1743 lines
1.6 MiB
JavaScript
1743 lines
1.6 MiB
JavaScript
|
|
var Tb=Object.defineProperty;var Ab=(t,e,n)=>e in t?Tb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Sn=(t,e,n)=>(Ab(t,typeof e!="symbol"?e+"":e,n),n);function Mb(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in t)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const h of l.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();/**
|
|||
|
|
* @vue/shared v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**//*! #__NO_SIDE_EFFECTS__ */function Jp(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const En={},gs=[],Fi=()=>{},G4=()=>!1,jc=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Qp=t=>t.startsWith("onUpdate:"),wr=Object.assign,ef=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Cb=Object.prototype.hasOwnProperty,dn=(t,e)=>Cb.call(t,e),Ft=Array.isArray,vs=t=>$c(t)==="[object Map]",K4=t=>$c(t)==="[object Set]",Vt=t=>typeof t=="function",nr=t=>typeof t=="string",Eo=t=>typeof t=="symbol",Wn=t=>t!==null&&typeof t=="object",X4=t=>(Wn(t)||Vt(t))&&Vt(t.then)&&Vt(t.catch),Z4=Object.prototype.toString,$c=t=>Z4.call(t),Lb=t=>$c(t).slice(8,-1),Y4=t=>$c(t)==="[object Object]",tf=t=>nr(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,_l=Jp(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Uc=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},_b=/-(\w)/g,mo=Uc(t=>t.replace(_b,(e,n)=>n?n.toUpperCase():"")),Nb=/\B([A-Z])/g,To=Uc(t=>t.replace(Nb,"-$1").toLowerCase()),J4=Uc(t=>t.charAt(0).toUpperCase()+t.slice(1)),Gd=Uc(t=>t?`on${J4(t)}`:""),fo=(t,e)=>!Object.is(t,e),V0=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},Q4=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},Xh=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let X1;const Vc=()=>X1||(X1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ts(t){if(Ft(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],a=nr(r)?Ib(r):Ts(r);if(a)for(const l in a)e[l]=a[l]}return e}else if(nr(t)||Wn(t))return t}const Db=/;(?![^(]*\))/g,Rb=/:([^]+)/,Ob=/\/\*[^]*?\*\//g;function Ib(t){const e={};return t.replace(Ob,"").split(Db).forEach(n=>{if(n){const r=n.split(Rb);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Xo(t){let e="";if(nr(t))e=t;else if(Ft(t))for(let n=0;n<t.length;n++){const r=Xo(t[n]);r&&(e+=r+" ")}else if(Wn(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Hb="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Pb=Jp(Hb);function ev(t){return!!t||t===""}const tv=t=>!!(t&&t.__v_isRef===!0),Qi=t=>nr(t)?t:t==null?"":Ft(t)||Wn(t)&&(t.toString===Z4||!Vt(t.toString))?tv(t)?Qi(t.value):JSON.stringify(t,nv,2):String(t),nv=(t,e)=>tv(e)?nv(t,e.value):vs(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,a],l)=>(n[Kd(r,l)+" =>"]=a,n),{})}:K4(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Kd(n))}:Eo(e)?Kd(e):Wn(e)&&!Ft(e)&&!Y4(e)?String(e):e,Kd=(t,e="")=>{var n;return Eo(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
|
|||
|
|
* @vue/reactivity v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let qr;class zb{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=qr,!e&&qr&&(this.index=(qr.scopes||(qr.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=qr;try{return qr=this,e()}finally{qr=n}}}on(){++this._on===1&&(this.prevScope=qr,qr=this)}off(){this._on>0&&--this._on===0&&(qr=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const a=this.parent.scopes.pop();a&&a!==this&&(this.parent.scopes[this.index]=a,a.index=this.index)}this.parent=void 0}}}function Bb(){return qr}let _n;const Xd=new WeakSet;class rv{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,qr&&qr.active&&qr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Xd.has(this)&&(Xd.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||av(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Z1(this),ov(this);const e=_n,n=qi;_n=this,qi=!0;try{return this.fn()}finally{sv(this),_n=e,qi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)af(e);this.deps=this.depsTail=void 0,Z1(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Xd.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Zh(this)&&this.run()}get dirty(){return Zh(this)}}let iv=0,Nl,Dl;function av(t,e=!1){if(t.flags|=8,e){t.next=Dl,Dl=t;return}t.next=Nl,Nl=t}function nf(){iv++}function rf(){if(--iv>0)return;if(Dl){let e=Dl;for(Dl=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Nl;){let e=Nl;for(Nl=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function ov(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function sv(t){let e,n=t.depsTail,r=n;for(;r;){const a=r.prevDep;r.version===-1?(r===n&&(n=a),af(r),Fb(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=a}t.deps=e,t.depsTail=n}function Zh(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(lv(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function lv(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===jl)||(t.globalVersion=jl,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Zh(t))))return;t.flags|=2;const e=t.dep,n=_n,r=qi;_n=t,qi=!0;try{ov(t);const a=t.fn(t._value);(e.version===0||fo(a,t._value))&&(t.flags|=128,t._value=a,e.version++)}catch(a){throw e.version++,a}finally{_n=n,qi=r,sv(t),t.flags&=-3}}function af(t,e=!1){const{dep:n,prevSub:r,nextSub:a}=t;if(r&&(r.nextSub=a,t.prevSub=void 0),a&&(a.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)af(l,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Fb(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let qi=!0;const cv=[];function $a(){cv.push(qi),qi=!1}function Ua(){const t=cv.pop();qi=t===void 0?!0:t}function Z1(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=_n;_n=void 0;try{e()}finally{_n=n}}}let jl=0;class qb{constructor(e,n){this.sub=e,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 Jl(t,e,n,r){try{return r?t(...r):t()}catch(a){Gc(a,e,n)}}function la(t,e,n,r){if(Vt(t)){const a=Jl(t,e,n,r);return a&&X4(a)&&a.catch(l=>{Gc(l,e,n)}),a}if(Ft(t)){const a=[];for(let l=0;l<t.length;l++)a.push(la(t[l],e,n,r));return a}}function Gc(t,e,n,r=!0){const a=e?e.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:h}=e&&e.appContext.config||En;if(e){let c=e.parent;const p=e.proxy,v=`https://vuejs.org/error-reference/#runtime-${n}`;for(;c;){const b=c.ec;if(b){for(let g=0;g<b.length;g++)if(b[g](t,p,v)===!1)return}c=c.parent}if(l){$a(),Jl(l,null,10,[t,p,v]),Ua();return}}f5(t,n,a,r,h)}function f5(t,e,n,r=!0,a=!1){if(a)throw t;console.error(t)}const Lr=[];let Ji=-1;const ys=[];let lo=null,hs=0;const yv=Promise.resolve();let uc=null;function Ma(t){const e=uc||yv;return t?e.then(this?t.bind(this):t):e}function m5(t){let e=Ji+1,n=Lr.length;for(;e<n;){const r=e+n>>>1,a=Lr[r],l=Ul(a);l<t||l===t&&a.flags&2?e=r+1:n=r}return e}function df(t){if(!(t.flags&1)){const e=Ul(t),n=Lr[Lr.length-1];!n||!(t.flags&2)&&e>=Ul(n)?Lr.push(t):Lr.splice(m5(e),0,t),t.flags|=1,wv()}}function wv(){uc||(uc=yv.then(kv))}function g5(t){Ft(t)?ys.push(...t):lo&&t.id===-1?lo.splice(hs+1,0,t):t.flags&1||(ys.push(t),t.flags|=1),wv()}function J1(t,e,n=Ji+1){for(;n<Lr.length;n++){const r=Lr[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;Lr.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function xv(t){if(ys.length){const e=[...new Set(ys)].sort((n,r)=>Ul(n)-Ul(r));if(ys.length=0,lo){lo.push(...e);return}for(lo=e,hs=0;hs<lo.length;hs++){const n=lo[hs];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}lo=null,hs=0}}const Ul=t=>t.id==null?t.flags&2?-1:1/0:t.id;function kv(t){const e=Fi;try{for(Ji=0;Ji<Lr.length;Ji++){const n=Lr[Ji];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),Jl(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;Ji<Lr.length;Ji++){const n=Lr[Ji];n&&(n.flags&=-2)}Ji=-1,Lr.length=0,xv(),uc=null,(Lr.length||ys.length)&&kv()}}let fi=null,Sv=null;function dc(t){const e=fi;return fi=t,Sv=t&&t.type.__scopeId||null,e}function v5(t,e=fi,n){if(!e||t._n)return t;const r=(...a)=>{r._d&&om(-1);const l=dc(e);let h;try{h=t(...a)}finally{dc(l),r._d&&om(1)}return h};return r._n=!0,r._c=!0,r._d=!0,r}function ep(t,e){if(fi===null)return t;const n=Jc(fi),r=t.dirs||(t.dirs=[]);for(let a=0;a<e.length;a++){let[l,h,c,p=En]=e[a];l&&(Vt(l)&&(l={mounted:l,updated:l}),l.deep&&Da(h),r.push({dir:l,instance:n,value:h,oldValue:void 0,arg:c,modifiers:p}))}return t}function zo(t,e,n,r){const a=t.dirs,l=e&&e.dirs;for(let h=0;h<a.length;h++){const c=a[h];l&&(c.oldValue=l[h].value);let p=c.dir[r];p&&($a(),la(p,n,8,[t.el,c,t,e]),Ua())}}const b5=Symbol("_vte"),y5=t=>t.__isTeleport,w5=Symbol("_leaveCb");function hf(t,e){t.shapeFlag&6&&t.component?(t.transition=e,hf(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Ev(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Rl(t,e,n,r,a=!1){if(Ft(t)){t.forEach((w,S)=>Rl(w,e&&(Ft(e)?e[S]:e),n,r,a));return}if(Ol(r)&&!a){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Rl(t,e,n,r.component.subTree);return}const l=r.shapeFlag&4?Jc(r.component):r.el,h=a?null:l,{i:c,r:p}=t,v=e&&e.r,b=c.refs===En?c.refs={}:c.refs,g=c.setupState,m=un(g),x=g===En?G4:w=>dn(m,w);if(v!=null&&v!==p){if(nr(v))b[v]=null,x(v)&&(g[v]=null);else if(Sr(v)){v.value=null;const w=e;w.k&&(b[w.k]=null)}}if(Vt(p))Jl(p,c,12,[h,b]);else{const w=nr(p),S=Sr(p);if(w||S){const k=()=>{if(t.f){const C=w?x(p)?g[p]:b[p]:p.value;if(a)Ft(C)&&ef(C,l);else if(Ft(C))C.includes(l)||C.push(l);else if(w)b[p]=[l],x(p)&&(g[p]=b[p]);else{const A=[l];p.value=A,t.k&&(b[t.k]=A)}}else w?(b[p]=h,x(p)&&(g[p]=h)):S&&(p.value=h,t.k&&(b[t.k]=h))};h?(k.id=-1,ti(k,n)):k()}}}Vc().requestIdleCallback;Vc().cancelIdleCallback;const Ol=t=>!!t.type.__asyncLoader,Tv=t=>t.type.__isKeepAlive;function x5(t,e){Av(t,"a",e)}function k5(t,e){Av(t,"da",e)}function Av(t,e,n=_r){const r=t.__wdc||(t.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.p
|
|||
|
|
* @vue/runtime-dom v3.5.20
|
|||
|
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|||
|
|
* @license MIT
|
|||
|
|
**/let op;const dm=typeof window<"u"&&window.trustedTypes;if(dm)try{op=dm.createPolicy("vue",{createHTML:t=>t})}catch{}const Xv=op?t=>op.createHTML(t):t=>t,Ey="http://www.w3.org/2000/svg",Ty="http://www.w3.org/1998/Math/MathML",Ca=typeof document<"u"?document:null,hm=Ca&&Ca.createElement("template"),Ay={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const a=e==="svg"?Ca.createElementNS(Ey,t):e==="mathml"?Ca.createElementNS(Ty,t):n?Ca.createElement(t,{is:n}):Ca.createElement(t);return t==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:t=>Ca.createTextNode(t),createComment:t=>Ca.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Ca.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,a,l){const h=n?n.previousSibling:e.lastChild;if(a&&(a===l||a.nextSibling))for(;e.insertBefore(a.cloneNode(!0),n),!(a===l||!(a=a.nextSibling)););else{hm.innerHTML=Xv(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const c=hm.content;if(r==="svg"||r==="mathml"){const p=c.firstChild;for(;p.firstChild;)c.appendChild(p.firstChild);c.removeChild(p)}e.insertBefore(c,n)}return[h?h.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},My=Symbol("_vtc");function Cy(t,e,n){const r=t[My];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const fc=Symbol("_vod"),Zv=Symbol("_vsh"),Ly={name:"show",beforeMount(t,{value:e},{transition:n}){t[fc]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):dl(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),dl(t,!0),r.enter(t)):r.leave(t,()=>{dl(t,!1)}):dl(t,e))},beforeUnmount(t,{value:e}){dl(t,e)}};function dl(t,e){t.style.display=e?t[fc]:"none",t[Zv]=!e}const _y=Symbol(""),Ny=/(^|;)\s*display\s*:/;function Dy(t,e,n){const r=t.style,a=nr(n);let l=!1;if(n&&!a){if(e)if(nr(e))for(const h of e.split(";")){const c=h.slice(0,h.indexOf(":")).trim();n[c]==null&&X0(r,c,"")}else for(const h in e)n[h]==null&&X0(r,h,"");for(const h in n)h==="display"&&(l=!0),X0(r,h,n[h])}else if(a){if(e!==n){const h=r[_y];h&&(n+=";"+h),r.cssText=n,l=Ny.test(n)}}else e&&t.removeAttribute("style");fc in t&&(t[fc]=l?r.display:"",t[Zv]&&(r.display="none"))}const pm=/\s*!important$/;function X0(t,e,n){if(Ft(n))n.forEach(r=>X0(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=Ry(t,e);pm.test(n)?t.setProperty(To(r),n.replace(pm,""),"important"):t[r]=n}}const fm=["Webkit","Moz","ms"],th={};function Ry(t,e){const n=th[e];if(n)return n;let r=mo(e);if(r!=="filter"&&r in t)return th[e]=r;r=J4(r);for(let a=0;a<fm.length;a++){const l=fm[a]+r;if(l in t)return th[e]=l}return e}const mm="http://www.w3.org/1999/xlink";function gm(t,e,n,r,a,l=Pb(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(mm,e.slice(6,e.length)):t.setAttributeNS(mm,e,n):n==null||l&&!ev(n)?t.removeAttribute(e):t.setAttribute(e,l?"":Eo(n)?String(n):n)}function vm(t,e,n,r,a){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?Xv(n):n);return}const l=t.tagName;if(e==="value"&&l!=="PROGRESS"&&!l.includes("-")){const c=l==="OPTION"?t.getAttribute("value")||"":t.value,p=n==null?t.type==="checkbox"?"on":"":String(n);(c!==p||!("_value"in t))&&(t.value=p),n==null&&t.removeAttribute(e),t._value=n;return}let h=!1;if(n===""||n==null){const c=typeof t[e];c==="boolean"?n=ev(n):n==null&&c==="string"?(n="",h=!0):c==="number"&&(n=0,h=!0)}try{t[e]=n}catch{}h&&t.removeAttribute(a||e)}function ps(t,e,n,r){t.addEventListener(e,n,r)}function Oy(t,e,n,r){t.removeEventListener(e,n,r)}const bm=Symbol("_vei");function Iy(t,e,n,r,a=null){const l=t[bm]||(t[bm]={}),h=l[e];if(r&&h)h.value=r;else{const[c,p]=Hy(e);if(r){const v=l[e]=By(r,a);ps(t,c,v,p)}else h&&(Oy(t,c,h,p),l[e]=void 0)}}const ym=/(?:Once|Passive|Capture)$/;function Hy(t
|
|||
|
|
* Vditor v3.11.2 - A markdown editor written in TypeScript.
|
|||
|
|
*
|
|||
|
|
* MIT License
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2018-present B3log 开源, b3log.org
|
|||
|
|
*
|
|||
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|||
|
|
* in the Software without restriction, including without limitation the rights
|
|||
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|||
|
|
* furnished to do so, subject to the following conditions:
|
|||
|
|
*
|
|||
|
|
* The above copyright notice and this permission notice shall be included in all
|
|||
|
|
* copies or substantial portions of the Software.
|
|||
|
|
*
|
|||
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
|
|
* SOFTWARE.
|
|||
|
|
*
|
|||
|
|
*/(function(t,e){(function(r,a){t.exports=a()})(lp,function(){return(()=>{var n={173:h=>{var c=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},p=-1,v=1,b=0;c.Diff=function(g,m){return[g,m]},c.prototype.diff_main=function(g,m,x,w){typeof w>"u"&&(this.Diff_Timeout<=0?w=Number.MAX_VALUE:w=new Date().getTime()+this.Diff_Timeout*1e3);var S=w;if(g==null||m==null)throw new Error("Null input. (diff_main)");if(g==m)return g?[new c.Diff(b,g)]:[];typeof x>"u"&&(x=!0);var k=x,C=this.diff_commonPrefix(g,m),A=g.substring(0,C);g=g.substring(C),m=m.substring(C),C=this.diff_commonSuffix(g,m);var T=g.substring(g.length-C);g=g.substring(0,g.length-C),m=m.substring(0,m.length-C);var M=this.diff_compute_(g,m,k,S);return A&&M.unshift(new c.Diff(b,A)),T&&M.push(new c.Diff(b,T)),this.diff_cleanupMerge(M),M},c.prototype.diff_compute_=function(g,m,x,w){var S;if(!g)return[new c.Diff(v,m)];if(!m)return[new c.Diff(p,g)];var k=g.length>m.length?g:m,C=g.length>m.length?m:g,A=k.indexOf(C);if(A!=-1)return S=[new c.Diff(v,k.substring(0,A)),new c.Diff(b,C),new c.Diff(v,k.substring(A+C.length))],g.length>m.length&&(S[0][0]=S[2][0]=p),S;if(C.length==1)return[new c.Diff(p,g),new c.Diff(v,m)];var T=this.diff_halfMatch_(g,m);if(T){var M=T[0],y=T[1],N=T[2],z=T[3],q=T[4],P=this.diff_main(M,N,x,w),Y=this.diff_main(y,z,x,w);return P.concat([new c.Diff(b,q)],Y)}return x&&g.length>100&&m.length>100?this.diff_lineMode_(g,m,w):this.diff_bisect_(g,m,w)},c.prototype.diff_lineMode_=function(g,m,x){var w=this.diff_linesToChars_(g,m);g=w.chars1,m=w.chars2;var S=w.lineArray,k=this.diff_main(g,m,!1,x);this.diff_charsToLines_(k,S),this.diff_cleanupSemantic(k),k.push(new c.Diff(b,""));for(var C=0,A=0,T=0,M="",y="";C<k.length;){switch(k[C][0]){case v:T++,y+=k[C][1];break;case p:A++,M+=k[C][1];break;case b:if(A>=1&&T>=1){k.splice(C-A-T,A+T),C=C-A-T;for(var N=this.diff_main(M,y,!1,x),z=N.length-1;z>=0;z--)k.splice(C,0,N[z]);C=C+N.length}T=0,A=0,M="",y="";break}C++}return k.pop(),k},c.prototype.diff_bisect_=function(g,m,x){for(var w=g.length,S=m.length,k=Math.ceil((w+S)/2),C=k,A=2*k,T=new Array(A),M=new Array(A),y=0;y<A;y++)T[y]=-1,M[y]=-1;T[C+1]=0,M[C+1]=0;for(var N=w-S,z=N%2!=0,q=0,P=0,Y=0,te=0,ue=0;ue<k&&!(new Date().getTime()>x);ue++){for(var Le=-ue+q;Le<=ue-P;Le+=2){var qe=C+Le,Xe;Le==-ue||Le!=ue&&T[qe-1]<T[qe+1]?Xe=T[qe+1]:Xe=T[qe-1]+1;for(var it=Xe-Le;Xe<w&&it<S&&g.charAt(Xe)==m.charAt(it);)Xe++,it++;if(T[qe]=Xe,Xe>w)P+=2;else if(it>S)q+=2;else if(z){var $e=C+N-Le;if($e>=0&&$e<A&&M[$e]!=-1){var De=w-M[$e];if(Xe>=De)return this.diff_bisectSplit_(g,m,Xe,it,x)}}}for(var nt=-ue+Y;nt<=ue-te;nt+=2){var $e=C+nt,De;nt==-ue||nt!=ue&&M[$e-1]<M[$e+1]?De=M[$e+1]:De=M[$e-1]+1;for(var ut=De-nt;De<w&&ut<S&&g.charAt(w-De-1)==m.charAt(S-ut-1);)De++,ut++;if(M[$e]=De,De>w)te+=2;else if(ut>S)Y+=2;else if(!z){var qe=C+N-nt;if(qe>=0&&qe<A&&T[qe]!=-1){var Xe=T[qe],it=C+Xe-qe;if(De=w-De,Xe>=De)return this.diff_bisectSplit_(g,m,Xe,it,x)}}}}return[new c.Diff(p,g),new c.Diff(v,m)]},c.prototype.diff_bisectSplit_=function(g,m,x,w,S){var k=g.substring(0,x),C=m.substring(0,w),A=g.substring(x),T=m.substring(w),M=this.diff_main(k,C,!1,S),y=this.diff_main(A,T,!1,S);return M.concat(y)},c.prototype.diff_linesToChars_=function(g,m){var x=[],w={};x[0]="";function S(T){for(var M="",y=0,N=-1,z=x.length;N<T.length-1;){N=T.indexOf(`
|
|||
|
|
`,y),N==-1&&(N=T.length-1);var q=T.substring(y,N+1);(w.hasOwnProperty?w.hasOwnProperty(q):w[q]!==void 0)?M+=String.fromCharCode(w[q]):(z==k&&(q=T.substring(y),N=T.length),M+=String.fromCharCode(z),w[q]=z,x[z++]=q),y=N+1}return M}var k=4e4,C=S(g);k=65535;var A=S(m);return{chars1:C,chars2:A,lineArray:x}},c.prototype.diff_charsToLines_=function(g,m){for(var x=0;x<g.length;x++){for(var w=g[x][1],S=[],k=0;k<w.length;k++)S[k]=m[w.charCodeAt(k)];g[x][1]=S.join("")}},c.prototype.diff_commonPrefix=function(g,m){if(!g||!m||g.charAt(0)!=m.charAt(0))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(k,S)==m.substring(k,S)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonSuffix=function(g,m){if(!g||!m||g.charAt(g.length-1)!=m.charAt(m.length-1))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(g.length-S,g.length-k)==m.substring(m.length-S,m.length-k)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonOverlap_=function(g,m){var x=g.length,w=m.length;if(x==0||w==0)return 0;x>w?g=g.substring(x-w):x<w&&(m=m.substring(0,x));var S=Math.min(x,w);if(g==m)return S;for(var k=0,C=1;;){var A=g.substring(S-C),T=m.indexOf(A);if(T==-1)return k;C+=T,(T==0||g.substring(S-C)==m.substring(0,C))&&(k=C,C++)}},c.prototype.diff_halfMatch_=function(g,m){if(this.Diff_Timeout<=0)return null;var x=g.length>m.length?g:m,w=g.length>m.length?m:g;if(x.length<4||w.length*2<x.length)return null;var S=this;function k(P,Y,te){for(var ue=P.substring(te,te+Math.floor(P.length/4)),Le=-1,qe="",Xe,it,$e,De;(Le=Y.indexOf(ue,Le+1))!=-1;){var nt=S.diff_commonPrefix(P.substring(te),Y.substring(Le)),ut=S.diff_commonSuffix(P.substring(0,te),Y.substring(0,Le));qe.length<ut+nt&&(qe=Y.substring(Le-ut,Le)+Y.substring(Le,Le+nt),Xe=P.substring(0,te-ut),it=P.substring(te+nt),$e=Y.substring(0,Le-ut),De=Y.substring(Le+nt))}return qe.length*2>=P.length?[Xe,it,$e,De,qe]:null}var C=k(x,w,Math.ceil(x.length/4)),A=k(x,w,Math.ceil(x.length/2)),T;if(!C&&!A)return null;A?C?T=C[4].length>A[4].length?C:A:T=A:T=C;var M,y,N,z;g.length>m.length?(M=T[0],y=T[1],N=T[2],z=T[3]):(N=T[0],z=T[1],M=T[2],y=T[3]);var q=T[4];return[M,y,N,z,q]},c.prototype.diff_cleanupSemantic=function(g){for(var m=!1,x=[],w=0,S=null,k=0,C=0,A=0,T=0,M=0;k<g.length;)g[k][0]==b?(x[w++]=k,C=T,A=M,T=0,M=0,S=g[k][1]):(g[k][0]==v?T+=g[k][1].length:M+=g[k][1].length,S&&S.length<=Math.max(C,A)&&S.length<=Math.max(T,M)&&(g.splice(x[w-1],0,new c.Diff(p,S)),g[x[w-1]+1][0]=v,w--,w--,k=w>0?x[w-1]:-1,C=0,A=0,T=0,M=0,S=null,m=!0)),k++;for(m&&this.diff_cleanupMerge(g),this.diff_cleanupSemanticLossless(g),k=1;k<g.length;){if(g[k-1][0]==p&&g[k][0]==v){var y=g[k-1][1],N=g[k][1],z=this.diff_commonOverlap_(y,N),q=this.diff_commonOverlap_(N,y);z>=q?(z>=y.length/2||z>=N.length/2)&&(g.splice(k,0,new c.Diff(b,N.substring(0,z))),g[k-1][1]=y.substring(0,y.length-z),g[k+1][1]=N.substring(z),k++):(q>=y.length/2||q>=N.length/2)&&(g.splice(k,0,new c.Diff(b,y.substring(0,q))),g[k-1][0]=v,g[k-1][1]=N.substring(0,N.length-q),g[k+1][0]=p,g[k+1][1]=y.substring(q),k++),k++}k++}},c.prototype.diff_cleanupSemanticLossless=function(g){function m(q,P){if(!q||!P)return 6;var Y=q.charAt(q.length-1),te=P.charAt(0),ue=Y.match(c.nonAlphaNumericRegex_),Le=te.match(c.nonAlphaNumericRegex_),qe=ue&&Y.match(c.whitespaceRegex_),Xe=Le&&te.match(c.whitespaceRegex_),it=qe&&Y.match(c.linebreakRegex_),$e=Xe&&te.match(c.linebreakRegex_),De=it&&q.match(c.blanklineEndRegex_),nt=$e&&P.match(c.blanklineStartRegex_);return De||nt?5:it||$e?4:ue&&!qe&&Xe?3:qe||Xe?2:ue||Le?1:0}for(var x=1;x<g.length-1;){if(g[x-1][0]==b&&g[x+1][0]==b){var w=g[x-1][1],S=g[x][1],k=g[x+1][1],C=this.diff_commonSuffix(w,S);if(C){var A=S.substring(S.length-C);w=w.substring(0,w.length-C),S=A+S.substring(0,S.length-C),k=A+k}for(var T=w,M=S,y=k,N=m(w,S)+m(S,k);S.charAt(0)===k.charAt(0);){w+=S.charAt(0),S=S.substring(1)+k.charAt(0),k=k.substring(1);var z=m(w,S)+m(S,k);z>=N&&(N=z,T=w,M=S,y=k)}g[x-1][1]!=T&&(T?g[x-1][1]=T:(g.splice(x-1,1),x--),g[x][1]=M,y?g[x+1][1]=y:(g.splice(x+1,1),x--))}x++}},c.nonAlphaNumericRegex_=/[^a-zA-Z0-
|
|||
|
|
`),w=0,S=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;w<x.length;){var k=x[w].match(S);if(!k)throw new Error("Invalid patch string: "+x[w]);var C=new c.patch_obj;for(m.push(C),C.start1=parseInt(k[1],10),k[2]===""?(C.start1--,C.length1=1):k[2]=="0"?C.length1=0:(C.start1--,C.length1=parseInt(k[2],10)),C.start2=parseInt(k[3],10),k[4]===""?(C.start2--,C.length2=1):k[4]=="0"?C.length2=0:(C.start2--,C.length2=parseInt(k[4],10)),w++;w<x.length;){var A=x[w].charAt(0);try{var T=decodeURI(x[w].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+T)}if(A=="-")C.diffs.push(new c.Diff(p,T));else if(A=="+")C.diffs.push(new c.Diff(v,T));else if(A==" ")C.diffs.push(new c.Diff(b,T));else{if(A=="@")break;if(A!=="")throw new Error('Invalid patch mode "'+A+'" in: '+T)}w++}}return m},c.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},c.patch_obj.prototype.toString=function(){var g,m;this.length1===0?g=this.start1+",0":this.length1==1?g=this.start1+1:g=this.start1+1+","+this.length1,this.length2===0?m=this.start2+",0":this.length2==1?m=this.start2+1:m=this.start2+1+","+this.length2;for(var x=["@@ -"+g+" +"+m+` @@
|
|||
|
|
`],w,S=0;S<this.diffs.length;S++){switch(this.diffs[S][0]){case v:w="+";break;case p:w="-";break;case b:w=" ";break}x[S+1]=w+encodeURI(this.diffs[S][1])+`
|
|||
|
|
`}return x.join("").replace(/%20/g," ")},h.exports=c,h.exports.diff_match_patch=c,h.exports.DIFF_DELETE=p,h.exports.DIFF_INSERT=v,h.exports.DIFF_EQUAL=b},408:(h,c,p)=>{p.d(c,{default:()=>Mt});var v=p(135),b=p(840),g=p(775),m=p(428),x=p(325),w=p(483),S=p(999),k=function(se){se===void 0&&(se=document);var fe=function(J){var Q=document.createElement("img");Q.src=J.getAttribute("data-src"),Q.addEventListener("load",function(){!J.getAttribute("style")&&!J.getAttribute("class")&&!J.getAttribute("width")&&!J.getAttribute("height")&&Q.naturalHeight>Q.naturalWidth&&Q.naturalWidth/Q.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&Q.naturalHeight>window.innerHeight-40&&(J.style.height=window.innerHeight-40+"px"),J.src=Q.src}),J.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return se.querySelectorAll("img").forEach(function(J){J.getAttribute("data-src")&&fe(J)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),se.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(J){J.forEach(function(Q){(typeof Q.isIntersecting>"u"?Q.intersectionRatio!==0:Q.isIntersecting)&&Q.target.getAttribute("data-src")&&fe(Q.target)})}),se.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)}))},C=p(472),A=p(280),T=p(637),M=p(825),y=p(11),N=p(194),z=p(436),q=p(229),P=p(145),Y=p(538),te=p(413),ue=p(106),Le=p(673),qe=function(se){document.querySelectorAll(".vditor-anchor").forEach(function(fe){se===1&&fe.classList.add("vditor-anchor--left"),fe.onclick=function(){var J=fe.getAttribute("href").substr(1),Q=document.getElementById("vditorAnchor-"+J).offsetTop;document.querySelector("html").scrollTop=Q}}),window.onhashchange=function(){var fe=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));fe&&(document.querySelector("html").scrollTop=fe.offsetTop)}},Xe=p(214),it=p(810),$e=function(se,fe){if(fe===void 0&&(fe="zh_CN"),!(typeof speechSynthesis>"u"||typeof SpeechSynthesisUtterance>"u")){var J=function(){var ge=speechSynthesis.getVoices(),ce,ve;return ge.forEach(function(Ee){Ee.lang===fe.replace("_","-")&&(ce=Ee),Ee.default&&(ve=Ee)}),ce||(ce=ve),ce},Q='<svg><use xlink:href="#vditor-icon-play"></use></svg>',Ie='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(Q='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',Ie='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var de=document.querySelector(".vditor-speech");de||(de=document.createElement("button"),de.className="vditor-speech",se.insertAdjacentElement("beforeend",de),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=J));var W=J(),Z=new SpeechSynthesisUtterance;Z.voice=W,Z.onend=Z.onerror=function(){de.style.display="none",speechSynthesis.cancel(),de.classList.remove("vditor-speech--current"),de.innerHTML=Q},se.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(ge){var ce=ge.target;if(ce.classList.contains("vditor-speech")||ce.parentElement.classList.contains("vditor-speech")){de.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),de.innerHTML=Ie):(speechSynthesis.pause(),de.innerHTML=Q)):(Z.text=de.getAttribute("data-text"),speechSynthesis.speak(Z),de.classList.add("vditor-speech--current"),de.innerHTML=Ie),(0,it.Hc)(window.vditorSpeechRange),se.focus();return}if(de.style.display="none",speechSynthesis.cancel(),de.classList.remove("vditor-speech--current"),de.innerHTML=Q,getSelection().rangeCount!==0){var ve=getSelection().getRangeAt(0),Ee=ve.toString().trim();if(Ee){window.vditorSpeechRange=ve.cloneRange();var ze=ve.getBoundingClientRect();de.innerHTML=Q,de.style.display="block",de.style.top=ze.top+ze.height+document.querySelector("html").scrollT
|
|||
|
|
`)&&(A=A.substr(0,A.length-1));var M='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(M='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var y=document.createElement("div");y.className="vditor-copy",y.innerHTML='<span aria-label="'.concat(((S=window.VditorI18n)===null||S===void 0?void 0:S.copy)||"复制",`"
|
|||
|
|
onmouseover="this.setAttribute('aria-label', '`).concat(((k=window.VditorI18n)===null||k===void 0?void 0:k.copy)||"复制",`')"
|
|||
|
|
class="vditor-tooltipped vditor-tooltipped__w"
|
|||
|
|
onclick="event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`).concat(((C=window.VditorI18n)===null||C===void 0?void 0:C.copied)||"已复制",`');this.previousElementSibling.blur()">`).concat(M,"</span>");var N=document.createElement("textarea");N.value=(0,v.X)(A),y.insertAdjacentElement("afterbegin",N),x&&x.renderMenu&&x.renderMenu(w,y),w.before(y),w.style.maxHeight=window.outerHeight-40+"px",w.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(b.g.ZWSP,"</span>"))})}},325:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.flowchartRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){S.forEach(function(k){if(k.getAttribute("data-processed")!=="true"){var C=flowchart.parse(g.flowchartRenderAdapter.getCode(k));k.innerHTML="",C.drawSVG(k),k.setAttribute("data-processed","true")}})})}},483:(h,c,p)=>{p.d(c,{v:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.graphvizRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){S.forEach(function(k){var C=g.graphvizRenderAdapter.getCode(k);if(!(k.parentElement.classList.contains("vditor-wysiwyg__pre")||k.parentElement.classList.contains("vditor-ir__marker--pre"))&&!(k.getAttribute("data-processed")==="true"||C.trim()==="")){try{var A=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),T=window.URL||window.webkitURL,M=T.createObjectURL(A),y=new Worker(M);new Viz({worker:y}).renderSVGElement(C).then(function(N){k.innerHTML=N.outerHTML}).catch(function(N){k.innerHTML="graphviz render error: <br>".concat(N),k.className="vditor-reset--error"})}catch(N){console.error("graphviz error",N)}k.setAttribute("data-processed","true")}})})}},999:(h,c,p)=>{p.d(c,{s:()=>m});var v=p(145),b=p(413),g=p(290),m=function(x,w,S){w===void 0&&(w=document),S===void 0&&(S=v.g.CDN);var k=x.style;v.g.CODE_THEME.includes(k)||(k="github");var C=document.getElementById("vditorHljsStyle"),A="".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css");if(C&&C.getAttribute("href")!==A&&C.remove(),(0,g.c)("".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css"),"vditorHljsStyle"),x.enable!==!1){var T=w.querySelectorAll("pre > code");T.length!==0&&(0,b.G)("".concat(S,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,b.G)("".concat(S,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){w.querySelectorAll("pre > code").forEach(function(M){if(!(M.parentElement.classList.contains("vditor-ir__marker--pre")||M.parentElement.classList.contains("vditor-wysiwyg__pre"))&&!(M.classList.contains("language-mermaid")||M.classList.contains("language-flowchart")||M.classList.contains("language-echarts")||M.classList.contains("language-mindmap")||M.classList.contains("language-plantuml")||M.classList.contains("language-smiles")||M.classList.contains("language-abc")||M.classList.contains("language-graphviz")||M.classList.contains("language-math"))){x.defaultLang!==""&&M.className.indexOf("language-")===-1&&M.classList.add("language-"+x.defaultLang);var y=M.className.replace("language-","");if(window.hljs.getLanguage(y)||(y="plaintext"),M.innerHTML=window.hljs.highlight(M.textContent,{language:y,ignoreIllegals:!0}).value,M.classList.add("hljs"),!!x.lineNumber){M.classList.add("vditor-linenumber");var N=M.querySelector(".vditor-linenumber__temp");N||(N=document.createElement("div"),N.className="vditor-linenumber__temp",M.insertAdjacentElement("beforeend",N));var z=getComputedStyle(M).whiteSpace,q=!1;(z==="pre-wrap"||z==="pre-line")&&(q=!0);var P="",Y=M.textContent.split(/\r\n|\r|\n/g);Y.pop(),Y.map(function(te){var ue="";q&&(N.textContent=te||`
|
|||
|
|
`,ue=' style="height:'.concat(N.getBoundingClientRect().height,'px"')),P+="<span".concat(ue,"></span>")}),N.style.display="none",P='<span class="vditor-linenumber__rows">'.concat(P,"</span>"),M.insertAdjacentHTML("beforeend",P)}}})})})}}},11:(h,c,p)=>{p.d(c,{K:()=>S});var v=p(145),b=p(413),g=p(840),m={},x=function(k,C){var A=k.transform(C),T=Object.keys(A.features).filter(function(q){return!m[q]});T.forEach(function(q){m[q]=!0});var M=k.getAssets(T),y=M.styles,N=M.scripts,z=window.markmap;return y&&z.loadCSS(y),N&&z.loadJS(N),A},w=function(k,C){var A=window.markmap,T=A.Transformer,M=A.Markmap,y=A.deriveOptions;A.globalCSS;var N=new T;k.innerHTML='<svg style="width:100%"></svg>';var z=k.firstChild,q=M.create(z,null),P=x(N,C),Y=P.root,te=P.frontmatter,ue=te==null?void 0:te.markmap,Le=y(ue);q.setData(Y,Le),q.fit()},S=function(k,C){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var A=g.markmapRenderAdapter.getElements(k);A.length!==0&&(0,b.G)("".concat(C,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){A.forEach(function(T){var M=g.markmapRenderAdapter.getCode(T);if(!(T.getAttribute("data-processed")==="true"||M.trim()==="")){var y=document.createElement("div");y.className="language-markmap",T.parentNode.appendChild(y),w(y,M),T.parentNode.childNodes[0].nodeName=="CODE"&&T.parentNode.removeChild(T.parentNode.childNodes[0])}})})}},472:(h,c,p)=>{p.d(c,{H:()=>w});var v=p(145),b=p(413),g=p(290),m=p(105),x=p(840),w=function(S,k){S===void 0&&(S=document);var C=x.mathRenderAdapter.getElements(S);if(C.length!==0){var A={cdn:v.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(k&&k.math&&(k.math=Object.assign({},A.math,k.math)),k=Object.assign({},A,k),k.math.engine==="KaTeX")(0,g.c)("".concat(k.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,b.G)("".concat(k.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,b.G)("".concat(k.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){C.forEach(function(y){if(!(y.parentElement.classList.contains("vditor-wysiwyg__pre")||y.parentElement.classList.contains("vditor-ir__marker--pre"))&&!y.getAttribute("data-math")){var N=(0,m.X)(x.mathRenderAdapter.getCode(y));y.setAttribute("data-math",N);try{y.innerHTML=katex.renderToString(N,{displayMode:y.tagName==="DIV",output:"html",macros:k.math.macros})}catch(z){y.innerHTML=z.message,y.className="language-math vditor-reset--error"}y.addEventListener("copy",function(z){z.stopPropagation(),z.preventDefault();var q=z.currentTarget.closest(".language-math");z.clipboardData.setData("text/html",q.innerHTML),z.clipboardData.setData("text/plain",q.getAttribute("data-math"))})}})})});else if(k.math.engine==="MathJax"){var T=function(y){if(y.length!==0){var N=0,z=y[y.length-1],q=function(){var P=y[N++];P===z?P():P(q)};q()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(k.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:k.math.macros}},Object.assign(window.MathJax,k.math.mathJaxOptions)),(0,b.J)("".concat(k.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var M=function(y,N){var z=(0,m.X)(y.textContent).trim(),q=window.MathJax.getMetricsFor(y);q.display=y.tagName==="DIV",window.MathJax.tex2svgPromise(z,q).then(function(P){y.innerHTML="",y.setAttribute("data-math",z),y.append(P),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var Y=P.querySelector('[data-mml-node="merror"]');Y&&Y.textContent.trim()!==""&&(y.innerHTML=Y.textContent.trim(),y.className="vditor-reset--error"),N&&N()})};window.MathJax.startup.promise.then(function(){for(var y=[],N=function(q){var P=C[q];!P.parentElement.classList.contains("vditor-wysiwyg__pre")&&!P.parentElement.classList.contains("vditor-ir__marker--pre")&&!P.getAttribute("data-math")&&(0,m.X)(P.textContent).trim()&&y.push(function(Y){q===C.length-1?M(P):M(P,Y)})},z=0;z<C.length;z++)N(z);T(y)})}}}},280:(h,c,p)=>{p.d(c,{Y:()=>x});var v=p(494),b=function(w,S){w.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(S,'"></
|
|||
|
|
src="//coub.com/embed/`.concat(T[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),w.remove();else if(M&&M[0])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.facebook.com/plugins/video.php?href=`.concat(encodeURIComponent(M[0]),'"></iframe>')),w.remove();else if(y&&y[2])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.dailymotion.com/embed/video/`.concat(y[2],'"></iframe>')),w.remove();else if(S.indexOf("bilibili.com")>-1&&(S.indexOf("bvid=")>-1||N&&N[1])){var q={bvid:(0,v.on)("bvid",S)||N&&N[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(S.startsWith("http")?S:"https:"+S).search.split("&").forEach(function(te,ue){if(te){ue===0&&(te=te.substr(1));var Le=te.split("=");q[Le[0]]=Le[1]}});var P="https://player.bilibili.com/player.html?",Y=Object.keys(q);Y.forEach(function(te,ue){P+="".concat(te,"=").concat(q[te]),ue<Y.length-1&&(P+="&")}),w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(P,'"></iframe>')),w.remove()}else z&&z[1]&&(w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(z[1],'"></iframe>')),w.remove())},x=function(w){w&&w.querySelectorAll("a").forEach(function(S){var k=S.getAttribute("href");k&&(k.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?b(S,k):k.match(/^.+.(mp3|wav|flac)$/)?g(S,k):m(S,k))})}},637:(h,c,p)=>{p.d(c,{i:()=>S});var v=p(145),b=p(413),g=p(840),m=p(494),x=function(k,C,A,T){function M(y){return y instanceof A?y:new A(function(N){N(y)})}return new(A||(A=Promise))(function(y,N){function z(Y){try{P(T.next(Y))}catch(te){N(te)}}function q(Y){try{P(T.throw(Y))}catch(te){N(te)}}function P(Y){Y.done?y(Y.value):M(Y.value).then(z,q)}P((T=T.apply(k,C||[])).next())})},w=function(k,C){var A={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},T,M,y,N;return N={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function z(P){return function(Y){return q([P,Y])}}function q(P){if(T)throw new TypeError("Generator is already executing.");for(;N&&(N=0,P[0]&&(A=0)),A;)try{if(T=1,M&&(y=P[0]&2?M.return:P[0]?M.throw||((y=M.return)&&y.call(M),0):M.next)&&!(y=y.call(M,P[1])).done)return y;switch(M=0,y&&(P=[P[0]&2,y.value]),P[0]){case 0:case 1:y=P;break;case 4:return A.label++,{value:P[1],done:!1};case 5:A.label++,M=P[1],P=[0];continue;case 7:P=A.ops.pop(),A.trys.pop();continue;default:if(y=A.trys,!(y=y.length>0&&y[y.length-1])&&(P[0]===6||P[0]===2)){A=0;continue}if(P[0]===3&&(!y||P[1]>y[0]&&P[1]<y[3])){A.label=P[1];break}if(P[0]===6&&A.label<y[1]){A.label=y[1],y=P;break}if(y&&A.label<y[2]){A.label=y[2],A.ops.push(P);break}y[2]&&A.ops.pop(),A.trys.pop();continue}P=C.call(k,A)}catch(Y){P=[6,Y],M=0}finally{T=y=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},S=function(k,C,A){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var T=g.mermaidRenderAdapter.getElements(k);T.length!==0&&(0,b.G)("".concat(C,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var M={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};A==="dark"&&(M.theme="dark"),mermaid.initialize(M),T.forEach(function(y){return x(void 0,void 0,void 0,function(){var N,z,q,P,Y;return w(this,function(te){switch(te.label){case 0:if(N=g.mermaidRenderAdapter.getCode(y),y.getAttribute("data-processed")==="true"||N.trim()==="")return[2];z="mermaid"+(0,m.Wb)(),te.label=1;case 1:return te.trys.push([1,3,,4]),[4,mermaid.render(z,y.textContent)];case 2:return q=te.sent(),y.innerHTML=q.svg,[3,4];case 3:return P=te.sent(),Y=document.querySelector("#"+z),y.innerHTML="".concat(Y.outerHTML,`<br>
|
|||
|
|
<div style="text-align: left"><small>`).concat(P.message.replace(/\n/,"<br>"),"</small></div>"),Y.parentElement.remove(),[3,4];case 4:return y.setAttribute("data-processed","true"),[2]}})})})})}},194:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w,S){x===void 0&&(x=document),w===void 0&&(w=v.g.CDN);var k=g.mindmapRenderAdapter.getElements(x);k.length>0&&(0,b.G)("".concat(w,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){k.forEach(function(C){if(!(C.parentElement.classList.contains("vditor-wysiwyg__pre")||C.parentElement.classList.contains("vditor-ir__marker--pre"))){var A=g.mindmapRenderAdapter.getCode(C);if(A)try{if(C.getAttribute("data-processed")==="true")return;echarts.init(C,S==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(A))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(T,M){var y;return!((y=M==null?void 0:M.data)===null||y===void 0)&&y.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),C.setAttribute("data-processed","true")}catch(T){C.className="vditor-reset--error",C.innerHTML="mindmap render error: <br>".concat(T)}}})})}},436:(h,c,p)=>{p.d(c,{k:()=>g});var v=p(771),b=p(472),g=function(m,x,w){var S="",k=[];if(Array.from(m.children).forEach(function(M,y){if((0,v.W)(M)){if(w){var N=M.id.lastIndexOf("_");M.id=M.id.substring(0,N===-1?void 0:N)+"_"+y}k.push(M.id),S+=M.outerHTML.replace("<wbr>","")}}),S==="")return x.innerHTML="","";var C=document.createElement("div");if(w)w.lute.SetToC(!0),w.currentMode==="wysiwyg"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorDOM("<p>[ToC]</p>"+S):w.currentMode==="ir"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorIRDOM("<p>[ToC]</p>"+S):C.innerHTML=w.lute.HTML2VditorDOM("<p>[ToC]</p>"+S),w.lute.SetToC(w.options.preview.markdown.toc);else{x.classList.add("vditor-outline");var A=Lute.New();A.SetToC(!0),C.innerHTML=A.HTML2VditorDOM("<p>[ToC]</p>"+S)}var T=C.firstElementChild.querySelectorAll("li > span[data-target-id]");return T.forEach(function(M,y){if(M.nextElementSibling&&M.nextElementSibling.tagName==="UL"){var N="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(N='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),M.innerHTML="".concat(N,"<span>").concat(M.innerHTML,"</span>")}else M.innerHTML="<svg></svg><span>".concat(M.innerHTML,"</span>");M.setAttribute("data-target-id",k[y])}),S=C.firstElementChild.innerHTML,T.length===0?(x.innerHTML="",S):(x.innerHTML=S,w&&(0,b.H)(x,{cdn:w.options.cdn,math:w.options.preview.math}),x.firstElementChild.addEventListener("click",function(M){for(var y=M.target;y&&!y.isEqualNode(x);){if(y.classList.contains("vditor-outline__action")){y.classList.contains("vditor-outline__action--close")?(y.classList.remove("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:block")):(y.classList.add("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:none")),M.preventDefault(),M.stopPropagation();break}else if(y.getAttribute("data-target-id")){M.preventDefault(),M.stopPropagation();var N=document.getElementById(y.getAttribute("data-target-id"));if(!N)return;if(w)if(w.options.height==="auto"){var z=N.offsetTop+w.element.offsetTop;w.options.toolbarConfig.pin||(z+=w.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,z)}else w.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,w.element.offsetTop),w.preview.element.contains(m)?m.parentElement.scrollTop=N.offsetTop:m.scrollTop=N.offsetTop;else window.scrollTo(window.scrollX,N.offsetTop);break}y=y.parentElement}}),S)}},229:(
|
|||
|
|
<div class="vditor-img__bar">
|
|||
|
|
<span class="vditor-img__btn" data-deg="0">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-redo"></use></svg>
|
|||
|
|
`).concat(window.VditorI18n.spin,`
|
|||
|
|
</span>
|
|||
|
|
<span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
X `).concat(window.VditorI18n.close,`
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
<img style="width: `).concat(b.width,"px;height:").concat(b.height,"px;transform: translate3d(").concat(x.left,"px, ").concat(x.top-w,'px, 0)" src="').concat(b.getAttribute("src"),`">
|
|||
|
|
</div>
|
|||
|
|
</div>`)),document.body.style.overflow="hidden";var S=document.querySelector(".vditor-img img"),k="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-w-b.naturalHeight)/2,"px, 0)");setTimeout(function(){S.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(k)),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)});var C=document.querySelector(".vditor-img__btn");C.addEventListener("click",function(){var A=parseInt(C.getAttribute("data-deg"),10)+90;A/90%2===1&&b.naturalWidth>S.parentElement.clientHeight?S.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(b.naturalWidth/2-b.naturalHeight/2,"px, 0) rotateZ(").concat(A,"deg)"):S.style.transform="".concat(k," rotateZ(").concat(A,"deg)"),C.setAttribute("data-deg",A.toString()),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)})}},580:(h,c,p)=>{p.d(c,{Y:()=>g});var v=p(145),b=p(290),g=function(m,x){x===void 0&&(x=v.g.CDN),v.g.CODE_THEME.includes(m)||(m="github");var w=document.getElementById("vditorHljsStyle"),S="".concat(x,"/dist/js/highlight.js/styles/").concat(m,".min.css");w?w.getAttribute("href")!==S&&(w.remove(),(0,b.c)(S,"vditorHljsStyle")):(0,b.c)(S,"vditorHljsStyle")}},538:(h,c,p)=>{p.d(c,{Z:()=>b});var v=p(290),b=function(g,m){if(!(!g||!m)){var x=document.getElementById("vditorContentTheme"),w="".concat(m,"/").concat(g,".css");x?x.getAttribute("href")!==w&&(x.remove(),(0,v.c)(w,"vditorContentTheme")):(0,v.c)(w,"vditorContentTheme")}}},413:(h,c,p)=>{p.d(c,{J:()=>v,G:()=>b});var v=function(g,m){if(document.getElementById(m))return!1;var x=new XMLHttpRequest;x.open("GET",g,!1),x.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),x.send("");var w=document.createElement("script");w.type="text/javascript",w.text=x.responseText,w.id=m,document.head.appendChild(w)},b=function(g,m){return new Promise(function(x,w){if(document.getElementById(m))return x(!0),!1;var S=document.createElement("script");S.src=g,S.async=!0,document.head.appendChild(S),S.onerror=function(k){w(k)},S.onload=function(){if(document.getElementById(m))return S.remove(),x(!0),!1;S.id=m,x(!0)}})}},290:(h,c,p)=>{p.d(c,{c:()=>v});var v=function(b,g){if(!document.getElementById(g)){var m=document.createElement("link");m.id=g,m.rel="stylesheet",m.type="text/css",m.href=b,document.getElementsByTagName("head")[0].appendChild(m)}}},105:(h,c,p)=>{p.d(c,{X:()=>v});var v=function(b){return b.replace(/\u00a0/g," ")}},410:(h,c,p)=>{p.d(c,{G6:()=>v,vU:()=>b,pK:()=>g,Le:()=>m,yl:()=>x,ns:()=>w,i7:()=>S});var v=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},b=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},g=function(){try{return typeof localStorage<"u"}catch{return!1}},m=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},x=function(k){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!(k.metaKey&&!k.ctrlKey):!!(!k.metaKey&&k.ctrlKey)},w=function(k){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?k.indexOf("⇧")>-1&&b()&&(k=k.replace(";",":").replace("=","+").replace("-","_")):(k.startsWith("⌘")?k=k.replace("⌘","⌘+"):k.startsWith("⌥")&&k.substr(1,1)!=="⌘"?k=k.replace("⌥","⌥+"):k=k.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+"),k=k.replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt"),k.indexOf("Shift")>-1&&(k=k.replace(";",":").replace("=","+").replace("-","_"))),k},S=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:(h,c,p)=>{p.d(c,{Wb:()=>v,on:()=>b,Qf:()=>g});var v=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g
|
|||
|
|
`).replace(/\n\n$/,`
|
|||
|
|
`)):i.currentMode==="wysiwyg"?i.lute.VditorDOM2Md(i.wysiwyg.element.innerHTML):i.currentMode==="ir"?i.lute.VditorIRDOM2Md(i.ir.element.innerHTML):""},b=a(413),g=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return i.prototype.renderEchart=function(o){var s=this;o.devtools.element.style.display==="block"&&(0,b.G)("".concat(o.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.ASTChart||(s.ASTChart=echarts.init(o.devtools.element.lastElementChild));try{s.element.lastElementChild.style.display="block",s.element.firstElementChild.innerHTML="",s.ASTChart.setOption({series:[{data:JSON.parse(o.lute.RenderEChartsJSON(v(o))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),s.ASTChart.resize()}catch(u){s.element.lastElementChild.style.display="none",s.element.firstElementChild.innerHTML=u}})},i}(),m=a(410),x=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains("vditor-menu--current")&&u.classList.remove("vditor-menu--current")}})},w=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains("vditor-menu--current")&&u.classList.add("vditor-menu--current")}})},S=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.remove(c.g.CLASS_MENU_DISABLED)}})},k=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.add(c.g.CLASS_MENU_DISABLED)}})},C=function(i,o){o.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="none")})},A=function(i,o){o.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="block")})},T=function(i,o,s){o.includes("subToolbar")&&(i.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(u){s&&u.isEqualNode(s)||(u.style.display="none")}),i.toolbar.elements.emoji&&(i.toolbar.elements.emoji.lastElementChild.style.display="none")),o.includes("hint")&&(i.hint.element.style.display="none"),i.wysiwyg.popover&&o.includes("popover")&&(i.wysiwyg.popover.style.display="none")},M=function(i,o,s,u){s.addEventListener((0,m.Le)(),function(d){d.preventDefault(),d.stopPropagation(),!s.classList.contains(c.g.CLASS_MENU_DISABLED)&&(i.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(f){f.classList.remove("vditor-hint--current")}),o.style.display==="block"?o.style.display="none":(T(i,["subToolbar","hint","popover"],s.parentElement.parentElement),s.classList.contains("vditor-tooltipped")||s.classList.add("vditor-hint--current"),o.style.display="block",i.toolbar.element.getBoundingClientRect().right-s.getBoundingClientRect().right<250?o.classList.add("vditor-panel--left"):o.classList.remove("vditor-panel--left")))})},y=a(106),N=a(771),z=function(i,o,s,u){u&&console.log("".concat(i," - ").concat(s,": ").concat(o))},q=a(135),P=a(775),Y=a(428),te=a(325),ue=a(483),Le=a(999),qe=a(472),Xe=a(637),it=a(11),$e=a(194),De=a(229),nt=a(825),ut=function(i,o,s){s===void 0&&(s="sv");var u=document.createElement("div");u.innerHTML=i;var d=!1;u.childElementCount===1&&u.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(d=!0);var f=u.querySelectorAll("pre");if(u.childElementCount===1&&f.length===1&&f[0].className!=="vditor-wysiwyg"&&f[0].className!=="vditor-sv"&&(d=!0),i.indexOf(`
|
|||
|
|
<p class="p1">`)===0&&(d=!0),u.childElementCount===1&&u.firstElementChild.tagName==="TABLE"&&u.querySelector(".line-number")&&u.querySelector(".line-content")&&(d=!0),d){var E=o||i;return/\n/.test(E)||f.length===1?s==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(E.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+E.replace(/&/g,"&").replace(/</g,"<")+"\n```":s==="wysiwyg"?"<code>".concat(E.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(E,"`")}return!1},je=function(i,o){if(i){if(i.parentElement.getAttribute("data-type")==="html-block"){i.setAttribute("data-render","1");return}var s=i.firstElementChild.className.replace("language-","");if(s==="abc")(0,q.Q)(i,o.options.cdn);else if(s==="mermaid")(0,Xe.i)(i,o.options.cdn,o.options.theme);else if(s==="smiles")(0,nt.J)(i,o.options.cdn,o.options.theme);else if(s==="markmap")(0,it.K)(i,o.options.cdn);else if(s==="flowchart")(0,te.P)(i,o.options.cdn);else if(s==="echarts")(0,P.p)(i,o.options.cdn,o.options.theme);else if(s==="mindmap")(0,$e.P)(i,o.options.cdn,o.options.theme);else if(s==="plantuml")(0,De.B)(i,o.options.cdn);else if(s==="graphviz")(0,ue.v)(i,o.options.cdn);else if(s==="math")(0,qe.H)(i,{cdn:o.options.cdn,math:o.options.preview.math});else{var u=o.options.customRenders.find(function(d){if(d.language===s)return d.render(i,o),!0});u||((0,Le.s)(Object.assign({},o.options.preview.hljs),i,o.options.cdn),(0,Y.O)(i,o.options.preview.hljs))}i.setAttribute("data-render","1")}},j=a(810),yt=function(i){if(i.currentMode!=="sv"){var o=i[i.currentMode].element,s=i.outline.render(i);s===""&&(s="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(u){u.innerHTML=s,(0,qe.H)(u,{cdn:i.options.cdn,math:i.options.preview.math})})}},It=function(i,o){var s=(0,y.lG)(i.target,"SPAN");if(s&&(0,y.fb)(s,"vditor-toc")){var u=o[o.currentMode].element.querySelector("#"+s.getAttribute("data-target-id"));if(u)if(o.options.height==="auto"){var d=u.offsetTop+o.element.offsetTop;o.options.toolbarConfig.pin||(d+=o.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,d)}else o.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,o.element.offsetTop),o[o.currentMode].element.scrollTop=u.offsetTop;return}},bt=function(i,o,s,u){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-toc")){if(s.key==="Backspace"&&(0,j.im)(i,o[o.currentMode].element,u).start===0)return i.previousElementSibling.remove(),ct(o),!0;if(Yr(o,s,u,i,i.previousElementSibling))return!0}if(i.nextElementSibling&&i.nextElementSibling.classList.contains("vditor-toc")){if(s.key==="Delete"&&(0,j.im)(i,o[o.currentMode].element,u).start>=i.textContent.trimRight().length)return i.nextElementSibling.remove(),ct(o),!0;if(Di(o,s,u,i,i.nextElementSibling))return!0}if(s.key==="Backspace"||s.key==="Delete"){var d=(0,y.fb)(u.startContainer,"vditor-toc");if(d)return d.remove(),ct(o),!0}},Mt=function(i,o,s,u){s===void 0&&(s=!1);var d=(0,y.F9)(o.startContainer);if(d&&!s&&d.getAttribute("data-type")!=="code-block"){if(_o(d.innerHTML)&&d.previousElementSibling||No(d.innerHTML))return;for(var f=(0,j.im)(d,i.ir.element,o).start,E=!0,L=f-1;L>d.textContent.substr(0,f).lastIndexOf(`
|
|||
|
|
`);L--)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==" "){E=!1;break}f===0&&(E=!1);for(var D=!0,L=f-1;L<d.textContent.length;L++)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==`
|
|||
|
|
`){D=!1;break}if(E){typeof i.options.input=="function"&&i.options.input(v(i));return}if(D&&/^#{1,6} $/.test(d.textContent)&&(D=!1),D){var _=(0,y.fb)(o.startContainer,"vditor-ir__marker");if(!_){var F=o.startContainer.previousSibling;F&&F.nodeType!==3&&F.classList.contains("vditor-ir__node--expand")&&F.classList.remove("vditor-ir__node--expand"),typeof i.options.input=="function"&&i.options.input(v(i));return}}}if(i.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(ot){ot.classList.remove("vditor-ir__node--expand")}),d||(d=i.ir.element),!d.querySelector("wbr")){var X=(0,y.fb)(o.startContainer,"vditor-ir__preview");X?X.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):o.insertNode(document.createElement("wbr"))}d.querySelectorAll("[style]").forEach(function(ot){ot.removeAttribute("style")}),d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.ir.element);var be=d.isEqualNode(i.ir.element),xe=(0,y.a1)(d,"data-type","footnotes-block"),pe="";if(be)pe=d.innerHTML;else{var Se=(0,N.S)(o.startContainer,"BLOCKQUOTE"),ke=(0,y.O9)(o.startContainer);if(ke&&(d=ke),Se&&(!ke||ke&&!Se.contains(ke))&&(d=Se),xe&&(d=xe),pe=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var me=d.previousElementSibling,Pe=d.nextElementSibling;me&&(me.tagName==="UL"||me.tagName==="OL")&&(pe=me.outerHTML+pe,me.remove()),Pe&&(Pe.tagName==="UL"||Pe.tagName==="OL")&&(pe=pe+Pe.outerHTML,Pe.remove()),pe=pe.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else d.previousElementSibling&&d.previousElementSibling.textContent.replace(c.g.ZWSP,"")!==""&&u&&u.inputType==="insertParagraph"&&(pe=d.previousElementSibling.outerHTML+pe,d.previousElementSibling.remove());d.innerText.startsWith("```")||(i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(ot){ot&&!d.isEqualNode(ot)&&(pe+=ot.outerHTML,ot.remove())}),i.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(ot){ot&&!d.isEqualNode(ot)&&(pe+=ot.outerHTML,ot.remove())}))}if(z("SpinVditorIRDOM",pe,"argument",i.options.debugger),pe=i.lute.SpinVditorIRDOM(pe),z("SpinVditorIRDOM",pe,"result",i.options.debugger),be)d.innerHTML=pe;else if(d.outerHTML=pe,xe){var Ce=(0,y.a1)(i.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(Ce){var Ve=Ce.textContent,Et=Ve.substring(1,Ve.indexOf("]:")),wt=i.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(Et,'"]'));wt&&wt.setAttribute("aria-label",Ve.substr(Et.length+3).trim().substr(0,24))}}var Ct,vn=i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");vn.forEach(function(ot,Ut){Ut===0?Ct=ot:(Ct.insertAdjacentHTML("beforeend",ot.innerHTML),ot.remove())}),vn.length>0&&i.ir.element.insertAdjacentElement("beforeend",vn[0]);var Yt,bn=i.ir.element.querySelectorAll("[data-type='footnotes-block']");bn.forEach(function(ot,Ut){Ut===0?Yt=ot:(Yt.insertAdjacentHTML("beforeend",ot.innerHTML),ot.remove())}),bn.length>0&&i.ir.element.insertAdjacentElement("beforeend",bn[0]),(0,j.ib)(i.ir.element,o),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(ot){je(ot,i)}),yt(i),lr(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},se=function(i,o){if(i==="")return!1;if(i.indexOf("⇧")===-1&&i.indexOf("⌘")===-1&&i.indexOf("⌥")===-1)return!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey&&o.code===i;if(i==="⇧Tab")return!!(!(0,m.yl)(o)&&!o.altKey&&o.shiftKey&&o.code==="Tab");var s=i.split("");if(i.startsWith("⌥")){var u=s.length===3?s[2]:s[1];return!!((s.length===3?(0,m.yl)(o):!(0,m.yl)(o))&&o.altKey&&!o.shiftKey&&o.code===(/^[0-9]$/.test(u)?"Digit":"Key")+u)}i==="⌘Enter"&&(s=["⌘","Enter"]);var d=s.length>2&&s[0]==="⇧",f=d?s[2]:s[1];return d&&((0,m.vU)()||!/Mac/.test(navigator.platform))&&(f==="-"?f="_":f==="="&&(f="+")),!!((0,m.yl)(o)&&o.key.toLowerCase()===f.toLowerCase()&&!o.altKey&&(!d&&!o.shiftKey||d&&o.shiftKey))},fe=function(i){var o=i.startContainer;if(o.nodeType===3&&o.nodeValue.length!==i.startOffset)return!1;for(var s=o.nextSibling;s&&s.textContent==="";)s=s.nextSibling;if(s){if(s&&s.nodeType
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}if(E===0&&(L=!1),L){ne(i);return}if(o.inputType==="deleteContentBackward"){var _=(0,y.a1)(d,"data-type","code-block-open-marker")||(0,y.a1)(d,"data-type","code-block-close-marker");if(_){if(_.getAttribute("data-type")==="code-block-close-marker"){var F=B(d,"code-block-open-marker");if(F){F.textContent=_.textContent,ne(i);return}}if(_.getAttribute("data-type")==="code-block-open-marker"){var F=B(d,"code-block-close-marker",!1);if(F){F.textContent=_.textContent,ne(i);return}}}var X=(0,y.a1)(d,"data-type","math-block-open-marker");if(X){var be=X.nextElementSibling.nextElementSibling;be&&be.getAttribute("data-type")==="math-block-close-marker"&&(be.remove(),ne(i));return}f.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(me){me.textContent.length===1&&me.remove()}),f.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(me){me.textContent.length===1&&me.remove()});var xe=(0,y.a1)(d,"data-type","heading-marker");if(xe&&xe.textContent.indexOf("#")===-1){ne(i);return}}if((o.data===" "||o.inputType==="deleteContentBackward")&&((0,y.a1)(d,"data-type","padding")||(0,y.a1)(d,"data-type","li-marker")||(0,y.a1)(d,"data-type","task-marker")||(0,y.a1)(d,"data-type","blockquote-marker"))){ne(i);return}}if(f&&f.textContent.trimRight()==="$$"){ne(i);return}f||(f=i.sv.element),((s=f.firstElementChild)===null||s===void 0?void 0:s.getAttribute("data-type"))==="link-ref-defs-block"&&(f=i.sv.element),(0,y.a1)(d,"data-type","footnotes-link")&&(f=i.sv.element),f.textContent.indexOf(Lute.Caret)===-1&&u.insertNode(document.createTextNode(Lute.Caret)),f.querySelectorAll("[style]").forEach(function(me){me.removeAttribute("style")}),f.querySelectorAll("font").forEach(function(me){me.outerHTML=me.innerHTML});var pe=f.textContent,Se=f.isEqualNode(i.sv.element);if(Se)pe=f.textContent;else{f.previousElementSibling&&(pe=f.previousElementSibling.textContent+pe,f.previousElementSibling.remove()),f.previousElementSibling&&pe.indexOf(`---
|
|||
|
|
`)===0&&(pe=f.previousElementSibling.textContent+pe,f.previousElementSibling.remove());var ke="";i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(me,Pe){me&&!f.isEqualNode(me.parentElement)&&(ke+=me.parentElement.textContent+`
|
|||
|
|
`,me.parentElement.remove())}),i.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(me,Pe){me&&!f.isEqualNode(me.parentElement)&&(ke+=me.parentElement.textContent+`
|
|||
|
|
`,me.parentElement.remove())}),pe=ke+pe}pe=V(pe,i),Se?f.innerHTML=pe:f.outerHTML=pe,i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(me){i.sv.element.insertAdjacentElement("beforeend",me.parentElement)}),W(i.sv.element,function(me){i.sv.element.insertAdjacentElement("beforeend",me)}),(0,j.ib)(i.sv.element,u),Bt(i),ne(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},ge=function(i,o){var s,u,d,f,E;if(i.sv.composingLock=o.isComposing,o.isComposing||(o.key.indexOf("Arrow")===-1&&o.key!=="Meta"&&o.key!=="Control"&&o.key!=="Alt"&&o.key!=="Shift"&&o.key!=="CapsLock"&&o.key!=="Escape"&&!/^F\d{1,2}$/.test(o.key)&&i.undo.recordFirstPosition(i,o),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,m.yl)(o)&&o.key!=="Escape"))return!1;var L=(0,j.zh)(i),D=L.startContainer;L.startContainer.nodeType!==3&&L.startContainer.tagName==="DIV"&&(D=L.startContainer.childNodes[L.startOffset-1]);var _=(0,y.a1)(D,"data-type","text"),F=(0,y.a1)(D,"data-type","blockquote-marker");if(!F&&L.startOffset===0&&_&&_.previousElementSibling&&_.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(F=_.previousElementSibling),F&&o.key==="Enter"&&!(0,m.yl)(o)&&!o.altKey&&F.nextElementSibling.textContent.trim()===""&&(0,j.im)(F,i.sv.element,L).start===F.textContent.length)return((s=F.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&F.previousElementSibling.setAttribute("data-action","enter-remove"),F.remove(),ne(i),o.preventDefault(),!0;var X=(0,y.a1)(D,"data-type","li-marker"),be=(0,y.a1)(D,"data-type","task-marker"),xe=X;if(xe||be&&be.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(xe=be),!xe&&L.startOffset===0&&_&&_.previousElementSibling&&(_.previousElementSibling.getAttribute("data-type")==="li-marker"||_.previousElementSibling.getAttribute("data-type")==="task-marker")&&(xe=_.previousElementSibling),xe){var pe=(0,j.im)(xe,i.sv.element,L).start,Se=xe.getAttribute("data-type")==="task-marker",ke=xe;if(Se&&(ke=xe.previousElementSibling.previousElementSibling.previousElementSibling),pe===xe.textContent.length){if(o.key==="Enter"&&!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey&&xe.nextElementSibling.textContent.trim()==="")return((u=ke.previousElementSibling)===null||u===void 0?void 0:u.getAttribute("data-type"))==="padding"?(ke.previousElementSibling.remove(),Z(i)):(Se&&(ke.remove(),xe.previousElementSibling.previousElementSibling.remove(),xe.previousElementSibling.remove()),xe.nextElementSibling.remove(),xe.remove(),ne(i)),o.preventDefault(),!0;if(o.key==="Tab")return o.shiftKey?ke.previousElementSibling.getAttribute("data-type")==="padding"&&ke.previousElementSibling.remove():ke.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(ke.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(ke.textContent)&&(ke.textContent=ke.textContent.replace(/^\d{1,}/,"1"),L.selectNodeContents(xe.firstChild),L.collapse(!1)),Z(i),o.preventDefault(),!0}}if(Do(i,L,o))return!0;var me=(0,y.a1)(D,"data-block","0"),Pe=(0,N.S)(D,"SPAN");if(o.key==="Enter"&&!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey&&me){var Ce=!1,Ve=me.textContent.match(/^\n+/);(0,j.im)(me,i.sv.element).start<=(Ve?Ve[0].length:0)&&(Ce=!0);var Et=`
|
|||
|
|
`;if(Pe){if(((d=Pe.previousElementSibling)===null||d===void 0?void 0:d.getAttribute("data-action"))==="enter-remove")return Pe.previousElementSibling.remove(),ne(i),o.preventDefault(),!0;Et+=ee(Pe)}return L.insertNode(document.createTextNode(Et)),L.collapse(!1),me&&me.textContent.trim()!==""&&!Ce?Z(i):ne(i),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey){if(Pe&&((f=Pe.previousElementSibling)===null||f===void 0?void 0:f.getAttribute("data-type"))==="newline"&&(0,j.im)(Pe,i.sv.element,L).start===1&&Pe.getAttribute("data-type").indexOf("code-block-")===-1)return L.setStart(Pe,0),L.extractContents(),Pe.textContent.trim()!==""?Z(i):ne(i),o.preventDefault(),!0;if(me&&(0,j.im)(me,i.sv.element,L).start===0&&me.previousElementSibling){L.extractContents();var wt=me.previousElementSibling.lastElementChild;return wt.getAttribute("data-type")==="newline"&&(wt.remove(),wt=me.previousElementSibling.lastElementChild),wt.getAttribute("data-type")!=="newline"&&(wt.insertAdjacentHTML("afterend",me.innerHTML),me.remove()),me.textContent.trim()!==""&&!(!((E=me.previousElementSibling)===null||E===void 0)&&E.querySelector('[data-type="code-block-open-marker"]'))?Z(i):(wt.getAttribute("data-type")!=="newline"&&(L.selectNodeContents(wt.lastChild),L.collapse(!1)),ne(i)),o.preventDefault(),!0}}return!1},ce=a(538),ve=function(i){i.options.theme==="dark"?i.element.classList.add("vditor--dark"):i.element.classList.remove("vditor--dark")},Ee=function(i){i.element.innerHTML="",i.element.classList.add("vditor"),i.options.rtl&&i.element.setAttribute("dir","rtl"),ve(i),(0,ce.Z)(i.options.preview.theme.current,i.options.preview.theme.path),typeof i.options.height=="number"?i.element.style.height=i.options.height+"px":i.element.style.height=i.options.height,typeof i.options.minHeight=="number"&&(i.element.style.minHeight=i.options.minHeight+"px"),typeof i.options.width=="number"?i.element.style.width=i.options.width+"px":i.element.style.width=i.options.width,i.element.appendChild(i.toolbar.element);var o=document.createElement("div");if(o.className="vditor-content",i.options.outline.position==="left"&&o.appendChild(i.outline.element),o.appendChild(i.wysiwyg.element.parentElement),o.appendChild(i.sv.element),o.appendChild(i.ir.element.parentElement),o.appendChild(i.preview.element),i.toolbar.elements.devtools&&o.appendChild(i.devtools.element),i.options.outline.position==="right"&&(i.outline.element.classList.add("vditor-outline--right"),o.appendChild(i.outline.element)),i.upload&&o.appendChild(i.upload.element),i.options.resize.enable&&o.appendChild(i.resize.element),o.appendChild(i.hint.element),o.appendChild(i.tip.element),i.element.appendChild(o),o.addEventListener("click",function(){T(i,["subToolbar"])}),i.toolbar.elements.export&&i.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),Ln(i,i.options.mode,at(i)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&typeof window.visualViewport<"u"){var s=!1,u=function(d){s||(s=!0,requestAnimationFrame(function(){s=!1;var f=i.toolbar.element;f.style.transform="none",f.getBoundingClientRect().top<0&&(f.style.transform="translate(0, ".concat(-f.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",u),window.visualViewport.addEventListener("resize",u)}},ze=function(i){var o=window.innerWidth<=c.g.MOBILE_WIDTH?10:35;if(i.wysiwyg.element.parentElement.style.display!=="none"){var s=(i.wysiwyg.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.wysiwyg.element.style.padding="10px ".concat(Math.max(o,s),"px")}if(i.ir.element.parentElement.style.display!=="none"){var s=(i.ir.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.ir.element.style.padding="10px ".concat(Math.max(o,s),"px")}i.preview.element.style.display!=="block"?i.toolbar.element.style.paddingLeft=Math.max(5,parseInt(i[i.currentMode].element.style.paddingLeft||"0",10)+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0))+"
|
|||
|
|
`,s.insertNode(_),s.collapse(!0),(0,j.Hc)(s),He(i),Bt(i),o.preventDefault(),!0}var F=(0,N.W)(u);if(F){if(F.tagName==="H6"&&u.textContent.length===s.startOffset&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var X=document.createElement("p");return X.textContent=`
|
|||
|
|
`,X.setAttribute("data-block","0"),u.parentElement.insertAdjacentElement("afterend",X),s.setStart(X,0),(0,j.Hc)(s),He(i),Bt(i),o.preventDefault(),!0}if(se("⌘=",o)){var be=parseInt(F.tagName.substr(1),10)-1;return be>0&&(ln(i,"h".concat(be)),He(i)),o.preventDefault(),!0}if(se("⌘-",o)){var be=parseInt(F.tagName.substr(1),10)+1;return be<7&&(ln(i,"h".concat(be)),He(i)),o.preventDefault(),!0}o.key==="Backspace"&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&F.textContent.length===1&&Qn(i)}if(Gs(i,s,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,m.yl)(o)&&!o.shiftKey){var xe=(0,y.lG)(u,"A"),pe=(0,y.a1)(u,"data-type","link-ref"),Se=(0,y.a1)(u,"data-type","footnotes-ref");if(xe||pe||Se||F&&F.tagName.length===2){var ke=i.wysiwyg.popover.querySelector("input");ke.focus(),ke.select()}}if(zt(i,o))return!0;if(se("⇧⌘U",o)){var me=i.wysiwyg.popover.querySelector('[data-type="up"]');if(me)return me.click(),o.preventDefault(),!0}if(se("⇧⌘D",o)){var me=i.wysiwyg.popover.querySelector('[data-type="down"]');if(me)return me.click(),o.preventDefault(),!0}if(Do(i,s,o))return!0;if(!(0,m.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&u.parentElement.tagName!=="LI"&&u.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName)?s.insertNode(document.createTextNode(`
|
|||
|
|
`+c.g.ZWSP)):s.insertNode(document.createTextNode(`
|
|||
|
|
`)),s.collapse(!1),(0,j.Hc)(s),He(i),Bt(i),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(Ks(i,s,o,f))return!0;if(d){if(d.previousElementSibling&&d.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&d.previousElementSibling.getAttribute("data-block")==="0"&&d.tagName!=="UL"&&d.tagName!=="OL"){var Pe=(0,j.im)(d,i.wysiwyg.element,s).start;if(Pe===0&&s.startOffset===0||Pe===1&&d.innerText.startsWith(c.g.ZWSP))return Cn(d.previousElementSibling.lastElementChild,i,!1),d.innerHTML.trim().replace(c.g.ZWSP,"")===""&&(d.remove(),He(i)),o.preventDefault(),!0}var Ce=s.startOffset;if(s.toString()===""&&u.nodeType===3&&u.textContent.charAt(Ce-2)===`
|
|||
|
|
`&&u.textContent.charAt(Ce-1)!==c.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName))return u.textContent=u.textContent.substring(0,Ce-1)+c.g.ZWSP,s.setStart(u,Ce),s.collapse(!0),He(i),o.preventDefault(),!0;u.textContent===c.g.ZWSP&&s.startOffset===1&&!u.previousSibling&&kt(s)&&(u.textContent=""),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(Et){Et.firstElementChild.style.display="inline",Et.lastElementChild.style.display="none"}),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(Et){Et.firstElementChild.style.display="inline",Et.lastElementChild.style.display="none"})}}if((0,m.vU)()&&s.startOffset===1&&u.textContent.indexOf(c.g.ZWSP)>-1&&u.previousSibling&&u.previousSibling.nodeType!==3&&u.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return s.selectNodeContents(u.previousSibling),s.collapse(!1),o.preventDefault(),!0;if(Zs(o,d,s))return o.preventDefault(),!0;if(to(s,o.key),o.key==="ArrowDown"){var Ve=u.nextSibling;Ve&&Ve.nodeType!==3&&Ve.getAttribute("data-type")==="math-inline"&&s.setStartAfter(Ve)}return d&&bt(d,i,o,s)?(o.preventDefault(),!0):!1},zt=function(i,o){if(se("⇧⌘X",o)){var s=i.wysiwyg.popover.querySelector('[data-type="remove"]');return s&&s.click(),o.preventDefault(),!0}},Pn=function(i){clearTimeout(i.wysiwyg.hlToolbarTimeoutId),i.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(i.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,j.Gb)(i.wysiwyg.element)){x(i.toolbar.elements,c.g.EDIT_TOOLBARS),S(i.toolbar.elements,c.g.EDIT_TOOLBARS);var o=getSelection().getRangeAt(0),s=o.startContainer;o.startContainer.nodeType===3?s=o.startContainer.parentElement:s=s.childNodes[o.startOffset>=s.childNodes.length?s.childNodes.length-1:o.startOffset];var u=(0,y.a1)(s,"data-type","footnotes-block");if(u){i.wysiwyg.popover.innerHTML="",Jt(u,i),Qt(i,"footnotes-block"),nn(i,u);return}var d=(0,y.lG)(s,"LI");d?(d.classList.contains("vditor-task")?w(i.toolbar.elements,["check"]):d.parentElement.tagName==="OL"?w(i.toolbar.elements,["ordered-list"]):d.parentElement.tagName==="UL"&&w(i.toolbar.elements,["list"]),S(i.toolbar.elements,["outdent","indent"])):k(i.toolbar.elements,["outdent","indent"]),(0,y.lG)(s,"BLOCKQUOTE")&&w(i.toolbar.elements,["quote"]),((0,y.lG)(s,"B")||(0,y.lG)(s,"STRONG"))&&w(i.toolbar.elements,["bold"]),((0,y.lG)(s,"I")||(0,y.lG)(s,"EM"))&&w(i.toolbar.elements,["italic"]),((0,y.lG)(s,"STRIKE")||(0,y.lG)(s,"S"))&&w(i.toolbar.elements,["strike"]),i.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(Re){Re.classList.remove("vditor-comment--focus")});var f=(0,y.fb)(s,"vditor-comment");if(f){var E=f.getAttribute("data-cmtids").split(" ");if(E.length>1&&f.nextSibling.isSameNode(f.nextElementSibling)){var L=f.nextElementSibling.getAttribute("data-cmtids").split(" ");E.find(function(Re){if(L.includes(Re))return E=[Re],!0})}i.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(Re){Re.getAttribute("data-cmtids").indexOf(E[0])>-1&&Re.classList.add("vditor-comment--focus")})}var D=(0,y.lG)(s,"A");D&&w(i.toolbar.elements,["link"]);var _=(0,y.lG)(s,"TABLE"),F=(0,N.W)(s);(0,y.lG)(s,"CODE")?(0,y.lG)(s,"PRE")?(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),w(i.toolbar.elements,["code"])):(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),w(i.toolbar.elements,["inline-code"])):F?(k(i.toolbar.elements,["bold"]),w(i.toolbar.elements,["headings"])):_&&k(i.toolbar.elements,["table"]);var X=(0,y.fb)(s,"vditor-toc");if(X){i.wysiwyg.popover.innerHTML="",Jt(X,i),Qt(i,"vditor-toc"),nn(i,X);return}var be=(0,N.S)(s,"BLOCKQUOTE");if(be&&(i.wysiwyg.popover.innerHTML="",er(o,be,i),or(o,be,i),Jt(be,i),Qt(i,"blockquote"),nn(i,be)),d&&(i.wysiwyg.popover.innerHTML="",er(o,d,i),or(o,d,i),Jt(d,i),Qt(i,"li"),nn(i,d)),_){i.options.lang,i.
|
|||
|
|
</code></pre>`:(X.innerHTML="<pre><code>".concat(f.toString(),"<wbr></code></pre>"),f.deleteContents()),f.insertNode(X),_&&(_.outerHTML=i.lute.SpinVditorDOM(_.outerHTML)),(0,j.ib)(i.wysiwyg.element,f),i.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Et){je(Et,i)}),o.classList.add("vditor-menu--disabled")}else if(E==="link"){if(f.toString()===""){var be=document.createElement("a");be.innerText=c.g.ZWSP,f.insertNode(be),f.setStart(be.firstChild,1),f.collapse(!0),Ci(i,be,f);var xe=i.wysiwyg.popover.querySelector("input");xe.value="",xe.focus(),d=!1}else{var X=document.createElement("a");X.setAttribute("href",""),X.innerHTML=f.toString(),f.surroundContents(X),f.insertNode(X),(0,j.Hc)(f),Ci(i,X,f);var pe=i.wysiwyg.popover.querySelectorAll("input");pe[0].value=X.innerText,pe[1].focus()}u=!1,o.classList.add("vditor-menu--current")}else if(E==="table"){var Se='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(f.toString().trim()==="")_&&_.innerHTML.trim().replace(c.g.ZWSP,"")===""?_.outerHTML=Se:document.execCommand("insertHTML",!1,Se),f.selectNode(i.wysiwyg.element.querySelector("wbr").previousSibling),i.wysiwyg.element.querySelector("wbr").remove(),(0,j.Hc)(f);else{Se='<table data-block="0"><thead><tr>';var ke=f.toString().split(`
|
|||
|
|
`),me=ke[0].split(",").length>ke[0].split(" ").length?",":" ";ke.forEach(function(Ve,Et){Et===0?(Ve.split(me).forEach(function(wt,Ct){Ct===0?Se+="<th>".concat(wt,"<wbr></th>"):Se+="<th>".concat(wt,"</th>")}),Se+="</tr></thead>"):(Et===1?Se+="<tbody><tr>":Se+="<tr>",Ve.split(me).forEach(function(wt){Se+="<td>".concat(wt,"</td>")}),Se+="</tr>")}),Se+="</tbody></table>",document.execCommand("insertHTML",!1,Se),(0,j.ib)(i.wysiwyg.element,f)}u=!1,o.classList.add("vditor-menu--disabled")}else if(E==="line"){if(_){var Pe=`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`;_.innerHTML.trim()===""?_.outerHTML=Pe:_.insertAdjacentHTML("afterend",Pe),(0,j.ib)(i.wysiwyg.element,f)}}else if(u=!1,o.classList.add("vditor-menu--current"),E==="strike"&&(E="strikeThrough"),f.toString()===""&&(E==="bold"||E==="italic"||E==="strikeThrough")){var Ce="strong";E==="italic"?Ce="em":E==="strikeThrough"&&(Ce="s");var X=document.createElement(Ce);X.textContent=c.g.ZWSP,f.insertNode(X),X.previousSibling&&X.previousSibling.textContent===c.g.ZWSP&&(X.previousSibling.textContent=""),f.setStart(X.firstChild,1),f.collapse(!0),(0,j.Hc)(f)}else document.execCommand(E,!1,"")}u&&Pn(i),d&&He(i)}},xt=function(){function i(o,s){var u,d=this;this.element=document.createElement("div"),s.className&&(u=this.element.classList).add.apply(u,s.className.split(" "));var f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"";s.level===2&&(f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"");var E=s.tip?s.tip+f:"".concat(window.VditorI18n[s.name]).concat(f),L=s.name==="upload"?"div":"button";if(s.level===2)this.element.innerHTML="<".concat(L,' data-type="').concat(s.name,'">').concat(E,"</").concat(L,">");else{this.element.classList.add("vditor-toolbar__item");var D=document.createElement(L);D.setAttribute("data-type",s.name),D.className="vditor-tooltipped vditor-tooltipped__".concat(s.tipPosition),D.setAttribute("aria-label",E),D.innerHTML=s.icon,this.element.appendChild(D)}s.prefix&&this.element.children[0].addEventListener((0,m.Le)(),function(_){_.preventDefault(),!d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)&&(o.currentMode==="wysiwyg"?Fr(o,d.element.children[0],_):o.currentMode==="ir"?Du(o,d.element.children[0],s.prefix||"",s.suffix||""):_e(o,d.element.children[0],s.prefix||"",s.suffix||""))})}return i}(),mr=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ln=function(i,o,s){var u;if(typeof s!="string"?(T(i,["subToolbar","hint"]),s.preventDefault(),u=v(i)):u=s,!(i.currentMode===o&&typeof s!="string")){if(i.devtools&&i.devtools.renderEchart(i),i.options.preview.mode==="both"&&o==="sv"?i.preview.element.style.display="block":i.preview.element.style.display="none",S(i.toolbar.elements,c.g.EDIT_TOOLBARS),x(i.toolbar.elements,c.g.EDIT_TOOLBARS),k(i.toolbar.elements,["outdent","indent"]),o==="ir")C(i.toolbar.elements,["both"]),A(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="none",i.ir.element.parentElement.style.display="block",i.lute.SetVditorIR(!0),i.lute.SetVditorWYSIWYG(!1),i.lute.SetVditorSV(!1),i.currentMode="ir",i.ir.element.innerHTML=i.lute.Md2VditorIRDOM(u),lr(i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),ze(i),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(f){je(f,i)}),i.ir.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,qe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})});else if(o==="wysiwyg")C(i.toolbar.elements,["both"]),A(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="block",i.ir.element.parentElement.style.display="none",i.lute.SetVditorIR(!1),i.lute.SetVditorWYSIWYG(!0),i.lute.SetVditorSV(!1),i.currentMode="wysiwyg",ze(i),Li(i,u,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),i.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,qe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})}),i.wysiwyg.popover.style.display="none";else if(o==="sv"){A(i.toolbar.elements,["both"]),C(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-
|
|||
|
|
<button data-mode="ir">`).concat(window.VditorI18n.instantRendering," <").concat((0,m.ns)("⌥⌘8"),`></button>
|
|||
|
|
<button data-mode="sv">`).concat(window.VditorI18n.splitView," <").concat((0,m.ns)("⌥⌘9"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f,u),d}return o.prototype._bindEvent=function(s,u,d){var f=this.element.children[0];M(s,u,f,d.level),u.children.item(0).addEventListener((0,m.Le)(),function(E){Ln(s,"wysiwyg",E),E.preventDefault(),E.stopPropagation()}),u.children.item(1).addEventListener((0,m.Le)(),function(E){Ln(s,"ir",E),E.preventDefault(),E.stopPropagation()}),u.children.item(2).addEventListener((0,m.Le)(),function(E){Ln(s,"sv",E),E.preventDefault(),E.stopPropagation()})},o}(xt),tr=function(i,o){return(0,j.Gb)(i,o)?getSelection().toString():""},Kr=function(i,o){o.addEventListener("focus",function(){i.options.focus&&i.options.focus(v(i)),T(i,["subToolbar","hint"])})},Ui=function(i,o){o.addEventListener("dblclick",function(s){s.target.tagName==="IMG"&&(i.options.image.preview?i.options.image.preview(s.target):i.options.image.isPreview&&(0,de.E)(s.target,i.options.lang,i.options.theme))})},sr=function(i,o){o.addEventListener("blur",function(s){if(i.currentMode==="ir"){var u=i.ir.element.querySelector(".vditor-ir__node--expand");u&&u.classList.remove("vditor-ir__node--expand")}else i.currentMode==="wysiwyg"&&!i.wysiwyg.selectPopover.contains(s.relatedTarget)&&i.wysiwyg.hideComment();i[i.currentMode].range=(0,j.zh)(i),i.options.blur&&i.options.blur(v(i))})},Xr=function(i,o){o.addEventListener("dragstart",function(s){s.dataTransfer.setData(c.g.DROP_EDITOR,c.g.DROP_EDITOR)}),o.addEventListener("drop",function(s){s.dataTransfer.getData(c.g.DROP_EDITOR)?ct(i):(s.dataTransfer.types.includes("Files")||s.dataTransfer.types.includes("text/html"))&&ya(i,s,{pasteCode:function(u){document.execCommand("insertHTML",!1,u)}})})},di=function(i,o,s){o.addEventListener("copy",function(u){return s(u,i)})},hi=function(i,o,s){o.addEventListener("cut",function(u){s(u,i),i.options.comment.enable&&i.currentMode==="wysiwyg"&&i.wysiwyg.getComments(i),document.execCommand("delete")})},Bt=function(i){if(i.currentMode==="wysiwyg"&&i.options.comment.enable&&i.options.comment.adjustTop(i.wysiwyg.getComments(i,!0)),!!i.options.typewriterMode){var o=i[i.currentMode].element,s=(0,j.Ny)(o).top;i.options.height==="auto"&&!i.element.classList.contains("vditor--fullscreen")&&window.scrollTo(window.scrollX,s+i.element.offsetTop+i.toolbar.element.offsetHeight-window.innerHeight/2+10),(i.options.height!=="auto"||i.element.classList.contains("vditor--fullscreen"))&&(o.scrollTop=s+o.scrollTop-o.clientHeight/2+10)}},_i=function(i,o){o.addEventListener("keydown",function(s){if(!s.isComposing&&i.options.keydown&&i.options.keydown(s),!((i.options.hint.extend.length>1||i.toolbar.elements.emoji)&&i.hint.select(s,i))){if(i.options.comment.enable&&i.currentMode==="wysiwyg"&&(s.key==="Backspace"||se("⌘X",s))&&i.wysiwyg.getComments(i),i.currentMode==="sv"){if(ge(i,s))return}else if(i.currentMode==="wysiwyg"){if(xn(i,s))return}else if(i.currentMode==="ir"&&Ie(i,s))return;if(i.options.ctrlEnter&&se("⌘Enter",s)){i.options.ctrlEnter(v(i)),s.preventDefault();return}if(se("⌘Z",s)&&!i.toolbar.elements.undo){i.undo.undo(i),s.preventDefault();return}if(se("⌘Y",s)&&!i.toolbar.elements.redo){i.undo.redo(i),s.preventDefault();return}if(s.key==="Escape"){i.hint.element.style.display==="block"?i.hint.element.style.display="none":i.options.esc&&!s.isComposing&&i.options.esc(v(i)),s.preventDefault();return}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[1-6]$/.test(s.code)){if(i.currentMode==="wysiwyg"){var u=s.code.replace("Digit","H");(0,y.lG)(getSelection().getRangeAt(0).startContainer,u)?Qn(i):ln(i,u),He(i)}else i.currentMode==="sv"?Te(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" "):i.currentMode==="ir"&&Ri(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" ");return s.preventDefault(),!0}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[7-9]$/.test(s.code))return s.code==="Digit7"?Ln(i,"wysiwyg",s):s.code==="Digit8"?Ln(i,"ir",s):s.code==="Digit9"&&Ln(i,"sv",s),!0;i.options.toolbar.find(function(d){if(!d.hotkey||d.toolbar){if(d.toolbar){var f=d.toolba
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",u.isEqualNode(i.sv.element)?u.innerHTML=d:u.outerHTML=d,W(i.sv.element),(0,j.ib)(i.sv.element,s),Bt(i)},B=function(i,o,s){s===void 0&&(s=!0);var u=i;for(u.nodeType===3&&(u=u.parentElement);u;){if(u.getAttribute("data-type")===o)return u;s?u=u.previousElementSibling:u=u.nextElementSibling}return!1},V=function(i,o){z("SpinVditorSVDOM",i,"argument",o.options.debugger);var s=o.lute.SpinVditorSVDOM(i);return i="<div data-block='0'>"+s.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",z("SpinVditorSVDOM",i,"result",o.options.debugger),i},ee=function(i){var o=i.getAttribute("data-type"),s=i.previousElementSibling,u=o&&o!=="text"&&o!=="table"&&o!=="heading-marker"&&o!=="newline"&&o!=="yaml-front-matter-open-marker"&&o!=="yaml-front-matter-close-marker"&&o!=="code-block-info"&&o!=="code-block-close-marker"&&o!=="code-block-open-marker"?i.textContent:"",d=!1;for(o==="newline"&&(d=!0);s&&!d;){var f=s.getAttribute("data-type");if(f==="li-marker"||f==="blockquote-marker"||f==="task-marker"||f==="padding"){var E=s.textContent;if(f==="li-marker"&&(o==="code-block-open-marker"||o==="code-block-info"))u=E.replace(/\S/g," ")+u;else if(o==="code-block-close-marker"&&s.nextElementSibling.isSameNode(i)){var L=B(i,"code-block-open-marker");L&&L.previousElementSibling&&(s=L.previousElementSibling,u=E+u)}else u=E+u}else f==="newline"&&(d=!0);s=s.previousElementSibling}return u},ne=function(i,o){o===void 0&&(o={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),o.enableHint&&i.hint.render(i),i.preview.render(i);var s=v(i);typeof i.options.input=="function"&&o.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),clearTimeout(i.sv.processTimeoutId),i.sv.processTimeoutId=window.setTimeout(function(){o.enableAddUndoStack&&!i.sv.composingLock&&i.undo.addToUndoStack(i)},i.options.undoDelay)},Te=function(i,o){var s=(0,j.zh)(i),u=(0,N.S)(s.startContainer,"SPAN");u&&u.textContent.trim()!==""&&(o=`
|
|||
|
|
`+o),s.collapse(!0),document.execCommand("insertHTML",!1,o)},_e=function(i,o,s,u){var d=(0,j.zh)(i),f=o.getAttribute("data-type");i.sv.element.childNodes.length===0&&(i.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
|
|||
|
|
</span></span>`,(0,j.ib)(i.sv.element,d));var E=(0,y.F9)(d.startContainer),L=(0,N.S)(d.startContainer,"SPAN");if(E){if(f==="link"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(u):D="".concat(s).concat(d.toString()).concat(u.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,D);return}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"||f==="line"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(f==="code"?"":u):D="".concat(s).concat(d.toString()).concat(Lute.Caret).concat(f==="code"?"":u),f==="table"||f==="code"&&L&&L.textContent!==""?D=`
|
|||
|
|
|
|||
|
|
`+D:f==="line"&&(D=`
|
|||
|
|
|
|||
|
|
`.concat(s,`
|
|||
|
|
`).concat(Lute.Caret)),document.execCommand("insertHTML",!1,D);return}else if((f==="check"||f==="list"||f==="ordered-list"||f==="quote")&&L){var _="* ";f==="check"?_="* [ ] ":f==="ordered-list"?_="1. ":f==="quote"&&(_="> ");var F=B(L,"newline");F?F.insertAdjacentText("afterend",_):E.insertAdjacentText("afterbegin",_),Z(i);return}(0,j.ib)(i.sv.element,d),ne(i)}},le=function(i){switch(i.currentMode){case"ir":return i.ir.element;case"wysiwyg":return i.wysiwyg.element;case"sv":return i.sv.element}},Ne=function(i,o){i.options.upload.setHeaders&&(i.options.upload.headers=i.options.upload.setHeaders()),i.options.upload.headers&&Object.keys(i.options.upload.headers).forEach(function(s){o.setRequestHeader(s,i.options.upload.headers[s])})},Qe=function(i,o,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(F){try{_(u.next(F))}catch(X){E(X)}}function D(F){try{_(u.throw(F))}catch(X){E(X)}}function _(F){F.done?f(F.value):d(F.value).then(L,D)}_((u=u.apply(i,o||[])).next())})},rt=function(i,o){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(F){return D([_,F])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=o.call(i,s)}catch(F){_=[6,F],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},Ot=function(){function i(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"}return i}(),Kt=function(i,o){i.tip.hide();var s=[],u="",d="";i.options.lang,i.options;for(var f=function(_,F){var X=o[F],be=!0;X.name||(u+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),be=!1),X.size>i.options.upload.max&&(u+="<li>".concat(X.name," ").concat(window.VditorI18n.over," ").concat(i.options.upload.max/1024/1024,"M</li>"),be=!1);var xe=X.name.lastIndexOf("."),pe=X.name.substr(xe),Se=i.options.upload.filename(X.name.substr(0,xe))+pe;if(i.options.upload.accept){var ke=i.options.upload.accept.split(",").some(function(me){var Pe=me.trim();if(Pe.indexOf(".")===0){if(pe.toLowerCase()===Pe.toLowerCase())return!0}else if(X.type.split("/")[0]===Pe.split("/")[0])return!0;return!1});ke||(u+="<li>".concat(X.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),be=!1)}be&&(s.push(X),d+="<li>".concat(Se," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))},E=o.length,L=0;L<E;L++)f(E,L);if(i.tip.show("<ul>".concat(u).concat(d,"</ul>")),i.options.upload.cancel){var D=i.tip.element.querySelector(".vditorCancelUpload");D&&D.addEventListener("click",function(){i.options.upload.cancel(s),i.tip.hide(),i.upload.isUploading=!1})}return s},cn=function(i,o){var s=le(o);s.focus();var u=JSON.parse(i),d="";u.code===1&&(d="".concat(u.msg)),u.data.errFiles&&u.data.errFiles.length>0&&(d="<ul><li>".concat(d,"</li>"),u.data.errFiles.forEach(function(E){var L=E.lastIndexOf("."),D=o.options.upload.filename(E.substr(0,L))+E.substr(L);d+="<li>".concat(D," ").concat(window.VditorI18n.uploadError,"</li>")}),d+="</ul>"),d?o.tip.show(d):o.tip.hide();var f="";Object.keys(u.data.succMap).forEach(function(E){var L=u.data.succMap[E],D=E.lastIndexOf("."),_=E.substr(D),F=o.options.upload.filename(E.substr(0,D))+_;_=_.toLowerCase(),
|
|||
|
|
data-block="0"><pre><code><audio controls="controls" src="`.concat(L,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(L,`"></audio></pre></div>
|
|||
|
|
`):o.currentMode==="ir"?f+='<audio controls="controls" src="'.concat(L,`"></audio>
|
|||
|
|
`):f+="[".concat(F,"](").concat(L,`)
|
|||
|
|
`):_.indexOf(".apng")===0||_.indexOf(".bmp")===0||_.indexOf(".gif")===0||_.indexOf(".ico")===0||_.indexOf(".cur")===0||_.indexOf(".jpg")===0||_.indexOf(".jpeg")===0||_.indexOf(".jfif")===0||_.indexOf(".pjp")===0||_.indexOf(".pjpeg")===0||_.indexOf(".png")===0||_.indexOf(".svg")===0||_.indexOf(".webp")===0?o.currentMode==="wysiwyg"?f+='<img alt="'.concat(F,'" src="').concat(L,`">
|
|||
|
|
`):f+=".concat(L,`)
|
|||
|
|
`):o.currentMode==="wysiwyg"?f+='<a href="'.concat(L,'">').concat(F,`</a>
|
|||
|
|
`):f+="[".concat(F,"](").concat(L,`)
|
|||
|
|
`)}),(0,j.Hc)(o.upload.range),document.execCommand("insertHTML",!1,f),o.upload.range=getSelection().getRangeAt(0).cloneRange()},wn=function(i,o,s){return Qe(void 0,void 0,void 0,function(){var u,d,pe,f,E,E,L,D,_,F,X,be,xe,pe,Se,ke;return rt(this,function(me){switch(me.label){case 0:for(u=[],d=i.options.upload.multiple===!0?o.length:1,pe=0;pe<d;pe++)f=o[pe],f instanceof DataTransferItem&&(f=f.getAsFile()),u.push(f);return i.options.upload.handler?[4,i.options.upload.handler(u)]:[3,2];case 1:return E=me.sent(),s&&(s.value=""),typeof E=="string"?(i.tip.show(E),[2]):[2];case 2:return!i.options.upload.url||!i.upload?(s&&(s.value=""),i.tip.show("please config: options.upload.url"),[2]):i.options.upload.file?[4,i.options.upload.file(u)]:[3,4];case 3:u=me.sent(),me.label=4;case 4:if(i.options.upload.validate&&(E=i.options.upload.validate(u),typeof E=="string"))return i.tip.show(E),[2];if(L=le(i),i.upload.range=(0,j.zh)(i),D=Kt(i,u),D.length===0)return s&&(s.value=""),[2];for(_=new FormData,F=i.options.upload.extraData,X=0,be=Object.keys(F);X<be.length;X++)xe=be[X],_.append(xe,F[xe]);for(pe=0,Se=D.length;pe<Se;pe++)_.append(i.options.upload.fieldName,D[pe]);return ke=new XMLHttpRequest,i.upload.xhr=ke,ke.open("POST",i.options.upload.url),i.options.upload.token&&ke.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(ke.withCredentials=!0),Ne(i,ke),i.upload.isUploading=!0,L.setAttribute("contenteditable","false"),ke.onreadystatechange=function(){if(ke.readyState===XMLHttpRequest.DONE){if(i.upload.isUploading=!1,L.setAttribute("contenteditable","true"),ke.status>=200&&ke.status<300)if(i.options.upload.success)i.options.upload.success(L,ke.responseText);else{var Pe=ke.responseText;i.options.upload.format&&(Pe=i.options.upload.format(o,ke.responseText)),cn(Pe,i)}else i.options.upload.error?i.options.upload.error(ke.responseText):i.tip.show(ke.responseText);s&&(s.value=""),i.upload.element.style.display="none",i.upload.xhr=void 0}},ke.upload.onprogress=function(Pe){if(Pe.lengthComputable){var Ce=Pe.loaded/Pe.total*100;i.upload.element.style.display="block";var Ve=i.upload.element;Ve.style.width=Ce+"%"}},ke.send(_),[2]}})})},On=function(i,o,s){var u,d=(0,y.F9)(o.startContainer);if(d||(d=i.wysiwyg.element),s&&s.inputType!=="formatItalic"&&s.inputType!=="deleteByDrag"&&s.inputType!=="insertFromDrop"&&s.inputType!=="formatBold"&&s.inputType!=="formatRemove"&&s.inputType!=="formatStrikeThrough"&&s.inputType!=="insertUnorderedList"&&s.inputType!=="insertOrderedList"&&s.inputType!=="formatOutdent"&&s.inputType!=="formatIndent"&&s.inputType!==""||!s){var f=gt(o.startContainer);f&&f.remove(),i.wysiwyg.element.querySelectorAll("wbr").forEach(function(Ce){Ce.remove()}),o.insertNode(document.createElement("wbr")),d.querySelectorAll("[style]").forEach(function(Ce){Ce.removeAttribute("style")}),d.querySelectorAll(".vditor-comment").forEach(function(Ce){Ce.textContent.trim()===""&&(Ce.classList.remove("vditor-comment","vditor-comment--focus"),Ce.removeAttribute("data-cmtids"))}),(u=d.previousElementSibling)===null||u===void 0||u.querySelectorAll(".vditor-comment").forEach(function(Ce){Ce.textContent.trim()===""&&(Ce.classList.remove("vditor-comment","vditor-comment--focus"),Ce.removeAttribute("data-cmtids"))});var E="";d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.wysiwyg.element);var L=d.isEqualNode(i.wysiwyg.element),D=(0,y.a1)(d,"data-type","footnotes-block");if(L)E=d.innerHTML;else{var _=(0,y.O9)(o.startContainer);if(_&&!D){var F=(0,N.S)(o.startContainer,"BLOCKQUOTE");F?d=(0,y.F9)(o.startContainer)||d:d=_}if(D&&(d=D),E=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var X=d.previousElementSibling,be=d.nextElementSibling;X&&(X.tagName==="UL"||X.tagName==="OL")&&(E=X.outerHTML+E,X.remove()),be&&(be.tagName==="UL"||be.tagName==="OL")&&(E=E+be.outerHTML,be.remove()),E=E.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}d.innerText.startsWith("```")||(i.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Ce){Ce&&!d.isEqualNode(Ce)&&(E+=Ce.outerHTML,Ce.re
|
|||
|
|
</p>`)),(0,j.ib)(i[i.currentMode].element,s),pr(i),ct(i))},Lu=function(i){var o=(0,y.lG)(i,"TABLE");return o&&o.rows[0].cells[0].isSameNode(i)?o:!1},_u=function(i){var o=(0,y.lG)(i,"TABLE");return o&&o.lastElementChild.lastElementChild.lastElementChild.isSameNode(i)?o:!1},Hs=function(i,o,s){s===void 0&&(s=!0);var u=i.previousElementSibling;return u||(i.parentElement.previousElementSibling?u=i.parentElement.previousElementSibling.lastElementChild:i.parentElement.parentElement.tagName==="TBODY"&&i.parentElement.parentElement.previousElementSibling?u=i.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:u=null),u&&(o.selectNodeContents(u),s||o.collapse(!1),(0,j.Hc)(o)),u},Di=function(i,o,s,u,d){var f=(0,j.im)(u,i[i.currentMode].element,s);if(o.key==="ArrowDown"&&u.textContent.trimRight().substr(f.start).indexOf(`
|
|||
|
|
`)===-1||o.key==="ArrowRight"&&f.start>=u.textContent.trimRight().length){var E=d.nextElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!0),(0,j.Hc)(s)),o.preventDefault(),!0}return!1},Yr=function(i,o,s,u,d){var f=(0,j.im)(u,i[i.currentMode].element,s);if(o.key==="ArrowUp"&&u.textContent.substr(0,f.start).indexOf(`
|
|||
|
|
`)===-1||(o.key==="ArrowLeft"||o.key==="Backspace"&&s.toString()==="")&&f.start===0){var E=d.previousElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!1),(0,j.Hc)(s)),o.preventDefault(),!0}return!1},ga=function(i,o,s,u){u===void 0&&(u=!0);var d=(0,y.lG)(o.startContainer,"LI");if(i[i.currentMode].element.querySelectorAll("wbr").forEach(function(F){F.remove()}),o.insertNode(document.createElement("wbr")),u&&d){for(var f="",E=0;E<d.parentElement.childElementCount;E++){var L=d.parentElement.children[E].querySelector("input");L&&L.remove(),f+='<p data-block="0">'.concat(d.parentElement.children[E].innerHTML.trimLeft(),"</p>")}d.parentElement.insertAdjacentHTML("beforebegin",f),d.parentElement.remove()}else if(d)if(s==="check")d.parentElement.querySelectorAll("li").forEach(function(F){F.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(F.textContent.indexOf(" ")===0?"":" ")),F.classList.add("vditor-task")});else{d.querySelector("input")&&d.parentElement.querySelectorAll("li").forEach(function(F){F.querySelector("input").remove(),F.classList.remove("vditor-task")});var _=void 0;s==="list"?(_=document.createElement("ul"),_.setAttribute("data-marker","*")):(_=document.createElement("ol"),_.setAttribute("data-marker","1.")),_.setAttribute("data-block","0"),_.setAttribute("data-tight",d.parentElement.getAttribute("data-tight")),_.innerHTML=d.parentElement.innerHTML,d.parentElement.parentNode.replaceChild(_,d.parentElement)}else{var D=(0,y.a1)(o.startContainer,"data-block","0");D||(i[i.currentMode].element.querySelector("wbr").remove(),D=i[i.currentMode].element.querySelector("p"),D.innerHTML="<wbr>"),s==="check"?(D.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(D.innerHTML,"</li></ul>")),D.remove()):s==="list"?(D.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(D.innerHTML,"</li></ul>")),D.remove()):s==="ordered-list"&&(D.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(D.innerHTML,"</li></ol>")),D.remove())}},Ps=function(i,o,s){var u=o.previousElementSibling;if(o&&u){var d=[o];Array.from(s.cloneContents().children).forEach(function(D,_){D.nodeType!==3&&o&&D.textContent.trim()!==""&&o.getAttribute("data-node-id")===D.getAttribute("data-node-id")&&(_!==0&&d.push(o),o=o.nextElementSibling)}),i[i.currentMode].element.querySelectorAll("wbr").forEach(function(D){D.remove()}),s.insertNode(document.createElement("wbr"));var f=u.parentElement,E="";d.forEach(function(D){var _=D.getAttribute("data-marker");_.length!==1&&(_="1".concat(_.slice(-1))),E+='<li data-node-id="'.concat(D.getAttribute("data-node-id"),'" data-marker="').concat(_,'">').concat(D.innerHTML,"</li>"),D.remove()}),u.insertAdjacentHTML("beforeend","<".concat(f.tagName,' data-block="0">').concat(E,"</").concat(f.tagName,">")),i.currentMode==="wysiwyg"?f.outerHTML=i.lute.SpinVditorDOM(f.outerHTML):f.outerHTML=i.lute.SpinVditorIRDOM(f.outerHTML),(0,j.ib)(i[i.currentMode].element,s);var L=(0,y.O9)(s.startContainer);L&&L.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function(D){je(D,i),i.currentMode==="wysiwyg"&&D.previousElementSibling.setAttribute("style","display:none")}),ct(i),pr(i)}else i[i.currentMode].element.focus()},Lo=function(i,o,s,u){var d=(0,y.lG)(o.parentElement,"LI");if(d){i[i.currentMode].element.querySelectorAll("wbr").forEach(function(X){X.remove()}),s.insertNode(document.createElement("wbr"));var f=o.parentElement,E=f.cloneNode(),L=[o];Array.from(s.cloneContents().children).forEach(function(X,be){X.nodeType!==3&&o&&X.textContent.trim()!==""&&o.getAttribute("data-node-id")===X.getAttribute("data-node-id")&&(be!==0&&L.push(o),o=o.nextElementSibling)});var D=!1,_="";f.querySelectorAll("li").forEach(function(X){D&&(_+=X.outerHTML,!X.nextElementSibling&&!X.previousElementSibling?X.parentElement.remove():X.remove()),X.isSam
|
|||
|
|
`).pop();return o===""?!1:(o.replace(/ |-/g,"")===""||o.replace(/ |_/g,"")===""||o.replace(/ |\*/g,"")==="")&&o.replace(/ /g,"").length>2?!(o.indexOf("-")>-1&&o.trimLeft().indexOf(" ")===-1&&i.trimRight().split(`
|
|||
|
|
`).length>1||o.indexOf(" ")===0||o.indexOf(" ")===0):!1},No=function(i){var o=i.trimRight().split(`
|
|||
|
|
`);return i=o.pop(),i.indexOf(" ")===0||i.indexOf(" ")===0||(i=i.trimLeft(),i===""||o.length===0)?!1:i.replace(/-/g,"")===""||i.replace(/=/g,"")===""},ct=function(i,o){o===void 0&&(o={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),i.currentMode==="wysiwyg"?He(i,o):i.currentMode==="ir"?lr(i,o):i.currentMode==="sv"&&ne(i,o)},zs=function(i,o,s,u){var d,f=i.startContainer,E=(0,y.lG)(f,"LI");if(E){if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Enter"&&!u.shiftKey&&s&&E.contains(s)&&s.nextElementSibling)return E&&!E.textContent.endsWith(`
|
|||
|
|
`)&&E.insertAdjacentText("beforeend",`
|
|||
|
|
`),i.insertNode(document.createTextNode(`
|
|||
|
|
|
|||
|
|
`)),i.collapse(!1),ct(o),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&!E.previousElementSibling&&i.toString()===""&&(0,j.im)(E,o[o.currentMode].element,i).start===0)return E.nextElementSibling?(E.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>")),E.remove()):E.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>"),(0,j.ib)(o[o.currentMode].element,i),ct(o),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&E.textContent.trim().replace(c.g.ZWSP,"")===""&&i.toString()===""&&((d=E.previousElementSibling)===null||d===void 0?void 0:d.tagName)==="LI")return E.previousElementSibling.insertAdjacentText("beforeend",`
|
|||
|
|
|
|||
|
|
`),i.selectNodeContents(E.previousElementSibling),i.collapse(!1),E.remove(),(0,j.ib)(o[o.currentMode].element,i),ct(o),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Tab"){var L=!1;if((i.startOffset===0&&(f.nodeType===3&&!f.previousSibling||f.nodeType!==3&&f.nodeName==="LI")||E.classList.contains("vditor-task")&&i.startOffset===1&&f.previousSibling.nodeType!==3&&f.previousSibling.tagName==="INPUT")&&(L=!0),L||i.toString()!=="")return u.shiftKey?Lo(o,E,i,E.parentElement):Ps(o,E,i),u.preventDefault(),!0}}return!1},Do=function(i,o,s){if(i.options.tab&&s.key==="Tab")return s.shiftKey||(o.toString()===""?(o.insertNode(document.createTextNode(i.options.tab)),o.collapse(!1)):(o.extractContents(),o.insertNode(document.createTextNode(i.options.tab)),o.collapse(!1))),(0,j.Hc)(o),ct(i),s.preventDefault(),!0},Bs=function(i,o,s,u){if(s){if(!(0,m.yl)(i)&&!i.altKey&&i.key==="Enter"){var d=String.raw(Ys||(Ys=Zr(["",""],["",""])),s.textContent).replace(/\\\|/g,"").trim(),f=d.split("|");if(d.startsWith("|")&&d.endsWith("|")&&f.length>3){var E=f.map(function(){return"---"}).join("|");return E=s.textContent+`
|
|||
|
|
`+E.substring(3,E.length-3)+`
|
|||
|
|
|<wbr>`,s.outerHTML=o.lute.SpinVditorDOM(E),(0,j.ib)(o[o.currentMode].element,u),ct(o),Bt(o),i.preventDefault(),!0}if(_o(s.innerHTML)&&s.previousElementSibling){var L="",D=s.innerHTML.trimRight().split(`
|
|||
|
|
`);return D.length>1&&(D.pop(),L='<p data-block="0">'.concat(D.join(`
|
|||
|
|
`),"</p>")),s.insertAdjacentHTML("afterend","".concat(L,`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`)),s.remove(),(0,j.ib)(o[o.currentMode].element,u),ct(o),Bt(o),i.preventDefault(),!0}if(No(s.innerHTML))return o.currentMode==="wysiwyg"?s.outerHTML=o.lute.SpinVditorDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`):s.outerHTML=o.lute.SpinVditorIRDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`),(0,j.ib)(o[o.currentMode].element,u),ct(o),Bt(o),i.preventDefault(),!0}if(u.collapsed&&s.previousElementSibling&&i.key==="Backspace"&&!(0,m.yl)(i)&&!i.altKey&&!i.shiftKey&&s.textContent.trimRight().split(`
|
|||
|
|
`).length>1&&(0,j.im)(s,o[o.currentMode].element,u).start===0){var _=(0,y.DX)(s.previousElementSibling);return _.textContent.endsWith(`
|
|||
|
|
`)||(_.textContent=_.textContent+`
|
|||
|
|
`),_.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(s.innerHTML)),s.remove(),(0,j.ib)(o[o.currentMode].element,u),!1}return!1}},Fs=function(i,o,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');s.tagName==="TH"?s.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(u,"</tr></tbody>")):s.parentElement.insertAdjacentHTML("afterend","<tr>".concat(u,"</tr>")),ct(i)},qs=function(i,o,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)s.tagName==="TH"?u+='<th align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </th>'):u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');if(s.tagName==="TH"){s.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(u,"</tr></thead>")),o.insertNode(document.createElement("wbr"));var f=s.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");s.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",f),s.parentElement.parentElement.remove(),(0,j.ib)(i.ir.element,o)}else s.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(u,"</tr>"));ct(i)},ba=function(i,o,s,u){u===void 0&&(u="afterend");for(var d=0,f=s.previousElementSibling;f;)d++,f=f.previousElementSibling;for(var E=0;E<o.rows.length;E++)E===0?o.rows[E].cells[d].insertAdjacentHTML(u,"<th> </th>"):o.rows[E].cells[d].insertAdjacentHTML(u,"<td> </td>");ct(i)},js=function(i,o,s){if(s.tagName==="TD"){var u=s.parentElement.parentElement;s.parentElement.previousElementSibling?o.selectNodeContents(s.parentElement.previousElementSibling.lastElementChild):o.selectNodeContents(u.previousElementSibling.lastElementChild.lastElementChild),u.childElementCount===1?u.remove():s.parentElement.remove(),o.collapse(!1),(0,j.Hc)(o),ct(i)}},$s=function(i,o,s,u){for(var d=0,f=u.previousElementSibling;f;)d++,f=f.previousElementSibling;(u.previousElementSibling||u.nextElementSibling)&&(o.selectNodeContents(u.previousElementSibling||u.nextElementSibling),o.collapse(!0));for(var E=0;E<s.rows.length;E++){var L=s.rows[E].cells;if(L.length===1){s.remove(),pr(i);break}L[d].remove()}(0,j.Hc)(o),ct(i)},Us=function(i,o,s){var u=s.startContainer,d=(0,y.lG)(u,"TD")||(0,y.lG)(u,"TH");if(d){if(!(0,m.yl)(o)&&!o.altKey&&o.key==="Enter"){(!d.lastElementChild||d.lastElementChild&&(!d.lastElementChild.isSameNode(d.lastChild)||d.lastElementChild.tagName!=="BR"))&&d.insertAdjacentHTML("beforeend","<br>");var f=document.createElement("br");return s.insertNode(f),s.setStartAfter(f),ct(i),Bt(i),o.preventDefault(),!0}if(o.key==="Tab"){if(o.shiftKey)return Hs(d,s),o.preventDefault(),!0;var E=d.nextElementSibling;return E||(d.parentElement.nextElementSibling?E=d.parentElement.nextElementSibling.firstElementChild:d.parentElement.parentElement.tagName==="THEAD"&&d.parentElement.parentElement.nextElementSibling?E=d.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:E=null),E&&(s.selectNodeContents(E),(0,j.Hc)(s)),o.preventDefault(),!0}var L=d.parentElement.parentElement.parentElement;if(o.key==="ArrowUp"){if(o.preventDefault(),d.tagName==="TH")return L.previousElementSibling?(s.selectNodeContents(L.previousElementSibling),s.collapse(!1),(0,j.Hc)(s)):Ni(i,"beforebegin"),!0;for(var D=0,_=d.parentElement;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var F=_.previousElementSibling;return F||(F=_.parentElement.previousElementSibling.firstChild),s.selectNodeContents(F.cells[D]),s.collapse(!1),(0,j.Hc)(s),!0}if(o.key==="ArrowDown"){o.preventDefault();var _=d.parentElement;if(!_.nextElementSibling&&d.tagName==="TD")return L.nextElementSibling?(s.selectNodeContents(L.nextElementSibling),s.collapse(!0),(0,j.Hc)(s)):Ni(i,"afterend"),!0;for(var D=0;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var E=_.nextElementSibling;return E||(E=_.parentElement.nextElementSibling.firstChild),s.selectNodeContents(E.cells[D]),s.collapse(!0),(0,j.Hc)(s),!0}if(i.currentMode==="wysiwyg"&&!(0,m.yl)(o)&&o.key==="Enter"&&!o.
|
|||
|
|
</p>`,(0,j.ib)(i[i.currentMode].element,s)):(s.setStartBefore(L),s.collapse(!0)),ct(i)),o.preventDefault(),!0}if(se("⇧⌘F",o))return qs(i,s,d),o.preventDefault(),!0;if(se("⌘=",o))return Fs(i,s,d),o.preventDefault(),!0;if(se("⇧⌘G",o))return ba(i,L,d,"beforebegin"),o.preventDefault(),!0;if(se("⇧⌘=",o))return ba(i,L,d),o.preventDefault(),!0;if(se("⌘-",o))return js(i,s,d),o.preventDefault(),!0;if(se("⇧⌘-",o))return $s(i,s,L,d),o.preventDefault(),!0;if(se("⇧⌘L",o)){if(i.currentMode==="ir")return va(L,"left"),ct(i),o.preventDefault(),!0;var xe=i.wysiwyg.popover.querySelector('[data-type="left"]');if(xe)return xe.click(),o.preventDefault(),!0}if(se("⇧⌘C",o)){if(i.currentMode==="ir")return va(L,"center"),ct(i),o.preventDefault(),!0;var xe=i.wysiwyg.popover.querySelector('[data-type="center"]');if(xe)return xe.click(),o.preventDefault(),!0}if(se("⇧⌘R",o)){if(i.currentMode==="ir")return va(L,"right"),ct(i),o.preventDefault(),!0;var xe=i.wysiwyg.popover.querySelector('[data-type="right"]');if(xe)return xe.click(),o.preventDefault(),!0}}return!1},Vs=function(i,o,s,u){if(s.tagName==="PRE"&&se("⌘A",o))return u.selectNodeContents(s.firstElementChild),o.preventDefault(),!0;if(i.options.tab&&o.key==="Tab"&&!o.shiftKey&&u.toString()==="")return u.insertNode(document.createTextNode(i.options.tab)),u.collapse(!1),ct(i),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey){var d=(0,j.im)(s,i[i.currentMode].element,u);if((d.start===0||d.start===1&&s.innerText===`
|
|||
|
|
`)&&u.toString()==="")return s.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(s.firstElementChild.innerHTML,"</p>"),(0,j.ib)(i[i.currentMode].element,u),ct(i),o.preventDefault(),!0}return!(0,m.yl)(o)&&!o.altKey&&o.key==="Enter"?(s.firstElementChild.textContent.endsWith(`
|
|||
|
|
`)||s.firstElementChild.insertAdjacentText("beforeend",`
|
|||
|
|
`),u.extractContents(),u.insertNode(document.createTextNode(`
|
|||
|
|
`)),u.collapse(!1),(0,j.Hc)(u),(0,m.vU)()||(i.currentMode==="wysiwyg"?On(i,u):Mt(i,u)),Bt(i),o.preventDefault(),!0):!1},Ws=function(i,o,s,u){var d=o.startContainer,f=(0,y.lG)(d,"BLOCKQUOTE");if(f&&o.toString()===""){if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&(0,j.im)(f,i[i.currentMode].element,o).start===0)return o.insertNode(document.createElement("wbr")),f.outerHTML=f.innerHTML,(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0;if(u&&s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&u.parentElement.tagName==="BLOCKQUOTE"){var E=!1;if(u.innerHTML.replace(c.g.ZWSP,"")===`
|
|||
|
|
`||u.innerHTML.replace(c.g.ZWSP,"")===""?(E=!0,u.remove()):u.innerHTML.endsWith(`
|
|||
|
|
|
|||
|
|
`)&&(0,j.im)(u,i[i.currentMode].element,o).start===u.textContent.length-1&&(u.innerHTML=u.innerHTML.substr(0,u.innerHTML.length-2),E=!0),E)return f.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,`<wbr>
|
|||
|
|
</p>`)),(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0}var L=(0,y.F9)(d);if(i.currentMode==="wysiwyg"&&L&&se("⇧⌘;",s))return o.insertNode(document.createElement("wbr")),L.outerHTML='<blockquote data-block="0">'.concat(L.outerHTML,"</blockquote>"),(0,j.ib)(i.wysiwyg.element,o),He(i),s.preventDefault(),!0;if(Di(i,s,o,f,f)||Yr(i,s,o,f,f))return!0}return!1},Gs=function(i,o,s){var u=o.startContainer,d=(0,y.lG)(u,"LI");if(d&&d.classList.contains("vditor-task")){if(se("⇧⌘J",s)){var f=d.firstElementChild;return f.checked?f.removeAttribute("checked"):f.setAttribute("checked","checked"),ct(i),s.preventDefault(),!0}if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&o.toString()===""&&o.startOffset===1&&(u.nodeType===3&&u.previousSibling&&u.previousSibling.tagName==="INPUT"||u.nodeType!==3)){var E=d.previousElementSibling;if(d.querySelector("input").remove(),E){var L=(0,y.DX)(E);L.parentElement.insertAdjacentHTML("beforeend","<wbr>"+d.innerHTML.trim()),d.remove()}else d.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(d.innerHTML.trim()||`
|
|||
|
|
`,"</p>")),d.nextElementSibling?d.remove():d.parentElement.remove();return(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0}if(s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey){if(d.textContent.trim()==="")if((0,y.fb)(d.parentElement,"vditor-task")){var D=(0,y.O9)(u);D&&Lo(i,d,o,D)}else if(d.nextElementSibling){var _="",F="",X=!1;Array.from(d.parentElement.children).forEach(function(Se){d.isSameNode(Se)?X=!0:X?_+=Se.outerHTML:F+=Se.outerHTML});var be=d.parentElement.tagName,xe=d.parentElement.tagName==="OL"?"":' data-marker="'.concat(d.parentElement.getAttribute("data-marker"),'"'),pe="";F&&(pe=d.parentElement.tagName==="UL"?"":' start="1"',F="<".concat(be,' data-tight="true"').concat(xe,' data-block="0">').concat(F,"</").concat(be,">")),d.parentElement.outerHTML="".concat(F,`<p data-block="0"><wbr>
|
|||
|
|
</p><`).concat(be,`
|
|||
|
|
data-tight="true"`).concat(xe,' data-block="0"').concat(pe,">").concat(_,"</").concat(be,">")}else d.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
|
|||
|
|
</p>`),d.parentElement.querySelectorAll("li").length===1?d.parentElement.remove():d.remove();else u.nodeType!==3&&o.startOffset===0&&u.firstChild.tagName==="INPUT"?o.setStart(u.childNodes[1],1):(o.setEndAfter(d.lastChild),d.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(d.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(o.extractContents()));return(0,j.ib)(i[i.currentMode].element,o),ct(i),Bt(i),s.preventDefault(),!0}}return!1},Ks=function(i,o,s,u){if(o.startContainer.nodeType!==3){var d=o.startContainer.children[o.startOffset];if(d&&d.tagName==="HR")return o.selectNodeContents(d.previousElementSibling),o.collapse(!1),s.preventDefault(),!0}if(u){var f=u.previousElementSibling;if(f&&(0,j.im)(u,i[i.currentMode].element,o).start===0&&((0,m.vU)()&&f.tagName==="HR"||f.tagName==="TABLE")){if(f.tagName==="TABLE"){var E=f.lastElementChild.lastElementChild.lastElementChild;E.innerHTML=E.innerHTML.trimLeft()+"<wbr>"+u.textContent.trim(),u.remove()}else f.remove();return(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0}}return!1},Xs=function(i){(0,m.vU)()&&i.startContainer.nodeType!==3&&i.startContainer.tagName==="HR"&&i.setStartBefore(i.startContainer)},Zs=function(i,o,s){var u,d;if(!(0,m.vU)())return!1;if(i.key==="ArrowUp"&&o&&((u=o.previousElementSibling)===null||u===void 0?void 0:u.tagName)==="TABLE"){var f=o.previousElementSibling;return s.selectNodeContents(f.rows[f.rows.length-1].lastElementChild),s.collapse(!1),i.preventDefault(),!0}return i.key==="ArrowDown"&&o&&((d=o.nextElementSibling)===null||d===void 0?void 0:d.tagName)==="TABLE"?(s.selectNodeContents(o.nextElementSibling.rows[0].cells[0]),s.collapse(!0),i.preventDefault(),!0):!1},ya=function(i,o,s){return Vi(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,F,X,be,xe,pe,Se,me,ke,me,Pe;return pi(this,function(Ce){switch(Ce.label){case 0:return i[i.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(o.stopPropagation(),o.preventDefault(),"clipboardData"in o?(u=o.clipboardData.getData("text/html"),d=o.clipboardData.getData("text/plain"),f=o.clipboardData.files):(u=o.dataTransfer.getData("text/html"),d=o.dataTransfer.getData("text/plain"),o.dataTransfer.types.includes("Files")&&(f=o.dataTransfer.items)),E={},L=function(Ve,Et){if(!Et)return["",Lute.WalkContinue];if(i.options.upload.renderLinkDest)return i.options.upload.renderLinkDest(i,Ve,Et);var wt=Ve.TokensStr();if(Ve.__internal_object__.Parent.Type===34&&wt&&wt.indexOf("file://")===-1&&i.options.upload.linkToImgUrl){var Ct=new XMLHttpRequest;Ct.open("POST",i.options.upload.linkToImgUrl),i.options.upload.token&&Ct.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(Ct.withCredentials=!0),Ne(i,Ct),Ct.setRequestHeader("Content-Type","application/json; charset=utf-8"),Ct.onreadystatechange=function(){if(Ct.readyState===XMLHttpRequest.DONE){if(Ct.status===200){var vn=Ct.responseText;i.options.upload.linkToImgFormat&&(vn=i.options.upload.linkToImgFormat(Ct.responseText));var Yt=JSON.parse(vn);if(Yt.code!==0){i.tip.show(Yt.msg);return}var bn=Yt.data.originalURL;if(i.currentMode==="sv")i.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(Ut){Ut.textContent===bn&&(Ut.textContent=Yt.data.url)});else{var ot=i[i.currentMode].element.querySelector('img[src="'.concat(bn,'"]'));ot.src=Yt.data.url,i.currentMode==="ir"&&(ot.previousElementSibling.previousElementSibling.innerHTML=Yt.data.url)}ct(i)}else i.tip.show(Ct.responseText);i.options.upload.linkToImgCallback&&i.options.upload.linkToImgCallback(Ct.responseText)}},Ct.send(JSON.stringify({url:wt}))}return i.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(wt),"</span>"),Lute.WalkContinue]:i.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(wt),"</span>"),Lute.WalkContinue]},(u.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(d,'">').concat(d
|
|||
|
|
`):Ve+=".concat(pe.result.toString(),`)
|
|||
|
|
`),document.execCommand("insertHTML",!1,Ve)}),Ce.label=8;case 8:return[3,10];case 9:d.trim()!==""&&f.length===0&&(me=(0,j.zh)(i),me.toString()!==""&&i.lute.IsValidLinkDest(d)&&(d="[".concat(me.toString(),"](").concat(d,")")),i.currentMode==="ir"?(E.Md2VditorIRDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,j.oC)(Lute.Sanitize(i.lute.Md2VditorIRDOM(d)),i)):i.currentMode==="wysiwyg"?(E.Md2VditorDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,j.oC)(Lute.Sanitize(i.lute.Md2VditorDOM(d)),i)):(E.Md2VditorSVDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),he(i,d)),i.outline.render(i)),Ce.label=10;case 10:return i.currentMode!=="sv"&&(ke=(0,y.F9)((0,j.zh)(i).startContainer),ke&&(me=(0,j.zh)(i),i[i.currentMode].element.querySelectorAll("wbr").forEach(function(Ve){Ve.remove()}),me.insertNode(document.createElement("wbr")),i.currentMode==="wysiwyg"?ke.outerHTML=i.lute.SpinVditorDOM(ke.outerHTML):ke.outerHTML=i.lute.SpinVditorIRDOM(ke.outerHTML),(0,j.ib)(i[i.currentMode].element,me)),i[i.currentMode].element.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function(Ve){je(Ve,i)})),i.wysiwyg.triggerRemoveComment(i),ct(i),i[i.currentMode].element.scrollHeight-_>Math.min(i[i.currentMode].element.clientHeight,window.innerHeight)/2&&Bt(i),[2]}})})},Nu=function(i,o,s){return Vi(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,F,X,Se,be,xe,pe,Se,ke,me;return pi(this,function(Pe){switch(Pe.label){case 0:if(!s)return[2];if(u=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,d=new RegExp("(?:("+u.source+"))([\\da-fA-F\\s]+)\\}","g"),f=s.match(d),E=[],f)for(L=0,D=f;L<D.length;L++)_=D[L],F=void 0,_.includes("\\pngblip")?F="image/png":_.includes("\\jpegblip")&&(F="image/jpeg"),F&&E.push({hex:_.replace(u,"").replace(/[^\da-fA-F]/g,""),type:F});for(X=[],Ro(o,function(Ce){if(Ce.tagName==="V:SHAPE")return Ro(Ce,function(Ve){Ve.tagName==="V:IMAGEDATA"&&X.push({shape:Ce,img:Ve})}),!1}),Se=0;Se<X.length;Se++)be=document.createElement("img"),xe="data:"+E[Se].type+";base64,"+btoa((E[Se].hex.match(/\w{2}/g)||[]).map(function(Ce){return String.fromCharCode(parseInt(Ce,16))}).join("")),be.src=xe,be.title=X[Se].img.getAttribute("title"),X[Se].shape.parentNode.replaceChild(be,X[Se].shape);pe=o.querySelectorAll("img"),Se=0,Pe.label=1;case 1:return Se<pe.length?(ke=pe[Se].src||"",ke?(me=pe[Se],[4,i.options.upload.base64ToLink(ke)]):[3,3]):[3,4];case 2:me.src=Pe.sent(),Pe.label=3;case 3:return Se++,[3,1];case 4:return[2]}})})},Ro=function(i,o){var s=o(i);if(s!==!1)for(var u=0;u<i.children.length;u++)Ro(i.children[u],o)},Ys,Js=function(i){var o,s;i.hint.render(i);var u=(0,j.zh)(i).startContainer,d=(0,y.a1)(u,"data-type","code-block-info");if(d)if(d.textContent.replace(c.g.ZWSP,"")===""&&i.hint.recentLanguage){d.textContent=c.g.ZWSP+i.hint.recentLanguage;var f=(0,j.zh)(i);f.selectNodeContents(d)}else{var E=[],L=d.textContent.substring(0,(0,j.im)(d,i.ir.element).start).replace(c.g.ZWSP,"");(i.options.preview.hljs.langs||c.g.ALIAS_CODE_LANGUAGES.concat(((s=(o=window.hljs)===null||o===void 0?void 0:o.listLanguages())!==null&&s!==void 0?s:[]).sort())).forEach(function(D){D.indexOf(L.toLowerCase())>-1&&E.push({html:D,value:D})}),i.hint.genHTML(E,L,i)}},lr=function(i,o){o===void 0&&(o={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),o.enableHint&&Js(i),clearTimeout(i.ir.processTimeoutId),i.ir.processTimeoutId=window.setTimeout(function(){if(!i.ir.composingLock){var s=v(i);typeof i.options.input=="function"&&o.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),o.enableAddUndoStack&&i.undo.addToUndoStack(i)}},i.options.undoDelay)},Ri=function(i,o){var s=(0,j.zh)(i),u=(0,y.F9)(s.startContainer)||s.startContainer;if(u){var d=u.querySelector(".vditor-ir__marker--heading");d?d.innerHTML=o:(u.insertAdjacentText("afterbegin",o),s.selectNodeContents(u),s.collapse(
|
|||
|
|
</p>`;X.innerHTML.trim()===""?X.outerHTML=be:X.insertAdjacentHTML("afterend",be)}}else if(f==="quote")X&&(d.insertNode(document.createElement("wbr")),X.outerHTML='<blockquote data-block="0">'.concat(X.outerHTML,"</blockquote>"),L=!1,o.classList.add("vditor-menu--current"));else if(f==="link"){var xe=void 0;d.toString()===""?xe="".concat(s,"<wbr>").concat(u):xe="".concat(s).concat(d.toString()).concat(u.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,xe),L=!1,o.classList.add("vditor-menu--current")}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"){var xe=void 0;d.toString()===""?xe="".concat(s,"<wbr>").concat(u):(f==="code"?xe="".concat(s,`
|
|||
|
|
`).concat(d.toString(),"<wbr>").concat(u):f==="table"?xe="".concat(s).concat(d.toString(),"<wbr>").concat(u):xe="".concat(s).concat(d.toString()).concat(u,"<wbr>"),d.deleteContents()),(f==="table"||f==="code")&&(xe=`
|
|||
|
|
`+xe+`
|
|||
|
|
|
|||
|
|
`);var pe=document.createElement("span");pe.innerHTML=xe,d.insertNode(pe),Mt(i,d),f==="table"&&(d.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,j.Hc)(d))}else(f==="check"||f==="list"||f==="ordered-list")&&(ga(i,d,f,!1),L=!1,x(i.toolbar.elements,["check","list","ordered-list"]),o.classList.add("vditor-menu--current"))}(0,j.ib)(i.ir.element,d),lr(i),L&&Ue(i)},Ru=function(i,o,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(F){try{_(u.next(F))}catch(X){E(X)}}function D(F){try{_(u.throw(F))}catch(X){E(X)}}function _(F){F.done?f(F.value):d(F.value).then(L,D)}_((u=u.apply(i,o||[])).next())})},Ou=function(i,o){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(F){return D([_,F])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=o.call(i,s)}catch(F){_=[6,F],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},Iu=function(){function i(o){var s=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(u,d){s.element.style.display="none";var f=decodeURIComponent(u.getAttribute("data-value")),E=window.getSelection().getRangeAt(0);if(d.currentMode==="ir"){var L=(0,y.a1)(E.startContainer,"data-type","code-block-info");if(L){L.textContent=c.g.ZWSP+f.trimRight(),E.selectNodeContents(L),E.collapse(!1),lr(d),L.parentElement.querySelectorAll("code").forEach(function(X){X.className="language-"+f.trimRight()}),je(L.parentElement.querySelector(".vditor-ir__preview"),d),s.recentLanguage=f.trimRight();return}}if(d.currentMode==="wysiwyg"&&E.startContainer.nodeType!==3){var D=E.startContainer,_=void 0;if(D.classList.contains("vditor-input")?_=D:_=D.firstElementChild,_&&_.classList.contains("vditor-input")){_.value=f.trimRight(),E.selectNodeContents(_),E.collapse(!1),_.dispatchEvent(new CustomEvent("input",{detail:1})),s.recentLanguage=f.trimRight();return}}if(E.setStart(E.startContainer,s.lastIndex),E.deleteContents(),d.options.hint.parse?d.currentMode==="sv"?(0,j.oC)(d.lute.SpinVditorSVDOM(f),d):d.currentMode==="wysiwyg"?(0,j.oC)(d.lute.SpinVditorDOM(f),d):(0,j.oC)(d.lute.SpinVditorIRDOM(f),d):(0,j.oC)(f,d),s.splitChar===":"&&f.indexOf(":")>-1&&d.currentMode!=="sv"&&E.insertNode(document.createTextNode(" ")),E.collapse(!1),(0,j.Hc)(E),d.currentMode==="wysiwyg"){var F=(0,y.fb)(E.startContainer,"vditor-wysiwyg__block");F&&F.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(F.lastElementChild.innerHTML=F.firstElementChild.innerHTML,je(F.lastElementChild,d))}else if(d.currentMode==="ir"){var F=(0,y.fb)(E.startContainer,"vditor-ir__marker--pre");F&&F.nextElementSibling.classList.contains("vditor-ir__preview")&&(F.nextElementSibling.innerHTML=F.innerHTML,je(F.nextElementSibling,d))}ct(d)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",o.push({key:":"})}return i.prototype.render=function(o){var s=this;if(window.getSelection().focusNode){var u,d=getSelection().getRangeAt(0);u=d.startContainer.textContent.substring(0,d.startOffset)||"";var f=this.getKey(u,o.options.hint.extend);if(typeof f>"u")this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var E=f===""?o.options.
|
|||
|
|
`).concat(be===0?"class='vditor-hint--current'":"","> ").concat(xe,"</button>")}}),this.element.innerHTML=_;var F=parseInt(document.defaultView.getComputedStyle(f,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(D+(F||22),"px"),this.element.style.left="".concat(L,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(X){X.addEventListener("click",function(be){d.fillEmoji(X,u),be.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(D-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},i.prototype.select=function(o,s){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var u=this.element.querySelector(".vditor-hint--current");if(o.key==="ArrowDown")return o.preventDefault(),o.stopPropagation(),u.removeAttribute("class"),u.nextElementSibling?u.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(o.key==="ArrowUp"){if(o.preventDefault(),o.stopPropagation(),u.removeAttribute("class"),u.previousElementSibling)u.previousElementSibling.className="vditor-hint--current";else{var d=this.element.children.length;this.element.children[d-1].className="vditor-hint--current"}return!0}else if(!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"&&!o.isComposing)return o.preventDefault(),o.stopPropagation(),this.fillEmoji(u,s),!0;return!1},i.prototype.getKey=function(o,s){var u=this;this.lastIndex=-1,this.splitChar="",s.forEach(function(_){var F=o.lastIndexOf(_.key);u.lastIndex<F&&(u.splitChar=_.key,u.lastIndex=F)});var d;if(this.lastIndex===-1)return d;var f=o.split(this.splitChar),E=f[f.length-1],L=32;if(f.length>1&&E.trim()===E)if(f.length===2&&f[0]===""&&f[1].length<L)d=f[1];else{var D=f[f.length-2].slice(-1);(0,p.X)(D)===" "&&E.length<L&&(d=E)}return d},i}(),Hu=function(){function i(o){this.composingLock=!1;var s=document.createElement("div");s.className="vditor-ir",s.innerHTML='<pre class="vditor-reset" placeholder="'.concat(o.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>`),this.element=s.firstElementChild,this.bindEvent(o),Kr(o,this.element),Ui(o,this.element),sr(o,this.element),_i(o,this.element),vt(o,this.element),Xr(o,this.element),di(o,this.element,this.copy),hi(o,this.element,this.copy)}return i.prototype.copy=function(o,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){o.stopPropagation(),o.preventDefault();var d=document.createElement("div");d.appendChild(u.cloneContents()),o.clipboardData.setData("text/plain",s.lute.VditorIRDOM2Md(d.innerHTML).trim()),o.clipboardData.setData("text/html","")}},i.prototype.bindEvent=function(o){var s=this;this.element.addEventListener("paste",function(u){ya(o,u,{pasteCode:function(d){document.execCommand("insertHTML",!1,d)}})}),this.element.addEventListener("scroll",function(){T(o,["hint"])}),this.element.addEventListener("compositionstart",function(u){s.composingLock=!0}),this.element.addEventListener("compositionend",function(u){(0,m.vU)()||Mt(o,getSelection().getRangeAt(0).cloneRange()),s.composingLock=!1}),this.element.addEventListener("input",function(u){if(!(u.inputType==="deleteByDrag"||u.inputType==="insertFromDrop")){if(s.preventInput){s.preventInput=!1,lr(o,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}s.composingLock||u.data==="‘"||u.data==="“"||u.data==="《"||Mt(o,getSelection().getRangeAt(0).cloneRange(),!1,u)}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){u.target.checked?u.target.setAttribute("checked","checked"):u.target.removeAttribute("checked"),s.preventInput=!0,lr(o);return}var d=(0,j.zh)(o),f=(0,y.fb)(u.target,"vditor-ir__preview");if(f||(f=(0,y.fb)(d.startContainer,"vditor-ir__preview")),f&&(f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!0),(0,j.Hc)(d),Bt(o)),u.target.tagName==="IMG"){var E=u.target.parentElement.querySelector(".vditor-ir__marker--link");E&&(d.selectNode(E),(0,j.Hc)(d))}var L=(0,y.a1)(u.target,"data-type","a");if(L&&!L.classList.contains("vditor-ir__node--expand")){o.options.link.click?o.options.link.click(L.querySelector(":scope > .vditor-ir__marker--link")):o.options.link.isOpen&&window.open(L.querySelector(":scope > .vditor-ir__marker--link").textContent);return}if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&d.collapsed){var D=s.element.lastElementChild.getBoundingClientRect();u.y>D.top+D.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(d.selectNodeContents(s.element.lastElementChild),d.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(s.element,d)))}d.toString()===""?Q(d,o):setTimeout(function(){Q((0,j.zh)(o),o)}),It(u,o),Ue(o)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){if(u.key==="Enter"&&Bt(o),Ue(o),(u.key==="Backspace"||u.key==="Delete")&&o.ir.element.innerHTML!==""&&o.ir.element.childNodes.length===1&&o.ir.element.firstElementChild&&o.ir.element.firstElementChild.tagName==="P"&&o.ir.element.firstElementChild.childElementCount===0&&(o.ir.element.textContent===""||o.ir.element.textContent===`
|
|||
|
|
`)){o.ir.element.innerHTML="";return}var d=(0,j.zh)(o);u.key==="Backspace"?((0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent="",Q(d,o)),s.element.querySelectorAll(".language-math").forEach(function(E){var L=E.querySelector("br");L&&L.remove()})):u.key.indexOf("Arrow")>-1?((u.key==="ArrowLeft"||u.key==="ArrowRight")&&Js(o),Q(d,o)):u.keyCode===229&&u.code===""&&u.key==="Unidentified"&&Q(d,o);var f=(0,y.fb)(d.startContainer,"vditor-ir__preview");if(f){if(u.key==="ArrowUp"||u.key==="ArrowLeft")return f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!1),u.preventDefault(),!0;if(f.tagName==="SPAN"&&(u.key==="ArrowDown"||u.key==="ArrowRight"))return f.parentElement.getAttribute("data-type")==="html-entity"?(f.parentElement.insertAdjacentText("afterend",c.g.ZWSP),d.setStart(f.parentElement.nextSibling,1)):d.selectNodeContents(f.parentElement.lastElementChild),d.collapse(!1),u.preventDefault(),!0}}})},i}(),Qs=function(i){if(i.currentMode==="sv")return i.lute.Md2HTML(v(i));if(i.currentMode==="wysiwyg")return i.lute.VditorDOM2HTML(i.wysiwyg.element.innerHTML);if(i.currentMode==="ir")return i.lute.VditorIRDOM2HTML(i.ir.element.innerHTML)},Pu=a(214),el=a(436),zu=function(){function i(o){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(o,`</div>
|
|||
|
|
<div class="vditor-outline__content"></div>`)}return i.prototype.render=function(o){var s="";return o.preview.element.style.display==="block"?s=(0,el.k)(o.preview.previewElement,this.element.lastElementChild,o):s=(0,el.k)(o[o.currentMode].element,this.element.lastElementChild,o),s},i.prototype.toggle=function(o,s,u){var d;s===void 0&&(s=!0),u===void 0&&(u=!0);var f=(d=o.toolbar.elements.outline)===null||d===void 0?void 0:d.firstElementChild;if(s&&window.innerWidth>=c.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(o),f==null||f.classList.add("vditor-menu--current")):(this.element.style.display="none",f==null||f.classList.remove("vditor-menu--current")),u&&getSelection().rangeCount>0){var E=getSelection().getRangeAt(0);o[o.currentMode].element.contains(E.startContainer)&&(0,j.Hc)(E)}ze(o)},i}(),Bu=a(280),Fu=function(){function i(o){var s=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",o.options.classes.preview&&this.previewElement.classList.add(o.options.classes.preview),this.previewElement.style.maxWidth=o.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(D){if(D.target.tagName!=="TEXTAREA"){var _=document.createElement("div");_.className="vditor-reset",_.appendChild(getSelection().getRangeAt(0).cloneContents()),s.copyToX(o,_,"default"),D.preventDefault()}}),this.previewElement.addEventListener("click",function(D){var _=(0,y.lG)(D.target,"SPAN");if(_&&(0,y.fb)(_,"vditor-toc")){var F=s.previewElement.querySelector("#"+_.getAttribute("data-target-id"));F&&(s.element.scrollTop=F.offsetTop);return}if(D.target.tagName==="A"){o.options.link.click?o.options.link.click(D.target):o.options.link.isOpen&&window.open(D.target.getAttribute("href")),D.preventDefault();return}D.target.tagName==="IMG"&&(o.options.image.preview?o.options.image.preview(D.target):o.options.image.isPreview&&(0,de.E)(D.target,o.options.lang,o.options.theme))}),this.element.appendChild(this.previewElement);var u=o.options.preview.actions;if(u.length!==0){var d=document.createElement("div");d.className="vditor-preview__action";for(var f=[],E=0;E<u.length;E++){var L=u[E];if(typeof L=="object"){f.push('<button type="button" data-type="'.concat(L.key,'" class="').concat(L.className,'"').concat(L.tooltip?' aria-label="'.concat(L.tooltip,'"'):"",'">').concat(L.text,"</button>"));continue}switch(L){case"desktop":f.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":f.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":f.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":f.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":f.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>');break}}d.innerHTML=f.join(""),d.addEventListener((0,m.Le)(),function(D){var _=(0,N.S)(D.target,"BUTTON");if(_){var F=_.getAttribute("data-type"),X=u.find(function(be){return(be==null?void 0:be.key)===F});if(X){X.click(F);return}if(F==="mp-wechat"||F==="zhihu"){s.copyToX(o,s.previewElement.cloneNode(!0),F);return}F==="desktop"?s.previewElement.style.width="auto":F==="tablet"?s.previewElement.style.width="780px":s.previewElement.style.width="360px",s.previewElement.scrollWidth>s.previewElement.parentElement.clientWidth&&(s.previewElement.style.width="auto"),s.render(o),d.querySelectorAll("button").forEach(function(be){be.classList.remove("vditor-preview__action--current")}),_.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(d,this.previewElement)}}return i.prototype.render=function(o,s){var u=this;if(clearTimeout(this.mdTimeoutId),this.element.st
|
|||
|
|
`)){o.sv.element.innerHTML="";return}u.key==="Enter"&&Bt(o)}})},i}(),tl=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return i.prototype.show=function(o,s){var u=this;s===void 0&&(s=6e3),this.element.className="vditor-tip vditor-tip--show",s===0?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(o,`
|
|||
|
|
<div class="vditor-tip__close">X</div></div>`),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){u.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(o,"</div>"),setTimeout(function(){u.hide()},s)),this.element.removeAttribute("style"),setTimeout(function(){var d=u.element.getBoundingClientRect();d.top<46&&(u.element.style.position="fixed",u.element.style.top="46px")},150)},i.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},i}(),Oo=function(i,o){if(o.options.preview.mode!==i){switch(o.options.preview.mode=i,i){case"both":o.sv.element.style.display="block",o.preview.element.style.display="block",o.preview.render(o),w(o.toolbar.elements,["both"]);break;case"editor":o.sv.element.style.display="block",o.preview.element.style.display="none",x(o.toolbar.elements,["both"]);break}o.devtools&&o.devtools.renderEchart(o)}},$u=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Uu=function(i){$u(o,i);function o(s,u){var d=i.call(this,s,u)||this;return s.options.preview.mode==="both"&&d.element.children[0].classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),s.currentMode==="sv"&&(s.options.preview.mode==="both"?Oo("editor",s):Oo("both",s)))}),d}return o}(xt),Vu=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"}return i}(),nl=a(580),Wu=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Gu=function(i){Wu(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return c.g.CODE_THEME.forEach(function(D){L+="<button>".concat(D,"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.addEventListener((0,m.Le)(),function(D){D.target.tagName==="BUTTON"&&(T(s,["subToolbar"]),s.options.preview.hljs.style=D.target.textContent,(0,nl.Y)(D.target.textContent,s.options.cdn),D.preventDefault(),D.stopPropagation())}),d.element.appendChild(E),M(s,E,f,u.level),d}return o}(xt),Ku=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Xu=function(i){Ku(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return Object.keys(s.options.preview.theme.list).forEach(function(D){L+='<button data-type="'.concat(D,'">').concat(s.options.preview.theme.list[D],"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.add
|
|||
|
|
`)?s.length-1:s.length;if(o.options.counter.type==="text"&&o[o.currentMode]){var d=o[o.currentMode].element.cloneNode(!0);d.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(f){f.remove()}),u=d.textContent.length}typeof o.options.counter.max=="number"?(u>o.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(u,"/").concat(o.options.counter.max)):this.element.innerHTML="".concat(u),this.element.setAttribute("aria-label",o.options.counter.type),o.options.counter.after&&o.options.counter.after(u,{enable:o.options.counter.enable,max:o.options.counter.max,type:o.options.counter.type})},i}(),Yu=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ju=function(i){Yu(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].innerHTML=u.icon,d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!f.currentTarget.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.click(f,s)}),d}return o}(xt),Qu=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ed=function(i){Qu(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.firstElementChild.addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),E.classList.contains("vditor-menu--current")?(E.classList.remove("vditor-menu--current"),s.devtools.element.style.display="none",ze(s)):(E.classList.add("vditor-menu--current"),s.devtools.element.style.display="block",ze(s),s.devtools.renderEchart(s)))}),d}return o}(xt),td=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"}return i}(),nd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),rd=function(i){nd(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");f.className="vditor-panel vditor-panel--arrow";var E="";return Object.keys(s.options.hint.emoji).forEach(function(L){var D=s.options.hint.emoji[L];D.indexOf(".")>-1?E+='<button data-value=":'.concat(L,': " data-key=":').concat(L,`:"><img
|
|||
|
|
data-value=":`).concat(L,': " data-key=":').concat(L,':" class="vditor-emojis__icon" src="').concat(D,'"/></button>'):E+='<button data-value="'.concat(D,` "
|
|||
|
|
data-key="`).concat(L,'"><span class="vditor-emojis__icon">').concat(D,"</span></button>")}),f.innerHTML='<div class="vditor-emojis" style="max-height: '.concat(s.options.height==="auto"?"auto":s.options.height-80,'px">').concat(E,`</div><div class="vditor-emojis__tail">
|
|||
|
|
<span class="vditor-emojis__tip"></span><span>`).concat(s.options.hint.emojiTail||"",`</span>
|
|||
|
|
</div>`),d.element.appendChild(f),M(s,f,d.element.firstElementChild,u.level),d.bindEvent(s),d}return o.prototype.bindEvent=function(s){var u=this;this.element.lastElementChild.addEventListener((0,m.Le)(),function(d){var f=(0,N.S)(d.target,"BUTTON");if(f){d.preventDefault();var E=f.getAttribute("data-value"),L=(0,j.zh)(s),D=E;if(s.currentMode==="wysiwyg"?D=s.lute.SpinVditorDOM(E):s.currentMode==="ir"&&(D=s.lute.SpinVditorIRDOM(E)),E.indexOf(":")>-1&&s.currentMode!=="sv"){var _=document.createElement("div");_.innerHTML=D,D=_.firstElementChild.firstElementChild.outerHTML+" ",(0,j.oC)(D,s)}else L.extractContents(),L.insertNode(document.createTextNode(E)),(0,y.F9)(L.startContainer)||Rn(s,L);L.collapse(!1),(0,j.Hc)(L),u.element.lastElementChild.style.display="none",ct(s)}}),this.element.lastElementChild.addEventListener("mouseover",function(d){var f=(0,N.S)(d.target,"BUTTON");f&&(u.element.querySelector(".vditor-emojis__tip").innerHTML=f.getAttribute("data-key"))})},o}(xt),rl=function(i,o,s){var u=document.createElement("a");"download"in u?(u.download=s,u.style.display="none",u.href=URL.createObjectURL(new Blob([o])),document.body.appendChild(u),u.click(),u.remove()):i.tip.show(window.VditorI18n.downloadTip,0)},id=function(i){var o=v(i);rl(i,o,o.substr(0,10)+".md")},ad=function(i){i.tip.show(window.VditorI18n.generate,3800);var o=document.querySelector("#vditorExportIframe");o.contentDocument.open(),o.contentDocument.write('<link rel="stylesheet" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script>
|
|||
|
|
<div id="preview" style="width: 800px"></div>
|
|||
|
|
<script>
|
|||
|
|
window.addEventListener("message", (e) => {
|
|||
|
|
if(!e.data) {
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
Vditor.preview(document.getElementById('preview'), e.data, {
|
|||
|
|
cdn: "`).concat(i.options.cdn,`",
|
|||
|
|
markdown: {
|
|||
|
|
theme: `).concat(JSON.stringify(i.options.preview.theme),`
|
|||
|
|
},
|
|||
|
|
hljs: {
|
|||
|
|
style: "`).concat(i.options.preview.hljs.style,`"
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
setTimeout(() => {
|
|||
|
|
window.print();
|
|||
|
|
}, 3600);
|
|||
|
|
}, false);
|
|||
|
|
<\/script>`)),o.contentDocument.close(),setTimeout(function(){o.contentWindow.postMessage(v(i),"*")},200)},od=function(i){var o=Qs(i),s='<html><head><link rel="stylesheet" type="text/css" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/i18n/").concat(i.options.lang,`.js"><\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script></head>
|
|||
|
|
<body><div class="vditor-reset" id="preview">`).concat(o,`</div>
|
|||
|
|
<script>
|
|||
|
|
const previewElement = document.getElementById('preview')
|
|||
|
|
Vditor.setContentTheme('`).concat(i.options.preview.theme.current,"', '").concat(i.options.preview.theme.path,`');
|
|||
|
|
Vditor.codeRender(previewElement);
|
|||
|
|
Vditor.highlightRender(`).concat(JSON.stringify(i.options.preview.hljs),", previewElement, '").concat(i.options.cdn,`');
|
|||
|
|
Vditor.mathRender(previewElement, {
|
|||
|
|
cdn: '`).concat(i.options.cdn,`',
|
|||
|
|
math: `).concat(JSON.stringify(i.options.preview.math),`,
|
|||
|
|
});
|
|||
|
|
Vditor.mermaidRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.SMILESRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.markmapRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.flowchartRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.graphvizRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.chartRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.mindmapRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.abcRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
`).concat(i.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",`
|
|||
|
|
Vditor.speechRender(previewElement);
|
|||
|
|
<\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/icons/").concat(i.options.icon,'.js"><\/script></body></html>');rl(i,s,o.substr(0,10)+".html")},sd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ld=function(i){sd(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");return E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow"),E.innerHTML=`<button data-type="markdown">Markdown</button>
|
|||
|
|
<button data-type="pdf">PDF</button>
|
|||
|
|
<button data-type="html">HTML</button>`,E.addEventListener((0,m.Le)(),function(L){var D=L.target;if(D.tagName==="BUTTON"){switch(D.getAttribute("data-type")){case"markdown":id(s);break;case"pdf":ad(s);break;case"html":od(s);break}T(s,["subToolbar"]),L.preventDefault(),L.stopPropagation()}}),d.element.appendChild(E),M(s,E,f,u.level),d}return o}(xt),cd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ud=function(i){cd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s,u),d}return o.prototype._bindEvent=function(s,u){this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault(),s.element.className.includes("vditor--fullscreen")?(u.level||(this.innerHTML=u.icon),s.element.style.zIndex="",document.body.style.overflow="",s.element.classList.remove("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__s","__n"),s.options.toolbar.forEach(function(L){typeof L!="string"&&L.tipPosition&&L.name===E.dataset.type&&(E.className="vditor-tooltipped vditor-tooltipped__".concat(L.tipPosition))}))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__s","__n"))):(u.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),s.element.style.zIndex=s.options.fullscreen.index.toString(),document.body.style.overflow="hidden",s.element.classList.add("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__n","__s"))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__n","__s"))),s.devtools&&s.devtools.renderEchart(s),u.click&&u.click(d,s),ze(s),We(s)})},o}(xt),dd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),hd=function(i){dd(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");return f.className="vditor-hint vditor-panel--arrow",f.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,m.ns)("<⌥⌘1>"),`</button>
|
|||
|
|
<button data-tag="h2" data-value="## ">`).concat(window.VditorI18n.heading2," <").concat((0,m.ns)("⌥⌘2"),`></button>
|
|||
|
|
<button data-tag="h3" data-value="### ">`).concat(window.VditorI18n.heading3," <").concat((0,m.ns)("⌥⌘3"),`></button>
|
|||
|
|
<button data-tag="h4" data-value="#### ">`).concat(window.VditorI18n.heading4," <").concat((0,m.ns)("⌥⌘4"),`></button>
|
|||
|
|
<button data-tag="h5" data-value="##### ">`).concat(window.VditorI18n.heading5," <").concat((0,m.ns)("⌥⌘5"),`></button>
|
|||
|
|
<button data-tag="h6" data-value="###### ">`).concat(window.VditorI18n.heading6," <").concat((0,m.ns)("⌥⌘6"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f),d}return o.prototype._bindEvent=function(s,u){var d=this.element.children[0];d.addEventListener((0,m.Le)(),function(E){E.preventDefault(),clearTimeout(s.wysiwyg.afterRenderTimeoutId),clearTimeout(s.ir.processTimeoutId),clearTimeout(s.sv.processTimeoutId),!d.classList.contains(c.g.CLASS_MENU_DISABLED)&&(d.blur(),d.classList.contains("vditor-menu--current")?(s.currentMode==="wysiwyg"?(Qn(s),He(s)):s.currentMode==="ir"&&Ri(s,""),d.classList.remove("vditor-menu--current")):(T(s,["subToolbar"]),u.style.display="block"))});for(var f=0;f<6;f++)u.children.item(f).addEventListener((0,m.Le)(),function(E){E.preventDefault(),s.currentMode==="wysiwyg"?(ln(s,E.target.getAttribute("data-tag")),He(s),d.classList.add("vditor-menu--current")):s.currentMode==="ir"?(Ri(s,E.target.getAttribute("data-value")),d.classList.add("vditor-menu--current")):Te(s,E.target.getAttribute("data-value")),u.style.display="none"})},o}(xt),pd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),fd=function(i){pd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Markdown 使用指南</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Vditor 支持</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
|
|||
|
|
<li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div></div>`,0)}),d}return o}(xt),md=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),gd=function(i){md(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,j.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&Ps(s,L,E)}}),d}return o}(xt),vd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),bd=function(i){vd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
|
|||
|
|
<p style="text-align: center;margin: 14px 0">
|
|||
|
|
<em>下一代的 Markdown 编辑器,为未来而构建</em>
|
|||
|
|
</p>
|
|||
|
|
<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
|
|||
|
|
<img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
|
|||
|
|
<div> </div>
|
|||
|
|
<div style="flex: 1;min-width: 250px">
|
|||
|
|
Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。
|
|||
|
|
它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="display: flex;flex-wrap: wrap;">
|
|||
|
|
<ul style="list-style: none;flex: 1;min-width:148px">
|
|||
|
|
<li>
|
|||
|
|
项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
开源协议:MIT
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
<ul style="list-style: none;margin-right: 18px">
|
|||
|
|
<li>
|
|||
|
|
组件版本:Vditor v`.concat(c.H," / Lute v").concat(Lute.Version,`
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</div>`),0)}),d}return o}(xt),yd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),wd=function(i){yd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&Ni(s,"afterend")}),d}return o}(xt),xd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),kd=function(i){xd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&Ni(s,"beforebegin")}),d}return o}(xt),Sd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ed=function(i){Sd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,j.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&Lo(s,L,E,L.parentElement)}}),d}return o}(xt),Td=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ad=function(i){Td(o,i);function o(s,u){var d=i.call(this,s,u)||this;return s.options.outline&&d.element.firstElementChild.classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault();var E=s.toolbar.elements.outline.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(s.options.outline.enable=!d.element.firstElementChild.classList.contains("vditor-menu--current"),s.outline.toggle(s,s.options.outline.enable))}),d}return o}(xt),Md=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Cd=function(i){Md(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s),d}return o.prototype._bindEvent=function(s){var u=this;this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault();var f=u.element.first
|
|||
|
|
| --- | --- | --- |
|
|||
|
|
| | | |
|
|||
|
|
| | | |`,tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],d=[];return o.forEach(function(f){var E=f;u.forEach(function(L){typeof f=="string"&&L.name===f&&(E=L),typeof f=="object"&&L.name===f.name&&(E=Object.assign({},L,f))}),f.toolbar&&(E.toolbar=s.mergeToolbar(f.toolbar)),d.push(E)}),d},i}(),$d=function(){function i(o){var s=this;this.composingLock=!1,this.commentIds=[];var u=document.createElement("div");u.className="vditor-wysiwyg",u.innerHTML='<pre class="vditor-reset" placeholder="'.concat(o.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>
|
|||
|
|
<div class="vditor-panel vditor-panel--none"></div>
|
|||
|
|
<div class="vditor-panel vditor-panel--none">
|
|||
|
|
<button type="button" aria-label="`).concat(window.VditorI18n.comment,`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-comment"></use></svg>
|
|||
|
|
</button>
|
|||
|
|
</div>`),this.element=u.firstElementChild,this.popover=u.firstElementChild.nextElementSibling,this.selectPopover=u.lastElementChild,this.bindEvent(o),Kr(o,this.element),Ui(o,this.element),sr(o,this.element),_i(o,this.element),vt(o,this.element),Xr(o,this.element),di(o,this.element,this.copy),hi(o,this.element,this.copy),o.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var d=Lute.NewNodeID(),f=getSelection().getRangeAt(0),E=f.cloneRange(),L=f.extractContents(),D,_,F=!1,X=!1;L.childNodes.forEach(function(pe,Se){var ke=!1;if(pe.nodeType===3?ke=!0:pe.classList.contains("vditor-comment")?pe.classList.contains("vditor-comment")&&pe.setAttribute("data-cmtids",pe.getAttribute("data-cmtids")+" "+d):ke=!0,ke)if(pe.nodeType!==3&&pe.getAttribute("data-block")==="0"&&Se===0&&E.startOffset>0)pe.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(pe.innerHTML,"</span>"),D=pe;else if(pe.nodeType!==3&&pe.getAttribute("data-block")==="0"&&Se===L.childNodes.length-1&&E.endOffset<E.endContainer.textContent.length)pe.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(pe.innerHTML,"</span>"),_=pe;else if(pe.nodeType!==3&&pe.getAttribute("data-block")==="0")Se===0?F=!0:Se===L.childNodes.length-1&&(X=!0),pe.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(pe.innerHTML,"</span>");else{var me=document.createElement("span");me.classList.add("vditor-comment"),me.setAttribute("data-cmtids",d),pe.parentNode.insertBefore(me,pe),me.appendChild(pe)}});var be=(0,y.F9)(E.startContainer);be&&(D?(be.insertAdjacentHTML("beforeend",D.innerHTML),D.remove()):be.textContent.trim().replace(c.g.ZWSP,"")===""&&F&&be.remove());var xe=(0,y.F9)(E.endContainer);xe&&(_?(xe.insertAdjacentHTML("afterbegin",_.innerHTML),_.remove()):xe.textContent.trim().replace(c.g.ZWSP,"")===""&&X&&xe.remove()),f.insertNode(L),o.options.comment.add(d,f.toString(),s.getComments(o,!0)),He(o,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),s.hideComment()})}return i.prototype.getComments=function(o,s){var u=this;if(s===void 0&&(s=!1),o.currentMode==="wysiwyg"&&o.options.comment.enable){this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(f){u.commentIds=u.commentIds.concat(f.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var d=[];if(s)return this.commentIds.forEach(function(f){d.push({id:f,top:u.element.querySelector('.vditor-comment[data-cmtids="'.concat(f,'"]')).offsetTop})}),d}else return[]},i.prototype.triggerRemoveComment=function(o){var s=function(f,E){var L=new Set(E);return f.filter(function(D){return!L.has(D)})};if(o.currentMode==="wysiwyg"&&o.options.comment.enable&&o.wysiwyg.commentIds.length>0){var u=JSON.parse(JSON.stringify(this.commentIds));this.getComments(o);var d=s(u,this.commentIds);d.length>0&&o.options.comment.remove(d)}},i.prototype.showComment=function(){var o=(0,j.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(o.left,"px;display:block;top:").concat(Math.max(-8,o.top-21),"px"))},i.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},i.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},i.prototype.copy=function(o,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){o.stopPropagation(),o.preventDefault();var d=(0,y.lG)(u.startContainer,"CODE"),f=(0,y.lG)(u.endContainer,"CODE");if(d&&f&&f.isSameNode(d)){var E="";d.parentElement.tagName==="PRE"?E=u.toString():E="`"+u.toString()+"`",o.clipboardData.setData("text/plain",E),o.clipboardData.setData("text/html","");return}var L=(0,y.lG)(u.startContainer,"A"),D=(0,y.lG)(u.endContainer,"A");if(L&&D&&D.isSameNode(L)){var _=L.getAttribute("title")||"";_&&(_=' "'.concat(_,'"')),o.clipboardData.setData("text/plain","[".concat(u.toString(),"](").concat(L.getAttribute("href")).concat(_,")")),o.clipboardData.setData("text/html","");return}var F=document.createElement("div");F.appendChild(u.cloneContents()),o.clipboardData.se
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}E===0&&(L=!1);for(var _=!0,D=E-1;D<f.textContent.length;D++)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==`
|
|||
|
|
`){_=!1;break}_&&/^#{1,6} $/.test(f.textContent)&&(_=!1);var F=(0,N.W)(getSelection().getRangeAt(0).startContainer);if(F&&F.textContent===""&&(yt(o),F.remove()),L&&f.getAttribute("data-type")!=="code-block"||_||No(f.innerHTML)||_o(f.innerHTML)&&f.previousElementSibling){typeof o.options.input=="function"&&o.options.input(v(o));return}u.inputType==="insertParagraph"&&s.element.innerHTML==="<p><br></p><p><br></p>"&&f.previousElementSibling.remove(),On(o,d,u)}}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){var d=u.target;d.checked?d.setAttribute("checked","checked"):d.removeAttribute("checked"),s.preventInput=!0,getSelection().rangeCount>0&&(0,j.Hc)(getSelection().getRangeAt(0)),He(o);return}if(u.target.tagName==="IMG"&&!u.target.parentElement.classList.contains("vditor-wysiwyg__preview")){u.target.getAttribute("data-type")==="link-ref"?Gr(o,u.target):zn(u,o);return}var f=(0,y.lG)(u.target,"A");if(f){o.options.link.click?o.options.link.click(f):o.options.link.isOpen&&window.open(f.getAttribute("href")),u.preventDefault();return}var E=(0,j.zh)(o);if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&E.collapsed){var L=s.element.lastElementChild.getBoundingClientRect();u.y>L.top+L.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(E.selectNodeContents(s.element.lastElementChild),E.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(s.element,E)))}Pn(o);var D=(0,y.fb)(u.target,"vditor-wysiwyg__preview");D||(D=(0,y.fb)((0,j.zh)(o).startContainer,"vditor-wysiwyg__preview")),D&&Cn(D,o),It(u,o)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){u.key==="Enter"&&Bt(o),(u.key==="Backspace"||u.key==="Delete")&&o.wysiwyg.element.innerHTML!==""&&o.wysiwyg.element.childNodes.length===1&&o.wysiwyg.element.firstElementChild&&o.wysiwyg.element.firstElementChild.tagName==="P"&&o.wysiwyg.element.firstElementChild.childElementCount===0&&(o.wysiwyg.element.textContent===""||o.wysiwyg.element.textContent===`
|
|||
|
|
`)&&(o.wysiwyg.element.innerHTML="");var d=(0,j.zh)(o);if(u.key==="Backspace"&&(0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent=""),Rn(o,d),Pn(o),!(u.key!=="ArrowDown"&&u.key!=="ArrowRight"&&u.key!=="Backspace"&&u.key!=="ArrowLeft"&&u.key!=="ArrowUp")){(u.key==="ArrowLeft"||u.key==="ArrowRight")&&o.hint.render(o);var f=(0,y.fb)(d.startContainer,"vditor-wysiwyg__preview");if(!f&&d.startContainer.nodeType!==3&&d.startOffset>0){var E=d.startContainer;E.classList.contains("vditor-wysiwyg__block")&&(f=E.lastElementChild)}if(f){var L=f.previousElementSibling;if(L.style.display==="none"){u.key==="ArrowDown"||u.key==="ArrowRight"?Cn(f,o):Cn(f,o,!1);return}var D=f.previousElementSibling;if(D.tagName==="PRE"&&(D=D.firstElementChild),u.key==="ArrowDown"||u.key==="ArrowRight"){var E=f.parentElement,_=Mn(E);if(_&&_.nodeType!==3){var F=_.querySelector(".vditor-wysiwyg__preview");if(F){Cn(F,o);return}}if(_.nodeType===3){for(;_.textContent.length===0&&_.nextSibling;)_=_.nextSibling;d.setStart(_,1)}else d.setStart(_.firstChild,0)}else d.selectNodeContents(D),d.collapse(!1)}}}})},i}(),Ud=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Vd=function(i){Ud(o,i);function o(s,u){var d=i.call(this)||this;if(d.isDestroyed=!1,d.version=c.H,typeof s=="string"){if(u?u.cache?u.cache.id||(u.cache.id="vditor".concat(s)):u.cache={id:"vditor".concat(s)}:u={cache:{id:"vditor".concat(s)}},!document.getElementById(s))return d.showErrorTip("Failed to get element by id: ".concat(s)),d;s=document.getElementById(s)}var f=new jd(u),E=f.merge();if(E.i18n)window.VditorI18n=E.i18n,d.init(s,E);else if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(E.lang)){var L="vditorI18nScript",D=L+E.lang;document.querySelectorAll('head script[id^="'.concat(L,'"]')).forEach(function(_){_.id!==D&&document.head.removeChild(_)}),(0,b.G)("".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js"),D).then(function(){d.init(s,E)}).catch(function(_){d.showErrorTip("GET ".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");return d}return o.prototype.showErrorTip=function(s){var u=new tl;document.body.appendChild(u.element),u.show(s,0)},o.prototype.updateToolbarConfig=function(s){this.vditor.toolbar.updateConfig(this.vditor,s)},o.prototype.setTheme=function(s,u,d,f){this.vditor.options.theme=s,ve(this.vditor),u&&(this.vditor.options.preview.theme.current=u,(0,ce.Z)(u,f||this.vditor.options.preview.theme.path)),d&&(this.vditor.options.preview.hljs.style=d,(0,nl.Y)(d,this.vditor.options.cdn))},o.prototype.getValue=function(){return v(this.vditor)},o.prototype.getCurrentMode=function(){return this.vditor.currentMode},o.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},o.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},o.prototype.disabled=function(){T(this.vditor,["subToolbar","hint","popover"]),k(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},o.prototype.enable=function(){S(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")
|
|||
|
|
]`).replace("lheading",i6).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},N7=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,D7=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,o6=/^( {2,}|\\)\n(?!\s*$)/,R7=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tu=/[\p{P}\p{S}]/u,Nf=/[\s\p{P}\p{S}]/u,s6=/[^\s\p{P}\p{S}]/u,O7=pn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Nf).getRegex(),l6=/(?!~)[\p{P}\p{S}]/u,I7=/(?!~)[\s\p{P}\p{S}]/u,H7=/(?:[^\s\p{P}\p{S}]|~)/u,P7=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,c6=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,z7=pn(c6,"u").replace(/punct/g,tu).getRegex(),B7=pn(c6,"u").replace(/punct/g,l6).getRegex(),u6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",F7=pn(u6,"gu").replace(/notPunctSpace/g,s6).replace(/punctSpace/g,Nf).replace(/punct/g,tu).getRegex(),q7=pn(u6,"gu").replace(/notPunctSpace/g,H7).replace(/punctSpace/g,I7).replace(/punct/g,l6).getRegex(),j7=pn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,s6).replace(/punctSpace/g,Nf).replace(/punct/g,tu).getRegex(),$7=pn(/\\(punct)/,"gu").replace(/punct/g,tu).getRegex(),U7=pn(/^<(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(),V7=pn(Lf).replace("(?:-->|$)","-->").getRegex(),W7=pn("^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",V7).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,G7=pn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),d6=pn(/^!?\[(label)\]\[(ref)\]/).replace("label",yc).replace("ref",Cf).getRegex(),h6=pn(/^!?\[(ref)\](?:\[\])?/).replace("ref",Cf).getRegex(),K7=pn("reflink|nolink(?!\\()","g").replace("reflink",d6).replace("nolink",h6).getRegex(),Df={_backpedal:Pl,anyPunctuation:$7,autolink:U7,blockSkip:P7,br:o6,code:D7,del:Pl,emStrongLDelim:z7,emStrongRDelimAst:F7,emStrongRDelimUnd:j7,escape:N7,link:G7,nolink:h6,punctuation:O7,reflink:d6,reflinkSearch:K7,tag:W7,text:R7,url:Pl},X7={...Df,link:pn(/^!?\[(label)\]\((.*?)\)/).replace("label",yc).getRegex(),reflink:pn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yc).getRegex()},dp={...Df,emStrongRDelimAst:q7,emStrongLDelim:B7,url:pn(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Z7={...dp,br:pn(o6).replace("{2,}","*").getRegex(),text:pn(dp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},b0={normal:_f,gfm:L7,pedantic:_7},hl={normal:Df,gfm:dp,breaks:Z7,pedantic:X7},Y7={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(l=>{let h=l.match(n.other.beginningSpace);if(h===null)return l;let[c]=h;return c.length>=a.length?l.slice(a.length):l}).join(`
|
|||
|
|
`)}var wc=class{constructor(t){St(this,"options"),St(this,"rules"),St(this,"lexer"),this.options=t||ts}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pl(n,`
|
|||
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Q7(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=pl(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:pl(e[0],`
|
|||
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=pl(e[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),r="",a="",l=[];for(;n.length>0;){let h=!1,c=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))c.push(n[p]),h=!0;else if(!h)c.push(n[p]);else break;n=n.slice(p);let v=c.join(`
|
|||
|
|
`),b=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|||
|
|
${v}`:v,a=a?`${a}
|
|||
|
|
${b}`:b;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=g,n.length===0)break;let m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.blockquote(w);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,a=a.substring(0,a.length-x.text.length)+S.text;break}else if((m==null?void 0:m.type)==="list"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.list(w);l[l.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,a=a.substring(0,a.length-x.raw.length)+S.raw,n=w.substring(l.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:a}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,a={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),h=!1;for(;t;){let p=!1,v="",b="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;v=e[0],t=t.substring(v.length);let g=e[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=t.split(`
|
|||
|
|
`,1)[0],x=!g.trim(),w=0;if(this.options.pedantic?(w=2,b=g.trimStart()):x?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,b=g.slice(w),w+=e[1].length),x&&this.rules.other.blankLine.test(m)&&(v+=m+`
|
|||
|
|
`,t=t.substring(m.length+1),p=!0),!p){let C=this.rules.other.nextBulletRegex(w),A=this.rules.other.hrRegex(w),T=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;t;){let N=t.split(`
|
|||
|
|
`,1)[0],z;if(m=N,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),z=m):z=m.replace(this.rules.other.tabCharGlobal," "),T.test(m)||M.test(m)||y.test(m)||C.test(m)||A.test(m))break;if(z.search(this.rules.other.nonSpaceChar)>=w||!m.trim())b+=`
|
|||
|
|
`+z.slice(w);else{if(x||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(g)||M.test(g)||A.test(g))break;b+=`
|
|||
|
|
`+m}!x&&!m.trim()&&(x=!0),v+=N+`
|
|||
|
|
`,t=t.substring(N.length+1),g=z.slice(w)}}a.loose||(h?a.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(h=!0));let S=null,k;this.options.gfm&&(S=this.rules.other.listIsTask.exec(b),S&&(k=S[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:v,task:!!S,checked:k,loose:!1,text:b,tokens:[]}),a.raw+=v}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p=0;p<a.items.length;p++)if(this.lexer.state.top=!1,a.items[p].tokens=this.lexer.blockTokens(a.items[p].text,[]),!a.loose){let v=a.items[p].tokens.filter(g=>g.type==="space"),b=v.length>0&&v.some(g=>this.rules.other.anyLine.test(g.raw));a.loose=b}if(a.loose)for(let p=0;p<a.items.length;p++)a.items[p].loose=!0;return a}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:a}}}table(t){var e;let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=_m(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(e=n[3])!=null&&e.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],h={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let c of a)this.rules.other.tableAlignRight.test(c)?h.align.push("right"):this.rules.other.tableAlignCenter.test(c)?h.align.push("center"):this.rules.other.tableAlignLeft.test(c)?h.align.push("left"):h.align.push(null);for(let c=0;c<r.length;c++)h.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:h.align[c]});for(let c of l)h.rows.push(_m(c,h.header.length).map((p,v)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:h.align[v]})));return h}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|||
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=pl(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=J7(e[2],"()");if(l===-2)return;if(l>-1){let h=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let r=e[2],a="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Nm(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=e[r.toLowerCase()];if(!a){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Nm(n,a,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...r[0]].length-1,l,h,c=a,p=0,v=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+a);(r=v.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(h=[...l].length,r[3]||r[4]){c+=h;continue}else if((r[5]||r[6])&&a%3&&!((a+h)%3)){p+=h;continue}if(c-=h,c>0)continue;h=Math.min(h,h+c+p);let b=[...r[0]][0].length,g=t.slice(0,a+r.index+b+h);if(Math.min(a,h)%2){let x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var e;let n;if(n=this.rules.inline.url.exec(t)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let l;do l=n[0],n[0]=((e=this.rules.inline._backpedal.exec(n[0]))==null?void 0:e[0])??"";while(l!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Ra=class hp{constructor(e){St(this,"tokens"),St(this,"
|
|||
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var a,l,h;for(this.options.pedantic&&(e=e.replace(Nr.tabCharGlobal," ").replace(Nr.spaceLine,""));e;){let c;if((l=(a=this.options.extensions)==null?void 0:a.block)!=null&&l.some(v=>(c=v.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let v=n.at(-1);c.raw.length===1&&v!==void 0?v.raw+=`
|
|||
|
|
`:n.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),n.push(c);continue}let p=e;if((h=this.options.extensions)!=null&&h.startBlock){let v=1/0,b=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},b),typeof g=="number"&&g>=0&&(v=Math.min(v,g))}),v<1/0&&v>=0&&(p=e.substring(0,v+1))}if(this.state.top&&(c=this.tokenizer.paragraph(p))){let v=n.at(-1);r&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c),r=p.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(e){let v="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(v)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var r,a,l;let h=e,c=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(h))!=null;)b.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(h))!=null;)h=h.slice(0,c.index)+"++"+h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(c=this.tokenizer.rules.inline.blockSkip.exec(h))!=null;)h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,v="";for(;e;){p||(v=""),p=!1;let b;if((a=(r=this.options.extensions)==null?void 0:r.inline)!=null&&a.some(m=>(b=m.call({lexer:this},e,n))?(e=e.substring(b.raw.length),n.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let m=n.at(-1);b.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(b=this.tokenizer.emStrong(e,h,v)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.del(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),n.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),n.push(b);continue}let g=e;if((l=this.options.extensions)!=null&&l.startInline){let m=1/0,x=e.slice(1),w;this.options.extensions.startInline.forEach(S=>{w=S.call({lexer:this},x),typeof w=="number"&&w>=0&&(m=Math.min(m,w))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(b=this.tokenizer.inlineText(g)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(v=b.raw.slice(-1)),p=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(m)}}return n}},xc=class{constructor(t){St(this,"options"),St(this,"parser"),this.options=t||ts}space(t){return""}code({text:t,lang:e,escaped:n}){var r;let a=(r=(e||"").match(Nr.notSpaceStart))==null?void 0:r[0],l=t.replace(Nr.endingNewline,"")+`
|
|||
|
|
`;return a?'<pre><code class="language-'+Xi(a)+'">'+(n?l:Xi(l,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?l:Xi(l,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|||
|
|
${this.parser.parse(t)}</blockquote>
|
|||
|
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|||
|
|
`}hr(t){return`<hr>
|
|||
|
|
`}list(t){let e=t.ordered,n=t.start,r="";for(let h=0;h<t.items.length;h++){let c=t.items[h];r+=this.listitem(c)}let a=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+a+l+`>
|
|||
|
|
`+r+"</"+a+`>
|
|||
|
|
`}listitem(t){var e;let n="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?((e=t.tokens[0])==null?void 0:e.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Xi(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
|
|||
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|||
|
|
`}table(t){let e="",n="";for(let a=0;a<t.header.length;a++)n+=this.tablecell(t.header[a]);e+=this.tablerow({text:n});let r="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];n="";for(let h=0;h<l.length;h++)n+=this.tablecell(l[h]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+e+`</thead>
|
|||
|
|
`+r+`</table>
|
|||
|
|
`}tablerow({text:t}){return`<tr>
|
|||
|
|
${t}</tr>
|
|||
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|||
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Xi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),a=Lm(t);if(a===null)return r;t=a;let l='<a href="'+t+'"';return e&&(l+=' title="'+Xi(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let a=Lm(t);if(a===null)return Xi(n);t=a;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${Xi(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Xi(t.text)}},Rf=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Oa=class pp{constructor(e){St(this,"options"),St(this,"renderer"),St(this,"textRenderer"),this.options=e||ts,this.options.renderer=this.options.renderer||new xc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Rf}static parse(e,n){return new pp(n).parse(e)}static parseInline(e,n){return new pp(n).parseInline(e)}parse(e,n=!0){var r,a;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[c.type]){let v=c,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(v.type)){l+=b||"";continue}}let p=c;switch(p.type){case"space":{l+=this.renderer.space(p);continue}case"hr":{l+=this.renderer.hr(p);continue}case"heading":{l+=this.renderer.heading(p);continue}case"code":{l+=this.renderer.code(p);continue}case"table":{l+=this.renderer.table(p);continue}case"blockquote":{l+=this.renderer.blockquote(p);continue}case"list":{l+=this.renderer.list(p);continue}case"html":{l+=this.renderer.html(p);continue}case"def":{l+=this.renderer.def(p);continue}case"paragraph":{l+=this.renderer.paragraph(p);continue}case"text":{let v=p,b=this.renderer.text(v);for(;h+1<e.length&&e[h+1].type==="text";)v=e[++h],b+=`
|
|||
|
|
`+this.renderer.text(v);n?l+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):l+=b;continue}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}parseInline(e,n=this.renderer){var r,a;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[c.type]){let v=this.options.extensions.renderers[c.type].call({parser:this},c);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){l+=v||"";continue}}let p=c;switch(p.type){case"escape":{l+=n.text(p);break}case"html":{l+=n.html(p);break}case"link":{l+=n.link(p);break}case"image":{l+=n.image(p);break}case"strong":{l+=n.strong(p);break}case"em":{l+=n.em(p);break}case"codespan":{l+=n.codespan(p);break}case"br":{l+=n.br(p);break}case"del":{l+=n.del(p);break}case"text":{l+=n.text(p);break}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}},ah,Z0=(ah=class{constructor(t){St(this,"options"),St(this,"block"),this.options=t||ts}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Ra.lex:Ra.lexInline}provideParser(){return this.block?Oa.parse:Oa.parseInline}},St(ah,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),ah),e8=class{constructor(...t){St(this,"defaults",Tf()),St(this,"options",this.setOptions),St(this,"parse",this.parseMarkdown(!0)),St(this,"parseInline",this.parseMarkdown(!1)),St(this,"Parser",Oa),St(this,"Renderer",xc),St(this,"TextRenderer",Rf),St(this,"Lexer",Ra),St(this,"Tokenizer",wc),St(this,"Hooks",Z0),this.use(...t)}walkTokens(t,e){var n,r;let a=[];for(let l of t)switch(a=a.concat(e.call(this,l)),l.type){case"table":{let h=l;for(let c of h.header)a=a.concat(this.walkTokens(c.tokens,e));for(let c of h.rows)for(let p of c)a=a.concat(this.walkTokens(p.tokens,e));break}case"list":{let h=l;a=a.concat(this.walkTokens(h.items,e));break}default:{let h=l;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[h.type]?this.defaults.extensions.childTokens[h.type].forEach(c=>{let p=h[c].flat(1/0);a=a.concat(this.walkTokens(p,e))}):h.tokens&&(a=a.concat(this.walkTokens(h.tokens,e)))}}return a}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=e.renderers[a.name];l?e.renderers[a.name]=function(...h){let c=a.renderer.apply(this,h);return c===!1&&(c=l.apply(this,h)),c}:e.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[a.level];l?l.unshift(a.tokenizer):e[a.level]=[a.tokenizer],a.start&&(a.level==="block"?e.startBlock?e.startBlock.push(a.start):e.startBlock=[a.start]:a.level==="inline"&&(e.startInline?e.startInline.push(a.start):e.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(e.childTokens[a.name]=a.childTokens)}),r.extensions=e),n.renderer){let a=this.defaults.renderer||new xc(this.defaults);for(let l in n.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let h=l,c=n.renderer[h],p=a[h];a[h]=(...v)=>{let b=c.apply(a,v);return b===!1&&(b=p.apply(a,v)),b||""}}r.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new wc(this.defaults);for(let l in n.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let h=l,c=n.tokenizer[h],p=a[h];a[h]=(...v)=>{let b=c.apply(a,v);return b===!1&&(b=p.apply(a,v)),b}}r.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Z0;for(let l in n.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let h=l,c=n.hooks[h],p
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Xi(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Zo=new e8;function hn(t,e){return Zo.parse(t,e)}hn.options=hn.setOptions=function(t){return Zo.setOptions(t),hn.defaults=Zo.defaults,n6(hn.defaults),hn};hn.getDefaults=Tf;hn.defaults=ts;hn.use=function(...t){return Zo.use(...t),hn.defaults=Zo.defaults,n6(hn.defaults),hn};hn.walkTokens=function(t,e){return Zo.walkTokens(t,e)};hn.parseInline=Zo.parseInline;hn.Parser=Oa;hn.parser=Oa.parse;hn.Renderer=xc;hn.TextRenderer=Rf;hn.Lexer=Ra;hn.lexer=Ra.lex;hn.Tokenizer=wc;hn.Hooks=Z0;hn.parse=hn;hn.options;hn.setOptions;hn.use;hn.walkTokens;hn.parseInline;Oa.parse;Ra.lex;const In=document,p6=function(t,e){const n=(this!=null&&this.el?this.el:e||document).querySelector(`[data-nodeid="me${t}"]`);if(!n)throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);return n},nu=function(t,e){if(t.innerHTML="",e.style){const r=e.style;for(const a in r)t.style[a]=r[a]}if(e.dangerouslySetInnerHTML){const r=e.dangerouslySetInnerHTML;if(r.includes("|")&&r.includes("-")||r.includes("![")||r.includes("#")||r.includes("**")||r.includes("`")){t.innerHTML='<div class="node-loading"><div class="loading-spinner"></div><span>渲染中...</span></div>',t.classList.add("mindmap-node-rendering");try{Promise.resolve().then(()=>Qk).then(({default:a})=>{a.preview(t,r,{mode:"dark",hljs:{style:"github"},after:()=>{t.classList.remove("mindmap-node-rendering"),t.classList.add("mindmap-node-completed")}})}).catch(a=>{n(t,r)})}catch{n(t,r)}return}n(t,r);return}function n(r,a){let l=a;l.includes("<table")||l.includes("<td>")||l.includes("<th>")?(l=l.replace(/•\s*【/g,"【"),l=l.replace(/•\s*\[/g,"["),l=l.replace(/•\s*(/g,"("),l=l.replace(/•\s*\(/g,"(")):(l=l.replace(/•\s*【/g,"【"),l=l.replace(/•\s*\[/g,"["),l=l.replace(/•\s*(/g,"("),l=l.replace(/•\s*\(/g,"("),l=l.replace(/^(\s*)•\s*(.+)$/gm,"<li>$2</li>").replace(/(<li>.*<\/li>)/gs,h=>l.includes("<ul>")?h:`<ul>${h}</ul>`).replace(/\n/g,"<br>")),r.innerHTML=l,l.includes("<img"),e.image,r.classList.add("no-image"),r.classList.remove("has-image")}if(e.image){const r=e.image;if(r.url&&r.width&&r.height){const a=In.createElement("img");a.src=this.imageProxy?this.imageProxy(r.url):r.url,a.style.width=r.width+"px",a.style.height=r.height+"px",r.fit&&(a.style.objectFit=r.fit),t.appendChild(a),t.image=a}}else t.image&&(t.image=void 0);{const r=In.createElement("span");r.className="text";let a="";this.markdown?a=this.markdown(e.topic,e):a=e.topic||"",a=a.replace(/•\s*【/g,"【"),a=a.replace(/•\s*\[/g,"["),a=a.replace(/•\s*(/g,"("),a=a.replace(/•\s*\(/g,"("),r.innerHTML=a,t.appendChild(r),t.text=r,e.image,a.includes("<img"),t.classList.add("no-image"),t.classList.remove("has-image")}if(e.hyperLink){const r=In.createElement("a");r.className="hyper-link",r.target="_blank",r.innerText="🔗",r.href=e.hyperLink,t.appendChild(r),t.link=r}else t.link&&(t.link=void 0);if(e.icons&&e.icons.length){const r=In.createElement("span");r.className="icons",r.innerHTML=e.icons.map(a=>`<span>${cp(a)}</span>`).join(""),t.appendChild(r),t.icons=r}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const r=In.createElement("div");r.className="tags",e.tags.forEach(a=>{const l=In.createElement("span");typeof a=="string"?l.textContent=a:(l.textContent=a.text,a.className&&(l.className=a.className),a.style&&Object.assign(l.style,a.style)),r.appendChild(l)}),t.appendChild(r),t.tags=r}else t.tags&&(t.tags=void 0)},t8=function(t,e){const n=In.createElement("me-wrapper"),{p:r,tpc:a}=this.createParent(t);if(n.appendChild(r),!e&&t.children&&t.children.length>0){const l=Of(t.expanded);if(r.appendChild(l),t.expanded!==!1){const h=b7(this,t.children);n.appendChild(h)}}return{grp:n,top:r,tpc:a}},n8=function(t){const e=In.createElement("me-parent"),n=this.createTopic(t);return nu.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},r8=function(t){const e=In.createElement("me-children");return e.append(...t),e},i
|
|||
|
|
color:${a.color};
|
|||
|
|
padding:${a.padding};
|
|||
|
|
margin:${a.margin};
|
|||
|
|
font:${a.font};
|
|||
|
|
background-color:${a.backgroundColor!=="rgba(0, 0, 0, 0)"&&a.backgroundColor};
|
|||
|
|
border-radius:${a.borderRadius};`,this.direction===0&&(e.style.right="0"),f6(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",l=>{l.stopPropagation();const h=l.key;if(h==="Enter"||h==="Tab"){if(l.shiftKey)return;l.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{var l;if(!e)return;const h=((l=e.textContent)==null?void 0:l.trim())||"";h===""?n.topic=r:(n.topic=h,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=h),e.remove(),nu.call(this,t,n),h!==r&&(this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:r}))})},Of=function(t){const e=In.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},o8=function(t){if(!t)return;const e=t.nodeObj,n=e.dangerouslySetInnerHTML||"",r=In.createElement("div");r.id="table-edit-overlay",r.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
background: rgba(0, 0, 0, 0.5);
|
|||
|
|
z-index: 9999;
|
|||
|
|
`;const a=In.createElement("div");a.id="table-edit-container",a.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 50%;
|
|||
|
|
left: 50%;
|
|||
|
|
transform: translate(-50%, -50%);
|
|||
|
|
width: 600px;
|
|||
|
|
min-height: 400px;
|
|||
|
|
max-height: 80vh;
|
|||
|
|
background: white;
|
|||
|
|
border: 2px solid #660874;
|
|||
|
|
border-radius: 8px;
|
|||
|
|
padding: 15px;
|
|||
|
|
z-index: 10000;
|
|||
|
|
box-shadow: 0 8px 24px rgba(0,0,0,0.3);
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
`;const l=In.createElement("div");l.textContent="编辑表格(Markdown格式)",l.style.cssText=`
|
|||
|
|
font-size: 14px;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: #333;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
padding-bottom: 8px;
|
|||
|
|
border-bottom: 1px solid #e0e0e0;
|
|||
|
|
`;const h=In.createElement("textarea");h.value=this.convertTableHTMLToMarkdown(n),h.style.cssText=`
|
|||
|
|
flex: 1;
|
|||
|
|
min-height: 300px;
|
|||
|
|
border: 1px solid #ddd;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
padding: 12px;
|
|||
|
|
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
|
|||
|
|
font-size: 13px;
|
|||
|
|
line-height: 1.5;
|
|||
|
|
resize: vertical;
|
|||
|
|
outline: none;
|
|||
|
|
background: #fafafa;
|
|||
|
|
color: #333;
|
|||
|
|
caret-color: #660874;
|
|||
|
|
`,h.setAttribute("spellcheck","false"),h.setAttribute("autocomplete","off"),h.setAttribute("autocorrect","off"),h.setAttribute("autocapitalize","off");const c=In.createElement("div");c.style.cssText=`
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
align-items: center;
|
|||
|
|
gap: 8px;
|
|||
|
|
margin-top: 12px;
|
|||
|
|
padding-top: 12px;
|
|||
|
|
border-top: 1px solid #e0e0e0;
|
|||
|
|
`;const p=In.createElement("span");p.textContent="提示: Ctrl+Enter保存, Esc取消",p.style.cssText=`
|
|||
|
|
font-size: 11px;
|
|||
|
|
color: #999;
|
|||
|
|
`;const v=In.createElement("div");v.style.cssText=`
|
|||
|
|
display: flex;
|
|||
|
|
gap: 8px;
|
|||
|
|
`;const b=In.createElement("button");b.textContent="取消",b.style.cssText=`
|
|||
|
|
padding: 8px 20px;
|
|||
|
|
background: #6c757d;
|
|||
|
|
color: white;
|
|||
|
|
border: none;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 13px;
|
|||
|
|
transition: background 0.2s;
|
|||
|
|
`,b.addEventListener("mouseenter",()=>{b.style.background="#5a6268"}),b.addEventListener("mouseleave",()=>{b.style.background="#6c757d"});const g=In.createElement("button");g.textContent="保存",g.style.cssText=`
|
|||
|
|
padding: 8px 20px;
|
|||
|
|
background: #660874;
|
|||
|
|
color: white;
|
|||
|
|
border: none;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 13px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
transition: background 0.2s;
|
|||
|
|
`,g.addEventListener("mouseenter",()=>{g.style.background="#4d0655"}),g.addEventListener("mouseleave",()=>{g.style.background="#660874"}),v.appendChild(b),v.appendChild(g),c.appendChild(p),c.appendChild(v),a.appendChild(l),a.appendChild(h),a.appendChild(c),In.body.appendChild(r),In.body.appendChild(a),r.addEventListener("click",()=>{r.remove(),a.remove()}),setTimeout(()=>{h.focus(),h.setSelectionRange(0,0)},50);const m=()=>{const w=h.value.trim();if(w===this.convertTableHTMLToMarkdown(n)){r.remove(),a.remove();return}hn.setOptions({breaks:!1,gfm:!0});const S=hn.parse(w).replace(/<table>/g,'<table class="markdown-table">');r.remove(),a.remove(),e.dangerouslySetInnerHTML=S,e.topic=w,t.innerHTML=S,this.bus.fire("operation",{name:"finishEditTable",obj:e,origin:n}),t.classList.add("no-image"),t.classList.remove("has-image"),this.bus.fire("operation",{name:"finishEditTable",obj:e,origin:n}),this.linkDiv()},x=()=>{r.remove(),a.remove()};g.addEventListener("click",m),b.addEventListener("click",x),h.addEventListener("keydown",w=>{w.stopPropagation(),w.key==="Escape"?(w.preventDefault(),x()):w.key==="Enter"&&w.ctrlKey&&(w.preventDefault(),m())})},s8=function(t){const e=In.createElement("div");e.innerHTML=t;const n=e.querySelector("table");if(!n)return t;let r="";const a=n.querySelector("thead");if(a){const h=a.querySelector("tr");if(h){const c=Array.from(h.querySelectorAll("th")).map(p=>{var v;return((v=p.textContent)==null?void 0:v.trim())||""});r+="| "+c.join(" | ")+` |
|
|||
|
|
`,r+="| "+c.map(()=>"---").join(" | ")+` |
|
|||
|
|
`}}const l=n.querySelector("tbody");return l&&l.querySelectorAll("tr").forEach(h=>{const c=Array.from(h.querySelectorAll("td")).map(p=>{var v;return((v=p.textContent)==null?void 0:v.trim())||""});r+="| "+c.join(" | ")+` |
|
|||
|
|
`}),r.trim()},Ko=document,yi="http://www.w3.org/2000/svg",fp=function(t,e,n,r={}){const{anchor:a="middle",color:l,dataType:h}=r,c=document.createElementNS(yi,"text");return Hn(c,{"text-anchor":a,x:e+"",y:n+"",fill:l||(a==="middle"?"rgb(235, 95, 82)":"#666")}),h&&(c.dataset.type=h),c.innerHTML=t,c},m6=function(t,e,n){const r=Ko.createElementNS(yi,"path");return Hn(r,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),r},Ml=function(t){const e=Ko.createElementNS(yi,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},Dm=function(){const t=Ko.createElementNS(yi,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},l8=function(t,e,n,r){const a=Ko.createElementNS(yi,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((l,h)=>{const c=l.d,p=Ko.createElementNS(yi,"path"),v={d:c,stroke:(r==null?void 0:r.stroke)||"rgb(235, 95, 82)",fill:"none","stroke-linecap":(r==null?void 0:r.strokeLinecap)||"cap","stroke-width":String((r==null?void 0:r.strokeWidth)||"2")};(r==null?void 0:r.opacity)!==void 0&&(v.opacity=String(r.opacity)),Hn(p,v),h===0&&p.setAttribute("stroke-dasharray",(r==null?void 0:r.strokeDasharray)||"8,2");const b=Ko.createElementNS(yi,"path");Hn(b,{d:c,stroke:"transparent",fill:"none","stroke-width":"15"}),a.appendChild(b),a.appendChild(p),a[l.name]=p}),a},g6=function(t,e,n){if(!e)return;const r=Ko.createElement("div");t.nodes.appendChild(r);const a=e.innerHTML;r.id="input-box",r.textContent=a,r.contentEditable="plaintext-only",r.spellcheck=!1;const l=e.getBBox();r.style.cssText=`
|
|||
|
|
min-width:${Math.max(88,l.width)}px;
|
|||
|
|
position:absolute;
|
|||
|
|
left:${l.x}px;
|
|||
|
|
top:${l.y}px;
|
|||
|
|
padding: 2px 4px;
|
|||
|
|
margin: -2px -4px;
|
|||
|
|
`,f6(r),t.scrollIntoView(r),r.addEventListener("keydown",h=>{h.stopPropagation();const c=h.key;if(c==="Enter"||c==="Tab"){if(h.shiftKey)return;h.preventDefault(),r.blur(),t.container.focus()}}),r.addEventListener("blur",()=>{var h;if(!r)return;const c=((h=r.textContent)==null?void 0:h.trim())||"";c===""?n.label=a:n.label=c,r.remove(),c!==a&&(e.innerHTML=n.label,"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},c8=function(t){const e=this.map.querySelector("me-root"),n=e.offsetTop,r=e.offsetLeft,a=e.offsetWidth,l=e.offsetHeight,h=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let c=0;c<h.length;c++){const p=h[c],v=p.querySelector("me-tpc"),{offsetLeft:b,offsetTop:g}=t0(this.nodes,v),m=v.offsetWidth,x=v.offsetHeight,w=p.parentNode.className,S=this.generateMainBranch({pT:n,pL:r,pW:a,pH:l,cT:g,cL:b,cW:m,cH:x,direction:w,containerHeight:this.nodes.offsetHeight}),k=this.theme.palette,C=v.nodeObj.branchColor||k[c%k.length];if(v.style.borderColor=C,this.lines.appendChild(m6(S,C,"3")),t&&t!==p)continue;const A=Ml("subLines"),T=p.lastChild;T.tagName==="svg"&&T.remove(),p.appendChild(A),v6(this,A,C,p,w,!0)}this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},v6=function(t,e,n,r,a,l){const h=r.firstChild,c=r.children[1].children;if(c.length===0)return;const p=h.offsetTop,v=h.offsetLeft,b=h.offsetWidth,g=h.offsetHeight;for(let m=0;m<c.length;m++){const x=c[m],w=x.firstChild,S=w.offsetTop,k=w.offsetLeft,C=w.offsetWidth,A=w.offsetHeight,T=w.firstChild.nodeObj.branchColor||n,M=t.generateSubBranch({pT:p,pL:v,pW:b,pH:g,cT:S,cL:k,cW:C,cH:A,direction:a,isFirst:l});e.appendChild(m6(M,T,"2"));const y=w.children[1];if(y){if(!y.expanded)continue}else continue;v6(t,e,T,x,a)}},Rm={addChild:"插入子节点",addParent:"插入父节点",addSibling:"插入同级节点",removeNode:"删除节点",focus:"专注",cancelFocus:"取消专注",moveUp:"上移",moveDown:"下移",link:"连接",linkBidirectional:"双向连接",clickTips:"请点击目标节点",summary:"摘要"},Om={cn:Rm,zh_CN:Rm,zh_TW:{addChild:"插入子節點",addParent:"插入父節點",addSibling:"插入同級節點",removeNode:"刪除節點",focus:"專注",cancelFocus:"取消專注",moveUp:"上移",moveDown:"下移",link:"連接",linkBidirectional:"雙向連接",clickTips:"請點擊目標節點",summary:"摘要"},en:{addChild:"Add child",addParent:"Add parent",addSibling:"Add sibling",removeNode:"Remove node",focus:"Focus Mode",cancelFocus:"Cancel Focus Mode",moveUp:"Move up",moveDown:"Move down",link:"Link",linkBidirectional:"Bidirectional Link",clickTips:"Please click the target node",summary:"Summary"},ru:{addChild:"Добавить дочерний элемент",addParent:"Добавить родительский элемент",addSibling:"Добавить на этом уровне",removeNode:"Удалить узел",focus:"Режим фокусировки",cancelFocus:"Отменить режим фокусировки",moveUp:"Поднять выше",moveDown:"Опустить ниже",link:"Ссылка",linkBidirectional:"Двунаправленная ссылка",clickTips:"Пожалуйста, нажмите на целевой узел",summary:"Описание"},ja:{addChild:"子ノードを追加する",addParent:"親ノードを追加します",addSibling:"兄弟ノードを追加する",removeNode:"ノードを削除",focus:"集中",cancelFocus:"集中解除",moveUp:"上へ移動",moveDown:"下へ移動",link:"コネクト",linkBidirectional:"双方向リンク",clickTips:"ターゲットノードをクリックしてください",summary:"概要"},pt:{addChild:"Adicionar item filho",addParent:"Adicionar item pai",addSibling:"Adicionar item irmao",removeNode:"Remover item",focus:"Modo Foco",cancelFocus:"Cancelar Modo Foco",moveUp:"Mover para cima",moveDown:"Mover para baixo",link:"Link",linkBidirectional:"Link bidirecional",clickTips:"Favor clicar no item alvo",summary:"Resumo"},it:{addChild:"Aggiungi figlio",addParent:"Aggiungi ge
|
|||
|
|
.topic { font-family: Arial, sans-serif; font-size: 14px; color: #333; }
|
|||
|
|
.markdown-content { font-size: 12px; line-height: 1.3; }
|
|||
|
|
|
|||
|
|
/* 表格样式 */
|
|||
|
|
.markdown-table {
|
|||
|
|
border-collapse: collapse;
|
|||
|
|
width: 100%;
|
|||
|
|
margin: 4px 0;
|
|||
|
|
font-size: 11px;
|
|||
|
|
border: 1px solid #e0e0e0;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|||
|
|
background-color: #fafafa;
|
|||
|
|
overflow: hidden;
|
|||
|
|
white-space: normal;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table th,
|
|||
|
|
.markdown-table td {
|
|||
|
|
border: 1px solid #e0e0e0;
|
|||
|
|
padding: 8px 12px;
|
|||
|
|
text-align: left;
|
|||
|
|
vertical-align: top;
|
|||
|
|
position: relative;
|
|||
|
|
white-space: normal;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table th {
|
|||
|
|
background-color: #f5f5f5;
|
|||
|
|
font-weight: 600;
|
|||
|
|
color: #333;
|
|||
|
|
text-align: center;
|
|||
|
|
border-bottom: 1px solid #d0d0d0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table td {
|
|||
|
|
background-color: #fff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table tr:nth-child(even) td {
|
|||
|
|
background-color: #f8f8f8;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table tr:hover td {
|
|||
|
|
background-color: #f0f8ff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* 移除多余的边框,保持简洁 */
|
|||
|
|
.markdown-table th:not(:last-child),
|
|||
|
|
.markdown-table td:not(:last-child) {
|
|||
|
|
border-right: 1px solid #e0e0e0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.markdown-table tr:not(:last-child) td {
|
|||
|
|
border-bottom: 1px solid #e0e0e0;
|
|||
|
|
}
|
|||
|
|
`,l=await e.exportSvg(!0,a);if(!l)return;const h=URL.createObjectURL(l),c=document.createElement("a");c.href=h,c.download=`${r}.${t}`,c.click(),URL.revokeObjectURL(h)}catch{alert(`导出${t.toUpperCase()}失败,请重试`)}},A8={side:v8,left:b8,right:y8,full:w8,living:x8,zoomin:k8,zoomout:S8,exportSvg:E8},uo=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=A8[e],n};function M8(t){try{const e=document.createElement("div"),n=uo("fullscreen","full"),r=uo("toCenter","living"),a=uo("zoomout","zoomout"),l=uo("zoomin","zoomin"),h=uo("exportSvg","exportSvg");h.title="导出SVG矢量图";const c=document.createElement("span");return c.innerText="100%",e.appendChild(n),e.appendChild(r),e.appendChild(a),e.appendChild(l),e.appendChild(h),e.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===t.el?(document.exitFullscreen(),setTimeout(()=>{t.el.focus()},100)):(t.el.requestFullscreen(),setTimeout(()=>{},100))},r.onclick=()=>{t.toCenter()},a.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},l.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},h.onclick=()=>{T8("svg")(t)},setTimeout(()=>{const p=document.getElementById("exportSvg")},1e3),e}catch{const e=document.createElement("div");return e.className="mind-elixir-toolbar rb",e}}function C8(t){const e=document.createElement("div"),n=uo("tbltl","left"),r=uo("tbltr","right"),a=uo("tblts","side");return e.appendChild(n),e.appendChild(r),e.appendChild(a),e.className="mind-elixir-toolbar lt",n.onclick=()=>{t.initLeft()},r.onclick=()=>{t.initRight()},a.onclick=()=>{t.initSide()},e}function L8(t){try{if(!t.container)return;const e=M8(t),n=C8(t);t.container.append(e),t.container.append(n)}catch{}}/*! @viselect/vanilla v3.9.0 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */let _8=class{constructor(){this._listeners=new Map,this.on=this.addEventListener,this.off=this.removeEventListener,this.emit=this.dispatchEvent}addEventListener(t,e){const n=this._listeners.get(t)??new Set;return this._listeners.set(t,n),n.add(e),this}removeEventListener(t,e){var n;return(n=this._listeners.get(t))==null||n.delete(e),this}dispatchEvent(t,...e){let n=!0;for(const r of this._listeners.get(t)??[])n=r(...e)!==!1&&n;return n}unbindAllListeners(){this._listeners.clear()}};const Hm=(t,e="px")=>typeof t=="number"?t+e:t,no=({style:t},e,n)=>{if(typeof e=="object")for(const[r,a]of Object.entries(e))a!==void 0&&(t[r]=Hm(a));else n!==void 0&&(t[e]=Hm(n))},Pm=(t=0,e=0,n=0,r=0)=>{const a={x:t,y:e,width:n,height:r,top:e,left:t,right:t+n,bottom:e+r};return{...a,toJSON:()=>JSON.stringify(a)}},N8=t=>{let e,n=-1,r=!1;return{next:(...a)=>{e=a,r||(r=!0,n=requestAnimationFrame(()=>{t(...e),r=!1}))},cancel:()=>{cancelAnimationFrame(n),r=!1}}},zm=(t,e,n="touch")=>{switch(n){case"center":{const r=e.left+e.width/2,a=e.top+e.height/2;return r>=t.left&&r<=t.right&&a>=t.top&&a<=t.bottom}case"cover":return e.left>=t.left&&e.top>=t.top&&e.right<=t.right&&e.bottom<=t.bottom;case"touch":return t.right>=e.left&&t.left<=e.right&&t.bottom>=e.top&&t.top<=e.bottom}},D8=()=>matchMedia("(hover: none), (pointer: coarse)").matches,R8=()=>"safari"in window,vp=t=>Array.isArray(t)?t:[t],b6=t=>(e,n,r,a={})=>{(e instanceof HTMLCollection||e instanceof NodeList)&&(e=Array.from(e)),n=vp(n),e=vp(e);for(const l of e)if(l)for(const h of n)l[t](h,r,{capture:!1,...a})},ro=b6("addEventListener"),Hi=b6("removeEventListener"),y0=t=>{var e;const{clientX:n,clientY:r,target:a}=((e=t.touches)==null?void 0:e[0])??t;return{x:n,y:r,target:a}},ls=(t,e=document)=>vp(t).map(n=>typeof n=="string"?Array.from(e.querySelectorAll(n)):n instanceof Element?n:null).flat().filter(Boolean),O8=(t,e)=>e.some(n=>typeof n=="number"?t.button===n:typeof n=="object"?n.button!==t.button?!1:n.modifiers.every(r=>{switch(r){case"alt":return t.altKey;case"ctrl":return t.ctrlKey||t.metaKey;case"shift":return t.shiftKey}}):!1),{abs:Fo,max:Bm,min:Fm,ceil:qm}=Math,jm=(t=[])=>({stored:t,selected:[],touched:[],changed:{added:[],removed:[]}}),y6=class extends _8{constructor(t){var e,n,r,a,l;super(),this._selection=jm
|
|||
|
|
`),c=parseFloat(e.lineHeight)||parseFloat(e.fontSize)*1.2,p=parseFloat(e.fontSize),v=parseInt(e.paddingTop)||8,b=parseInt(e.paddingLeft)||8,g=t.offsetWidth||200,m=n+b,x=(h.length-1)*c+p+v+(parseInt(e.paddingBottom)||8),w=t.offsetHeight||100,S=Math.min(x,w),k=document.createElementNS(ur,"rect");return Hn(k,{x:n+"",y:r+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:g+"px",height:S+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),a.appendChild(k),h.forEach((C,A)=>{const T=document.createElementNS(ur,"text");Hn(T,{x:m+"",y:r+v+p+c*A+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),T.innerHTML=C,a.appendChild(T)}),a}function Wm(t){if(!t)return t;let e=t.replace(/<td[^>]*>([^<]*)<br\s*\/?>([^<]*)<\/td>/gi,(n,r,a)=>`<td>${r} ${a}</td>`);return e=e.replace(/<th[^>]*>([^<]*)<br\s*\/?>([^<]*)<\/th>/gi,(n,r,a)=>`<th>${r} ${a}</th>`),e=e.replace(/<br\s*\/?>/gi," "),e=e.replace(/•\s*【/g,"【"),e=e.replace(/•\s*\[/g,"["),e=e.replace(/•\s*(/g,"("),e=e.replace(/•\s*\(/g,"("),e=e.replace(/<([^>]+)>/g,(n,r)=>{const a=["br","hr","img","input","meta","link"],l=r.split(" ")[0].toLowerCase();return a.includes(l)?`<${r} />`:n}),e}function sh(t,e,n,r,a=!1){const l=document.createElementNS(ur,"g");a||l.setAttribute("transform",`translate(${n}, ${r})`);const h=t;let c="";h.nodeObj&&h.nodeObj.dangerouslySetInnerHTML?c=h.nodeObj.dangerouslySetInnerHTML:h.text&&h.text.innerHTML&&(c=h.text.innerHTML);const p=c&&c!==t.textContent,v=c&&c.includes("<table");if(v){const b=t.offsetWidth||400,g=t.offsetHeight||200,m=document.createElementNS(ur,"rect");Hn(m,{x:n+"",y:r+"",width:b+"",height:g+"",fill:"white",stroke:"#ccc","stroke-width":"1"}),l.appendChild(m);const x=document.createElementNS(ur,"foreignObject");Hn(x,{x:a?n+"":"0",y:a?r+"":"0",width:b+"",height:g+""});const w=`
|
|||
|
|
<div xmlns="http://www.w3.org/1999/xhtml" style="
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
padding: 8px;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
overflow: hidden;
|
|||
|
|
font-family: '${(e.fontFamily||"Arial, sans-serif").replace(/"/g,""")}';
|
|||
|
|
font-size: ${e.fontSize||"14px"};
|
|||
|
|
line-height: 1.4;
|
|||
|
|
">
|
|||
|
|
${Wm(c)}
|
|||
|
|
</div>
|
|||
|
|
`;return x.innerHTML=w,l.appendChild(x),l}if(p&&!v){const b=Wm(c),g=t.getBoundingClientRect(),m=g.width,x=g.height;b.includes("<img"),h.nodeObj&&h.nodeObj.image;try{const N=document.createElement("div");N.innerHTML=b,N.style.cssText=`
|
|||
|
|
position: absolute;
|
|||
|
|
top: -9999px;
|
|||
|
|
left: -9999px;
|
|||
|
|
width: ${m}px;
|
|||
|
|
font-family: '${(e.fontFamily||"Arial").replace(/"/g,""")}';
|
|||
|
|
font-size: ${e.fontSize};
|
|||
|
|
color: ${e.color};
|
|||
|
|
`,document.body.appendChild(N);const z=(N.textContent||N.innerText||"").split(`
|
|||
|
|
`).filter(q=>q.trim());if(z.length>0){const q=parseFloat(e.fontSize)||14,P=q*1.4,Y=parseInt(e.paddingTop)||8,te=parseInt(e.paddingBottom)||8,ue=parseInt(e.paddingLeft)||8,Le=(z.length-1)*P+q+Y+te,qe=Math.min(Le,x),Xe=b.includes("<img"),it=Xe?n+m/2:n+ue,$e=r+q+Y;z.forEach((nt,ut)=>{const je=document.createElementNS(ur,"text");Hn(je,{x:it+"",y:$e+P*ut+"","text-anchor":Xe?"middle":"start","font-family":e.fontFamily,"font-size":e.fontSize,"font-weight":e.fontWeight,fill:e.color}),je.innerHTML=nt.trim(),l.appendChild(je)});const De=document.createElementNS(ur,"rect");return Hn(De,{x:n+"",y:r+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:m+"px",height:qe+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),l.insertBefore(De,l.firstChild),document.body.removeChild(N),l}document.body.removeChild(N)}catch{}const w=document.createElementNS(ur,"foreignObject");Hn(w,{x:n+"",y:r+"",width:m+"px",height:x+"px"});const S=document.createElement("div");S.innerHTML=b;const k=15,C=15,A=parseInt(e.paddingLeft)||8,T=parseInt(e.paddingRight)||8;S.style.cssText=`
|
|||
|
|
width: 100%;
|
|||
|
|
height: 100%;
|
|||
|
|
font-family: '${(e.fontFamily||"Arial").replace(/"/g,""")}';
|
|||
|
|
font-size: ${e.fontSize};
|
|||
|
|
color: ${e.color};
|
|||
|
|
background: transparent;
|
|||
|
|
padding: ${k}px ${T}px ${C}px ${A}px;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
overflow: visible;
|
|||
|
|
text-align: center !important;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
justify-content: center;
|
|||
|
|
align-items: center;
|
|||
|
|
position: relative;
|
|||
|
|
`,S.querySelectorAll("table").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
width: 100%;
|
|||
|
|
border-collapse: collapse;
|
|||
|
|
font-size: ${e.fontSize};
|
|||
|
|
font-family: '${(e.fontFamily||"Arial").replace(/"/g,""")}';
|
|||
|
|
margin: 0 auto 0px auto;
|
|||
|
|
border: 1px solid #ccc;
|
|||
|
|
`,N.querySelectorAll("td, th").forEach(q=>{const P=q;P.style.cssText=`
|
|||
|
|
border: 1px solid #ccc;
|
|||
|
|
padding: 4px 8px;
|
|||
|
|
text-align: center;
|
|||
|
|
vertical-align: top;
|
|||
|
|
font-size: ${parseFloat(e.fontSize)*.9}px;
|
|||
|
|
background: white;
|
|||
|
|
`})}),S.querySelectorAll("ul, ol").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
margin: 2px 0 4px 0 !important;
|
|||
|
|
padding-left: 0 !important;
|
|||
|
|
text-align: center !important;
|
|||
|
|
list-style-position: inside !important;
|
|||
|
|
`}),S.querySelectorAll("li").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
margin: 1px 0 !important;
|
|||
|
|
line-height: 1.2 !important;
|
|||
|
|
padding: 0 !important;
|
|||
|
|
text-align: center !important;
|
|||
|
|
list-style-position: inside !important;
|
|||
|
|
`}),S.querySelectorAll("p").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
margin: 2px 0 !important;
|
|||
|
|
line-height: 1.4 !important;
|
|||
|
|
padding: 0 !important;
|
|||
|
|
text-align: center !important;
|
|||
|
|
`}),S.querySelectorAll("span, div, strong, em").forEach(N=>{const z=N;z.style.cssText=`
|
|||
|
|
text-align: center !important;
|
|||
|
|
display: block !important;
|
|||
|
|
margin-left: auto !important;
|
|||
|
|
margin-right: auto !important;
|
|||
|
|
`});const M=document.createElement("style");M.textContent=`
|
|||
|
|
* {
|
|||
|
|
text-align: center !important;
|
|||
|
|
margin-left: auto !important;
|
|||
|
|
margin-right: auto !important;
|
|||
|
|
}
|
|||
|
|
`,S.appendChild(M),S.querySelectorAll("img").forEach((N,z)=>{const q=N,P=m-A-T-5,Y=Math.floor(x*.7);q.style.cssText=`
|
|||
|
|
max-width: ${P}px !important;
|
|||
|
|
max-height: ${Y}px !important;
|
|||
|
|
width: auto !important;
|
|||
|
|
height: auto !important;
|
|||
|
|
display: block !important;
|
|||
|
|
margin: 8px auto 0px auto !important;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
object-fit: contain !important;
|
|||
|
|
flex-shrink: 0 !important;
|
|||
|
|
box-sizing: border-box !important;
|
|||
|
|
position: relative !important;
|
|||
|
|
top: 0 !important;
|
|||
|
|
left: 0 !important;
|
|||
|
|
right: 0 !important;
|
|||
|
|
bottom: 0 !important;
|
|||
|
|
`}),w.appendChild(S);const y=document.createElementNS(ur,"rect");Hn(y,{x:n+"",y:r+"",rx:e.borderRadius||"8",ry:e.borderRadius||"8",width:m+"px",height:x+"px",fill:e.backgroundColor||"white",stroke:e.borderColor||"#ccc","stroke-width":e.borderWidth||"1"}),l.insertBefore(y,l.firstChild),l.appendChild(w)}else return L6(t,e,n,r);return l}function x0(t,e,n=!1,r){var a;const l=getComputedStyle(e);let h,c;if(r)h=r.x,c=r.y;else{const{offsetLeft:x,offsetTop:w}=Ef(t.nodes,e);h=x,c=w}s7(e);const p=e;p.nodeObj&&p.nodeObj.dangerouslySetInnerHTML&&((a=p.nodeObj.dangerouslySetInnerHTML)==null||a.includes("<img")),p.nodeObj&&p.nodeObj.image;const v=document.createElementNS(ur,"g");r||v.setAttribute("transform",`translate(${h}, ${c})`);let b=null;const g=e,m=g.nodeObj&&g.nodeObj.dangerouslySetInnerHTML&&g.nodeObj.dangerouslySetInnerHTML.includes("<table");if(g.nodeObj&&g.nodeObj.dangerouslySetInnerHTML){if(m)return sh(e,l,h,c);b=sh(e,l,h,c)}else n?b=sh(e,l,h,c):b=L6(e,l,h,c);return b&&v.appendChild(b),v}function r9(t,e){const n=getComputedStyle(e),{offsetLeft:r,offsetTop:a}=t0(t.nodes,e),l=document.createElementNS(ur,"a"),h=document.createElementNS(ur,"text");return Hn(h,{x:r+"",y:a+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),h.innerHTML=e.textContent,l.appendChild(h),l.setAttribute("href",e.href),l}async function i9(t,e){const n=getComputedStyle(e),{offsetLeft:r,offsetTop:a}=Ef(t.nodes,e);if(!e.nodeObj.image)return null;const l=e.nodeObj.image,h=document.createElementNS(ur,"image"),c=parseInt(n.width),p=parseInt(n.height),v=Math.min(c-10,300),b=Math.min(p*.6,150),g=Math.min(l.width||200,v),m=Math.min(l.height||150,b);let x=0;if(e.text&&e.text.textContent){const k=e.text.textContent.trim();if(k){const C=k.split(`
|
|||
|
|
`).length,A=parseFloat(n.lineHeight)||parseFloat(n.fontSize)*1.2;parseFloat(n.fontSize);const T=parseInt(n.paddingTop)||8,M=parseInt(n.paddingBottom)||8;x=C*A+T+M}}const w=r+(c-g)/2,S=a+x+0;try{const k=await _6(l.url);Hn(h,{x:w+"",y:S+"",width:g+"",height:m+"",href:k})}catch{Hn(h,{x:w+"",y:S+"",width:g+"",height:m+"",href:l.url})}return h}async function a9(t,e){const n=getComputedStyle(e),{offsetLeft:r,offsetTop:a}=Ef(t.nodes,e),l=document.createElementNS(ur,"image"),h=t.imageProxy?t.imageProxy(e.src):e.src,c=Math.min(parseInt(n.width)||300,300),p=Math.min(parseInt(n.height)||200,200);try{const v=await _6(h);Hn(l,{x:r+"",y:a+"",width:c+"",height:p+"",href:v})}catch{Hn(l,{x:r+"",y:a+"",width:c+"",height:p+"",href:h})}return l}function _6(t){return new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const a=document.createElement("canvas");a.width=r.width,a.height=r.height;const l=a.getContext("2d");if(!l){n(new Error("Failed to get canvas context"));return}l.drawImage(r,0,0);const h=a.toDataURL("image/png");e(h)}catch(a){n(a)}},r.onerror=()=>{n(new Error("Failed to load image"))},r.src=t})}const k0=100,o9='<?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">',Gm=(t,e)=>{const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return window.getComputedStyle(e).transform,{x:n.left-r.left,y:n.top-r.top,width:n.width,height:n.height}},s9=async()=>{await new Promise(t=>setTimeout(t,0)),await document.fonts.ready,await new Promise(t=>requestAnimationFrame(t)),await new Promise(t=>setTimeout(t,100))},l9=async(t,e=!1)=>{var n,r,a;await s9();const l=t.nodes;l.getBoundingClientRect();const h=l.offsetHeight+k0*2,c=l.offsetWidth+k0*2,p=n9(h+"px",c+"px"),v=document.createElementNS(ur,"svg"),b=document.createElementNS(ur,"rect");Hn(b,{x:"0",y:"0",width:`${c}`,height:`${h}`,fill:t.theme.cssVar["--bgcolor"]}),p.appendChild(b),l.querySelectorAll(".subLines").forEach(k=>{const C=k.cloneNode(!0),A=k.parentElement,T=Gm(A,l);C.setAttribute("x",`${T.x}`),C.setAttribute("y",`${T.y}`),v.appendChild(C)});const g=(n=l.querySelector(".lines"))==null?void 0:n.cloneNode(!0);g&&v.appendChild(g);const m=(r=l.querySelector(".topiclinks"))==null?void 0:r.cloneNode(!0);m&&v.appendChild(m);const x=(a=l.querySelector(".summary"))==null?void 0:a.cloneNode(!0);x&&v.appendChild(x);const w=Array.from(l.querySelectorAll("me-tpc")).map(async k=>{const C=Gm(k,l),A=k.nodeObj.dangerouslySetInnerHTML,T=!!(k.text&&k.text.innerHTML&&k.text.innerHTML!==k.text.textContent),M=k.nodeObj.image;if(A||T){const y=x0(t,k,!e,C);v.appendChild(y)}else v.appendChild(x0(t,k,!1,C));if(M)try{const y=await i9(t,k);y&&v.appendChild(y)}catch{}});await Promise.all(w),l.querySelectorAll(".tags > span").forEach(k=>{v.appendChild(x0(t,k))}),l.querySelectorAll(".icons > span").forEach(k=>{v.appendChild(x0(t,k))}),l.querySelectorAll(".hyper-link").forEach(k=>{v.appendChild(r9(t,k))});const S=Array.from(l.querySelectorAll("img")).map(async(k,C)=>{const A=k.closest("me-tpc"),T=k.closest("foreignObject");return A||T?null:await a9(t,k)});return(await Promise.all(S)).filter(k=>k!==null).forEach(k=>{k&&v.appendChild(k)}),Hn(v,{x:k0+"",y:k0+"",overflow:"visible"}),p.appendChild(v),p},c9=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),o9+t.outerHTML);function u9(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=a=>{e(a.target.result)},r.onerror=a=>{n(a)},r.readAsDataURL(t)})}const d9=async function(t=!1,e){const n=await l9(this,t),r=c9(n,e);return new Blob([r],{type:"image/svg+xml"})},h9=async function(t=!1,e){const n=await this.exportSvg(t,e),r=await u9(n);return new Promise((a,l)=>{const h=new Image;h.setAttribute("crossOrigin","anonymous");const c=setTimeout(()=>{l(new Error("Image loading timeout"))},1e4);h.onload=()=>{clearTimeout(c);try{const p=document.createElement("canvas");p.width=h.width,p.height=h.height;const v=p.getContext("2d");v.fillStyle="#ffffff",v.fillRect(0,0,p.width,p.height),v.drawImage(h,0,0),p.toBlob(a,"image/png",1)}catch(p){l(
|
|||
|
|
]`).replace("lheading",R6).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},A9=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,M9=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,I6=/^( {2,}|\\)\n(?!\s*$)/,C9=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,au=/[\p{P}\p{S}]/u,Uf=/[\s\p{P}\p{S}]/u,H6=/[^\s\p{P}\p{S}]/u,L9=fn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Uf).getRegex(),P6=/(?!~)[\p{P}\p{S}]/u,_9=/(?!~)[\s\p{P}\p{S}]/u,N9=/(?:[^\s\p{P}\p{S}]|~)/u,D9=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,z6=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,R9=fn(z6,"u").replace(/punct/g,au).getRegex(),O9=fn(z6,"u").replace(/punct/g,P6).getRegex(),B6="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",I9=fn(B6,"gu").replace(/notPunctSpace/g,H6).replace(/punctSpace/g,Uf).replace(/punct/g,au).getRegex(),H9=fn(B6,"gu").replace(/notPunctSpace/g,N9).replace(/punctSpace/g,_9).replace(/punct/g,P6).getRegex(),P9=fn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,H6).replace(/punctSpace/g,Uf).replace(/punct/g,au).getRegex(),z9=fn(/\\(punct)/,"gu").replace(/punct/g,au).getRegex(),B9=fn(/^<(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(),F9=fn(jf).replace("(?:-->|$)","-->").getRegex(),q9=fn("^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",F9).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,j9=fn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Sc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),F6=fn(/^!?\[(label)\]\[(ref)\]/).replace("label",Sc).replace("ref",qf).getRegex(),q6=fn(/^!?\[(ref)\](?:\[\])?/).replace("ref",qf).getRegex(),$9=fn("reflink|nolink(?!\\()","g").replace("reflink",F6).replace("nolink",q6).getRegex(),Vf={_backpedal:zl,anyPunctuation:z9,autolink:B9,blockSkip:D9,br:I6,code:M9,del:zl,emStrongLDelim:R9,emStrongRDelimAst:I9,emStrongRDelimUnd:P9,escape:A9,link:j9,nolink:q6,punctuation:L9,reflink:F6,reflinkSearch:$9,tag:q9,text:C9,url:zl},U9={...Vf,link:fn(/^!?\[(label)\]\((.*?)\)/).replace("label",Sc).getRegex(),reflink:fn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sc).getRegex()},bp={...Vf,emStrongRDelimAst:H9,emStrongLDelim:O9,url:fn(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},V9={...bp,br:fn(I6).replace("{2,}","*").getRegex(),text:fn(bp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},S0={normal:$f,gfm:E9,pedantic:T9},fl={normal:Vf,gfm:bp,breaks:V9,pedantic:U9},W9={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(l=>{let h=l.match(n.other.beginningSpace);if(h===null)return l;let[c]=h;return c.length>=a.length?l.slice(a.length):l}).join(`
|
|||
|
|
`)}var Ec=class{constructor(t){St(this,"options"),St(this,"rules"),St(this,"lexer"),this.options=t||ns}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ml(n,`
|
|||
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=K9(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=ml(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:ml(e[0],`
|
|||
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ml(e[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),r="",a="",l=[];for(;n.length>0;){let h=!1,c=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))c.push(n[p]),h=!0;else if(!h)c.push(n[p]);else break;n=n.slice(p);let v=c.join(`
|
|||
|
|
`),b=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|||
|
|
${v}`:v,a=a?`${a}
|
|||
|
|
${b}`:b;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=g,n.length===0)break;let m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.blockquote(w);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,a=a.substring(0,a.length-x.text.length)+S.text;break}else if((m==null?void 0:m.type)==="list"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.list(w);l[l.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,a=a.substring(0,a.length-x.raw.length)+S.raw,n=w.substring(l.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:a}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,a={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),h=!1;for(;t;){let p=!1,v="",b="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;v=e[0],t=t.substring(v.length);let g=e[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=t.split(`
|
|||
|
|
`,1)[0],x=!g.trim(),w=0;if(this.options.pedantic?(w=2,b=g.trimStart()):x?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,b=g.slice(w),w+=e[1].length),x&&this.rules.other.blankLine.test(m)&&(v+=m+`
|
|||
|
|
`,t=t.substring(m.length+1),p=!0),!p){let C=this.rules.other.nextBulletRegex(w),A=this.rules.other.hrRegex(w),T=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;t;){let N=t.split(`
|
|||
|
|
`,1)[0],z;if(m=N,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),z=m):z=m.replace(this.rules.other.tabCharGlobal," "),T.test(m)||M.test(m)||y.test(m)||C.test(m)||A.test(m))break;if(z.search(this.rules.other.nonSpaceChar)>=w||!m.trim())b+=`
|
|||
|
|
`+z.slice(w);else{if(x||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(g)||M.test(g)||A.test(g))break;b+=`
|
|||
|
|
`+m}!x&&!m.trim()&&(x=!0),v+=N+`
|
|||
|
|
`,t=t.substring(N.length+1),g=z.slice(w)}}a.loose||(h?a.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(h=!0));let S=null,k;this.options.gfm&&(S=this.rules.other.listIsTask.exec(b),S&&(k=S[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:v,task:!!S,checked:k,loose:!1,text:b,tokens:[]}),a.raw+=v}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p=0;p<a.items.length;p++)if(this.lexer.state.top=!1,a.items[p].tokens=this.lexer.blockTokens(a.items[p].text,[]),!a.loose){let v=a.items[p].tokens.filter(g=>g.type==="space"),b=v.length>0&&v.some(g=>this.rules.other.anyLine.test(g.raw));a.loose=b}if(a.loose)for(let p=0;p<a.items.length;p++)a.items[p].loose=!0;return a}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:a}}}table(t){var e;let n=this.rules.block.table.exec(t);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Ym(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(e=n[3])!=null&&e.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],h={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let c of a)this.rules.other.tableAlignRight.test(c)?h.align.push("right"):this.rules.other.tableAlignCenter.test(c)?h.align.push("center"):this.rules.other.tableAlignLeft.test(c)?h.align.push("left"):h.align.push(null);for(let c=0;c<r.length;c++)h.header.push({text:r[c],tokens:this.lexer.inline(r[c]),header:!0,align:h.align[c]});for(let c of l)h.rows.push(Ym(c,h.header.length).map((p,v)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:h.align[v]})));return h}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|||
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=ml(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=G9(e[2],"()");if(l===-2)return;if(l>-1){let h=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let r=e[2],a="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Jm(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=e[r.toLowerCase()];if(!a){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Jm(n,a,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...r[0]].length-1,l,h,c=a,p=0,v=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+a);(r=v.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(h=[...l].length,r[3]||r[4]){c+=h;continue}else if((r[5]||r[6])&&a%3&&!((a+h)%3)){p+=h;continue}if(c-=h,c>0)continue;h=Math.min(h,h+c+p);let b=[...r[0]][0].length,g=t.slice(0,a+r.index+b+h);if(Math.min(a,h)%2){let x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var e;let n;if(n=this.rules.inline.url.exec(t)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let l;do l=n[0],n[0]=((e=this.rules.inline._backpedal.exec(n[0]))==null?void 0:e[0])??"";while(l!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Ia=class yp{constructor(e){St(this,"tokens"),St(this,"
|
|||
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var a,l,h;for(this.options.pedantic&&(e=e.replace(Dr.tabCharGlobal," ").replace(Dr.spaceLine,""));e;){let c;if((l=(a=this.options.extensions)==null?void 0:a.block)!=null&&l.some(v=>(c=v.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let v=n.at(-1);c.raw.length===1&&v!==void 0?v.raw+=`
|
|||
|
|
`:n.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),n.push(c);continue}let p=e;if((h=this.options.extensions)!=null&&h.startBlock){let v=1/0,b=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},b),typeof g=="number"&&g>=0&&(v=Math.min(v,g))}),v<1/0&&v>=0&&(p=e.substring(0,v+1))}if(this.state.top&&(c=this.tokenizer.paragraph(p))){let v=n.at(-1);r&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c),r=p.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(e){let v="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(v)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var r,a,l;let h=e,c=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(c=this.tokenizer.rules.inline.reflinkSearch.exec(h))!=null;)b.includes(c[0].slice(c[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(c=this.tokenizer.rules.inline.anyPunctuation.exec(h))!=null;)h=h.slice(0,c.index)+"++"+h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(c=this.tokenizer.rules.inline.blockSkip.exec(h))!=null;)h=h.slice(0,c.index)+"["+"a".repeat(c[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let p=!1,v="";for(;e;){p||(v=""),p=!1;let b;if((a=(r=this.options.extensions)==null?void 0:r.inline)!=null&&a.some(m=>(b=m.call({lexer:this},e,n))?(e=e.substring(b.raw.length),n.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let m=n.at(-1);b.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(b=this.tokenizer.emStrong(e,h,v)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.del(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),n.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),n.push(b);continue}let g=e;if((l=this.options.extensions)!=null&&l.startInline){let m=1/0,x=e.slice(1),w;this.options.extensions.startInline.forEach(S=>{w=S.call({lexer:this},x),typeof w=="number"&&w>=0&&(m=Math.min(m,w))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(b=this.tokenizer.inlineText(g)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(v=b.raw.slice(-1)),p=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(m)}}return n}},Tc=class{constructor(t){St(this,"options"),St(this,"parser"),this.options=t||ns}space(t){return""}code({text:t,lang:e,escaped:n}){var r;let a=(r=(e||"").match(Dr.notSpaceStart))==null?void 0:r[0],l=t.replace(Dr.endingNewline,"")+`
|
|||
|
|
`;return a?'<pre><code class="language-'+Zi(a)+'">'+(n?l:Zi(l,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?l:Zi(l,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|||
|
|
${this.parser.parse(t)}</blockquote>
|
|||
|
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|||
|
|
`}hr(t){return`<hr>
|
|||
|
|
`}list(t){let e=t.ordered,n=t.start,r="";for(let h=0;h<t.items.length;h++){let c=t.items[h];r+=this.listitem(c)}let a=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+a+l+`>
|
|||
|
|
`+r+"</"+a+`>
|
|||
|
|
`}listitem(t){var e;let n="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?((e=t.tokens[0])==null?void 0:e.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Zi(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(t.tokens,!!t.loose),`<li>${n}</li>
|
|||
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|||
|
|
`}table(t){let e="",n="";for(let a=0;a<t.header.length;a++)n+=this.tablecell(t.header[a]);e+=this.tablerow({text:n});let r="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];n="";for(let h=0;h<l.length;h++)n+=this.tablecell(l[h]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+e+`</thead>
|
|||
|
|
`+r+`</table>
|
|||
|
|
`}tablerow({text:t}){return`<tr>
|
|||
|
|
${t}</tr>
|
|||
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|||
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Zi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),a=Zm(t);if(a===null)return r;t=a;let l='<a href="'+t+'"';return e&&(l+=' title="'+Zi(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let a=Zm(t);if(a===null)return Zi(n);t=a;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${Zi(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Zi(t.text)}},Wf=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ha=class wp{constructor(e){St(this,"options"),St(this,"renderer"),St(this,"textRenderer"),this.options=e||ns,this.options.renderer=this.options.renderer||new Tc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Wf}static parse(e,n){return new wp(n).parse(e)}static parseInline(e,n){return new wp(n).parseInline(e)}parse(e,n=!0){var r,a;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[c.type]){let v=c,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(v.type)){l+=b||"";continue}}let p=c;switch(p.type){case"space":{l+=this.renderer.space(p);continue}case"hr":{l+=this.renderer.hr(p);continue}case"heading":{l+=this.renderer.heading(p);continue}case"code":{l+=this.renderer.code(p);continue}case"table":{l+=this.renderer.table(p);continue}case"blockquote":{l+=this.renderer.blockquote(p);continue}case"list":{l+=this.renderer.list(p);continue}case"html":{l+=this.renderer.html(p);continue}case"def":{l+=this.renderer.def(p);continue}case"paragraph":{l+=this.renderer.paragraph(p);continue}case"text":{let v=p,b=this.renderer.text(v);for(;h+1<e.length&&e[h+1].type==="text";)v=e[++h],b+=`
|
|||
|
|
`+this.renderer.text(v);n?l+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):l+=b;continue}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}parseInline(e,n=this.renderer){var r,a;let l="";for(let h=0;h<e.length;h++){let c=e[h];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[c.type]){let v=this.options.extensions.renderers[c.type].call({parser:this},c);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){l+=v||"";continue}}let p=c;switch(p.type){case"escape":{l+=n.text(p);break}case"html":{l+=n.html(p);break}case"link":{l+=n.link(p);break}case"image":{l+=n.image(p);break}case"strong":{l+=n.strong(p);break}case"em":{l+=n.em(p);break}case"codespan":{l+=n.codespan(p);break}case"br":{l+=n.br(p);break}case"del":{l+=n.del(p);break}case"text":{l+=n.text(p);break}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return"";throw new Error(v)}}}return l}},lh,Y0=(lh=class{constructor(t){St(this,"options"),St(this,"block"),this.options=t||ns}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Ia.lex:Ia.lexInline}provideParser(){return this.block?Ha.parse:Ha.parseInline}},St(lh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),lh),X9=class{constructor(...t){St(this,"defaults",zf()),St(this,"options",this.setOptions),St(this,"parse",this.parseMarkdown(!0)),St(this,"parseInline",this.parseMarkdown(!1)),St(this,"Parser",Ha),St(this,"Renderer",Tc),St(this,"TextRenderer",Wf),St(this,"Lexer",Ia),St(this,"Tokenizer",Ec),St(this,"Hooks",Y0),this.use(...t)}walkTokens(t,e){var n,r;let a=[];for(let l of t)switch(a=a.concat(e.call(this,l)),l.type){case"table":{let h=l;for(let c of h.header)a=a.concat(this.walkTokens(c.tokens,e));for(let c of h.rows)for(let p of c)a=a.concat(this.walkTokens(p.tokens,e));break}case"list":{let h=l;a=a.concat(this.walkTokens(h.items,e));break}default:{let h=l;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[h.type]?this.defaults.extensions.childTokens[h.type].forEach(c=>{let p=h[c].flat(1/0);a=a.concat(this.walkTokens(p,e))}):h.tokens&&(a=a.concat(this.walkTokens(h.tokens,e)))}}return a}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=e.renderers[a.name];l?e.renderers[a.name]=function(...h){let c=a.renderer.apply(this,h);return c===!1&&(c=l.apply(this,h)),c}:e.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[a.level];l?l.unshift(a.tokenizer):e[a.level]=[a.tokenizer],a.start&&(a.level==="block"?e.startBlock?e.startBlock.push(a.start):e.startBlock=[a.start]:a.level==="inline"&&(e.startInline?e.startInline.push(a.start):e.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(e.childTokens[a.name]=a.childTokens)}),r.extensions=e),n.renderer){let a=this.defaults.renderer||new Tc(this.defaults);for(let l in n.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let h=l,c=n.renderer[h],p=a[h];a[h]=(...v)=>{let b=c.apply(a,v);return b===!1&&(b=p.apply(a,v)),b||""}}r.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Ec(this.defaults);for(let l in n.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let h=l,c=n.tokenizer[h],p=a[h];a[h]=(...v)=>{let b=c.apply(a,v);return b===!1&&(b=p.apply(a,v)),b}}r.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new Y0;for(let l in n.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let h=l,c=n.hooks[h],p
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Zi(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Yo=new X9;function sn(t,e){return Yo.parse(t,e)}sn.options=sn.setOptions=function(t){return Yo.setOptions(t),sn.defaults=Yo.defaults,N6(sn.defaults),sn};sn.getDefaults=zf;sn.defaults=ns;sn.use=function(...t){return Yo.use(...t),sn.defaults=Yo.defaults,N6(sn.defaults),sn};sn.walkTokens=function(t,e){return Yo.walkTokens(t,e)};sn.parseInline=Yo.parseInline;sn.Parser=Ha;sn.parser=Ha.parse;sn.Renderer=Tc;sn.TextRenderer=Wf;sn.Lexer=Ia;sn.lexer=Ia.lex;sn.Tokenizer=Ec;sn.Hooks=Y0;sn.parse=sn;sn.options;sn.setOptions;sn.use;sn.walkTokens;sn.parseInline;Ha.parse;Ia.lex;var xp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j6(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $6={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|||
|
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|||
|
|
*
|
|||
|
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|||
|
|
* @author Lea Verou <https://lea.verou.me>
|
|||
|
|
* @namespace
|
|||
|
|
* @public
|
|||
|
|
*/var n=function(r){var a=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,h={},c={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function A(T){return T instanceof p?new p(T.type,A(T.content),T.alias):Array.isArray(T)?T.map(A):T.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(A){return Object.prototype.toString.call(A).slice(8,-1)},objId:function(A){return A.__id||Object.defineProperty(A,"__id",{value:++l}),A.__id},clone:function A(T,M){M=M||{};var y,N;switch(c.util.type(T)){case"Object":if(N=c.util.objId(T),M[N])return M[N];y={},M[N]=y;for(var z in T)T.hasOwnProperty(z)&&(y[z]=A(T[z],M));return y;case"Array":return N=c.util.objId(T),M[N]?M[N]:(y=[],M[N]=y,T.forEach(function(q,P){y[P]=A(q,M)}),y);default:return T}},getLanguage:function(A){for(;A;){var T=a.exec(A.className);if(T)return T[1].toLowerCase();A=A.parentElement}return"none"},setLanguage:function(A,T){A.className=A.className.replace(RegExp(a,"gi"),""),A.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT"&&1<2)return document.currentScript;try{throw new Error}catch(y){var A=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(A){var T=document.getElementsByTagName("script");for(var M in T)if(T[M].src==A)return T[M]}return null}},isActive:function(A,T,M){for(var y="no-"+T;A;){var N=A.classList;if(N.contains(T))return!0;if(N.contains(y))return!1;A=A.parentElement}return!!M}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(A,T){var M=c.util.clone(c.languages[A]);for(var y in T)M[y]=T[y];return M},insertBefore:function(A,T,M,y){y=y||c.languages;var N=y[A],z={};for(var q in N)if(N.hasOwnProperty(q)){if(q==T)for(var P in M)M.hasOwnProperty(P)&&(z[P]=M[P]);M.hasOwnProperty(q)||(z[q]=N[q])}var Y=y[A];return y[A]=z,c.languages.DFS(c.languages,function(te,ue){ue===Y&&te!=A&&(this[te]=z)}),z},DFS:function A(T,M,y,N){N=N||{};var z=c.util.objId;for(var q in T)if(T.hasOwnProperty(q)){M.call(T,q,T[q],y||q);var P=T[q],Y=c.util.type(P);Y==="Object"&&!N[z(P)]?(N[z(P)]=!0,A(P,M,null,N)):Y==="Array"&&!N[z(P)]&&(N[z(P)]=!0,A(P,M,q,N))}}},plugins:{},highlightAll:function(A,T){c.highlightAllUnder(document,A,T)},highlightAllUnder:function(A,T,M){var y={callback:M,container:A,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};c.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),c.hooks.run("before-all-elements-highlight",y);for(var N=0,z;z=y.elements[N++];)c.highlightElement(z,T===!0,y.callback)},highlightElement:function(A,T,M){var y=c.util.getLanguage(A),N=c.languages[y];c.util.setLanguage(A,y);var z=A.parentElement;z&&z.nodeName.toLowerCase()==="pre"&&c.util.setLanguage(z,y);var q=A.textContent,P={element:A,language:y,grammar:N,code:q};function Y(ue){P.highlightedCode=ue,c.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,c.hooks.run("after-highlight",P),c.hooks.run("complete",P),M&&M.call(P.element)}if(c.hooks.run("before-sanity-check",P),z=P.element.parentElement,z&&z.nodeName.toLowerCase()==="pre"&&!z.hasAttribute("tabindex")&&z.setAttribute("tabindex","0"),!P.code){c.hooks.run("complete",P),M&&M.call(P.element);return}if(c.hooks.run("before-highlight",P),!P.grammar){Y(c.util.encode(P.code));return}if(T&&r.Worker){var te=new Worker(c.filename);te.onmessage=function(ue){Y(ue.data)},te.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else Y(c.highlight(P.code,P.grammar,P.language))},highlight:function(A,T,M){var y={code:A,grammar:T,language:M};if(c.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=c.tokenize(y.code,y.grammar),c.hooks.run("after-tokenize",y),p.stringify(c.util.encode(y.tokens),y.language)},tokenize:function(A,T){var M=T.rest;if(M){for(var y in M)T[y]=M[y];delete T.rest}var N=new g;return m(N,N.head,A)
|
|||
|
|
`),S.hasAttribute("data-start")||S.setAttribute("data-start",String(q+1))}k.textContent=y,n.highlightElement(k)},function(y){S.setAttribute(c,b),k.textContent=y})}}),n.plugins.fileHighlight={highlight:function(w){for(var S=(w||document).querySelectorAll(g),k=0,C;C=S[k++];)n.highlightElement(C)}},n.fileHighlight=function(){n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})($6);var Z9=$6.exports;const Qm=j6(Z9);class ri{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new ri(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class wi{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new wi(n,ri.range(this,e))}}let tt=class U6{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,a,l,h=n&&n.loc;if(h&&h.start<=h.end){var c=h.lexer.input;a=h.start,l=h.end,a===c.length?r+=" at end of input: ":r+=" at position "+(a+1)+": ";var p=c.slice(a,l).replace(/[^]/g,"$&̲"),v;a>15?v="…"+c.slice(a-15,a):v=c.slice(0,a);var b;l+15<c.length?b=c.slice(l,l+15)+"…":b=c.slice(l),r+=v+p+b}var g=new Error(r);return g.name="ParseError",g.__proto__=U6.prototype,g.position=a,a!=null&&l!=null&&(g.length=l-a),g.rawMessage=e,g}};tt.prototype.__proto__=Error.prototype;var Y9=function(t,e){return t.indexOf(e)!==-1},J9=function(t,e){return t===void 0?e:t},Q9=/([A-Z])/g,ex=function(t){return t.replace(Q9,"-$1").toLowerCase()},tx={"&":"&",">":">","<":"<",'"':""","'":"'"},nx=/[&><"']/g;function rx(t){return String(t).replace(nx,e=>tx[e])}var V6=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},ix=function(t){var e=V6(t);return e.type==="mathord"||e.type==="textord"||e.type==="atom"},ax=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},ox=function(t){var e=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return e?e[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1])?null:e[1].toLowerCase():"_relative"},Tt={contains:Y9,deflt:J9,escape:rx,hyphenate:ex,getBaseElem:V6,isCharacterBox:ix,protocolFromUrl:ox},J0={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:
|
|||
|
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|||
|
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|||
|
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|||
|
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|||
|
|
c69,-144,104.5,-217.7,106.5,-221
|
|||
|
|
l`+t/2.075+" -"+t+`
|
|||
|
|
c5.3,-9.3,12,-14,20,-14
|
|||
|
|
H400000v`+(40+t)+`H845.2724
|
|||
|
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|||
|
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|||
|
|
M`+(834+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},gx=function(t,e){return"M263,"+(601+t+e)+`c0.7,0,18,39.7,52,119
|
|||
|
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|||
|
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|||
|
|
l`+t/2.084+" -"+t+`
|
|||
|
|
c4.7,-7.3,11,-11,19,-11
|
|||
|
|
H40000v`+(40+t)+`H1012.3
|
|||
|
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|||
|
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|||
|
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|||
|
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|||
|
|
M`+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},vx=function(t,e){return"M983 "+(10+t+e)+`
|
|||
|
|
l`+t/3.13+" -"+t+`
|
|||
|
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|||
|
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|||
|
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|||
|
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|||
|
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|||
|
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|||
|
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|||
|
|
M`+(1001+t)+" "+e+"h400000v"+(40+t)+"h-400000z"},bx=function(t,e){return"M424,"+(2398+t+e)+`
|
|||
|
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|||
|
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|||
|
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|||
|
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|||
|
|
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|||
|
|
v`+(40+t)+`H1014.6
|
|||
|
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|||
|
|
c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+e+`
|
|||
|
|
h400000v`+(40+t)+"h-400000z"},yx=function(t,e){return"M473,"+(2713+t+e)+`
|
|||
|
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|||
|
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|||
|
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|||
|
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|||
|
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|||
|
|
606zM`+(1001+t)+" "+e+"h400000v"+(40+t)+"H1017.7z"},wx=function(t){var e=t/2;return"M400000 "+t+" H0 L"+e+" 0 l65 45 L145 "+(t-80)+" H400000z"},xx=function(t,e,n){var r=n-54-e-t;return"M702 "+(t+e)+"H400000"+(40+t)+`
|
|||
|
|
H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|||
|
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|||
|
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|||
|
|
219 661 l218 661zM702 `+e+"H400000v"+(40+t)+"H742z"},kx=function(t,e,n){e=1e3*e;var r="";switch(t){case"sqrtMain":r=mx(e,cs);break;case"sqrtSize1":r=gx(e,cs);break;case"sqrtSize2":r=vx(e,cs);break;case"sqrtSize3":r=bx(e,cs);break;case"sqrtSize4":r=yx(e,cs);break;case"sqrtTall":r=xx(e,cs,n)}return r},Sx=function(t,e){switch(t){case"⎜":return"M291 0 H417 V"+e+" H291z M291 0 H417 V"+e+" H291z";case"∣":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z";case"∥":return"M145 0 H188 V"+e+" H145z M145 0 H188 V"+e+" H145z"+("M367 0 H410 V"+e+" H367z M367 0 H410 V"+e+" H367z");case"⎟":return"M457 0 H583 V"+e+" H457z M457 0 H583 V"+e+" H457z";case"⎢":return"M319 0 H403 V"+e+" H319z M319 0 H403 V"+e+" H319z";case"⎥":return"M263 0 H347 V"+e+" H263z M263 0 H347 V"+e+" H263z";case"⎪":return"M384 0 H504 V"+e+" H384z M384 0 H504 V"+e+" H384z";case"⏐":return"M312 0 H355 V"+e+" H312z M312 0 H355 V"+e+" H312z";case"‖":return"M257 0 H300 V"+e+" H257z M257 0 H300 V"+e+" H257z"+("M478 0 H521 V"+e+" H478z M478 0 H521 V"+e+" H478z");default:return""}},eg={doubleleftarrow:`M262 157
|
|||
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|||
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|||
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|||
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|||
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|||
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|||
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|||
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|||
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|||
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|||
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|||
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|||
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|||
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|||
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|||
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|||
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|||
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|||
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|||
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|||
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|||
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|||
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|||
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|||
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|||
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|||
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|||
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|||
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|||
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|||
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|||
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|||
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|||
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|||
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|||
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|||
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|||
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|||
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|||
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|||
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|||
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|||
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|||
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|||
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|||
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|||
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|||
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|||
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|||
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|||
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|||
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|||
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|||
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|||
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|||
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|||
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|||
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|||
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|||
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|||
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|||
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|||
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|||
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|||
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|||
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|||
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|||
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|||
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|||
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|||
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|||
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|||
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|||
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|||
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|||
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|||
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|||
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|||
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|||
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|||
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|||
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|||
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|||
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|||
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|||
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|||
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|||
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|||
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|||
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|||
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|||
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|||
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|||
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|||
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|||
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|||
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|||
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|||
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|||
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|||
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|||
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|||
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|||
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|||
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|||
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|||
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|||
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|||
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|||
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|||
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|||
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|||
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|||
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|||
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|||
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|||
|
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|||
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|||
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|||
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|||
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|||
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|||
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|||
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|||
|
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|||
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|||
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|||
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|||
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|||
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|||
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|||
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|||
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|||
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|||
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|||
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|||
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|||
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|||
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|||
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|||
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|||
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|||
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|||
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|||
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|||
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|||
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|||
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|||
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|||
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|||
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|||
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|||
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|||
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|||
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Ex=function(t,e){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+` v1759 h347 v-84
|
|||
|
|
H403z M403 1759 V0 H319 V1759 v`+e+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+` v1759 H0 v84 H347z
|
|||
|
|
M347 1759 V0 H263 V1759 v`+e+" v1759 h84z";case"vert":return"M145 15 v585 v"+e+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-e+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+e+" v585 h43z";case"doublevert":return"M145 15 v585 v"+e+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-e+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+e+` v585 h43z
|
|||
|
|
M367 15 v585 v`+e+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-e+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+e+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+e+` v1715 h263 v84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+e+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+e+` v1799 H0 v-84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+e+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+e+` v602 h84z
|
|||
|
|
M403 1759 V0 H319 V1759 v`+e+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+e+` v602 h84z
|
|||
|
|
M347 1759 V0 h-84 V1759 v`+e+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|||
|
|
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|||
|
|
-36,557 l0,`+(e+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|||
|
|
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|||
|
|
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|||
|
|
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|||
|
|
l0,-`+(e+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|||
|
|
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|||
|
|
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|||
|
|
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(e+9)+`
|
|||
|
|
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|||
|
|
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|||
|
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|||
|
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|||
|
|
l0,-`+(e+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|||
|
|
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class a0{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Tt.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var ia={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.755
|
|||
|
|
`+N+" children.");for(var Y=0;Y<N;Y++){var te=new yo(A[Y]),ue=new Va([te],{width:"400em",height:st(y),viewBox:"0 0 "+h+" "+M,preserveAspectRatio:q[Y]+" slice"}),Le=Ae.makeSvgSpan([z[Y]],[ue],e);if(N===1)return{span:Le,minWidth:T,height:y};Le.style.height=st(y),k.push(Le)}return{span:Ae.makeSpan(["stretchy"],k,e),minWidth:T,height:y}}}var{span:r,minWidth:a,height:l}=n();return r.height=l,r.style.height=st(l),a>0&&(r.style.minWidth=st(a)),r},ck=function(t,e,n,r,a){var l,h=t.height+t.depth+n+r;if(/fbox|color|angl/.test(e)){if(l=Ae.makeSpan(["stretchy",e],[],a),e==="fbox"){var c=a.color&&a.getColor();c&&(l.style.borderColor=c)}}else{var p=[];/^[bx]cancel$/.test(e)&&p.push(new Ep({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(e)&&p.push(new Ep({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var v=new Va(p,{width:"100%",height:st(h)});l=Ae.makeSvgSpan([],[v],a)}return l.height=h,l.style.height=st(h),l},Ga={encloseSpan:ck,mathMLnode:ak,svgSpan:lk};function Wt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function e1(t){var e=lu(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function lu(t){return t&&(t.type==="atom"||Ox.hasOwnProperty(t.type))?t:null}var t1=(t,e)=>{var n,r,a;t&&t.type==="supsub"?(r=Wt(t.base,"accent"),n=r.base,t.base=n,a=Dx(en(t,e)),t.base=r):(r=Wt(t,"accent"),n=r.base);var l=en(n,e.havingCrampedStyle()),h=r.isShifty&&Tt.isCharacterBox(n),c=0;if(h){var p=Tt.getBaseElem(n),v=en(p,e.havingCrampedStyle());c=ig(v).skew}var b=r.label==="\\c",g=b?l.height+l.depth:Math.min(l.height,e.fontMetrics().xHeight),m;if(r.isStretchy)m=Ga.svgSpan(r,e),m=Ae.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+st(2*c)+")",marginLeft:st(2*c)}:void 0}]},e);else{var x,w;r.label==="\\vec"?(x=Ae.staticSvg("vec",e),w=Ae.svgData.vec[1]):(x=Ae.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=ig(x),x.italic=0,w=x.width,b&&(g+=x.depth)),m=Ae.makeSpan(["accent-body"],[x]);var S=r.label==="\\textcircled";S&&(m.classes.push("accent-full"),g=l.height);var k=c;S||(k-=w/2),m.style.left=st(k),r.label==="\\textcircled"&&(m.style.top=".2em"),m=Ae.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-g},{type:"elem",elem:m}]},e)}var C=Ae.makeSpan(["mord","accent"],[m],e);return a?(a.children[0]=C,a.height=Math.max(C.height,a.height),a.classes[0]="mord",a):C},s2=(t,e)=>{var n=t.isStretchy?Ga.mathMLnode(t.label):new Ye.MathNode("mo",[Ei(t.label,t.mode)]),r=new Ye.MathNode("mover",[Tn(t.base,e),n]);return r.setAttribute("accent","true"),r},uk=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));ht({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=_c(e[0]),r=!uk.test(t.funcName),a=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:t1,mathmlBuilder:s2});ht({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:t1,mathmlBuilder:s2});ht({type:"accentUnder",names:["\\underleftarro
|
|||
|
|
]`,Pk="\\\\[a-zA-Z@]+",zk="\\\\[^\uD800-\uDFFF]",Bk="("+Pk+")"+O2+"*",Fk=`\\\\(
|
|||
|
|
|[ \r ]+
|
|||
|
|
?)[ \r ]*`,_p="[̀-ͯ]",qk=new RegExp(_p+"+$"),jk="("+O2+"+)|"+(Fk+"|")+"([!-\\[\\]-‧-豈-]"+(_p+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(_p+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Bk)+("|"+zk+")");class Lg{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(jk,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new wi("EOF",new ri(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new tt("Unexpected character: '"+e[n]+"'",new wi(e[n],new ri(this,n,n+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[a]===14){var l=e.indexOf(`
|
|||
|
|
`,this.tokenRegex.lastIndex);return l===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=l+1,this.lex()}return new wi(a,new ri(this,n,this.tokenRegex.lastIndex))}}class $k{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new tt("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var l=this.undefStack[this.undefStack.length-1];l&&!l.hasOwnProperty(e)&&(l[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var Uk=S2;G("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});G("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});G("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});G("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});G("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});G("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");G("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var _g={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};G("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new tt("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=_g[e.text],r==null||r>=n)throw new tt("Invalid base-"+n+" digit "+e.text);for(var a;(a=_g[t.future().text])!=null&&a<n;)r*=n,r+=a,t.popToken()}return"\\@char{"+r+"}"});var c1=(t,e,n,r)=>{var a=t.consumeArg().tokens;if(a.length!==1)throw new tt("\\newcommand's first argument must be a macro name");var l=a[0].text,h=t.isDefined(l);if(h&&!e)throw new tt("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!h&&!n)throw new tt("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var c=0;if(a=t.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var p="",v=t.expandNextToken();v.text!=="]"&&v.text!=="EOF";)p+=v.text,v=t.expandNextToken();if(!p.match(/^\s*[0-9]+\s*$/))throw new tt("Invalid number of arguments: "+p);c=parseInt(p),a=t.consumeArg().tokens}return h&&r||t.macros.set(l,{tokens:a,numArgs:c}),""};G("\\newcommand",t=>c1(t,!1,!0,!1));G("\\renewcommand",t=>c1(t,!0,!1,!1));G("\\providecommand",t=>c1(t,!0,!0,!0));G("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});G("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});G("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),ho[n],Nn.math[n],Nn.text[n]),""});G("\\bgroup","{");G("\\egroup","}");G("~","\\nobreakspace");G("\\lq","`");G("\\rq","'");G("\\aa","\\r a");G("\\AA","\\r A");G("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");G("\\copyright","\\TextOrMath{
|
|||
|
|
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:a}}Rg.hasOwnProperty(n[0])&&!Nn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=Rg[n[0]]+n.slice(1));var l=qk.exec(n);l&&(n=n.substring(0,l.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var h;if(Nn[this.mode][n]){this.settings.strict&&this.mode==="math"&&Tp.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=Nn[this.mode][n].group,p=ri.range(e),v;if(Rx.hasOwnProperty(c)){var b=c;v={type:"atom",mode:this.mode,family:b,loc:p,text:n}}else v={type:c,mode:this.mode,loc:p,text:n};h=v}else if(n.charCodeAt(0)>=128)this.settings.strict&&(W6(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),h={type:"textord",mode:"text",loc:ri.range(e),text:n};else return null;if(this.consume(),l)for(var g=0;g<l[0].length;g++){var m=l[0][g];if(!Sh[m])throw new tt("Unknown accent ' "+m+"'",e);var x=Sh[m][this.mode]||Sh[m].text;if(!x)throw new tt("Accent "+m+" unsupported in "+this.mode+" mode",e);h={type:"accent",mode:this.mode,loc:ri.range(e),label:x,isStretchy:!1,isShifty:!0,base:h}}return h}}hu.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var d1=function(t,e){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new hu(t,e);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!e.displayMode)throw new tt("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new wi("\\df@tag")])}]}return r},z2=function(t,e,n){e.textContent="";var r=h1(t,n).toNode();e.appendChild(r)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),z2=function(){throw new tt("KaTeX doesn't work in quirks mode.")});var Wk=function(t,e){var n=h1(t,e).toMarkup();return n},Gk=function(t,e){var n=new Gf(e);return d1(t,n)},B2=function(t,e,n){if(n.throwOnError||!(t instanceof tt))throw t;var r=Ae.makeSpan(["katex-error"],[new Si(e)]);return r.setAttribute("title",t.toString()),r.setAttribute("style","color:"+n.errorColor),r},h1=function(t,e){var n=new Gf(e);try{var r=d1(t,n);return nk(r,t,n)}catch(a){return B2(a,t,n)}},Kk=function(t,e){var n=new Gf(e);try{var r=d1(t,n);return rk(r,t,n)}catch(a){return B2(a,t,n)}},Xk="0.16.22",Zk={Span:o0,Anchor:Zf,SymbolNode:Si,SvgNode:Va,PathNode:yo,LineNode:Ep},Og={version:Xk,render:z2,renderToString:Wk,ParseError:tt,SETTINGS_SCHEMA:J0,__parse:Gk,__renderToDomTree:h1,__renderToHTMLTree:Kk,__setFontMetrics:Tx,__defineSymbol:R,__defineFunction:ht,__defineMacro:G,__domTree:Zk},F2={exports:{}};/*!
|
|||
|
|
* Vditor v3.11.2 - A markdown editor written in TypeScript.
|
|||
|
|
*
|
|||
|
|
* MIT License
|
|||
|
|
*
|
|||
|
|
* Copyright (c) 2018-present B3log 开源, b3log.org
|
|||
|
|
*
|
|||
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|||
|
|
* in the Software without restriction, including without limitation the rights
|
|||
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|||
|
|
* furnished to do so, subject to the following conditions:
|
|||
|
|
*
|
|||
|
|
* The above copyright notice and this permission notice shall be included in all
|
|||
|
|
* copies or substantial portions of the Software.
|
|||
|
|
*
|
|||
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
|
|
* SOFTWARE.
|
|||
|
|
*
|
|||
|
|
*/(function(t,e){(function(n,r){t.exports=r()})(xp,function(){return(()=>{var n={173:h=>{var c=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},p=-1,v=1,b=0;c.Diff=function(g,m){return[g,m]},c.prototype.diff_main=function(g,m,x,w){typeof w>"u"&&(this.Diff_Timeout<=0?w=Number.MAX_VALUE:w=new Date().getTime()+this.Diff_Timeout*1e3);var S=w;if(g==null||m==null)throw new Error("Null input. (diff_main)");if(g==m)return g?[new c.Diff(b,g)]:[];typeof x>"u"&&(x=!0);var k=x,C=this.diff_commonPrefix(g,m),A=g.substring(0,C);g=g.substring(C),m=m.substring(C),C=this.diff_commonSuffix(g,m);var T=g.substring(g.length-C);g=g.substring(0,g.length-C),m=m.substring(0,m.length-C);var M=this.diff_compute_(g,m,k,S);return A&&M.unshift(new c.Diff(b,A)),T&&M.push(new c.Diff(b,T)),this.diff_cleanupMerge(M),M},c.prototype.diff_compute_=function(g,m,x,w){var S;if(!g)return[new c.Diff(v,m)];if(!m)return[new c.Diff(p,g)];var k=g.length>m.length?g:m,C=g.length>m.length?m:g,A=k.indexOf(C);if(A!=-1)return S=[new c.Diff(v,k.substring(0,A)),new c.Diff(b,C),new c.Diff(v,k.substring(A+C.length))],g.length>m.length&&(S[0][0]=S[2][0]=p),S;if(C.length==1)return[new c.Diff(p,g),new c.Diff(v,m)];var T=this.diff_halfMatch_(g,m);if(T){var M=T[0],y=T[1],N=T[2],z=T[3],q=T[4],P=this.diff_main(M,N,x,w),Y=this.diff_main(y,z,x,w);return P.concat([new c.Diff(b,q)],Y)}return x&&g.length>100&&m.length>100?this.diff_lineMode_(g,m,w):this.diff_bisect_(g,m,w)},c.prototype.diff_lineMode_=function(g,m,x){var w=this.diff_linesToChars_(g,m);g=w.chars1,m=w.chars2;var S=w.lineArray,k=this.diff_main(g,m,!1,x);this.diff_charsToLines_(k,S),this.diff_cleanupSemantic(k),k.push(new c.Diff(b,""));for(var C=0,A=0,T=0,M="",y="";C<k.length;){switch(k[C][0]){case v:T++,y+=k[C][1];break;case p:A++,M+=k[C][1];break;case b:if(A>=1&&T>=1){k.splice(C-A-T,A+T),C=C-A-T;for(var N=this.diff_main(M,y,!1,x),z=N.length-1;z>=0;z--)k.splice(C,0,N[z]);C=C+N.length}T=0,A=0,M="",y="";break}C++}return k.pop(),k},c.prototype.diff_bisect_=function(g,m,x){for(var w=g.length,S=m.length,k=Math.ceil((w+S)/2),C=k,A=2*k,T=new Array(A),M=new Array(A),y=0;y<A;y++)T[y]=-1,M[y]=-1;T[C+1]=0,M[C+1]=0;for(var N=w-S,z=N%2!=0,q=0,P=0,Y=0,te=0,ue=0;ue<k&&!(new Date().getTime()>x);ue++){for(var Le=-ue+q;Le<=ue-P;Le+=2){var qe=C+Le,Xe;Le==-ue||Le!=ue&&T[qe-1]<T[qe+1]?Xe=T[qe+1]:Xe=T[qe-1]+1;for(var it=Xe-Le;Xe<w&&it<S&&g.charAt(Xe)==m.charAt(it);)Xe++,it++;if(T[qe]=Xe,Xe>w)P+=2;else if(it>S)q+=2;else if(z){var $e=C+N-Le;if($e>=0&&$e<A&&M[$e]!=-1){var De=w-M[$e];if(Xe>=De)return this.diff_bisectSplit_(g,m,Xe,it,x)}}}for(var nt=-ue+Y;nt<=ue-te;nt+=2){var $e=C+nt,De;nt==-ue||nt!=ue&&M[$e-1]<M[$e+1]?De=M[$e+1]:De=M[$e-1]+1;for(var ut=De-nt;De<w&&ut<S&&g.charAt(w-De-1)==m.charAt(S-ut-1);)De++,ut++;if(M[$e]=De,De>w)te+=2;else if(ut>S)Y+=2;else if(!z){var qe=C+N-nt;if(qe>=0&&qe<A&&T[qe]!=-1){var Xe=T[qe],it=C+Xe-qe;if(De=w-De,Xe>=De)return this.diff_bisectSplit_(g,m,Xe,it,x)}}}}return[new c.Diff(p,g),new c.Diff(v,m)]},c.prototype.diff_bisectSplit_=function(g,m,x,w,S){var k=g.substring(0,x),C=m.substring(0,w),A=g.substring(x),T=m.substring(w),M=this.diff_main(k,C,!1,S),y=this.diff_main(A,T,!1,S);return M.concat(y)},c.prototype.diff_linesToChars_=function(g,m){var x=[],w={};x[0]="";function S(T){for(var M="",y=0,N=-1,z=x.length;N<T.length-1;){N=T.indexOf(`
|
|||
|
|
`,y),N==-1&&(N=T.length-1);var q=T.substring(y,N+1);(w.hasOwnProperty?w.hasOwnProperty(q):w[q]!==void 0)?M+=String.fromCharCode(w[q]):(z==k&&(q=T.substring(y),N=T.length),M+=String.fromCharCode(z),w[q]=z,x[z++]=q),y=N+1}return M}var k=4e4,C=S(g);k=65535;var A=S(m);return{chars1:C,chars2:A,lineArray:x}},c.prototype.diff_charsToLines_=function(g,m){for(var x=0;x<g.length;x++){for(var w=g[x][1],S=[],k=0;k<w.length;k++)S[k]=m[w.charCodeAt(k)];g[x][1]=S.join("")}},c.prototype.diff_commonPrefix=function(g,m){if(!g||!m||g.charAt(0)!=m.charAt(0))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(k,S)==m.substring(k,S)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonSuffix=function(g,m){if(!g||!m||g.charAt(g.length-1)!=m.charAt(m.length-1))return 0;for(var x=0,w=Math.min(g.length,m.length),S=w,k=0;x<S;)g.substring(g.length-S,g.length-k)==m.substring(m.length-S,m.length-k)?(x=S,k=x):w=S,S=Math.floor((w-x)/2+x);return S},c.prototype.diff_commonOverlap_=function(g,m){var x=g.length,w=m.length;if(x==0||w==0)return 0;x>w?g=g.substring(x-w):x<w&&(m=m.substring(0,x));var S=Math.min(x,w);if(g==m)return S;for(var k=0,C=1;;){var A=g.substring(S-C),T=m.indexOf(A);if(T==-1)return k;C+=T,(T==0||g.substring(S-C)==m.substring(0,C))&&(k=C,C++)}},c.prototype.diff_halfMatch_=function(g,m){if(this.Diff_Timeout<=0)return null;var x=g.length>m.length?g:m,w=g.length>m.length?m:g;if(x.length<4||w.length*2<x.length)return null;var S=this;function k(P,Y,te){for(var ue=P.substring(te,te+Math.floor(P.length/4)),Le=-1,qe="",Xe,it,$e,De;(Le=Y.indexOf(ue,Le+1))!=-1;){var nt=S.diff_commonPrefix(P.substring(te),Y.substring(Le)),ut=S.diff_commonSuffix(P.substring(0,te),Y.substring(0,Le));qe.length<ut+nt&&(qe=Y.substring(Le-ut,Le)+Y.substring(Le,Le+nt),Xe=P.substring(0,te-ut),it=P.substring(te+nt),$e=Y.substring(0,Le-ut),De=Y.substring(Le+nt))}return qe.length*2>=P.length?[Xe,it,$e,De,qe]:null}var C=k(x,w,Math.ceil(x.length/4)),A=k(x,w,Math.ceil(x.length/2)),T;if(!C&&!A)return null;A?C?T=C[4].length>A[4].length?C:A:T=A:T=C;var M,y,N,z;g.length>m.length?(M=T[0],y=T[1],N=T[2],z=T[3]):(N=T[0],z=T[1],M=T[2],y=T[3]);var q=T[4];return[M,y,N,z,q]},c.prototype.diff_cleanupSemantic=function(g){for(var m=!1,x=[],w=0,S=null,k=0,C=0,A=0,T=0,M=0;k<g.length;)g[k][0]==b?(x[w++]=k,C=T,A=M,T=0,M=0,S=g[k][1]):(g[k][0]==v?T+=g[k][1].length:M+=g[k][1].length,S&&S.length<=Math.max(C,A)&&S.length<=Math.max(T,M)&&(g.splice(x[w-1],0,new c.Diff(p,S)),g[x[w-1]+1][0]=v,w--,w--,k=w>0?x[w-1]:-1,C=0,A=0,T=0,M=0,S=null,m=!0)),k++;for(m&&this.diff_cleanupMerge(g),this.diff_cleanupSemanticLossless(g),k=1;k<g.length;){if(g[k-1][0]==p&&g[k][0]==v){var y=g[k-1][1],N=g[k][1],z=this.diff_commonOverlap_(y,N),q=this.diff_commonOverlap_(N,y);z>=q?(z>=y.length/2||z>=N.length/2)&&(g.splice(k,0,new c.Diff(b,N.substring(0,z))),g[k-1][1]=y.substring(0,y.length-z),g[k+1][1]=N.substring(z),k++):(q>=y.length/2||q>=N.length/2)&&(g.splice(k,0,new c.Diff(b,y.substring(0,q))),g[k-1][0]=v,g[k-1][1]=N.substring(0,N.length-q),g[k+1][0]=p,g[k+1][1]=y.substring(q),k++),k++}k++}},c.prototype.diff_cleanupSemanticLossless=function(g){function m(q,P){if(!q||!P)return 6;var Y=q.charAt(q.length-1),te=P.charAt(0),ue=Y.match(c.nonAlphaNumericRegex_),Le=te.match(c.nonAlphaNumericRegex_),qe=ue&&Y.match(c.whitespaceRegex_),Xe=Le&&te.match(c.whitespaceRegex_),it=qe&&Y.match(c.linebreakRegex_),$e=Xe&&te.match(c.linebreakRegex_),De=it&&q.match(c.blanklineEndRegex_),nt=$e&&P.match(c.blanklineStartRegex_);return De||nt?5:it||$e?4:ue&&!qe&&Xe?3:qe||Xe?2:ue||Le?1:0}for(var x=1;x<g.length-1;){if(g[x-1][0]==b&&g[x+1][0]==b){var w=g[x-1][1],S=g[x][1],k=g[x+1][1],C=this.diff_commonSuffix(w,S);if(C){var A=S.substring(S.length-C);w=w.substring(0,w.length-C),S=A+S.substring(0,S.length-C),k=A+k}for(var T=w,M=S,y=k,N=m(w,S)+m(S,k);S.charAt(0)===k.charAt(0);){w+=S.charAt(0),S=S.substring(1)+k.charAt(0),k=k.substring(1);var z=m(w,S)+m(S,k);z>=N&&(N=z,T=w,M=S,y=k)}g[x-1][1]!=T&&(T?g[x-1][1]=T:(g.splice(x-1,1),x--),g[x][1]=M,y?g[x+1][1]=y:(g.splice(x+1,1),x--))}x++}},c.nonAlphaNumericRegex_=/[^a-zA-Z0-
|
|||
|
|
`),w=0,S=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;w<x.length;){var k=x[w].match(S);if(!k)throw new Error("Invalid patch string: "+x[w]);var C=new c.patch_obj;for(m.push(C),C.start1=parseInt(k[1],10),k[2]===""?(C.start1--,C.length1=1):k[2]=="0"?C.length1=0:(C.start1--,C.length1=parseInt(k[2],10)),C.start2=parseInt(k[3],10),k[4]===""?(C.start2--,C.length2=1):k[4]=="0"?C.length2=0:(C.start2--,C.length2=parseInt(k[4],10)),w++;w<x.length;){var A=x[w].charAt(0);try{var T=decodeURI(x[w].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+T)}if(A=="-")C.diffs.push(new c.Diff(p,T));else if(A=="+")C.diffs.push(new c.Diff(v,T));else if(A==" ")C.diffs.push(new c.Diff(b,T));else{if(A=="@")break;if(A!=="")throw new Error('Invalid patch mode "'+A+'" in: '+T)}w++}}return m},c.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},c.patch_obj.prototype.toString=function(){var g,m;this.length1===0?g=this.start1+",0":this.length1==1?g=this.start1+1:g=this.start1+1+","+this.length1,this.length2===0?m=this.start2+",0":this.length2==1?m=this.start2+1:m=this.start2+1+","+this.length2;for(var x=["@@ -"+g+" +"+m+` @@
|
|||
|
|
`],w,S=0;S<this.diffs.length;S++){switch(this.diffs[S][0]){case v:w="+";break;case p:w="-";break;case b:w=" ";break}x[S+1]=w+encodeURI(this.diffs[S][1])+`
|
|||
|
|
`}return x.join("").replace(/%20/g," ")},h.exports=c,h.exports.diff_match_patch=c,h.exports.DIFF_DELETE=p,h.exports.DIFF_INSERT=v,h.exports.DIFF_EQUAL=b},408:(h,c,p)=>{p.d(c,{default:()=>Mt});var v=p(135),b=p(840),g=p(775),m=p(428),x=p(325),w=p(483),S=p(999),k=function(se){se===void 0&&(se=document);var fe=function(J){var Q=document.createElement("img");Q.src=J.getAttribute("data-src"),Q.addEventListener("load",function(){!J.getAttribute("style")&&!J.getAttribute("class")&&!J.getAttribute("width")&&!J.getAttribute("height")&&Q.naturalHeight>Q.naturalWidth&&Q.naturalWidth/Q.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&Q.naturalHeight>window.innerHeight-40&&(J.style.height=window.innerHeight-40+"px"),J.src=Q.src}),J.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return se.querySelectorAll("img").forEach(function(J){J.getAttribute("data-src")&&fe(J)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),se.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(J){J.forEach(function(Q){(typeof Q.isIntersecting>"u"?Q.intersectionRatio!==0:Q.isIntersecting)&&Q.target.getAttribute("data-src")&&fe(Q.target)})}),se.querySelectorAll("img").forEach(function(J){window.vditorImageIntersectionObserver.observe(J)}))},C=p(472),A=p(280),T=p(637),M=p(825),y=p(11),N=p(194),z=p(436),q=p(229),P=p(145),Y=p(538),te=p(413),ue=p(106),Le=p(673),qe=function(se){document.querySelectorAll(".vditor-anchor").forEach(function(fe){se===1&&fe.classList.add("vditor-anchor--left"),fe.onclick=function(){var J=fe.getAttribute("href").substr(1),Q=document.getElementById("vditorAnchor-"+J).offsetTop;document.querySelector("html").scrollTop=Q}}),window.onhashchange=function(){var fe=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));fe&&(document.querySelector("html").scrollTop=fe.offsetTop)}},Xe=p(214),it=p(810),$e=function(se,fe){if(fe===void 0&&(fe="zh_CN"),!(typeof speechSynthesis>"u"||typeof SpeechSynthesisUtterance>"u")){var J=function(){var ge=speechSynthesis.getVoices(),ce,ve;return ge.forEach(function(Ee){Ee.lang===fe.replace("_","-")&&(ce=Ee),Ee.default&&(ve=Ee)}),ce||(ce=ve),ce},Q='<svg><use xlink:href="#vditor-icon-play"></use></svg>',Ie='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(Q='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',Ie='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var de=document.querySelector(".vditor-speech");de||(de=document.createElement("button"),de.className="vditor-speech",se.insertAdjacentElement("beforeend",de),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=J));var W=J(),Z=new SpeechSynthesisUtterance;Z.voice=W,Z.onend=Z.onerror=function(){de.style.display="none",speechSynthesis.cancel(),de.classList.remove("vditor-speech--current"),de.innerHTML=Q},se.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(ge){var ce=ge.target;if(ce.classList.contains("vditor-speech")||ce.parentElement.classList.contains("vditor-speech")){de.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),de.innerHTML=Ie):(speechSynthesis.pause(),de.innerHTML=Q)):(Z.text=de.getAttribute("data-text"),speechSynthesis.speak(Z),de.classList.add("vditor-speech--current"),de.innerHTML=Ie),(0,it.Hc)(window.vditorSpeechRange),se.focus();return}if(de.style.display="none",speechSynthesis.cancel(),de.classList.remove("vditor-speech--current"),de.innerHTML=Q,getSelection().rangeCount!==0){var ve=getSelection().getRangeAt(0),Ee=ve.toString().trim();if(Ee){window.vditorSpeechRange=ve.cloneRange();var ze=ve.getBoundingClientRect();de.innerHTML=Q,de.style.display="block",de.style.top=ze.top+ze.height+document.querySelector("html").scrollT
|
|||
|
|
`)&&(A=A.substr(0,A.length-1));var M='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(M='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var y=document.createElement("div");y.className="vditor-copy",y.innerHTML='<span aria-label="'.concat(((S=window.VditorI18n)===null||S===void 0?void 0:S.copy)||"复制",`"
|
|||
|
|
onmouseover="this.setAttribute('aria-label', '`).concat(((k=window.VditorI18n)===null||k===void 0?void 0:k.copy)||"复制",`')"
|
|||
|
|
class="vditor-tooltipped vditor-tooltipped__w"
|
|||
|
|
onclick="event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`).concat(((C=window.VditorI18n)===null||C===void 0?void 0:C.copied)||"已复制",`');this.previousElementSibling.blur()">`).concat(M,"</span>");var N=document.createElement("textarea");N.value=(0,v.X)(A),y.insertAdjacentElement("afterbegin",N),x&&x.renderMenu&&x.renderMenu(w,y),w.before(y),w.style.maxHeight=window.outerHeight-40+"px",w.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(b.g.ZWSP,"</span>"))})}},325:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.flowchartRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){S.forEach(function(k){if(k.getAttribute("data-processed")!=="true"){var C=flowchart.parse(g.flowchartRenderAdapter.getCode(k));k.innerHTML="",C.drawSVG(k),k.setAttribute("data-processed","true")}})})}},483:(h,c,p)=>{p.d(c,{v:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w){w===void 0&&(w=v.g.CDN);var S=g.graphvizRenderAdapter.getElements(x);S.length!==0&&(0,b.G)("".concat(w,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){S.forEach(function(k){var C=g.graphvizRenderAdapter.getCode(k);if(!(k.parentElement.classList.contains("vditor-wysiwyg__pre")||k.parentElement.classList.contains("vditor-ir__marker--pre"))&&!(k.getAttribute("data-processed")==="true"||C.trim()==="")){try{var A=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),T=window.URL||window.webkitURL,M=T.createObjectURL(A),y=new Worker(M);new Viz({worker:y}).renderSVGElement(C).then(function(N){k.innerHTML=N.outerHTML}).catch(function(N){k.innerHTML="graphviz render error: <br>".concat(N),k.className="vditor-reset--error"})}catch{}k.setAttribute("data-processed","true")}})})}},999:(h,c,p)=>{p.d(c,{s:()=>m});var v=p(145),b=p(413),g=p(290),m=function(x,w,S){w===void 0&&(w=document),S===void 0&&(S=v.g.CDN);var k=x.style;v.g.CODE_THEME.includes(k)||(k="github");var C=document.getElementById("vditorHljsStyle"),A="".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css");if(C&&C.getAttribute("href")!==A&&C.remove(),(0,g.c)("".concat(S,"/dist/js/highlight.js/styles/").concat(k,".min.css"),"vditorHljsStyle"),x.enable!==!1){var T=w.querySelectorAll("pre > code");T.length!==0&&(0,b.G)("".concat(S,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,b.G)("".concat(S,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){w.querySelectorAll("pre > code").forEach(function(M){if(!(M.parentElement.classList.contains("vditor-ir__marker--pre")||M.parentElement.classList.contains("vditor-wysiwyg__pre"))&&!(M.classList.contains("language-mermaid")||M.classList.contains("language-flowchart")||M.classList.contains("language-echarts")||M.classList.contains("language-mindmap")||M.classList.contains("language-plantuml")||M.classList.contains("language-smiles")||M.classList.contains("language-abc")||M.classList.contains("language-graphviz")||M.classList.contains("language-math"))){x.defaultLang!==""&&M.className.indexOf("language-")===-1&&M.classList.add("language-"+x.defaultLang);var y=M.className.replace("language-","");if(window.hljs.getLanguage(y)||(y="plaintext"),M.innerHTML=window.hljs.highlight(M.textContent,{language:y,ignoreIllegals:!0}).value,M.classList.add("hljs"),!!x.lineNumber){M.classList.add("vditor-linenumber");var N=M.querySelector(".vditor-linenumber__temp");N||(N=document.createElement("div"),N.className="vditor-linenumber__temp",M.insertAdjacentElement("beforeend",N));var z=getComputedStyle(M).whiteSpace,q=!1;(z==="pre-wrap"||z==="pre-line")&&(q=!0);var P="",Y=M.textContent.split(/\r\n|\r|\n/g);Y.pop(),Y.map(function(te){var ue="";q&&(N.textContent=te||`
|
|||
|
|
`,ue=' style="height:'.concat(N.getBoundingClientRect().height,'px"')),P+="<span".concat(ue,"></span>")}),N.style.display="none",P='<span class="vditor-linenumber__rows">'.concat(P,"</span>"),M.insertAdjacentHTML("beforeend",P)}}})})})}}},11:(h,c,p)=>{p.d(c,{K:()=>S});var v=p(145),b=p(413),g=p(840),m={},x=function(k,C){var A=k.transform(C),T=Object.keys(A.features).filter(function(q){return!m[q]});T.forEach(function(q){m[q]=!0});var M=k.getAssets(T),y=M.styles,N=M.scripts,z=window.markmap;return y&&z.loadCSS(y),N&&z.loadJS(N),A},w=function(k,C){var A=window.markmap,T=A.Transformer,M=A.Markmap,y=A.deriveOptions;A.globalCSS;var N=new T;k.innerHTML='<svg style="width:100%"></svg>';var z=k.firstChild,q=M.create(z,null),P=x(N,C),Y=P.root,te=P.frontmatter,ue=te==null?void 0:te.markmap,Le=y(ue);q.setData(Y,Le),q.fit()},S=function(k,C){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var A=g.markmapRenderAdapter.getElements(k);A.length!==0&&(0,b.G)("".concat(C,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){A.forEach(function(T){var M=g.markmapRenderAdapter.getCode(T);if(!(T.getAttribute("data-processed")==="true"||M.trim()==="")){var y=document.createElement("div");y.className="language-markmap",T.parentNode.appendChild(y),w(y,M),T.parentNode.childNodes[0].nodeName=="CODE"&&T.parentNode.removeChild(T.parentNode.childNodes[0])}})})}},472:(h,c,p)=>{p.d(c,{H:()=>w});var v=p(145),b=p(413),g=p(290),m=p(105),x=p(840),w=function(S,k){S===void 0&&(S=document);var C=x.mathRenderAdapter.getElements(S);if(C.length!==0){var A={cdn:v.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(k&&k.math&&(k.math=Object.assign({},A.math,k.math)),k=Object.assign({},A,k),k.math.engine==="KaTeX")(0,g.c)("".concat(k.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,b.G)("".concat(k.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,b.G)("".concat(k.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){C.forEach(function(y){if(!(y.parentElement.classList.contains("vditor-wysiwyg__pre")||y.parentElement.classList.contains("vditor-ir__marker--pre"))&&!y.getAttribute("data-math")){var N=(0,m.X)(x.mathRenderAdapter.getCode(y));y.setAttribute("data-math",N);try{y.innerHTML=katex.renderToString(N,{displayMode:y.tagName==="DIV",output:"html",macros:k.math.macros})}catch(z){y.innerHTML=z.message,y.className="language-math vditor-reset--error"}y.addEventListener("copy",function(z){z.stopPropagation(),z.preventDefault();var q=z.currentTarget.closest(".language-math");z.clipboardData.setData("text/html",q.innerHTML),z.clipboardData.setData("text/plain",q.getAttribute("data-math"))})}})})});else if(k.math.engine==="MathJax"){var T=function(y){if(y.length!==0){var N=0,z=y[y.length-1],q=function(){var P=y[N++];P===z?P():P(q)};q()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(k.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:k.math.macros}},Object.assign(window.MathJax,k.math.mathJaxOptions)),(0,b.J)("".concat(k.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var M=function(y,N){var z=(0,m.X)(y.textContent).trim(),q=window.MathJax.getMetricsFor(y);q.display=y.tagName==="DIV",window.MathJax.tex2svgPromise(z,q).then(function(P){y.innerHTML="",y.setAttribute("data-math",z),y.append(P),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var Y=P.querySelector('[data-mml-node="merror"]');Y&&Y.textContent.trim()!==""&&(y.innerHTML=Y.textContent.trim(),y.className="vditor-reset--error"),N&&N()})};window.MathJax.startup.promise.then(function(){for(var y=[],N=function(q){var P=C[q];!P.parentElement.classList.contains("vditor-wysiwyg__pre")&&!P.parentElement.classList.contains("vditor-ir__marker--pre")&&!P.getAttribute("data-math")&&(0,m.X)(P.textContent).trim()&&y.push(function(Y){q===C.length-1?M(P):M(P,Y)})},z=0;z<C.length;z++)N(z);T(y)})}}}},280:(h,c,p)=>{p.d(c,{Y:()=>x});var v=p(494),b=function(w,S){w.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(S,'"></
|
|||
|
|
src="//coub.com/embed/`.concat(T[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),w.remove();else if(M&&M[0])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.facebook.com/plugins/video.php?href=`.concat(encodeURIComponent(M[0]),'"></iframe>')),w.remove();else if(y&&y[2])w.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
|
|||
|
|
src="https://www.dailymotion.com/embed/video/`.concat(y[2],'"></iframe>')),w.remove();else if(S.indexOf("bilibili.com")>-1&&(S.indexOf("bvid=")>-1||N&&N[1])){var q={bvid:(0,v.on)("bvid",S)||N&&N[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(S.startsWith("http")?S:"https:"+S).search.split("&").forEach(function(te,ue){if(te){ue===0&&(te=te.substr(1));var Le=te.split("=");q[Le[0]]=Le[1]}});var P="https://player.bilibili.com/player.html?",Y=Object.keys(q);Y.forEach(function(te,ue){P+="".concat(te,"=").concat(q[te]),ue<Y.length-1&&(P+="&")}),w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(P,'"></iframe>')),w.remove()}else z&&z[1]&&(w.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(z[1],'"></iframe>')),w.remove())},x=function(w){w&&w.querySelectorAll("a").forEach(function(S){var k=S.getAttribute("href");k&&(k.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?b(S,k):k.match(/^.+.(mp3|wav|flac)$/)?g(S,k):m(S,k))})}},637:(h,c,p)=>{p.d(c,{i:()=>S});var v=p(145),b=p(413),g=p(840),m=p(494),x=function(k,C,A,T){function M(y){return y instanceof A?y:new A(function(N){N(y)})}return new(A||(A=Promise))(function(y,N){function z(Y){try{P(T.next(Y))}catch(te){N(te)}}function q(Y){try{P(T.throw(Y))}catch(te){N(te)}}function P(Y){Y.done?y(Y.value):M(Y.value).then(z,q)}P((T=T.apply(k,C||[])).next())})},w=function(k,C){var A={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},T,M,y,N;return N={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function z(P){return function(Y){return q([P,Y])}}function q(P){if(T)throw new TypeError("Generator is already executing.");for(;N&&(N=0,P[0]&&(A=0)),A;)try{if(T=1,M&&(y=P[0]&2?M.return:P[0]?M.throw||((y=M.return)&&y.call(M),0):M.next)&&!(y=y.call(M,P[1])).done)return y;switch(M=0,y&&(P=[P[0]&2,y.value]),P[0]){case 0:case 1:y=P;break;case 4:return A.label++,{value:P[1],done:!1};case 5:A.label++,M=P[1],P=[0];continue;case 7:P=A.ops.pop(),A.trys.pop();continue;default:if(y=A.trys,!(y=y.length>0&&y[y.length-1])&&(P[0]===6||P[0]===2)){A=0;continue}if(P[0]===3&&(!y||P[1]>y[0]&&P[1]<y[3])){A.label=P[1];break}if(P[0]===6&&A.label<y[1]){A.label=y[1],y=P;break}if(y&&A.label<y[2]){A.label=y[2],A.ops.push(P);break}y[2]&&A.ops.pop(),A.trys.pop();continue}P=C.call(k,A)}catch(Y){P=[6,Y],M=0}finally{T=y=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},S=function(k,C,A){k===void 0&&(k=document),C===void 0&&(C=v.g.CDN);var T=g.mermaidRenderAdapter.getElements(k);T.length!==0&&(0,b.G)("".concat(C,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var M={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};A==="dark"&&(M.theme="dark"),mermaid.initialize(M),T.forEach(function(y){return x(void 0,void 0,void 0,function(){var N,z,q,P,Y;return w(this,function(te){switch(te.label){case 0:if(N=g.mermaidRenderAdapter.getCode(y),y.getAttribute("data-processed")==="true"||N.trim()==="")return[2];z="mermaid"+(0,m.Wb)(),te.label=1;case 1:return te.trys.push([1,3,,4]),[4,mermaid.render(z,y.textContent)];case 2:return q=te.sent(),y.innerHTML=q.svg,[3,4];case 3:return P=te.sent(),Y=document.querySelector("#"+z),y.innerHTML="".concat(Y.outerHTML,`<br>
|
|||
|
|
<div style="text-align: left"><small>`).concat(P.message.replace(/\n/,"<br>"),"</small></div>"),Y.parentElement.remove(),[3,4];case 4:return y.setAttribute("data-processed","true"),[2]}})})})})}},194:(h,c,p)=>{p.d(c,{P:()=>m});var v=p(145),b=p(413),g=p(840),m=function(x,w,S){x===void 0&&(x=document),w===void 0&&(w=v.g.CDN);var k=g.mindmapRenderAdapter.getElements(x);k.length>0&&(0,b.G)("".concat(w,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){k.forEach(function(C){if(!(C.parentElement.classList.contains("vditor-wysiwyg__pre")||C.parentElement.classList.contains("vditor-ir__marker--pre"))){var A=g.mindmapRenderAdapter.getCode(C);if(A)try{if(C.getAttribute("data-processed")==="true")return;echarts.init(C,S==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(A))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(T,M){var y;return!((y=M==null?void 0:M.data)===null||y===void 0)&&y.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),C.setAttribute("data-processed","true")}catch(T){C.className="vditor-reset--error",C.innerHTML="mindmap render error: <br>".concat(T)}}})})}},436:(h,c,p)=>{p.d(c,{k:()=>g});var v=p(771),b=p(472),g=function(m,x,w){var S="",k=[];if(Array.from(m.children).forEach(function(M,y){if((0,v.W)(M)){if(w){var N=M.id.lastIndexOf("_");M.id=M.id.substring(0,N===-1?void 0:N)+"_"+y}k.push(M.id),S+=M.outerHTML.replace("<wbr>","")}}),S==="")return x.innerHTML="","";var C=document.createElement("div");if(w)w.lute.SetToC(!0),w.currentMode==="wysiwyg"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorDOM("<p>[ToC]</p>"+S):w.currentMode==="ir"&&!w.preview.element.contains(m)?C.innerHTML=w.lute.SpinVditorIRDOM("<p>[ToC]</p>"+S):C.innerHTML=w.lute.HTML2VditorDOM("<p>[ToC]</p>"+S),w.lute.SetToC(w.options.preview.markdown.toc);else{x.classList.add("vditor-outline");var A=Lute.New();A.SetToC(!0),C.innerHTML=A.HTML2VditorDOM("<p>[ToC]</p>"+S)}var T=C.firstElementChild.querySelectorAll("li > span[data-target-id]");return T.forEach(function(M,y){if(M.nextElementSibling&&M.nextElementSibling.tagName==="UL"){var N="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(N='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),M.innerHTML="".concat(N,"<span>").concat(M.innerHTML,"</span>")}else M.innerHTML="<svg></svg><span>".concat(M.innerHTML,"</span>");M.setAttribute("data-target-id",k[y])}),S=C.firstElementChild.innerHTML,T.length===0?(x.innerHTML="",S):(x.innerHTML=S,w&&(0,b.H)(x,{cdn:w.options.cdn,math:w.options.preview.math}),x.firstElementChild.addEventListener("click",function(M){for(var y=M.target;y&&!y.isEqualNode(x);){if(y.classList.contains("vditor-outline__action")){y.classList.contains("vditor-outline__action--close")?(y.classList.remove("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:block")):(y.classList.add("vditor-outline__action--close"),y.parentElement.nextElementSibling.setAttribute("style","display:none")),M.preventDefault(),M.stopPropagation();break}else if(y.getAttribute("data-target-id")){M.preventDefault(),M.stopPropagation();var N=document.getElementById(y.getAttribute("data-target-id"));if(!N)return;if(w)if(w.options.height==="auto"){var z=N.offsetTop+w.element.offsetTop;w.options.toolbarConfig.pin||(z+=w.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,z)}else w.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,w.element.offsetTop),w.preview.element.contains(m)?m.parentElement.scrollTop=N.offsetTop:m.scrollTop=N.offsetTop;else window.scrollTo(window.scrollX,N.offsetTop);break}y=y.parentElement}}),S)}},229:(
|
|||
|
|
<div class="vditor-img__bar">
|
|||
|
|
<span class="vditor-img__btn" data-deg="0">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-redo"></use></svg>
|
|||
|
|
`).concat(window.VditorI18n.spin,`
|
|||
|
|
</span>
|
|||
|
|
<span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
X `).concat(window.VditorI18n.close,`
|
|||
|
|
</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
|
|||
|
|
<img style="width: `).concat(b.width,"px;height:").concat(b.height,"px;transform: translate3d(").concat(x.left,"px, ").concat(x.top-w,'px, 0)" src="').concat(b.getAttribute("src"),`">
|
|||
|
|
</div>
|
|||
|
|
</div>`)),document.body.style.overflow="hidden";var S=document.querySelector(".vditor-img img"),k="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-w-b.naturalHeight)/2,"px, 0)");setTimeout(function(){S.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(k)),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)});var C=document.querySelector(".vditor-img__btn");C.addEventListener("click",function(){var A=parseInt(C.getAttribute("data-deg"),10)+90;A/90%2===1&&b.naturalWidth>S.parentElement.clientHeight?S.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-b.naturalWidth)/2,"px, ").concat(b.naturalWidth/2-b.naturalHeight/2,"px, 0) rotateZ(").concat(A,"deg)"):S.style.transform="".concat(k," rotateZ(").concat(A,"deg)"),C.setAttribute("data-deg",A.toString()),setTimeout(function(){S.parentElement.scrollTo((S.parentElement.scrollWidth-S.parentElement.clientWidth)/2,(S.parentElement.scrollHeight-S.parentElement.clientHeight)/2)},400)})}},580:(h,c,p)=>{p.d(c,{Y:()=>g});var v=p(145),b=p(290),g=function(m,x){x===void 0&&(x=v.g.CDN),v.g.CODE_THEME.includes(m)||(m="github");var w=document.getElementById("vditorHljsStyle"),S="".concat(x,"/dist/js/highlight.js/styles/").concat(m,".min.css");w?w.getAttribute("href")!==S&&(w.remove(),(0,b.c)(S,"vditorHljsStyle")):(0,b.c)(S,"vditorHljsStyle")}},538:(h,c,p)=>{p.d(c,{Z:()=>b});var v=p(290),b=function(g,m){if(!(!g||!m)){var x=document.getElementById("vditorContentTheme"),w="".concat(m,"/").concat(g,".css");x?x.getAttribute("href")!==w&&(x.remove(),(0,v.c)(w,"vditorContentTheme")):(0,v.c)(w,"vditorContentTheme")}}},413:(h,c,p)=>{p.d(c,{J:()=>v,G:()=>b});var v=function(g,m){if(document.getElementById(m))return!1;var x=new XMLHttpRequest;x.open("GET",g,!1),x.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),x.send("");var w=document.createElement("script");w.type="text/javascript",w.text=x.responseText,w.id=m,document.head.appendChild(w)},b=function(g,m){return new Promise(function(x,w){if(document.getElementById(m))return x(!0),!1;var S=document.createElement("script");S.src=g,S.async=!0,document.head.appendChild(S),S.onerror=function(k){w(k)},S.onload=function(){if(document.getElementById(m))return S.remove(),x(!0),!1;S.id=m,x(!0)}})}},290:(h,c,p)=>{p.d(c,{c:()=>v});var v=function(b,g){if(!document.getElementById(g)){var m=document.createElement("link");m.id=g,m.rel="stylesheet",m.type="text/css",m.href=b,document.getElementsByTagName("head")[0].appendChild(m)}}},105:(h,c,p)=>{p.d(c,{X:()=>v});var v=function(b){return b.replace(/\u00a0/g," ")}},410:(h,c,p)=>{p.d(c,{G6:()=>v,vU:()=>b,pK:()=>g,Le:()=>m,yl:()=>x,ns:()=>w,i7:()=>S});var v=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},b=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},g=function(){try{return typeof localStorage<"u"}catch{return!1}},m=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},x=function(k){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!(k.metaKey&&!k.ctrlKey):!!(!k.metaKey&&k.ctrlKey)},w=function(k){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?k.indexOf("⇧")>-1&&b()&&(k=k.replace(";",":").replace("=","+").replace("-","_")):(k.startsWith("⌘")?k=k.replace("⌘","⌘+"):k.startsWith("⌥")&&k.substr(1,1)!=="⌘"?k=k.replace("⌥","⌥+"):k=k.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+"),k=k.replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt"),k.indexOf("Shift")>-1&&(k=k.replace(";",":").replace("=","+").replace("-","_"))),k},S=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:(h,c,p)=>{p.d(c,{Wb:()=>v,on:()=>b,Qf:()=>g});var v=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g
|
|||
|
|
`).replace(/\n\n$/,`
|
|||
|
|
`)):i.currentMode==="wysiwyg"?i.lute.VditorDOM2Md(i.wysiwyg.element.innerHTML):i.currentMode==="ir"?i.lute.VditorIRDOM2Md(i.ir.element.innerHTML):""},b=a(413),g=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return i.prototype.renderEchart=function(o){var s=this;o.devtools.element.style.display==="block"&&(0,b.G)("".concat(o.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.ASTChart||(s.ASTChart=echarts.init(o.devtools.element.lastElementChild));try{s.element.lastElementChild.style.display="block",s.element.firstElementChild.innerHTML="",s.ASTChart.setOption({series:[{data:JSON.parse(o.lute.RenderEChartsJSON(v(o))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),s.ASTChart.resize()}catch(u){s.element.lastElementChild.style.display="none",s.element.firstElementChild.innerHTML=u}})},i}(),m=a(410),x=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains("vditor-menu--current")&&u.classList.remove("vditor-menu--current")}})},w=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains("vditor-menu--current")&&u.classList.add("vditor-menu--current")}})},S=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.remove(c.g.CLASS_MENU_DISABLED)}})},k=function(i,o){o.forEach(function(s){if(i[s]){var u=i[s].children[0];u&&!u.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.classList.add(c.g.CLASS_MENU_DISABLED)}})},C=function(i,o){o.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="none")})},A=function(i,o){o.forEach(function(s){i[s]&&i[s]&&(i[s].style.display="block")})},T=function(i,o,s){o.includes("subToolbar")&&(i.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(u){s&&u.isEqualNode(s)||(u.style.display="none")}),i.toolbar.elements.emoji&&(i.toolbar.elements.emoji.lastElementChild.style.display="none")),o.includes("hint")&&(i.hint.element.style.display="none"),i.wysiwyg.popover&&o.includes("popover")&&(i.wysiwyg.popover.style.display="none")},M=function(i,o,s,u){s.addEventListener((0,m.Le)(),function(d){d.preventDefault(),d.stopPropagation(),!s.classList.contains(c.g.CLASS_MENU_DISABLED)&&(i.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(f){f.classList.remove("vditor-hint--current")}),o.style.display==="block"?o.style.display="none":(T(i,["subToolbar","hint","popover"],s.parentElement.parentElement),s.classList.contains("vditor-tooltipped")||s.classList.add("vditor-hint--current"),o.style.display="block",i.toolbar.element.getBoundingClientRect().right-s.getBoundingClientRect().right<250?o.classList.add("vditor-panel--left"):o.classList.remove("vditor-panel--left")))})},y=a(106),N=a(771),z=function(i,o,s,u){},q=a(135),P=a(775),Y=a(428),te=a(325),ue=a(483),Le=a(999),qe=a(472),Xe=a(637),it=a(11),$e=a(194),De=a(229),nt=a(825),ut=function(i,o,s){s===void 0&&(s="sv");var u=document.createElement("div");u.innerHTML=i;var d=!1;u.childElementCount===1&&u.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(d=!0);var f=u.querySelectorAll("pre");if(u.childElementCount===1&&f.length===1&&f[0].className!=="vditor-wysiwyg"&&f[0].className!=="vditor-sv"&&(d=!0),i.indexOf(`
|
|||
|
|
<p class="p1">`)===0&&(d=!0),u.childElementCount===1&&u.firstElementChild.tagName==="TABLE"&&u.querySelector(".line-number")&&u.querySelector(".line-content")&&(d=!0),d){var E=o||i;return/\n/.test(E)||f.length===1?s==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(E.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+E.replace(/&/g,"&").replace(/</g,"<")+"\n```":s==="wysiwyg"?"<code>".concat(E.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(E,"`")}return!1},je=function(i,o){if(i){if(i.parentElement.getAttribute("data-type")==="html-block"){i.setAttribute("data-render","1");return}var s=i.firstElementChild.className.replace("language-","");if(s==="abc")(0,q.Q)(i,o.options.cdn);else if(s==="mermaid")(0,Xe.i)(i,o.options.cdn,o.options.theme);else if(s==="smiles")(0,nt.J)(i,o.options.cdn,o.options.theme);else if(s==="markmap")(0,it.K)(i,o.options.cdn);else if(s==="flowchart")(0,te.P)(i,o.options.cdn);else if(s==="echarts")(0,P.p)(i,o.options.cdn,o.options.theme);else if(s==="mindmap")(0,$e.P)(i,o.options.cdn,o.options.theme);else if(s==="plantuml")(0,De.B)(i,o.options.cdn);else if(s==="graphviz")(0,ue.v)(i,o.options.cdn);else if(s==="math")(0,qe.H)(i,{cdn:o.options.cdn,math:o.options.preview.math});else{var u=o.options.customRenders.find(function(d){if(d.language===s)return d.render(i,o),!0});u||((0,Le.s)(Object.assign({},o.options.preview.hljs),i,o.options.cdn),(0,Y.O)(i,o.options.preview.hljs))}i.setAttribute("data-render","1")}},j=a(810),yt=function(i){if(i.currentMode!=="sv"){var o=i[i.currentMode].element,s=i.outline.render(i);s===""&&(s="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(u){u.innerHTML=s,(0,qe.H)(u,{cdn:i.options.cdn,math:i.options.preview.math})})}},It=function(i,o){var s=(0,y.lG)(i.target,"SPAN");if(s&&(0,y.fb)(s,"vditor-toc")){var u=o[o.currentMode].element.querySelector("#"+s.getAttribute("data-target-id"));if(u)if(o.options.height==="auto"){var d=u.offsetTop+o.element.offsetTop;o.options.toolbarConfig.pin||(d+=o.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,d)}else o.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,o.element.offsetTop),o[o.currentMode].element.scrollTop=u.offsetTop;return}},bt=function(i,o,s,u){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-toc")){if(s.key==="Backspace"&&(0,j.im)(i,o[o.currentMode].element,u).start===0)return i.previousElementSibling.remove(),ct(o),!0;if(Yr(o,s,u,i,i.previousElementSibling))return!0}if(i.nextElementSibling&&i.nextElementSibling.classList.contains("vditor-toc")){if(s.key==="Delete"&&(0,j.im)(i,o[o.currentMode].element,u).start>=i.textContent.trimRight().length)return i.nextElementSibling.remove(),ct(o),!0;if(Di(o,s,u,i,i.nextElementSibling))return!0}if(s.key==="Backspace"||s.key==="Delete"){var d=(0,y.fb)(u.startContainer,"vditor-toc");if(d)return d.remove(),ct(o),!0}},Mt=function(i,o,s,u){s===void 0&&(s=!1);var d=(0,y.F9)(o.startContainer);if(d&&!s&&d.getAttribute("data-type")!=="code-block"){if(_o(d.innerHTML)&&d.previousElementSibling||No(d.innerHTML))return;for(var f=(0,j.im)(d,i.ir.element,o).start,E=!0,L=f-1;L>d.textContent.substr(0,f).lastIndexOf(`
|
|||
|
|
`);L--)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==" "){E=!1;break}f===0&&(E=!1);for(var D=!0,L=f-1;L<d.textContent.length;L++)if(d.textContent.charAt(L)!==" "&&d.textContent.charAt(L)!==`
|
|||
|
|
`){D=!1;break}if(E){typeof i.options.input=="function"&&i.options.input(v(i));return}if(D&&/^#{1,6} $/.test(d.textContent)&&(D=!1),D){var _=(0,y.fb)(o.startContainer,"vditor-ir__marker");if(!_){var F=o.startContainer.previousSibling;F&&F.nodeType!==3&&F.classList.contains("vditor-ir__node--expand")&&F.classList.remove("vditor-ir__node--expand"),typeof i.options.input=="function"&&i.options.input(v(i));return}}}if(i.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(ot){ot.classList.remove("vditor-ir__node--expand")}),d||(d=i.ir.element),!d.querySelector("wbr")){var X=(0,y.fb)(o.startContainer,"vditor-ir__preview");X?X.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):o.insertNode(document.createElement("wbr"))}d.querySelectorAll("[style]").forEach(function(ot){ot.removeAttribute("style")}),d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.ir.element);var be=d.isEqualNode(i.ir.element),xe=(0,y.a1)(d,"data-type","footnotes-block"),pe="";if(be)pe=d.innerHTML;else{var Se=(0,N.S)(o.startContainer,"BLOCKQUOTE"),ke=(0,y.O9)(o.startContainer);if(ke&&(d=ke),Se&&(!ke||ke&&!Se.contains(ke))&&(d=Se),xe&&(d=xe),pe=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var me=d.previousElementSibling,Pe=d.nextElementSibling;me&&(me.tagName==="UL"||me.tagName==="OL")&&(pe=me.outerHTML+pe,me.remove()),Pe&&(Pe.tagName==="UL"||Pe.tagName==="OL")&&(pe=pe+Pe.outerHTML,Pe.remove()),pe=pe.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else d.previousElementSibling&&d.previousElementSibling.textContent.replace(c.g.ZWSP,"")!==""&&u&&u.inputType==="insertParagraph"&&(pe=d.previousElementSibling.outerHTML+pe,d.previousElementSibling.remove());d.innerText.startsWith("```")||(i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(ot){ot&&!d.isEqualNode(ot)&&(pe+=ot.outerHTML,ot.remove())}),i.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(ot){ot&&!d.isEqualNode(ot)&&(pe+=ot.outerHTML,ot.remove())}))}if(z("SpinVditorIRDOM",pe,"argument",i.options.debugger),pe=i.lute.SpinVditorIRDOM(pe),z("SpinVditorIRDOM",pe,"result",i.options.debugger),be)d.innerHTML=pe;else if(d.outerHTML=pe,xe){var Ce=(0,y.a1)(i.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(Ce){var Ve=Ce.textContent,Et=Ve.substring(1,Ve.indexOf("]:")),wt=i.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(Et,'"]'));wt&&wt.setAttribute("aria-label",Ve.substr(Et.length+3).trim().substr(0,24))}}var Ct,vn=i.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");vn.forEach(function(ot,Ut){Ut===0?Ct=ot:(Ct.insertAdjacentHTML("beforeend",ot.innerHTML),ot.remove())}),vn.length>0&&i.ir.element.insertAdjacentElement("beforeend",vn[0]);var Yt,bn=i.ir.element.querySelectorAll("[data-type='footnotes-block']");bn.forEach(function(ot,Ut){Ut===0?Yt=ot:(Yt.insertAdjacentHTML("beforeend",ot.innerHTML),ot.remove())}),bn.length>0&&i.ir.element.insertAdjacentElement("beforeend",bn[0]),(0,j.ib)(i.ir.element,o),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(ot){je(ot,i)}),yt(i),lr(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},se=function(i,o){if(i==="")return!1;if(i.indexOf("⇧")===-1&&i.indexOf("⌘")===-1&&i.indexOf("⌥")===-1)return!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey&&o.code===i;if(i==="⇧Tab")return!!(!(0,m.yl)(o)&&!o.altKey&&o.shiftKey&&o.code==="Tab");var s=i.split("");if(i.startsWith("⌥")){var u=s.length===3?s[2]:s[1];return!!((s.length===3?(0,m.yl)(o):!(0,m.yl)(o))&&o.altKey&&!o.shiftKey&&o.code===(/^[0-9]$/.test(u)?"Digit":"Key")+u)}i==="⌘Enter"&&(s=["⌘","Enter"]);var d=s.length>2&&s[0]==="⇧",f=d?s[2]:s[1];return d&&((0,m.vU)()||!/Mac/.test(navigator.platform))&&(f==="-"?f="_":f==="="&&(f="+")),!!((0,m.yl)(o)&&o.key.toLowerCase()===f.toLowerCase()&&!o.altKey&&(!d&&!o.shiftKey||d&&o.shiftKey))},fe=function(i){var o=i.startContainer;if(o.nodeType===3&&o.nodeValue.length!==i.startOffset)return!1;for(var s=o.nextSibling;s&&s.textContent==="";)s=s.nextSibling;if(s){if(s&&s.nodeType
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}if(E===0&&(L=!1),L){ne(i);return}if(o.inputType==="deleteContentBackward"){var _=(0,y.a1)(d,"data-type","code-block-open-marker")||(0,y.a1)(d,"data-type","code-block-close-marker");if(_){if(_.getAttribute("data-type")==="code-block-close-marker"){var F=B(d,"code-block-open-marker");if(F){F.textContent=_.textContent,ne(i);return}}if(_.getAttribute("data-type")==="code-block-open-marker"){var F=B(d,"code-block-close-marker",!1);if(F){F.textContent=_.textContent,ne(i);return}}}var X=(0,y.a1)(d,"data-type","math-block-open-marker");if(X){var be=X.nextElementSibling.nextElementSibling;be&&be.getAttribute("data-type")==="math-block-close-marker"&&(be.remove(),ne(i));return}f.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(me){me.textContent.length===1&&me.remove()}),f.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(me){me.textContent.length===1&&me.remove()});var xe=(0,y.a1)(d,"data-type","heading-marker");if(xe&&xe.textContent.indexOf("#")===-1){ne(i);return}}if((o.data===" "||o.inputType==="deleteContentBackward")&&((0,y.a1)(d,"data-type","padding")||(0,y.a1)(d,"data-type","li-marker")||(0,y.a1)(d,"data-type","task-marker")||(0,y.a1)(d,"data-type","blockquote-marker"))){ne(i);return}}if(f&&f.textContent.trimRight()==="$$"){ne(i);return}f||(f=i.sv.element),((s=f.firstElementChild)===null||s===void 0?void 0:s.getAttribute("data-type"))==="link-ref-defs-block"&&(f=i.sv.element),(0,y.a1)(d,"data-type","footnotes-link")&&(f=i.sv.element),f.textContent.indexOf(Lute.Caret)===-1&&u.insertNode(document.createTextNode(Lute.Caret)),f.querySelectorAll("[style]").forEach(function(me){me.removeAttribute("style")}),f.querySelectorAll("font").forEach(function(me){me.outerHTML=me.innerHTML});var pe=f.textContent,Se=f.isEqualNode(i.sv.element);if(Se)pe=f.textContent;else{f.previousElementSibling&&(pe=f.previousElementSibling.textContent+pe,f.previousElementSibling.remove()),f.previousElementSibling&&pe.indexOf(`---
|
|||
|
|
`)===0&&(pe=f.previousElementSibling.textContent+pe,f.previousElementSibling.remove());var ke="";i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(me,Pe){me&&!f.isEqualNode(me.parentElement)&&(ke+=me.parentElement.textContent+`
|
|||
|
|
`,me.parentElement.remove())}),i.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(me,Pe){me&&!f.isEqualNode(me.parentElement)&&(ke+=me.parentElement.textContent+`
|
|||
|
|
`,me.parentElement.remove())}),pe=ke+pe}pe=V(pe,i),Se?f.innerHTML=pe:f.outerHTML=pe,i.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(me){i.sv.element.insertAdjacentElement("beforeend",me.parentElement)}),W(i.sv.element,function(me){i.sv.element.insertAdjacentElement("beforeend",me)}),(0,j.ib)(i.sv.element,u),Bt(i),ne(i,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},ge=function(i,o){var s,u,d,f,E;if(i.sv.composingLock=o.isComposing,o.isComposing||(o.key.indexOf("Arrow")===-1&&o.key!=="Meta"&&o.key!=="Control"&&o.key!=="Alt"&&o.key!=="Shift"&&o.key!=="CapsLock"&&o.key!=="Escape"&&!/^F\d{1,2}$/.test(o.key)&&i.undo.recordFirstPosition(i,o),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,m.yl)(o)&&o.key!=="Escape"))return!1;var L=(0,j.zh)(i),D=L.startContainer;L.startContainer.nodeType!==3&&L.startContainer.tagName==="DIV"&&(D=L.startContainer.childNodes[L.startOffset-1]);var _=(0,y.a1)(D,"data-type","text"),F=(0,y.a1)(D,"data-type","blockquote-marker");if(!F&&L.startOffset===0&&_&&_.previousElementSibling&&_.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(F=_.previousElementSibling),F&&o.key==="Enter"&&!(0,m.yl)(o)&&!o.altKey&&F.nextElementSibling.textContent.trim()===""&&(0,j.im)(F,i.sv.element,L).start===F.textContent.length)return((s=F.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&F.previousElementSibling.setAttribute("data-action","enter-remove"),F.remove(),ne(i),o.preventDefault(),!0;var X=(0,y.a1)(D,"data-type","li-marker"),be=(0,y.a1)(D,"data-type","task-marker"),xe=X;if(xe||be&&be.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(xe=be),!xe&&L.startOffset===0&&_&&_.previousElementSibling&&(_.previousElementSibling.getAttribute("data-type")==="li-marker"||_.previousElementSibling.getAttribute("data-type")==="task-marker")&&(xe=_.previousElementSibling),xe){var pe=(0,j.im)(xe,i.sv.element,L).start,Se=xe.getAttribute("data-type")==="task-marker",ke=xe;if(Se&&(ke=xe.previousElementSibling.previousElementSibling.previousElementSibling),pe===xe.textContent.length){if(o.key==="Enter"&&!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey&&xe.nextElementSibling.textContent.trim()==="")return((u=ke.previousElementSibling)===null||u===void 0?void 0:u.getAttribute("data-type"))==="padding"?(ke.previousElementSibling.remove(),Z(i)):(Se&&(ke.remove(),xe.previousElementSibling.previousElementSibling.remove(),xe.previousElementSibling.remove()),xe.nextElementSibling.remove(),xe.remove(),ne(i)),o.preventDefault(),!0;if(o.key==="Tab")return o.shiftKey?ke.previousElementSibling.getAttribute("data-type")==="padding"&&ke.previousElementSibling.remove():ke.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(ke.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(ke.textContent)&&(ke.textContent=ke.textContent.replace(/^\d{1,}/,"1"),L.selectNodeContents(xe.firstChild),L.collapse(!1)),Z(i),o.preventDefault(),!0}}if(Do(i,L,o))return!0;var me=(0,y.a1)(D,"data-block","0"),Pe=(0,N.S)(D,"SPAN");if(o.key==="Enter"&&!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey&&me){var Ce=!1,Ve=me.textContent.match(/^\n+/);(0,j.im)(me,i.sv.element).start<=(Ve?Ve[0].length:0)&&(Ce=!0);var Et=`
|
|||
|
|
`;if(Pe){if(((d=Pe.previousElementSibling)===null||d===void 0?void 0:d.getAttribute("data-action"))==="enter-remove")return Pe.previousElementSibling.remove(),ne(i),o.preventDefault(),!0;Et+=ee(Pe)}return L.insertNode(document.createTextNode(Et)),L.collapse(!1),me&&me.textContent.trim()!==""&&!Ce?Z(i):ne(i),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,m.yl)(o)&&!o.altKey&&!o.shiftKey){if(Pe&&((f=Pe.previousElementSibling)===null||f===void 0?void 0:f.getAttribute("data-type"))==="newline"&&(0,j.im)(Pe,i.sv.element,L).start===1&&Pe.getAttribute("data-type").indexOf("code-block-")===-1)return L.setStart(Pe,0),L.extractContents(),Pe.textContent.trim()!==""?Z(i):ne(i),o.preventDefault(),!0;if(me&&(0,j.im)(me,i.sv.element,L).start===0&&me.previousElementSibling){L.extractContents();var wt=me.previousElementSibling.lastElementChild;return wt.getAttribute("data-type")==="newline"&&(wt.remove(),wt=me.previousElementSibling.lastElementChild),wt.getAttribute("data-type")!=="newline"&&(wt.insertAdjacentHTML("afterend",me.innerHTML),me.remove()),me.textContent.trim()!==""&&!(!((E=me.previousElementSibling)===null||E===void 0)&&E.querySelector('[data-type="code-block-open-marker"]'))?Z(i):(wt.getAttribute("data-type")!=="newline"&&(L.selectNodeContents(wt.lastChild),L.collapse(!1)),ne(i)),o.preventDefault(),!0}}return!1},ce=a(538),ve=function(i){i.options.theme==="dark"?i.element.classList.add("vditor--dark"):i.element.classList.remove("vditor--dark")},Ee=function(i){i.element.innerHTML="",i.element.classList.add("vditor"),i.options.rtl&&i.element.setAttribute("dir","rtl"),ve(i),(0,ce.Z)(i.options.preview.theme.current,i.options.preview.theme.path),typeof i.options.height=="number"?i.element.style.height=i.options.height+"px":i.element.style.height=i.options.height,typeof i.options.minHeight=="number"&&(i.element.style.minHeight=i.options.minHeight+"px"),typeof i.options.width=="number"?i.element.style.width=i.options.width+"px":i.element.style.width=i.options.width,i.element.appendChild(i.toolbar.element);var o=document.createElement("div");if(o.className="vditor-content",i.options.outline.position==="left"&&o.appendChild(i.outline.element),o.appendChild(i.wysiwyg.element.parentElement),o.appendChild(i.sv.element),o.appendChild(i.ir.element.parentElement),o.appendChild(i.preview.element),i.toolbar.elements.devtools&&o.appendChild(i.devtools.element),i.options.outline.position==="right"&&(i.outline.element.classList.add("vditor-outline--right"),o.appendChild(i.outline.element)),i.upload&&o.appendChild(i.upload.element),i.options.resize.enable&&o.appendChild(i.resize.element),o.appendChild(i.hint.element),o.appendChild(i.tip.element),i.element.appendChild(o),o.addEventListener("click",function(){T(i,["subToolbar"])}),i.toolbar.elements.export&&i.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),Ln(i,i.options.mode,at(i)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&typeof window.visualViewport<"u"){var s=!1,u=function(d){s||(s=!0,requestAnimationFrame(function(){s=!1;var f=i.toolbar.element;f.style.transform="none",f.getBoundingClientRect().top<0&&(f.style.transform="translate(0, ".concat(-f.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",u),window.visualViewport.addEventListener("resize",u)}},ze=function(i){var o=window.innerWidth<=c.g.MOBILE_WIDTH?10:35;if(i.wysiwyg.element.parentElement.style.display!=="none"){var s=(i.wysiwyg.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.wysiwyg.element.style.padding="10px ".concat(Math.max(o,s),"px")}if(i.ir.element.parentElement.style.display!=="none"){var s=(i.ir.element.parentElement.clientWidth-i.options.preview.maxWidth)/2;i.ir.element.style.padding="10px ".concat(Math.max(o,s),"px")}i.preview.element.style.display!=="block"?i.toolbar.element.style.paddingLeft=Math.max(5,parseInt(i[i.currentMode].element.style.paddingLeft||"0",10)+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0))+"
|
|||
|
|
`,s.insertNode(_),s.collapse(!0),(0,j.Hc)(s),He(i),Bt(i),o.preventDefault(),!0}var F=(0,N.W)(u);if(F){if(F.tagName==="H6"&&u.textContent.length===s.startOffset&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var X=document.createElement("p");return X.textContent=`
|
|||
|
|
`,X.setAttribute("data-block","0"),u.parentElement.insertAdjacentElement("afterend",X),s.setStart(X,0),(0,j.Hc)(s),He(i),Bt(i),o.preventDefault(),!0}if(se("⌘=",o)){var be=parseInt(F.tagName.substr(1),10)-1;return be>0&&(ln(i,"h".concat(be)),He(i)),o.preventDefault(),!0}if(se("⌘-",o)){var be=parseInt(F.tagName.substr(1),10)+1;return be<7&&(ln(i,"h".concat(be)),He(i)),o.preventDefault(),!0}o.key==="Backspace"&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&F.textContent.length===1&&Qn(i)}if(Gs(i,s,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,m.yl)(o)&&!o.shiftKey){var xe=(0,y.lG)(u,"A"),pe=(0,y.a1)(u,"data-type","link-ref"),Se=(0,y.a1)(u,"data-type","footnotes-ref");if(xe||pe||Se||F&&F.tagName.length===2){var ke=i.wysiwyg.popover.querySelector("input");ke.focus(),ke.select()}}if(zt(i,o))return!0;if(se("⇧⌘U",o)){var me=i.wysiwyg.popover.querySelector('[data-type="up"]');if(me)return me.click(),o.preventDefault(),!0}if(se("⇧⌘D",o)){var me=i.wysiwyg.popover.querySelector('[data-type="down"]');if(me)return me.click(),o.preventDefault(),!0}if(Do(i,s,o))return!0;if(!(0,m.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&u.parentElement.tagName!=="LI"&&u.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName)?s.insertNode(document.createTextNode(`
|
|||
|
|
`+c.g.ZWSP)):s.insertNode(document.createTextNode(`
|
|||
|
|
`)),s.collapse(!1),(0,j.Hc)(s),He(i),Bt(i),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(Ks(i,s,o,f))return!0;if(d){if(d.previousElementSibling&&d.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&d.previousElementSibling.getAttribute("data-block")==="0"&&d.tagName!=="UL"&&d.tagName!=="OL"){var Pe=(0,j.im)(d,i.wysiwyg.element,s).start;if(Pe===0&&s.startOffset===0||Pe===1&&d.innerText.startsWith(c.g.ZWSP))return Cn(d.previousElementSibling.lastElementChild,i,!1),d.innerHTML.trim().replace(c.g.ZWSP,"")===""&&(d.remove(),He(i)),o.preventDefault(),!0}var Ce=s.startOffset;if(s.toString()===""&&u.nodeType===3&&u.textContent.charAt(Ce-2)===`
|
|||
|
|
`&&u.textContent.charAt(Ce-1)!==c.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(u.parentElement.tagName))return u.textContent=u.textContent.substring(0,Ce-1)+c.g.ZWSP,s.setStart(u,Ce),s.collapse(!0),He(i),o.preventDefault(),!0;u.textContent===c.g.ZWSP&&s.startOffset===1&&!u.previousSibling&&kt(s)&&(u.textContent=""),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(Et){Et.firstElementChild.style.display="inline",Et.lastElementChild.style.display="none"}),d.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(Et){Et.firstElementChild.style.display="inline",Et.lastElementChild.style.display="none"})}}if((0,m.vU)()&&s.startOffset===1&&u.textContent.indexOf(c.g.ZWSP)>-1&&u.previousSibling&&u.previousSibling.nodeType!==3&&u.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return s.selectNodeContents(u.previousSibling),s.collapse(!1),o.preventDefault(),!0;if(Zs(o,d,s))return o.preventDefault(),!0;if(to(s,o.key),o.key==="ArrowDown"){var Ve=u.nextSibling;Ve&&Ve.nodeType!==3&&Ve.getAttribute("data-type")==="math-inline"&&s.setStartAfter(Ve)}return d&&bt(d,i,o,s)?(o.preventDefault(),!0):!1},zt=function(i,o){if(se("⇧⌘X",o)){var s=i.wysiwyg.popover.querySelector('[data-type="remove"]');return s&&s.click(),o.preventDefault(),!0}},Pn=function(i){clearTimeout(i.wysiwyg.hlToolbarTimeoutId),i.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(i.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,j.Gb)(i.wysiwyg.element)){x(i.toolbar.elements,c.g.EDIT_TOOLBARS),S(i.toolbar.elements,c.g.EDIT_TOOLBARS);var o=getSelection().getRangeAt(0),s=o.startContainer;o.startContainer.nodeType===3?s=o.startContainer.parentElement:s=s.childNodes[o.startOffset>=s.childNodes.length?s.childNodes.length-1:o.startOffset];var u=(0,y.a1)(s,"data-type","footnotes-block");if(u){i.wysiwyg.popover.innerHTML="",Jt(u,i),Qt(i,"footnotes-block"),nn(i,u);return}var d=(0,y.lG)(s,"LI");d?(d.classList.contains("vditor-task")?w(i.toolbar.elements,["check"]):d.parentElement.tagName==="OL"?w(i.toolbar.elements,["ordered-list"]):d.parentElement.tagName==="UL"&&w(i.toolbar.elements,["list"]),S(i.toolbar.elements,["outdent","indent"])):k(i.toolbar.elements,["outdent","indent"]),(0,y.lG)(s,"BLOCKQUOTE")&&w(i.toolbar.elements,["quote"]),((0,y.lG)(s,"B")||(0,y.lG)(s,"STRONG"))&&w(i.toolbar.elements,["bold"]),((0,y.lG)(s,"I")||(0,y.lG)(s,"EM"))&&w(i.toolbar.elements,["italic"]),((0,y.lG)(s,"STRIKE")||(0,y.lG)(s,"S"))&&w(i.toolbar.elements,["strike"]),i.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(Re){Re.classList.remove("vditor-comment--focus")});var f=(0,y.fb)(s,"vditor-comment");if(f){var E=f.getAttribute("data-cmtids").split(" ");if(E.length>1&&f.nextSibling.isSameNode(f.nextElementSibling)){var L=f.nextElementSibling.getAttribute("data-cmtids").split(" ");E.find(function(Re){if(L.includes(Re))return E=[Re],!0})}i.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(Re){Re.getAttribute("data-cmtids").indexOf(E[0])>-1&&Re.classList.add("vditor-comment--focus")})}var D=(0,y.lG)(s,"A");D&&w(i.toolbar.elements,["link"]);var _=(0,y.lG)(s,"TABLE"),F=(0,N.W)(s);(0,y.lG)(s,"CODE")?(0,y.lG)(s,"PRE")?(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),w(i.toolbar.elements,["code"])):(k(i.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),w(i.toolbar.elements,["inline-code"])):F?(k(i.toolbar.elements,["bold"]),w(i.toolbar.elements,["headings"])):_&&k(i.toolbar.elements,["table"]);var X=(0,y.fb)(s,"vditor-toc");if(X){i.wysiwyg.popover.innerHTML="",Jt(X,i),Qt(i,"vditor-toc"),nn(i,X);return}var be=(0,N.S)(s,"BLOCKQUOTE");if(be&&(i.wysiwyg.popover.innerHTML="",er(o,be,i),or(o,be,i),Jt(be,i),Qt(i,"blockquote"),nn(i,be)),d&&(i.wysiwyg.popover.innerHTML="",er(o,d,i),or(o,d,i),Jt(d,i),Qt(i,"li"),nn(i,d)),_){i.options.lang,i.
|
|||
|
|
</code></pre>`:(X.innerHTML="<pre><code>".concat(f.toString(),"<wbr></code></pre>"),f.deleteContents()),f.insertNode(X),_&&(_.outerHTML=i.lute.SpinVditorDOM(_.outerHTML)),(0,j.ib)(i.wysiwyg.element,f),i.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Et){je(Et,i)}),o.classList.add("vditor-menu--disabled")}else if(E==="link"){if(f.toString()===""){var be=document.createElement("a");be.innerText=c.g.ZWSP,f.insertNode(be),f.setStart(be.firstChild,1),f.collapse(!0),Ci(i,be,f);var xe=i.wysiwyg.popover.querySelector("input");xe.value="",xe.focus(),d=!1}else{var X=document.createElement("a");X.setAttribute("href",""),X.innerHTML=f.toString(),f.surroundContents(X),f.insertNode(X),(0,j.Hc)(f),Ci(i,X,f);var pe=i.wysiwyg.popover.querySelectorAll("input");pe[0].value=X.innerText,pe[1].focus()}u=!1,o.classList.add("vditor-menu--current")}else if(E==="table"){var Se='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(f.toString().trim()==="")_&&_.innerHTML.trim().replace(c.g.ZWSP,"")===""?_.outerHTML=Se:document.execCommand("insertHTML",!1,Se),f.selectNode(i.wysiwyg.element.querySelector("wbr").previousSibling),i.wysiwyg.element.querySelector("wbr").remove(),(0,j.Hc)(f);else{Se='<table data-block="0"><thead><tr>';var ke=f.toString().split(`
|
|||
|
|
`),me=ke[0].split(",").length>ke[0].split(" ").length?",":" ";ke.forEach(function(Ve,Et){Et===0?(Ve.split(me).forEach(function(wt,Ct){Ct===0?Se+="<th>".concat(wt,"<wbr></th>"):Se+="<th>".concat(wt,"</th>")}),Se+="</tr></thead>"):(Et===1?Se+="<tbody><tr>":Se+="<tr>",Ve.split(me).forEach(function(wt){Se+="<td>".concat(wt,"</td>")}),Se+="</tr>")}),Se+="</tbody></table>",document.execCommand("insertHTML",!1,Se),(0,j.ib)(i.wysiwyg.element,f)}u=!1,o.classList.add("vditor-menu--disabled")}else if(E==="line"){if(_){var Pe=`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`;_.innerHTML.trim()===""?_.outerHTML=Pe:_.insertAdjacentHTML("afterend",Pe),(0,j.ib)(i.wysiwyg.element,f)}}else if(u=!1,o.classList.add("vditor-menu--current"),E==="strike"&&(E="strikeThrough"),f.toString()===""&&(E==="bold"||E==="italic"||E==="strikeThrough")){var Ce="strong";E==="italic"?Ce="em":E==="strikeThrough"&&(Ce="s");var X=document.createElement(Ce);X.textContent=c.g.ZWSP,f.insertNode(X),X.previousSibling&&X.previousSibling.textContent===c.g.ZWSP&&(X.previousSibling.textContent=""),f.setStart(X.firstChild,1),f.collapse(!0),(0,j.Hc)(f)}else document.execCommand(E,!1,"")}u&&Pn(i),d&&He(i)}},xt=function(){function i(o,s){var u,d=this;this.element=document.createElement("div"),s.className&&(u=this.element.classList).add.apply(u,s.className.split(" "));var f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"";s.level===2&&(f=s.hotkey?" <".concat((0,m.ns)(s.hotkey),">"):"");var E=s.tip?s.tip+f:"".concat(window.VditorI18n[s.name]).concat(f),L=s.name==="upload"?"div":"button";if(s.level===2)this.element.innerHTML="<".concat(L,' data-type="').concat(s.name,'">').concat(E,"</").concat(L,">");else{this.element.classList.add("vditor-toolbar__item");var D=document.createElement(L);D.setAttribute("data-type",s.name),D.className="vditor-tooltipped vditor-tooltipped__".concat(s.tipPosition),D.setAttribute("aria-label",E),D.innerHTML=s.icon,this.element.appendChild(D)}s.prefix&&this.element.children[0].addEventListener((0,m.Le)(),function(_){_.preventDefault(),!d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)&&(o.currentMode==="wysiwyg"?Fr(o,d.element.children[0],_):o.currentMode==="ir"?Du(o,d.element.children[0],s.prefix||"",s.suffix||""):_e(o,d.element.children[0],s.prefix||"",s.suffix||""))})}return i}(),mr=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ln=function(i,o,s){var u;if(typeof s!="string"?(T(i,["subToolbar","hint"]),s.preventDefault(),u=v(i)):u=s,!(i.currentMode===o&&typeof s!="string")){if(i.devtools&&i.devtools.renderEchart(i),i.options.preview.mode==="both"&&o==="sv"?i.preview.element.style.display="block":i.preview.element.style.display="none",S(i.toolbar.elements,c.g.EDIT_TOOLBARS),x(i.toolbar.elements,c.g.EDIT_TOOLBARS),k(i.toolbar.elements,["outdent","indent"]),o==="ir")C(i.toolbar.elements,["both"]),A(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="none",i.ir.element.parentElement.style.display="block",i.lute.SetVditorIR(!0),i.lute.SetVditorWYSIWYG(!1),i.lute.SetVditorSV(!1),i.currentMode="ir",i.ir.element.innerHTML=i.lute.Md2VditorIRDOM(u),lr(i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),ze(i),i.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(f){je(f,i)}),i.ir.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,qe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})});else if(o==="wysiwyg")C(i.toolbar.elements,["both"]),A(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),i.sv.element.style.display="none",i.wysiwyg.element.parentElement.style.display="block",i.ir.element.parentElement.style.display="none",i.lute.SetVditorIR(!1),i.lute.SetVditorWYSIWYG(!0),i.lute.SetVditorSV(!1),i.currentMode="wysiwyg",ze(i),Li(i,u,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),i.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(f){(0,qe.H)(f,{cdn:i.options.cdn,math:i.options.preview.math})}),i.wysiwyg.popover.style.display="none";else if(o==="sv"){A(i.toolbar.elements,["both"]),C(i.toolbar.elements,["outdent","indent","outline","insert-before","insert-
|
|||
|
|
<button data-mode="ir">`).concat(window.VditorI18n.instantRendering," <").concat((0,m.ns)("⌥⌘8"),`></button>
|
|||
|
|
<button data-mode="sv">`).concat(window.VditorI18n.splitView," <").concat((0,m.ns)("⌥⌘9"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f,u),d}return o.prototype._bindEvent=function(s,u,d){var f=this.element.children[0];M(s,u,f,d.level),u.children.item(0).addEventListener((0,m.Le)(),function(E){Ln(s,"wysiwyg",E),E.preventDefault(),E.stopPropagation()}),u.children.item(1).addEventListener((0,m.Le)(),function(E){Ln(s,"ir",E),E.preventDefault(),E.stopPropagation()}),u.children.item(2).addEventListener((0,m.Le)(),function(E){Ln(s,"sv",E),E.preventDefault(),E.stopPropagation()})},o}(xt),tr=function(i,o){return(0,j.Gb)(i,o)?getSelection().toString():""},Kr=function(i,o){o.addEventListener("focus",function(){i.options.focus&&i.options.focus(v(i)),T(i,["subToolbar","hint"])})},Ui=function(i,o){o.addEventListener("dblclick",function(s){s.target.tagName==="IMG"&&(i.options.image.preview?i.options.image.preview(s.target):i.options.image.isPreview&&(0,de.E)(s.target,i.options.lang,i.options.theme))})},sr=function(i,o){o.addEventListener("blur",function(s){if(i.currentMode==="ir"){var u=i.ir.element.querySelector(".vditor-ir__node--expand");u&&u.classList.remove("vditor-ir__node--expand")}else i.currentMode==="wysiwyg"&&!i.wysiwyg.selectPopover.contains(s.relatedTarget)&&i.wysiwyg.hideComment();i[i.currentMode].range=(0,j.zh)(i),i.options.blur&&i.options.blur(v(i))})},Xr=function(i,o){o.addEventListener("dragstart",function(s){s.dataTransfer.setData(c.g.DROP_EDITOR,c.g.DROP_EDITOR)}),o.addEventListener("drop",function(s){s.dataTransfer.getData(c.g.DROP_EDITOR)?ct(i):(s.dataTransfer.types.includes("Files")||s.dataTransfer.types.includes("text/html"))&&ya(i,s,{pasteCode:function(u){document.execCommand("insertHTML",!1,u)}})})},di=function(i,o,s){o.addEventListener("copy",function(u){return s(u,i)})},hi=function(i,o,s){o.addEventListener("cut",function(u){s(u,i),i.options.comment.enable&&i.currentMode==="wysiwyg"&&i.wysiwyg.getComments(i),document.execCommand("delete")})},Bt=function(i){if(i.currentMode==="wysiwyg"&&i.options.comment.enable&&i.options.comment.adjustTop(i.wysiwyg.getComments(i,!0)),!!i.options.typewriterMode){var o=i[i.currentMode].element,s=(0,j.Ny)(o).top;i.options.height==="auto"&&!i.element.classList.contains("vditor--fullscreen")&&window.scrollTo(window.scrollX,s+i.element.offsetTop+i.toolbar.element.offsetHeight-window.innerHeight/2+10),(i.options.height!=="auto"||i.element.classList.contains("vditor--fullscreen"))&&(o.scrollTop=s+o.scrollTop-o.clientHeight/2+10)}},_i=function(i,o){o.addEventListener("keydown",function(s){if(!s.isComposing&&i.options.keydown&&i.options.keydown(s),!((i.options.hint.extend.length>1||i.toolbar.elements.emoji)&&i.hint.select(s,i))){if(i.options.comment.enable&&i.currentMode==="wysiwyg"&&(s.key==="Backspace"||se("⌘X",s))&&i.wysiwyg.getComments(i),i.currentMode==="sv"){if(ge(i,s))return}else if(i.currentMode==="wysiwyg"){if(xn(i,s))return}else if(i.currentMode==="ir"&&Ie(i,s))return;if(i.options.ctrlEnter&&se("⌘Enter",s)){i.options.ctrlEnter(v(i)),s.preventDefault();return}if(se("⌘Z",s)&&!i.toolbar.elements.undo){i.undo.undo(i),s.preventDefault();return}if(se("⌘Y",s)&&!i.toolbar.elements.redo){i.undo.redo(i),s.preventDefault();return}if(s.key==="Escape"){i.hint.element.style.display==="block"?i.hint.element.style.display="none":i.options.esc&&!s.isComposing&&i.options.esc(v(i)),s.preventDefault();return}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[1-6]$/.test(s.code)){if(i.currentMode==="wysiwyg"){var u=s.code.replace("Digit","H");(0,y.lG)(getSelection().getRangeAt(0).startContainer,u)?Qn(i):ln(i,u),He(i)}else i.currentMode==="sv"?Te(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" "):i.currentMode==="ir"&&Ri(i,"#".repeat(parseInt(s.code.replace("Digit",""),10))+" ");return s.preventDefault(),!0}if((0,m.yl)(s)&&s.altKey&&!s.shiftKey&&/^Digit[7-9]$/.test(s.code))return s.code==="Digit7"?Ln(i,"wysiwyg",s):s.code==="Digit8"?Ln(i,"ir",s):s.code==="Digit9"&&Ln(i,"sv",s),!0;i.options.toolbar.find(function(d){if(!d.hotkey||d.toolbar){if(d.toolbar){var f=d.toolba
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",u.isEqualNode(i.sv.element)?u.innerHTML=d:u.outerHTML=d,W(i.sv.element),(0,j.ib)(i.sv.element,s),Bt(i)},B=function(i,o,s){s===void 0&&(s=!0);var u=i;for(u.nodeType===3&&(u=u.parentElement);u;){if(u.getAttribute("data-type")===o)return u;s?u=u.previousElementSibling:u=u.nextElementSibling}return!1},V=function(i,o){z("SpinVditorSVDOM",i,"argument",o.options.debugger);var s=o.lute.SpinVditorSVDOM(i);return i="<div data-block='0'>"+s.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span><span data-type="newline"><br /><span style="display: none">
|
|||
|
|
</span></span></div><div data-block="0"><`)+"</div>",z("SpinVditorSVDOM",i,"result",o.options.debugger),i},ee=function(i){var o=i.getAttribute("data-type"),s=i.previousElementSibling,u=o&&o!=="text"&&o!=="table"&&o!=="heading-marker"&&o!=="newline"&&o!=="yaml-front-matter-open-marker"&&o!=="yaml-front-matter-close-marker"&&o!=="code-block-info"&&o!=="code-block-close-marker"&&o!=="code-block-open-marker"?i.textContent:"",d=!1;for(o==="newline"&&(d=!0);s&&!d;){var f=s.getAttribute("data-type");if(f==="li-marker"||f==="blockquote-marker"||f==="task-marker"||f==="padding"){var E=s.textContent;if(f==="li-marker"&&(o==="code-block-open-marker"||o==="code-block-info"))u=E.replace(/\S/g," ")+u;else if(o==="code-block-close-marker"&&s.nextElementSibling.isSameNode(i)){var L=B(i,"code-block-open-marker");L&&L.previousElementSibling&&(s=L.previousElementSibling,u=E+u)}else u=E+u}else f==="newline"&&(d=!0);s=s.previousElementSibling}return u},ne=function(i,o){o===void 0&&(o={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),o.enableHint&&i.hint.render(i),i.preview.render(i);var s=v(i);typeof i.options.input=="function"&&o.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),clearTimeout(i.sv.processTimeoutId),i.sv.processTimeoutId=window.setTimeout(function(){o.enableAddUndoStack&&!i.sv.composingLock&&i.undo.addToUndoStack(i)},i.options.undoDelay)},Te=function(i,o){var s=(0,j.zh)(i),u=(0,N.S)(s.startContainer,"SPAN");u&&u.textContent.trim()!==""&&(o=`
|
|||
|
|
`+o),s.collapse(!0),document.execCommand("insertHTML",!1,o)},_e=function(i,o,s,u){var d=(0,j.zh)(i),f=o.getAttribute("data-type");i.sv.element.childNodes.length===0&&(i.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
|
|||
|
|
</span></span>`,(0,j.ib)(i.sv.element,d));var E=(0,y.F9)(d.startContainer),L=(0,N.S)(d.startContainer,"SPAN");if(E){if(f==="link"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(u):D="".concat(s).concat(d.toString()).concat(u.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,D);return}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"||f==="line"){var D=void 0;d.toString()===""?D="".concat(s).concat(Lute.Caret).concat(f==="code"?"":u):D="".concat(s).concat(d.toString()).concat(Lute.Caret).concat(f==="code"?"":u),f==="table"||f==="code"&&L&&L.textContent!==""?D=`
|
|||
|
|
|
|||
|
|
`+D:f==="line"&&(D=`
|
|||
|
|
|
|||
|
|
`.concat(s,`
|
|||
|
|
`).concat(Lute.Caret)),document.execCommand("insertHTML",!1,D);return}else if((f==="check"||f==="list"||f==="ordered-list"||f==="quote")&&L){var _="* ";f==="check"?_="* [ ] ":f==="ordered-list"?_="1. ":f==="quote"&&(_="> ");var F=B(L,"newline");F?F.insertAdjacentText("afterend",_):E.insertAdjacentText("afterbegin",_),Z(i);return}(0,j.ib)(i.sv.element,d),ne(i)}},le=function(i){switch(i.currentMode){case"ir":return i.ir.element;case"wysiwyg":return i.wysiwyg.element;case"sv":return i.sv.element}},Ne=function(i,o){i.options.upload.setHeaders&&(i.options.upload.headers=i.options.upload.setHeaders()),i.options.upload.headers&&Object.keys(i.options.upload.headers).forEach(function(s){o.setRequestHeader(s,i.options.upload.headers[s])})},Qe=function(i,o,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(F){try{_(u.next(F))}catch(X){E(X)}}function D(F){try{_(u.throw(F))}catch(X){E(X)}}function _(F){F.done?f(F.value):d(F.value).then(L,D)}_((u=u.apply(i,o||[])).next())})},rt=function(i,o){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(F){return D([_,F])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=o.call(i,s)}catch(F){_=[6,F],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},Ot=function(){function i(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"}return i}(),Kt=function(i,o){i.tip.hide();var s=[],u="",d="";i.options.lang,i.options;for(var f=function(_,F){var X=o[F],be=!0;X.name||(u+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),be=!1),X.size>i.options.upload.max&&(u+="<li>".concat(X.name," ").concat(window.VditorI18n.over," ").concat(i.options.upload.max/1024/1024,"M</li>"),be=!1);var xe=X.name.lastIndexOf("."),pe=X.name.substr(xe),Se=i.options.upload.filename(X.name.substr(0,xe))+pe;if(i.options.upload.accept){var ke=i.options.upload.accept.split(",").some(function(me){var Pe=me.trim();if(Pe.indexOf(".")===0){if(pe.toLowerCase()===Pe.toLowerCase())return!0}else if(X.type.split("/")[0]===Pe.split("/")[0])return!0;return!1});ke||(u+="<li>".concat(X.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),be=!1)}be&&(s.push(X),d+="<li>".concat(Se," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))},E=o.length,L=0;L<E;L++)f(E,L);if(i.tip.show("<ul>".concat(u).concat(d,"</ul>")),i.options.upload.cancel){var D=i.tip.element.querySelector(".vditorCancelUpload");D&&D.addEventListener("click",function(){i.options.upload.cancel(s),i.tip.hide(),i.upload.isUploading=!1})}return s},cn=function(i,o){var s=le(o);s.focus();var u=JSON.parse(i),d="";u.code===1&&(d="".concat(u.msg)),u.data.errFiles&&u.data.errFiles.length>0&&(d="<ul><li>".concat(d,"</li>"),u.data.errFiles.forEach(function(E){var L=E.lastIndexOf("."),D=o.options.upload.filename(E.substr(0,L))+E.substr(L);d+="<li>".concat(D," ").concat(window.VditorI18n.uploadError,"</li>")}),d+="</ul>"),d?o.tip.show(d):o.tip.hide();var f="";Object.keys(u.data.succMap).forEach(function(E){var L=u.data.succMap[E],D=E.lastIndexOf("."),_=E.substr(D),F=o.options.upload.filename(E.substr(0,D))+_;_=_.toLowerCase(),
|
|||
|
|
data-block="0"><pre><code><audio controls="controls" src="`.concat(L,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(L,`"></audio></pre></div>
|
|||
|
|
`):o.currentMode==="ir"?f+='<audio controls="controls" src="'.concat(L,`"></audio>
|
|||
|
|
`):f+="[".concat(F,"](").concat(L,`)
|
|||
|
|
`):_.indexOf(".apng")===0||_.indexOf(".bmp")===0||_.indexOf(".gif")===0||_.indexOf(".ico")===0||_.indexOf(".cur")===0||_.indexOf(".jpg")===0||_.indexOf(".jpeg")===0||_.indexOf(".jfif")===0||_.indexOf(".pjp")===0||_.indexOf(".pjpeg")===0||_.indexOf(".png")===0||_.indexOf(".svg")===0||_.indexOf(".webp")===0?o.currentMode==="wysiwyg"?f+='<img alt="'.concat(F,'" src="').concat(L,`">
|
|||
|
|
`):f+=".concat(L,`)
|
|||
|
|
`):o.currentMode==="wysiwyg"?f+='<a href="'.concat(L,'">').concat(F,`</a>
|
|||
|
|
`):f+="[".concat(F,"](").concat(L,`)
|
|||
|
|
`)}),(0,j.Hc)(o.upload.range),document.execCommand("insertHTML",!1,f),o.upload.range=getSelection().getRangeAt(0).cloneRange()},wn=function(i,o,s){return Qe(void 0,void 0,void 0,function(){var u,d,pe,f,E,E,L,D,_,F,X,be,xe,pe,Se,ke;return rt(this,function(me){switch(me.label){case 0:for(u=[],d=i.options.upload.multiple===!0?o.length:1,pe=0;pe<d;pe++)f=o[pe],f instanceof DataTransferItem&&(f=f.getAsFile()),u.push(f);return i.options.upload.handler?[4,i.options.upload.handler(u)]:[3,2];case 1:return E=me.sent(),s&&(s.value=""),typeof E=="string"?(i.tip.show(E),[2]):[2];case 2:return!i.options.upload.url||!i.upload?(s&&(s.value=""),i.tip.show("please config: options.upload.url"),[2]):i.options.upload.file?[4,i.options.upload.file(u)]:[3,4];case 3:u=me.sent(),me.label=4;case 4:if(i.options.upload.validate&&(E=i.options.upload.validate(u),typeof E=="string"))return i.tip.show(E),[2];if(L=le(i),i.upload.range=(0,j.zh)(i),D=Kt(i,u),D.length===0)return s&&(s.value=""),[2];for(_=new FormData,F=i.options.upload.extraData,X=0,be=Object.keys(F);X<be.length;X++)xe=be[X],_.append(xe,F[xe]);for(pe=0,Se=D.length;pe<Se;pe++)_.append(i.options.upload.fieldName,D[pe]);return ke=new XMLHttpRequest,i.upload.xhr=ke,ke.open("POST",i.options.upload.url),i.options.upload.token&&ke.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(ke.withCredentials=!0),Ne(i,ke),i.upload.isUploading=!0,L.setAttribute("contenteditable","false"),ke.onreadystatechange=function(){if(ke.readyState===XMLHttpRequest.DONE){if(i.upload.isUploading=!1,L.setAttribute("contenteditable","true"),ke.status>=200&&ke.status<300)if(i.options.upload.success)i.options.upload.success(L,ke.responseText);else{var Pe=ke.responseText;i.options.upload.format&&(Pe=i.options.upload.format(o,ke.responseText)),cn(Pe,i)}else i.options.upload.error?i.options.upload.error(ke.responseText):i.tip.show(ke.responseText);s&&(s.value=""),i.upload.element.style.display="none",i.upload.xhr=void 0}},ke.upload.onprogress=function(Pe){if(Pe.lengthComputable){var Ce=Pe.loaded/Pe.total*100;i.upload.element.style.display="block";var Ve=i.upload.element;Ve.style.width=Ce+"%"}},ke.send(_),[2]}})})},On=function(i,o,s){var u,d=(0,y.F9)(o.startContainer);if(d||(d=i.wysiwyg.element),s&&s.inputType!=="formatItalic"&&s.inputType!=="deleteByDrag"&&s.inputType!=="insertFromDrop"&&s.inputType!=="formatBold"&&s.inputType!=="formatRemove"&&s.inputType!=="formatStrikeThrough"&&s.inputType!=="insertUnorderedList"&&s.inputType!=="insertOrderedList"&&s.inputType!=="formatOutdent"&&s.inputType!=="formatIndent"&&s.inputType!==""||!s){var f=gt(o.startContainer);f&&f.remove(),i.wysiwyg.element.querySelectorAll("wbr").forEach(function(Ce){Ce.remove()}),o.insertNode(document.createElement("wbr")),d.querySelectorAll("[style]").forEach(function(Ce){Ce.removeAttribute("style")}),d.querySelectorAll(".vditor-comment").forEach(function(Ce){Ce.textContent.trim()===""&&(Ce.classList.remove("vditor-comment","vditor-comment--focus"),Ce.removeAttribute("data-cmtids"))}),(u=d.previousElementSibling)===null||u===void 0||u.querySelectorAll(".vditor-comment").forEach(function(Ce){Ce.textContent.trim()===""&&(Ce.classList.remove("vditor-comment","vditor-comment--focus"),Ce.removeAttribute("data-cmtids"))});var E="";d.getAttribute("data-type")==="link-ref-defs-block"&&(d=i.wysiwyg.element);var L=d.isEqualNode(i.wysiwyg.element),D=(0,y.a1)(d,"data-type","footnotes-block");if(L)E=d.innerHTML;else{var _=(0,y.O9)(o.startContainer);if(_&&!D){var F=(0,N.S)(o.startContainer,"BLOCKQUOTE");F?d=(0,y.F9)(o.startContainer)||d:d=_}if(D&&(d=D),E=d.outerHTML,d.tagName==="UL"||d.tagName==="OL"){var X=d.previousElementSibling,be=d.nextElementSibling;X&&(X.tagName==="UL"||X.tagName==="OL")&&(E=X.outerHTML+E,X.remove()),be&&(be.tagName==="UL"||be.tagName==="OL")&&(E=E+be.outerHTML,be.remove()),E=E.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}d.innerText.startsWith("```")||(i.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Ce){Ce&&!d.isEqualNode(Ce)&&(E+=Ce.outerHTML,Ce.re
|
|||
|
|
</p>`)),(0,j.ib)(i[i.currentMode].element,s),pr(i),ct(i))},Lu=function(i){var o=(0,y.lG)(i,"TABLE");return o&&o.rows[0].cells[0].isSameNode(i)?o:!1},_u=function(i){var o=(0,y.lG)(i,"TABLE");return o&&o.lastElementChild.lastElementChild.lastElementChild.isSameNode(i)?o:!1},Hs=function(i,o,s){s===void 0&&(s=!0);var u=i.previousElementSibling;return u||(i.parentElement.previousElementSibling?u=i.parentElement.previousElementSibling.lastElementChild:i.parentElement.parentElement.tagName==="TBODY"&&i.parentElement.parentElement.previousElementSibling?u=i.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:u=null),u&&(o.selectNodeContents(u),s||o.collapse(!1),(0,j.Hc)(o)),u},Di=function(i,o,s,u,d){var f=(0,j.im)(u,i[i.currentMode].element,s);if(o.key==="ArrowDown"&&u.textContent.trimRight().substr(f.start).indexOf(`
|
|||
|
|
`)===-1||o.key==="ArrowRight"&&f.start>=u.textContent.trimRight().length){var E=d.nextElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!0),(0,j.Hc)(s)),o.preventDefault(),!0}return!1},Yr=function(i,o,s,u,d){var f=(0,j.im)(u,i[i.currentMode].element,s);if(o.key==="ArrowUp"&&u.textContent.substr(0,f.start).indexOf(`
|
|||
|
|
`)===-1||(o.key==="ArrowLeft"||o.key==="Backspace"&&s.toString()==="")&&f.start===0){var E=d.previousElementSibling;return!E||E&&(E.tagName==="TABLE"||E.getAttribute("data-type"))?(d.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(i[i.currentMode].element,s)):(s.selectNodeContents(E),s.collapse(!1),(0,j.Hc)(s)),o.preventDefault(),!0}return!1},ga=function(i,o,s,u){u===void 0&&(u=!0);var d=(0,y.lG)(o.startContainer,"LI");if(i[i.currentMode].element.querySelectorAll("wbr").forEach(function(F){F.remove()}),o.insertNode(document.createElement("wbr")),u&&d){for(var f="",E=0;E<d.parentElement.childElementCount;E++){var L=d.parentElement.children[E].querySelector("input");L&&L.remove(),f+='<p data-block="0">'.concat(d.parentElement.children[E].innerHTML.trimLeft(),"</p>")}d.parentElement.insertAdjacentHTML("beforebegin",f),d.parentElement.remove()}else if(d)if(s==="check")d.parentElement.querySelectorAll("li").forEach(function(F){F.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(F.textContent.indexOf(" ")===0?"":" ")),F.classList.add("vditor-task")});else{d.querySelector("input")&&d.parentElement.querySelectorAll("li").forEach(function(F){F.querySelector("input").remove(),F.classList.remove("vditor-task")});var D=void 0;s==="list"?(D=document.createElement("ul"),D.setAttribute("data-marker","*")):(D=document.createElement("ol"),D.setAttribute("data-marker","1.")),D.setAttribute("data-block","0"),D.setAttribute("data-tight",d.parentElement.getAttribute("data-tight")),D.innerHTML=d.parentElement.innerHTML,d.parentElement.parentNode.replaceChild(D,d.parentElement)}else{var _=(0,y.a1)(o.startContainer,"data-block","0");_||(i[i.currentMode].element.querySelector("wbr").remove(),_=i[i.currentMode].element.querySelector("p"),_.innerHTML="<wbr>"),s==="check"?(_.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(_.innerHTML,"</li></ul>")),_.remove()):s==="list"?(_.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(_.innerHTML,"</li></ul>")),_.remove()):s==="ordered-list"&&(_.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(_.innerHTML,"</li></ol>")),_.remove())}},Ps=function(i,o,s){var u=o.previousElementSibling;if(o&&u){var d=[o];Array.from(s.cloneContents().children).forEach(function(D,_){D.nodeType!==3&&o&&D.textContent.trim()!==""&&o.getAttribute("data-node-id")===D.getAttribute("data-node-id")&&(_!==0&&d.push(o),o=o.nextElementSibling)}),i[i.currentMode].element.querySelectorAll("wbr").forEach(function(D){D.remove()}),s.insertNode(document.createElement("wbr"));var f=u.parentElement,E="";d.forEach(function(D){var _=D.getAttribute("data-marker");_.length!==1&&(_="1".concat(_.slice(-1))),E+='<li data-node-id="'.concat(D.getAttribute("data-node-id"),'" data-marker="').concat(_,'">').concat(D.innerHTML,"</li>"),D.remove()}),u.insertAdjacentHTML("beforeend","<".concat(f.tagName,' data-block="0">').concat(E,"</").concat(f.tagName,">")),i.currentMode==="wysiwyg"?f.outerHTML=i.lute.SpinVditorDOM(f.outerHTML):f.outerHTML=i.lute.SpinVditorIRDOM(f.outerHTML),(0,j.ib)(i[i.currentMode].element,s);var L=(0,y.O9)(s.startContainer);L&&L.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function(D){je(D,i),i.currentMode==="wysiwyg"&&D.previousElementSibling.setAttribute("style","display:none")}),ct(i),pr(i)}else i[i.currentMode].element.focus()},Lo=function(i,o,s,u){var d=(0,y.lG)(o.parentElement,"LI");if(d){i[i.currentMode].element.querySelectorAll("wbr").forEach(function(X){X.remove()}),s.insertNode(document.createElement("wbr"));var f=o.parentElement,E=f.cloneNode(),L=[o];Array.from(s.cloneContents().children).forEach(function(X,be){X.nodeType!==3&&o&&X.textContent.trim()!==""&&o.getAttribute("data-node-id")===X.getAttribute("data-node-id")&&(be!==0&&L.push(o),o=o.nextElementSibling)});var D=!1,_="";f.querySelectorAll("li").forEach(function(X){D&&(_+=X.outerHTML,!X.nextElementSibling&&!X.previousElementSibling?X.parentElement.remove():X.remove()),X.isSam
|
|||
|
|
`).pop();return o===""?!1:(o.replace(/ |-/g,"")===""||o.replace(/ |_/g,"")===""||o.replace(/ |\*/g,"")==="")&&o.replace(/ /g,"").length>2?!(o.indexOf("-")>-1&&o.trimLeft().indexOf(" ")===-1&&i.trimRight().split(`
|
|||
|
|
`).length>1||o.indexOf(" ")===0||o.indexOf(" ")===0):!1},No=function(i){var o=i.trimRight().split(`
|
|||
|
|
`);return i=o.pop(),i.indexOf(" ")===0||i.indexOf(" ")===0||(i=i.trimLeft(),i===""||o.length===0)?!1:i.replace(/-/g,"")===""||i.replace(/=/g,"")===""},ct=function(i,o){o===void 0&&(o={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),i.currentMode==="wysiwyg"?He(i,o):i.currentMode==="ir"?lr(i,o):i.currentMode==="sv"&&ne(i,o)},zs=function(i,o,s,u){var d,f=i.startContainer,E=(0,y.lG)(f,"LI");if(E){if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Enter"&&!u.shiftKey&&s&&E.contains(s)&&s.nextElementSibling)return E&&!E.textContent.endsWith(`
|
|||
|
|
`)&&E.insertAdjacentText("beforeend",`
|
|||
|
|
`),i.insertNode(document.createTextNode(`
|
|||
|
|
|
|||
|
|
`)),i.collapse(!1),ct(o),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&!E.previousElementSibling&&i.toString()===""&&(0,j.im)(E,o[o.currentMode].element,i).start===0)return E.nextElementSibling?(E.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>")),E.remove()):E.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(E.innerHTML,"</p>"),(0,j.ib)(o[o.currentMode].element,i),ct(o),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.shiftKey&&!u.altKey&&u.key==="Backspace"&&E.textContent.trim().replace(c.g.ZWSP,"")===""&&i.toString()===""&&((d=E.previousElementSibling)===null||d===void 0?void 0:d.tagName)==="LI")return E.previousElementSibling.insertAdjacentText("beforeend",`
|
|||
|
|
|
|||
|
|
`),i.selectNodeContents(E.previousElementSibling),i.collapse(!1),E.remove(),(0,j.ib)(o[o.currentMode].element,i),ct(o),u.preventDefault(),!0;if(!(0,m.yl)(u)&&!u.altKey&&u.key==="Tab"){var L=!1;if((i.startOffset===0&&(f.nodeType===3&&!f.previousSibling||f.nodeType!==3&&f.nodeName==="LI")||E.classList.contains("vditor-task")&&i.startOffset===1&&f.previousSibling.nodeType!==3&&f.previousSibling.tagName==="INPUT")&&(L=!0),L||i.toString()!=="")return u.shiftKey?Lo(o,E,i,E.parentElement):Ps(o,E,i),u.preventDefault(),!0}}return!1},Do=function(i,o,s){if(i.options.tab&&s.key==="Tab")return s.shiftKey||(o.toString()===""?(o.insertNode(document.createTextNode(i.options.tab)),o.collapse(!1)):(o.extractContents(),o.insertNode(document.createTextNode(i.options.tab)),o.collapse(!1))),(0,j.Hc)(o),ct(i),s.preventDefault(),!0},Bs=function(i,o,s,u){if(s){if(!(0,m.yl)(i)&&!i.altKey&&i.key==="Enter"){var d=String.raw(Ys||(Ys=Zr(["",""],["",""])),s.textContent).replace(/\\\|/g,"").trim(),f=d.split("|");if(d.startsWith("|")&&d.endsWith("|")&&f.length>3){var E=f.map(function(){return"---"}).join("|");return E=s.textContent+`
|
|||
|
|
`+E.substring(3,E.length-3)+`
|
|||
|
|
|<wbr>`,s.outerHTML=o.lute.SpinVditorDOM(E),(0,j.ib)(o[o.currentMode].element,u),ct(o),Bt(o),i.preventDefault(),!0}if(_o(s.innerHTML)&&s.previousElementSibling){var L="",D=s.innerHTML.trimRight().split(`
|
|||
|
|
`);return D.length>1&&(D.pop(),L='<p data-block="0">'.concat(D.join(`
|
|||
|
|
`),"</p>")),s.insertAdjacentHTML("afterend","".concat(L,`<hr data-block="0"><p data-block="0"><wbr>
|
|||
|
|
</p>`)),s.remove(),(0,j.ib)(o[o.currentMode].element,u),ct(o),Bt(o),i.preventDefault(),!0}if(No(s.innerHTML))return o.currentMode==="wysiwyg"?s.outerHTML=o.lute.SpinVditorDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`):s.outerHTML=o.lute.SpinVditorIRDOM(s.innerHTML+`<p data-block="0"><wbr>
|
|||
|
|
</p>`),(0,j.ib)(o[o.currentMode].element,u),ct(o),Bt(o),i.preventDefault(),!0}if(u.collapsed&&s.previousElementSibling&&i.key==="Backspace"&&!(0,m.yl)(i)&&!i.altKey&&!i.shiftKey&&s.textContent.trimRight().split(`
|
|||
|
|
`).length>1&&(0,j.im)(s,o[o.currentMode].element,u).start===0){var _=(0,y.DX)(s.previousElementSibling);return _.textContent.endsWith(`
|
|||
|
|
`)||(_.textContent=_.textContent+`
|
|||
|
|
`),_.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(s.innerHTML)),s.remove(),(0,j.ib)(o[o.currentMode].element,u),!1}return!1}},Fs=function(i,o,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');s.tagName==="TH"?s.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(u,"</tr></tbody>")):s.parentElement.insertAdjacentHTML("afterend","<tr>".concat(u,"</tr>")),ct(i)},qs=function(i,o,s){for(var u="",d=0;d<s.parentElement.childElementCount;d++)s.tagName==="TH"?u+='<th align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </th>'):u+='<td align="'.concat(s.parentElement.children[d].getAttribute("align"),'"> </td>');if(s.tagName==="TH"){s.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(u,"</tr></thead>")),o.insertNode(document.createElement("wbr"));var f=s.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");s.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",f),s.parentElement.parentElement.remove(),(0,j.ib)(i.ir.element,o)}else s.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(u,"</tr>"));ct(i)},ba=function(i,o,s,u){u===void 0&&(u="afterend");for(var d=0,f=s.previousElementSibling;f;)d++,f=f.previousElementSibling;for(var E=0;E<o.rows.length;E++)E===0?o.rows[E].cells[d].insertAdjacentHTML(u,"<th> </th>"):o.rows[E].cells[d].insertAdjacentHTML(u,"<td> </td>");ct(i)},js=function(i,o,s){if(s.tagName==="TD"){var u=s.parentElement.parentElement;s.parentElement.previousElementSibling?o.selectNodeContents(s.parentElement.previousElementSibling.lastElementChild):o.selectNodeContents(u.previousElementSibling.lastElementChild.lastElementChild),u.childElementCount===1?u.remove():s.parentElement.remove(),o.collapse(!1),(0,j.Hc)(o),ct(i)}},$s=function(i,o,s,u){for(var d=0,f=u.previousElementSibling;f;)d++,f=f.previousElementSibling;(u.previousElementSibling||u.nextElementSibling)&&(o.selectNodeContents(u.previousElementSibling||u.nextElementSibling),o.collapse(!0));for(var E=0;E<s.rows.length;E++){var L=s.rows[E].cells;if(L.length===1){s.remove(),pr(i);break}L[d].remove()}(0,j.Hc)(o),ct(i)},Us=function(i,o,s){var u=s.startContainer,d=(0,y.lG)(u,"TD")||(0,y.lG)(u,"TH");if(d){if(!(0,m.yl)(o)&&!o.altKey&&o.key==="Enter"){(!d.lastElementChild||d.lastElementChild&&(!d.lastElementChild.isSameNode(d.lastChild)||d.lastElementChild.tagName!=="BR"))&&d.insertAdjacentHTML("beforeend","<br>");var f=document.createElement("br");return s.insertNode(f),s.setStartAfter(f),ct(i),Bt(i),o.preventDefault(),!0}if(o.key==="Tab"){if(o.shiftKey)return Hs(d,s),o.preventDefault(),!0;var E=d.nextElementSibling;return E||(d.parentElement.nextElementSibling?E=d.parentElement.nextElementSibling.firstElementChild:d.parentElement.parentElement.tagName==="THEAD"&&d.parentElement.parentElement.nextElementSibling?E=d.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:E=null),E&&(s.selectNodeContents(E),(0,j.Hc)(s)),o.preventDefault(),!0}var L=d.parentElement.parentElement.parentElement;if(o.key==="ArrowUp"){if(o.preventDefault(),d.tagName==="TH")return L.previousElementSibling?(s.selectNodeContents(L.previousElementSibling),s.collapse(!1),(0,j.Hc)(s)):Ni(i,"beforebegin"),!0;for(var D=0,_=d.parentElement;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var F=_.previousElementSibling;return F||(F=_.parentElement.previousElementSibling.firstChild),s.selectNodeContents(F.cells[D]),s.collapse(!1),(0,j.Hc)(s),!0}if(o.key==="ArrowDown"){o.preventDefault();var _=d.parentElement;if(!_.nextElementSibling&&d.tagName==="TD")return L.nextElementSibling?(s.selectNodeContents(L.nextElementSibling),s.collapse(!0),(0,j.Hc)(s)):Ni(i,"afterend"),!0;for(var D=0;D<_.cells.length&&!_.cells[D].isSameNode(d);D++);var E=_.nextElementSibling;return E||(E=_.parentElement.nextElementSibling.firstChild),s.selectNodeContents(E.cells[D]),s.collapse(!0),(0,j.Hc)(s),!0}if(i.currentMode==="wysiwyg"&&!(0,m.yl)(o)&&o.key==="Enter"&&!o.
|
|||
|
|
</p>`,(0,j.ib)(i[i.currentMode].element,s)):(s.setStartBefore(L),s.collapse(!0)),ct(i)),o.preventDefault(),!0}if(se("⇧⌘F",o))return qs(i,s,d),o.preventDefault(),!0;if(se("⌘=",o))return Fs(i,s,d),o.preventDefault(),!0;if(se("⇧⌘G",o))return ba(i,L,d,"beforebegin"),o.preventDefault(),!0;if(se("⇧⌘=",o))return ba(i,L,d),o.preventDefault(),!0;if(se("⌘-",o))return js(i,s,d),o.preventDefault(),!0;if(se("⇧⌘-",o))return $s(i,s,L,d),o.preventDefault(),!0;if(se("⇧⌘L",o)){if(i.currentMode==="ir")return va(L,"left"),ct(i),o.preventDefault(),!0;var xe=i.wysiwyg.popover.querySelector('[data-type="left"]');if(xe)return xe.click(),o.preventDefault(),!0}if(se("⇧⌘C",o)){if(i.currentMode==="ir")return va(L,"center"),ct(i),o.preventDefault(),!0;var xe=i.wysiwyg.popover.querySelector('[data-type="center"]');if(xe)return xe.click(),o.preventDefault(),!0}if(se("⇧⌘R",o)){if(i.currentMode==="ir")return va(L,"right"),ct(i),o.preventDefault(),!0;var xe=i.wysiwyg.popover.querySelector('[data-type="right"]');if(xe)return xe.click(),o.preventDefault(),!0}}return!1},Vs=function(i,o,s,u){if(s.tagName==="PRE"&&se("⌘A",o))return u.selectNodeContents(s.firstElementChild),o.preventDefault(),!0;if(i.options.tab&&o.key==="Tab"&&!o.shiftKey&&u.toString()==="")return u.insertNode(document.createTextNode(i.options.tab)),u.collapse(!1),ct(i),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey){var d=(0,j.im)(s,i[i.currentMode].element,u);if((d.start===0||d.start===1&&s.innerText===`
|
|||
|
|
`)&&u.toString()==="")return s.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(s.firstElementChild.innerHTML,"</p>"),(0,j.ib)(i[i.currentMode].element,u),ct(i),o.preventDefault(),!0}return!(0,m.yl)(o)&&!o.altKey&&o.key==="Enter"?(s.firstElementChild.textContent.endsWith(`
|
|||
|
|
`)||s.firstElementChild.insertAdjacentText("beforeend",`
|
|||
|
|
`),u.extractContents(),u.insertNode(document.createTextNode(`
|
|||
|
|
`)),u.collapse(!1),(0,j.Hc)(u),(0,m.vU)()||(i.currentMode==="wysiwyg"?On(i,u):Mt(i,u)),Bt(i),o.preventDefault(),!0):!1},Ws=function(i,o,s,u){var d=o.startContainer,f=(0,y.lG)(d,"BLOCKQUOTE");if(f&&o.toString()===""){if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&(0,j.im)(f,i[i.currentMode].element,o).start===0)return o.insertNode(document.createElement("wbr")),f.outerHTML=f.innerHTML,(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0;if(u&&s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&u.parentElement.tagName==="BLOCKQUOTE"){var E=!1;if(u.innerHTML.replace(c.g.ZWSP,"")===`
|
|||
|
|
`||u.innerHTML.replace(c.g.ZWSP,"")===""?(E=!0,u.remove()):u.innerHTML.endsWith(`
|
|||
|
|
|
|||
|
|
`)&&(0,j.im)(u,i[i.currentMode].element,o).start===u.textContent.length-1&&(u.innerHTML=u.innerHTML.substr(0,u.innerHTML.length-2),E=!0),E)return f.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(c.g.ZWSP,`<wbr>
|
|||
|
|
</p>`)),(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0}var L=(0,y.F9)(d);if(i.currentMode==="wysiwyg"&&L&&se("⇧⌘;",s))return o.insertNode(document.createElement("wbr")),L.outerHTML='<blockquote data-block="0">'.concat(L.outerHTML,"</blockquote>"),(0,j.ib)(i.wysiwyg.element,o),He(i),s.preventDefault(),!0;if(Di(i,s,o,f,f)||Yr(i,s,o,f,f))return!0}return!1},Gs=function(i,o,s){var u=o.startContainer,d=(0,y.lG)(u,"LI");if(d&&d.classList.contains("vditor-task")){if(se("⇧⌘J",s)){var f=d.firstElementChild;return f.checked?f.removeAttribute("checked"):f.setAttribute("checked","checked"),ct(i),s.preventDefault(),!0}if(s.key==="Backspace"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey&&o.toString()===""&&o.startOffset===1&&(u.nodeType===3&&u.previousSibling&&u.previousSibling.tagName==="INPUT"||u.nodeType!==3)){var E=d.previousElementSibling;if(d.querySelector("input").remove(),E){var L=(0,y.DX)(E);L.parentElement.insertAdjacentHTML("beforeend","<wbr>"+d.innerHTML.trim()),d.remove()}else d.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(d.innerHTML.trim()||`
|
|||
|
|
`,"</p>")),d.nextElementSibling?d.remove():d.parentElement.remove();return(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0}if(s.key==="Enter"&&!(0,m.yl)(s)&&!s.shiftKey&&!s.altKey){if(d.textContent.trim()==="")if((0,y.fb)(d.parentElement,"vditor-task")){var D=(0,y.O9)(u);D&&Lo(i,d,o,D)}else if(d.nextElementSibling){var _="",F="",X=!1;Array.from(d.parentElement.children).forEach(function(Se){d.isSameNode(Se)?X=!0:X?_+=Se.outerHTML:F+=Se.outerHTML});var be=d.parentElement.tagName,xe=d.parentElement.tagName==="OL"?"":' data-marker="'.concat(d.parentElement.getAttribute("data-marker"),'"'),pe="";F&&(pe=d.parentElement.tagName==="UL"?"":' start="1"',F="<".concat(be,' data-tight="true"').concat(xe,' data-block="0">').concat(F,"</").concat(be,">")),d.parentElement.outerHTML="".concat(F,`<p data-block="0"><wbr>
|
|||
|
|
</p><`).concat(be,`
|
|||
|
|
data-tight="true"`).concat(xe,' data-block="0"').concat(pe,">").concat(_,"</").concat(be,">")}else d.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
|
|||
|
|
</p>`),d.parentElement.querySelectorAll("li").length===1?d.parentElement.remove():d.remove();else u.nodeType!==3&&o.startOffset===0&&u.firstChild.tagName==="INPUT"?o.setStart(u.childNodes[1],1):(o.setEndAfter(d.lastChild),d.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(d.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(o.extractContents()));return(0,j.ib)(i[i.currentMode].element,o),ct(i),Bt(i),s.preventDefault(),!0}}return!1},Ks=function(i,o,s,u){if(o.startContainer.nodeType!==3){var d=o.startContainer.children[o.startOffset];if(d&&d.tagName==="HR")return o.selectNodeContents(d.previousElementSibling),o.collapse(!1),s.preventDefault(),!0}if(u){var f=u.previousElementSibling;if(f&&(0,j.im)(u,i[i.currentMode].element,o).start===0&&((0,m.vU)()&&f.tagName==="HR"||f.tagName==="TABLE")){if(f.tagName==="TABLE"){var E=f.lastElementChild.lastElementChild.lastElementChild;E.innerHTML=E.innerHTML.trimLeft()+"<wbr>"+u.textContent.trim(),u.remove()}else f.remove();return(0,j.ib)(i[i.currentMode].element,o),ct(i),s.preventDefault(),!0}}return!1},Xs=function(i){(0,m.vU)()&&i.startContainer.nodeType!==3&&i.startContainer.tagName==="HR"&&i.setStartBefore(i.startContainer)},Zs=function(i,o,s){var u,d;if(!(0,m.vU)())return!1;if(i.key==="ArrowUp"&&o&&((u=o.previousElementSibling)===null||u===void 0?void 0:u.tagName)==="TABLE"){var f=o.previousElementSibling;return s.selectNodeContents(f.rows[f.rows.length-1].lastElementChild),s.collapse(!1),i.preventDefault(),!0}return i.key==="ArrowDown"&&o&&((d=o.nextElementSibling)===null||d===void 0?void 0:d.tagName)==="TABLE"?(s.selectNodeContents(o.nextElementSibling.rows[0].cells[0]),s.collapse(!0),i.preventDefault(),!0):!1},ya=function(i,o,s){return Vi(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,F,X,be,xe,pe,Se,me,ke,me,Pe;return pi(this,function(Ce){switch(Ce.label){case 0:return i[i.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(o.stopPropagation(),o.preventDefault(),"clipboardData"in o?(u=o.clipboardData.getData("text/html"),d=o.clipboardData.getData("text/plain"),f=o.clipboardData.files):(u=o.dataTransfer.getData("text/html"),d=o.dataTransfer.getData("text/plain"),o.dataTransfer.types.includes("Files")&&(f=o.dataTransfer.items)),E={},L=function(Ve,Et){if(!Et)return["",Lute.WalkContinue];if(i.options.upload.renderLinkDest)return i.options.upload.renderLinkDest(i,Ve,Et);var wt=Ve.TokensStr();if(Ve.__internal_object__.Parent.Type===34&&wt&&wt.indexOf("file://")===-1&&i.options.upload.linkToImgUrl){var Ct=new XMLHttpRequest;Ct.open("POST",i.options.upload.linkToImgUrl),i.options.upload.token&&Ct.setRequestHeader("X-Upload-Token",i.options.upload.token),i.options.upload.withCredentials&&(Ct.withCredentials=!0),Ne(i,Ct),Ct.setRequestHeader("Content-Type","application/json; charset=utf-8"),Ct.onreadystatechange=function(){if(Ct.readyState===XMLHttpRequest.DONE){if(Ct.status===200){var vn=Ct.responseText;i.options.upload.linkToImgFormat&&(vn=i.options.upload.linkToImgFormat(Ct.responseText));var Yt=JSON.parse(vn);if(Yt.code!==0){i.tip.show(Yt.msg);return}var bn=Yt.data.originalURL;if(i.currentMode==="sv")i.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(Ut){Ut.textContent===bn&&(Ut.textContent=Yt.data.url)});else{var ot=i[i.currentMode].element.querySelector('img[src="'.concat(bn,'"]'));ot.src=Yt.data.url,i.currentMode==="ir"&&(ot.previousElementSibling.previousElementSibling.innerHTML=Yt.data.url)}ct(i)}else i.tip.show(Ct.responseText);i.options.upload.linkToImgCallback&&i.options.upload.linkToImgCallback(Ct.responseText)}},Ct.send(JSON.stringify({url:wt}))}return i.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(wt),"</span>"),Lute.WalkContinue]:i.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(wt),"</span>"),Lute.WalkContinue]},(u.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(d,'">').concat(d
|
|||
|
|
`):Ve+=".concat(pe.result.toString(),`)
|
|||
|
|
`),document.execCommand("insertHTML",!1,Ve)}),Ce.label=8;case 8:return[3,10];case 9:d.trim()!==""&&f.length===0&&(me=(0,j.zh)(i),me.toString()!==""&&i.lute.IsValidLinkDest(d)&&(d="[".concat(me.toString(),"](").concat(d,")")),i.currentMode==="ir"?(E.Md2VditorIRDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,j.oC)(Lute.Sanitize(i.lute.Md2VditorIRDOM(d)),i)):i.currentMode==="wysiwyg"?(E.Md2VditorDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),(0,j.oC)(Lute.Sanitize(i.lute.Md2VditorDOM(d)),i)):(E.Md2VditorSVDOM={renderLinkDest:L},i.lute.SetJSRenderers({renderers:E}),he(i,d)),i.outline.render(i)),Ce.label=10;case 10:return i.currentMode!=="sv"&&(ke=(0,y.F9)((0,j.zh)(i).startContainer),ke&&(me=(0,j.zh)(i),i[i.currentMode].element.querySelectorAll("wbr").forEach(function(Ve){Ve.remove()}),me.insertNode(document.createElement("wbr")),i.currentMode==="wysiwyg"?ke.outerHTML=i.lute.SpinVditorDOM(ke.outerHTML):ke.outerHTML=i.lute.SpinVditorIRDOM(ke.outerHTML),(0,j.ib)(i[i.currentMode].element,me)),i[i.currentMode].element.querySelectorAll(".vditor-".concat(i.currentMode,"__preview[data-render='2']")).forEach(function(Ve){je(Ve,i)})),i.wysiwyg.triggerRemoveComment(i),ct(i),i[i.currentMode].element.scrollHeight-_>Math.min(i[i.currentMode].element.clientHeight,window.innerHeight)/2&&Bt(i),[2]}})})},Nu=function(i,o,s){return Vi(void 0,void 0,void 0,function(){var u,d,f,E,L,D,_,F,X,Se,be,xe,pe,Se,ke,me;return pi(this,function(Pe){switch(Pe.label){case 0:if(!s)return[2];if(u=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,d=new RegExp("(?:("+u.source+"))([\\da-fA-F\\s]+)\\}","g"),f=s.match(d),E=[],f)for(L=0,D=f;L<D.length;L++)_=D[L],F=void 0,_.includes("\\pngblip")?F="image/png":_.includes("\\jpegblip")&&(F="image/jpeg"),F&&E.push({hex:_.replace(u,"").replace(/[^\da-fA-F]/g,""),type:F});for(X=[],Ro(o,function(Ce){if(Ce.tagName==="V:SHAPE")return Ro(Ce,function(Ve){Ve.tagName==="V:IMAGEDATA"&&X.push({shape:Ce,img:Ve})}),!1}),Se=0;Se<X.length;Se++)be=document.createElement("img"),xe="data:"+E[Se].type+";base64,"+btoa((E[Se].hex.match(/\w{2}/g)||[]).map(function(Ce){return String.fromCharCode(parseInt(Ce,16))}).join("")),be.src=xe,be.title=X[Se].img.getAttribute("title"),X[Se].shape.parentNode.replaceChild(be,X[Se].shape);pe=o.querySelectorAll("img"),Se=0,Pe.label=1;case 1:return Se<pe.length?(ke=pe[Se].src||"",ke?(me=pe[Se],[4,i.options.upload.base64ToLink(ke)]):[3,3]):[3,4];case 2:me.src=Pe.sent(),Pe.label=3;case 3:return Se++,[3,1];case 4:return[2]}})})},Ro=function(i,o){var s=o(i);if(s!==!1)for(var u=0;u<i.children.length;u++)Ro(i.children[u],o)},Ys,Js=function(i){var o,s;i.hint.render(i);var u=(0,j.zh)(i).startContainer,d=(0,y.a1)(u,"data-type","code-block-info");if(d)if(d.textContent.replace(c.g.ZWSP,"")===""&&i.hint.recentLanguage){d.textContent=c.g.ZWSP+i.hint.recentLanguage;var f=(0,j.zh)(i);f.selectNodeContents(d)}else{var E=[],L=d.textContent.substring(0,(0,j.im)(d,i.ir.element).start).replace(c.g.ZWSP,"");(i.options.preview.hljs.langs||c.g.ALIAS_CODE_LANGUAGES.concat(((s=(o=window.hljs)===null||o===void 0?void 0:o.listLanguages())!==null&&s!==void 0?s:[]).sort())).forEach(function(D){D.indexOf(L.toLowerCase())>-1&&E.push({html:D,value:D})}),i.hint.genHTML(E,L,i)}},lr=function(i,o){o===void 0&&(o={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),o.enableHint&&Js(i),clearTimeout(i.ir.processTimeoutId),i.ir.processTimeoutId=window.setTimeout(function(){if(!i.ir.composingLock){var s=v(i);typeof i.options.input=="function"&&o.enableInput&&i.options.input(s),i.options.counter.enable&&i.counter.render(i,s),i.options.cache.enable&&(0,m.pK)()&&(localStorage.setItem(i.options.cache.id,s),i.options.cache.after&&i.options.cache.after(s)),i.devtools&&i.devtools.renderEchart(i),o.enableAddUndoStack&&i.undo.addToUndoStack(i)}},i.options.undoDelay)},Ri=function(i,o){var s=(0,j.zh)(i),u=(0,y.F9)(s.startContainer)||s.startContainer;if(u){var d=u.querySelector(".vditor-ir__marker--heading");d?d.innerHTML=o:(u.insertAdjacentText("afterbegin",o),s.selectNodeContents(u),s.collapse(
|
|||
|
|
</p>`;X.innerHTML.trim()===""?X.outerHTML=be:X.insertAdjacentHTML("afterend",be)}}else if(f==="quote")X&&(d.insertNode(document.createElement("wbr")),X.outerHTML='<blockquote data-block="0">'.concat(X.outerHTML,"</blockquote>"),L=!1,o.classList.add("vditor-menu--current"));else if(f==="link"){var xe=void 0;d.toString()===""?xe="".concat(s,"<wbr>").concat(u):xe="".concat(s).concat(d.toString()).concat(u.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,xe),L=!1,o.classList.add("vditor-menu--current")}else if(f==="italic"||f==="bold"||f==="strike"||f==="inline-code"||f==="code"||f==="table"){var xe=void 0;d.toString()===""?xe="".concat(s,"<wbr>").concat(u):(f==="code"?xe="".concat(s,`
|
|||
|
|
`).concat(d.toString(),"<wbr>").concat(u):f==="table"?xe="".concat(s).concat(d.toString(),"<wbr>").concat(u):xe="".concat(s).concat(d.toString()).concat(u,"<wbr>"),d.deleteContents()),(f==="table"||f==="code")&&(xe=`
|
|||
|
|
`+xe+`
|
|||
|
|
|
|||
|
|
`);var pe=document.createElement("span");pe.innerHTML=xe,d.insertNode(pe),Mt(i,d),f==="table"&&(d.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,j.Hc)(d))}else(f==="check"||f==="list"||f==="ordered-list")&&(ga(i,d,f,!1),L=!1,x(i.toolbar.elements,["check","list","ordered-list"]),o.classList.add("vditor-menu--current"))}(0,j.ib)(i.ir.element,d),lr(i),L&&Ue(i)},Ru=function(i,o,s,u){function d(f){return f instanceof s?f:new s(function(E){E(f)})}return new(s||(s=Promise))(function(f,E){function L(F){try{_(u.next(F))}catch(X){E(X)}}function D(F){try{_(u.throw(F))}catch(X){E(X)}}function _(F){F.done?f(F.value):d(F.value).then(L,D)}_((u=u.apply(i,o||[])).next())})},Ou=function(i,o){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,d,f,E;return E={next:L(0),throw:L(1),return:L(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function L(_){return function(F){return D([_,F])}}function D(_){if(u)throw new TypeError("Generator is already executing.");for(;E&&(E=0,_[0]&&(s=0)),s;)try{if(u=1,d&&(f=_[0]&2?d.return:_[0]?d.throw||((f=d.return)&&f.call(d),0):d.next)&&!(f=f.call(d,_[1])).done)return f;switch(d=0,f&&(_=[_[0]&2,f.value]),_[0]){case 0:case 1:f=_;break;case 4:return s.label++,{value:_[1],done:!1};case 5:s.label++,d=_[1],_=[0];continue;case 7:_=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(_[0]===6||_[0]===2)){s=0;continue}if(_[0]===3&&(!f||_[1]>f[0]&&_[1]<f[3])){s.label=_[1];break}if(_[0]===6&&s.label<f[1]){s.label=f[1],f=_;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(_);break}f[2]&&s.ops.pop(),s.trys.pop();continue}_=o.call(i,s)}catch(F){_=[6,F],d=0}finally{u=f=0}if(_[0]&5)throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}},Iu=function(){function i(o){var s=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(u,d){s.element.style.display="none";var f=decodeURIComponent(u.getAttribute("data-value")),E=window.getSelection().getRangeAt(0);if(d.currentMode==="ir"){var L=(0,y.a1)(E.startContainer,"data-type","code-block-info");if(L){L.textContent=c.g.ZWSP+f.trimRight(),E.selectNodeContents(L),E.collapse(!1),lr(d),L.parentElement.querySelectorAll("code").forEach(function(X){X.className="language-"+f.trimRight()}),je(L.parentElement.querySelector(".vditor-ir__preview"),d),s.recentLanguage=f.trimRight();return}}if(d.currentMode==="wysiwyg"&&E.startContainer.nodeType!==3){var D=E.startContainer,_=void 0;if(D.classList.contains("vditor-input")?_=D:_=D.firstElementChild,_&&_.classList.contains("vditor-input")){_.value=f.trimRight(),E.selectNodeContents(_),E.collapse(!1),_.dispatchEvent(new CustomEvent("input",{detail:1})),s.recentLanguage=f.trimRight();return}}if(E.setStart(E.startContainer,s.lastIndex),E.deleteContents(),d.options.hint.parse?d.currentMode==="sv"?(0,j.oC)(d.lute.SpinVditorSVDOM(f),d):d.currentMode==="wysiwyg"?(0,j.oC)(d.lute.SpinVditorDOM(f),d):(0,j.oC)(d.lute.SpinVditorIRDOM(f),d):(0,j.oC)(f,d),s.splitChar===":"&&f.indexOf(":")>-1&&d.currentMode!=="sv"&&E.insertNode(document.createTextNode(" ")),E.collapse(!1),(0,j.Hc)(E),d.currentMode==="wysiwyg"){var F=(0,y.fb)(E.startContainer,"vditor-wysiwyg__block");F&&F.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(F.lastElementChild.innerHTML=F.firstElementChild.innerHTML,je(F.lastElementChild,d))}else if(d.currentMode==="ir"){var F=(0,y.fb)(E.startContainer,"vditor-ir__marker--pre");F&&F.nextElementSibling.classList.contains("vditor-ir__preview")&&(F.nextElementSibling.innerHTML=F.innerHTML,je(F.nextElementSibling,d))}ct(d)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",o.push({key:":"})}return i.prototype.render=function(o){var s=this;if(window.getSelection().focusNode){var u,d=getSelection().getRangeAt(0);u=d.startContainer.textContent.substring(0,d.startOffset)||"";var f=this.getKey(u,o.options.hint.extend);if(typeof f>"u")this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var E=f===""?o.options.
|
|||
|
|
`).concat(be===0?"class='vditor-hint--current'":"","> ").concat(xe,"</button>")}}),this.element.innerHTML=_;var F=parseInt(document.defaultView.getComputedStyle(f,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(D+(F||22),"px"),this.element.style.left="".concat(L,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(X){X.addEventListener("click",function(be){d.fillEmoji(X,u),be.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(D-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},i.prototype.select=function(o,s){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var u=this.element.querySelector(".vditor-hint--current");if(o.key==="ArrowDown")return o.preventDefault(),o.stopPropagation(),u.removeAttribute("class"),u.nextElementSibling?u.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(o.key==="ArrowUp"){if(o.preventDefault(),o.stopPropagation(),u.removeAttribute("class"),u.previousElementSibling)u.previousElementSibling.className="vditor-hint--current";else{var d=this.element.children.length;this.element.children[d-1].className="vditor-hint--current"}return!0}else if(!(0,m.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"&&!o.isComposing)return o.preventDefault(),o.stopPropagation(),this.fillEmoji(u,s),!0;return!1},i.prototype.getKey=function(o,s){var u=this;this.lastIndex=-1,this.splitChar="",s.forEach(function(_){var F=o.lastIndexOf(_.key);u.lastIndex<F&&(u.splitChar=_.key,u.lastIndex=F)});var d;if(this.lastIndex===-1)return d;var f=o.split(this.splitChar),E=f[f.length-1],L=32;if(f.length>1&&E.trim()===E)if(f.length===2&&f[0]===""&&f[1].length<L)d=f[1];else{var D=f[f.length-2].slice(-1);(0,p.X)(D)===" "&&E.length<L&&(d=E)}return d},i}(),Hu=function(){function i(o){this.composingLock=!1;var s=document.createElement("div");s.className="vditor-ir",s.innerHTML='<pre class="vditor-reset" placeholder="'.concat(o.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>`),this.element=s.firstElementChild,this.bindEvent(o),Kr(o,this.element),Ui(o,this.element),sr(o,this.element),_i(o,this.element),vt(o,this.element),Xr(o,this.element),di(o,this.element,this.copy),hi(o,this.element,this.copy)}return i.prototype.copy=function(o,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){o.stopPropagation(),o.preventDefault();var d=document.createElement("div");d.appendChild(u.cloneContents()),o.clipboardData.setData("text/plain",s.lute.VditorIRDOM2Md(d.innerHTML).trim()),o.clipboardData.setData("text/html","")}},i.prototype.bindEvent=function(o){var s=this;this.element.addEventListener("paste",function(u){ya(o,u,{pasteCode:function(d){document.execCommand("insertHTML",!1,d)}})}),this.element.addEventListener("scroll",function(){T(o,["hint"])}),this.element.addEventListener("compositionstart",function(u){s.composingLock=!0}),this.element.addEventListener("compositionend",function(u){(0,m.vU)()||Mt(o,getSelection().getRangeAt(0).cloneRange()),s.composingLock=!1}),this.element.addEventListener("input",function(u){if(!(u.inputType==="deleteByDrag"||u.inputType==="insertFromDrop")){if(s.preventInput){s.preventInput=!1,lr(o,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}s.composingLock||u.data==="‘"||u.data==="“"||u.data==="《"||Mt(o,getSelection().getRangeAt(0).cloneRange(),!1,u)}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){u.target.checked?u.target.setAttribute("checked","checked"):u.target.removeAttribute("checked"),s.preventInput=!0,lr(o);return}var d=(0,j.zh)(o),f=(0,y.fb)(u.target,"vditor-ir__preview");if(f||(f=(0,y.fb)(d.startContainer,"vditor-ir__preview")),f&&(f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!0),(0,j.Hc)(d),Bt(o)),u.target.tagName==="IMG"){var E=u.target.parentElement.querySelector(".vditor-ir__marker--link");E&&(d.selectNode(E),(0,j.Hc)(d))}var L=(0,y.a1)(u.target,"data-type","a");if(L&&!L.classList.contains("vditor-ir__node--expand")){o.options.link.click?o.options.link.click(L.querySelector(":scope > .vditor-ir__marker--link")):o.options.link.isOpen&&window.open(L.querySelector(":scope > .vditor-ir__marker--link").textContent);return}if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&d.collapsed){var D=s.element.lastElementChild.getBoundingClientRect();u.y>D.top+D.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(d.selectNodeContents(s.element.lastElementChild),d.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(s.element,d)))}d.toString()===""?Q(d,o):setTimeout(function(){Q((0,j.zh)(o),o)}),It(u,o),Ue(o)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){if(u.key==="Enter"&&Bt(o),Ue(o),(u.key==="Backspace"||u.key==="Delete")&&o.ir.element.innerHTML!==""&&o.ir.element.childNodes.length===1&&o.ir.element.firstElementChild&&o.ir.element.firstElementChild.tagName==="P"&&o.ir.element.firstElementChild.childElementCount===0&&(o.ir.element.textContent===""||o.ir.element.textContent===`
|
|||
|
|
`)){o.ir.element.innerHTML="";return}var d=(0,j.zh)(o);u.key==="Backspace"?((0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent="",Q(d,o)),s.element.querySelectorAll(".language-math").forEach(function(E){var L=E.querySelector("br");L&&L.remove()})):u.key.indexOf("Arrow")>-1?((u.key==="ArrowLeft"||u.key==="ArrowRight")&&Js(o),Q(d,o)):u.keyCode===229&&u.code===""&&u.key==="Unidentified"&&Q(d,o);var f=(0,y.fb)(d.startContainer,"vditor-ir__preview");if(f){if(u.key==="ArrowUp"||u.key==="ArrowLeft")return f.previousElementSibling.firstElementChild?d.selectNodeContents(f.previousElementSibling.firstElementChild):d.selectNodeContents(f.previousElementSibling),d.collapse(!1),u.preventDefault(),!0;if(f.tagName==="SPAN"&&(u.key==="ArrowDown"||u.key==="ArrowRight"))return f.parentElement.getAttribute("data-type")==="html-entity"?(f.parentElement.insertAdjacentText("afterend",c.g.ZWSP),d.setStart(f.parentElement.nextSibling,1)):d.selectNodeContents(f.parentElement.lastElementChild),d.collapse(!1),u.preventDefault(),!0}}})},i}(),Qs=function(i){if(i.currentMode==="sv")return i.lute.Md2HTML(v(i));if(i.currentMode==="wysiwyg")return i.lute.VditorDOM2HTML(i.wysiwyg.element.innerHTML);if(i.currentMode==="ir")return i.lute.VditorIRDOM2HTML(i.ir.element.innerHTML)},Pu=a(214),el=a(436),zu=function(){function i(o){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(o,`</div>
|
|||
|
|
<div class="vditor-outline__content"></div>`)}return i.prototype.render=function(o){var s="";return o.preview.element.style.display==="block"?s=(0,el.k)(o.preview.previewElement,this.element.lastElementChild,o):s=(0,el.k)(o[o.currentMode].element,this.element.lastElementChild,o),s},i.prototype.toggle=function(o,s,u){var d;s===void 0&&(s=!0),u===void 0&&(u=!0);var f=(d=o.toolbar.elements.outline)===null||d===void 0?void 0:d.firstElementChild;if(s&&window.innerWidth>=c.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(o),f==null||f.classList.add("vditor-menu--current")):(this.element.style.display="none",f==null||f.classList.remove("vditor-menu--current")),u&&getSelection().rangeCount>0){var E=getSelection().getRangeAt(0);o[o.currentMode].element.contains(E.startContainer)&&(0,j.Hc)(E)}ze(o)},i}(),Bu=a(280),Fu=function(){function i(o){var s=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",o.options.classes.preview&&this.previewElement.classList.add(o.options.classes.preview),this.previewElement.style.maxWidth=o.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(D){if(D.target.tagName!=="TEXTAREA"){var _=document.createElement("div");_.className="vditor-reset",_.appendChild(getSelection().getRangeAt(0).cloneContents()),s.copyToX(o,_,"default"),D.preventDefault()}}),this.previewElement.addEventListener("click",function(D){var _=(0,y.lG)(D.target,"SPAN");if(_&&(0,y.fb)(_,"vditor-toc")){var F=s.previewElement.querySelector("#"+_.getAttribute("data-target-id"));F&&(s.element.scrollTop=F.offsetTop);return}if(D.target.tagName==="A"){o.options.link.click?o.options.link.click(D.target):o.options.link.isOpen&&window.open(D.target.getAttribute("href")),D.preventDefault();return}D.target.tagName==="IMG"&&(o.options.image.preview?o.options.image.preview(D.target):o.options.image.isPreview&&(0,de.E)(D.target,o.options.lang,o.options.theme))}),this.element.appendChild(this.previewElement);var u=o.options.preview.actions;if(u.length!==0){var d=document.createElement("div");d.className="vditor-preview__action";for(var f=[],E=0;E<u.length;E++){var L=u[E];if(typeof L=="object"){f.push('<button type="button" data-type="'.concat(L.key,'" class="').concat(L.className,'"').concat(L.tooltip?' aria-label="'.concat(L.tooltip,'"'):"",'">').concat(L.text,"</button>"));continue}switch(L){case"desktop":f.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":f.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":f.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":f.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":f.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>');break}}d.innerHTML=f.join(""),d.addEventListener((0,m.Le)(),function(D){var _=(0,N.S)(D.target,"BUTTON");if(_){var F=_.getAttribute("data-type"),X=u.find(function(be){return(be==null?void 0:be.key)===F});if(X){X.click(F);return}if(F==="mp-wechat"||F==="zhihu"){s.copyToX(o,s.previewElement.cloneNode(!0),F);return}F==="desktop"?s.previewElement.style.width="auto":F==="tablet"?s.previewElement.style.width="780px":s.previewElement.style.width="360px",s.previewElement.scrollWidth>s.previewElement.parentElement.clientWidth&&(s.previewElement.style.width="auto"),s.render(o),d.querySelectorAll("button").forEach(function(be){be.classList.remove("vditor-preview__action--current")}),_.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(d,this.previewElement)}}return i.prototype.render=function(o,s){var u=this;if(clearTimeout(this.mdTimeoutId),this.element.st
|
|||
|
|
`)){o.sv.element.innerHTML="";return}u.key==="Enter"&&Bt(o)}})},i}(),tl=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return i.prototype.show=function(o,s){var u=this;s===void 0&&(s=6e3),this.element.className="vditor-tip vditor-tip--show",s===0?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(o,`
|
|||
|
|
<div class="vditor-tip__close">X</div></div>`),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){u.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(o,"</div>"),setTimeout(function(){u.hide()},s)),this.element.removeAttribute("style"),setTimeout(function(){var d=u.element.getBoundingClientRect();d.top<46&&(u.element.style.position="fixed",u.element.style.top="46px")},150)},i.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},i}(),Oo=function(i,o){if(o.options.preview.mode!==i){switch(o.options.preview.mode=i,i){case"both":o.sv.element.style.display="block",o.preview.element.style.display="block",o.preview.render(o),w(o.toolbar.elements,["both"]);break;case"editor":o.sv.element.style.display="block",o.preview.element.style.display="none",x(o.toolbar.elements,["both"]);break}o.devtools&&o.devtools.renderEchart(o)}},$u=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Uu=function(i){$u(o,i);function o(s,u){var d=i.call(this,s,u)||this;return s.options.preview.mode==="both"&&d.element.children[0].classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),s.currentMode==="sv"&&(s.options.preview.mode==="both"?Oo("editor",s):Oo("both",s)))}),d}return o}(xt),Vu=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"}return i}(),nl=a(580),Wu=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Gu=function(i){Wu(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return c.g.CODE_THEME.forEach(function(D){L+="<button>".concat(D,"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.addEventListener((0,m.Le)(),function(D){D.target.tagName==="BUTTON"&&(T(s,["subToolbar"]),s.options.preview.hljs.style=D.target.textContent,(0,nl.Y)(D.target.textContent,s.options.cdn),D.preventDefault(),D.stopPropagation())}),d.element.appendChild(E),M(s,E,f,u.level),d}return o}(xt),Ku=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Xu=function(i){Ku(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow");var L="";return Object.keys(s.options.preview.theme.list).forEach(function(D){L+='<button data-type="'.concat(D,'">').concat(s.options.preview.theme.list[D],"</button>")}),E.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(L,"</div>"),E.add
|
|||
|
|
`)?s.length-1:s.length;if(o.options.counter.type==="text"&&o[o.currentMode]){var d=o[o.currentMode].element.cloneNode(!0);d.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(f){f.remove()}),u=d.textContent.length}typeof o.options.counter.max=="number"?(u>o.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(u,"/").concat(o.options.counter.max)):this.element.innerHTML="".concat(u),this.element.setAttribute("aria-label",o.options.counter.type),o.options.counter.after&&o.options.counter.after(u,{enable:o.options.counter.enable,max:o.options.counter.max,type:o.options.counter.type})},i}(),Yu=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ju=function(i){Yu(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].innerHTML=u.icon,d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!f.currentTarget.classList.contains(c.g.CLASS_MENU_DISABLED)&&u.click(f,s)}),d}return o}(xt),Qu=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ed=function(i){Qu(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.firstElementChild.addEventListener((0,m.Le)(),function(f){var E=d.element.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(f.preventDefault(),E.classList.contains("vditor-menu--current")?(E.classList.remove("vditor-menu--current"),s.devtools.element.style.display="none",ze(s)):(E.classList.add("vditor-menu--current"),s.devtools.element.style.display="block",ze(s),s.devtools.renderEchart(s)))}),d}return o}(xt),td=function(){function i(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"}return i}(),nd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),rd=function(i){nd(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");f.className="vditor-panel vditor-panel--arrow";var E="";return Object.keys(s.options.hint.emoji).forEach(function(L){var D=s.options.hint.emoji[L];D.indexOf(".")>-1?E+='<button data-value=":'.concat(L,': " data-key=":').concat(L,`:"><img
|
|||
|
|
data-value=":`).concat(L,': " data-key=":').concat(L,':" class="vditor-emojis__icon" src="').concat(D,'"/></button>'):E+='<button data-value="'.concat(D,` "
|
|||
|
|
data-key="`).concat(L,'"><span class="vditor-emojis__icon">').concat(D,"</span></button>")}),f.innerHTML='<div class="vditor-emojis" style="max-height: '.concat(s.options.height==="auto"?"auto":s.options.height-80,'px">').concat(E,`</div><div class="vditor-emojis__tail">
|
|||
|
|
<span class="vditor-emojis__tip"></span><span>`).concat(s.options.hint.emojiTail||"",`</span>
|
|||
|
|
</div>`),d.element.appendChild(f),M(s,f,d.element.firstElementChild,u.level),d.bindEvent(s),d}return o.prototype.bindEvent=function(s){var u=this;this.element.lastElementChild.addEventListener((0,m.Le)(),function(d){var f=(0,N.S)(d.target,"BUTTON");if(f){d.preventDefault();var E=f.getAttribute("data-value"),L=(0,j.zh)(s),D=E;if(s.currentMode==="wysiwyg"?D=s.lute.SpinVditorDOM(E):s.currentMode==="ir"&&(D=s.lute.SpinVditorIRDOM(E)),E.indexOf(":")>-1&&s.currentMode!=="sv"){var _=document.createElement("div");_.innerHTML=D,D=_.firstElementChild.firstElementChild.outerHTML+" ",(0,j.oC)(D,s)}else L.extractContents(),L.insertNode(document.createTextNode(E)),(0,y.F9)(L.startContainer)||Rn(s,L);L.collapse(!1),(0,j.Hc)(L),u.element.lastElementChild.style.display="none",ct(s)}}),this.element.lastElementChild.addEventListener("mouseover",function(d){var f=(0,N.S)(d.target,"BUTTON");f&&(u.element.querySelector(".vditor-emojis__tip").innerHTML=f.getAttribute("data-key"))})},o}(xt),rl=function(i,o,s){var u=document.createElement("a");"download"in u?(u.download=s,u.style.display="none",u.href=URL.createObjectURL(new Blob([o])),document.body.appendChild(u),u.click(),u.remove()):i.tip.show(window.VditorI18n.downloadTip,0)},id=function(i){var o=v(i);rl(i,o,o.substr(0,10)+".md")},ad=function(i){i.tip.show(window.VditorI18n.generate,3800);var o=document.querySelector("#vditorExportIframe");o.contentDocument.open(),o.contentDocument.write('<link rel="stylesheet" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script>
|
|||
|
|
<div id="preview" style="width: 800px"></div>
|
|||
|
|
<script>
|
|||
|
|
window.addEventListener("message", (e) => {
|
|||
|
|
if(!e.data) {
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
Vditor.preview(document.getElementById('preview'), e.data, {
|
|||
|
|
cdn: "`).concat(i.options.cdn,`",
|
|||
|
|
markdown: {
|
|||
|
|
theme: `).concat(JSON.stringify(i.options.preview.theme),`
|
|||
|
|
},
|
|||
|
|
hljs: {
|
|||
|
|
style: "`).concat(i.options.preview.hljs.style,`"
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
setTimeout(() => {
|
|||
|
|
window.print();
|
|||
|
|
}, 3600);
|
|||
|
|
}, false);
|
|||
|
|
<\/script>`)),o.contentDocument.close(),setTimeout(function(){o.contentWindow.postMessage(v(i),"*")},200)},od=function(i){var o=Qs(i),s='<html><head><link rel="stylesheet" type="text/css" href="'.concat(i.options.cdn,`/dist/index.css"/>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/i18n/").concat(i.options.lang,`.js"><\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,`/dist/method.min.js"><\/script></head>
|
|||
|
|
<body><div class="vditor-reset" id="preview">`).concat(o,`</div>
|
|||
|
|
<script>
|
|||
|
|
const previewElement = document.getElementById('preview')
|
|||
|
|
Vditor.setContentTheme('`).concat(i.options.preview.theme.current,"', '").concat(i.options.preview.theme.path,`');
|
|||
|
|
Vditor.codeRender(previewElement);
|
|||
|
|
Vditor.highlightRender(`).concat(JSON.stringify(i.options.preview.hljs),", previewElement, '").concat(i.options.cdn,`');
|
|||
|
|
Vditor.mathRender(previewElement, {
|
|||
|
|
cdn: '`).concat(i.options.cdn,`',
|
|||
|
|
math: `).concat(JSON.stringify(i.options.preview.math),`,
|
|||
|
|
});
|
|||
|
|
Vditor.mermaidRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.SMILESRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.markmapRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.flowchartRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.graphvizRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
Vditor.chartRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.mindmapRender(previewElement, '`).concat(i.options.cdn,"', '").concat(i.options.theme,`');
|
|||
|
|
Vditor.abcRender(previewElement, '`).concat(i.options.cdn,`');
|
|||
|
|
`).concat(i.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",`
|
|||
|
|
Vditor.speechRender(previewElement);
|
|||
|
|
<\/script>
|
|||
|
|
<script src="`).concat(i.options.cdn,"/dist/js/icons/").concat(i.options.icon,'.js"><\/script></body></html>');rl(i,s,o.substr(0,10)+".html")},sd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ld=function(i){sd(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=d.element.children[0],E=document.createElement("div");return E.className="vditor-hint".concat(u.level===2?"":" vditor-panel--arrow"),E.innerHTML=`<button data-type="markdown">Markdown</button>
|
|||
|
|
<button data-type="pdf">PDF</button>
|
|||
|
|
<button data-type="html">HTML</button>`,E.addEventListener((0,m.Le)(),function(L){var D=L.target;if(D.tagName==="BUTTON"){switch(D.getAttribute("data-type")){case"markdown":id(s);break;case"pdf":ad(s);break;case"html":od(s);break}T(s,["subToolbar"]),L.preventDefault(),L.stopPropagation()}}),d.element.appendChild(E),M(s,E,f,u.level),d}return o}(xt),cd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),ud=function(i){cd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s,u),d}return o.prototype._bindEvent=function(s,u){this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault(),s.element.className.includes("vditor--fullscreen")?(u.level||(this.innerHTML=u.icon),s.element.style.zIndex="",document.body.style.overflow="",s.element.classList.remove("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__s","__n"),s.options.toolbar.forEach(function(L){typeof L!="string"&&L.tipPosition&&L.name===E.dataset.type&&(E.className="vditor-tooltipped vditor-tooltipped__".concat(L.tipPosition))}))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__s","__n"))):(u.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),s.element.style.zIndex=s.options.fullscreen.index.toString(),document.body.style.overflow="hidden",s.element.classList.add("vditor--fullscreen"),Object.keys(s.toolbar.elements).forEach(function(f){var E=s.toolbar.elements[f].firstChild;E&&(E.className=E.className.replace("__n","__s"))}),s.counter&&(s.counter.element.className=s.counter.element.className.replace("__n","__s"))),s.devtools&&s.devtools.renderEchart(s),u.click&&u.click(d,s),ze(s),We(s)})},o}(xt),dd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),hd=function(i){dd(o,i);function o(s,u){var d=i.call(this,s,u)||this,f=document.createElement("div");return f.className="vditor-hint vditor-panel--arrow",f.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,m.ns)("<⌥⌘1>"),`</button>
|
|||
|
|
<button data-tag="h2" data-value="## ">`).concat(window.VditorI18n.heading2," <").concat((0,m.ns)("⌥⌘2"),`></button>
|
|||
|
|
<button data-tag="h3" data-value="### ">`).concat(window.VditorI18n.heading3," <").concat((0,m.ns)("⌥⌘3"),`></button>
|
|||
|
|
<button data-tag="h4" data-value="#### ">`).concat(window.VditorI18n.heading4," <").concat((0,m.ns)("⌥⌘4"),`></button>
|
|||
|
|
<button data-tag="h5" data-value="##### ">`).concat(window.VditorI18n.heading5," <").concat((0,m.ns)("⌥⌘5"),`></button>
|
|||
|
|
<button data-tag="h6" data-value="###### ">`).concat(window.VditorI18n.heading6," <").concat((0,m.ns)("⌥⌘6"),"></button>"),d.element.appendChild(f),d._bindEvent(s,f),d}return o.prototype._bindEvent=function(s,u){var d=this.element.children[0];d.addEventListener((0,m.Le)(),function(E){E.preventDefault(),clearTimeout(s.wysiwyg.afterRenderTimeoutId),clearTimeout(s.ir.processTimeoutId),clearTimeout(s.sv.processTimeoutId),!d.classList.contains(c.g.CLASS_MENU_DISABLED)&&(d.blur(),d.classList.contains("vditor-menu--current")?(s.currentMode==="wysiwyg"?(Qn(s),He(s)):s.currentMode==="ir"&&Ri(s,""),d.classList.remove("vditor-menu--current")):(T(s,["subToolbar"]),u.style.display="block"))});for(var f=0;f<6;f++)u.children.item(f).addEventListener((0,m.Le)(),function(E){E.preventDefault(),s.currentMode==="wysiwyg"?(ln(s,E.target.getAttribute("data-tag")),He(s),d.classList.add("vditor-menu--current")):s.currentMode==="ir"?(Ri(s,E.target.getAttribute("data-value")),d.classList.add("vditor-menu--current")):Te(s,E.target.getAttribute("data-value")),u.style.display="none"})},o}(xt),pd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),fd=function(i){pd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Markdown 使用指南</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
<div style="margin-top: 14px;flex: 1">
|
|||
|
|
<div>Vditor 支持</div>
|
|||
|
|
<ul style="list-style: none">
|
|||
|
|
<li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
|
|||
|
|
<li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>
|
|||
|
|
<li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>
|
|||
|
|
<li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>
|
|||
|
|
</ul>
|
|||
|
|
</div></div>`,0)}),d}return o}(xt),md=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),gd=function(i){md(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,j.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&Ps(s,L,E)}}),d}return o}(xt),vd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),bd=function(i){vd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),s.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
|
|||
|
|
<p style="text-align: center;margin: 14px 0">
|
|||
|
|
<em>下一代的 Markdown 编辑器,为未来而构建</em>
|
|||
|
|
</p>
|
|||
|
|
<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
|
|||
|
|
<img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
|
|||
|
|
<div> </div>
|
|||
|
|
<div style="flex: 1;min-width: 250px">
|
|||
|
|
Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。
|
|||
|
|
它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div style="display: flex;flex-wrap: wrap;">
|
|||
|
|
<ul style="list-style: none;flex: 1;min-width:148px">
|
|||
|
|
<li>
|
|||
|
|
项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
开源协议:MIT
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
<ul style="list-style: none;margin-right: 18px">
|
|||
|
|
<li>
|
|||
|
|
组件版本:Vditor v`.concat(c.H," / Lute v").concat(Lute.Version,`
|
|||
|
|
</li>
|
|||
|
|
<li>
|
|||
|
|
赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
|
|||
|
|
</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
</div>`),0)}),d}return o}(xt),yd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),wd=function(i){yd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&Ni(s,"afterend")}),d}return o}(xt),xd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),kd=function(i){xd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")&&Ni(s,"beforebegin")}),d}return o}(xt),Sd=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ed=function(i){Sd(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d.element.children[0].addEventListener((0,m.Le)(),function(f){if(f.preventDefault(),!(d.element.firstElementChild.classList.contains(c.g.CLASS_MENU_DISABLED)||s.currentMode==="sv")){var E=(0,j.zh)(s),L=(0,y.lG)(E.startContainer,"LI");L&&Lo(s,L,E,L.parentElement)}}),d}return o}(xt),Td=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Ad=function(i){Td(o,i);function o(s,u){var d=i.call(this,s,u)||this;return s.options.outline&&d.element.firstElementChild.classList.add("vditor-menu--current"),d.element.children[0].addEventListener((0,m.Le)(),function(f){f.preventDefault();var E=s.toolbar.elements.outline.firstElementChild;E.classList.contains(c.g.CLASS_MENU_DISABLED)||(s.options.outline.enable=!d.element.firstElementChild.classList.contains("vditor-menu--current"),s.outline.toggle(s,s.options.outline.enable))}),d}return o}(xt),Md=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Cd=function(i){Md(o,i);function o(s,u){var d=i.call(this,s,u)||this;return d._bindEvent(s),d}return o.prototype._bindEvent=function(s){var u=this;this.element.children[0].addEventListener((0,m.Le)(),function(d){d.preventDefault();var f=u.element.first
|
|||
|
|
| --- | --- | --- |
|
|||
|
|
| | | |
|
|||
|
|
| | | |`,tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],d=[];return o.forEach(function(f){var E=f;u.forEach(function(L){typeof f=="string"&&L.name===f&&(E=L),typeof f=="object"&&L.name===f.name&&(E=Object.assign({},L,f))}),f.toolbar&&(E.toolbar=s.mergeToolbar(f.toolbar)),d.push(E)}),d},i}(),$d=function(){function i(o){var s=this;this.composingLock=!1,this.commentIds=[];var u=document.createElement("div");u.className="vditor-wysiwyg",u.innerHTML='<pre class="vditor-reset" placeholder="'.concat(o.options.placeholder,`"
|
|||
|
|
contenteditable="true" spellcheck="false"></pre>
|
|||
|
|
<div class="vditor-panel vditor-panel--none"></div>
|
|||
|
|
<div class="vditor-panel vditor-panel--none">
|
|||
|
|
<button type="button" aria-label="`).concat(window.VditorI18n.comment,`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
|
|||
|
|
<svg><use xlink:href="#vditor-icon-comment"></use></svg>
|
|||
|
|
</button>
|
|||
|
|
</div>`),this.element=u.firstElementChild,this.popover=u.firstElementChild.nextElementSibling,this.selectPopover=u.lastElementChild,this.bindEvent(o),Kr(o,this.element),Ui(o,this.element),sr(o,this.element),_i(o,this.element),vt(o,this.element),Xr(o,this.element),di(o,this.element,this.copy),hi(o,this.element,this.copy),o.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var d=Lute.NewNodeID(),f=getSelection().getRangeAt(0),E=f.cloneRange(),L=f.extractContents(),D,_,F=!1,X=!1;L.childNodes.forEach(function(pe,Se){var ke=!1;if(pe.nodeType===3?ke=!0:pe.classList.contains("vditor-comment")?pe.classList.contains("vditor-comment")&&pe.setAttribute("data-cmtids",pe.getAttribute("data-cmtids")+" "+d):ke=!0,ke)if(pe.nodeType!==3&&pe.getAttribute("data-block")==="0"&&Se===0&&E.startOffset>0)pe.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(pe.innerHTML,"</span>"),D=pe;else if(pe.nodeType!==3&&pe.getAttribute("data-block")==="0"&&Se===L.childNodes.length-1&&E.endOffset<E.endContainer.textContent.length)pe.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(pe.innerHTML,"</span>"),_=pe;else if(pe.nodeType!==3&&pe.getAttribute("data-block")==="0")Se===0?F=!0:Se===L.childNodes.length-1&&(X=!0),pe.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(d,'">').concat(pe.innerHTML,"</span>");else{var me=document.createElement("span");me.classList.add("vditor-comment"),me.setAttribute("data-cmtids",d),pe.parentNode.insertBefore(me,pe),me.appendChild(pe)}});var be=(0,y.F9)(E.startContainer);be&&(D?(be.insertAdjacentHTML("beforeend",D.innerHTML),D.remove()):be.textContent.trim().replace(c.g.ZWSP,"")===""&&F&&be.remove());var xe=(0,y.F9)(E.endContainer);xe&&(_?(xe.insertAdjacentHTML("afterbegin",_.innerHTML),_.remove()):xe.textContent.trim().replace(c.g.ZWSP,"")===""&&X&&xe.remove()),f.insertNode(L),o.options.comment.add(d,f.toString(),s.getComments(o,!0)),He(o,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),s.hideComment()})}return i.prototype.getComments=function(o,s){var u=this;if(s===void 0&&(s=!1),o.currentMode==="wysiwyg"&&o.options.comment.enable){this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(f){u.commentIds=u.commentIds.concat(f.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var d=[];if(s)return this.commentIds.forEach(function(f){d.push({id:f,top:u.element.querySelector('.vditor-comment[data-cmtids="'.concat(f,'"]')).offsetTop})}),d}else return[]},i.prototype.triggerRemoveComment=function(o){var s=function(f,E){var L=new Set(E);return f.filter(function(D){return!L.has(D)})};if(o.currentMode==="wysiwyg"&&o.options.comment.enable&&o.wysiwyg.commentIds.length>0){var u=JSON.parse(JSON.stringify(this.commentIds));this.getComments(o);var d=s(u,this.commentIds);d.length>0&&o.options.comment.remove(d)}},i.prototype.showComment=function(){var o=(0,j.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(o.left,"px;display:block;top:").concat(Math.max(-8,o.top-21),"px"))},i.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},i.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},i.prototype.copy=function(o,s){var u=getSelection().getRangeAt(0);if(u.toString()!==""){o.stopPropagation(),o.preventDefault();var d=(0,y.lG)(u.startContainer,"CODE"),f=(0,y.lG)(u.endContainer,"CODE");if(d&&f&&f.isSameNode(d)){var E="";d.parentElement.tagName==="PRE"?E=u.toString():E="`"+u.toString()+"`",o.clipboardData.setData("text/plain",E),o.clipboardData.setData("text/html","");return}var L=(0,y.lG)(u.startContainer,"A"),D=(0,y.lG)(u.endContainer,"A");if(L&&D&&D.isSameNode(L)){var _=L.getAttribute("title")||"";_&&(_=' "'.concat(_,'"')),o.clipboardData.setData("text/plain","[".concat(u.toString(),"](").concat(L.getAttribute("href")).concat(_,")")),o.clipboardData.setData("text/html","");return}var F=document.createElement("div");F.appendChild(u.cloneContents()),o.clipboardData.se
|
|||
|
|
`);D--)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==" "){L=!1;break}E===0&&(L=!1);for(var _=!0,D=E-1;D<f.textContent.length;D++)if(f.textContent.charAt(D)!==" "&&f.textContent.charAt(D)!==`
|
|||
|
|
`){_=!1;break}_&&/^#{1,6} $/.test(f.textContent)&&(_=!1);var F=(0,N.W)(getSelection().getRangeAt(0).startContainer);if(F&&F.textContent===""&&(yt(o),F.remove()),L&&f.getAttribute("data-type")!=="code-block"||_||No(f.innerHTML)||_o(f.innerHTML)&&f.previousElementSibling){typeof o.options.input=="function"&&o.options.input(v(o));return}u.inputType==="insertParagraph"&&s.element.innerHTML==="<p><br></p><p><br></p>"&&f.previousElementSibling.remove(),On(o,d,u)}}}),this.element.addEventListener("click",function(u){if(u.target.tagName==="INPUT"){var d=u.target;d.checked?d.setAttribute("checked","checked"):d.removeAttribute("checked"),s.preventInput=!0,getSelection().rangeCount>0&&(0,j.Hc)(getSelection().getRangeAt(0)),He(o);return}if(u.target.tagName==="IMG"&&!u.target.parentElement.classList.contains("vditor-wysiwyg__preview")){u.target.getAttribute("data-type")==="link-ref"?Gr(o,u.target):zn(u,o);return}var f=(0,y.lG)(u.target,"A");if(f){o.options.link.click?o.options.link.click(f):o.options.link.isOpen&&window.open(f.getAttribute("href")),u.preventDefault();return}var E=(0,j.zh)(o);if(u.target.isEqualNode(s.element)&&s.element.lastElementChild&&E.collapsed){var L=s.element.lastElementChild.getBoundingClientRect();u.y>L.top+L.height&&(s.element.lastElementChild.tagName==="P"&&s.element.lastElementChild.textContent.trim().replace(c.g.ZWSP,"")===""?(E.selectNodeContents(s.element.lastElementChild),E.collapse(!1)):(s.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(c.g.ZWSP,"<wbr></p>")),(0,j.ib)(s.element,E)))}Pn(o);var D=(0,y.fb)(u.target,"vditor-wysiwyg__preview");D||(D=(0,y.fb)((0,j.zh)(o).startContainer,"vditor-wysiwyg__preview")),D&&Cn(D,o),It(u,o)}),this.element.addEventListener("keyup",function(u){if(!(u.isComposing||(0,m.yl)(u))){u.key==="Enter"&&Bt(o),(u.key==="Backspace"||u.key==="Delete")&&o.wysiwyg.element.innerHTML!==""&&o.wysiwyg.element.childNodes.length===1&&o.wysiwyg.element.firstElementChild&&o.wysiwyg.element.firstElementChild.tagName==="P"&&o.wysiwyg.element.firstElementChild.childElementCount===0&&(o.wysiwyg.element.textContent===""||o.wysiwyg.element.textContent===`
|
|||
|
|
`)&&(o.wysiwyg.element.innerHTML="");var d=(0,j.zh)(o);if(u.key==="Backspace"&&(0,m.vU)()&&d.startContainer.textContent===`
|
|||
|
|
`&&d.startOffset===1&&(d.startContainer.textContent=""),Rn(o,d),Pn(o),!(u.key!=="ArrowDown"&&u.key!=="ArrowRight"&&u.key!=="Backspace"&&u.key!=="ArrowLeft"&&u.key!=="ArrowUp")){(u.key==="ArrowLeft"||u.key==="ArrowRight")&&o.hint.render(o);var f=(0,y.fb)(d.startContainer,"vditor-wysiwyg__preview");if(!f&&d.startContainer.nodeType!==3&&d.startOffset>0){var E=d.startContainer;E.classList.contains("vditor-wysiwyg__block")&&(f=E.lastElementChild)}if(f){var L=f.previousElementSibling;if(L.style.display==="none"){u.key==="ArrowDown"||u.key==="ArrowRight"?Cn(f,o):Cn(f,o,!1);return}var D=f.previousElementSibling;if(D.tagName==="PRE"&&(D=D.firstElementChild),u.key==="ArrowDown"||u.key==="ArrowRight"){var E=f.parentElement,_=Mn(E);if(_&&_.nodeType!==3){var F=_.querySelector(".vditor-wysiwyg__preview");if(F){Cn(F,o);return}}if(_.nodeType===3){for(;_.textContent.length===0&&_.nextSibling;)_=_.nextSibling;d.setStart(_,1)}else d.setStart(_.firstChild,0)}else d.selectNodeContents(D),d.collapse(!1)}}}})},i}(),Ud=function(){var i=function(o,s){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&(u[f]=d[f])},i(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");i(o,s);function u(){this.constructor=o}o.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}}(),Vd=function(i){Ud(o,i);function o(s,u){var d=i.call(this)||this;if(d.isDestroyed=!1,d.version=c.H,typeof s=="string"){if(u?u.cache?u.cache.id||(u.cache.id="vditor".concat(s)):u.cache={id:"vditor".concat(s)}:u={cache:{id:"vditor".concat(s)}},!document.getElementById(s))return d.showErrorTip("Failed to get element by id: ".concat(s)),d;s=document.getElementById(s)}var f=new jd(u),E=f.merge();if(E.i18n)window.VditorI18n=E.i18n,d.init(s,E);else if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(E.lang)){var L="vditorI18nScript",D=L+E.lang;document.querySelectorAll('head script[id^="'.concat(L,'"]')).forEach(function(_){_.id!==D&&document.head.removeChild(_)}),(0,b.G)("".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js"),D).then(function(){d.init(s,E)}).catch(function(_){d.showErrorTip("GET ".concat(E.cdn,"/dist/js/i18n/").concat(E.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");return d}return o.prototype.showErrorTip=function(s){var u=new tl;document.body.appendChild(u.element),u.show(s,0)},o.prototype.updateToolbarConfig=function(s){this.vditor.toolbar.updateConfig(this.vditor,s)},o.prototype.setTheme=function(s,u,d,f){this.vditor.options.theme=s,ve(this.vditor),u&&(this.vditor.options.preview.theme.current=u,(0,ce.Z)(u,f||this.vditor.options.preview.theme.path)),d&&(this.vditor.options.preview.hljs.style=d,(0,nl.Y)(d,this.vditor.options.cdn))},o.prototype.getValue=function(){return v(this.vditor)},o.prototype.getCurrentMode=function(){return this.vditor.currentMode},o.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},o.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},o.prototype.disabled=function(){T(this.vditor,["subToolbar","hint","popover"]),k(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},o.prototype.enable=function(){S(this.vditor.toolbar.elements,c.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")
|
|||
|
|
]`).replace("lheading",V2).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xS=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kS=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,G2=/^( {2,}|\\)\n(?!\s*$)/,SS=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fu=/[\p{P}\p{S}]/u,y1=/[\s\p{P}\p{S}]/u,K2=/[^\s\p{P}\p{S}]/u,ES=mn(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,y1).getRegex(),X2=/(?!~)[\p{P}\p{S}]/u,TS=/(?!~)[\s\p{P}\p{S}]/u,AS=/(?:[^\s\p{P}\p{S}]|~)/u,MS=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,Z2=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,CS=mn(Z2,"u").replace(/punct/g,fu).getRegex(),LS=mn(Z2,"u").replace(/punct/g,X2).getRegex(),Y2="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_S=mn(Y2,"gu").replace(/notPunctSpace/g,K2).replace(/punctSpace/g,y1).replace(/punct/g,fu).getRegex(),NS=mn(Y2,"gu").replace(/notPunctSpace/g,AS).replace(/punctSpace/g,TS).replace(/punct/g,X2).getRegex(),DS=mn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,K2).replace(/punctSpace/g,y1).replace(/punct/g,fu).getRegex(),RS=mn(/\\(punct)/,"gu").replace(/punct/g,fu).getRegex(),OS=mn(/^<(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(),IS=mn(v1).replace("(?:-->|$)","-->").getRegex(),HS=mn("^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",IS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,PS=mn(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Nc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),J2=mn(/^!?\[(label)\]\[(ref)\]/).replace("label",Nc).replace("ref",g1).getRegex(),Q2=mn(/^!?\[(ref)\](?:\[\])?/).replace("ref",g1).getRegex(),zS=mn("reflink|nolink(?!\\()","g").replace("reflink",J2).replace("nolink",Q2).getRegex(),w1={_backpedal:Fl,anyPunctuation:RS,autolink:OS,blockSkip:MS,br:G2,code:kS,del:Fl,emStrongLDelim:CS,emStrongRDelimAst:_S,emStrongRDelimUnd:DS,escape:xS,link:PS,nolink:Q2,punctuation:ES,reflink:J2,reflinkSearch:zS,tag:HS,text:SS,url:Fl},BS={...w1,link:mn(/^!?\[(label)\]\((.*?)\)/).replace("label",Nc).getRegex(),reflink:mn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nc).getRegex()},Np={...w1,emStrongRDelimAst:NS,emStrongLDelim:LS,url:mn(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},FS={...Np,br:mn(G2).replace("{2,}","*").getRegex(),text:mn(Np.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},R0={normal:b1,gfm:yS,pedantic:wS},vl={normal:w1,gfm:Np,breaks:FS,pedantic:BS},qS={"&":"&","<":"<",">":">",'"':"
|
|||
|
|
`).map(l=>{let h=l.match(n.other.beginningSpace);if(h===null)return l;let[c]=h;return c.length>=a.length?l.slice(a.length):l}).join(`
|
|||
|
|
`)}var Dc=class{constructor(t){Sn(this,"options");Sn(this,"rules");Sn(this,"lexer");this.options=t||is}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:bl(n,`
|
|||
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=$S(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=bl(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:bl(e[0],`
|
|||
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=bl(e[0],`
|
|||
|
|
`).split(`
|
|||
|
|
`),r="",a="",l=[];for(;n.length>0;){let h=!1,c=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))c.push(n[p]),h=!0;else if(!h)c.push(n[p]);else break;n=n.slice(p);let v=c.join(`
|
|||
|
|
`),b=v.replace(this.rules.other.blockquoteSetextReplace,`
|
|||
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|||
|
|
${v}`:v,a=a?`${a}
|
|||
|
|
${b}`:b;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,l,!0),this.lexer.state.top=g,n.length===0)break;let m=l.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.blockquote(w);l[l.length-1]=S,r=r.substring(0,r.length-x.raw.length)+S.raw,a=a.substring(0,a.length-x.text.length)+S.text;break}else if((m==null?void 0:m.type)==="list"){let x=m,w=x.raw+`
|
|||
|
|
`+n.join(`
|
|||
|
|
`),S=this.list(w);l[l.length-1]=S,r=r.substring(0,r.length-m.raw.length)+S.raw,a=a.substring(0,a.length-x.raw.length)+S.raw,n=w.substring(l.at(-1).raw.length).split(`
|
|||
|
|
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:a}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,a={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let l=this.rules.other.listItemRegex(n),h=!1;for(;t;){let p=!1,v="",b="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;v=e[0],t=t.substring(v.length);let g=e[2].split(`
|
|||
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,C=>" ".repeat(3*C.length)),m=t.split(`
|
|||
|
|
`,1)[0],x=!g.trim(),w=0;if(this.options.pedantic?(w=2,b=g.trimStart()):x?w=e[1].length+1:(w=e[2].search(this.rules.other.nonSpaceChar),w=w>4?1:w,b=g.slice(w),w+=e[1].length),x&&this.rules.other.blankLine.test(m)&&(v+=m+`
|
|||
|
|
`,t=t.substring(m.length+1),p=!0),!p){let C=this.rules.other.nextBulletRegex(w),A=this.rules.other.hrRegex(w),T=this.rules.other.fencesBeginRegex(w),M=this.rules.other.headingBeginRegex(w),y=this.rules.other.htmlBeginRegex(w);for(;t;){let N=t.split(`
|
|||
|
|
`,1)[0],z;if(m=N,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),z=m):z=m.replace(this.rules.other.tabCharGlobal," "),T.test(m)||M.test(m)||y.test(m)||C.test(m)||A.test(m))break;if(z.search(this.rules.other.nonSpaceChar)>=w||!m.trim())b+=`
|
|||
|
|
`+z.slice(w);else{if(x||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(g)||M.test(g)||A.test(g))break;b+=`
|
|||
|
|
`+m}!x&&!m.trim()&&(x=!0),v+=N+`
|
|||
|
|
`,t=t.substring(N.length+1),g=z.slice(w)}}a.loose||(h?a.loose=!0:this.rules.other.doubleBlankLine.test(v)&&(h=!0));let S=null,k;this.options.gfm&&(S=this.rules.other.listIsTask.exec(b),S&&(k=S[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),a.items.push({type:"list_item",raw:v,task:!!S,checked:k,loose:!1,text:b,tokens:[]}),a.raw+=v}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p=0;p<a.items.length;p++)if(this.lexer.state.top=!1,a.items[p].tokens=this.lexer.blockTokens(a.items[p].text,[]),!a.loose){let v=a.items[p].tokens.filter(g=>g.type==="space"),b=v.length>0&&v.some(g=>this.rules.other.anyLine.test(g.raw));a.loose=b}if(a.loose)for(let p=0;p<a.items.length;p++)a.items[p].loose=!0;return a}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:a}}}table(t){var h;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Bg(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(h=e[3])!=null&&h.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|||
|
|
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let c of r)this.rules.other.tableAlignRight.test(c)?l.align.push("right"):this.rules.other.tableAlignCenter.test(c)?l.align.push("center"):this.rules.other.tableAlignLeft.test(c)?l.align.push("left"):l.align.push(null);for(let c=0;c<n.length;c++)l.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:l.align[c]});for(let c of a)l.rows.push(Bg(c,l.header.length).map((p,v)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:l.align[v]})));return l}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|||
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=bl(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=jS(e[2],"()");if(l===-2)return;if(l>-1){let h=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,h).trim(),e[3]=""}}let r=e[2],a="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],a=l[3])}else a=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Fg(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=e[r.toLowerCase()];if(!a){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Fg(n,a,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let a=[...r[0]].length-1,l,h,c=a,p=0,v=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(v.lastIndex=0,e=e.slice(-1*t.length+a);(r=v.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(h=[...l].length,r[3]||r[4]){c+=h;continue}else if((r[5]||r[6])&&a%3&&!((a+h)%3)){p+=h;continue}if(c-=h,c>0)continue;h=Math.min(h,h+c+p);let b=[...r[0]][0].length,g=t.slice(0,a+r.index+b+h);if(Math.min(a,h)%2){let x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}let m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let e;if(e=this.rules.inline.url.exec(t)){let r,a;if(e[2]==="@")r=e[0],a="mailto:"+r;else{let l;do l=e[0],e[0]=((n=this.rules.inline._backpedal.exec(e[0]))==null?void 0:n[0])??"";while(l!==e[0]);r=e[0],e[1]==="www."?a="http://"+e[0]:a=e[0]}return{type:"link",raw:e[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Pa=class Dp{constructor(e){Sn(this,"tokens");Sn(this,"
|
|||
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){var a,l,h;for(this.options.pedantic&&(e=e.replace(Or.tabCharGlobal," ").replace(Or.spaceLine,""));e;){let c;if((l=(a=this.options.extensions)==null?void 0:a.block)!=null&&l.some(v=>(c=v.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(e)){e=e.substring(c.raw.length);let v=n.at(-1);c.raw.length===1&&v!==void 0?v.raw+=`
|
|||
|
|
`:n.push(c);continue}if(c=this.tokenizer.code(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(c=this.tokenizer.fences(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="paragraph"||(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.raw,this.inlineQueue.at(-1).src=v.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(e)){e=e.substring(c.raw.length),n.push(c);continue}let p=e;if((h=this.options.extensions)!=null&&h.startBlock){let v=1/0,b=e.slice(1),g;this.options.extensions.startBlock.forEach(m=>{g=m.call({lexer:this},b),typeof g=="number"&&g>=0&&(v=Math.min(v,g))}),v<1/0&&v>=0&&(p=e.substring(0,v+1))}if(this.state.top&&(c=this.tokenizer.paragraph(p))){let v=n.at(-1);r&&(v==null?void 0:v.type)==="paragraph"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c),r=p.length!==e.length,e=e.substring(c.raw.length);continue}if(c=this.tokenizer.text(e)){e=e.substring(c.raw.length);let v=n.at(-1);(v==null?void 0:v.type)==="text"?(v.raw+=(v.raw.endsWith(`
|
|||
|
|
`)?"":`
|
|||
|
|
`)+c.raw,v.text+=`
|
|||
|
|
`+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=v.text):n.push(c);continue}if(e){let v="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(v);break}else throw new Error(v)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){var c,p,v;let r=e,a=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)b.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let l=!1,h="";for(;e;){l||(h=""),l=!1;let b;if((p=(c=this.options.extensions)==null?void 0:c.inline)!=null&&p.some(m=>(b=m.call({lexer:this},e,n))?(e=e.substring(b.raw.length),n.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let m=n.at(-1);b.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(b=this.tokenizer.emStrong(e,r,h)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.del(e)){e=e.substring(b.raw.length),n.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),n.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),n.push(b);continue}let g=e;if((v=this.options.extensions)!=null&&v.startInline){let m=1/0,x=e.slice(1),w;this.options.extensions.startInline.forEach(S=>{w=S.call({lexer:this},x),typeof w=="number"&&w>=0&&(m=Math.min(m,w))}),m<1/0&&m>=0&&(g=e.substring(0,m+1))}if(b=this.tokenizer.inlineText(g)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(h=b.raw.slice(-1)),l=!0;let m=n.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=b.raw,m.text+=b.text):n.push(b);continue}if(e){let m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return n}},Rc=class{constructor(t){Sn(this,"options");Sn(this,"parser");this.options=t||is}space(t){return""}code({text:t,lang:e,escaped:n}){var l;let r=(l=(e||"").match(Or.notSpaceStart))==null?void 0:l[0],a=t.replace(Or.endingNewline,"")+`
|
|||
|
|
`;return r?'<pre><code class="language-'+Yi(r)+'">'+(n?a:Yi(a,!0))+`</code></pre>
|
|||
|
|
`:"<pre><code>"+(n?a:Yi(a,!0))+`</code></pre>
|
|||
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|||
|
|
${this.parser.parse(t)}</blockquote>
|
|||
|
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|||
|
|
`}hr(t){return`<hr>
|
|||
|
|
`}list(t){let e=t.ordered,n=t.start,r="";for(let h=0;h<t.items.length;h++){let c=t.items[h];r+=this.listitem(c)}let a=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+a+l+`>
|
|||
|
|
`+r+"</"+a+`>
|
|||
|
|
`}listitem(t){var n;let e="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?((n=t.tokens[0])==null?void 0:n.type)==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Yi(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|||
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|||
|
|
`}table(t){let e="",n="";for(let a=0;a<t.header.length;a++)n+=this.tablecell(t.header[a]);e+=this.tablerow({text:n});let r="";for(let a=0;a<t.rows.length;a++){let l=t.rows[a];n="";for(let h=0;h<l.length;h++)n+=this.tablecell(l[h]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|||
|
|
<thead>
|
|||
|
|
`+e+`</thead>
|
|||
|
|
`+r+`</table>
|
|||
|
|
`}tablerow({text:t}){return`<tr>
|
|||
|
|
${t}</tr>
|
|||
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|||
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Yi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),a=zg(t);if(a===null)return r;t=a;let l='<a href="'+t+'"';return e&&(l+=' title="'+Yi(e)+'"'),l+=">"+r+"</a>",l}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let a=zg(t);if(a===null)return Yi(n);t=a;let l=`<img src="${t}" alt="${n}"`;return e&&(l+=` title="${Yi(e)}"`),l+=">",l}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Yi(t.text)}},x1=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""}},za=class Rp{constructor(e){Sn(this,"options");Sn(this,"renderer");Sn(this,"textRenderer");this.options=e||is,this.options.renderer=this.options.renderer||new Rc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new x1}static parse(e,n){return new Rp(n).parse(e)}static parseInline(e,n){return new Rp(n).parseInline(e)}parse(e,n=!0){var a,l;let r="";for(let h=0;h<e.length;h++){let c=e[h];if((l=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&l[c.type]){let v=c,b=this.options.extensions.renderers[v.type].call({parser:this},v);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(v.type)){r+=b||"";continue}}let p=c;switch(p.type){case"space":{r+=this.renderer.space(p);continue}case"hr":{r+=this.renderer.hr(p);continue}case"heading":{r+=this.renderer.heading(p);continue}case"code":{r+=this.renderer.code(p);continue}case"table":{r+=this.renderer.table(p);continue}case"blockquote":{r+=this.renderer.blockquote(p);continue}case"list":{r+=this.renderer.list(p);continue}case"html":{r+=this.renderer.html(p);continue}case"def":{r+=this.renderer.def(p);continue}case"paragraph":{r+=this.renderer.paragraph(p);continue}case"text":{let v=p,b=this.renderer.text(v);for(;h+1<e.length&&e[h+1].type==="text";)v=e[++h],b+=`
|
|||
|
|
`+this.renderer.text(v);n?r+=this.renderer.paragraph({type:"paragraph",raw:b,text:b,tokens:[{type:"text",raw:b,text:b,escaped:!0}]}):r+=b;continue}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return r}parseInline(e,n=this.renderer){var a,l;let r="";for(let h=0;h<e.length;h++){let c=e[h];if((l=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&l[c.type]){let v=this.options.extensions.renderers[c.type].call({parser:this},c);if(v!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(c.type)){r+=v||"";continue}}let p=c;switch(p.type){case"escape":{r+=n.text(p);break}case"html":{r+=n.html(p);break}case"link":{r+=n.link(p);break}case"image":{r+=n.image(p);break}case"strong":{r+=n.strong(p);break}case"em":{r+=n.em(p);break}case"codespan":{r+=n.codespan(p);break}case"br":{r+=n.br(p);break}case"del":{r+=n.del(p);break}case"text":{r+=n.text(p);break}default:{let v='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return r}},Kh,ec=(Kh=class{constructor(t){Sn(this,"options");Sn(this,"block");this.options=t||is}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Pa.lex:Pa.lexInline}provideParser(){return this.block?za.parse:za.parseInline}},Sn(Kh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Kh),US=class{constructor(...t){Sn(this,"defaults",p1());Sn(this,"options",this.setOptions);Sn(this,"parse",this.parseMarkdown(!0));Sn(this,"parseInline",this.parseMarkdown(!1));Sn(this,"Parser",za);Sn(this,"Renderer",Rc);Sn(this,"TextRenderer",x1);Sn(this,"Lexer",Pa);Sn(this,"Tokenizer",Dc);Sn(this,"Hooks",ec);this.use(...t)}walkTokens(t,e){var r,a;let n=[];for(let l of t)switch(n=n.concat(e.call(this,l)),l.type){case"table":{let h=l;for(let c of h.header)n=n.concat(this.walkTokens(c.tokens,e));for(let c of h.rows)for(let p of c)n=n.concat(this.walkTokens(p.tokens,e));break}case"list":{let h=l;n=n.concat(this.walkTokens(h.items,e));break}default:{let h=l;(a=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&a[h.type]?this.defaults.extensions.childTokens[h.type].forEach(c=>{let p=h[c].flat(1/0);n=n.concat(this.walkTokens(p,e))}):h.tokens&&(n=n.concat(this.walkTokens(h.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let l=e.renderers[a.name];l?e.renderers[a.name]=function(...h){let c=a.renderer.apply(this,h);return c===!1&&(c=l.apply(this,h)),c}:e.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[a.level];l?l.unshift(a.tokenizer):e[a.level]=[a.tokenizer],a.start&&(a.level==="block"?e.startBlock?e.startBlock.push(a.start):e.startBlock=[a.start]:a.level==="inline"&&(e.startInline?e.startInline.push(a.start):e.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(e.childTokens[a.name]=a.childTokens)}),r.extensions=e),n.renderer){let a=this.defaults.renderer||new Rc(this.defaults);for(let l in n.renderer){if(!(l in a))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let h=l,c=n.renderer[h],p=a[h];a[h]=(...v)=>{let b=c.apply(a,v);return b===!1&&(b=p.apply(a,v)),b||""}}r.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Dc(this.defaults);for(let l in n.tokenizer){if(!(l in a))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let h=l,c=n.tokenizer[h],p=a[h];a[h]=(...v)=>{let b=c.apply(a,v);return b===!1&&(b=p.apply(a,v)),b}}r.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new ec;for(let l in n.hooks){if(!(l in a))throw new Error(`hook '${l}' does not exist`);if(["options","block"].include
|
|||
|
|
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Yi(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Jo=new US;function rn(t,e){return Jo.parse(t,e)}rn.options=rn.setOptions=function(t){return Jo.setOptions(t),rn.defaults=Jo.defaults,$2(rn.defaults),rn};rn.getDefaults=p1;rn.defaults=is;rn.use=function(...t){return Jo.use(...t),rn.defaults=Jo.defaults,$2(rn.defaults),rn};rn.walkTokens=function(t,e){return Jo.walkTokens(t,e)};rn.parseInline=Jo.parseInline;rn.Parser=za;rn.parser=za.parse;rn.Renderer=Rc;rn.TextRenderer=x1;rn.Lexer=Pa;rn.lexer=Pa.lex;rn.Tokenizer=Dc;rn.Hooks=ec;rn.parse=rn;rn.options;rn.setOptions;rn.use;rn.walkTokens;rn.parseInline;za.parse;Pa.lex;var e3={exports:{}};(function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|||
|
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|||
|
|
*
|
|||
|
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|||
|
|
* @author Lea Verou <https://lea.verou.me>
|
|||
|
|
* @namespace
|
|||
|
|
* @public
|
|||
|
|
*/var n=function(r){var a=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,h={},c={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function A(T){return T instanceof p?new p(T.type,A(T.content),T.alias):Array.isArray(T)?T.map(A):T.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(A){return Object.prototype.toString.call(A).slice(8,-1)},objId:function(A){return A.__id||Object.defineProperty(A,"__id",{value:++l}),A.__id},clone:function A(T,M){M=M||{};var y,N;switch(c.util.type(T)){case"Object":if(N=c.util.objId(T),M[N])return M[N];y={},M[N]=y;for(var z in T)T.hasOwnProperty(z)&&(y[z]=A(T[z],M));return y;case"Array":return N=c.util.objId(T),M[N]?M[N]:(y=[],M[N]=y,T.forEach(function(q,P){y[P]=A(q,M)}),y);default:return T}},getLanguage:function(A){for(;A;){var T=a.exec(A.className);if(T)return T[1].toLowerCase();A=A.parentElement}return"none"},setLanguage:function(A,T){A.className=A.className.replace(RegExp(a,"gi"),""),A.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT"&&1<2)return document.currentScript;try{throw new Error}catch(y){var A=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(A){var T=document.getElementsByTagName("script");for(var M in T)if(T[M].src==A)return T[M]}return null}},isActive:function(A,T,M){for(var y="no-"+T;A;){var N=A.classList;if(N.contains(T))return!0;if(N.contains(y))return!1;A=A.parentElement}return!!M}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(A,T){var M=c.util.clone(c.languages[A]);for(var y in T)M[y]=T[y];return M},insertBefore:function(A,T,M,y){y=y||c.languages;var N=y[A],z={};for(var q in N)if(N.hasOwnProperty(q)){if(q==T)for(var P in M)M.hasOwnProperty(P)&&(z[P]=M[P]);M.hasOwnProperty(q)||(z[q]=N[q])}var Y=y[A];return y[A]=z,c.languages.DFS(c.languages,function(te,ue){ue===Y&&te!=A&&(this[te]=z)}),z},DFS:function A(T,M,y,N){N=N||{};var z=c.util.objId;for(var q in T)if(T.hasOwnProperty(q)){M.call(T,q,T[q],y||q);var P=T[q],Y=c.util.type(P);Y==="Object"&&!N[z(P)]?(N[z(P)]=!0,A(P,M,null,N)):Y==="Array"&&!N[z(P)]&&(N[z(P)]=!0,A(P,M,q,N))}}},plugins:{},highlightAll:function(A,T){c.highlightAllUnder(document,A,T)},highlightAllUnder:function(A,T,M){var y={callback:M,container:A,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};c.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),c.hooks.run("before-all-elements-highlight",y);for(var N=0,z;z=y.elements[N++];)c.highlightElement(z,T===!0,y.callback)},highlightElement:function(A,T,M){var y=c.util.getLanguage(A),N=c.languages[y];c.util.setLanguage(A,y);var z=A.parentElement;z&&z.nodeName.toLowerCase()==="pre"&&c.util.setLanguage(z,y);var q=A.textContent,P={element:A,language:y,grammar:N,code:q};function Y(ue){P.highlightedCode=ue,c.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,c.hooks.run("after-highlight",P),c.hooks.run("complete",P),M&&M.call(P.element)}if(c.hooks.run("before-sanity-check",P),z=P.element.parentElement,z&&z.nodeName.toLowerCase()==="pre"&&!z.hasAttribute("tabindex")&&z.setAttribute("tabindex","0"),!P.code){c.hooks.run("complete",P),M&&M.call(P.element);return}if(c.hooks.run("before-highlight",P),!P.grammar){Y(c.util.encode(P.code));return}if(T&&r.Worker){var te=new Worker(c.filename);te.onmessage=function(ue){Y(ue.data)},te.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else Y(c.highlight(P.code,P.grammar,P.language))},highlight:function(A,T,M){var y={code:A,grammar:T,language:M};if(c.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=c.tokenize(y.code,y.grammar),c.hooks.run("after-tokenize",y),p.stringify(c.util.encode(y.tokens),y.language)},tokenize:function(A,T){var M=T.rest;if(M){for(var y in M)T[y]=M[y];delete T.rest}var N=new g;return m(N,N.head,A)
|
|||
|
|
`),k.hasAttribute("data-start")||k.setAttribute("data-start",String(P+1))}C.textContent=N,n.highlightElement(C)},function(N){k.setAttribute(c,b),C.textContent=N})}}),n.plugins.fileHighlight={highlight:function(k){for(var C=(k||document).querySelectorAll(g),A=0,T;T=C[A++];)n.highlightElement(T)}};var w=!1;n.fileHighlight=function(){w||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),w=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(e3);var VS=e3.exports;const qg=Jv(VS);class ii{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new ii(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class xi{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new xi(n,ii.range(this,e))}}class et{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,a,l,h=n&&n.loc;if(h&&h.start<=h.end){var c=h.lexer.input;a=h.start,l=h.end,a===c.length?r+=" at end of input: ":r+=" at position "+(a+1)+": ";var p=c.slice(a,l).replace(/[^]/g,"$&̲"),v;a>15?v="…"+c.slice(a-15,a):v=c.slice(0,a);var b;l+15<c.length?b=c.slice(l,l+15)+"…":b=c.slice(l),r+=v+p+b}var g=new Error(r);return g.name="ParseError",g.__proto__=et.prototype,g.position=a,a!=null&&l!=null&&(g.length=l-a),g.rawMessage=e,g}}et.prototype.__proto__=Error.prototype;var WS=function(e,n){return e.indexOf(n)!==-1},GS=function(e,n){return e===void 0?n:e},KS=/([A-Z])/g,XS=function(e){return e.replace(KS,"-$1").toLowerCase()},ZS={"&":"&",">":">","<":"<",'"':""","'":"'"},YS=/[&><"']/g;function JS(t){return String(t).replace(YS,e=>ZS[e])}var t3=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},QS=function(e){var n=t3(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},eE=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},tE=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},At={contains:WS,deflt:GS,escape:JS,hyphenate:XS,getBaseElem:t3,isCharacterBox:QS,protocolFromUrl:tE},tc={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-a
|
|||
|
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|||
|
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|||
|
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|||
|
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|||
|
|
c69,-144,104.5,-217.7,106.5,-221
|
|||
|
|
l`+e/2.075+" -"+e+`
|
|||
|
|
c5.3,-9.3,12,-14,20,-14
|
|||
|
|
H400000v`+(40+e)+`H845.2724
|
|||
|
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|||
|
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|||
|
|
M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},dE=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119
|
|||
|
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|||
|
|
c340,-704.7,510.7,-1060.3,512,-1067
|
|||
|
|
l`+e/2.084+" -"+e+`
|
|||
|
|
c4.7,-7.3,11,-11,19,-11
|
|||
|
|
H40000v`+(40+e)+`H1012.3
|
|||
|
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|||
|
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|||
|
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|||
|
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|||
|
|
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},hE=function(e,n){return"M983 "+(10+e+n)+`
|
|||
|
|
l`+e/3.13+" -"+e+`
|
|||
|
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|||
|
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|||
|
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|||
|
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|||
|
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|||
|
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|||
|
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|||
|
|
M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},pE=function(e,n){return"M424,"+(2398+e+n)+`
|
|||
|
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|||
|
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|||
|
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|||
|
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|||
|
|
l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000
|
|||
|
|
v`+(40+e)+`H1014.6
|
|||
|
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|||
|
|
c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+`
|
|||
|
|
h400000v`+(40+e)+"h-400000z"},fE=function(e,n){return"M473,"+(2713+e+n)+`
|
|||
|
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+`
|
|||
|
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|||
|
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|||
|
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|||
|
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|||
|
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|||
|
|
606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},mE=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},gE=function(e,n,r){var a=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+`
|
|||
|
|
H742v`+a+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|||
|
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|||
|
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|||
|
|
219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},vE=function(e,n,r){n=1e3*n;var a="";switch(e){case"sqrtMain":a=uE(n,us);break;case"sqrtSize1":a=dE(n,us);break;case"sqrtSize2":a=hE(n,us);break;case"sqrtSize3":a=pE(n,us);break;case"sqrtSize4":a=fE(n,us);break;case"sqrtTall":a=gE(n,us,r)}return a},bE=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},jg={doubleleftarrow:`M262 157
|
|||
|
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|||
|
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|||
|
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|||
|
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|||
|
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|||
|
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|||
|
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|||
|
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|||
|
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|||
|
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|||
|
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|||
|
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|||
|
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|||
|
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|||
|
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|||
|
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|||
|
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|||
|
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|||
|
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|||
|
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|||
|
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|||
|
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|||
|
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|||
|
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|||
|
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|||
|
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|||
|
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|||
|
|
435 0h399565z`,leftgroupunder:`M400000 262
|
|||
|
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|||
|
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|||
|
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|||
|
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|||
|
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|||
|
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|||
|
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|||
|
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|||
|
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|||
|
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|||
|
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|||
|
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|||
|
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|||
|
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|||
|
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|||
|
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|||
|
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|||
|
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|||
|
|
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|||
|
|
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|||
|
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|||
|
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|||
|
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|||
|
|
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|||
|
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|||
|
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|||
|
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|||
|
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|||
|
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|||
|
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|||
|
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|||
|
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|||
|
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|||
|
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|||
|
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|||
|
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|||
|
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|||
|
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|||
|
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|||
|
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|||
|
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|||
|
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|||
|
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|||
|
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|||
|
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|||
|
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|||
|
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|||
|
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|||
|
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|||
|
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|||
|
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|||
|
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|||
|
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|||
|
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|||
|
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|||
|
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|||
|
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|||
|
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|||
|
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|||
|
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|||
|
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|||
|
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|||
|
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|||
|
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|||
|
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|||
|
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|||
|
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|||
|
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|||
|
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|||
|
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|||
|
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|||
|
|
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|||
|
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|||
|
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|||
|
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|||
|
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|||
|
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|||
|
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|||
|
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|||
|
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|||
|
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|||
|
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|||
|
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|||
|
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|||
|
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|||
|
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|||
|
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|||
|
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|||
|
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|||
|
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|||
|
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|||
|
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|||
|
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|||
|
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|||
|
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|||
|
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|||
|
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|||
|
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|||
|
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|||
|
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|||
|
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|||
|
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|||
|
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|||
|
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|||
|
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|||
|
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|||
|
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|||
|
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|||
|
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|||
|
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|||
|
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|||
|
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|||
|
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|||
|
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|||
|
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|||
|
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|||
|
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|||
|
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|||
|
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|||
|
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|||
|
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|||
|
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|||
|
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|||
|
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|||
|
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|||
|
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|||
|
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|||
|
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|||
|
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|||
|
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|||
|
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|||
|
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|||
|
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|||
|
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|||
|
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|||
|
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},yE=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84
|
|||
|
|
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|||
|
|
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|||
|
|
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|||
|
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|||
|
|
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|||
|
|
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|||
|
|
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|||
|
|
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|||
|
|
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|||
|
|
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|||
|
|
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|||
|
|
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|||
|
|
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|||
|
|
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|||
|
|
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|||
|
|
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|||
|
|
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|||
|
|
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|||
|
|
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|||
|
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|||
|
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|||
|
|
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|||
|
|
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class c0{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return At.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){for(var e="",n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e}toText(){var e=n=>n.toText();return this.children.map(e).join("")}}var oa={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.755
|
|||
|
|
`+z+" children.");for(var te=0;te<z;te++){var ue=new ko(T[te]),Le=new Ka([ue],{width:"400em",height:lt(N),viewBox:"0 0 "+c+" "+y,preserveAspectRatio:P[te]+" slice"}),qe=Me.makeSvgSpan([q[te]],[Le],n);if(z===1)return{span:qe,minWidth:M,height:N};qe.style.height=lt(N),C.push(qe)}return{span:Me.makeSpan(["stretchy"],C,n),minWidth:M,height:N}}}var{span:a,minWidth:l,height:h}=r();return a.height=h,a.style.height=lt(h),l>0&&(a.style.minWidth=lt(l)),a},iT=function(e,n,r,a,l){var h,c=e.height+e.depth+r+a;if(/fbox|color|angl/.test(n)){if(h=Me.makeSpan(["stretchy",n],[],l),n==="fbox"){var p=l.color&&l.getColor();p&&(h.style.borderColor=p)}}else{var v=[];/^[bx]cancel$/.test(n)&&v.push(new Hp({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&v.push(new Hp({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var b=new Ka(v,{width:"100%",height:lt(c)});h=Me.makeSvgSpan([],[b],l)}return h.height=c,h.style.height=lt(c),h},Za={encloseSpan:iT,mathMLnode:eT,svgSpan:rT};function Gt(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function L1(t){var e=vu(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function vu(t){return t&&(t.type==="atom"||LE.hasOwnProperty(t.type))?t:null}var _1=(t,e)=>{var n,r,a;t&&t.type==="supsub"?(r=Gt(t.base,"accent"),n=r.base,t.base=n,a=ME(tn(t,e)),t.base=r):(r=Gt(t,"accent"),n=r.base);var l=tn(n,e.havingCrampedStyle()),h=r.isShifty&&At.isCharacterBox(n),c=0;if(h){var p=At.getBaseElem(n),v=tn(p,e.havingCrampedStyle());c=Wg(v).skew}var b=r.label==="\\c",g=b?l.height+l.depth:Math.min(l.height,e.fontMetrics().xHeight),m;if(r.isStretchy)m=Za.svgSpan(r,e),m=Me.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:c>0?{width:"calc(100% - "+lt(2*c)+")",marginLeft:lt(2*c)}:void 0}]},e);else{var x,w;r.label==="\\vec"?(x=Me.staticSvg("vec",e),w=Me.svgData.vec[1]):(x=Me.makeOrd({mode:r.mode,text:r.label},e,"textord"),x=Wg(x),x.italic=0,w=x.width,b&&(g+=x.depth)),m=Me.makeSpan(["accent-body"],[x]);var S=r.label==="\\textcircled";S&&(m.classes.push("accent-full"),g=l.height);var k=c;S||(k-=w/2),m.style.left=lt(k),r.label==="\\textcircled"&&(m.style.top=".2em"),m=Me.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:-g},{type:"elem",elem:m}]},e)}var C=Me.makeSpan(["mord","accent"],[m],e);return a?(a.children[0]=C,a.height=Math.max(C.height,a.height),a.classes[0]="mord",a):C},v3=(t,e)=>{var n=t.isStretchy?Za.mathMLnode(t.label):new Je.MathNode("mo",[Ai(t.label,t.mode)]),r=new Je.MathNode("mover",[An(t.base,e),n]);return r.setAttribute("accent","true"),r},aT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));pt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=zc(e[0]),r=!aT.test(t.funcName),a=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:_1,mathmlBuilder:v3});pt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:_1,mathmlBuilder:v3});pt({type:"accentUnder",names:["\\underle
|
|||
|
|
]`,DT="\\\\[a-zA-Z@]+",RT="\\\\[^\uD800-\uDFFF]",OT="("+DT+")"+U3+"*",IT=`\\\\(
|
|||
|
|
|[ \r ]+
|
|||
|
|
?)[ \r ]*`,jp="[̀-ͯ]",HT=new RegExp(jp+"+$"),PT="("+U3+"+)|"+(IT+"|")+"([!-\\[\\]-‧-豈-]"+(jp+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(jp+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+OT)+("|"+RT+")");class v4{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(PT,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new xi("EOF",new ii(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new et("Unexpected character: '"+e[n]+"'",new xi(e[n],new ii(this,n,n+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[a]===14){var l=e.indexOf(`
|
|||
|
|
`,this.tokenRegex.lastIndex);return l===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=l+1,this.lex()}return new xi(a,new ii(this,n,this.tokenRegex.lastIndex))}}class zT{constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new et("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var l=this.undefStack[this.undefStack.length-1];l&&!l.hasOwnProperty(e)&&(l[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var BT=R3;K("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});K("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});K("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});K("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});K("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});K("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");K("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var b4={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};K("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new et("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=b4[e.text],r==null||r>=n)throw new et("Invalid base-"+n+" digit "+e.text);for(var a;(a=b4[t.future().text])!=null&&a<n;)r*=n,r+=a,t.popToken()}return"\\@char{"+r+"}"});var z1=(t,e,n,r)=>{var a=t.consumeArg().tokens;if(a.length!==1)throw new et("\\newcommand's first argument must be a macro name");var l=a[0].text,h=t.isDefined(l);if(h&&!e)throw new et("\\newcommand{"+l+"} attempting to redefine "+(l+"; use \\renewcommand"));if(!h&&!n)throw new et("\\renewcommand{"+l+"} when command "+l+" does not yet exist; use \\newcommand");var c=0;if(a=t.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var p="",v=t.expandNextToken();v.text!=="]"&&v.text!=="EOF";)p+=v.text,v=t.expandNextToken();if(!p.match(/^\s*[0-9]+\s*$/))throw new et("Invalid number of arguments: "+p);c=parseInt(p),a=t.consumeArg().tokens}return h&&r||t.macros.set(l,{tokens:a,numArgs:c}),""};K("\\newcommand",t=>z1(t,!1,!0,!1));K("\\renewcommand",t=>z1(t,!0,!1,!1));K("\\providecommand",t=>z1(t,!0,!0,!0));K("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});K("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});K("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),po[n],Dn.math[n],Dn.text[n]),""});K("\\bgroup","{");K("\\egroup","}");K("~","\\nobreakspace");K("\\lq","`");K("\\rq","'");K("\\aa","\\r a");K("\\AA","\\r A");K("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");K("\\copyright","\\TextOrMath{
|
|||
|
|
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:a}}x4.hasOwnProperty(n[0])&&!Dn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',e),n=x4[n[0]]+n.slice(1));var l=HT.exec(n);l&&(n=n.substring(0,l.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var h;if(Dn[this.mode][n]){this.settings.strict&&this.mode==="math"&&Pp.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var c=Dn[this.mode][n].group,p=ii.range(e),v;if(CE.hasOwnProperty(c)){var b=c;v={type:"atom",mode:this.mode,family:b,loc:p,text:n}}else v={type:c,mode:this.mode,loc:p,text:n};h=v}else if(n.charCodeAt(0)>=128)this.settings.strict&&(n3(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),h={type:"textord",mode:"text",loc:ii.range(e),text:n};else return null;if(this.consume(),l)for(var g=0;g<l[0].length;g++){var m=l[0][g];if(!zh[m])throw new et("Unknown accent ' "+m+"'",e);var x=zh[m][this.mode]||zh[m].text;if(!x)throw new et("Accent "+m+" unsupported in "+this.mode+" mode",e);h={type:"accent",mode:this.mode,loc:ii.range(e),label:x,isStretchy:!1,isShifty:!0,base:h}}return h}}xu.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var F1=function(e,n){if(!(typeof e=="string"||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new xu(e,n);delete r.gullet.macros.current["\\df@tag"];var a=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new et("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:r.subparse([new xi("\\df@tag")])}]}return a},K3=function(e,n,r){n.textContent="";var a=q1(e,r).toNode();n.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),K3=function(){throw new et("KaTeX doesn't work in quirks mode.")});var qT=function(e,n){var r=q1(e,n).toMarkup();return r},jT=function(e,n){var r=new k1(n);return F1(e,r)},X3=function(e,n,r){if(r.throwOnError||!(e instanceof et))throw e;var a=Me.makeSpan(["katex-error"],[new Ti(n)]);return a.setAttribute("title",e.toString()),a.setAttribute("style","color:"+r.errorColor),a},q1=function(e,n){var r=new k1(n);try{var a=F1(e,r);return YE(a,e,r)}catch(l){return X3(l,e,r)}},$T=function(e,n){var r=new k1(n);try{var a=F1(e,r);return JE(a,e,r)}catch(l){return X3(l,e,r)}},UT="0.16.22",VT={Span:u0,Anchor:T1,SymbolNode:Ti,SvgNode:Ka,PathNode:ko,LineNode:Hp},k4={version:UT,render:K3,renderToString:qT,ParseError:et,SETTINGS_SCHEMA:tc,__parse:jT,__renderToDomTree:q1,__renderToHTMLTree:$T,__setFontMetrics:wE,__defineSymbol:O,__defineFunction:pt,__defineMacro:K,__domTree:VT};/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries:Z3,setPrototypeOf:S4,isFrozen:WT,getPrototypeOf:GT,getOwnPropertyDescriptor:KT}=Object;let{freeze:Hr,seal:Mi,create:$p}=Object,{apply:Up,construct:Vp}=typeof Reflect<"u"&&Reflect;Hr||(Hr=function(e){return e});Mi||(Mi=function(e){return e});Up||(Up=function(e,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l<r;l++)a[l-2]=arguments[l];return e.apply(n,a)});Vp||(Vp=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new e(...r)});const $0=Pr(Array.prototype.forEach),XT=Pr(Array.prototype.lastIndexOf),E4=Pr(Array.prototype.pop),yl=Pr(Array.prototype.push),ZT=Pr(Array.prototype.splice),rc=Pr(String.prot
|
|||
|
|
`+_e),W&&$0([ue,Le,qe],le=>{_e=wl(_e,le," ")}),M&&We?M.createHTML(_e):_e},e.setConfig=function(){let vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Li(vt),ce=!0},e.clearConfig=function(){an=null,ce=!1},e.isValidAttribute=function(vt,he,B){an||Li({});const V=zn(vt),ee=zn(he);return di(V,ee,B)},e.addHook=function(vt,he){typeof he=="function"&&yl(te[vt],he)},e.removeHook=function(vt,he){if(he!==void 0){const B=XT(te[vt],he);return B===-1?void 0:ZT(te[vt],B,1)[0]}return E4(te[vt])},e.removeHooks=function(vt){te[vt]=[]},e.removeAllHooks=function(){te=_4()},e}var pA=Q3();Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{patter
|
|||
|
|
`),n=[];let r=!1;const a=l=>(l.replace(/\\\|/g,"").match(/\|/g)||[]).length>=2;for(let l=0;l<e.length;l++){let h=e[l];if(/^\s*```/.test(h)){r=!r,n.push(h);continue}if(r){n.push(h);continue}if(a(h)){const c=h.replace(/^\t|^ {1,4}/,"").trim(),p=l+1<e.length?e[l+1]:"",v=/^\s*\|?\s*[:\-\| ]+\|?\s*$/.test(p),b=c.split("|").filter(g=>g.trim()!=="").length;if(!v&&b>=2){const g="|"+Array.from({length:b}).map(()=>" --- ").join("|")+"|";n.push(c),n.push(g),p&&!/^\s*```/.test(p)&&(n.push(D4(p,b)),l++);continue}if(n.push(c),v){const g="|"+Array.from({length:b}).map(()=>" --- ").join("|")+"|";n.push(g),l++;let m=l+0;for(;m+1<=e.length-1&&a(e[m+1]);)m++;for(let x=l+1;x<=m;x++)n.push(D4(e[x],b));l=m;continue}}n.push(h)}return n.join(`
|
|||
|
|
`)},D4=(t,e)=>{const n=t.replace(/^\t|^ {1,4}/,"").split("|"),r=n.filter((a,l)=>!(l===0&&a.trim()==="")&&!(l===n.length-1&&a.trim()===""));for(;r.length<e;)r.push(" ");return"|"+r.slice(0,e).map(a=>" "+a.trim()+" ").join("|")+"|"},R4=t=>{let e=t.replace(/<table>/g,'<table class="markdown-table">').replace(/<pre><code/g,'<pre class="markdown-code"><code');const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("pre code").forEach(a=>{const l=a.className.match(/language-(\w+)/);if(l)try{a.innerHTML=qg.highlight(a.textContent,qg.languages[l[1]],l[1])}catch(h){console.warn("语法高亮失败:",h)}}),n.innerHTML},bA=t=>{if(!t||typeof t!="string")return!1;const e=t.split(`
|
|||
|
|
`);let n=!1,r=!1;for(const h of e){const c=h.trim();c.includes("|")&&c.split("|").length>=3&&(n=!0),c.includes("|")&&c.includes("-")&&/^[\s\|\-\:]+$/.test(c)&&(r=!0)}const a=(t.match(/\|/g)||[]).length,l=a>=6;return n&&r||n&&l||n&&a>=4},yA=t=>!t||typeof t!="string"?!1:bA(t)?!0:[/#{1,6}\s+/,/\*\*.*?\*\*/,/\*.*?\*/,/`.*?`/,/```[\s\S]*?```/,/^\s*[-*+]\s+/m,/^\s*\d+\.\s+/m,/\[.*?\]\(.*?\)/,/!\[.*?\]\(.*?\)/,/\$\$.*?\$\$/,/\$.*?\$/].some(n=>n.test(t)),El=t=>{if(!t||typeof t!="string")return t||"";const e=yA(t),n=t.includes("|")&&t.includes("-");return e||n?(console.log("🎯 同步渲染Markdown内容"),j1(t)):t};function tb(t,e){return function(){return t.apply(e,arguments)}}const{toString:wA}=Object.prototype,{getPrototypeOf:$1}=Object,{iterator:ku,toStringTag:nb}=Symbol,Su=(t=>e=>{const n=wA.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),$i=t=>(t=t.toLowerCase(),e=>Su(e)===t),Eu=t=>e=>typeof e===t,{isArray:Os}=Array,Yl=Eu("undefined");function h0(t){return t!==null&&!Yl(t)&&t.constructor!==null&&!Yl(t.constructor)&&Ur(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const rb=$i("ArrayBuffer");function xA(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&rb(t.buffer),e}const kA=Eu("string"),Ur=Eu("function"),ib=Eu("number"),p0=t=>t!==null&&typeof t=="object",SA=t=>t===!0||t===!1,ic=t=>{if(Su(t)!=="object")return!1;const e=$1(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(nb in t)&&!(ku in t)},EA=t=>{if(!p0(t)||h0(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},TA=$i("Date"),AA=$i("File"),MA=$i("Blob"),CA=$i("FileList"),LA=t=>p0(t)&&Ur(t.pipe),_A=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Ur(t.append)&&((e=Su(t))==="formdata"||e==="object"&&Ur(t.toString)&&t.toString()==="[object FormData]"))},NA=$i("URLSearchParams"),[DA,RA,OA,IA]=["ReadableStream","Request","Response","Headers"].map($i),HA=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function f0(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,a;if(typeof t!="object"&&(t=[t]),Os(t))for(r=0,a=t.length;r<a;r++)e.call(null,t[r],r,t);else{if(h0(t))return;const l=n?Object.getOwnPropertyNames(t):Object.keys(t),h=l.length;let c;for(r=0;r<h;r++)c=l[r],e.call(null,t[c],c,t)}}function ab(t,e){if(h0(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,a;for(;r-- >0;)if(a=n[r],e===a.toLowerCase())return a;return null}const Wo=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ob=t=>!Yl(t)&&t!==Wo;function Wp(){const{caseless:t}=ob(this)&&this||{},e={},n=(r,a)=>{const l=t&&ab(e,a)||a;ic(e[l])&&ic(r)?e[l]=Wp(e[l],r):ic(r)?e[l]=Wp({},r):Os(r)?e[l]=r.slice():e[l]=r};for(let r=0,a=arguments.length;r<a;r++)arguments[r]&&f0(arguments[r],n);return e}const PA=(t,e,n,{allOwnKeys:r}={})=>(f0(e,(a,l)=>{n&&Ur(a)?t[l]=tb(a,n):t[l]=a},{allOwnKeys:r}),t),zA=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),BA=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},FA=(t,e,n,r)=>{let a,l,h;const c={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),l=a.length;l-- >0;)h=a[l],(!r||r(h,t,e))&&!c[h]&&(e[h]=t[h],c[h]=!0);t=n!==!1&&$1(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},qA=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},jA=t=>{if(!t)return null;if(Os(t))return t;let e=t.length;if(!ib(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},$A=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&$1(Uint8Array)),UA=(t,e)=>{const r=(t&&t[ku]).call(t);let a;for(;(a=r.next())&&!a.done;){const l=a.value;e.call(t,l[0],l[1])}},VA=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},WA=$i("HTMLFormElement"),GA=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a
|
|||
|
|
`).forEach(function(h){a=h.indexOf(":"),n=h.substring(0,a).trim().toLowerCase(),r=h.substring(a+1).trim(),!(!n||e[n]&&kM[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},z4=Symbol("internals");function Tl(t){return t&&String(t).trim().toLowerCase()}function ac(t){return t===!1||t==null?t:Oe.isArray(t)?t.map(ac):String(t)}function EM(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const TM=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Vh(t,e,n,r,a){if(Oe.isFunction(r))return r.call(this,e,n);if(a&&(e=n),!!Oe.isString(e)){if(Oe.isString(r))return e.indexOf(r)!==-1;if(Oe.isRegExp(r))return r.test(e)}}function AM(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function MM(t,e){const n=Oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(a,l,h){return this[r].call(this,e,a,l,h)},configurable:!0})})}class Au{constructor(e){e&&this.set(e)}set(e,n,r){const a=this;function l(c,p,v){const b=Tl(p);if(!b)throw new Error("header name must be a non-empty string");const g=Oe.findKey(a,b);(!g||a[g]===void 0||v===!0||v===void 0&&a[g]!==!1)&&(a[g||p]=ac(c))}const h=(c,p)=>Oe.forEach(c,(v,b)=>l(v,b,p));if(Oe.isPlainObject(e)||e instanceof this.constructor)h(e,n);else if(Oe.isString(e)&&(e=e.trim())&&!TM(e))h(SM(e),n);else if(Oe.isObject(e)&&Oe.isIterable(e)){let c={},p,v;for(const b of e){if(!Oe.isArray(b))throw TypeError("Object iterator must return a key-value pair");c[v=b[0]]=(p=c[v])?Oe.isArray(p)?[...p,b[1]]:[p,b[1]]:b[1]}h(c,n)}else e!=null&&l(n,e,r);return this}get(e,n){if(e=Tl(e),e){const r=Oe.findKey(this,e);if(r){const a=this[r];if(!n)return a;if(n===!0)return EM(a);if(Oe.isFunction(n))return n.call(this,a,r);if(Oe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Tl(e),e){const r=Oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Vh(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let a=!1;function l(h){if(h=Tl(h),h){const c=Oe.findKey(r,h);c&&(!n||Vh(r,r[c],c,n))&&(delete r[c],a=!0)}}return Oe.isArray(e)?e.forEach(l):l(e),a}clear(e){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const l=n[r];(!e||Vh(this,this[l],l,e,!0))&&(delete this[l],a=!0)}return a}normalize(e){const n=this,r={};return Oe.forEach(this,(a,l)=>{const h=Oe.findKey(r,l);if(h){n[h]=ac(a),delete n[l];return}const c=e?AM(l):String(l).trim();c!==l&&delete n[l],n[c]=ac(a),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return Oe.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=e&&Oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|||
|
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(a=>r.set(a)),r}static accessor(e){const r=(this[z4]=this[z4]={accessors:{}}).accessors,a=this.prototype;function l(h){const c=Tl(h);r[c]||(MM(a,h),r[c]=!0)}return Oe.isArray(e)?e.forEach(l):l(e),this}}Au.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Oe.reduceDescriptors(Au.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});Oe.freezeMethods(Au);const ji=Au;function Wh(t,e){const n=this||G1,r=e||n,a=ji.from(r.headers);let l=r.data;return Oe.forEach(t,function(c){l=c.call(n,l,a.normalize(),e?e.status:void 0)}),a.normalize(),l}function gb(t){return!!(t&&t.__CANCEL__)}function Is(t,e,n){qt.call(this,t??"canceled",qt.ERR_CANCELED,e,n),this.name="CanceledError"}Oe.inherits(Is,qt,{__CANCEL__:!0});function vb(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function CM(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function LM(t,e){t=t||10;const n=new Array(t),r=new Array(t);let a=0,l=0,h;return e=e!==void 0?e:1e3,function(p){const v=Date.now(),b=r[l];h||(h=v),n[a]=p,r[a]=v;let g=l,m=0;for(;g!==a;)m+=n[g++],g=g%t;if(a=(a+1)%t,a===l&&(l=(l+1)%t),v-h<e)return;const x=b&&v-b;return x?Math.round(m*1e3/x):void 0}}function _M(t,e){let n=0,r=1e3/e,a,l;const h=(v,b=Date.now())=>{n=b,a=null,l&&(clearTimeout(l),l=null),t(...v)};return[(...v)=>{const b=Date.now(),g=b-n;g>=r?h(v,b):(a=v,l||(l=setTimeout(()=>{l=null,h(a)},r-g)))},()=>a&&h(a)]}const Bc=(t,e,n=3)=>{let r=0;const a=LM(50,250);return _M(l=>{const h=l.loaded,c=l.lengthComputable?l.total:void 0,p=h-r,v=a(p),b=h<=c;r=h;const g={loaded:h,total:c,progress:c?h/c:void 0,bytes:p,rate:v||void 0,estimated:v&&c&&b?(c-h)/v:void 0,event:l,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(g)},n)},B4=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},F4=t=>(...e)=>Oe.asap(()=>t(...e)),NM=kr.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,kr.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(kr.origin),kr.navigator&&/(msie|trident)/i.test(kr.navigator.userAgent)):()=>!0,DM=kr.hasStandardBrowserEnv?{write(t,e,n,r,a,l){const h=[t+"="+encodeURIComponent(e)];Oe.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),Oe.isString(r)&&h.push("path="+r),Oe.isString(a)&&h.push("domain="+a),l===!0&&h.push("secure"),document.cookie=h.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function RM(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function OM(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function bb(t,e,n){let r=!RM(e);return t&&(r||n==!1)?OM(t,e):e}const q4=t=>t instanceof ji?{...t}:t;function Qo(t,e){e=e||{};const n={};function r(v,b,g,m){return Oe.isPlainObject(v)&&Oe.isPlainObject(b)?Oe.merge.call({caseless:m},v,b):Oe.isPlainObject(b)?Oe.merge({},b):Oe.isArray(b)?b.slice():b}function a(v,b,g,m){if(Oe.isUndefined(b)){if(!Oe.isUndefined(v))return r(void 0,v,g,m)}else return r(v,b,g,m)}function l(v,b){if(!Oe.isUndefined(b))return r(void 0,b)}function h(v,b){if(Oe.isUndefined(b)){if(!Oe.isUndefined(v))return r(void 0,v)}else return r(void 0,b)}function c(v,b,g){if(g in e)return r(v,b);if(g in t)return r(void 0,v)}const p={url:l,method:l,data:l,baseURL:h,transformRequest:h,transformResponse:h,paramsSerializer:h,timeout:h,timeoutMessage:h,withCredentials:h,withXSRFToken:h,adapter:h,responseType:h,xsrfCookieName:h,xsrfHeaderName:h,onUploadProgress:h,onDownloadProgress:h,decompress:h,maxContentLength:h,maxBodyLength:h,beforeRedirect:h,transport:h,httpAgent:
|
|||
|
|
`+l.map(U4).join(`
|
|||
|
|
`):" "+U4(l[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return r},adapters:Zp};function Gh(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Is(null,t)}function V4(t){return Gh(t),t.headers=ji.from(t.headers),t.data=Wh.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),kb.getAdapter(t.adapter||G1.adapter)(t).then(function(r){return Gh(t),r.data=Wh.call(t,t.transformResponse,r),r.headers=ji.from(r.headers),r},function(r){return gb(r)||(Gh(t),r&&r.response&&(r.response.data=Wh.call(t,t.transformResponse,r.response),r.response.headers=ji.from(r.response.headers))),Promise.reject(r)})}const Sb="1.11.0",Cu={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Cu[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const W4={};Cu.transitional=function(e,n,r){function a(l,h){return"[Axios v"+Sb+"] Transitional option '"+l+"'"+h+(r?". "+r:"")}return(l,h,c)=>{if(e===!1)throw new qt(a(h," has been removed"+(n?" in "+n:"")),qt.ERR_DEPRECATED);return n&&!W4[h]&&(W4[h]=!0,console.warn(a(h," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,h,c):!0}};Cu.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function KM(t,e,n){if(typeof t!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let a=r.length;for(;a-- >0;){const l=r[a],h=e[l];if(h){const c=t[l],p=c===void 0||h(c,l,t);if(p!==!0)throw new qt("option "+l+" must be "+p,qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qt("Unknown option "+l,qt.ERR_BAD_OPTION)}}const oc={assertOptions:KM,validators:Cu},Ki=oc.validators;class qc{constructor(e){this.defaults=e||{},this.interceptors={request:new P4,response:new P4}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const l=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|||
|
|
`+l):r.stack=l}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Qo(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:l}=n;r!==void 0&&oc.assertOptions(r,{silentJSONParsing:Ki.transitional(Ki.boolean),forcedJSONParsing:Ki.transitional(Ki.boolean),clarifyTimeoutError:Ki.transitional(Ki.boolean)},!1),a!=null&&(Oe.isFunction(a)?n.paramsSerializer={serialize:a}:oc.assertOptions(a,{encode:Ki.function,serialize:Ki.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),oc.assertOptions(n,{baseUrl:Ki.spelling("baseURL"),withXsrfToken:Ki.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let h=l&&Oe.merge(l.common,l[n.method]);l&&Oe.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=ji.concat(h,l);const c=[];let p=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(p=p&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const v=[];this.interceptors.response.forEach(function(S){v.push(S.fulfilled,S.rejected)});let b,g=0,m;if(!p){const w=[V4.bind(this),void 0];for(w.unshift(...c),w.push(...v),m=w.length,b=Promise.resolve(n);g<m;)b=b.then(w[g++],w[g++]);return b}m=c.length;let x=n;for(g=0;g<m;){const w=c[g++],S=c[g++];try{x=w(x)}catch(k){S.call(this,k);break}}try{b=V4.call(this,x)}catch(w){return Promise.reject(w)}for(g=0,m=v.length;g<m;)b=b.then(v[g++],v[g++]);return b}getUri(e){e=Qo(this.defaults,e);const n=bb(e.baseURL,e.url,e.allowAbsoluteUrls);return pb(n,e.params,e.paramsSerializer)}}Oe.forEach(["delete","get","head","options"],function(e){qc.prototype[e]=function(n,r){return this.request(Qo(r||{},{method:e,url:n,data:(r||{}).data}))}});Oe.forEach(["post","put","patch"],function(e){function n(r){return function(l,h,c){return this.request(Qo(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:h}))}}qc.prototype[e]=n(),qc.prototype[e+"Form"]=n(!0)});const sc=qc;class K1{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(a=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](a);r._listeners=null}),this.promise.then=a=>{let l;const h=new Promise(c=>{r.subscribe(c),l=c}).then(a);return h.cancel=function(){r.unsubscribe(l)},h},e(function(l,h,c){r.reason||(r.reason=new Is(l,h,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new K1(function(a){e=a}),cancel:e}}}const XM=K1;function ZM(t){return function(n){return t.apply(null,n)}}function YM(t){return Oe.isObject(t)&&t.isAxiosError===!0}const Yp={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,RequestHead
|
|||
|
|
`,ee+="| "+wn.map(()=>"---").join(" | ")+` |
|
|||
|
|
`}}(Ne.querySelector("tbody")||Ne).querySelectorAll("tr").forEach(cn=>{if(rt&&rt.contains(cn))return;const wn=Array.from(cn.querySelectorAll("td, th")).map(On=>(On.textContent||"").trim().replace(/\|/g,"\\|"));wn.length>0&&(ee+="| "+wn.join(" | ")+` |
|
|||
|
|
`)}),ee+=`
|
|||
|
|
`}),V.querySelectorAll("img").forEach(Ne=>{const Qe=Ne.src||Ne.getAttribute("src")||"",rt=Ne.alt||Ne.getAttribute("alt")||"";Qe&&(ee+=`
|
|||
|
|
|
|||
|
|
`)});const _e=V.cloneNode(!0);_e.querySelectorAll("table, img").forEach(Ne=>Ne.remove());let le=_e.innerHTML;return le=le.replace(/<br\s*\/?>/gi,`
|
|||
|
|
`).replace(/<\/p>/gi,`
|
|||
|
|
|
|||
|
|
`).replace(/<p[^>]*>/gi,"").replace(/<strong>(.*?)<\/strong>/gi,"**$1**").replace(/<b>(.*?)<\/b>/gi,"**$1**").replace(/<em>(.*?)<\/em>/gi,"*$1*").replace(/<i>(.*?)<\/i>/gi,"*$1*").replace(/<ul[^>]*>/gi,`
|
|||
|
|
`).replace(/<\/ul>/gi,`
|
|||
|
|
`).replace(/<li[^>]*>/gi,"- ").replace(/<\/li>/gi,`
|
|||
|
|
`).replace(/<h1[^>]*>(.*?)<\/h1>/gi,`# $1
|
|||
|
|
|
|||
|
|
`).replace(/<h2[^>]*>(.*?)<\/h2>/gi,`## $1
|
|||
|
|
|
|||
|
|
`).replace(/<h3[^>]*>(.*?)<\/h3>/gi,`### $1
|
|||
|
|
|
|||
|
|
`).replace(/<h4[^>]*>(.*?)<\/h4>/gi,`#### $1
|
|||
|
|
|
|||
|
|
`).replace(/<h5[^>]*>(.*?)<\/h5>/gi,`##### $1
|
|||
|
|
|
|||
|
|
`).replace(/<h6[^>]*>(.*?)<\/h6>/gi,`###### $1
|
|||
|
|
|
|||
|
|
`).replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gi,"[$2]($1)").replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`").replace(/<pre[^>]*>(.*?)<\/pre>/gi,"```\n$1\n```\n\n").replace(/<[^>]+>/g,"").replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`).trim(),ee+=le,console.log("✅ HTML转Markdown转换完成:",ee.substring(0,200)+"..."),ee}catch(V){return console.error("❌ HTML转Markdown转换失败:",V),B}},je=(B,V)=>{console.log("📝 打开富文本编辑器:",{nodeObj:B,nodeElement:V}),q.value=B,P.value=V;let ee=B.title;!ee&&B.topic&&(ee=B.topic.replace(/!\[.*?\]\(.*?\)/g,"").trim()),N.value=ee||"编辑节点内容",console.log("📝 节点完整数据:",{title:B.title,topic:B.topic,image:B.image,hasImage:!!B.image,htmlContent:B.htmlContent,allKeys:Object.keys(B)});let ne="";if(typeof B.markdown=="string"&&B.markdown.trim())ne=B.markdown;else if(typeof B.topic=="string"&&/<\w|<table/i.test(B.topic))try{ne=ut(B.topic)}catch{ne=B.topic}else if(typeof B.dangerouslySetInnerHTML=="string"&&B.dangerouslySetInnerHTML.trim())try{ne=ut(B.dangerouslySetInnerHTML)}catch{ne=B.dangerouslySetInnerHTML}else typeof B.data=="string"?ne=B.data:B.data&&typeof B.data=="object"?(ne=B.data.markdown||B.data.note||B.data.text||B.data.content||"",!ne&&typeof B.topic=="string"&&(ne=B.topic)):typeof B.topic=="string"?ne=B.topic:ne="";if(z.value=ne||"",console.log("📝 设置编辑器 Markdown 源:",String(z.value).substring(0,200)+"..."),B.image&&!z.value.includes("`;z.value=z.value+`
|
|||
|
|
`+le}try{typeof window<"u"&&typeof window.parseExistingImages=="function"&&window.parseExistingImages()}catch{}y.value=!0,console.log("📝 富文本编辑器已打开")},j=()=>{y.value=!1,N.value="",z.value="",q.value=null,P.value=null,Y.value=[],fe()},yt=B=>{z.value=B,console.log("📝 编辑器内容变化:",B.substring(0,100)+"...")},It=()=>{console.log("✅ Vditor编辑器准备就绪")};let bt=0;const Mt=()=>{try{return ue.value&&(ue.value.querySelector(".vditor")||ue.value.querySelector(".vditor-wysiwyg"))?(bt=0,!0):!1}catch{return!1}},se=async()=>{if(!ue.value){console.error("❌ vditorContainer未找到");return}try{ue.value.style.width="100%",ue.value.style.minHeight="360px",ue.value.style.display="block"}catch{}try{ue.value.innerHTML="";const B=document.createElement("div");B.className="vditor-root",B.style.width="100%",B.style.minHeight="360px",ue.value.appendChild(B),console.log("🧩 准备初始化Vditor,容器尺寸:",ue.value.getBoundingClientRect());const V=await sp(()=>Promise.resolve().then(()=>e7),void 0),ee=V&&(V.default||V);console.log("🧩 Vditor 构造器类型:",typeof ee),Le=new ee(B,{height:400,placeholder:"请输入节点内容...",mode:"wysiwyg",theme:"classic",value:String(z.value||""),toolbarConfig:{pin:!0},cache:{enable:!1},preview:{hljs:{style:"github"}},toolbar:["emoji","headings","bold","italic","strike","|","list","ordered-list","check","|","quote","line","code","inline-code","|","link","table","image","upload","|","undo","redo","fullscreen","edit-mode"],upload:{accept:"image/*",multiple:!1,fieldName:"file",max:5*1024*1024,url:"",linkToImgUrl:"",success:(ne,Te)=>{console.log("图片上传成功:",Te)},error:ne=>{console.error("图片上传失败:",ne)}},after:()=>{setTimeout(()=>{z.value&&z.value.trim()?Le.setValue(z.value):Le.setValue(""),Le.focus(),Le.on&&Le.on("input",ne=>{const Te=Le.getValue();z.value=Te}),setTimeout(()=>{const ne=Mt();if(!ne&&bt<bC){try{Le&&Le.destroy&&Le.destroy()}catch{}Le=null,bt+=1,console.warn("⚠️ Vditor未挂载成功,重试第",bt,"次"),setTimeout(()=>se(),120)}else ne?(bt=0,console.log("✅ Vditor挂载成功")):console.error("❌ Vditor多次重试仍未挂载成功")},200)},100)}})}catch(B){console.error("❌ Vditor编辑器初始化失败:",B),console.error("错误详情:",B.stack)}},fe=()=>{Le&&(Le.destroy(),Le=null,console.log("🗑️ Vditor编辑器已销毁"))},J=async()=>{var V,ee,ne,Te;if(console.log("🚀 saveRichTextChanges函数被调用!"),console.log("🚀 开始保存 Vditor 富文本内容..."),console.log("📝 当前editorTitle:",N.value),console.log("📝 当前editorContent:",z.value.substring(0,100)+"..."),console.log("📝 当前节点:",q.value),console.log("📝 Vditor实例状态:",!!Le),!q.value){alert("节点信息丢失");return}if(!Le){console.error("❌ Vditor实例不存在,无法获取内容"),alert("编辑器未初始化,请重试");return}const B=Le?Le.getValue():String(z.value||"");if(updateNodeModelAndRefresh(q.value,B,a.value),q.value.dangerouslySetInnerHTML=q.value.topic,q.value.title=N.value,P.value&&(P.value.innerHTML=q.value.topic||"",titleChanged)){const _e=P.value.querySelector(".tpc");_e&&(_e.textContent=N.value,console.log("📝 DOM文本元素已更新:",N.value))}try{const _e=q.value.id.replace(/^me/,""),le=j1(B||""),Ne={newTitle:q.value.title||nt(B||le),newDes:((V=q.value.data)==null?void 0:V.des)||"",newParentId:q.value.parentId||((ee=q.value.parent)==null?void 0:ee.id),newDangerouslySetInnerHTML:le,newMarkdown:B||le};console.log("🔍 直接发送到后端的更新数据:",Ne),console.log("🔍 清理后的节点ID:",_e);const Qe=await Zn.updateNode(_e,Ne);if(Qe.data&&Qe.data.success){if(console.log("✅ 节点数据已保存到后端"),a.value&&q.value&&P.value){const Ot=P.value.querySelector(".tpc");Ot&&(Ot.innerHTML=htmlContent,console.log("📝 节点显示内容已更新 - 直接设置HTML"))}alert("✅ 节点内容保存成功!")}else console.warn("⚠️ 保存节点到后端失败:",Qe),alert("❌ 保存失败,请重试")}catch(_e){console.error("❌ 保存节点到后端失<E7ABAF>
|
|||
|
|
font-size: 11px;
|
|||
|
|
color: #666;
|
|||
|
|
margin-top: 6px;
|
|||
|
|
padding: 6px 8px;
|
|||
|
|
background: rgba(0, 0, 0, 0.03);
|
|||
|
|
border-radius: 4px;
|
|||
|
|
max-width: 250px;
|
|||
|
|
word-wrap: break-word;
|
|||
|
|
line-height: 1.3;
|
|||
|
|
border-left: 3px solid #e0e0e0;
|
|||
|
|
display: block;
|
|||
|
|
`,V.appendChild(Ne));const Qe=_e.data.des;Qe.length>150?(Ne.textContent=Qe.substring(0,150)+"...",Ne.title=Qe):Ne.textContent=Qe}})},1e3)},We=()=>{try{if(a.value&&a.value.toCenter){a.value.toCenter(),console.log("✅ 使用 MindElixir toCenter 方法实现根节点居中");return}const B=r.value;if(!B)return;const V=B.querySelector(".map-canvas");if(!V)return;const ee=V.querySelectorAll("me-tpc");if(ee.length===0)return;let ne=1/0,Te=-1/0,_e=1/0,le=-1/0;ee.forEach(Vi=>{const pi=Vi.getBoundingClientRect(),Wi=B.getBoundingClientRect(),eo=pi.left-Wi.left,to=pi.top-Wi.top;ne=Math.min(ne,eo),Te=Math.max(Te,eo+pi.width),_e=Math.min(_e,to),le=Math.max(le,to+pi.height)});const Ne=(ne+Te)/2,Qe=(_e+le)/2,rt=B.clientWidth/2,Ot=B.clientHeight/2,Kt=rt-Ne,cn=Ot-Qe;V.style.transform=`translate(${Kt}px, ${cn}px)`,V.style.opacity="1",V.style.transition="opacity 0.3s ease";const wn=100,On=Math.max(Kt,wn),Zr=Math.max(cn,wn);V.style.transform=`translate(${On}px, ${Zr}px)`,V.style.opacity="1",V.style.visibility="visible"}catch{}},Ze=async B=>{if(!(!a.value||!B))try{console.log("🎯 开始处理新节点:",B);let V=null,ee=0;const ne=5;for(;!V&&ee<ne;)V=a.value.findEle(B),V||(ee++,await new Promise(Te=>setTimeout(Te,50)));V?(console.log("✅ 找到节点元素:",V),a.value.scrollIntoView&&(a.value.scrollIntoView(V),console.log("✅ 节点已平滑居中显示")),setTimeout(()=>{try{const Te=(B||"").replace(/^me/,""),le=(a.value.getNodeById?a.value.getNodeById(Te):null)||{id:Te,topic:(V==null?void 0:V.textContent)||""};typeof ui=="function"?ui(le,V):typeof je=="function"&&je(le,V),console.log("✅ 已打开自定义富文本编辑器")}catch(Te){console.warn("打开自定义编辑器失败,忽略。",Te)}},350)):console.error("❌ 多次尝试后仍未找到节点元素:",B)}catch(V){console.error("❌ 居中显示节点失败:",V)}},Be=()=>{if(!l.value)return;if(a.value&&a.value.getNodeById)try{const V=a.value.getNodeById(l.value.id);if(V){const ee=V.getBoundingClientRect(),ne=r.value.getBoundingClientRect(),Te=ee.left-ne.left+ee.width/2,_e=ee.bottom-ne.top+10;h.value={left:`${Te}px`,top:`${_e}px`};return}}catch{}let B=document.querySelector(`[data-id="${l.value.id}"]`);if(B||(B=document.querySelector(`.topic[data-id="${l.value.id}"]`)),B||(B=document.querySelector(`[data-node-id="${l.value.id}"]`)),B||(B=document.querySelector(`[data-nodeid="me${l.value.id}"]`)),!B){const V=document.querySelectorAll("me-tpc");for(const ee of V)if(ee.getAttribute("data-nodeid")===`me${l.value.id}`){B=ee;break}}if(!B){const V=document.querySelectorAll(".topic");for(const ee of V)if(ee.textContent.trim()===l.value.topic){B=ee;break}}if(B){const V=B.getBoundingClientRect(),ee=r.value.getBoundingClientRect(),ne=V.left-ee.left+V.width/2,Te=V.bottom-ee.top+10;h.value={left:`${ne}px`,top:`${Te}px`}}else h.value={left:"50%",top:"50%",transform:"translate(-50%, -50%)"}},at=async()=>{l.value&&(await Ci(l.value),l.value=null)},Ue=async()=>{l.value&&(await zn(l.value),l.value=null)},He=async()=>{l.value&&(await an(l.value),l.value=null)},gt=async()=>{if(!l.value)return;console.log("Ask AI for node:",l.value);const B=parseFloat(h.value.left)||0,V=parseFloat(h.value.top)||0;c.value={left:`${B}px`,top:`${V+60}px`,transform:"translateX(-50%)"},m.value=!0,x.value=l.value},kt=()=>{m.value=!1,x.value=null,w.value="",S.value=!1,l.value=null},jt=B=>{if(!B)return"";const V=[];return B.parent&&B.parent.topic&&V.push(`父节点: ${B.parent.topic}`),B.parent&&B.parent.parent&&B.parent.parent.topic&&V.push(`祖父节点: ${B.parent.parent.topic}`),V.join(" | ")},$t=B=>{B.ctrlKey||B.metaKey||(B.preventDefault(),Mn())},Mn=async()=>{if(!(!w.value.trim()||!x.value||S.value)){S.value=!0;try{const B="你是一个专业的思维导图分析助手。请根据用户的问题和提供的节点信息,给出专业、有用的回答。",V=`节点信息:
|
|||
|
|
当前节点:${x.value.topic}
|
|||
|
|
上下文:${jt(x.value)}
|
|||
|
|
用户问题:${w.value}
|
|||
|
|
|
|||
|
|
请给出详细的回答,回答应该:
|
|||
|
|
1. 直接回答用户的问题
|
|||
|
|
2. 提供具体的建议或改进方案
|
|||
|
|
3. 保持专业和有用的语调
|
|||
|
|
4. 回答长度适中,便于在思维导图中展示`;console.log("发送AI请求:",{systemPrompt:B,userPrompt:V});const ee=await fetch("http://127.0.0.1:8000/api/ai/generate-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:B,user_prompt:V,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"})});if(!ee.ok)throw new Error(`HTTP error! status: ${ee.status}`);let ne="";const Te=ee.body.getReader(),_e=new TextDecoder;let le="";for(;;){const{done:Ne,value:Qe}=await Te.read();if(Ne)break;le+=_e.decode(Qe,{stream:!0});const rt=le.split(`
|
|||
|
|
`);le=rt.pop()||"";for(const Ot of rt)if(Ot.startsWith("data: "))try{const Kt=JSON.parse(Ot.slice(6));if(Kt.type==="chunk")ne+=Kt.content;else if(Kt.type==="error")throw new Error(Kt.content)}catch(Kt){console.warn("解析流式数据失败:",Kt)}}await Qn(x.value,w.value,ne),kt()}catch(B){console.error("AI请求失败:",B),alert("AI请求失败,请稍后重试")}finally{S.value=!1}}},gn=B=>B.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(V,ee)=>{if(ee.includes(":")){const ne=ee.split(":");if(ne.length>1)return`【${ne[0]}】: ${ne.slice(1).join(":")}`}return`【${ee}】`}).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,`
|
|||
|
|
`),Rn=(B,V,ee)=>{const ne=B.split(`
|
|||
|
|
`);let Te=ee,_e=[];for(let le=0;le<ne.length;le++){const Qe=ne[le].trim(),rt=Qe.match(/^[-*+]\s*【(.+)】/);if(rt){const Ot=rt[1].trim(),Kt={id:`node_${Te++}`,topic:Ot,children:[],level:(V.level||0)+1,data:{}};let cn=[],wn=le+1;for(;wn<ne.length;){const On=ne[wn].trim();if(On.match(/^[-*+]\s*【(.+)】/))break;const Vi=On.match(/^[-*+]\s+(.+)$/);if(Vi){const pi=Vi[1].trim(),Wi=gn(pi);cn.push("• "+Wi)}wn++}if(cn.length>0){const On=gn(cn.join(`
|
|||
|
|
`));Kt.topic=Kt.topic+`
|
|||
|
|
|
|||
|
|
`+On}V.children.push(Kt),le=wn-1}else Qe&&_e.push(Qe)}if(_e.length>0){const le=_e.join(`
|
|||
|
|
`).trim();le&&le.split(`
|
|||
|
|
|
|||
|
|
`).filter(Qe=>Qe.trim()).forEach(Qe=>{const rt=gn(Qe.trim());if(rt){const Ot={id:`node_${Te++}`,topic:rt,children:[],level:(V.level||0)+1,data:{}};V.children.push(Ot)}})}return{nodeCounter:Te}},ln=B=>{const V=B.split(`
|
|||
|
|
`);let ee=null;const ne=[];let Te=0,_e=[];if(V.forEach((le,Ne)=>{const Qe=le.trim(),rt=Qe.match(/^(#{1,6})\s+(.+)$/);if(rt){if(_e.length>0&&ne.length>0){const On=_e.join(`
|
|||
|
|
`).trim();On&&(Te=Rn(On,ne[ne.length-1],Te).nodeCounter),_e=[]}const Ot=rt[1].length,Kt=rt[2].trim(),cn=gn(Kt),wn={id:`node_${Te++}`,topic:cn,children:[],level:Ot,data:{}};if(Ot===1&&!ee)ee=wn,ne.length=0,ne.push(ee);else{for(;ne.length>1&&ne[ne.length-1].level>=Ot;)ne.pop();ne.length>0&&ne[ne.length-1].children.push(wn),ne.push(wn)}}else Qe&&_e.push(Qe)}),_e.length>0&&ne.length>0){const le=_e.join(`
|
|||
|
|
`).trim();le&&(Te=Rn(le,ne[ne.length-1],Te).nodeCounter)}return ee||(ee={id:"root",topic:"根节点",children:[],data:{}}),ee},Qn=async(B,V,ee)=>{var ne,Te,_e;try{const Ne=(Zr=>Zr.replace(/^#+\s*/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/^\s*[-*+]\s*(?![|])/gm,"• ").replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`).trim())(ee),Qe=`# ${V}
|
|||
|
|
|
|||
|
|
${Ne}`,rt=ln(Qe),Ot={title:V,des:`AI追问产生的节点 - ${new Date().toLocaleString()}`,parentId:B.id,isRoot:!1},Kt=[];if(rt.children&&rt.children.length>0&&rt.children.forEach(Zr=>{Kt.push({title:Zr.topic,des:"",parentId:null,isRoot:!1})}),console.log("当前思维导图ID:",p.value),!p.value)throw new Error("没有找到当前思维导图ID,无法创建节点");const cn=await Zn.addNodes(p.value,[Ot]);if(!cn.data||!cn.data.success)throw new Error("AI父节点创建失败");const wn=(_e=(Te=(ne=cn.data.data)==null?void 0:ne.nodes)==null?void 0:Te[0])==null?void 0:_e.id;if(!wn)throw new Error("无法获取创建的父节点ID");Kt.forEach(Zr=>{Zr.parentId=wn});let On=null;if(Kt.length>0&&(On=await Zn.addNodes(p.value,Kt)),cn.data&&cn.data.success)await Xr();else throw new Error("AI父节点创建失败")}catch(le){console.error("创建AI节点失败:",le),alert("创建AI回答节点失败: "+le.message)}},Cn=async()=>{if(l.value){try{const B=l.value.topic||l.value.title||"无标题";if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(B),xn();else{const V=document.createElement("textarea");V.value=B,V.style.position="fixed",V.style.left="-999999px",V.style.top="-999999px",document.body.appendChild(V),V.focus(),V.select();const ee=document.execCommand("copy");document.body.removeChild(V),ee?xn():zt()}}catch{zt()}l.value=null}},xn=()=>{const B=document.createElement("div");B.textContent="文本已复制到剪贴板",B.style.cssText=`
|
|||
|
|
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 V=document.createElement("style");V.textContent=`
|
|||
|
|
@keyframes slideIn {
|
|||
|
|
from { transform: translateX(100%); opacity: 0; }
|
|||
|
|
to { transform: translateX(0); opacity: 1; }
|
|||
|
|
}
|
|||
|
|
`,document.head.appendChild(V),document.body.appendChild(B),setTimeout(()=>{B.parentNode&&B.parentNode.removeChild(B),V.parentNode&&V.parentNode.removeChild(V)},3e3)},zt=()=>{const B=document.createElement("div");B.textContent="复制失败,请手动复制",B.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(B),setTimeout(()=>{B.parentNode&&B.parentNode.removeChild(B)},3e3)},Pn=(B,V="success")=>{const ee=document.createElement("div");ee.textContent=B;const ne=V==="success"?"#4CAF50":V==="error"?"#f44336":"#ff9800";ee.style.cssText=`
|
|||
|
|
position: fixed;
|
|||
|
|
top: 20px;
|
|||
|
|
right: 20px;
|
|||
|
|
background: ${ne};
|
|||
|
|
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(ee),setTimeout(()=>{ee.parentNode&&ee.parentNode.removeChild(ee)},2e3)},nn=()=>{const B=document.createElement("div");B.textContent="✅ 节点编辑已保存",B.style.cssText=`
|
|||
|
|
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;
|
|||
|
|
`,document.body.appendChild(B),setTimeout(()=>{B.parentNode&&B.parentNode.removeChild(B)},2e3)},Gr=()=>{const B=document.createElement("div");B.textContent="❌ 节点编辑保存失败",B.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(B),setTimeout(()=>{B.parentNode&&B.parentNode.removeChild(B)},3e3)},er=async B=>{try{console.log("🎯 处理节点拖拽操作:",B.name),console.log("📦 操作详情:",{name:B.name,objs:B.objs,toObj:B.toObj}),setTimeout(async()=>{var V;try{const ee=B.objs||[],ne=B.toObj;if(!ee.length||!ne){console.warn("⚠️ 拖拽操作缺少必要信息");return}console.log(`📦 准备保存 ${ee.length} 个节点的父子关系`);let Te=null;B.name==="moveNodeIn"?(Te=ne.id,console.log(`📌 拖入操作:新父节点为 ${Te}`)):(B.name==="moveNodeBefore"||B.name==="moveNodeAfter")&&(Te=((V=ne.parent)==null?void 0:V.id)||null,console.log(`📌 拖到兄弟位置:新父节点为 ${Te||"根节点"}`));const _e=ee.map(async rt=>{try{console.log(`🔄 更新节点 ${rt.id} 的父节点为 ${Te||"根节点"}`);const Ot=await Zn.updateNode(rt.id,{newParentId:Te});return Ot.data&&Ot.data.success?(console.log(`✅ 节点 ${rt.id} 父子关系更新成功`),{success:!0,nodeId:rt.id}):(console.warn(`⚠️ 节点 ${rt.id} 父子关系更新失败:`,Ot),{success:!1,nodeId:rt.id})}catch(Ot){return console.error(`❌ 节点 ${rt.id} 父子关系更新失败:`,Ot),{success:!1,nodeId:rt.id,error:Ot}}}),le=await Promise.all(_e),Ne=le.filter(rt=>rt.success).length,Qe=le.filter(rt=>!rt.success).length;console.log(`📊 拖拽保存结果: ${Ne} 成功, ${Qe} 失败`)}catch(ee){console.error("❌ 保存拖拽后的结构失败:",ee),Pn("❌ 节点拖拽保存失败","error")}},500)}catch(V){console.error("❌ 处理节点拖拽操作失败:",V)}},or=new Set,Jt=async B=>{var ee;const V=`${B.name}-${(ee=B.obj)==null?void 0:ee.id}`;if(or.has(V)){console.log("⚠️ 跳过重复的编辑操作:",V);return}or.add(V);try{console.log("🔍 处理编辑完成:",B);const ne=B.obj;ne?(console.log("🔍 保存编辑的节点:",{nodeId:ne.id,nodeTopic:ne.topic,hasHtml:/<\\w+[^>]*>/.test(ne.topic||"")}),await Er(ne)):console.error("无法解析编辑操作:",B)}catch(ne){console.error("处理编辑完成失败:",ne)}finally{or.delete(V)}},Er=async B=>{var V,ee,ne;try{const Te=B.id.replace(/^me/,"");if(console.log("🔍 更新节点编辑:",{originalNodeId:B.id,cleanNodeId:Te,nodeTopic:B.topic,currentMindmapId:p.value}),!p.value){console.error("无法获取思维导图ID");return}const _e={newTitle:B.topic,newDes:((V=B.data)==null?void 0:V.des)||"",newParentId:B.parentId||((ee=B.parent)==null?void 0:ee.id),newDangerouslySetInnerHTML:B.topic||""};console.log("🔍 发送到后端的更新数据:",_e);const le=await Zn.updateNode(Te,_e);if(le.data&&le.data.success){if(a.value&&B){let Ne=B.id;if(Ne.startsWith("me")&&(Ne=Ne.substring(2)),!Ne.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)){console.error("❌ 无效的UUID格式:",Ne,"原始ID:",B.id);return}console.log("🔍 查找DOM元素,纯净ID:",Ne,"原始ID:",B.id),console.log("🔍 调试信息 - node对象:",{id:B.id,topic:((ne=B.topic)==null?void 0:ne.substring(0,50))+"...",hasHtml:/<\w+[^>]*>/.test(B.topic||"")});try{const Qe=a.value.findEle(Ne);console.log("🔍 找到的DOM元素:",Qe),Qe?(console.log("✅ DOM元素存在,直接更新内容..."),B.topic?(console.log("🔍 更新文本内容:",B.topic.substring(0,100)+"..."),Qe.innerHTML=B.topic,console.log("📝 节点显示内容已更新 (updateNodeEdit) - 设置HTML")):console.warn("⚠️ node对象没有topic")):console.warn("⚠️ findEle返回了null或undefined")}catch(Qe){console.warn("⚠️ 无法找到DOM元素:",Qe.message,"纯净ID:",Ne)}}nn()}else console.error("更新节点编辑失败:",le.data),Gr()}catch(Te){console.error("更新节点编辑失败:",Te),Gr()}},Ci=async B=>{var V;try{await Qt();const ee=p.value||B.mindmap_id||B.mindmapId;if(!ee){console.error("无法获取思维导图ID");return}const ne=await Zn.addNodes(ee,[{title:"新子节点",des:"子节点描述",parentId:B.id}]);if(ne.data&&ne.data.success){const Te=((V=ne.data.data)==null?void 0:V.nodes)||[];if(Te.length>0){const _e=Te[0];try{await new Promise(Ne=>setTimeout(Ne,800));const le=await Zn.getMindmap(e
|
|||
|
|
1. 提取主要主题和关键概念
|
|||
|
|
2. 组织成层次分明的结构
|
|||
|
|
3. 使用清晰的标题和子标题
|
|||
|
|
4. 保持内容的逻辑性和完整性
|
|||
|
|
5. 对于长文档,请确保完整处理所有内容,不要截断
|
|||
|
|
6. **重要:如果原文档中包含图片,请按以下方式处理:
|
|||
|
|
- 识别图片在文档中的位置和上下文
|
|||
|
|
- 根据图片内容生成准确的描述文字
|
|||
|
|
- 在相应位置插入图片占位符:
|
|||
|
|
- 图片描述要准确反映图片内容,图片路径可以是相对路径或占位符
|
|||
|
|
- 确保图片占位符放在逻辑上合适的位置**
|
|||
|
|
7. **重要:如果原文档中包含表格,请完整保留表格结构:
|
|||
|
|
- 保持表格的Markdown格式
|
|||
|
|
- 确保所有表格行都被包含
|
|||
|
|
- 不要省略任何表格内容
|
|||
|
|
- 对于合并单元格的表格,请使用HTML格式并正确使用rowspan和colspan属性
|
|||
|
|
- 如果表格结构复杂,优先使用HTML table标签而不是Markdown表格语法**
|
|||
|
|
8. **重要:确保内容完整性:
|
|||
|
|
- 不要截断任何内容
|
|||
|
|
- 保持原文的完整性
|
|||
|
|
- 所有重要信息都要包含在思维导图中**
|
|||
|
|
9. 输出格式:直接输出Markdown内容,不要添加任何说明文字或代码块标记`,Q=`请分析以下文档内容并生成结构化Markdown:
|
|||
|
|
|
|||
|
|
${fe}`;await te(J,Q),await Le(),It(w.value.name,l.value),setTimeout(async()=>{try{await je()}catch(Ie){console.error("自动保存失败:",Ie)}},1500)}catch(fe){console.error("从文件生成Markdown失败:",fe),j("生成失败: "+fe.message,"error")}finally{c.value=!1}},z=fe=>new Promise(async(J,Q)=>{try{const Ie=fe.type.includes("text")||fe.name.endsWith(".txt")||fe.name.endsWith(".md"),de=fe.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||fe.type==="application/msword"||fe.name.endsWith(".docx")||fe.name.endsWith(".doc"),W=fe.type==="application/pdf"||fe.name.endsWith(".pdf");if(Ie){const Z=new FileReader;Z.onload=ge=>J(ge.target.result),Z.onerror=()=>Q(new Error("文本文件读取失败")),Z.readAsText(fe)}else if(de){const Z=await q(fe);J(Z)}else if(W){const Z=await P(fe);J(Z)}else{const Z=new FileReader;Z.onload=ge=>J(ge.target.result),Z.onerror=()=>Q(new Error("文件读取失败")),Z.readAsText(fe)}}catch(Ie){Q(Ie)}}),q=async fe=>{try{if(fe.name.endsWith(".docx")){const J=await sp(()=>import("./index-394d79f1.js").then(de=>de.i),[]),Q=await fe.arrayBuffer();return(await J.extractRawText({arrayBuffer:Q})).value}else if(fe.name.endsWith(".doc"))throw new Error("请将.doc文件转换为.docx格式,或安装相应的解析库")}catch(J){throw new Error(`Office文档解析失败: ${J.message}`)}},P=async fe=>{try{const J=await sp(()=>import("./pdf-4d9c7501.js"),[]);J.GlobalWorkerOptions.workerSrc="/pdf.worker.min.mjs";const Q=await fe.arrayBuffer(),Ie=await J.getDocument({data:Q}).promise;let de="";for(let W=1;W<=Ie.numPages;W++){const ce=(await(await Ie.getPage(W)).getTextContent()).items.map(ve=>ve.str).join(" ");de+=ce+`
|
|||
|
|
`}return de}catch(J){throw new Error(`PDF文件解析失败: ${J.message}`)}},Y=fe=>fe&&fe.replace(/^好的[,,]?作为.*?专家[,,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^好的[,,]?作为.*?专业的.*?专家[,,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^以下是.*?结构化的.*?思维导图[::]\s*/i,"").replace(/^以下是.*?Markdown.*?思维导图[::]\s*/i,"").replace(/^以下是.*?Markdown.*?格式.*?思维导图[::]\s*/i,"").replace(/^```(?:markdown)?\s*/gm,"").replace(/```\s*$/gm,"").replace(/^「」`markdown\s*/gm,"").replace(/^「」`\s*/gm,"").replace(/^\s*「」`markdown\s*/gm,"").replace(/^\s*「」`\s*/gm,"").replace(/^作为.*?专家[,,]?我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^我已.*?分析.*?内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^根据.*?文档内容.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^基于.*?文档.*?生成了以下.*?思维导图[::]\s*/i,"").replace(/^以下是.*?分析.*?结果[::]\s*/i,"").replace(/^以下是.*?整理.*?结果[::]\s*/i,"").replace(/^以下是.*?结构化.*?内容[::]\s*/i,"").replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`).trim(),te=async(fe,J)=>{const Ie=fe||`你是一位Markdown格式转换专家。你的任务是将用户提供的文章内容精确转换为结构化的Markdown格式。请遵循以下步骤:
|
|||
|
|
|
|||
|
|
提取主标题: 识别文章最顶层的主标题(通常为文章题目或书名),并使用Markdown的 # 级别表示。
|
|||
|
|
|
|||
|
|
识别层级标题: 从文章内容中提取所有层级的内容标题(从主标题后的第一个标题开始,Level 1 至 Level 4)。判断层级依据:
|
|||
|
|
|
|||
|
|
视觉与结构特征: 如独立成行/段、位置(行首)、格式(加粗、编号如 1., 1.1, (1), - 等)。
|
|||
|
|
|
|||
|
|
语义逻辑: 标题之间的包含和并列关系。
|
|||
|
|
|
|||
|
|
在Markdown中,使用相应标题级别:
|
|||
|
|
|
|||
|
|
Level 1 标题用 ##
|
|||
|
|
|
|||
|
|
Level 2 标题用 ###
|
|||
|
|
|
|||
|
|
Level 3 标题用 ####
|
|||
|
|
|
|||
|
|
Level 4 标题用 #####
|
|||
|
|
|
|||
|
|
精确保留原文标题文字,不得修改、概括或润色。
|
|||
|
|
|
|||
|
|
处理正文内容: 对于每个标题下的正文内容区块(从该标题后开始,直到下一个同级或更高级别标题前):
|
|||
|
|
|
|||
|
|
直接保留原文文本,但根据内容结构适当格式化为Markdown。
|
|||
|
|
|
|||
|
|
如果内容是列表(如项目符号或编号列表),使用Markdown列表语法(例如 - 用于无序列表,1. 用于有序列表)。
|
|||
|
|
|
|||
|
|
保持段落和换行不变。
|
|||
|
|
|
|||
|
|
**重要:如果原文档中包含图片,请按以下方式处理:
|
|||
|
|
1. 识别图片在文档中的位置和上下文
|
|||
|
|
2. 根据图片内容生成准确的描述文字
|
|||
|
|
3. 在相应位置插入图片占位符:
|
|||
|
|
4. 图片描述要准确反映图片内容,图片路径可以是相对路径或占位符
|
|||
|
|
5. 确保图片占位符放在逻辑上合适的位置**
|
|||
|
|
|
|||
|
|
输出格式: 输出必须是纯Markdown格式的文本,不得包含任何额外说明、JSON或非Markdown元素。确保输出与示例风格一致。直接输出Markdown内容,不要添加任何说明文字。`,de=J||"请将以下内容转换为结构化的Markdown格式:";try{const W=await fetch("http://127.0.0.1:8000/api/ai/generate-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_prompt:Ie,user_prompt:de,model:"glm-4.5",base_url:"https://open.bigmodel.cn/api/paas/v4/",api_key:"ce39bdd4fcf34ec0aec75072bc9ff988.hAp7HZTVUwy7vImn"})});if(!W.ok)throw new Error(`HTTP error! status: ${W.status}`);const Z=W.body.getReader(),ge=new TextDecoder;let ce="",ve=0;for(;;){const{done:Ee,value:ze}=await Z.read();if(Ee)break;ce+=ge.decode(ze,{stream:!0});const We=ce.split(`
|
|||
|
|
`);ce=We.pop()||"";for(const Ze of We)if(Ze.startsWith("data: "))try{const Be=JSON.parse(Ze.slice(6));if(Be.type==="start")j("AI开始生成内容...","info");else if(Be.type==="chunk"){if(ve++,l.value+=Be.content,ve%15===0&&l.value.length>100)try{const at=Y(l.value);if(at.length<10||!at.includes("#")){console.log("⚠️ 内容还不够完整,跳过此次转换"),console.log("⚠️ 内容长度:",at.length),console.log("⚠️ 内容预览:",at.substring(0,200));return}console.log("🔍 准备转换的内容长度:",at.length),console.log("🔍 准备转换的内容预览:",at.substring(0,500)),console.log("🔍 内容是否包含标题:",at.includes("#")),console.log("🔍 内容行数:",at.split(`
|
|||
|
|
`).length);const Ue=await De(at);if(!Ue||!Ue.topic){console.log("⚠️ 转换结果无效,跳过此次更新"),console.log("🔍 转换结果详情:",Ue),console.log("🔍 内容长度:",at.length),console.log("🔍 内容预览:",at.substring(0,200));return}h.value=JSON.stringify(Ue,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:Ue,title:Ue.topic||"AI生成中...",source:"ai-streaming",chunkCount:ve,isIncremental:!0}}))}catch(at){if(console.warn("⚠️ 实时转换JSON失败:",at.message),console.warn("⚠️ 当前内容长度:",l.value.length),console.warn("⚠️ 当前内容预览:",l.value.substring(0,200)),l.value.length>50)try{const Ue=$e(l.value);window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:Ue,title:"AI生成中...",source:"ai-streaming-fallback",chunkCount:ve,isIncremental:!0}}))}catch(Ue){console.warn("⚠️ 回退处理也失败:",Ue)}}}else if(Be.type==="end")try{const at=Y(l.value),Ue=qe(at),He=await De(at);h.value=JSON.stringify(He,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:He,title:He.topic||"AI生成完成",source:"ai-final",chunkCount:ve}})),setTimeout(()=>{window.dispatchEvent(new CustomEvent("save-preview-to-database",{detail:{data:He,title:He.topic||"AI生成思维导图",source:"ai-generated",timestamp:Date.now()}}))},2e3),j("AI内容生成完成!正在保存到数据库...","success")}catch(at){console.error("⚠️ 最终处理失败:",at),console.error("⚠️ 错误详情:",at.message);try{const Ue=$e(l.value);h.value=JSON.stringify(Ue,null,2),window.dispatchEvent(new CustomEvent("realtime-mindmap-update",{detail:{data:Ue,title:"AI生成完成(简化版)",source:"ai-final-fallback",chunkCount:ve}})),setTimeout(()=>{window.dispatchEvent(new CustomEvent("save-preview-to-database",{detail:{data:Ue,title:Ue.topic||"AI生成思维导图(回退)",source:"ai-final-fallback",timestamp:Date.now()}}))},2e3),j("AI内容生成完成(简化版)!正在保存到数据库...","success")}catch(Ue){console.error("⚠️ 回退处理也失败:",Ue),j("AI内容生成完成,但格式处理遇到问题","warning")}}else if(Be.type==="error")throw new Error(Be.content)}catch(Be){console.warn("解析流式数据失败:",Be)}}}catch(W){throw console.error("流式AI API调用失败:",W),W}},ue=fe=>{if(fe.includes("|")&&fe.includes("-")){const J=fe.split(`
|
|||
|
|
`);let Q=!1,Ie=!1;for(const de of J){const W=de.trim();W.includes("|")&&W.split("|").length>=3&&(Q=!0),W.includes("|")&&W.includes("-")&&/^[\s\|\-\:]+$/.test(W)&&(Ie=!0)}if(Q&&Ie)return console.log("🚫 formatMarkdownToText: 检测到表格内容,跳过转换"),fe}return fe.replace(/^### (.*$)/gim,"📋 $1").replace(/^## (.*$)/gim,"📌 $1").replace(/^# (.*$)/gim,"🎯 $1").replace(/\*\*(.*?)\*\*/g,(J,Q)=>{if(Q.includes(":")){const Ie=Q.split(":");if(Ie.length>1)return`【${Ie[0]}】: ${Ie.slice(1).join(":")}`}return`【${Q}】`}).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,`
|
|||
|
|
`).split(`
|
|||
|
|
`).map(J=>J.length>80?J.substring(0,77)+"...":J).join(`
|
|||
|
|
`).trim()},Le=async()=>{if(!l.value.trim()){j("请输入Markdown内容","error");return}p.value=!0;try{const fe=Y(l.value),J=De(fe);h.value=JSON.stringify(J,null,2)}catch(fe){console.error("转换失败:",fe),j("转换失败,请检查Markdown格式","error")}finally{p.value=!1}},qe=fe=>{const J=/!\[([^\]]*)\]\(([^)]*)\)/g,Q=[];let Ie;for(;(Ie=J.exec(fe))!==null;){let de=Ie[2];const W=Ie[1]||"";if(console.log(`🔍 发现图片匹配: alt="${W}", url="${de}"`),de&&de.trim()){if(de=de.trim(),de.endsWith("...")||de.endsWith("..")||de.length<10){console.log(`⚠️ 检测到不完整的图片URL: ${de}`);continue}de.startsWith("http")||de.startsWith("data:")||de.startsWith("/")||de.startsWith("./")?(Q.push({alt:W,url:de,fullMatch:Ie[0]}),console.log(`✅ 有效图片URL: ${de}`)):console.warn(`⚠️ 跳过格式不支持的图片URL: ${de}`)}else console.warn("⚠️ 跳过空的图片URL")}return console.log(`🔍 从内容中提取到 ${Q.length} 张图片:`,Q),Q},Xe=fe=>{if(!fe)return"";let J=fe.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,"");return J=J.replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`),J.trim()},it=fe=>{if(!fe)return"";let J=fe;J=J.replace(/!\[([^\]]*)\]\(([^)]*\.\.\.?)\)/g,""),J=J.replace(/!\[([^\]]*)\]\(([^)]*)\)/g,(W,Z,ge)=>!ge||ge.length<10||ge.endsWith("...")||ge.endsWith("..")?(console.log("🔧 移除不完整的图片引用:",W),""):W);const Q=J.split(`
|
|||
|
|
`);let Ie=!1;for(const W of Q)if(W.trim().match(/^#{1,6}\s+.+/)){Ie=!0;break}if(!Ie&&Q.length>0){const W=Q[0].trim();W&&!W.startsWith("#")&&W.length>0&&(J=`# ${W}
|
|||
|
|
|
|||
|
|
${Q.slice(1).join(`
|
|||
|
|
`)}`,console.log("🔧 修复:将第一行转换为标题"))}J=J.replace(/^[-*+]\s*$/gm,"");const de=J.match(/```/g);return de&&de.length%2===1&&(J+="\n```",console.log("🔧 修复:添加缺失的代码块闭合标记")),J=J.replace(/\*\*([^*]*)$/,"**$1**"),J=J.replace(/\*([^*]*)$/,"*$1*"),J=J.replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`),J&&!J.endsWith(`
|
|||
|
|
`)&&(J+=`
|
|||
|
|
`),console.log("🔧 预处理完成,原始长度:",fe.length,"处理后长度:",J.length),J},$e=fe=>{if(!fe)return{id:"root",topic:"AI生成中...",children:[{id:"node_1",topic:"内容生成中,请稍候...",children:[],level:1,data:{},expanded:!0}]};const J=fe.split(`
|
|||
|
|
`).filter(W=>W.trim());let Q="AI生成中...";for(const W of J){const Z=W.trim();if(Z.startsWith("#")){Q=Z.replace(/^#+\s*/,"").trim();break}else if(Z.length>5&&!Z.startsWith("```")&&!Z.startsWith("**")){Q=Z.substring(0,30)+(Z.length>30?"...":"");break}}const Ie=J.filter(W=>{const Z=W.trim();return Z.length>10&&!Z.startsWith("#")&&!Z.startsWith("```")&&!Z.startsWith("**")&&!Z.startsWith("- ")&&!Z.startsWith("* ")&&!Z.startsWith("+ ")}),de=[];return Ie.slice(0,3).forEach((W,Z)=>{const ge=W.trim().substring(0,50);ge&&de.push({id:`node_${Z+1}`,topic:ge+(W.trim().length>50?"...":""),children:[],level:1,data:{},expanded:!0})}),de.length===0&&de.push({id:"node_1",topic:"内容生成中,请稍候...",children:[],level:1,data:{},expanded:!0}),{id:"root",topic:Q,children:de}},De=async fe=>{try{if(!fe||typeof fe!="string")throw new Error("Markdown内容为空或格式错误");const Q=it(fe).split(`
|
|||
|
|
`);let Ie=null;const de=[];let W=0,Z=[];for(let ve=0;ve<Q.length;ve++){const ze=Q[ve].trim(),We=ze.match(/^(#{1,6})\s+(.+)$/);if(We){if(Z.length>0&&de.length>0){const gt=Z.join(`
|
|||
|
|
`).trim();if(gt){const kt={id:`node_${W++}`,topic:gt,children:[],level:(de[de.length-1].level||0)+1,data:{},expanded:!0};de[de.length-1].children.push(kt)}Z=[]}const Ze=We[1].length,Be=We[2].trim(),at=qe(Be),Ue=Xe(ue(Be));at.length>0&&console.log(`🖼️ 在标题中发现 ${at.length} 张图片: ${Be}`);const He={id:`node_${W++}`,topic:Ue,children:[],level:Ze,data:{},expanded:!0};if(at.length>0){const gt=at[0];if(gt.url&>.url.trim()!==""){let kt=gt.url;kt.includes("cdn-mineru.openxlab.org.cn")&&(kt=`/proxy-image${kt.replace("https://cdn-mineru.openxlab.org.cn","")}`);const jt=``;He.topic=j1(jt),He.markdown=jt,console.log(`✅ 成功为标题节点设置图片Markdown: ${jt}`)}else console.error("❌ 标题图片URL无效:",gt)}if(Ze===1&&!Ie)Ie=He,de.length=0,de.push(Ie);else{for(;de.length>1&&de[de.length-1].level>=Ze;)de.pop();de.length>0&&de[de.length-1].children.push(He),de.push(He)}}else ze&&Z.push(ze)}if(Z.length>0&&de.length>0){const ve=Z.join(`
|
|||
|
|
`).trim();if(ve){ve.includes("|")&&console.log("🔍 处理最后的内容(包含表格):",ve.substring(0,200)+"...");const Ee={id:`node_${W++}`,topic:ve,children:[],level:(de[de.length-1].level||0)+1,data:{},expanded:!0};de[de.length-1].children.push(Ee)}}Ie||(console.warn("⚠️ 没有找到根节点,创建默认结构"),console.log("🔍 原因分析:"),console.log("- Markdown内容长度:",fe.length),console.log("- 是否包含标题(#):",fe.includes("#")),console.log("- 前几行内容:",fe.split(`
|
|||
|
|
`).slice(0,5)),Ie={id:"root",topic:"根节点",children:[],data:{},expanded:!0});const ge=ve=>{let Ee=1;return ve.children&&ve.children.forEach(ze=>{Ee+=ge(ze)}),Ee},ce=ge(Ie);return console.log("🔍 markdownToJSON返回结果:"),console.log("- 根节点ID:",Ie.id),console.log("- 根节点topic:",Ie.topic),console.log("- 子节点数量:",Ie.children?Ie.children.length:0),console.log("- 总节点数:",ce),Ie}catch(J){return console.error("❌ Markdown转JSON失败:",J),console.error("❌ 错误详情:",J.message),console.error("❌ 输入内容长度:",(fe==null?void 0:fe.length)||0),console.error("❌ 输入内容预览:",(fe==null?void 0:fe.substring(0,200))||"无内容"),$e(fe||"")}},nt=async()=>{if(!l.value){j("没有Markdown内容可复制","error");return}try{await navigator.clipboard.writeText(l.value),j("Markdown已复制到剪贴板","success")}catch{const J=document.createElement("textarea");J.value=l.value,document.body.appendChild(J),J.select(),document.execCommand("copy"),J.remove(),j("Markdown已复制到剪贴板","success")}},ut=async()=>{try{await navigator.clipboard.writeText(h.value),j("JSON已复制到剪贴板","success")}catch(fe){console.error("复制失败:",fe),j("复制失败","error")}},je=async()=>{if(!h.value){j("请先生成或转换JSON数据","error");return}try{const fe=JSON.parse(h.value),J=fe.topic||fe.title||`AI生成的思维导图_${new Date().toLocaleString()}`,Q=new CustomEvent("save-preview-to-database",{detail:{data:fe,title:J,source:"ai-generated",timestamp:Date.now()}});window.dispatchEvent(Q),setTimeout(()=>{j("思维导图已保存成功!","success"),w.value=null,x.value&&(x.value.value="")},2e3)}catch(fe){console.error("JSON解析失败:",fe),j("JSON格式错误,请检查数据","error")}},j=(fe,J="info")=>{const Q=document.createElement("div");switch(Q.className=`notification notification-${J}`,Q.textContent=fe,Q.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;
|
|||
|
|
`,J){case"success":Q.style.background="#4CAF50",Q.style.color="white";break;case"error":Q.style.background="#f44336",Q.style.color="white";break;case"info":default:Q.style.background="#2196F3",Q.style.color="white";break}if(!document.querySelector("#notification-styles")){const Ie=document.createElement("style");Ie.id="notification-styles",Ie.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(Ie)}document.body.appendChild(Q),setTimeout(()=>{Q.style.animation="slideOut 0.3s ease",setTimeout(()=>{Q.parentNode&&Q.parentNode.removeChild(Q)},300)},3e3)},yt=()=>{l.value="",h.value="",j("内容已清空","info")},It=(fe,J,Q=null)=>{const Ie={title:fe,content:J,mindmapId:Q,timestamp:new Date};v.value.unshift(Ie),v.value.length>10&&(v.value=v.value.slice(0,10)),localStorage.setItem("ai-sidebar-history",JSON.stringify(v.value))},bt=async fe=>{fe.mindmapId?window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{mindmapId:fe.mindmapId,title:fe.title}})):(l.value=fe.content,await Le(),window.dispatchEvent(new CustomEvent("loadMindmapFromHistory",{detail:{markdown:fe.content,json:h.value,title:fe.title}})))},Mt=fe=>new Date(fe).toLocaleString("zh-CN");Xc(()=>{const fe=localStorage.getItem("ai-sidebar-history");if(fe)try{v.value=JSON.parse(fe)}catch(J){console.error("加载历史记录失败:",J)}window.addEventListener("add-to-history",J=>{const{title:Q,content:Ie,timestamp:de}=J.detail;It(Q,Ie,null)}),window.addEventListener("mindmap-saved",J=>{const{mindmapId:Q,title:Ie,timestamp:de}=J.detail,W=v.value.find(Z=>Z.title===Ie||Z.timestamp&&Math.abs(Z.timestamp-de)<5e3);W?(W.mindmapId=Q,localStorage.setItem("ai-sidebar-history",JSON.stringify(v.value))):It(Ie,"",Q)}),xs(a,(J,Q)=>{}),xs(l,(J,Q)=>{})});const se=async()=>{try{const fe=await fetch("http://127.0.0.1:8000/api/ai/test-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({test:"data"})});if(!fe.ok)throw new Error(`HTTP error! status: ${fe.status}`);const J=fe.body.getReader(),Q=new TextDecoder;let Ie="";for(;;){const{done:de,value:W}=await J.read();if(de)break;Ie+=Q.decode(W,{stream:!0});const Z=Ie.split(`
|
|||
|
|
`);Ie=Z.pop()||"";for(const ge of Z)if(ge.startsWith("data: "))try{const ce=JSON.parse(ge.slice(6))}catch(ce){console.warn("解析测试数据失败:",ce)}}}catch(fe){console.error("❌ 测试流式API失败:",fe)}};return window.testStreamAPI=se,Ql(()=>{}),(fe,J)=>(on(),yn("div",xC,[Fe("div",{class:"sidebar-toggle",onClick:S,title:r.value?"展开AI助手":"折叠AI助手",style:Ts({left:r.value?"10px":"420px"})},[r.value?(on(),yn("svg",SC,[...J[1]||(J[1]=[Fe("path",{d:"M9 18l6-6-6-6"},null,-1)])])):(on(),yn("svg",EC,[...J[2]||(J[2]=[Fe("path",{d:"M15 18l-6-6 6-6"},null,-1)])]))],12,kC),Fe("div",{class:Xo(["ai-sidebar",{"sidebar-collapsed":r.value}])},[ep(Fe("div",TC,[J[12]||(J[12]=Fe("div",{class:"sidebar-header"},[Fe("h3",null,"🤖 AI 助手"),Fe("p",null,"文档转思维导图工具"),Fe("div",{class:"collapse-hint"},[Fe("small",null,"💡 点击右侧按钮可折叠侧边栏")])],-1)),Fe("div",AC,[J[6]||(J[6]=Fe("h4",null,"📁 生成思维导图",-1)),Fe("div",MC,[J[4]||(J[4]=Fe("label",null,"上传文件:",-1)),Fe("div",{class:"file-upload-area",onDrop:C,onDragover:A,onDragleave:T},[Fe("input",{type:"file",ref_key:"fileInput",ref:x,onChange:k,accept:".txt,.md,.doc,.docx,.pdf",class:"file-input"},null,544),Fe("div",{class:Xo(["file-upload-placeholder",{"drag-over":b.value}])},[...J[3]||(J[3]=[Fe("span",{class:"upload-icon"},"📎",-1),Fe("span",{class:"upload-text"},"点击选择文件或拖拽文件到此处",-1),Fe("span",{class:"upload-hint"},"支持 .txt, .md, .doc, .docx, .pdf 格式",-1)])],2)],32)]),w.value?(on(),yn("div",CC,[Fe("div",LC,[Fe("div",_C,[Fe("span",NC,"📄 "+Qi(w.value.name),1),Fe("span",DC,"("+Qi(y(w.value.size))+")",1)]),Fe("button",{onClick:M,class:"btn-remove",title:"删除文件"},[...J[5]||(J[5]=[Fe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[Fe("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)])])])])):ni("",!0),Fe("div",RC,[Fe("button",{onClick:N,disabled:!w.value||c.value,class:"btn-primary"},[c.value?(on(),yn("span",IC,"AI生成中...")):(on(),yn("span",HC,"AI生成思维导图"))],8,OC)])]),v.value.length>0?(on(),yn("div",PC,[J[7]||(J[7]=Fe("h4",null,"📚 历史记录",-1)),Fe("div",zC,[(on(!0),yn(ea,null,R5(v.value,(Q,Ie)=>(on(),yn("div",{key:Ie,class:"history-item",onClick:de=>bt(Q)},[Fe("div",FC,Qi(Q.title),1),Fe("div",qC,Qi(Mt(Q.timestamp)),1)],8,BC))),128))])])):ni("",!0),Fe("div",jC,[J[9]||(J[9]=Fe("h4",null,"📝 AI生成的Markdown结果",-1)),Fe("div",$C,[J[8]||(J[8]=Fe("label",null,"Markdown内容:",-1)),ep(Fe("textarea",{"onUpdate:modelValue":J[0]||(J[0]=Q=>l.value=Q),placeholder:"AI生成的Markdown内容将显示在这里",rows:"6",readonly:"",class:"markdown-result"},null,512),[[Yv,l.value]])]),Fe("div",UC,[Fe("button",{onClick:Le,disabled:p.value,class:"btn-secondary"},[p.value?(on(),yn("span",WC,"转换中...")):(on(),yn("span",GC,"🔄 转换为JSON"))],8,VC),Fe("button",{onClick:yt,class:"btn-clear"},"清空"),Fe("button",{onClick:nt,class:"btn-copy"},"📋 复制Markdown")])]),Fe("div",KC,[J[11]||(J[11]=Fe("h4",null,"📊 Markdown转JSON结果",-1)),g.value?(on(),yn("div",XC,[J[10]||(J[10]=Fe("div",{class:"spinner"},null,-1)),Fe("span",null,Qi(m.value),1)])):ni("",!0),Fe("div",ZC,[Fe("pre",YC,Qi(h.value||"JSON转换结果将显示在这里"),1),Fe("div",JC,[Fe("button",{onClick:ut,class:"btn-copy"},"📋 复制JSON"),Fe("button",{onClick:je,disabled:g.value,class:"btn-copy"},Qi(g.value?"处理中...":"👁️ 预览"),9,QC)])])])],512),[[Ly,!r.value]])],2)]))}},tL=bf(eL,[["__scopeId","data-v-9f62a011"]]);const nL={id:"app"},rL={class:"main-content"},iL={__name:"App",setup(t){const e=Lt(null),n=()=>{e.value&&e.value.showMindMapPage()};return(r,a)=>(on(),yn("div",nL,[a[0]||(a[0]=gf("« ",-1)),bi(tL,{onStartRealtimeGeneration:n}),Fe("div",rL,[bi(wC,{ref_key:"mindMapRef",ref:e},null,512)])]))}};Xy(iL).mount("#app");export{sp as _,lp as c,oL as g};
|