| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- var Bi=Object.defineProperty,Ui=Object.defineProperties;var Vi=Object.getOwnPropertyDescriptors;var Wn=Object.getOwnPropertySymbols;var Yi=Object.prototype.hasOwnProperty,qi=Object.prototype.propertyIsEnumerable;var Fn=(xe,Me,Ee)=>Me in xe?Bi(xe,Me,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):xe[Me]=Ee,Bt=(xe,Me)=>{for(var Ee in Me||(Me={}))Yi.call(Me,Ee)&&Fn(xe,Ee,Me[Ee]);if(Wn)for(var Ee of Wn(Me))qi.call(Me,Ee)&&Fn(xe,Ee,Me[Ee]);return xe},zn=(xe,Me)=>Ui(xe,Vi(Me));import{O as Ki,m as Zn,aD as Gn}from"./entry/index-CRWhxBeP.js";import{c as Jn,b as Xn}from"./antd-BfqWtMX3.js";import{b as Wi}from"./index-CD5zFmZN.js";import{d as $n,K as Fi,f as pt,w as Ut,c as zi,u as ht,j as Qn,Q as er,Z as tr,_ as nr,y as Zi,a1 as Gi}from"./vue-DM5HGU8Z.js";import{o as rr}from"./onMountedOrActivated-Ckq_czNf.js";navigator.mediaDevices||(navigator.mediaDevices={},navigator.mediaDevices.getUserMedia||(navigator.mediaDevices.getUserMedia=function(xe){const Me=navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return Me?new Promise(function(Ee,je){Me.call(navigator,xe,Ee,je)}):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}));var ir={exports:{}};/*!
- * Vditor v3.10.8 - 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(xe,Me){(function(je,te){xe.exports=te()})(Jn,()=>(()=>{var Ee={192:se=>{var E=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},x=-1,V=1,j=0;E.Diff=function(c,l){return[c,l]},E.prototype.diff_main=function(c,l,g,p){typeof p=="undefined"&&(this.Diff_Timeout<=0?p=Number.MAX_VALUE:p=new Date().getTime()+this.Diff_Timeout*1e3);var m=p;if(c==null||l==null)throw new Error("Null input. (diff_main)");if(c==l)return c?[new E.Diff(j,c)]:[];typeof g=="undefined"&&(g=!0);var u=g,S=this.diff_commonPrefix(c,l),b=c.substring(0,S);c=c.substring(S),l=l.substring(S),S=this.diff_commonSuffix(c,l);var y=c.substring(c.length-S);c=c.substring(0,c.length-S),l=l.substring(0,l.length-S);var w=this.diff_compute_(c,l,u,m);return b&&w.unshift(new E.Diff(j,b)),y&&w.push(new E.Diff(j,y)),this.diff_cleanupMerge(w),w},E.prototype.diff_compute_=function(c,l,g,p){var m;if(!c)return[new E.Diff(V,l)];if(!l)return[new E.Diff(x,c)];var u=c.length>l.length?c:l,S=c.length>l.length?l:c,b=u.indexOf(S);if(b!=-1)return m=[new E.Diff(V,u.substring(0,b)),new E.Diff(j,S),new E.Diff(V,u.substring(b+S.length))],c.length>l.length&&(m[0][0]=m[2][0]=x),m;if(S.length==1)return[new E.Diff(x,c),new E.Diff(V,l)];var y=this.diff_halfMatch_(c,l);if(y){var w=y[0],s=y[1],L=y[2],U=y[3],Y=y[4],H=this.diff_main(w,L,g,p),Q=this.diff_main(s,U,g,p);return H.concat([new E.Diff(j,Y)],Q)}return g&&c.length>100&&l.length>100?this.diff_lineMode_(c,l,p):this.diff_bisect_(c,l,p)},E.prototype.diff_lineMode_=function(c,l,g){var p=this.diff_linesToChars_(c,l);c=p.chars1,l=p.chars2;var m=p.lineArray,u=this.diff_main(c,l,!1,g);this.diff_charsToLines_(u,m),this.diff_cleanupSemantic(u),u.push(new E.Diff(j,""));for(var S=0,b=0,y=0,w="",s="";S<u.length;){switch(u[S][0]){case V:y++,s+=u[S][1];break;case x:b++,w+=u[S][1];break;case j:if(b>=1&&y>=1){u.splice(S-b-y,b+y),S=S-b-y;for(var L=this.diff_main(w,s,!1,g),U=L.length-1;U>=0;U--)u.splice(S,0,L[U]);S=S+L.length}y=0,b=0,w="",s="";break}S++}return u.pop(),u},E.prototype.diff_bisect_=function(c,l,g){for(var p=c.length,m=l.length,u=Math.ceil((p+m)/2),S=u,b=2*u,y=new Array(b),w=new Array(b),s=0;s<b;s++)y[s]=-1,w[s]=-1;y[S+1]=0,w[S+1]=0;for(var L=p-m,U=L%2!=0,Y=0,H=0,Q=0,ne=0,oe=0;oe<u&&!(new Date().getTime()>g);oe++){for(var pe=-oe+Y;pe<=oe-H;pe+=2){var ye=S+pe,ve;pe==-oe||pe!=oe&&y[ye-1]<y[ye+1]?ve=y[ye+1]:ve=y[ye-1]+1;for(var Ce=ve-pe;ve<p&&Ce<m&&c.charAt(ve)==l.charAt(Ce);)ve++,Ce++;if(y[ye]=ve,ve>p)H+=2;else if(Ce>m)Y+=2;else if(U){var ke=S+L-pe;if(ke>=0&&ke<b&&w[ke]!=-1){var Te=p-w[ke];if(ve>=Te)return this.diff_bisectSplit_(c,l,ve,Ce,g)}}}for(var De=-oe+Q;De<=oe-ne;De+=2){var ke=S+De,Te;De==-oe||De!=oe&&w[ke-1]<w[ke+1]?Te=w[ke+1]:Te=w[ke-1]+1;for(var Be=Te-De;Te<p&&Be<m&&c.charAt(p-Te-1)==l.charAt(m-Be-1);)Te++,Be++;if(w[ke]=Te,Te>p)ne+=2;else if(Be>m)Q+=2;else if(!U){var ye=S+L-De;if(ye>=0&&ye<b&&y[ye]!=-1){var ve=y[ye],Ce=S+ve-ye;if(Te=p-Te,ve>=Te)return this.diff_bisectSplit_(c,l,ve,Ce,g)}}}}return[new E.Diff(x,c),new E.Diff(V,l)]},E.prototype.diff_bisectSplit_=function(c,l,g,p,m){var u=c.substring(0,g),S=l.substring(0,p),b=c.substring(g),y=l.substring(p),w=this.diff_main(u,S,!1,m),s=this.diff_main(b,y,!1,m);return w.concat(s)},E.prototype.diff_linesToChars_=function(c,l){var g=[],p={};g[0]="";function m(y){for(var w="",s=0,L=-1,U=g.length;L<y.length-1;){L=y.indexOf(`
- `,s),L==-1&&(L=y.length-1);var Y=y.substring(s,L+1);(p.hasOwnProperty?p.hasOwnProperty(Y):p[Y]!==void 0)?w+=String.fromCharCode(p[Y]):(U==u&&(Y=y.substring(s),L=y.length),w+=String.fromCharCode(U),p[Y]=U,g[U++]=Y),s=L+1}return w}var u=4e4,S=m(c);u=65535;var b=m(l);return{chars1:S,chars2:b,lineArray:g}},E.prototype.diff_charsToLines_=function(c,l){for(var g=0;g<c.length;g++){for(var p=c[g][1],m=[],u=0;u<p.length;u++)m[u]=l[p.charCodeAt(u)];c[g][1]=m.join("")}},E.prototype.diff_commonPrefix=function(c,l){if(!c||!l||c.charAt(0)!=l.charAt(0))return 0;for(var g=0,p=Math.min(c.length,l.length),m=p,u=0;g<m;)c.substring(u,m)==l.substring(u,m)?(g=m,u=g):p=m,m=Math.floor((p-g)/2+g);return m},E.prototype.diff_commonSuffix=function(c,l){if(!c||!l||c.charAt(c.length-1)!=l.charAt(l.length-1))return 0;for(var g=0,p=Math.min(c.length,l.length),m=p,u=0;g<m;)c.substring(c.length-m,c.length-u)==l.substring(l.length-m,l.length-u)?(g=m,u=g):p=m,m=Math.floor((p-g)/2+g);return m},E.prototype.diff_commonOverlap_=function(c,l){var g=c.length,p=l.length;if(g==0||p==0)return 0;g>p?c=c.substring(g-p):g<p&&(l=l.substring(0,g));var m=Math.min(g,p);if(c==l)return m;for(var u=0,S=1;;){var b=c.substring(m-S),y=l.indexOf(b);if(y==-1)return u;S+=y,(y==0||c.substring(m-S)==l.substring(0,S))&&(u=S,S++)}},E.prototype.diff_halfMatch_=function(c,l){if(this.Diff_Timeout<=0)return null;var g=c.length>l.length?c:l,p=c.length>l.length?l:c;if(g.length<4||p.length*2<g.length)return null;var m=this;function u(H,Q,ne){for(var oe=H.substring(ne,ne+Math.floor(H.length/4)),pe=-1,ye="",ve,Ce,ke,Te;(pe=Q.indexOf(oe,pe+1))!=-1;){var De=m.diff_commonPrefix(H.substring(ne),Q.substring(pe)),Be=m.diff_commonSuffix(H.substring(0,ne),Q.substring(0,pe));ye.length<Be+De&&(ye=Q.substring(pe-Be,pe)+Q.substring(pe,pe+De),ve=H.substring(0,ne-Be),Ce=H.substring(ne+De),ke=Q.substring(0,pe-Be),Te=Q.substring(pe+De))}return ye.length*2>=H.length?[ve,Ce,ke,Te,ye]:null}var S=u(g,p,Math.ceil(g.length/4)),b=u(g,p,Math.ceil(g.length/2)),y;if(!S&&!b)return null;b?S?y=S[4].length>b[4].length?S:b:y=b:y=S;var w,s,L,U;c.length>l.length?(w=y[0],s=y[1],L=y[2],U=y[3]):(L=y[0],U=y[1],w=y[2],s=y[3]);var Y=y[4];return[w,s,L,U,Y]},E.prototype.diff_cleanupSemantic=function(c){for(var l=!1,g=[],p=0,m=null,u=0,S=0,b=0,y=0,w=0;u<c.length;)c[u][0]==j?(g[p++]=u,S=y,b=w,y=0,w=0,m=c[u][1]):(c[u][0]==V?y+=c[u][1].length:w+=c[u][1].length,m&&m.length<=Math.max(S,b)&&m.length<=Math.max(y,w)&&(c.splice(g[p-1],0,new E.Diff(x,m)),c[g[p-1]+1][0]=V,p--,p--,u=p>0?g[p-1]:-1,S=0,b=0,y=0,w=0,m=null,l=!0)),u++;for(l&&this.diff_cleanupMerge(c),this.diff_cleanupSemanticLossless(c),u=1;u<c.length;){if(c[u-1][0]==x&&c[u][0]==V){var s=c[u-1][1],L=c[u][1],U=this.diff_commonOverlap_(s,L),Y=this.diff_commonOverlap_(L,s);U>=Y?(U>=s.length/2||U>=L.length/2)&&(c.splice(u,0,new E.Diff(j,L.substring(0,U))),c[u-1][1]=s.substring(0,s.length-U),c[u+1][1]=L.substring(U),u++):(Y>=s.length/2||Y>=L.length/2)&&(c.splice(u,0,new E.Diff(j,s.substring(0,Y))),c[u-1][0]=V,c[u-1][1]=L.substring(0,L.length-Y),c[u+1][0]=x,c[u+1][1]=s.substring(Y),u++),u++}u++}},E.prototype.diff_cleanupSemanticLossless=function(c){function l(Y,H){if(!Y||!H)return 6;var Q=Y.charAt(Y.length-1),ne=H.charAt(0),oe=Q.match(E.nonAlphaNumericRegex_),pe=ne.match(E.nonAlphaNumericRegex_),ye=oe&&Q.match(E.whitespaceRegex_),ve=pe&&ne.match(E.whitespaceRegex_),Ce=ye&&Q.match(E.linebreakRegex_),ke=ve&&ne.match(E.linebreakRegex_),Te=Ce&&Y.match(E.blanklineEndRegex_),De=ke&&H.match(E.blanklineStartRegex_);return Te||De?5:Ce||ke?4:oe&&!ye&&ve?3:ye||ve?2:oe||pe?1:0}for(var g=1;g<c.length-1;){if(c[g-1][0]==j&&c[g+1][0]==j){var p=c[g-1][1],m=c[g][1],u=c[g+1][1],S=this.diff_commonSuffix(p,m);if(S){var b=m.substring(m.length-S);p=p.substring(0,p.length-S),m=b+m.substring(0,m.length-S),u=b+u}for(var y=p,w=m,s=u,L=l(p,m)+l(m,u);m.charAt(0)===u.charAt(0);){p+=m.charAt(0),m=m.substring(1)+u.charAt(0),u=u.substring(1);var U=l(p,m)+l(m,u);U>=L&&(L=U,y=p,w=m,s=u)}c[g-1][1]!=y&&(y?c[g-1][1]=y:(c.splice(g-1,1),g--),c[g][1]=w,s?c[g+1][1]=s:(c.splice(g+1,1),g--))}g++}},E.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,E.whitespaceRegex_=/\s/,E.linebreakRegex_=/[\r\n]/,E.blanklineEndRegex_=/\n\r?\n$/,E.blanklineStartRegex_=/^\r?\n\r?\n/,E.prototype.diff_cleanupEfficiency=function(c){for(var l=!1,g=[],p=0,m=null,u=0,S=!1,b=!1,y=!1,w=!1;u<c.length;)c[u][0]==j?(c[u][1].length<this.Diff_EditCost&&(y||w)?(g[p++]=u,S=y,b=w,m=c[u][1]):(p=0,m=null),y=w=!1):(c[u][0]==x?w=!0:y=!0,m&&(S&&b&&y&&w||m.length<this.Diff_EditCost/2&&S+b+y+w==3)&&(c.splice(g[p-1],0,new E.Diff(x,m)),c[g[p-1]+1][0]=V,p--,m=null,S&&b?(y=w=!0,p=0):(p--,u=p>0?g[p-1]:-1,y=w=!1),l=!0)),u++;l&&this.diff_cleanupMerge(c)},E.prototype.diff_cleanupMerge=function(c){c.push(new E.Diff(j,""));for(var l=0,g=0,p=0,m="",u="",S;l<c.length;)switch(c[l][0]){case V:p++,u+=c[l][1],l++;break;case x:g++,m+=c[l][1],l++;break;case j:g+p>1?(g!==0&&p!==0&&(S=this.diff_commonPrefix(u,m),S!==0&&(l-g-p>0&&c[l-g-p-1][0]==j?c[l-g-p-1][1]+=u.substring(0,S):(c.splice(0,0,new E.Diff(j,u.substring(0,S))),l++),u=u.substring(S),m=m.substring(S)),S=this.diff_commonSuffix(u,m),S!==0&&(c[l][1]=u.substring(u.length-S)+c[l][1],u=u.substring(0,u.length-S),m=m.substring(0,m.length-S))),l-=g+p,c.splice(l,g+p),m.length&&(c.splice(l,0,new E.Diff(x,m)),l++),u.length&&(c.splice(l,0,new E.Diff(V,u)),l++),l++):l!==0&&c[l-1][0]==j?(c[l-1][1]+=c[l][1],c.splice(l,1)):l++,p=0,g=0,m="",u="";break}c[c.length-1][1]===""&&c.pop();var b=!1;for(l=1;l<c.length-1;)c[l-1][0]==j&&c[l+1][0]==j&&(c[l][1].substring(c[l][1].length-c[l-1][1].length)==c[l-1][1]?(c[l][1]=c[l-1][1]+c[l][1].substring(0,c[l][1].length-c[l-1][1].length),c[l+1][1]=c[l-1][1]+c[l+1][1],c.splice(l-1,1),b=!0):c[l][1].substring(0,c[l+1][1].length)==c[l+1][1]&&(c[l-1][1]+=c[l+1][1],c[l][1]=c[l][1].substring(c[l+1][1].length)+c[l+1][1],c.splice(l+1,1),b=!0)),l++;b&&this.diff_cleanupMerge(c)},E.prototype.diff_xIndex=function(c,l){var g=0,p=0,m=0,u=0,S;for(S=0;S<c.length&&(c[S][0]!==V&&(g+=c[S][1].length),c[S][0]!==x&&(p+=c[S][1].length),!(g>l));S++)m=g,u=p;return c.length!=S&&c[S][0]===x?u:u+(l-m)},E.prototype.diff_prettyHtml=function(c){for(var l=[],g=/&/g,p=/</g,m=/>/g,u=/\n/g,S=0;S<c.length;S++){var b=c[S][0],y=c[S][1],w=y.replace(g,"&").replace(p,"<").replace(m,">").replace(u,"¶<br>");switch(b){case V:l[S]='<ins style="background:#e6ffe6;">'+w+"</ins>";break;case x:l[S]='<del style="background:#ffe6e6;">'+w+"</del>";break;case j:l[S]="<span>"+w+"</span>";break}}return l.join("")},E.prototype.diff_text1=function(c){for(var l=[],g=0;g<c.length;g++)c[g][0]!==V&&(l[g]=c[g][1]);return l.join("")},E.prototype.diff_text2=function(c){for(var l=[],g=0;g<c.length;g++)c[g][0]!==x&&(l[g]=c[g][1]);return l.join("")},E.prototype.diff_levenshtein=function(c){for(var l=0,g=0,p=0,m=0;m<c.length;m++){var u=c[m][0],S=c[m][1];switch(u){case V:g+=S.length;break;case x:p+=S.length;break;case j:l+=Math.max(g,p),g=0,p=0;break}}return l+=Math.max(g,p),l},E.prototype.diff_toDelta=function(c){for(var l=[],g=0;g<c.length;g++)switch(c[g][0]){case V:l[g]="+"+encodeURI(c[g][1]);break;case x:l[g]="-"+c[g][1].length;break;case j:l[g]="="+c[g][1].length;break}return l.join(" ").replace(/%20/g," ")},E.prototype.diff_fromDelta=function(c,l){for(var g=[],p=0,m=0,u=l.split(/\t/g),S=0;S<u.length;S++){var b=u[S].substring(1);switch(u[S].charAt(0)){case"+":try{g[p++]=new E.Diff(V,decodeURI(b))}catch(s){throw new Error("Illegal escape in diff_fromDelta: "+b)}break;case"-":case"=":var y=parseInt(b,10);if(isNaN(y)||y<0)throw new Error("Invalid number in diff_fromDelta: "+b);var w=c.substring(m,m+=y);u[S].charAt(0)=="="?g[p++]=new E.Diff(j,w):g[p++]=new E.Diff(x,w);break;default:if(u[S])throw new Error("Invalid diff operation in diff_fromDelta: "+u[S])}}if(m!=c.length)throw new Error("Delta length ("+m+") does not equal source text length ("+c.length+").");return g},E.prototype.match_main=function(c,l,g){if(c==null||l==null||g==null)throw new Error("Null input. (match_main)");return g=Math.max(0,Math.min(g,c.length)),c==l?0:c.length?c.substring(g,g+l.length)==l?g:this.match_bitap_(c,l,g):-1},E.prototype.match_bitap_=function(c,l,g){if(l.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var p=this.match_alphabet_(l),m=this;function u(ve,Ce){var ke=ve/l.length,Te=Math.abs(g-Ce);return m.Match_Distance?ke+Te/m.Match_Distance:Te?1:ke}var S=this.Match_Threshold,b=c.indexOf(l,g);b!=-1&&(S=Math.min(u(0,b),S),b=c.lastIndexOf(l,g+l.length),b!=-1&&(S=Math.min(u(0,b),S)));var y=1<<l.length-1;b=-1;for(var w,s,L=l.length+c.length,U,Y=0;Y<l.length;Y++){for(w=0,s=L;w<s;)u(Y,g+s)<=S?w=s:L=s,s=Math.floor((L-w)/2+w);L=s;var H=Math.max(1,g-s+1),Q=Math.min(g+s,c.length)+l.length,ne=Array(Q+2);ne[Q+1]=(1<<Y)-1;for(var oe=Q;oe>=H;oe--){var pe=p[c.charAt(oe-1)];if(Y===0?ne[oe]=(ne[oe+1]<<1|1)&pe:ne[oe]=(ne[oe+1]<<1|1)&pe|((U[oe+1]|U[oe])<<1|1)|U[oe+1],ne[oe]&y){var ye=u(Y,oe-1);if(ye<=S)if(S=ye,b=oe-1,b>g)H=Math.max(1,2*g-b);else break}}if(u(Y+1,g)>S)break;U=ne}return b},E.prototype.match_alphabet_=function(c){for(var l={},g=0;g<c.length;g++)l[c.charAt(g)]=0;for(var g=0;g<c.length;g++)l[c.charAt(g)]|=1<<c.length-g-1;return l},E.prototype.patch_addContext_=function(c,l){if(l.length!=0){if(c.start2===null)throw Error("patch not initialized");for(var g=l.substring(c.start2,c.start2+c.length1),p=0;l.indexOf(g)!=l.lastIndexOf(g)&&g.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)p+=this.Patch_Margin,g=l.substring(c.start2-p,c.start2+c.length1+p);p+=this.Patch_Margin;var m=l.substring(c.start2-p,c.start2);m&&c.diffs.unshift(new E.Diff(j,m));var u=l.substring(c.start2+c.length1,c.start2+c.length1+p);u&&c.diffs.push(new E.Diff(j,u)),c.start1-=m.length,c.start2-=m.length,c.length1+=m.length+u.length,c.length2+=m.length+u.length}},E.prototype.patch_make=function(c,l,g){var p,m;if(typeof c=="string"&&typeof l=="string"&&typeof g=="undefined")p=c,m=this.diff_main(p,l,!0),m.length>2&&(this.diff_cleanupSemantic(m),this.diff_cleanupEfficiency(m));else if(c&&typeof c=="object"&&typeof l=="undefined"&&typeof g=="undefined")m=c,p=this.diff_text1(m);else if(typeof c=="string"&&l&&typeof l=="object"&&typeof g=="undefined")p=c,m=l;else if(typeof c=="string"&&typeof l=="string"&&g&&typeof g=="object")p=c,m=g;else throw new Error("Unknown call format to patch_make.");if(m.length===0)return[];for(var u=[],S=new E.patch_obj,b=0,y=0,w=0,s=p,L=p,U=0;U<m.length;U++){var Y=m[U][0],H=m[U][1];switch(!b&&Y!==j&&(S.start1=y,S.start2=w),Y){case V:S.diffs[b++]=m[U],S.length2+=H.length,L=L.substring(0,w)+H+L.substring(w);break;case x:S.length1+=H.length,S.diffs[b++]=m[U],L=L.substring(0,w)+L.substring(w+H.length);break;case j:H.length<=2*this.Patch_Margin&&b&&m.length!=U+1?(S.diffs[b++]=m[U],S.length1+=H.length,S.length2+=H.length):H.length>=2*this.Patch_Margin&&b&&(this.patch_addContext_(S,s),u.push(S),S=new E.patch_obj,b=0,s=L,y=w);break}Y!==V&&(y+=H.length),Y!==x&&(w+=H.length)}return b&&(this.patch_addContext_(S,s),u.push(S)),u},E.prototype.patch_deepCopy=function(c){for(var l=[],g=0;g<c.length;g++){var p=c[g],m=new E.patch_obj;m.diffs=[];for(var u=0;u<p.diffs.length;u++)m.diffs[u]=new E.Diff(p.diffs[u][0],p.diffs[u][1]);m.start1=p.start1,m.start2=p.start2,m.length1=p.length1,m.length2=p.length2,l[g]=m}return l},E.prototype.patch_apply=function(c,l){if(c.length==0)return[l,[]];c=this.patch_deepCopy(c);var g=this.patch_addPadding(c);l=g+l+g,this.patch_splitMax(c);for(var p=0,m=[],u=0;u<c.length;u++){var S=c[u].start2+p,b=this.diff_text1(c[u].diffs),y,w=-1;if(b.length>this.Match_MaxBits?(y=this.match_main(l,b.substring(0,this.Match_MaxBits),S),y!=-1&&(w=this.match_main(l,b.substring(b.length-this.Match_MaxBits),S+b.length-this.Match_MaxBits),(w==-1||y>=w)&&(y=-1))):y=this.match_main(l,b,S),y==-1)m[u]=!1,p-=c[u].length2-c[u].length1;else{m[u]=!0,p=y-S;var s;if(w==-1?s=l.substring(y,y+b.length):s=l.substring(y,w+this.Match_MaxBits),b==s)l=l.substring(0,y)+this.diff_text2(c[u].diffs)+l.substring(y+b.length);else{var L=this.diff_main(b,s,!1);if(b.length>this.Match_MaxBits&&this.diff_levenshtein(L)/b.length>this.Patch_DeleteThreshold)m[u]=!1;else{this.diff_cleanupSemanticLossless(L);for(var U=0,Y,H=0;H<c[u].diffs.length;H++){var Q=c[u].diffs[H];Q[0]!==j&&(Y=this.diff_xIndex(L,U)),Q[0]===V?l=l.substring(0,y+Y)+Q[1]+l.substring(y+Y):Q[0]===x&&(l=l.substring(0,y+Y)+l.substring(y+this.diff_xIndex(L,U+Q[1].length))),Q[0]!==x&&(U+=Q[1].length)}}}}}return l=l.substring(g.length,l.length-g.length),[l,m]},E.prototype.patch_addPadding=function(c){for(var l=this.Patch_Margin,g="",p=1;p<=l;p++)g+=String.fromCharCode(p);for(var p=0;p<c.length;p++)c[p].start1+=l,c[p].start2+=l;var m=c[0],u=m.diffs;if(u.length==0||u[0][0]!=j)u.unshift(new E.Diff(j,g)),m.start1-=l,m.start2-=l,m.length1+=l,m.length2+=l;else if(l>u[0][1].length){var S=l-u[0][1].length;u[0][1]=g.substring(u[0][1].length)+u[0][1],m.start1-=S,m.start2-=S,m.length1+=S,m.length2+=S}if(m=c[c.length-1],u=m.diffs,u.length==0||u[u.length-1][0]!=j)u.push(new E.Diff(j,g)),m.length1+=l,m.length2+=l;else if(l>u[u.length-1][1].length){var S=l-u[u.length-1][1].length;u[u.length-1][1]+=g.substring(0,S),m.length1+=S,m.length2+=S}return g},E.prototype.patch_splitMax=function(c){for(var l=this.Match_MaxBits,g=0;g<c.length;g++)if(!(c[g].length1<=l)){var p=c[g];c.splice(g--,1);for(var m=p.start1,u=p.start2,S="";p.diffs.length!==0;){var b=new E.patch_obj,y=!0;for(b.start1=m-S.length,b.start2=u-S.length,S!==""&&(b.length1=b.length2=S.length,b.diffs.push(new E.Diff(j,S)));p.diffs.length!==0&&b.length1<l-this.Patch_Margin;){var w=p.diffs[0][0],s=p.diffs[0][1];w===V?(b.length2+=s.length,u+=s.length,b.diffs.push(p.diffs.shift()),y=!1):w===x&&b.diffs.length==1&&b.diffs[0][0]==j&&s.length>2*l?(b.length1+=s.length,m+=s.length,y=!1,b.diffs.push(new E.Diff(w,s)),p.diffs.shift()):(s=s.substring(0,l-b.length1-this.Patch_Margin),b.length1+=s.length,m+=s.length,w===j?(b.length2+=s.length,u+=s.length):y=!1,b.diffs.push(new E.Diff(w,s)),s==p.diffs[0][1]?p.diffs.shift():p.diffs[0][1]=p.diffs[0][1].substring(s.length))}S=this.diff_text2(b.diffs),S=S.substring(S.length-this.Patch_Margin);var L=this.diff_text1(p.diffs).substring(0,this.Patch_Margin);L!==""&&(b.length1+=L.length,b.length2+=L.length,b.diffs.length!==0&&b.diffs[b.diffs.length-1][0]===j?b.diffs[b.diffs.length-1][1]+=L:b.diffs.push(new E.Diff(j,L))),y||c.splice(++g,0,b)}}},E.prototype.patch_toText=function(c){for(var l=[],g=0;g<c.length;g++)l[g]=c[g];return l.join("")},E.prototype.patch_fromText=function(c){var l=[];if(!c)return l;for(var g=c.split(`
- `),p=0,m=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;p<g.length;){var u=g[p].match(m);if(!u)throw new Error("Invalid patch string: "+g[p]);var S=new E.patch_obj;for(l.push(S),S.start1=parseInt(u[1],10),u[2]===""?(S.start1--,S.length1=1):u[2]=="0"?S.length1=0:(S.start1--,S.length1=parseInt(u[2],10)),S.start2=parseInt(u[3],10),u[4]===""?(S.start2--,S.length2=1):u[4]=="0"?S.length2=0:(S.start2--,S.length2=parseInt(u[4],10)),p++;p<g.length;){var b=g[p].charAt(0);try{var y=decodeURI(g[p].substring(1))}catch(w){throw new Error("Illegal escape in patch_fromText: "+y)}if(b=="-")S.diffs.push(new E.Diff(x,y));else if(b=="+")S.diffs.push(new E.Diff(V,y));else if(b==" ")S.diffs.push(new E.Diff(j,y));else{if(b=="@")break;if(b!=="")throw new Error('Invalid patch mode "'+b+'" in: '+y)}p++}}return l},E.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},E.patch_obj.prototype.toString=function(){var c,l;this.length1===0?c=this.start1+",0":this.length1==1?c=this.start1+1:c=this.start1+1+","+this.length1,this.length2===0?l=this.start2+",0":this.length2==1?l=this.start2+1:l=this.start2+1+","+this.length2;for(var g=["@@ -"+c+" +"+l+` @@
- `],p,m=0;m<this.diffs.length;m++){switch(this.diffs[m][0]){case V:p="+";break;case x:p="-";break;case j:p=" ";break}g[m+1]=p+encodeURI(this.diffs[m][1])+`
- `}return g.join("").replace(/%20/g," ")},se.exports=E,se.exports.diff_match_patch=E,se.exports.DIFF_DELETE=x,se.exports.DIFF_INSERT=V,se.exports.DIFF_EQUAL=j},923:(se,E,x)=>{x.d(E,{default:()=>R});var V=x(288),j=x(59),c=x(784),l=x(51),g=x(500),p=x(339),m=x(108),u=function(_){_===void 0&&(_=document);var B=function(A){var k=document.createElement("img");k.src=A.getAttribute("data-src"),k.addEventListener("load",function(){!A.getAttribute("style")&&!A.getAttribute("class")&&!A.getAttribute("width")&&!A.getAttribute("height")&&k.naturalHeight>k.naturalWidth&&k.naturalWidth/k.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&k.naturalHeight>window.innerHeight-40&&(A.style.height=window.innerHeight-40+"px"),A.src=k.src}),A.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return _.querySelectorAll("img").forEach(function(A){A.getAttribute("data-src")&&B(A)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),_.querySelectorAll("img").forEach(function(A){window.vditorImageIntersectionObserver.observe(A)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(A){A.forEach(function(k){(typeof k.isIntersecting=="undefined"?k.intersectionRatio!==0:k.isIntersecting)&&k.target.getAttribute("data-src")&&B(k.target)})}),_.querySelectorAll("img").forEach(function(A){window.vditorImageIntersectionObserver.observe(A)}))},S=x(960),b=x(0),y=x(975),w=x(931),s=x(597),L=x(162),U=x(70),Y=x(591),H=x(913),Q=x(873),ne=x(161),oe=x(598),pe=x(905),ye=function(_){document.querySelectorAll(".vditor-anchor").forEach(function(B){_===1&&B.classList.add("vditor-anchor--left"),B.onclick=function(){var A=B.getAttribute("href").substr(1),k=document.getElementById("vditorAnchor-"+A).offsetTop;document.querySelector("html").scrollTop=k}}),window.onhashchange=function(){var B=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));B&&(document.querySelector("html").scrollTop=B.offsetTop)}},ve=x(796),Ce=x(827),ke=function(_,B){if(B===void 0&&(B="zh_CN"),!(typeof speechSynthesis=="undefined"||typeof SpeechSynthesisUtterance=="undefined")){var A=function(){var P=speechSynthesis.getVoices(),C,q;return P.forEach(function(F){F.lang===B.replace("_","-")&&(C=F),F.default&&(q=F)}),C||(C=q),C},k='<svg><use xlink:href="#vditor-icon-play"></use></svg>',O='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(k='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',O='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var M=document.querySelector(".vditor-speech");M||(M=document.createElement("button"),M.className="vditor-speech",_.insertAdjacentElement("beforeend",M),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=A));var K=A(),G=new SpeechSynthesisUtterance;G.voice=K,G.onend=G.onerror=function(){M.style.display="none",speechSynthesis.cancel(),M.classList.remove("vditor-speech--current"),M.innerHTML=k},_.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(P){var C=P.target;if(C.classList.contains("vditor-speech")||C.parentElement.classList.contains("vditor-speech")){M.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),M.innerHTML=O):(speechSynthesis.pause(),M.innerHTML=k)):(G.text=M.getAttribute("data-text"),speechSynthesis.speak(G),M.classList.add("vditor-speech--current"),M.innerHTML=O),(0,Ce.jl)(window.vditorSpeechRange),_.focus();return}if(M.style.display="none",speechSynthesis.cancel(),M.classList.remove("vditor-speech--current"),M.innerHTML=k,getSelection().rangeCount!==0){var q=getSelection().getRangeAt(0),F=q.toString().trim();if(F){window.vditorSpeechRange=q.cloneRange();var le=q.getBoundingClientRect();M.innerHTML=k,M.style.display="block",M.style.top=le.top+le.height+document.querySelector("html").scrollTop-20+"px",window.ontouchstart!==void 0?M.style.left=P.changedTouches[P.changedTouches.length-1].pageX+2+"px":M.style.left=P.clientX+2+"px",M.setAttribute("data-text",F)}}})}},Te=function(_,B,A,k){function O(M){return M instanceof A?M:new A(function(K){K(M)})}return new(A||(A=Promise))(function(M,K){function G(q){try{C(k.next(q))}catch(F){K(F)}}function P(q){try{C(k.throw(q))}catch(F){K(F)}}function C(q){q.done?M(q.value):O(q.value).then(G,P)}C((k=k.apply(_,B||[])).next())})},De=function(_,B){var A={label:0,sent:function(){if(M[0]&1)throw M[1];return M[1]},trys:[],ops:[]},k,O,M,K;return K={next:G(0),throw:G(1),return:G(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function G(C){return function(q){return P([C,q])}}function P(C){if(k)throw new TypeError("Generator is already executing.");for(;K&&(K=0,C[0]&&(A=0)),A;)try{if(k=1,O&&(M=C[0]&2?O.return:C[0]?O.throw||((M=O.return)&&M.call(O),0):O.next)&&!(M=M.call(O,C[1])).done)return M;switch(O=0,M&&(C=[C[0]&2,M.value]),C[0]){case 0:case 1:M=C;break;case 4:return A.label++,{value:C[1],done:!1};case 5:A.label++,O=C[1],C=[0];continue;case 7:C=A.ops.pop(),A.trys.pop();continue;default:if(M=A.trys,!(M=M.length>0&&M[M.length-1])&&(C[0]===6||C[0]===2)){A=0;continue}if(C[0]===3&&(!M||C[1]>M[0]&&C[1]<M[3])){A.label=C[1];break}if(C[0]===6&&A.label<M[1]){A.label=M[1],M=C;break}if(M&&A.label<M[2]){A.label=M[2],A.ops.push(C);break}M[2]&&A.ops.pop(),A.trys.pop();continue}C=B.call(_,A)}catch(q){C=[6,q],O=0}finally{k=M=0}if(C[0]&5)throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}},Be=function(_){var B,A={anchor:0,cdn:H.Y.CDN,customEmoji:{},emojiPath:"".concat(H.Y.CDN,"/dist/images/emoji"),hljs:H.Y.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:H.Y.MARKDOWN_OPTIONS,math:H.Y.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:H.Y.THEME_OPTIONS};return _.cdn&&(!((B=_.theme)===null||B===void 0)&&B.path||(A.theme.path="".concat(_.cdn,"/dist/css/content-theme")),_.emojiPath||(A.emojiPath="".concat(_.cdn,"/dist/images/emoji"))),(0,pe.h)(A,_)},He=function(_,B){var A=Be(B);return(0,ne.Z)("".concat(A.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var k=(0,ve.X)({autoSpace:A.markdown.autoSpace,gfmAutoLink:A.markdown.gfmAutoLink,codeBlockPreview:A.markdown.codeBlockPreview,emojiSite:A.emojiPath,emojis:A.customEmoji,fixTermTypo:A.markdown.fixTermTypo,footnotes:A.markdown.footnotes,headingAnchor:A.anchor!==0,inlineMathDigit:A.math.inlineDigit,lazyLoadImage:A.lazyLoadImage,linkBase:A.markdown.linkBase,linkPrefix:A.markdown.linkPrefix,listStyle:A.markdown.listStyle,mark:A.markdown.mark,mathBlockPreview:A.markdown.mathBlockPreview,paragraphBeginningSpace:A.markdown.paragraphBeginningSpace,sanitize:A.markdown.sanitize,toc:A.markdown.toc});return B!=null&&B.renderers&&k.SetJSRenderers({renderers:{Md2HTML:B.renderers}}),k.SetHeadingID(!0),k.Md2HTML(_)})},v=function(_,B,A){return Te(void 0,void 0,void 0,function(){var k,O,M,K;return De(this,function(G){switch(G.label){case 0:return k=Be(A),[4,He(B,k)];case 1:if(O=G.sent(),k.transform&&(O=k.transform(O)),_.innerHTML=O,_.classList.add("vditor-reset"),k.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(k.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return M="vditorI18nScript",K=M+k.lang,document.querySelectorAll('head script[id^="'.concat(M,'"]')).forEach(function(P){P.id!==K&&document.head.removeChild(P)}),[4,(0,ne.Z)("".concat(k.cdn,"/dist/js/i18n/").concat(k.lang,".js"),K)];case 3:G.sent(),G.label=4;case 4:return[3,6];case 5:window.VditorI18n=k.i18n,G.label=6;case 6:return k.icon?[4,(0,ne.Z)("".concat(k.cdn,"/dist/js/icons/").concat(k.icon,".js"),"vditorIconScript")]:[3,8];case 7:G.sent(),G.label=8;case 8:return(0,Q.H)(k.theme.current,k.theme.path),k.anchor===1&&_.classList.add("vditor-reset--anchor"),(0,l.o)(_,k.hljs),(0,m.$)(k.hljs,_,k.cdn),(0,S.T)(_,{cdn:k.cdn,math:k.math}),(0,y.e)(_,k.cdn,k.mode),(0,w.Y)(_,k.cdn,k.mode),(0,s.K)(_,k.cdn),(0,g.D)(_,k.cdn),(0,p.m)(_,k.cdn),(0,c.v)(_,k.cdn,k.mode),(0,L.l)(_,k.cdn,k.mode),(0,Y.M)(_,k.cdn),(0,V.$)(_,k.cdn),k.render.media.enable&&(0,b.l)(_),k.speech.enable&&ke(_),k.anchor!==0&&ye(k.anchor),k.after&&k.after(),k.lazyLoadImage&&u(_),_.addEventListener("click",function(P){var C=(0,oe._Y)(P.target,"SPAN");if(C&&(0,oe.KJ)(C,"vditor-toc")){var q=_.querySelector("#"+C.getAttribute("data-target-id"));q&&window.scrollTo(window.scrollX,q.offsetTop);return}}),[2]}})})},Z=x(726),D=x(13),I=function(){function _(){}return _.adapterRender=j,_.previewImage=Z.o,_.codeRender=l.o,_.graphvizRender=p.m,_.highlightRender=m.$,_.mathRender=S.T,_.mermaidRender=y.e,_.SMILESRender=w.Y,_.markmapRender=s.K,_.flowchartRender=g.D,_.chartRender=c.v,_.abcRender=V.$,_.mindmapRender=L.l,_.plantumlRender=Y.M,_.outlineRender=U.N,_.mediaRender=b.l,_.speechRender=ke,_.lazyLoadImageRender=u,_.md2html=He,_.preview=v,_.setCodeTheme=D.h,_.setContentTheme=Q.H,_}();const R=I},913:(se,E,x)=>{x.d(E,{Y:()=>j,g:()=>V});var V="3.10.8",j=function(){function c(){}return c.ZWSP="",c.DROP_EDITOR="application/editor",c.MOBILE_WIDTH=520,c.CLASS_MENU_DISABLED="vditor-menu--disabled",c.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],c.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atelier-heath","base16/atelier-lakeside","base16/atelier-plateau","base16/atelier-savanna","base16/atelier-seaside","base16/atelier-sulphurpool","base16/atlas","base16/bespin","base16/black-metal","base16/black-metal-bathory","base16/black-metal-burzum","base16/black-metal-dark-funeral","base16/black-metal-gorgoroth","base16/black-metal-immortal","base16/black-metal-khold","base16/black-metal-marduk","base16/black-metal-mayhem","base16/black-metal-nile","base16/black-metal-venom","base16/brewer","base16/bright","base16/brogrammer","base16/brush-trees-dark","base16/chalk","base16/circus","base16/classic-dark","base16/codeschool","base16/colors","base16/danqing","base16/darcula","base16/dark-violet","base16/darkmoss","base16/darktooth","base16/decaf","base16/default-dark","base16/dracula","base16/edge-dark","base16/eighties","base16/embers","base16/equilibrium-dark","base16/equilibrium-gray-dark","base16/espresso","base16/eva","base16/eva-dim","base16/flat","base16/framer","base16/gigavolt","base16/google-dark","base16/grayscale-dark","base16/green-screen","base16/gruvbox-dark-hard","base16/gruvbox-dark-medium","base16/gruvbox-dark-pale","base16/gruvbox-dark-soft","base16/hardcore","base16/harmonic16-dark","base16/heetch-dark","base16/helios","base16/hopscotch","base16/horizon-dark","base16/humanoid-dark","base16/ia-dark","base16/icy-dark","base16/ir-black","base16/isotope","base16/kimber","base16/london-tube","base16/macintosh","base16/marrakesh","base16/materia","base16/material","base16/material-darker","base16/material-palenight","base16/material-vivid","base16/mellow-purple","base16/mocha","base16/monokai","base16/nebula","base16/nord","base16/nova","base16/ocean","base16/oceanicnext","base16/onedark","base16/outrun-dark","base16/papercolor-dark","base16/paraiso","base16/pasque","base16/phd","base16/pico","base16/pop","base16/porple","base16/qualia","base16/railscasts","base16/rebecca","base16/ros-pine","base16/ros-pine-moon","base16/sandcastle","base16/seti-ui","base16/silk-dark","base16/snazzy","base16/solar-flare","base16/solarized-dark","base16/spacemacs","base16/summercamp","base16/summerfruit-dark","base16/synth-midnight-terminal-dark","base16/tango","base16/tender","base16/tomorrow-night","base16/twilight","base16/unikitty-dark","base16/vulcan","base16/windows-10","base16/windows-95","base16/windows-high-contrast","base16/windows-nt","base16/woodland","base16/xcode-dusk","base16/zenburn","codepen-embed","dark","devibeans","far","felipec","github-dark","github-dark-dimmed","gml","gradient-dark","hybrid","ir-black","isbl-editor-dark","kimbie-dark","lioshi","monokai","monokai-sublime","night-owl","nnfx-dark","nord","obsidian","panda-syntax-dark","paraiso-dark","pojoaque","qtcreator-dark","rainbow","shades-of-purple","srcery","stackoverflow-dark","sunburst","tomorrow-night-blue","tomorrow-night-bright","tokyo-night-dark","vs2015","xt256","ant-design","a11y-light","arduino-light","ascetic","atom-one-light","base16/atelier-cave-light","base16/atelier-dune-light","base16/atelier-estuary-light","base16/atelier-forest-light","base16/atelier-heath-light","base16/atelier-lakeside-light","base16/atelier-plateau-light","base16/atelier-savanna-light","base16/atelier-seaside-light","base16/atelier-sulphurpool-light","base16/brush-trees","base16/classic-light","base16/cupcake","base16/cupertino","base16/default-light","base16/dirtysea","base16/edge-light","base16/equilibrium-gray-light","base16/equilibrium-light","base16/fruit-soda","base16/github","base16/google-light","base16/grayscale-light","base16/gruvbox-light-hard","base16/gruvbox-light-medium","base16/gruvbox-light-soft","base16/harmonic16-light","base16/heetch-light","base16/humanoid-light","base16/horizon-light","base16/ia-light","base16/material-lighter","base16/mexico-light","base16/one-light","base16/papercolor-light","base16/ros-pine-dawn","base16/sagelight","base16/shapeshifter","base16/silk-light","base16/solar-flare-light","base16/solarized-light","base16/summerfruit-light","base16/synth-midnight-terminal-light","base16/tomorrow","base16/unikitty-light","base16/windows-10-light","base16/windows-95-light","base16/windows-high-contrast-light","brown-paper","base16/windows-nt-light","color-brewer","docco","foundation","github","googlecode","gradient-light","grayscale","idea","intellij-light","isbl-editor-light","kimbie-light","lightfair","magula","mono-blue","nnfx-light","panda-syntax-light","paraiso-light","purebasic","qtcreator-light","routeros","school-book","stackoverflow-light","tokyo-night-light","vs","xcode","default"],c.ALIAS_CODE_LANGUAGES=["abc","plantuml","mermaid","flowchart","echarts","mindmap","graphviz","math","markmap","smiles","js","ts","html","toml","c#","bat"],c.CDN="https://unpkg.com/vditor@".concat("3.10.8"),c.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},c.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},c.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},c.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(c.CDN,"/dist/css/content-theme")},c}()},931:(se,E,x)=>{x.d(E,{Y:()=>g});var V=x(913),j=x(161),c=x(59),l=x(933),g=function(p,m,u){p===void 0&&(p=document),m===void 0&&(m=V.Y.CDN);var S=c.SMILESRenderAdapter.getElements(p);S.length>0&&(0,j.Z)("".concat(m,"/dist/js/smiles-drawer/smiles-drawer.min.js?v=2.1.7"),"vditorAbcjsScript").then(function(){var b=new SmiDrawer({},{});S.forEach(function(y){var w=c.SMILESRenderAdapter.getCode(y).trim();if(!(y.getAttribute("data-processed")==="true"||w.trim()==="")){var s="smiles"+(0,l.Ee)();y.innerHTML='<svg id="'.concat(s,'"></svg>'),b.draw(w,"#"+s,u==="dark"?"dark":void 0),y.setAttribute("data-processed","true")}})})}},288:(se,E,x)=>{x.d(E,{$:()=>l});var V=x(913),j=x(161),c=x(59),l=function(g,p){g===void 0&&(g=document),p===void 0&&(p=V.Y.CDN);var m=c.abcRenderAdapter.getElements(g);m.length>0&&(0,j.Z)("".concat(p,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){m.forEach(function(u){u.parentElement.classList.contains("vditor-wysiwyg__pre")||u.parentElement.classList.contains("vditor-ir__marker--pre")||u.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(u,c.abcRenderAdapter.getCode(u).trim()),u.style.overflowX="auto",u.setAttribute("data-processed","true"))})})}},59:(se,E,x)=>{x.r(E),x.d(E,{SMILESRenderAdapter:()=>j,abcRenderAdapter:()=>m,chartRenderAdapter:()=>p,flowchartRenderAdapter:()=>S,graphvizRenderAdapter:()=>u,markmapRenderAdapter:()=>l,mathRenderAdapter:()=>V,mermaidRenderAdapter:()=>c,mindmapRenderAdapter:()=>g,plantumlRenderAdapter:()=>b});var V={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-math")}},j={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-smiles")}},c={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-mermaid")}},l={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-markmap")}},g={getCode:function(y){return y.getAttribute("data-code")},getElements:function(y){return y.querySelectorAll(".language-mindmap")}},p={getCode:function(y){return y.innerText},getElements:function(y){return y.querySelectorAll(".language-echarts")}},m={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-abc")}},u={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-graphviz")}},S={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-flowchart")}},b={getCode:function(y){return y.textContent},getElements:function(y){return y.querySelectorAll(".language-plantuml")}}},784:(se,E,x)=>{x.d(E,{v:()=>m});var V=x(913),j=x(161),c=x(59),l=x(933),g=function(u,S,b,y){function w(s){return s instanceof b?s:new b(function(L){L(s)})}return new(b||(b=Promise))(function(s,L){function U(Q){try{H(y.next(Q))}catch(ne){L(ne)}}function Y(Q){try{H(y.throw(Q))}catch(ne){L(ne)}}function H(Q){Q.done?s(Q.value):w(Q.value).then(U,Y)}H((y=y.apply(u,S||[])).next())})},p=function(u,S){var b={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},y,w,s,L;return L={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function U(H){return function(Q){return Y([H,Q])}}function Y(H){if(y)throw new TypeError("Generator is already executing.");for(;L&&(L=0,H[0]&&(b=0)),b;)try{if(y=1,w&&(s=H[0]&2?w.return:H[0]?w.throw||((s=w.return)&&s.call(w),0):w.next)&&!(s=s.call(w,H[1])).done)return s;switch(w=0,s&&(H=[H[0]&2,s.value]),H[0]){case 0:case 1:s=H;break;case 4:return b.label++,{value:H[1],done:!1};case 5:b.label++,w=H[1],H=[0];continue;case 7:H=b.ops.pop(),b.trys.pop();continue;default:if(s=b.trys,!(s=s.length>0&&s[s.length-1])&&(H[0]===6||H[0]===2)){b=0;continue}if(H[0]===3&&(!s||H[1]>s[0]&&H[1]<s[3])){b.label=H[1];break}if(H[0]===6&&b.label<s[1]){b.label=s[1],s=H;break}if(s&&b.label<s[2]){b.label=s[2],b.ops.push(H);break}s[2]&&b.ops.pop(),b.trys.pop();continue}H=S.call(u,b)}catch(Q){H=[6,Q],w=0}finally{y=s=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}},m=function(u,S,b){u===void 0&&(u=document),S===void 0&&(S=V.Y.CDN);var y=c.chartRenderAdapter.getElements(u);y.length>0&&(0,j.Z)("".concat(S,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){y.forEach(function(w){return g(void 0,void 0,void 0,function(){var s,L,U;return p(this,function(Y){switch(Y.label){case 0:if(w.parentElement.classList.contains("vditor-wysiwyg__pre")||w.parentElement.classList.contains("vditor-ir__marker--pre"))return[2];if(s=c.chartRenderAdapter.getCode(w).trim(),!s)return[2];Y.label=1;case 1:return Y.trys.push([1,3,,4]),w.getAttribute("data-processed")==="true"?[2]:[4,(0,l.kY)(s)];case 2:return L=Y.sent(),echarts.init(w,b==="dark"?"dark":void 0).setOption(L),w.setAttribute("data-processed","true"),[3,4];case 3:return U=Y.sent(),w.className="vditor-reset--error",w.innerHTML="echarts render error: <br>".concat(U),[3,4];case 4:return[2]}})})})})}},51:(se,E,x)=>{x.d(E,{o:()=>c});var V=x(695),j=x(913),c=function(l,g){Array.from(l.querySelectorAll("pre > code")).filter(function(p,m){return!(p.parentElement.classList.contains("vditor-wysiwyg__pre")||p.parentElement.classList.contains("vditor-ir__marker--pre")||p.classList.contains("language-mermaid")||p.classList.contains("language-flowchart")||p.classList.contains("language-echarts")||p.classList.contains("language-mindmap")||p.classList.contains("language-plantuml")||p.classList.contains("language-markmap")||p.classList.contains("language-abc")||p.classList.contains("language-graphviz")||p.classList.contains("language-math")||p.classList.contains("language-smiles")||p.style.maxHeight.indexOf("px")>-1||l.classList.contains("vditor-preview")&&m>5)}).forEach(function(p){var m,u,S,b=p.innerText;if(p.classList.contains("highlight-chroma")){var y=p.cloneNode(!0);y.querySelectorAll(".highlight-ln").forEach(function(U){U.remove()}),b=y.innerText}else b.endsWith(`
- `)&&(b=b.substr(0,b.length-1));var w='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(w='<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 s=document.createElement("div");s.className="vditor-copy",s.innerHTML='<span aria-label="'.concat(((m=window.VditorI18n)===null||m===void 0?void 0:m.copy)||"复制",`"
- onmouseover="this.setAttribute('aria-label', '`).concat(((u=window.VditorI18n)===null||u===void 0?void 0:u.copy)||"复制",`')"
- class="vditor-tooltipped vditor-tooltipped__w"
- onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`).concat(((S=window.VditorI18n)===null||S===void 0?void 0:S.copied)||"已复制",`');this.previousElementSibling.blur()">`).concat(w,"</span>");var L=document.createElement("textarea");L.value=(0,V.p)(b),s.insertAdjacentElement("afterbegin",L),g&&g.renderMenu&&g.renderMenu(p,s),p.before(s),p.style.maxHeight=window.outerHeight-40+"px",p.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(j.Y.ZWSP,"</span>"))})}},500:(se,E,x)=>{x.d(E,{D:()=>l});var V=x(913),j=x(161),c=x(59),l=function(g,p){p===void 0&&(p=V.Y.CDN);var m=c.flowchartRenderAdapter.getElements(g);m.length!==0&&(0,j.Z)("".concat(p,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){m.forEach(function(u){if(u.getAttribute("data-processed")!=="true"){var S=flowchart.parse(c.flowchartRenderAdapter.getCode(u));u.innerHTML="",S.drawSVG(u),u.setAttribute("data-processed","true")}})})}},339:(se,E,x)=>{x.d(E,{m:()=>l});var V=x(913),j=x(161),c=x(59),l=function(g,p){p===void 0&&(p=V.Y.CDN);var m=c.graphvizRenderAdapter.getElements(g);m.length!==0&&(0,j.Z)("".concat(p,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){m.forEach(function(u){var S=c.graphvizRenderAdapter.getCode(u);if(!(u.parentElement.classList.contains("vditor-wysiwyg__pre")||u.parentElement.classList.contains("vditor-ir__marker--pre"))&&!(u.getAttribute("data-processed")==="true"||S.trim()==="")){try{var b=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),y=window.URL||window.webkitURL,w=y.createObjectURL(b),s=new Worker(w);new Viz({worker:s}).renderSVGElement(S).then(function(L){u.innerHTML=L.outerHTML}).catch(function(L){u.innerHTML="graphviz render error: <br>".concat(L),u.className="vditor-reset--error"})}catch(L){}u.setAttribute("data-processed","true")}})})}},108:(se,E,x)=>{x.d(E,{$:()=>l});var V=x(913),j=x(161),c=x(505),l=function(g,p,m){p===void 0&&(p=document),m===void 0&&(m=V.Y.CDN);var u=g.style;V.Y.CODE_THEME.includes(u)||(u="github");var S=document.getElementById("vditorHljsStyle"),b="".concat(m,"/dist/js/highlight.js/styles/").concat(u,".min.css");if(S&&S.getAttribute("href")!==b&&S.remove(),(0,c.T)("".concat(m,"/dist/js/highlight.js/styles/").concat(u,".min.css"),"vditorHljsStyle"),g.enable!==!1){var y=p.querySelectorAll("pre > code");y.length!==0&&(0,j.Z)("".concat(m,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,j.Z)("".concat(m,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){p.querySelectorAll("pre > code").forEach(function(w){if(!(w.parentElement.classList.contains("vditor-ir__marker--pre")||w.parentElement.classList.contains("vditor-wysiwyg__pre"))&&!(w.classList.contains("language-mermaid")||w.classList.contains("language-flowchart")||w.classList.contains("language-echarts")||w.classList.contains("language-mindmap")||w.classList.contains("language-plantuml")||w.classList.contains("language-smiles")||w.classList.contains("language-abc")||w.classList.contains("language-graphviz")||w.classList.contains("language-math"))){g.defaultLang!==""&&w.className.indexOf("language-")===-1&&w.classList.add("language-"+g.defaultLang);var s=g.defaultLang||w.className.replace("language-","");if(window.hljs.getLanguage(s)||(s="plaintext"),w.innerHTML=window.hljs.highlight(w.textContent,{language:s,ignoreIllegals:!0}).value,w.classList.add("hljs"),!!g.lineNumber){w.classList.add("vditor-linenumber");var L=w.querySelector(".vditor-linenumber__temp");L||(L=document.createElement("div"),L.className="vditor-linenumber__temp",w.insertAdjacentElement("beforeend",L));var U=getComputedStyle(w).whiteSpace,Y=!1;(U==="pre-wrap"||U==="pre-line")&&(Y=!0);var H="",Q=w.textContent.split(/\r\n|\r|\n/g);Q.pop(),Q.map(function(ne){var oe="";Y&&(L.textContent=ne||`
- `,oe=' style="height:'.concat(L.getBoundingClientRect().height,'px"')),H+="<span".concat(oe,"></span>")}),L.style.display="none",H='<span class="vditor-linenumber__rows">'.concat(H,"</span>"),w.insertAdjacentHTML("beforeend",H)}}})})})}}},597:(se,E,x)=>{x.d(E,{K:()=>m});var V=x(913),j=x(161),c=x(59),l={},g=function(u,S){var b=u.transform(S),y=Object.keys(b.features).filter(function(Y){return!l[Y]});y.forEach(function(Y){l[Y]=!0});var w=u.getAssets(y),s=w.styles,L=w.scripts,U=window.markmap;return s&&U.loadCSS(s),L&&U.loadJS(L),b},p=function(u,S){var b=window.markmap,y=b.Transformer,w=b.Markmap,s=b.deriveOptions;b.globalCSS;var L=new y;u.innerHTML='<svg style="width:100%"></svg>';var U=u.firstChild,Y=w.create(U,null),H=g(L,S),Q=H.root,ne=H.frontmatter,oe=ne==null?void 0:ne.markmap,pe=s(oe);Y.setData(Q,pe),Y.fit()},m=function(u,S){u===void 0&&(u=document),S===void 0&&(S=V.Y.CDN);var b=c.markmapRenderAdapter.getElements(u);b.length!==0&&(0,j.Z)("".concat(S,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){b.forEach(function(y){var w=c.markmapRenderAdapter.getCode(y);if(!(y.getAttribute("data-processed")==="true"||w.trim()==="")){var s=document.createElement("div");s.className="language-markmap",y.parentNode.appendChild(s),p(s,w),y.parentNode.childNodes[0].nodeName=="CODE"&&y.parentNode.removeChild(y.parentNode.childNodes[0])}})})}},960:(se,E,x)=>{x.d(E,{T:()=>p});var V=x(913),j=x(161),c=x(505),l=x(695),g=x(59),p=function(m,u){m===void 0&&(m=document);var S=g.mathRenderAdapter.getElements(m);if(S.length!==0){var b={cdn:V.Y.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(u&&u.math&&(u.math=Object.assign({},b.math,u.math)),u=Object.assign({},b,u),u.math.engine==="KaTeX")(0,c.T)("".concat(u.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,j.Z)("".concat(u.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,j.Z)("".concat(u.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){S.forEach(function(s){if(!(s.parentElement.classList.contains("vditor-wysiwyg__pre")||s.parentElement.classList.contains("vditor-ir__marker--pre"))&&!s.getAttribute("data-math")){var L=(0,l.p)(g.mathRenderAdapter.getCode(s));s.setAttribute("data-math",L);try{s.innerHTML=katex.renderToString(L,{displayMode:s.tagName==="DIV",output:"html",macros:u.math.macros})}catch(U){s.innerHTML=U.message,s.className="language-math vditor-reset--error"}s.addEventListener("copy",function(U){U.stopPropagation(),U.preventDefault();var Y=U.currentTarget.closest(".language-math");U.clipboardData.setData("text/html",Y.innerHTML),U.clipboardData.setData("text/plain",Y.getAttribute("data-math"))})}})})});else if(u.math.engine==="MathJax"){var y=function(s){if(s.length!==0){var L=0,U=s[s.length-1],Y=function(){var H=s[L++];H===U?H():H(Y)};Y()}};window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(u.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:u.math.macros}},Object.assign(window.MathJax,u.math.mathJaxOptions)),(0,j.U)("".concat(u.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var w=function(s,L){var U=(0,l.p)(s.textContent).trim(),Y=window.MathJax.getMetricsFor(s);Y.display=s.tagName==="DIV",window.MathJax.tex2svgPromise(U,Y).then(function(H){s.innerHTML="",s.setAttribute("data-math",U),s.append(H),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var Q=H.querySelector('[data-mml-node="merror"]');Q&&Q.textContent.trim()!==""&&(s.innerHTML=Q.textContent.trim(),s.className="vditor-reset--error"),L&&L()})};window.MathJax.startup.promise.then(function(){for(var s=[],L=function(Y){var H=S[Y];!H.parentElement.classList.contains("vditor-wysiwyg__pre")&&!H.parentElement.classList.contains("vditor-ir__marker--pre")&&!H.getAttribute("data-math")&&(0,l.p)(H.textContent).trim()&&s.push(function(Q){Y===S.length-1?w(H):w(H,Q)})},U=0;U<S.length;U++)L(U);y(s)})}}}},0:(se,E,x)=>{x.d(E,{l:()=>g});var V=x(933),j=function(p,m){p.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(m,'"></video>')),p.remove()},c=function(p,m){p.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(m,'"></audio>')),p.remove()},l=function(p,m){var u=m.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),S=m.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),b=m.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),y=m.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),w=m.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=m.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),L=m.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),U=m.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(u&&u[1].length===11)p.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(u[1]+(u[2]?"?start="+u[2]:""),'"></iframe>')),p.remove();else if(S&&S[1])p.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(S[1],'"></iframe>')),p.remove();else if(b&&b[1])p.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(b[1],'"></iframe>')),p.remove();else if(y&&y[1])p.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="//coub.com/embed/`.concat(y[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),p.remove();else if(w&&w[0])p.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.facebook.com/plugins/video.php?href=`.concat(encodeURIComponent(w[0]),'"></iframe>')),p.remove();else if(s&&s[2])p.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.dailymotion.com/embed/video/`.concat(s[2],'"></iframe>')),p.remove();else if(m.indexOf("bilibili.com")>-1&&(m.indexOf("bvid=")>-1||L&&L[1])){var Y={bvid:(0,V.TK)("bvid",m)||L&&L[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(m.startsWith("http")?m:"https:"+m).search.split("&").forEach(function(ne,oe){if(ne){oe===0&&(ne=ne.substr(1));var pe=ne.split("=");Y[pe[0]]=pe[1]}});var H="https://player.bilibili.com/player.html?",Q=Object.keys(Y);Q.forEach(function(ne,oe){H+="".concat(ne,"=").concat(Y[ne]),oe<Q.length-1&&(H+="&")}),p.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(H,'"></iframe>')),p.remove()}else U&&U[1]&&(p.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(U[1],'"></iframe>')),p.remove())},g=function(p){p&&p.querySelectorAll("a").forEach(function(m){var u=m.getAttribute("href");u&&(u.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?j(m,u):u.match(/^.+.(mp3|wav|flac)$/)?c(m,u):l(m,u))})}},975:(se,E,x)=>{x.d(E,{e:()=>m});var V=x(913),j=x(161),c=x(59),l=x(933),g=function(u,S,b,y){function w(s){return s instanceof b?s:new b(function(L){L(s)})}return new(b||(b=Promise))(function(s,L){function U(Q){try{H(y.next(Q))}catch(ne){L(ne)}}function Y(Q){try{H(y.throw(Q))}catch(ne){L(ne)}}function H(Q){Q.done?s(Q.value):w(Q.value).then(U,Y)}H((y=y.apply(u,S||[])).next())})},p=function(u,S){var b={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},y,w,s,L;return L={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function U(H){return function(Q){return Y([H,Q])}}function Y(H){if(y)throw new TypeError("Generator is already executing.");for(;L&&(L=0,H[0]&&(b=0)),b;)try{if(y=1,w&&(s=H[0]&2?w.return:H[0]?w.throw||((s=w.return)&&s.call(w),0):w.next)&&!(s=s.call(w,H[1])).done)return s;switch(w=0,s&&(H=[H[0]&2,s.value]),H[0]){case 0:case 1:s=H;break;case 4:return b.label++,{value:H[1],done:!1};case 5:b.label++,w=H[1],H=[0];continue;case 7:H=b.ops.pop(),b.trys.pop();continue;default:if(s=b.trys,!(s=s.length>0&&s[s.length-1])&&(H[0]===6||H[0]===2)){b=0;continue}if(H[0]===3&&(!s||H[1]>s[0]&&H[1]<s[3])){b.label=H[1];break}if(H[0]===6&&b.label<s[1]){b.label=s[1],s=H;break}if(s&&b.label<s[2]){b.label=s[2],b.ops.push(H);break}s[2]&&b.ops.pop(),b.trys.pop();continue}H=S.call(u,b)}catch(Q){H=[6,Q],w=0}finally{y=s=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}},m=function(u,S,b){u===void 0&&(u=document),S===void 0&&(S=V.Y.CDN);var y=c.mermaidRenderAdapter.getElements(u);y.length!==0&&(0,j.Z)("".concat(S,"/dist/js/mermaid/mermaid.min.js"),"vditorMermaidScript").then(function(){var w={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}};b==="dark"&&(w.theme="dark"),mermaid.initialize(w),y.forEach(function(s){return g(void 0,void 0,void 0,function(){var L,U,Y,H,Q;return p(this,function(ne){switch(ne.label){case 0:if(L=c.mermaidRenderAdapter.getCode(s),s.getAttribute("data-processed")==="true"||L.trim()==="")return[2];U="mermaid"+(0,l.Ee)(),ne.label=1;case 1:return ne.trys.push([1,3,,4]),[4,mermaid.render(U,s.textContent)];case 2:return Y=ne.sent(),s.innerHTML=Y.svg,[3,4];case 3:return H=ne.sent(),Q=document.querySelector("#"+U),s.innerHTML="".concat(Q.outerHTML,`<br>
- <div style="text-align: left"><small>`).concat(H.message.replace(/\n/,"<br>"),"</small></div>"),Q.parentElement.remove(),[3,4];case 4:return s.setAttribute("data-processed","true"),[2]}})})})})}},162:(se,E,x)=>{x.d(E,{l:()=>l});var V=x(913),j=x(161),c=x(59),l=function(g,p,m){g===void 0&&(g=document),p===void 0&&(p=V.Y.CDN);var u=c.mindmapRenderAdapter.getElements(g);u.length>0&&(0,j.Z)("".concat(p,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){u.forEach(function(S){if(!(S.parentElement.classList.contains("vditor-wysiwyg__pre")||S.parentElement.classList.contains("vditor-ir__marker--pre"))){var b=c.mindmapRenderAdapter.getCode(S);if(b)try{if(S.getAttribute("data-processed")==="true")return;echarts.init(S,m==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(b))],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(y,w){var s;return!((s=w==null?void 0:w.data)===null||s===void 0)&&s.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),S.setAttribute("data-processed","true")}catch(y){S.className="vditor-reset--error",S.innerHTML="mindmap render error: <br>".concat(y)}}})})}},70:(se,E,x)=>{x.d(E,{N:()=>c});var V=x(164),j=x(960),c=function(l,g,p){var m="",u=[];if(Array.from(l.children).forEach(function(w,s){if((0,V.c)(w)){if(p){var L=w.id.lastIndexOf("_");w.id=w.id.substring(0,L===-1?void 0:L)+"_"+s}u.push(w.id),m+=w.outerHTML.replace("<wbr>","")}}),m==="")return g.innerHTML="","";var S=document.createElement("div");if(p)p.lute.SetToC(!0),p.currentMode==="wysiwyg"&&!p.preview.element.contains(l)?S.innerHTML=p.lute.SpinVditorDOM("<p>[ToC]</p>"+m):p.currentMode==="ir"&&!p.preview.element.contains(l)?S.innerHTML=p.lute.SpinVditorIRDOM("<p>[ToC]</p>"+m):S.innerHTML=p.lute.HTML2VditorDOM("<p>[ToC]</p>"+m),p.lute.SetToC(p.options.preview.markdown.toc);else{g.classList.add("vditor-outline");var b=Lute.New();b.SetToC(!0),S.innerHTML=b.HTML2VditorDOM("<p>[ToC]</p>"+m)}var y=S.firstElementChild.querySelectorAll("li > span[data-target-id]");return y.forEach(function(w,s){if(w.nextElementSibling&&w.nextElementSibling.tagName==="UL"){var L="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(L='<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>'),w.innerHTML="".concat(L,"<span>").concat(w.innerHTML,"</span>")}else w.innerHTML="<svg></svg><span>".concat(w.innerHTML,"</span>");w.setAttribute("data-target-id",u[s])}),m=S.firstElementChild.innerHTML,y.length===0?(g.innerHTML="",m):(g.innerHTML=m,p&&(0,j.T)(g,{cdn:p.options.cdn,math:p.options.preview.math}),g.firstElementChild.addEventListener("click",function(w){for(var s=w.target;s&&!s.isEqualNode(g);){if(s.classList.contains("vditor-outline__action")){s.classList.contains("vditor-outline__action--close")?(s.classList.remove("vditor-outline__action--close"),s.parentElement.nextElementSibling.setAttribute("style","display:block")):(s.classList.add("vditor-outline__action--close"),s.parentElement.nextElementSibling.setAttribute("style","display:none")),w.preventDefault(),w.stopPropagation();break}else if(s.getAttribute("data-target-id")){w.preventDefault(),w.stopPropagation();var L=document.getElementById(s.getAttribute("data-target-id"));if(!L)return;if(p)if(p.options.height==="auto"){var U=L.offsetTop+p.element.offsetTop;p.options.toolbarConfig.pin||(U+=p.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,U)}else p.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,p.element.offsetTop),p.preview.element.contains(l)?l.parentElement.scrollTop=L.offsetTop:l.scrollTop=L.offsetTop;else window.scrollTo(window.scrollX,L.offsetTop);break}s=s.parentElement}}),m)}},591:(se,E,x)=>{x.d(E,{M:()=>l});var V=x(913),j=x(161),c=x(59),l=function(g,p){g===void 0&&(g=document),p===void 0&&(p=V.Y.CDN);var m=c.plantumlRenderAdapter.getElements(g);m.length!==0&&(0,j.Z)("".concat(p,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){m.forEach(function(u){if(!(u.parentElement.classList.contains("vditor-wysiwyg__pre")||u.parentElement.classList.contains("vditor-ir__marker--pre"))){var S=c.plantumlRenderAdapter.getCode(u).trim();if(S)try{u.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(S),'"/>')}catch(b){u.className="vditor-reset--error",u.innerHTML="plantuml render error: <br>".concat(b)}}})})}},796:(se,E,x)=>{x.d(E,{X:()=>V});var V=function(j){var c=Lute.New();return c.PutEmojis(j.emojis),c.SetEmojiSite(j.emojiSite),c.SetHeadingAnchor(j.headingAnchor),c.SetInlineMathAllowDigitAfterOpenMarker(j.inlineMathDigit),c.SetAutoSpace(j.autoSpace),c.SetToC(j.toc),c.SetFootnotes(j.footnotes),c.SetFixTermTypo(j.fixTermTypo),c.SetVditorCodeBlockPreview(j.codeBlockPreview),c.SetVditorMathBlockPreview(j.mathBlockPreview),c.SetSanitize(j.sanitize),c.SetChineseParagraphBeginningSpace(j.paragraphBeginningSpace),c.SetRenderListStyle(j.listStyle),c.SetLinkBase(j.linkBase),c.SetLinkPrefix(j.linkPrefix),c.SetMark(j.mark),c.SetGFMAutoLink(j.gfmAutoLink),j.lazyLoadImage&&c.SetImageLazyLoading(j.lazyLoadImage),c}},726:(se,E,x)=>{x.d(E,{o:()=>V});var V=function(j,c,l){l===void 0&&(l="classic");var g=j.getBoundingClientRect(),p=36;document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat(l==="dark"?" vditor--dark":"",`">
- <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(j.width,"px;height:").concat(j.height,"px;transform: translate3d(").concat(g.left,"px, ").concat(g.top-p,'px, 0)" src="').concat(j.getAttribute("src"),`">
- </div>
- </div>`)),document.body.style.overflow="hidden";var m=document.querySelector(".vditor-img img"),u="translate3d(".concat(Math.max(0,window.innerWidth-j.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-p-j.naturalHeight)/2,"px, 0)");setTimeout(function(){m.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(u)),setTimeout(function(){m.parentElement.scrollTo((m.parentElement.scrollWidth-m.parentElement.clientWidth)/2,(m.parentElement.scrollHeight-m.parentElement.clientHeight)/2)},400)});var S=document.querySelector(".vditor-img__btn");S.addEventListener("click",function(){var b=parseInt(S.getAttribute("data-deg"),10)+90;b/90%2===1&&j.naturalWidth>m.parentElement.clientHeight?m.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-j.naturalWidth)/2,"px, ").concat(j.naturalWidth/2-j.naturalHeight/2,"px, 0) rotateZ(").concat(b,"deg)"):m.style.transform="".concat(u," rotateZ(").concat(b,"deg)"),S.setAttribute("data-deg",b.toString()),setTimeout(function(){m.parentElement.scrollTo((m.parentElement.scrollWidth-m.parentElement.clientWidth)/2,(m.parentElement.scrollHeight-m.parentElement.clientHeight)/2)},400)})}},13:(se,E,x)=>{x.d(E,{h:()=>c});var V=x(913),j=x(505),c=function(l,g){g===void 0&&(g=V.Y.CDN),V.Y.CODE_THEME.includes(l)||(l="github");var p=document.getElementById("vditorHljsStyle"),m="".concat(g,"/dist/js/highlight.js/styles/").concat(l,".min.css");p?p.getAttribute("href")!==m&&(p.remove(),(0,j.T)(m,"vditorHljsStyle")):(0,j.T)(m,"vditorHljsStyle")}},873:(se,E,x)=>{x.d(E,{H:()=>j});var V=x(505),j=function(c,l){if(!(!c||!l)){var g=document.getElementById("vditorContentTheme"),p="".concat(l,"/").concat(c,".css");g?g.getAttribute("href")!==p&&(g.remove(),(0,V.T)(p,"vditorContentTheme")):(0,V.T)(p,"vditorContentTheme")}}},161:(se,E,x)=>{x.d(E,{U:()=>V,Z:()=>j});var V=function(c,l){if(document.getElementById(l))return!1;var g=new XMLHttpRequest;g.open("GET",c,!1),g.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),g.send("");var p=document.createElement("script");p.type="text/javascript",p.text=g.responseText,p.id=l,document.head.appendChild(p)},j=function(c,l){return new Promise(function(g,p){if(document.getElementById(l))return g(!0),!1;var m=document.createElement("script");m.src=c,m.async=!0,document.head.appendChild(m),m.onerror=function(u){p(u)},m.onload=function(){if(document.getElementById(l))return m.remove(),g(!0),!1;m.id=l,g(!0)}})}},505:(se,E,x)=>{x.d(E,{T:()=>V});var V=function(j,c){if(!document.getElementById(c)){var l=document.createElement("link");l.id=c,l.rel="stylesheet",l.type="text/css",l.href=j,document.getElementsByTagName("head")[0].appendChild(l)}}},695:(se,E,x)=>{x.d(E,{p:()=>V});var V=function(j){return j.replace(/\u00a0/g," ")}},629:(se,E,x)=>{x.d(E,{D:()=>c,H8:()=>m,_0:()=>g,fG:()=>p,gm:()=>j,nr:()=>V,y3:()=>l});var V=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},j=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},c=function(){try{return typeof localStorage!="undefined"}catch(u){return!1}},l=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},g=function(u){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!!(u.metaKey&&!u.ctrlKey):!!(!u.metaKey&&u.ctrlKey)},p=function(u){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?u.indexOf("⇧")>-1&&j()&&(u=u.replace(";",":").replace("=","+").replace("-","_")):(u.startsWith("⌘")?u=u.replace("⌘","⌘+"):u.startsWith("⌥")&&u.substr(1,1)!=="⌘"?u=u.replace("⌥","⌥+"):u=u.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+"),u=u.replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt"),u.indexOf("Shift")>-1&&(u=u.replace(";",":").replace("=","+").replace("-","_"))),u},m=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},933:(se,E,x)=>{x.d(E,{Ee:()=>V,TK:()=>j,kY:()=>c});var V=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(l){return(parseInt(l,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(l,10)/4).toString(16)})},j=function(l,g){g===void 0&&(g=window.location.search);var p=g.substring(g.indexOf("?")),m=p.indexOf("#"),u=new URLSearchParams(p.substring(0,m>=0?m:void 0));return u.get(l)},c=function(l){return Function('"use strict";return ('.concat(l,")"))()}},598:(se,E,x)=>{x.d(E,{Ab:()=>c,KJ:()=>u,KR:()=>l,Rp:()=>S,Th:()=>g,XW:()=>j,_Y:()=>m,pt:()=>p});var V=x(164),j=function(b,y){for(var w=u(b,y),s=!1,L=!1;w&&!w.classList.contains("vditor-reset")&&!L;)s=u(w.parentElement,y),s?w=s:L=!0;return w||!1},c=function(b,y){for(var w=(0,V.f)(b,y),s=!1,L=!1;w&&!w.classList.contains("vditor-reset")&&!L;)s=(0,V.f)(w.parentElement,y),s?w=s:L=!0;return w||!1},l=function(b){var y=c(b,"UL"),w=c(b,"OL"),s=y;return w&&(!y||y&&w.contains(y))&&(s=w),s},g=function(b,y,w){if(!b)return!1;b.nodeType===3&&(b=b.parentElement);for(var s=b,L=!1;s&&!L&&!s.classList.contains("vditor-reset");)s.getAttribute(y)===w?L=!0:s=s.parentElement;return L&&s},p=function(b){if(!b)return!1;b.nodeType===3&&(b=b.parentElement);var y=b,w=!1,s=g(b,"data-block","0");if(s)return s;for(;y&&!w&&!y.classList.contains("vditor-reset");)y.tagName==="H1"||y.tagName==="H2"||y.tagName==="H3"||y.tagName==="H4"||y.tagName==="H5"||y.tagName==="H6"||y.tagName==="P"||y.tagName==="BLOCKQUOTE"||y.tagName==="OL"||y.tagName==="UL"?w=!0:y=y.parentElement;return w&&y},m=function(b,y){if(!b)return!1;b.nodeType===3&&(b=b.parentElement);for(var w=b,s=!1;w&&!s&&!w.classList.contains("vditor-reset");)w.nodeName===y?s=!0:w=w.parentElement;return s&&w},u=function(b,y){if(!b)return!1;b.nodeType===3&&(b=b.parentElement);for(var w=b,s=!1;w&&!s&&!w.classList.contains("vditor-reset");)w.classList.contains(y)?s=!0:w=w.parentElement;return s&&w},S=function(b){for(;b&&b.lastChild;)b=b.lastChild;return b}},164:(se,E,x)=>{x.d(E,{c:()=>j,f:()=>V});var V=function(c,l){if(!c)return!1;c.nodeType===3&&(c=c.parentElement);for(var g=c,p=!1;g&&!p&&!g.classList.contains("vditor-reset");)g.nodeName.indexOf(l)===0?p=!0:g=g.parentElement;return p&&g},j=function(c){var l=V(c,"H");return l&&l.tagName.length===2&&l.tagName!=="HR"?l:!1}},905:(se,E,x)=>{x.d(E,{h:()=>V});var V=function(){for(var j=[],c=0;c<arguments.length;c++)j[c]=arguments[c];for(var l={},g=function(m){for(var u in m)m.hasOwnProperty(u)&&(Object.prototype.toString.call(m[u])==="[object Object]"?l[u]=V(l[u],m[u]):l[u]=m[u])},p=0;p<j.length;p++)g(j[p]);return l}},827:(se,E,x)=>{x.d(E,{Co:()=>p,ED:()=>u,Ey:()=>g,Fm:()=>S,RN:()=>l,Z2:()=>y,ir:()=>b,jl:()=>m});var V=x(913),j=x(629),c=x(598),l=function(w){var s,L=w[w.currentMode].element;return getSelection().rangeCount>0&&(s=getSelection().getRangeAt(0),L.isEqualNode(s.startContainer)||L.contains(s.startContainer))?s:w[w.currentMode].range?w[w.currentMode].range:(L.focus(),s=L.ownerDocument.createRange(),s.setStart(L,0),s.collapse(!0),s)},g=function(w){var s=window.getSelection().getRangeAt(0);if(!w.contains(s.startContainer)&&!(0,c.KJ)(s.startContainer,"vditor-panel--none"))return{left:0,top:0};var L=w.parentElement.getBoundingClientRect(),U;if(s.getClientRects().length===0)if(s.startContainer.nodeType===3){var Y=s.startContainer.parentElement;if(Y&&Y.getClientRects().length>0)U=Y.getClientRects()[0];else return{left:0,top:0}}else{var H=s.startContainer.children;if(H[s.startOffset]&&H[s.startOffset].getClientRects().length>0)U=H[s.startOffset].getClientRects()[0];else if(s.startContainer.childNodes.length>0){var Q=s.cloneRange();s.selectNode(s.startContainer.childNodes[Math.max(0,s.startOffset-1)]),U=s.getClientRects()[0],s.setEnd(Q.endContainer,Q.endOffset),s.setStart(Q.startContainer,Q.startOffset)}else U=s.startContainer.getClientRects()[0];if(!U){for(var ne=s.startContainer.childNodes[s.startOffset];!ne.getClientRects||ne.getClientRects&&ne.getClientRects().length===0;)ne=ne.parentElement;U=ne.getClientRects()[0]}}else U=s.getClientRects()[0];return{left:U.left-L.left,top:U.top-L.top}},p=function(w,s){if(!s){if(getSelection().rangeCount===0)return!1;s=getSelection().getRangeAt(0)}var L=s.commonAncestorContainer;return w.isEqualNode(L)||w.contains(L)},m=function(w){var s=window.getSelection();s.removeAllRanges(),s.addRange(w)},u=function(w,s,L){var U={end:0,start:0};if(!L){if(getSelection().rangeCount===0)return U;L=window.getSelection().getRangeAt(0)}if(p(s,L)){var Y=L.cloneRange();w.childNodes[0]&&w.childNodes[0].childNodes[0]?Y.setStart(w.childNodes[0].childNodes[0],0):Y.selectNodeContents(w),Y.setEnd(L.startContainer,L.startOffset),U.start=Y.toString().length,U.end=U.start+L.toString().length}return U},S=function(w,s,L){var U=0,Y=0,H=L.childNodes[Y],Q=!1,ne=!1;w=Math.max(0,w),s=Math.max(0,s);var oe=L.ownerDocument.createRange();for(oe.setStart(H||L,0),oe.collapse(!0);!ne&&H;){var pe=U+H.textContent.length;if(!Q&&w>=U&&w<=pe&&(w===0?oe.setStart(H,0):H.childNodes[0].nodeType===3?oe.setStart(H.childNodes[0],w-U):H.nextSibling?oe.setStartBefore(H.nextSibling):oe.setStartAfter(H),Q=!0,w===s)){ne=!0;break}Q&&s>=U&&s<=pe&&(s===0?oe.setEnd(H,0):H.childNodes[0].nodeType===3?oe.setEnd(H.childNodes[0],s-U):H.nextSibling?oe.setEndBefore(H.nextSibling):oe.setEndAfter(H),ne=!0),U=pe,H=L.childNodes[++Y]}return!ne&&L.childNodes[Y-1]&&oe.setStartBefore(L.childNodes[Y-1]),m(oe),oe},b=function(w,s){var L=w.querySelector("wbr");if(L){if(!L.previousElementSibling)L.previousSibling?s.setStart(L.previousSibling,L.previousSibling.textContent.length):L.nextSibling?L.nextSibling.nodeType===3?s.setStart(L.nextSibling,0):s.setStartBefore(L.nextSibling):s.setStart(L.parentElement,0);else if(L.previousElementSibling.isSameNode(L.previousSibling))if(L.previousElementSibling.lastChild){s.setStartBefore(L),s.collapse(!0),m(s),(0,j.H8)()&&(L.previousElementSibling.tagName==="EM"||L.previousElementSibling.tagName==="STRONG"||L.previousElementSibling.tagName==="S")&&(s.insertNode(document.createTextNode(V.Y.ZWSP)),s.collapse(!1)),L.remove();return}else s.setStartAfter(L.previousElementSibling);else s.setStart(L.previousSibling,L.previousSibling.textContent.length);s.collapse(!0),L.remove(),m(s)}},y=function(w,s){var L=document.createElement("div");L.innerHTML=w;var U=L.querySelectorAll("p");U.length===1&&!U[0].previousSibling&&!U[0].nextSibling&&s[s.currentMode].element.children.length>0&&L.firstElementChild.tagName==="P"&&(w=U[0].innerHTML.trim());var Y=document.createElement("div");Y.innerHTML=w;var H=l(s);if(H.toString()!==""&&(s[s.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),Y.firstElementChild&&Y.firstElementChild.getAttribute("data-block")==="0"){Y.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var Q=(0,c.pt)(H.startContainer);Q?Q.insertAdjacentHTML("afterend",Y.innerHTML):s[s.currentMode].element.insertAdjacentHTML("beforeend",Y.innerHTML),b(s[s.currentMode].element,H)}else{var ne=document.createElement("template");ne.innerHTML=w,H.insertNode(ne.content.cloneNode(!0)),H.collapse(!1),m(H)}}}},je={};function te(se){var E=je[se];if(E!==void 0)return E.exports;var x=je[se]={exports:{}};return Ee[se](x,x.exports,te),x.exports}te.d=(se,E)=>{for(var x in E)te.o(E,x)&&!te.o(se,x)&&Object.defineProperty(se,x,{enumerable:!0,get:E[x]})},te.o=(se,E)=>Object.prototype.hasOwnProperty.call(se,E),te.r=se=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(se,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(se,"__esModule",{value:!0})};var Ue={};return(()=>{te.d(Ue,{default:()=>Pi});var se=te(923),E=te(913),x=te(695),V=function(e){return e.currentMode==="sv"?(0,x.p)("".concat(e.sv.element.textContent,`
- `).replace(/\n\n$/,`
- `)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},j=te(161),c=function(){function e(){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 e.prototype.renderEchart=function(t){var n=this;t.devtools.element.style.display==="block"&&(0,j.Z)("".concat(t.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){n.ASTChart||(n.ASTChart=echarts.init(t.devtools.element.lastElementChild));try{n.element.lastElementChild.style.display="block",n.element.firstElementChild.innerHTML="",n.ASTChart.setOption({series:[{data:JSON.parse(t.lute.RenderEChartsJSON(V(t))),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}}),n.ASTChart.resize()}catch(r){n.element.lastElementChild.style.display="none",n.element.firstElementChild.innerHTML=r}})},e}(),l=te(629),g=function(e,t){t.forEach(function(n){if(e[n]){var r=e[n].children[0];r&&r.classList.contains("vditor-menu--current")&&r.classList.remove("vditor-menu--current")}})},p=function(e,t){t.forEach(function(n){if(e[n]){var r=e[n].children[0];r&&!r.classList.contains("vditor-menu--current")&&r.classList.add("vditor-menu--current")}})},m=function(e,t){t.forEach(function(n){if(e[n]){var r=e[n].children[0];r&&r.classList.contains(E.Y.CLASS_MENU_DISABLED)&&r.classList.remove(E.Y.CLASS_MENU_DISABLED)}})},u=function(e,t){t.forEach(function(n){if(e[n]){var r=e[n].children[0];r&&!r.classList.contains(E.Y.CLASS_MENU_DISABLED)&&r.classList.add(E.Y.CLASS_MENU_DISABLED)}})},S=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="none")})},b=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="block")})},y=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(r){n&&r.isEqualNode(n)||(r.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},w=function(e,t,n,r){n.addEventListener((0,l.y3)(),function(i){i.preventDefault(),i.stopPropagation(),!n.classList.contains(E.Y.CLASS_MENU_DISABLED)&&(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(a){a.classList.remove("vditor-hint--current")}),t.style.display==="block"?t.style.display="none":(y(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},s=te(598),L=te(164),U=function(e,t,n,r){},Y=te(288),H=te(784),Q=te(51),ne=te(500),oe=te(339),pe=te(108),ye=te(960),ve=te(975),Ce=te(597),ke=te(162),Te=te(591),De=te(931),Be=function(e,t,n){n===void 0&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var i=!1;r.childElementCount===1&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(i=!0);var a=r.querySelectorAll("pre");if(r.childElementCount===1&&a.length===1&&a[0].className!=="vditor-wysiwyg"&&a[0].className!=="vditor-sv"&&(i=!0),e.indexOf(`
- <p class="p1">`)===0&&(i=!0),r.childElementCount===1&&r.firstElementChild.tagName==="TABLE"&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(i=!0),i){var o=t||e;return/\n/.test(o)||a.length===1?n==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(o.replace(/&/g,"&").replace(/</g,"<"),"<wbr></code></pre></div>"):"\n```\n"+o.replace(/&/g,"&").replace(/</g,"<")+"\n```":n==="wysiwyg"?"<code>".concat(o.replace(/&/g,"&").replace(/</g,"<"),"</code><wbr>"):"`".concat(o,"`")}return!1},He=function(e,t){if(e){if(e.parentElement.getAttribute("data-type")==="html-block"){e.setAttribute("data-render","1");return}var n=e.firstElementChild.className.replace("language-","");if(n==="abc")(0,Y.$)(e,t.options.cdn);else if(n==="mermaid")(0,ve.e)(e,t.options.cdn,t.options.theme);else if(n==="smiles")(0,De.Y)(e,t.options.cdn,t.options.theme);else if(n==="markmap")(0,Ce.K)(e,t.options.cdn);else if(n==="flowchart")(0,ne.D)(e,t.options.cdn);else if(n==="echarts")(0,H.v)(e,t.options.cdn,t.options.theme);else if(n==="mindmap")(0,ke.l)(e,t.options.cdn,t.options.theme);else if(n==="plantuml")(0,Te.M)(e,t.options.cdn);else if(n==="graphviz")(0,oe.m)(e,t.options.cdn);else if(n==="math")(0,ye.T)(e,{cdn:t.options.cdn,math:t.options.preview.math});else{var r=t.options.customRenders.find(function(i){if(i.language===n)return i.render(e,t),!0});r||((0,pe.$)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,Q.o)(e,t.options.preview.hljs))}e.setAttribute("data-render","1")}},v=te(827),Z=function(e){if(e.currentMode!=="sv"){var t=e[e.currentMode].element,n=e.outline.render(e);n===""&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(r){r.innerHTML=n,(0,ye.T)(r,{cdn:e.options.cdn,math:e.options.preview.math})})}},D=function(e,t){var n=(0,s._Y)(e.target,"SPAN");if(n&&(0,s.KJ)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if(t.options.height==="auto"){var i=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(i+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,i)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop;return}},I=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if(n.key==="Backspace"&&(0,v.ED)(e,t[t.currentMode].element,r).start===0)return e.previousElementSibling.remove(),me(t),!0;if(ct(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if(n.key==="Delete"&&(0,v.ED)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),me(t),!0;if(vt(t,n,r,e,e.nextElementSibling))return!0}if(n.key==="Backspace"||n.key==="Delete"){var i=(0,s.KJ)(r.startContainer,"vditor-toc");if(i)return i.remove(),me(t),!0}},R=function(e,t,n,r){n===void 0&&(n=!1);var i=(0,s.pt)(t.startContainer);if(i&&!n&&i.getAttribute("data-type")!=="code-block"){if(Qt(i.innerHTML)&&i.previousElementSibling||en(i.innerHTML))return;for(var a=(0,v.ED)(i,e.ir.element,t).start,o=!0,f=a-1;f>i.textContent.substr(0,a).lastIndexOf(`
- `);f--)if(i.textContent.charAt(f)!==" "&&i.textContent.charAt(f)!==" "){o=!1;break}a===0&&(o=!1);for(var h=!0,f=a-1;f<i.textContent.length;f++)if(i.textContent.charAt(f)!==" "&&i.textContent.charAt(f)!==`
- `){h=!1;break}if(o){typeof e.options.input=="function"&&e.options.input(V(e));return}if(h&&/^#{1,6} $/.test(i.textContent)&&(h=!1),h){var d=(0,s.KJ)(t.startContainer,"vditor-ir__marker");if(!d){var T=t.startContainer.previousSibling;T&&T.nodeType!==3&&T.classList.contains("vditor-ir__node--expand")&&T.classList.remove("vditor-ir__node--expand"),typeof e.options.input=="function"&&e.options.input(V(e));return}}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(he){he.classList.remove("vditor-ir__node--expand")}),i||(i=e.ir.element),!i.querySelector("wbr")){var N=(0,s.KJ)(t.startContainer,"vditor-ir__preview");N?N.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}i.querySelectorAll("[style]").forEach(function(he){he.removeAttribute("style")}),i.getAttribute("data-type")==="link-ref-defs-block"&&(i=e.ir.element);var $=i.isEqualNode(e.ir.element),J=(0,s.Th)(i,"data-type","footnotes-block"),z="";if($)z=i.innerHTML;else{var ae=(0,L.f)(t.startContainer,"BLOCKQUOTE"),ee=(0,s.KR)(t.startContainer);if(ee&&(i=ee),ae&&(!ee||ee&&!ae.contains(ee))&&(i=ae),J&&(i=J),z=i.outerHTML,i.tagName==="UL"||i.tagName==="OL"){var W=i.previousElementSibling,ce=i.nextElementSibling;W&&(W.tagName==="UL"||W.tagName==="OL")&&(z=W.outerHTML+z,W.remove()),ce&&(ce.tagName==="UL"||ce.tagName==="OL")&&(z=z+ce.outerHTML,ce.remove()),z=z.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else i.previousElementSibling&&i.previousElementSibling.textContent.replace(E.Y.ZWSP,"")!==""&&r&&r.inputType==="insertParagraph"&&(z=i.previousElementSibling.outerHTML+z,i.previousElementSibling.remove());i.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(he){he&&!i.isEqualNode(he)&&(z+=he.outerHTML,he.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(he){he&&!i.isEqualNode(he)&&(z+=he.outerHTML,he.remove())}))}if(U("SpinVditorIRDOM",z,"argument",e.options.debugger),z=e.lute.SpinVditorIRDOM(z),U("SpinVditorIRDOM",z,"result",e.options.debugger),$)i.innerHTML=z;else if(i.outerHTML=z,J){var re=(0,s.Th)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(re){var ue=re.textContent,_e=ue.substring(1,ue.indexOf("]:")),Se=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(_e,'"]'));Se&&Se.setAttribute("aria-label",ue.substr(_e.length+3).trim().substr(0,24))}}var Le,Ye=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");Ye.forEach(function(he,Ne){Ne===0?Le=he:(Le.insertAdjacentHTML("beforeend",he.innerHTML),he.remove())}),Ye.length>0&&e.ir.element.insertAdjacentElement("beforeend",Ye[0]);var Pe,qe=e.ir.element.querySelectorAll("[data-type='footnotes-block']");qe.forEach(function(he,Ne){Ne===0?Pe=he:(Pe.insertAdjacentHTML("beforeend",he.innerHTML),he.remove())}),qe.length>0&&e.ir.element.insertAdjacentElement("beforeend",qe[0]),(0,v.ir)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(he){He(he,e)}),Z(e),$e(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},_=function(e,t){if(e==="")return!1;if(e.indexOf("⇧")===-1&&e.indexOf("⌘")===-1&&e.indexOf("⌥")===-1)return!(0,l._0)(t)&&!t.altKey&&!t.shiftKey&&t.code===e;if(e==="⇧Tab")return!!(!(0,l._0)(t)&&!t.altKey&&t.shiftKey&&t.code==="Tab");var n=e.split("");if(e.startsWith("⌥")){var r=n.length===3?n[2]:n[1];return!!((n.length===3?(0,l._0)(t):!(0,l._0)(t))&&t.altKey&&!t.shiftKey&&t.code===(/^[0-9]$/.test(r)?"Digit":"Key")+r)}e==="⌘Enter"&&(n=["⌘","Enter"]);var i=n.length>2&&n[0]==="⇧",a=i?n[2]:n[1];return i&&((0,l.gm)()||!/Mac/.test(navigator.platform))&&(a==="-"?a="_":a==="="&&(a="+")),!!((0,l._0)(t)&&t.key.toLowerCase()===a.toLowerCase()&&!t.altKey&&(!i&&!t.shiftKey||i&&t.shiftKey))},B=function(e){var t=e.startContainer;if(t.nodeType===3&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&n.textContent==="";)n=n.nextSibling;if(n){if(n&&n.nodeType!==3&&n.classList.contains("vditor-ir__node")&&!n.getAttribute("data-block"))return n}else{var r=(0,s.KJ)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var i=t.parentElement.parentElement.nextSibling;if(i&&i.nodeType!==3&&i.classList.contains("vditor-ir__node"))return i}return!1}return!1},A=function(e){var t=e.startContainer,n=t.previousSibling;return t.nodeType===3&&e.startOffset===0&&n&&n.nodeType!==3&&n.classList.contains("vditor-ir__node")&&!n.getAttribute("data-block")?n:!1},k=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(o){o.classList.remove("vditor-ir__node--expand")});var n=(0,s.XW)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,s.XW)(e.endContainer,"vditor-ir__node");if(!(!e.collapsed&&(!n||n!==r))){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,v.jl)(e));var i=B(e);if(i){i.classList.add("vditor-ir__node--expand"),i.classList.remove("vditor-ir__node--hidden");return}var a=A(e);if(a){a.classList.add("vditor-ir__node--expand"),a.classList.remove("vditor-ir__node--hidden");return}}},O=function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;t.key.indexOf("Arrow")===-1&&t.key!=="Meta"&&t.key!=="Control"&&t.key!=="Alt"&&t.key!=="Shift"&&t.key!=="CapsLock"&&t.key!=="Escape"&&!/^F\d{1,2}$/.test(t.key)&&e.undo.recordFirstPosition(e,t);var n=(0,v.RN)(e),r=n.startContainer;if(!mn(t,e,r)||(gn(n,e,t),Dn(n),t.key!=="Enter"&&t.key!=="Tab"&&t.key!=="Backspace"&&t.key.indexOf("Arrow")===-1&&!(0,l._0)(t)&&t.key!=="Escape"&&t.key!=="Delete"))return!1;var i=(0,s.Th)(r,"data-newline","1");if(!(0,l._0)(t)&&!t.altKey&&!t.shiftKey&&t.key==="Enter"&&i&&n.startOffset<i.textContent.length){var a=i.previousElementSibling;a&&(n.insertNode(document.createTextNode(a.textContent)),n.collapse(!1));var o=i.nextSibling;o&&(n.insertNode(document.createTextNode(o.textContent)),n.collapse(!0))}var f=(0,s._Y)(r,"P");if(En(t,e,f,n)||vn(n,e,f,t)||Cn(e,n,t,f))return!0;var h=(0,s.KJ)(r,"vditor-ir__marker--pre");if(h&&h.tagName==="PRE"){var d=h.firstChild;if(Mn(e,t,h,n)||(d.getAttribute("data-type")==="math-block"||d.getAttribute("data-type")==="html-block")&&ct(e,t,n,d,h.parentElement)||vt(e,t,n,d,h.parentElement))return!0}var T=(0,s.Th)(r,"data-type","code-block-info");if(T){if(t.key==="Enter"||t.key==="Tab")return n.selectNodeContents(T.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),y(e,["hint"]),!0;if(t.key==="Backspace"){var N=(0,v.ED)(T,e.ir.element).start;N===1&&n.setStart(r,0),N===2&&(e.hint.recentLanguage="")}if(ct(e,t,n,T,T.parentElement))return y(e,["hint"]),!0}var $=(0,s._Y)(r,"TD")||(0,s._Y)(r,"TH");if(t.key.indexOf("Arrow")>-1&&$){var J=Sr($);if(J&&ct(e,t,n,$,J))return!0;var z=kr($);if(z&&vt(e,t,n,$,z))return!0}if(Ln(e,t,n)||An(e,n,t)||tn(e,n,t))return!0;var ae=(0,L.c)(r);if(ae){if(_("⌘=",t)){var ee=ae.querySelector(".vditor-ir__marker--heading");return ee&&ee.textContent.trim().length>1&&Et(e,ee.textContent.substr(1)),t.preventDefault(),!0}if(_("⌘-",t)){var ee=ae.querySelector(".vditor-ir__marker--heading");return ee&&ee.textContent.trim().length<6&&Et(e,ee.textContent.trim()+"# "),t.preventDefault(),!0}}var W=(0,s.pt)(r);if(t.key==="Backspace"&&!(0,l._0)(t)&&!t.shiftKey&&!t.altKey&&n.toString()===""){if(xn(e,n,t,f))return!0;if(W&&W.previousElementSibling&&W.tagName!=="UL"&&W.tagName!=="OL"&&(W.previousElementSibling.getAttribute("data-type")==="code-block"||W.previousElementSibling.getAttribute("data-type")==="math-block")){var ce=(0,v.ED)(W,e.ir.element,n).start;if(ce===0||ce===1&&W.innerText.startsWith(E.Y.ZWSP))return n.selectNodeContents(W.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),k(n,e),W.textContent.trim().replace(E.Y.ZWSP,"")===""&&(W.remove(),$e(e)),t.preventDefault(),!0}if(ae){var re=ae.firstElementChild.textContent.length;(0,v.ED)(ae,e.ir.element).start===re&&re!==0&&(n.setStart(ae.firstElementChild.firstChild,re-1),n.collapse(!0),(0,v.jl)(n))}}return(t.key==="ArrowUp"||t.key==="ArrowDown")&&W&&(W.querySelectorAll(".vditor-ir__node").forEach(function(ue){ue.contains(r)||ue.classList.add("vditor-ir__node--hidden")}),Hn(t,W,n))?!0:(yn(n,t.key),W&&I(W,e,t,n)?(t.preventDefault(),!0):!1)},M=te(726),K=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(n){for(var r=n.parentElement,i=r.nextSibling;i&&i.textContent.startsWith(" ");){var a=i;a.childNodes.forEach(function(o){r.append(o.cloneNode(!0))}),i=i.nextSibling,a.remove()}t&&t(r)})},G=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),i=r.startContainer;r.startContainer.nodeType!==3&&r.startContainer.tagName==="DIV"&&(i=r.startContainer.childNodes[r.startOffset-1]);var a=(0,s.Th)(i,"data-block","0");if(a&&t&&(t.inputType==="deleteContentBackward"||t.data===" ")){for(var o=(0,v.ED)(a,e.sv.element,r).start,f=!0,h=o-1;h>a.textContent.substr(0,o).lastIndexOf(`
- `);h--)if(a.textContent.charAt(h)!==" "&&a.textContent.charAt(h)!==" "){f=!1;break}if(o===0&&(f=!1),f){Re(e);return}if(t.inputType==="deleteContentBackward"){var d=(0,s.Th)(i,"data-type","code-block-open-marker")||(0,s.Th)(i,"data-type","code-block-close-marker");if(d){if(d.getAttribute("data-type")==="code-block-close-marker"){var T=At(i,"code-block-open-marker");if(T){T.textContent=d.textContent,Re(e);return}}if(d.getAttribute("data-type")==="code-block-open-marker"){var T=At(i,"code-block-close-marker",!1);if(T){T.textContent=d.textContent,Re(e);return}}}var N=(0,s.Th)(i,"data-type","math-block-open-marker");if(N){var $=N.nextElementSibling.nextElementSibling;$&&$.getAttribute("data-type")==="math-block-close-marker"&&($.remove(),Re(e));return}a.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(W){W.textContent.length===1&&W.remove()}),a.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(W){W.textContent.length===1&&W.remove()});var J=(0,s.Th)(i,"data-type","heading-marker");if(J&&J.textContent.indexOf("#")===-1){Re(e);return}}if((t.data===" "||t.inputType==="deleteContentBackward")&&((0,s.Th)(i,"data-type","padding")||(0,s.Th)(i,"data-type","li-marker")||(0,s.Th)(i,"data-type","task-marker")||(0,s.Th)(i,"data-type","blockquote-marker"))){Re(e);return}}if(a&&a.textContent.trimRight()==="$$"){Re(e);return}a||(a=e.sv.element),((n=a.firstElementChild)===null||n===void 0?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(a=e.sv.element),(0,s.Th)(i,"data-type","footnotes-link")&&(a=e.sv.element),a.textContent.indexOf(Lute.Caret)===-1&&r.insertNode(document.createTextNode(Lute.Caret)),a.querySelectorAll("[style]").forEach(function(W){W.removeAttribute("style")}),a.querySelectorAll("font").forEach(function(W){W.outerHTML=W.innerHTML});var z=a.textContent,ae=a.isEqualNode(e.sv.element);if(ae)z=a.textContent;else{a.previousElementSibling&&(z=a.previousElementSibling.textContent+z,a.previousElementSibling.remove()),a.previousElementSibling&&z.indexOf(`---
- `)===0&&(z=a.previousElementSibling.textContent+z,a.previousElementSibling.remove());var ee="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(W,ce){W&&!a.isEqualNode(W.parentElement)&&(ee+=W.parentElement.textContent+`
- `,W.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(W,ce){W&&!a.isEqualNode(W.parentElement)&&(ee+=W.parentElement.textContent+`
- `,W.parentElement.remove())}),z=ee+z}z=fn(z,e),ae?a.innerHTML=z:a.outerHTML=z,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(W){e.sv.element.insertAdjacentElement("beforeend",W.parentElement)}),K(e.sv.element,function(W){e.sv.element.insertAdjacentElement("beforeend",W)}),(0,v.ir)(e.sv.element,r),Oe(e),Re(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){var n,r,i,a,o;if(e.sv.composingLock=t.isComposing,t.isComposing||(t.key.indexOf("Arrow")===-1&&t.key!=="Meta"&&t.key!=="Control"&&t.key!=="Alt"&&t.key!=="Shift"&&t.key!=="CapsLock"&&t.key!=="Escape"&&!/^F\d{1,2}$/.test(t.key)&&e.undo.recordFirstPosition(e,t),t.key!=="Enter"&&t.key!=="Tab"&&t.key!=="Backspace"&&t.key.indexOf("Arrow")===-1&&!(0,l._0)(t)&&t.key!=="Escape"))return!1;var f=(0,v.RN)(e),h=f.startContainer;f.startContainer.nodeType!==3&&f.startContainer.tagName==="DIV"&&(h=f.startContainer.childNodes[f.startOffset-1]);var d=(0,s.Th)(h,"data-type","text"),T=(0,s.Th)(h,"data-type","blockquote-marker");if(!T&&f.startOffset===0&&d&&d.previousElementSibling&&d.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(T=d.previousElementSibling),T&&t.key==="Enter"&&!(0,l._0)(t)&&!t.altKey&&T.nextElementSibling.textContent.trim()===""&&(0,v.ED)(T,e.sv.element,f).start===T.textContent.length)return((n=T.previousElementSibling)===null||n===void 0?void 0:n.getAttribute("data-type"))==="padding"&&T.previousElementSibling.setAttribute("data-action","enter-remove"),T.remove(),Re(e),t.preventDefault(),!0;var N=(0,s.Th)(h,"data-type","li-marker"),$=(0,s.Th)(h,"data-type","task-marker"),J=N;if(J||$&&$.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(J=$),!J&&f.startOffset===0&&d&&d.previousElementSibling&&(d.previousElementSibling.getAttribute("data-type")==="li-marker"||d.previousElementSibling.getAttribute("data-type")==="task-marker")&&(J=d.previousElementSibling),J){var z=(0,v.ED)(J,e.sv.element,f).start,ae=J.getAttribute("data-type")==="task-marker",ee=J;if(ae&&(ee=J.previousElementSibling.previousElementSibling.previousElementSibling),z===J.textContent.length){if(t.key==="Enter"&&!(0,l._0)(t)&&!t.altKey&&!t.shiftKey&&J.nextElementSibling.textContent.trim()==="")return((r=ee.previousElementSibling)===null||r===void 0?void 0:r.getAttribute("data-type"))==="padding"?(ee.previousElementSibling.remove(),G(e)):(ae&&(ee.remove(),J.previousElementSibling.previousElementSibling.remove(),J.previousElementSibling.remove()),J.nextElementSibling.remove(),J.remove(),Re(e)),t.preventDefault(),!0;if(t.key==="Tab")return t.shiftKey?ee.previousElementSibling.getAttribute("data-type")==="padding"&&ee.previousElementSibling.remove():ee.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(ee.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(ee.textContent)&&(ee.textContent=ee.textContent.replace(/^\d{1,}/,"1"),f.selectNodeContents(J.firstChild),f.collapse(!1)),G(e),t.preventDefault(),!0}}if(tn(e,f,t))return!0;var W=(0,s.Th)(h,"data-block","0"),ce=(0,L.f)(h,"SPAN");if(t.key==="Enter"&&!(0,l._0)(t)&&!t.altKey&&!t.shiftKey&&W){var re=!1,ue=W.textContent.match(/^\n+/);(0,v.ED)(W,e.sv.element).start<=(ue?ue[0].length:0)&&(re=!0);var _e=`
- `;if(ce){if(((i=ce.previousElementSibling)===null||i===void 0?void 0:i.getAttribute("data-action"))==="enter-remove")return ce.previousElementSibling.remove(),Re(e),t.preventDefault(),!0;_e+=dr(ce)}return f.insertNode(document.createTextNode(_e)),f.collapse(!1),W&&W.textContent.trim()!==""&&!re?G(e):Re(e),t.preventDefault(),!0}if(t.key==="Backspace"&&!(0,l._0)(t)&&!t.altKey&&!t.shiftKey){if(ce&&((a=ce.previousElementSibling)===null||a===void 0?void 0:a.getAttribute("data-type"))==="newline"&&(0,v.ED)(ce,e.sv.element,f).start===1&&ce.getAttribute("data-type").indexOf("code-block-")===-1)return f.setStart(ce,0),f.extractContents(),ce.textContent.trim()!==""?G(e):Re(e),t.preventDefault(),!0;if(W&&(0,v.ED)(W,e.sv.element,f).start===0&&W.previousElementSibling){f.extractContents();var Se=W.previousElementSibling.lastElementChild;return Se.getAttribute("data-type")==="newline"&&(Se.remove(),Se=W.previousElementSibling.lastElementChild),Se.getAttribute("data-type")!=="newline"&&(Se.insertAdjacentHTML("afterend",W.innerHTML),W.remove()),W.textContent.trim()!==""&&!(!((o=W.previousElementSibling)===null||o===void 0)&&o.querySelector('[data-type="code-block-open-marker"]'))?G(e):(Se.getAttribute("data-type")!=="newline"&&(f.selectNodeContents(Se.lastChild),f.collapse(!1)),Re(e)),t.preventDefault(),!0}}return!1},C=te(873),q=function(e){e.options.theme==="dark"?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},F=function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),q(e),(0,C.H)(e.options.preview.theme.current,e.options.preview.theme.path),typeof e.options.height=="number"?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,typeof e.options.minHeight=="number"&&(e.element.style.minHeight=e.options.minHeight+"px"),typeof e.options.width=="number"?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content",e.options.outline.position==="left"&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),e.options.outline.position==="right"&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){y(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),at(e,e.options.mode,be(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&typeof window.visualViewport!="undefined"){var n=!1,r=function(i){n||(n=!0,requestAnimationFrame(function(){n=!1;var a=e.toolbar.element;a.style.transform="none",a.getBoundingClientRect().top<0&&(a.style.transform="translate(0, ".concat(-a.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}},le=function(e){var t=window.innerWidth<=E.Y.MOBILE_WIDTH?10:35;if(e.wysiwyg.element.parentElement.style.display!=="none"){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px ".concat(Math.max(t,n),"px")}if(e.ir.element.parentElement.style.display!=="none"){var n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.ir.element.style.padding="10px ".concat(Math.max(t,n),"px")}e.preview.element.style.display!=="block"?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0)+"px"},fe=function(e){if(e.options.typewriterMode){var t=window.innerHeight;typeof e.options.height=="number"?(t=e.options.height,typeof e.options.minHeight=="number"&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}},de;function X(){window.removeEventListener("resize",de)}var be=function(e){fe(e),X(),window.addEventListener("resize",de=function(){le(e),fe(e)});var t=(0,l.D)()&&localStorage.getItem(e.options.cache.id);return(!e.options.cache.enable||!t)&&(e.options.value?t=e.options.value:e.originalInnerHTML?t=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(t="")),t||""},We=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if(e[e.currentMode].element.getAttribute("contenteditable")!=="false"&&(0,v.Co)(e[e.currentMode].element)){g(e.toolbar.elements,E.Y.EDIT_TOOLBARS),m(e.toolbar.elements,E.Y.EDIT_TOOLBARS);var t=(0,v.RN)(e),n=t.startContainer;t.startContainer.nodeType===3&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]);var r=e.currentMode==="sv"?(0,s.Th)(n,"data-type","heading"):(0,L.c)(n);r&&p(e.toolbar.elements,["headings"]);var i=e.currentMode==="sv"?(0,s.Th)(n,"data-type","blockquote"):(0,s._Y)(n,"BLOCKQUOTE");i&&p(e.toolbar.elements,["quote"]);var a=(0,s.Th)(n,"data-type","strong");a&&p(e.toolbar.elements,["bold"]);var o=(0,s.Th)(n,"data-type","em");o&&p(e.toolbar.elements,["italic"]);var f=(0,s.Th)(n,"data-type","s");f&&p(e.toolbar.elements,["strike"]);var h=(0,s.Th)(n,"data-type","a");h&&p(e.toolbar.elements,["link"]);var d=(0,s._Y)(n,"LI");d?(d.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):d.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):d.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),m(e.toolbar.elements,["outdent","indent"])):u(e.toolbar.elements,["outdent","indent"]);var T=(0,s.Th)(n,"data-type","code-block");T&&(u(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),p(e.toolbar.elements,["code"]));var N=(0,s.Th)(n,"data-type","code");N&&(u(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"]));var $=(0,s.Th)(n,"data-type","table");$&&u(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},we=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=V(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,l.D)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},Tt=function(e){for(var t=e.previousSibling;t;){if(t.nodeType!==3&&t.tagName==="A"&&!t.previousSibling&&t.innerHTML.replace(E.Y.ZWSP,"")===""&&t.nextSibling)return t;t=t.previousSibling}return!1},_t=function(e){for(var t=e.startContainer.nextSibling;t&&t.textContent==="";)t=t.nextSibling;return!!(t&&t.nodeType!==3&&(t.tagName==="CODE"||t.getAttribute("data-type")==="math-inline"||t.getAttribute("data-type")==="html-entity"||t.getAttribute("data-type")==="html-inline"))},mt=function(e){for(var t="",n=e.nextSibling;n;)n.nodeType===3?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},gt=function(e){for(var t="",n=e.previousSibling;n;)n.nodeType===3?t=n.textContent+t:t=n.outerHTML+t,n=n.previousSibling;return t},Lt=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling},Mt=function(e){var t=gt(e.startContainer),n=mt(e.startContainer),r=e.startContainer.textContent,i=e.startOffset,a="",o="";return(r.substr(0,i)!==""&&r.substr(0,i)!==E.Y.ZWSP||t)&&(a="".concat(t).concat(r.substr(0,i))),(r.substr(i)!==""&&r.substr(i)!==E.Y.ZWSP||n)&&(o="".concat(r.substr(i)).concat(n)),{afterHTML:o,beforeHTML:a}},rt=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(n.nodeType===3){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var i=t.startContainer.nodeType===3?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,i)),t.collapse(!0),(0,v.jl)(t),!0}else if(!n.getAttribute("data-block"))return n.tagName==="P"?n.remove():(n.tagName==="DIV"?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>")):n.tagName==="BR"?n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"<wbr></p>"):(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"</p>")),(0,v.ir)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},Ct=function(e,t){var n=(0,v.RN)(e),r=(0,s.pt)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),!r&&e.wysiwyg.element.children.length===0&&(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),r.innerHTML.trim()==="<wbr>"&&(r.innerHTML="<wbr><br>"),r.tagName==="BLOCKQUOTE"||r.classList.contains("vditor-reset")?r.innerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"):r.outerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"),(0,v.ir)(e.wysiwyg.element,n),Z(e))},Vt=function(e){var t=getSelection().getRangeAt(0),n=(0,s.pt)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,v.ir)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},yt=function(e,t,n){n===void 0&&(n=!0);var r=e.previousElementSibling,i=r.ownerDocument.createRange();r.tagName==="CODE"?(r.style.display="inline-block",n?i.setStart(r.firstChild,1):i.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),i.selectNodeContents(r.firstChild)),n?i.collapse(!0):i.collapse(!1),(0,v.jl)(i),!e.firstElementChild.classList.contains("language-mindmap")&&Oe(t)},or=function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;t.key.indexOf("Arrow")===-1&&t.key!=="Meta"&&t.key!=="Control"&&t.key!=="Alt"&&t.key!=="Shift"&&t.key!=="CapsLock"&&t.key!=="Escape"&&!/^F\d{1,2}$/.test(t.key)&&e.undo.recordFirstPosition(e,t);var n=(0,v.RN)(e),r=n.startContainer;if(!mn(t,e,r)||(gn(n,e,t),Dn(n),t.key!=="Enter"&&t.key!=="Tab"&&t.key!=="Backspace"&&t.key.indexOf("Arrow")===-1&&!(0,l._0)(t)&&t.key!=="Escape"&&t.key!=="Delete"))return!1;var i=(0,s.pt)(r),a=(0,s._Y)(r,"P");if(En(t,e,a,n)||vn(n,e,a,t)||Ln(e,t,n))return!0;var o=(0,s.KJ)(r,"vditor-wysiwyg__block");if(o){if(t.key==="Escape"&&o.children.length===2)return e.wysiwyg.popover.style.display="none",o.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,l._0)(t)&&!t.shiftKey&&t.altKey&&t.key==="Enter"&&o.getAttribute("data-type")==="code-block"){var f=e.wysiwyg.popover.querySelector(".vditor-input");return f.focus(),f.select(),t.preventDefault(),!0}if(o.getAttribute("data-block")==="0"&&(Mn(e,t,o.firstElementChild,n)||vt(e,t,n,o.firstElementChild,o)||o.getAttribute("data-type")!=="yaml-front-matter"&&ct(e,t,n,o.firstElementChild,o)))return!0}if(Cn(e,n,t,a))return!0;var h=(0,s.Ab)(r,"BLOCKQUOTE");if(h&&!t.shiftKey&&t.altKey&&t.key==="Enter"){(0,l._0)(t)?n.setStartBefore(h):n.setStartAfter(h),(0,v.jl)(n);var d=document.createElement("p");return d.setAttribute("data-block","0"),d.innerHTML=`
- `,n.insertNode(d),n.collapse(!0),(0,v.jl)(n),we(e),Oe(e),t.preventDefault(),!0}var T=(0,L.c)(r);if(T){if(T.tagName==="H6"&&r.textContent.length===n.startOffset&&!(0,l._0)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Enter"){var N=document.createElement("p");return N.textContent=`
- `,N.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",N),n.setStart(N,0),(0,v.jl)(n),we(e),Oe(e),t.preventDefault(),!0}if(_("⌘=",t)){var $=parseInt(T.tagName.substr(1),10)-1;return $>0&&(Ct(e,"h".concat($)),we(e)),t.preventDefault(),!0}if(_("⌘-",t)){var $=parseInt(T.tagName.substr(1),10)+1;return $<7&&(Ct(e,"h".concat($)),we(e)),t.preventDefault(),!0}t.key==="Backspace"&&!(0,l._0)(t)&&!t.shiftKey&&!t.altKey&&T.textContent.length===1&&Vt(e)}if(An(e,n,t))return!0;if(t.altKey&&t.key==="Enter"&&!(0,l._0)(t)&&!t.shiftKey){var J=(0,s._Y)(r,"A"),z=(0,s.Th)(r,"data-type","link-ref"),ae=(0,s.Th)(r,"data-type","footnotes-ref");if(J||z||ae||T&&T.tagName.length===2){var ee=e.wysiwyg.popover.querySelector("input");ee.focus(),ee.select()}}if(Ve(e,t))return!0;if(_("⇧⌘U",t)){var W=e.wysiwyg.popover.querySelector('[data-type="up"]');if(W)return W.click(),t.preventDefault(),!0}if(_("⇧⌘D",t)){var W=e.wysiwyg.popover.querySelector('[data-type="down"]');if(W)return W.click(),t.preventDefault(),!0}if(tn(e,n,t))return!0;if(!(0,l._0)(t)&&t.shiftKey&&!t.altKey&&t.key==="Enter"&&r.parentElement.tagName!=="LI"&&r.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode(`
- `+E.Y.ZWSP)):n.insertNode(document.createTextNode(`
- `)),n.collapse(!1),(0,v.jl)(n),we(e),Oe(e),t.preventDefault(),!0;if(t.key==="Backspace"&&!(0,l._0)(t)&&!t.shiftKey&&!t.altKey&&n.toString()===""){if(xn(e,n,t,a))return!0;if(i){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&i.previousElementSibling.getAttribute("data-block")==="0"&&i.tagName!=="UL"&&i.tagName!=="OL"){var ce=(0,v.ED)(i,e.wysiwyg.element,n).start;if(ce===0&&n.startOffset===0||ce===1&&i.innerText.startsWith(E.Y.ZWSP))return yt(i.previousElementSibling.lastElementChild,e,!1),i.innerHTML.trim().replace(E.Y.ZWSP,"")===""&&(i.remove(),we(e)),t.preventDefault(),!0}var re=n.startOffset;if(n.toString()===""&&r.nodeType===3&&r.textContent.charAt(re-2)===`
- `&&r.textContent.charAt(re-1)!==E.Y.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,re-1)+E.Y.ZWSP,n.setStart(r,re),n.collapse(!0),we(e),t.preventDefault(),!0;r.textContent===E.Y.ZWSP&&n.startOffset===1&&!r.previousSibling&&_t(n)&&(r.textContent=""),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(_e){_e.firstElementChild.style.display="inline",_e.lastElementChild.style.display="none"}),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(_e){_e.firstElementChild.style.display="inline",_e.lastElementChild.style.display="none"})}}if((0,l.gm)()&&n.startOffset===1&&r.textContent.indexOf(E.Y.ZWSP)>-1&&r.previousSibling&&r.previousSibling.nodeType!==3&&r.previousSibling.tagName==="CODE"&&(t.key==="Backspace"||t.key==="ArrowLeft"))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(Hn(t,i,n))return t.preventDefault(),!0;if(yn(n,t.key),t.key==="ArrowDown"){var ue=r.nextSibling;ue&&ue.nodeType!==3&&ue.getAttribute("data-type")==="math-inline"&&n.setStartAfter(ue)}return i&&I(i,e,t,n)?(t.preventDefault(),!0):!1},Ve=function(e,t){if(_("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},it=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(e.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,v.Co)(e.wysiwyg.element)){g(e.toolbar.elements,E.Y.EDIT_TOOLBARS),m(e.toolbar.elements,E.Y.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;t.startContainer.nodeType===3?n=t.startContainer.parentElement:n=n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,s.Th)(n,"data-type","footnotes-block");if(r){e.wysiwyg.popover.innerHTML="",ze(r,e),Fe(e,r);return}var i=(0,s._Y)(n,"LI");i?(i.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):i.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):i.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),m(e.toolbar.elements,["outdent","indent"])):u(e.toolbar.elements,["outdent","indent"]),(0,s._Y)(n,"BLOCKQUOTE")&&p(e.toolbar.elements,["quote"]),((0,s._Y)(n,"B")||(0,s._Y)(n,"STRONG"))&&p(e.toolbar.elements,["bold"]),((0,s._Y)(n,"I")||(0,s._Y)(n,"EM"))&&p(e.toolbar.elements,["italic"]),((0,s._Y)(n,"STRIKE")||(0,s._Y)(n,"S"))&&p(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(ie){ie.classList.remove("vditor-comment--focus")});var a=(0,s.KJ)(n,"vditor-comment");if(a){var o=a.getAttribute("data-cmtids").split(" ");if(o.length>1&&a.nextSibling.isSameNode(a.nextElementSibling)){var f=a.nextElementSibling.getAttribute("data-cmtids").split(" ");o.find(function(ie){if(f.includes(ie))return o=[ie],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(ie){ie.getAttribute("data-cmtids").indexOf(o[0])>-1&&ie.classList.add("vditor-comment--focus")})}var h=(0,s._Y)(n,"A");h&&p(e.toolbar.elements,["link"]);var d=(0,s._Y)(n,"TABLE"),T=(0,L.c)(n);(0,s._Y)(n,"CODE")?(0,s._Y)(n,"PRE")?(u(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),p(e.toolbar.elements,["code"])):(u(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])):T?(u(e.toolbar.elements,["bold"]),p(e.toolbar.elements,["headings"])):d&&u(e.toolbar.elements,["table"]);var N=(0,s.KJ)(n,"vditor-toc");if(N){e.wysiwyg.popover.innerHTML="",ze(N,e),Fe(e,N);return}var $=(0,L.f)(n,"BLOCKQUOTE");if($&&(e.wysiwyg.popover.innerHTML="",ot(t,$,e),st(t,$,e),ze($,e),Fe(e,$)),i&&(e.wysiwyg.popover.innerHTML="",ot(t,i,e),st(t,i,e),ze(i,e),Fe(e,i)),d){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var J=function(){var ie=d.rows.length,ge=d.rows[0].cells.length,tt=parseInt(Ne.value,10)||ie,nt=parseInt(Ke.value,10)||ge;if(!(tt===ie&&ge===nt)){if(ge!==nt)for(var kt=nt-ge,Xe=0;Xe<d.rows.length;Xe++)if(kt>0)for(var Yn=0;Yn<kt;Yn++)Xe===0?d.rows[Xe].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):d.rows[Xe].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var an=ge-1;an>=nt;an--)d.rows[Xe].cells[an].remove();if(ie!==tt){var qn=tt-ie;if(qn>0){for(var on="<tr>",dt=0;dt<nt;dt++)on+="<td> </td>";for(var Kn=0;Kn<qn;Kn++)d.querySelector("tbody")?d.querySelector("tbody").insertAdjacentHTML("beforeend",on):d.querySelector("thead").insertAdjacentHTML("afterend",on+"</tr>")}else for(var dt=ie-1;dt>=tt;dt--)d.rows[dt].remove(),d.rows.length===1&&d.querySelector("tbody").remove()}typeof e.options.input=="function"&&e.options.input(V(e))}},z=function(ie){Ot(d,ie),ie==="right"?(ce.classList.remove("vditor-icon--current"),re.classList.remove("vditor-icon--current"),ue.classList.add("vditor-icon--current")):ie==="center"?(ce.classList.remove("vditor-icon--current"),ue.classList.remove("vditor-icon--current"),re.classList.add("vditor-icon--current")):(re.classList.remove("vditor-icon--current"),ue.classList.remove("vditor-icon--current"),ce.classList.add("vditor-icon--current")),(0,v.jl)(t),we(e)},ae=(0,s._Y)(n,"TD"),ee=(0,s._Y)(n,"TH"),W="left";ae?W=ae.getAttribute("align")||"left":ee&&(W=ee.getAttribute("align")||"center");var ce=document.createElement("button");ce.setAttribute("type","button"),ce.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,l.fG)("⇧⌘L")+">"),ce.setAttribute("data-type","left"),ce.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',ce.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(W==="left"?" vditor-icon--current":""),ce.onclick=function(){z("left")};var re=document.createElement("button");re.setAttribute("type","button"),re.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,l.fG)("⇧⌘C")+">"),re.setAttribute("data-type","center"),re.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',re.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(W==="center"?" vditor-icon--current":""),re.onclick=function(){z("center")};var ue=document.createElement("button");ue.setAttribute("type","button"),ue.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,l.fG)("⇧⌘R")+">"),ue.setAttribute("data-type","right"),ue.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',ue.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(W==="right"?" vditor-icon--current":""),ue.onclick=function(){z("right")};var _e=document.createElement("button");_e.setAttribute("type","button"),_e.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,l.fG)("⌘=")+">"),_e.setAttribute("data-type","insertRow"),_e.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',_e.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",_e.onclick=function(){var ie=getSelection().getRangeAt(0).startContainer,ge=(0,s._Y)(ie,"TD")||(0,s._Y)(ie,"TH");ge&&Sn(e,t,ge)};var Se=document.createElement("button");Se.setAttribute("type","button"),Se.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,l.fG)("⇧⌘F")+">"),Se.setAttribute("data-type","insertRow"),Se.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',Se.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Se.onclick=function(){var ie=getSelection().getRangeAt(0).startContainer,ge=(0,s._Y)(ie,"TD")||(0,s._Y)(ie,"TH");ge&&kn(e,t,ge)};var Le=document.createElement("button");Le.setAttribute("type","button"),Le.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,l.fG)("⇧⌘=")+">"),Le.setAttribute("data-type","insertColumn"),Le.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',Le.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Le.onclick=function(){var ie=getSelection().getRangeAt(0).startContainer,ge=(0,s._Y)(ie,"TD")||(0,s._Y)(ie,"TH");ge&&Nt(e,d,ge)};var Ye=document.createElement("button");Ye.setAttribute("type","button"),Ye.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,l.fG)("⇧⌘G")+">"),Ye.setAttribute("data-type","insertColumn"),Ye.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',Ye.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Ye.onclick=function(){var ie=getSelection().getRangeAt(0).startContainer,ge=(0,s._Y)(ie,"TD")||(0,s._Y)(ie,"TH");ge&&Nt(e,d,ge,"beforebegin")};var Pe=document.createElement("button");Pe.setAttribute("type","button"),Pe.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,l.fG)("⌘-")+">"),Pe.setAttribute("data-type","deleteRow"),Pe.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',Pe.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Pe.onclick=function(){var ie=getSelection().getRangeAt(0).startContainer,ge=(0,s._Y)(ie,"TD")||(0,s._Y)(ie,"TH");ge&&Tn(e,t,ge)};var qe=document.createElement("button");qe.setAttribute("type","button"),qe.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,l.fG)("⇧⌘-")+">"),qe.setAttribute("data-type","deleteColumn"),qe.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',qe.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",qe.onclick=function(){var ie=getSelection().getRangeAt(0).startContainer,ge=(0,s._Y)(ie,"TD")||(0,s._Y)(ie,"TH");ge&&_n(e,t,d,ge)};var he=document.createElement("span");he.setAttribute("aria-label",window.VditorI18n.row),he.className="vditor-tooltipped vditor-tooltipped__n";var Ne=document.createElement("input");he.appendChild(Ne),Ne.type="number",Ne.min="1",Ne.className="vditor-input",Ne.style.width="42px",Ne.style.textAlign="center",Ne.setAttribute("placeholder",window.VditorI18n.row),Ne.value=d.rows.length.toString(),Ne.oninput=function(){J()},Ne.onkeydown=function(ie){if(!ie.isComposing){if(ie.key==="Tab"){Ke.focus(),Ke.select(),ie.preventDefault();return}Ve(e,ie)||Je(ie,t)}};var It=document.createElement("span");It.setAttribute("aria-label",window.VditorI18n.column),It.className="vditor-tooltipped vditor-tooltipped__n";var Ke=document.createElement("input");It.appendChild(Ke),Ke.type="number",Ke.min="1",Ke.className="vditor-input",Ke.style.width="42px",Ke.style.textAlign="center",Ke.setAttribute("placeholder",window.VditorI18n.column),Ke.value=d.rows[0].cells.length.toString(),Ke.oninput=function(){J()},Ke.onkeydown=function(ie){if(!ie.isComposing){if(ie.key==="Tab"){Ne.focus(),Ne.select(),ie.preventDefault();return}Ve(e,ie)||Je(ie,t)}},ot(t,d,e),st(t,d,e),ze(d,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",ce),e.wysiwyg.popover.insertAdjacentElement("beforeend",re),e.wysiwyg.popover.insertAdjacentElement("beforeend",ue),e.wysiwyg.popover.insertAdjacentElement("beforeend",Se),e.wysiwyg.popover.insertAdjacentElement("beforeend",_e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Ye),e.wysiwyg.popover.insertAdjacentElement("beforeend",Le),e.wysiwyg.popover.insertAdjacentElement("beforeend",Pe),e.wysiwyg.popover.insertAdjacentElement("beforeend",qe),e.wysiwyg.popover.insertAdjacentElement("beforeend",he),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",It),Fe(e,d)}var rn=(0,s.Th)(n,"data-type","link-ref");rn&&ln(e,rn,t);var ut=(0,s.Th)(n,"data-type","footnotes-ref");if(ut){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var he=document.createElement("span");he.setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,l.fG)("⌥Enter")+">"),he.className="vditor-tooltipped vditor-tooltipped__n";var Qe=document.createElement("input");he.appendChild(Qe),Qe.className="vditor-input",Qe.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,l.fG)("⌥Enter")+">"),Qe.style.width="120px",Qe.value=ut.getAttribute("data-footnotes-label"),Qe.oninput=function(){Qe.value.trim()!==""&&ut.setAttribute("data-footnotes-label",Qe.value),typeof e.options.input=="function"&&e.options.input(V(e))},Qe.onkeydown=function(ge){ge.isComposing||Ve(e,ge)||Je(ge,t)},ze(ut,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",he),Fe(e,ut)}var Ie=(0,s.KJ)(n,"vditor-wysiwyg__block"),Un=Ie?Ie.getAttribute("data-type").indexOf("block")>-1:!1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(ie){if(!Ie||Ie&&Un&&!Ie.contains(ie)){var ge=ie.previousElementSibling;ge.style.display="none"}}),Ie&&Un){if(e.wysiwyg.popover.innerHTML="",ot(t,Ie,e),st(t,Ie,e),ze(Ie,e),Ie.getAttribute("data-type")==="code-block"){var Pt=document.createElement("span");Pt.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,l.fG)("⌥Enter")+">"),Pt.className="vditor-tooltipped vditor-tooltipped__n";var Ze=document.createElement("input");Pt.appendChild(Ze);var St=Ie.firstElementChild.firstElementChild;Ze.className="vditor-input",Ze.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,l.fG)("⌥Enter")+">"),Ze.value=St.className.indexOf("language-")>-1?St.className.split("-")[1].split(" ")[0]:"",Ze.oninput=function(ie){Ze.value.trim()!==""?St.className="language-".concat(Ze.value):(St.className="",e.hint.recentLanguage=""),Ie.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(Ie.lastElementChild.innerHTML=Ie.firstElementChild.innerHTML,He(Ie.lastElementChild,e)),we(e),ie.detail===1&&(t.setStart(St.firstChild,0),t.collapse(!0),(0,v.jl)(t))},Ze.onkeydown=function(ie){if(!ie.isComposing&&!Ve(e,ie)){if(ie.key==="Escape"&&e.hint.element.style.display==="block"){e.hint.element.style.display="none",ie.preventDefault();return}e.hint.select(ie,e),Je(ie,t)}},Ze.onkeyup=function(ie){var ge,tt;if(!(ie.isComposing||ie.key==="Enter"||ie.key==="ArrowUp"||ie.key==="Escape"||ie.key==="ArrowDown")){var nt=[],kt=Ze.value.substring(0,Ze.selectionStart);(e.options.preview.hljs.langs||E.Y.ALIAS_CODE_LANGUAGES.concat(((tt=(ge=window.hljs)===null||ge===void 0?void 0:ge.listLanguages())!==null&&tt!==void 0?tt:[]).sort())).forEach(function(Xe){Xe.indexOf(kt.toLowerCase())>-1&&nt.push({html:Xe,value:Xe})}),e.hint.genHTML(nt,kt,e),ie.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",Pt)}Fe(e,Ie)}else Ie=void 0;if(T){e.wysiwyg.popover.innerHTML="";var he=document.createElement("span");he.setAttribute("aria-label","ID<"+(0,l.fG)("⌥Enter")+">"),he.className="vditor-tooltipped vditor-tooltipped__n";var et=document.createElement("input");he.appendChild(et),et.className="vditor-input",et.setAttribute("placeholder","ID<"+(0,l.fG)("⌥Enter")+">"),et.style.width="120px",et.value=T.getAttribute("data-id")||"",et.oninput=function(){T.setAttribute("data-id",et.value),typeof e.options.input=="function"&&e.options.input(V(e))},et.onkeydown=function(ge){ge.isComposing||Ve(e,ge)||Je(ge,t)},ot(t,T,e),st(t,T,e),ze(T,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",he),Fe(e,T)}if(h&&Yt(e,h,t),!$&&!i&&!d&&!Ie&&!h&&!rn&&!ut&&!T&&!N){var ft=(0,s.Th)(n,"data-block","0");ft&&ft.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",ot(t,ft,e),st(t,ft,e),ze(ft,e),Fe(e,ft)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(ie){ie.style.display="none"});var Vn=(0,s.Th)(t.startContainer,"data-type","backslash");Vn&&(Vn.querySelector("span").style.display="inline")}},200)},Fe=function(e,t){var n=t,r=(0,s._Y)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},ln=function(e,t,n){n===void 0&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){a.value.trim()!==""&&(t.tagName==="IMG"?t.setAttribute("alt",a.value):t.textContent=a.value),f.value.trim()!==""&&t.setAttribute("data-link-label",f.value),typeof e.options.input=="function"&&e.options.input(V(e))},i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),i.className="vditor-tooltipped vditor-tooltipped__n";var a=document.createElement("input");i.appendChild(a),a.className="vditor-input",a.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),a.style.width="120px",a.value=t.getAttribute("alt")||t.textContent,a.oninput=function(){r()},a.onkeydown=function(h){Ve(e,h)||Je(h,n)||bt(e,t,h,f)};var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.linkRef),o.className="vditor-tooltipped vditor-tooltipped__n";var f=document.createElement("input");o.appendChild(f),f.className="vditor-input",f.setAttribute("placeholder",window.VditorI18n.linkRef),f.value=t.getAttribute("data-link-label"),f.oninput=function(){r()},f.onkeydown=function(h){Ve(e,h)||Je(h,n)||bt(e,t,h,a)},ze(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",i),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),Fe(e,t)},ot=function(e,t,n){var r=t.previousElementSibling;if(!(!r||!t.parentElement.isEqualNode(n.wysiwyg.element)&&t.tagName!=="LI")){var i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("data-type","up"),i.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,l.fG)("⇧⌘U")+">"),i.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',i.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",i.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,v.ir)(n.wysiwyg.element,e),we(n),it(n),Oe(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",i)}},st=function(e,t,n){var r=t.nextElementSibling;if(!(!r||!t.parentElement.isEqualNode(n.wysiwyg.element)&&t.tagName!=="LI")){var i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("data-type","down"),i.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,l.fG)("⇧⌘D")+">"),i.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',i.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",i.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,v.ir)(n.wysiwyg.element,e),we(n),it(n),Oe(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",i)}},ze=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,l.fG)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var r=(0,v.RN)(t);r.setStartAfter(e),(0,v.jl)(r),e.remove(),we(t),it(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&Z(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},bt=function(e,t,n,r){if(!n.isComposing){if(n.key==="Tab"){r.focus(),r.select(),n.preventDefault();return}if(!(0,l._0)(n)&&!n.shiftKey&&n.altKey&&n.key==="Enter"){var i=(0,v.RN)(e);t.insertAdjacentHTML("afterend",E.Y.ZWSP),i.setStartAfter(t.nextSibling),i.collapse(!0),(0,v.jl)(i),n.preventDefault()}}},Yt=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){a.value.trim()!==""&&(t.innerHTML=a.value),t.setAttribute("href",f.value),t.setAttribute("title",d.value),we(e)};t.querySelectorAll("[data-marker]").forEach(function(T){T.removeAttribute("data-marker")});var i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),i.className="vditor-tooltipped vditor-tooltipped__n";var a=document.createElement("input");i.appendChild(a),a.className="vditor-input",a.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),a.style.width="120px",a.value=t.innerHTML||"",a.oninput=function(){r()},a.onkeydown=function(T){Ve(e,T)||Je(T,n)||bt(e,t,T,f)};var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.link),o.className="vditor-tooltipped vditor-tooltipped__n";var f=document.createElement("input");o.appendChild(f),f.className="vditor-input",f.setAttribute("placeholder",window.VditorI18n.link),f.value=t.getAttribute("href")||"",f.oninput=function(){r()},f.onkeydown=function(T){Ve(e,T)||Je(T,n)||bt(e,t,T,d)};var h=document.createElement("span");h.setAttribute("aria-label",window.VditorI18n.tooltipText),h.className="vditor-tooltipped vditor-tooltipped__n";var d=document.createElement("input");h.appendChild(d),d.className="vditor-input",d.setAttribute("placeholder",window.VditorI18n.tooltipText),d.style.width="60px",d.value=t.getAttribute("title")||"",d.oninput=function(){r()},d.onkeydown=function(T){Ve(e,T)||Je(T,n)||bt(e,t,T,a)},ze(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",i),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",h),Fe(e,t)},sr=function(e,t){var n=e.target;t.wysiwyg.popover.innerHTML="";var r=function(){n.setAttribute("src",a.value),n.setAttribute("alt",f.value),n.setAttribute("title",d.value),typeof t.options.input=="function"&&t.options.input(V(t))},i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.imageURL),i.className="vditor-tooltipped vditor-tooltipped__n";var a=document.createElement("input");i.appendChild(a),a.className="vditor-input",a.setAttribute("placeholder",window.VditorI18n.imageURL),a.value=n.getAttribute("src")||"",a.oninput=function(){r()},a.onkeydown=function(T){Ve(t,T)};var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.alternateText),o.className="vditor-tooltipped vditor-tooltipped__n";var f=document.createElement("input");o.appendChild(f),f.className="vditor-input",f.setAttribute("placeholder",window.VditorI18n.alternateText),f.style.width="52px",f.value=n.getAttribute("alt")||"",f.oninput=function(){r()},f.onkeydown=function(T){Ve(t,T)};var h=document.createElement("span");h.setAttribute("aria-label",window.VditorI18n.title),h.className="vditor-tooltipped vditor-tooltipped__n";var d=document.createElement("input");h.appendChild(d),d.className="vditor-input",d.setAttribute("placeholder",window.VditorI18n.title),d.value=n.getAttribute("title")||"",d.oninput=function(){r()},d.onkeydown=function(T){Ve(t,T)},ze(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",i),t.wysiwyg.popover.insertAdjacentElement("beforeend",o),t.wysiwyg.popover.insertAdjacentElement("beforeend",h),Fe(t,n)},Je=function(e,t){if(!(0,l._0)(e)&&!e.shiftKey&&e.key==="Enter"||e.key==="Escape")return t&&(0,v.jl)(t),e.preventDefault(),e.stopPropagation(),!0},lt=function(e){e.currentMode==="wysiwyg"?it(e):e.currentMode==="ir"&&We(e)},cn=function(e,t,n){n===void 0&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(i){He(i,e),i.previousElementSibling.setAttribute("style","display:none")}),we(e,n)},lr=function(e,t,n){for(var r=e.startContainer.parentElement,i=!1,a="",o="",f=Mt(e),h=f.beforeHTML,d=f.afterHTML;r&&!i;){var T=r.tagName;if(T==="STRIKE"&&(T="S"),T==="I"&&(T="EM"),T==="B"&&(T="STRONG"),T==="S"||T==="STRONG"||T==="EM"){var N="",$="",J="";r.parentElement.getAttribute("data-block")!=="0"&&($=gt(r),J=mt(r)),(h||$)&&(N="".concat($,"<").concat(T,">").concat(h,"</").concat(T,">"),h=N),(n==="bold"&&T==="STRONG"||n==="italic"&&T==="EM"||n==="strikeThrough"&&T==="S")&&(N+="".concat(a).concat(E.Y.ZWSP,"<wbr>").concat(o),i=!0),(d||J)&&(d="<".concat(T,">").concat(d,"</").concat(T,">").concat(J),N+=d),r.parentElement.getAttribute("data-block")!=="0"?(r=r.parentElement,r.innerHTML=N):(r.outerHTML=N,r=r.parentElement),a="<".concat(T,">")+a,o="</".concat(T,">")+o}else i=!0}(0,v.ir)(t.wysiwyg.element,e)},cr=function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,i=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var a=(0,v.RN)(e),o=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if(o==="strike"&&(o="strikeThrough"),o==="quote"){var f=(0,s._Y)(a.startContainer,"BLOCKQUOTE");f||(f=a.startContainer.childNodes[a.startOffset]),f&&(r=!1,t.classList.remove("vditor-menu--current"),a.insertNode(document.createElement("wbr")),f.outerHTML=f.innerHTML.trim()===""?'<p data-block="0">'.concat(f.innerHTML,"</p>"):f.innerHTML,(0,v.ir)(e.wysiwyg.element,a))}else if(o==="inline-code"){var h=(0,s._Y)(a.startContainer,"CODE");h||(h=a.startContainer.childNodes[a.startOffset]),h&&(h.outerHTML=h.innerHTML.replace(E.Y.ZWSP,"")+"<wbr>",(0,v.ir)(e.wysiwyg.element,a))}else o==="link"?(a.collapsed&&a.selectNode(a.startContainer.parentElement),document.execCommand("unlink",!1,"")):o==="check"||o==="list"||o==="ordered-list"?(Ht(e,a,o),(0,v.ir)(e.wysiwyg.element,a),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),a.toString()===""?lr(a,e,o):document.execCommand(o,!1,""));else{e.wysiwyg.element.childNodes.length===0&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,v.ir)(e.wysiwyg.element,a));var d=(0,s.pt)(a.startContainer);if(o==="quote"){if(d||(d=a.startContainer.childNodes[a.startOffset]),d){r=!1,t.classList.add("vditor-menu--current"),a.insertNode(document.createElement("wbr"));var T=(0,s._Y)(a.startContainer,"LI");T&&d.contains(T)?T.innerHTML='<blockquote data-block="0">'.concat(T.innerHTML,"</blockquote>"):d.outerHTML='<blockquote data-block="0">'.concat(d.outerHTML,"</blockquote>"),(0,v.ir)(e.wysiwyg.element,a)}}else if(o==="check"||o==="list"||o==="ordered-list")Ht(e,a,o,!1),(0,v.ir)(e.wysiwyg.element,a),r=!1,g(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if(o==="inline-code"){if(a.toString()===""){var N=document.createElement("code");N.textContent=E.Y.ZWSP,a.insertNode(N),a.setStart(N.firstChild,1),a.collapse(!0),(0,v.jl)(a)}else if(a.startContainer.nodeType===3){var N=document.createElement("code");a.surroundContents(N),a.insertNode(N),(0,v.jl)(a)}t.classList.add("vditor-menu--current")}else if(o==="code"){var N=document.createElement("div");N.className="vditor-wysiwyg__block",N.setAttribute("data-type","code-block"),N.setAttribute("data-block","0"),N.setAttribute("data-marker","```"),a.toString()===""?N.innerHTML=`<pre><code><wbr>
- </code></pre>`:(N.innerHTML="<pre><code>".concat(a.toString(),"<wbr></code></pre>"),a.deleteContents()),a.insertNode(N),d&&(d.outerHTML=e.lute.SpinVditorDOM(d.outerHTML)),(0,v.ir)(e.wysiwyg.element,a),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(_e){He(_e,e)}),t.classList.add("vditor-menu--disabled")}else if(o==="link"){if(a.toString()===""){var $=document.createElement("a");$.innerText=E.Y.ZWSP,a.insertNode($),a.setStart($.firstChild,1),a.collapse(!0),Yt(e,$,a);var J=e.wysiwyg.popover.querySelector("input");J.value="",J.focus(),i=!1}else{var N=document.createElement("a");N.setAttribute("href",""),N.innerHTML=a.toString(),a.surroundContents(N),a.insertNode(N),(0,v.jl)(a),Yt(e,N,a);var z=e.wysiwyg.popover.querySelectorAll("input");z[0].value=N.innerText,z[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if(o==="table"){var ae='<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(a.toString().trim()==="")d&&d.innerHTML.trim().replace(E.Y.ZWSP,"")===""?d.outerHTML=ae:document.execCommand("insertHTML",!1,ae),a.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,v.jl)(a);else{ae='<table data-block="0"><thead><tr>';var ee=a.toString().split(`
- `),W=ee[0].split(",").length>ee[0].split(" ").length?",":" ";ee.forEach(function(ue,_e){_e===0?(ue.split(W).forEach(function(Se,Le){Le===0?ae+="<th>".concat(Se,"<wbr></th>"):ae+="<th>".concat(Se,"</th>")}),ae+="</tr></thead>"):(_e===1?ae+="<tbody><tr>":ae+="<tr>",ue.split(W).forEach(function(Se){ae+="<td>".concat(Se,"</td>")}),ae+="</tr>")}),ae+="</tbody></table>",document.execCommand("insertHTML",!1,ae),(0,v.ir)(e.wysiwyg.element,a)}r=!1,t.classList.add("vditor-menu--disabled")}else if(o==="line"){if(d){var ce=`<hr data-block="0"><p data-block="0"><wbr>
- </p>`;d.innerHTML.trim()===""?d.outerHTML=ce:d.insertAdjacentHTML("afterend",ce),(0,v.ir)(e.wysiwyg.element,a)}}else if(r=!1,t.classList.add("vditor-menu--current"),o==="strike"&&(o="strikeThrough"),a.toString()===""&&(o==="bold"||o==="italic"||o==="strikeThrough")){var re="strong";o==="italic"?re="em":o==="strikeThrough"&&(re="s");var N=document.createElement(re);N.textContent=E.Y.ZWSP,a.insertNode(N),N.previousSibling&&N.previousSibling.textContent===E.Y.ZWSP&&(N.previousSibling.textContent=""),a.setStart(N.firstChild,1),a.collapse(!0),(0,v.jl)(a)}else document.execCommand(o,!1,"")}r&&it(e),i&&we(e)}},Ae=function(){function e(t,n){var r,i=this;this.element=document.createElement("div"),n.className&&(r=this.element.classList).add.apply(r,n.className.split(" "));var a=n.hotkey?" <".concat((0,l.fG)(n.hotkey),">"):"";n.level===2&&(a=n.hotkey?" <".concat((0,l.fG)(n.hotkey),">"):"");var o=n.tip?n.tip+a:"".concat(window.VditorI18n[n.name]).concat(a),f=n.name==="upload"?"div":"button";if(n.level===2)this.element.innerHTML="<".concat(f,' data-type="').concat(n.name,'">').concat(o,"</").concat(f,">");else{this.element.classList.add("vditor-toolbar__item");var h=document.createElement(f);h.setAttribute("data-type",n.name),h.className="vditor-tooltipped vditor-tooltipped__".concat(n.tipPosition),h.setAttribute("aria-label",o),h.innerHTML=n.icon,this.element.appendChild(h)}n.prefix&&this.element.children[0].addEventListener((0,l.y3)(),function(d){d.preventDefault(),!i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)&&(t.currentMode==="wysiwyg"?cr(t,i.element.children[0],d):t.currentMode==="ir"?Tr(t,i.element.children[0],n.prefix||"",n.suffix||""):pr(t,i.element.children[0],n.prefix||"",n.suffix||""))})}return e}(),ur=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),at=function(e,t,n){var r;if(typeof n!="string"?(y(e,["subToolbar","hint"]),n.preventDefault(),r=V(e)):r=n,!(e.currentMode===t&&typeof n!="string")){if(e.devtools&&e.devtools.renderEchart(e),e.options.preview.mode==="both"&&t==="sv"?e.preview.element.style.display="block":e.preview.element.style.display="none",m(e.toolbar.elements,E.Y.EDIT_TOOLBARS),g(e.toolbar.elements,E.Y.EDIT_TOOLBARS),u(e.toolbar.elements,["outdent","indent"]),t==="ir")S(e.toolbar.elements,["both"]),b(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),$e(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),le(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(a){He(a,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(a){(0,ye.T)(a,{cdn:e.options.cdn,math:e.options.preview.math})});else if(t==="wysiwyg")S(e.toolbar.elements,["both"]),b(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",le(e),cn(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(a){(0,ye.T)(a,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if(t==="sv"){b(e.toolbar.elements,["both"]),S(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",(e.options.preview.mode==="both"||e.options.preview.mode==="editor")&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var i=fn(r,e);i==="<div data-block='0'></div>"&&(i=""),e.sv.element.innerHTML=i,K(e.sv.element),Re(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),le(e)}e.undo.resetIcon(e),typeof n!="string"&&(e[e.currentMode].element.focus(),lt(e)),Z(e),fe(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(a){a.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(e.currentMode,'"]')).classList.add("vditor-menu--current")),e.outline.toggle(e,e.currentMode!=="sv"&&e.options.outline.enable,typeof n!="string")}},fr=function(e){ur(t,e);function t(n,r){var i=e.call(this,n,r)||this,a=document.createElement("div");return a.className="vditor-hint".concat(r.level===2?"":" vditor-panel--arrow"),a.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," <").concat((0,l.fG)("⌥⌘7"),`></button>
- <button data-mode="ir">`).concat(window.VditorI18n.instantRendering," <").concat((0,l.fG)("⌥⌘8"),`></button>
- <button data-mode="sv">`).concat(window.VditorI18n.splitView," <").concat((0,l.fG)("⌥⌘9"),"></button>"),i.element.appendChild(a),i._bindEvent(n,a,r),i}return t.prototype._bindEvent=function(n,r,i){var a=this.element.children[0];w(n,r,a,i.level),r.children.item(0).addEventListener((0,l.y3)(),function(o){at(n,"wysiwyg",o),o.preventDefault(),o.stopPropagation()}),r.children.item(1).addEventListener((0,l.y3)(),function(o){at(n,"ir",o),o.preventDefault(),o.stopPropagation()}),r.children.item(2).addEventListener((0,l.y3)(),function(o){at(n,"sv",o),o.preventDefault(),o.stopPropagation()})},t}(Ae),wt=function(e,t){return(0,v.Co)(e,t)?getSelection().toString():""},qt=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(V(e)),y(e,["subToolbar","hint"])})},un=function(e,t){t.addEventListener("dblclick",function(n){n.target.tagName==="IMG"&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,M.o)(n.target,e.options.lang,e.options.theme))})},Kt=function(e,t){t.addEventListener("blur",function(n){if(e.currentMode==="ir"){var r=e.ir.element.querySelector(".vditor-ir__node--expand");r&&r.classList.remove("vditor-ir__node--expand")}else e.currentMode==="wysiwyg"&&!e.wysiwyg.selectPopover.contains(n.relatedTarget)&&e.wysiwyg.hideComment();e[e.currentMode].range=(0,v.RN)(e),e.options.blur&&e.options.blur(V(e))})},Wt=function(e,t){t.addEventListener("dragstart",function(n){n.dataTransfer.setData(E.Y.DROP_EDITOR,E.Y.DROP_EDITOR)}),t.addEventListener("drop",function(n){n.dataTransfer.getData(E.Y.DROP_EDITOR)?me(e):(n.dataTransfer.types.includes("Files")||n.dataTransfer.types.includes("text/html"))&&Rt(e,n,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})})},Ft=function(e,t,n){t.addEventListener("copy",function(r){return n(r,e)})},zt=function(e,t,n){t.addEventListener("cut",function(r){n(r,e),e.options.comment.enable&&e.currentMode==="wysiwyg"&&e.wysiwyg.getComments(e),document.execCommand("delete")})},Oe=function(e){if(e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),!!e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,v.Ey)(t).top;e.options.height==="auto"&&!e.element.classList.contains("vditor--fullscreen")&&window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),(e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},Zt=function(e,t){t.addEventListener("keydown",function(n){if(!n.isComposing&&e.options.keydown&&e.options.keydown(n),!((e.options.hint.extend.length>1||e.toolbar.elements.emoji)&&e.hint.select(n,e))){if(e.options.comment.enable&&e.currentMode==="wysiwyg"&&(n.key==="Backspace"||_("⌘X",n))&&e.wysiwyg.getComments(e),e.currentMode==="sv"){if(P(e,n))return}else if(e.currentMode==="wysiwyg"){if(or(e,n))return}else if(e.currentMode==="ir"&&O(e,n))return;if(e.options.ctrlEnter&&_("⌘Enter",n)){e.options.ctrlEnter(V(e)),n.preventDefault();return}if(_("⌘Z",n)&&!e.toolbar.elements.undo){e.undo.undo(e),n.preventDefault();return}if(_("⌘Y",n)&&!e.toolbar.elements.redo){e.undo.redo(e),n.preventDefault();return}if(n.key==="Escape"){e.hint.element.style.display==="block"?e.hint.element.style.display="none":e.options.esc&&!n.isComposing&&e.options.esc(V(e)),n.preventDefault();return}if((0,l._0)(n)&&n.altKey&&!n.shiftKey&&/^Digit[1-6]$/.test(n.code)){if(e.currentMode==="wysiwyg"){var r=n.code.replace("Digit","H");(0,s._Y)(getSelection().getRangeAt(0).startContainer,r)?Vt(e):Ct(e,r),we(e)}else e.currentMode==="sv"?dn(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" "):e.currentMode==="ir"&&Et(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" ");return n.preventDefault(),!0}if((0,l._0)(n)&&n.altKey&&!n.shiftKey&&/^Digit[7-9]$/.test(n.code))return n.code==="Digit7"?at(e,"wysiwyg",n):n.code==="Digit8"?at(e,"ir",n):n.code==="Digit9"&&at(e,"sv",n),!0;e.options.toolbar.find(function(i){if(!i.hotkey||i.toolbar){if(i.toolbar){var a=i.toolbar.find(function(o){if(!o.hotkey)return!1;if(_(o.hotkey,n))return e.toolbar.elements[o.name].children[0].dispatchEvent(new CustomEvent((0,l.y3)())),n.preventDefault(),!0});return!!a}return!1}if(_(i.hotkey,n))return e.toolbar.elements[i.name].children[0].dispatchEvent(new CustomEvent((0,l.y3)())),n.preventDefault(),!0})}})},Gt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var r=wt(e[e.currentMode].element);r.trim()?(e.currentMode==="wysiwyg"&&e.options.comment.enable&&(!(0,s.Th)(n.target,"data-type","footnotes-block")&&!(0,s.Th)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.showComment():e.wysiwyg.hideComment()),e.options.select&&e.options.select(r)):e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},Jt=function(e,t){var n=(0,v.RN)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,s.Th)(n.startContainer,"data-block","0");r||(r=e.sv.element);var i=e.lute.SpinVditorSVDOM(r.textContent);i="<div data-block='0'>"+i.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>",r.isEqualNode(e.sv.element)?r.innerHTML=i:r.outerHTML=i,K(e.sv.element),(0,v.ir)(e.sv.element,n),Oe(e)},At=function(e,t,n){n===void 0&&(n=!0);var r=e;for(r.nodeType===3&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;n?r=r.previousElementSibling:r=r.nextElementSibling}return!1},fn=function(e,t){U("SpinVditorSVDOM",e,"argument",t.options.debugger);var n=t.lute.SpinVditorSVDOM(e);return e="<div data-block='0'>"+n.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>",U("SpinVditorSVDOM",e,"result",t.options.debugger),e},dr=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=t&&t!=="text"&&t!=="table"&&t!=="heading-marker"&&t!=="newline"&&t!=="yaml-front-matter-open-marker"&&t!=="yaml-front-matter-close-marker"&&t!=="code-block-info"&&t!=="code-block-close-marker"&&t!=="code-block-open-marker"?e.textContent:"",i=!1;for(t==="newline"&&(i=!0);n&&!i;){var a=n.getAttribute("data-type");if(a==="li-marker"||a==="blockquote-marker"||a==="task-marker"||a==="padding"){var o=n.textContent;if(a==="li-marker"&&(t==="code-block-open-marker"||t==="code-block-info"))r=o.replace(/\S/g," ")+r;else if(t==="code-block-close-marker"&&n.nextElementSibling.isSameNode(e)){var f=At(e,"code-block-open-marker");f&&f.previousElementSibling&&(n=f.previousElementSibling,r=o+r)}else r=o+r}else a==="newline"&&(i=!0);n=n.previousElementSibling}return r},Re=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=V(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,l.D)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},dn=function(e,t){var n=(0,v.RN)(e),r=(0,L.f)(n.startContainer,"SPAN");r&&r.textContent.trim()!==""&&(t=`
- `+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},pr=function(e,t,n,r){var i=(0,v.RN)(e),a=t.getAttribute("data-type");e.sv.element.childNodes.length===0&&(e.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,v.ir)(e.sv.element,i));var o=(0,s.pt)(i.startContainer),f=(0,L.f)(i.startContainer,"SPAN");if(o){if(a==="link"){var h=void 0;i.toString()===""?h="".concat(n).concat(Lute.Caret).concat(r):h="".concat(n).concat(i.toString()).concat(r.replace(")",Lute.Caret+")")),document.execCommand("insertHTML",!1,h);return}else if(a==="italic"||a==="bold"||a==="strike"||a==="inline-code"||a==="code"||a==="table"||a==="line"){var h=void 0;i.toString()===""?h="".concat(n).concat(Lute.Caret).concat(a==="code"?"":r):h="".concat(n).concat(i.toString()).concat(Lute.Caret).concat(a==="code"?"":r),a==="table"||a==="code"&&f&&f.textContent!==""?h=`
- `+h:a==="line"&&(h=`
- `.concat(n,`
- `).concat(Lute.Caret)),document.execCommand("insertHTML",!1,h);return}else if((a==="check"||a==="list"||a==="ordered-list"||a==="quote")&&f){var d="* ";a==="check"?d="* [ ] ":a==="ordered-list"?d="1. ":a==="quote"&&(d="> ");var T=At(f,"newline");T?T.insertAdjacentText("afterend",d):o.insertAdjacentText("afterbegin",d),G(e);return}(0,v.ir)(e.sv.element,i),Re(e)}},pn=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},hn=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},hr=function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function f(T){try{d(r.next(T))}catch(N){o(N)}}function h(T){try{d(r.throw(T))}catch(N){o(N)}}function d(T){T.done?a(T.value):i(T.value).then(f,h)}d((r=r.apply(e,t||[])).next())})},mr=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(d){return function(T){return h([d,T])}}function h(d){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(n=0)),n;)try{if(r=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,i=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){n.label=d[1];break}if(d[0]===6&&n.label<a[1]){n.label=a[1],a=d;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(d);break}a[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(T){d=[6,T],i=0}finally{r=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},gr=function(){function e(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"}return e}(),yr=function(e,t){e.tip.hide();var n=[],r="",i="";e.options.lang,e.options;for(var a=function(h,d){var T=t[d],N=!0;T.name||(r+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),N=!1),T.size>e.options.upload.max&&(r+="<li>".concat(T.name," ").concat(window.VditorI18n.over," ").concat(e.options.upload.max/1024/1024,"M</li>"),N=!1);var $=T.name.lastIndexOf("."),J=T.name.substr($),z=e.options.upload.filename(T.name.substr(0,$))+J;if(e.options.upload.accept){var ae=e.options.upload.accept.split(",").some(function(ee){var W=ee.trim();if(W.indexOf(".")===0){if(J.toLowerCase()===W.toLowerCase())return!0}else if(T.type.split("/")[0]===W.split("/")[0])return!0;return!1});ae||(r+="<li>".concat(T.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),N=!1)}N&&(n.push(T),i+="<li>".concat(z," ").concat(window.VditorI18n.uploading,"</li>"))},o=t.length,f=0;f<o;f++)a(o,f);return e.tip.show("<ul>".concat(r).concat(i,"</ul>")),n},br=function(e,t){var n=pn(t);n.focus();var r=JSON.parse(e),i="";r.code===1&&(i="".concat(r.msg)),r.data.errFiles&&r.data.errFiles.length>0&&(i="<ul><li>".concat(i,"</li>"),r.data.errFiles.forEach(function(o){var f=o.lastIndexOf("."),h=t.options.upload.filename(o.substr(0,f))+o.substr(f);i+="<li>".concat(h," ").concat(window.VditorI18n.uploadError,"</li>")}),i+="</ul>"),i?t.tip.show(i):t.tip.hide();var a="";Object.keys(r.data.succMap).forEach(function(o){var f=r.data.succMap[o],h=o.lastIndexOf("."),d=o.substr(h),T=t.options.upload.filename(o.substr(0,h))+d;d=d.toLowerCase(),d.indexOf(".wav")===0||d.indexOf(".mp3")===0||d.indexOf(".ogg")===0?t.currentMode==="wysiwyg"?a+=`<div class="vditor-wysiwyg__block" data-type="html-block"
- data-block="0"><pre><code><audio controls="controls" src="`.concat(f,'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(f,`"></audio></pre></div>
- `):t.currentMode==="ir"?a+='<audio controls="controls" src="'.concat(f,`"></audio>
- `):a+="[".concat(T,"](").concat(f,`)
- `):d.indexOf(".apng")===0||d.indexOf(".bmp")===0||d.indexOf(".gif")===0||d.indexOf(".ico")===0||d.indexOf(".cur")===0||d.indexOf(".jpg")===0||d.indexOf(".jpeg")===0||d.indexOf(".jfif")===0||d.indexOf(".pjp")===0||d.indexOf(".pjpeg")===0||d.indexOf(".png")===0||d.indexOf(".svg")===0||d.indexOf(".webp")===0?t.currentMode==="wysiwyg"?a+='<img alt="'.concat(T,'" src="').concat(f,`">
- `):a+=".concat(f,`)
- `):t.currentMode==="wysiwyg"?a+='<a href="'.concat(f,'">').concat(T,`</a>
- `):a+="[".concat(T,"](").concat(f,`)
- `)}),(0,v.jl)(t.upload.range),document.execCommand("insertHTML",!1,a),t.upload.range=getSelection().getRangeAt(0).cloneRange()},Xt=function(e,t,n){return hr(void 0,void 0,void 0,function(){var r,i,z,a,o,o,f,h,d,T,N,$,J,z,ae,ee;return mr(this,function(W){switch(W.label){case 0:for(r=[],i=e.options.upload.multiple===!0?t.length:1,z=0;z<i;z++)a=t[z],a instanceof DataTransferItem&&(a=a.getAsFile()),r.push(a);return e.options.upload.handler?[4,e.options.upload.handler(r)]:[3,2];case 1:return o=W.sent(),n&&(n.value=""),typeof o=="string"?(e.tip.show(o),[2]):[2];case 2:return!e.options.upload.url||!e.upload?(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]):e.options.upload.file?[4,e.options.upload.file(r)]:[3,4];case 3:r=W.sent(),W.label=4;case 4:if(e.options.upload.validate&&(o=e.options.upload.validate(r),typeof o=="string"))return e.tip.show(o),[2];if(f=pn(e),e.upload.range=(0,v.RN)(e),h=yr(e,r),h.length===0)return n&&(n.value=""),[2];for(d=new FormData,T=e.options.upload.extraData,N=0,$=Object.keys(T);N<$.length;N++)J=$[N],d.append(J,T[J]);for(z=0,ae=h.length;z<ae;z++)d.append(e.options.upload.fieldName,h[z]);return ee=new XMLHttpRequest,ee.open("POST",e.options.upload.url),e.options.upload.token&&ee.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(ee.withCredentials=!0),hn(e,ee),e.upload.isUploading=!0,f.setAttribute("contenteditable","false"),ee.onreadystatechange=function(){if(ee.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,f.setAttribute("contenteditable","true"),ee.status>=200&&ee.status<300)if(e.options.upload.success)e.options.upload.success(f,ee.responseText);else{var ce=ee.responseText;e.options.upload.format&&(ce=e.options.upload.format(t,ee.responseText)),br(ce,e)}else e.options.upload.error?e.options.upload.error(ee.responseText):e.tip.show(ee.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},ee.upload.onprogress=function(ce){if(ce.lengthComputable){var re=ce.loaded/ce.total*100;e.upload.element.style.display="block";var ue=e.upload.element;ue.style.width=re+"%"}},ee.send(d),[2]}})})},xt=function(e,t,n){var r,i=(0,s.pt)(t.startContainer);if(i||(i=e.wysiwyg.element),n&&n.inputType!=="formatItalic"&&n.inputType!=="deleteByDrag"&&n.inputType!=="insertFromDrop"&&n.inputType!=="formatBold"&&n.inputType!=="formatRemove"&&n.inputType!=="formatStrikeThrough"&&n.inputType!=="insertUnorderedList"&&n.inputType!=="insertOrderedList"&&n.inputType!=="formatOutdent"&&n.inputType!=="formatIndent"&&n.inputType!==""||!n){var a=Tt(t.startContainer);a&&a.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(re){re.remove()}),t.insertNode(document.createElement("wbr")),i.querySelectorAll("[style]").forEach(function(re){re.removeAttribute("style")}),i.querySelectorAll(".vditor-comment").forEach(function(re){re.textContent.trim()===""&&(re.classList.remove("vditor-comment","vditor-comment--focus"),re.removeAttribute("data-cmtids"))}),(r=i.previousElementSibling)===null||r===void 0||r.querySelectorAll(".vditor-comment").forEach(function(re){re.textContent.trim()===""&&(re.classList.remove("vditor-comment","vditor-comment--focus"),re.removeAttribute("data-cmtids"))});var o="";i.getAttribute("data-type")==="link-ref-defs-block"&&(i=e.wysiwyg.element);var f=i.isEqualNode(e.wysiwyg.element),h=(0,s.Th)(i,"data-type","footnotes-block");if(f)o=i.innerHTML;else{var d=(0,s.KR)(t.startContainer);if(d&&!h){var T=(0,L.f)(t.startContainer,"BLOCKQUOTE");T?i=(0,s.pt)(t.startContainer)||i:i=d}if(h&&(i=h),o=i.outerHTML,i.tagName==="UL"||i.tagName==="OL"){var N=i.previousElementSibling,$=i.nextElementSibling;N&&(N.tagName==="UL"||N.tagName==="OL")&&(o=N.outerHTML+o,N.remove()),$&&($.tagName==="UL"||$.tagName==="OL")&&(o=o+$.outerHTML,$.remove()),o=o.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}i.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(re){re&&!i.isEqualNode(re)&&(o+=re.outerHTML,re.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(re){re&&!i.isEqualNode(re)&&(o+=re.outerHTML,re.remove())}))}if(o=o.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""),o==='<p data-block="0">```<wbr></p>'&&e.hint.recentLanguage&&(o='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),U("SpinVditorDOM",o,"argument",e.options.debugger),o=e.lute.SpinVditorDOM(o),U("SpinVditorDOM",o,"result",e.options.debugger),f)i.innerHTML=o;else if(i.outerHTML=o,h){var J=(0,s.Ab)(e.wysiwyg.element.querySelector("wbr"),"LI");if(J){var z=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(J.getAttribute("data-marker"),'"]'));z&&z.setAttribute("aria-label",J.textContent.trim().substr(0,24))}}var ae,ee=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");ee.forEach(function(re,ue){ue===0?ae=re:(ae.insertAdjacentHTML("beforeend",re.innerHTML),re.remove())}),ee.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",ee[0]);var W,ce=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");ce.forEach(function(re,ue){ue===0?W=re:(W.insertAdjacentHTML("beforeend",re.innerHTML),re.remove())}),ce.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",ce[0]),(0,v.ir)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(re){He(re,e)}),n&&(n.inputType==="deleteContentBackward"||n.inputType==="deleteContentForward")&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}Z(e),we(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},wr=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},vr=function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function f(T){try{d(r.next(T))}catch(N){o(N)}}function h(T){try{d(r.throw(T))}catch(N){o(N)}}function d(T){T.done?a(T.value):i(T.value).then(f,h)}d((r=r.apply(e,t||[])).next())})},Er=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(d){return function(T){return h([d,T])}}function h(d){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(n=0)),n;)try{if(r=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,i=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){n.label=d[1];break}if(d[0]===6&&n.label<a[1]){n.label=a[1],a=d;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(d);break}a[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(T){d=[6,T],i=0}finally{r=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},mn=function(e,t,n){if(e.keyCode===229&&e.code===""&&e.key==="Unidentified"&&t.currentMode!=="sv"){var r=(0,s.pt)(n);if(r&&r.textContent.trim()==="")return t[t.currentMode].composingLock=!0,!1}return!0},gn=function(e,t,n){if(!(n.key==="Enter"||n.key==="Tab"||n.key==="Backspace"||n.key.indexOf("Arrow")>-1||(0,l._0)(n)||n.key==="Escape"||n.shiftKey||n.altKey)){var r=(0,s._Y)(e.startContainer,"P")||(0,s._Y)(e.startContainer,"LI");if(r&&(0,v.ED)(r,t[t.currentMode].element,e).start===0){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var i=document.createTextNode(E.Y.ZWSP);e.insertNode(i),e.setStartAfter(i)}}},yn=function(e,t){if(t==="ArrowDown"||t==="ArrowUp"){var n=(0,s.Th)(e.startContainer,"data-type","math-inline")||(0,s.Th)(e.startContainer,"data-type","html-entity")||(0,s.Th)(e.startContainer,"data-type","html-inline");n&&(t==="ArrowDown"&&e.setStartAfter(n.parentElement),t==="ArrowUp"&&e.setStartBefore(n.parentElement))}},Dt=function(e,t){var n=(0,v.RN)(e),r=(0,s.pt)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'.concat(E.Y.ZWSP,`<wbr>
- </p>`)),(0,v.ir)(e[e.currentMode].element,n),lt(e),me(e))},Sr=function(e){var t=(0,s._Y)(e,"TABLE");return t&&t.rows[0].cells[0].isSameNode(e)?t:!1},kr=function(e){var t=(0,s._Y)(e,"TABLE");return t&&t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e)?t:!1},bn=function(e,t,n){n===void 0&&(n=!0);var r=e.previousElementSibling;return r||(e.parentElement.previousElementSibling?r=e.parentElement.previousElementSibling.lastElementChild:e.parentElement.parentElement.tagName==="TBODY"&&e.parentElement.parentElement.previousElementSibling?r=e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:r=null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,v.jl)(t)),r},vt=function(e,t,n,r,i){var a=(0,v.ED)(r,e[e.currentMode].element,n);if(t.key==="ArrowDown"&&r.textContent.trimRight().substr(a.start).indexOf(`
- `)===-1||t.key==="ArrowRight"&&a.start>=r.textContent.trimRight().length){var o=i.nextElementSibling;return!o||o&&(o.tagName==="TABLE"||o.getAttribute("data-type"))?(i.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(E.Y.ZWSP,"<wbr></p>")),(0,v.ir)(e[e.currentMode].element,n)):(n.selectNodeContents(o),n.collapse(!0),(0,v.jl)(n)),t.preventDefault(),!0}return!1},ct=function(e,t,n,r,i){var a=(0,v.ED)(r,e[e.currentMode].element,n);if(t.key==="ArrowUp"&&r.textContent.substr(0,a.start).indexOf(`
- `)===-1||(t.key==="ArrowLeft"||t.key==="Backspace"&&n.toString()==="")&&a.start===0){var o=i.previousElementSibling;return!o||o&&(o.tagName==="TABLE"||o.getAttribute("data-type"))?(i.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(E.Y.ZWSP,"<wbr></p>")),(0,v.ir)(e[e.currentMode].element,n)):(n.selectNodeContents(o),n.collapse(!1),(0,v.jl)(n)),t.preventDefault(),!0}return!1},Ht=function(e,t,n,r){r===void 0&&(r=!0);var i=(0,s._Y)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(T){T.remove()}),t.insertNode(document.createElement("wbr")),r&&i){for(var a="",o=0;o<i.parentElement.childElementCount;o++){var f=i.parentElement.children[o].querySelector("input");f&&f.remove(),a+='<p data-block="0">'.concat(i.parentElement.children[o].innerHTML.trimLeft(),"</p>")}i.parentElement.insertAdjacentHTML("beforebegin",a),i.parentElement.remove()}else if(i)if(n==="check")i.parentElement.querySelectorAll("li").forEach(function(T){T.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(T.textContent.indexOf(" ")===0?"":" ")),T.classList.add("vditor-task")});else{i.querySelector("input")&&i.parentElement.querySelectorAll("li").forEach(function(T){T.querySelector("input").remove(),T.classList.remove("vditor-task")});var d=void 0;n==="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",i.parentElement.getAttribute("data-tight")),d.innerHTML=i.parentElement.innerHTML,i.parentElement.parentNode.replaceChild(d,i.parentElement)}else{var h=(0,s.Th)(t.startContainer,"data-block","0");h||(e[e.currentMode].element.querySelector("wbr").remove(),h=e[e.currentMode].element.querySelector("p"),h.innerHTML="<wbr>"),n==="check"?(h.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(h.innerHTML,"</li></ul>")),h.remove()):n==="list"?(h.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(h.innerHTML,"</li></ul>")),h.remove()):n==="ordered-list"&&(h.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(h.innerHTML,"</li></ol>")),h.remove())}},wn=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var i=[t];Array.from(n.cloneContents().children).forEach(function(h,d){h.nodeType!==3&&t&&h.textContent.trim()!==""&&t.getAttribute("data-node-id")===h.getAttribute("data-node-id")&&(d!==0&&i.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(h){h.remove()}),n.insertNode(document.createElement("wbr"));var a=r.parentElement,o="";i.forEach(function(h){var d=h.getAttribute("data-marker");d.length!==1&&(d="1".concat(d.slice(-1))),o+='<li data-node-id="'.concat(h.getAttribute("data-node-id"),'" data-marker="').concat(d,'">').concat(h.innerHTML,"</li>"),h.remove()}),r.insertAdjacentHTML("beforeend","<".concat(a.tagName,' data-block="0">').concat(o,"</").concat(a.tagName,">")),e.currentMode==="wysiwyg"?a.outerHTML=e.lute.SpinVditorDOM(a.outerHTML):a.outerHTML=e.lute.SpinVditorIRDOM(a.outerHTML),(0,v.ir)(e[e.currentMode].element,n);var f=(0,s.KR)(n.startContainer);f&&f.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(h){He(h,e),e.currentMode==="wysiwyg"&&h.previousElementSibling.setAttribute("style","display:none")}),me(e),lt(e)}else e[e.currentMode].element.focus()},$t=function(e,t,n,r){var i=(0,s._Y)(t.parentElement,"LI");if(i){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(N){N.remove()}),n.insertNode(document.createElement("wbr"));var a=t.parentElement,o=a.cloneNode(),f=[t];Array.from(n.cloneContents().children).forEach(function(N,$){N.nodeType!==3&&t&&N.textContent.trim()!==""&&t.getAttribute("data-node-id")===N.getAttribute("data-node-id")&&($!==0&&f.push(t),t=t.nextElementSibling)});var h=!1,d="";a.querySelectorAll("li").forEach(function(N){h&&(d+=N.outerHTML,!N.nextElementSibling&&!N.previousElementSibling?N.parentElement.remove():N.remove()),N.isSameNode(f[f.length-1])&&(h=!0)}),f.reverse().forEach(function(N){i.insertAdjacentElement("afterend",N)}),d&&(o.innerHTML=d,f[0].insertAdjacentElement("beforeend",o)),e.currentMode==="wysiwyg"?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,v.ir)(e[e.currentMode].element,n);var T=(0,s.KR)(n.startContainer);T&&T.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(N){He(N,e),e.currentMode==="wysiwyg"&&N.previousElementSibling.setAttribute("style","display:none")}),me(e),lt(e)}else e[e.currentMode].element.focus()},Ot=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,i=e.rows.length,a=0,o=0;o<i;o++)for(var f=0;f<r;f++)if(e.rows[o].cells[f].isSameNode(n)){a=f;break}for(var h=0;h<i;h++)e.rows[h].cells[a].setAttribute("align",t)},Qt=function(e){var t=e.trimRight().split(`
- `).pop();return t===""?!1:(t.replace(/ |-/g,"")===""||t.replace(/ |_/g,"")===""||t.replace(/ |\*/g,"")==="")&&t.replace(/ /g,"").length>2?!(t.indexOf("-")>-1&&t.trimLeft().indexOf(" ")===-1&&e.trimRight().split(`
- `).length>1||t.indexOf(" ")===0||t.indexOf(" ")===0):!1},en=function(e){var t=e.trimRight().split(`
- `);return e=t.pop(),e.indexOf(" ")===0||e.indexOf(" ")===0||(e=e.trimLeft(),e===""||t.length===0)?!1:e.replace(/-/g,"")===""||e.replace(/=/g,"")===""},me=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),e.currentMode==="wysiwyg"?we(e,t):e.currentMode==="ir"?$e(e,t):e.currentMode==="sv"&&Re(e,t)},vn=function(e,t,n,r){var i,a=e.startContainer,o=(0,s._Y)(a,"LI");if(o){if(!(0,l._0)(r)&&!r.altKey&&r.key==="Enter"&&!r.shiftKey&&n&&o.contains(n)&&n.nextElementSibling)return o&&!o.textContent.endsWith(`
- `)&&o.insertAdjacentText("beforeend",`
- `),e.insertNode(document.createTextNode(`
- `)),e.collapse(!1),me(t),r.preventDefault(),!0;if(!(0,l._0)(r)&&!r.shiftKey&&!r.altKey&&r.key==="Backspace"&&!o.previousElementSibling&&e.toString()===""&&(0,v.ED)(o,t[t.currentMode].element,e).start===0)return o.nextElementSibling?(o.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(o.innerHTML,"</p>")),o.remove()):o.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(o.innerHTML,"</p>"),(0,v.ir)(t[t.currentMode].element,e),me(t),r.preventDefault(),!0;if(!(0,l._0)(r)&&!r.shiftKey&&!r.altKey&&r.key==="Backspace"&&o.textContent.trim().replace(E.Y.ZWSP,"")===""&&e.toString()===""&&((i=o.previousElementSibling)===null||i===void 0?void 0:i.tagName)==="LI")return o.previousElementSibling.insertAdjacentText("beforeend",`
- `),e.selectNodeContents(o.previousElementSibling),e.collapse(!1),o.remove(),(0,v.ir)(t[t.currentMode].element,e),me(t),r.preventDefault(),!0;if(!(0,l._0)(r)&&!r.altKey&&r.key==="Tab"){var f=!1;if((e.startOffset===0&&(a.nodeType===3&&!a.previousSibling||a.nodeType!==3&&a.nodeName==="LI")||o.classList.contains("vditor-task")&&e.startOffset===1&&a.previousSibling.nodeType!==3&&a.previousSibling.tagName==="INPUT")&&(f=!0),f||e.toString()!=="")return r.shiftKey?$t(t,o,e,o.parentElement):wn(t,o,e),r.preventDefault(),!0}}return!1},tn=function(e,t,n){if(e.options.tab&&n.key==="Tab")return n.shiftKey||(t.toString()===""?(t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)):(t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1))),(0,v.jl)(t),me(e),n.preventDefault(),!0},En=function(e,t,n,r){if(n){if(!(0,l._0)(e)&&!e.altKey&&e.key==="Enter"){var i=String.raw(On||(On=wr(["",""],["",""])),n.textContent).replace(/\\\|/g,"").trim(),a=i.split("|");if(i.startsWith("|")&&i.endsWith("|")&&a.length>3){var o=a.map(function(){return"---"}).join("|");return o=n.textContent+`
- `+o.substring(3,o.length-3)+`
- |<wbr>`,n.outerHTML=t.lute.SpinVditorDOM(o),(0,v.ir)(t[t.currentMode].element,r),me(t),Oe(t),e.preventDefault(),!0}if(Qt(n.innerHTML)&&n.previousElementSibling){var f="",h=n.innerHTML.trimRight().split(`
- `);return h.length>1&&(h.pop(),f='<p data-block="0">'.concat(h.join(`
- `),"</p>")),n.insertAdjacentHTML("afterend","".concat(f,`<hr data-block="0"><p data-block="0"><wbr>
- </p>`)),n.remove(),(0,v.ir)(t[t.currentMode].element,r),me(t),Oe(t),e.preventDefault(),!0}if(en(n.innerHTML))return t.currentMode==="wysiwyg"?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+`<p data-block="0"><wbr>
- </p>`):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+`<p data-block="0"><wbr>
- </p>`),(0,v.ir)(t[t.currentMode].element,r),me(t),Oe(t),e.preventDefault(),!0}if(r.collapsed&&n.previousElementSibling&&e.key==="Backspace"&&!(0,l._0)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split(`
- `).length>1&&(0,v.ED)(n,t[t.currentMode].element,r).start===0){var d=(0,s.Rp)(n.previousElementSibling);return d.textContent.endsWith(`
- `)||(d.textContent=d.textContent+`
- `),d.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,v.ir)(t[t.currentMode].element,r),!1}return!1}},Sn=function(e,t,n){for(var r="",i=0;i<n.parentElement.childElementCount;i++)r+='<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');n.tagName==="TH"?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(r,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(r,"</tr>")),me(e)},kn=function(e,t,n){for(var r="",i=0;i<n.parentElement.childElementCount;i++)n.tagName==="TH"?r+='<th align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </th>'):r+='<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');if(n.tagName==="TH"){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr"));var a=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",a),n.parentElement.parentElement.remove(),(0,v.ir)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>"));me(e)},Nt=function(e,t,n,r){r===void 0&&(r="afterend");for(var i=0,a=n.previousElementSibling;a;)i++,a=a.previousElementSibling;for(var o=0;o<t.rows.length;o++)o===0?t.rows[o].cells[i].insertAdjacentHTML(r,"<th> </th>"):t.rows[o].cells[i].insertAdjacentHTML(r,"<td> </td>");me(e)},Tn=function(e,t,n){if(n.tagName==="TD"){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),r.childElementCount===1?r.remove():n.parentElement.remove(),t.collapse(!1),(0,v.jl)(t),me(e)}},_n=function(e,t,n,r){for(var i=0,a=r.previousElementSibling;a;)i++,a=a.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var o=0;o<n.rows.length;o++){var f=n.rows[o].cells;if(f.length===1){n.remove(),lt(e);break}f[i].remove()}(0,v.jl)(t),me(e)},Ln=function(e,t,n){var r=n.startContainer,i=(0,s._Y)(r,"TD")||(0,s._Y)(r,"TH");if(i){if(!(0,l._0)(t)&&!t.altKey&&t.key==="Enter"){(!i.lastElementChild||i.lastElementChild&&(!i.lastElementChild.isSameNode(i.lastChild)||i.lastElementChild.tagName!=="BR"))&&i.insertAdjacentHTML("beforeend","<br>");var a=document.createElement("br");return n.insertNode(a),n.setStartAfter(a),me(e),Oe(e),t.preventDefault(),!0}if(t.key==="Tab"){if(t.shiftKey)return bn(i,n),t.preventDefault(),!0;var o=i.nextElementSibling;return o||(i.parentElement.nextElementSibling?o=i.parentElement.nextElementSibling.firstElementChild:i.parentElement.parentElement.tagName==="THEAD"&&i.parentElement.parentElement.nextElementSibling?o=i.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:o=null),o&&(n.selectNodeContents(o),(0,v.jl)(n)),t.preventDefault(),!0}var f=i.parentElement.parentElement.parentElement;if(t.key==="ArrowUp"){if(t.preventDefault(),i.tagName==="TH")return f.previousElementSibling?(n.selectNodeContents(f.previousElementSibling),n.collapse(!1),(0,v.jl)(n)):Dt(e,"beforebegin"),!0;for(var h=0,d=i.parentElement;h<d.cells.length&&!d.cells[h].isSameNode(i);h++);var T=d.previousElementSibling;return T||(T=d.parentElement.previousElementSibling.firstChild),n.selectNodeContents(T.cells[h]),n.collapse(!1),(0,v.jl)(n),!0}if(t.key==="ArrowDown"){t.preventDefault();var d=i.parentElement;if(!d.nextElementSibling&&i.tagName==="TD")return f.nextElementSibling?(n.selectNodeContents(f.nextElementSibling),n.collapse(!0),(0,v.jl)(n)):Dt(e,"afterend"),!0;for(var h=0;h<d.cells.length&&!d.cells[h].isSameNode(i);h++);var o=d.nextElementSibling;return o||(o=d.parentElement.nextElementSibling.firstChild),n.selectNodeContents(o.cells[h]),n.collapse(!0),(0,v.jl)(n),!0}if(e.currentMode==="wysiwyg"&&!(0,l._0)(t)&&t.key==="Enter"&&!t.shiftKey&&t.altKey){var N=e.wysiwyg.popover.querySelector(".vditor-input");return N.focus(),N.select(),t.preventDefault(),!0}if(!(0,l._0)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Backspace"&&n.startOffset===0&&n.toString()===""){var $=bn(i,n,!1);return!$&&f&&(f.textContent.trim()===""?(f.outerHTML=`<p data-block="0"><wbr>
- </p>`,(0,v.ir)(e[e.currentMode].element,n)):(n.setStartBefore(f),n.collapse(!0)),me(e)),t.preventDefault(),!0}if(_("⇧⌘F",t))return kn(e,n,i),t.preventDefault(),!0;if(_("⌘=",t))return Sn(e,n,i),t.preventDefault(),!0;if(_("⇧⌘G",t))return Nt(e,f,i,"beforebegin"),t.preventDefault(),!0;if(_("⇧⌘=",t))return Nt(e,f,i),t.preventDefault(),!0;if(_("⌘-",t))return Tn(e,n,i),t.preventDefault(),!0;if(_("⇧⌘-",t))return _n(e,n,f,i),t.preventDefault(),!0;if(_("⇧⌘L",t)){if(e.currentMode==="ir")return Ot(f,"left"),me(e),t.preventDefault(),!0;var J=e.wysiwyg.popover.querySelector('[data-type="left"]');if(J)return J.click(),t.preventDefault(),!0}if(_("⇧⌘C",t)){if(e.currentMode==="ir")return Ot(f,"center"),me(e),t.preventDefault(),!0;var J=e.wysiwyg.popover.querySelector('[data-type="center"]');if(J)return J.click(),t.preventDefault(),!0}if(_("⇧⌘R",t)){if(e.currentMode==="ir")return Ot(f,"right"),me(e),t.preventDefault(),!0;var J=e.wysiwyg.popover.querySelector('[data-type="right"]');if(J)return J.click(),t.preventDefault(),!0}}return!1},Mn=function(e,t,n,r){if(n.tagName==="PRE"&&_("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&t.key==="Tab"&&!t.shiftKey&&r.toString()==="")return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),me(e),t.preventDefault(),!0;if(t.key==="Backspace"&&!(0,l._0)(t)&&!t.shiftKey&&!t.altKey){var i=(0,v.ED)(n,e[e.currentMode].element,r);if((i.start===0||i.start===1&&n.innerText===`
- `)&&r.toString()==="")return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,v.ir)(e[e.currentMode].element,r),me(e),t.preventDefault(),!0}return!(0,l._0)(t)&&!t.altKey&&t.key==="Enter"?(n.firstElementChild.textContent.endsWith(`
- `)||n.firstElementChild.insertAdjacentText("beforeend",`
- `),r.extractContents(),r.insertNode(document.createTextNode(`
- `)),r.collapse(!1),(0,v.jl)(r),(0,l.gm)()||(e.currentMode==="wysiwyg"?xt(e,r):R(e,r)),Oe(e),t.preventDefault(),!0):!1},Cn=function(e,t,n,r){var i=t.startContainer,a=(0,s._Y)(i,"BLOCKQUOTE");if(a&&t.toString()===""){if(n.key==="Backspace"&&!(0,l._0)(n)&&!n.shiftKey&&!n.altKey&&(0,v.ED)(a,e[e.currentMode].element,t).start===0)return t.insertNode(document.createElement("wbr")),a.outerHTML=a.innerHTML,(0,v.ir)(e[e.currentMode].element,t),me(e),n.preventDefault(),!0;if(r&&n.key==="Enter"&&!(0,l._0)(n)&&!n.shiftKey&&!n.altKey&&r.parentElement.tagName==="BLOCKQUOTE"){var o=!1;if(r.innerHTML.replace(E.Y.ZWSP,"")===`
- `||r.innerHTML.replace(E.Y.ZWSP,"")===""?(o=!0,r.remove()):r.innerHTML.endsWith(`
- `)&&(0,v.ED)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),o=!0),o)return a.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(E.Y.ZWSP,`<wbr>
- </p>`)),(0,v.ir)(e[e.currentMode].element,t),me(e),n.preventDefault(),!0}var f=(0,s.pt)(i);if(e.currentMode==="wysiwyg"&&f&&_("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),f.outerHTML='<blockquote data-block="0">'.concat(f.outerHTML,"</blockquote>"),(0,v.ir)(e.wysiwyg.element,t),we(e),n.preventDefault(),!0;if(vt(e,n,t,a,a)||ct(e,n,t,a,a))return!0}return!1},An=function(e,t,n){var r=t.startContainer,i=(0,s.KJ)(r,"vditor-task");if(i){if(_("⇧⌘J",n)){var a=i.firstElementChild;return a.checked?a.removeAttribute("checked"):a.setAttribute("checked","checked"),me(e),n.preventDefault(),!0}if(n.key==="Backspace"&&!(0,l._0)(n)&&!n.shiftKey&&!n.altKey&&t.toString()===""&&t.startOffset===1&&(r.nodeType===3&&r.previousSibling&&r.previousSibling.tagName==="INPUT"||r.nodeType!==3)){var o=i.previousElementSibling;if(i.querySelector("input").remove(),o){var f=(0,s.Rp)(o);f.parentElement.insertAdjacentHTML("beforeend","<wbr>"+i.innerHTML.trim()),i.remove()}else i.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(i.innerHTML.trim()||`
- `,"</p>")),i.nextElementSibling?i.remove():i.parentElement.remove();return(0,v.ir)(e[e.currentMode].element,t),me(e),n.preventDefault(),!0}if(n.key==="Enter"&&!(0,l._0)(n)&&!n.shiftKey&&!n.altKey){if(i.textContent.trim()==="")if((0,s.KJ)(i.parentElement,"vditor-task")){var h=(0,s.KR)(r);h&&$t(e,i,t,h)}else if(i.nextElementSibling){var d="",T="",N=!1;Array.from(i.parentElement.children).forEach(function(ae){i.isSameNode(ae)?N=!0:N?d+=ae.outerHTML:T+=ae.outerHTML});var $=i.parentElement.tagName,J=i.parentElement.tagName==="OL"?"":' data-marker="'.concat(i.parentElement.getAttribute("data-marker"),'"'),z="";T&&(z=i.parentElement.tagName==="UL"?"":' start="1"',T="<".concat($,' data-tight="true"').concat(J,' data-block="0">').concat(T,"</").concat($,">")),i.parentElement.outerHTML="".concat(T,`<p data-block="0"><wbr>
- </p><`).concat($,`
- data-tight="true"`).concat(J,' data-block="0"').concat(z,">").concat(d,"</").concat($,">")}else i.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
- </p>`),i.parentElement.querySelectorAll("li").length===1?i.parentElement.remove():i.remove();else r.nodeType!==3&&t.startOffset===0&&r.firstChild.tagName==="INPUT"?t.setStart(r.childNodes[1],1):(t.setEndAfter(i.lastChild),i.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(i.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents()));return(0,v.ir)(e[e.currentMode].element,t),me(e),Oe(e),n.preventDefault(),!0}}return!1},xn=function(e,t,n,r){if(t.startContainer.nodeType!==3){var i=t.startContainer.children[t.startOffset];if(i&&i.tagName==="HR")return t.selectNodeContents(i.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var a=r.previousElementSibling;if(a&&(0,v.ED)(r,e[e.currentMode].element,t).start===0&&((0,l.gm)()&&a.tagName==="HR"||a.tagName==="TABLE")){if(a.tagName==="TABLE"){var o=a.lastElementChild.lastElementChild.lastElementChild;o.innerHTML=o.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else a.remove();return(0,v.ir)(e[e.currentMode].element,t),me(e),n.preventDefault(),!0}}return!1},Dn=function(e){(0,l.gm)()&&e.startContainer.nodeType!==3&&e.startContainer.tagName==="HR"&&e.setStartBefore(e.startContainer)},Hn=function(e,t,n){var r,i;if(!(0,l.gm)())return!1;if(e.key==="ArrowUp"&&t&&((r=t.previousElementSibling)===null||r===void 0?void 0:r.tagName)==="TABLE"){var a=t.previousElementSibling;return n.selectNodeContents(a.rows[a.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return e.key==="ArrowDown"&&t&&((i=t.nextElementSibling)===null||i===void 0?void 0:i.tagName)==="TABLE"?(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0):!1},Rt=function(e,t,n){return vr(void 0,void 0,void 0,function(){var r,i,a,o,f,h,d,T,N,$,J,z,ae,W,ee,W,ce;return Er(this,function(re){switch(re.label){case 0:return e[e.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),i=t.clipboardData.getData("text/plain"),a=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),i=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(a=t.dataTransfer.items)),o={},f=function(ue,_e){if(!_e)return["",Lute.WalkContinue];if(e.options.upload.renderLinkDest)return e.options.upload.renderLinkDest(e,ue,_e);var Se=ue.TokensStr();if(ue.__internal_object__.Parent.Type===34&&Se&&Se.indexOf("file://")===-1&&e.options.upload.linkToImgUrl){var Le=new XMLHttpRequest;Le.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&Le.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(Le.withCredentials=!0),hn(e,Le),Le.setRequestHeader("Content-Type","application/json; charset=utf-8"),Le.onreadystatechange=function(){if(Le.readyState===XMLHttpRequest.DONE){if(Le.status===200){var Ye=Le.responseText;e.options.upload.linkToImgFormat&&(Ye=e.options.upload.linkToImgFormat(Le.responseText));var Pe=JSON.parse(Ye);if(Pe.code!==0){e.tip.show(Pe.msg);return}var qe=Pe.data.originalURL;if(e.currentMode==="sv")e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(Ne){Ne.textContent===qe&&(Ne.textContent=Pe.data.url)});else{var he=e[e.currentMode].element.querySelector('img[src="'.concat(qe,'"]'));he.src=Pe.data.url,e.currentMode==="ir"&&(he.previousElementSibling.previousElementSibling.innerHTML=Pe.data.url)}me(e)}else e.tip.show(Le.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(Le.responseText)}},Le.send(JSON.stringify({url:Se}))}return e.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(Se),"</span>"),Lute.WalkContinue]:e.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(Se),"</span>"),Lute.WalkContinue]},(r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<a href="'.concat(i,'">').concat(i,"</a>")||r.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/ig,"").trim()==='<!--StartFragment--><a href="'.concat(i,'">').concat(i,"</a><!--EndFragment-->"))&&(r=""),h=new DOMParser().parseFromString(r,"text/html"),h.body&&(r=h.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),d=e[e.currentMode].element.scrollHeight,T=Be(r,i,e.currentMode),N=e.currentMode==="sv"?(0,s.Th)(t.target,"data-type","code-block"):(0,s._Y)(t.target,"CODE"),N?(e.currentMode==="sv"?document.execCommand("insertHTML",!1,i.replace(/&/g,"&").replace(/</g,"<")):($=(0,v.ED)(t.target,e[e.currentMode].element),N.parentElement.tagName!=="PRE"&&(i+=E.Y.ZWSP),N.textContent=N.textContent.substring(0,$.start)+i+N.textContent.substring($.end),(0,v.Fm)($.start+i.length,$.start+i.length,N.parentElement),!((ce=N.parentElement)===null||ce===void 0)&&ce.nextElementSibling.classList.contains("vditor-".concat(e.currentMode,"__preview"))&&(N.parentElement.nextElementSibling.innerHTML=N.outerHTML,He(N.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return T?(n.pasteCode(T),[3,8]):[3,2];case 2:return r.trim()===""?[3,3]:(J=document.createElement("div"),J.innerHTML=r,J.querySelectorAll("[style]").forEach(function(ue){ue.removeAttribute("style")}),J.querySelectorAll(".vditor-copy").forEach(function(ue){ue.remove()}),e.currentMode==="ir"?(o.HTML2VditorIRDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:o}),(0,v.Z2)(e.lute.HTML2VditorIRDOM(J.innerHTML),e)):e.currentMode==="wysiwyg"?(o.HTML2VditorDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:o}),(0,v.Z2)(e.lute.HTML2VditorDOM(J.innerHTML),e)):(o.Md2VditorSVDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:o}),Jt(e,e.lute.HTML2Md(J.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return a.length>0?e.options.upload.url||e.options.upload.handler?[4,Xt(e,a)]:[3,5]:[3,7];case 4:return re.sent(),[3,6];case 5:z=new FileReader,"clipboardData"in t?(a=t.clipboardData.files,ae=a[0]):t.dataTransfer.types.includes("Files")&&(a=t.dataTransfer.items,ae=a[0].getAsFile()),ae&&ae.type.startsWith("image")&&(z.readAsDataURL(ae),z.onload=function(){var ue="";e.currentMode==="wysiwyg"?ue+='<img alt="'.concat(ae.name,'" src="').concat(z.result.toString(),`">
- `):ue+=".concat(z.result.toString(),`)
- `),document.execCommand("insertHTML",!1,ue)}),re.label=6;case 6:return[3,8];case 7:i.trim()!==""&&a.length===0&&(W=(0,v.RN)(e),W.toString()!==""&&e.lute.IsValidLinkDest(i)&&(i="[".concat(W.toString(),"](").concat(i,")")),e.currentMode==="ir"?(o.Md2VditorIRDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:o}),(0,v.Z2)(e.lute.Md2VditorIRDOM(i),e)):e.currentMode==="wysiwyg"?(o.Md2VditorDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:o}),(0,v.Z2)(e.lute.Md2VditorDOM(i),e)):(o.Md2VditorSVDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:o}),Jt(e,i)),e.outline.render(e)),re.label=8;case 8:return e.currentMode!=="sv"&&(ee=(0,s.pt)((0,v.RN)(e).startContainer),ee&&(W=(0,v.RN)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(ue){ue.remove()}),W.insertNode(document.createElement("wbr")),e.currentMode==="wysiwyg"?ee.outerHTML=e.lute.SpinVditorDOM(ee.outerHTML):ee.outerHTML=e.lute.SpinVditorIRDOM(ee.outerHTML),(0,v.ir)(e[e.currentMode].element,W)),e[e.currentMode].element.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(ue){He(ue,e)})),e.wysiwyg.triggerRemoveComment(e),me(e),e[e.currentMode].element.scrollHeight-d>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&Oe(e),[2]}})})},On,Nn=function(e){var t,n;e.hint.render(e);var r=(0,v.RN)(e).startContainer,i=(0,s.Th)(r,"data-type","code-block-info");if(i)if(i.textContent.replace(E.Y.ZWSP,"")===""&&e.hint.recentLanguage){i.textContent=E.Y.ZWSP+e.hint.recentLanguage;var a=(0,v.RN)(e);a.selectNodeContents(i)}else{var o=[],f=i.textContent.substring(0,(0,v.ED)(i,e.ir.element).start).replace(E.Y.ZWSP,"");(e.options.preview.hljs.langs||E.Y.ALIAS_CODE_LANGUAGES.concat(((n=(t=window.hljs)===null||t===void 0?void 0:t.listLanguages())!==null&&n!==void 0?n:[]).sort())).forEach(function(h){h.indexOf(f.toLowerCase())>-1&&o.push({html:h,value:h})}),e.hint.genHTML(o,f,e)}},$e=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Nn(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=V(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,l.D)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},Et=function(e,t){var n=(0,v.RN)(e),r=(0,s.pt)(n.startContainer)||n.startContainer;if(r){var i=r.querySelector(".vditor-ir__marker--heading");i?i.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),R(e,n.cloneRange()),We(e)}},jt=function(e,t,n){var r=(0,s.Th)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var i=document.createElement("div");i.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=i.firstElementChild.innerHTML.trim()}},Tr=function(e,t,n,r){var i=(0,v.RN)(e),a=t.getAttribute("data-type"),o=i.startContainer;o.nodeType===3&&(o=o.parentElement);var f=!0;if(t.classList.contains("vditor-menu--current"))if(a==="quote"){var h=(0,s._Y)(o,"BLOCKQUOTE");h&&(i.insertNode(document.createElement("wbr")),h.outerHTML=h.innerHTML.trim()===""?'<p data-block="0">'.concat(h.innerHTML,"</p>"):h.innerHTML)}else if(a==="link"){var d=(0,s.Th)(i.startContainer,"data-type","a");if(d){var T=(0,s.KJ)(i.startContainer,"vditor-ir__link");T?(i.insertNode(document.createElement("wbr")),d.outerHTML=T.innerHTML):d.outerHTML=d.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else a==="italic"?jt(i,e,"em"):a==="bold"?jt(i,e,"strong"):a==="strike"?jt(i,e,"s"):a==="inline-code"?jt(i,e,"code"):(a==="check"||a==="list"||a==="ordered-list")&&(Ht(e,i,a),f=!1,t.classList.remove("vditor-menu--current"));else{e.ir.element.childNodes.length===0&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,v.ir)(e.ir.element,i));var N=(0,s.pt)(i.startContainer);if(a==="line"){if(N){var $=`<hr data-block="0"><p data-block="0"><wbr>
- </p>`;N.innerHTML.trim()===""?N.outerHTML=$:N.insertAdjacentHTML("afterend",$)}}else if(a==="quote")N&&(i.insertNode(document.createElement("wbr")),N.outerHTML='<blockquote data-block="0">'.concat(N.outerHTML,"</blockquote>"),f=!1,t.classList.add("vditor-menu--current"));else if(a==="link"){var J=void 0;i.toString()===""?J="".concat(n,"<wbr>").concat(r):J="".concat(n).concat(i.toString()).concat(r.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,J),f=!1,t.classList.add("vditor-menu--current")}else if(a==="italic"||a==="bold"||a==="strike"||a==="inline-code"||a==="code"||a==="table"){var J=void 0;i.toString()===""?J="".concat(n,"<wbr>").concat(r):(a==="code"?J="".concat(n,`
- `).concat(i.toString(),"<wbr>").concat(r):a==="table"?J="".concat(n).concat(i.toString(),"<wbr>").concat(r):J="".concat(n).concat(i.toString()).concat(r,"<wbr>"),i.deleteContents()),(a==="table"||a==="code")&&(J=`
- `+J+`
- `);var z=document.createElement("span");z.innerHTML=J,i.insertNode(z),R(e,i),a==="table"&&(i.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,v.jl)(i))}else(a==="check"||a==="list"||a==="ordered-list")&&(Ht(e,i,a,!1),f=!1,g(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,v.ir)(e.ir.element,i),$e(e),f&&We(e)},_r=function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function f(T){try{d(r.next(T))}catch(N){o(N)}}function h(T){try{d(r.throw(T))}catch(N){o(N)}}function d(T){T.done?a(T.value):i(T.value).then(f,h)}d((r=r.apply(e,t||[])).next())})},Lr=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(d){return function(T){return h([d,T])}}function h(d){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(n=0)),n;)try{if(r=1,i&&(a=d[0]&2?i.return:d[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,d[1])).done)return a;switch(i=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return n.label++,{value:d[1],done:!1};case 5:n.label++,i=d[1],d=[0];continue;case 7:d=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){n=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]<a[3])){n.label=d[1];break}if(d[0]===6&&n.label<a[1]){n.label=a[1],a=d;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(d);break}a[2]&&n.ops.pop(),n.trys.pop();continue}d=t.call(e,n)}catch(T){d=[6,T],i=0}finally{r=a=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},Mr=function(){function e(t){var n=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(r,i){n.element.style.display="none";var a=decodeURIComponent(r.getAttribute("data-value")),o=window.getSelection().getRangeAt(0);if(i.currentMode==="ir"){var f=(0,s.Th)(o.startContainer,"data-type","code-block-info");if(f){f.textContent=E.Y.ZWSP+a.trimRight(),o.selectNodeContents(f),o.collapse(!1),$e(i),f.parentElement.querySelectorAll("code").forEach(function(N){N.className="language-"+a.trimRight()}),He(f.parentElement.querySelector(".vditor-ir__preview"),i),n.recentLanguage=a.trimRight();return}}if(i.currentMode==="wysiwyg"&&o.startContainer.nodeType!==3){var h=o.startContainer,d=void 0;if(h.classList.contains("vditor-input")?d=h:d=h.firstElementChild,d&&d.classList.contains("vditor-input")){d.value=a.trimRight(),o.selectNodeContents(d),o.collapse(!1),d.dispatchEvent(new CustomEvent("input",{detail:1})),n.recentLanguage=a.trimRight();return}}if(o.setStart(o.startContainer,n.lastIndex),o.deleteContents(),i.options.hint.parse?i.currentMode==="sv"?(0,v.Z2)(i.lute.SpinVditorSVDOM(a),i):i.currentMode==="wysiwyg"?(0,v.Z2)(i.lute.SpinVditorDOM(a),i):(0,v.Z2)(i.lute.SpinVditorIRDOM(a),i):(0,v.Z2)(a,i),n.splitChar===":"&&a.indexOf(":")>-1&&i.currentMode!=="sv"&&o.insertNode(document.createTextNode(" ")),o.collapse(!1),(0,v.jl)(o),i.currentMode==="wysiwyg"){var T=(0,s.KJ)(o.startContainer,"vditor-wysiwyg__block");T&&T.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(T.lastElementChild.innerHTML=T.firstElementChild.innerHTML,He(T.lastElementChild,i))}else if(i.currentMode==="ir"){var T=(0,s.KJ)(o.startContainer,"vditor-ir__marker--pre");T&&T.nextElementSibling.classList.contains("vditor-ir__preview")&&(T.nextElementSibling.innerHTML=T.innerHTML,He(T.nextElementSibling,i))}me(i)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",t.push({key:":"})}return e.prototype.render=function(t){var n=this;if(window.getSelection().focusNode){var r,i=getSelection().getRangeAt(0);r=i.startContainer.textContent.substring(0,i.startOffset)||"";var a=this.getKey(r,t.options.hint.extend);if(typeof a=="undefined")this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var o=a===""?t.options.hint.emoji:t.lute.GetEmojis(),f=[];Object.keys(o).forEach(function(h){h.indexOf(a.toLowerCase())===0&&(o[h].indexOf(".")>-1?f.push({html:'<img src="'.concat(o[h],'" title=":').concat(h,':"/> :').concat(h,":"),value:":".concat(h,":")}):f.push({html:'<span class="vditor-hint__emoji">'.concat(o[h],"</span>").concat(h),value:o[h]}))}),this.genHTML(f,a,t)}else t.options.hint.extend.forEach(function(h){h.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){return _r(n,void 0,void 0,function(){var d;return Lr(this,function(T){switch(T.label){case 0:return d=this.genHTML,[4,h.hint(a)];case 1:return d.apply(this,[T.sent(),a,t]),[2]}})})},t.options.hint.delay))})}},e.prototype.genHTML=function(t,n,r){var i=this;if(t.length===0){this.element.style.display="none";return}var a=r[r.currentMode].element,o=(0,v.Ey)(a),f=o.left+(r.options.outline.position==="left"?r.outline.element.offsetWidth:0),h=o.top,d="";t.forEach(function(N,$){if(!($>7)){var J=N.html;if(n!==""){var z=J.lastIndexOf(">")+1,ae=J.substr(z),ee=ae.toLowerCase().indexOf(n.toLowerCase());ee>-1&&(ae=ae.substring(0,ee)+"<b>"+ae.substring(ee,ee+n.length)+"</b>"+ae.substring(ee+n.length),J=J.substr(0,z)+ae)}d+='<button type="button" data-value="'.concat(encodeURIComponent(N.value),` "
- `).concat($===0?"class='vditor-hint--current'":"","> ").concat(J,"</button>")}}),this.element.innerHTML=d;var T=parseInt(document.defaultView.getComputedStyle(a,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(h+(T||22),"px"),this.element.style.left="".concat(f,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(N){N.addEventListener("click",function($){i.fillEmoji(N,r),$.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(h-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")},e.prototype.select=function(t,n){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var r=this.element.querySelector(".vditor-hint--current");if(t.key==="ArrowDown")return t.preventDefault(),t.stopPropagation(),r.removeAttribute("class"),r.nextElementSibling?r.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(t.key==="ArrowUp"){if(t.preventDefault(),t.stopPropagation(),r.removeAttribute("class"),r.previousElementSibling)r.previousElementSibling.className="vditor-hint--current";else{var i=this.element.children.length;this.element.children[i-1].className="vditor-hint--current"}return!0}else if(!(0,l._0)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Enter"&&!t.isComposing)return t.preventDefault(),t.stopPropagation(),this.fillEmoji(r,n),!0;return!1},e.prototype.getKey=function(t,n){var r=this;this.lastIndex=-1,this.splitChar="",n.forEach(function(d){var T=t.lastIndexOf(d.key);r.lastIndex<T&&(r.splitChar=d.key,r.lastIndex=T)});var i;if(this.lastIndex===-1)return i;var a=t.split(this.splitChar),o=a[a.length-1],f=32;if(a.length>1&&o.trim()===o)if(a.length===2&&a[0]===""&&a[1].length<f)i=a[1];else{var h=a[a.length-2].slice(-1);(0,x.p)(h)===" "&&o.length<f&&(i=o)}return i},e}(),Cr=function(){function e(t){this.composingLock=!1;var n=document.createElement("div");n.className="vditor-ir",n.innerHTML='<pre class="vditor-reset" placeholder="'.concat(t.options.placeholder,`"
- contenteditable="true" spellcheck="false"></pre>`),this.element=n.firstElementChild,this.bindEvent(t),qt(t,this.element),un(t,this.element),Kt(t,this.element),Zt(t,this.element),Gt(t,this.element),Wt(t,this.element),Ft(t,this.element,this.copy),zt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){var r=getSelection().getRangeAt(0);if(r.toString()!==""){t.stopPropagation(),t.preventDefault();var i=document.createElement("div");i.appendChild(r.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorIRDOM2Md(i.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(r){Rt(t,r,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})}),this.element.addEventListener("scroll",function(){y(t,["hint"])}),this.element.addEventListener("compositionstart",function(r){n.composingLock=!0}),this.element.addEventListener("compositionend",function(r){(0,l.gm)()||R(t,getSelection().getRangeAt(0).cloneRange()),n.composingLock=!1}),this.element.addEventListener("input",function(r){if(!(r.inputType==="deleteByDrag"||r.inputType==="insertFromDrop")){if(n.preventInput){n.preventInput=!1,$e(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}n.composingLock||r.data==="‘"||r.data==="“"||r.data==="《"||R(t,getSelection().getRangeAt(0).cloneRange(),!1,r)}}),this.element.addEventListener("click",function(r){if(r.target.tagName==="INPUT"){r.target.checked?r.target.setAttribute("checked","checked"):r.target.removeAttribute("checked"),n.preventInput=!0,$e(t);return}var i=(0,v.RN)(t),a=(0,s.KJ)(r.target,"vditor-ir__preview");if(a||(a=(0,s.KJ)(i.startContainer,"vditor-ir__preview")),a&&(a.previousElementSibling.firstElementChild?i.selectNodeContents(a.previousElementSibling.firstElementChild):i.selectNodeContents(a.previousElementSibling),i.collapse(!0),(0,v.jl)(i),Oe(t)),r.target.tagName==="IMG"){var o=r.target.parentElement.querySelector(".vditor-ir__marker--link");o&&(i.selectNode(o),(0,v.jl)(i))}var f=(0,s.Th)(r.target,"data-type","a");if(f&&!f.classList.contains("vditor-ir__node--expand")){t.options.link.click?t.options.link.click(f.querySelector(":scope > .vditor-ir__marker--link")):t.options.link.isOpen&&window.open(f.querySelector(":scope > .vditor-ir__marker--link").textContent);return}if(r.target.isEqualNode(n.element)&&n.element.lastElementChild&&i.collapsed){var h=n.element.lastElementChild.getBoundingClientRect();r.y>h.top+h.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(E.Y.ZWSP,"")===""?(i.selectNodeContents(n.element.lastElementChild),i.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(E.Y.ZWSP,"<wbr></p>")),(0,v.ir)(n.element,i)))}i.toString()===""?k(i,t):setTimeout(function(){k((0,v.RN)(t),t)}),D(r,t),We(t)}),this.element.addEventListener("keyup",function(r){if(!(r.isComposing||(0,l._0)(r))){if(r.key==="Enter"&&Oe(t),We(t),(r.key==="Backspace"||r.key==="Delete")&&t.ir.element.innerHTML!==""&&t.ir.element.childNodes.length===1&&t.ir.element.firstElementChild&&t.ir.element.firstElementChild.tagName==="P"&&t.ir.element.firstElementChild.childElementCount===0&&(t.ir.element.textContent===""||t.ir.element.textContent===`
- `)){t.ir.element.innerHTML="";return}var i=(0,v.RN)(t);r.key==="Backspace"?((0,l.gm)()&&i.startContainer.textContent===`
- `&&i.startOffset===1&&(i.startContainer.textContent="",k(i,t)),n.element.querySelectorAll(".language-math").forEach(function(o){var f=o.querySelector("br");f&&f.remove()})):r.key.indexOf("Arrow")>-1?((r.key==="ArrowLeft"||r.key==="ArrowRight")&&Nn(t),k(i,t)):r.keyCode===229&&r.code===""&&r.key==="Unidentified"&&k(i,t);var a=(0,s.KJ)(i.startContainer,"vditor-ir__preview");if(a){if(r.key==="ArrowUp"||r.key==="ArrowLeft")return a.previousElementSibling.firstElementChild?i.selectNodeContents(a.previousElementSibling.firstElementChild):i.selectNodeContents(a.previousElementSibling),i.collapse(!1),r.preventDefault(),!0;if(a.tagName==="SPAN"&&(r.key==="ArrowDown"||r.key==="ArrowRight"))return a.parentElement.getAttribute("data-type")==="html-entity"?(a.parentElement.insertAdjacentText("afterend",E.Y.ZWSP),i.setStart(a.parentElement.nextSibling,1)):i.selectNodeContents(a.parentElement.lastElementChild),i.collapse(!1),r.preventDefault(),!0}}})},e}(),Rn=function(e){if(e.currentMode==="sv")return e.lute.Md2HTML(V(e));if(e.currentMode==="wysiwyg")return e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML);if(e.currentMode==="ir")return e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML)},Ar=te(796),jn=te(70),xr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(t,`</div>
- <div class="vditor-outline__content"></div>`)}return e.prototype.render=function(t){var n="";return t.preview.element.style.display==="block"?n=(0,jn.N)(t.preview.previewElement,this.element.lastElementChild,t):n=(0,jn.N)(t[t.currentMode].element,this.element.lastElementChild,t),n},e.prototype.toggle=function(t,n,r){var i;n===void 0&&(n=!0),r===void 0&&(r=!0);var a=(i=t.toolbar.elements.outline)===null||i===void 0?void 0:i.firstElementChild;if(n&&window.innerWidth>=E.Y.MOBILE_WIDTH?(this.element.style.display="block",this.render(t),a==null||a.classList.add("vditor-menu--current")):(this.element.style.display="none",a==null||a.classList.remove("vditor-menu--current")),r&&getSelection().rangeCount>0){var o=getSelection().getRangeAt(0);t[t.currentMode].element.contains(o.startContainer)&&(0,v.jl)(o)}le(t)},e}(),Dr=te(0),Hr=function(){function e(t){var n=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",t.options.classes.preview&&this.previewElement.classList.add(t.options.classes.preview),this.previewElement.style.maxWidth=t.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(h){if(h.target.tagName!=="TEXTAREA"){var d=document.createElement("div");d.className="vditor-reset",d.appendChild(getSelection().getRangeAt(0).cloneContents()),n.copyToX(t,d,"default"),h.preventDefault()}}),this.previewElement.addEventListener("click",function(h){var d=(0,s._Y)(h.target,"SPAN");if(d&&(0,s.KJ)(d,"vditor-toc")){var T=n.previewElement.querySelector("#"+d.getAttribute("data-target-id"));T&&(n.element.scrollTop=T.offsetTop);return}if(h.target.tagName==="A"){t.options.link.click?t.options.link.click(h.target):t.options.link.isOpen&&window.open(h.target.getAttribute("href")),h.preventDefault();return}h.target.tagName==="IMG"&&(t.options.image.preview?t.options.image.preview(h.target):t.options.image.isPreview&&(0,M.o)(h.target,t.options.lang,t.options.theme))}),this.element.appendChild(this.previewElement);var r=t.options.preview.actions;if(r.length!==0){var i=document.createElement("div");i.className="vditor-preview__action";for(var a=[],o=0;o<r.length;o++){var f=r[o];if(typeof f=="object"){a.push('<button type="button" data-type="'.concat(f.key,'" class="').concat(f.className,'"').concat(f.tooltip?' aria-label="'.concat(f.tooltip,'"'):"",'">').concat(f.text,"</button>"));continue}switch(f){case"desktop":a.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":a.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":a.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":a.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":a.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}}i.innerHTML=a.join(""),i.addEventListener((0,l.y3)(),function(h){var d=(0,L.f)(h.target,"BUTTON");if(d){var T=d.getAttribute("data-type"),N=r.find(function($){return($==null?void 0:$.key)===T});if(N){N.click(T);return}if(T==="mp-wechat"||T==="zhihu"){n.copyToX(t,n.previewElement.cloneNode(!0),T);return}T==="desktop"?n.previewElement.style.width="auto":T==="tablet"?n.previewElement.style.width="780px":n.previewElement.style.width="360px",n.previewElement.scrollWidth>n.previewElement.parentElement.clientWidth&&(n.previewElement.style.width="auto"),n.render(t),i.querySelectorAll("button").forEach(function($){$.classList.remove("vditor-preview__action--current")}),d.classList.add("vditor-preview__action--current")}}),this.element.insertBefore(i,this.previewElement)}}return e.prototype.render=function(t,n){var r=this;if(clearTimeout(this.mdTimeoutId),this.element.style.display==="none"){this.element.getAttribute("data-type")==="renderPerformance"&&t.tip.hide();return}if(n){this.previewElement.innerHTML=n;return}if(V(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")===""){this.previewElement.innerHTML="";return}var i=new Date().getTime(),a=V(t);this.mdTimeoutId=window.setTimeout(function(){if(t.options.preview.url){var o=new XMLHttpRequest;o.open("POST",t.options.preview.url),o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)if(o.status===200){var h=JSON.parse(o.responseText);if(h.code!==0){t.tip.show(h.msg);return}t.options.preview.transform&&(h.data=t.options.preview.transform(h.data)),r.previewElement.innerHTML=h.data,r.afterRender(t,i)}else{var d=t.lute.Md2HTML(a);t.options.preview.transform&&(d=t.options.preview.transform(d)),r.previewElement.innerHTML=d,r.afterRender(t,i)}},o.send(JSON.stringify({markdownText:a}))}else{var f=t.lute.Md2HTML(a);t.options.preview.transform&&(f=t.options.preview.transform(f)),r.previewElement.innerHTML=f,r.afterRender(t,i)}},t.options.preview.delay)},e.prototype.afterRender=function(t,n){t.options.preview.parse&&t.options.preview.parse(this.element);var r=new Date().getTime()-n;new Date().getTime()-n>2600?(t.tip.show(window.VditorI18n.performanceTip.replace("${x}",r.toString())),t.preview.element.setAttribute("data-type","renderPerformance")):t.preview.element.getAttribute("data-type")==="renderPerformance"&&(t.tip.hide(),t.preview.element.removeAttribute("data-type"));var i=t.preview.element.querySelector(".vditor-comment--focus");i&&i.classList.remove("vditor-comment--focus"),(0,Q.o)(t.preview.previewElement,t.options.preview.hljs),(0,pe.$)(t.options.preview.hljs,t.preview.previewElement,t.options.cdn),(0,ve.e)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,Ce.K)(t.preview.previewElement,t.options.cdn),(0,De.Y)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ne.D)(t.preview.previewElement,t.options.cdn),(0,oe.m)(t.preview.previewElement,t.options.cdn),(0,H.v)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ke.l)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,Te.M)(t.preview.previewElement,t.options.cdn),(0,Y.$)(t.preview.previewElement,t.options.cdn),t.options.preview.render.media.enable&&(0,Dr.l)(t.preview.previewElement),t.options.customRenders.forEach(function(f){f.render(t.preview.previewElement,t)});var a=t.preview.element,o=t.outline.render(t);o===""&&(o="[ToC]"),a.querySelectorAll('[data-type="toc-block"]').forEach(function(f){f.innerHTML=o,(0,ye.T)(f,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,ye.T)(t.preview.previewElement,{cdn:t.options.cdn,math:t.options.preview.math})},e.prototype.copyToX=function(t,n,r){r===void 0&&(r="mp-wechat"),r!=="zhihu"?n.querySelectorAll(".katex-html .base").forEach(function(a){a.style.display="initial"}):n.querySelectorAll(".language-math").forEach(function(a){a.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(a.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')}),n.style.backgroundColor="#fff",n.querySelectorAll("code").forEach(function(a){a.style.backgroundImage="none"}),this.element.append(n);var i=n.ownerDocument.createRange();i.selectNode(n),(0,v.jl)(i),document.execCommand("copy"),n.remove(),t.tip.show(["zhihu","mp-wechat"].includes(r)?"已复制,可到".concat(r==="zhihu"?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},e}(),Or=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(t.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(t)}return e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("mousedown",function(r){var i=document,a=r.clientY,o=t.element.offsetHeight,f=63+t.element.querySelector(".vditor-toolbar").clientHeight;i.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),n.element.classList.add("vditor-resize--selected"),i.onmousemove=function(h){t.options.resize.position==="top"?t.element.style.height=Math.max(f,o+(a-h.clientY))+"px":t.element.style.height=Math.max(f,o+(h.clientY-a))+"px",t.options.typewriterMode&&(t.sv.element.style.paddingBottom=t.sv.element.parentElement.offsetHeight/2+"px")},i.onmouseup=function(){t.options.resize.after&&t.options.resize.after(t.element.offsetHeight-o),window.captureEvents&&window.captureEvents(),i.onmousemove=null,i.onmouseup=null,i.ondragstart=null,i.onselectstart=null,i.onselect=null,n.element.classList.remove("vditor-resize--selected")}})},e}(),Nr=function(){function e(t){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",t.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(t),qt(t,this.element),Kt(t,this.element),Zt(t,this.element),Gt(t,this.element),Wt(t,this.element),Ft(t,this.element,this.copy),zt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){t.stopPropagation(),t.preventDefault(),t.clipboardData.setData("text/plain",wt(n[n.currentMode].element))},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(r){Rt(t,r,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})}),this.element.addEventListener("scroll",function(){if(t.preview.element.style.display==="block"){var r=n.element.scrollTop,i=n.element.clientHeight,a=n.element.scrollHeight-parseFloat(n.element.style.paddingBottom||"0"),o=t.preview.element;r/i>.5?o.scrollTop=(r+i)*o.scrollHeight/a-i:o.scrollTop=r*o.scrollHeight/a}}),this.element.addEventListener("compositionstart",function(r){n.composingLock=!0}),this.element.addEventListener("compositionend",function(r){(0,l.gm)()||G(t,r),n.composingLock=!1}),this.element.addEventListener("input",function(r){if(!(r.inputType==="deleteByDrag"||r.inputType==="insertFromDrop")&&!(n.composingLock||r.data==="‘"||r.data==="“"||r.data==="《")){if(n.preventInput){n.preventInput=!1,Re(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0});return}G(t,r)}}),this.element.addEventListener("keyup",function(r){if(!(r.isComposing||(0,l._0)(r))){if((r.key==="Backspace"||r.key==="Delete")&&t.sv.element.innerHTML!==""&&t.sv.element.childNodes.length===1&&t.sv.element.firstElementChild&&t.sv.element.firstElementChild.tagName==="DIV"&&t.sv.element.firstElementChild.childElementCount===2&&(t.sv.element.firstElementChild.textContent===""||t.sv.element.textContent===`
- `)){t.sv.element.innerHTML="";return}r.key==="Enter"&&Oe(t)}})},e}(),In=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(t,n){var r=this;n===void 0&&(n=6e3),this.element.className="vditor-tip vditor-tip--show",n===0?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(t,`
- <div class="vditor-tip__close">X</div></div>`),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){r.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(t,"</div>"),setTimeout(function(){r.hide()},n)),this.element.removeAttribute("style"),setTimeout(function(){var i=r.element.getBoundingClientRect();i.top<46&&(r.element.style.position="fixed",r.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),nn=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),p(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",g(t.toolbar.elements,["both"]);break}t.devtools&&t.devtools.renderEchart(t)}},Rr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jr=function(e){Rr(t,e);function t(n,r){var i=e.call(this,n,r)||this;return n.options.preview.mode==="both"&&i.element.children[0].classList.add("vditor-menu--current"),i.element.children[0].addEventListener((0,l.y3)(),function(a){var o=i.element.firstElementChild;o.classList.contains(E.Y.CLASS_MENU_DISABLED)||(a.preventDefault(),n.currentMode==="sv"&&(n.options.preview.mode==="both"?nn("editor",n):nn("both",n)))}),i}return t}(Ae),Ir=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"}return e}(),Pn=te(13),Pr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Br=function(e){Pr(t,e);function t(n,r){var i=e.call(this,n,r)||this,a=i.element.children[0],o=document.createElement("div");o.className="vditor-hint".concat(r.level===2?"":" vditor-panel--arrow");var f="";return E.Y.CODE_THEME.forEach(function(h){f+="<button>".concat(h,"</button>")}),o.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(f,"</div>"),o.addEventListener((0,l.y3)(),function(h){h.target.tagName==="BUTTON"&&(y(n,["subToolbar"]),n.options.preview.hljs.style=h.target.textContent,(0,Pn.h)(h.target.textContent,n.options.cdn),h.preventDefault(),h.stopPropagation())}),i.element.appendChild(o),w(n,o,a,r.level),i}return t}(Ae),Ur=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vr=function(e){Ur(t,e);function t(n,r){var i=e.call(this,n,r)||this,a=i.element.children[0],o=document.createElement("div");o.className="vditor-hint".concat(r.level===2?"":" vditor-panel--arrow");var f="";return Object.keys(n.options.preview.theme.list).forEach(function(h){f+='<button data-type="'.concat(h,'">').concat(n.options.preview.theme.list[h],"</button>")}),o.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(f,"</div>"),o.addEventListener((0,l.y3)(),function(h){h.target.tagName==="BUTTON"&&(y(n,["subToolbar"]),n.options.preview.theme.current=h.target.getAttribute("data-type"),(0,C.H)(n.options.preview.theme.current,n.options.preview.theme.path),h.preventDefault(),h.stopPropagation())}),i.element.appendChild(o),w(n,o,a,r.level),i}return t}(Ae),Yr=function(){function e(t){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(t,"")}return e.prototype.render=function(t,n){var r=n.endsWith(`
- `)?n.length-1:n.length;if(t.options.counter.type==="text"&&t[t.currentMode]){var i=t[t.currentMode].element.cloneNode(!0);i.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(a){a.remove()}),r=i.textContent.length}typeof t.options.counter.max=="number"?(r>t.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(r,"/").concat(t.options.counter.max)):this.element.innerHTML="".concat(r),this.element.setAttribute("aria-label",t.options.counter.type),t.options.counter.after&&t.options.counter.after(r,{enable:t.options.counter.enable,max:t.options.counter.max,type:t.options.counter.type})},e}(),qr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kr=function(e){qr(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].innerHTML=r.icon,i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),!a.currentTarget.classList.contains(E.Y.CLASS_MENU_DISABLED)&&r.click(a,n)}),i}return t}(Ae),Wr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fr=function(e){Wr(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.firstElementChild.addEventListener((0,l.y3)(),function(a){var o=i.element.firstElementChild;o.classList.contains(E.Y.CLASS_MENU_DISABLED)||(a.preventDefault(),o.classList.contains("vditor-menu--current")?(o.classList.remove("vditor-menu--current"),n.devtools.element.style.display="none",le(n)):(o.classList.add("vditor-menu--current"),n.devtools.element.style.display="block",le(n),n.devtools.renderEchart(n)))}),i}return t}(Ae),zr=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"}return e}(),Zr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gr=function(e){Zr(t,e);function t(n,r){var i=e.call(this,n,r)||this,a=document.createElement("div");a.className="vditor-panel vditor-panel--arrow";var o="";return Object.keys(n.options.hint.emoji).forEach(function(f){var h=n.options.hint.emoji[f];h.indexOf(".")>-1?o+='<button data-value=":'.concat(f,': " data-key=":').concat(f,`:"><img
- data-value=":`).concat(f,': " data-key=":').concat(f,':" class="vditor-emojis__icon" src="').concat(h,'"/></button>'):o+='<button data-value="'.concat(h,` "
- data-key="`).concat(f,'"><span class="vditor-emojis__icon">').concat(h,"</span></button>")}),a.innerHTML='<div class="vditor-emojis" style="max-height: '.concat(n.options.height==="auto"?"auto":n.options.height-80,'px">').concat(o,`</div><div class="vditor-emojis__tail">
- <span class="vditor-emojis__tip"></span><span>`).concat(n.options.hint.emojiTail||"",`</span>
- </div>`),i.element.appendChild(a),w(n,a,i.element.firstElementChild,r.level),i.bindEvent(n),i}return t.prototype.bindEvent=function(n){var r=this;this.element.lastElementChild.addEventListener((0,l.y3)(),function(i){var a=(0,L.f)(i.target,"BUTTON");if(a){i.preventDefault();var o=a.getAttribute("data-value"),f=(0,v.RN)(n),h=o;if(n.currentMode==="wysiwyg"?h=n.lute.SpinVditorDOM(o):n.currentMode==="ir"&&(h=n.lute.SpinVditorIRDOM(o)),o.indexOf(":")>-1&&n.currentMode!=="sv"){var d=document.createElement("div");d.innerHTML=h,h=d.firstElementChild.firstElementChild.outerHTML+" ",(0,v.Z2)(h,n)}else f.extractContents(),f.insertNode(document.createTextNode(o)),(0,s.pt)(f.startContainer)||rt(n,f);f.collapse(!1),(0,v.jl)(f),r.element.lastElementChild.style.display="none",me(n)}}),this.element.lastElementChild.addEventListener("mouseover",function(i){var a=(0,L.f)(i.target,"BUTTON");a&&(r.element.querySelector(".vditor-emojis__tip").innerHTML=a.getAttribute("data-key"))})},t}(Ae),Bn=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Jr=function(e){var t=V(e);Bn(e,t,t.substr(0,10)+".md")},Xr=function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'.concat(e.options.cdn,`/dist/index.css"/>
- <script src="`).concat(e.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(e.options.cdn,`",
- markdown: {
- theme: `).concat(JSON.stringify(e.options.preview.theme),`
- },
- hljs: {
- style: "`).concat(e.options.preview.hljs.style,`"
- }
- });
- setTimeout(() => {
- window.print();
- }, 3600);
- }, false);
- <\/script>`)),t.contentDocument.close(),setTimeout(function(){t.contentWindow.postMessage(V(e),"*")},200)},$r=function(e){var t=Rn(e),n='<html><head><link rel="stylesheet" type="text/css" href="'.concat(e.options.cdn,`/dist/index.css"/>
- <script src="`).concat(e.options.cdn,"/dist/js/i18n/").concat(e.options.lang,`.js"><\/script>
- <script src="`).concat(e.options.cdn,`/dist/method.min.js"><\/script></head>
- <body><div class="vditor-reset" id="preview">`).concat(t,`</div>
- <script>
- const previewElement = document.getElementById('preview')
- Vditor.setContentTheme('`).concat(e.options.preview.theme.current,"', '").concat(e.options.preview.theme.path,`');
- Vditor.codeRender(previewElement);
- Vditor.highlightRender(`).concat(JSON.stringify(e.options.preview.hljs),", previewElement, '").concat(e.options.cdn,`');
- Vditor.mathRender(previewElement, {
- cdn: '`).concat(e.options.cdn,`',
- math: `).concat(JSON.stringify(e.options.preview.math),`,
- });
- Vditor.mermaidRender(previewElement, '`).concat(e.options.cdn,"', '").concat(e.options.theme,`');
- Vditor.SMILESRender(previewElement, '`).concat(e.options.cdn,"', '").concat(e.options.theme,`');
- Vditor.markmapRender(previewElement, '`).concat(e.options.cdn,`');
- Vditor.flowchartRender(previewElement, '`).concat(e.options.cdn,`');
- Vditor.graphvizRender(previewElement, '`).concat(e.options.cdn,`');
- Vditor.chartRender(previewElement, '`).concat(e.options.cdn,"', '").concat(e.options.theme,`');
- Vditor.mindmapRender(previewElement, '`).concat(e.options.cdn,"', '").concat(e.options.theme,`');
- Vditor.abcRender(previewElement, '`).concat(e.options.cdn,`');
- `).concat(e.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",`
- Vditor.speechRender(previewElement);
- <\/script>
- <script src="`).concat(e.options.cdn,"/dist/js/icons/").concat(e.options.icon,'.js"><\/script></body></html>');Bn(e,n,t.substr(0,10)+".html")},Qr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ei=function(e){Qr(t,e);function t(n,r){var i=e.call(this,n,r)||this,a=i.element.children[0],o=document.createElement("div");return o.className="vditor-hint".concat(r.level===2?"":" vditor-panel--arrow"),o.innerHTML=`<button data-type="markdown">Markdown</button>
- <button data-type="pdf">PDF</button>
- <button data-type="html">HTML</button>`,o.addEventListener((0,l.y3)(),function(f){var h=f.target;if(h.tagName==="BUTTON"){switch(h.getAttribute("data-type")){case"markdown":Jr(n);break;case"pdf":Xr(n);break;case"html":$r(n);break}y(n,["subToolbar"]),f.preventDefault(),f.stopPropagation()}}),i.element.appendChild(o),w(n,o,a,r.level),i}return t}(Ae),ti=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ni=function(e){ti(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i._bindEvent(n,r),i}return t.prototype._bindEvent=function(n,r){this.element.children[0].addEventListener((0,l.y3)(),function(i){i.preventDefault(),n.element.className.includes("vditor--fullscreen")?(r.level||(this.innerHTML=r.icon),n.element.style.zIndex="",document.body.style.overflow="",n.element.classList.remove("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(a){var o=n.toolbar.elements[a].firstChild;o&&(o.className=o.className.replace("__s","__n"),n.options.toolbar.forEach(function(f){typeof f!="string"&&f.tipPosition&&f.name===o.dataset.type&&(o.className="vditor-tooltipped vditor-tooltipped__".concat(f.tipPosition))}))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__s","__n"))):(r.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),n.element.style.zIndex=n.options.fullscreen.index.toString(),document.body.style.overflow="hidden",n.element.classList.add("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(a){var o=n.toolbar.elements[a].firstChild;o&&(o.className=o.className.replace("__n","__s"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__n","__s"))),n.devtools&&n.devtools.renderEchart(n),r.click&&r.click(i,n),le(n),fe(n)})},t}(Ae),ri=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ii=function(e){ri(t,e);function t(n,r){var i=e.call(this,n,r)||this,a=document.createElement("div");return a.className="vditor-hint vditor-panel--arrow",a.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,l.fG)("<⌥⌘1>"),`</button>
- <button data-tag="h2" data-value="## ">`).concat(window.VditorI18n.heading2," <").concat((0,l.fG)("⌥⌘2"),`></button>
- <button data-tag="h3" data-value="### ">`).concat(window.VditorI18n.heading3," <").concat((0,l.fG)("⌥⌘3"),`></button>
- <button data-tag="h4" data-value="#### ">`).concat(window.VditorI18n.heading4," <").concat((0,l.fG)("⌥⌘4"),`></button>
- <button data-tag="h5" data-value="##### ">`).concat(window.VditorI18n.heading5," <").concat((0,l.fG)("⌥⌘5"),`></button>
- <button data-tag="h6" data-value="###### ">`).concat(window.VditorI18n.heading6," <").concat((0,l.fG)("⌥⌘6"),"></button>"),i.element.appendChild(a),i._bindEvent(n,a),i}return t.prototype._bindEvent=function(n,r){var i=this.element.children[0];i.addEventListener((0,l.y3)(),function(o){o.preventDefault(),clearTimeout(n.wysiwyg.afterRenderTimeoutId),clearTimeout(n.ir.processTimeoutId),clearTimeout(n.sv.processTimeoutId),!i.classList.contains(E.Y.CLASS_MENU_DISABLED)&&(i.blur(),i.classList.contains("vditor-menu--current")?(n.currentMode==="wysiwyg"?(Vt(n),we(n)):n.currentMode==="ir"&&Et(n,""),i.classList.remove("vditor-menu--current")):(y(n,["subToolbar"]),r.style.display="block"))});for(var a=0;a<6;a++)r.children.item(a).addEventListener((0,l.y3)(),function(o){o.preventDefault(),n.currentMode==="wysiwyg"?(Ct(n,o.target.getAttribute("data-tag")),we(n),i.classList.add("vditor-menu--current")):n.currentMode==="ir"?(Et(n,o.target.getAttribute("data-value")),i.classList.add("vditor-menu--current")):dn(n,o.target.getAttribute("data-value")),r.style.display="none"})},t}(Ae),ai=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),oi=function(e){ai(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),n.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)}),i}return t}(Ae),si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),li=function(e){si(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].addEventListener((0,l.y3)(),function(a){if(a.preventDefault(),!(i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)||n.currentMode==="sv")){var o=(0,v.RN)(n),f=(0,s._Y)(o.startContainer,"LI");f&&wn(n,f,o)}}),i}return t}(Ae),ci=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ui=function(e){ci(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),n.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(E.g," / 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)}),i}return t}(Ae),fi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),di=function(e){fi(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),!(i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)||n.currentMode==="sv")&&Dt(n,"afterend")}),i}return t}(Ae),pi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hi=function(e){pi(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),!(i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)||n.currentMode==="sv")&&Dt(n,"beforebegin")}),i}return t}(Ae),mi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gi=function(e){mi(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.element.children[0].addEventListener((0,l.y3)(),function(a){if(a.preventDefault(),!(i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)||n.currentMode==="sv")){var o=(0,v.RN)(n),f=(0,s._Y)(o.startContainer,"LI");f&&$t(n,f,o,f.parentElement)}}),i}return t}(Ae),yi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),bi=function(e){yi(t,e);function t(n,r){var i=e.call(this,n,r)||this;return n.options.outline&&i.element.firstElementChild.classList.add("vditor-menu--current"),i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault();var o=n.toolbar.elements.outline.firstElementChild;o.classList.contains(E.Y.CLASS_MENU_DISABLED)||(n.options.outline.enable=!i.element.firstElementChild.classList.contains("vditor-menu--current"),n.outline.toggle(n,n.options.outline.enable))}),i}return t}(Ae),wi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vi=function(e){wi(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i._bindEvent(n),i}return t.prototype._bindEvent=function(n){var r=this;this.element.children[0].addEventListener((0,l.y3)(),function(i){i.preventDefault();var a=r.element.firstElementChild;if(!a.classList.contains(E.Y.CLASS_MENU_DISABLED)){var o=E.Y.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);a.classList.contains("vditor-menu--current")?(a.classList.remove("vditor-menu--current"),n.currentMode==="sv"?(n.sv.element.style.display="block",n.options.preview.mode==="both"?n.preview.element.style.display="block":n.preview.element.style.display="none"):(n[n.currentMode].element.parentElement.style.display="block",n.preview.element.style.display="none"),m(n.toolbar.elements,o),n.outline.render(n)):(u(n.toolbar.elements,o),n.preview.element.style.display="block",n.currentMode==="sv"?n.sv.element.style.display="none":n[n.currentMode].element.parentElement.style.display="none",n.preview.render(n),a.classList.add("vditor-menu--current"),y(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),le(n)}})},t}(Ae),Ei=function(){function e(t){this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0;var n;if(typeof AudioContext!="undefined")n=new AudioContext;else if(webkitAudioContext)n=new webkitAudioContext;else return;this.DEFAULT_SAMPLE_RATE=n.sampleRate;var r=n.createGain(),i=n.createMediaStreamSource(t);i.connect(r),this.recorder=n.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,r.connect(this.recorder),this.recorder.connect(n.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(t,n){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(n)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),n=this.mergeBuffers(this.rightChannel),r=new Float32Array(t.length),i=0;i<t.length;++i)r[i]=.5*(t[i]+n[i]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(r=this.downSampleBuffer(r,this.SAMPLE_RATE));var a=44+r.length*2,o=new ArrayBuffer(a),f=new DataView(o);this.writeUTFBytes(f,0,"RIFF"),f.setUint32(4,a,!0),this.writeUTFBytes(f,8,"WAVE"),this.writeUTFBytes(f,12,"fmt "),f.setUint32(16,16,!0),f.setUint16(20,1,!0),f.setUint16(22,1,!0),f.setUint32(24,this.SAMPLE_RATE,!0),f.setUint32(28,this.SAMPLE_RATE*2,!0),f.setUint16(32,2,!0),f.setUint16(34,16,!0);var h=r.length*2;this.writeUTFBytes(f,36,"data"),f.setUint32(40,h,!0);for(var d=r.length,T=44,N=1,$=0;$<d;$++)f.setInt16(T,r[$]*(32767*N),!0),T+=2;return new Blob([f],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(t,n){if(n===this.DEFAULT_SAMPLE_RATE||n>this.DEFAULT_SAMPLE_RATE)return t;for(var r=this.DEFAULT_SAMPLE_RATE/n,i=Math.round(t.length/r),a=new Float32Array(i),o=0,f=0;o<a.length;){for(var h=Math.round((o+1)*r),d=0,T=0,N=f;N<h&&N<t.length;N++)d+=t[N],T++;a[o]=d/T,o++,f=h}return a},e.prototype.mergeBuffers=function(t){for(var n=new Float32Array(this.recordingLength),r=0,i=t.length,a=0;a<i;++a){var o=t[a];n.set(o,r),r+=o.length}return n},e.prototype.writeUTFBytes=function(t,n,r){for(var i=r.length,a=0;a<i;a++)t.setUint8(n+a,r.charCodeAt(a))},e}(),Si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ki=function(e){Si(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i._bindEvent(n),i}return t.prototype._bindEvent=function(n){var r=this,i;this.element.children[0].addEventListener((0,l.y3)(),function(a){if(a.preventDefault(),!r.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)){var o=n[n.currentMode].element;if(!i){navigator.mediaDevices.getUserMedia({audio:!0}).then(function(h){i=new Ei(h),i.recorder.onaudioprocess=function(d){if(i.isRecording){var T=d.inputBuffer.getChannelData(0),N=d.inputBuffer.getChannelData(1);i.cloneChannelData(T,N)}},i.startRecordingNewWavFile(),n.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),r.element.children[0].classList.add("vditor-menu--current")}).catch(function(){n.tip.show(window.VditorI18n["record-tip"])});return}if(i.isRecording){i.stopRecording(),n.tip.hide();var f=new File([i.buildWavFileBlob()],"record".concat(new Date().getTime(),".wav"),{type:"video/webm"});Xt(n,[f]),r.element.children[0].classList.remove("vditor-menu--current")}else n.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),i.startRecordingNewWavFile(),r.element.children[0].classList.add("vditor-menu--current")}})},t}(Ae),Ti=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_i=function(e){Ti(t,e);function t(n,r){var i=e.call(this,n,r)||this;return u({redo:i.element},["redo"]),i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),!i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)&&n.undo.redo(n)}),i}return t}(Ae),Li=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mi=function(e){Li(t,e);function t(n,r){var i=e.call(this,n,r)||this;return u({undo:i.element},["undo"]),i.element.children[0].addEventListener((0,l.y3)(),function(a){a.preventDefault(),!i.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)&&n.undo.undo(n)}),i}return t}(Ae),Ci=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ai=function(e){Ci(t,e);function t(n,r){var i=e.call(this,n,r)||this,a='<input type="file"';return n.options.upload.multiple&&(a+=' multiple="multiple"'),n.options.upload.accept&&(a+=' accept="'.concat(n.options.upload.accept,'"')),i.element.children[0].innerHTML="".concat(r.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(a,">"),i._bindEvent(n),i}return t.prototype._bindEvent=function(n){var r=this;this.element.children[0].addEventListener((0,l.y3)(),function(i){if(r.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)){i.stopPropagation(),i.preventDefault();return}}),this.element.querySelector("input").addEventListener("change",function(i){if(r.element.firstElementChild.classList.contains(E.Y.CLASS_MENU_DISABLED)){i.stopPropagation(),i.preventDefault();return}i.target.files.length!==0&&Xt(n,i.target.files,i.target)})},t}(Ae),xi=function(){function e(t){var n=this,r=t.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",r.toolbar.forEach(function(i,a){var o=n.genItem(t,i,a);if(n.element.appendChild(o),i.toolbar){var f=document.createElement("div");f.className="vditor-hint vditor-panel--arrow",f.addEventListener((0,l.y3)(),function(h){f.style.display="none"}),i.toolbar.forEach(function(h,d){h.level=2,f.appendChild(n.genItem(t,h,a+d))}),o.appendChild(f),w(t,f,o.children[0])}}),t.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),t.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),t.options.counter.enable&&(t.counter=new Yr(t),this.element.appendChild(t.counter.element))}return e.prototype.updateConfig=function(t,n){t.options.toolbarConfig=Object.assign({hide:!1,pin:!1},n),t.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),t.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},e.prototype.genItem=function(t,n,r){var i;switch(n.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":i=new Ae(t,n);break;case"emoji":i=new Gr(t,n);break;case"headings":i=new ii(t,n);break;case"|":i=new zr;break;case"br":i=new Ir;break;case"undo":i=new Mi(t,n);break;case"redo":i=new _i(t,n);break;case"help":i=new oi(t,n);break;case"both":i=new jr(t,n);break;case"preview":i=new vi(t,n);break;case"fullscreen":i=new ni(t,n);break;case"upload":i=new Ai(t,n);break;case"record":i=new ki(t,n);break;case"info":i=new ui(t,n);break;case"edit-mode":i=new fr(t,n);break;case"devtools":i=new Fr(t,n);break;case"outdent":i=new gi(t,n);break;case"indent":i=new li(t,n);break;case"outline":i=new bi(t,n);break;case"insert-after":i=new di(t,n);break;case"insert-before":i=new hi(t,n);break;case"code-theme":i=new Br(t,n);break;case"content-theme":i=new Vr(t,n);break;case"export":i=new ei(t,n);break;default:i=new Kr(t,n);break}if(i){var a=n.name;return(a==="br"||a==="|")&&(a=a+r),this.elements[a]=i.element,i.element}},e}(),Di=te(192),Hi=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new Di}return e.prototype.clearStack=function(t){this.resetStack(),this.resetIcon(t)},e.prototype.resetIcon=function(t){t.toolbar&&(this[t.currentMode].undoStack.length>1?m(t.toolbar.elements,["undo"]):u(t.toolbar.elements,["undo"]),this[t.currentMode].redoStack.length!==0?m(t.toolbar.elements,["redo"]):u(t.toolbar.elements,["redo"]))},e.prototype.undo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"&&!(this[t.currentMode].undoStack.length<2)){var n=this[t.currentMode].undoStack.pop();n&&(this[t.currentMode].redoStack.push(n),this.renderDiff(n,t),this[t.currentMode].hasUndo=!0,y(t,["hint"]))}},e.prototype.redo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"){var n=this[t.currentMode].redoStack.pop();n&&(this[t.currentMode].undoStack.push(n),this.renderDiff(n,t,!0))}},e.prototype.recordFirstPosition=function(t,n){if(getSelection().rangeCount!==0&&!(this[t.currentMode].undoStack.length!==1||this[t.currentMode].undoStack[0].length===0||this[t.currentMode].redoStack.length>0)&&!((0,l.gm)()&&n.key==="Backspace")&&!(0,l.nr)()){var r=this.addCaret(t);r.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[t.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[t.currentMode].undoStack[0][0].diffs[0][1]=r,this[t.currentMode].lastText=r)}},e.prototype.addToUndoStack=function(t){var n=this.addCaret(t,!0),r=this.dmp.diff_main(n,this[t.currentMode].lastText,!0),i=this.dmp.patch_make(n,this[t.currentMode].lastText,r);i.length===0&&this[t.currentMode].undoStack.length>0||(this[t.currentMode].lastText=n,this[t.currentMode].undoStack.push(i),this[t.currentMode].undoStack.length>this.stackSize&&this[t.currentMode].undoStack.shift(),this[t.currentMode].hasUndo&&(this[t.currentMode].redoStack=[],this[t.currentMode].hasUndo=!1,u(t.toolbar.elements,["redo"])),this[t.currentMode].undoStack.length>1&&m(t.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(t,n,r){r===void 0&&(r=!1);var i;if(r){var a=this.dmp.patch_deepCopy(t).reverse();a.forEach(function(f){f.diffs.forEach(function(h){h[0]=-h[0]})}),i=this.dmp.patch_apply(a,this[n.currentMode].lastText)[0]}else i=this.dmp.patch_apply(t,this[n.currentMode].lastText)[0];if(this[n.currentMode].lastText=i,n[n.currentMode].element.innerHTML=i,n.currentMode!=="sv"&&(n[n.currentMode].element.querySelectorAll(".vditor-".concat(n.currentMode,"__preview")).forEach(function(f){f.parentElement.querySelector(".language-echarts")&&(f.outerHTML=n.lute.SpinVditorDOM(f.parentElement.outerHTML))}),n[n.currentMode].element.querySelectorAll(".vditor-".concat(n.currentMode,"__preview[data-render='2']")).forEach(function(f){He(f,n)})),n[n.currentMode].element.querySelector("wbr"))(0,v.ir)(n[n.currentMode].element,n[n.currentMode].element.ownerDocument.createRange()),Oe(n);else{var o=getSelection().getRangeAt(0);o.setEndBefore(n[n.currentMode].element),o.collapse(!1)}Z(n),me(n,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),lt(n),n[n.currentMode].element.querySelectorAll(".vditor-".concat(n.currentMode,"__preview[data-render='2']")).forEach(function(f){He(f,n)}),this[n.currentMode].undoStack.length>1?m(n.toolbar.elements,["undo"]):u(n.toolbar.elements,["undo"]),this[n.currentMode].redoStack.length!==0?m(n.toolbar.elements,["redo"]):u(n.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(t,n){n===void 0&&(n=!1);var r;if(getSelection().rangeCount!==0&&!t[t.currentMode].element.querySelector("wbr")){var i=getSelection().getRangeAt(0);if(t[t.currentMode].element.contains(i.startContainer)){r=i.cloneRange();var a=document.createElement("span");a.className="vditor-wbr",i.insertNode(a)}}var o=t.ir.element.cloneNode(!0);o.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='1']")).forEach(function(h){h.firstElementChild&&(h.firstElementChild.classList.contains("language-echarts")||h.firstElementChild.classList.contains("language-plantuml")||h.firstElementChild.classList.contains("language-mindmap")?(h.firstElementChild.removeAttribute("_echarts_instance_"),h.firstElementChild.removeAttribute("data-processed"),h.firstElementChild.innerHTML=h.previousElementSibling.firstElementChild.innerHTML,h.setAttribute("data-render","2")):h.firstElementChild.classList.contains("language-math")&&(h.setAttribute("data-render","2"),h.firstElementChild.textContent=h.firstElementChild.getAttribute("data-math"),h.firstElementChild.removeAttribute("data-math")))});var f=t[t.currentMode].element.innerHTML;return t[t.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(h){h.remove()}),n&&r&&(0,v.jl)(r),f.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),Oi=te(905),Ni=function(){function e(t){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:E.Y.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:"".concat(E.Y.CDN,"/dist/images/emoji"),extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:E.Y.HLJS_OPTIONS,markdown:E.Y.MARKDOWN_OPTIONS,math:E.Y.MATH_OPTIONS,maxWidth:800,mode:"both",theme:E.Y.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(n){return n.replace(/\W/g,"")},linkToImgUrl:"",max:10*1024*1024,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=t}return e.prototype.merge=function(){var t,n,r,i,a,o,f,h,d;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),!((n=(t=this.options.preview)===null||t===void 0?void 0:t.theme)===null||n===void 0)&&n.list&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),!((a=(i=(r=this.options.preview)===null||r===void 0?void 0:r.render)===null||i===void 0?void 0:i.media)===null||a===void 0)&&a.enable&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),!((o=this.options.hint)===null||o===void 0)&&o.emoji&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&(!((h=(f=this.options.preview)===null||f===void 0?void 0:f.theme)===null||h===void 0)&&h.path||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),!((d=this.options.hint)===null||d===void 0)&&d.emojiPath||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji"))));var T=(0,Oi.h)(this.defaultOptions,this.options);if(T.cache.enable&&!T.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return T},e.prototype.mergeToolbar=function(t){var n=this,r=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:` | col2 | col3 |
- | --- | --- | --- |
- | | | |
- | | | |`,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"}],i=[];return t.forEach(function(a){var o=a;r.forEach(function(f){typeof a=="string"&&f.name===a&&(o=f),typeof a=="object"&&f.name===a.name&&(o=Object.assign({},f,a))}),a.toolbar&&(o.toolbar=n.mergeToolbar(a.toolbar)),i.push(o)}),i},e}(),Ri=function(){function e(t){var n=this;this.composingLock=!1,this.commentIds=[];var r=document.createElement("div");r.className="vditor-wysiwyg",r.innerHTML='<pre class="vditor-reset" placeholder="'.concat(t.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=r.firstElementChild,this.popover=r.firstElementChild.nextElementSibling,this.selectPopover=r.lastElementChild,this.bindEvent(t),qt(t,this.element),un(t,this.element),Kt(t,this.element),Zt(t,this.element),Gt(t,this.element),Wt(t,this.element),Ft(t,this.element,this.copy),zt(t,this.element,this.copy),t.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var i=Lute.NewNodeID(),a=getSelection().getRangeAt(0),o=a.cloneRange(),f=a.extractContents(),h,d,T=!1,N=!1;f.childNodes.forEach(function(z,ae){var ee=!1;if(z.nodeType===3?ee=!0:z.classList.contains("vditor-comment")?z.classList.contains("vditor-comment")&&z.setAttribute("data-cmtids",z.getAttribute("data-cmtids")+" "+i):ee=!0,ee)if(z.nodeType!==3&&z.getAttribute("data-block")==="0"&&ae===0&&o.startOffset>0)z.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(z.innerHTML,"</span>"),h=z;else if(z.nodeType!==3&&z.getAttribute("data-block")==="0"&&ae===f.childNodes.length-1&&o.endOffset<o.endContainer.textContent.length)z.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(z.innerHTML,"</span>"),d=z;else if(z.nodeType!==3&&z.getAttribute("data-block")==="0")ae===0?T=!0:ae===f.childNodes.length-1&&(N=!0),z.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(i,'">').concat(z.innerHTML,"</span>");else{var W=document.createElement("span");W.classList.add("vditor-comment"),W.setAttribute("data-cmtids",i),z.parentNode.insertBefore(W,z),W.appendChild(z)}});var $=(0,s.pt)(o.startContainer);$&&(h?($.insertAdjacentHTML("beforeend",h.innerHTML),h.remove()):$.textContent.trim().replace(E.Y.ZWSP,"")===""&&T&&$.remove());var J=(0,s.pt)(o.endContainer);J&&(d?(J.insertAdjacentHTML("afterbegin",d.innerHTML),d.remove()):J.textContent.trim().replace(E.Y.ZWSP,"")===""&&N&&J.remove()),a.insertNode(f),t.options.comment.add(i,a.toString(),n.getComments(t,!0)),we(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),n.hideComment()})}return e.prototype.getComments=function(t,n){var r=this;if(n===void 0&&(n=!1),t.currentMode==="wysiwyg"&&t.options.comment.enable){this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(a){r.commentIds=r.commentIds.concat(a.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var i=[];if(n)return this.commentIds.forEach(function(a){i.push({id:a,top:r.element.querySelector('.vditor-comment[data-cmtids="'.concat(a,'"]')).offsetTop})}),i}else return[]},e.prototype.triggerRemoveComment=function(t){var n=function(a,o){var f=new Set(o);return a.filter(function(h){return!f.has(h)})};if(t.currentMode==="wysiwyg"&&t.options.comment.enable&&t.wysiwyg.commentIds.length>0){var r=JSON.parse(JSON.stringify(this.commentIds));this.getComments(t);var i=n(r,this.commentIds);i.length>0&&t.options.comment.remove(i)}},e.prototype.showComment=function(){var t=(0,v.Ey)(this.element);this.selectPopover.setAttribute("style","left:".concat(t.left,"px;display:block;top:").concat(Math.max(-8,t.top-21),"px"))},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(t,n){var r=getSelection().getRangeAt(0);if(r.toString()!==""){t.stopPropagation(),t.preventDefault();var i=(0,s._Y)(r.startContainer,"CODE"),a=(0,s._Y)(r.endContainer,"CODE");if(i&&a&&a.isSameNode(i)){var o="";i.parentElement.tagName==="PRE"?o=r.toString():o="`"+r.toString()+"`",t.clipboardData.setData("text/plain",o),t.clipboardData.setData("text/html","");return}var f=(0,s._Y)(r.startContainer,"A"),h=(0,s._Y)(r.endContainer,"A");if(f&&h&&h.isSameNode(f)){var d=f.getAttribute("title")||"";d&&(d=' "'.concat(d,'"')),t.clipboardData.setData("text/plain","[".concat(r.toString(),"](").concat(f.getAttribute("href")).concat(d,")")),t.clipboardData.setData("text/html","");return}var T=document.createElement("div");T.appendChild(r.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorDOM2Md(T.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(y(t,["hint"]),!(n.popover.style.display!=="block"||n.selectPopover.style.display!=="block")){var r=parseInt(n.popover.getAttribute("data-top"),10);if(t.options.height!=="auto"){if(t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0){var i=Math.max(window.scrollY-t.element.offsetTop-8,Math.min(r-t.wysiwyg.element.scrollTop,n.element.clientHeight-21))+"px";n.popover.style.display==="block"&&(n.popover.style.top=i),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=i)}return}else if(!t.options.toolbarConfig.pin)return;var a=Math.max(r,window.scrollY-t.element.offsetTop-8)+"px";n.popover.style.display==="block"&&(n.popover.style.top=a),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=a)}}),this.element.addEventListener("scroll",function(){if(y(t,["hint"]),t.options.comment&&t.options.comment.enable&&t.options.comment.scroll&&t.options.comment.scroll(t.wysiwyg.element.scrollTop),n.popover.style.display==="block"){var r=parseInt(n.popover.getAttribute("data-top"),10)-t.wysiwyg.element.scrollTop,i=-8;t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0&&(i=window.scrollY-t.element.offsetTop+i);var a=Math.max(i,Math.min(r,n.element.clientHeight-21))+"px";n.popover.style.top=a,n.selectPopover.style.top=a}}),this.element.addEventListener("paste",function(r){Rt(t,r,{pasteCode:function(i){var a=(0,v.RN)(t),o=document.createElement("template");o.innerHTML=i,a.insertNode(o.content.cloneNode(!0));var f=(0,s.Th)(a.startContainer,"data-block","0");f?f.outerHTML=t.lute.SpinVditorDOM(f.outerHTML):t.wysiwyg.element.innerHTML=t.lute.SpinVditorDOM(t.wysiwyg.element.innerHTML),(0,v.ir)(t.wysiwyg.element,a)}})}),this.element.addEventListener("compositionstart",function(){n.composingLock=!0}),this.element.addEventListener("compositionend",function(r){var i=(0,L.c)(getSelection().getRangeAt(0).startContainer);if(i&&i.textContent===""){Z(t);return}(0,l.gm)()||xt(t,getSelection().getRangeAt(0).cloneRange(),r),n.composingLock=!1}),this.element.addEventListener("input",function(r){if(!(r.inputType==="deleteByDrag"||r.inputType==="insertFromDrop")){if(n.preventInput){n.preventInput=!1,we(t);return}if(n.composingLock||r.data==="‘"||r.data==="“"||r.data==="《"){we(t);return}var i=getSelection().getRangeAt(0),a=(0,s.pt)(i.startContainer);if(a||(rt(t,i),a=(0,s.pt)(i.startContainer)),!!a){for(var o=(0,v.ED)(a,t.wysiwyg.element,i).start,f=!0,h=o-1;h>a.textContent.substr(0,o).lastIndexOf(`
- `);h--)if(a.textContent.charAt(h)!==" "&&a.textContent.charAt(h)!==" "){f=!1;break}o===0&&(f=!1);for(var d=!0,h=o-1;h<a.textContent.length;h++)if(a.textContent.charAt(h)!==" "&&a.textContent.charAt(h)!==`
- `){d=!1;break}d&&/^#{1,6} $/.test(a.textContent)&&(d=!1);var T=(0,L.c)(getSelection().getRangeAt(0).startContainer);if(T&&T.textContent===""&&(Z(t),T.remove()),f&&a.getAttribute("data-type")!=="code-block"||d||en(a.innerHTML)||Qt(a.innerHTML)&&a.previousElementSibling){typeof t.options.input=="function"&&t.options.input(V(t));return}r.inputType==="insertParagraph"&&n.element.innerHTML==="<p><br></p><p><br></p>"&&a.previousElementSibling.remove(),xt(t,i,r)}}}),this.element.addEventListener("click",function(r){if(r.target.tagName==="INPUT"){var i=r.target;i.checked?i.setAttribute("checked","checked"):i.removeAttribute("checked"),n.preventInput=!0,getSelection().rangeCount>0&&(0,v.jl)(getSelection().getRangeAt(0)),we(t);return}if(r.target.tagName==="IMG"&&!r.target.parentElement.classList.contains("vditor-wysiwyg__preview")){r.target.getAttribute("data-type")==="link-ref"?ln(t,r.target):sr(r,t);return}var a=(0,s._Y)(r.target,"A");if(a){t.options.link.click?t.options.link.click(a):t.options.link.isOpen&&window.open(a.getAttribute("href")),r.preventDefault();return}var o=(0,v.RN)(t);if(r.target.isEqualNode(n.element)&&n.element.lastElementChild&&o.collapsed){var f=n.element.lastElementChild.getBoundingClientRect();r.y>f.top+f.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(E.Y.ZWSP,"")===""?(o.selectNodeContents(n.element.lastElementChild),o.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(E.Y.ZWSP,"<wbr></p>")),(0,v.ir)(n.element,o)))}it(t);var h=(0,s.KJ)(r.target,"vditor-wysiwyg__preview");h||(h=(0,s.KJ)((0,v.RN)(t).startContainer,"vditor-wysiwyg__preview")),h&&yt(h,t),D(r,t)}),this.element.addEventListener("keyup",function(r){if(!(r.isComposing||(0,l._0)(r))){r.key==="Enter"&&Oe(t),(r.key==="Backspace"||r.key==="Delete")&&t.wysiwyg.element.innerHTML!==""&&t.wysiwyg.element.childNodes.length===1&&t.wysiwyg.element.firstElementChild&&t.wysiwyg.element.firstElementChild.tagName==="P"&&t.wysiwyg.element.firstElementChild.childElementCount===0&&(t.wysiwyg.element.textContent===""||t.wysiwyg.element.textContent===`
- `)&&(t.wysiwyg.element.innerHTML="");var i=(0,v.RN)(t);if(r.key==="Backspace"&&(0,l.gm)()&&i.startContainer.textContent===`
- `&&i.startOffset===1&&(i.startContainer.textContent=""),rt(t,i),it(t),!(r.key!=="ArrowDown"&&r.key!=="ArrowRight"&&r.key!=="Backspace"&&r.key!=="ArrowLeft"&&r.key!=="ArrowUp")){(r.key==="ArrowLeft"||r.key==="ArrowRight")&&t.hint.render(t);var a=(0,s.KJ)(i.startContainer,"vditor-wysiwyg__preview");if(!a&&i.startContainer.nodeType!==3&&i.startOffset>0){var o=i.startContainer;o.classList.contains("vditor-wysiwyg__block")&&(a=o.lastElementChild)}if(a){var f=a.previousElementSibling;if(f.style.display==="none"){r.key==="ArrowDown"||r.key==="ArrowRight"?yt(a,t):yt(a,t,!1);return}var h=a.previousElementSibling;if(h.tagName==="PRE"&&(h=h.firstElementChild),r.key==="ArrowDown"||r.key==="ArrowRight"){var o=a.parentElement,d=Lt(o);if(d&&d.nodeType!==3){var T=d.querySelector(".vditor-wysiwyg__preview");if(T){yt(T,t);return}}if(d.nodeType===3){for(;d.textContent.length===0&&d.nextSibling;)d=d.nextSibling;i.setStart(d,1)}else i.setStart(d.firstChild,0)}else i.selectNodeContents(h),i.collapse(!1)}}}})},e}(),ji=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ii=function(e){ji(t,e);function t(n,r){var i=e.call(this)||this;if(i.version=E.g,typeof n=="string"){if(r?r.cache?r.cache.id||(r.cache.id="vditor".concat(n)):r.cache={id:"vditor".concat(n)}:r={cache:{id:"vditor".concat(n)}},!document.getElementById(n))return i.showErrorTip("Failed to get element by id: ".concat(n)),i;n=document.getElementById(n)}var a=new Ni(r),o=a.merge();if(o.i18n)window.VditorI18n=o.i18n,i.init(n,o);else if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang)){var f="vditorI18nScript",h=f+o.lang;document.querySelectorAll('head script[id^="'.concat(f,'"]')).forEach(function(d){d.id!==h&&document.head.removeChild(d)}),(0,j.Z)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),h).then(function(){i.init(n,o)}).catch(function(d){i.showErrorTip("GET ".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}else throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");return i}return t.prototype.showErrorTip=function(n){var r=new In;document.body.appendChild(r.element),r.show(n,0)},t.prototype.updateToolbarConfig=function(n){this.vditor.toolbar.updateConfig(this.vditor,n)},t.prototype.setTheme=function(n,r,i,a){this.vditor.options.theme=n,q(this.vditor),r&&(this.vditor.options.preview.theme.current=r,(0,C.H)(r,a||this.vditor.options.preview.theme.path)),i&&(this.vditor.options.preview.hljs.style=i,(0,Pn.h)(i,this.vditor.options.cdn))},t.prototype.getValue=function(){return V(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.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()},t.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()},t.prototype.disabled=function(){y(this.vditor,["subToolbar","hint","popover"]),u(this.vditor.toolbar.elements,E.Y.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){m(this.vditor.toolbar.elements,E.Y.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){if(this.vditor.currentMode==="wysiwyg")return wt(this.vditor.wysiwyg.element);if(this.vditor.currentMode==="sv")return wt(this.vditor.sv.element);if(this.vditor.currentMode==="ir")return wt(this.vditor.ir.element)},t.prototype.renderPreview=function(n){this.vditor.preview.render(this.vditor,n)},t.prototype.getCursorPosition=function(){return(0,v.Ey)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){this.vditor.options.cache.enable&&(0,l.D)()&&localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(n){return this.vditor.lute.HTML2Md(n)},t.prototype.exportJSON=function(n){return this.vditor.lute.RenderJSON(n)},t.prototype.getHTML=function(){return Rn(this.vditor)},t.prototype.tip=function(n,r){this.vditor.tip.show(n,r)},t.prototype.setPreviewMode=function(n){nn(n,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(n){document.execCommand("insertHTML",!1,n)},t.prototype.insertValue=function(n,r){r===void 0&&(r=!0);var i=(0,v.RN)(this.vditor);i.collapse(!0);var a=document.createElement("template");a.innerHTML=n,i.insertNode(a.content.cloneNode(!0)),i.collapse(!1),this.vditor.currentMode==="sv"?(this.vditor.sv.preventInput=!0,r&&G(this.vditor)):this.vditor.currentMode==="wysiwyg"?r&&xt(this.vditor,getSelection().getRangeAt(0)):this.vditor.currentMode==="ir"&&(this.vditor.ir.preventInput=!0,r&&R(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.insertMD=function(n){this.vditor.currentMode==="ir"?(0,v.Z2)(this.vditor.lute.Md2VditorIRDOM(n),this.vditor):this.vditor.currentMode==="wysiwyg"?(0,v.Z2)(this.vditor.lute.Md2VditorDOM(n),this.vditor):Jt(this.vditor,n),this.vditor.outline.render(this.vditor),me(this.vditor)},t.prototype.setValue=function(n,r){var i=this;r===void 0&&(r=!1),this.vditor.currentMode==="sv"?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(n),"</div>"),Re(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):this.vditor.currentMode==="wysiwyg"?cn(this.vditor,n,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(n),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(a){He(a,i.vditor)}),$e(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),n||(y(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),r&&this.clearStack()},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var n=document.getElementById("vditorIconScript");n&&n.remove(),this.clearCache(),X(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return this.vditor.currentMode!=="wysiwyg"?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var r=function(i){i.classList.remove("vditor-comment--hover"),n.forEach(function(a){i.getAttribute("data-cmtids").indexOf(a)>-1&&i.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(i){r(i)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(i){r(i)})}},t.prototype.unHlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var r=function(i){n.forEach(function(a){i.getAttribute("data-cmtids").indexOf(a)>-1&&i.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(i){r(i)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(i){r(i)})}},t.prototype.removeCommentIds=function(n){var r=this;if(this.vditor.currentMode==="wysiwyg"){var i=function(a,o){var f=a.getAttribute("data-cmtids").split(" ");f.find(function(h,d){if(h===o)return f.splice(d,1),!0}),f.length===0?(a.outerHTML=a.innerHTML,(0,v.RN)(r.vditor).collapse(!0)):a.setAttribute("data-cmtids",f.join(" "))};n.forEach(function(a){r.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(o){i(o,a)}),r.vditor.preview.element.style.display!=="none"&&r.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(o){i(o,a)})}),we(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(n,r){var i=this;this.vditor={currentMode:r.mode,element:n,hint:new Mr(r.hint.extend),lute:void 0,options:r,originalInnerHTML:n.innerHTML,outline:new xr(window.VditorI18n.outline),tip:new In},this.vditor.sv=new Nr(this.vditor),this.vditor.undo=new Hi,this.vditor.wysiwyg=new Ri(this.vditor),this.vditor.ir=new Cr(this.vditor),this.vditor.toolbar=new xi(this.vditor),r.resize.enable&&(this.vditor.resize=new Or(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new c),(r.upload.url||r.upload.handler)&&(this.vditor.upload=new gr),(0,j.Z)(r._lutePath||"".concat(r.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){i.vditor.lute=(0,Ar.X)({autoSpace:i.vditor.options.preview.markdown.autoSpace,gfmAutoLink:i.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:i.vditor.options.preview.markdown.codeBlockPreview,emojiSite:i.vditor.options.hint.emojiPath,emojis:i.vditor.options.hint.emoji,fixTermTypo:i.vditor.options.preview.markdown.fixTermTypo,footnotes:i.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:i.vditor.options.preview.math.inlineDigit,linkBase:i.vditor.options.preview.markdown.linkBase,linkPrefix:i.vditor.options.preview.markdown.linkPrefix,listStyle:i.vditor.options.preview.markdown.listStyle,mark:i.vditor.options.preview.markdown.mark,mathBlockPreview:i.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:i.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:i.vditor.options.preview.markdown.sanitize,toc:i.vditor.options.preview.markdown.toc}),i.vditor.preview=new Hr(i.vditor),F(i.vditor),r.after&&r.after(),r.icon&&(0,j.U)("".concat(r.cdn,"/dist/js/icons/").concat(r.icon,".js"),"vditorIconScript")})},t}(se.default);const Pi=Ii})(),Ue=Ue.default,Ue})())})(ir);var Ji=ir.exports;const Xi=Xn(Ji),Ge=(xe,Me="default")=>{const Ee=xe==="dark";switch(Me){case"default":return Ee?"dark":"classic";case"content":return Ee?"dark":"light";case"code":return Ee?"dracula":"github"}},$i=$n({inheritAttrs:!1,__name:"Markdown",props:{height:{type:Number,default:360},value:{type:String,default:""}},emits:["change","get","update:value"],setup(xe,{emit:Me}){const Ee=xe,je=Me,te=Fi(),Ue=pt(null),se=pt(null),E=pt(!1),x=Wi(),{getLocale:V}=Ki(),{getDarkMode:j}=Zn(),c=pt(Ee.value||"");Ut([()=>j.value,()=>E.value],([u,S])=>{var b;S&&((b=p.getVditor())==null||b.setTheme(Ge(u),Ge(u,"content"),Ge(u,"code")))},{immediate:!0,flush:"post"}),Ut(()=>Ee.value,u=>{var S;u!==c.value&&((S=p.getVditor())==null||S.setValue(u)),c.value=u});const l=zi(()=>{let u;switch(ht(V)){case"en":u="en_US";break;case"ja":u="ja_JP";break;case"ko":u="ko_KR";break;default:u="zh_CN"}return u});function g(){const u=ht(Ue);if(!u)return;const S=Bt(Bt({},te),Ee),b=new Xi(u,zn(Bt({theme:Ge(j.value),lang:ht(l),mode:"sv",fullscreen:{index:520},preview:{theme:{current:Ge(j.value,"content")},hljs:{style:Ge(j.value,"code")},actions:[]},input:y=>{c.value=y,je("update:value",y),je("change",y)},after:()=>{Zi(()=>{var y;(y=x==null?void 0:x.redoModalHeight)==null||y.call(x),b.setValue(c.value),se.value=b,E.value=!0,je("get",p)})},blur:()=>{}},S),{cache:{enable:!1}}))}const p={getVditor:()=>se.value};function m(){var S;const u=ht(se);if(u){try{(S=u==null?void 0:u.destroy)==null||S.call(u)}catch(b){}se.value=null,E.value=!1}}return rr(g),Qn(m),er(m),(u,S)=>(tr(),nr("div",{ref_key:"wrapRef",ref:Ue},null,512))}});var ar={exports:{}};(function(xe,Me){(function(Ee,je){xe.exports=je()})(Jn,()=>(()=>{var Ee={913:(v,Z,D)=>{D.d(Z,{Y:()=>I});var I=function(){function R(){}return R.ZWSP="",R.DROP_EDITOR="application/editor",R.MOBILE_WIDTH=520,R.CLASS_MENU_DISABLED="vditor-menu--disabled",R.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],R.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atelier-heath","base16/atelier-lakeside","base16/atelier-plateau","base16/atelier-savanna","base16/atelier-seaside","base16/atelier-sulphurpool","base16/atlas","base16/bespin","base16/black-metal","base16/black-metal-bathory","base16/black-metal-burzum","base16/black-metal-dark-funeral","base16/black-metal-gorgoroth","base16/black-metal-immortal","base16/black-metal-khold","base16/black-metal-marduk","base16/black-metal-mayhem","base16/black-metal-nile","base16/black-metal-venom","base16/brewer","base16/bright","base16/brogrammer","base16/brush-trees-dark","base16/chalk","base16/circus","base16/classic-dark","base16/codeschool","base16/colors","base16/danqing","base16/darcula","base16/dark-violet","base16/darkmoss","base16/darktooth","base16/decaf","base16/default-dark","base16/dracula","base16/edge-dark","base16/eighties","base16/embers","base16/equilibrium-dark","base16/equilibrium-gray-dark","base16/espresso","base16/eva","base16/eva-dim","base16/flat","base16/framer","base16/gigavolt","base16/google-dark","base16/grayscale-dark","base16/green-screen","base16/gruvbox-dark-hard","base16/gruvbox-dark-medium","base16/gruvbox-dark-pale","base16/gruvbox-dark-soft","base16/hardcore","base16/harmonic16-dark","base16/heetch-dark","base16/helios","base16/hopscotch","base16/horizon-dark","base16/humanoid-dark","base16/ia-dark","base16/icy-dark","base16/ir-black","base16/isotope","base16/kimber","base16/london-tube","base16/macintosh","base16/marrakesh","base16/materia","base16/material","base16/material-darker","base16/material-palenight","base16/material-vivid","base16/mellow-purple","base16/mocha","base16/monokai","base16/nebula","base16/nord","base16/nova","base16/ocean","base16/oceanicnext","base16/onedark","base16/outrun-dark","base16/papercolor-dark","base16/paraiso","base16/pasque","base16/phd","base16/pico","base16/pop","base16/porple","base16/qualia","base16/railscasts","base16/rebecca","base16/ros-pine","base16/ros-pine-moon","base16/sandcastle","base16/seti-ui","base16/silk-dark","base16/snazzy","base16/solar-flare","base16/solarized-dark","base16/spacemacs","base16/summercamp","base16/summerfruit-dark","base16/synth-midnight-terminal-dark","base16/tango","base16/tender","base16/tomorrow-night","base16/twilight","base16/unikitty-dark","base16/vulcan","base16/windows-10","base16/windows-95","base16/windows-high-contrast","base16/windows-nt","base16/woodland","base16/xcode-dusk","base16/zenburn","codepen-embed","dark","devibeans","far","felipec","github-dark","github-dark-dimmed","gml","gradient-dark","hybrid","ir-black","isbl-editor-dark","kimbie-dark","lioshi","monokai","monokai-sublime","night-owl","nnfx-dark","nord","obsidian","panda-syntax-dark","paraiso-dark","pojoaque","qtcreator-dark","rainbow","shades-of-purple","srcery","stackoverflow-dark","sunburst","tomorrow-night-blue","tomorrow-night-bright","tokyo-night-dark","vs2015","xt256","ant-design","a11y-light","arduino-light","ascetic","atom-one-light","base16/atelier-cave-light","base16/atelier-dune-light","base16/atelier-estuary-light","base16/atelier-forest-light","base16/atelier-heath-light","base16/atelier-lakeside-light","base16/atelier-plateau-light","base16/atelier-savanna-light","base16/atelier-seaside-light","base16/atelier-sulphurpool-light","base16/brush-trees","base16/classic-light","base16/cupcake","base16/cupertino","base16/default-light","base16/dirtysea","base16/edge-light","base16/equilibrium-gray-light","base16/equilibrium-light","base16/fruit-soda","base16/github","base16/google-light","base16/grayscale-light","base16/gruvbox-light-hard","base16/gruvbox-light-medium","base16/gruvbox-light-soft","base16/harmonic16-light","base16/heetch-light","base16/humanoid-light","base16/horizon-light","base16/ia-light","base16/material-lighter","base16/mexico-light","base16/one-light","base16/papercolor-light","base16/ros-pine-dawn","base16/sagelight","base16/shapeshifter","base16/silk-light","base16/solar-flare-light","base16/solarized-light","base16/summerfruit-light","base16/synth-midnight-terminal-light","base16/tomorrow","base16/unikitty-light","base16/windows-10-light","base16/windows-95-light","base16/windows-high-contrast-light","brown-paper","base16/windows-nt-light","color-brewer","docco","foundation","github","googlecode","gradient-light","grayscale","idea","intellij-light","isbl-editor-light","kimbie-light","lightfair","magula","mono-blue","nnfx-light","panda-syntax-light","paraiso-light","purebasic","qtcreator-light","routeros","school-book","stackoverflow-light","tokyo-night-light","vs","xcode","default"],R.ALIAS_CODE_LANGUAGES=["abc","plantuml","mermaid","flowchart","echarts","mindmap","graphviz","math","markmap","smiles","js","ts","html","toml","c#","bat"],R.CDN="https://unpkg.com/vditor@".concat("3.10.8"),R.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},R.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},R.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},R.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(R.CDN,"/dist/css/content-theme")},R}()},931:(v,Z,D)=>{D.d(Z,{Y:()=>A});var I=D(913),R=D(161),_=D(59),B=D(933),A=function(k,O,M){k===void 0&&(k=document),O===void 0&&(O=I.Y.CDN);var K=_.SMILESRenderAdapter.getElements(k);K.length>0&&(0,R.Z)("".concat(O,"/dist/js/smiles-drawer/smiles-drawer.min.js?v=2.1.7"),"vditorAbcjsScript").then(function(){var G=new SmiDrawer({},{});K.forEach(function(P){var C=_.SMILESRenderAdapter.getCode(P).trim();if(P.getAttribute("data-processed")!=="true"&&C.trim()!==""){var q="smiles"+(0,B.Ee)();P.innerHTML='<svg id="'.concat(q,'"></svg>'),G.draw(C,"#"+q,M==="dark"?"dark":void 0),P.setAttribute("data-processed","true")}})})}},288:(v,Z,D)=>{D.d(Z,{$:()=>B});var I=D(913),R=D(161),_=D(59),B=function(A,k){A===void 0&&(A=document),k===void 0&&(k=I.Y.CDN);var O=_.abcRenderAdapter.getElements(A);O.length>0&&(0,R.Z)("".concat(k,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){O.forEach(function(M){M.parentElement.classList.contains("vditor-wysiwyg__pre")||M.parentElement.classList.contains("vditor-ir__marker--pre")||M.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(M,_.abcRenderAdapter.getCode(M).trim()),M.style.overflowX="auto",M.setAttribute("data-processed","true"))})})}},59:(v,Z,D)=>{D.r(Z),D.d(Z,{SMILESRenderAdapter:()=>R,abcRenderAdapter:()=>O,chartRenderAdapter:()=>k,flowchartRenderAdapter:()=>K,graphvizRenderAdapter:()=>M,markmapRenderAdapter:()=>B,mathRenderAdapter:()=>I,mermaidRenderAdapter:()=>_,mindmapRenderAdapter:()=>A,plantumlRenderAdapter:()=>G});var I={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-math")}},R={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-smiles")}},_={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-mermaid")}},B={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-markmap")}},A={getCode:function(P){return P.getAttribute("data-code")},getElements:function(P){return P.querySelectorAll(".language-mindmap")}},k={getCode:function(P){return P.innerText},getElements:function(P){return P.querySelectorAll(".language-echarts")}},O={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-abc")}},M={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-graphviz")}},K={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-flowchart")}},G={getCode:function(P){return P.textContent},getElements:function(P){return P.querySelectorAll(".language-plantuml")}}},784:(v,Z,D)=>{D.d(Z,{v:()=>O});var I=D(913),R=D(161),_=D(59),B=D(933),A=function(M,K,G,P){return new(G||(G=Promise))(function(C,q){function F(de){try{fe(P.next(de))}catch(X){q(X)}}function le(de){try{fe(P.throw(de))}catch(X){q(X)}}function fe(de){var X;de.done?C(de.value):(X=de.value,X instanceof G?X:new G(function(be){be(X)})).then(F,le)}fe((P=P.apply(M,[])).next())})},k=function(M,K){var G,P,C,q,F={label:0,sent:function(){if(1&C[0])throw C[1];return C[1]},trys:[],ops:[]};return q={next:le(0),throw:le(1),return:le(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function le(fe){return function(de){return function(X){if(G)throw new TypeError("Generator is already executing.");for(;q&&(q=0,X[0]&&(F=0)),F;)try{if(G=1,P&&(C=2&X[0]?P.return:X[0]?P.throw||((C=P.return)&&C.call(P),0):P.next)&&!(C=C.call(P,X[1])).done)return C;switch(P=0,C&&(X=[2&X[0],C.value]),X[0]){case 0:case 1:C=X;break;case 4:return F.label++,{value:X[1],done:!1};case 5:F.label++,P=X[1],X=[0];continue;case 7:X=F.ops.pop(),F.trys.pop();continue;default:if(C=F.trys,!((C=C.length>0&&C[C.length-1])||X[0]!==6&&X[0]!==2)){F=0;continue}if(X[0]===3&&(!C||X[1]>C[0]&&X[1]<C[3])){F.label=X[1];break}if(X[0]===6&&F.label<C[1]){F.label=C[1],C=X;break}if(C&&F.label<C[2]){F.label=C[2],F.ops.push(X);break}C[2]&&F.ops.pop(),F.trys.pop();continue}X=K.call(M,F)}catch(be){X=[6,be],P=0}finally{G=C=0}if(5&X[0])throw X[1];return{value:X[0]?X[1]:void 0,done:!0}}([fe,de])}}},O=function(M,K,G){M===void 0&&(M=document),K===void 0&&(K=I.Y.CDN);var P=_.chartRenderAdapter.getElements(M);P.length>0&&(0,R.Z)("".concat(K,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){P.forEach(function(C){return A(void 0,void 0,void 0,function(){var q,F,le;return k(this,function(fe){switch(fe.label){case 0:if(C.parentElement.classList.contains("vditor-wysiwyg__pre")||C.parentElement.classList.contains("vditor-ir__marker--pre"))return[2];if(!(q=_.chartRenderAdapter.getCode(C).trim()))return[2];fe.label=1;case 1:return fe.trys.push([1,3,,4]),C.getAttribute("data-processed")==="true"?[2]:[4,(0,B.kY)(q)];case 2:return F=fe.sent(),echarts.init(C,G==="dark"?"dark":void 0).setOption(F),C.setAttribute("data-processed","true"),[3,4];case 3:return le=fe.sent(),C.className="vditor-reset--error",C.innerHTML="echarts render error: <br>".concat(le),[3,4];case 4:return[2]}})})})})}},51:(v,Z,D)=>{D.d(Z,{o:()=>_});var I=D(695),R=D(913),_=function(B,A){Array.from(B.querySelectorAll("pre > code")).filter(function(k,O){return!k.parentElement.classList.contains("vditor-wysiwyg__pre")&&!k.parentElement.classList.contains("vditor-ir__marker--pre")&&!(k.classList.contains("language-mermaid")||k.classList.contains("language-flowchart")||k.classList.contains("language-echarts")||k.classList.contains("language-mindmap")||k.classList.contains("language-plantuml")||k.classList.contains("language-markmap")||k.classList.contains("language-abc")||k.classList.contains("language-graphviz")||k.classList.contains("language-math")||k.classList.contains("language-smiles"))&&!(k.style.maxHeight.indexOf("px")>-1)&&!(B.classList.contains("vditor-preview")&&O>5)}).forEach(function(k){var O,M,K,G=k.innerText;if(k.classList.contains("highlight-chroma")){var P=k.cloneNode(!0);P.querySelectorAll(".highlight-ln").forEach(function(le){le.remove()}),G=P.innerText}else G.endsWith(`
- `)&&(G=G.substr(0,G.length-1));var C='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(C='<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 q=document.createElement("div");q.className="vditor-copy",q.innerHTML='<span aria-label="'.concat(((O=window.VditorI18n)===null||O===void 0?void 0:O.copy)||"复制",`"
- onmouseover="this.setAttribute('aria-label', '`).concat(((M=window.VditorI18n)===null||M===void 0?void 0:M.copy)||"复制",`')"
- class="vditor-tooltipped vditor-tooltipped__w"
- onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`).concat(((K=window.VditorI18n)===null||K===void 0?void 0:K.copied)||"已复制",`');this.previousElementSibling.blur()">`).concat(C,"</span>");var F=document.createElement("textarea");F.value=(0,I.p)(G),q.insertAdjacentElement("afterbegin",F),A&&A.renderMenu&&A.renderMenu(k,q),k.before(q),k.style.maxHeight=window.outerHeight-40+"px",k.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(R.Y.ZWSP,"</span>"))})}},500:(v,Z,D)=>{D.d(Z,{D:()=>B});var I=D(913),R=D(161),_=D(59),B=function(A,k){k===void 0&&(k=I.Y.CDN);var O=_.flowchartRenderAdapter.getElements(A);O.length!==0&&(0,R.Z)("".concat(k,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){O.forEach(function(M){if(M.getAttribute("data-processed")!=="true"){var K=flowchart.parse(_.flowchartRenderAdapter.getCode(M));M.innerHTML="",K.drawSVG(M),M.setAttribute("data-processed","true")}})})}},339:(v,Z,D)=>{D.d(Z,{m:()=>B});var I=D(913),R=D(161),_=D(59),B=function(A,k){k===void 0&&(k=I.Y.CDN);var O=_.graphvizRenderAdapter.getElements(A);O.length!==0&&(0,R.Z)("".concat(k,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){O.forEach(function(M){var K=_.graphvizRenderAdapter.getCode(M);if(!M.parentElement.classList.contains("vditor-wysiwyg__pre")&&!M.parentElement.classList.contains("vditor-ir__marker--pre")&&M.getAttribute("data-processed")!=="true"&&K.trim()!==""){try{var G=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),P=(window.URL||window.webkitURL).createObjectURL(G),C=new Worker(P);new Viz({worker:C}).renderSVGElement(K).then(function(q){M.innerHTML=q.outerHTML}).catch(function(q){M.innerHTML="graphviz render error: <br>".concat(q),M.className="vditor-reset--error"})}catch(q){}M.setAttribute("data-processed","true")}})})}},108:(v,Z,D)=>{D.d(Z,{$:()=>B});var I=D(913),R=D(161),_=D(505),B=function(A,k,O){k===void 0&&(k=document),O===void 0&&(O=I.Y.CDN);var M=A.style;I.Y.CODE_THEME.includes(M)||(M="github");var K=document.getElementById("vditorHljsStyle"),G="".concat(O,"/dist/js/highlight.js/styles/").concat(M,".min.css");K&&K.getAttribute("href")!==G&&K.remove(),(0,_.T)("".concat(O,"/dist/js/highlight.js/styles/").concat(M,".min.css"),"vditorHljsStyle"),A.enable!==!1&&k.querySelectorAll("pre > code").length!==0&&(0,R.Z)("".concat(O,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,R.Z)("".concat(O,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){k.querySelectorAll("pre > code").forEach(function(P){if(!P.parentElement.classList.contains("vditor-ir__marker--pre")&&!P.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(P.classList.contains("language-mermaid")||P.classList.contains("language-flowchart")||P.classList.contains("language-echarts")||P.classList.contains("language-mindmap")||P.classList.contains("language-plantuml")||P.classList.contains("language-smiles")||P.classList.contains("language-abc")||P.classList.contains("language-graphviz")||P.classList.contains("language-math"))){A.defaultLang!==""&&P.className.indexOf("language-")===-1&&P.classList.add("language-"+A.defaultLang);var C=A.defaultLang||P.className.replace("language-","");if(window.hljs.getLanguage(C)||(C="plaintext"),P.innerHTML=window.hljs.highlight(P.textContent,{language:C,ignoreIllegals:!0}).value,P.classList.add("hljs"),A.lineNumber){P.classList.add("vditor-linenumber");var q=P.querySelector(".vditor-linenumber__temp");q||((q=document.createElement("div")).className="vditor-linenumber__temp",P.insertAdjacentElement("beforeend",q));var F=getComputedStyle(P).whiteSpace,le=!1;F!=="pre-wrap"&&F!=="pre-line"||(le=!0);var fe="",de=P.textContent.split(/\r\n|\r|\n/g);de.pop(),de.map(function(X){var be="";le&&(q.textContent=X||`
- `,be=' style="height:'.concat(q.getBoundingClientRect().height,'px"')),fe+="<span".concat(be,"></span>")}),q.style.display="none",fe='<span class="vditor-linenumber__rows">'.concat(fe,"</span>"),P.insertAdjacentHTML("beforeend",fe)}}})})})}},597:(v,Z,D)=>{D.d(Z,{K:()=>k});var I=D(913),R=D(161),_=D(59),B={},A=function(O,M){var K=window.markmap,G=K.Transformer,P=K.Markmap,C=K.deriveOptions,q=(K.globalCSS,new G);O.innerHTML='<svg style="width:100%"></svg>';var F=O.firstChild,le=P.create(F,null),fe=function(We,we){var Tt=We.transform(we),_t=Object.keys(Tt.features).filter(function(rt){return!B[rt]});_t.forEach(function(rt){B[rt]=!0});var mt=We.getAssets(_t),gt=mt.styles,Lt=mt.scripts,Mt=window.markmap;return gt&&Mt.loadCSS(gt),Lt&&Mt.loadJS(Lt),Tt}(q,M),de=fe.root,X=fe.frontmatter,be=C(X==null?void 0:X.markmap);le.setData(de,be),le.fit()},k=function(O,M){O===void 0&&(O=document),M===void 0&&(M=I.Y.CDN);var K=_.markmapRenderAdapter.getElements(O);K.length!==0&&(0,R.Z)("".concat(M,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){K.forEach(function(G){var P=_.markmapRenderAdapter.getCode(G);if(G.getAttribute("data-processed")!=="true"&&P.trim()!==""){var C=document.createElement("div");C.className="language-markmap",G.parentNode.appendChild(C),A(C,P),G.parentNode.childNodes[0].nodeName=="CODE"&&G.parentNode.removeChild(G.parentNode.childNodes[0])}})})}},960:(v,Z,D)=>{D.d(Z,{T:()=>k});var I=D(913),R=D(161),_=D(505),B=D(695),A=D(59),k=function(O,M){O===void 0&&(O=document);var K=A.mathRenderAdapter.getElements(O);if(K.length!==0){var G={cdn:I.Y.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(M&&M.math&&(M.math=Object.assign({},G.math,M.math)),(M=Object.assign({},G,M)).math.engine==="KaTeX")(0,_.T)("".concat(M.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,R.Z)("".concat(M.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,R.Z)("".concat(M.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){K.forEach(function(C){if(!C.parentElement.classList.contains("vditor-wysiwyg__pre")&&!C.parentElement.classList.contains("vditor-ir__marker--pre")&&!C.getAttribute("data-math")){var q=(0,B.p)(A.mathRenderAdapter.getCode(C));C.setAttribute("data-math",q);try{C.innerHTML=katex.renderToString(q,{displayMode:C.tagName==="DIV",output:"html",macros:M.math.macros})}catch(F){C.innerHTML=F.message,C.className="language-math vditor-reset--error"}C.addEventListener("copy",function(F){F.stopPropagation(),F.preventDefault();var le=F.currentTarget.closest(".language-math");F.clipboardData.setData("text/html",le.innerHTML),F.clipboardData.setData("text/plain",le.getAttribute("data-math"))})}})})});else if(M.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(M.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:M.math.macros}},Object.assign(window.MathJax,M.math.mathJaxOptions)),(0,R.U)("".concat(M.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var P=function(C,q){var F=(0,B.p)(C.textContent).trim(),le=window.MathJax.getMetricsFor(C);le.display=C.tagName==="DIV",window.MathJax.tex2svgPromise(F,le).then(function(fe){C.innerHTML="",C.setAttribute("data-math",F),C.append(fe),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var de=fe.querySelector('[data-mml-node="merror"]');de&&de.textContent.trim()!==""&&(C.innerHTML=de.textContent.trim(),C.className="vditor-reset--error"),q&&q()})};window.MathJax.startup.promise.then(function(){for(var C=[],q=function(le){var fe=K[le];fe.parentElement.classList.contains("vditor-wysiwyg__pre")||fe.parentElement.classList.contains("vditor-ir__marker--pre")||fe.getAttribute("data-math")||!(0,B.p)(fe.textContent).trim()||C.push(function(de){le===K.length-1?P(fe):P(fe,de)})},F=0;F<K.length;F++)q(F);(function(le){if(le.length!==0){var fe=0,de=le[le.length-1],X=function(){var be=le[fe++];be===de?be():be(X)};X()}})(C)})}}}},0:(v,Z,D)=>{D.d(Z,{l:()=>R});var I=D(933),R=function(_){_&&_.querySelectorAll("a").forEach(function(B){var A=B.getAttribute("href");A&&(A.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(k,O){k.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(O,'"></video>')),k.remove()}(B,A):A.match(/^.+.(mp3|wav|flac)$/)?function(k,O){k.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(O,'"></audio>')),k.remove()}(B,A):function(k,O){var M=O.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),K=O.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),G=O.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),P=O.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),C=O.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),q=O.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),F=O.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),le=O.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(M&&M[1].length===11)k.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(M[1]+(M[2]?"?start="+M[2]:""),'"></iframe>')),k.remove();else if(K&&K[1])k.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(K[1],'"></iframe>')),k.remove();else if(G&&G[1])k.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(G[1],'"></iframe>')),k.remove();else if(P&&P[1])k.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="//coub.com/embed/`.concat(P[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),k.remove();else if(C&&C[0])k.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.facebook.com/plugins/video.php?href=`.concat(encodeURIComponent(C[0]),'"></iframe>')),k.remove();else if(q&&q[2])k.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.dailymotion.com/embed/video/`.concat(q[2],'"></iframe>')),k.remove();else if(O.indexOf("bilibili.com")>-1&&(O.indexOf("bvid=")>-1||F&&F[1])){var fe={bvid:(0,I.TK)("bvid",O)||F&&F[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(O.startsWith("http")?O:"https:"+O).search.split("&").forEach(function(be,We){if(be){We===0&&(be=be.substr(1));var we=be.split("=");fe[we[0]]=we[1]}});var de="https://player.bilibili.com/player.html?",X=Object.keys(fe);X.forEach(function(be,We){de+="".concat(be,"=").concat(fe[be]),We<X.length-1&&(de+="&")}),k.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(de,'"></iframe>')),k.remove()}else le&&le[1]&&(k.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(le[1],'"></iframe>')),k.remove())}(B,A))})}},975:(v,Z,D)=>{D.d(Z,{e:()=>O});var I=D(913),R=D(161),_=D(59),B=D(933),A=function(M,K,G,P){return new(G||(G=Promise))(function(C,q){function F(de){try{fe(P.next(de))}catch(X){q(X)}}function le(de){try{fe(P.throw(de))}catch(X){q(X)}}function fe(de){var X;de.done?C(de.value):(X=de.value,X instanceof G?X:new G(function(be){be(X)})).then(F,le)}fe((P=P.apply(M,[])).next())})},k=function(M,K){var G,P,C,q,F={label:0,sent:function(){if(1&C[0])throw C[1];return C[1]},trys:[],ops:[]};return q={next:le(0),throw:le(1),return:le(2)},typeof Symbol=="function"&&(q[Symbol.iterator]=function(){return this}),q;function le(fe){return function(de){return function(X){if(G)throw new TypeError("Generator is already executing.");for(;q&&(q=0,X[0]&&(F=0)),F;)try{if(G=1,P&&(C=2&X[0]?P.return:X[0]?P.throw||((C=P.return)&&C.call(P),0):P.next)&&!(C=C.call(P,X[1])).done)return C;switch(P=0,C&&(X=[2&X[0],C.value]),X[0]){case 0:case 1:C=X;break;case 4:return F.label++,{value:X[1],done:!1};case 5:F.label++,P=X[1],X=[0];continue;case 7:X=F.ops.pop(),F.trys.pop();continue;default:if(C=F.trys,!((C=C.length>0&&C[C.length-1])||X[0]!==6&&X[0]!==2)){F=0;continue}if(X[0]===3&&(!C||X[1]>C[0]&&X[1]<C[3])){F.label=X[1];break}if(X[0]===6&&F.label<C[1]){F.label=C[1],C=X;break}if(C&&F.label<C[2]){F.label=C[2],F.ops.push(X);break}C[2]&&F.ops.pop(),F.trys.pop();continue}X=K.call(M,F)}catch(be){X=[6,be],P=0}finally{G=C=0}if(5&X[0])throw X[1];return{value:X[0]?X[1]:void 0,done:!0}}([fe,de])}}},O=function(M,K,G){M===void 0&&(M=document),K===void 0&&(K=I.Y.CDN);var P=_.mermaidRenderAdapter.getElements(M);P.length!==0&&(0,R.Z)("".concat(K,"/dist/js/mermaid/mermaid.min.js"),"vditorMermaidScript").then(function(){var C={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}};G==="dark"&&(C.theme="dark"),mermaid.initialize(C),P.forEach(function(q){return A(void 0,void 0,void 0,function(){var F,le,fe,de,X;return k(this,function(be){switch(be.label){case 0:if(F=_.mermaidRenderAdapter.getCode(q),q.getAttribute("data-processed")==="true"||F.trim()==="")return[2];le="mermaid"+(0,B.Ee)(),be.label=1;case 1:return be.trys.push([1,3,,4]),[4,mermaid.render(le,q.textContent)];case 2:return fe=be.sent(),q.innerHTML=fe.svg,[3,4];case 3:return de=be.sent(),X=document.querySelector("#"+le),q.innerHTML="".concat(X.outerHTML,`<br>
- <div style="text-align: left"><small>`).concat(de.message.replace(/\n/,"<br>"),"</small></div>"),X.parentElement.remove(),[3,4];case 4:return q.setAttribute("data-processed","true"),[2]}})})})})}},162:(v,Z,D)=>{D.d(Z,{l:()=>B});var I=D(913),R=D(161),_=D(59),B=function(A,k,O){A===void 0&&(A=document),k===void 0&&(k=I.Y.CDN);var M=_.mindmapRenderAdapter.getElements(A);M.length>0&&(0,R.Z)("".concat(k,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){M.forEach(function(K){if(!K.parentElement.classList.contains("vditor-wysiwyg__pre")&&!K.parentElement.classList.contains("vditor-ir__marker--pre")){var G=_.mindmapRenderAdapter.getCode(K);if(G)try{if(K.getAttribute("data-processed")==="true")return;echarts.init(K,O==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(G))],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(P,C){var q;return!((q=C==null?void 0:C.data)===null||q===void 0)&&q.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),K.setAttribute("data-processed","true")}catch(P){K.className="vditor-reset--error",K.innerHTML="mindmap render error: <br>".concat(P)}}})})}},70:(v,Z,D)=>{D.d(Z,{N:()=>_});var I=D(164),R=D(960),_=function(B,A,k){var O="",M=[];if(Array.from(B.children).forEach(function(C,q){if((0,I.c)(C)){if(k){var F=C.id.lastIndexOf("_");C.id=C.id.substring(0,F===-1?void 0:F)+"_"+q}M.push(C.id),O+=C.outerHTML.replace("<wbr>","")}}),O==="")return A.innerHTML="","";var K=document.createElement("div");if(k)k.lute.SetToC(!0),k.currentMode!=="wysiwyg"||k.preview.element.contains(B)?k.currentMode!=="ir"||k.preview.element.contains(B)?K.innerHTML=k.lute.HTML2VditorDOM("<p>[ToC]</p>"+O):K.innerHTML=k.lute.SpinVditorIRDOM("<p>[ToC]</p>"+O):K.innerHTML=k.lute.SpinVditorDOM("<p>[ToC]</p>"+O),k.lute.SetToC(k.options.preview.markdown.toc);else{A.classList.add("vditor-outline");var G=Lute.New();G.SetToC(!0),K.innerHTML=G.HTML2VditorDOM("<p>[ToC]</p>"+O)}var P=K.firstElementChild.querySelectorAll("li > span[data-target-id]");return P.forEach(function(C,q){if(C.nextElementSibling&&C.nextElementSibling.tagName==="UL"){var F="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(F='<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>'),C.innerHTML="".concat(F,"<span>").concat(C.innerHTML,"</span>")}else C.innerHTML="<svg></svg><span>".concat(C.innerHTML,"</span>");C.setAttribute("data-target-id",M[q])}),O=K.firstElementChild.innerHTML,P.length===0?(A.innerHTML="",O):(A.innerHTML=O,k&&(0,R.T)(A,{cdn:k.options.cdn,math:k.options.preview.math}),A.firstElementChild.addEventListener("click",function(C){for(var q=C.target;q&&!q.isEqualNode(A);){if(q.classList.contains("vditor-outline__action")){q.classList.contains("vditor-outline__action--close")?(q.classList.remove("vditor-outline__action--close"),q.parentElement.nextElementSibling.setAttribute("style","display:block")):(q.classList.add("vditor-outline__action--close"),q.parentElement.nextElementSibling.setAttribute("style","display:none")),C.preventDefault(),C.stopPropagation();break}if(q.getAttribute("data-target-id")){C.preventDefault(),C.stopPropagation();var F=document.getElementById(q.getAttribute("data-target-id"));if(!F)return;if(k)if(k.options.height==="auto"){var le=F.offsetTop+k.element.offsetTop;k.options.toolbarConfig.pin||(le+=k.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,le)}else k.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,k.element.offsetTop),k.preview.element.contains(B)?B.parentElement.scrollTop=F.offsetTop:B.scrollTop=F.offsetTop;else window.scrollTo(window.scrollX,F.offsetTop);break}q=q.parentElement}}),O)}},591:(v,Z,D)=>{D.d(Z,{M:()=>B});var I=D(913),R=D(161),_=D(59),B=function(A,k){A===void 0&&(A=document),k===void 0&&(k=I.Y.CDN);var O=_.plantumlRenderAdapter.getElements(A);O.length!==0&&(0,R.Z)("".concat(k,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){O.forEach(function(M){if(!M.parentElement.classList.contains("vditor-wysiwyg__pre")&&!M.parentElement.classList.contains("vditor-ir__marker--pre")){var K=_.plantumlRenderAdapter.getCode(M).trim();if(K)try{M.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(K),'"/>')}catch(G){M.className="vditor-reset--error",M.innerHTML="plantuml render error: <br>".concat(G)}}})})}},796:(v,Z,D)=>{D.d(Z,{X:()=>I});var I=function(R){var _=Lute.New();return _.PutEmojis(R.emojis),_.SetEmojiSite(R.emojiSite),_.SetHeadingAnchor(R.headingAnchor),_.SetInlineMathAllowDigitAfterOpenMarker(R.inlineMathDigit),_.SetAutoSpace(R.autoSpace),_.SetToC(R.toc),_.SetFootnotes(R.footnotes),_.SetFixTermTypo(R.fixTermTypo),_.SetVditorCodeBlockPreview(R.codeBlockPreview),_.SetVditorMathBlockPreview(R.mathBlockPreview),_.SetSanitize(R.sanitize),_.SetChineseParagraphBeginningSpace(R.paragraphBeginningSpace),_.SetRenderListStyle(R.listStyle),_.SetLinkBase(R.linkBase),_.SetLinkPrefix(R.linkPrefix),_.SetMark(R.mark),_.SetGFMAutoLink(R.gfmAutoLink),R.lazyLoadImage&&_.SetImageLazyLoading(R.lazyLoadImage),_}},726:(v,Z,D)=>{D.d(Z,{o:()=>I});var I=function(R,_,B){B===void 0&&(B="classic");var A=R.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat(B==="dark"?" vditor--dark":"",`">
- <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(R.width,"px;height:").concat(R.height,"px;transform: translate3d(").concat(A.left,"px, ").concat(A.top-36,'px, 0)" src="').concat(R.getAttribute("src"),`">
- </div>
- </div>`)),document.body.style.overflow="hidden";var k=document.querySelector(".vditor-img img"),O="translate3d(".concat(Math.max(0,window.innerWidth-R.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-R.naturalHeight)/2,"px, 0)");setTimeout(function(){k.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(O)),setTimeout(function(){k.parentElement.scrollTo((k.parentElement.scrollWidth-k.parentElement.clientWidth)/2,(k.parentElement.scrollHeight-k.parentElement.clientHeight)/2)},400)});var M=document.querySelector(".vditor-img__btn");M.addEventListener("click",function(){var K=parseInt(M.getAttribute("data-deg"),10)+90;K/90%2==1&&R.naturalWidth>k.parentElement.clientHeight?k.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-R.naturalWidth)/2,"px, ").concat(R.naturalWidth/2-R.naturalHeight/2,"px, 0) rotateZ(").concat(K,"deg)"):k.style.transform="".concat(O," rotateZ(").concat(K,"deg)"),M.setAttribute("data-deg",K.toString()),setTimeout(function(){k.parentElement.scrollTo((k.parentElement.scrollWidth-k.parentElement.clientWidth)/2,(k.parentElement.scrollHeight-k.parentElement.clientHeight)/2)},400)})}},13:(v,Z,D)=>{D.d(Z,{h:()=>_});var I=D(913),R=D(505),_=function(B,A){A===void 0&&(A=I.Y.CDN),I.Y.CODE_THEME.includes(B)||(B="github");var k=document.getElementById("vditorHljsStyle"),O="".concat(A,"/dist/js/highlight.js/styles/").concat(B,".min.css");k?k.getAttribute("href")!==O&&(k.remove(),(0,R.T)(O,"vditorHljsStyle")):(0,R.T)(O,"vditorHljsStyle")}},873:(v,Z,D)=>{D.d(Z,{H:()=>R});var I=D(505),R=function(_,B){if(_&&B){var A=document.getElementById("vditorContentTheme"),k="".concat(B,"/").concat(_,".css");A?A.getAttribute("href")!==k&&(A.remove(),(0,I.T)(k,"vditorContentTheme")):(0,I.T)(k,"vditorContentTheme")}}},161:(v,Z,D)=>{D.d(Z,{U:()=>I,Z:()=>R});var I=function(_,B){if(document.getElementById(B))return!1;var A=new XMLHttpRequest;A.open("GET",_,!1),A.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),A.send("");var k=document.createElement("script");k.type="text/javascript",k.text=A.responseText,k.id=B,document.head.appendChild(k)},R=function(_,B){return new Promise(function(A,k){if(document.getElementById(B))return A(!0),!1;var O=document.createElement("script");O.src=_,O.async=!0,document.head.appendChild(O),O.onerror=function(M){k(M)},O.onload=function(){if(document.getElementById(B))return O.remove(),A(!0),!1;O.id=B,A(!0)}})}},505:(v,Z,D)=>{D.d(Z,{T:()=>I});var I=function(R,_){if(!document.getElementById(_)){var B=document.createElement("link");B.id=_,B.rel="stylesheet",B.type="text/css",B.href=R,document.getElementsByTagName("head")[0].appendChild(B)}}},695:(v,Z,D)=>{D.d(Z,{p:()=>I});var I=function(R){return R.replace(/\u00a0/g," ")}},933:(v,Z,D)=>{D.d(Z,{Ee:()=>I,TK:()=>R,kY:()=>_});var I=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(B){return(parseInt(B,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(B,10)/4).toString(16)})},R=function(B,A){A===void 0&&(A=window.location.search);var k=A.substring(A.indexOf("?")),O=k.indexOf("#");return new URLSearchParams(k.substring(0,O>=0?O:void 0)).get(B)},_=function(B){return Function('"use strict";return ('.concat(B,")"))()}},598:(v,Z,D)=>{D.d(Z,{KJ:()=>R,_Y:()=>I});var I=function(_,B){if(!_)return!1;_.nodeType===3&&(_=_.parentElement);for(var A=_,k=!1;A&&!k&&!A.classList.contains("vditor-reset");)A.nodeName===B?k=!0:A=A.parentElement;return k&&A},R=function(_,B){if(!_)return!1;_.nodeType===3&&(_=_.parentElement);for(var A=_,k=!1;A&&!k&&!A.classList.contains("vditor-reset");)A.classList.contains(B)?k=!0:A=A.parentElement;return k&&A}},164:(v,Z,D)=>{D.d(Z,{c:()=>I});var I=function(R){var _=function(B,A){if(!B)return!1;B.nodeType===3&&(B=B.parentElement);for(var k=B,O=!1;k&&!O&&!k.classList.contains("vditor-reset");)k.nodeName.indexOf(A)===0?O=!0:k=k.parentElement;return O&&k}(R,"H");return!(!_||_.tagName.length!==2||_.tagName==="HR")&&_}},905:(v,Z,D)=>{D.d(Z,{h:()=>I});var I=function(){for(var R=[],_=0;_<arguments.length;_++)R[_]=arguments[_];for(var B={},A=function(O){for(var M in O)O.hasOwnProperty(M)&&(Object.prototype.toString.call(O[M])==="[object Object]"?B[M]=I(B[M],O[M]):B[M]=O[M])},k=0;k<R.length;k++)A(R[k]);return B}},827:(v,Z,D)=>{D.d(Z,{jl:()=>I}),D(913);var I=function(R){var _=window.getSelection();_.removeAllRanges(),_.addRange(R)}}},je={};function te(v){var Z=je[v];if(Z!==void 0)return Z.exports;var D=je[v]={exports:{}};return Ee[v](D,D.exports,te),D.exports}te.d=(v,Z)=>{for(var D in Z)te.o(Z,D)&&!te.o(v,D)&&Object.defineProperty(v,D,{enumerable:!0,get:Z[D]})},te.o=(v,Z)=>Object.prototype.hasOwnProperty.call(v,Z),te.r=v=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})};var Ue={};te.d(Ue,{default:()=>He});var se=te(288),E=te(59),x=te(784),V=te(51),j=te(500),c=te(339),l=te(108),g=function(v){v===void 0&&(v=document);var Z=function(D){var I=document.createElement("img");I.src=D.getAttribute("data-src"),I.addEventListener("load",function(){D.getAttribute("style")||D.getAttribute("class")||D.getAttribute("width")||D.getAttribute("height")||I.naturalHeight>I.naturalWidth&&I.naturalWidth/I.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&I.naturalHeight>window.innerHeight-40&&(D.style.height=window.innerHeight-40+"px"),D.src=I.src}),D.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return v.querySelectorAll("img").forEach(function(D){D.getAttribute("data-src")&&Z(D)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),v.querySelectorAll("img").forEach(function(D){window.vditorImageIntersectionObserver.observe(D)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(D){D.forEach(function(I){(I.isIntersecting===void 0?I.intersectionRatio!==0:I.isIntersecting)&&I.target.getAttribute("data-src")&&Z(I.target)})}),v.querySelectorAll("img").forEach(function(D){window.vditorImageIntersectionObserver.observe(D)}))},p=te(960),m=te(0),u=te(975),S=te(931),b=te(597),y=te(162),w=te(70),s=te(591),L=te(913),U=te(873),Y=te(161),H=te(598),Q=te(905),ne=te(796),oe=te(827),pe=function(v,Z){if(Z===void 0&&(Z="zh_CN"),typeof speechSynthesis!="undefined"&&typeof SpeechSynthesisUtterance!="undefined"){var D=function(){var k,O;return speechSynthesis.getVoices().forEach(function(M){M.lang===Z.replace("_","-")&&(k=M),M.default&&(O=M)}),k||(k=O),k},I='<svg><use xlink:href="#vditor-icon-play"></use></svg>',R='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(I='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',R='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var _=document.querySelector(".vditor-speech");_||((_=document.createElement("button")).className="vditor-speech",v.insertAdjacentElement("beforeend",_),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=D));var B=D(),A=new SpeechSynthesisUtterance;A.voice=B,A.onend=A.onerror=function(){_.style.display="none",speechSynthesis.cancel(),_.classList.remove("vditor-speech--current"),_.innerHTML=I},v.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(k){var O=k.target;if(O.classList.contains("vditor-speech")||O.parentElement.classList.contains("vditor-speech"))return _.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),_.innerHTML=R):(speechSynthesis.pause(),_.innerHTML=I)):(A.text=_.getAttribute("data-text"),speechSynthesis.speak(A),_.classList.add("vditor-speech--current"),_.innerHTML=R),(0,oe.jl)(window.vditorSpeechRange),void v.focus();if(_.style.display="none",speechSynthesis.cancel(),_.classList.remove("vditor-speech--current"),_.innerHTML=I,getSelection().rangeCount!==0){var M=getSelection().getRangeAt(0),K=M.toString().trim();if(K){window.vditorSpeechRange=M.cloneRange();var G=M.getBoundingClientRect();_.innerHTML=I,_.style.display="block",_.style.top=G.top+G.height+document.querySelector("html").scrollTop-20+"px",window.ontouchstart!==void 0?_.style.left=k.changedTouches[k.changedTouches.length-1].pageX+2+"px":_.style.left=k.clientX+2+"px",_.setAttribute("data-text",K)}}})}},ye=function(v,Z,D,I){return new(D||(D=Promise))(function(R,_){function B(O){try{k(I.next(O))}catch(M){_(M)}}function A(O){try{k(I.throw(O))}catch(M){_(M)}}function k(O){var M;O.done?R(O.value):(M=O.value,M instanceof D?M:new D(function(K){K(M)})).then(B,A)}k((I=I.apply(v,[])).next())})},ve=function(v,Z){var D,I,R,_,B={label:0,sent:function(){if(1&R[0])throw R[1];return R[1]},trys:[],ops:[]};return _={next:A(0),throw:A(1),return:A(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function A(k){return function(O){return function(M){if(D)throw new TypeError("Generator is already executing.");for(;_&&(_=0,M[0]&&(B=0)),B;)try{if(D=1,I&&(R=2&M[0]?I.return:M[0]?I.throw||((R=I.return)&&R.call(I),0):I.next)&&!(R=R.call(I,M[1])).done)return R;switch(I=0,R&&(M=[2&M[0],R.value]),M[0]){case 0:case 1:R=M;break;case 4:return B.label++,{value:M[1],done:!1};case 5:B.label++,I=M[1],M=[0];continue;case 7:M=B.ops.pop(),B.trys.pop();continue;default:if(R=B.trys,!((R=R.length>0&&R[R.length-1])||M[0]!==6&&M[0]!==2)){B=0;continue}if(M[0]===3&&(!R||M[1]>R[0]&&M[1]<R[3])){B.label=M[1];break}if(M[0]===6&&B.label<R[1]){B.label=R[1],R=M;break}if(R&&B.label<R[2]){B.label=R[2],B.ops.push(M);break}R[2]&&B.ops.pop(),B.trys.pop();continue}M=Z.call(v,B)}catch(K){M=[6,K],I=0}finally{D=R=0}if(5&M[0])throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}([k,O])}}},Ce=function(v){var Z,D={anchor:0,cdn:L.Y.CDN,customEmoji:{},emojiPath:"".concat(L.Y.CDN,"/dist/images/emoji"),hljs:L.Y.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:L.Y.MARKDOWN_OPTIONS,math:L.Y.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:L.Y.THEME_OPTIONS};return v.cdn&&(!((Z=v.theme)===null||Z===void 0)&&Z.path||(D.theme.path="".concat(v.cdn,"/dist/css/content-theme")),v.emojiPath||(D.emojiPath="".concat(v.cdn,"/dist/images/emoji"))),(0,Q.h)(D,v)},ke=function(v,Z){var D=Ce(Z);return(0,Y.Z)("".concat(D.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var I=(0,ne.X)({autoSpace:D.markdown.autoSpace,gfmAutoLink:D.markdown.gfmAutoLink,codeBlockPreview:D.markdown.codeBlockPreview,emojiSite:D.emojiPath,emojis:D.customEmoji,fixTermTypo:D.markdown.fixTermTypo,footnotes:D.markdown.footnotes,headingAnchor:D.anchor!==0,inlineMathDigit:D.math.inlineDigit,lazyLoadImage:D.lazyLoadImage,linkBase:D.markdown.linkBase,linkPrefix:D.markdown.linkPrefix,listStyle:D.markdown.listStyle,mark:D.markdown.mark,mathBlockPreview:D.markdown.mathBlockPreview,paragraphBeginningSpace:D.markdown.paragraphBeginningSpace,sanitize:D.markdown.sanitize,toc:D.markdown.toc});return Z!=null&&Z.renderers&&I.SetJSRenderers({renderers:{Md2HTML:Z.renderers}}),I.SetHeadingID(!0),I.Md2HTML(v)})},Te=function(v,Z,D){return ye(void 0,void 0,void 0,function(){var I,R,_,B;return ve(this,function(A){switch(A.label){case 0:return I=Ce(D),[4,ke(Z,I)];case 1:if(R=A.sent(),I.transform&&(R=I.transform(R)),v.innerHTML=R,v.classList.add("vditor-reset"),I.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(I.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return B=(_="vditorI18nScript")+I.lang,document.querySelectorAll('head script[id^="'.concat(_,'"]')).forEach(function(O){O.id!==B&&document.head.removeChild(O)}),[4,(0,Y.Z)("".concat(I.cdn,"/dist/js/i18n/").concat(I.lang,".js"),B)];case 3:A.sent(),A.label=4;case 4:return[3,6];case 5:window.VditorI18n=I.i18n,A.label=6;case 6:return I.icon?[4,(0,Y.Z)("".concat(I.cdn,"/dist/js/icons/").concat(I.icon,".js"),"vditorIconScript")]:[3,8];case 7:A.sent(),A.label=8;case 8:return(0,U.H)(I.theme.current,I.theme.path),I.anchor===1&&v.classList.add("vditor-reset--anchor"),(0,V.o)(v,I.hljs),(0,l.$)(I.hljs,v,I.cdn),(0,p.T)(v,{cdn:I.cdn,math:I.math}),(0,u.e)(v,I.cdn,I.mode),(0,S.Y)(v,I.cdn,I.mode),(0,b.K)(v,I.cdn),(0,j.D)(v,I.cdn),(0,c.m)(v,I.cdn),(0,x.v)(v,I.cdn,I.mode),(0,y.l)(v,I.cdn,I.mode),(0,s.M)(v,I.cdn),(0,se.$)(v,I.cdn),I.render.media.enable&&(0,m.l)(v),I.speech.enable&&pe(v),I.anchor!==0&&(k=I.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(O){k===1&&O.classList.add("vditor-anchor--left"),O.onclick=function(){var M=O.getAttribute("href").substr(1),K=document.getElementById("vditorAnchor-"+M).offsetTop;document.querySelector("html").scrollTop=K}}),window.onhashchange=function(){var O=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));O&&(document.querySelector("html").scrollTop=O.offsetTop)}),I.after&&I.after(),I.lazyLoadImage&&g(v),v.addEventListener("click",function(O){var M=(0,H._Y)(O.target,"SPAN");if(M&&(0,H.KJ)(M,"vditor-toc")){var K=v.querySelector("#"+M.getAttribute("data-target-id"));K&&window.scrollTo(window.scrollX,K.offsetTop)}}),[2]}var k})})},De=te(726),Be=te(13);const He=function(){function v(){}return v.adapterRender=E,v.previewImage=De.o,v.codeRender=V.o,v.graphvizRender=c.m,v.highlightRender=l.$,v.mathRender=p.T,v.mermaidRender=u.e,v.SMILESRender=S.Y,v.markmapRender=b.K,v.flowchartRender=j.D,v.chartRender=x.v,v.abcRender=se.$,v.mindmapRender=y.l,v.plantumlRender=s.M,v.outlineRender=w.N,v.mediaRender=m.l,v.speechRender=pe,v.lazyLoadImageRender=g,v.md2html=ke,v.preview=Te,v.setCodeTheme=Be.h,v.setContentTheme=U.H,v}();return Ue=Ue.default})())})(ar);var Qi=ar.exports;const sn=Xn(Qi),ea=$n({__name:"MarkdownViewer",props:{value:{type:String},class:{type:String}},setup(xe){const Me=xe,Ee=pt(null),je=pt(null),{getDarkMode:te}=Zn();function Ue(){const E=ht(Ee);je.value=sn.preview(E,Me.value,{mode:Ge(te.value,"content"),theme:{current:Ge(te.value,"content")},hljs:{style:Ge(te.value,"code")}})}Ut(()=>te.value,E=>{sn.setContentTheme(Ge(E,"content")),sn.setCodeTheme(Ge(E,"code")),Ue()}),Ut(()=>Me.value,(E,x)=>{E!==x&&Ue()});function se(){var x;const E=ht(je);if(E){try{(x=E==null?void 0:E.destroy)==null||x.call(E)}catch(V){}je.value=null}}return rr(Ue),Qn(se),er(se),(E,x)=>(tr(),nr("div",{ref_key:"viewerRef",ref:Ee,id:"markdownViewer",class:Gi(E.$props.class)},null,2))}}),sa=Gn($i),la=Gn(ea);export{sa as M,la as a};
|