| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- var ki=Object.defineProperty,Si=Object.defineProperties;var Li=Object.getOwnPropertyDescriptors;var In=Object.getOwnPropertySymbols;var Ti=Object.prototype.hasOwnProperty,Ci=Object.prototype.propertyIsEnumerable;var Rn=(_e,we,fe)=>we in _e?ki(_e,we,{enumerable:!0,configurable:!0,writable:!0,value:fe}):_e[we]=fe,Ct=(_e,we)=>{for(var fe in we||(we={}))Ti.call(we,fe)&&Rn(_e,fe,we[fe]);if(In)for(var fe of In(we))Ci.call(we,fe)&&Rn(_e,fe,we[fe]);return _e},Pn=(_e,we)=>Si(_e,Li(we));var Kt=(_e,we,fe)=>new Promise((Ae,W)=>{var xe=m=>{try{T(fe.next(m))}catch(d){W(d)}},j=m=>{try{T(fe.throw(m))}catch(d){W(d)}},T=m=>m.done?Ae(m.value):Promise.resolve(m.value).then(xe,j);T((fe=fe.apply(_e,we)).next())});import{a as Mi,B as _i}from"./index-e473004f.js";import{b as Ai}from"./dialysisRecordApi-ea9abeb1.js";import{O as xi,l as qn,ax as Vn,_ as Hi}from"./index.js";import{c as Un,b as zn,z as Ni}from"./antd-ecb53b14.js";import{b as Di}from"./index-8cbf1e33.js";import{d as Jt,J as Oi,f as $e,w as Mt,c as Gn,u as Ge,j as Wn,Q as Kn,Y as ht,Z as _t,x as ji,a0 as Ii,a6 as Ri,a7 as Pi,l as Bn,aa as Bi}from"./vue-8fccce23.js";import{o as Fn}from"./onMountedOrActivated-cb072c10.js";import"./useWindowSizeFn-8ad2dbf2.js";var Jn={exports:{}};(function(_e,we){(function(fe,Ae){_e.exports=Ae()})(Un,function(){return(()=>{var fe={14:j=>{var T=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},m=-1;T.Diff=function(d,u){return[d,u]},T.prototype.diff_main=function(d,u,l,g){g===void 0&&(g=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var a=g;if(d==null||u==null)throw new Error("Null input. (diff_main)");if(d==u)return d?[new T.Diff(0,d)]:[];l===void 0&&(l=!0);var c=l,p=this.diff_commonPrefix(d,u),v=d.substring(0,p);d=d.substring(p),u=u.substring(p),p=this.diff_commonSuffix(d,u);var L=d.substring(d.length-p);d=d.substring(0,d.length-p),u=u.substring(0,u.length-p);var w=this.diff_compute_(d,u,c,a);return v&&w.unshift(new T.Diff(0,v)),L&&w.push(new T.Diff(0,L)),this.diff_cleanupMerge(w),w},T.prototype.diff_compute_=function(d,u,l,g){var a;if(!d)return[new T.Diff(1,u)];if(!u)return[new T.Diff(m,d)];var c=d.length>u.length?d:u,p=d.length>u.length?u:d,v=c.indexOf(p);if(v!=-1)return a=[new T.Diff(1,c.substring(0,v)),new T.Diff(0,p),new T.Diff(1,c.substring(v+p.length))],d.length>u.length&&(a[0][0]=a[2][0]=m),a;if(p.length==1)return[new T.Diff(m,d),new T.Diff(1,u)];var L=this.diff_halfMatch_(d,u);if(L){var w=L[0],M=L[1],k=L[2],S=L[3],f=L[4],N=this.diff_main(w,k,l,g),O=this.diff_main(M,S,l,g);return N.concat([new T.Diff(0,f)],O)}return l&&d.length>100&&u.length>100?this.diff_lineMode_(d,u,g):this.diff_bisect_(d,u,g)},T.prototype.diff_lineMode_=function(d,u,l){var g=this.diff_linesToChars_(d,u);d=g.chars1,u=g.chars2;var a=g.lineArray,c=this.diff_main(d,u,!1,l);this.diff_charsToLines_(c,a),this.diff_cleanupSemantic(c),c.push(new T.Diff(0,""));for(var p=0,v=0,L=0,w="",M="";p<c.length;){switch(c[p][0]){case 1:L++,M+=c[p][1];break;case m:v++,w+=c[p][1];break;case 0:if(v>=1&&L>=1){c.splice(p-v-L,v+L),p=p-v-L;for(var k=this.diff_main(w,M,!1,l),S=k.length-1;S>=0;S--)c.splice(p,0,k[S]);p+=k.length}L=0,v=0,w="",M=""}p++}return c.pop(),c},T.prototype.diff_bisect_=function(d,u,l){for(var g=d.length,a=u.length,c=Math.ceil((g+a)/2),p=c,v=2*c,L=new Array(v),w=new Array(v),M=0;M<v;M++)L[M]=-1,w[M]=-1;L[p+1]=0,w[p+1]=0;for(var k=g-a,S=k%2!=0,f=0,N=0,O=0,F=0,Z=0;Z<c&&!(new Date().getTime()>l);Z++){for(var oe=-Z+f;oe<=Z-N;oe+=2){for(var ae=p+oe,ve=(Le=oe==-Z||oe!=Z&&L[ae-1]<L[ae+1]?L[ae+1]:L[ae-1]+1)-oe;Le<g&&ve<a&&d.charAt(Le)==u.charAt(ve);)Le++,ve++;if(L[ae]=Le,Le>g)N+=2;else if(ve>a)f+=2;else if(S&&(he=p+k-oe)>=0&&he<v&&w[he]!=-1&&Le>=(de=g-w[he]))return this.diff_bisectSplit_(d,u,Le,ve,l)}for(var pe=-Z+O;pe<=Z-F;pe+=2){for(var de,he=p+pe,Te=(de=pe==-Z||pe!=Z&&w[he-1]<w[he+1]?w[he+1]:w[he-1]+1)-pe;de<g&&Te<a&&d.charAt(g-de-1)==u.charAt(a-Te-1);)de++,Te++;if(w[he]=de,de>g)F+=2;else if(Te>a)O+=2;else if(!S&&(ae=p+k-pe)>=0&&ae<v&&L[ae]!=-1){var Le;if(ve=p+(Le=L[ae])-ae,Le>=(de=g-de))return this.diff_bisectSplit_(d,u,Le,ve,l)}}}return[new T.Diff(m,d),new T.Diff(1,u)]},T.prototype.diff_bisectSplit_=function(d,u,l,g,a){var c=d.substring(0,l),p=u.substring(0,g),v=d.substring(l),L=u.substring(g),w=this.diff_main(c,p,!1,a),M=this.diff_main(v,L,!1,a);return w.concat(M)},T.prototype.diff_linesToChars_=function(d,u){var l=[],g={};function a(v){for(var L="",w=0,M=-1,k=l.length;M<v.length-1;){(M=v.indexOf(`
- `,w))==-1&&(M=v.length-1);var S=v.substring(w,M+1);(g.hasOwnProperty?g.hasOwnProperty(S):g[S]!==void 0)?L+=String.fromCharCode(g[S]):(k==c&&(S=v.substring(w),M=v.length),L+=String.fromCharCode(k),g[S]=k,l[k++]=S),w=M+1}return L}l[0]="";var c=4e4,p=a(d);return c=65535,{chars1:p,chars2:a(u),lineArray:l}},T.prototype.diff_charsToLines_=function(d,u){for(var l=0;l<d.length;l++){for(var g=d[l][1],a=[],c=0;c<g.length;c++)a[c]=u[g.charCodeAt(c)];d[l][1]=a.join("")}},T.prototype.diff_commonPrefix=function(d,u){if(!d||!u||d.charAt(0)!=u.charAt(0))return 0;for(var l=0,g=Math.min(d.length,u.length),a=g,c=0;l<a;)d.substring(c,a)==u.substring(c,a)?c=l=a:g=a,a=Math.floor((g-l)/2+l);return a},T.prototype.diff_commonSuffix=function(d,u){if(!d||!u||d.charAt(d.length-1)!=u.charAt(u.length-1))return 0;for(var l=0,g=Math.min(d.length,u.length),a=g,c=0;l<a;)d.substring(d.length-a,d.length-c)==u.substring(u.length-a,u.length-c)?c=l=a:g=a,a=Math.floor((g-l)/2+l);return a},T.prototype.diff_commonOverlap_=function(d,u){var l=d.length,g=u.length;if(l==0||g==0)return 0;l>g?d=d.substring(l-g):l<g&&(u=u.substring(0,l));var a=Math.min(l,g);if(d==u)return a;for(var c=0,p=1;;){var v=d.substring(a-p),L=u.indexOf(v);if(L==-1)return c;p+=L,L!=0&&d.substring(a-p)!=u.substring(0,p)||(c=p,p++)}},T.prototype.diff_halfMatch_=function(d,u){if(this.Diff_Timeout<=0)return null;var l=d.length>u.length?d:u,g=d.length>u.length?u:d;if(l.length<4||2*g.length<l.length)return null;var a=this;function c(f,N,O){for(var F,Z,oe,ae,ve=f.substring(O,O+Math.floor(f.length/4)),pe=-1,de="";(pe=N.indexOf(ve,pe+1))!=-1;){var he=a.diff_commonPrefix(f.substring(O),N.substring(pe)),Te=a.diff_commonSuffix(f.substring(0,O),N.substring(0,pe));de.length<Te+he&&(de=N.substring(pe-Te,pe)+N.substring(pe,pe+he),F=f.substring(0,O-Te),Z=f.substring(O+he),oe=N.substring(0,pe-Te),ae=N.substring(pe+he))}return 2*de.length>=f.length?[F,Z,oe,ae,de]:null}var p,v,L,w,M,k=c(l,g,Math.ceil(l.length/4)),S=c(l,g,Math.ceil(l.length/2));return k||S?(p=S?k&&k[4].length>S[4].length?k:S:k,d.length>u.length?(v=p[0],L=p[1],w=p[2],M=p[3]):(w=p[0],M=p[1],v=p[2],L=p[3]),[v,L,w,M,p[4]]):null},T.prototype.diff_cleanupSemantic=function(d){for(var u=!1,l=[],g=0,a=null,c=0,p=0,v=0,L=0,w=0;c<d.length;)d[c][0]==0?(l[g++]=c,p=L,v=w,L=0,w=0,a=d[c][1]):(d[c][0]==1?L+=d[c][1].length:w+=d[c][1].length,a&&a.length<=Math.max(p,v)&&a.length<=Math.max(L,w)&&(d.splice(l[g-1],0,new T.Diff(m,a)),d[l[g-1]+1][0]=1,g--,c=--g>0?l[g-1]:-1,p=0,v=0,L=0,w=0,a=null,u=!0)),c++;for(u&&this.diff_cleanupMerge(d),this.diff_cleanupSemanticLossless(d),c=1;c<d.length;){if(d[c-1][0]==m&&d[c][0]==1){var M=d[c-1][1],k=d[c][1],S=this.diff_commonOverlap_(M,k),f=this.diff_commonOverlap_(k,M);S>=f?(S>=M.length/2||S>=k.length/2)&&(d.splice(c,0,new T.Diff(0,k.substring(0,S))),d[c-1][1]=M.substring(0,M.length-S),d[c+1][1]=k.substring(S),c++):(f>=M.length/2||f>=k.length/2)&&(d.splice(c,0,new T.Diff(0,M.substring(0,f))),d[c-1][0]=1,d[c-1][1]=k.substring(0,k.length-f),d[c+1][0]=m,d[c+1][1]=M.substring(f),c++),c++}c++}},T.prototype.diff_cleanupSemanticLossless=function(d){function u(f,N){if(!f||!N)return 6;var O=f.charAt(f.length-1),F=N.charAt(0),Z=O.match(T.nonAlphaNumericRegex_),oe=F.match(T.nonAlphaNumericRegex_),ae=Z&&O.match(T.whitespaceRegex_),ve=oe&&F.match(T.whitespaceRegex_),pe=ae&&O.match(T.linebreakRegex_),de=ve&&F.match(T.linebreakRegex_),he=pe&&f.match(T.blanklineEndRegex_),Te=de&&N.match(T.blanklineStartRegex_);return he||Te?5:pe||de?4:Z&&!ae&&ve?3:ae||ve?2:Z||oe?1:0}for(var l=1;l<d.length-1;){if(d[l-1][0]==0&&d[l+1][0]==0){var g=d[l-1][1],a=d[l][1],c=d[l+1][1],p=this.diff_commonSuffix(g,a);if(p){var v=a.substring(a.length-p);g=g.substring(0,g.length-p),a=v+a.substring(0,a.length-p),c=v+c}for(var L=g,w=a,M=c,k=u(g,a)+u(a,c);a.charAt(0)===c.charAt(0);){g+=a.charAt(0),a=a.substring(1)+c.charAt(0),c=c.substring(1);var S=u(g,a)+u(a,c);S>=k&&(k=S,L=g,w=a,M=c)}d[l-1][1]!=L&&(L?d[l-1][1]=L:(d.splice(l-1,1),l--),d[l][1]=w,M?d[l+1][1]=M:(d.splice(l+1,1),l--))}l++}},T.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,T.whitespaceRegex_=/\s/,T.linebreakRegex_=/[\r\n]/,T.blanklineEndRegex_=/\n\r?\n$/,T.blanklineStartRegex_=/^\r?\n\r?\n/,T.prototype.diff_cleanupEfficiency=function(d){for(var u=!1,l=[],g=0,a=null,c=0,p=!1,v=!1,L=!1,w=!1;c<d.length;)d[c][0]==0?(d[c][1].length<this.Diff_EditCost&&(L||w)?(l[g++]=c,p=L,v=w,a=d[c][1]):(g=0,a=null),L=w=!1):(d[c][0]==m?w=!0:L=!0,a&&(p&&v&&L&&w||a.length<this.Diff_EditCost/2&&p+v+L+w==3)&&(d.splice(l[g-1],0,new T.Diff(m,a)),d[l[g-1]+1][0]=1,g--,a=null,p&&v?(L=w=!0,g=0):(c=--g>0?l[g-1]:-1,L=w=!1),u=!0)),c++;u&&this.diff_cleanupMerge(d)},T.prototype.diff_cleanupMerge=function(d){d.push(new T.Diff(0,""));for(var u,l=0,g=0,a=0,c="",p="";l<d.length;)switch(d[l][0]){case 1:a++,p+=d[l][1],l++;break;case m:g++,c+=d[l][1],l++;break;case 0:g+a>1?(g!==0&&a!==0&&((u=this.diff_commonPrefix(p,c))!==0&&(l-g-a>0&&d[l-g-a-1][0]==0?d[l-g-a-1][1]+=p.substring(0,u):(d.splice(0,0,new T.Diff(0,p.substring(0,u))),l++),p=p.substring(u),c=c.substring(u)),(u=this.diff_commonSuffix(p,c))!==0&&(d[l][1]=p.substring(p.length-u)+d[l][1],p=p.substring(0,p.length-u),c=c.substring(0,c.length-u))),l-=g+a,d.splice(l,g+a),c.length&&(d.splice(l,0,new T.Diff(m,c)),l++),p.length&&(d.splice(l,0,new T.Diff(1,p)),l++),l++):l!==0&&d[l-1][0]==0?(d[l-1][1]+=d[l][1],d.splice(l,1)):l++,a=0,g=0,c="",p=""}d[d.length-1][1]===""&&d.pop();var v=!1;for(l=1;l<d.length-1;)d[l-1][0]==0&&d[l+1][0]==0&&(d[l][1].substring(d[l][1].length-d[l-1][1].length)==d[l-1][1]?(d[l][1]=d[l-1][1]+d[l][1].substring(0,d[l][1].length-d[l-1][1].length),d[l+1][1]=d[l-1][1]+d[l+1][1],d.splice(l-1,1),v=!0):d[l][1].substring(0,d[l+1][1].length)==d[l+1][1]&&(d[l-1][1]+=d[l+1][1],d[l][1]=d[l][1].substring(d[l+1][1].length)+d[l+1][1],d.splice(l+1,1),v=!0)),l++;v&&this.diff_cleanupMerge(d)},T.prototype.diff_xIndex=function(d,u){var l,g=0,a=0,c=0,p=0;for(l=0;l<d.length&&(d[l][0]!==1&&(g+=d[l][1].length),d[l][0]!==m&&(a+=d[l][1].length),!(g>u));l++)c=g,p=a;return d.length!=l&&d[l][0]===m?p:p+(u-c)},T.prototype.diff_prettyHtml=function(d){for(var u=[],l=/&/g,g=/</g,a=/>/g,c=/\n/g,p=0;p<d.length;p++){var v=d[p][0],L=d[p][1].replace(l,"&").replace(g,"<").replace(a,">").replace(c,"¶<br>");switch(v){case 1:u[p]='<ins style="background:#e6ffe6;">'+L+"</ins>";break;case m:u[p]='<del style="background:#ffe6e6;">'+L+"</del>";break;case 0:u[p]="<span>"+L+"</span>"}}return u.join("")},T.prototype.diff_text1=function(d){for(var u=[],l=0;l<d.length;l++)d[l][0]!==1&&(u[l]=d[l][1]);return u.join("")},T.prototype.diff_text2=function(d){for(var u=[],l=0;l<d.length;l++)d[l][0]!==m&&(u[l]=d[l][1]);return u.join("")},T.prototype.diff_levenshtein=function(d){for(var u=0,l=0,g=0,a=0;a<d.length;a++){var c=d[a][0],p=d[a][1];switch(c){case 1:l+=p.length;break;case m:g+=p.length;break;case 0:u+=Math.max(l,g),l=0,g=0}}return u+=Math.max(l,g)},T.prototype.diff_toDelta=function(d){for(var u=[],l=0;l<d.length;l++)switch(d[l][0]){case 1:u[l]="+"+encodeURI(d[l][1]);break;case m:u[l]="-"+d[l][1].length;break;case 0:u[l]="="+d[l][1].length}return u.join(" ").replace(/%20/g," ")},T.prototype.diff_fromDelta=function(d,u){for(var l=[],g=0,a=0,c=u.split(/\t/g),p=0;p<c.length;p++){var v=c[p].substring(1);switch(c[p].charAt(0)){case"+":try{l[g++]=new T.Diff(1,decodeURI(v))}catch(M){throw new Error("Illegal escape in diff_fromDelta: "+v)}break;case"-":case"=":var L=parseInt(v,10);if(isNaN(L)||L<0)throw new Error("Invalid number in diff_fromDelta: "+v);var w=d.substring(a,a+=L);c[p].charAt(0)=="="?l[g++]=new T.Diff(0,w):l[g++]=new T.Diff(m,w);break;default:if(c[p])throw new Error("Invalid diff operation in diff_fromDelta: "+c[p])}}if(a!=d.length)throw new Error("Delta length ("+a+") does not equal source text length ("+d.length+").");return l},T.prototype.match_main=function(d,u,l){if(d==null||u==null||l==null)throw new Error("Null input. (match_main)");return l=Math.max(0,Math.min(l,d.length)),d==u?0:d.length?d.substring(l,l+u.length)==u?l:this.match_bitap_(d,u,l):-1},T.prototype.match_bitap_=function(d,u,l){if(u.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var g=this.match_alphabet_(u),a=this;function c(ve,pe){var de=ve/u.length,he=Math.abs(l-pe);return a.Match_Distance?de+he/a.Match_Distance:he?1:de}var p=this.Match_Threshold,v=d.indexOf(u,l);v!=-1&&(p=Math.min(c(0,v),p),(v=d.lastIndexOf(u,l+u.length))!=-1&&(p=Math.min(c(0,v),p)));var L,w,M=1<<u.length-1;v=-1;for(var k,S=u.length+d.length,f=0;f<u.length;f++){for(L=0,w=S;L<w;)c(f,l+w)<=p?L=w:S=w,w=Math.floor((S-L)/2+L);S=w;var N=Math.max(1,l-w+1),O=Math.min(l+w,d.length)+u.length,F=Array(O+2);F[O+1]=(1<<f)-1;for(var Z=O;Z>=N;Z--){var oe=g[d.charAt(Z-1)];if(F[Z]=f===0?(F[Z+1]<<1|1)&oe:(F[Z+1]<<1|1)&oe|(k[Z+1]|k[Z])<<1|1|k[Z+1],F[Z]&M){var ae=c(f,Z-1);if(ae<=p){if(p=ae,!((v=Z-1)>l))break;N=Math.max(1,2*l-v)}}}if(c(f+1,l)>p)break;k=F}return v},T.prototype.match_alphabet_=function(d){for(var u={},l=0;l<d.length;l++)u[d.charAt(l)]=0;for(l=0;l<d.length;l++)u[d.charAt(l)]|=1<<d.length-l-1;return u},T.prototype.patch_addContext_=function(d,u){if(u.length!=0){if(d.start2===null)throw Error("patch not initialized");for(var l=u.substring(d.start2,d.start2+d.length1),g=0;u.indexOf(l)!=u.lastIndexOf(l)&&l.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)g+=this.Patch_Margin,l=u.substring(d.start2-g,d.start2+d.length1+g);g+=this.Patch_Margin;var a=u.substring(d.start2-g,d.start2);a&&d.diffs.unshift(new T.Diff(0,a));var c=u.substring(d.start2+d.length1,d.start2+d.length1+g);c&&d.diffs.push(new T.Diff(0,c)),d.start1-=a.length,d.start2-=a.length,d.length1+=a.length+c.length,d.length2+=a.length+c.length}},T.prototype.patch_make=function(d,u,l){var g,a;if(typeof d=="string"&&typeof u=="string"&&l===void 0)g=d,(a=this.diff_main(g,u,!0)).length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(d&&typeof d=="object"&&u===void 0&&l===void 0)a=d,g=this.diff_text1(a);else if(typeof d=="string"&&u&&typeof u=="object"&&l===void 0)g=d,a=u;else{if(typeof d!="string"||typeof u!="string"||!l||typeof l!="object")throw new Error("Unknown call format to patch_make.");g=d,a=l}if(a.length===0)return[];for(var c=[],p=new T.patch_obj,v=0,L=0,w=0,M=g,k=g,S=0;S<a.length;S++){var f=a[S][0],N=a[S][1];switch(v||f===0||(p.start1=L,p.start2=w),f){case 1:p.diffs[v++]=a[S],p.length2+=N.length,k=k.substring(0,w)+N+k.substring(w);break;case m:p.length1+=N.length,p.diffs[v++]=a[S],k=k.substring(0,w)+k.substring(w+N.length);break;case 0:N.length<=2*this.Patch_Margin&&v&&a.length!=S+1?(p.diffs[v++]=a[S],p.length1+=N.length,p.length2+=N.length):N.length>=2*this.Patch_Margin&&v&&(this.patch_addContext_(p,M),c.push(p),p=new T.patch_obj,v=0,M=k,L=w)}f!==1&&(L+=N.length),f!==m&&(w+=N.length)}return v&&(this.patch_addContext_(p,M),c.push(p)),c},T.prototype.patch_deepCopy=function(d){for(var u=[],l=0;l<d.length;l++){var g=d[l],a=new T.patch_obj;a.diffs=[];for(var c=0;c<g.diffs.length;c++)a.diffs[c]=new T.Diff(g.diffs[c][0],g.diffs[c][1]);a.start1=g.start1,a.start2=g.start2,a.length1=g.length1,a.length2=g.length2,u[l]=a}return u},T.prototype.patch_apply=function(d,u){if(d.length==0)return[u,[]];d=this.patch_deepCopy(d);var l=this.patch_addPadding(d);u=l+u+l,this.patch_splitMax(d);for(var g=0,a=[],c=0;c<d.length;c++){var p,v,L=d[c].start2+g,w=this.diff_text1(d[c].diffs),M=-1;if(w.length>this.Match_MaxBits?(p=this.match_main(u,w.substring(0,this.Match_MaxBits),L))!=-1&&((M=this.match_main(u,w.substring(w.length-this.Match_MaxBits),L+w.length-this.Match_MaxBits))==-1||p>=M)&&(p=-1):p=this.match_main(u,w,L),p==-1)a[c]=!1,g-=d[c].length2-d[c].length1;else if(a[c]=!0,g=p-L,w==(v=M==-1?u.substring(p,p+w.length):u.substring(p,M+this.Match_MaxBits)))u=u.substring(0,p)+this.diff_text2(d[c].diffs)+u.substring(p+w.length);else{var k=this.diff_main(w,v,!1);if(w.length>this.Match_MaxBits&&this.diff_levenshtein(k)/w.length>this.Patch_DeleteThreshold)a[c]=!1;else{this.diff_cleanupSemanticLossless(k);for(var S,f=0,N=0;N<d[c].diffs.length;N++){var O=d[c].diffs[N];O[0]!==0&&(S=this.diff_xIndex(k,f)),O[0]===1?u=u.substring(0,p+S)+O[1]+u.substring(p+S):O[0]===m&&(u=u.substring(0,p+S)+u.substring(p+this.diff_xIndex(k,f+O[1].length))),O[0]!==m&&(f+=O[1].length)}}}}return[u=u.substring(l.length,u.length-l.length),a]},T.prototype.patch_addPadding=function(d){for(var u=this.Patch_Margin,l="",g=1;g<=u;g++)l+=String.fromCharCode(g);for(g=0;g<d.length;g++)d[g].start1+=u,d[g].start2+=u;var a=d[0],c=a.diffs;if(c.length==0||c[0][0]!=0)c.unshift(new T.Diff(0,l)),a.start1-=u,a.start2-=u,a.length1+=u,a.length2+=u;else if(u>c[0][1].length){var p=u-c[0][1].length;c[0][1]=l.substring(c[0][1].length)+c[0][1],a.start1-=p,a.start2-=p,a.length1+=p,a.length2+=p}return(c=(a=d[d.length-1]).diffs).length==0||c[c.length-1][0]!=0?(c.push(new T.Diff(0,l)),a.length1+=u,a.length2+=u):u>c[c.length-1][1].length&&(p=u-c[c.length-1][1].length,c[c.length-1][1]+=l.substring(0,p),a.length1+=p,a.length2+=p),l},T.prototype.patch_splitMax=function(d){for(var u=this.Match_MaxBits,l=0;l<d.length;l++)if(!(d[l].length1<=u)){var g=d[l];d.splice(l--,1);for(var a=g.start1,c=g.start2,p="";g.diffs.length!==0;){var v=new T.patch_obj,L=!0;for(v.start1=a-p.length,v.start2=c-p.length,p!==""&&(v.length1=v.length2=p.length,v.diffs.push(new T.Diff(0,p)));g.diffs.length!==0&&v.length1<u-this.Patch_Margin;){var w=g.diffs[0][0],M=g.diffs[0][1];w===1?(v.length2+=M.length,c+=M.length,v.diffs.push(g.diffs.shift()),L=!1):w===m&&v.diffs.length==1&&v.diffs[0][0]==0&&M.length>2*u?(v.length1+=M.length,a+=M.length,L=!1,v.diffs.push(new T.Diff(w,M)),g.diffs.shift()):(M=M.substring(0,u-v.length1-this.Patch_Margin),v.length1+=M.length,a+=M.length,w===0?(v.length2+=M.length,c+=M.length):L=!1,v.diffs.push(new T.Diff(w,M)),M==g.diffs[0][1]?g.diffs.shift():g.diffs[0][1]=g.diffs[0][1].substring(M.length))}p=(p=this.diff_text2(v.diffs)).substring(p.length-this.Patch_Margin);var k=this.diff_text1(g.diffs).substring(0,this.Patch_Margin);k!==""&&(v.length1+=k.length,v.length2+=k.length,v.diffs.length!==0&&v.diffs[v.diffs.length-1][0]===0?v.diffs[v.diffs.length-1][1]+=k:v.diffs.push(new T.Diff(0,k))),L||d.splice(++l,0,v)}}},T.prototype.patch_toText=function(d){for(var u=[],l=0;l<d.length;l++)u[l]=d[l];return u.join("")},T.prototype.patch_fromText=function(d){var u=[];if(!d)return u;for(var l=d.split(`
- `),g=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;g<l.length;){var c=l[g].match(a);if(!c)throw new Error("Invalid patch string: "+l[g]);var p=new T.patch_obj;for(u.push(p),p.start1=parseInt(c[1],10),c[2]===""?(p.start1--,p.length1=1):c[2]=="0"?p.length1=0:(p.start1--,p.length1=parseInt(c[2],10)),p.start2=parseInt(c[3],10),c[4]===""?(p.start2--,p.length2=1):c[4]=="0"?p.length2=0:(p.start2--,p.length2=parseInt(c[4],10)),g++;g<l.length;){var v=l[g].charAt(0);try{var L=decodeURI(l[g].substring(1))}catch(w){throw new Error("Illegal escape in patch_fromText: "+L)}if(v=="-")p.diffs.push(new T.Diff(m,L));else if(v=="+")p.diffs.push(new T.Diff(1,L));else if(v==" ")p.diffs.push(new T.Diff(0,L));else{if(v=="@")break;if(v!=="")throw new Error('Invalid patch mode "'+v+'" in: '+L)}g++}}return u},(T.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var d,u=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
- `],l=0;l<this.diffs.length;l++){switch(this.diffs[l][0]){case 1:d="+";break;case m:d="-";break;case 0:d=" "}u[l+1]=d+encodeURI(this.diffs[l][1])+`
- `}return u.join("").replace(/%20/g," ")},j.exports=T,j.exports.diff_match_patch=T,j.exports.DIFF_DELETE=m,j.exports.DIFF_INSERT=1,j.exports.DIFF_EQUAL=0},872:(j,T,m)=>{m.d(T,{default:()=>ee});var d=m(478),u=m(156),l=m(314),g=m(730),a=m(66),c=m(218),p=m(702),v=function(x){x===void 0&&(x=document);var q=function(P){var D=document.createElement("img");D.src=P.getAttribute("data-src"),D.addEventListener("load",function(){P.getAttribute("style")||P.getAttribute("class")||P.getAttribute("width")||P.getAttribute("height")||D.naturalHeight>D.naturalWidth&&D.naturalWidth/D.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&D.naturalHeight>window.innerHeight-40&&(P.style.height=window.innerHeight-40+"px"),P.src=D.src}),P.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return x.querySelectorAll("img").forEach(function(P){P.getAttribute("data-src")&&q(P)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),x.querySelectorAll("img").forEach(function(P){window.vditorImageIntersectionObserver.observe(P)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(P){P.forEach(function(D){(D.isIntersecting===void 0?D.intersectionRatio!==0:D.isIntersecting)&&D.target.getAttribute("data-src")&&q(D.target)})}),x.querySelectorAll("img").forEach(function(P){window.vditorImageIntersectionObserver.observe(P)}))},L=m(466),w=m(554),M=m(40),k=m(563),S=m(749),f=m(818),N=m(408),O=m(54),F=m(227),Z=m(526),oe=m(827),ae=m(640),ve=m(895),pe=m(393),de=function(x,q){if(q===void 0&&(q="zh_CN"),typeof speechSynthesis!="undefined"&&typeof SpeechSynthesisUtterance!="undefined"){var P='<svg><use xlink:href="#vditor-icon-play"></use></svg>',D='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(P='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',D='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var U=document.querySelector(".vditor-speech");if(!U){(U=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",U);var se=function(){var Q,me;return speechSynthesis.getVoices().forEach(function(be){be.lang===q.replace("_","-")&&(Q=be),be.default&&(me=be)}),Q||(Q=me),Q};speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=se);var te=se();U.onclick=function(){if(U.className==="vditor-speech"){var Q=new SpeechSynthesisUtterance(U.getAttribute("data-text"));Q.voice=te,Q.onend=function(){U.className="vditor-speech",speechSynthesis.cancel(),U.innerHTML=P},speechSynthesis.speak(Q),U.className="vditor-speech vditor-speech--current",U.innerHTML=D}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),U.innerHTML=D):(speechSynthesis.pause(),U.innerHTML=P));(0,pe.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",function(){getSelection().toString().trim()===""&&U.style.display==="block"&&(U.className="vditor-speech",speechSynthesis.cancel(),U.style.display="none")})}x.addEventListener("mouseup",function(Q){var me=getSelection().toString().trim();if(speechSynthesis.cancel(),getSelection().toString().trim()!==""){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var be=getSelection().getRangeAt(0).getBoundingClientRect();U.innerHTML=P,U.style.display="block",U.style.top=be.top+be.height+document.querySelector("html").scrollTop-20+"px",U.style.left=Q.clientX+2+"px",U.setAttribute("data-text",me)}else U.style.display==="block"&&(U.className="vditor-speech",U.style.display="none")})}},he=function(x,q,P,D){return new(P||(P=Promise))(function(U,se){function te(be){try{me(D.next(be))}catch(ce){se(ce)}}function Q(be){try{me(D.throw(be))}catch(ce){se(ce)}}function me(be){var ce;be.done?U(be.value):(ce=be.value,ce instanceof P?ce:new P(function(Je){Je(ce)})).then(te,Q)}me((D=D.apply(x,q||[])).next())})},Te=function(x,q){var P,D,U,se,te={label:0,sent:function(){if(1&U[0])throw U[1];return U[1]},trys:[],ops:[]};return se={next:Q(0),throw:Q(1),return:Q(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Q(me){return function(be){return function(ce){if(P)throw new TypeError("Generator is already executing.");for(;te;)try{if(P=1,D&&(U=2&ce[0]?D.return:ce[0]?D.throw||((U=D.return)&&U.call(D),0):D.next)&&!(U=U.call(D,ce[1])).done)return U;switch(D=0,U&&(ce=[2&ce[0],U.value]),ce[0]){case 0:case 1:U=ce;break;case 4:return te.label++,{value:ce[1],done:!1};case 5:te.label++,D=ce[1],ce=[0];continue;case 7:ce=te.ops.pop(),te.trys.pop();continue;default:if(U=te.trys,!((U=U.length>0&&U[U.length-1])||ce[0]!==6&&ce[0]!==2)){te=0;continue}if(ce[0]===3&&(!U||ce[1]>U[0]&&ce[1]<U[3])){te.label=ce[1];break}if(ce[0]===6&&te.label<U[1]){te.label=U[1],U=ce;break}if(U&&te.label<U[2]){te.label=U[2],te.ops.push(ce);break}U[2]&&te.ops.pop(),te.trys.pop();continue}ce=q.call(x,te)}catch(Je){ce=[6,Je],D=0}finally{P=U=0}if(5&ce[0])throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}([me,be])}}},Le=function(x){var q={anchor:0,cdn:O.g.CDN,customEmoji:{},emojiPath:(x&&x.emojiPath||O.g.CDN)+"/dist/images/emoji",hljs:O.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:O.g.MARKDOWN_OPTIONS,math:O.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:O.g.THEME_OPTIONS};return(0,ae.T)(q,x)},Ie=function(x,q){var P=Le(q);return(0,Z.G)(P.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var D=(0,ve.X)({autoSpace:P.markdown.autoSpace,gfmAutoLink:P.markdown.gfmAutoLink,codeBlockPreview:P.markdown.codeBlockPreview,emojiSite:P.emojiPath,emojis:P.customEmoji,fixTermTypo:P.markdown.fixTermTypo,footnotes:P.markdown.footnotes,headingAnchor:P.anchor!==0,inlineMathDigit:P.math.inlineDigit,lazyLoadImage:P.lazyLoadImage,linkBase:P.markdown.linkBase,linkPrefix:P.markdown.linkPrefix,listStyle:P.markdown.listStyle,mark:P.markdown.mark,mathBlockPreview:P.markdown.mathBlockPreview,paragraphBeginningSpace:P.markdown.paragraphBeginningSpace,sanitize:P.markdown.sanitize,toc:P.markdown.toc});return q!=null&&q.renderers&&D.SetJSRenderers({renderers:{Md2HTML:q.renderers}}),D.SetHeadingID(!0),D.Md2HTML(x)})},ye=function(x,q,P){return he(void 0,void 0,void 0,function(){var D,U,se;return Te(this,function(te){switch(te.label){case 0:return D=Le(P),[4,Ie(q,D)];case 1:if(U=te.sent(),D.transform&&(U=D.transform(U)),x.innerHTML=U,x.classList.add("vditor-reset"),D.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(D.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return se="vditorI18nScript"+D.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(me){me.id!==se&&document.head.removeChild(me)}),[4,(0,Z.G)(D.cdn+"/dist/js/i18n/"+D.lang+".js",se)];case 3:te.sent(),te.label=4;case 4:return[3,6];case 5:window.VditorI18n=D.i18n,te.label=6;case 6:return D.icon?[4,(0,Z.G)(D.cdn+"/dist/js/icons/"+D.icon+".js","vditorIconScript")]:[3,8];case 7:te.sent(),te.label=8;case 8:return(0,F.Z)(D.theme.current,D.theme.path),D.anchor===1&&x.classList.add("vditor-reset--anchor"),(0,g.O)(x),(0,p.s)(D.hljs,x,D.cdn),(0,L.H)(x,{cdn:D.cdn,math:D.math}),(0,M.i)(x,D.cdn,D.mode),(0,k.K)(x,D.cdn,D.mode),(0,a.P)(x,D.cdn),(0,c.v)(x,D.cdn),(0,l.p)(x,D.cdn,D.mode),(0,S.P)(x,D.cdn,D.mode),(0,N.B)(x,D.cdn),(0,d.Q)(x,D.cdn),(0,w.Y)(x),D.speech.enable&&de(x),D.anchor!==0&&(Q=D.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(me){Q===1&&me.classList.add("vditor-anchor--left"),me.onclick=function(){var be=me.getAttribute("href").substr(1),ce=document.getElementById("vditorAnchor-"+be).offsetTop;document.querySelector("html").scrollTop=ce}}),window.onhashchange=function(){var me=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));me&&(document.querySelector("html").scrollTop=me.offsetTop)}),D.after&&D.after(),D.lazyLoadImage&&v(x),x.addEventListener("click",function(me){var be=(0,oe.lG)(me.target,"SPAN");if(be&&(0,oe.fb)(be,"vditor-toc")){var ce=x.querySelector("#"+be.getAttribute("data-target-id"));ce&&window.scrollTo(window.scrollX,ce.offsetTop)}}),[2]}var Q})})},C=m(863),ge=m(312);const ee=function(){function x(){}return x.adapterRender=u,x.previewImage=C.E,x.codeRender=g.O,x.graphvizRender=c.v,x.highlightRender=p.s,x.mathRender=L.H,x.mermaidRender=M.i,x.markmapRender=k.K,x.flowchartRender=a.P,x.chartRender=l.p,x.abcRender=d.Q,x.mindmapRender=S.P,x.plantumlRender=N.B,x.outlineRender=f.k,x.mediaRender=w.Y,x.speechRender=de,x.lazyLoadImageRender=v,x.md2html=Ie,x.preview=ye,x.setCodeTheme=ge.Y,x.setContentTheme=F.Z,x}()},54:(j,T,m)=>{m.d(T,{H:()=>d,g:()=>u});var d="3.9.4",u=function(){function l(){}return l.ZWSP="",l.DROP_EDITOR="application/editor",l.MOBILE_WIDTH=520,l.CLASS_MENU_DISABLED="vditor-menu--disabled",l.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"],l.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],l.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],l.CDN="https://unpkg.com/vditor@3.9.4",l.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},l.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},l.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},l.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:l.CDN+"/dist/css/content-theme"},l}()},478:(j,T,m)=>{m.d(T,{Q:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.abcRenderAdapter.getElements(a);p.length>0&&(0,u.G)(c+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){p.forEach(function(v){v.parentElement.classList.contains("vditor-wysiwyg__pre")||v.parentElement.classList.contains("vditor-ir__marker--pre")||v.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(v,l.abcRenderAdapter.getCode(v).trim()),v.style.overflowX="auto",v.setAttribute("data-processed","true"))})})}},156:(j,T,m)=>{m.r(T),m.d(T,{mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,markmapRenderAdapter:()=>l,mindmapRenderAdapter:()=>g,chartRenderAdapter:()=>a,abcRenderAdapter:()=>c,graphvizRenderAdapter:()=>p,flowchartRenderAdapter:()=>v,plantumlRenderAdapter:()=>L});var d={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-math")}},u={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-mermaid")}},l={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-markmap")}},g={getCode:function(w){return w.getAttribute("data-code")},getElements:function(w){return w.querySelectorAll(".language-mindmap")}},a={getCode:function(w){return w.innerText},getElements:function(w){return w.querySelectorAll(".language-echarts")}},c={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-abc")}},p={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-graphviz")}},v={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-flowchart")}},L={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-plantuml")}}},314:(j,T,m)=>{m.d(T,{p:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.chartRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.chartRenderAdapter.getCode(L).trim();if(w)try{if(L.getAttribute("data-processed")==="true")return;var M=JSON.parse(w);echarts.init(L,p==="dark"?"dark":void 0).setOption(M),L.setAttribute("data-processed","true")}catch(k){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+k}}})})}},730:(j,T,m)=>{m.d(T,{O:()=>l});var d=m(51),u=m(54),l=function(g){g.querySelectorAll("pre > code").forEach(function(a,c){var p,v,L;if(!a.parentElement.classList.contains("vditor-wysiwyg__pre")&&!a.parentElement.classList.contains("vditor-ir__marker--pre")&&!(a.classList.contains("language-mermaid")||a.classList.contains("language-flowchart")||a.classList.contains("language-echarts")||a.classList.contains("language-mindmap")||a.classList.contains("language-plantuml")||a.classList.contains("language-markmap")||a.classList.contains("language-abc")||a.classList.contains("language-graphviz")||a.classList.contains("language-math")||a.style.maxHeight.indexOf("px")>-1||g.classList.contains("vditor-preview")&&c>5)){var w=a.innerText;if(a.classList.contains("highlight-chroma")){var M=document.createElement("code");M.innerHTML=a.innerHTML,M.querySelectorAll(".highlight-ln").forEach(function(N){N.remove()}),w=M.innerText}else w.endsWith(`
- `)&&(w=w.substr(0,w.length-1));var k='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(k='<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="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"复制")+`"
- onmouseover="this.setAttribute('aria-label', '`+(((v=window.VditorI18n)===null||v===void 0?void 0:v.copy)||"复制")+`')"
- class="vditor-tooltipped vditor-tooltipped__w"
- onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"已复制")+`')">`+k+"</span>";var f=document.createElement("textarea");f.value=(0,d.X)(w),S.insertAdjacentElement("afterbegin",f),a.before(S),a.style.maxHeight=window.outerHeight-40+"px",a.insertAdjacentHTML("afterend",'<span style="position: absolute">'+u.g.ZWSP+"</span>")}})}},66:(j,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.flowchartRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){p.forEach(function(v){if(v.getAttribute("data-processed")!=="true"){var L=flowchart.parse(l.flowchartRenderAdapter.getCode(v));v.innerHTML="",L.drawSVG(v),v.setAttribute("data-processed","true")}})})}},218:(j,T,m)=>{m.d(T,{v:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.graphvizRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){p.forEach(function(v){var L=l.graphvizRenderAdapter.getCode(v);if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")&&v.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var w=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),M=(window.URL||window.webkitURL).createObjectURL(w),k=new Worker(M);new Viz({worker:k}).renderSVGElement(L).then(function(S){v.innerHTML=S.outerHTML}).catch(function(S){v.innerHTML="graphviz render error: <br>"+S,v.className="vditor-reset--error"})}catch(S){console.error("graphviz error",S)}v.setAttribute("data-processed","true")}})})}},702:(j,T,m)=>{m.d(T,{s:()=>g});var d=m(54),u=m(526),l=m(578),g=function(a,c,p){c===void 0&&(c=document),p===void 0&&(p=d.g.CDN);var v=a.style;d.g.CODE_THEME.includes(v)||(v="github");var L=document.getElementById("vditorHljsStyle"),w=p+"/dist/js/highlight.js/styles/"+v+".css";L&&L.href!==w&&L.remove(),(0,l.c)(p+"/dist/js/highlight.js/styles/"+v+".css","vditorHljsStyle"),a.enable!==!1&&c.querySelectorAll("pre > code").length!==0&&(0,u.G)(p+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){c.querySelectorAll("pre > code").forEach(function(M){if(!M.parentElement.classList.contains("vditor-ir__marker--pre")&&!M.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(M.classList.contains("language-mermaid")||M.classList.contains("language-flowchart")||M.classList.contains("language-echarts")||M.classList.contains("language-mindmap")||M.classList.contains("language-plantuml")||M.classList.contains("language-abc")||M.classList.contains("language-graphviz")||M.classList.contains("language-math"))&&(a.defaultLang!==""&&M.className.indexOf("language-")===-1&&M.classList.add("language-"+a.defaultLang),hljs.highlightElement(M),a.lineNumber)){M.classList.add("vditor-linenumber");var k=M.querySelector(".vditor-linenumber__temp");k||((k=document.createElement("div")).className="vditor-linenumber__temp",M.insertAdjacentElement("beforeend",k));var S=getComputedStyle(M).whiteSpace,f=!1;S!=="pre-wrap"&&S!=="pre-line"||(f=!0);var N="",O=M.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(F){var Z="";f&&(k.textContent=F||`
- `,Z=' style="height:'+k.getBoundingClientRect().height+'px"'),N+="<span"+Z+"></span>"}),k.style.display="none",N='<span class="vditor-linenumber__rows">'+N+"</span>",M.insertAdjacentHTML("beforeend",N)}})})})})}},563:(j,T,m)=>{m.d(T,{K:()=>c});var d=m(54),u=m(526),l=m(156),g={},a=function(p,v){var L=window.markmap,w=L.Transformer,M=L.Markmap,k=L.deriveOptions,S=(L.globalCSS,new w);p.innerHTML='<svg style="width:100%"></svg>';var f=p.firstChild,N=M.create(f,null),O=function(ae,ve){var pe=ae.transform(ve),de=Object.keys(pe.features).filter(function(ye){return!g[ye]});de.forEach(function(ye){g[ye]=!0});var he=ae.getAssets(de),Te=he.styles,Le=he.scripts,Ie=window.markmap;return Te&&Ie.loadCSS(Te),Le&&Ie.loadJS(Le),pe}(S,v),F=O.root,Z=O.frontmatter,oe=k(Z==null?void 0:Z.markmap);N.setData(F,oe),N.fit()},c=function(p,v,L){v===void 0&&(v=d.g.CDN);var w=l.markmapRenderAdapter.getElements(p);w.length!==0&&(0,u.G)(v+"/src/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){w.forEach(function(M){var k=l.markmapRenderAdapter.getCode(M);if(M.getAttribute("data-processed")!=="true"&&k.trim()!==""){var S=document.createElement("div");S.className="language-markmap",M.parentNode.appendChild(S),a(S,k),M.parentNode.childNodes[0].nodeName=="CODE"&&M.parentNode.removeChild(M.parentNode.childNodes[0])}})})}},466:(j,T,m)=>{m.d(T,{H:()=>c});var d=m(54),u=m(526),l=m(578),g=m(51),a=m(156),c=function(p,v){var L=a.mathRenderAdapter.getElements(p);if(L.length!==0){var w={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(v&&v.math&&(v.math=Object.assign({},w.math,v.math)),(v=Object.assign({},w,v)).math.engine==="KaTeX")(0,l.c)(v.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,u.G)(v.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then(function(){(0,u.G)(v.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then(function(){L.forEach(function(k){if(!k.parentElement.classList.contains("vditor-wysiwyg__pre")&&!k.parentElement.classList.contains("vditor-ir__marker--pre")&&!k.getAttribute("data-math")){var S=(0,g.X)(a.mathRenderAdapter.getCode(k));k.setAttribute("data-math",S);try{k.innerHTML=katex.renderToString(S,{displayMode:k.tagName==="DIV",output:"html"})}catch(f){k.innerHTML=f.message,k.className="language-math vditor-reset--error"}k.addEventListener("copy",function(f){f.stopPropagation(),f.preventDefault();var N=f.currentTarget.closest(".language-math");f.clipboardData.setData("text/html",N.innerHTML),f.clipboardData.setData("text/plain",N.getAttribute("data-math"))})}})})});else if(v.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:v.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:v.math.macros}}),(0,u.J)(v.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var M=function(k,S){var f=(0,g.X)(k.textContent).trim(),N=window.MathJax.getMetricsFor(k);N.display=k.tagName==="DIV",window.MathJax.tex2svgPromise(f,N).then(function(O){k.innerHTML="",k.setAttribute("data-math",f),k.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var F=O.querySelector('[data-mml-node="merror"]');F&&F.textContent.trim()!==""&&(k.innerHTML=F.textContent.trim(),k.className="vditor-reset--error"),S&&S()})};window.MathJax.startup.promise.then(function(){for(var k=[],S=function(N){var O=L[N];O.parentElement.classList.contains("vditor-wysiwyg__pre")||O.parentElement.classList.contains("vditor-ir__marker--pre")||O.getAttribute("data-math")||!(0,g.X)(O.textContent).trim()||k.push(function(F){N===L.length-1?M(O):M(O,F)})},f=0;f<L.length;f++)S(f);(function(N){if(N.length!==0){var O=0,F=N[N.length-1],Z=function(){var oe=N[O++];oe===F?oe():oe(Z)};Z()}})(k)})}}}},554:(j,T,m)=>{m.d(T,{Y:()=>d});var d=function(u){u&&u.querySelectorAll("a").forEach(function(l){var g=l.getAttribute("href");g&&(g.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<video controls="controls" src="'+c+'"></video>'),a.remove()}(l,g):g.match(/^.+.(mp3|wav|flac)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+c+'"></audio>'),a.remove()}(l,g):function(a,c){var p=c.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),v=c.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),L=c.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),w=c.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),M=c.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=c.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),S=c.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),f=c.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);p&&p[1].length===11?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+p[1]+(p[2]?"?start="+p[2]:"")+'"></iframe>'),a.remove()):v&&v[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+v[1]+'"></iframe>'),a.remove()):L&&L[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+L[1]+'"></iframe>'),a.remove()):w&&w[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="//coub.com/embed/`+w[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),a.remove()):M&&M[0]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(M[0])+'"></iframe>'),a.remove()):k&&k[2]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),a.remove()):S&&S[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="//player.bilibili.com/player.html?bvid=`+S[1]+'"></iframe>'),a.remove()):f&&f[1]&&(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+f[1]+'"></iframe>'),a.remove())}(l,g))})}},40:(j,T,m)=>{m.d(T,{i:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){c===void 0&&(c=d.g.CDN);var v=l.mermaidRenderAdapter.getElements(a);v.length!==0&&(0,u.G)(c+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var L={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8},gantt:{leftPadding:75,rightPadding:20}};p==="dark"&&(L.theme="dark"),mermaid.initialize(L),v.forEach(function(w){var M=l.mermaidRenderAdapter.getCode(w);w.getAttribute("data-processed")!=="true"&&M.trim()!==""&&(mermaid.init(void 0,w),w.setAttribute("data-processed","true"))})})}},749:(j,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.mindmapRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.mindmapRenderAdapter.getCode(L);if(w)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(w))],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(M,k){var S;return!((S=k==null?void 0:k.data)===null||S===void 0)&&S.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(M){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+M}}})})}},818:(j,T,m)=>{m.d(T,{k:()=>l});var d=m(64),u=m(466),l=function(g,a,c){var p="",v=[];if(Array.from(g.children).forEach(function(k,S){if((0,d.W)(k)){if(c){var f=k.id.lastIndexOf("_");k.id=k.id.substring(0,f===-1?void 0:f)+"_"+S}v.push(k.id),p+=k.outerHTML.replace("<wbr>","")}}),p==="")return a.innerHTML="","";var L=document.createElement("div");if(c)c.lute.SetToC(!0),c.currentMode!=="wysiwyg"||c.preview.element.contains(g)?c.currentMode!=="ir"||c.preview.element.contains(g)?L.innerHTML=c.lute.HTML2VditorDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorIRDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorDOM("<p>[ToC]</p>"+p),c.lute.SetToC(c.options.preview.markdown.toc);else{a.classList.add("vditor-outline");var w=Lute.New();w.SetToC(!0),L.innerHTML=w.HTML2VditorDOM("<p>[ToC]</p>"+p)}var M=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return M.forEach(function(k,S){if(k.nextElementSibling&&k.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>'),k.innerHTML=f+"<span>"+k.innerHTML+"</span>"}else k.innerHTML="<svg></svg><span>"+k.innerHTML+"</span>";k.setAttribute("data-target-id",v[S])}),p=L.firstElementChild.innerHTML,M.length===0?(a.innerHTML="",p):(a.innerHTML=p,c&&(0,u.H)(a,{cdn:c.options.cdn,math:c.options.preview.math}),a.firstElementChild.addEventListener("click",function(k){for(var S=k.target;S&&!S.isEqualNode(a);){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")),k.preventDefault(),k.stopPropagation();break}if(S.getAttribute("data-target-id")){k.preventDefault(),k.stopPropagation();var f=document.getElementById(S.getAttribute("data-target-id"));if(!f)return;if(c)if(c.options.height==="auto"){var N=f.offsetTop+c.element.offsetTop;c.options.toolbarConfig.pin||(N+=c.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,N)}else c.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,c.element.offsetTop),c.preview.element.contains(g)?g.parentElement.scrollTop=f.offsetTop:g.scrollTop=f.offsetTop;else window.scrollTo(window.scrollX,f.offsetTop);break}S=S.parentElement}}),p)}},408:(j,T,m)=>{m.d(T,{B:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.plantumlRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){p.forEach(function(v){if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")){var L=l.plantumlRenderAdapter.getCode(v).trim();if(L)try{v.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'">'}catch(w){v.className="vditor-reset--error",v.innerHTML="plantuml render error: <br>"+w}}})})}},895:(j,T,m)=>{m.d(T,{X:()=>d});var d=function(u){var l=Lute.New();return l.PutEmojis(u.emojis),l.SetEmojiSite(u.emojiSite),l.SetHeadingAnchor(u.headingAnchor),l.SetInlineMathAllowDigitAfterOpenMarker(u.inlineMathDigit),l.SetAutoSpace(u.autoSpace),l.SetToC(u.toc),l.SetFootnotes(u.footnotes),l.SetFixTermTypo(u.fixTermTypo),l.SetVditorCodeBlockPreview(u.codeBlockPreview),l.SetVditorMathBlockPreview(u.mathBlockPreview),l.SetSanitize(u.sanitize),l.SetChineseParagraphBeginningSpace(u.paragraphBeginningSpace),l.SetRenderListStyle(u.listStyle),l.SetLinkBase(u.linkBase),l.SetLinkPrefix(u.linkPrefix),l.SetMark(u.mark),l.SetGFMAutoLink(u.gfmAutoLink),u.lazyLoadImage&&l.SetImageLazyLoading(u.lazyLoadImage),l}},863:(j,T,m)=>{m.d(T,{E:()=>d});var d=function(u,l,g){g===void 0&&(g="classic");var a=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(g==="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>
- `+window.VditorI18n.spin+`
- </span>
- <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
- X `+window.VditorI18n.close+`
- </span>
- </div>
- <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
- <img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+a.left+"px, "+(a.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
- </div>
- </div>`),document.body.style.overflow="hidden";var c=document.querySelector(".vditor-img img"),p="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-u.naturalHeight)/2+"px, 0)";setTimeout(function(){c.setAttribute("style","transition: transform .3s ease-in-out;transform: "+p),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)});var v=document.querySelector(".vditor-img__btn");v.addEventListener("click",function(){var L=parseInt(v.getAttribute("data-deg"),10)+90;L/90%2==1&&u.naturalWidth>c.parentElement.clientHeight?c.style.transform="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+(u.naturalWidth/2-u.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":c.style.transform=p+" rotateZ("+L+"deg)",v.setAttribute("data-deg",L.toString()),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)})}},312:(j,T,m)=>{m.d(T,{Y:()=>l});var d=m(54),u=m(578),l=function(g,a){a===void 0&&(a=d.g.CDN),d.g.CODE_THEME.includes(g)||(g="github");var c=document.getElementById("vditorHljsStyle"),p=a+"/dist/js/highlight.js/styles/"+g+".css";c?c.href!==p&&(c.remove(),(0,u.c)(p,"vditorHljsStyle")):(0,u.c)(p,"vditorHljsStyle")}},227:(j,T,m)=>{m.d(T,{Z:()=>u});var d=m(578),u=function(l,g){if(l&&g){var a=document.getElementById("vditorContentTheme"),c=g+"/"+l+".css";a?a.getAttribute("href")!==c&&(a.remove(),(0,d.c)(c,"vditorContentTheme")):(0,d.c)(c,"vditorContentTheme")}}},526:(j,T,m)=>{m.d(T,{J:()=>d,G:()=>u});var d=function(l,g){if(document.getElementById(g))return!1;var a=new XMLHttpRequest;a.open("GET",l,!1),a.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),a.send("");var c=document.createElement("script");c.type="text/javascript",c.text=a.responseText,c.id=g,document.head.appendChild(c)},u=function(l,g){return new Promise(function(a,c){if(document.getElementById(g))return a(),!1;var p=document.createElement("script");p.src=l,p.async=!0,document.head.appendChild(p),p.onload=function(){if(document.getElementById(g))return p.remove(),a(),!1;p.id=g,a()}})}},578:(j,T,m)=>{m.d(T,{c:()=>d});var d=function(u,l){if(!document.getElementById(l)){var g=document.createElement("link");g.id=l,g.rel="stylesheet",g.type="text/css",g.href=u,document.getElementsByTagName("head")[0].appendChild(g)}}},51:(j,T,m)=>{m.d(T,{X:()=>d});var d=function(u){return u.replace(/\u00a0/g," ")}},794:(j,T,m)=>{m.d(T,{G6:()=>d,vU:()=>u,pK:()=>l,Le:()=>g,yl:()=>a,ns:()=>c,i7:()=>p});var d=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},u=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},l=function(){try{return typeof localStorage!="undefined"}catch(v){return!1}},g=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},a=function(v){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!v.metaKey||v.ctrlKey):!(v.metaKey||!v.ctrlKey)},c=function(v){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?v.indexOf("⇧")>-1&&u()&&(v=v.replace(";",":").replace("=","+").replace("-","_")):(v=(v=v.startsWith("⌘")?v.replace("⌘","⌘+"):v.startsWith("⌥")&&v.substr(1,1)!=="⌘"?v.replace("⌥","⌥+"):v.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(v=v.replace(";",":").replace("=","+").replace("-","_")),v},p=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},827:(j,T,m)=>{m.d(T,{JQ:()=>u,E2:()=>l,O9:()=>g,a1:()=>a,F9:()=>c,lG:()=>p,fb:()=>v,DX:()=>L});var d=m(64),u=function(w,M){for(var k=v(w,M),S=!1,f=!1;k&&!k.classList.contains("vditor-reset")&&!f;)(S=v(k.parentElement,M))?k=S:f=!0;return k||!1},l=function(w,M){for(var k=(0,d.S)(w,M),S=!1,f=!1;k&&!k.classList.contains("vditor-reset")&&!f;)(S=(0,d.S)(k.parentElement,M))?k=S:f=!0;return k||!1},g=function(w){var M=l(w,"UL"),k=l(w,"OL"),S=M;return k&&(!M||M&&k.contains(M))&&(S=k),S},a=function(w,M,k){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);for(var S=w,f=!1;S&&!f&&!S.classList.contains("vditor-reset");)S.getAttribute(M)===k?f=!0:S=S.parentElement;return f&&S},c=function(w){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);var M=w,k=!1,S=a(w,"data-block","0");if(S)return S;for(;M&&!k&&!M.classList.contains("vditor-reset");)M.tagName==="H1"||M.tagName==="H2"||M.tagName==="H3"||M.tagName==="H4"||M.tagName==="H5"||M.tagName==="H6"||M.tagName==="P"||M.tagName==="BLOCKQUOTE"||M.tagName==="OL"||M.tagName==="UL"?k=!0:M=M.parentElement;return k&&M},p=function(w,M){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);for(var k=w,S=!1;k&&!S&&!k.classList.contains("vditor-reset");)k.nodeName===M?S=!0:k=k.parentElement;return S&&k},v=function(w,M){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);for(var k=w,S=!1;k&&!S&&!k.classList.contains("vditor-reset");)k.classList.contains(M)?S=!0:k=k.parentElement;return S&&k},L=function(w){for(;w&&w.lastChild;)w=w.lastChild;return w}},64:(j,T,m)=>{m.d(T,{S:()=>d,W:()=>u});var d=function(l,g){if(!l)return!1;l.nodeType===3&&(l=l.parentElement);for(var a=l,c=!1;a&&!c&&!a.classList.contains("vditor-reset");)a.nodeName.indexOf(g)===0?c=!0:a=a.parentElement;return c&&a},u=function(l){var g=d(l,"H");return!(!g||g.tagName.length!==2||g.tagName==="HR")&&g}},640:(j,T,m)=>{m.d(T,{T:()=>d});var d=function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];for(var g={},a=function(p){for(var v in p)p.hasOwnProperty(v)&&(Object.prototype.toString.call(p[v])==="[object Object]"?g[v]=d(g[v],p[v]):g[v]=p[v])},c=0;c<u.length;c++)a(u[c]);return g}},393:(j,T,m)=>{m.d(T,{zh:()=>g,Ny:()=>a,Gb:()=>c,Hc:()=>p,im:()=>v,$j:()=>L,ib:()=>w,oC:()=>M});var d=m(54),u=m(794),l=m(827),g=function(k){var S,f=k[k.currentMode].element;return getSelection().rangeCount>0&&(S=getSelection().getRangeAt(0),f.isEqualNode(S.startContainer)||f.contains(S.startContainer))?S:k[k.currentMode].range?k[k.currentMode].range:(f.focus(),(S=f.ownerDocument.createRange()).setStart(f,0),S.collapse(!0),S)},a=function(k){var S=window.getSelection().getRangeAt(0);if(!k.contains(S.startContainer)&&!(0,l.fb)(S.startContainer,"vditor-panel--none"))return{left:0,top:0};var f,N=k.parentElement.getBoundingClientRect();if(S.getClientRects().length===0)if(S.startContainer.nodeType===3){var O=S.startContainer.parentElement;if(!(O&&O.getClientRects().length>0))return{left:0,top:0};f=O.getClientRects()[0]}else{var F=S.startContainer.children;if(F[S.startOffset]&&F[S.startOffset].getClientRects().length>0)f=F[S.startOffset].getClientRects()[0];else if(S.startContainer.childNodes.length>0){var Z=S.cloneRange();S.selectNode(S.startContainer.childNodes[Math.max(0,S.startOffset-1)]),f=S.getClientRects()[0],S.setEnd(Z.endContainer,Z.endOffset),S.setStart(Z.startContainer,Z.startOffset)}else f=S.startContainer.getClientRects()[0];if(!f){for(var oe=S.startContainer.childNodes[S.startOffset];!oe.getClientRects||oe.getClientRects&&oe.getClientRects().length===0;)oe=oe.parentElement;f=oe.getClientRects()[0]}}else f=S.getClientRects()[0];return{left:f.left-N.left,top:f.top-N.top}},c=function(k,S){if(!S){if(getSelection().rangeCount===0)return!1;S=getSelection().getRangeAt(0)}var f=S.commonAncestorContainer;return k.isEqualNode(f)||k.contains(f)},p=function(k){var S=window.getSelection();S.removeAllRanges(),S.addRange(k)},v=function(k,S,f){var N={end:0,start:0};if(!f){if(getSelection().rangeCount===0)return N;f=window.getSelection().getRangeAt(0)}if(c(S,f)){var O=f.cloneRange();k.childNodes[0]&&k.childNodes[0].childNodes[0]?O.setStart(k.childNodes[0].childNodes[0],0):O.selectNodeContents(k),O.setEnd(f.startContainer,f.startOffset),N.start=O.toString().length,N.end=N.start+f.toString().length}return N},L=function(k,S,f){var N=0,O=0,F=f.childNodes[O],Z=!1,oe=!1;k=Math.max(0,k),S=Math.max(0,S);var ae=f.ownerDocument.createRange();for(ae.setStart(F||f,0),ae.collapse(!0);!oe&&F;){var ve=N+F.textContent.length;if(!Z&&k>=N&&k<=ve&&(k===0?ae.setStart(F,0):F.childNodes[0].nodeType===3?ae.setStart(F.childNodes[0],k-N):F.nextSibling?ae.setStartBefore(F.nextSibling):ae.setStartAfter(F),Z=!0,k===S)){oe=!0;break}Z&&S>=N&&S<=ve&&(S===0?ae.setEnd(F,0):F.childNodes[0].nodeType===3?ae.setEnd(F.childNodes[0],S-N):F.nextSibling?ae.setEndBefore(F.nextSibling):ae.setEndAfter(F),oe=!0),N=ve,F=f.childNodes[++O]}return!oe&&f.childNodes[O-1]&&ae.setStartBefore(f.childNodes[O-1]),p(ae),ae},w=function(k,S){var f=k.querySelector("wbr");if(f){if(f.previousElementSibling)if(f.previousElementSibling.isSameNode(f.previousSibling)){if(f.previousElementSibling.lastChild)return S.setStartBefore(f),S.collapse(!0),p(S),!(0,u.i7)()||f.previousElementSibling.tagName!=="EM"&&f.previousElementSibling.tagName!=="STRONG"&&f.previousElementSibling.tagName!=="S"||(S.insertNode(document.createTextNode(d.g.ZWSP)),S.collapse(!1)),void f.remove();S.setStartAfter(f.previousElementSibling)}else S.setStart(f.previousSibling,f.previousSibling.textContent.length);else f.previousSibling?S.setStart(f.previousSibling,f.previousSibling.textContent.length):f.nextSibling?f.nextSibling.nodeType===3?S.setStart(f.nextSibling,0):S.setStartBefore(f.nextSibling):S.setStart(f.parentElement,0);S.collapse(!0),f.remove(),p(S)}},M=function(k,S){var f=document.createElement("div");f.innerHTML=k;var N=f.querySelectorAll("p");N.length===1&&!N[0].previousSibling&&!N[0].nextSibling&&S[S.currentMode].element.children.length>0&&f.firstElementChild.tagName==="P"&&(k=N[0].innerHTML.trim());var O=document.createElement("div");O.innerHTML=k;var F=g(S);if(F.toString()!==""&&(S[S.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),O.firstElementChild&&O.firstElementChild.getAttribute("data-block")==="0"){O.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var Z=(0,l.F9)(F.startContainer);Z?Z.insertAdjacentHTML("afterend",O.innerHTML):S[S.currentMode].element.insertAdjacentHTML("beforeend",O.innerHTML),w(S[S.currentMode].element,F)}else{var oe=document.createElement("template");oe.innerHTML=k,F.insertNode(oe.content.cloneNode(!0)),F.collapse(!1),p(F)}}}},Ae={};function W(j){var T=Ae[j];if(T!==void 0)return T.exports;var m=Ae[j]={exports:{}};return fe[j](m,m.exports,W),m.exports}W.d=(j,T)=>{for(var m in T)W.o(T,m)&&!W.o(j,m)&&Object.defineProperty(j,m,{enumerable:!0,get:T[m]})},W.o=(j,T)=>Object.prototype.hasOwnProperty.call(j,T),W.r=j=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})};var xe={};return(()=>{W.d(xe,{default:()=>Ei});var j,T=W(872),m=W(54),d=W(51),u=function(e){return e.currentMode==="sv"?(0,d.X)((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):""},l=W(526),g=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,l.G)(t.options.cdn+"/dist/js/echarts/echarts.min.js","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(u(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(i){n.element.lastElementChild.style.display="none",n.element.firstElementChild.innerHTML=i}})},e}(),a=W(794),c=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains("vditor-menu--current")&&i.classList.remove("vditor-menu--current")}})},p=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains("vditor-menu--current")&&i.classList.add("vditor-menu--current")}})},v=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains(m.g.CLASS_MENU_DISABLED)&&i.classList.remove(m.g.CLASS_MENU_DISABLED)}})},L=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains(m.g.CLASS_MENU_DISABLED)&&i.classList.add(m.g.CLASS_MENU_DISABLED)}})},w=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="none")})},M=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="block")})},k=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(i){n&&i.isEqualNode(n)||(i.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")},S=function(e,t,n,i){n.addEventListener((0,a.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(m.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(o){o.classList.remove("vditor-hint--current")}),t.style.display==="block"?t.style.display="none":(k(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")))})},f=W(827),N=W(64),O=function(e,t,n,i){i&&console.log(e+" - "+n+": "+t)},F=W(478),Z=W(314),oe=W(730),ae=W(66),ve=W(218),pe=W(702),de=W(466),he=W(40),Te=W(563),Le=W(749),Ie=W(408),ye=function(e,t){if(e)if(e.parentElement.getAttribute("data-type")!=="html-block"){var n=e.firstElementChild.className.replace("language-","");n==="abc"?(0,F.Q)(e,t.options.cdn):n==="mermaid"?(0,he.i)(e,t.options.cdn,t.options.theme):n==="markmap"?(0,Te.K)(e,t.options.cdn,t.options.theme):n==="flowchart"?(0,ae.P)(e,t.options.cdn):n==="echarts"?(0,Z.p)(e,t.options.cdn,t.options.theme):n==="mindmap"?(0,Le.P)(e,t.options.cdn,t.options.theme):n==="plantuml"?(0,Ie.B)(e,t.options.cdn):n==="graphviz"?(0,ve.v)(e,t.options.cdn):n==="math"?(0,de.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):((0,pe.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,oe.O)(e)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},C=W(393),ge=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(i){i.innerHTML=n,(0,de.H)(i,{cdn:e.options.cdn,math:e.options.preview.math})})}},ee=function(e,t){var n=(0,f.lG)(e.target,"SPAN");if(n&&(0,f.fb)(n,"vditor-toc")){var i=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(i)if(t.options.height==="auto"){var r=i.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(r+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,r)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=i.offsetTop}},x=function(e,t,n,i){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if(n.key==="Backspace"&&(0,C.im)(e,t[t.currentMode].element,i).start===0)return e.previousElementSibling.remove(),ue(t),!0;if(rt(t,n,i,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if(n.key==="Delete"&&(0,C.im)(e,t[t.currentMode].element,i).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),ue(t),!0;if(pt(t,n,i,e,e.nextElementSibling))return!0}if(n.key==="Backspace"||n.key==="Delete"){var r=(0,f.fb)(i.startContainer,"vditor-toc");if(r)return r.remove(),ue(t),!0}},q=function(e,t,n,i){n===void 0&&(n=!1);var r=(0,f.F9)(t.startContainer);if(r&&!n&&r.getAttribute("data-type")!=="code-block"){if(qt(r.innerHTML)&&r.previousElementSibling||Vt(r.innerHTML))return;for(var o=(0,C.im)(r,e.ir.element,t).start,s=!0,h=o-1;h>r.textContent.substr(0,o).lastIndexOf(`
- `);h--)if(r.textContent.charAt(h)!==" "&&r.textContent.charAt(h)!==" "){s=!1;break}o===0&&(s=!1);var E=!0;for(h=o-1;h<r.textContent.length;h++)if(r.textContent.charAt(h)!==" "&&r.textContent.charAt(h)!==`
- `){E=!1;break}if(s)return void(typeof e.options.input=="function"&&e.options.input(u(e)));if(E&&!(0,f.fb)(t.startContainer,"vditor-ir__marker")){var b=t.startContainer.previousSibling;return b&&b.nodeType!==3&&b.classList.contains("vditor-ir__node--expand")&&b.classList.remove("vditor-ir__node--expand"),void(typeof e.options.input=="function"&&e.options.input(u(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(Y){Y.classList.remove("vditor-ir__node--expand")}),r||(r=e.ir.element),!r.querySelector("wbr")){var y=(0,f.fb)(t.startContainer,"vditor-ir__preview");y?y.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}r.querySelectorAll("[style]").forEach(function(Y){Y.removeAttribute("style")}),r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.ir.element);var A,R=r.isEqualNode(e.ir.element),B=(0,f.a1)(r,"data-type","footnotes-block"),_="";if(R)_=r.innerHTML;else{var I=(0,N.S)(t.startContainer,"BLOCKQUOTE"),K=(0,f.O9)(t.startContainer);if(K&&(r=K),I&&(!K||K&&!I.contains(K))&&(r=I),B&&(r=B),_=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var z=r.previousElementSibling,G=r.nextElementSibling;!z||z.tagName!=="UL"&&z.tagName!=="OL"||(_=z.outerHTML+_,z.remove()),!G||G.tagName!=="UL"&&G.tagName!=="OL"||(_+=G.outerHTML,G.remove()),_=_.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else r.previousElementSibling&&r.previousElementSibling.textContent.replace(m.g.ZWSP,"")!==""&&i&&i.inputType==="insertParagraph"&&(_=r.previousElementSibling.outerHTML+_,r.previousElementSibling.remove());r.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Y){Y&&!r.isEqualNode(Y)&&(_+=Y.outerHTML,Y.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(Y){Y&&!r.isEqualNode(Y)&&(_+=Y.outerHTML,Y.remove())}))}if(O("SpinVditorIRDOM",_,"argument",e.options.debugger),_=e.lute.SpinVditorIRDOM(_),O("SpinVditorIRDOM",_,"result",e.options.debugger),R)r.innerHTML=_;else if(r.outerHTML=_,B){var V=(0,f.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(V){var H=V.textContent,X=H.substring(1,H.indexOf("]:")),ie=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+X+'"]');ie&&ie.setAttribute("aria-label",H.substr(X.length+3).trim().substr(0,24))}}var $,re=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");re.forEach(function(Y,le){le===0?A=Y:(A.insertAdjacentHTML("beforeend",Y.innerHTML),Y.remove())}),re.length>0&&e.ir.element.insertAdjacentElement("beforeend",re[0]);var ne=e.ir.element.querySelectorAll("[data-type='footnotes-block']");ne.forEach(function(Y,le){le===0?$=Y:($.insertAdjacentHTML("beforeend",Y.innerHTML),Y.remove())}),ne.length>0&&e.ir.element.insertAdjacentElement("beforeend",ne[0]),(0,C.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(Y){ye(Y,e)}),ge(e),We(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){if(e==="")return!1;if(e.indexOf("⇧")===-1&&e.indexOf("⌘")===-1&&e.indexOf("⌥")===-1)return!((0,a.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if(e==="⇧Tab")return!((0,a.yl)(t)||t.altKey||!t.shiftKey||t.code!=="Tab");var n=e.split("");if(e.startsWith("⌥")){var i=n.length===3?n[2]:n[1];return!((n.length===3?!(0,a.yl)(t):(0,a.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(i)?"Digit":"Key")+i)}e==="⌘Enter"&&(n=["⌘","Enter"]);var r=n.length>2&&n[0]==="⇧",o=r?n[2]:n[1];return!r||!(0,a.vU)()&&/Mac/.test(navigator.platform)||(o==="-"?o="_":o==="="&&(o="+")),!(!(0,a.yl)(t)||t.key.toLowerCase()!==o.toLowerCase()||t.altKey||!(!r&&!t.shiftKey||r&&t.shiftKey))},D=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(s){s.classList.remove("vditor-ir__node--expand")});var n=(0,f.JQ)(e.startContainer,"vditor-ir__node"),i=!e.collapsed&&(0,f.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===i){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,C.Hc)(e));var r=function(s){var h=s.startContainer;if(h.nodeType===3&&h.nodeValue.length!==s.startOffset)return!1;for(var E=h.nextSibling;E&&E.textContent==="";)E=E.nextSibling;if(!E){var b=(0,f.fb)(h,"vditor-ir__marker");if(b&&!b.nextSibling){var y=h.parentElement.parentElement.nextSibling;if(y&&y.nodeType!==3&&y.classList.contains("vditor-ir__node"))return y}return!1}return!(!E||E.nodeType===3||!E.classList.contains("vditor-ir__node")||E.getAttribute("data-block"))&&E}(e);if(r)return r.classList.add("vditor-ir__node--expand"),void r.classList.remove("vditor-ir__node--hidden");var o=function(s){var h=s.startContainer,E=h.previousSibling;return!(h.nodeType!==3||s.startOffset!==0||!E||E.nodeType===3||!E.classList.contains("vditor-ir__node")||E.getAttribute("data-block"))&&E}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},U=W(863),se=function(e,t){var n,i=getSelection().getRangeAt(0).cloneRange(),r=i.startContainer;i.startContainer.nodeType!==3&&i.startContainer.tagName==="DIV"&&(r=i.startContainer.childNodes[i.startOffset-1]);var o=(0,f.a1)(r,"data-block","0");if(o&&t&&(t.inputType==="deleteContentBackward"||t.data===" ")){for(var s=(0,C.im)(o,e.sv.element,i).start,h=!0,E=s-1;E>o.textContent.substr(0,s).lastIndexOf(`
- `);E--)if(o.textContent.charAt(E)!==" "&&o.textContent.charAt(E)!==" "){h=!1;break}if(s===0&&(h=!1),h)return void De(e);if(t.inputType==="deleteContentBackward"){var b=(0,f.a1)(r,"data-type","code-block-open-marker")||(0,f.a1)(r,"data-type","code-block-close-marker");if(b){var y;if(b.getAttribute("data-type")==="code-block-close-marker"&&(y=gt(r,"code-block-open-marker"))||b.getAttribute("data-type")==="code-block-open-marker"&&(y=gt(r,"code-block-close-marker",!1)))return y.textContent=b.textContent,void De(e)}var A=(0,f.a1)(r,"data-type","math-block-open-marker");if(A){var R=A.nextElementSibling.nextElementSibling;return void(R&&R.getAttribute("data-type")==="math-block-close-marker"&&(R.remove(),De(e)))}o.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(H){H.textContent.length===1&&H.remove()}),o.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(H){H.textContent.length===1&&H.remove()});var B=(0,f.a1)(r,"data-type","heading-marker");if(B&&B.textContent.indexOf("#")===-1)return void De(e)}if((t.data===" "||t.inputType==="deleteContentBackward")&&((0,f.a1)(r,"data-type","padding")||(0,f.a1)(r,"data-type","li-marker")||(0,f.a1)(r,"data-type","task-marker")||(0,f.a1)(r,"data-type","blockquote-marker")))return void De(e)}if(o&&o.textContent.trimRight()==="$$")De(e);else{o||(o=e.sv.element),((n=o.firstElementChild)===null||n===void 0?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(o=e.sv.element),(0,f.a1)(r,"data-type","footnotes-link")&&(o=e.sv.element),o.textContent.indexOf(Lute.Caret)===-1&&i.insertNode(document.createTextNode(Lute.Caret)),o.querySelectorAll("[style]").forEach(function(H){H.removeAttribute("style")}),o.querySelectorAll("font").forEach(function(H){H.outerHTML=H.innerHTML});var _,I=o.textContent,K=o.isEqualNode(e.sv.element);K?I=o.textContent:(o.previousElementSibling&&(I=o.previousElementSibling.textContent+I,o.previousElementSibling.remove()),o.previousElementSibling&&I.indexOf(`---
- `)===0&&(I=o.previousElementSibling.textContent+I,o.previousElementSibling.remove()),o.innerText.startsWith("```")||(e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(H,X){X===0&&H&&!o.isEqualNode(H.parentElement)&&(I+=`
- `+H.parentElement.textContent,H.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(H,X){X===0&&H&&!o.isEqualNode(H.parentElement)&&(I+=`
- `+H.parentElement.textContent,H.parentElement.remove())}))),I=rn(I,e),K?o.innerHTML=I:o.outerHTML=I;var z,G=e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']");G.forEach(function(H,X){X===0?_=H.parentElement:(_.lastElementChild.remove(),_.insertAdjacentHTML("beforeend",""+H.parentElement.innerHTML),H.parentElement.remove())}),G.length>0&&e.sv.element.insertAdjacentElement("beforeend",_);var V=e.sv.element.querySelectorAll("[data-type='footnotes-link']");V.forEach(function(H,X){X===0?z=H.parentElement:(z.lastElementChild.remove(),z.insertAdjacentHTML("beforeend",""+H.parentElement.innerHTML),H.parentElement.remove())}),V.length>0&&e.sv.element.insertAdjacentElement("beforeend",z),(0,C.ib)(e.sv.element,i),He(e),De(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},te=W(227),Q=function(e){e.options.theme==="dark"?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},me=function(e){var t=window.innerWidth<=m.g.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 "+Math.max(t,n)+"px"}e.ir.element.parentElement.style.display!=="none"&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px "+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"},be=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")}};function ce(){window.removeEventListener("resize",j)}var Je,Xt,Zn=function(e){be(e),ce(),window.addEventListener("resize",j=function(){me(e),be(e)});var t=(0,a.pK)()&&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||""},lt=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if(e[e.currentMode].element.getAttribute("contenteditable")!=="false"&&(0,C.Gb)(e[e.currentMode].element)){c(e.toolbar.elements,m.g.EDIT_TOOLBARS),v(e.toolbar.elements,m.g.EDIT_TOOLBARS);var t=(0,C.zh)(e),n=t.startContainer;t.startContainer.nodeType===3&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),(e.currentMode==="sv"?(0,f.a1)(n,"data-type","heading"):(0,N.W)(n))&&p(e.toolbar.elements,["headings"]),(e.currentMode==="sv"?(0,f.a1)(n,"data-type","blockquote"):(0,f.lG)(n,"BLOCKQUOTE"))&&p(e.toolbar.elements,["quote"]),(0,f.a1)(n,"data-type","strong")&&p(e.toolbar.elements,["bold"]),(0,f.a1)(n,"data-type","em")&&p(e.toolbar.elements,["italic"]),(0,f.a1)(n,"data-type","s")&&p(e.toolbar.elements,["strike"]),(0,f.a1)(n,"data-type","a")&&p(e.toolbar.elements,["link"]);var i=(0,f.lG)(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"]),v(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,f.a1)(n,"data-type","code-block")&&(L(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"])),(0,f.a1)(n,"data-type","code")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])),(0,f.a1)(n,"data-type","table")&&L(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},ke=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=u(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,a.pK)()&&(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)},Zt=function(e){for(var t="",n=e.nextSibling;n;)n.nodeType===3?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},Yt=function(e){for(var t="",n=e.previousSibling;n;)t=n.nodeType===3?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},Qt=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(n.nodeType===3){var i=document.createElement("p");i.setAttribute("data-block","0"),i.textContent=n.textContent;var r=t.startContainer.nodeType===3?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(i,n),n.remove(),t.setStart(i.firstChild,Math.min(i.firstChild.textContent.length,r)),t.collapse(!0),(0,C.Hc)(t),!0}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">'+n.innerHTML+"</p>"):n.tagName==="BR"?n.outerHTML='<p data-block="0">'+n.outerHTML+"<wbr></p>":(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.outerHTML+"</p>"),(0,C.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},vt=function(e,t){var n=(0,C.zh)(e),i=(0,f.F9)(n.startContainer);i||(i=n.startContainer.childNodes[n.startOffset]),i||e.wysiwyg.element.children.length!==0||(i=e.wysiwyg.element),i&&!i.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),i.innerHTML.trim()==="<wbr>"&&(i.innerHTML="<wbr><br>"),i.tagName==="BLOCKQUOTE"||i.classList.contains("vditor-reset")?i.innerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">":i.outerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">",(0,C.ib)(e.wysiwyg.element,n),ge(e))},At=function(e){var t=getSelection().getRangeAt(0),n=(0,f.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>",(0,C.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},ct=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling,r=i.ownerDocument.createRange();i.tagName==="CODE"?(i.style.display="inline-block",n?r.setStart(i.firstChild,1):r.selectNodeContents(i)):(i.style.display="block",i.firstChild.firstChild||i.firstChild.appendChild(document.createTextNode("")),r.selectNodeContents(i.firstChild)),n?r.collapse(!0):r.collapse(!1),(0,C.Hc)(r),e.firstElementChild.classList.contains("language-mindmap")||He(t)},Oe=function(e,t){if(P("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},Ze=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(e.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,C.Gb)(e.wysiwyg.element)){c(e.toolbar.elements,m.g.EDIT_TOOLBARS),v(e.toolbar.elements,m.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=t.startContainer.nodeType===3?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var i=(0,f.a1)(n,"data-type","footnotes-block");if(i)return e.wysiwyg.popover.innerHTML="",Be(i,e),void Pe(e,i);var r=(0,f.lG)(n,"LI");r?(r.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):r.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):r.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),v(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,f.lG)(n,"BLOCKQUOTE")&&p(e.toolbar.elements,["quote"]),((0,f.lG)(n,"B")||(0,f.lG)(n,"STRONG"))&&p(e.toolbar.elements,["bold"]),((0,f.lG)(n,"I")||(0,f.lG)(n,"EM"))&&p(e.toolbar.elements,["italic"]),((0,f.lG)(n,"STRIKE")||(0,f.lG)(n,"S"))&&p(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(J){J.classList.remove("vditor-comment--focus")});var o=(0,f.fb)(n,"vditor-comment");if(o){var s=o.getAttribute("data-cmtids").split(" ");if(s.length>1&&o.nextSibling.isSameNode(o.nextElementSibling)){var h=o.nextElementSibling.getAttribute("data-cmtids").split(" ");s.find(function(J){if(h.includes(J))return s=[J],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(J){J.getAttribute("data-cmtids").indexOf(s[0])>-1&&J.classList.add("vditor-comment--focus")})}var E=(0,f.lG)(n,"A");E&&p(e.toolbar.elements,["link"]);var b=(0,f.lG)(n,"TABLE"),y=(0,N.W)(n);(0,f.lG)(n,"CODE")?(0,f.lG)(n,"PRE")?(L(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"])):(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])):y?(L(e.toolbar.elements,["bold"]),p(e.toolbar.elements,["headings"])):b&&L(e.toolbar.elements,["table"]);var A=(0,f.fb)(n,"vditor-toc");if(A)return e.wysiwyg.popover.innerHTML="",Be(A,e),void Pe(e,A);var R=(0,N.S)(n,"BLOCKQUOTE");if(R&&(e.wysiwyg.popover.innerHTML="",et(t,R,e),tt(t,R,e),Be(R,e),Pe(e,R)),r&&(e.wysiwyg.popover.innerHTML="",et(t,r,e),tt(t,r,e),Be(r,e),Pe(e,r)),b){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var B=function(){var J=b.rows.length,Se=b.rows[0].cells.length,Qe=parseInt(le.value,10)||J,Fe=parseInt(Me.value,10)||Se;if(Qe!==J||Se!==Fe){if(Se!==Fe)for(var Nn=Fe-Se,at=0;at<b.rows.length;at++)if(Nn>0)for(var Dn=0;Dn<Nn;Dn++)at===0?b.rows[at].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):b.rows[at].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var Gt=Se-1;Gt>=Fe;Gt--)b.rows[at].cells[Gt].remove();if(J!==Qe){var On=Qe-J;if(On>0){for(var Wt="<tr>",st=0;st<Fe;st++)Wt+="<td> </td>";for(var jn=0;jn<On;jn++)b.querySelector("tbody")?b.querySelector("tbody").insertAdjacentHTML("beforeend",Wt):b.querySelector("thead").insertAdjacentHTML("afterend",Wt+"</tr>")}else for(st=J-1;st>=Qe;st--)b.rows[st].remove(),b.rows.length===1&&b.querySelector("tbody").remove()}}},_=function(J){Et(b,J),J==="right"?(G.classList.remove("vditor-icon--current"),V.classList.remove("vditor-icon--current"),H.classList.add("vditor-icon--current")):J==="center"?(G.classList.remove("vditor-icon--current"),H.classList.remove("vditor-icon--current"),V.classList.add("vditor-icon--current")):(V.classList.remove("vditor-icon--current"),H.classList.remove("vditor-icon--current"),G.classList.add("vditor-icon--current")),(0,C.Hc)(t),ke(e)},I=(0,f.lG)(n,"TD"),K=(0,f.lG)(n,"TH"),z="left";I?z=I.getAttribute("align")||"left":K&&(z=K.getAttribute("align")||"center");var G=document.createElement("button");G.setAttribute("type","button"),G.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,a.ns)("⇧⌘L")+">"),G.setAttribute("data-type","left"),G.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',G.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(z==="left"?" vditor-icon--current":""),G.onclick=function(){_("left")};var V=document.createElement("button");V.setAttribute("type","button"),V.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,a.ns)("⇧⌘C")+">"),V.setAttribute("data-type","center"),V.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',V.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(z==="center"?" vditor-icon--current":""),V.onclick=function(){_("center")};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,a.ns)("⇧⌘R")+">"),H.setAttribute("data-type","right"),H.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(z==="right"?" vditor-icon--current":""),H.onclick=function(){_("right")};var X=document.createElement("button");X.setAttribute("type","button"),X.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,a.ns)("⌘=")+">"),X.setAttribute("data-type","insertRow"),X.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',X.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",X.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,Se=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");Se&&hn(e,t,Se)};var ie=document.createElement("button");ie.setAttribute("type","button"),ie.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,a.ns)("⇧⌘F")+">"),ie.setAttribute("data-type","insertRow"),ie.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',ie.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ie.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,Se=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");Se&&vn(e,t,Se)};var $=document.createElement("button");$.setAttribute("type","button"),$.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,a.ns)("⇧⌘=")+">"),$.setAttribute("data-type","insertColumn"),$.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',$.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",$.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,Se=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");Se&&kt(e,b,Se)};var re=document.createElement("button");re.setAttribute("type","button"),re.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,a.ns)("⇧⌘G")+">"),re.setAttribute("data-type","insertColumn"),re.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',re.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",re.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,Se=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");Se&&kt(e,b,Se,"beforebegin")};var ne=document.createElement("button");ne.setAttribute("type","button"),ne.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,a.ns)("⌘-")+">"),ne.setAttribute("data-type","deleteRow"),ne.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',ne.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ne.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,Se=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");Se&&gn(e,t,Se)};var Y=document.createElement("button");Y.setAttribute("type","button"),Y.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,a.ns)("⇧⌘-")+">"),Y.setAttribute("data-type","deleteColumn"),Y.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',Y.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Y.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,Se=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");Se&&yn(e,t,b,Se)},(qe=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),qe.className="vditor-tooltipped vditor-tooltipped__n";var le=document.createElement("input");qe.appendChild(le),le.type="number",le.min="1",le.className="vditor-input",le.style.width="42px",le.style.textAlign="center",le.setAttribute("placeholder",window.VditorI18n.row),le.value=b.rows.length.toString(),le.oninput=function(){B()},le.onkeydown=function(J){if(!J.isComposing)return J.key==="Tab"?(Me.focus(),Me.select(),void J.preventDefault()):void(Oe(e,J)||ze(J,t))};var Ee=document.createElement("span");Ee.setAttribute("aria-label",window.VditorI18n.column),Ee.className="vditor-tooltipped vditor-tooltipped__n";var Me=document.createElement("input");Ee.appendChild(Me),Me.type="number",Me.min="1",Me.className="vditor-input",Me.style.width="42px",Me.style.textAlign="center",Me.setAttribute("placeholder",window.VditorI18n.column),Me.value=b.rows[0].cells.length.toString(),Me.oninput=function(){B()},Me.onkeydown=function(J){if(!J.isComposing)return J.key==="Tab"?(le.focus(),le.select(),void J.preventDefault()):void(Oe(e,J)||ze(J,t))},et(t,b,e),tt(t,b,e),Be(b,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",G),e.wysiwyg.popover.insertAdjacentElement("beforeend",V),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",ie),e.wysiwyg.popover.insertAdjacentElement("beforeend",X),e.wysiwyg.popover.insertAdjacentElement("beforeend",re),e.wysiwyg.popover.insertAdjacentElement("beforeend",$),e.wysiwyg.popover.insertAdjacentElement("beforeend",ne),e.wysiwyg.popover.insertAdjacentElement("beforeend",Y),e.wysiwyg.popover.insertAdjacentElement("beforeend",qe),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",Ee),Pe(e,b)}var Ke=(0,f.a1)(n,"data-type","link-ref");Ke&&$t(e,Ke,t);var je=(0,f.a1)(n,"data-type","footnotes-ref");if(je){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(qe=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,a.ns)("⌥Enter")+">"),qe.className="vditor-tooltipped vditor-tooltipped__n";var Re=document.createElement("input");qe.appendChild(Re),Re.className="vditor-input",Re.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,a.ns)("⌥Enter")+">"),Re.style.width="120px",Re.value=je.getAttribute("data-footnotes-label"),Re.oninput=function(){Re.value.trim()!==""&&je.setAttribute("data-footnotes-label",Re.value)},Re.onkeydown=function(J){J.isComposing||Oe(e,J)||ze(J,t)},Be(je,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",qe),Pe(e,je)}var Ne=(0,f.fb)(n,"vditor-wysiwyg__block"),it=!!Ne&&Ne.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(J){(!Ne||Ne&&it&&!Ne.contains(J))&&(J.previousElementSibling.style.display="none")}),Ne&&it){if(e.wysiwyg.popover.innerHTML="",et(t,Ne,e),tt(t,Ne,e),Be(Ne,e),Ne.getAttribute("data-type")==="code-block"){var Tt=document.createElement("span");Tt.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,a.ns)("⌥Enter")+">"),Tt.className="vditor-tooltipped vditor-tooltipped__n";var Ve=document.createElement("input");Tt.appendChild(Ve);var ft=Ne.firstElementChild.firstElementChild;Ve.className="vditor-input",Ve.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,a.ns)("⌥Enter")+">"),Ve.value=ft.className.indexOf("language-")>-1?ft.className.split("-")[1].split(" ")[0]:"",Ve.oninput=function(J){Ve.value.trim()!==""?ft.className="language-"+Ve.value:(ft.className="",e.hint.recentLanguage=""),Ne.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(Ne.lastElementChild.innerHTML=Ne.firstElementChild.innerHTML,ye(Ne.lastElementChild,e)),ke(e),J.detail===1&&(t.setStart(ft.firstChild,0),t.collapse(!0),(0,C.Hc)(t))},Ve.onkeydown=function(J){if(!J.isComposing&&!Oe(e,J)){if(J.key==="Escape"&&e.hint.element.style.display==="block")return e.hint.element.style.display="none",void J.preventDefault();e.hint.select(J,e),ze(J,t)}},Ve.onkeyup=function(J){if(!J.isComposing&&J.key!=="Enter"&&J.key!=="ArrowUp"&&J.key!=="Escape"&&J.key!=="ArrowDown"){var Se=[],Qe=Ve.value.substring(0,Ve.selectionStart);m.g.CODE_LANGUAGES.forEach(function(Fe){Fe.indexOf(Qe.toLowerCase())>-1&&Se.push({html:Fe,value:Fe})}),e.hint.genHTML(Se,Qe,e),J.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",Tt)}Pe(e,Ne)}else Ne=void 0;if(y){var qe;e.wysiwyg.popover.innerHTML="",(qe=document.createElement("span")).setAttribute("aria-label","ID<"+(0,a.ns)("⌥Enter")+">"),qe.className="vditor-tooltipped vditor-tooltipped__n";var Xe=document.createElement("input");qe.appendChild(Xe),Xe.className="vditor-input",Xe.setAttribute("placeholder","ID<"+(0,a.ns)("⌥Enter")+">"),Xe.style.width="120px",Xe.value=y.getAttribute("data-id")||"",Xe.oninput=function(){y.setAttribute("data-id",Xe.value)},Xe.onkeydown=function(J){J.isComposing||Oe(e,J)||ze(J,t)},et(t,y,e),tt(t,y,e),Be(y,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",qe),Pe(e,y)}if(E&&xt(e,E,t),!(R||r||b||Ne||E||Ke||je||y||A)){var ot=(0,f.a1)(n,"data-block","0");ot&&ot.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",et(t,ot,e),tt(t,ot,e),Be(ot,e),Pe(e,ot)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(J){J.style.display="none"});var Hn=(0,f.a1)(t.startContainer,"data-type","backslash");Hn&&(Hn.querySelector("span").style.display="inline")}},200)},Pe=function(e,t){var n=t,i=(0,f.lG)(t,"TABLE");i&&(n=i),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())},$t=function(e,t,n){n===void 0&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.tagName==="IMG"?t.setAttribute("alt",o.value):t.textContent=o.value),h.value.trim()!==""&&t.setAttribute("data-link-label",h.value)},r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.getAttribute("alt")||t.textContent,o.oninput=function(){i()},o.onkeydown=function(E){Oe(e,E)||ze(E,n)||dt(e,t,E,h)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.linkRef),s.className="vditor-tooltipped vditor-tooltipped__n";var h=document.createElement("input");s.appendChild(h),h.className="vditor-input",h.setAttribute("placeholder",window.VditorI18n.linkRef),h.value=t.getAttribute("data-link-label"),h.oninput=function(){i()},h.onkeydown=function(E){Oe(e,E)||ze(E,n)||dt(e,t,E,o)},Be(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),Pe(e,t)},et=function(e,t,n){var i=t.previousElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","up"),r.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,a.ns)("⇧⌘U")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("beforebegin",t),(0,C.ib)(n.wysiwyg.element,e),ke(n),Ze(n),He(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},tt=function(e,t,n){var i=t.nextElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","down"),r.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,a.ns)("⇧⌘D")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("afterend",t),(0,C.ib)(n.wysiwyg.element,e),ke(n),Ze(n),He(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},Be=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,a.ns)("⇧⌘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 i=(0,C.zh)(t);i.setStartAfter(e),(0,C.Hc)(i),e.remove(),ke(t),Ze(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&ge(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},dt=function(e,t,n,i){if(!n.isComposing){if(n.key==="Tab")return i.focus(),i.select(),void n.preventDefault();if(!(0,a.yl)(n)&&!n.shiftKey&&n.altKey&&n.key==="Enter"){var r=(0,C.zh)(e);t.insertAdjacentHTML("afterend",m.g.ZWSP),r.setStartAfter(t.nextSibling),r.collapse(!0),(0,C.Hc)(r),n.preventDefault()}}},xt=function(e,t,n){e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.innerHTML=o.value),t.setAttribute("href",h.value),t.setAttribute("title",b.value),ke(e)};t.querySelectorAll("[data-marker]").forEach(function(y){y.removeAttribute("data-marker")});var r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.innerHTML||"",o.oninput=function(){i()},o.onkeydown=function(y){Oe(e,y)||ze(y,n)||dt(e,t,y,h)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.link),s.className="vditor-tooltipped vditor-tooltipped__n";var h=document.createElement("input");s.appendChild(h),h.className="vditor-input",h.setAttribute("placeholder",window.VditorI18n.link),h.value=t.getAttribute("href")||"",h.oninput=function(){i()},h.onkeydown=function(y){Oe(e,y)||ze(y,n)||dt(e,t,y,b)};var E=document.createElement("span");E.setAttribute("aria-label",window.VditorI18n.tooltipText),E.className="vditor-tooltipped vditor-tooltipped__n";var b=document.createElement("input");E.appendChild(b),b.className="vditor-input",b.setAttribute("placeholder",window.VditorI18n.tooltipText),b.style.width="60px",b.value=t.getAttribute("title")||"",b.oninput=function(){i()},b.onkeydown=function(y){Oe(e,y)||ze(y,n)||dt(e,t,y,o)},Be(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),e.wysiwyg.popover.insertAdjacentElement("beforeend",E),Pe(e,t)},ze=function(e,t){if(!(0,a.yl)(e)&&!e.shiftKey&&e.key==="Enter"||e.key==="Escape")return t&&(0,C.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},nt=function(e){e.currentMode==="wysiwyg"?Ze(e):e.currentMode==="ir"&<(e)},en=function(e,t,n){n===void 0&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var i=e.wysiwyg.element;i.innerHTML=e.lute.Md2VditorDOM(t),i.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(r){ye(r,e),r.previousElementSibling.setAttribute("style","display:none")}),ke(e,n)},Yn=function(e,t,n){for(var i=e.startContainer.parentElement,r=!1,o="",s="",h=function(_){var I=Yt(_.startContainer),K=Zt(_.startContainer),z=_.startContainer.textContent,G=_.startOffset,V="",H="";return(z.substr(0,G)!==""&&z.substr(0,G)!==m.g.ZWSP||I)&&(V=""+I+z.substr(0,G)),(z.substr(G)!==""&&z.substr(G)!==m.g.ZWSP||K)&&(H=""+z.substr(G)+K),{afterHTML:H,beforeHTML:V}}(e),E=h.beforeHTML,b=h.afterHTML;i&&!r;){var y=i.tagName;if(y==="STRIKE"&&(y="S"),y==="I"&&(y="EM"),y==="B"&&(y="STRONG"),y==="S"||y==="STRONG"||y==="EM"){var A="",R="",B="";i.parentElement.getAttribute("data-block")!=="0"&&(R=Yt(i),B=Zt(i)),(E||R)&&(E=A=R+"<"+y+">"+E+"</"+y+">"),(n==="bold"&&y==="STRONG"||n==="italic"&&y==="EM"||n==="strikeThrough"&&y==="S")&&(A+=""+o+m.g.ZWSP+"<wbr>"+s,r=!0),(b||B)&&(A+=b="<"+y+">"+b+"</"+y+">"+B),i.parentElement.getAttribute("data-block")!=="0"?(i=i.parentElement).innerHTML=A:(i.outerHTML=A,i=i.parentElement),o="<"+y+">"+o,s="</"+y+">"+s}else r=!0}(0,C.ib)(t.wysiwyg.element,e)},Ce=function(e,t){var n,i=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var r=t.hotkey?" <"+(0,a.ns)(t.hotkey)+">":"";t.level===2&&(r=t.hotkey?" <"+(0,a.ns)(t.hotkey)+">":"");var o=t.tip?t.tip+r:""+window.VditorI18n[t.name]+r,s=t.name==="upload"?"div":"button";if(t.level===2)this.element.innerHTML="<"+s+' data-type="'+t.name+'">'+o+"</"+s+">";else{this.element.classList.add("vditor-toolbar__item");var h=document.createElement(s);h.setAttribute("data-type",t.name),h.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,h.setAttribute("aria-label",o),h.innerHTML=t.icon,this.element.appendChild(h)}t.prefix&&this.element.children[0].addEventListener((0,a.Le)(),function(E){E.preventDefault(),i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(e.currentMode==="wysiwyg"?function(b,y,A){if(!(b.wysiwyg.composingLock&&A instanceof CustomEvent)){var R=!0,B=!0;b.wysiwyg.element.querySelector("wbr")&&b.wysiwyg.element.querySelector("wbr").remove();var _=(0,C.zh)(b),I=y.getAttribute("data-type");if(y.classList.contains("vditor-menu--current"))if(I==="strike"&&(I="strikeThrough"),I==="quote"){var K=(0,f.lG)(_.startContainer,"BLOCKQUOTE");K||(K=_.startContainer.childNodes[_.startOffset]),K&&(R=!1,y.classList.remove("vditor-menu--current"),_.insertNode(document.createElement("wbr")),K.outerHTML=K.innerHTML.trim()===""?'<p data-block="0">'+K.innerHTML+"</p>":K.innerHTML,(0,C.ib)(b.wysiwyg.element,_))}else if(I==="inline-code"){var z=(0,f.lG)(_.startContainer,"CODE");z||(z=_.startContainer.childNodes[_.startOffset]),z&&(z.outerHTML=z.innerHTML.replace(m.g.ZWSP,"")+"<wbr>",(0,C.ib)(b.wysiwyg.element,_))}else I==="link"?(_.collapsed&&_.selectNode(_.startContainer.parentElement),document.execCommand("unlink",!1,"")):I==="check"||I==="list"||I==="ordered-list"?(wt(b,_,I),(0,C.ib)(b.wysiwyg.element,_),R=!1,y.classList.remove("vditor-menu--current")):(R=!1,y.classList.remove("vditor-menu--current"),_.toString()===""?Yn(_,b,I):document.execCommand(I,!1,""));else{b.wysiwyg.element.childNodes.length===0&&(b.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,C.ib)(b.wysiwyg.element,_));var G=(0,f.F9)(_.startContainer);if(I==="quote"){if(G||(G=_.startContainer.childNodes[_.startOffset]),G){R=!1,y.classList.add("vditor-menu--current"),_.insertNode(document.createElement("wbr"));var V=(0,f.lG)(_.startContainer,"LI");V&&G.contains(V)?V.innerHTML='<blockquote data-block="0">'+V.innerHTML+"</blockquote>":G.outerHTML='<blockquote data-block="0">'+G.outerHTML+"</blockquote>",(0,C.ib)(b.wysiwyg.element,_)}}else if(I==="check"||I==="list"||I==="ordered-list")wt(b,_,I,!1),(0,C.ib)(b.wysiwyg.element,_),R=!1,c(b.toolbar.elements,["check","list","ordered-list"]),y.classList.add("vditor-menu--current");else if(I==="inline-code"){if(_.toString()==="")(H=document.createElement("code")).textContent=m.g.ZWSP,_.insertNode(H),_.setStart(H.firstChild,1),_.collapse(!0),(0,C.Hc)(_);else if(_.startContainer.nodeType===3){var H=document.createElement("code");_.surroundContents(H),_.insertNode(H),(0,C.Hc)(_)}y.classList.add("vditor-menu--current")}else if(I==="code")(H=document.createElement("div")).className="vditor-wysiwyg__block",H.setAttribute("data-type","code-block"),H.setAttribute("data-block","0"),H.setAttribute("data-marker","```"),_.toString()===""?H.innerHTML=`<pre><code><wbr>
- </code></pre>`:(H.innerHTML="<pre><code>"+_.toString()+"<wbr></code></pre>",_.deleteContents()),_.insertNode(H),G&&(G.outerHTML=b.lute.SpinVditorDOM(G.outerHTML)),(0,C.ib)(b.wysiwyg.element,_),b.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Me){ye(Me,b)}),y.classList.add("vditor-menu--disabled");else if(I==="link"){if(_.toString()===""){var X=document.createElement("a");X.innerText=m.g.ZWSP,_.insertNode(X),_.setStart(X.firstChild,1),_.collapse(!0),xt(b,X,_);var ie=b.wysiwyg.popover.querySelector("input");ie.value="",ie.focus(),B=!1}else{(H=document.createElement("a")).setAttribute("href",""),H.innerHTML=_.toString(),_.surroundContents(H),_.insertNode(H),(0,C.Hc)(_),xt(b,H,_);var $=b.wysiwyg.popover.querySelectorAll("input");$[0].value=H.innerText,$[1].focus()}R=!1,y.classList.add("vditor-menu--current")}else if(I==="table"){var re='<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(_.toString().trim()==="")G&&G.innerHTML.trim().replace(m.g.ZWSP,"")===""?G.outerHTML=re:document.execCommand("insertHTML",!1,re),_.selectNode(b.wysiwyg.element.querySelector("wbr").previousSibling),b.wysiwyg.element.querySelector("wbr").remove(),(0,C.Hc)(_);else{re='<table data-block="0"><thead><tr>';var ne=_.toString().split(`
- `),Y=ne[0].split(",").length>ne[0].split(" ").length?",":" ";ne.forEach(function(Me,Ke){Ke===0?(Me.split(Y).forEach(function(je,Re){re+=Re===0?"<th>"+je+"<wbr></th>":"<th>"+je+"</th>"}),re+="</tr></thead>"):(re+=Ke===1?"<tbody><tr>":"<tr>",Me.split(Y).forEach(function(je){re+="<td>"+je+"</td>"}),re+="</tr>")}),re+="</tbody></table>",document.execCommand("insertHTML",!1,re),(0,C.ib)(b.wysiwyg.element,_)}R=!1,y.classList.add("vditor-menu--disabled")}else if(I==="line"){if(G){var le=`<hr data-block="0"><p data-block="0"><wbr>
- </p>`;G.innerHTML.trim()===""?G.outerHTML=le:G.insertAdjacentHTML("afterend",le),(0,C.ib)(b.wysiwyg.element,_)}}else if(R=!1,y.classList.add("vditor-menu--current"),I==="strike"&&(I="strikeThrough"),_.toString()!==""||I!=="bold"&&I!=="italic"&&I!=="strikeThrough")document.execCommand(I,!1,"");else{var Ee="strong";I==="italic"?Ee="em":I==="strikeThrough"&&(Ee="s"),(H=document.createElement(Ee)).textContent=m.g.ZWSP,_.insertNode(H),H.previousSibling&&H.previousSibling.textContent===m.g.ZWSP&&(H.previousSibling.textContent=""),_.setStart(H.firstChild,1),_.collapse(!0),(0,C.Hc)(_)}}R&&Ze(b),B&&ke(b)}}(e,i.element.children[0],E):e.currentMode==="ir"?dr(e,i.element.children[0],t.prefix||"",t.suffix||""):tr(e,i.element.children[0],t.prefix||"",t.suffix||""))})},Qn=(Je=function(e,t){return Je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},Je(e,t)},function(e,t){function n(){this.constructor=e}Je(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),Ye=function(e,t,n){var i;if(typeof n!="string"?(k(e,["subToolbar","hint"]),n.preventDefault(),i=u(e)):i=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",v(e.toolbar.elements,m.g.EDIT_TOOLBARS),c(e.toolbar.elements,m.g.EDIT_TOOLBARS),L(e.toolbar.elements,["outdent","indent"]),t==="ir")w(e.toolbar.elements,["both"]),M(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(i),We(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),me(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){ye(o,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,de.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})});else if(t==="wysiwyg")w(e.toolbar.elements,["both"]),M(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",me(e),en(e,i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,de.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if(t==="sv"){M(e.toolbar.elements,["both"]),w(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 r=rn(i,e);r==="<div data-block='0'></div>"&&(r=""),e.sv.element.innerHTML=r,De(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),me(e)}e.undo.resetIcon(e),typeof n!="string"&&(e[e.currentMode].element.focus(),nt(e)),ge(e),be(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(o){o.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'+e.currentMode+'"]').classList.add("vditor-menu--current")),e.outline.toggle(e,e.currentMode!=="sv"&&e.options.outline.enable,typeof n!="string")}},$n=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'+window.VditorI18n.wysiwyg+" <"+(0,a.ns)("⌥⌘7")+`></button>
- <button data-mode="ir">`+window.VditorI18n.instantRendering+" <"+(0,a.ns)("⌥⌘8")+`></button>
- <button data-mode="sv">`+window.VditorI18n.splitView+" <"+(0,a.ns)("⌥⌘9")+"></button>",r.element.appendChild(o),r._bindEvent(n,o,i),r}return Qn(t,e),t.prototype._bindEvent=function(n,i,r){var o=this.element.children[0];S(n,i,o,r.level),i.children.item(0).addEventListener((0,a.Le)(),function(s){Ye(n,"wysiwyg",s),s.preventDefault(),s.stopPropagation()}),i.children.item(1).addEventListener((0,a.Le)(),function(s){Ye(n,"ir",s),s.preventDefault(),s.stopPropagation()}),i.children.item(2).addEventListener((0,a.Le)(),function(s){Ye(n,"sv",s),s.preventDefault(),s.stopPropagation()})},t}(Ce),ut=function(e,t){return(0,C.Gb)(e,t)?getSelection().toString():""},Ht=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(u(e)),k(e,["subToolbar","hint"])})},tn=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,U.E)(n.target,e.options.lang,e.options.theme))})},Nt=function(e,t){t.addEventListener("blur",function(n){if(e.currentMode==="ir"){var i=e.ir.element.querySelector(".vditor-ir__node--expand");i&&i.classList.remove("vditor-ir__node--expand")}else e.currentMode!=="wysiwyg"||e.wysiwyg.selectPopover.contains(n.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,C.zh)(e),e.options.blur&&e.options.blur(u(e))})},Dt=function(e,t){t.addEventListener("dragstart",function(n){n.dataTransfer.setData(m.g.DROP_EDITOR,m.g.DROP_EDITOR)}),t.addEventListener("drop",function(n){n.dataTransfer.getData(m.g.DROP_EDITOR)?ue(e):(n.dataTransfer.types.includes("Files")||n.dataTransfer.types.includes("text/html"))&&St(e,n,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})})},Ot=function(e,t,n){t.addEventListener("copy",function(i){return n(i,e)})},jt=function(e,t,n){t.addEventListener("cut",function(i){n(i,e),e.options.comment.enable&&e.currentMode==="wysiwyg"&&e.wysiwyg.getComments(e),document.execCommand("delete")})},He=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,C.Ny)(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)}},It=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"||P("⌘X",n))&&e.wysiwyg.getComments(e),e.currentMode==="sv"){if(function(r,o){var s,h,E,b,y;if(r.sv.composingLock=o.isComposing,o.isComposing||(o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,a.yl)(o)&&o.key!=="Escape"))return!1;var A=(0,C.zh)(r),R=A.startContainer;A.startContainer.nodeType!==3&&A.startContainer.tagName==="DIV"&&(R=A.startContainer.childNodes[A.startOffset-1]);var B=(0,f.a1)(R,"data-type","text"),_=(0,f.a1)(R,"data-type","blockquote-marker");if(!_&&A.startOffset===0&&B&&B.previousElementSibling&&B.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(_=B.previousElementSibling),_&&o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&_.nextElementSibling.textContent.trim()===""&&(0,C.im)(_,r.sv.element,A).start===_.textContent.length)return((s=_.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&_.previousElementSibling.setAttribute("data-action","enter-remove"),_.remove(),De(r),o.preventDefault(),!0;var I=(0,f.a1)(R,"data-type","li-marker"),K=(0,f.a1)(R,"data-type","task-marker"),z=I;if(z||K&&K.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(z=K),z||A.startOffset!==0||!B||!B.previousElementSibling||B.previousElementSibling.getAttribute("data-type")!=="li-marker"&&B.previousElementSibling.getAttribute("data-type")!=="task-marker"||(z=B.previousElementSibling),z){var G=(0,C.im)(z,r.sv.element,A).start,V=z.getAttribute("data-type")==="task-marker",H=z;if(V&&(H=z.previousElementSibling.previousElementSibling.previousElementSibling),G===z.textContent.length){if(o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&z.nextElementSibling.textContent.trim()==="")return((h=H.previousElementSibling)===null||h===void 0?void 0:h.getAttribute("data-type"))==="padding"?(H.previousElementSibling.remove(),se(r)):(V&&(H.remove(),z.previousElementSibling.previousElementSibling.remove(),z.previousElementSibling.remove()),z.nextElementSibling.remove(),z.remove(),De(r)),o.preventDefault(),!0;if(o.key==="Tab")return H.insertAdjacentHTML("beforebegin",'<span data-type="padding">'+H.textContent.replace(/\S/g," ")+"</span>"),/^\d/.test(H.textContent)&&(H.textContent=H.textContent.replace(/^\d{1,}/,"1"),A.selectNodeContents(z.firstChild),A.collapse(!1)),se(r),o.preventDefault(),!0}}if(Ut(r,A,o))return!0;var X=(0,f.a1)(R,"data-block","0"),ie=(0,N.S)(R,"SPAN");if(o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&X){var $=!1,re=X.textContent.match(/^\n+/);(0,C.im)(X,r.sv.element).start<=(re?re[0].length:0)&&($=!0);var ne=`
- `;if(ie){if(((E=ie.previousElementSibling)===null||E===void 0?void 0:E.getAttribute("data-action"))==="enter-remove")return ie.previousElementSibling.remove(),De(r),o.preventDefault(),!0;ne+=er(ie)}return A.insertNode(document.createTextNode(ne)),A.collapse(!1),X&&X.textContent.trim()!==""&&!$?se(r):De(r),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey){if(ie&&((b=ie.previousElementSibling)===null||b===void 0?void 0:b.getAttribute("data-type"))==="newline"&&(0,C.im)(ie,r.sv.element,A).start===1&&ie.getAttribute("data-type").indexOf("code-block-")===-1)return A.setStart(ie,0),A.extractContents(),ie.textContent.trim()!==""?se(r):De(r),o.preventDefault(),!0;if(X&&(0,C.im)(X,r.sv.element,A).start===0&&X.previousElementSibling){A.extractContents();var Y=X.previousElementSibling.lastElementChild;return Y.getAttribute("data-type")==="newline"&&(Y.remove(),Y=X.previousElementSibling.lastElementChild),Y.getAttribute("data-type")!=="newline"&&(Y.insertAdjacentHTML("afterend",X.innerHTML),X.remove()),X.textContent.trim()===""||!((y=X.previousElementSibling)===null||y===void 0)&&y.querySelector('[data-type="code-block-open-marker"]')?(Y.getAttribute("data-type")!=="newline"&&(A.selectNodeContents(Y.lastChild),A.collapse(!1)),De(r)):se(r),o.preventDefault(),!0}}return!1}(e,n))return}else if(e.currentMode==="wysiwyg"){if(function(r,o){if(r.wysiwyg.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var s=(0,C.zh)(r),h=s.startContainer;if(!ln(o,r,h)||(cn(s,r,o),Ln(s),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,a.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var E=(0,f.F9)(h),b=(0,f.lG)(h,"P");if(fn(o,r,b,s)||mn(s,r,b,o)||bn(r,o,s))return!0;var y=(0,f.fb)(h,"vditor-wysiwyg__block");if(y){if(o.key==="Escape"&&y.children.length===2)return r.wysiwyg.popover.style.display="none",y.firstElementChild.style.display="none",r.wysiwyg.element.blur(),o.preventDefault(),!0;if(!(0,a.yl)(o)&&!o.shiftKey&&o.altKey&&o.key==="Enter"&&y.getAttribute("data-type")==="code-block"){var A=r.wysiwyg.popover.querySelector(".vditor-input");return A.focus(),A.select(),o.preventDefault(),!0}if(y.getAttribute("data-block")==="0"&&(wn(r,o,y.firstElementChild,s)||pt(r,o,s,y.firstElementChild,y)||y.getAttribute("data-type")!=="yaml-front-matter"&&rt(r,o,s,y.firstElementChild,y)))return!0}if(En(r,s,o,b))return!0;var R=(0,f.E2)(h,"BLOCKQUOTE");if(R&&!o.shiftKey&&o.altKey&&o.key==="Enter"){(0,a.yl)(o)?s.setStartBefore(R):s.setStartAfter(R),(0,C.Hc)(s);var B=document.createElement("p");return B.setAttribute("data-block","0"),B.innerHTML=`
- `,s.insertNode(B),s.collapse(!0),(0,C.Hc)(s),ke(r),He(r),o.preventDefault(),!0}var _,I=(0,N.W)(h);if(I){if(I.tagName==="H6"&&h.textContent.length===s.startOffset&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var K=document.createElement("p");return K.textContent=`
- `,K.setAttribute("data-block","0"),h.parentElement.insertAdjacentElement("afterend",K),s.setStart(K,0),(0,C.Hc)(s),ke(r),He(r),o.preventDefault(),!0}var z;if(P("⌘=",o))return(z=parseInt(I.tagName.substr(1),10)-1)>0&&(vt(r,"h"+z),ke(r)),o.preventDefault(),!0;if(P("⌘-",o))return(z=parseInt(I.tagName.substr(1),10)+1)<7&&(vt(r,"h"+z),ke(r)),o.preventDefault(),!0;o.key!=="Backspace"||(0,a.yl)(o)||o.shiftKey||o.altKey||I.textContent.length!==1||At(r)}if(kn(r,s,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,a.yl)(o)&&!o.shiftKey){var G=(0,f.lG)(h,"A"),V=(0,f.a1)(h,"data-type","link-ref"),H=(0,f.a1)(h,"data-type","footnotes-ref");if(G||V||H||I&&I.tagName.length===2){var X=r.wysiwyg.popover.querySelector("input");X.focus(),X.select()}}if(Oe(r,o))return!0;if(P("⇧⌘U",o)&&(_=r.wysiwyg.popover.querySelector('[data-type="up"]'))||P("⇧⌘D",o)&&(_=r.wysiwyg.popover.querySelector('[data-type="down"]')))return _.click(),o.preventDefault(),!0;if(Ut(r,s,o))return!0;if(!(0,a.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&h.parentElement.tagName!=="LI"&&h.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(h.parentElement.tagName)?s.insertNode(document.createTextNode(`
- `+m.g.ZWSP)):s.insertNode(document.createTextNode(`
- `)),s.collapse(!1),(0,C.Hc)(s),ke(r),He(r),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(Sn(r,s,o,b))return!0;if(E){if(E.previousElementSibling&&E.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&E.previousElementSibling.getAttribute("data-block")==="0"&&E.tagName!=="UL"&&E.tagName!=="OL"){var ie=(0,C.im)(E,r.wysiwyg.element,s).start;if(ie===0&&s.startOffset===0||ie===1&&E.innerText.startsWith(m.g.ZWSP))return ct(E.previousElementSibling.lastElementChild,r,!1),E.innerHTML.trim().replace(m.g.ZWSP,"")===""&&(E.remove(),ke(r)),o.preventDefault(),!0}var $=s.startOffset;if(s.toString()===""&&h.nodeType===3&&h.textContent.charAt($-2)===`
- `&&h.textContent.charAt($-1)!==m.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(h.parentElement.tagName))return h.textContent=h.textContent.substring(0,$-1)+m.g.ZWSP,s.setStart(h,$),s.collapse(!0),ke(r),o.preventDefault(),!0;h.textContent===m.g.ZWSP&&s.startOffset===1&&!h.previousSibling&&function(ne){for(var Y=ne.startContainer.nextSibling;Y&&Y.textContent==="";)Y=Y.nextSibling;return!(!Y||Y.nodeType===3||Y.tagName!=="CODE"&&Y.getAttribute("data-type")!=="math-inline"&&Y.getAttribute("data-type")!=="html-entity"&&Y.getAttribute("data-type")!=="html-inline")}(s)&&(h.textContent=""),E.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(ne){ne.firstElementChild.style.display="inline",ne.lastElementChild.style.display="none"}),E.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(ne){ne.firstElementChild.style.display="inline",ne.lastElementChild.style.display="none"})}}if((0,a.vU)()&&s.startOffset===1&&h.textContent.indexOf(m.g.ZWSP)>-1&&h.previousSibling&&h.previousSibling.nodeType!==3&&h.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return s.selectNodeContents(h.previousSibling),s.collapse(!1),o.preventDefault(),!0;if(Tn(o,E,s))return o.preventDefault(),!0;if(dn(s,o.key),o.key==="ArrowDown"){var re=h.nextSibling;re&&re.nodeType!==3&&re.getAttribute("data-type")==="math-inline"&&s.setStartAfter(re)}return!(!E||!x(E,r,o,s)||(o.preventDefault(),0))}(e,n))return}else if(e.currentMode==="ir"&&function(r,o){if(r.ir.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var s=(0,C.zh)(r),h=s.startContainer;if(!ln(o,r,h)||(cn(s,r,o),Ln(s),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,a.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var E=(0,f.a1)(h,"data-newline","1");if(!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&o.key==="Enter"&&E&&s.startOffset<E.textContent.length){var b=E.previousElementSibling;b&&(s.insertNode(document.createTextNode(b.textContent)),s.collapse(!1));var y=E.nextSibling;y&&(s.insertNode(document.createTextNode(y.textContent)),s.collapse(!0))}var A=(0,f.lG)(h,"P");if(fn(o,r,A,s)||mn(s,r,A,o)||En(r,s,o,A))return!0;var R=(0,f.fb)(h,"vditor-ir__marker--pre");if(R&&R.tagName==="PRE"){var B=R.firstChild;if(wn(r,o,R,s)||(B.getAttribute("data-type")==="math-block"||B.getAttribute("data-type")==="html-block")&&rt(r,o,s,B,R.parentElement)||pt(r,o,s,B,R.parentElement))return!0}var _=(0,f.a1)(h,"data-type","code-block-info");if(_){if(o.key==="Enter"||o.key==="Tab")return s.selectNodeContents(_.nextElementSibling.firstChild),s.collapse(!0),o.preventDefault(),k(r,["hint"]),!0;if(o.key==="Backspace"){var I=(0,C.im)(_,r.ir.element).start;I===1&&s.setStart(h,0),I===2&&(r.hint.recentLanguage="")}if(rt(r,o,s,_,_.parentElement))return k(r,["hint"]),!0}var K=(0,f.lG)(h,"TD")||(0,f.lG)(h,"TH");if(o.key.indexOf("Arrow")>-1&&K){var z=lr(K);if(z&&rt(r,o,s,K,z))return!0;var G=cr(K);if(G&&pt(r,o,s,K,G))return!0}if(bn(r,o,s)||kn(r,s,o)||Ut(r,s,o))return!0;var V=(0,N.W)(h);if(V){var H;if(P("⌘=",o))return(H=V.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length>1&&mt(r,H.textContent.substr(1)),o.preventDefault(),!0;if(P("⌘-",o))return(H=V.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length<6&&mt(r,H.textContent.trim()+"# "),o.preventDefault(),!0}var X=(0,f.F9)(h);if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(Sn(r,s,o,A))return!0;if(X&&X.previousElementSibling&&X.tagName!=="UL"&&X.tagName!=="OL"&&(X.previousElementSibling.getAttribute("data-type")==="code-block"||X.previousElementSibling.getAttribute("data-type")==="math-block")){var ie=(0,C.im)(X,r.ir.element,s).start;if(ie===0||ie===1&&X.innerText.startsWith(m.g.ZWSP))return s.selectNodeContents(X.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),s.collapse(!1),D(s,r),X.textContent.trim().replace(m.g.ZWSP,"")===""&&(X.remove(),We(r)),o.preventDefault(),!0}if(V){var $=V.firstElementChild.textContent.length;(0,C.im)(V,r.ir.element).start===$&&(s.setStart(V.firstElementChild.firstChild,$-1),s.collapse(!0),(0,C.Hc)(s))}}return!((o.key!=="ArrowUp"&&o.key!=="ArrowDown"||!X||(X.querySelectorAll(".vditor-ir__node").forEach(function(re){re.contains(h)||re.classList.add("vditor-ir__node--hidden")}),!Tn(o,X,s)))&&(dn(s,o.key),!X||!x(X,r,o,s)||(o.preventDefault(),0)))}(e,n))return;if(e.options.ctrlEnter&&P("⌘Enter",n))return e.options.ctrlEnter(u(e)),void n.preventDefault();if(P("⌘Z",n)&&!e.toolbar.elements.undo)return e.undo.undo(e),void n.preventDefault();if(P("⌘Y",n)&&!e.toolbar.elements.redo)return e.undo.redo(e),void n.preventDefault();if(n.key==="Escape")return e.hint.element.style.display==="block"?e.hint.element.style.display="none":e.options.esc&&!n.isComposing&&e.options.esc(u(e)),void n.preventDefault();if((0,a.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[1-6]$/.test(n.code)){if(e.currentMode==="wysiwyg"){var i=n.code.replace("Digit","H");(0,f.lG)(getSelection().getRangeAt(0).startContainer,i)?At(e):vt(e,i),ke(e)}else e.currentMode==="sv"?on(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" "):e.currentMode==="ir"&&mt(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" ");return n.preventDefault(),!0}if((0,a.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[7-9]$/.test(n.code))return n.code==="Digit7"?Ye(e,"wysiwyg",n):n.code==="Digit8"?Ye(e,"ir",n):n.code==="Digit9"&&Ye(e,"sv",n),!0;e.options.toolbar.find(function(r){return!r.hotkey||r.toolbar?!!r.toolbar&&!!r.toolbar.find(function(o){return!!o.hotkey&&(P(o.hotkey,n)?(e.toolbar.elements[o.name].children[0].dispatchEvent(new CustomEvent((0,a.Le)())),n.preventDefault(),!0):void 0)}):P(r.hotkey,n)?(e.toolbar.elements[r.name].children[0].dispatchEvent(new CustomEvent((0,a.Le)())),n.preventDefault(),!0):void 0})}})},Rt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var i=ut(e[e.currentMode].element);i.trim()?(e.currentMode==="wysiwyg"&&e.options.comment.enable&&((0,f.a1)(n.target,"data-type","footnotes-block")||(0,f.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(i)):e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},nn=function(e,t){var n=(0,C.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var i=(0,f.a1)(n.startContainer,"data-block","0");i||(i=e.sv.element);var r=e.lute.SpinVditorSVDOM(i.textContent);r=r.indexOf('data-type="footnotes-link"')>-1||r.indexOf('data-type="link-ref-defs-block"')>-1?"<div data-block='0'>"+r+"</div>":"<div data-block='0'>"+r.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>",i.isEqualNode(e.sv.element)?i.innerHTML=r:i.outerHTML=r,(0,C.ib)(e.sv.element,n),He(e)},gt=function(e,t,n){n===void 0&&(n=!0);var i=e;for(i.nodeType===3&&(i=i.parentElement);i;){if(i.getAttribute("data-type")===t)return i;i=n?i.previousElementSibling:i.nextElementSibling}return!1},rn=function(e,t){O("SpinVditorSVDOM",e,"argument",t.options.debugger);var n=t.lute.SpinVditorSVDOM(e);return e=n.indexOf('data-type="footnotes-link"')>-1||n.indexOf('data-type="link-ref-defs-block"')>-1?"<div data-block='0'>"+n+"</div>":"<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>",O("SpinVditorSVDOM",e,"result",t.options.debugger),e},er=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,i=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:"",r=!1;for(t==="newline"&&(r=!0);n&&!r;){var o=n.getAttribute("data-type");if(o==="li-marker"||o==="blockquote-marker"||o==="task-marker"||o==="padding"){var s=n.textContent;if(o!=="li-marker"||t!=="code-block-open-marker"&&t!=="code-block-info")if(t==="code-block-close-marker"&&n.nextElementSibling.isSameNode(e)){var h=gt(e,"code-block-open-marker");h&&h.previousElementSibling&&(n=h.previousElementSibling,i=s+i)}else i=s+i;else i=s.replace(/\S/g," ")+i}else o==="newline"&&(r=!0);n=n.previousElementSibling}return i},De=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=u(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,a.pK)()&&(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)},on=function(e,t){var n=(0,C.zh)(e),i=(0,N.S)(n.startContainer,"SPAN");i&&i.textContent.trim()!==""&&(t=`
- `+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},tr=function(e,t,n,i){var r=(0,C.zh)(e),o=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,C.ib)(e.sv.element,r));var s=(0,f.F9)(r.startContainer),h=(0,N.S)(r.startContainer,"SPAN");if(s){if(o==="link"){var E=void 0;return E=r.toString()===""?""+n+Lute.Caret+i:""+n+r.toString()+i.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,E)}if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"||o==="line")return E=void 0,E=r.toString()===""?""+n+Lute.Caret+(o==="code"?"":i):""+n+r.toString()+Lute.Caret+(o==="code"?"":i),o==="table"||o==="code"&&h&&h.textContent!==""?E=`
- `+E:o==="line"&&(E=`
- `+n+`
- `+Lute.Caret),void document.execCommand("insertHTML",!1,E);if((o==="check"||o==="list"||o==="ordered-list"||o==="quote")&&h){var b="* ";o==="check"?b="* [ ] ":o==="ordered-list"?b="1. ":o==="quote"&&(b="> ");var y=gt(h,"newline");return y?y.insertAdjacentText("afterend",b):s.insertAdjacentText("afterbegin",b),void se(e)}(0,C.ib)(e.sv.element,r),De(e)}},an=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},sn=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])})},nr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(b){try{E(i.next(b))}catch(y){o(y)}}function h(b){try{E(i.throw(b))}catch(y){o(y)}}function E(b){var y;b.done?r(b.value):(y=b.value,y instanceof n?y:new n(function(A){A(y)})).then(s,h)}E((i=i.apply(e,t||[])).next())})},rr=function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(E){return function(b){return function(y){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&y[0]?i.return:y[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,y[1])).done)return r;switch(i=0,r&&(y=[2&y[0],r.value]),y[0]){case 0:case 1:r=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,i=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||y[0]!==6&&y[0]!==2)){s=0;continue}if(y[0]===3&&(!r||y[1]>r[0]&&y[1]<r[3])){s.label=y[1];break}if(y[0]===6&&s.label<r[1]){s.label=r[1],r=y;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(y);break}r[2]&&s.ops.pop(),s.trys.pop();continue}y=t.call(e,s)}catch(A){y=[6,A],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([E,b])}}},ir=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},Pt=function(e,t,n){return nr(void 0,void 0,void 0,function(){var i,r,o,s,h,E,b,y,A,R,B,_,I,K;return rr(this,function(z){switch(z.label){case 0:for(i=[],r=e.options.upload.multiple===!0?t.length:1,_=0;_<r;_++)(o=t[_])instanceof DataTransferItem&&(o=o.getAsFile()),i.push(o);return e.options.upload.handler?[4,e.options.upload.handler(i)]:[3,2];case 1:return s=z.sent(),n&&(n.value=""),typeof s=="string"?(e.tip.show(s),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(i)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:i=z.sent(),z.label=4;case 4:if(e.options.upload.validate&&typeof(s=e.options.upload.validate(i))=="string")return e.tip.show(s),[2];if(h=an(e),e.upload.range=(0,C.zh)(e),E=function(G,V){G.tip.hide();for(var H=[],X="",ie="",$=(G.options.lang,G.options,function(Y,le){var Ee=V[le],Me=!0;Ee.name||(X+="<li>"+window.VditorI18n.nameEmpty+"</li>",Me=!1),Ee.size>G.options.upload.max&&(X+="<li>"+Ee.name+" "+window.VditorI18n.over+" "+G.options.upload.max/1024/1024+"M</li>",Me=!1);var Ke=Ee.name.lastIndexOf("."),je=Ee.name.substr(Ke),Re=G.options.upload.filename(Ee.name.substr(0,Ke))+je;G.options.upload.accept&&(G.options.upload.accept.split(",").some(function(Ne){var it=Ne.trim();if(it.indexOf(".")===0){if(je.toLowerCase()===it.toLowerCase())return!0}else if(Ee.type.split("/")[0]===it.split("/")[0])return!0;return!1})||(X+="<li>"+Ee.name+" "+window.VditorI18n.fileTypeError+"</li>",Me=!1)),Me&&(H.push(Ee),ie+="<li>"+Re+" "+window.VditorI18n.uploading+"</li>")}),re=V.length,ne=0;ne<re;ne++)$(0,ne);return G.tip.show("<ul>"+X+ie+"</ul>"),H}(e,i),E.length===0)return n&&(n.value=""),[2];for(b=new FormData,y=e.options.upload.extraData,A=0,R=Object.keys(y);A<R.length;A++)B=R[A],b.append(B,y[B]);for(_=0,I=E.length;_<I;_++)b.append(e.options.upload.fieldName,E[_]);return(K=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&K.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(K.withCredentials=!0),sn(e,K),e.upload.isUploading=!0,h.setAttribute("contenteditable","false"),K.onreadystatechange=function(){if(K.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,h.setAttribute("contenteditable","true"),K.status>=200&&K.status<300)if(e.options.upload.success)e.options.upload.success(h,K.responseText);else{var G=K.responseText;e.options.upload.format&&(G=e.options.upload.format(t,K.responseText)),function(V,H){an(H).focus();var X=JSON.parse(V),ie="";X.code===1&&(ie=""+X.msg),X.data.errFiles&&X.data.errFiles.length>0&&(ie="<ul><li>"+ie+"</li>",X.data.errFiles.forEach(function(re){var ne=re.lastIndexOf("."),Y=H.options.upload.filename(re.substr(0,ne))+re.substr(ne);ie+="<li>"+Y+" "+window.VditorI18n.uploadError+"</li>"}),ie+="</ul>"),ie?H.tip.show(ie):H.tip.hide();var $="";Object.keys(X.data.succMap).forEach(function(re){var ne=X.data.succMap[re],Y=re.lastIndexOf("."),le=re.substr(Y),Ee=H.options.upload.filename(re.substr(0,Y))+le;(le=le.toLowerCase()).indexOf(".wav")===0||le.indexOf(".mp3")===0||le.indexOf(".ogg")===0?H.currentMode==="wysiwyg"?$+=`<div class="vditor-wysiwyg__block" data-type="html-block"
- data-block="0"><pre><code><audio controls="controls" src="`+ne+'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+ne+`"></audio></pre></div>
- `:H.currentMode==="ir"?$+='<audio controls="controls" src="'+ne+`"></audio>
- `:$+="["+Ee+"]("+ne+`)
- `:le.indexOf(".apng")===0||le.indexOf(".bmp")===0||le.indexOf(".gif")===0||le.indexOf(".ico")===0||le.indexOf(".cur")===0||le.indexOf(".jpg")===0||le.indexOf(".jpeg")===0||le.indexOf(".jfif")===0||le.indexOf(".pjp")===0||le.indexOf(".pjpeg")===0||le.indexOf(".png")===0||le.indexOf(".svg")===0||le.indexOf(".webp")===0?H.currentMode==="wysiwyg"?$+='<img alt="'+Ee+'" src="'+ne+`">
- `:$+="
- `:H.currentMode==="wysiwyg"?$+='<a href="'+ne+'">'+Ee+`</a>
- `:$+="["+Ee+"]("+ne+`)
- `}),(0,C.Hc)(H.upload.range),document.execCommand("insertHTML",!1,$),H.upload.range=getSelection().getRangeAt(0).cloneRange()}(G,e)}else e.options.upload.error?e.options.upload.error(K.responseText):e.tip.show(K.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},K.upload.onprogress=function(G){if(G.lengthComputable){var V=G.loaded/G.total*100;e.upload.element.style.display="block",e.upload.element.style.width=V+"%"}},K.send(b),[2]}})})},yt=function(e,t,n){var i,r=(0,f.F9)(t.startContainer);if(r||(r=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 o=function(V){for(var H=V.previousSibling;H;){if(H.nodeType!==3&&H.tagName==="A"&&!H.previousSibling&&H.innerHTML.replace(m.g.ZWSP,"")===""&&H.nextSibling)return H;H=H.previousSibling}return!1}(t.startContainer);o&&o.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(V){V.remove()}),t.insertNode(document.createElement("wbr")),r.querySelectorAll("[style]").forEach(function(V){V.removeAttribute("style")}),r.querySelectorAll(".vditor-comment").forEach(function(V){V.textContent.trim()===""&&(V.classList.remove("vditor-comment","vditor-comment--focus"),V.removeAttribute("data-cmtids"))}),(i=r.previousElementSibling)===null||i===void 0||i.querySelectorAll(".vditor-comment").forEach(function(V){V.textContent.trim()===""&&(V.classList.remove("vditor-comment","vditor-comment--focus"),V.removeAttribute("data-cmtids"))});var s="";r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.wysiwyg.element);var h,E=r.isEqualNode(e.wysiwyg.element),b=(0,f.a1)(r,"data-type","footnotes-block");if(E)s=r.innerHTML;else{var y=(0,f.O9)(t.startContainer);if(y&&!b){var A=(0,N.S)(t.startContainer,"BLOCKQUOTE");r=A?(0,f.F9)(t.startContainer)||r:y}if(b&&(r=b),s=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var R=r.previousElementSibling,B=r.nextElementSibling;!R||R.tagName!=="UL"&&R.tagName!=="OL"||(s=R.outerHTML+s,R.remove()),!B||B.tagName!=="UL"&&B.tagName!=="OL"||(s+=B.outerHTML,B.remove()),s=s.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}r.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(V){V&&!r.isEqualNode(V)&&(s+=V.outerHTML,V.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(V){V&&!r.isEqualNode(V)&&(s+=V.outerHTML,V.remove())}))}if((s=s.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,""))==='<p data-block="0">```<wbr></p>'&&e.hint.recentLanguage&&(s='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),O("SpinVditorDOM",s,"argument",e.options.debugger),s=e.lute.SpinVditorDOM(s),O("SpinVditorDOM",s,"result",e.options.debugger),E)r.innerHTML=s;else if(r.outerHTML=s,b){var _=(0,f.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(_){var I=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+_.getAttribute("data-marker")+'"]');I&&I.setAttribute("aria-label",_.textContent.trim().substr(0,24))}}var K,z=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");z.forEach(function(V,H){H===0?h=V:(h.insertAdjacentHTML("beforeend",V.innerHTML),V.remove())}),z.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",z[0]);var G=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");G.forEach(function(V,H){H===0?K=V:(K.insertAdjacentHTML("beforeend",V.innerHTML),V.remove())}),G.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",G[0]),(0,C.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(V){ye(V,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)))}ge(e),ke(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},or=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ar=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(b){try{E(i.next(b))}catch(y){o(y)}}function h(b){try{E(i.throw(b))}catch(y){o(y)}}function E(b){var y;b.done?r(b.value):(y=b.value,y instanceof n?y:new n(function(A){A(y)})).then(s,h)}E((i=i.apply(e,t||[])).next())})},sr=function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(E){return function(b){return function(y){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&y[0]?i.return:y[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,y[1])).done)return r;switch(i=0,r&&(y=[2&y[0],r.value]),y[0]){case 0:case 1:r=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,i=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||y[0]!==6&&y[0]!==2)){s=0;continue}if(y[0]===3&&(!r||y[1]>r[0]&&y[1]<r[3])){s.label=y[1];break}if(y[0]===6&&s.label<r[1]){s.label=r[1],r=y;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(y);break}r[2]&&s.ops.pop(),s.trys.pop();continue}y=t.call(e,s)}catch(A){y=[6,A],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([E,b])}}},ln=function(e,t,n){if(e.keyCode===229&&e.code===""&&e.key==="Unidentified"&&t.currentMode!=="sv"){var i=(0,f.F9)(n);if(i&&i.textContent.trim()==="")return t[t.currentMode].composingLock=!0,!1}return!0},cn=function(e,t,n){if(!(n.key==="Enter"||n.key==="Tab"||n.key==="Backspace"||n.key.indexOf("Arrow")>-1||(0,a.yl)(n)||n.key==="Escape"||n.shiftKey||n.altKey)){var i=(0,f.lG)(e.startContainer,"P")||(0,f.lG)(e.startContainer,"LI");if(i&&(0,C.im)(i,t[t.currentMode].element,e).start===0){i.nodeValue&&(i.nodeValue=i.nodeValue.replace(/\u2006/g,""));var r=document.createTextNode(m.g.ZWSP);e.insertNode(r),e.setStartAfter(r)}}},dn=function(e,t){if(t==="ArrowDown"||t==="ArrowUp"){var n=(0,f.a1)(e.startContainer,"data-type","math-inline")||(0,f.a1)(e.startContainer,"data-type","html-entity")||(0,f.a1)(e.startContainer,"data-type","html-inline");n&&(t==="ArrowDown"&&e.setStartAfter(n.parentElement),t==="ArrowUp"&&e.setStartBefore(n.parentElement))}},bt=function(e,t){var n=(0,C.zh)(e),i=(0,f.F9)(n.startContainer);i&&(i.insertAdjacentHTML(t,'<p data-block="0">'+m.g.ZWSP+`<wbr>
- </p>`),(0,C.ib)(e[e.currentMode].element,n),nt(e),ue(e))},lr=function(e){var t=(0,f.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},cr=function(e){var t=(0,f.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},un=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling;return i||(i=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:e.parentElement.parentElement.tagName==="TBODY"&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),i&&(t.selectNodeContents(i),n||t.collapse(!1),(0,C.Hc)(t)),i},pt=function(e,t,n,i,r){var o=(0,C.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowDown"&&i.textContent.trimRight().substr(o.start).indexOf(`
- `)===-1||t.key==="ArrowRight"&&o.start>=i.textContent.trimRight().length){var s=r.nextElementSibling;return!s||s&&(s.tagName==="TABLE"||s.getAttribute("data-type"))?(r.insertAdjacentHTML("afterend",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,C.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(s),n.collapse(!0),(0,C.Hc)(n)),t.preventDefault(),!0}return!1},rt=function(e,t,n,i,r){var o=(0,C.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowUp"&&i.textContent.substr(0,o.start).indexOf(`
- `)===-1||(t.key==="ArrowLeft"||t.key==="Backspace"&&n.toString()==="")&&o.start===0){var s=r.previousElementSibling;return!s||s&&(s.tagName==="TABLE"||s.getAttribute("data-type"))?(r.insertAdjacentHTML("beforebegin",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,C.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(s),n.collapse(!1),(0,C.Hc)(n)),t.preventDefault(),!0}return!1},wt=function(e,t,n,i){i===void 0&&(i=!0);var r=(0,f.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(y){y.remove()}),t.insertNode(document.createElement("wbr")),i&&r){for(var o="",s=0;s<r.parentElement.childElementCount;s++){var h=r.parentElement.children[s].querySelector("input");h&&h.remove(),o+='<p data-block="0">'+r.parentElement.children[s].innerHTML.trimLeft()+"</p>"}r.parentElement.insertAdjacentHTML("beforebegin",o),r.parentElement.remove()}else if(r)if(n==="check")r.parentElement.querySelectorAll("li").forEach(function(y){y.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'+(y.textContent.indexOf(" ")===0?"":" ")),y.classList.add("vditor-task")});else{r.querySelector("input")&&r.parentElement.querySelectorAll("li").forEach(function(y){y.querySelector("input").remove(),y.classList.remove("vditor-task")});var E=void 0;n==="list"?(E=document.createElement("ul")).setAttribute("data-marker","*"):(E=document.createElement("ol")).setAttribute("data-marker","1."),E.setAttribute("data-block","0"),E.setAttribute("data-tight",r.parentElement.getAttribute("data-tight")),E.innerHTML=r.parentElement.innerHTML,r.parentElement.parentNode.replaceChild(E,r.parentElement)}else{var b=(0,f.a1)(t.startContainer,"data-block","0");b||(e[e.currentMode].element.querySelector("wbr").remove(),(b=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),n==="check"?(b.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+b.innerHTML+"</li></ul>"),b.remove()):n==="list"?(b.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+b.innerHTML+"</li></ul>"),b.remove()):n==="ordered-list"&&(b.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+b.innerHTML+"</li></ol>"),b.remove())}},pn=function(e,t,n){var i=t.previousElementSibling;if(t&&i){var r=[t];Array.from(n.cloneContents().children).forEach(function(E,b){E.nodeType!==3&&t&&E.textContent.trim()!==""&&t.getAttribute("data-node-id")===E.getAttribute("data-node-id")&&(b!==0&&r.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(E){E.remove()}),n.insertNode(document.createElement("wbr"));var o=i.parentElement,s="";r.forEach(function(E){var b=E.getAttribute("data-marker");b.length!==1&&(b="1"+b.slice(-1)),s+='<li data-node-id="'+E.getAttribute("data-node-id")+'" data-marker="'+b+'">'+E.innerHTML+"</li>",E.remove()}),i.insertAdjacentHTML("beforeend","<"+o.tagName+' data-block="0">'+s+"</"+o.tagName+">"),e.currentMode==="wysiwyg"?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=e.lute.SpinVditorIRDOM(o.outerHTML),(0,C.ib)(e[e.currentMode].element,n);var h=(0,f.O9)(n.startContainer);h&&h.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(E){ye(E,e),e.currentMode==="wysiwyg"&&E.previousElementSibling.setAttribute("style","display:none")}),ue(e),nt(e)}else e[e.currentMode].element.focus()},Bt=function(e,t,n,i){var r=(0,f.lG)(t.parentElement,"LI");if(r){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(A){A.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,s=o.cloneNode(),h=[t];Array.from(n.cloneContents().children).forEach(function(A,R){A.nodeType!==3&&t&&A.textContent.trim()!==""&&t.getAttribute("data-node-id")===A.getAttribute("data-node-id")&&(R!==0&&h.push(t),t=t.nextElementSibling)});var E=!1,b="";o.querySelectorAll("li").forEach(function(A){E&&(b+=A.outerHTML,A.nextElementSibling||A.previousElementSibling?A.remove():A.parentElement.remove()),A.isSameNode(h[h.length-1])&&(E=!0)}),h.reverse().forEach(function(A){r.insertAdjacentElement("afterend",A)}),b&&(s.innerHTML=b,h[0].insertAdjacentElement("beforeend",s)),e.currentMode==="wysiwyg"?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,C.ib)(e[e.currentMode].element,n);var y=(0,f.O9)(n.startContainer);y&&y.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(A){ye(A,e),e.currentMode==="wysiwyg"&&A.previousElementSibling.setAttribute("style","display:none")}),ue(e),nt(e)}else e[e.currentMode].element.focus()},Et=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,i=e.rows[0].cells.length,r=e.rows.length,o=0,s=0;s<r;s++)for(var h=0;h<i;h++)if(e.rows[s].cells[h].isSameNode(n)){o=h;break}for(var E=0;E<r;E++)e.rows[E].cells[o].setAttribute("align",t)},qt=function(e){var t=e.trimRight().split(`
- `).pop();return t!==""&&(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},Vt=function(e){var t=e.trimRight().split(`
- `);return(e=t.pop()).indexOf(" ")!==0&&e.indexOf(" ")!==0&&(e=e.trimLeft())!==""&&t.length!==0&&(e.replace(/-/g,"")===""||e.replace(/=/g,"")==="")},ue=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),e.currentMode==="wysiwyg"?ke(e,t):e.currentMode==="ir"?We(e,t):e.currentMode==="sv"&&De(e,t)},mn=function(e,t,n,i){var r,o=e.startContainer,s=(0,f.lG)(o,"LI");if(s){if(!(0,a.yl)(i)&&!i.altKey&&i.key==="Enter"&&!i.shiftKey&&n&&s.contains(n)&&n.nextElementSibling)return s&&!s.textContent.endsWith(`
- `)&&s.insertAdjacentText("beforeend",`
- `),e.insertNode(document.createTextNode(`
- `)),e.collapse(!1),ue(t),i.preventDefault(),!0;if(!((0,a.yl)(i)||i.shiftKey||i.altKey||i.key!=="Backspace"||s.previousElementSibling||e.toString()!==""||(0,C.im)(s,t[t.currentMode].element,e).start!==0))return s.nextElementSibling?(s.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+s.innerHTML+"</p>"),s.remove()):s.parentElement.outerHTML='<p data-block="0"><wbr>'+s.innerHTML+"</p>",(0,C.ib)(t[t.currentMode].element,e),ue(t),i.preventDefault(),!0;if(!(0,a.yl)(i)&&!i.shiftKey&&!i.altKey&&i.key==="Backspace"&&s.textContent.trim().replace(m.g.ZWSP,"")===""&&e.toString()===""&&((r=s.previousElementSibling)===null||r===void 0?void 0:r.tagName)==="LI")return s.previousElementSibling.insertAdjacentText("beforeend",`
- `),e.selectNodeContents(s.previousElementSibling),e.collapse(!1),s.remove(),(0,C.ib)(t[t.currentMode].element,e),ue(t),i.preventDefault(),!0;if(!(0,a.yl)(i)&&!i.altKey&&i.key==="Tab"){var h=!1;if((e.startOffset===0&&(o.nodeType===3&&!o.previousSibling||o.nodeType!==3&&o.nodeName==="LI")||s.classList.contains("vditor-task")&&e.startOffset===1&&o.previousSibling.nodeType!==3&&o.previousSibling.tagName==="INPUT")&&(h=!0),h||e.toString()!=="")return i.shiftKey?Bt(t,s,e,s.parentElement):pn(t,s,e),i.preventDefault(),!0}}return!1},Ut=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,C.Hc)(t),ue(e),n.preventDefault(),!0},fn=function(e,t,n,i){if(n){if(!(0,a.yl)(e)&&!e.altKey&&e.key==="Enter"){var r=String.raw(Xt||(Xt=or(["",""],["",""])),n.textContent).replace(/\\\|/g,"").trim(),o=r.split("|");if(r.startsWith("|")&&r.endsWith("|")&&o.length>3){var s=o.map(function(){return"---"}).join("|");return s=n.textContent+`
- `+s.substring(3,s.length-3)+`
- |<wbr>`,n.outerHTML=t.lute.SpinVditorDOM(s),(0,C.ib)(t[t.currentMode].element,i),ue(t),He(t),e.preventDefault(),!0}if(qt(n.innerHTML)&&n.previousElementSibling){var h="",E=n.innerHTML.trimRight().split(`
- `);return E.length>1&&(E.pop(),h='<p data-block="0">'+E.join(`
- `)+"</p>"),n.insertAdjacentHTML("afterend",h+`<hr data-block="0"><p data-block="0"><wbr>
- </p>`),n.remove(),(0,C.ib)(t[t.currentMode].element,i),ue(t),He(t),e.preventDefault(),!0}if(Vt(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,C.ib)(t[t.currentMode].element,i),ue(t),He(t),e.preventDefault(),!0}if(i.collapsed&&n.previousElementSibling&&e.key==="Backspace"&&!(0,a.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split(`
- `).length>1&&(0,C.im)(n,t[t.currentMode].element,i).start===0){var b=(0,f.DX)(n.previousElementSibling);return b.textContent.endsWith(`
- `)||(b.textContent=b.textContent+`
- `),b.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,C.ib)(t[t.currentMode].element,i),!1}return!1}},hn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';n.tagName==="TH"?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>"+i+"</tr></tbody>"):n.parentElement.insertAdjacentHTML("afterend","<tr>"+i+"</tr>"),ue(e)},vn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)n.tagName==="TH"?i+='<th align="'+n.parentElement.children[r].getAttribute("align")+'"> </th>':i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';if(n.tagName==="TH"){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>"+i+"</tr></thead>"),t.insertNode(document.createElement("wbr"));var o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,C.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>"+i+"</tr>");ue(e)},kt=function(e,t,n,i){i===void 0&&(i="afterend");for(var r=0,o=n.previousElementSibling;o;)r++,o=o.previousElementSibling;for(var s=0;s<t.rows.length;s++)s===0?t.rows[s].cells[r].insertAdjacentHTML(i,"<th> </th>"):t.rows[s].cells[r].insertAdjacentHTML(i,"<td> </td>");ue(e)},gn=function(e,t,n){if(n.tagName==="TD"){var i=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(i.previousElementSibling.lastElementChild.lastElementChild),i.childElementCount===1?i.remove():n.parentElement.remove(),t.collapse(!1),(0,C.Hc)(t),ue(e)}},yn=function(e,t,n,i){for(var r=0,o=i.previousElementSibling;o;)r++,o=o.previousElementSibling;(i.previousElementSibling||i.nextElementSibling)&&(t.selectNodeContents(i.previousElementSibling||i.nextElementSibling),t.collapse(!0));for(var s=0;s<n.rows.length;s++){var h=n.rows[s].cells;if(h.length===1){n.remove(),nt(e);break}h[r].remove()}(0,C.Hc)(t),ue(e)},bn=function(e,t,n){var i=n.startContainer,r=(0,f.lG)(i,"TD")||(0,f.lG)(i,"TH");if(r){if(!(0,a.yl)(t)&&!t.altKey&&t.key==="Enter"){r.lastElementChild&&(!r.lastElementChild||r.lastElementChild.isSameNode(r.lastChild)&&r.lastElementChild.tagName==="BR")||r.insertAdjacentHTML("beforeend","<br>");var o=document.createElement("br");return n.insertNode(o),n.setStartAfter(o),ue(e),He(e),t.preventDefault(),!0}if(t.key==="Tab")return t.shiftKey?(un(r,n),t.preventDefault(),!0):((y=r.nextElementSibling)||(y=r.parentElement.nextElementSibling?r.parentElement.nextElementSibling.firstElementChild:r.parentElement.parentElement.tagName==="THEAD"&&r.parentElement.parentElement.nextElementSibling?r.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),y&&(n.selectNodeContents(y),(0,C.Hc)(n)),t.preventDefault(),!0);var s=r.parentElement.parentElement.parentElement;if(t.key==="ArrowUp"){if(t.preventDefault(),r.tagName==="TH")return s.previousElementSibling?(n.selectNodeContents(s.previousElementSibling),n.collapse(!1),(0,C.Hc)(n)):bt(e,"beforebegin"),!0;for(var h=0,E=r.parentElement;h<E.cells.length&&!E.cells[h].isSameNode(r);h++);var b=E.previousElementSibling;return b||(b=E.parentElement.previousElementSibling.firstChild),n.selectNodeContents(b.cells[h]),n.collapse(!1),(0,C.Hc)(n),!0}if(t.key==="ArrowDown"){var y;if(t.preventDefault(),!(E=r.parentElement).nextElementSibling&&r.tagName==="TD")return s.nextElementSibling?(n.selectNodeContents(s.nextElementSibling),n.collapse(!0),(0,C.Hc)(n)):bt(e,"afterend"),!0;for(h=0;h<E.cells.length&&!E.cells[h].isSameNode(r);h++);return(y=E.nextElementSibling)||(y=E.parentElement.nextElementSibling.firstChild),n.selectNodeContents(y.cells[h]),n.collapse(!0),(0,C.Hc)(n),!0}if(e.currentMode==="wysiwyg"&&!(0,a.yl)(t)&&t.key==="Enter"&&!t.shiftKey&&t.altKey){var A=e.wysiwyg.popover.querySelector(".vditor-input");return A.focus(),A.select(),t.preventDefault(),!0}if(!(0,a.yl)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Backspace"&&n.startOffset===0&&n.toString()==="")return!un(r,n,!1)&&s&&(s.textContent.trim()===""?(s.outerHTML=`<p data-block="0"><wbr>
- </p>`,(0,C.ib)(e[e.currentMode].element,n)):(n.setStartBefore(s),n.collapse(!0)),ue(e)),t.preventDefault(),!0;if(P("⇧⌘F",t))return vn(e,n,r),t.preventDefault(),!0;if(P("⌘=",t))return hn(e,n,r),t.preventDefault(),!0;if(P("⇧⌘G",t))return kt(e,s,r,"beforebegin"),t.preventDefault(),!0;if(P("⇧⌘=",t))return kt(e,s,r),t.preventDefault(),!0;if(P("⌘-",t))return gn(e,n,r),t.preventDefault(),!0;if(P("⇧⌘-",t))return yn(e,n,s,r),t.preventDefault(),!0;if(P("⇧⌘L",t)){if(e.currentMode==="ir")return Et(s,"left"),ue(e),t.preventDefault(),!0;if(R=e.wysiwyg.popover.querySelector('[data-type="left"]'))return R.click(),t.preventDefault(),!0}if(P("⇧⌘C",t)){if(e.currentMode==="ir")return Et(s,"center"),ue(e),t.preventDefault(),!0;if(R=e.wysiwyg.popover.querySelector('[data-type="center"]'))return R.click(),t.preventDefault(),!0}if(P("⇧⌘R",t)){if(e.currentMode==="ir")return Et(s,"right"),ue(e),t.preventDefault(),!0;var R;if(R=e.wysiwyg.popover.querySelector('[data-type="right"]'))return R.click(),t.preventDefault(),!0}}return!1},wn=function(e,t,n,i){if(n.tagName==="PRE"&&P("⌘A",t))return i.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&t.key==="Tab"&&!t.shiftKey&&i.toString()==="")return i.insertNode(document.createTextNode(e.options.tab)),i.collapse(!1),ue(e),t.preventDefault(),!0;if(t.key==="Backspace"&&!(0,a.yl)(t)&&!t.shiftKey&&!t.altKey){var r=(0,C.im)(n,e[e.currentMode].element,i);if((r.start===0||r.start===1&&n.innerText===`
- `)&&i.toString()==="")return n.parentElement.outerHTML='<p data-block="0"><wbr>'+n.firstElementChild.innerHTML+"</p>",(0,C.ib)(e[e.currentMode].element,i),ue(e),t.preventDefault(),!0}return!(0,a.yl)(t)&&!t.altKey&&t.key==="Enter"&&(n.firstElementChild.textContent.endsWith(`
- `)||n.firstElementChild.insertAdjacentText("beforeend",`
- `),i.extractContents(),i.insertNode(document.createTextNode(`
- `)),i.collapse(!1),(0,C.Hc)(i),(0,a.vU)()||(e.currentMode==="wysiwyg"?yt(e,i):q(e,i)),He(e),t.preventDefault(),!0)},En=function(e,t,n,i){var r=t.startContainer,o=(0,f.lG)(r,"BLOCKQUOTE");if(o&&t.toString()===""){if(n.key==="Backspace"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey&&(0,C.im)(o,e[e.currentMode].element,t).start===0)return t.insertNode(document.createElement("wbr")),o.outerHTML=o.innerHTML,(0,C.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0;if(i&&n.key==="Enter"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey&&i.parentElement.tagName==="BLOCKQUOTE"){var s=!1;if(i.innerHTML.replace(m.g.ZWSP,"")===`
- `||i.innerHTML.replace(m.g.ZWSP,"")===""?(s=!0,i.remove()):i.innerHTML.endsWith(`
- `)&&(0,C.im)(i,e[e.currentMode].element,t).start===i.textContent.length-1&&(i.innerHTML=i.innerHTML.substr(0,i.innerHTML.length-2),s=!0),s)return o.insertAdjacentHTML("afterend",'<p data-block="0">'+m.g.ZWSP+`<wbr>
- </p>`),(0,C.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}var h=(0,f.F9)(r);if(e.currentMode==="wysiwyg"&&h&&P("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),h.outerHTML='<blockquote data-block="0">'+h.outerHTML+"</blockquote>",(0,C.ib)(e.wysiwyg.element,t),ke(e),n.preventDefault(),!0;if(pt(e,n,t,o,o)||rt(e,n,t,o,o))return!0}return!1},kn=function(e,t,n){var i=t.startContainer,r=(0,f.fb)(i,"vditor-task");if(r){if(P("⇧⌘J",n)){var o=r.firstElementChild;return o.checked?o.removeAttribute("checked"):o.setAttribute("checked","checked"),ue(e),n.preventDefault(),!0}if(n.key==="Backspace"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey&&t.toString()===""&&t.startOffset===1&&(i.nodeType===3&&i.previousSibling&&i.previousSibling.tagName==="INPUT"||i.nodeType!==3)){var s=r.previousElementSibling;return r.querySelector("input").remove(),s?((0,f.DX)(s).parentElement.insertAdjacentHTML("beforeend","<wbr>"+r.innerHTML.trim()),r.remove()):(r.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(r.innerHTML.trim()||`
- `)+"</p>"),r.nextElementSibling?r.remove():r.parentElement.remove()),(0,C.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}if(n.key==="Enter"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey){if(r.textContent.trim()==="")if((0,f.fb)(r.parentElement,"vditor-task")){var h=(0,f.O9)(i);h&&Bt(e,r,t,h)}else if(r.nextElementSibling){var E="",b="",y=!1;Array.from(r.parentElement.children).forEach(function(_){r.isSameNode(_)?y=!0:y?E+=_.outerHTML:b+=_.outerHTML});var A=r.parentElement.tagName,R=r.parentElement.tagName==="OL"?"":' data-marker="'+r.parentElement.getAttribute("data-marker")+'"',B="";b&&(B=r.parentElement.tagName==="UL"?"":' start="1"',b="<"+A+' data-tight="true"'+R+' data-block="0">'+b+"</"+A+">"),r.parentElement.outerHTML=b+`<p data-block="0"><wbr>
- </p><`+A+`
- data-tight="true"`+R+' data-block="0"'+B+">"+E+"</"+A+">"}else r.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
- </p>`),r.parentElement.querySelectorAll("li").length===1?r.parentElement.remove():r.remove();else i.nodeType!==3&&t.startOffset===0&&i.firstChild.tagName==="INPUT"?t.setStart(i.childNodes[1],1):(t.setEndAfter(r.lastChild),r.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'+r.getAttribute("data-marker")+'"><input type="checkbox"> <wbr></li>'),document.querySelector("wbr").after(t.extractContents()));return(0,C.ib)(e[e.currentMode].element,t),ue(e),He(e),n.preventDefault(),!0}}return!1},Sn=function(e,t,n,i){if(t.startContainer.nodeType!==3){var r=t.startContainer.children[t.startOffset];if(r&&r.tagName==="HR")return t.selectNodeContents(r.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(i){var o=i.previousElementSibling;if(o&&(0,C.im)(i,e[e.currentMode].element,t).start===0&&((0,a.vU)()&&o.tagName==="HR"||o.tagName==="TABLE")){if(o.tagName==="TABLE"){var s=o.lastElementChild.lastElementChild.lastElementChild;s.innerHTML=s.innerHTML.trimLeft()+"<wbr>"+i.textContent.trim(),i.remove()}else o.remove();return(0,C.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}}return!1},Ln=function(e){(0,a.vU)()&&e.startContainer.nodeType!==3&&e.startContainer.tagName==="HR"&&e.setStartBefore(e.startContainer)},Tn=function(e,t,n){var i,r;if(!(0,a.vU)())return!1;if(e.key==="ArrowUp"&&t&&((i=t.previousElementSibling)===null||i===void 0?void 0:i.tagName)==="TABLE"){var o=t.previousElementSibling;return n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!(e.key!=="ArrowDown"||!t||((r=t.nextElementSibling)===null||r===void 0?void 0:r.tagName)!=="TABLE")&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},St=function(e,t,n){return ar(void 0,void 0,void 0,function(){var i,r,o,s,h,E,b,y,A,R,B,_,I,K,z,G;return sr(this,function(V){switch(V.label){case 0:return e[e.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(i=t.clipboardData.getData("text/html"),r=t.clipboardData.getData("text/plain"),o=t.clipboardData.files):(i=t.dataTransfer.getData("text/html"),r=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items)),s={},h=function(H,X){if(!X)return["",Lute.WalkContinue];var ie=H.TokensStr();if(H.__internal_object__.Parent.Type===34&&ie&&ie.indexOf("file://")===-1&&e.options.upload.linkToImgUrl){var $=new XMLHttpRequest;$.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&$.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&($.withCredentials=!0),sn(e,$),$.setRequestHeader("Content-Type","application/json; charset=utf-8"),$.onreadystatechange=function(){if($.readyState===XMLHttpRequest.DONE){if($.status===200){var re=$.responseText;e.options.upload.linkToImgFormat&&(re=e.options.upload.linkToImgFormat($.responseText));var ne=JSON.parse(re);if(ne.code!==0)return void e.tip.show(ne.msg);var Y=ne.data.originalURL;if(e.currentMode==="sv")e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(Ee){Ee.textContent===Y&&(Ee.textContent=ne.data.url)});else{var le=e[e.currentMode].element.querySelector('img[src="'+Y+'"]');le.src=ne.data.url,e.currentMode==="ir"&&(le.previousElementSibling.previousElementSibling.innerHTML=ne.data.url)}ue(e)}else e.tip.show($.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback($.responseText)}},$.send(JSON.stringify({url:ie}))}return e.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'+Lute.EscapeHTMLStr(ie)+"</span>",Lute.WalkContinue]:e.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'+Lute.EscapeHTMLStr(ie)+"</span>",Lute.WalkContinue]},i.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+r+'">'+r+"</a>"&&i.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<!--StartFragment--><a href="'+r+'">'+r+"</a><!--EndFragment-->"||(i=""),(E=new DOMParser().parseFromString(i,"text/html")).body&&(i=E.body.innerHTML),i=Lute.Sanitize(i),e.wysiwyg.getComments(e),b=e[e.currentMode].element.scrollHeight,y=function(H,X,ie){ie===void 0&&(ie="sv");var $=document.createElement("div");$.innerHTML=H;var re=!1;$.childElementCount===1&&$.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(re=!0);var ne=$.querySelectorAll("pre");if($.childElementCount===1&&ne.length===1&&ne[0].className!=="vditor-wysiwyg"&&ne[0].className!=="vditor-sv"&&(re=!0),H.indexOf(`
- <p class="p1">`)===0&&(re=!0),$.childElementCount===1&&$.firstElementChild.tagName==="TABLE"&&$.querySelector(".line-number")&&$.querySelector(".line-content")&&(re=!0),re){var Y=X||H;return/\n/.test(Y)||ne.length===1?ie==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+Y.replace(/&/g,"&").replace(/</g,"<")+"<wbr></code></pre></div>":"\n```\n"+Y.replace(/&/g,"&").replace(/</g,"<")+"\n```":ie==="wysiwyg"?"<code>"+Y.replace(/&/g,"&").replace(/</g,"<")+"</code><wbr>":"`"+Y+"`"}return!1}(i,r,e.currentMode),(A=e.currentMode==="sv"?(0,f.a1)(t.target,"data-type","code-block"):(0,f.lG)(t.target,"CODE"))?(e.currentMode==="sv"?document.execCommand("insertHTML",!1,r.replace(/&/g,"&").replace(/</g,"<")):(R=(0,C.im)(t.target,e[e.currentMode].element),A.parentElement.tagName!=="PRE"&&(r+=m.g.ZWSP),A.textContent=A.textContent.substring(0,R.start)+r+A.textContent.substring(R.end),(0,C.$j)(R.start+r.length,R.start+r.length,A.parentElement),!((G=A.parentElement)===null||G===void 0)&&G.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview")&&(A.parentElement.nextElementSibling.innerHTML=A.outerHTML,ye(A.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return y?(n.pasteCode(y),[3,8]):[3,2];case 2:return i.trim()===""?[3,3]:((B=document.createElement("div")).innerHTML=i,B.querySelectorAll("[style]").forEach(function(H){H.removeAttribute("style")}),B.querySelectorAll(".vditor-copy").forEach(function(H){H.remove()}),e.currentMode==="ir"?(s.HTML2VditorIRDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,C.oC)(e.lute.HTML2VditorIRDOM(B.innerHTML),e)):e.currentMode==="wysiwyg"?(s.HTML2VditorDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,C.oC)(e.lute.HTML2VditorDOM(B.innerHTML),e)):(s.Md2VditorSVDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),nn(e,e.lute.HTML2Md(B.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return o.length>0?e.options.upload.url||e.options.upload.handler?[4,Pt(e,o)]:[3,5]:[3,7];case 4:return V.sent(),[3,6];case 5:_=new FileReader,"clipboardData"in t?(o=t.clipboardData.files,I=o[0]):t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items,I=o[0].getAsFile()),I&&I.type.startsWith("image")&&(_.readAsDataURL(I),_.onload=function(){var H="";e.currentMode==="wysiwyg"?H+='<img alt="'+I.name+'" src="'+_.result.toString()+`">
- `:H+="+`)
- `,document.execCommand("insertHTML",!1,H)}),V.label=6;case 6:return[3,8];case 7:r.trim()!==""&&o.length===0&&((z=(0,C.zh)(e)).toString()!==""&&e.lute.IsValidLinkDest(r)&&(r="["+z.toString()+"]("+r+")"),e.currentMode==="ir"?(s.Md2VditorIRDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,C.oC)(e.lute.Md2VditorIRDOM(r),e)):e.currentMode==="wysiwyg"?(s.Md2VditorDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,C.oC)(e.lute.Md2VditorDOM(r),e)):(s.Md2VditorSVDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),nn(e,r)),e.outline.render(e)),V.label=8;case 8:return e.currentMode!=="sv"&&((K=(0,f.F9)((0,C.zh)(e).startContainer))&&(z=(0,C.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(H){H.remove()}),z.insertNode(document.createElement("wbr")),e.currentMode==="wysiwyg"?K.outerHTML=e.lute.SpinVditorDOM(K.outerHTML):K.outerHTML=e.lute.SpinVditorIRDOM(K.outerHTML),(0,C.ib)(e[e.currentMode].element,z)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(H){ye(H,e)})),e.wysiwyg.triggerRemoveComment(e),ue(e),e[e.currentMode].element.scrollHeight-b>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&He(e),[2]}})})},Cn=function(e){e.hint.render(e);var t=(0,C.zh)(e).startContainer,n=(0,f.a1)(t,"data-type","code-block-info");if(n)if(n.textContent.replace(m.g.ZWSP,"")===""&&e.hint.recentLanguage)n.textContent=m.g.ZWSP+e.hint.recentLanguage,(0,C.zh)(e).selectNodeContents(n);else{var i=[],r=n.textContent.substring(0,(0,C.im)(n,e.ir.element).start).replace(m.g.ZWSP,"");m.g.CODE_LANGUAGES.forEach(function(o){o.indexOf(r.toLowerCase())>-1&&i.push({html:o,value:o})}),e.hint.genHTML(i,r,e)}},We=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Cn(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=u(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,a.pK)()&&(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)},mt=function(e,t){var n=(0,C.zh)(e),i=(0,f.F9)(n.startContainer)||n.startContainer;if(i){var r=i.querySelector(".vditor-ir__marker--heading");r?r.innerHTML=t:(i.insertAdjacentText("afterbegin",t),n.selectNodeContents(i),n.collapse(!1)),q(e,n.cloneRange()),lt(e)}},Lt=function(e,t,n){var i=(0,f.a1)(e.startContainer,"data-type",n);if(i){i.firstElementChild.remove(),i.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var r=document.createElement("div");r.innerHTML=t.lute.SpinVditorIRDOM(i.outerHTML),i.outerHTML=r.firstElementChild.innerHTML.trim()}},dr=function(e,t,n,i){var r=(0,C.zh)(e),o=t.getAttribute("data-type"),s=r.startContainer;s.nodeType===3&&(s=s.parentElement);var h=!0;if(t.classList.contains("vditor-menu--current"))if(o==="quote"){var E=(0,f.lG)(s,"BLOCKQUOTE");E&&(r.insertNode(document.createElement("wbr")),E.outerHTML=E.innerHTML.trim()===""?'<p data-block="0">'+E.innerHTML+"</p>":E.innerHTML)}else if(o==="link"){var b=(0,f.a1)(r.startContainer,"data-type","a");if(b){var y=(0,f.fb)(r.startContainer,"vditor-ir__link");y?(r.insertNode(document.createElement("wbr")),b.outerHTML=y.innerHTML):b.outerHTML=b.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else o==="italic"?Lt(r,e,"em"):o==="bold"?Lt(r,e,"strong"):o==="strike"?Lt(r,e,"s"):o==="inline-code"?Lt(r,e,"code"):o!=="check"&&o!=="list"&&o!=="ordered-list"||(wt(e,r,o),h=!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,C.ib)(e.ir.element,r));var A=(0,f.F9)(r.startContainer);if(o==="line"){if(A){var R=`<hr data-block="0"><p data-block="0"><wbr>
- </p>`;A.innerHTML.trim()===""?A.outerHTML=R:A.insertAdjacentHTML("afterend",R)}}else if(o==="quote")A&&(r.insertNode(document.createElement("wbr")),A.outerHTML='<blockquote data-block="0">'+A.outerHTML+"</blockquote>",h=!1,t.classList.add("vditor-menu--current"));else if(o==="link"){var B=void 0;B=r.toString()===""?n+"<wbr>"+i:""+n+r.toString()+i.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,B),h=!1,t.classList.add("vditor-menu--current")}else if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"){B=void 0,r.toString()===""?B=n+"<wbr>"+i:(B=o==="code"?n+`
- `+r.toString()+"<wbr>"+i:o==="table"?""+n+r.toString()+"<wbr>"+i:""+n+r.toString()+i+"<wbr>",r.deleteContents()),o!=="table"&&o!=="code"||(B=`
- `+B+`
- `);var _=document.createElement("span");_.innerHTML=B,r.insertNode(_),q(e,r),o==="table"&&(r.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,C.Hc)(r))}else o!=="check"&&o!=="list"&&o!=="ordered-list"||(wt(e,r,o,!1),h=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,C.ib)(e.ir.element,r),We(e),h&<(e)},ur=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(b){try{E(i.next(b))}catch(y){o(y)}}function h(b){try{E(i.throw(b))}catch(y){o(y)}}function E(b){var y;b.done?r(b.value):(y=b.value,y instanceof n?y:new n(function(A){A(y)})).then(s,h)}E((i=i.apply(e,t||[])).next())})},pr=function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(E){return function(b){return function(y){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&y[0]?i.return:y[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,y[1])).done)return r;switch(i=0,r&&(y=[2&y[0],r.value]),y[0]){case 0:case 1:r=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,i=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||y[0]!==6&&y[0]!==2)){s=0;continue}if(y[0]===3&&(!r||y[1]>r[0]&&y[1]<r[3])){s.label=y[1];break}if(y[0]===6&&s.label<r[1]){s.label=r[1],r=y;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(y);break}r[2]&&s.ops.pop(),s.trys.pop();continue}y=t.call(e,s)}catch(A){y=[6,A],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([E,b])}}},mr=function(){function e(t){var n=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(i,r){n.element.style.display="none";var o=decodeURIComponent(i.getAttribute("data-value")),s=window.getSelection().getRangeAt(0);if(r.currentMode==="ir"){var h=(0,f.a1)(s.startContainer,"data-type","code-block-info");if(h)return h.textContent=m.g.ZWSP+o.trimRight(),s.selectNodeContents(h),s.collapse(!1),We(r),h.parentElement.querySelectorAll("code").forEach(function(A){A.className="language-"+o.trimRight()}),ye(h.parentElement.querySelector(".vditor-ir__preview"),r),void(n.recentLanguage=o.trimRight())}if(r.currentMode==="wysiwyg"&&s.startContainer.nodeType!==3){var E=s.startContainer,b=void 0;if((b=E.classList.contains("vditor-input")?E:E.firstElementChild)&&b.classList.contains("vditor-input"))return b.value=o.trimRight(),s.selectNodeContents(b),s.collapse(!1),b.dispatchEvent(new CustomEvent("input",{detail:1})),void(n.recentLanguage=o.trimRight())}if(s.setStart(s.startContainer,n.lastIndex),s.deleteContents(),r.options.hint.parse?r.currentMode==="sv"?(0,C.oC)(r.lute.SpinVditorSVDOM(o),r):r.currentMode==="wysiwyg"?(0,C.oC)(r.lute.SpinVditorDOM(o),r):(0,C.oC)(r.lute.SpinVditorIRDOM(o),r):(0,C.oC)(o,r),n.splitChar===":"&&o.indexOf(":")>-1&&r.currentMode!=="sv"&&s.insertNode(document.createTextNode(" ")),s.collapse(!1),(0,C.Hc)(s),r.currentMode==="wysiwyg")(y=(0,f.fb)(s.startContainer,"vditor-wysiwyg__block"))&&y.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(y.lastElementChild.innerHTML=y.firstElementChild.innerHTML,ye(y.lastElementChild,r));else if(r.currentMode==="ir"){var y;(y=(0,f.fb)(s.startContainer,"vditor-ir__marker--pre"))&&y.nextElementSibling.classList.contains("vditor-ir__preview")&&(y.nextElementSibling.innerHTML=y.innerHTML,ye(y.nextElementSibling,r))}ue(r)},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 i,r=getSelection().getRangeAt(0);i=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(i,t.options.hint.extend);if(o===void 0)this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var s=o===""?t.options.hint.emoji:t.lute.GetEmojis(),h=[];Object.keys(s).forEach(function(E){E.indexOf(o.toLowerCase())===0&&(s[E].indexOf(".")>-1?h.push({html:'<img src="'+s[E]+'" title=":'+E+':"/> :'+E+":",value:":"+E+":"}):h.push({html:'<span class="vditor-hint__emoji">'+s[E]+"</span>"+E,value:s[E]}))}),this.genHTML(h,o,t)}else t.options.hint.extend.forEach(function(E){E.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){return ur(n,void 0,void 0,function(){var b;return pr(this,function(y){switch(y.label){case 0:return b=this.genHTML,[4,E.hint(o)];case 1:return b.apply(this,[y.sent(),o,t]),[2]}})})},t.options.hint.delay))})}},e.prototype.genHTML=function(t,n,i){var r=this;if(t.length!==0){var o=i[i.currentMode].element,s=(0,C.Ny)(o),h=s.left+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0),E=s.top,b="";t.forEach(function(A,R){if(!(R>7)){var B=A.html;if(n!==""){var _=B.lastIndexOf(">")+1,I=B.substr(_),K=I.toLowerCase().indexOf(n.toLowerCase());K>-1&&(I=I.substring(0,K)+"<b>"+I.substring(K,K+n.length)+"</b>"+I.substring(K+n.length),B=B.substr(0,_)+I)}b+='<button type="button" data-value="'+encodeURIComponent(A.value)+` "
- `+(R===0?"class='vditor-hint--current'":"")+"> "+B+"</button>"}}),this.element.innerHTML=b;var y=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=E+(y||22)+"px",this.element.style.left=h+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(A){A.addEventListener("click",function(R){r.fillEmoji(A,i),R.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=E-this.element.offsetHeight+"px"),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(t,n){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var i=this.element.querySelector(".vditor-hint--current");if(t.key==="ArrowDown")return t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.nextElementSibling?i.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(t.key==="ArrowUp"){if(t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.previousElementSibling)i.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,a.yl)(t)||t.shiftKey||t.altKey||t.key!=="Enter"||t.isComposing)&&(t.preventDefault(),t.stopPropagation(),this.fillEmoji(i,n),!0)},e.prototype.getKey=function(t,n){var i,r=this;if(this.lastIndex=-1,this.splitChar="",n.forEach(function(E){var b=t.lastIndexOf(E.key);r.lastIndex<b&&(r.splitChar=E.key,r.lastIndex=b)}),this.lastIndex===-1)return i;var o=t.split(this.splitChar),s=o[o.length-1];if(o.length>1&&s.trim()===s)if(o.length===2&&o[0]===""&&o[1].length<32)i=o[1];else{var h=o[o.length-2].slice(-1);(0,d.X)(h)===" "&&s.length<32&&(i=s)}return i},e}(),fr=function(){function e(t){this.composingLock=!1;var n=document.createElement("div");n.className="vditor-ir",n.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
- contenteditable="true" spellcheck="false"></pre>`,this.element=n.firstElementChild,this.bindEvent(t),Ht(t,this.element),tn(t,this.element),Nt(t,this.element),It(t,this.element),Rt(t,this.element),Dt(t,this.element),Ot(t,this.element,this.copy),jt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=document.createElement("div");r.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorIRDOM2Md(r.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){St(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,a.vU)()||q(t,getSelection().getRangeAt(0).cloneRange()),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop")return n.preventInput?(n.preventInput=!1,void We(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(n.composingLock||i.data==="‘"||i.data==="“"||i.data==="《"||q(t,getSelection().getRangeAt(0).cloneRange(),!1,i))}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT")return i.target.checked?i.target.setAttribute("checked","checked"):i.target.removeAttribute("checked"),n.preventInput=!0,void We(t);var r=(0,C.zh)(t),o=(0,f.fb)(i.target,"vditor-ir__preview");if(o||(o=(0,f.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,C.Hc)(r),He(t)),i.target.tagName==="IMG"){var s=i.target.parentElement.querySelector(".vditor-ir__marker--link");s&&(r.selectNode(s),(0,C.Hc)(r))}var h=(0,f.a1)(i.target,"data-type","a");if(!h||h.classList.contains("vditor-ir__node--expand")){if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&r.collapsed){var E=n.element.lastElementChild.getBoundingClientRect();i.y>E.top+E.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(m.g.ZWSP,"")===""?(r.selectNodeContents(n.element.lastElementChild),r.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,C.ib)(n.element,r)))}r.toString()===""?D(r,t):setTimeout(function(){D((0,C.zh)(t),t)}),ee(i,t),lt(t)}else t.options.link.click?t.options.link.click(h.querySelector(":scope > .vditor-ir__marker--link")):t.options.link.isOpen&&window.open(h.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,a.yl)(i))if(i.key==="Enter"&&He(t),lt(t),i.key!=="Backspace"&&i.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!==`
- `){var r=(0,C.zh)(t);i.key==="Backspace"?((0,a.vU)()&&r.startContainer.textContent===`
- `&&r.startOffset===1&&(r.startContainer.textContent="",D(r,t)),n.element.querySelectorAll(".language-math").forEach(function(s){var h=s.querySelector("br");h&&h.remove()})):i.key.indexOf("Arrow")>-1?(i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||Cn(t),D(r,t)):i.keyCode===229&&i.code===""&&i.key==="Unidentified"&&D(r,t);var o=(0,f.fb)(r.startContainer,"vditor-ir__preview");if(o){if(i.key==="ArrowUp"||i.key==="ArrowLeft")return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),i.preventDefault(),!0;if(o.tagName==="SPAN"&&(i.key==="ArrowDown"||i.key==="ArrowRight"))return o.parentElement.getAttribute("data-type")==="html-entity"?(o.parentElement.insertAdjacentText("afterend",m.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),i.preventDefault(),!0}}else t.ir.element.innerHTML=""})},e}(),Mn=function(e){return e.currentMode==="sv"?e.lute.Md2HTML(u(e)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},hr=W(895),_n=W(818),vr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+t+`</div>
- <div class="vditor-outline__content"></div>`}return e.prototype.render=function(t){return t.preview.element.style.display==="block"?(0,_n.k)(t.preview.element.lastElementChild,this.element.lastElementChild,t):(0,_n.k)(t[t.currentMode].element,this.element.lastElementChild,t)},e.prototype.toggle=function(t,n,i){var r;n===void 0&&(n=!0),i===void 0&&(i=!0);var o=(r=t.toolbar.elements.outline)===null||r===void 0?void 0:r.firstElementChild;if(n&&window.innerWidth>=m.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(t),o==null||o.classList.add("vditor-menu--current")):(this.element.style.display="none",o==null||o.classList.remove("vditor-menu--current")),i&&getSelection().rangeCount>0){var s=getSelection().getRangeAt(0);t[t.currentMode].element.contains(s.startContainer)&&(0,C.Hc)(s)}me(t)},e}(),gr=W(554),yr=function(){function e(t){var n=this;this.element=document.createElement("div"),this.element.className="vditor-preview";var i=document.createElement("div");i.className="vditor-reset",t.options.classes.preview&&i.classList.add(t.options.classes.preview),i.style.maxWidth=t.options.preview.maxWidth+"px",i.addEventListener("copy",function(b){if(b.target.tagName!=="TEXTAREA"){var y=document.createElement("div");y.className="vditor-reset",y.appendChild(getSelection().getRangeAt(0).cloneContents()),n.copyToX(t,y),b.preventDefault()}}),i.addEventListener("click",function(b){var y=(0,f.lG)(b.target,"SPAN");if(y&&(0,f.fb)(y,"vditor-toc")){var A=i.querySelector("#"+y.getAttribute("data-target-id"));A&&(n.element.scrollTop=A.offsetTop)}else{if(b.target.tagName==="A")return t.options.link.click?t.options.link.click(b.target):t.options.link.isOpen&&window.open(b.target.getAttribute("href")),void b.preventDefault();b.target.tagName==="IMG"&&(t.options.image.preview?t.options.image.preview(b.target):t.options.image.isPreview&&(0,U.E)(b.target,t.options.lang,t.options.theme))}});var r=t.options.preview.actions,o=document.createElement("div");o.className="vditor-preview__action";for(var s=[],h=0;h<r.length;h++){var E=r[h];if(typeof E!="object")switch(E){case"desktop":s.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":s.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":s.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":s.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":s.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>')}else s.push('<button type="button" data-type="'+E.key+'" class="'+E.className+'"'+(E.tooltip?' aria-label="'+E.tooltip+'"':"")+'">'+E.text+"</button>")}o.innerHTML=s.join(""),r.length===0&&(o.style.display="none"),this.element.appendChild(o),this.element.appendChild(i),o.addEventListener((0,a.Le)(),function(b){var y=(0,N.S)(b.target,"BUTTON");if(y){var A=y.getAttribute("data-type"),R=r.find(function(B){return(B==null?void 0:B.key)===A});R?R.click(A):A!=="mp-wechat"&&A!=="zhihu"?(i.style.width=A==="desktop"?"auto":A==="tablet"?"780px":"360px",i.scrollWidth>i.parentElement.clientWidth&&(i.style.width="auto"),n.render(t),o.querySelectorAll("button").forEach(function(B){B.classList.remove("vditor-preview__action--current")}),y.classList.add("vditor-preview__action--current")):n.copyToX(t,n.element.lastElementChild.cloneNode(!0),A)}})}return e.prototype.render=function(t,n){var i=this;if(clearTimeout(this.mdTimeoutId),this.element.style.display!=="none")if(n)this.element.lastElementChild.innerHTML=n;else if(u(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")!==""){var r=new Date().getTime(),o=u(t);this.mdTimeoutId=window.setTimeout(function(){if(t.options.preview.url){var s=new XMLHttpRequest;s.open("POST",t.options.preview.url),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE)if(s.status===200){var E=JSON.parse(s.responseText);if(E.code!==0)return void t.tip.show(E.msg);t.options.preview.transform&&(E.data=t.options.preview.transform(E.data)),i.element.lastElementChild.innerHTML=E.data,i.afterRender(t,r)}else{var b=t.lute.Md2HTML(o);t.options.preview.transform&&(b=t.options.preview.transform(b)),i.element.lastElementChild.innerHTML=b,i.afterRender(t,r)}},s.send(JSON.stringify({markdownText:o}))}else{var h=t.lute.Md2HTML(o);t.options.preview.transform&&(h=t.options.preview.transform(h)),i.element.lastElementChild.innerHTML=h,i.afterRender(t,r)}},t.options.preview.delay)}else this.element.lastElementChild.innerHTML="";else this.element.getAttribute("data-type")==="renderPerformance"&&t.tip.hide()},e.prototype.afterRender=function(t,n){t.options.preview.parse&&t.options.preview.parse(this.element);var i=new Date().getTime()-n;new Date().getTime()-n>2600?(t.tip.show(window.VditorI18n.performanceTip.replace("${x}",i.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 r=t.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,oe.O)(t.preview.element.lastElementChild),(0,pe.s)(t.options.preview.hljs,t.preview.element.lastElementChild,t.options.cdn),(0,he.i)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,Te.K)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,ae.P)(t.preview.element.lastElementChild,t.options.cdn),(0,ve.v)(t.preview.element.lastElementChild,t.options.cdn),(0,Z.p)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,Le.P)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,Ie.B)(t.preview.element.lastElementChild,t.options.cdn),(0,F.Q)(t.preview.element.lastElementChild,t.options.cdn),(0,gr.Y)(t.preview.element.lastElementChild);var o=t.preview.element,s=t.outline.render(t);s===""&&(s="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(h){h.innerHTML=s,(0,de.H)(h,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,de.H)(t.preview.element.lastElementChild,{cdn:t.options.cdn,math:t.options.preview.math})},e.prototype.copyToX=function(t,n,i){i===void 0&&(i="mp-wechat"),i!=="zhihu"?n.querySelectorAll(".katex-html .base").forEach(function(o){o.style.display="initial"}):n.querySelectorAll(".language-math").forEach(function(o){o.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'+o.getAttribute("data-math")+'\\" style="display: block; margin: 0 auto; max-width: 100%;">'}),n.style.backgroundColor="#fff",n.querySelectorAll("code").forEach(function(o){o.style.backgroundImage="none"}),this.element.append(n);var r=n.ownerDocument.createRange();r.selectNode(n),(0,C.Hc)(r),document.execCommand("copy"),this.element.lastElementChild.remove(),t.tip.show("已复制,可到"+(i==="zhihu"?"知乎":"微信公众号平台")+"进行粘贴")},e}(),br=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--"+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(i){var r=document,o=i.clientY,s=t.element.offsetHeight,h=63+t.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),n.element.classList.add("vditor-resize--selected"),r.onmousemove=function(E){t.options.resize.position==="top"?t.element.style.height=Math.max(h,s+(o-E.clientY))+"px":t.element.style.height=Math.max(h,s+(E.clientY-o))+"px",t.options.typewriterMode&&(t.sv.element.style.paddingBottom=t.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){t.options.resize.after&&t.options.resize.after(t.element.offsetHeight-s),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,n.element.classList.remove("vditor-resize--selected")}})},e}(),wr=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),Ht(t,this.element),Nt(t,this.element),It(t,this.element),Rt(t,this.element),Dt(t,this.element),Ot(t,this.element,this.copy),jt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){t.stopPropagation(),t.preventDefault(),t.clipboardData.setData("text/plain",ut(n[n.currentMode].element))},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){St(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("scroll",function(){if(t.preview.element.style.display==="block"){var i=n.element.scrollTop,r=n.element.clientHeight,o=n.element.scrollHeight-parseFloat(n.element.style.paddingBottom||"0"),s=t.preview.element;s.scrollTop=i/r>.5?(i+r)*s.scrollHeight/o-r:i*s.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,a.vU)()||se(t,i),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"&&!n.composingLock&&i.data!=="‘"&&i.data!=="“"&&i.data!=="《")return n.preventInput?(n.preventInput=!1,void De(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void se(t,i)}),this.element.addEventListener("keyup",function(i){i.isComposing||(0,a.yl)(i)||(i.key!=="Backspace"&&i.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!==`
- `?i.key==="Enter"&&He(t):t.sv.element.innerHTML="")})},e}(),Er=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(t,n){var i=this;n===void 0&&(n=6e3),this.element.className="vditor-tip vditor-tip--show",n===0?(this.element.innerHTML='<div class="vditor-tip__content">'+t+`
- <div class="vditor-tip__close">X</div></div>`,this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){i.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'+t+"</div>",setTimeout(function(){i.hide()},n)),this.element.removeAttribute("style"),setTimeout(function(){i.element.getBoundingClientRect().top<46&&(i.element.style.position="fixed",i.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),zt=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",c(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},kr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Sr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.preview.mode==="both"&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,a.Le)(),function(o){r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(o.preventDefault(),n.currentMode==="sv"&&(n.options.preview.mode==="both"?zt("editor",n):zt("both",n)))}),r}return kr(t,e),t}(Ce),Lr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},An=W(312),Tr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Cr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],s=document.createElement("div");s.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var h="";return m.g.CODE_THEME.forEach(function(E){h+="<button>"+E+"</button>"}),s.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+h+"</div>",s.addEventListener((0,a.Le)(),function(E){E.target.tagName==="BUTTON"&&(k(n,["subToolbar"]),n.options.preview.hljs.style=E.target.textContent,(0,An.Y)(E.target.textContent,n.options.cdn),E.preventDefault(),E.stopPropagation())}),r.element.appendChild(s),S(n,s,o,i.level),r}return Tr(t,e),t}(Ce),Mr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),_r=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],s=document.createElement("div");s.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var h="";return Object.keys(n.options.preview.theme.list).forEach(function(E){h+='<button data-type="'+E+'">'+n.options.preview.theme.list[E]+"</button>"}),s.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+h+"</div>",s.addEventListener((0,a.Le)(),function(E){E.target.tagName==="BUTTON"&&(k(n,["subToolbar"]),n.options.preview.theme.current=E.target.getAttribute("data-type"),(0,te.Z)(n.options.preview.theme.current,n.options.preview.theme.path),E.preventDefault(),E.stopPropagation())}),r.element.appendChild(s),S(n,s,o,i.level),r}return Mr(t,e),t}(Ce),Ar=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 i=n.endsWith(`
- `)?n.length-1:n.length;if(t.options.counter.type==="text"&&t[t.currentMode]){var r=t[t.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(o){o.remove()}),i=r.textContent.length}typeof t.options.counter.max=="number"?(i>t.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML=i+"/"+t.options.counter.max):this.element.innerHTML=""+i,this.element.setAttribute("aria-label",t.options.counter.type),t.options.counter.after&&t.options.counter.after(i,{enable:t.options.counter.enable,max:t.options.counter.max,type:t.options.counter.type})},e}(),xr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Hr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].innerHTML=i.icon,r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),o.currentTarget.classList.contains(m.g.CLASS_MENU_DISABLED)||i.click(o,n)}),r}return xr(t,e),t}(Ce),Nr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.firstElementChild.addEventListener((0,a.Le)(),function(o){var s=r.element.firstElementChild;s.classList.contains(m.g.CLASS_MENU_DISABLED)||(o.preventDefault(),s.classList.contains("vditor-menu--current")?(s.classList.remove("vditor-menu--current"),n.devtools.element.style.display="none",me(n)):(s.classList.add("vditor-menu--current"),n.devtools.element.style.display="block",me(n),n.devtools.renderEchart(n)))}),r}return Nr(t,e),t}(Ce),Or=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},jr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ir=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var s="";return Object.keys(n.options.hint.emoji).forEach(function(h){var E=n.options.hint.emoji[h];E.indexOf(".")>-1?s+='<button data-value=":'+h+': " data-key=":'+h+`:"><img
- data-value=":`+h+': " data-key=":'+h+':" class="vditor-emojis__icon" src="'+E+'"/></button>':s+='<button data-value="'+E+` "
- data-key="`+h+'"><span class="vditor-emojis__icon">'+E+"</span></button>"}),o.innerHTML='<div class="vditor-emojis" style="max-height: '+(n.options.height==="auto"?"auto":n.options.height-80)+'px">'+s+`</div><div class="vditor-emojis__tail">
- <span class="vditor-emojis__tip"></span><span>`+(n.options.hint.emojiTail||"")+`</span>
- </div>`,r.element.appendChild(o),S(n,o,r.element.firstElementChild,i.level),r.bindEvent(n),r}return jr(t,e),t.prototype.bindEvent=function(n){var i=this;this.element.lastElementChild.addEventListener((0,a.Le)(),function(r){var o=(0,N.S)(r.target,"BUTTON");if(o){r.preventDefault();var s=o.getAttribute("data-value"),h=(0,C.zh)(n),E=s;if(n.currentMode==="wysiwyg"?E=n.lute.SpinVditorDOM(s):n.currentMode==="ir"&&(E=n.lute.SpinVditorIRDOM(s)),s.indexOf(":")>-1&&n.currentMode!=="sv"){var b=document.createElement("div");b.innerHTML=E,E=b.firstElementChild.firstElementChild.outerHTML+" ",(0,C.oC)(E,n)}else h.extractContents(),h.insertNode(document.createTextNode(s));h.collapse(!1),(0,C.Hc)(h),i.element.lastElementChild.style.display="none",ue(n)}}),this.element.lastElementChild.addEventListener("mouseover",function(r){var o=(0,N.S)(r.target,"BUTTON");o&&(i.element.querySelector(".vditor-emojis__tip").innerHTML=o.getAttribute("data-key"))})},t}(Ce),xn=function(e,t,n){var i=document.createElement("a");"download"in i?(i.download=n,i.style.display="none",i.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(i),i.click(),i.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Rr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Pr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],s=document.createElement("div");return s.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),s.innerHTML=`<button data-type="markdown">Markdown</button>
- <button data-type="pdf">PDF</button>
- <button data-type="html">HTML</button>`,s.addEventListener((0,a.Le)(),function(h){var E=h.target;if(E.tagName==="BUTTON"){switch(E.getAttribute("data-type")){case"markdown":(function(b){var y=u(b);xn(b,y,y.substr(0,10)+".md")})(n);break;case"pdf":(function(b){b.tip.show(window.VditorI18n.generate,3800);var y=document.querySelector("#vditorExportIframe");y.contentDocument.open(),y.contentDocument.write('<link rel="stylesheet" href="'+b.options.cdn+`/dist/index.css"/>
- <script src="`+b.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, {
- markdown: {
- theme: "`+b.options.preview.theme+`"
- },
- hljs: {
- style: "`+b.options.preview.hljs.style+`"
- }
- });
- setTimeout(() => {
- window.print();
- }, 3600);
- }, false);
- <\/script>`),y.contentDocument.close(),setTimeout(function(){y.contentWindow.postMessage(u(b),"*")},200)})(n);break;case"html":(function(b){var y=Mn(b),A='<html><head><link rel="stylesheet" type="text/css" href="'+b.options.cdn+`/dist/index.css"/>
- <script src="`+b.options.cdn+"/dist/js/i18n/"+b.options.lang+`.js"><\/script>
- <script src="`+b.options.cdn+`/dist/method.min.js"><\/script></head>
- <body><div class="vditor-reset" id="preview">`+y+`</div>
- <script>
- const previewElement = document.getElementById('preview')
- Vditor.setContentTheme('`+b.options.preview.theme.current+"', '"+b.options.preview.theme.path+`');
- Vditor.codeRender(previewElement);
- Vditor.highlightRender(`+JSON.stringify(b.options.preview.hljs)+", previewElement, '"+b.options.cdn+`');
- Vditor.mathRender(previewElement, {
- cdn: '`+b.options.cdn+`',
- math: `+JSON.stringify(b.options.preview.math)+`,
- });
- Vditor.mermaidRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
- Vditor.markmapRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
- Vditor.flowchartRender(previewElement, '`+b.options.cdn+`');
- Vditor.graphvizRender(previewElement, '`+b.options.cdn+`');
- Vditor.chartRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
- Vditor.mindmapRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
- Vditor.abcRender(previewElement, '`+b.options.cdn+`');
- Vditor.mediaRender(previewElement);
- Vditor.speechRender(previewElement);
- <\/script>
- <script src="`+b.options.cdn+"/dist/js/icons/"+b.options.icon+'.js"><\/script></body></html>';xn(b,A,y.substr(0,10)+".html")})(n)}k(n,["subToolbar"]),h.preventDefault(),h.stopPropagation()}}),r.element.appendChild(s),S(n,s,o,i.level),r}return Rr(t,e),t}(Ce),Br=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),qr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n,i),r}return Br(t,e),t.prototype._bindEvent=function(n,i){this.element.children[0].addEventListener((0,a.Le)(),function(r){r.preventDefault(),n.element.className.includes("vditor--fullscreen")?(i.level||(this.innerHTML=i.icon),n.element.style.zIndex="",document.body.style.overflow="",n.element.classList.remove("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var s=n.toolbar.elements[o].firstChild;s&&(s.className=s.className.replace("__s","__n"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__s","__n"))):(i.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(o){var s=n.toolbar.elements[o].firstChild;s&&(s.className=s.className.replace("__n","__s"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__n","__s"))),n.devtools&&n.devtools.renderEchart(n),i.click&&i.click(r,n),me(n),be(n)})},t}(Ce),Vr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ur=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'+window.VditorI18n.heading1+" "+(0,a.ns)("<⌥⌘1>")+`</button>
- <button data-tag="h2" data-value="## ">`+window.VditorI18n.heading2+" <"+(0,a.ns)("⌥⌘2")+`></button>
- <button data-tag="h3" data-value="### ">`+window.VditorI18n.heading3+" <"+(0,a.ns)("⌥⌘3")+`></button>
- <button data-tag="h4" data-value="#### ">`+window.VditorI18n.heading4+" <"+(0,a.ns)("⌥⌘4")+`></button>
- <button data-tag="h5" data-value="##### ">`+window.VditorI18n.heading5+" <"+(0,a.ns)("⌥⌘5")+`></button>
- <button data-tag="h6" data-value="###### ">`+window.VditorI18n.heading6+" <"+(0,a.ns)("⌥⌘6")+"></button>",r.element.appendChild(o),r._bindEvent(n,o),r}return Vr(t,e),t.prototype._bindEvent=function(n,i){var r=this.element.children[0];r.addEventListener((0,a.Le)(),function(s){s.preventDefault(),clearTimeout(n.wysiwyg.afterRenderTimeoutId),clearTimeout(n.ir.processTimeoutId),clearTimeout(n.sv.processTimeoutId),r.classList.contains(m.g.CLASS_MENU_DISABLED)||(r.blur(),r.classList.contains("vditor-menu--current")?(n.currentMode==="wysiwyg"?(At(n),ke(n)):n.currentMode==="ir"&&mt(n,""),r.classList.remove("vditor-menu--current")):(k(n,["subToolbar"]),i.style.display="block"))});for(var o=0;o<6;o++)i.children.item(o).addEventListener((0,a.Le)(),function(s){s.preventDefault(),n.currentMode==="wysiwyg"?(vt(n,s.target.getAttribute("data-tag")),ke(n),r.classList.add("vditor-menu--current")):n.currentMode==="ir"?(mt(n,s.target.getAttribute("data-value")),r.classList.add("vditor-menu--current")):on(n,s.target.getAttribute("data-value")),i.style.display="none"})},t}(Ce),zr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Gr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.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)}),r}return zr(t,e),t}(Ce),Wr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Kr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var s=(0,C.zh)(n),h=(0,f.lG)(s.startContainer,"LI");h&&pn(n,h,s)}}),r}return Wr(t,e),t}(Ce),Fr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.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`+m.H+" / Lute v"+Lute.Version+`
- </li>
- <li>
- 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
- </li>
- </ul>
- </div>
- </div>`,0)}),r}return Fr(t,e),t}(Ce),Xr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||bt(n,"afterend")}),r}return Xr(t,e),t}(Ce),Yr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||bt(n,"beforebegin")}),r}return Yr(t,e),t}(Ce),$r=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ei=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var s=(0,C.zh)(n),h=(0,f.lG)(s.startContainer,"LI");h&&Bt(n,h,s,h.parentElement)}}),r}return $r(t,e),t}(Ce),ti=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ni=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),n.toolbar.elements.outline.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(n.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),n.outline.toggle(n,n.options.outline.enable))}),r}return ti(t,e),t}(Ce),ri=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ii=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return ri(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,a.Le)(),function(r){r.preventDefault();var o=i.element.firstElementChild;if(!o.classList.contains(m.g.CLASS_MENU_DISABLED)){var s=m.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);o.classList.contains("vditor-menu--current")?(o.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"),v(n.toolbar.elements,s),n.outline.render(n)):(L(n.toolbar.elements,s),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),o.classList.add("vditor-menu--current"),k(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),me(n)}})},t}(Ce),oi=function(){function e(t){var n;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,typeof AudioContext!="undefined")n=new AudioContext;else{if(!webkitAudioContext)return;n=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=n.sampleRate;var i=n.createGain();n.createMediaStreamSource(t).connect(i),this.recorder=n.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,i.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),i=new Float32Array(t.length),r=0;r<t.length;++r)i[r]=.5*(t[r]+n[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(i=this.downSampleBuffer(i,this.SAMPLE_RATE));var o=44+2*i.length,s=new ArrayBuffer(o),h=new DataView(s);this.writeUTFBytes(h,0,"RIFF"),h.setUint32(4,o,!0),this.writeUTFBytes(h,8,"WAVE"),this.writeUTFBytes(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,1,!0),h.setUint16(22,1,!0),h.setUint32(24,this.SAMPLE_RATE,!0),h.setUint32(28,2*this.SAMPLE_RATE,!0),h.setUint16(32,2,!0),h.setUint16(34,16,!0);var E=2*i.length;this.writeUTFBytes(h,36,"data"),h.setUint32(40,E,!0);for(var b=i.length,y=44,A=0;A<b;A++)h.setInt16(y,32767*i[A],!0),y+=2;return new Blob([h],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(t,n){if(n===this.DEFAULT_SAMPLE_RATE||n>this.DEFAULT_SAMPLE_RATE)return t;for(var i=this.DEFAULT_SAMPLE_RATE/n,r=Math.round(t.length/i),o=new Float32Array(r),s=0,h=0;s<o.length;){for(var E=Math.round((s+1)*i),b=0,y=0,A=h;A<E&&A<t.length;A++)b+=t[A],y++;o[s]=b/y,s++,h=E}return o},e.prototype.mergeBuffers=function(t){for(var n=new Float32Array(this.recordingLength),i=0,r=t.length,o=0;o<r;++o){var s=t[o];n.set(s,i),i+=s.length}return n},e.prototype.writeUTFBytes=function(t,n,i){for(var r=i.length,o=0;o<r;o++)t.setUint8(n+o,i.charCodeAt(o))},e}(),ai=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),si=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return ai(t,e),t.prototype._bindEvent=function(n){var i,r=this;this.element.children[0].addEventListener((0,a.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)){var s=n[n.currentMode].element;if(i)if(i.isRecording){i.stopRecording(),n.tip.hide();var h=new File([i.buildWavFileBlob()],"record"+new Date().getTime()+".wav",{type:"video/webm"});Pt(n,[h]),r.element.children[0].classList.remove("vditor-menu--current")}else n.tip.show(window.VditorI18n.recording),s.setAttribute("contenteditable","false"),i.startRecordingNewWavFile(),r.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(E){(i=new oi(E)).recorder.onaudioprocess=function(b){if(i.isRecording){var y=b.inputBuffer.getChannelData(0),A=b.inputBuffer.getChannelData(1);i.cloneChannelData(y,A)}},i.startRecordingNewWavFile(),n.tip.show(window.VditorI18n.recording),s.setAttribute("contenteditable","false"),r.element.children[0].classList.add("vditor-menu--current")}).catch(function(){n.tip.show(window.VditorI18n["record-tip"])})}})},t}(Ce),li=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ci=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.undo.redo(n)}),r}return li(t,e),t}(Ce),di=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ui=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.undo.undo(n)}),r}return di(t,e),t}(Ce),pi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),mi=function(e){function t(n,i){var r=e.call(this,n,i)||this,o='<input type="file"';return n.options.upload.multiple&&(o+=' multiple="multiple"'),n.options.upload.accept&&(o+=' accept="'+n.options.upload.accept+'"'),r.element.children[0].innerHTML=""+(i.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>')+o+">",r._bindEvent(n),r}return pi(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,a.Le)(),function(r){if(i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(r){if(i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault();r.target.files.length!==0&&Pt(n,r.target.files,r.target)})},t}(Ce),fi=function(){function e(t){var n=this,i=t.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",i.toolbar.forEach(function(r,o){var s=n.genItem(t,r,o);if(n.element.appendChild(s),r.toolbar){var h=document.createElement("div");h.className="vditor-hint vditor-panel--arrow",h.addEventListener((0,a.Le)(),function(E){h.style.display="none"}),r.toolbar.forEach(function(E,b){E.level=2,h.appendChild(n.genItem(t,E,o+b))}),s.appendChild(h),S(t,h,s.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 Ar(t),this.element.appendChild(t.counter.element))}return e.prototype.genItem=function(t,n,i){var r;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":r=new Ce(t,n);break;case"emoji":r=new Ir(t,n);break;case"headings":r=new Ur(t,n);break;case"|":r=new Or;break;case"br":r=new Lr;break;case"undo":r=new ui(t,n);break;case"redo":r=new ci(t,n);break;case"help":r=new Gr(t,n);break;case"both":r=new Sr(t,n);break;case"preview":r=new ii(t,n);break;case"fullscreen":r=new qr(t,n);break;case"upload":r=new mi(t,n);break;case"record":r=new si(t,n);break;case"info":r=new Jr(t,n);break;case"edit-mode":r=new $n(t,n);break;case"devtools":r=new Dr(t,n);break;case"outdent":r=new ei(t,n);break;case"indent":r=new Kr(t,n);break;case"outline":r=new ni(t,n);break;case"insert-after":r=new Zr(t,n);break;case"insert-before":r=new Qr(t,n);break;case"code-theme":r=new Cr(t,n);break;case"content-theme":r=new _r(t,n);break;case"export":r=new Pr(t,n);break;default:r=new Hr(t,n)}if(r){var o=n.name;return o!=="br"&&o!=="|"||(o+=i),this.elements[o]=r.element,r.element}},e}(),hi=W(14),vi=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new hi}return e.prototype.clearStack=function(t){this.resetStack(),this.resetIcon(t)},e.prototype.resetIcon=function(t){t.toolbar&&(this[t.currentMode].undoStack.length>1?v(t.toolbar.elements,["undo"]):L(t.toolbar.elements,["undo"]),this[t.currentMode].redoStack.length!==0?v(t.toolbar.elements,["redo"]):L(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,k(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,a.vU)()&&n.key==="Backspace"||(0,a.G6)())){var i=this.addCaret(t);i.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]=i,this[t.currentMode].lastText=i)}},e.prototype.addToUndoStack=function(t){var n=this.addCaret(t,!0),i=this.dmp.diff_main(n,this[t.currentMode].lastText,!0),r=this.dmp.patch_make(n,this[t.currentMode].lastText,i);r.length===0&&this[t.currentMode].undoStack.length>0||(this[t.currentMode].lastText=n,this[t.currentMode].undoStack.push(r),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,L(t.toolbar.elements,["redo"])),this[t.currentMode].undoStack.length>1&&v(t.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(t,n,i){var r;if(i===void 0&&(i=!1),i){var o=this.dmp.patch_deepCopy(t).reverse();o.forEach(function(h){h.diffs.forEach(function(E){E[0]=-E[0]})}),r=this.dmp.patch_apply(o,this[n.currentMode].lastText)[0]}else r=this.dmp.patch_apply(t,this[n.currentMode].lastText)[0];if(this[n.currentMode].lastText=r,n[n.currentMode].element.innerHTML=r,n.currentMode!=="sv"&&n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(h){ye(h,n)}),n[n.currentMode].element.querySelector("wbr"))(0,C.ib)(n[n.currentMode].element,n[n.currentMode].element.ownerDocument.createRange()),He(n);else{var s=getSelection().getRangeAt(0);s.setEndBefore(n[n.currentMode].element),s.collapse(!1)}ge(n),ue(n,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),nt(n),n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(h){ye(h,n)}),this[n.currentMode].undoStack.length>1?v(n.toolbar.elements,["undo"]):L(n.toolbar.elements,["undo"]),this[n.currentMode].redoStack.length!==0?v(n.toolbar.elements,["redo"]):L(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){var i;if(n===void 0&&(n=!1),getSelection().rangeCount!==0&&!t[t.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(t[t.currentMode].element.contains(r.startContainer)){i=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}t.ir.element.cloneNode(!0).querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='1']").forEach(function(h){(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 s=t[t.currentMode].element.innerHTML;return t[t.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(h){h.remove()}),n&&i&&(0,C.Hc)(i),s.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),gi=W(640),yi=function(){function e(t){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:m.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:m.g.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:m.g.HLJS_OPTIONS,markdown:m.g.MARKDOWN_OPTIONS,math:m.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:m.g.THEME_OPTIONS},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:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=t}return e.prototype.merge=function(){var t,n,i;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),!((i=this.options.hint)===null||i===void 0)&&i.emoji&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment));var r=(0,gi.T)(this.defaultOptions,this.options);if(r.cache.enable&&!r.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return r},e.prototype.mergeToolbar=function(t){var n=this,i=[{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"}],r=[];return t.forEach(function(o){var s=o;i.forEach(function(h){typeof o=="string"&&h.name===o&&(s=h),typeof o=="object"&&h.name===o.name&&(s=Object.assign({},h,o))}),o.toolbar&&(s.toolbar=n.mergeToolbar(o.toolbar)),r.push(s)}),r},e}(),bi=function(){function e(t){var n=this;this.composingLock=!1,this.commentIds=[];var i=document.createElement("div");i.className="vditor-wysiwyg",i.innerHTML='<pre class="vditor-reset" placeholder="'+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="`+window.VditorI18n.comment+`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
- <svg><use xlink:href="#vditor-icon-comment"></use></svg>
- </button>
- </div>`,this.element=i.firstElementChild,this.popover=i.firstElementChild.nextElementSibling,this.selectPopover=i.lastElementChild,this.bindEvent(t),Ht(t,this.element),tn(t,this.element),Nt(t,this.element),It(t,this.element),Rt(t,this.element),Dt(t,this.element),Ot(t,this.element,this.copy),jt(t,this.element,this.copy),t.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var r,o,s=Lute.NewNodeID(),h=getSelection().getRangeAt(0),E=h.cloneRange(),b=h.extractContents(),y=!1,A=!1;b.childNodes.forEach(function(_,I){var K=!1;if(_.nodeType===3?K=!0:_.classList.contains("vditor-comment")?_.classList.contains("vditor-comment")&&_.setAttribute("data-cmtids",_.getAttribute("data-cmtids")+" "+s):K=!0,K)if(_.nodeType!==3&&_.getAttribute("data-block")==="0"&&I===0&&E.startOffset>0)_.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+_.innerHTML+"</span>",r=_;else if(_.nodeType!==3&&_.getAttribute("data-block")==="0"&&I===b.childNodes.length-1&&E.endOffset<E.endContainer.textContent.length)_.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+_.innerHTML+"</span>",o=_;else if(_.nodeType!==3&&_.getAttribute("data-block")==="0")I===0?y=!0:I===b.childNodes.length-1&&(A=!0),_.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+_.innerHTML+"</span>";else{var z=document.createElement("span");z.classList.add("vditor-comment"),z.setAttribute("data-cmtids",s),_.parentNode.insertBefore(z,_),z.appendChild(_)}});var R=(0,f.F9)(E.startContainer);R&&(r?(R.insertAdjacentHTML("beforeend",r.innerHTML),r.remove()):R.textContent.trim().replace(m.g.ZWSP,"")===""&&y&&R.remove());var B=(0,f.F9)(E.endContainer);B&&(o?(B.insertAdjacentHTML("afterbegin",o.innerHTML),o.remove()):B.textContent.trim().replace(m.g.ZWSP,"")===""&&A&&B.remove()),h.insertNode(b),t.options.comment.add(s,h.toString(),n.getComments(t,!0)),ke(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),n.hideComment()})}return e.prototype.getComments=function(t,n){var i=this;if(n===void 0&&(n=!1),t.currentMode!=="wysiwyg"||!t.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(o){i.commentIds=i.commentIds.concat(o.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return n?(this.commentIds.forEach(function(o){r.push({id:o,top:i.element.querySelector('.vditor-comment[data-cmtids="'+o+'"]').offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(t){var n,i,r;if(t.currentMode==="wysiwyg"&&t.options.comment.enable&&t.wysiwyg.commentIds.length>0){var o=JSON.parse(JSON.stringify(this.commentIds));this.getComments(t);var s=(n=o,i=this.commentIds,r=new Set(i),n.filter(function(h){return!r.has(h)}));s.length>0&&t.options.comment.remove(s)}},e.prototype.showComment=function(){var t=(0,C.Ny)(this.element);this.selectPopover.setAttribute("style","left:"+t.left+"px;display:block;top:"+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 i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=(0,f.lG)(i.startContainer,"CODE"),o=(0,f.lG)(i.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var s="";return s=r.parentElement.tagName==="PRE"?i.toString():"`"+i.toString()+"`",t.clipboardData.setData("text/plain",s),void t.clipboardData.setData("text/html","")}var h=(0,f.lG)(i.startContainer,"A"),E=(0,f.lG)(i.endContainer,"A");if(h&&E&&E.isSameNode(h)){var b=h.getAttribute("title")||"";return b&&(b=' "'+b+'"'),t.clipboardData.setData("text/plain","["+i.toString()+"]("+h.getAttribute("href")+b+")"),void t.clipboardData.setData("text/html","")}var y=document.createElement("div");y.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorDOM2Md(y.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(k(t,["hint"]),n.popover.style.display==="block"&&n.selectPopover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10);if(t.options.height==="auto"){if(t.options.toolbarConfig.pin){var r=Math.max(i,window.scrollY-t.element.offsetTop-8)+"px";n.popover.style.display==="block"&&(n.popover.style.top=r),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=r)}}else if(t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0){var o=Math.max(window.scrollY-t.element.offsetTop-8,Math.min(i-t.wysiwyg.element.scrollTop,n.element.clientHeight-21))+"px";n.popover.style.display==="block"&&(n.popover.style.top=o),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(k(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 i=parseInt(n.popover.getAttribute("data-top"),10)-t.wysiwyg.element.scrollTop,r=-8;t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0&&(r=window.scrollY-t.element.offsetTop+r);var o=Math.max(r,Math.min(i,n.element.clientHeight-21))+"px";n.popover.style.top=o,n.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(i){St(t,i,{pasteCode:function(r){var o=(0,C.zh)(t),s=document.createElement("template");s.innerHTML=r,o.insertNode(s.content.cloneNode(!0));var h=(0,f.a1)(o.startContainer,"data-block","0");h?h.outerHTML=t.lute.SpinVditorDOM(h.outerHTML):t.wysiwyg.element.innerHTML=t.lute.SpinVditorDOM(t.wysiwyg.element.innerHTML),(0,C.ib)(t.wysiwyg.element,o)}})}),this.element.addEventListener("compositionstart",function(){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){var r=(0,N.W)(getSelection().getRangeAt(0).startContainer);r&&r.textContent===""?ge(t):((0,a.vU)()||yt(t,getSelection().getRangeAt(0).cloneRange(),i),n.composingLock=!1)}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"){if(n.preventInput)return n.preventInput=!1,void ke(t);if(n.composingLock||i.data==="‘"||i.data==="“"||i.data==="《")ke(t);else{var r=getSelection().getRangeAt(0),o=(0,f.F9)(r.startContainer);if(o||(Qt(t,r),o=(0,f.F9)(r.startContainer)),o){for(var s=(0,C.im)(o,t.wysiwyg.element,r).start,h=!0,E=s-1;E>o.textContent.substr(0,s).lastIndexOf(`
- `);E--)if(o.textContent.charAt(E)!==" "&&o.textContent.charAt(E)!==" "){h=!1;break}s===0&&(h=!1);var b=!0;for(E=s-1;E<o.textContent.length;E++)if(o.textContent.charAt(E)!==" "&&o.textContent.charAt(E)!==`
- `){b=!1;break}var y=(0,N.W)(getSelection().getRangeAt(0).startContainer);y&&y.textContent===""&&(ge(t),y.remove()),h&&o.getAttribute("data-type")!=="code-block"||b||Vt(o.innerHTML)||qt(o.innerHTML)&&o.previousElementSibling?typeof t.options.input=="function"&&t.options.input(u(t)):yt(t,r,i)}}}}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT"){var r=i.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),n.preventInput=!0,void ke(t)}if(i.target.tagName!=="IMG"||i.target.parentElement.classList.contains("vditor-wysiwyg__preview")){if(i.target.tagName==="A")return t.options.link.click?t.options.link.click(i.target):t.options.link.isOpen&&window.open(i.target.getAttribute("href")),void i.preventDefault();var o=(0,C.zh)(t);if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&o.collapsed){var s=n.element.lastElementChild.getBoundingClientRect();i.y>s.top+s.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(m.g.ZWSP,"")===""?(o.selectNodeContents(n.element.lastElementChild),o.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,C.ib)(n.element,o)))}Ze(t);var h=(0,f.fb)(i.target,"vditor-wysiwyg__preview");h||(h=(0,f.fb)((0,C.zh)(t).startContainer,"vditor-wysiwyg__preview")),h&&ct(h,t),ee(i,t)}else i.target.getAttribute("data-type")==="link-ref"?$t(t,i.target):function(E,b){var y=E.target;b.wysiwyg.popover.innerHTML="";var A=function(){y.setAttribute("src",B.value),y.setAttribute("alt",I.value),y.setAttribute("title",z.value)},R=document.createElement("span");R.setAttribute("aria-label",window.VditorI18n.imageURL),R.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");R.appendChild(B),B.className="vditor-input",B.setAttribute("placeholder",window.VditorI18n.imageURL),B.value=y.getAttribute("src")||"",B.oninput=function(){A()},B.onkeydown=function(G){Oe(b,G)};var _=document.createElement("span");_.setAttribute("aria-label",window.VditorI18n.alternateText),_.className="vditor-tooltipped vditor-tooltipped__n";var I=document.createElement("input");_.appendChild(I),I.className="vditor-input",I.setAttribute("placeholder",window.VditorI18n.alternateText),I.style.width="52px",I.value=y.getAttribute("alt")||"",I.oninput=function(){A()},I.onkeydown=function(G){Oe(b,G)};var K=document.createElement("span");K.setAttribute("aria-label",window.VditorI18n.title),K.className="vditor-tooltipped vditor-tooltipped__n";var z=document.createElement("input");K.appendChild(z),z.className="vditor-input",z.setAttribute("placeholder",window.VditorI18n.title),z.value=y.getAttribute("title")||"",z.oninput=function(){A()},z.onkeydown=function(G){Oe(b,G)},Be(y,b),b.wysiwyg.popover.insertAdjacentElement("beforeend",R),b.wysiwyg.popover.insertAdjacentElement("beforeend",_),b.wysiwyg.popover.insertAdjacentElement("beforeend",K),Pe(b,y)}(i,t)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,a.yl)(i)){i.key==="Enter"&&He(t),i.key!=="Backspace"&&i.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 r=(0,C.zh)(t);if(i.key==="Backspace"&&(0,a.vU)()&&r.startContainer.textContent===`
- `&&r.startOffset===1&&(r.startContainer.textContent=""),Qt(t,r),Ze(t),i.key==="ArrowDown"||i.key==="ArrowRight"||i.key==="Backspace"||i.key==="ArrowLeft"||i.key==="ArrowUp"){i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||t.hint.render(t);var o=(0,f.fb)(r.startContainer,"vditor-wysiwyg__preview");if(!o&&r.startContainer.nodeType!==3&&r.startOffset>0&&(h=r.startContainer).classList.contains("vditor-wysiwyg__block")&&(o=h.lastElementChild),o)if(o.previousElementSibling.style.display!=="none"){var s=o.previousElementSibling;if(s.tagName==="PRE"&&(s=s.firstElementChild),i.key==="ArrowDown"||i.key==="ArrowRight"){var h,E=function(y){for(var A=y;A&&!A.nextSibling;)A=A.parentElement;return A.nextSibling}(h=o.parentElement);if(E&&E.nodeType!==3){var b=E.querySelector(".vditor-wysiwyg__preview");if(b)return void ct(b,t)}if(E.nodeType===3){for(;E.textContent.length===0&&E.nextSibling;)E=E.nextSibling;r.setStart(E,1)}else r.setStart(E.firstChild,0)}else r.selectNodeContents(s),r.collapse(!1)}else i.key==="ArrowDown"||i.key==="ArrowRight"?ct(o,t):ct(o,t,!1)}}})},e}(),wi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ei=function(e){function t(n,i){var r=e.call(this)||this;r.version=m.H,typeof n=="string"&&(i?i.cache?i.cache.id||(i.cache.id="vditor"+n):i.cache={id:"vditor"+n}:i={cache:{id:"vditor"+n}},n=document.getElementById(n));var o=new yi(i).merge();if(o.i18n)window.VditorI18n=o.i18n,r.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))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var s="vditorI18nScript",h=s+o.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(E){E.id!==h&&document.head.removeChild(E)}),(0,l.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",h).then(function(){r.init(n,o)})}return r}return wi(t,e),t.prototype.setTheme=function(n,i,r,o){this.vditor.options.theme=n,Q(this.vditor),i&&(this.vditor.options.preview.theme.current=i,(0,te.Z)(i,o||this.vditor.options.preview.theme.path)),r&&(this.vditor.options.preview.hljs.style=r,(0,An.Y)(r,this.vditor.options.cdn))},t.prototype.getValue=function(){return u(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(){k(this.vditor,["subToolbar","hint","popover"]),L(this.vditor.toolbar.elements,m.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){v(this.vditor.toolbar.elements,m.g.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(){return this.vditor.currentMode==="wysiwyg"?ut(this.vditor.wysiwyg.element):this.vditor.currentMode==="sv"?ut(this.vditor.sv.element):this.vditor.currentMode==="ir"?ut(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(n){this.vditor.preview.render(this.vditor,n)},t.prototype.getCursorPosition=function(){return(0,C.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){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 Mn(this.vditor)},t.prototype.tip=function(n,i){this.vditor.tip.show(n,i)},t.prototype.setPreviewMode=function(n){zt(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,i){i===void 0&&(i=!0);var r=(0,C.zh)(this.vditor);r.collapse(!0);var o=document.createElement("template");o.innerHTML=n,r.insertNode(o.content.cloneNode(!0)),this.vditor.currentMode==="sv"?(this.vditor.sv.preventInput=!0,i&&se(this.vditor)):this.vditor.currentMode==="wysiwyg"?(this.vditor.wysiwyg.preventInput=!0,i&&yt(this.vditor,getSelection().getRangeAt(0))):this.vditor.currentMode==="ir"&&(this.vditor.ir.preventInput=!0,i&&q(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(n,i){var r=this;i===void 0&&(i=!1),this.vditor.currentMode==="sv"?(this.vditor.sv.element.innerHTML="<div data-block='0'>"+this.vditor.lute.SpinVditorSVDOM(n)+"</div>",De(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):this.vditor.currentMode==="wysiwyg"?en(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(o){ye(o,r.vditor)}),We(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),n||(k(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),i&&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(),ce(),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 i=function(r){r.classList.remove("vditor-comment--hover"),n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.unHlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.removeCommentIds=function(n){var i=this;if(this.vditor.currentMode==="wysiwyg"){var r=function(o,s){var h=o.getAttribute("data-cmtids").split(" ");h.find(function(E,b){if(E===s)return h.splice(b,1),!0}),h.length===0?(o.outerHTML=o.innerHTML,(0,C.zh)(i.vditor).collapse(!0)):o.setAttribute("data-cmtids",h.join(" "))};n.forEach(function(o){i.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(s){r(s,o)}),i.vditor.preview.element.style.display!=="none"&&i.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(s){r(s,o)})}),ke(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(n,i){var r=this;this.vditor={currentMode:i.mode,element:n,hint:new mr(i.hint.extend),lute:void 0,options:i,originalInnerHTML:n.innerHTML,outline:new vr(window.VditorI18n.outline),tip:new Er},this.vditor.sv=new wr(this.vditor),this.vditor.undo=new vi,this.vditor.wysiwyg=new bi(this.vditor),this.vditor.ir=new fr(this.vditor),this.vditor.toolbar=new fi(this.vditor),i.resize.enable&&(this.vditor.resize=new br(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new g),(i.upload.url||i.upload.handler)&&(this.vditor.upload=new ir),(0,l.G)(i._lutePath||i.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){r.vditor.lute=(0,hr.X)({autoSpace:r.vditor.options.preview.markdown.autoSpace,gfmAutoLink:r.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:r.vditor.options.preview.markdown.codeBlockPreview,emojiSite:r.vditor.options.hint.emojiPath,emojis:r.vditor.options.hint.emoji,fixTermTypo:r.vditor.options.preview.markdown.fixTermTypo,footnotes:r.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:r.vditor.options.preview.math.inlineDigit,linkBase:r.vditor.options.preview.markdown.linkBase,linkPrefix:r.vditor.options.preview.markdown.linkPrefix,listStyle:r.vditor.options.preview.markdown.listStyle,mark:r.vditor.options.preview.markdown.mark,mathBlockPreview:r.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:r.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:r.vditor.options.preview.markdown.sanitize,toc:r.vditor.options.preview.markdown.toc}),r.vditor.preview=new yr(r.vditor),function(o){o.element.innerHTML="",o.element.classList.add("vditor"),o.options.rtl&&o.element.setAttribute("dir","rtl"),Q(o),(0,te.Z)(o.options.preview.theme.current,o.options.preview.theme.path),typeof o.options.height=="number"?o.element.style.height=o.options.height+"px":o.element.style.height=o.options.height,typeof o.options.minHeight=="number"&&(o.element.style.minHeight=o.options.minHeight+"px"),typeof o.options.width=="number"?o.element.style.width=o.options.width+"px":o.element.style.width=o.options.width,o.element.appendChild(o.toolbar.element);var s=document.createElement("div");if(s.className="vditor-content",o.options.outline.position==="left"&&s.appendChild(o.outline.element),s.appendChild(o.wysiwyg.element.parentElement),s.appendChild(o.sv.element),s.appendChild(o.ir.element.parentElement),s.appendChild(o.preview.element),o.toolbar.elements.devtools&&s.appendChild(o.devtools.element),o.options.outline.position==="right"&&(o.outline.element.classList.add("vditor-outline--right"),s.appendChild(o.outline.element)),o.upload&&s.appendChild(o.upload.element),o.options.resize.enable&&s.appendChild(o.resize.element),s.appendChild(o.hint.element),s.appendChild(o.tip.element),o.element.appendChild(s),s.addEventListener("click",function(){k(o,["subToolbar"])}),o.toolbar.elements.export&&o.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),Ye(o,o.options.mode,Zn(o)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&window.visualViewport!==void 0){var h=!1,E=function(b){h||(h=!0,requestAnimationFrame(function(){h=!1;var y=o.toolbar.element;y.style.transform="none",y.getBoundingClientRect().top<0&&(y.style.transform="translate(0, "+-y.getBoundingClientRect().top+"px)")}))};window.visualViewport.addEventListener("scroll",E),window.visualViewport.addEventListener("resize",E)}}(r.vditor),i.after&&i.after(),i.icon&&(0,l.J)(i.cdn+"/dist/js/icons/"+i.icon+".js","vditorIconScript")})},t}(T.default)})(),xe=xe.default})()})})(Jn);var qi=Jn.exports;const Vi=zn(qi);const Ue=(_e,we="default")=>{const fe=_e==="dark";switch(we){case"default":return fe?"dark":"classic";case"content":return fe?"dark":"light";case"code":return fe?"dracula":"github"}},Ui=Jt({inheritAttrs:!1,__name:"Markdown",props:{height:{type:Number,default:360},value:{type:String,default:""}},emits:["change","get","update:value"],setup(_e,{emit:we}){const fe=_e,Ae=Oi(),W=$e(null),xe=$e(null),j=$e(!1),T=Di(),{getLocale:m}=xi(),{getDarkMode:d}=qn(),u=$e(fe.value||"");Mt([()=>d.value,()=>j.value],([p,v])=>{var L;v&&((L=a.getVditor())==null||L.setTheme(Ue(p),Ue(p,"content"),Ue(p,"code")))},{immediate:!0,flush:"post"}),Mt(()=>fe.value,p=>{var v;p!==u.value&&((v=a.getVditor())==null||v.setValue(p)),u.value=p});const l=Gn(()=>{let p;switch(Ge(m)){case"en":p="en_US";break;case"ja":p="ja_JP";break;case"ko":p="ko_KR";break;default:p="zh_CN"}return p});function g(){const p=Ge(W);if(!p)return;const v=Ct(Ct({},Ae),fe),L=new Vi(p,Pn(Ct({theme:Ue(d.value),lang:Ge(l),mode:"sv",fullscreen:{index:520},preview:{theme:{current:Ue(d.value,"content")},hljs:{style:Ue(d.value,"code")},actions:[]},input:w=>{u.value=w,we("update:value",w),we("change",w)},after:()=>{ji(()=>{var w;(w=T==null?void 0:T.redoModalHeight)==null||w.call(T),L.setValue(u.value),xe.value=L,j.value=!0,we("get",a)})},blur:()=>{}},v),{cache:{enable:!1}}))}const a={getVditor:()=>xe.value};function c(){var v;const p=Ge(xe);if(p){try{(v=p==null?void 0:p.destroy)==null||v.call(p)}catch(L){}xe.value=null,j.value=!1}}return Fn(g),Wn(c),Kn(c),(p,v)=>(ht(),_t("div",{ref_key:"wrapRef",ref:W},null,512))}});var Xn={exports:{}};(function(_e,we){(function(fe,Ae){_e.exports=Ae()})(Un,function(){return(()=>{var fe={54:(j,T,m)=>{m.d(T,{g:()=>d});var d=function(){function u(){}return u.ZWSP="",u.DROP_EDITOR="application/editor",u.MOBILE_WIDTH=520,u.CLASS_MENU_DISABLED="vditor-menu--disabled",u.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"],u.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],u.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],u.CDN="https://unpkg.com/vditor@3.9.4",u.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},u.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},u.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},u.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:u.CDN+"/dist/css/content-theme"},u}()},478:(j,T,m)=>{m.d(T,{Q:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.abcRenderAdapter.getElements(a);p.length>0&&(0,u.G)(c+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){p.forEach(function(v){v.parentElement.classList.contains("vditor-wysiwyg__pre")||v.parentElement.classList.contains("vditor-ir__marker--pre")||v.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(v,l.abcRenderAdapter.getCode(v).trim()),v.style.overflowX="auto",v.setAttribute("data-processed","true"))})})}},156:(j,T,m)=>{m.r(T),m.d(T,{mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,markmapRenderAdapter:()=>l,mindmapRenderAdapter:()=>g,chartRenderAdapter:()=>a,abcRenderAdapter:()=>c,graphvizRenderAdapter:()=>p,flowchartRenderAdapter:()=>v,plantumlRenderAdapter:()=>L});var d={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-math")}},u={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-mermaid")}},l={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-markmap")}},g={getCode:function(w){return w.getAttribute("data-code")},getElements:function(w){return w.querySelectorAll(".language-mindmap")}},a={getCode:function(w){return w.innerText},getElements:function(w){return w.querySelectorAll(".language-echarts")}},c={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-abc")}},p={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-graphviz")}},v={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-flowchart")}},L={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-plantuml")}}},314:(j,T,m)=>{m.d(T,{p:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.chartRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.chartRenderAdapter.getCode(L).trim();if(w)try{if(L.getAttribute("data-processed")==="true")return;var M=JSON.parse(w);echarts.init(L,p==="dark"?"dark":void 0).setOption(M),L.setAttribute("data-processed","true")}catch(k){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+k}}})})}},730:(j,T,m)=>{m.d(T,{O:()=>l});var d=m(51),u=m(54),l=function(g){g.querySelectorAll("pre > code").forEach(function(a,c){var p,v,L;if(!a.parentElement.classList.contains("vditor-wysiwyg__pre")&&!a.parentElement.classList.contains("vditor-ir__marker--pre")&&!(a.classList.contains("language-mermaid")||a.classList.contains("language-flowchart")||a.classList.contains("language-echarts")||a.classList.contains("language-mindmap")||a.classList.contains("language-plantuml")||a.classList.contains("language-markmap")||a.classList.contains("language-abc")||a.classList.contains("language-graphviz")||a.classList.contains("language-math")||a.style.maxHeight.indexOf("px")>-1||g.classList.contains("vditor-preview")&&c>5)){var w=a.innerText;if(a.classList.contains("highlight-chroma")){var M=document.createElement("code");M.innerHTML=a.innerHTML,M.querySelectorAll(".highlight-ln").forEach(function(N){N.remove()}),w=M.innerText}else w.endsWith(`
- `)&&(w=w.substr(0,w.length-1));var k='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(k='<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="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"复制")+`"
- onmouseover="this.setAttribute('aria-label', '`+(((v=window.VditorI18n)===null||v===void 0?void 0:v.copy)||"复制")+`')"
- class="vditor-tooltipped vditor-tooltipped__w"
- onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"已复制")+`')">`+k+"</span>";var f=document.createElement("textarea");f.value=(0,d.X)(w),S.insertAdjacentElement("afterbegin",f),a.before(S),a.style.maxHeight=window.outerHeight-40+"px",a.insertAdjacentHTML("afterend",'<span style="position: absolute">'+u.g.ZWSP+"</span>")}})}},66:(j,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.flowchartRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){p.forEach(function(v){if(v.getAttribute("data-processed")!=="true"){var L=flowchart.parse(l.flowchartRenderAdapter.getCode(v));v.innerHTML="",L.drawSVG(v),v.setAttribute("data-processed","true")}})})}},218:(j,T,m)=>{m.d(T,{v:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.graphvizRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){p.forEach(function(v){var L=l.graphvizRenderAdapter.getCode(v);if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")&&v.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var w=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),M=(window.URL||window.webkitURL).createObjectURL(w),k=new Worker(M);new Viz({worker:k}).renderSVGElement(L).then(function(S){v.innerHTML=S.outerHTML}).catch(function(S){v.innerHTML="graphviz render error: <br>"+S,v.className="vditor-reset--error"})}catch(S){console.error("graphviz error",S)}v.setAttribute("data-processed","true")}})})}},702:(j,T,m)=>{m.d(T,{s:()=>g});var d=m(54),u=m(526),l=m(578),g=function(a,c,p){c===void 0&&(c=document),p===void 0&&(p=d.g.CDN);var v=a.style;d.g.CODE_THEME.includes(v)||(v="github");var L=document.getElementById("vditorHljsStyle"),w=p+"/dist/js/highlight.js/styles/"+v+".css";L&&L.href!==w&&L.remove(),(0,l.c)(p+"/dist/js/highlight.js/styles/"+v+".css","vditorHljsStyle"),a.enable!==!1&&c.querySelectorAll("pre > code").length!==0&&(0,u.G)(p+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){c.querySelectorAll("pre > code").forEach(function(M){if(!M.parentElement.classList.contains("vditor-ir__marker--pre")&&!M.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(M.classList.contains("language-mermaid")||M.classList.contains("language-flowchart")||M.classList.contains("language-echarts")||M.classList.contains("language-mindmap")||M.classList.contains("language-plantuml")||M.classList.contains("language-abc")||M.classList.contains("language-graphviz")||M.classList.contains("language-math"))&&(a.defaultLang!==""&&M.className.indexOf("language-")===-1&&M.classList.add("language-"+a.defaultLang),hljs.highlightElement(M),a.lineNumber)){M.classList.add("vditor-linenumber");var k=M.querySelector(".vditor-linenumber__temp");k||((k=document.createElement("div")).className="vditor-linenumber__temp",M.insertAdjacentElement("beforeend",k));var S=getComputedStyle(M).whiteSpace,f=!1;S!=="pre-wrap"&&S!=="pre-line"||(f=!0);var N="",O=M.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(F){var Z="";f&&(k.textContent=F||`
- `,Z=' style="height:'+k.getBoundingClientRect().height+'px"'),N+="<span"+Z+"></span>"}),k.style.display="none",N='<span class="vditor-linenumber__rows">'+N+"</span>",M.insertAdjacentHTML("beforeend",N)}})})})})}},563:(j,T,m)=>{m.d(T,{K:()=>c});var d=m(54),u=m(526),l=m(156),g={},a=function(p,v){var L=window.markmap,w=L.Transformer,M=L.Markmap,k=L.deriveOptions,S=(L.globalCSS,new w);p.innerHTML='<svg style="width:100%"></svg>';var f=p.firstChild,N=M.create(f,null),O=function(ae,ve){var pe=ae.transform(ve),de=Object.keys(pe.features).filter(function(ye){return!g[ye]});de.forEach(function(ye){g[ye]=!0});var he=ae.getAssets(de),Te=he.styles,Le=he.scripts,Ie=window.markmap;return Te&&Ie.loadCSS(Te),Le&&Ie.loadJS(Le),pe}(S,v),F=O.root,Z=O.frontmatter,oe=k(Z==null?void 0:Z.markmap);N.setData(F,oe),N.fit()},c=function(p,v,L){v===void 0&&(v=d.g.CDN);var w=l.markmapRenderAdapter.getElements(p);w.length!==0&&(0,u.G)(v+"/src/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){w.forEach(function(M){var k=l.markmapRenderAdapter.getCode(M);if(M.getAttribute("data-processed")!=="true"&&k.trim()!==""){var S=document.createElement("div");S.className="language-markmap",M.parentNode.appendChild(S),a(S,k),M.parentNode.childNodes[0].nodeName=="CODE"&&M.parentNode.removeChild(M.parentNode.childNodes[0])}})})}},466:(j,T,m)=>{m.d(T,{H:()=>c});var d=m(54),u=m(526),l=m(578),g=m(51),a=m(156),c=function(p,v){var L=a.mathRenderAdapter.getElements(p);if(L.length!==0){var w={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(v&&v.math&&(v.math=Object.assign({},w.math,v.math)),(v=Object.assign({},w,v)).math.engine==="KaTeX")(0,l.c)(v.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,u.G)(v.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then(function(){(0,u.G)(v.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then(function(){L.forEach(function(k){if(!k.parentElement.classList.contains("vditor-wysiwyg__pre")&&!k.parentElement.classList.contains("vditor-ir__marker--pre")&&!k.getAttribute("data-math")){var S=(0,g.X)(a.mathRenderAdapter.getCode(k));k.setAttribute("data-math",S);try{k.innerHTML=katex.renderToString(S,{displayMode:k.tagName==="DIV",output:"html"})}catch(f){k.innerHTML=f.message,k.className="language-math vditor-reset--error"}k.addEventListener("copy",function(f){f.stopPropagation(),f.preventDefault();var N=f.currentTarget.closest(".language-math");f.clipboardData.setData("text/html",N.innerHTML),f.clipboardData.setData("text/plain",N.getAttribute("data-math"))})}})})});else if(v.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:v.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:v.math.macros}}),(0,u.J)(v.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var M=function(k,S){var f=(0,g.X)(k.textContent).trim(),N=window.MathJax.getMetricsFor(k);N.display=k.tagName==="DIV",window.MathJax.tex2svgPromise(f,N).then(function(O){k.innerHTML="",k.setAttribute("data-math",f),k.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var F=O.querySelector('[data-mml-node="merror"]');F&&F.textContent.trim()!==""&&(k.innerHTML=F.textContent.trim(),k.className="vditor-reset--error"),S&&S()})};window.MathJax.startup.promise.then(function(){for(var k=[],S=function(N){var O=L[N];O.parentElement.classList.contains("vditor-wysiwyg__pre")||O.parentElement.classList.contains("vditor-ir__marker--pre")||O.getAttribute("data-math")||!(0,g.X)(O.textContent).trim()||k.push(function(F){N===L.length-1?M(O):M(O,F)})},f=0;f<L.length;f++)S(f);(function(N){if(N.length!==0){var O=0,F=N[N.length-1],Z=function(){var oe=N[O++];oe===F?oe():oe(Z)};Z()}})(k)})}}}},554:(j,T,m)=>{m.d(T,{Y:()=>d});var d=function(u){u&&u.querySelectorAll("a").forEach(function(l){var g=l.getAttribute("href");g&&(g.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<video controls="controls" src="'+c+'"></video>'),a.remove()}(l,g):g.match(/^.+.(mp3|wav|flac)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+c+'"></audio>'),a.remove()}(l,g):function(a,c){var p=c.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),v=c.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),L=c.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),w=c.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),M=c.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=c.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),S=c.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),f=c.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);p&&p[1].length===11?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+p[1]+(p[2]?"?start="+p[2]:"")+'"></iframe>'),a.remove()):v&&v[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+v[1]+'"></iframe>'),a.remove()):L&&L[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+L[1]+'"></iframe>'),a.remove()):w&&w[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="//coub.com/embed/`+w[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),a.remove()):M&&M[0]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(M[0])+'"></iframe>'),a.remove()):k&&k[2]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),a.remove()):S&&S[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
- src="//player.bilibili.com/player.html?bvid=`+S[1]+'"></iframe>'),a.remove()):f&&f[1]&&(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+f[1]+'"></iframe>'),a.remove())}(l,g))})}},40:(j,T,m)=>{m.d(T,{i:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){c===void 0&&(c=d.g.CDN);var v=l.mermaidRenderAdapter.getElements(a);v.length!==0&&(0,u.G)(c+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var L={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8},gantt:{leftPadding:75,rightPadding:20}};p==="dark"&&(L.theme="dark"),mermaid.initialize(L),v.forEach(function(w){var M=l.mermaidRenderAdapter.getCode(w);w.getAttribute("data-processed")!=="true"&&M.trim()!==""&&(mermaid.init(void 0,w),w.setAttribute("data-processed","true"))})})}},749:(j,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.mindmapRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.mindmapRenderAdapter.getCode(L);if(w)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(w))],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(M,k){var S;return!((S=k==null?void 0:k.data)===null||S===void 0)&&S.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(M){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+M}}})})}},818:(j,T,m)=>{m.d(T,{k:()=>l});var d=m(64),u=m(466),l=function(g,a,c){var p="",v=[];if(Array.from(g.children).forEach(function(k,S){if((0,d.W)(k)){if(c){var f=k.id.lastIndexOf("_");k.id=k.id.substring(0,f===-1?void 0:f)+"_"+S}v.push(k.id),p+=k.outerHTML.replace("<wbr>","")}}),p==="")return a.innerHTML="","";var L=document.createElement("div");if(c)c.lute.SetToC(!0),c.currentMode!=="wysiwyg"||c.preview.element.contains(g)?c.currentMode!=="ir"||c.preview.element.contains(g)?L.innerHTML=c.lute.HTML2VditorDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorIRDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorDOM("<p>[ToC]</p>"+p),c.lute.SetToC(c.options.preview.markdown.toc);else{a.classList.add("vditor-outline");var w=Lute.New();w.SetToC(!0),L.innerHTML=w.HTML2VditorDOM("<p>[ToC]</p>"+p)}var M=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return M.forEach(function(k,S){if(k.nextElementSibling&&k.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>'),k.innerHTML=f+"<span>"+k.innerHTML+"</span>"}else k.innerHTML="<svg></svg><span>"+k.innerHTML+"</span>";k.setAttribute("data-target-id",v[S])}),p=L.firstElementChild.innerHTML,M.length===0?(a.innerHTML="",p):(a.innerHTML=p,c&&(0,u.H)(a,{cdn:c.options.cdn,math:c.options.preview.math}),a.firstElementChild.addEventListener("click",function(k){for(var S=k.target;S&&!S.isEqualNode(a);){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")),k.preventDefault(),k.stopPropagation();break}if(S.getAttribute("data-target-id")){k.preventDefault(),k.stopPropagation();var f=document.getElementById(S.getAttribute("data-target-id"));if(!f)return;if(c)if(c.options.height==="auto"){var N=f.offsetTop+c.element.offsetTop;c.options.toolbarConfig.pin||(N+=c.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,N)}else c.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,c.element.offsetTop),c.preview.element.contains(g)?g.parentElement.scrollTop=f.offsetTop:g.scrollTop=f.offsetTop;else window.scrollTo(window.scrollX,f.offsetTop);break}S=S.parentElement}}),p)}},408:(j,T,m)=>{m.d(T,{B:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.plantumlRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){p.forEach(function(v){if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")){var L=l.plantumlRenderAdapter.getCode(v).trim();if(L)try{v.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'">'}catch(w){v.className="vditor-reset--error",v.innerHTML="plantuml render error: <br>"+w}}})})}},895:(j,T,m)=>{m.d(T,{X:()=>d});var d=function(u){var l=Lute.New();return l.PutEmojis(u.emojis),l.SetEmojiSite(u.emojiSite),l.SetHeadingAnchor(u.headingAnchor),l.SetInlineMathAllowDigitAfterOpenMarker(u.inlineMathDigit),l.SetAutoSpace(u.autoSpace),l.SetToC(u.toc),l.SetFootnotes(u.footnotes),l.SetFixTermTypo(u.fixTermTypo),l.SetVditorCodeBlockPreview(u.codeBlockPreview),l.SetVditorMathBlockPreview(u.mathBlockPreview),l.SetSanitize(u.sanitize),l.SetChineseParagraphBeginningSpace(u.paragraphBeginningSpace),l.SetRenderListStyle(u.listStyle),l.SetLinkBase(u.linkBase),l.SetLinkPrefix(u.linkPrefix),l.SetMark(u.mark),l.SetGFMAutoLink(u.gfmAutoLink),u.lazyLoadImage&&l.SetImageLazyLoading(u.lazyLoadImage),l}},863:(j,T,m)=>{m.d(T,{E:()=>d});var d=function(u,l,g){g===void 0&&(g="classic");var a=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(g==="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>
- `+window.VditorI18n.spin+`
- </span>
- <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
- X `+window.VditorI18n.close+`
- </span>
- </div>
- <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
- <img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+a.left+"px, "+(a.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
- </div>
- </div>`),document.body.style.overflow="hidden";var c=document.querySelector(".vditor-img img"),p="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-u.naturalHeight)/2+"px, 0)";setTimeout(function(){c.setAttribute("style","transition: transform .3s ease-in-out;transform: "+p),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)});var v=document.querySelector(".vditor-img__btn");v.addEventListener("click",function(){var L=parseInt(v.getAttribute("data-deg"),10)+90;L/90%2==1&&u.naturalWidth>c.parentElement.clientHeight?c.style.transform="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+(u.naturalWidth/2-u.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":c.style.transform=p+" rotateZ("+L+"deg)",v.setAttribute("data-deg",L.toString()),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)})}},312:(j,T,m)=>{m.d(T,{Y:()=>l});var d=m(54),u=m(578),l=function(g,a){a===void 0&&(a=d.g.CDN),d.g.CODE_THEME.includes(g)||(g="github");var c=document.getElementById("vditorHljsStyle"),p=a+"/dist/js/highlight.js/styles/"+g+".css";c?c.href!==p&&(c.remove(),(0,u.c)(p,"vditorHljsStyle")):(0,u.c)(p,"vditorHljsStyle")}},227:(j,T,m)=>{m.d(T,{Z:()=>u});var d=m(578),u=function(l,g){if(l&&g){var a=document.getElementById("vditorContentTheme"),c=g+"/"+l+".css";a?a.getAttribute("href")!==c&&(a.remove(),(0,d.c)(c,"vditorContentTheme")):(0,d.c)(c,"vditorContentTheme")}}},526:(j,T,m)=>{m.d(T,{J:()=>d,G:()=>u});var d=function(l,g){if(document.getElementById(g))return!1;var a=new XMLHttpRequest;a.open("GET",l,!1),a.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),a.send("");var c=document.createElement("script");c.type="text/javascript",c.text=a.responseText,c.id=g,document.head.appendChild(c)},u=function(l,g){return new Promise(function(a,c){if(document.getElementById(g))return a(),!1;var p=document.createElement("script");p.src=l,p.async=!0,document.head.appendChild(p),p.onload=function(){if(document.getElementById(g))return p.remove(),a(),!1;p.id=g,a()}})}},578:(j,T,m)=>{m.d(T,{c:()=>d});var d=function(u,l){if(!document.getElementById(l)){var g=document.createElement("link");g.id=l,g.rel="stylesheet",g.type="text/css",g.href=u,document.getElementsByTagName("head")[0].appendChild(g)}}},51:(j,T,m)=>{m.d(T,{X:()=>d});var d=function(u){return u.replace(/\u00a0/g," ")}},827:(j,T,m)=>{m.d(T,{lG:()=>d,fb:()=>u});var d=function(l,g){if(!l)return!1;l.nodeType===3&&(l=l.parentElement);for(var a=l,c=!1;a&&!c&&!a.classList.contains("vditor-reset");)a.nodeName===g?c=!0:a=a.parentElement;return c&&a},u=function(l,g){if(!l)return!1;l.nodeType===3&&(l=l.parentElement);for(var a=l,c=!1;a&&!c&&!a.classList.contains("vditor-reset");)a.classList.contains(g)?c=!0:a=a.parentElement;return c&&a}},64:(j,T,m)=>{m.d(T,{W:()=>d});var d=function(u){var l=function(g,a){if(!g)return!1;g.nodeType===3&&(g=g.parentElement);for(var c=g,p=!1;c&&!p&&!c.classList.contains("vditor-reset");)c.nodeName.indexOf(a)===0?p=!0:c=c.parentElement;return p&&c}(u,"H");return!(!l||l.tagName.length!==2||l.tagName==="HR")&&l}},640:(j,T,m)=>{m.d(T,{T:()=>d});var d=function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];for(var g={},a=function(p){for(var v in p)p.hasOwnProperty(v)&&(Object.prototype.toString.call(p[v])==="[object Object]"?g[v]=d(g[v],p[v]):g[v]=p[v])},c=0;c<u.length;c++)a(u[c]);return g}},393:(j,T,m)=>{m.d(T,{Hc:()=>d}),m(54);var d=function(u){var l=window.getSelection();l.removeAllRanges(),l.addRange(u)}}},Ae={};function W(j){var T=Ae[j];if(T!==void 0)return T.exports;var m=Ae[j]={exports:{}};return fe[j](m,m.exports,W),m.exports}W.d=(j,T)=>{for(var m in T)W.o(T,m)&&!W.o(j,m)&&Object.defineProperty(j,m,{enumerable:!0,get:T[m]})},W.o=(j,T)=>Object.prototype.hasOwnProperty.call(j,T),W.r=j=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})};var xe={};return(()=>{W.d(xe,{default:()=>ye});var j=W(478),T=W(156),m=W(314),d=W(730),u=W(66),l=W(218),g=W(702),a=function(C){C===void 0&&(C=document);var ge=function(ee){var x=document.createElement("img");x.src=ee.getAttribute("data-src"),x.addEventListener("load",function(){ee.getAttribute("style")||ee.getAttribute("class")||ee.getAttribute("width")||ee.getAttribute("height")||x.naturalHeight>x.naturalWidth&&x.naturalWidth/x.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&x.naturalHeight>window.innerHeight-40&&(ee.style.height=window.innerHeight-40+"px"),ee.src=x.src}),ee.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return C.querySelectorAll("img").forEach(function(ee){ee.getAttribute("data-src")&&ge(ee)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),C.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(ee){ee.forEach(function(x){(x.isIntersecting===void 0?x.intersectionRatio!==0:x.isIntersecting)&&x.target.getAttribute("data-src")&&ge(x.target)})}),C.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)}))},c=W(466),p=W(554),v=W(40),L=W(563),w=W(749),M=W(818),k=W(408),S=W(54),f=W(227),N=W(526),O=W(827),F=W(640),Z=W(895),oe=W(393),ae=function(C,ge){if(ge===void 0&&(ge="zh_CN"),typeof speechSynthesis!="undefined"&&typeof SpeechSynthesisUtterance!="undefined"){var ee='<svg><use xlink:href="#vditor-icon-play"></use></svg>',x='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(ee='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',x='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var q=document.querySelector(".vditor-speech");if(!q){(q=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",q);var P=function(){var U,se;return speechSynthesis.getVoices().forEach(function(te){te.lang===ge.replace("_","-")&&(U=te),te.default&&(se=te)}),U||(U=se),U};speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=P);var D=P();q.onclick=function(){if(q.className==="vditor-speech"){var U=new SpeechSynthesisUtterance(q.getAttribute("data-text"));U.voice=D,U.onend=function(){q.className="vditor-speech",speechSynthesis.cancel(),q.innerHTML=ee},speechSynthesis.speak(U),q.className="vditor-speech vditor-speech--current",q.innerHTML=x}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),q.innerHTML=x):(speechSynthesis.pause(),q.innerHTML=ee));(0,oe.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",function(){getSelection().toString().trim()===""&&q.style.display==="block"&&(q.className="vditor-speech",speechSynthesis.cancel(),q.style.display="none")})}C.addEventListener("mouseup",function(U){var se=getSelection().toString().trim();if(speechSynthesis.cancel(),getSelection().toString().trim()!==""){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var te=getSelection().getRangeAt(0).getBoundingClientRect();q.innerHTML=ee,q.style.display="block",q.style.top=te.top+te.height+document.querySelector("html").scrollTop-20+"px",q.style.left=U.clientX+2+"px",q.setAttribute("data-text",se)}else q.style.display==="block"&&(q.className="vditor-speech",q.style.display="none")})}},ve=function(C,ge,ee,x){return new(ee||(ee=Promise))(function(q,P){function D(te){try{se(x.next(te))}catch(Q){P(Q)}}function U(te){try{se(x.throw(te))}catch(Q){P(Q)}}function se(te){var Q;te.done?q(te.value):(Q=te.value,Q instanceof ee?Q:new ee(function(me){me(Q)})).then(D,U)}se((x=x.apply(C,ge||[])).next())})},pe=function(C,ge){var ee,x,q,P,D={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return P={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function U(se){return function(te){return function(Q){if(ee)throw new TypeError("Generator is already executing.");for(;D;)try{if(ee=1,x&&(q=2&Q[0]?x.return:Q[0]?x.throw||((q=x.return)&&q.call(x),0):x.next)&&!(q=q.call(x,Q[1])).done)return q;switch(x=0,q&&(Q=[2&Q[0],q.value]),Q[0]){case 0:case 1:q=Q;break;case 4:return D.label++,{value:Q[1],done:!1};case 5:D.label++,x=Q[1],Q=[0];continue;case 7:Q=D.ops.pop(),D.trys.pop();continue;default:if(q=D.trys,!((q=q.length>0&&q[q.length-1])||Q[0]!==6&&Q[0]!==2)){D=0;continue}if(Q[0]===3&&(!q||Q[1]>q[0]&&Q[1]<q[3])){D.label=Q[1];break}if(Q[0]===6&&D.label<q[1]){D.label=q[1],q=Q;break}if(q&&D.label<q[2]){D.label=q[2],D.ops.push(Q);break}q[2]&&D.ops.pop(),D.trys.pop();continue}Q=ge.call(C,D)}catch(me){Q=[6,me],x=0}finally{ee=q=0}if(5&Q[0])throw Q[1];return{value:Q[0]?Q[1]:void 0,done:!0}}([se,te])}}},de=function(C){var ge={anchor:0,cdn:S.g.CDN,customEmoji:{},emojiPath:(C&&C.emojiPath||S.g.CDN)+"/dist/images/emoji",hljs:S.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:S.g.MARKDOWN_OPTIONS,math:S.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:S.g.THEME_OPTIONS};return(0,F.T)(ge,C)},he=function(C,ge){var ee=de(ge);return(0,N.G)(ee.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var x=(0,Z.X)({autoSpace:ee.markdown.autoSpace,gfmAutoLink:ee.markdown.gfmAutoLink,codeBlockPreview:ee.markdown.codeBlockPreview,emojiSite:ee.emojiPath,emojis:ee.customEmoji,fixTermTypo:ee.markdown.fixTermTypo,footnotes:ee.markdown.footnotes,headingAnchor:ee.anchor!==0,inlineMathDigit:ee.math.inlineDigit,lazyLoadImage:ee.lazyLoadImage,linkBase:ee.markdown.linkBase,linkPrefix:ee.markdown.linkPrefix,listStyle:ee.markdown.listStyle,mark:ee.markdown.mark,mathBlockPreview:ee.markdown.mathBlockPreview,paragraphBeginningSpace:ee.markdown.paragraphBeginningSpace,sanitize:ee.markdown.sanitize,toc:ee.markdown.toc});return ge!=null&&ge.renderers&&x.SetJSRenderers({renderers:{Md2HTML:ge.renderers}}),x.SetHeadingID(!0),x.Md2HTML(C)})},Te=function(C,ge,ee){return ve(void 0,void 0,void 0,function(){var x,q,P;return pe(this,function(D){switch(D.label){case 0:return x=de(ee),[4,he(ge,x)];case 1:if(q=D.sent(),x.transform&&(q=x.transform(q)),C.innerHTML=q,C.classList.add("vditor-reset"),x.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(x.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return P="vditorI18nScript"+x.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(se){se.id!==P&&document.head.removeChild(se)}),[4,(0,N.G)(x.cdn+"/dist/js/i18n/"+x.lang+".js",P)];case 3:D.sent(),D.label=4;case 4:return[3,6];case 5:window.VditorI18n=x.i18n,D.label=6;case 6:return x.icon?[4,(0,N.G)(x.cdn+"/dist/js/icons/"+x.icon+".js","vditorIconScript")]:[3,8];case 7:D.sent(),D.label=8;case 8:return(0,f.Z)(x.theme.current,x.theme.path),x.anchor===1&&C.classList.add("vditor-reset--anchor"),(0,d.O)(C),(0,g.s)(x.hljs,C,x.cdn),(0,c.H)(C,{cdn:x.cdn,math:x.math}),(0,v.i)(C,x.cdn,x.mode),(0,L.K)(C,x.cdn,x.mode),(0,u.P)(C,x.cdn),(0,l.v)(C,x.cdn),(0,m.p)(C,x.cdn,x.mode),(0,w.P)(C,x.cdn,x.mode),(0,k.B)(C,x.cdn),(0,j.Q)(C,x.cdn),(0,p.Y)(C),x.speech.enable&&ae(C),x.anchor!==0&&(U=x.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(se){U===1&&se.classList.add("vditor-anchor--left"),se.onclick=function(){var te=se.getAttribute("href").substr(1),Q=document.getElementById("vditorAnchor-"+te).offsetTop;document.querySelector("html").scrollTop=Q}}),window.onhashchange=function(){var se=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));se&&(document.querySelector("html").scrollTop=se.offsetTop)}),x.after&&x.after(),x.lazyLoadImage&&a(C),C.addEventListener("click",function(se){var te=(0,O.lG)(se.target,"SPAN");if(te&&(0,O.fb)(te,"vditor-toc")){var Q=C.querySelector("#"+te.getAttribute("data-target-id"));Q&&window.scrollTo(window.scrollX,Q.offsetTop)}}),[2]}var U})})},Le=W(863),Ie=W(312);const ye=function(){function C(){}return C.adapterRender=T,C.previewImage=Le.E,C.codeRender=d.O,C.graphvizRender=l.v,C.highlightRender=g.s,C.mathRender=c.H,C.mermaidRender=v.i,C.markmapRender=L.K,C.flowchartRender=u.P,C.chartRender=m.p,C.abcRender=j.Q,C.mindmapRender=w.P,C.plantumlRender=k.B,C.outlineRender=M.k,C.mediaRender=p.Y,C.speechRender=ae,C.lazyLoadImageRender=a,C.md2html=he,C.preview=Te,C.setCodeTheme=Ie.Y,C.setContentTheme=f.Z,C}()})(),xe=xe.default})()})})(Xn);var zi=Xn.exports;const Ft=zn(zi),Gi=Jt({__name:"MarkdownViewer",props:{value:{type:String},class:{type:String}},setup(_e){const we=_e,fe=$e(null),Ae=$e(null),{getDarkMode:W}=qn();function xe(){const T=Ge(fe);Ae.value=Ft.preview(T,we.value,{mode:Ue(W.value,"content"),theme:{current:Ue(W.value,"content")},hljs:{style:Ue(W.value,"code")}})}Mt(()=>W.value,T=>{Ft.setContentTheme(Ue(T,"content")),Ft.setCodeTheme(Ue(T,"code")),xe()}),Mt(()=>we.value,(T,m)=>{T!==m&&xe()});function j(){var m;const T=Ge(Ae);if(T){try{(m=T==null?void 0:T.destroy)==null||m.call(T)}catch(d){}Ae.value=null}}return Fn(xe),Wn(j),Kn(j),(T,m)=>(ht(),_t("div",{ref_key:"viewerRef",ref:fe,id:"markdownViewer",class:Ii(T.$props.class)},null,2))}});Vn(Ui);const Wi=Vn(Gi),Ki={key:0},Fi={key:1},Ji="1000px",Xi=Jt({__name:"AiDrawer",emits:["success","register"],setup(_e,{emit:we}){const fe=Gn(()=>"AI护理建议"),Ae=$e(""),[W,{setDrawerProps:xe,closeDrawer:j}]=Mi(m=>Kt(this,null,function*(){xe({confirmLoading:!1}),Ae.value="";const d=yield Ai(m.record.id);Ae.value=d}));function T(){return Kt(this,null,function*(){try{j(),we("success")}finally{xe({confirmLoading:!1})}})}return(m,d)=>(ht(),Ri(Ge(_i),Bi(m.$attrs,{destroyOnClose:"",onRegister:Ge(W),title:fe.value,width:Ji,onCancel:T,showFooter:!0,cancelText:"关闭","show-ok-btn":!1}),{default:Pi(()=>[Ae.value?(ht(),_t("div",Ki,[Bn(Ge(Wi),{value:Ae.value},null,8,["value"])])):(ht(),_t("div",Fi,[Bn(Ge(Ni),{active:""})]))]),_:1},16,["onRegister","title"]))}});const oo=Hi(Xi,[["__scopeId","data-v-26828017"]]);export{oo as default};
|