@nocobase/plugin-field-markdown-vditor 2.0.0-alpha.6 → 2.0.0-alpha.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react"),require("@nocobase/flow-engine"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/utils/client"),require("antd")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-markdown-vditor",["react-i18next","react","@nocobase/flow-engine","@nocobase/client","@formily/react","@nocobase/utils/client","antd"],t):"object"==typeof exports?exports["@nocobase/plugin-field-markdown-vditor"]=t(require("react-i18next"),require("react"),require("@nocobase/flow-engine"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/utils/client"),require("antd")):e["@nocobase/plugin-field-markdown-vditor"]=t(e["react-i18next"],e.react,e["@nocobase/flow-engine"],e["@nocobase/client"],e["@formily/react"],e["@nocobase/utils/client"],e.antd)}(self,function(e,t,n,r,o,i,a){return function(){var l,s,d,c,u,p,f={607:function(e,t,n){"use strict";n.d(t,{s:function(){return h}});var r=n(505),o=n(772),i=n(721),a=n(156),l=n.n(a),s=n(825),d=n.n(s),c=n(731),u=n(418);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=function(e){if(e){var t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}};function v(e){var t,n=(0,a.useRef)(null),r=(0,u.Z)(),o=r.wrapSSR,i=r.componentCls,s=r.hashId,p=(0,c.S)();return(0,a.useEffect)(function(){var t;d().preview(n.current,null!=(t=e.value)?t:"",{mode:"light",cdn:p}),setTimeout(function(){var e;null==(e=n.current)||e.querySelectorAll("img").forEach(function(e){e.style.cursor="zoom-in",e.addEventListener("click",function(){var t=e.src;if(!document.getElementById("custom-image-preview")){var n=document.createElement("span");n.id="custom-image-preview",Object.assign(n.style,{position:"fixed",inset:"0",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"9999",cursor:"zoom-out"});var r=document.createElement("img");r.src=t,Object.assign(r.style,{maxWidth:"90%",maxHeight:"90%",borderRadius:"8px",boxShadow:"0 0 20px rgba(0,0,0,0.5)",transition:"transform 0.2s",cursor:"zoom-out"}),n.addEventListener("click",function(){document.body.removeChild(n)}),n.appendChild(r),document.body.appendChild(n)}})})},0)},[e.value]),o(l().createElement("span",{className:"".concat(s," ").concat(i)},l().createElement("span",{ref:n,style:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({border:"none"},null!=(t=null==e?void 0:e.style)?t:{})})))}var h=(0,o.withDynamicSchemaProps)(function(e){var t,n=(0,r.useField)(),o=null!=(t=e.value)?t:null==n?void 0:n.value,s=(0,c.S)(),u=(0,a.useRef)(),p=f((0,a.useState)(!1),2),h=p[0],g=p[1],b=f((0,a.useState)(!1),2),y=b[0],w=b[1],k=f((0,a.useState)(""),2),E=k[0],x=k[1],_=(0,a.useRef)();(0,a.useEffect)(function(){if(e.value&&(!n||(null==n?void 0:n.value)))if(e.ellipsis)d().md2html(e.value,{mode:"light",cdn:s}).then(function(e){var t,n;x(((t=document.createElement("div")).innerHTML=e,n=t.innerText,t=null,(null==n?void 0:n.replace(/[\n\r]/g,""))||""))}).catch(function(){return x("")});else{var t;d().preview(u.current,null!=(t=e.value)?t:null==n?void 0:n.value,{mode:"light",cdn:s})}},[e.value,e.ellipsis,null==n?void 0:n.value]);var S=(0,a.useCallback)(function(){var e;return!!_.current&&m(_.current)>(null==(e=_.current)?void 0:e.offsetWidth)},[_]);return e.ellipsis?l().createElement(i.Popover,{open:h,onOpenChange:function(e){g(y&&e)},content:l().createElement(v,{value:o,style:{maxWidth:500,maxHeight:400,overflowY:"auto"}})},l().createElement("div",{ref:_,style:{overflow:"hidden",overflowWrap:"break-word",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-all"},onMouseEnter:function(e){var t=e.target;S()&&w(t.scrollWidth>=t.clientWidth)}},E)):l().createElement(v,{value:o})})},234:function(e,t,n){"use strict";n.d(t,{I:function(){return h}});var r=n(772),o=n(156),i=n.n(o),a=n(238),l=n(825),s=n.n(l),d=n(68),c=n(551),u=n(731),p=n(418);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}var v=["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"],h=(0,r.withDynamicSchemaProps)(function(e){var t,n=e.disabled,l=e.onChange,h=e.value,g=e.fileCollection,b=e.toolbar,y=(t=(0,o.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return f(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=y[0],k=y[1],E=(0,o.useRef)(),x=(0,o.useRef)(!1),_=(0,o.useRef)(null),S=(0,o.useRef)(null),L=(0,r.useAPIClient)(),T=(0,u.S)(),C=(0,p.Z)(),M=C.wrapSSR,A=C.hashId,H=C.componentCls,O=L.auth.locale||"en-US",N=(0,r.usePlugin)("@nocobase/plugin-file-manager"),D=(0,r.useCompile)(),j=(0,o.useRef)(D);j.current=D;var I=(0,a.useTranslation)().t,R=(0,r.useZIndexContext)(),P=(0,r.getZIndex)("drawer",R+1e3,0),q=(0,o.useMemo)(function(){var e=O.replace(/-/g,"_");return v.includes(e)?e:"en_US"},[O]);return(0,o.useEffect)(function(){if(_.current){var e=null!=b?b:d.K,t=new(s())(_.current,{value:null!=h?h:"",lang:q,cache:{enable:!1},undoDelay:0,preview:{math:{engine:"KaTeX"}},toolbar:e,fullscreen:{index:1200},cdn:T,minHeight:200,after:function(){E.current=t,k(!0),t.setValue(null!=h?h:""),n?t.disabled():t.enable()},input:function(e){l(e)},upload:{multiple:!1,fieldName:"file",handler:function(e){var n;return(n=function(){var n,r,o,i,a,l,s,d,u,p,f,m,v,h,b;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(y){switch(y.label){case 0:return d=e[0],t.focus(),[4,L.resource("vditor").check({fileCollectionName:g})];case 1:if(!(null==(u=y.sent().data)||null==(n=u.data)?void 0:n.isSupportToUploadFiles))return t.tip(I("vditor.uploadError.message",{ns:c.A,storageTitle:null==(p=u.data.storage)?void 0:p.title}),0),[2];return t.tip(I("uploading"),0),[4,N.uploadFile({file:d,fileCollectionName:g,storageId:null==u||null==(o=u.data)||null==(r=o.storage)?void 0:r.id,storageType:null==u||null==(a=u.data)||null==(i=a.storage)?void 0:i.type,storageRules:null==u||null==(s=u.data)||null==(l=s.storage)?void 0:l.rules})];case 2:if(m=(f=y.sent()).data,v=f.errorMessage)return t.tip(j.current(v),3e3),[2];if(!m)return t.tip(I("Response data is empty",{ns:c.A}),3e3),[2];return h=m.filename,b=m.url,d.type.startsWith("image/")?t.insertValue("![".concat(h,"](").concat(b,")")):t.insertValue("[".concat(h,"](").concat(b,")")),t.tip(I(""),10),[2,null]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){m(i,r,o,a,l,"next",e)}function l(e){m(i,r,o,a,l,"throw",e)}a(void 0)})})()}}});return function(){var e;null==(e=E.current)||e.destroy(),E.current=void 0}}},[null==b?void 0:b.join(",")]),(0,o.useEffect)(function(){if(w&&E.current){var e=E.current;if(h!==e.getValue()){e.setValue(null!=h?h:"");var t,n=null==(t=_.current)?void 0:t.querySelector("div.vditor-content > div.vditor-ir > pre");if(n){var r=document.createRange(),o=window.getSelection();o&&(r.selectNodeContents(n),r.collapse(!1),o.removeAllRanges(),o.addRange(r))}}}},[h,w]),(0,o.useEffect)(function(){w&&E.current&&(n?E.current.disabled():E.current.enable())},[n,w]),(0,o.useEffect)(function(){if(S.current){var e=new MutationObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,l=!0,s=!1,d=void 0;try{for(var c,u=Array.from(a.addedNodes)[Symbol.iterator]();!(l=(c=u.next()).done);l=!0){var p,f=c.value;p=HTMLElement,(null!=p&&"undefined"!=typeof Symbol&&p[Symbol.hasInstance]?!!p[Symbol.hasInstance](f):f instanceof p)&&f.classList.contains("vditor-img")&&(S.current.appendChild(f),f.style.zIndex=String(P))}}catch(e){s=!0,d=e}finally{try{l||null==u.return||u.return()}finally{if(s)throw d}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}});return e.observe(document.body,{childList:!0}),function(){e.disconnect()}}},[P]),(0,o.useLayoutEffect)(function(){if(_.current){var e=new ResizeObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a,l=o.value.target;l.className.includes("vditor--fullscreen")?(document.body.appendChild(l),x.current=!0):x.current&&(null==(a=S.current)||a.appendChild(l),x.current=!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}});return e.observe(_.current),function(){e.unobserve(_.current)}}},[]),M(i().createElement("div",{ref:S,className:"".concat(A," ").concat(H)},i().createElement("div",{ref:_})))})},291:function(e,t,n){"use strict";n.r(t),n.d(t,{PluginFieldMarkdownVditorClient:function(){return V},default:function(){return W}});var r=n(772),o=n(278),i=n.n(o),a=n(391),l=n.n(a),s=n(547),d=n.n(s),c=n(604),u=n.n(c),p=n(593),f=n.n(p),m=n(784),v=n.n(m),h=n(926),g={};g.styleTagTransform=v(),g.setAttributes=u(),g.insert=d().bind(null,"head"),g.domAPI=l(),g.insertStyleElement=f(),i()(h.Z,g),h.Z&&h.Z.locals&&h.Z.locals;var b=n(156),y=n.n(b),w=n(667),k=n(234);function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_=function(){return!!e})()}var S=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=E(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,_()?Reflect.construct(e,t||[],E(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&x(n,e),t=[{key:"render",value:function(){return y().createElement(k.I,this.props)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.FieldModel);S=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}([(0,w.largeField)()],S),w.EditableItemModel.bindModelToInterface("VditorFieldModel",["vditor"],{isDefault:!0});var L=n(607);function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(M=function(){return!!e})()}var A=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=T(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,M()?Reflect.construct(e,t||[],T(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&C(n,e),t=[{key:"renderComponent",value:function(e){if(e)return y().createElement(L.s,{value:e,ellipsis:this.props.textOnly})}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.DisplayTitleFieldModel);A.define({label:(0,w.escapeT)("MarkdownVditor")}),A.registerFlow({key:"markdownVditorSettings",title:(0,r.tval)("Content settings"),sort:200,steps:{renderMode:{use:"renderMode"}}}),w.DisplayItemModel.bindModelToInterface("DisplayVditorFieldModel",["vditor"],{isDefault:!0});var H=n(68),O=n(581);function N(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function D(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,l,"next",e)}function l(e){N(i,r,o,a,l,"throw",e)}a(void 0)})}}function j(e,t,n){return(j=B()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&P(o,n.prototype),o}).apply(null,arguments)}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t="function"==typeof Map?new Map:void 0;return(q=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return j(e,arguments,R(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),P(n,e)})(e)}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}function z(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var U=(0,r.lazy)(function(){return O("imported_-1bo1vdq_component",n.e("158").then(n.bind(n,304)))},"MarkdownVditor").MarkdownVditor,V=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=R(t),I(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,B()?Reflect.construct(t,r||[],R(this).constructor):t.apply(this,r)),"dependencyLoaded",!1),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&P(n,e),t=[{key:"afterAdd",value:function(){return D(function(){return z(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return D(function(){return z(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return D(function(){return z(this,function(t){return e.app.addComponents({MarkdownVditor:U}),e.app.dataSourceManager.addFieldInterfaces([H.w]),e.flowEngine.registerModels({VditorFieldModel:S,DisplayVditorFieldModel:A}),[2]})})()}},{key:"getCDN",value:function(){return this.app.getPublicPath()+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client/vditor"}},{key:"initVditorDependency",value:function(){var e=this,t=this.getCDN();try{var n,r="plugin-field-markdown-vditor-dep",o=(n={},I(n,"".concat(r,".katex"),"".concat(t,"/dist/js/katex/katex.min.js?v=0.16.9")),I(n,"".concat(r,".ABCJS"),"".concat(t,"/dist/js/abcjs/abcjs_basic.min")),I(n,"".concat(r,".plantumlEncoder"),"".concat(t,"/dist/js/plantuml/plantuml-encoder.min")),I(n,"".concat(r,".echarts"),"".concat(t,"/dist/js/echarts/echarts.min")),I(n,"".concat(r,".flowchart"),"".concat(t,"/dist/js/flowchart.js/flowchart.min")),I(n,"".concat(r,".Viz"),"".concat(t,"/dist/js/graphviz/viz")),I(n,"".concat(r,".mermaid"),"".concat(t,"/dist/js/mermaid/mermaid.min")),n);this.app.requirejs.require.config({waitSeconds:120,paths:o}),Object.keys(o).forEach(function(t){e.app.requirejs.require([t],function(e){window[t.split(".")[1]]=e})})}catch(e){console.log("initVditorDependency failed",e)}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(q(r.Plugin)),W=V},68:function(e,t,n){"use strict";n.d(t,{K:function(){return u},w:function(){return p}});var r=n(772),o=n(551);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var d=r.interfacesProperties.defaultProps,c=r.interfacesProperties.operators,u=["headings","bold","italic","strike","link","list","ordered-list","check","quote","line","code","inline-code","upload","fullscreen"],p=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,l,p;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=a(t),i(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,s()?Reflect.construct(t,r||[],a(this).constructor):t.apply(this,r)),"name","vditor"),i(e,"type","object"),i(e,"group","media"),i(e,"order",1),i(e,"title",(0,o.U)("Vditor")),i(e,"sortable",!0),i(e,"default",{type:"text",length:"long",uiSchema:{type:"string","x-component":"MarkdownVditor"}}),i(e,"availableTypes",["text","json","string"]),i(e,"properties",(l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){i(e,t,n[t])})}return e}({},d),p=p={"uiSchema.x-component-props.fileCollection":{type:"string",title:(0,o.U)("File collection"),"x-component":"CollectionSelect","x-component-props":{filter:function(e){var t;return(null==e||null==(t=e.options)?void 0:t.template)==="file"}},"x-decorator":"FormItem",default:"","x-reactions":{fulfill:{schema:{description:(0,o.U)("Used to store files uploaded in the Markdown editor (default: attachments)")}}}},"uiSchema.x-component-props.toolbar":{type:"array",title:(0,o.U)("Toolbar"),"x-component":"Select","x-component-props":{mode:"multiple"},"x-decorator":"FormItem",default:u,enum:[{value:"emoji",label:(0,o.U)("Emoji")},{value:"headings",label:(0,o.U)("Headings")},{value:"bold",label:(0,o.U)("Bold")},{value:"italic",label:(0,o.U)("Italic")},{value:"strike",label:(0,o.U)("Strike")},{value:"line",label:(0,o.U)("Line")},{value:"quote",label:(0,o.U)("Quote")},{value:"list",label:(0,o.U)("List")},{value:"ordered-list",label:(0,o.U)("OrderedList")},{value:"check",label:(0,o.U)("Check")},{value:"outdent",label:(0,o.U)("Outdent")},{value:"indent",label:(0,o.U)("Indent")},{value:"code",label:(0,o.U)("Code")},{value:"inline-code",label:(0,o.U)("InlineCode")},{value:"insert-after",label:(0,o.U)("InsertAfter")},{value:"insert-before",label:(0,o.U)("InsertBefore")},{value:"undo",label:(0,o.U)("Undo")},{value:"redo",label:(0,o.U)("Redo")},{value:"upload",label:(0,o.U)("Upload")},{value:"link",label:(0,o.U)("Link")},{value:"record",label:(0,o.U)("Record")},{value:"table",label:(0,o.U)("Table")},{value:"edit-mode",label:(0,o.U)("EditMode")},{value:"both",label:(0,o.U)("Both")},{value:"preview",label:(0,o.U)("Preview")},{value:"fullscreen",label:(0,o.U)("Fullscreen")},{value:"outline",label:(0,o.U)("Outline")}]}},Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(p)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(p)).forEach(function(e){Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(p,e))}),l)),i(e,"filterable",{operators:c.bigField}),i(e,"titleUsable",!0),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&l(n,e),t=[{key:"schemaInitialize",value:function(e,t){["Table","Kanban"].includes(t.block)&&(e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].ellipsis=!0)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.CollectionFieldInterface)},731:function(e,t,n){"use strict";n.d(t,{S:function(){return i}});var r=n(772),o=n(291),i=function(){var e=(0,r.usePlugin)(o.PluginFieldMarkdownVditorClient);return e.dependencyLoaded||(e.initVditorDependency(),e.dependencyLoaded=!0),e.getCDN()}},418:function(e,t,n){"use strict";t.Z=(0,n(772).genStyleHook)("nb-field-markdown-vditor",function(e){var t,n,r;return t={},n=e.componentCls,r={".vditor-reset":{fontSize:"".concat(e.fontSize,"px !important"),color:"unset",padding:"10px !important"},".vditor":{borderRadius:8},".vditor .vditor-content":{borderRadius:"0 0 8px 8px",overflow:"hidden"},".vditor .vditor-toolbar":{paddingLeft:" 16px !important",borderRadius:"8px 8px 0 0"},".vditor .vditor-content .vditor-ir .vditor-reset":{paddingLeft:" 16px !important"},".vditor-ir pre.vditor-reset":{backgroundColor:"".concat(e.colorBgContainer,"!important")}},n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t})},551:function(e,t,n){"use strict";n.d(t,{A:function(){return o},U:function(){return i}});var r=n(584),o="field-markdown-vditor";function i(e){return(0,r.tval)(e,{ns:o})}},926:function(e,t,n){"use strict";var r=n(46),o=n.n(r),i=n(758),a=n.n(i),l=n(821),s=n.n(l),d=new URL(n(2),n.b),c=a()(o()),u=s()(d);c.push([e.id,'/*!\n * Vditor v3.10.4 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\nanimation-name: tooltip-appear;\nanimation-duration: 0.15s;\nanimation-fill-mode: forwards;\nanimation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\nanimation-duration: 0.15s;\nanimation-name: scale-in;\nanimation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\nanimation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: -webkit-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: -moz-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\nanimation-duration: 0.15s;\nanimation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\nanimation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: -webkit-zoom-out;\n cursor: -moz-zoom-out;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url('+u+');\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 0.5em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: normal;\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n\n',""]),t.Z=c},758:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);r&&a[c[0]]||(void 0!==i&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]&&(c[1]="@media ".concat(c[2]," {").concat(c[1],"}")),c[2]=n),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c))}},t}},821:function(e){"use strict";e.exports=function(e,t){return(t||(t={}),e&&(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes))?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e}},46:function(e){"use strict";e.exports=function(e){return e[1]}},581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},278:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var l=e[a],s=r.base?l[0]+r.base:l[0],d=o[s]||0,c="".concat(s," ").concat(d);o[s]=d+1;var u=n(c),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var f=function(e,t){var n=t.domAPI(t);return n.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&n.update(e=t):n.remove()}}(p,r);r.byIndex=a,t.splice(a,0,{identifier:c,updater:f,references:1})}i.push(c)}return i}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var l=n(i[a]);t[l].references--}for(var s=r(e,o),d=0;d<i.length;d++){var c=n(i[d]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}i=s}}},547:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},593:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},604:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},391:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){var r,o,i;r="",n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {")),(o=void 0!==n.layer)&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}"),(i=n.sourceMap)&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(r,t,e.options)},remove:function(){!function(e){if(null!==e.parentNode)e.parentNode.removeChild(e)}(t)}}}},784:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},825:function(e){e.exports=(()=>{var e={471:e=>{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};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=o;if(null==e||null==n)throw Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var a=r,l=this.diff_commonPrefix(e,n),s=e.substring(0,l);e=e.substring(l),n=n.substring(l),l=this.diff_commonSuffix(e,n);var d=e.substring(e.length-l);e=e.substring(0,e.length-l),n=n.substring(0,n.length-l);var c=this.diff_compute_(e,n,a,i);return s&&c.unshift(new t.Diff(0,s)),d&&c.push(new t.Diff(0,d)),this.diff_cleanupMerge(c),c},t.prototype.diff_compute_=function(e,n,r,o){if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var i,a=e.length>n.length?e:n,l=e.length>n.length?n:e,s=a.indexOf(l);if(-1!=s)return i=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>n.length&&(i[0][0]=i[2][0]=-1),i;if(1==l.length)return[new t.Diff(-1,e),new t.Diff(1,n)];var d=this.diff_halfMatch_(e,n);if(d){var c=d[0],u=d[1],p=d[2],f=d[3],m=d[4],v=this.diff_main(c,p,r,o),h=this.diff_main(u,f,r,o);return v.concat([new t.Diff(0,m)],h)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,o):this.diff_bisect_(e,n,o)},t.prototype.diff_lineMode_=function(e,n,r){var o=this.diff_linesToChars_(e,n);e=o.chars1,n=o.chars2;var i=o.lineArray,a=this.diff_main(e,n,!1,r);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,d=0,c="",u="";l<a.length;){switch(a[l][0]){case 1:d++,u+=a[l][1];break;case -1:s++,c+=a[l][1];break;case 0:if(s>=1&&d>=1){a.splice(l-s-d,s+d),l=l-s-d;for(var p=this.diff_main(c,u,!1,r),f=p.length-1;f>=0;f--)a.splice(l,0,p[f]);l+=p.length}d=0,s=0,c="",u=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,n,r){for(var o=e.length,i=n.length,a=Math.ceil((o+i)/2),l=2*a,s=Array(l),d=Array(l),c=0;c<l;c++)s[c]=-1,d[c]=-1;s[a+1]=0,d[a+1]=0;for(var u=o-i,p=u%2!=0,f=0,m=0,v=0,h=0,g=0;g<a&&!((new Date).getTime()>r);g++){for(var b=-g+f;b<=g-m;b+=2){for(var y=a+b,w=(E=b==-g||b!=g&&s[y-1]<s[y+1]?s[y+1]:s[y-1]+1)-b;E<o&&w<i&&e.charAt(E)==n.charAt(w);)E++,w++;if(s[y]=E,E>o)m+=2;else if(w>i)f+=2;else if(p&&(_=a+u-b)>=0&&_<l&&-1!=d[_]&&E>=(x=o-d[_]))return this.diff_bisectSplit_(e,n,E,w,r)}for(var k=-g+v;k<=g-h;k+=2){for(var E,x,_=a+k,S=(x=k==-g||k!=g&&d[_-1]<d[_+1]?d[_+1]:d[_-1]+1)-k;x<o&&S<i&&e.charAt(o-x-1)==n.charAt(i-S-1);)x++,S++;if(d[_]=x,x>o)h+=2;else if(S>i)v+=2;else if(!p&&(y=a+u-k)>=0&&y<l&&-1!=s[y]&&(w=a+(E=s[y])-y,E>=(x=o-x)))return this.diff_bisectSplit_(e,n,E,w,r)}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,o){var i=e.substring(0,n),a=t.substring(0,r),l=e.substring(n),s=t.substring(r),d=this.diff_main(i,a,!1,o),c=this.diff_main(l,s,!1,o);return d.concat(c)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function o(e){for(var t="",o=0,a=-1,l=n.length;a<e.length-1;){-1==(a=e.indexOf("\n",o))&&(a=e.length-1);var s=e.substring(o,a+1);(r.hasOwnProperty?r.hasOwnProperty(s):void 0!==r[s])?t+=String.fromCharCode(r[s]):(l==i&&(s=e.substring(o),a=e.length),t+=String.fromCharCode(l),r[s]=l,n[l++]=s),o=a+1}return t}n[0]="";var i=4e4,a=o(e);return i=65535,{chars1:a,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],o=[],i=0;i<r.length;i++)o[i]=t[r.charCodeAt(i)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(i,o)==t.substring(i,o)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(e.length-o,e.length-i)==t.substring(t.length-o,t.length-i)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var o=Math.min(n,r);if(e==t)return o;for(var i=0,a=1;;){var l=e.substring(o-a),s=t.indexOf(l);if(-1==s)return i;a+=s,0!=s&&e.substring(o-a)!=t.substring(0,a)||(i=a,a++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var o=this;function i(e,t,n){for(var r,i,a,l,s=e.substring(n,n+Math.floor(e.length/4)),d=-1,c="";-1!=(d=t.indexOf(s,d+1));){var u=o.diff_commonPrefix(e.substring(n),t.substring(d)),p=o.diff_commonSuffix(e.substring(0,n),t.substring(0,d));c.length<p+u&&(c=t.substring(d-p,d)+t.substring(d,d+u),r=e.substring(0,n-p),i=e.substring(n+u),a=t.substring(0,d-p),l=t.substring(d+u))}return 2*c.length>=e.length?[r,i,a,l,c]:null}var a,l,s,d,c,u=i(n,r,Math.ceil(n.length/4)),p=i(n,r,Math.ceil(n.length/2));return u||p?(a=p?u&&u[4].length>p[4].length?u:p:u,e.length>t.length?(l=a[0],s=a[1],d=a[2],c=a[3]):(d=a[0],c=a[1],l=a[2],s=a[3]),[l,s,d,c,a[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=0,s=0,d=0,c=0;a<e.length;)0==e[a][0]?(r[o++]=a,l=d,s=c,d=0,c=0,i=e[a][1]):(1==e[a][0]?d+=e[a][1].length:c+=e[a][1].length,i&&i.length<=Math.max(l,s)&&i.length<=Math.max(d,c)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,a=--o>0?r[o-1]:-1,l=0,s=0,d=0,c=0,i=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(-1==e[a-1][0]&&1==e[a][0]){var u=e[a-1][1],p=e[a][1],f=this.diff_commonOverlap_(u,p),m=this.diff_commonOverlap_(p,u);f>=m?(f>=u.length/2||f>=p.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,f))),e[a-1][1]=u.substring(0,u.length-f),e[a+1][1]=p.substring(f),a++):(m>=u.length/2||m>=p.length/2)&&(e.splice(a,0,new t.Diff(0,u.substring(0,m))),e[a-1][0]=1,e[a-1][1]=p.substring(0,p.length-m),e[a+1][0]=-1,e[a+1][1]=u.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),o=n.charAt(0),i=r.match(t.nonAlphaNumericRegex_),a=o.match(t.nonAlphaNumericRegex_),l=i&&r.match(t.whitespaceRegex_),s=a&&o.match(t.whitespaceRegex_),d=l&&r.match(t.linebreakRegex_),c=s&&o.match(t.linebreakRegex_),u=d&&e.match(t.blanklineEndRegex_),p=c&&n.match(t.blanklineStartRegex_);return u||p?5:d||c?4:i&&!l&&s?3:l||s?2:i||a?1:0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var o=e[r-1][1],i=e[r][1],a=e[r+1][1],l=this.diff_commonSuffix(o,i);if(l){var s=i.substring(i.length-l);o=o.substring(0,o.length-l),i=s+i.substring(0,i.length-l),a=s+a}for(var d=o,c=i,u=a,p=n(o,i)+n(i,a);i.charAt(0)===a.charAt(0);){o+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var f=n(o,i)+n(i,a);f>=p&&(p=f,d=o,c=i,u=a)}e[r-1][1]!=d&&(d?e[r-1][1]=d:(e.splice(r-1,1),r--),e[r][1]=c,u?e[r+1][1]=u:(e.splice(r+1,1),r--))}r++}},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(e){for(var n=!1,r=[],o=0,i=null,a=0,l=!1,s=!1,d=!1,c=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(d||c)?(r[o++]=a,l=d,s=c,i=e[a][1]):(o=0,i=null),d=c=!1):(-1==e[a][0]?c=!0:d=!0,i&&(l&&s&&d&&c||i.length<this.Diff_EditCost/2&&l+s+d+c==3)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,i=null,l&&s?(d=c=!0,o=0):(a=--o>0?r[o-1]:-1,d=c=!1),n=!0)),a++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var n,r=0,o=0,i=0,a="",l="";r<e.length;)switch(e[r][0]){case 1:i++,l+=e[r][1],r++;break;case -1:o++,a+=e[r][1],r++;break;case 0:o+i>1?(0!==o&&0!==i&&(0!==(n=this.diff_commonPrefix(l,a))&&(r-o-i>0&&0==e[r-o-i-1][0]?e[r-o-i-1][1]+=l.substring(0,n):(e.splice(0,0,new t.Diff(0,l.substring(0,n))),r++),l=l.substring(n),a=a.substring(n)),0!==(n=this.diff_commonSuffix(l,a))&&(e[r][1]=l.substring(l.length-n)+e[r][1],l=l.substring(0,l.length-n),a=a.substring(0,a.length-n))),r-=o+i,e.splice(r,o+i),a.length&&(e.splice(r,0,new t.Diff(-1,a)),r++),l.length&&(e.splice(r,0,new t.Diff(1,l)),r++),r++):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(r=1;r<e.length-1;)0==e[r-1][0]&&0==e[r+1][0]&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),s=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),s=!0)),r++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,o=0,i=0,a=0;for(n=0;n<e.length&&(1!==e[n][0]&&(r+=e[n][1].length),-1!==e[n][0]&&(o+=e[n][1].length),!(r>t));n++)i=r,a=o;return e.length!=n&&-1===e[n][0]?a:a+(t-i)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,o=/>/g,i=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(n,"&amp;").replace(r,"&lt;").replace(o,"&gt;").replace(i,"&para;<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case -1:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,o=0;o<e.length;o++){var i=e[o][0],a=e[o][1];switch(i){case 1:n+=a.length;break;case -1:r+=a.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]="+"+encodeURI(e[n][1]);break;case -1:t[n]="-"+e[n][1].length;break;case 0:t[n]="="+e[n][1].length}return t.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,n){for(var r=[],o=0,i=0,a=n.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{r[o++]=new t.Diff(1,decodeURI(s))}catch(e){throw Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var d=parseInt(s,10);if(isNaN(d)||d<0)throw Error("Invalid number in diff_fromDelta: "+s);var c=e.substring(i,i+=d);"="==a[l].charAt(0)?r[o++]=new t.Diff(0,c):r[o++]=new t.Diff(-1,c);break;default:if(a[l])throw Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(i!=e.length)throw Error("Delta length ("+i+") does not equal source text length ("+e.length+").");return r},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),o=this;function i(e,r){var i=e/t.length,a=Math.abs(n-r);return o.Match_Distance?i+a/o.Match_Distance:a?1:i}var a=this.Match_Threshold,l=e.indexOf(t,n);-1!=l&&(a=Math.min(i(0,l),a),-1!=(l=e.lastIndexOf(t,n+t.length))&&(a=Math.min(i(0,l),a)));var s,d,c=1<<t.length-1;l=-1;for(var u,p=t.length+e.length,f=0;f<t.length;f++){for(s=0,d=p;s<d;)i(f,n+d)<=a?s=d:p=d,d=Math.floor((p-s)/2+s);p=d;var m=Math.max(1,n-d+1),v=Math.min(n+d,e.length)+t.length,h=Array(v+2);h[v+1]=(1<<f)-1;for(var g=v;g>=m;g--){var b=r[e.charAt(g-1)];if(h[g]=0===f?(h[g+1]<<1|1)&b:(h[g+1]<<1|1)&b|(u[g+1]|u[g])<<1|1|u[g+1],h[g]&c){var y=i(f,g-1);if(y<=a){if(a=y,!((l=g-1)>n))break;m=Math.max(1,2*n-l)}}}if(i(f+1,n)>a)break;u=h}return l},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,r=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var i=n.substring(e.start2-o,e.start2);i&&e.diffs.unshift(new t.Diff(0,i));var a=n.substring(e.start2+e.length1,e.start2+e.length1+o);a&&e.diffs.push(new t.Diff(0,a)),e.start1-=i.length,e.start2-=i.length,e.length1+=i.length+a.length,e.length2+=i.length+a.length}},t.prototype.patch_make=function(e,n,r){var o,i;if("string"==typeof e&&"string"==typeof n&&void 0===r)o=e,(i=this.diff_main(o,n,!0)).length>2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&"object"==typeof e&&void 0===n&&void 0===r)i=e,o=this.diff_text1(i);else if("string"==typeof e&&n&&"object"==typeof n&&void 0===r)o=e,i=n;else{if("string"!=typeof e||"string"!=typeof n||!r||"object"!=typeof r)throw Error("Unknown call format to patch_make.");o=e,i=r}if(0===i.length)return[];for(var a=[],l=new t.patch_obj,s=0,d=0,c=0,u=o,p=o,f=0;f<i.length;f++){var m=i[f][0],v=i[f][1];switch(s||0===m||(l.start1=d,l.start2=c),m){case 1:l.diffs[s++]=i[f],l.length2+=v.length,p=p.substring(0,c)+v+p.substring(c);break;case -1:l.length1+=v.length,l.diffs[s++]=i[f],p=p.substring(0,c)+p.substring(c+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&i.length!=f+1?(l.diffs[s++]=i[f],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,u),a.push(l),l=new t.patch_obj,s=0,u=p,d=c)}1!==m&&(d+=v.length),-1!==m&&(c+=v.length)}return s&&(this.patch_addContext_(l,u),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=new t.patch_obj;i.diffs=[];for(var a=0;a<o.diffs.length;a++)i.diffs[a]=new t.Diff(o.diffs[a][0],o.diffs[a][1]);i.start1=o.start1,i.start2=o.start2,i.length1=o.length1,i.length2=o.length2,n[r]=i}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,o=[],i=0;i<e.length;i++){var a,l,s=e[i].start2+r,d=this.diff_text1(e[i].diffs),c=-1;if(d.length>this.Match_MaxBits?-1!=(a=this.match_main(t,d.substring(0,this.Match_MaxBits),s))&&(-1==(c=this.match_main(t,d.substring(d.length-this.Match_MaxBits),s+d.length-this.Match_MaxBits))||a>=c)&&(a=-1):a=this.match_main(t,d,s),-1==a)o[i]=!1,r-=e[i].length2-e[i].length1;else if(o[i]=!0,r=a-s,d==(l=-1==c?t.substring(a,a+d.length):t.substring(a,c+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[i].diffs)+t.substring(a+d.length);else{var u=this.diff_main(d,l,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(u)/d.length>this.Patch_DeleteThreshold)o[i]=!1;else{this.diff_cleanupSemanticLossless(u);for(var p,f=0,m=0;m<e[i].diffs.length;m++){var v=e[i].diffs[m];0!==v[0]&&(p=this.diff_xIndex(u,f)),1===v[0]?t=t.substring(0,a+p)+v[1]+t.substring(a+p):-1===v[0]&&(t=t.substring(0,a+p)+t.substring(a+this.diff_xIndex(u,f+v[1].length))),-1!==v[0]&&(f+=v[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",o=1;o<=n;o++)r+=String.fromCharCode(o);for(o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var i=e[0],a=i.diffs;if(0==a.length||0!=a[0][0])a.unshift(new t.Diff(0,r)),i.start1-=n,i.start2-=n,i.length1+=n,i.length2+=n;else if(n>a[0][1].length){var l=n-a[0][1].length;a[0][1]=r.substring(a[0][1].length)+a[0][1],i.start1-=l,i.start2-=l,i.length1+=l,i.length2+=l}return 0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0]?(a.push(new t.Diff(0,r)),i.length1+=n,i.length2+=n):n>a[a.length-1][1].length&&(l=n-a[a.length-1][1].length,a[a.length-1][1]+=r.substring(0,l),i.length1+=l,i.length2+=l),r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var o=e[r];e.splice(r--,1);for(var i=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,d=!0;for(s.start1=i-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<n-this.Patch_Margin;){var c=o.diffs[0][0],u=o.diffs[0][1];1===c?(s.length2+=u.length,a+=u.length,s.diffs.push(o.diffs.shift()),d=!1):-1===c&&1==s.diffs.length&&0==s.diffs[0][0]&&u.length>2*n?(s.length1+=u.length,i+=u.length,d=!1,s.diffs.push(new t.Diff(c,u)),o.diffs.shift()):(u=u.substring(0,n-s.length1-this.Patch_Margin),s.length1+=u.length,i+=u.length,0===c?(s.length2+=u.length,a+=u.length):d=!1,s.diffs.push(new t.Diff(c,u)),u==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(u.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==p&&(s.length1+=p.length,s.length2+=p.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=p:s.diffs.push(new t.Diff(0,p))),d||e.splice(++r,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split("\n"),o=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<r.length;){var a=r[o].match(i);if(!a)throw Error("Invalid patch string: "+r[o]);var l=new t.patch_obj;for(n.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<r.length;){var s=r[o].charAt(0);try{var d=decodeURI(r[o].substring(1))}catch(e){throw Error("Illegal escape in patch_fromText: "+d)}if("-"==s)l.diffs.push(new t.Diff(-1,d));else if("+"==s)l.diffs.push(new t.Diff(1,d));else if(" "==s)l.diffs.push(new t.Diff(0,d));else{if("@"==s)break;if(""!==s)throw Error('Invalid patch mode "'+s+'" in: '+d)}o++}}return n},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e="+";break;case -1:e="-";break;case 0:e=" "}t[n+1]=e+encodeURI(this.diffs[n][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},872:(e,t,n)=>{"use strict";n.d(t,{default:()=>O});var r=n(478),o=n(156),i=n(314),a=n(730),l=n(66),s=n(218),d=n(702),c=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src}),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach(function(e){e.getAttribute("data-src")&&t(e)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)}))},u=n(466),p=n(554),f=n(40),m=n(563),v=n(749),h=n(818),g=n(408),b=n(54),y=n(227),w=n(526),k=n(827),E=n(640),x=n(895),_=n(393),S=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach(function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)}),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',o='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',o='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");i||((i=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",i),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var a=n(),l=new SpeechSynthesisUtterance;l.voice=a,l.onend=l.onerror=function(){i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech"))return i.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=o):(speechSynthesis.pause(),i.innerHTML=r)):(l.text=i.getAttribute("data-text"),speechSynthesis.speak(l),i.classList.add("vditor-speech--current"),i.innerHTML=o),(0,_.Hc)(window.vditorSpeechRange),void e.focus();if(i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r,0!==getSelection().rangeCount){var a=getSelection().getRangeAt(0),s=a.toString().trim();if(s){window.vditorSpeechRange=a.cloneRange();var d=a.getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=d.top+d.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?i.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":i.style.left=t.clientX+2+"px",i.setAttribute("data-text",s)}}})}},L=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}},T=function(e){var t,n={anchor:0,cdn:b.g.CDN,customEmoji:{},emojiPath:b.g.CDN+"/dist/images/emoji",hljs:b.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:b.g.MARKDOWN_OPTIONS,math:b.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:b.g.THEME_OPTIONS};return e.cdn&&((null==(t=e.theme)?void 0:t.path)||(n.theme.path=e.cdn+"/dist/css/content-theme"),e.emojiPath||(n.emojiPath=e.cdn+"/dist/images/emoji")),(0,E.T)(n,e)},C=function(e,t){var n=T(t);return(0,w.G)(n.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var r=(0,x.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.SetHeadingID(!0),r.Md2HTML(e)})},M=function(e,t,n){var o,h,b,E;return o=void 0,h=void 0,b=void 0,E=function(){var o,h,b;return L(this,function(E){var x;switch(E.label){case 0:return[4,C(t,o=T(n))];case 1:if(h=E.sent(),o.transform&&(h=o.transform(h)),e.innerHTML=h,e.classList.add("vditor-reset"),o.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang))return[3,2];throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return b="vditorI18nScript"+o.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(e){e.id!==b&&document.head.removeChild(e)}),[4,(0,w.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",b)];case 3:E.sent(),E.label=4;case 4:return[3,6];case 5:window.VditorI18n=o.i18n,E.label=6;case 6:return o.icon?[4,(0,w.G)(o.cdn+"/dist/js/icons/"+o.icon+".js","vditorIconScript")]:[3,8];case 7:E.sent(),E.label=8;case 8:return(0,y.Z)(o.theme.current,o.theme.path),1===o.anchor&&e.classList.add("vditor-reset--anchor"),(0,a.O)(e,o.hljs),(0,d.s)(o.hljs,e,o.cdn),(0,u.H)(e,{cdn:o.cdn,math:o.math}),(0,f.i)(e,o.cdn,o.mode),(0,m.K)(e,o.cdn,o.mode),(0,l.P)(e,o.cdn),(0,s.v)(e,o.cdn),(0,i.p)(e,o.cdn,o.mode),(0,v.P)(e,o.cdn,o.mode),(0,g.B)(e,o.cdn),(0,r.Q)(e,o.cdn),o.render.media.enable&&(0,p.Y)(e),o.speech.enable&&S(e),0!==o.anchor&&(x=o.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(e){1===x&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=n}}),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),o.after&&o.after(),o.lazyLoadImage&&c(e),e.addEventListener("click",function(t){var n=(0,k.lG)(t.target,"SPAN");if(n&&(0,k.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}}),[2]}})},new(b||(b=Promise))(function(e,t){function n(e){try{i(E.next(e))}catch(e){t(e)}}function r(e){try{i(E.throw(e))}catch(e){t(e)}}function i(t){var o;t.done?e(t.value):((o=t.value)instanceof b?o:new b(function(e){e(o)})).then(n,r)}i((E=E.apply(o,h||[])).next())})},A=n(863),H=n(312);let O=function(){function e(){}return e.adapterRender=o,e.previewImage=A.E,e.codeRender=a.O,e.graphvizRender=s.v,e.highlightRender=d.s,e.mathRender=u.H,e.mermaidRender=f.i,e.markmapRender=m.K,e.flowchartRender=l.P,e.chartRender=i.p,e.abcRender=r.Q,e.mindmapRender=v.P,e.plantumlRender=g.B,e.outlineRender=h.k,e.mediaRender=p.Y,e.speechRender=S,e.lazyLoadImageRender=c,e.md2html=C,e.preview=M,e.setCodeTheme=H.Y,e.setContentTheme=y.Z,e}()},54:(e,t,n)=>{"use strict";n.d(t,{H:()=>r,g:()=>o});var r="3.10.4",o=function(){function e(){}return e.ZWSP="​",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.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"],e.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"],e.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"],e.CDN="https://unpkg.com/vditor@3.10.4",e.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},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:e.CDN+"/dist/css/content-theme"},e}()},478:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.abcRenderAdapter.getElements(e);n.length>0&&(0,o.G)(t+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){n.forEach(function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,i.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},156:(e,t,n)=>{"use strict";n.r(t),n.d(t,{abcRenderAdapter:()=>s,chartRenderAdapter:()=>l,flowchartRenderAdapter:()=>c,graphvizRenderAdapter:()=>d,markmapRenderAdapter:()=>i,mathRenderAdapter:()=>r,mermaidRenderAdapter:()=>o,mindmapRenderAdapter:()=>a,plantumlRenderAdapter:()=>u});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},l={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},u={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},314:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.chartRenderAdapter.getElements(e);a.length>0&&(0,o.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){a.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.chartRenderAdapter.getCode(e).trim();if(t)try{if("true"===e.getAttribute("data-processed"))return;var r=JSON.parse(t);echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>"+t}}})})}},730:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(51),o=n(54),i=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter(function(t,n){return!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&!(t.style.maxHeight.indexOf("px")>-1)&&!(e.classList.contains("vditor-preview")&&n>5)}).forEach(function(e){var n,i,a,l=e.innerText;if(e.classList.contains("highlight-chroma")){var s=e.cloneNode(!0);s.querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),l=s.innerText}else l.endsWith("\n")&&(l=l.substr(0,l.length-1));var d='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(d='<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 c=document.createElement("div");c.className="vditor-copy",c.innerHTML='<span aria-label="'+((null==(n=window.VditorI18n)?void 0:n.copy)||"复制")+"\"\nonmouseover=\"this.setAttribute('aria-label', '"+((null==(i=window.VditorI18n)?void 0:i.copy)||"复制")+"')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '"+((null==(a=window.VditorI18n)?void 0:a.copied)||"已复制")+"');this.previousElementSibling.blur()\">"+d+"</span>";var u=document.createElement("textarea");u.value=(0,r.X)(l),c.insertAdjacentElement("afterbegin",u),t&&t.renderMenu&&t.renderMenu(e,c),e.before(c),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'+o.g.ZWSP+"</span>")})}},66:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,o.G)(t+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){n.forEach(function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(i.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}})})}},218:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,o.G)(t+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){n.forEach(function(e){var t=i.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),o=new Worker(r);new Viz({worker:o}).renderSVGElement(t).then(function(t){e.innerHTML=t.outerHTML}).catch(function(t){e.innerHTML="graphviz render error: <br>"+t,e.className="vditor-reset--error"})}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}})})}},702:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(54),o=n(526),i=n(578),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var a=e.style;r.g.CODE_THEME.includes(a)||(a="github");var l=document.getElementById("vditorHljsStyle"),s=n+"/dist/js/highlight.js/styles/"+a+".css";l&&l.getAttribute("href")!==s&&l.remove(),(0,i.c)(n+"/dist/js/highlight.js/styles/"+a+".css","vditorHljsStyle"),!1!==e.enable&&0!==t.querySelectorAll("pre > code").length&&(0,o.G)(n+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,o.G)(n+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,o.G)(n+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){t.querySelectorAll("pre > code").forEach(function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&(""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang),hljs.highlightElement(t),e.lineNumber)){t.classList.add("vditor-linenumber");var n=t.querySelector(".vditor-linenumber__temp");n||((n=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",n));var r=getComputedStyle(t).whiteSpace,o=!1;"pre-wrap"!==r&&"pre-line"!==r||(o=!0);var i="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map(function(e){var t="";o&&(n.textContent=e||"\n",t=' style="height:'+n.getBoundingClientRect().height+'px"'),i+="<span"+t+"></span>"}),n.style.display="none",i='<span class="vditor-linenumber__rows">'+i+"</span>",t.insertAdjacentHTML("beforeend",i)}})})})})}},563:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(54),o=n(526),i=n(156),a={},l=function(e,t){var n,r,o,i,l,s,d=window.markmap,c=d.Transformer,u=d.Markmap,p=d.deriveOptions,f=(d.globalCSS,new c);e.innerHTML='<svg style="width:100%"></svg>';var m=e.firstChild,v=u.create(m,null),h=((r=Object.keys((n=f.transform(t)).features).filter(function(e){return!a[e]})).forEach(function(e){a[e]=!0}),i=(o=f.getAssets(r)).styles,l=o.scripts,s=window.markmap,i&&s.loadCSS(i),l&&s.loadJS(l),n),g=h.root,b=h.frontmatter,y=p(null==b?void 0:b.markmap);v.setData(g,y),v.fit()},s=function(e,t,n){void 0===t&&(t=r.g.CDN);var a=i.markmapRenderAdapter.getElements(e);0!==a.length&&(0,o.G)(t+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){a.forEach(function(e){var t=i.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),l(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}})})}},466:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var r=n(54),o=n(526),i=n(578),a=n(51),l=n(156),s=function(e,t){var n=l.mathRenderAdapter.getElements(e);if(0!==n.length){var s={cdn:r.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},s.math,t.math)),"KaTeX"===(t=Object.assign({},s,t)).math.engine)(0,i.c)(t.cdn+"/dist/js/katex/katex.min.css?v=0.16.9","vditorKatexStyle"),(0,o.G)(t.cdn+"/dist/js/katex/katex.min.js?v=0.16.9","vditorKatexScript").then(function(){(0,o.G)(t.cdn+"/dist/js/katex/mhchem.min.js?v=0.16.9","vditorKatexChemScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var n=(0,a.X)(l.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))})}})})});else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:t.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:t.math.macros}},Object.assign(window.MathJax,t.math.mathJaxOptions)),(0,o.J)(t.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var d=function(e,t){var n=(0,a.X)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then(function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var o=r.querySelector('[data-mml-node="merror"]');o&&""!==o.textContent.trim()&&(e.innerHTML=o.textContent.trim(),e.className="vditor-reset--error"),t&&t()})};window.MathJax.startup.promise.then(function(){for(var e=[],t=function(t){var r=n[t];r.parentElement.classList.contains("vditor-wysiwyg__pre")||r.parentElement.classList.contains("vditor-ir__marker--pre")||r.getAttribute("data-math")||!(0,a.X)(r.textContent).trim()||e.push(function(e){t===n.length-1?d(r):d(r,e)})},r=0;r<n.length;r++)t(r);if(0!==e.length){var o=0,i=e[e.length-1],l=function(){var t=e[o++];t===i?t():t(l)};l()}})}}}},554:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(835),o=function(e){e&&e.querySelectorAll("a").forEach(function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?(e.insertAdjacentHTML("afterend",'<video controls="controls" src="'+t+'"></video>'),e.remove()):t.match(/^.+.(mp3|wav|flac)$/)?(e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+t+'"></audio>'),e.remove()):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),o=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),l=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),d=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(n&&11===n[1].length)e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+n[1]+(n[2]?"?start="+n[2]:"")+'"></iframe>'),e.remove();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+o[1]+'"></iframe>'),e.remove();else if(i&&i[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+i[1]+'"></iframe>'),e.remove();else if(a&&a[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'+a[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),e.remove();else if(l&&l[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='+encodeURIComponent(l[0])+'"></iframe>'),e.remove();else if(s&&s[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'+s[2]+'"></iframe>'),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||d&&d[1])){var u={bvid:(0,r.o)("bvid",t)||d&&d[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach(function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");u[n[0]]=n[1]}});var p="https://player.bilibili.com/player.html?",f=Object.keys(u);f.forEach(function(e,t){p+=e+"="+u[e],t<f.length-1&&(p+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'+p+'"></iframe>'),e.remove()}else c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+c[1]+'"></iframe>'),e.remove())}(e,t))})}},40:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(54),o=n(526),i=n(156),a=n(835),l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}},s=function(e,t,n){void 0===t&&(t=r.g.CDN);var s=i.mermaidRenderAdapter.getElements(e);0!==s.length&&(0,o.G)(t+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),s.forEach(function(e){var t,n,r,o;return t=void 0,n=void 0,r=void 0,o=function(){var t,n,r,o;return l(this,function(l){switch(l.label){case 0:if(t=i.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,a.W)(),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return e.innerHTML=l.sent().svg,[3,4];case 3:return r=l.sent(),e.innerHTML=(o=document.querySelector("#"+n)).outerHTML+'<br>\n<div style="text-align: left"><small>'+r.message.replace(/\n/,"<br>")+"</small></div>",o.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}})},new(r||(r=Promise))(function(e,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,l)}s((o=o.apply(t,n||[])).next())})})})}},749:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.mindmapRenderAdapter.getElements(e);a.length>0&&(0,o.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){a.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],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(e,t){var n;return(null==(n=null==t?void 0:t.data)?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>"+t}}})})}},818:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(64),o=n(466),i=function(e,t,n){var i="",a=[];if(Array.from(e.children).forEach(function(e,t){if((0,r.W)(e)){if(n){var o=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===o?void 0:o)+"_"+t}a.push(e.id),i+=e.outerHTML.replace("<wbr>","")}}),""===i)return t.innerHTML="","";var l=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?l.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+i),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var s=Lute.New();s.SetToC(!0),l.innerHTML=s.HTML2VditorDOM("<p>[ToC]</p>"+i)}var d=l.firstElementChild.querySelectorAll("li > span[data-target-id]");return d.forEach(function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML=n+"<span>"+e.innerHTML+"</span>"}else e.innerHTML="<svg></svg><span>"+e.innerHTML+"</span>";e.setAttribute("data-target-id",a[t])}),i=l.firstElementChild.innerHTML,0===d.length?t.innerHTML="":(t.innerHTML=i,n&&(0,o.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",function(r){for(var o=r.target;o&&!o.isEqualNode(t);){if(o.classList.contains("vditor-outline__action")){o.classList.contains("vditor-outline__action--close")?(o.classList.remove("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:block")):(o.classList.add("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(o.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var i=document.getElementById(o.getAttribute("data-target-id"));if(!i)return;if(n)if("auto"===n.options.height){var a=i.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(a+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,a)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=i.offsetTop:e.scrollTop=i.offsetTop;else window.scrollTo(window.scrollX,i.offsetTop);break}o=o.parentElement}})),i}},408:(e,t,n)=>{"use strict";n.d(t,{B:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,o.G)(t+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(t)+'"/>'}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>"+t}}})})}},895:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},863:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});var r=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var r=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+("dark"===n?" vditor--dark":"")+'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n '+window.VditorI18n.spin+"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X &nbsp;"+window.VditorI18n.close+'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: '+e.width+"px;height:"+e.height+"px;transform: translate3d("+r.left+"px, "+(r.top-36)+'px, 0)" src="'+e.getAttribute("src")+'">\n </div>\n</div>'),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),i="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-e.naturalHeight)/2+"px, 0)";setTimeout(function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: "+i),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)});var a=document.querySelector(".vditor-img__btn");a.addEventListener("click",function(){var t=parseInt(a.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+(e.naturalWidth/2-e.naturalHeight/2)+"px, 0) rotateZ("+t+"deg)":o.style.transform=i+" rotateZ("+t+"deg)",a.setAttribute("data-deg",t.toString()),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)})}},312:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(54),o=n(578),i=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),i=t+"/dist/js/highlight.js/styles/"+e+".css";n?n.getAttribute("href")!==i&&(n.remove(),(0,o.c)(i,"vditorHljsStyle")):(0,o.c)(i,"vditorHljsStyle")}},227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(578),o=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),o=t+"/"+e+".css";n?n.getAttribute("href")!==o&&(n.remove(),(0,r.c)(o,"vditorContentTheme")):(0,r.c)(o,"vditorContentTheme")}}},526:(e,t,n)=>{"use strict";n.d(t,{G:()=>o,J:()=>r});var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},o=function(e,t){return new Promise(function(n,r){if(document.getElementById(t))return n(),!1;var o=document.createElement("script");o.src=e,o.async=!0,document.head.appendChild(o),o.onerror=function(e){r(e)},o.onload=function(){if(document.getElementById(t))return o.remove(),n(),!1;o.id=t,n()}})}},578:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},51:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){return e.replace(/\u00a0/g," ")}},794:(e,t,n)=>{"use strict";n.d(t,{G6:()=>r,Le:()=>a,i7:()=>d,ns:()=>s,pK:()=>i,vU:()=>o,yl:()=>l});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},o=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},i=function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},l=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},s=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&o()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},d=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},835:(e,t,n)=>{"use strict";n.d(t,{W:()=>r,o:()=>o});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},o=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)}},827:(e,t,n)=>{"use strict";n.d(t,{DX:()=>u,E2:()=>i,F9:()=>s,JQ:()=>o,O9:()=>a,a1:()=>l,fb:()=>c,lG:()=>d});var r=n(64),o=function(e,t){for(var n=c(e,t),r=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(r=c(n.parentElement,t))?n=r:o=!0;return n||!1},i=function(e,t){for(var n=(0,r.S)(e,t),o=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(o=(0,r.S)(n.parentElement,t))?n=o:i=!0;return n||!1},a=function(e){var t=i(e,"UL"),n=i(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},l=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,o=!1;r&&!o&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?o=!0:r=r.parentElement;return o&&r},s=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=l(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},d=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},u=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},64:(e,t,n)=>{"use strict";n.d(t,{S:()=>r,W:()=>o});var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},o=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},640:(e,t,n)=>{"use strict";n.d(t,{T:()=>r});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},o=0;o<e.length;o++){var i=e[o];for(var a in i)i.hasOwnProperty(a)&&("[object Object]"===Object.prototype.toString.call(i[a])?n[a]=r(n[a],i[a]):n[a]=i[a])}return n}},393:(e,t,n)=>{"use strict";n.d(t,{$j:()=>u,Gb:()=>s,Hc:()=>d,Ny:()=>l,ib:()=>p,im:()=>c,oC:()=>f,zh:()=>a});var r=n(54),o=n(794),i=n(827),a=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},l=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!(0,i.fb)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};var n,r=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var o=t.startContainer.parentElement;if(!(o&&o.getClientRects().length>0))return{left:0,top:0};n=o.getClientRects()[0]}else{var a=t.startContainer.children;if(a[t.startOffset]&&a[t.startOffset].getClientRects().length>0)n=a[t.startOffset].getClientRects()[0];else if(t.startContainer.childNodes.length>0){var l=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(l.endContainer,l.endOffset),t.setStart(l.startContainer,l.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var s=t.startContainer.childNodes[t.startOffset];!s.getClientRects||s.getClientRects&&0===s.getClientRects().length;)s=s.parentElement;n=s.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},s=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},d=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},c=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(s(t,n)){var o=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?o.setStart(e.childNodes[0].childNodes[0],0):o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),r.start=o.toString().length,r.end=r.start+n.toString().length}return r},u=function(e,t,n){var r=0,o=0,i=n.childNodes[o],a=!1,l=!1;e=Math.max(0,e),t=Math.max(0,t);var s=n.ownerDocument.createRange();for(s.setStart(i||n,0),s.collapse(!0);!l&&i;){var c=r+i.textContent.length;if(!a&&e>=r&&e<=c&&(0===e?s.setStart(i,0):3===i.childNodes[0].nodeType?s.setStart(i.childNodes[0],e-r):i.nextSibling?s.setStartBefore(i.nextSibling):s.setStartAfter(i),a=!0,e===t)){l=!0;break}a&&t>=r&&t<=c&&(0===t?s.setEnd(i,0):3===i.childNodes[0].nodeType?s.setEnd(i.childNodes[0],t-r):i.nextSibling?s.setEndBefore(i.nextSibling):s.setEndAfter(i),l=!0),r=c,i=n.childNodes[++o]}return!l&&n.childNodes[o-1]&&s.setStartBefore(n.childNodes[o-1]),d(s),s},p=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling)){if(n.previousElementSibling.lastChild)return t.setStartBefore(n),t.collapse(!0),d(t),(0,o.i7)()&&("EM"===n.previousElementSibling.tagName||"STRONG"===n.previousElementSibling.tagName||"S"===n.previousElementSibling.tagName)&&(t.insertNode(document.createTextNode(r.g.ZWSP)),t.collapse(!1)),void n.remove();t.setStartAfter(n.previousElementSibling)}else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),d(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1!==r.length||r[0].previousSibling||r[0].nextSibling||!(t[t.currentMode].element.children.length>0)||"P"!==n.firstElementChild.tagName||(e=r[0].innerHTML.trim());var o=document.createElement("div");o.innerHTML=e;var l=a(t);if(""!==l.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),o.firstElementChild&&"0"===o.firstElementChild.getAttribute("data-block")){o.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var s=(0,i.F9)(l.startContainer);s?s.insertAdjacentHTML("afterend",o.innerHTML):t[t.currentMode].element.insertAdjacentHTML("beforeend",o.innerHTML),p(t[t.currentMode].element,l)}else{var c=document.createElement("template");c.innerHTML=e,l.insertNode(c.content.cloneNode(!0)),l.collapse(!1),d(l)}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>nF});var e,t=n(872),o=n(54),i=n(51),a=function(e){return"sv"===e.currentMode?(0,i.X)((e.sv.element.textContent+"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},l=n(526),s=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(e){var t=this;"block"===e.devtools.element.style.display&&(0,l.G)(e.options.cdn+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(a(e))),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}}),t.ASTChart.resize()}catch(e){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=e}})},e}(),d=n(794),c=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}})},u=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}})},p=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(o.g.CLASS_MENU_DISABLED)&&n.classList.remove(o.g.CLASS_MENU_DISABLED)}})},f=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(o.g.CLASS_MENU_DISABLED)&&n.classList.add(o.g.CLASS_MENU_DISABLED)}})},m=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="none")})},v=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="block")})},h=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.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")},g=function(e,t,n,r){n.addEventListener((0,d.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===t.style.display?t.style.display="none":(h(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")))})},b=n(827),y=n(64),w=function(e,t,n,r){r&&console.log(e+" - "+n+": "+t)},k=n(478),E=n(314),x=n(730),_=n(66),S=n(218),L=n(702),T=n(466),C=n(40),M=n(563),A=n(749),H=n(408),O=function(e,t){if(e)if("html-block"!==e.parentElement.getAttribute("data-type")){var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,k.Q)(e,t.options.cdn):"mermaid"===n?(0,C.i)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,M.K)(e,t.options.cdn,t.options.theme):"flowchart"===n?(0,_.P)(e,t.options.cdn):"echarts"===n?(0,E.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,A.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,H.B)(e,t.options.cdn):"graphviz"===n?(0,S.v)(e,t.options.cdn):"math"===n?(0,T.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(r){if(r.language===n)return r.render(e,t),!0})||((0,L.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,x.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},N=n(393),D=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=n,(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})}},j=function(e,t){var n=(0,b.lG)(e.target,"SPAN");if(n&&(0,b.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if("auto"===t.options.height){var o=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(o+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop}},I=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,N.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),ty(t),!0;if(tp(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,N.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),ty(t),!0;if(tu(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var o=(0,b.fb)(r.startContainer,"vditor-toc");if(o)return o.remove(),ty(t),!0}},R=function(e,t,n,r){void 0===n&&(n=!1);var i=(0,b.F9)(t.startContainer);if(i&&!n&&"code-block"!==i.getAttribute("data-type")){if(tg(i.innerHTML)&&i.previousElementSibling||tb(i.innerHTML))return;for(var l=(0,N.im)(i,e.ir.element,t).start,s=!0,d=l-1;d>i.textContent.substr(0,l).lastIndexOf("\n");d--)if(" "!==i.textContent.charAt(d)&&" "!==i.textContent.charAt(d)){s=!1;break}0===l&&(s=!1);var c=!0;for(d=l-1;d<i.textContent.length;d++)if(" "!==i.textContent.charAt(d)&&"\n"!==i.textContent.charAt(d)){c=!1;break}if(s)return void("function"==typeof e.options.input&&e.options.input(a(e)));if(c&&!(0,b.fb)(t.startContainer,"vditor-ir__marker")){var u=t.startContainer.previousSibling;return u&&3!==u.nodeType&&u.classList.contains("vditor-ir__node--expand")&&u.classList.remove("vditor-ir__node--expand"),void("function"==typeof e.options.input&&e.options.input(a(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),i||(i=e.ir.element),!i.querySelector("wbr")){var p=(0,b.fb)(t.startContainer,"vditor-ir__preview");p?p.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),"link-ref-defs-block"===i.getAttribute("data-type")&&(i=e.ir.element);var f,m=i.isEqualNode(e.ir.element),v=(0,b.a1)(i,"data-type","footnotes-block"),h="";if(m)h=i.innerHTML;else{var g=(0,y.S)(t.startContainer,"BLOCKQUOTE"),k=(0,b.O9)(t.startContainer);if(k&&(i=k),g&&(!k||k&&!g.contains(k))&&(i=g),v&&(i=v),h=i.outerHTML,"UL"===i.tagName||"OL"===i.tagName){var E=i.previousElementSibling,x=i.nextElementSibling;E&&("UL"===E.tagName||"OL"===E.tagName)&&(h=E.outerHTML+h,E.remove()),x&&("UL"===x.tagName||"OL"===x.tagName)&&(h+=x.outerHTML,x.remove()),h=h.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else i.previousElementSibling&&""!==i.previousElementSibling.textContent.replace(o.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(h=i.previousElementSibling.outerHTML+h,i.previousElementSibling.remove());i.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(h+=e.outerHTML,e.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(h+=e.outerHTML,e.remove())}))}if(w("SpinVditorIRDOM",h,"argument",e.options.debugger),w("SpinVditorIRDOM",h=e.lute.SpinVditorIRDOM(h),"result",e.options.debugger),m)i.innerHTML=h;else if(i.outerHTML=h,v){var _=(0,b.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(_){var S=_.textContent,L=S.substring(1,S.indexOf("]:")),T=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+L+'"]');T&&T.setAttribute("aria-label",S.substr(L.length+3).trim().substr(0,24))}}var C,M=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");M.forEach(function(e,t){0===t?f=e:(f.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),M.length>0&&e.ir.element.insertAdjacentElement("beforeend",M[0]);var A=e.ir.element.querySelectorAll("[data-type='footnotes-block']");A.forEach(function(e,t){0===t?C=e:(C.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),A.length>0&&e.ir.element.insertAdjacentElement("beforeend",A[0]),(0,N.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){O(t,e)}),D(e),tR(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!((0,d.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if("⇧Tab"===e)return!((0,d.yl)(t)||t.altKey||!t.shiftKey||"Tab"!==t.code);var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return!((3===n.length?!(0,d.yl)(t):(0,d.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(r)?"Digit":"Key")+r)}"⌘Enter"===e&&(n=["⌘","Enter"]);var o=n.length>2&&"⇧"===n[0],i=o?n[2]:n[1];return!o||!(0,d.vU)()&&/Mac/.test(navigator.platform)||("-"===i?i="_":"="===i&&(i="+")),!(!(0,d.yl)(t)||t.key.toLowerCase()!==i.toLowerCase()||t.altKey||!(!o&&!t.shiftKey||o&&t.shiftKey))},q=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var n=(0,b.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,b.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,N.Hc)(e));var o,i,a=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(!n){var r=(0,b.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var o=t.parentElement.parentElement.nextSibling;if(o&&3!==o.nodeType&&o.classList.contains("vditor-ir__node"))return o}return!1}return!(!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);if(a)return a.classList.add("vditor-ir__node--expand"),void a.classList.remove("vditor-ir__node--hidden");var l=(i=(o=e.startContainer).previousSibling,!(3!==o.nodeType||0!==e.startOffset||!i||3===i.nodeType||!i.classList.contains("vditor-ir__node")||i.getAttribute("data-block"))&&i);return l?(l.classList.add("vditor-ir__node--expand"),void l.classList.remove("vditor-ir__node--hidden")):void 0}},B=n(863),z=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var n=e.parentElement,r=n.nextSibling;r&&r.textContent.startsWith(" ");){var o=r;o.childNodes.forEach(function(e){n.append(e.cloneNode(!0))}),r=r.nextSibling,o.remove()}t&&t(n)})},U=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),o=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(o=r.startContainer.childNodes[r.startOffset-1]);var i=(0,b.a1)(o,"data-block","0");if(i&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var a=(0,N.im)(i,e.sv.element,r).start,l=!0,s=a-1;s>i.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==i.textContent.charAt(s)&&" "!==i.textContent.charAt(s)){l=!1;break}if(0===a&&(l=!1),l)return void e5(e);if("deleteContentBackward"===t.inputType){var d,c=(0,b.a1)(o,"data-type","code-block-open-marker")||(0,b.a1)(o,"data-type","code-block-close-marker");if(c&&("code-block-close-marker"===c.getAttribute("data-type")&&(d=e1(o,"code-block-open-marker"))||"code-block-open-marker"===c.getAttribute("data-type")&&(d=e1(o,"code-block-close-marker",!1))))return d.textContent=c.textContent,void e5(e);var u=(0,b.a1)(o,"data-type","math-block-open-marker");if(u){var p=u.nextElementSibling.nextElementSibling;return void(p&&"math-block-close-marker"===p.getAttribute("data-type")&&(p.remove(),e5(e)))}i.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),i.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var f=(0,b.a1)(o,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void e5(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,b.a1)(o,"data-type","padding")||(0,b.a1)(o,"data-type","li-marker")||(0,b.a1)(o,"data-type","task-marker")||(0,b.a1)(o,"data-type","blockquote-marker")))return void e5(e)}if(i&&"$$"===i.textContent.trimRight())e5(e);else{i||(i=e.sv.element),"link-ref-defs-block"===(null==(n=i.firstElementChild)?void 0:n.getAttribute("data-type"))&&(i=e.sv.element),(0,b.a1)(o,"data-type","footnotes-link")&&(i=e.sv.element),-1===i.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML});var m=i.textContent,v=i.isEqualNode(e.sv.element);if(v)m=i.textContent;else{i.previousElementSibling&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove()),i.previousElementSibling&&0===m.indexOf("---\n")&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove());var h="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),m=h+m}m=e2(m,e),v?i.innerHTML=m:i.outerHTML=m,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)}),z(e.sv.element,function(t){e.sv.element.insertAdjacentElement("beforeend",t)}),(0,N.ib)(e.sv.element,r),eY(e),e5(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},V=n(227),W=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},F=function(e){var t=window.innerWidth<=o.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px "+Math.max(t,n)+"px"}"none"!==e.ir.element.parentElement.style.display&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px "+Math.max(t,n)+"px"),"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},G=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(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 K(){window.removeEventListener("resize",e)}var Z,J,X,Y,Q,$,ee,et,en,er,eo,ei,ea,el,es,ed,ec,eu,ep,ef,em,ev,eh,eg,eb=function(t){G(t),K(),window.addEventListener("resize",e=function(){F(t),G(t)});var n=(0,d.pK)()&&localStorage.getItem(t.options.cache.id);return t.options.cache.enable&&n||(t.options.value?n=t.options.value:t.originalInnerHTML?n=t.lute.HTML2Md(t.originalInnerHTML):t.options.cache.enable||(n="")),n||""},ey=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,N.Gb)(e[e.currentMode].element)){c(e.toolbar.elements,o.g.EDIT_TOOLBARS),p(e.toolbar.elements,o.g.EDIT_TOOLBARS);var t=(0,N.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,b.a1)(n,"data-type","heading"):(0,y.W)(n))&&u(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,b.a1)(n,"data-type","blockquote"):(0,b.lG)(n,"BLOCKQUOTE"))&&u(e.toolbar.elements,["quote"]),(0,b.a1)(n,"data-type","strong")&&u(e.toolbar.elements,["bold"]),(0,b.a1)(n,"data-type","em")&&u(e.toolbar.elements,["italic"]),(0,b.a1)(n,"data-type","s")&&u(e.toolbar.elements,["strike"]),(0,b.a1)(n,"data-type","a")&&u(e.toolbar.elements,["link"]);var r=(0,b.lG)(n,"LI");r?(r.classList.contains("vditor-task")?u(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?u(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&u(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,b.a1)(n,"data-type","code-block")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),u(e.toolbar.elements,["code"])),(0,b.a1)(n,"data-type","code")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),u(e.toolbar.elements,["inline-code"])),(0,b.a1)(n,"data-type","table")&&f(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},ew=function(e,t){void 0===t&&(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=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,d.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)},ek=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},eE=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},ex=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var o=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,o)),t.collapse(!0),(0,N.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>"):"BR"===n.tagName?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,N.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},e_=function(e,t){var n=(0,N.zh)(e),r=(0,b.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<"+t+' data-block="0">'+r.innerHTML.trim()+"</"+t+">":r.outerHTML="<"+t+' data-block="0">'+r.innerHTML.trim()+"</"+t+">",(0,N.ib)(e.wysiwyg.element,n),D(e))},eS=function(e){var t=getSelection().getRangeAt(0),n=(0,b.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,N.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},eL=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,o=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?o.setStart(r.firstChild,1):o.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),o.selectNodeContents(r.firstChild)),n?o.collapse(!0):o.collapse(!1),(0,N.Hc)(o),e.firstElementChild.classList.contains("language-mindmap")||eY(t)},eT=function(e,t){if(P("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},eC=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,N.Gb)(e.wysiwyg.element)){c(e.toolbar.elements,o.g.EDIT_TOOLBARS),p(e.toolbar.elements,o.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,b.a1)(n,"data-type","footnotes-block");if(r)return e.wysiwyg.popover.innerHTML="",eN(r,e),void eM(e,r);var i=(0,b.lG)(n,"LI");i?(i.classList.contains("vditor-task")?u(e.toolbar.elements,["check"]):"OL"===i.parentElement.tagName?u(e.toolbar.elements,["ordered-list"]):"UL"===i.parentElement.tagName&&u(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,b.lG)(n,"BLOCKQUOTE")&&u(e.toolbar.elements,["quote"]),((0,b.lG)(n,"B")||(0,b.lG)(n,"STRONG"))&&u(e.toolbar.elements,["bold"]),((0,b.lG)(n,"I")||(0,b.lG)(n,"EM"))&&u(e.toolbar.elements,["italic"]),((0,b.lG)(n,"STRIKE")||(0,b.lG)(n,"S"))&&u(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")});var l=(0,b.fb)(n,"vditor-comment");if(l){var s=l.getAttribute("data-cmtids").split(" ");if(s.length>1&&l.nextSibling.isSameNode(l.nextElementSibling)){var m=l.nextElementSibling.getAttribute("data-cmtids").split(" ");s.find(function(e){if(m.includes(e))return s=[e],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){e.getAttribute("data-cmtids").indexOf(s[0])>-1&&e.classList.add("vditor-comment--focus")})}var v=(0,b.lG)(n,"A");v&&u(e.toolbar.elements,["link"]);var h=(0,b.lG)(n,"TABLE"),g=(0,y.W)(n);(0,b.lG)(n,"CODE")?(0,b.lG)(n,"PRE")?(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),u(e.toolbar.elements,["code"])):(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),u(e.toolbar.elements,["inline-code"])):g?(f(e.toolbar.elements,["bold"]),u(e.toolbar.elements,["headings"])):h&&f(e.toolbar.elements,["table"]);var w=(0,b.fb)(n,"vditor-toc");if(w)return e.wysiwyg.popover.innerHTML="",eN(w,e),void eM(e,w);var k=(0,y.S)(n,"BLOCKQUOTE");if(k&&(e.wysiwyg.popover.innerHTML="",eH(t,k,e),eO(t,k,e),eN(k,e),eM(e,k)),i&&(e.wysiwyg.popover.innerHTML="",eH(t,i,e),eO(t,i,e),eN(i,e),eM(e,i)),h){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var E=function(){var t=h.rows.length,n=h.rows[0].cells.length,r=parseInt(P.value,10)||t,o=parseInt(B.value,10)||n;if(r!==t||n!==o){if(n!==o)for(var i=o-n,l=0;l<h.rows.length;l++)if(i>0)for(var s=0;s<i;s++)0===l?h.rows[l].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):h.rows[l].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var d=n-1;d>=o;d--)h.rows[l].cells[d].remove();if(t!==r){var c=r-t;if(c>0){for(var u="<tr>",p=0;p<o;p++)u+="<td> </td>";for(var f=0;f<c;f++)h.querySelector("tbody")?h.querySelector("tbody").insertAdjacentHTML("beforeend",u):h.querySelector("thead").insertAdjacentHTML("afterend",u+"</tr>")}else for(p=t-1;p>=r;p--)h.rows[p].remove(),1===h.rows.length&&h.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(a(e))}},x=function(n){th(h,n),"right"===n?(T.classList.remove("vditor-icon--current"),C.classList.remove("vditor-icon--current"),M.classList.add("vditor-icon--current")):"center"===n?(T.classList.remove("vditor-icon--current"),M.classList.remove("vditor-icon--current"),C.classList.add("vditor-icon--current")):(C.classList.remove("vditor-icon--current"),M.classList.remove("vditor-icon--current"),T.classList.add("vditor-icon--current")),(0,N.Hc)(t),ew(e)},_=(0,b.lG)(n,"TD"),S=(0,b.lG)(n,"TH"),L="left";_?L=_.getAttribute("align")||"left":S&&(L=S.getAttribute("align")||"center");var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,d.ns)("⇧⌘L")+">"),T.setAttribute("data-type","left"),T.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===L?" vditor-icon--current":""),T.onclick=function(){x("left")};var C=document.createElement("button");C.setAttribute("type","button"),C.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,d.ns)("⇧⌘C")+">"),C.setAttribute("data-type","center"),C.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',C.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===L?" vditor-icon--current":""),C.onclick=function(){x("center")};var M=document.createElement("button");M.setAttribute("type","button"),M.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,d.ns)("⇧⌘R")+">"),M.setAttribute("data-type","right"),M.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',M.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===L?" vditor-icon--current":""),M.onclick=function(){x("right")};var A=document.createElement("button");A.setAttribute("type","button"),A.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,d.ns)("⌘=")+">"),A.setAttribute("data-type","insertRow"),A.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',A.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",A.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tx(e,t,r)};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,d.ns)("⇧⌘F")+">"),H.setAttribute("data-type","insertRow"),H.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",H.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&t_(e,t,r)};var D=document.createElement("button");D.setAttribute("type","button"),D.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,d.ns)("⇧⌘=")+">"),D.setAttribute("data-type","insertColumn"),D.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',D.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",D.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,b.lG)(t,"TD")||(0,b.lG)(t,"TH");n&&tS(e,h,n)};var j=document.createElement("button");j.setAttribute("type","button"),j.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,d.ns)("⇧⌘G")+">"),j.setAttribute("data-type","insertColumn"),j.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',j.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",j.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,b.lG)(t,"TD")||(0,b.lG)(t,"TH");n&&tS(e,h,n,"beforebegin")};var I=document.createElement("button");I.setAttribute("type","button"),I.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,d.ns)("⌘-")+">"),I.setAttribute("data-type","deleteRow"),I.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',I.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",I.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tL(e,t,r)};var R=document.createElement("button");R.setAttribute("type","button"),R.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,d.ns)("⇧⌘-")+">"),R.setAttribute("data-type","deleteColumn"),R.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',R.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",R.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tT(e,t,h,r)},(J=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),J.className="vditor-tooltipped vditor-tooltipped__n";var P=document.createElement("input");J.appendChild(P),P.type="number",P.min="1",P.className="vditor-input",P.style.width="42px",P.style.textAlign="center",P.setAttribute("placeholder",window.VditorI18n.row),P.value=h.rows.length.toString(),P.oninput=function(){E()},P.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(B.focus(),B.select(),void n.preventDefault()):void(eT(e,n)||eI(n,t))};var q=document.createElement("span");q.setAttribute("aria-label",window.VditorI18n.column),q.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");q.appendChild(B),B.type="number",B.min="1",B.className="vditor-input",B.style.width="42px",B.style.textAlign="center",B.setAttribute("placeholder",window.VditorI18n.column),B.value=h.rows[0].cells.length.toString(),B.oninput=function(){E()},B.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(P.focus(),P.select(),void n.preventDefault()):void(eT(e,n)||eI(n,t))},eH(t,h,e),eO(t,h,e),eN(h,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",C),e.wysiwyg.popover.insertAdjacentElement("beforeend",M),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",A),e.wysiwyg.popover.insertAdjacentElement("beforeend",j),e.wysiwyg.popover.insertAdjacentElement("beforeend",D),e.wysiwyg.popover.insertAdjacentElement("beforeend",I),e.wysiwyg.popover.insertAdjacentElement("beforeend",R),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",q),eM(e,h)}var z=(0,b.a1)(n,"data-type","link-ref");z&&eA(e,z,t);var U=(0,b.a1)(n,"data-type","footnotes-ref");if(U){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(J=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,d.ns)("⌥Enter")+">"),J.className="vditor-tooltipped vditor-tooltipped__n";var V=document.createElement("input");J.appendChild(V),V.className="vditor-input",V.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,d.ns)("⌥Enter")+">"),V.style.width="120px",V.value=U.getAttribute("data-footnotes-label"),V.oninput=function(){""!==V.value.trim()&&U.setAttribute("data-footnotes-label",V.value),"function"==typeof e.options.input&&e.options.input(a(e))},V.onkeydown=function(n){n.isComposing||eT(e,n)||eI(n,t)},eN(U,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),eM(e,U)}var W=(0,b.fb)(n,"vditor-wysiwyg__block"),F=!!W&&W.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){(!W||W&&F&&!W.contains(e))&&(e.previousElementSibling.style.display="none")}),W&&F){if(e.wysiwyg.popover.innerHTML="",eH(t,W,e),eO(t,W,e),eN(W,e),"code-block"===W.getAttribute("data-type")){var G=document.createElement("span");G.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,d.ns)("⌥Enter")+">"),G.className="vditor-tooltipped vditor-tooltipped__n";var K=document.createElement("input");G.appendChild(K);var Z=W.firstElementChild.firstElementChild;K.className="vditor-input",K.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,d.ns)("⌥Enter")+">"),K.value=Z.className.indexOf("language-")>-1?Z.className.split("-")[1].split(" ")[0]:"",K.oninput=function(n){""!==K.value.trim()?Z.className="language-"+K.value:(Z.className="",e.hint.recentLanguage=""),W.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(W.lastElementChild.innerHTML=W.firstElementChild.innerHTML,O(W.lastElementChild,e)),ew(e),1===n.detail&&(t.setStart(Z.firstChild,0),t.collapse(!0),(0,N.Hc)(t))},K.onkeydown=function(n){if(!n.isComposing&&!eT(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display)return e.hint.element.style.display="none",void n.preventDefault();e.hint.select(n,e),eI(n,t)}},K.onkeyup=function(t){if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var n=[],r=K.value.substring(0,K.selectionStart);(e.options.preview.hljs.langs||o.g.CODE_LANGUAGES).forEach(function(e){e.indexOf(r.toLowerCase())>-1&&n.push({html:e,value:e})}),e.hint.genHTML(n,r,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",G)}eM(e,W)}else W=void 0;if(g){e.wysiwyg.popover.innerHTML="",(J=document.createElement("span")).setAttribute("aria-label","ID<"+(0,d.ns)("⌥Enter")+">"),J.className="vditor-tooltipped vditor-tooltipped__n";var J,X=document.createElement("input");J.appendChild(X),X.className="vditor-input",X.setAttribute("placeholder","ID<"+(0,d.ns)("⌥Enter")+">"),X.style.width="120px",X.value=g.getAttribute("data-id")||"",X.oninput=function(){g.setAttribute("data-id",X.value),"function"==typeof e.options.input&&e.options.input(a(e))},X.onkeydown=function(n){n.isComposing||eT(e,n)||eI(n,t)},eH(t,g,e),eO(t,g,e),eN(g,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),eM(e,g)}if(v&&ej(e,v,t),!(k||i||h||W||v||z||U||g||w)){var Y=(0,b.a1)(n,"data-block","0");Y&&Y.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",eH(t,Y,e),eO(t,Y,e),eN(Y,e),eM(e,Y)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"});var Q=(0,b.a1)(t.startContainer,"data-type","backslash");Q&&(Q.querySelector("span").style.display="inline")}},200)},eM=function(e,t){var n=t,r=(0,b.lG)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},eA=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",i.value):t.textContent=i.value),""!==s.value.trim()&&t.setAttribute("data-link-label",s.value),"function"==typeof e.options.input&&e.options.input(a(e))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.getAttribute("alt")||t.textContent,i.oninput=function(){r()},i.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,s)};var l=document.createElement("span");l.setAttribute("aria-label",window.VditorI18n.linkRef),l.className="vditor-tooltipped vditor-tooltipped__n";var s=document.createElement("input");l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.linkRef),s.value=t.getAttribute("data-link-label"),s.oninput=function(){r()},s.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,i)},eN(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",l),eM(e,t)},eH=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","up"),o.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,d.ns)("⇧⌘U")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,N.ib)(n.wysiwyg.element,e),ew(n),eC(n),eY(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eO=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","down"),o.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,d.ns)("⇧⌘D")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,N.ib)(n.wysiwyg.element,e),ew(n),eC(n),eY(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eN=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,d.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 n=(0,N.zh)(t);n.setStartAfter(e),(0,N.Hc)(n),e.remove(),ew(t),eC(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&D(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},eD=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key)return r.focus(),r.select(),void n.preventDefault();if(!(0,d.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var i=(0,N.zh)(e);t.insertAdjacentHTML("afterend",o.g.ZWSP),i.setStartAfter(t.nextSibling),i.collapse(!0),(0,N.Hc)(i),n.preventDefault()}}},ej=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&(t.innerHTML=i.value),t.setAttribute("href",l.value),t.setAttribute("title",d.value),ew(e)};t.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.innerHTML||"",i.oninput=function(){r()},i.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.link),l.value=t.getAttribute("href")||"",l.oninput=function(){r()},l.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,d)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.tooltipText),s.className="vditor-tooltipped vditor-tooltipped__n";var d=document.createElement("input");s.appendChild(d),d.className="vditor-input",d.setAttribute("placeholder",window.VditorI18n.tooltipText),d.style.width="60px",d.value=t.getAttribute("title")||"",d.oninput=function(){r()},d.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,i)},eN(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),eM(e,t)},eI=function(e,t){if(!(0,d.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,N.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},eR=function(e){"wysiwyg"===e.currentMode?eC(e):"ir"===e.currentMode&&ey(e)},eP=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){O(t,e),t.previousElementSibling.setAttribute("style","display:none")}),ew(e,n)},eq=function(e,t,n){for(var r,i,a,l,s,d,c=e.startContainer.parentElement,u=!1,p="",f="",m=(r=eE(e.startContainer),i=ek(e.startContainer),a=e.startContainer.textContent,l=e.startOffset,s="",d="",(""!==a.substr(0,l)&&a.substr(0,l)!==o.g.ZWSP||r)&&(s=""+r+a.substr(0,l)),(""!==a.substr(l)&&a.substr(l)!==o.g.ZWSP||i)&&(d=""+a.substr(l)+i),{afterHTML:d,beforeHTML:s}),v=m.beforeHTML,h=m.afterHTML;c&&!u;){var g=c.tagName;if("STRIKE"===g&&(g="S"),"I"===g&&(g="EM"),"B"===g&&(g="STRONG"),"S"===g||"STRONG"===g||"EM"===g){var b="",y="",w="";"0"!==c.parentElement.getAttribute("data-block")&&(y=eE(c),w=ek(c)),(v||y)&&(v=b=y+"<"+g+">"+v+"</"+g+">"),("bold"===n&&"STRONG"===g||"italic"===n&&"EM"===g||"strikeThrough"===n&&"S"===g)&&(b+=""+p+o.g.ZWSP+"<wbr>"+f,u=!0),(h||w)&&(b+=h="<"+g+">"+h+"</"+g+">"+w),"0"!==c.parentElement.getAttribute("data-block")?(c=c.parentElement).innerHTML=b:(c.outerHTML=b,c=c.parentElement),p="<"+g+">"+p,f="</"+g+">"+f}else u=!0}(0,N.ib)(t.wysiwyg.element,e)},eB=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var i=t.hotkey?" <"+(0,d.ns)(t.hotkey)+">":"";2===t.level&&(i=t.hotkey?" &lt;"+(0,d.ns)(t.hotkey)+"&gt;":"");var a=t.tip?t.tip+i:""+window.VditorI18n[t.name]+i,l="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<"+l+' data-type="'+t.name+'">'+a+"</"+l+">";else{this.element.classList.add("vditor-toolbar__item");var s=document.createElement(l);s.setAttribute("data-type",t.name),s.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,s.setAttribute("aria-label",a),s.innerHTML=t.icon,this.element.appendChild(s)}t.prefix&&this.element.children[0].addEventListener((0,d.Le)(),function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,i=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var a=(0,N.zh)(e),l=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if("strike"===l&&(l="strikeThrough"),"quote"===l){var s=(0,b.lG)(a.startContainer,"BLOCKQUOTE");s||(s=a.startContainer.childNodes[a.startOffset]),s&&(r=!1,t.classList.remove("vditor-menu--current"),a.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'+s.innerHTML+"</p>":s.innerHTML,(0,N.ib)(e.wysiwyg.element,a))}else if("inline-code"===l){var d=(0,b.lG)(a.startContainer,"CODE");d||(d=a.startContainer.childNodes[a.startOffset]),d&&(d.outerHTML=d.innerHTML.replace(o.g.ZWSP,"")+"<wbr>",(0,N.ib)(e.wysiwyg.element,a))}else"link"===l?(a.collapsed&&a.selectNode(a.startContainer.parentElement),document.execCommand("unlink",!1,"")):"check"===l||"list"===l||"ordered-list"===l?(tf(e,a,l),(0,N.ib)(e.wysiwyg.element,a),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===a.toString()?eq(a,e,l):document.execCommand(l,!1,""));else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.wysiwyg.element,a));var u=(0,b.F9)(a.startContainer);if("quote"===l){if(u||(u=a.startContainer.childNodes[a.startOffset]),u){r=!1,t.classList.add("vditor-menu--current"),a.insertNode(document.createElement("wbr"));var p=(0,b.lG)(a.startContainer,"LI");p&&u.contains(p)?p.innerHTML='<blockquote data-block="0">'+p.innerHTML+"</blockquote>":u.outerHTML='<blockquote data-block="0">'+u.outerHTML+"</blockquote>",(0,N.ib)(e.wysiwyg.element,a)}}else if("check"===l||"list"===l||"ordered-list"===l)tf(e,a,l,!1),(0,N.ib)(e.wysiwyg.element,a),r=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===l){if(""===a.toString())(f=document.createElement("code")).textContent=o.g.ZWSP,a.insertNode(f),a.setStart(f.firstChild,1),a.collapse(!0),(0,N.Hc)(a);else if(3===a.startContainer.nodeType){var f=document.createElement("code");a.surroundContents(f),a.insertNode(f),(0,N.Hc)(a)}t.classList.add("vditor-menu--current")}else if("code"===l)(f=document.createElement("div")).className="vditor-wysiwyg__block",f.setAttribute("data-type","code-block"),f.setAttribute("data-block","0"),f.setAttribute("data-marker","```"),""===a.toString()?f.innerHTML="<pre><code><wbr>\n</code></pre>":(f.innerHTML="<pre><code>"+a.toString()+"<wbr></code></pre>",a.deleteContents()),a.insertNode(f),u&&(u.outerHTML=e.lute.SpinVditorDOM(u.outerHTML)),(0,N.ib)(e.wysiwyg.element,a),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){O(t,e)}),t.classList.add("vditor-menu--disabled");else if("link"===l){if(""===a.toString()){var m=document.createElement("a");m.innerText=o.g.ZWSP,a.insertNode(m),a.setStart(m.firstChild,1),a.collapse(!0),ej(e,m,a);var v=e.wysiwyg.popover.querySelector("input");v.value="",v.focus(),i=!1}else{(f=document.createElement("a")).setAttribute("href",""),f.innerHTML=a.toString(),a.surroundContents(f),a.insertNode(f),(0,N.Hc)(a),ej(e,f,a);var h=e.wysiwyg.popover.querySelectorAll("input");h[0].value=f.innerText,h[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===l){var g='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(""===a.toString().trim())u&&""===u.innerHTML.trim().replace(o.g.ZWSP,"")?u.outerHTML=g:document.execCommand("insertHTML",!1,g),a.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,N.Hc)(a);else{g='<table data-block="0"><thead><tr>';var y=a.toString().split("\n"),w=y[0].split(",").length>y[0].split(" ").length?",":" ";y.forEach(function(e,t){0===t?(e.split(w).forEach(function(e,t){g+=0===t?"<th>"+e+"<wbr></th>":"<th>"+e+"</th>"}),g+="</tr></thead>"):(g+=1===t?"<tbody><tr>":"<tr>",e.split(w).forEach(function(e){g+="<td>"+e+"</td>"}),g+="</tr>")}),g+="</tbody></table>",document.execCommand("insertHTML",!1,g),(0,N.ib)(e.wysiwyg.element,a)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===l){if(u){var k='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===u.innerHTML.trim()?u.outerHTML=k:u.insertAdjacentHTML("afterend",k),(0,N.ib)(e.wysiwyg.element,a)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===l&&(l="strikeThrough"),""!==a.toString()||"bold"!==l&&"italic"!==l&&"strikeThrough"!==l)document.execCommand(l,!1,"");else{var E="strong";"italic"===l?E="em":"strikeThrough"===l&&(E="s"),(f=document.createElement(E)).textContent=o.g.ZWSP,a.insertNode(f),f.previousSibling&&f.previousSibling.textContent===o.g.ZWSP&&(f.previousSibling.textContent=""),a.setStart(f.firstChild,1),a.collapse(!0),(0,N.Hc)(a)}}r&&eC(e),i&&ew(e)}}(e,r.element.children[0],n):"ir"===e.currentMode?tB(e,r.element.children[0],t.prefix||"",t.suffix||""):e6(e,r.element.children[0],t.prefix||"",t.suffix||""))})},ez=(eh=function(e,t){return(eh=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}eh(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),eU=function(e,t,n){var r;if("string"!=typeof n?(h(e,["subToolbar","hint"]),n.preventDefault(),r=a(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",p(e.toolbar.elements,o.g.EDIT_TOOLBARS),c(e.toolbar.elements,o.g.EDIT_TOOLBARS),f(e.toolbar.elements,["outdent","indent"]),"ir"===t)m(e.toolbar.elements,["both"]),v(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),tR(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),F(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){O(t,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})});else if("wysiwyg"===t)m(e.toolbar.elements,["both"]),v(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",F(e),eP(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if("sv"===t){v(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",("both"===e.options.preview.mode||"editor"===e.options.preview.mode)&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var i=e2(r,e);"<div data-block='0'></div>"===i&&(i=""),e.sv.element.innerHTML=i,z(e.sv.element),e5(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),F(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),eR(e)),D(e),G(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.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,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},eV=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'+window.VditorI18n.wysiwyg+" &lt;"+(0,d.ns)("⌥⌘7")+'></button>\n<button data-mode="ir">'+window.VditorI18n.instantRendering+" &lt;"+(0,d.ns)("⌥⌘8")+'></button>\n<button data-mode="sv">'+window.VditorI18n.splitView+" &lt;"+(0,d.ns)("⌥⌘9")+"></button>",r.element.appendChild(o),r._bindEvent(t,o,n),r}return ez(t,e),t.prototype._bindEvent=function(e,t,n){g(e,t,this.element.children[0],n.level),t.children.item(0).addEventListener((0,d.Le)(),function(t){eU(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()}),t.children.item(1).addEventListener((0,d.Le)(),function(t){eU(e,"ir",t),t.preventDefault(),t.stopPropagation()}),t.children.item(2).addEventListener((0,d.Le)(),function(t){eU(e,"sv",t),t.preventDefault(),t.stopPropagation()})},t}(eB),eW=function(e,t){return(0,N.Gb)(e,t)?getSelection().toString():""},eF=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(a(e)),h(e,["subToolbar","hint"])})},eG=function(e,t){t.addEventListener("dblclick",function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,B.E)(t.target,e.options.lang,e.options.theme))})},eK=function(e,t){t.addEventListener("blur",function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,N.zh)(e),e.options.blur&&e.options.blur(a(e))})},eZ=function(e,t){t.addEventListener("dragstart",function(e){e.dataTransfer.setData(o.g.DROP_EDITOR,o.g.DROP_EDITOR)}),t.addEventListener("drop",function(t){t.dataTransfer.getData(o.g.DROP_EDITOR)?ty(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&tj(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},eJ=function(e,t,n){t.addEventListener("copy",function(t){return n(t,e)})},eX=function(e,t,n){t.addEventListener("cut",function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")})},eY=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,N.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},eQ=function(e,t){t.addEventListener("keydown",function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(t,e)){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||P("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(function(e,t){if(e.sv.composingLock=t.isComposing,t.isComposing||(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,d.yl)(t)&&"Escape"!==t.key))return!1;var n,r,o,i,a,l=(0,N.zh)(e),s=l.startContainer;3!==l.startContainer.nodeType&&"DIV"===l.startContainer.tagName&&(s=l.startContainer.childNodes[l.startOffset-1]);var c=(0,b.a1)(s,"data-type","text"),u=(0,b.a1)(s,"data-type","blockquote-marker");if(!u&&0===l.startOffset&&c&&c.previousElementSibling&&"blockquote-marker"===c.previousElementSibling.getAttribute("data-type")&&(u=c.previousElementSibling),u&&"Enter"===t.key&&!(0,d.yl)(t)&&!t.altKey&&""===u.nextElementSibling.textContent.trim()&&(0,N.im)(u,e.sv.element,l).start===u.textContent.length)return"padding"===(null==(n=u.previousElementSibling)?void 0:n.getAttribute("data-type"))&&u.previousElementSibling.setAttribute("data-action","enter-remove"),u.remove(),e5(e),t.preventDefault(),!0;var p=(0,b.a1)(s,"data-type","li-marker"),f=(0,b.a1)(s,"data-type","task-marker"),m=p;if(m||f&&"task-marker"!==f.nextElementSibling.getAttribute("data-type")&&(m=f),!m&&0===l.startOffset&&c&&c.previousElementSibling&&("li-marker"===c.previousElementSibling.getAttribute("data-type")||"task-marker"===c.previousElementSibling.getAttribute("data-type"))&&(m=c.previousElementSibling),m){var v=(0,N.im)(m,e.sv.element,l).start,h="task-marker"===m.getAttribute("data-type"),g=m;if(h&&(g=m.previousElementSibling.previousElementSibling.previousElementSibling),v===m.textContent.length){if("Enter"===t.key&&!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey&&""===m.nextElementSibling.textContent.trim())return"padding"===(null==(r=g.previousElementSibling)?void 0:r.getAttribute("data-type"))?(g.previousElementSibling.remove(),U(e)):(h&&(g.remove(),m.previousElementSibling.previousElementSibling.remove(),m.previousElementSibling.remove()),m.nextElementSibling.remove(),m.remove(),e5(e)),t.preventDefault(),!0;if("Tab"===t.key)return g.insertAdjacentHTML("beforebegin",'<span data-type="padding">'+g.textContent.replace(/\S/g," ")+"</span>"),/^\d/.test(g.textContent)&&(g.textContent=g.textContent.replace(/^\d{1,}/,"1"),l.selectNodeContents(m.firstChild),l.collapse(!1)),U(e),t.preventDefault(),!0}}if(tk(e,l,t))return!0;var w=(0,b.a1)(s,"data-block","0"),k=(0,y.S)(s,"SPAN");if("Enter"===t.key&&!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey&&w){var E=!1,x=w.textContent.match(/^\n+/);(0,N.im)(w,e.sv.element).start<=(x?x[0].length:0)&&(E=!0);var _="\n";if(k){if("enter-remove"===(null==(o=k.previousElementSibling)?void 0:o.getAttribute("data-action")))return k.previousElementSibling.remove(),e5(e),t.preventDefault(),!0;_+=e3(k)}return l.insertNode(document.createTextNode(_)),l.collapse(!1),w&&""!==w.textContent.trim()&&!E?U(e):e5(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey){if(k&&"newline"===(null==(i=k.previousElementSibling)?void 0:i.getAttribute("data-type"))&&1===(0,N.im)(k,e.sv.element,l).start&&-1===k.getAttribute("data-type").indexOf("code-block-"))return l.setStart(k,0),l.extractContents(),""!==k.textContent.trim()?U(e):e5(e),t.preventDefault(),!0;if(w&&0===(0,N.im)(w,e.sv.element,l).start&&w.previousElementSibling){l.extractContents();var S=w.previousElementSibling.lastElementChild;return"newline"===S.getAttribute("data-type")&&(S.remove(),S=w.previousElementSibling.lastElementChild),"newline"!==S.getAttribute("data-type")&&(S.insertAdjacentHTML("afterend",w.innerHTML),w.remove()),""===w.textContent.trim()||(null==(a=w.previousElementSibling)?void 0:a.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==S.getAttribute("data-type")&&(l.selectNodeContents(S.lastChild),l.collapse(!1)),e5(e)):U(e),t.preventDefault(),!0}}return!1}(e,t))return}else if("wysiwyg"===e.currentMode){if(function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!to(t,e,r)||(ti(n,e,t),tN(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,d.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var i=(0,b.F9)(r),a=(0,b.lG)(r,"P");if(tE(t,e,a,n)||tw(n,e,a,t)||tC(e,t,n))return!0;var l=(0,b.fb)(r,"vditor-wysiwyg__block");if(l){if("Escape"===t.key&&2===l.children.length)return e.wysiwyg.popover.style.display="none",l.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,d.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===l.getAttribute("data-type")){var s=e.wysiwyg.popover.querySelector(".vditor-input");return s.focus(),s.select(),t.preventDefault(),!0}if("0"===l.getAttribute("data-block")&&(tM(e,t,l.firstElementChild,n)||tu(e,t,n,l.firstElementChild,l)||"yaml-front-matter"!==l.getAttribute("data-type")&&tp(e,t,n,l.firstElementChild,l)))return!0}if(tA(e,n,t,a))return!0;var c=(0,b.E2)(r,"BLOCKQUOTE");if(c&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,d.yl)(t)?n.setStartBefore(c):n.setStartAfter(c),(0,N.Hc)(n);var u=document.createElement("p");return u.setAttribute("data-block","0"),u.innerHTML="\n",n.insertNode(u),n.collapse(!0),(0,N.Hc)(n),ew(e),eY(e),t.preventDefault(),!0}var p,f=(0,y.W)(r);if(f){if("H6"===f.tagName&&r.textContent.length===n.startOffset&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var m,v=document.createElement("p");return v.textContent="\n",v.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",v),n.setStart(v,0),(0,N.Hc)(n),ew(e),eY(e),t.preventDefault(),!0}if(P("⌘=",t))return(m=parseInt(f.tagName.substr(1),10)-1)>0&&(e_(e,"h"+m),ew(e)),t.preventDefault(),!0;if(P("⌘-",t))return(m=parseInt(f.tagName.substr(1),10)+1)<7&&(e_(e,"h"+m),ew(e)),t.preventDefault(),!0;"Backspace"!==t.key||(0,d.yl)(t)||t.shiftKey||t.altKey||1!==f.textContent.length||eS(e)}if(tH(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,d.yl)(t)&&!t.shiftKey){var h=(0,b.lG)(r,"A"),g=(0,b.a1)(r,"data-type","link-ref"),w=(0,b.a1)(r,"data-type","footnotes-ref");if(h||g||w||f&&2===f.tagName.length){var k=e.wysiwyg.popover.querySelector("input");k.focus(),k.select()}}if(eT(e,t))return!0;if(P("⇧⌘U",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="up"]'))||P("⇧⌘D",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="down"]')))return p.click(),t.preventDefault(),!0;if(tk(e,n,t))return!0;if(!(0,d.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+o.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,N.Hc)(n),ew(e),eY(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(tO(e,n,t,a))return!0;if(i){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===i.previousElementSibling.getAttribute("data-block")&&"UL"!==i.tagName&&"OL"!==i.tagName){var E=(0,N.im)(i,e.wysiwyg.element,n).start;if(0===E&&0===n.startOffset||1===E&&i.innerText.startsWith(o.g.ZWSP))return eL(i.previousElementSibling.lastElementChild,e,!1),""===i.innerHTML.trim().replace(o.g.ZWSP,"")&&(i.remove(),ew(e)),t.preventDefault(),!0}var x=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(x-2)&&r.textContent.charAt(x-1)!==o.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,x-1)+o.g.ZWSP,n.setStart(r,x),n.collapse(!0),ew(e),t.preventDefault(),!0;r.textContent===o.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!(!t||3===t.nodeType||"CODE"!==t.tagName&&"math-inline"!==t.getAttribute("data-type")&&"html-entity"!==t.getAttribute("data-type")&&"html-inline"!==t.getAttribute("data-type"))}(n)&&(r.textContent=""),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}if((0,d.vU)()&&1===n.startOffset&&r.textContent.indexOf(o.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(tD(t,i,n))return t.preventDefault(),!0;if(ta(n,t.key),"ArrowDown"===t.key){var _=r.nextSibling;_&&3!==_.nodeType&&"math-inline"===_.getAttribute("data-type")&&n.setStartAfter(_)}return!(!i||!I(i,e,t,n)||(t.preventDefault(),0))}(e,t))return}else if("ir"===e.currentMode&&function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n,r=(0,N.zh)(e),i=r.startContainer;if(!to(t,e,i)||(ti(r,e,t),tN(r),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,d.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var a=(0,b.a1)(i,"data-newline","1");if(!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&a&&r.startOffset<a.textContent.length){var l=a.previousElementSibling;l&&(r.insertNode(document.createTextNode(l.textContent)),r.collapse(!1));var s=a.nextSibling;s&&(r.insertNode(document.createTextNode(s.textContent)),r.collapse(!0))}var c=(0,b.lG)(i,"P");if(tE(t,e,c,r)||tw(r,e,c,t)||tA(e,r,t,c))return!0;var u=(0,b.fb)(i,"vditor-ir__marker--pre");if(u&&"PRE"===u.tagName){var p=u.firstChild;if(tM(e,t,u,r)||("math-block"===p.getAttribute("data-type")||"html-block"===p.getAttribute("data-type"))&&tp(e,t,r,p,u.parentElement)||tu(e,t,r,p,u.parentElement))return!0}var f=(0,b.a1)(i,"data-type","code-block-info");if(f){if("Enter"===t.key||"Tab"===t.key)return r.selectNodeContents(f.nextElementSibling.firstChild),r.collapse(!0),t.preventDefault(),h(e,["hint"]),!0;if("Backspace"===t.key){var m=(0,N.im)(f,e.ir.element).start;1===m&&r.setStart(i,0),2===m&&(e.hint.recentLanguage="")}if(tp(e,t,r,f,f.parentElement))return h(e,["hint"]),!0}var v=(0,b.lG)(i,"TD")||(0,b.lG)(i,"TH");if(t.key.indexOf("Arrow")>-1&&v){var g=ts(v);if(g&&tp(e,t,r,v,g))return!0;var w=td(v);if(w&&tu(e,t,r,v,w))return!0}if(tC(e,t,r)||tH(e,r,t)||tk(e,r,t))return!0;var k=(0,y.W)(i);if(k){if(P("⌘=",t))return(n=k.querySelector(".vditor-ir__marker--heading"))&&n.textContent.trim().length>1&&tP(e,n.textContent.substr(1)),t.preventDefault(),!0;if(P("⌘-",t))return(n=k.querySelector(".vditor-ir__marker--heading"))&&n.textContent.trim().length<6&&tP(e,n.textContent.trim()+"# "),t.preventDefault(),!0}var E=(0,b.F9)(i);if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&""===r.toString()){if(tO(e,r,t,c))return!0;if(E&&E.previousElementSibling&&"UL"!==E.tagName&&"OL"!==E.tagName&&("code-block"===E.previousElementSibling.getAttribute("data-type")||"math-block"===E.previousElementSibling.getAttribute("data-type"))){var x=(0,N.im)(E,e.ir.element,r).start;if(0===x||1===x&&E.innerText.startsWith(o.g.ZWSP))return r.selectNodeContents(E.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),r.collapse(!1),q(r,e),""===E.textContent.trim().replace(o.g.ZWSP,"")&&(E.remove(),tR(e)),t.preventDefault(),!0}if(k){var _=k.firstElementChild.textContent.length;(0,N.im)(k,e.ir.element).start===_&&(r.setStart(k.firstElementChild.firstChild,_-1),r.collapse(!0),(0,N.Hc)(r))}}return!(("ArrowUp"!==t.key&&"ArrowDown"!==t.key||!E||(E.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(i)||e.classList.add("vditor-ir__node--hidden")}),!tD(t,E,r)))&&(ta(r,t.key),!E||!I(E,e,t,r)||(t.preventDefault(),0)))}(e,t))return;if(e.options.ctrlEnter&&P("⌘Enter",t))return e.options.ctrlEnter(a(e)),void t.preventDefault();if(P("⌘Z",t)&&!e.toolbar.elements.undo)return e.undo.undo(e),void t.preventDefault();if(P("⌘Y",t)&&!e.toolbar.elements.redo)return e.undo.redo(e),void t.preventDefault();if("Escape"===t.key)return"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(a(e)),void t.preventDefault();if((0,d.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,b.lG)(getSelection().getRangeAt(0).startContainer,n)?eS(e):e_(e,n),ew(e)}else"sv"===e.currentMode?e4(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&tP(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,d.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?eU(e,"wysiwyg",t):"Digit8"===t.code?eU(e,"ir",t):"Digit9"===t.code&&eU(e,"sv",t),!0;e.options.toolbar.find(function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find(function(n){return!!n.hotkey&&(P(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,d.Le)())),t.preventDefault(),!0):void 0)}):P(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,d.Le)())),t.preventDefault(),!0):void 0})}})},e$=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var t=eW(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,b.a1)(n.target,"data-type","footnotes-block")||(0,b.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):"wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},e0=function(e,t){var n=(0,N.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,b.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var o=e.lute.SpinVditorSVDOM(r.textContent);o="<div data-block='0'>"+o.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">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=o:r.outerHTML=o,z(e.sv.element),(0,N.ib)(e.sv.element,n),eY(e)},e1=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},e2=function(e,t){return w("SpinVditorSVDOM",e,"argument",t.options.debugger),w("SpinVditorSVDOM",e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).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">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>","result",t.options.debugger),e},e3=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=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"!==t?e.textContent:"",o=!1;for("newline"===t&&(o=!0);n&&!o;){var i=n.getAttribute("data-type");if("li-marker"===i||"blockquote-marker"===i||"task-marker"===i||"padding"===i){var a=n.textContent;if("li-marker"!==i||"code-block-open-marker"!==t&&"code-block-info"!==t)if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var l=e1(e,"code-block-open-marker");l&&l.previousElementSibling&&(n=l.previousElementSibling,r=a+r)}else r=a+r;else r=a.replace(/\S/g," ")+r}else"newline"===i&&(o=!0);n=n.previousElementSibling}return r},e5=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,d.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)},e4=function(e,t){var n=(0,N.zh)(e),r=(0,y.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},e6=function(e,t,n,r){var o=(0,N.zh)(e),i=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(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">\n</span></span>',(0,N.ib)(e.sv.element,o));var a=(0,b.F9)(o.startContainer),l=(0,y.S)(o.startContainer,"SPAN");if(a){if("link"===i){var s=void 0;return s=""===o.toString()?""+n+Lute.Caret+r:""+n+o.toString()+r.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,s)}if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i||"line"===i)return s=void 0,s=""===o.toString()?""+n+Lute.Caret+("code"===i?"":r):""+n+o.toString()+Lute.Caret+("code"===i?"":r),"table"===i||"code"===i&&l&&""!==l.textContent?s="\n\n"+s:"line"===i&&(s="\n\n"+n+"\n"+Lute.Caret),void document.execCommand("insertHTML",!1,s);if(("check"===i||"list"===i||"ordered-list"===i||"quote"===i)&&l){var d="* ";"check"===i?d="* [ ] ":"ordered-list"===i?d="1. ":"quote"===i&&(d="> ");var c=e1(l,"newline");return c?c.insertAdjacentText("afterend",d):a.insertAdjacentText("afterbegin",d),void U(e)}(0,N.ib)(e.sv.element,o),e5(e)}},e8=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},e9=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])})},e7=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}},te=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},tt=function(e,t,n){var r,o,i,a;return r=void 0,o=void 0,i=void 0,a=function(){var r,o,i,a,l,s,d,c,u,p,f,m,v,h;return e7(this,function(g){switch(g.label){case 0:for(r=[],o=!0===e.options.upload.multiple?t.length:1,m=0;m<o;m++)(i=t[m])instanceof DataTransferItem&&(i=i.getAsFile()),r.push(i);return e.options.upload.handler?[4,e.options.upload.handler(r)]:[3,2];case 1:return a=g.sent(),n&&(n.value=""),"string"==typeof a&&e.tip.show(a),[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(r)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:r=g.sent(),g.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(a=e.options.upload.validate(r)))return e.tip.show(a),[2];if(l=e8(e),e.upload.range=(0,N.zh)(e),0===(s=function(e,t){e.tip.hide();for(var n=[],r="",o="",i=(e.options.lang,e.options,function(i,a){var l=t[a],s=!0;l.name||(r+="<li>"+window.VditorI18n.nameEmpty+"</li>",s=!1),l.size>e.options.upload.max&&(r+="<li>"+l.name+" "+window.VditorI18n.over+" "+e.options.upload.max/1024/1024+"M</li>",s=!1);var d=l.name.lastIndexOf("."),c=l.name.substr(d),u=e.options.upload.filename(l.name.substr(0,d))+c;e.options.upload.accept&&(e.options.upload.accept.split(",").some(function(e){var t=e.trim();if(0===t.indexOf(".")){if(c.toLowerCase()===t.toLowerCase())return!0}else if(l.type.split("/")[0]===t.split("/")[0])return!0;return!1})||(r+="<li>"+l.name+" "+window.VditorI18n.fileTypeError+"</li>",s=!1)),s&&(n.push(l),o+="<li>"+u+" "+window.VditorI18n.uploading+"</li>")}),a=t.length,l=0;l<a;l++)i(0,l);return e.tip.show("<ul>"+r+o+"</ul>"),n}(e,r)).length)return n&&(n.value=""),[2];for(d=new FormData,c=e.options.upload.extraData,u=0,p=Object.keys(c);u<p.length;u++)f=p[u],d.append(f,c[f]);for(m=0,v=s.length;m<v;m++)d.append(e.options.upload.fieldName,s[m]);return(h=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&h.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(h.withCredentials=!0),e9(e,h),e.upload.isUploading=!0,l.setAttribute("contenteditable","false"),h.onreadystatechange=function(){if(h.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,l.setAttribute("contenteditable","true"),h.status>=200&&h.status<300)if(e.options.upload.success)e.options.upload.success(l,h.responseText);else{var r,o,i,a,s=h.responseText;e.options.upload.format&&(s=e.options.upload.format(t,h.responseText)),r=s,e8(e).focus(),o=JSON.parse(r),i="",1===o.code&&(i=""+o.msg),o.data.errFiles&&o.data.errFiles.length>0&&(i="<ul><li>"+i+"</li>",o.data.errFiles.forEach(function(t){var n=t.lastIndexOf("."),r=e.options.upload.filename(t.substr(0,n))+t.substr(n);i+="<li>"+r+" "+window.VditorI18n.uploadError+"</li>"}),i+="</ul>"),i?e.tip.show(i):e.tip.hide(),a="",Object.keys(o.data.succMap).forEach(function(t){var n=o.data.succMap[t],r=t.lastIndexOf("."),i=t.substr(r),l=e.options.upload.filename(t.substr(0,r))+i;0===(i=i.toLowerCase()).indexOf(".wav")||0===i.indexOf(".mp3")||0===i.indexOf(".ogg")?"wysiwyg"===e.currentMode?a+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code>&lt;audio controls="controls" src="'+n+'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+n+'"></audio></pre></div>\n':"ir"===e.currentMode?a+='<audio controls="controls" src="'+n+'"></audio>\n':a+="["+l+"]("+n+")\n":0===i.indexOf(".apng")||0===i.indexOf(".bmp")||0===i.indexOf(".gif")||0===i.indexOf(".ico")||0===i.indexOf(".cur")||0===i.indexOf(".jpg")||0===i.indexOf(".jpeg")||0===i.indexOf(".jfif")||0===i.indexOf(".pjp")||0===i.indexOf(".pjpeg")||0===i.indexOf(".png")||0===i.indexOf(".svg")||0===i.indexOf(".webp")?"wysiwyg"===e.currentMode?a+='<img alt="'+l+'" src="'+n+'">\n':a+="!["+l+"]("+n+")\n":"wysiwyg"===e.currentMode?a+='<a href="'+n+'">'+l+"</a>\n":a+="["+l+"]("+n+")\n"}),(0,N.Hc)(e.upload.range),document.execCommand("insertHTML",!1,a),e.upload.range=getSelection().getRangeAt(0).cloneRange()}else e.options.upload.error?e.options.upload.error(h.responseText):e.tip.show(h.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},h.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},h.send(d),[2]}})},new(i||(i=Promise))(function(e,t){function n(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(n,l)}s((a=a.apply(r,o||[])).next())})},tn=function(e,t,n){var r,i=(0,b.F9)(t.startContainer);if(i||(i=e.wysiwyg.element),n&&"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.inputType||!n){var a=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(o.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1}(t.startContainer);a&&a.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null==(r=i.previousElementSibling)||r.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))});var l="";"link-ref-defs-block"===i.getAttribute("data-type")&&(i=e.wysiwyg.element);var s,d=i.isEqualNode(e.wysiwyg.element),c=(0,b.a1)(i,"data-type","footnotes-block");if(d)l=i.innerHTML;else{var u=(0,b.O9)(t.startContainer);if(u&&!c&&(i=(0,y.S)(t.startContainer,"BLOCKQUOTE")?(0,b.F9)(t.startContainer)||i:u),c&&(i=c),l=i.outerHTML,"UL"===i.tagName||"OL"===i.tagName){var p=i.previousElementSibling,f=i.nextElementSibling;p&&("UL"===p.tagName||"OL"===p.tagName)&&(l=p.outerHTML+l,p.remove()),f&&("UL"===f.tagName||"OL"===f.tagName)&&(l+=f.outerHTML,f.remove()),l=l.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}i.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(l+=e.outerHTML,e.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(l+=e.outerHTML,e.remove())}))}if('<p data-block="0">```<wbr></p>'===(l=l.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,""))&&e.hint.recentLanguage&&(l='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),w("SpinVditorDOM",l,"argument",e.options.debugger),w("SpinVditorDOM",l=e.lute.SpinVditorDOM(l),"result",e.options.debugger),d)i.innerHTML=l;else if(i.outerHTML=l,c){var m=(0,b.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(m){var v=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+m.getAttribute("data-marker")+'"]');v&&v.setAttribute("aria-label",m.textContent.trim().substr(0,24))}}var h,g=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");g.forEach(function(e,t){0===t?s=e:(s.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),g.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",g[0]);var k=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");k.forEach(function(e,t){0===t?h=e:(h.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),k.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",k[0]),(0,N.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){O(t,e)}),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}D(e),ew(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},tr=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}},to=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,b.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},ti=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,d.yl)(n)||"Escape"===n.key||n.shiftKey||n.altKey)){var r=(0,b.lG)(e.startContainer,"P")||(0,b.lG)(e.startContainer,"LI");if(r&&0===(0,N.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var i=document.createTextNode(o.g.ZWSP);e.insertNode(i),e.setStartAfter(i)}}},ta=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,b.a1)(e.startContainer,"data-type","math-inline")||(0,b.a1)(e.startContainer,"data-type","html-entity")||(0,b.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},tl=function(e,t){var n=(0,N.zh)(e),r=(0,b.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'+o.g.ZWSP+"<wbr>\n</p>"),(0,N.ib)(e[e.currentMode].element,n),eR(e),ty(e))},ts=function(e){var t=(0,b.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},td=function(e){var t=(0,b.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},tc=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,N.Hc)(t)),r},tu=function(e,t,n,r,i){var a=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(a.start).indexOf("\n")||"ArrowRight"===t.key&&a.start>=r.textContent.trimRight().length){var l=i.nextElementSibling;return!l||l&&("TABLE"===l.tagName||l.getAttribute("data-type"))?(i.insertAdjacentHTML("afterend",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(l),n.collapse(!0),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},tp=function(e,t,n,r,i){var a=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,a.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===a.start){var l=i.previousElementSibling;return!l||l&&("TABLE"===l.tagName||l.getAttribute("data-type"))?(i.insertAdjacentHTML("beforebegin",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(l),n.collapse(!1),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},tf=function(e,t,n,r){void 0===r&&(r=!0);var o=(0,b.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r&&o){for(var i="",a=0;a<o.parentElement.childElementCount;a++){var l=o.parentElement.children[a].querySelector("input");l&&l.remove(),i+='<p data-block="0">'+o.parentElement.children[a].innerHTML.trimLeft()+"</p>"}o.parentElement.insertAdjacentHTML("beforebegin",i),o.parentElement.remove()}else if(o)if("check"===n)o.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'+(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")});else{o.querySelector("input")&&o.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")});var s=void 0;"list"===n?(s=document.createElement("ul")).setAttribute("data-marker","*"):(s=document.createElement("ol")).setAttribute("data-marker","1."),s.setAttribute("data-block","0"),s.setAttribute("data-tight",o.parentElement.getAttribute("data-tight")),s.innerHTML=o.parentElement.innerHTML,o.parentElement.parentNode.replaceChild(s,o.parentElement)}else{var d=(0,b.a1)(t.startContainer,"data-block","0");d||(e[e.currentMode].element.querySelector("wbr").remove(),(d=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(d.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+d.innerHTML+"</li></ul>"),d.remove()):"list"===n?(d.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+d.innerHTML+"</li></ul>"),d.remove()):"ordered-list"===n&&(d.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+d.innerHTML+"</li></ol>"),d.remove())}},tm=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var o=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&o.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=r.parentElement,a="";o.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1"+t.slice(-1)),a+='<li data-node-id="'+e.getAttribute("data-node-id")+'" data-marker="'+t+'">'+e.innerHTML+"</li>",e.remove()}),r.insertAdjacentHTML("beforeend","<"+i.tagName+' data-block="0">'+a+"</"+i.tagName+">"),"wysiwyg"===e.currentMode?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var l=(0,b.O9)(n.startContainer);l&&l.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(t){O(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),ty(e),eR(e)}else e[e.currentMode].element.focus()},tv=function(e,t,n,r){var o=(0,b.lG)(t.parentElement,"LI");if(o){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=t.parentElement,a=i.cloneNode(),l=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&l.push(t),t=t.nextElementSibling)});var s=!1,d="";i.querySelectorAll("li").forEach(function(e){s&&(d+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(l[l.length-1])&&(s=!0)}),l.reverse().forEach(function(e){o.insertAdjacentElement("afterend",e)}),d&&(a.innerHTML=d,l[0].insertAdjacentElement("beforeend",a)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var c=(0,b.O9)(n.startContainer);c&&c.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(t){O(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),ty(e),eR(e)}else e[e.currentMode].element.focus()},th=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,o=e.rows.length,i=0,a=0;a<o;a++)for(var l=0;l<r;l++)if(e.rows[a].cells[l].isSameNode(n)){i=l;break}for(var s=0;s<o;s++)e.rows[s].cells[i].setAttribute("align",t)},tg=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&-1===t.trimLeft().indexOf(" ")&&e.trimRight().split("\n").length>1)&&0!==t.indexOf(" ")&&0!==t.indexOf(" ")},tb=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf(" ")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},ty=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?ew(e,t):"ir"===e.currentMode?tR(e,t):"sv"===e.currentMode&&e5(e,t)},tw=function(e,t,n,r){var i,a=e.startContainer,l=(0,b.lG)(a,"LI");if(l){if(!(0,d.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&l.contains(n)&&n.nextElementSibling)return l&&!l.textContent.endsWith("\n")&&l.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),ty(t),r.preventDefault(),!0;if(!((0,d.yl)(r)||r.shiftKey||r.altKey||"Backspace"!==r.key||l.previousElementSibling||""!==e.toString()||0!==(0,N.im)(l,t[t.currentMode].element,e).start))return l.nextElementSibling?(l.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+l.innerHTML+"</p>"),l.remove()):l.parentElement.outerHTML='<p data-block="0"><wbr>'+l.innerHTML+"</p>",(0,N.ib)(t[t.currentMode].element,e),ty(t),r.preventDefault(),!0;if(!(0,d.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===l.textContent.trim().replace(o.g.ZWSP,"")&&""===e.toString()&&"LI"===(null==(i=l.previousElementSibling)?void 0:i.tagName))return l.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(l.previousElementSibling),e.collapse(!1),l.remove(),(0,N.ib)(t[t.currentMode].element,e),ty(t),r.preventDefault(),!0;if(!(0,d.yl)(r)&&!r.altKey&&"Tab"===r.key){var s=!1;if((0===e.startOffset&&(3===a.nodeType&&!a.previousSibling||3!==a.nodeType&&"LI"===a.nodeName)||l.classList.contains("vditor-task")&&1===e.startOffset&&3!==a.previousSibling.nodeType&&"INPUT"===a.previousSibling.tagName)&&(s=!0),s||""!==e.toString())return r.shiftKey?tv(t,l,e,l.parentElement):tm(t,l,e),r.preventDefault(),!0}}return!1},tk=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""===t.toString()||t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)),(0,N.Hc)(t),ty(e),n.preventDefault(),!0},tE=function(e,t,n,r){if(n){if(!(0,d.yl)(e)&&!e.altKey&&"Enter"===e.key){var o,i,a=String.raw(eg||(o=["",""],i=["",""],Object.defineProperty?Object.defineProperty(o,"raw",{value:i}):o.raw=i,eg=o),n.textContent).replace(/\\\|/g,"").trim(),l=a.split("|");if(a.startsWith("|")&&a.endsWith("|")&&l.length>3){var s=l.map(function(){return"---"}).join("|");return s=n.textContent+"\n"+s.substring(3,s.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(s),(0,N.ib)(t[t.currentMode].element,r),ty(t),eY(t),e.preventDefault(),!0}if(tg(n.innerHTML)&&n.previousElementSibling){var c="",u=n.innerHTML.trimRight().split("\n");return u.length>1&&(u.pop(),c='<p data-block="0">'+u.join("\n")+"</p>"),n.insertAdjacentHTML("afterend",c+'<hr data-block="0"><p data-block="0"><wbr>\n</p>'),n.remove(),(0,N.ib)(t[t.currentMode].element,r),ty(t),eY(t),e.preventDefault(),!0}if(tb(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,N.ib)(t[t.currentMode].element,r),ty(t),eY(t),e.preventDefault(),!0}if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,d.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,N.im)(n,t[t.currentMode].element,r).start){var p=(0,b.DX)(n.previousElementSibling);return p.textContent.endsWith("\n")||(p.textContent=p.textContent+"\n"),p.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,N.ib)(t[t.currentMode].element,r),!1}return!1}},tx=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)r+='<td align="'+n.parentElement.children[o].getAttribute("align")+'"> </td>';"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>"+r+"</tr></tbody>"):n.parentElement.insertAdjacentHTML("afterend","<tr>"+r+"</tr>"),ty(e)},t_=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)"TH"===n.tagName?r+='<th align="'+n.parentElement.children[o].getAttribute("align")+'"> </th>':r+='<td align="'+n.parentElement.children[o].getAttribute("align")+'"> </td>';if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>"+r+"</tr></thead>"),t.insertNode(document.createElement("wbr"));var i=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",i),n.parentElement.parentElement.remove(),(0,N.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>"+r+"</tr>");ty(e)},tS=function(e,t,n,r){void 0===r&&(r="afterend");for(var o=0,i=n.previousElementSibling;i;)o++,i=i.previousElementSibling;for(var a=0;a<t.rows.length;a++)0===a?t.rows[a].cells[o].insertAdjacentHTML(r,"<th> </th>"):t.rows[a].cells[o].insertAdjacentHTML(r,"<td> </td>");ty(e)},tL=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,N.Hc)(t),ty(e)}},tT=function(e,t,n,r){for(var o=0,i=r.previousElementSibling;i;)o++,i=i.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var l=n.rows[a].cells;if(1===l.length){n.remove(),eR(e);break}l[o].remove()}(0,N.Hc)(t),ty(e)},tC=function(e,t,n){var r=n.startContainer,o=(0,b.lG)(r,"TD")||(0,b.lG)(r,"TH");if(o){if(!(0,d.yl)(t)&&!t.altKey&&"Enter"===t.key){o.lastElementChild&&(!o.lastElementChild||o.lastElementChild.isSameNode(o.lastChild)&&"BR"===o.lastElementChild.tagName)||o.insertAdjacentHTML("beforeend","<br>");var i,a,l=document.createElement("br");return n.insertNode(l),n.setStartAfter(l),ty(e),eY(e),t.preventDefault(),!0}if("Tab"===t.key)return t.shiftKey?tc(o,n):((i=o.nextElementSibling)||(i=o.parentElement.nextElementSibling?o.parentElement.nextElementSibling.firstElementChild:"THEAD"===o.parentElement.parentElement.tagName&&o.parentElement.parentElement.nextElementSibling?o.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),i&&(n.selectNodeContents(i),(0,N.Hc)(n))),t.preventDefault(),!0;var s=o.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===o.tagName)return s.previousElementSibling?(n.selectNodeContents(s.previousElementSibling),n.collapse(!1),(0,N.Hc)(n)):tl(e,"beforebegin"),!0;for(var c=0,u=o.parentElement;c<u.cells.length&&!u.cells[c].isSameNode(o);c++);var p=u.previousElementSibling;return p||(p=u.parentElement.previousElementSibling.firstChild),n.selectNodeContents(p.cells[c]),n.collapse(!1),(0,N.Hc)(n),!0}if("ArrowDown"===t.key){if(t.preventDefault(),!(u=o.parentElement).nextElementSibling&&"TD"===o.tagName)return s.nextElementSibling?(n.selectNodeContents(s.nextElementSibling),n.collapse(!0),(0,N.Hc)(n)):tl(e,"afterend"),!0;for(c=0;c<u.cells.length&&!u.cells[c].isSameNode(o);c++);return(i=u.nextElementSibling)||(i=u.parentElement.nextElementSibling.firstChild),n.selectNodeContents(i.cells[c]),n.collapse(!0),(0,N.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,d.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var f=e.wysiwyg.popover.querySelector(".vditor-input");return f.focus(),f.select(),t.preventDefault(),!0}if(!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!tc(o,n,!1)&&s&&(""===s.textContent.trim()?(s.outerHTML='<p data-block="0"><wbr>\n</p>',(0,N.ib)(e[e.currentMode].element,n)):(n.setStartBefore(s),n.collapse(!0)),ty(e)),t.preventDefault(),!0;if(P("⇧⌘F",t))return t_(e,n,o),t.preventDefault(),!0;if(P("⌘=",t))return tx(e,n,o),t.preventDefault(),!0;if(P("⇧⌘G",t))return tS(e,s,o,"beforebegin"),t.preventDefault(),!0;if(P("⇧⌘=",t))return tS(e,s,o),t.preventDefault(),!0;if(P("⌘-",t))return tL(e,n,o),t.preventDefault(),!0;if(P("⇧⌘-",t))return tT(e,n,s,o),t.preventDefault(),!0;if(P("⇧⌘L",t)){if("ir"===e.currentMode)return th(s,"left"),ty(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="left"]'))return a.click(),t.preventDefault(),!0}if(P("⇧⌘C",t)){if("ir"===e.currentMode)return th(s,"center"),ty(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="center"]'))return a.click(),t.preventDefault(),!0}if(P("⇧⌘R",t)){if("ir"===e.currentMode)return th(s,"right"),ty(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="right"]'))return a.click(),t.preventDefault(),!0}}return!1},tM=function(e,t,n,r){if("PRE"===n.tagName&&P("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),ty(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey){var o=(0,N.im)(n,e[e.currentMode].element,r);if((0===o.start||1===o.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'+n.firstElementChild.innerHTML+"</p>",(0,N.ib)(e[e.currentMode].element,r),ty(e),t.preventDefault(),!0}return!(0,d.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,N.Hc)(r),(0,d.vU)()||("wysiwyg"===e.currentMode?tn(e,r):R(e,r)),eY(e),t.preventDefault(),!0)},tA=function(e,t,n,r){var i=t.startContainer,a=(0,b.lG)(i,"BLOCKQUOTE");if(a&&""===t.toString()){if("Backspace"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,N.im)(a,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),a.outerHTML=a.innerHTML,(0,N.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var l=!1;if("\n"===r.innerHTML.replace(o.g.ZWSP,"")||""===r.innerHTML.replace(o.g.ZWSP,"")?(l=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,N.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),l=!0),l)return a.insertAdjacentHTML("afterend",'<p data-block="0">'+o.g.ZWSP+"<wbr>\n</p>"),(0,N.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0}var s=(0,b.F9)(i);if("wysiwyg"===e.currentMode&&s&&P("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),s.outerHTML='<blockquote data-block="0">'+s.outerHTML+"</blockquote>",(0,N.ib)(e.wysiwyg.element,t),ew(e),n.preventDefault(),!0;if(tu(e,n,t,a,a)||tp(e,n,t,a,a))return!0}return!1},tH=function(e,t,n){var r=t.startContainer,o=(0,b.fb)(r,"vditor-task");if(o){if(P("⇧⌘J",n)){var i=o.firstElementChild;return i.checked?i.removeAttribute("checked"):i.setAttribute("checked","checked"),ty(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var a=o.previousElementSibling;return(o.querySelector("input").remove(),a)?((0,b.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+o.innerHTML.trim()),o.remove()):(o.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(o.innerHTML.trim()||"\n")+"</p>"),o.nextElementSibling?o.remove():o.parentElement.remove()),(0,N.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===o.textContent.trim())if((0,b.fb)(o.parentElement,"vditor-task")){var l=(0,b.O9)(r);l&&tv(e,o,t,l)}else if(o.nextElementSibling){var s="",c="",u=!1;Array.from(o.parentElement.children).forEach(function(e){o.isSameNode(e)?u=!0:u?s+=e.outerHTML:c+=e.outerHTML});var p=o.parentElement.tagName,f="OL"===o.parentElement.tagName?"":' data-marker="'+o.parentElement.getAttribute("data-marker")+'"',m="";c&&(m="UL"===o.parentElement.tagName?"":' start="1"',c="<"+p+' data-tight="true"'+f+' data-block="0">'+c+"</"+p+">"),o.parentElement.outerHTML=c+'<p data-block="0"><wbr>\n</p><'+p+'\n data-tight="true"'+f+' data-block="0"'+m+">"+s+"</"+p+">"}else o.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===o.parentElement.querySelectorAll("li").length?o.parentElement.remove():o.remove();else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(o.lastChild),o.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'+o.getAttribute("data-marker")+'"><input type="checkbox"> <wbr></li>'),document.querySelector("wbr").after(t.extractContents()));return(0,N.ib)(e[e.currentMode].element,t),ty(e),eY(e),n.preventDefault(),!0}}return!1},tO=function(e,t,n,r){if(3!==t.startContainer.nodeType){var o=t.startContainer.children[t.startOffset];if(o&&"HR"===o.tagName)return t.selectNodeContents(o.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var i=r.previousElementSibling;if(i&&0===(0,N.im)(r,e[e.currentMode].element,t).start&&((0,d.vU)()&&"HR"===i.tagName||"TABLE"===i.tagName)){if("TABLE"===i.tagName){var a=i.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else i.remove();return(0,N.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0}}return!1},tN=function(e){(0,d.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},tD=function(e,t,n){var r,o;if(!(0,d.vU)())return!1;if("ArrowUp"===e.key&&t&&"TABLE"===(null==(r=t.previousElementSibling)?void 0:r.tagName)){var i=t.previousElementSibling;return n.selectNodeContents(i.rows[i.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!("ArrowDown"!==e.key||!t||"TABLE"!==(null==(o=t.nextElementSibling)?void 0:o.tagName))&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},tj=function(e,t,n){var r,i,a,l;return r=void 0,i=void 0,a=void 0,l=function(){var r,i,a,l,s,d,c,u,p,f,m,v,h,g,y,w;return tr(this,function(k){switch(k.label){case 0:return"true"!==e[e.currentMode].element.getAttribute("contenteditable")?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),i=t.clipboardData.getData("text/plain"),a=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),i=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(a=t.dataTransfer.items)),l={},s=function(t,n){if(!n)return["",Lute.WalkContinue];var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&o.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(o.withCredentials=!0),e9(e,o),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status){var t=o.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(o.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===r&&(e.textContent=n.data.url)});else{var i=e[e.currentMode].element.querySelector('img[src="'+r+'"]');i.src=n.data.url,"ir"===e.currentMode&&(i.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}ty(e)}else e.tip.show(o.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(o.responseText)}},o.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'+Lute.EscapeHTMLStr(r)+"</span>",Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'+Lute.EscapeHTMLStr(r)+"</span>",Lute.WalkContinue]},r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+i+'">'+i+"</a>"&&r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='\x3c!--StartFragment--\x3e<a href="'+i+'">'+i+"</a>\x3c!--EndFragment--\x3e"||(r=""),(d=(new DOMParser).parseFromString(r,"text/html")).body&&(r=d.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),c=e[e.currentMode].element.scrollHeight,u=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var o=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(o=!0);var i=r.querySelectorAll("pre");if(1===r.childElementCount&&1===i.length&&"vditor-wysiwyg"!==i[0].className&&"vditor-sv"!==i[0].className&&(o=!0),0===e.indexOf('\n<p class="p1">')&&(o=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(o=!0),o){var a=t||e;return/\n/.test(a)||1===i.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"<wbr></code></pre></div>":"\n```\n"+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":"wysiwyg"===n?"<code>"+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</code><wbr>":"`"+a+"`"}return!1}(r,i,e.currentMode),(p="sv"===e.currentMode?(0,b.a1)(t.target,"data-type","code-block"):(0,b.lG)(t.target,"CODE"))?("sv"===e.currentMode?document.execCommand("insertHTML",!1,i.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(f=(0,N.im)(t.target,e[e.currentMode].element),"PRE"!==p.parentElement.tagName&&(i+=o.g.ZWSP),p.textContent=p.textContent.substring(0,f.start)+i+p.textContent.substring(f.end),(0,N.$j)(f.start+i.length,f.start+i.length,p.parentElement),(null==(w=p.parentElement)?void 0:w.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview"))&&(p.parentElement.nextElementSibling.innerHTML=p.outerHTML,O(p.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return u?(n.pasteCode(u),[3,8]):[3,2];case 2:return""===r.trim()?[3,3]:((m=document.createElement("div")).innerHTML=r,m.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),m.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===e.currentMode?(l.HTML2VditorIRDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.HTML2VditorIRDOM(m.innerHTML),e)):"wysiwyg"===e.currentMode?(l.HTML2VditorDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.HTML2VditorDOM(m.innerHTML),e)):(l.Md2VditorSVDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),e0(e,e.lute.HTML2Md(m.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return a.length>0?e.options.upload.url||e.options.upload.handler?[4,tt(e,a)]:[3,5]:[3,7];case 4:return k.sent(),[3,6];case 5:v=new FileReader,"clipboardData"in t?h=(a=t.clipboardData.files)[0]:t.dataTransfer.types.includes("Files")&&(h=(a=t.dataTransfer.items)[0].getAsFile()),h&&h.type.startsWith("image")&&(v.readAsDataURL(h),v.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'+h.name+'" src="'+v.result.toString()+'">\n':t+="!["+h.name+"]("+v.result.toString()+")\n",document.execCommand("insertHTML",!1,t)}),k.label=6;case 6:return[3,8];case 7:""!==i.trim()&&0===a.length&&(""!==(y=(0,N.zh)(e)).toString()&&e.lute.IsValidLinkDest(i)&&(i="["+y.toString()+"]("+i+")"),"ir"===e.currentMode?(l.Md2VditorIRDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.Md2VditorIRDOM(i),e)):"wysiwyg"===e.currentMode?(l.Md2VditorDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,N.oC)(e.lute.Md2VditorDOM(i),e)):(l.Md2VditorSVDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),e0(e,i)),e.outline.render(e)),k.label=8;case 8:return"sv"!==e.currentMode&&((g=(0,b.F9)((0,N.zh)(e).startContainer))&&(y=(0,N.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),y.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?g.outerHTML=e.lute.SpinVditorDOM(g.outerHTML):g.outerHTML=e.lute.SpinVditorIRDOM(g.outerHTML),(0,N.ib)(e[e.currentMode].element,y)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(t){O(t,e)})),e.wysiwyg.triggerRemoveComment(e),ty(e),e[e.currentMode].element.scrollHeight-c>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&eY(e),[2]}})},new(a||(a=Promise))(function(e,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,o)}s((l=l.apply(r,i||[])).next())})},tI=function(e){e.hint.render(e);var t=(0,N.zh)(e).startContainer,n=(0,b.a1)(t,"data-type","code-block-info");if(n)if(""===n.textContent.replace(o.g.ZWSP,"")&&e.hint.recentLanguage)n.textContent=o.g.ZWSP+e.hint.recentLanguage,(0,N.zh)(e).selectNodeContents(n);else{var r=[],i=n.textContent.substring(0,(0,N.im)(n,e.ir.element).start).replace(o.g.ZWSP,"");(e.options.preview.hljs.langs||o.g.CODE_LANGUAGES).forEach(function(e){e.indexOf(i.toLowerCase())>-1&&r.push({html:e,value:e})}),e.hint.genHTML(r,i,e)}},tR=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&tI(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,d.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)},tP=function(e,t){var n=(0,N.zh)(e),r=(0,b.F9)(n.startContainer)||n.startContainer;if(r){var o=r.querySelector(".vditor-ir__marker--heading");o?o.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),R(e,n.cloneRange()),ey(e)}},tq=function(e,t,n){var r=(0,b.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var o=document.createElement("div");o.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=o.firstElementChild.innerHTML.trim()}},tB=function(e,t,n,r){var o=(0,N.zh)(e),i=t.getAttribute("data-type"),a=o.startContainer;3===a.nodeType&&(a=a.parentElement);var l=!0;if(t.classList.contains("vditor-menu--current"))if("quote"===i){var s=(0,b.lG)(a,"BLOCKQUOTE");s&&(o.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'+s.innerHTML+"</p>":s.innerHTML)}else if("link"===i){var d=(0,b.a1)(o.startContainer,"data-type","a");if(d){var u=(0,b.fb)(o.startContainer,"vditor-ir__link");u?(o.insertNode(document.createElement("wbr")),d.outerHTML=u.innerHTML):d.outerHTML=d.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===i?tq(o,e,"em"):"bold"===i?tq(o,e,"strong"):"strike"===i?tq(o,e,"s"):"inline-code"===i?tq(o,e,"code"):"check"!==i&&"list"!==i&&"ordered-list"!==i||(tf(e,o,i),l=!1,t.classList.remove("vditor-menu--current"));else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.ir.element,o));var p=(0,b.F9)(o.startContainer);if("line"===i){if(p){var f='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===p.innerHTML.trim()?p.outerHTML=f:p.insertAdjacentHTML("afterend",f)}}else if("quote"===i)p&&(o.insertNode(document.createElement("wbr")),p.outerHTML='<blockquote data-block="0">'+p.outerHTML+"</blockquote>",l=!1,t.classList.add("vditor-menu--current"));else if("link"===i){var m=void 0;m=""===o.toString()?n+"<wbr>"+r:""+n+o.toString()+r.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,m),l=!1,t.classList.add("vditor-menu--current")}else if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i){m=void 0,""===o.toString()?m=n+"<wbr>"+r:(m="code"===i?n+"\n"+o.toString()+"<wbr>"+r:"table"===i?""+n+o.toString()+"<wbr>"+r:""+n+o.toString()+r+"<wbr>",o.deleteContents()),"table"!==i&&"code"!==i||(m="\n"+m+"\n\n");var v=document.createElement("span");v.innerHTML=m,o.insertNode(v),R(e,o),"table"===i&&(o.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,N.Hc)(o))}else"check"!==i&&"list"!==i&&"ordered-list"!==i||(tf(e,o,i,!1),l=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,N.ib)(e.ir.element,o),tR(e),l&&ey(e)},tz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var s=[i,l];if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}},tU=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r,i=decodeURIComponent(e.getAttribute("data-value")),a=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var l=(0,b.a1)(a.startContainer,"data-type","code-block-info");if(l)return l.textContent=o.g.ZWSP+i.trimRight(),a.selectNodeContents(l),a.collapse(!1),tR(n),l.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+i.trimRight()}),O(l.parentElement.querySelector(".vditor-ir__preview"),n),void(t.recentLanguage=i.trimRight())}if("wysiwyg"===n.currentMode&&3!==a.startContainer.nodeType){var s=a.startContainer,d=void 0;if((d=s.classList.contains("vditor-input")?s:s.firstElementChild)&&d.classList.contains("vditor-input"))return d.value=i.trimRight(),a.selectNodeContents(d),a.collapse(!1),d.dispatchEvent(new CustomEvent("input",{detail:1})),void(t.recentLanguage=i.trimRight())}(a.setStart(a.startContainer,t.lastIndex),a.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,N.oC)(n.lute.SpinVditorSVDOM(i),n):"wysiwyg"===n.currentMode?(0,N.oC)(n.lute.SpinVditorDOM(i),n):(0,N.oC)(n.lute.SpinVditorIRDOM(i),n):(0,N.oC)(i,n),":"===t.splitChar&&i.indexOf(":")>-1&&"sv"!==n.currentMode&&a.insertNode(document.createTextNode(" ")),a.collapse(!1),(0,N.Hc)(a),"wysiwyg"===n.currentMode)?(r=(0,b.fb)(a.startContainer,"vditor-wysiwyg__block"))&&r.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(r.lastElementChild.innerHTML=r.firstElementChild.innerHTML,O(r.lastElementChild,n)):"ir"===n.currentMode&&(r=(0,b.fb)(a.startContainer,"vditor-ir__marker--pre"))&&r.nextElementSibling.classList.contains("vditor-ir__preview")&&(r.nextElementSibling.innerHTML=r.innerHTML,O(r.nextElementSibling,n)),ty(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t=this;if(window.getSelection().focusNode){var n,r=getSelection().getRangeAt(0);n=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(n,e.options.hint.extend);if(void 0===o)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var i=""===o?e.options.hint.emoji:e.lute.GetEmojis(),a=[];Object.keys(i).forEach(function(e){0===e.indexOf(o.toLowerCase())&&(i[e].indexOf(".")>-1?a.push({html:'<img src="'+i[e]+'" title=":'+e+':"/> :'+e+":",value:":"+e+":"}):a.push({html:'<span class="vditor-hint__emoji">'+i[e]+"</span>"+e,value:i[e]}))}),this.genHTML(a,o,e)}else e.options.hint.extend.forEach(function(n){n.key===t.splitChar&&(clearTimeout(t.timeId),t.timeId=window.setTimeout(function(){var r,i,a;return r=void 0,i=void 0,a=function(){var t;return tz(this,function(r){switch(r.label){case 0:return t=this.genHTML,[4,n.hint(o)];case 1:return t.apply(this,[r.sent(),o,e]),[2]}})},new(i||(i=Promise))(function(e,n){function o(e){try{s(a.next(e))}catch(e){n(e)}}function l(e){try{s(a.throw(e))}catch(e){n(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof i?n:new i(function(e){e(n)})).then(o,l)}s((a=a.apply(t,r||[])).next())})},e.options.hint.delay))})}},e.prototype.genHTML=function(e,t,n){var r=this;if(0!==e.length){var o=n[n.currentMode].element,i=(0,N.Ny)(o),a=i.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),l=i.top,s="";e.forEach(function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var o=r.lastIndexOf(">")+1,i=r.substr(o),a=i.toLowerCase().indexOf(t.toLowerCase());a>-1&&(i=i.substring(0,a)+"<b>"+i.substring(a,a+t.length)+"</b>"+i.substring(a+t.length),r=r.substr(0,o)+i)}s+='<button type="button" data-value="'+encodeURIComponent(e.value)+' "\n'+(0===n?"class='vditor-hint--current'":"")+"> "+r+"</button>"}}),this.element.innerHTML=s;var d=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=l+(d||22)+"px",this.element.style.left=a+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(e){e.addEventListener("click",function(t){r.fillEmoji(e,n),t.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=l-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(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.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,d.yl)(e)||e.shiftKey||e.altKey||"Enter"!==e.key||e.isComposing)&&(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),!0)},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach(function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)}),-1===this.lastIndex)return n;var o=e.split(this.splitChar),a=o[o.length-1];if(o.length>1&&a.trim()===a)if(2===o.length&&""===o[0]&&o[1].length<32)n=o[1];else{var l=o[o.length-2].slice(-1);" "===(0,i.X)(l)&&a.length<32&&(n=a)}return n},e}(),tV=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'+e.options.placeholder+'"\n contenteditable="true" spellcheck="false"></pre>',this.element=t.firstElementChild,this.bindEvent(e),eF(e,this.element),eG(e,this.element),eK(e,this.element),eQ(e,this.element),e$(e,this.element),eZ(e,this.element),eJ(e,this.element,this.copy),eX(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tj(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){h(e,["hint"])}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,d.vU)()||R(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType)return t.preventInput?(t.preventInput=!1,void tR(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||R(e,getSelection().getRangeAt(0).cloneRange(),!1,n))}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName)return n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,void tR(e);var r=(0,N.zh)(e),i=(0,b.fb)(n.target,"vditor-ir__preview");if(i||(i=(0,b.fb)(r.startContainer,"vditor-ir__preview")),i&&(i.previousElementSibling.firstElementChild?r.selectNodeContents(i.previousElementSibling.firstElementChild):r.selectNodeContents(i.previousElementSibling),r.collapse(!0),(0,N.Hc)(r),eY(e)),"IMG"===n.target.tagName){var a=n.target.parentElement.querySelector(".vditor-ir__marker--link");a&&(r.selectNode(a),(0,N.Hc)(r))}var l=(0,b.a1)(n.target,"data-type","a");if(!l||l.classList.contains("vditor-ir__node--expand")){if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var s=t.element.lastElementChild.getBoundingClientRect();n.y>s.top+s.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(o.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,N.ib)(t.element,r)))}""===r.toString()?q(r,e):setTimeout(function(){q((0,N.zh)(e),e)}),j(n,e),ey(e)}else e.options.link.click?e.options.link.click(l.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(l.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(n){if(!n.isComposing&&!(0,d.yl)(n))if("Enter"===n.key&&eY(e),ey(e),("Backspace"===n.key||"Delete"===n.key)&&""!==e.ir.element.innerHTML&&1===e.ir.element.childNodes.length&&e.ir.element.firstElementChild&&"P"===e.ir.element.firstElementChild.tagName&&0===e.ir.element.firstElementChild.childElementCount&&(""===e.ir.element.textContent||"\n"===e.ir.element.textContent))e.ir.element.innerHTML="";else{var r=(0,N.zh)(e);"Backspace"===n.key?((0,d.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",q(r,e)),t.element.querySelectorAll(".language-math").forEach(function(e){var t=e.querySelector("br");t&&t.remove()})):n.key.indexOf("Arrow")>-1?("ArrowLeft"!==n.key&&"ArrowRight"!==n.key||tI(e),q(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&q(r,e);var i=(0,b.fb)(r.startContainer,"vditor-ir__preview");if(i){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return i.previousElementSibling.firstElementChild?r.selectNodeContents(i.previousElementSibling.firstElementChild):r.selectNodeContents(i.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===i.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===i.parentElement.getAttribute("data-type")?(i.parentElement.insertAdjacentText("afterend",o.g.ZWSP),r.setStart(i.parentElement.nextSibling,1)):r.selectNodeContents(i.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}})},e}(),tW=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(a(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},tF=n(895),tG=n(818),tK=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+e+'</div>\n<div class="vditor-outline__content"></div>'}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,tG.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,tG.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);var r,i=null==(r=e.toolbar.elements.outline)?void 0:r.firstElementChild;if(t&&window.innerWidth>=o.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==i||i.classList.add("vditor-menu--current")):(this.element.style.display="none",null==i||i.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var a=getSelection().getRangeAt(0);e[e.currentMode].element.contains(a.startContainer)&&(0,N.Hc)(a)}F(e)},e}(),tZ=n(554),tJ=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}}),this.previewElement.addEventListener("click",function(n){var r=(0,b.lG)(n.target,"SPAN");if(r&&(0,b.fb)(r,"vditor-toc")){var o=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));o&&(t.element.scrollTop=o.offsetTop)}else{if("A"===n.target.tagName)return e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),void n.preventDefault();"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,B.E)(n.target,e.options.lang,e.options.theme))}}),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],i=0;i<n.length;i++){var a=n[i];if("object"!=typeof a)switch(a){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.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":o.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 o.push('<button type="button" data-type="'+a.key+'" class="'+a.className+'"'+(a.tooltip?' aria-label="'+a.tooltip+'"':"")+'">'+a.text+"</button>")}r.innerHTML=o.join(""),r.addEventListener((0,d.Le)(),function(o){var i=(0,y.S)(o.target,"BUTTON");if(i){var a=i.getAttribute("data-type"),l=n.find(function(e){return(null==e?void 0:e.key)===a});l?l.click(a):"mp-wechat"!==a&&"zhihu"!==a?(t.previewElement.style.width="desktop"===a?"auto":"tablet"===a?"780px":"360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),i.classList.add("vditor-preview__action--current")):t.copyToX(e,t.previewElement.cloneNode(!0),a)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"!==this.element.style.display)if(t)this.previewElement.innerHTML=t;else if(""!==a(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){var r=(new Date).getTime(),o=a(e);this.mdTimeoutId=window.setTimeout(function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE)if(200===t.status){var i=JSON.parse(t.responseText);if(0!==i.code)return void e.tip.show(i.msg);e.options.preview.transform&&(i.data=e.options.preview.transform(i.data)),n.previewElement.innerHTML=i.data,n.afterRender(e,r)}else{var a=e.lute.Md2HTML(o);e.options.preview.transform&&(a=e.options.preview.transform(a)),n.previewElement.innerHTML=a,n.afterRender(e,r)}},t.send(JSON.stringify({markdownText:o}))}else{var i=e.lute.Md2HTML(o);e.options.preview.transform&&(i=e.options.preview.transform(i)),n.previewElement.innerHTML=i,n.afterRender(e,r)}},e.options.preview.delay)}else this.previewElement.innerHTML="";else"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide()},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=(new Date).getTime()-t;(new Date).getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,x.O)(e.preview.previewElement,e.options.preview.hljs),(0,L.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,C.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,M.K)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,_.P)(e.preview.previewElement,e.options.cdn),(0,S.v)(e.preview.previewElement,e.options.cdn),(0,E.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,A.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,H.B)(e.preview.previewElement,e.options.cdn),(0,k.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,tZ.Y)(e.preview.previewElement),e.options.customRenders.forEach(function(t){t.render(e.preview.previewElement,e)});var o=e.preview.element,i=e.outline.render(e);""===i&&(i="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=i,(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),(0,T.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'+e.getAttribute("data-math")+'\\" style="display: block; margin: 0 auto; max-width: 100%;">'}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,N.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到"+("zhihu"===n?"知乎":"微信公众号平台")+"进行粘贴":"已复制到剪切板")},e}(),tX=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--"+e.options.resize.position,this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",function(n){var r=document,o=n.clientY,i=e.element.offsetHeight,a=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(a,i+(o-t.clientY))+"px":e.element.style.height=Math.max(a,i+(t.clientY-o))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-i),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}})},e}(),tY=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),eF(e,this.element),eK(e,this.element),eQ(e,this.element),e$(e,this.element),eZ(e,this.element),eJ(e,this.element,this.copy),eX(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",eW(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tj(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,o=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),i=e.preview.element;i.scrollTop=n/r>.5?(n+r)*i.scrollHeight/o-r:n*i.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,d.vU)()||U(e,n),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data)return t.preventInput?(t.preventInput=!1,void e5(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void U(e,n)}),this.element.addEventListener("keyup",function(t){t.isComposing||(0,d.yl)(t)||(("Backspace"===t.key||"Delete"===t.key)&&""!==e.sv.element.innerHTML&&1===e.sv.element.childNodes.length&&e.sv.element.firstElementChild&&"DIV"===e.sv.element.firstElementChild.tagName&&2===e.sv.element.firstElementChild.childElementCount&&(""===e.sv.element.firstElementChild.textContent||"\n"===e.sv.element.textContent)?e.sv.element.innerHTML="":"Enter"===t.key&&eY(e))})},e}(),tQ=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'+e+'\n<div class="vditor-tip__close">X</div></div>',this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'+e+"</div>",setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),t$=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),u(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)}},t0=(Z=function(e,t){return(Z=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),t1=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,d.Le)(),function(e){r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?t$("editor",t):t$("both",t)))}),r}return t0(t,e),t}(eB),t2=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},t3=n(312),t5=(J=function(e,t){return(J=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),t4=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],a=document.createElement("div");a.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow");var l="";return o.g.CODE_THEME.forEach(function(e){l+="<button>"+e+"</button>"}),a.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+l+"</div>",a.addEventListener((0,d.Le)(),function(e){"BUTTON"===e.target.tagName&&(h(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,t3.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(a),g(t,a,i,n.level),r}return t5(t,e),t}(eB),t6=(X=function(e,t){return(X=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),t8=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow");var a="";return Object.keys(t.options.preview.theme.list).forEach(function(e){a+='<button data-type="'+e+'">'+t.options.preview.theme.list[e]+"</button>"}),i.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+a+"</div>",i.addEventListener((0,d.Le)(),function(e){"BUTTON"===e.target.tagName&&(h(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,V.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(i),g(t,i,o,n.level),r}return t6(t,e),t}(eB),t9=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML=n+"/"+e.options.counter.max):this.element.innerHTML=""+n,this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),t7=(Y=function(e,t){return(Y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ne=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(o.g.CLASS_MENU_DISABLED)||n.click(e,t)}),r}return t7(t,e),t}(eB),nt=(Q=function(e,t){return(Q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,d.Le)(),function(e){var n=r.element.firstElementChild;n.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",F(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",F(t),t.devtools.renderEchart(t)))}),r}return nt(t,e),t}(eB),nr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},no=($=function(e,t){return($=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ni=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var i="";return Object.keys(t.options.hint.emoji).forEach(function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?i+='<button data-value=":'+e+': " data-key=":'+e+':"><img\ndata-value=":'+e+': " data-key=":'+e+':" class="vditor-emojis__icon" src="'+n+'"/></button>':i+='<button data-value="'+n+' "\n data-key="'+e+'"><span class="vditor-emojis__icon">'+n+"</span></button>"}),o.innerHTML='<div class="vditor-emojis" style="max-height: '+("auto"===t.options.height?"auto":t.options.height-80)+'px">'+i+'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>'+(t.options.hint.emojiTail||"")+"</span>\n</div>",r.element.appendChild(o),g(t,o,r.element.firstElementChild,n.level),r.bindEvent(t),r}return no(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,d.Le)(),function(n){var r=(0,y.S)(n.target,"BUTTON");if(r){n.preventDefault();var o=r.getAttribute("data-value"),i=(0,N.zh)(e),a=o;if("wysiwyg"===e.currentMode?a=e.lute.SpinVditorDOM(o):"ir"===e.currentMode&&(a=e.lute.SpinVditorIRDOM(o)),o.indexOf(":")>-1&&"sv"!==e.currentMode){var l=document.createElement("div");l.innerHTML=a,a=l.firstElementChild.firstElementChild.outerHTML+" ",(0,N.oC)(a,e)}else i.extractContents(),i.insertNode(document.createTextNode(o));i.collapse(!1),(0,N.Hc)(i),t.element.lastElementChild.style.display="none",ty(e)}}),this.element.lastElementChild.addEventListener("mouseover",function(e){var n=(0,y.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))})},t}(eB),na=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},nl=(ee=function(e,t){return(ee=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ns=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");return i.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',i.addEventListener((0,d.Le)(),function(e){var n,r,o,i,l=e.target;if("BUTTON"===l.tagName){switch(l.getAttribute("data-type")){case"markdown":n=a(t),na(t,n,n.substr(0,10)+".md");break;case"pdf":t.tip.show(window.VditorI18n.generate,3800),(r=document.querySelector("#vditorExportIframe")).contentDocument.open(),r.contentDocument.write('<link rel="stylesheet" href="'+t.options.cdn+'/dist/index.css"/>\n<script src="'+t.options.cdn+'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "'+t.options.cdn+'",\n markdown: {\n theme: '+JSON.stringify(t.options.preview.theme)+'\n },\n hljs: {\n style: "'+t.options.preview.hljs.style+'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>'),r.contentDocument.close(),setTimeout(function(){r.contentWindow.postMessage(a(t),"*")},200);break;case"html":o=tW(t),i='<html><head><link rel="stylesheet" type="text/css" href="'+t.options.cdn+'/dist/index.css"/>\n<script src="'+t.options.cdn+"/dist/js/i18n/"+t.options.lang+'.js"><\/script>\n<script src="'+t.options.cdn+'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">'+o+"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('"+t.options.preview.theme.current+"', '"+t.options.preview.theme.path+"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender("+JSON.stringify(t.options.preview.hljs)+", previewElement, '"+t.options.cdn+"');\n Vditor.mathRender(previewElement, {\n cdn: '"+t.options.cdn+"',\n math: "+JSON.stringify(t.options.preview.math)+",\n });\n Vditor.mermaidRender(previewElement, '"+t.options.cdn+"', '"+t.options.theme+"');\n Vditor.markmapRender(previewElement, '"+t.options.cdn+"', '"+t.options.theme+"');\n Vditor.flowchartRender(previewElement, '"+t.options.cdn+"');\n Vditor.graphvizRender(previewElement, '"+t.options.cdn+"');\n Vditor.chartRender(previewElement, '"+t.options.cdn+"', '"+t.options.theme+"');\n Vditor.mindmapRender(previewElement, '"+t.options.cdn+"', '"+t.options.theme+"');\n Vditor.abcRender(previewElement, '"+t.options.cdn+"');\n "+(t.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"")+'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="'+t.options.cdn+"/dist/js/icons/"+t.options.icon+'.js"><\/script></body></html>',na(t,i,o.substr(0,10)+".html")}h(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),r.element.appendChild(i),g(t,i,o,n.level),r}return nl(t,e),t}(eB),nd=(et=function(e,t){return(et=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}et(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return nd(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,d.Le)(),function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition)}))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),F(e),G(e)})},t}(eB),nu=(en=function(e,t){return(en=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}en(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),np=function(e){function t(t,n){var r=e.call(this,t,n)||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,d.ns)("&lt;⌥⌘1>")+'</button>\n<button data-tag="h2" data-value="## ">'+window.VditorI18n.heading2+" &lt;"+(0,d.ns)("⌥⌘2")+'></button>\n<button data-tag="h3" data-value="### ">'+window.VditorI18n.heading3+" &lt;"+(0,d.ns)("⌥⌘3")+'></button>\n<button data-tag="h4" data-value="#### ">'+window.VditorI18n.heading4+" &lt;"+(0,d.ns)("⌥⌘4")+'></button>\n<button data-tag="h5" data-value="##### ">'+window.VditorI18n.heading5+" &lt;"+(0,d.ns)("⌥⌘5")+'></button>\n<button data-tag="h6" data-value="###### ">'+window.VditorI18n.heading6+" &lt;"+(0,d.ns)("⌥⌘6")+"></button>",r.element.appendChild(o),r._bindEvent(t,o),r}return nu(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,d.Le)(),function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(o.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(eS(e),ew(e)):"ir"===e.currentMode&&tP(e,""),n.classList.remove("vditor-menu--current")):(h(e,["subToolbar"]),t.style.display="block"))});for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,d.Le)(),function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(e_(e,r.target.getAttribute("data-tag")),ew(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(tP(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):e4(e,r.target.getAttribute("data-value")),t.style.display="none"})},t}(eB),nf=(er=function(e,t){return(er=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}er(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nm=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),r}return nf(t,e),t}(eB),nv=(eo=function(e,t){return(eo=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}eo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nh=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),i=(0,b.lG)(n.startContainer,"LI");i&&tm(t,i,n)}}),r}return nv(t,e),t}(eB),ng=(ei=function(e,t){return(ei=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ei(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nb=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div>&nbsp;&nbsp;</div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'+o.H+" / Lute v"+Lute.Version+'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>',0)}),r}return ng(t,e),t}(eB),ny=(ea=function(e,t){return(ea=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ea(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nw=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||tl(t,"afterend")}),r}return ny(t,e),t}(eB),nk=(el=function(e,t){return(el=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}el(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nE=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||tl(t,"beforebegin")}),r}return nk(t,e),t}(eB),nx=(es=function(e,t){return(es=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}es(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),n_=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),i=(0,b.lG)(n.startContainer,"LI");i&&tv(t,i,n,i.parentElement)}}),r}return nx(t,e),t}(eB),nS=(ed=function(e,t){return(ed=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ed(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nL=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),r}return nS(t,e),t}(eB),nT=(ec=function(e,t){return(ec=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ec(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nC=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nT(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,d.Le)(),function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(o.g.CLASS_MENU_DISABLED)){var i=o.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),p(e.toolbar.elements,i),e.outline.render(e)):(f(e.toolbar.elements,i),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),h(e,["subToolbar","hint","popover"]),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10)),F(e)}})},t}(eB),nM=function(){function e(e){if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var t,n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),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 e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var o=44+2*n.length,i=new DataView(new ArrayBuffer(o));this.writeUTFBytes(i,0,"RIFF"),i.setUint32(4,o,!0),this.writeUTFBytes(i,8,"WAVE"),this.writeUTFBytes(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,this.SAMPLE_RATE,!0),i.setUint32(28,2*this.SAMPLE_RATE,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0);var a=2*n.length;this.writeUTFBytes(i,36,"data"),i.setUint32(40,a,!0);for(var l=n.length,s=44,d=0;d<l;d++)i.setInt16(s,32767*n[d],!0),s+=2;return new Blob([i],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE||t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=Math.round(e.length/n),o=new Float32Array(r),i=0,a=0;i<o.length;){for(var l=Math.round((i+1)*n),s=0,d=0,c=a;c<l&&c<e.length;c++)s+=e[c],d++;o[i]=s/d,i++,a=l}return o},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,o=0;o<r;++o){var i=e[o];t.set(i,n),n+=i.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,o=0;o<r;o++)e.setUint8(t+o,n.charCodeAt(o))},e}(),nA=(eu=function(e,t){return(eu=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}eu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nH=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nA(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,d.Le)(),function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)){var i=e[e.currentMode].element;t?t.isRecording?(t.stopRecording(),e.tip.hide(),tt(e,[new File([t.buildWavFileBlob()],"record"+(new Date).getTime()+".wav",{type:"video/webm"})]),n.element.children[0].classList.remove("vditor-menu--current")):(e.tip.show(window.VditorI18n.recording),i.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current")):navigator.mediaDevices.getUserMedia({audio:!0}).then(function(r){(t=new nM(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),i.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")}).catch(function(){e.tip.show(window.VditorI18n["record-tip"])})}})},t}(eB),nO=(ep=function(e,t){return(ep=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ep(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nN=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),r}return nO(t,e),t}(eB),nD=(ef=function(e,t){return(ef=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ef(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nj=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),r}return nD(t,e),t}(eB),nI=(em=function(e,t){return(em=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}em(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nR=function(e){function t(t,n){var r=e.call(this,t,n)||this,o='<input type="file"';return t.options.upload.multiple&&(o+=' multiple="multiple"'),t.options.upload.accept&&(o+=' accept="'+t.options.upload.accept+'"'),r.element.children[0].innerHTML=""+(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>')+o+">",r._bindEvent(t),r}return nI(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,d.Le)(),function(e){if(t.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED))return e.stopPropagation(),void e.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(n){if(t.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED))return n.stopPropagation(),void n.preventDefault();0!==n.target.files.length&&tt(e,n.target.files,n.target)})},t}(eB),nP=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach(function(n,r){var o=t.genItem(e,n,r);if(t.element.appendChild(o),n.toolbar){var i=document.createElement("div");i.className="vditor-hint vditor-panel--arrow",i.addEventListener((0,d.Le)(),function(e){i.style.display="none"}),n.toolbar.forEach(function(n,o){n.level=2,i.appendChild(t.genItem(e,n,r+o))}),o.appendChild(i),g(e,i,o.children[0])}}),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new t9(e),this.element.appendChild(e.counter.element))}return e.prototype.genItem=function(e,t,n){var r;switch(t.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 eB(e,t);break;case"emoji":r=new ni(e,t);break;case"headings":r=new np(e,t);break;case"|":r=new nr;break;case"br":r=new t2;break;case"undo":r=new nj(e,t);break;case"redo":r=new nN(e,t);break;case"help":r=new nm(e,t);break;case"both":r=new t1(e,t);break;case"preview":r=new nC(e,t);break;case"fullscreen":r=new nc(e,t);break;case"upload":r=new nR(e,t);break;case"record":r=new nH(e,t);break;case"info":r=new nb(e,t);break;case"edit-mode":r=new eV(e,t);break;case"devtools":r=new nn(e,t);break;case"outdent":r=new n_(e,t);break;case"indent":r=new nh(e,t);break;case"outline":r=new nL(e,t);break;case"insert-after":r=new nw(e,t);break;case"insert-before":r=new nE(e,t);break;case"code-theme":r=new t4(e,t);break;case"content-theme":r=new t8(e,t);break;case"export":r=new ns(e,t);break;default:r=new ne(e,t)}if(r){var o=t.name;return"br"!==o&&"|"!==o||(o+=n),this.elements[o]=r.element,r.element}},e}(),nq=n(471),nB=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new nq}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?p(e.toolbar.elements,["undo"]):f(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?p(e.toolbar.elements,["redo"]):f(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,h(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(0!==getSelection().rangeCount&&!(1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,d.vU)()&&"Backspace"===t.key||(0,d.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);0===r.length&&this[e.currentMode].undoStack.length>0||(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,f(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&p(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){var r;if(void 0===n&&(n=!1),n){var o=this.dmp.patch_deepCopy(e).reverse();o.forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),r=this.dmp.patch_apply(o,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&t[t.currentMode].element.querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='2']").forEach(function(e){O(e,t)}),t[t.currentMode].element.querySelector("wbr"))(0,N.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),eY(t);else{var i=getSelection().getRangeAt(0);i.setEndBefore(t[t.currentMode].element),i.collapse(!1)}D(t),ty(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),eR(t),t[t.currentMode].element.querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='2']").forEach(function(e){O(e,t)}),this[t.currentMode].undoStack.length>1?p(t.toolbar.elements,["undo"]):f(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?p(t.toolbar.elements,["redo"]):f(t.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(e,t){if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var n,r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}e.ir.element.cloneNode(!0).querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='1']").forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var i=e[e.currentMode].element.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,N.Hc)(n),i.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),nz=n(640),nU=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:o.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"\uD83D\uDC4D","-1":"\uD83D\uDC4E",confused:"\uD83D\uDE15",eyes:"\uD83D\uDC40️",heart:"❤️",rocket:"\uD83D\uDE80️",smile:"\uD83D\uDE04",tada:"\uD83C\uDF89️"},emojiPath:o.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:o.g.HLJS_OPTIONS,markdown:o.g.MARKDOWN_OPTIONS,math:o.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:o.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:0xa00000,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null==(t=null==(e=this.options.preview)?void 0:e.theme)?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null==(o=null==(r=null==(n=this.options.preview)?void 0:n.render)?void 0:r.media)?void 0:o.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null==(i=this.options.hint)?void 0:i.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null==(l=null==(a=this.options.preview)?void 0:a.theme)?void 0:l.path)||(this.defaultOptions.preview.theme.path=this.options.cdn+"/dist/css/content-theme"),(null==(s=this.options.hint)?void 0:s.emojiPath)||(this.defaultOptions.hint.emojiPath=this.options.cdn+"/dist/images/emoji")));var e,t,n,r,o,i,a,l,s,d=(0,nz.T)(this.defaultOptions,this.options);if(d.cache.enable&&!d.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return d},e.prototype.mergeToolbar=function(e){var t=this,n=[{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 |\n| --- | --- | --- |\n| | | |\n| | | |",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 e.forEach(function(e){var o=e;n.forEach(function(t){"string"==typeof e&&t.name===e&&(o=t),"object"==typeof e&&t.name===e.name&&(o=Object.assign({},t,e))}),e.toolbar&&(o.toolbar=t.mergeToolbar(e.toolbar)),r.push(o)}),r},e}(),nV=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'+e.options.placeholder+'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="'+window.VditorI18n.comment+'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>',this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),eF(e,this.element),eG(e,this.element),eK(e,this.element),eQ(e,this.element),e$(e,this.element),eZ(e,this.element),eJ(e,this.element,this.copy),eX(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,i=Lute.NewNodeID(),a=getSelection().getRangeAt(0),l=a.cloneRange(),s=a.extractContents(),d=!1,c=!1;s.childNodes.forEach(function(e,t){var o=!1;if(3===e.nodeType?o=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+i):o=!0,o)if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&l.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'+i+'">'+e.innerHTML+"</span>",n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===s.childNodes.length-1&&l.endOffset<l.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'+i+'">'+e.innerHTML+"</span>",r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?d=!0:t===s.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'+i+'">'+e.innerHTML+"</span>";else{var a=document.createElement("span");a.classList.add("vditor-comment"),a.setAttribute("data-cmtids",i),e.parentNode.insertBefore(a,e),a.appendChild(e)}});var u=(0,b.F9)(l.startContainer);u&&(n?(u.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===u.textContent.trim().replace(o.g.ZWSP,"")&&d&&u.remove());var p=(0,b.F9)(l.endContainer);p&&(r?(p.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===p.textContent.trim().replace(o.g.ZWSP,"")&&c&&p.remove()),a.insertNode(s),e.options.comment.add(i,a.toString(),t.getComments(e,!0)),ew(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return t?(this.commentIds.forEach(function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'+e+'"]').offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(e){var t;if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var n=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var r=(t=new Set(this.commentIds),n.filter(function(e){return!t.has(e)}));r.length>0&&e.options.comment.remove(r)}},e.prototype.showComment=function(){var e=(0,N.Ny)(this.element);this.selectPopover.setAttribute("style","left:"+e.left+"px;display:block;top:"+Math.max(-8,e.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(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,b.lG)(n.startContainer,"CODE"),o=(0,b.lG)(n.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var i="";return i="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",i),void e.clipboardData.setData("text/html","")}var a=(0,b.lG)(n.startContainer,"A"),l=(0,b.lG)(n.endContainer,"A");if(a&&l&&l.isSameNode(a)){var s=a.getAttribute("title")||"";return s&&(s=' "'+s+'"'),e.clipboardData.setData("text/plain","["+n.toString()+"]("+a.getAttribute("href")+s+")"),void e.clipboardData.setData("text/html","")}var d=document.createElement("div");d.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(d.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(h(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"===e.options.height){if(e.options.toolbarConfig.pin){var r=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}}else if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var o=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=o),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(h(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var o=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=o,t.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(t){tj(e,t,{pasteCode:function(t){var n=(0,N.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var o=(0,b.a1)(n.startContainer,"data-block","0");o?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,N.ib)(e.wysiwyg.element,n)}})}),this.element.addEventListener("compositionstart",function(){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){var r=(0,y.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?D(e):((0,d.vU)()||tn(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput)return t.preventInput=!1,void ew(e);if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)ew(e);else{var r=getSelection().getRangeAt(0),o=(0,b.F9)(r.startContainer);if(o||(ex(e,r),o=(0,b.F9)(r.startContainer)),o){for(var i=(0,N.im)(o,e.wysiwyg.element,r).start,l=!0,s=i-1;s>o.textContent.substr(0,i).lastIndexOf("\n");s--)if(" "!==o.textContent.charAt(s)&&" "!==o.textContent.charAt(s)){l=!1;break}0===i&&(l=!1);var d=!0;for(s=i-1;s<o.textContent.length;s++)if(" "!==o.textContent.charAt(s)&&"\n"!==o.textContent.charAt(s)){d=!1;break}var c=(0,y.W)(getSelection().getRangeAt(0).startContainer);c&&""===c.textContent&&(D(e),c.remove()),l&&"code-block"!==o.getAttribute("data-type")||d||tb(o.innerHTML)||tg(o.innerHTML)&&o.previousElementSibling?"function"==typeof e.options.input&&e.options.input(a(e)):("insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&o.previousElementSibling.remove(),tn(e,r,n))}}}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){var r,i,l,s,d,c,u,p,f=n.target;return f.checked?f.setAttribute("checked","checked"):f.removeAttribute("checked"),t.preventInput=!0,void ew(e)}if("IMG"!==n.target.tagName||n.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var m=(0,b.lG)(n.target,"A");if(m)return e.options.link.click?e.options.link.click(m):e.options.link.isOpen&&window.open(m.getAttribute("href")),void n.preventDefault();var v=(0,N.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&v.collapsed){var h=t.element.lastElementChild.getBoundingClientRect();n.y>h.top+h.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(o.g.ZWSP,"")?(v.selectNodeContents(t.element.lastElementChild),v.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,N.ib)(t.element,v)))}eC(e);var g=(0,b.fb)(n.target,"vditor-wysiwyg__preview");g||(g=(0,b.fb)((0,N.zh)(e).startContainer,"vditor-wysiwyg__preview")),g&&eL(g,e),j(n,e)}else"link-ref"===n.target.getAttribute("data-type")?eA(e,n.target):(r=n.target,e.wysiwyg.popover.innerHTML="",i=function(){r.setAttribute("src",s.value),r.setAttribute("alt",c.value),r.setAttribute("title",p.value),"function"==typeof e.options.input&&e.options.input(a(e))},(l=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.imageURL),l.className="vditor-tooltipped vditor-tooltipped__n",s=document.createElement("input"),l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.imageURL),s.value=r.getAttribute("src")||"",s.oninput=function(){i()},s.onkeydown=function(t){eT(e,t)},(d=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.alternateText),d.className="vditor-tooltipped vditor-tooltipped__n",c=document.createElement("input"),d.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.alternateText),c.style.width="52px",c.value=r.getAttribute("alt")||"",c.oninput=function(){i()},c.onkeydown=function(t){eT(e,t)},(u=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.title),u.className="vditor-tooltipped vditor-tooltipped__n",p=document.createElement("input"),u.appendChild(p),p.className="vditor-input",p.setAttribute("placeholder",window.VditorI18n.title),p.value=r.getAttribute("title")||"",p.oninput=function(){i()},p.onkeydown=function(t){eT(e,t)},eN(r,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",l),e.wysiwyg.popover.insertAdjacentElement("beforeend",d),e.wysiwyg.popover.insertAdjacentElement("beforeend",u),eM(e,r))}),this.element.addEventListener("keyup",function(t){if(!t.isComposing&&!(0,d.yl)(t)){"Enter"===t.key&&eY(e),("Backspace"===t.key||"Delete"===t.key)&&""!==e.wysiwyg.element.innerHTML&&1===e.wysiwyg.element.childNodes.length&&e.wysiwyg.element.firstElementChild&&"P"===e.wysiwyg.element.firstElementChild.tagName&&0===e.wysiwyg.element.firstElementChild.childElementCount&&(""===e.wysiwyg.element.textContent||"\n"===e.wysiwyg.element.textContent)&&(e.wysiwyg.element.innerHTML="");var n=(0,N.zh)(e);if("Backspace"===t.key&&(0,d.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),ex(e,n),eC(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||e.hint.render(e);var r=(0,b.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0&&(i=n.startContainer).classList.contains("vditor-wysiwyg__block")&&(r=i.lastElementChild),r)if("none"!==r.previousElementSibling.style.display){var o=r.previousElementSibling;if("PRE"===o.tagName&&(o=o.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var i,a=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling}(i=r.parentElement);if(a&&3!==a.nodeType){var l=a.querySelector(".vditor-wysiwyg__preview");if(l)return void eL(l,e)}if(3===a.nodeType){for(;0===a.textContent.length&&a.nextSibling;)a=a.nextSibling;n.setStart(a,1)}else n.setStart(a.firstChild,0)}else n.selectNodeContents(o),n.collapse(!1)}else"ArrowDown"===t.key||"ArrowRight"===t.key?eL(r,e):eL(r,e,!1)}}})},e}(),nW=(ev=function(e,t){return(ev=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ev(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});let nF=function(e){function t(t,n){var r=e.call(this)||this;if(r.version=o.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor"+t):n.cache={id:"vditor"+t}:n={cache:{id:"vditor"+t}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: "+t),r;t=document.getElementById(t)}var i=new nU(n).merge();if(i.i18n)window.VditorI18n=i.i18n,r.init(t,i);else{if(!["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(i.lang))throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");var a="vditorI18nScript"+i.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(e){e.id!==a&&document.head.removeChild(e)}),(0,l.G)(i.cdn+"/dist/js/i18n/"+i.lang+".js",a).then(function(){r.init(t,i)}).catch(function(e){r.showErrorTip("GET "+i.cdn+"/dist/js/i18n/"+i.lang+".js net::ERR_ABORTED 404 (Not Found)")})}return r}return nW(t,e),t.prototype.showErrorTip=function(e){var t=new tQ;document.body.appendChild(t.element),t.show(e,0)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,W(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,V.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,t3.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return a(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){h(this.vditor,["subToolbar","hint","popover"]),f(this.vditor.toolbar.elements,o.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){p(this.vditor.toolbar.elements,o.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"wysiwyg"===this.vditor.currentMode?eW(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?eW(this.vditor.sv.element):"ir"===this.vditor.currentMode?eW(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,N.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 Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return tW(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){t$(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,N.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&U(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&tn(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&R(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>"+this.vditor.lute.SpinVditorSVDOM(e)+"</div>",e5(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?eP(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){O(e,n.vditor)}),tR(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(h(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&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 e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),K(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find(function(e,t){if(e===n)return r.splice(t,1),!0}),0===r.length?(e.outerHTML=e.innerHTML,(0,N.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach(function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)}),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)})}),ew(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.vditor={currentMode:t.mode,element:e,hint:new tU(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new tK(window.VditorI18n.outline),tip:new tQ},this.vditor.sv=new tY(this.vditor),this.vditor.undo=new nB,this.vditor.wysiwyg=new nV(this.vditor),this.vditor.ir=new tV(this.vditor),this.vditor.toolbar=new nP(this.vditor),t.resize.enable&&(this.vditor.resize=new tX(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new s),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new te),(0,l.G)(t._lutePath||t.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){n.vditor.lute=(0,tF.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new tJ(n.vditor),function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),W(e),(0,V.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){h(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),eU(e,e.options.mode,eb(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame(function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, "+-t.getBoundingClientRect().top+"px)")}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}}(n.vditor),t.after&&t.after(),t.icon&&(0,l.J)(t.cdn+"/dist/js/icons/"+t.icon+".js","vditorIconScript")})},t}(t.default)})(),r=r.default})()},2:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg=="},505:function(e){"use strict";e.exports=o},772:function(e){"use strict";e.exports=r},667:function(e){"use strict";e.exports=n},584:function(e){"use strict";e.exports=i},721:function(e){"use strict";e.exports=a},156:function(e){"use strict";e.exports=t},238:function(t){"use strict";t.exports=e}},m={};function v(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={id:e,exports:{}};return f[e].call(n.exports,n,n.exports,v),n.exports}return v.m=f,v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(t,n){return v.f[n](e,t),t},[]))},v.u=function(e){return"1dde14932eb8f07d.js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l={},s="@nocobase/plugin-field-markdown-vditor:",v.l=function(e,t,n,r){if(l[e])return void l[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),d=0;d<a.length;d++){var c=a[d];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==s+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-webpack",s+n),o.src=e),l[e]=[t];var u=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=l[e];if(delete l[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.nc=void 0,(d=window.__nocobase_public_path__||"/").endsWith("/")||(d+="/"),v.p=d+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client/",v.b=document.baseURI||self.location.href,c={909:0},v.f.j=function(e,t){var n=v.o(c,e)?c[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(t){if(v.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},u=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],l=0;if(o.some(function(e){return 0!==c[e]})){for(n in i)v.o(i,n)&&(v.m[n]=i[n]);a&&a(v)}for(e&&e(t);l<o.length;l++)r=o[l],v.o(c,r)&&c[r]&&c[r][0](),c[r]=0},(p=self.webpackChunk_nocobase_plugin_field_markdown_vditor=self.webpackChunk_nocobase_plugin_field_markdown_vditor||[]).forEach(u.bind(null,0)),p.push=u.bind(null,p.push.bind(p)),v(291)}()});
10
+ !function(n,o){"object"==typeof exports&&"object"==typeof module?module.exports=o(require("react"),require("@nocobase/flow-engine"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/utils/client"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-markdown-vditor",["react","@nocobase/flow-engine","@nocobase/client","@formily/react","@nocobase/utils/client","antd","react-i18next"],o):"object"==typeof exports?exports["@nocobase/plugin-field-markdown-vditor"]=o(require("react"),require("@nocobase/flow-engine"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/utils/client"),require("antd"),require("react-i18next")):n["@nocobase/plugin-field-markdown-vditor"]=o(n.react,n["@nocobase/flow-engine"],n["@nocobase/client"],n["@formily/react"],n["@nocobase/utils/client"],n.antd,n["react-i18next"])}(self,function(n,o,e,t,r,i,a){return function(){var l,d,c,s,p,u,v={718:function(n,o,e){"use strict";e.r(o),e.d(o,{PluginFieldMarkdownVditorClient:function(){return V},default:function(){return W}});var t=e(772),r=e(278),i=e.n(r),a=e(391),l=e.n(a),d=e(547),c=e.n(d),s=e(604),p=e.n(s),u=e(593),v=e.n(u),f=e(784),b=e.n(f),h=e(926),g={};g.styleTagTransform=b(),g.setAttributes=p(),g.insert=c().bind(null,"head"),g.domAPI=l(),g.insertStyleElement=v(),i()(h.Z,g),h.Z&&h.Z.locals&&h.Z.locals;var m=e(667),y=e(156),x=e.n(y);function w(n,o){(null==o||o>n.length)&&(o=n.length);for(var e=0,t=Array(o);e<o;e++)t[e]=n[e];return t}function k(n,o,e,t,r,i,a){try{var l=n[i](a),d=l.value}catch(n){e(n);return}l.done?o(d):Promise.resolve(d).then(t,r)}function _(n){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function O(n,o){return(O=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n})(n,o)}function j(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(j=function(){return!!n})()}var z=function(n){var o,e=n.value,t=n.markdown,r=n.liquid,i=n.t,a=n.textOnly,l=n.ctx,d=n.overflowMode,c=n.parseLiquid,s=void 0!==c&&c,p=(o=(0,y.useState)(null),function(n){if(Array.isArray(n))return n}(o)||function(n,o){var e,t,r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var i=[],a=!0,l=!1;try{for(r=r.call(n);!(a=(e=r.next()).done)&&(i.push(e.value),i.length!==o);a=!0);}catch(n){l=!0,t=n}finally{try{a||null==r.return||r.return()}finally{if(l)throw t}}return i}}(o,2)||function(n,o){if(n){if("string"==typeof n)return w(n,2);var e=Object.prototype.toString.call(n).slice(8,-1);if("Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e)return Array.from(e);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return w(n,o)}}(o,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=p[0],v=p[1];return(0,y.useEffect)(function(){if(e){var n;(n=function(){var n,o,c;return function(n,o){var e,t,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var d=[i,l];if(e)throw TypeError("Generator is already executing.");for(;a;)try{if(e=1,t&&(r=2&d[0]?t.return:d[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,d[1])).done)return r;switch(t=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,t=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===d[0]||2===d[0])){a=0;continue}if(3===d[0]&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(6===d[0]&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=o.call(n,a)}catch(n){d=[6,n],t=0}finally{e=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}}(this,function(p){switch(p.label){case 0:if(p.trys.push([0,4,,5]),!s)return[3,2];return[4,r.renderWithFullContext(e,l)];case 1:return o=p.sent(),[3,3];case 2:o=e,p.label=3;case 3:return n=o,v(t.render(i(n),{ellipsis:"ellipsis"===d,textOnly:a})),[3,5];case 4:return c=p.sent(),v('<pre style="color:red;"> 渲染错误: '.concat(c.message,"</pre>")),[3,5];case 5:return[2]}})},function(){var o=this,e=arguments;return new Promise(function(t,r){var i=n.apply(o,e);function a(n){k(i,t,r,a,l,"next",n)}function l(n){k(i,t,r,a,l,"throw",n)}a(void 0)})})()}},[e,a,d]),u},S=function(n){var o;if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");function e(){var n,o;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");return n=e,o=arguments,n=_(n),function(n,o){var e;if(o&&("object"==((e=o)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof o))return o;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,j()?Reflect.construct(n,o||[],_(this).constructor):n.apply(this,o))}return e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&O(e,n),o=[{key:"renderComponent",value:function(n){if(!n)return null;var o=this.context,e=o.markdown,t=o.liquid,r=o.t,i=this.props,a=i.textOnly,l=i.overflowMode;return x().createElement(z,{value:n,markdown:e,liquid:t,t:r,textOnly:a,ctx:this.context,overflowMode:l})}}],function(n,o){for(var e=0;e<o.length;e++){var t=o[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}(e.prototype,o),e}(t.DisplayTitleFieldModel);S.define({label:(0,m.escapeT)("MarkdownVditor")}),S.registerFlow({key:"markdownVditorSettings",title:(0,t.tval)("Content settings"),sort:200,steps:{renderMode:{use:"renderMode"}}}),m.DisplayItemModel.bindModelToInterface("DisplayVditorFieldModel",["vditor","markdown"],{isDefault:!0});function E(n){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function A(n,o){return(A=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n})(n,o)}function T(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(T=function(){return!!n})()}var P=function(n){var o;if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");function e(){var n,o;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");return n=e,o=arguments,n=E(n),function(n,o){var e;if(o&&("object"==((e=o)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof o))return o;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,T()?Reflect.construct(n,o||[],E(this).constructor):n.apply(this,o))}return e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&A(e,n),o=[{key:"render",value:function(){var n,o;return this.context.markdown.edit((n=function(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},t=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.forEach(function(o){var t;t=e[o],o in n?Object.defineProperty(n,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[o]=t})}return n}({},this.props),o=o={enableContextSelect:!1},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e.push.apply(e,t)}return e})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}}],function(n,o){for(var e=0;e<o.length;e++){var t=o[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}(e.prototype,o),e}(t.FieldModel);P=function(n,o,e,t){var r,i=arguments.length,a=i<3?o:null===t?t=Object.getOwnPropertyDescriptor(o,e):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(n,o,e,t);else for(var l=n.length-1;l>=0;l--)(r=n[l])&&(a=(i<3?r(a):i>3?r(o,e,a):r(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a}([(0,m.largeField)()],P),m.EditableItemModel.bindModelToInterface("VditorFieldModel",["vditor","markdown"],{isDefault:!0});var C=e(68),I=e(581);function M(n,o,e,t,r,i,a){try{var l=n[i](a),d=l.value}catch(n){e(n);return}l.done?o(d):Promise.resolve(d).then(t,r)}function U(n){return function(){var o=this,e=arguments;return new Promise(function(t,r){var i=n.apply(o,e);function a(n){M(i,t,r,a,l,"next",n)}function l(n){M(i,t,r,a,l,"throw",n)}a(void 0)})}}function R(n,o,e){return(R=L()?Reflect.construct:function(n,o,e){var t=[null];t.push.apply(t,o);var r=new(Function.bind.apply(n,t));return e&&D(r,e.prototype),r}).apply(null,arguments)}function N(n,o,e){return o in n?Object.defineProperty(n,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[o]=e,n}function q(n){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function D(n,o){return(D=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n})(n,o)}function H(n){var o="function"==typeof Map?new Map:void 0;return(H=function(n){if(null===n||-1===Function.toString.call(n).indexOf("[native code]"))return n;if("function"!=typeof n)throw TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(n))return o.get(n);o.set(n,e)}function e(){return R(n,arguments,q(this).constructor)}return e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),D(e,n)})(n)}function L(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(L=function(){return!!n})()}function F(n,o){var e,t,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){var d=[i,l];if(e)throw TypeError("Generator is already executing.");for(;a;)try{if(e=1,t&&(r=2&d[0]?t.return:d[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,d[1])).done)return r;switch(t=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,t=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===d[0]||2===d[0])){a=0;continue}if(3===d[0]&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(6===d[0]&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=o.call(n,a)}catch(n){d=[6,n],t=0}finally{e=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}}var B=(0,t.lazy)(function(){return I("imported_-1bo1vdq_component",Promise.all([e.e("859"),e.e("189")]).then(e.bind(e,563)))},"MarkdownVditor").MarkdownVditor,V=function(n){var o;if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");function e(){var n,o,t;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");return o=e,t=arguments,o=q(o),N(n=function(n,o){var e;if(o&&("object"==((e=o)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof o))return o;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,L()?Reflect.construct(o,t||[],q(this).constructor):o.apply(this,t)),"dependencyLoaded",!1),n}return e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&D(e,n),o=[{key:"afterAdd",value:function(){return U(function(){return F(this,function(n){return[2]})})()}},{key:"beforeLoad",value:function(){return U(function(){return F(this,function(n){return[2]})})()}},{key:"load",value:function(){var n=this;return U(function(){return F(this,function(o){return n.app.addComponents({MarkdownVditor:B}),n.app.dataSourceManager.addFieldInterfaces([C.w]),n.flowEngine.registerModels({VditorFieldModel:P,DisplayVditorFieldModel:S}),[2]})})()}},{key:"getCDN",value:function(){return this.app.getPublicPath()+"static/plugins/@nocobase/plugin-block-markdown/dist/client/vditor"}},{key:"initVditorDependency",value:function(){var n=this,o=this.getCDN();try{var e,t="plugin-field-markdown-vditor-dep",r=(e={},N(e,"".concat(t,".katex"),"".concat(o,"/dist/js/katex/katex.min.js?v=0.16.9")),N(e,"".concat(t,".ABCJS"),"".concat(o,"/dist/js/abcjs/abcjs_basic.min")),N(e,"".concat(t,".plantumlEncoder"),"".concat(o,"/dist/js/plantuml/plantuml-encoder.min")),N(e,"".concat(t,".echarts"),"".concat(o,"/dist/js/echarts/echarts.min")),N(e,"".concat(t,".flowchart"),"".concat(o,"/dist/js/flowchart.js/flowchart.min")),N(e,"".concat(t,".Viz"),"".concat(o,"/dist/js/graphviz/viz")),N(e,"".concat(t,".mermaid"),"".concat(o,"/dist/js/mermaid/mermaid.min")),e);this.app.requirejs.require.config({waitSeconds:120,paths:r}),Object.keys(r).forEach(function(o){n.app.requirejs.require([o],function(n){window[o.split(".")[1]]=n})})}catch(n){console.log("initVditorDependency failed",n)}}}],function(n,o){for(var e=0;e<o.length;e++){var t=o[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}(e.prototype,o),e}(H(t.Plugin)),W=V},68:function(n,o,e){"use strict";e.d(o,{K:function(){return p},w:function(){return u}});var t=e(772),r=e(551);function i(n,o,e){return o in n?Object.defineProperty(n,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[o]=e,n}function a(n){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function l(n,o){return(l=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n})(n,o)}function d(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(n){}return(d=function(){return!!n})()}var c=t.interfacesProperties.defaultProps,s=t.interfacesProperties.operators,p=["headings","bold","italic","strike","link","list","ordered-list","check","quote","line","code","inline-code","upload","fullscreen"],u=function(n){var o;if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");function e(){var n,o,t,l,u;if(!(this instanceof e))throw TypeError("Cannot call a class as a function");return o=e,t=arguments,o=a(o),i(n=function(n,o){var e;if(o&&("object"==((e=o)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof o))return o;if(void 0===n)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(this,d()?Reflect.construct(o,t||[],a(this).constructor):o.apply(this,t)),"name","vditor"),i(n,"type","object"),i(n,"group","media"),i(n,"order",1),i(n,"title",(0,r.U)("Vditor")),i(n,"sortable",!0),i(n,"default",{type:"text",length:"long",uiSchema:{type:"string","x-component":"MarkdownVditor"}}),i(n,"availableTypes",["text","json","string"]),i(n,"properties",(l=function(n){for(var o=1;o<arguments.length;o++){var e=null!=arguments[o]?arguments[o]:{},t=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e).filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.forEach(function(o){i(n,o,e[o])})}return n}({},c),u=u={"uiSchema.x-component-props.fileCollection":{type:"string",title:(0,r.U)("File collection"),"x-component":"CollectionSelect","x-component-props":{filter:function(n){var o;return(null==n||null==(o=n.options)?void 0:o.template)==="file"}},"x-decorator":"FormItem",default:"","x-reactions":{fulfill:{schema:{description:(0,r.U)("Used to store files uploaded in the Markdown editor (default: attachments)")}}}},"uiSchema.x-component-props.toolbar":{type:"array",title:(0,r.U)("Toolbar"),"x-component":"Select","x-component-props":{mode:"multiple"},"x-decorator":"FormItem",default:p,enum:[{value:"emoji",label:(0,r.U)("Emoji")},{value:"headings",label:(0,r.U)("Headings")},{value:"bold",label:(0,r.U)("Bold")},{value:"italic",label:(0,r.U)("Italic")},{value:"strike",label:(0,r.U)("Strike")},{value:"line",label:(0,r.U)("Line")},{value:"quote",label:(0,r.U)("Quote")},{value:"list",label:(0,r.U)("List")},{value:"ordered-list",label:(0,r.U)("OrderedList")},{value:"check",label:(0,r.U)("Check")},{value:"outdent",label:(0,r.U)("Outdent")},{value:"indent",label:(0,r.U)("Indent")},{value:"code",label:(0,r.U)("Code")},{value:"inline-code",label:(0,r.U)("InlineCode")},{value:"insert-after",label:(0,r.U)("InsertAfter")},{value:"insert-before",label:(0,r.U)("InsertBefore")},{value:"undo",label:(0,r.U)("Undo")},{value:"redo",label:(0,r.U)("Redo")},{value:"upload",label:(0,r.U)("Upload")},{value:"link",label:(0,r.U)("Link")},{value:"record",label:(0,r.U)("Record")},{value:"table",label:(0,r.U)("Table")},{value:"edit-mode",label:(0,r.U)("EditMode")},{value:"both",label:(0,r.U)("Both")},{value:"preview",label:(0,r.U)("Preview")},{value:"fullscreen",label:(0,r.U)("Fullscreen")},{value:"outline",label:(0,r.U)("Outline")}]}},Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(u)):(function(n,o){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);e.push.apply(e,t)}return e})(Object(u)).forEach(function(n){Object.defineProperty(l,n,Object.getOwnPropertyDescriptor(u,n))}),l)),i(n,"filterable",{operators:s.bigField}),i(n,"titleUsable",!0),n}return e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&l(e,n),o=[{key:"schemaInitialize",value:function(n,o){["Table","Kanban"].includes(o.block)&&(n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].ellipsis=!0)}}],function(n,o){for(var e=0;e<o.length;e++){var t=o[e];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(n,t.key,t)}}(e.prototype,o),e}(t.CollectionFieldInterface)},551:function(n,o,e){"use strict";e.d(o,{A:function(){return r},U:function(){return i}});var t=e(584),r="field-markdown-vditor";function i(n){return(0,t.tval)(n,{ns:r})}},926:function(n,o,e){"use strict";var t=e(46),r=e.n(t),i=e(758),a=e.n(i),l=e(821),d=e.n(l),c=new URL(e(2),e.b),s=a()(r()),p=d()(c);s.push([n.id,'/*!\n * Vditor v3.10.4 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\nanimation-name: tooltip-appear;\nanimation-duration: 0.15s;\nanimation-fill-mode: forwards;\nanimation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\nanimation-duration: 0.15s;\nanimation-name: scale-in;\nanimation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\nanimation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: -webkit-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: -moz-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\nanimation-duration: 0.15s;\nanimation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\nanimation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: -webkit-zoom-out;\n cursor: -moz-zoom-out;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url('+p+');\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 0.5em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: normal;\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n\n',""]),o.Z=s},758:function(n){"use strict";n.exports=function(n){var o=[];return o.toString=function(){return this.map(function(o){var e="",t=void 0!==o[5];return o[4]&&(e+="@supports (".concat(o[4],") {")),o[2]&&(e+="@media ".concat(o[2]," {")),t&&(e+="@layer".concat(o[5].length>0?" ".concat(o[5]):""," {")),e+=n(o),t&&(e+="}"),o[2]&&(e+="}"),o[4]&&(e+="}"),e}).join("")},o.i=function(n,e,t,r,i){"string"==typeof n&&(n=[[null,n,void 0]]);var a={};if(t)for(var l=0;l<this.length;l++){var d=this[l][0];null!=d&&(a[d]=!0)}for(var c=0;c<n.length;c++){var s=[].concat(n[c]);t&&a[s[0]]||(void 0!==i&&(void 0===s[5]||(s[1]="@layer".concat(s[5].length>0?" ".concat(s[5]):""," {").concat(s[1],"}")),s[5]=i),e&&(s[2]&&(s[1]="@media ".concat(s[2]," {").concat(s[1],"}")),s[2]=e),r&&(s[4]?(s[1]="@supports (".concat(s[4],") {").concat(s[1],"}"),s[4]=r):s[4]="".concat(r)),o.push(s))}},o}},821:function(n){"use strict";n.exports=function(n,o){return(o||(o={}),n&&(n=String(n.__esModule?n.default:n),/^['"].*['"]$/.test(n)&&(n=n.slice(1,-1)),o.hash&&(n+=o.hash),/["'() \t\n]|(%20)/.test(n)||o.needQuotes))?'"'.concat(n.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):n}},46:function(n){"use strict";n.exports=function(n){return n[1]}},581:function(n){n.exports=function(n,o){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(n,o),o}},278:function(n){"use strict";var o=[];function e(n){for(var e=-1,t=0;t<o.length;t++)if(o[t].identifier===n){e=t;break}return e}function t(n,t){for(var r={},i=[],a=0;a<n.length;a++){var l=n[a],d=t.base?l[0]+t.base:l[0],c=r[d]||0,s="".concat(d," ").concat(c);r[d]=c+1;var p=e(s),u={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==p)o[p].references++,o[p].updater(u);else{var v=function(n,o){var e=o.domAPI(o);return e.update(n),function(o){o?(o.css!==n.css||o.media!==n.media||o.sourceMap!==n.sourceMap||o.supports!==n.supports||o.layer!==n.layer)&&e.update(n=o):e.remove()}}(u,t);t.byIndex=a,o.splice(a,0,{identifier:s,updater:v,references:1})}i.push(s)}return i}n.exports=function(n,r){var i=t(n=n||[],r=r||{});return function(n){n=n||[];for(var a=0;a<i.length;a++){var l=e(i[a]);o[l].references--}for(var d=t(n,r),c=0;c<i.length;c++){var s=e(i[c]);0===o[s].references&&(o[s].updater(),o.splice(s,1))}i=d}}},547:function(n){"use strict";var o={};n.exports=function(n,e){var t=function(n){if(void 0===o[n]){var e=document.querySelector(n);if(window.HTMLIFrameElement&&e instanceof window.HTMLIFrameElement)try{e=e.contentDocument.head}catch(n){e=null}o[n]=e}return o[n]}(n);if(!t)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");t.appendChild(e)}},593:function(n){"use strict";n.exports=function(n){var o=document.createElement("style");return n.setAttributes(o,n.attributes),n.insert(o,n.options),o}},604:function(n,o,e){"use strict";n.exports=function(n){var o=e.nc;o&&n.setAttribute("nonce",o)}},391:function(n){"use strict";n.exports=function(n){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var o=n.insertStyleElement(n);return{update:function(e){var t,r,i;t="",e.supports&&(t+="@supports (".concat(e.supports,") {")),e.media&&(t+="@media ".concat(e.media," {")),(r=void 0!==e.layer)&&(t+="@layer".concat(e.layer.length>0?" ".concat(e.layer):""," {")),t+=e.css,r&&(t+="}"),e.media&&(t+="}"),e.supports&&(t+="}"),(i=e.sourceMap)&&"undefined"!=typeof btoa&&(t+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),n.styleTagTransform(t,o,n.options)},remove:function(){!function(n){if(null!==n.parentNode)n.parentNode.removeChild(n)}(o)}}}},784:function(n){"use strict";n.exports=function(n,o){if(o.styleSheet)o.styleSheet.cssText=n;else{for(;o.firstChild;)o.removeChild(o.firstChild);o.appendChild(document.createTextNode(n))}}},2:function(n){"use strict";n.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg=="},505:function(n){"use strict";n.exports=t},772:function(n){"use strict";n.exports=e},667:function(n){"use strict";n.exports=o},584:function(n){"use strict";n.exports=r},721:function(n){"use strict";n.exports=i},156:function(o){"use strict";o.exports=n},238:function(n){"use strict";n.exports=a}},f={};function b(n){var o=f[n];if(void 0!==o)return o.exports;var e=f[n]={id:n,exports:{}};return v[n].call(e.exports,e,e.exports,b),e.exports}return b.m=v,b.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return b.d(o,{a:o}),o},b.d=function(n,o){for(var e in o)b.o(o,e)&&!b.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:o[e]})},b.f={},b.e=function(n){return Promise.all(Object.keys(b.f).reduce(function(o,e){return b.f[e](n,o),o},[]))},b.u=function(n){return""+({189:"7bd9f8591457f3a8",859:"478dab5e65264134"})[n]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(n){if("object"==typeof window)return window}}(),b.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},l={},d="@nocobase/plugin-field-markdown-vditor:",b.l=function(n,o,e,t){if(l[n])return void l[n].push(o);if(void 0!==e)for(var r,i,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var s=a[c];if(s.getAttribute("src")==n||s.getAttribute("data-webpack")==d+e){r=s;break}}r||(i=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,b.nc&&r.setAttribute("nonce",b.nc),r.setAttribute("data-webpack",d+e),r.src=n),l[n]=[o];var p=function(o,e){r.onerror=r.onload=null,clearTimeout(u);var t=l[n];if(delete l[n],r.parentNode&&r.parentNode.removeChild(r),t&&t.forEach(function(n){return n(e)}),o)return o(e)},u=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),i&&document.head.appendChild(r)},b.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},b.nc=void 0,(c=window.__nocobase_public_path__||"/").endsWith("/")||(c+="/"),b.p=c+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client/",b.b=document.baseURI||self.location.href,s={909:0},b.f.j=function(n,o){var e=b.o(s,n)?s[n]:void 0;if(0!==e)if(e)o.push(e[2]);else{var t=new Promise(function(o,t){e=s[n]=[o,t]});o.push(e[2]=t);var r=b.p+b.u(n),i=Error();b.l(r,function(o){if(b.o(s,n)&&(0!==(e=s[n])&&(s[n]=void 0),e)){var t=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;i.message="Loading chunk "+n+" failed.\n("+t+": "+r+")",i.name="ChunkLoadError",i.type=t,i.request=r,e[1](i)}},"chunk-"+n,n)}},p=function(n,o){var e,t,r=o[0],i=o[1],a=o[2],l=0;if(r.some(function(n){return 0!==s[n]})){for(e in i)b.o(i,e)&&(b.m[e]=i[e]);a&&a(b)}for(n&&n(o);l<r.length;l++)t=r[l],b.o(s,t)&&s[t]&&s[t][0](),s[t]=0},(u=self.webpackChunk_nocobase_plugin_field_markdown_vditor=self.webpackChunk_nocobase_plugin_field_markdown_vditor||[]).forEach(p.bind(null,0)),u.push=p.bind(null,u.push.bind(u)),b(718)}()});