/**
* Minified by jsDelivr using Terser v5.39.0.
* Original file: /npm/@toast-ui/editor@3.2.2/dist/toastui-editor.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/*!
* @toast-ui/editor
* @version 3.2.2 | Fri Feb 17 2023
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
* @license MIT
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prosemirror-commands"),require("prosemirror-history"),require("prosemirror-inputrules"),require("prosemirror-keymap"),require("prosemirror-model"),require("prosemirror-state"),require("prosemirror-transform"),require("prosemirror-view")):"function"==typeof define&&define.amd?define(["prosemirror-commands","prosemirror-history","prosemirror-inputrules","prosemirror-keymap","prosemirror-model","prosemirror-state","prosemirror-transform","prosemirror-view"],t):"object"==typeof exports?exports.toastui=t(require("prosemirror-commands"),require("prosemirror-history"),require("prosemirror-inputrules"),require("prosemirror-keymap"),require("prosemirror-model"),require("prosemirror-state"),require("prosemirror-transform"),require("prosemirror-view")):(e.toastui=e.toastui||{},e.toastui.Editor=t(e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0],e[void 0]))}(self,(function(e,t,n,r,o,i,a,s){return function(){var l={368:function(e){
/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */
e.exports=function(){"use strict";function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var t=Object.hasOwnProperty,n=Object.setPrototypeOf,r=Object.isFrozen,o=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor,a=Object.freeze,s=Object.seal,l=Object.create,u="undefined"!=typeof Reflect&&Reflect,c=u.apply,p=u.construct;c||(c=function(e,t,n){return e.apply(t,n)}),a||(a=function(e){return e}),s||(s=function(e){return e}),p||(p=function(t,n){return new(Function.prototype.bind.apply(t,[null].concat(e(n))))});var d=x(Array.prototype.forEach),f=x(Array.prototype.pop),h=x(Array.prototype.push),m=x(String.prototype.toLowerCase),v=x(String.prototype.match),g=x(String.prototype.replace),y=x(String.prototype.indexOf),b=x(String.prototype.trim),w=x(RegExp.prototype.test),k=C(TypeError);function x(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return c(e,t,r)}}function C(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return p(e,n)}}function T(e,t){n&&n(e,null);for(var o=t.length;o--;){var i=t[o];if("string"==typeof i){var a=m(i);a!==i&&(r(t)||(t[o]=a),i=a)}e[i]=!0}return e}function E(e){var n=l(null),r=void 0;for(r in e)c(t,e,[r])&&(n[r]=e[r]);return n}function M(e,t){for(;null!==e;){var n=i(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=o(e)}function r(e){return console.warn("fallback value for",e),null}return r}var L=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),N=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),S=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),A=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),D=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),O=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I=a(["#text"]),R=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),P=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),B=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),F=s(/\{\{[\s\S]*|[\s\S]*\}\}/gm),q=s(/<%[\s\S]*|[\s\S]*%>/gm),j=s(/^data-[\-\w.\u00B7-\uFFFF]/),_=s(/^aria-[\-\w]+$/),U=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),z=s(/^(?:\w+script|data):/i),V=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function $(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var G=function(){return"undefined"==typeof window?null:window},X=function(e,t){if("object"!==(void 0===e?"undefined":W(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G(),t=function(e){return Z(e)};if(t.version="2.3.3",t.removed=[],!e||!e.document||9!==e.document.nodeType)return t.isSupported=!1,t;var n=e.document,r=e.document,o=e.DocumentFragment,i=e.HTMLTemplateElement,s=e.Node,l=e.Element,u=e.NodeFilter,c=e.NamedNodeMap,p=void 0===c?e.NamedNodeMap||e.MozNamedAttrMap:c,x=e.Text,C=e.Comment,K=e.DOMParser,Q=e.trustedTypes,Y=l.prototype,J=M(Y,"cloneNode"),ee=M(Y,"nextSibling"),te=M(Y,"childNodes"),ne=M(Y,"parentNode");if("function"==typeof i){var re=r.createElement("template");re.content&&re.content.ownerDocument&&(r=re.content.ownerDocument)}var oe=X(Q,n),ie=oe&&Be?oe.createHTML(""):"",ae=r,se=ae.implementation,le=ae.createNodeIterator,ue=ae.createDocumentFragment,ce=ae.getElementsByTagName,pe=n.importNode,de={};try{de=E(r).documentMode?r.documentMode:{}}catch(e){}var fe={};t.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==de;var he=F,me=q,ve=j,ge=_,ye=z,be=V,we=U,ke=null,xe=T({},[].concat($(L),$(N),$(S),$(D),$(I))),Ce=null,Te=T({},[].concat($(R),$(P),$(H),$(B))),Ee=null,Me=null,Le=!0,Ne=!0,Se=!1,Ae=!1,De=!1,Oe=!1,Ie=!1,Re=!1,Pe=!1,He=!0,Be=!1,Fe=!0,qe=!0,je=!1,_e={},Ue=null,ze=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Ve=null,We=T({},["audio","video","img","source","image","track"]),$e=null,Ge=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Ze="http://www.w3.org/2000/svg",Ke="http://www.w3.org/1999/xhtml",Qe=Ke,Ye=!1,Je=void 0,et=["application/xhtml+xml","text/html"],tt="text/html",nt=void 0,rt=null,ot=r.createElement("form"),it=function(e){rt&&rt===e||(e&&"object"===(void 0===e?"undefined":W(e))||(e={}),e=E(e),ke="ALLOWED_TAGS"in e?T({},e.ALLOWED_TAGS):xe,Ce="ALLOWED_ATTR"in e?T({},e.ALLOWED_ATTR):Te,$e="ADD_URI_SAFE_ATTR"in e?T(E(Ge),e.ADD_URI_SAFE_ATTR):Ge,Ve="ADD_DATA_URI_TAGS"in e?T(E(We),e.ADD_DATA_URI_TAGS):We,Ue="FORBID_CONTENTS"in e?T({},e.FORBID_CONTENTS):ze,Ee="FORBID_TAGS"in e?T({},e.FORBID_TAGS):{},Me="FORBID_ATTR"in e?T({},e.FORBID_ATTR):{},_e="USE_PROFILES"in e&&e.USE_PROFILES,Le=!1!==e.ALLOW_ARIA_ATTR,Ne=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=e.SAFE_FOR_TEMPLATES||!1,De=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,He=!1!==e.RETURN_DOM_IMPORT,Be=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,qe=!1!==e.KEEP_CONTENT,je=e.IN_PLACE||!1,we=e.ALLOWED_URI_REGEXP||we,Qe=e.NAMESPACE||Ke,Je=Je=-1===et.indexOf(e.PARSER_MEDIA_TYPE)?tt:e.PARSER_MEDIA_TYPE,nt="application/xhtml+xml"===Je?function(e){return e}:m,Ae&&(Ne=!1),Pe&&(Re=!0),_e&&(ke=T({},[].concat($(I))),Ce=[],!0===_e.html&&(T(ke,L),T(Ce,R)),!0===_e.svg&&(T(ke,N),T(Ce,P),T(Ce,B)),!0===_e.svgFilters&&(T(ke,S),T(Ce,P),T(Ce,B)),!0===_e.mathMl&&(T(ke,D),T(Ce,H),T(Ce,B))),e.ADD_TAGS&&(ke===xe&&(ke=E(ke)),T(ke,e.ADD_TAGS)),e.ADD_ATTR&&(Ce===Te&&(Ce=E(Ce)),T(Ce,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&T($e,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(Ue===ze&&(Ue=E(Ue)),T(Ue,e.FORBID_CONTENTS)),qe&&(ke["#text"]=!0),De&&T(ke,["html","head","body"]),ke.table&&(T(ke,["tbody"]),delete Ee.tbody),a&&a(e),rt=e)},at=T({},["mi","mo","mn","ms","mtext"]),st=T({},["foreignobject","desc","title","annotation-xml"]),lt=T({},N);T(lt,S),T(lt,A);var ut=T({},D);T(ut,O);var ct=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:Ke,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===Ze)return t.namespaceURI===Ke?"svg"===n:t.namespaceURI===Xe?"svg"===n&&("annotation-xml"===r||at[r]):Boolean(lt[n]);if(e.namespaceURI===Xe)return t.namespaceURI===Ke?"math"===n:t.namespaceURI===Ze?"math"===n&&st[r]:Boolean(ut[n]);if(e.namespaceURI===Ke){if(t.namespaceURI===Ze&&!st[r])return!1;if(t.namespaceURI===Xe&&!at[r])return!1;var o=T({},["title","style","font","a","script"]);return!ut[n]&&(o[n]||!lt[n])}return!1},pt=function(e){h(t.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},dt=function(e,n){try{h(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch(e){h(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),"is"===e&&!Ce[e])if(Re||Pe)try{pt(n)}catch(e){}else try{n.setAttribute(e,"")}catch(e){}},ft=function(e){var t=void 0,n=void 0;if(Ie)e="<remove></remove>"+e;else{var o=v(e,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===Je&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=oe?oe.createHTML(e):e;if(Qe===Ke)try{t=(new K).parseFromString(i,Je)}catch(e){}if(!t||!t.documentElement){t=se.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=Ye?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),Qe===Ke?ce.call(t,De?"html":"body")[0]:De?t.documentElement:a},ht=function(e){return le.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},mt=function(e){return!(e instanceof x||e instanceof C||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof p&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},vt=function(e){return"object"===(void 0===s?"undefined":W(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":W(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},gt=function(e,n,r){fe[e]&&d(fe[e],(function(e){e.call(t,n,r,rt)}))},yt=function(e){var n=void 0;if(gt("beforeSanitizeElements",e,null),mt(e))return pt(e),!0;if(v(e.nodeName,/[\u0080-\uFFFF]/))return pt(e),!0;var r=nt(e.nodeName);if(gt("uponSanitizeElement",e,{tagName:r,allowedTags:ke}),!vt(e.firstElementChild)&&(!vt(e.content)||!vt(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return pt(e),!0;if("select"===r&&w(/<template/i,e.innerHTML))return pt(e),!0;if(!ke[r]||Ee[r]){if(qe&&!Ue[r]){var o=ne(e)||e.parentNode,i=te(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(J(i[a],!0),ee(e))}return pt(e),!0}return e instanceof l&&!ct(e)?(pt(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(Ae&&3===e.nodeType&&(n=e.textContent,n=g(n,he," "),n=g(n,me," "),e.textContent!==n&&(h(t.removed,{element:e.cloneNode()}),e.textContent=n)),gt("afterSanitizeElements",e,null),!1):(pt(e),!0)},bt=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in r||n in ot))return!1;if(Ne&&!Me[t]&&w(ve,t));else if(Le&&w(ge,t));else{if(!Ce[t]||Me[t])return!1;if($e[t]);else if(w(we,g(n,be,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==y(n,"data:")||!Ve[e])if(Se&&!w(ye,g(n,be,"")));else if(n)return!1}return!0},wt=function(e){var n=void 0,r=void 0,o=void 0,i=void 0;gt("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ce};for(i=a.length;i--;){var l=n=a[i],u=l.name,c=l.namespaceURI;if(r=b(n.value),o=nt(u),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,gt("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(dt(u,e),s.keepAttr))if(w(/\/>/i,r))dt(u,e);else{Ae&&(r=g(r,he," "),r=g(r,me," "));var p=nt(e.nodeName);if(bt(p,o,r))try{c?e.setAttributeNS(c,u,r):e.setAttribute(u,r),f(t.removed)}catch(e){}}}gt("afterSanitizeAttributes",e,null)}},kt=function e(t){var n=void 0,r=ht(t);for(gt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)gt("uponSanitizeShadowNode",n,null),yt(n)||(n.content instanceof o&&e(n.content),wt(n));gt("afterSanitizeShadowDOM",t,null)};return t.sanitize=function(r,i){var a=void 0,l=void 0,u=void 0,c=void 0,p=void 0;if((Ye=!r)&&(r="\x3c!--\x3e"),"string"!=typeof r&&!vt(r)){if("function"!=typeof r.toString)throw k("toString is not a function");if("string"!=typeof(r=r.toString()))throw k("dirty is not a string, aborting")}if(!t.isSupported){if("object"===W(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof r)return e.toStaticHTML(r);if(vt(r))return e.toStaticHTML(r.outerHTML)}return r}if(Oe||it(i),t.removed=[],"string"==typeof r&&(je=!1),je);else if(r instanceof s)1===(l=(a=ft("\x3c!----\x3e")).ownerDocument.importNode(r,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!Re&&!Ae&&!De&&-1===r.indexOf("<"))return oe&&Be?oe.createHTML(r):r;if(!(a=ft(r)))return Re?null:ie}a&&Ie&&pt(a.firstChild);for(var d=ht(je?r:a);u=d.nextNode();)3===u.nodeType&&u===c||yt(u)||(u.content instanceof o&&kt(u.content),wt(u),c=u);if(c=null,je)return r;if(Re){if(Pe)for(p=ue.call(a.ownerDocument);a.firstChild;)p.appendChild(a.firstChild);else p=a;return He&&(p=pe.call(n,p,!0)),p}var f=De?a.outerHTML:a.innerHTML;return Ae&&(f=g(f,he," "),f=g(f,me," ")),oe&&Be?oe.createHTML(f):f},t.setConfig=function(e){it(e),Oe=!0},t.clearConfig=function(){rt=null,Oe=!1},t.isValidAttribute=function(e,t,n){rt||it({});var r=nt(e),o=nt(t);return bt(r,o,n)},t.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],h(fe[e],t))},t.removeHook=function(e){fe[e]&&f(fe[e])},t.removeHooks=function(e){fe[e]&&(fe[e]=[])},t.removeAllHooks=function(){fe={}},t}return Z()}()},928:function(e,t,n){"use strict";var r=n(322);e.exports=function(e,t,n){var o,i;if(n=n||0,!r(t))return-1;if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e,n);for(i=t.length,o=n;n>=0&&o<i;o+=1)if(t[o]===e)return o;return-1}},690:function(e,t,n){"use strict";var r=n(322),o=n(893),i=n(956);e.exports=function(e,t,n){r(e)?o(e,t,n):i(e,t,n)}},893:function(e){"use strict";e.exports=function(e,t,n){var r=0,o=e.length;for(n=n||null;r<o&&!1!==t.call(n,e[r],r,e);r+=1);}},956:function(e){"use strict";e.exports=function(e,t,n){var r;for(r in n=n||null,e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))break}},990:function(e,t,n){"use strict";var r=n(893);e.exports=function(e){var t;try{t=Array.prototype.slice.call(e)}catch(n){t=[],r(e,(function(e){t.push(e)}))}return t}},755:function(e){"use strict";var t="_feEventKey";e.exports=function(e,n){var r,o=e[t];return o||(o=e[t]={}),(r=o[n])||(r=o[n]=[]),r}},349:function(e,t,n){"use strict";var r=n(758),o=n(690),i=n(755);function a(e,t,n){var r,a=i(e,t);n?(o(a,(function(o,i){return n!==o.handler||(s(e,t,o.wrappedHandler),r=i,!1)})),a.splice(r,1)):(o(a,(function(n){s(e,t,n.wrappedHandler)})),a.splice(0,a.length))}function s(e,t,n){"removeEventListener"in e?e.removeEventListener(t,n):"detachEvent"in e&&e.detachEvent("on"+t,n)}e.exports=function(e,t,n){r(t)?o(t.split(/\s+/g),(function(t){a(e,t,n)})):o(t,(function(t,n){a(e,n,t)}))}},348:function(e,t,n){"use strict";var r=n(758),o=n(690),i=n(755);function a(e,t,n,r){function a(t){n.call(r||e,t||window.event)}"addEventListener"in e?e.addEventListener(t,a):"attachEvent"in e&&e.attachEvent("on"+t,a),function(e,t,n,r){var a=i(e,t),s=!1;o(a,(function(e){return e.handler!==n||(s=!0,!1)})),s||a.push({handler:n,wrappedHandler:r})}(e,t,n,a)}e.exports=function(e,t,n,i){r(t)?o(t.split(/\s+/g),(function(t){a(e,t,n,i)})):o(t,(function(t,r){a(e,r,t,n)}))}},24:function(e,t,n){"use strict";var r=n(322),o=n(929);e.exports=function(e,t){t=(t=r(t)?t.join(" "):t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),o(e.className.baseVal)?e.className=t:e.className.baseVal=t}},204:function(e,t,n){"use strict";var r=n(690),o=n(928),i=n(902),a=n(24);e.exports=function(e){var t,n=Array.prototype.slice.call(arguments,1),s=e.classList,l=[];s?r(n,(function(t){e.classList.add(t)})):((t=i(e))&&(n=[].concat(t.split(/\s+/),n)),r(n,(function(e){o(e,l)<0&&l.push(e)})),a(e,l))}},522:function(e,t,n){"use strict";var r=n(758),o=n(690);e.exports=function(e,t,n){var i=e.style;r(t)?i[t]=n:o(t,(function(e,t){i[t]=e}))}},902:function(e,t,n){"use strict";var r=n(929);e.exports=function(e){return e&&e.className?r(e.className.baseVal)?e.className:e.className.baseVal:""}},714:function(e,t,n){"use strict";var r=n(928),o=n(902);e.exports=function(e,t){var n;return e.classList?e.classList.contains(t):(n=o(e).split(/\s+/),r(t,n)>-1)}},471:function(e,t,n){"use strict";var r=n(928),o=n(990),i=Element.prototype,a=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(e){var t=this.document||this.ownerDocument;return r(this,o(t.querySelectorAll(e)))>-1};e.exports=function(e,t){return a.call(e,t)}},462:function(e,t,n){"use strict";var r=n(893),o=n(928),i=n(902),a=n(24);e.exports=function(e){var t,n,s=Array.prototype.slice.call(arguments,1),l=e.classList;l?r(s,(function(e){l.remove(e)})):(t=i(e).split(/\s+/),n=[],r(t,(function(e){o(e,s)<0&&n.push(e)})),a(e,n))}},969:function(e){"use strict";e.exports=function(e,t){var n,r,o,i,a=Object.prototype.hasOwnProperty;for(o=1,i=arguments.length;o<i;o+=1)for(r in n=arguments[o])a.call(n,r)&&(e[r]=n[r]);return e}},254:function(e,t,n){"use strict";var r=n(956);e.exports=function(e,t){var n=document.createElement("img"),o="";return r(t,(function(e,t){o+="&"+t+"="+e})),o=o.substring(1),n.src=e+"?"+o,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}},391:function(e,t,n){"use strict";var r=n(929),o=n(254);e.exports=function(e,t){var n=location.hostname,i="TOAST UI "+e+" for "+n+": Statistics",a=window.localStorage.getItem(i);(r(window.tui)||!1!==window.tui.usageStatistics)&&(a&&!function(e){return(new Date).getTime()-e>6048e5}(a)||(window.localStorage.setItem(i,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||o("https://www.google-analytics.com/collect",{v:1,t:"event",tid:t,cid:n,dp:n,dh:e,el:e,ec:"use"})}),1e3)))}},516:function(e){"use strict";e.exports=function(e,t){var n,r;return t=t||0,function(){r=Array.prototype.slice.call(arguments),window.clearTimeout(n),n=window.setTimeout((function(){e.apply(null,r)}),t)}}},423:function(e,t,n){"use strict";var r=n(516);e.exports=function(e,t){var n,o,i,a,s=!0,l=function(t){e.apply(null,t),n=null};function u(){if(a=Array.prototype.slice.call(arguments),s)return l(a),void(s=!1);i=Number(new Date),n=n||i,o(a),i-n>=t&&l(a)}return o=r(l,t=t||0),u.reset=function(){s=!0,n=null},u}},322:function(e){"use strict";e.exports=function(e){return e instanceof Array}},326:function(e){"use strict";e.exports=function(e){return"boolean"==typeof e||e instanceof Boolean}},65:function(e,t,n){"use strict";var r=n(929),o=n(934);e.exports=function(e){return!r(e)&&!o(e)}},404:function(e,t,n){"use strict";var r=n(790);e.exports=function(e){return!r(e)}},294:function(e){"use strict";e.exports=function(e){return e instanceof Function}},934:function(e){"use strict";e.exports=function(e){return null===e}},321:function(e){"use strict";e.exports=function(e){return"number"==typeof e||e instanceof Number}},73:function(e){"use strict";e.exports=function(e){return e===Object(e)}},758:function(e){"use strict";e.exports=function(e){return"string"==typeof e||e instanceof String}},790:function(e,t,n){"use strict";var r=n(65);e.exports=function(e){return r(e)&&!1!==e}},929:function(e){"use strict";e.exports=function(e){return void 0===e}},695:function(t){"use strict";t.exports=e},412:function(e){"use strict";e.exports=t},479:function(e){"use strict";e.exports=n},481:function(e){"use strict";e.exports=r},43:function(e){"use strict";e.exports=o},814:function(e){"use strict";e.exports=i},785:function(e){"use strict";e.exports=a},311:function(e){"use strict";e.exports=s}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return l[e].call(n.exports,n,n.exports,c),n.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var p={};return function(){"use strict";c.d(p,{default:function(){return Yp}});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.create;function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}Object.create;var i=c(43),a=c(956),s=c.n(a),l=c(969),u=c.n(l),d=c(522),f=c.n(d),h=c(204),m=c.n(h),v=c(462),g=c.n(v),y=c(758),b=c.n(y),w=c(321),k=c.n(w),x=c(929),C=c.n(x),T=c(934),E=c.n(T),M=c(391),L=c.n(M),N=(/Mac/.test(navigator.platform),/[\u0020]+/g),S=/[>(){}[\]+-.!#|]/g,A=/<([a-zA-Z_][a-zA-Z0-9\-._]*)(\s|[^\\>])*\/?>|<(\/)([a-zA-Z_][a-zA-Z0-9\-._]*)\s*\/?>|<!--[^-]+-->|<([a-zA-Z_][a-zA-Z0-9\-.:/]*)>/g,D=/\\[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~\\]/g,O=/[*_~`]/g,I=/!\[.*\]\(.*\)/g,R=/[[\]]/g,P=/(?:^|[^\\])\\(?!\\)/g,H=new RegExp('[&<>"]',"g");function B(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}}function F(e){return H.test(e)?e.replace(H,B):e}function q(e,t){return-1!==e.indexOf(t)}var j=["rel","target","hreflang","type"],_={codeblock:/(^ {4}[^\n]+\n*)+/,thematicBreak:/^ *((\* *){3,}|(- *){3,} *|(_ *){3,}) */,atxHeading:/^(#{1,6}) +[\s\S]+/,seTextheading:/^([^\n]+)\n *(=|-){2,} */,blockquote:/^( *>[^\n]+.*)+/,list:/^ *(\*+|-+|\d+\.) [\s\S]+/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? */,link:/!?\[.*\]\(.*\)/,reflink:/!?\[.*\]\s*\[([^\]]*)\]/,verticalBar:/\u007C/,fencedCodeblock:/^((`|~){3,})/};function U(e){if(!e)return null;var t={};return j.forEach((function(n){C()(e[n])||(t[n]=e[n])})),t}function z(e,t){for(var n="",r=0;r<t;r+=1)n+=e;return n}function V(e){for(var t=[],n=I.exec(e);n;)t.push([n.index,n.index+n[0].length]),n=I.exec(e);return e.replace(R,(function(e,n){var r=t.some((function(e){return n>e[0]&&n<e[1]}));return r?e:"\\"+e}))}function W(e){var t=function(e){return"\\"+e},n=e.replace(N," ");return D.test(n)&&(n=n.replace(D,t)),P.test(n)&&(n=n.replace(P,(function(e){return e+"\\"}))),n=n.replace(O,t),A.test(n)&&(n=n.replace(A,t)),function(e){var t=!1;return s()(_,(function(n){return n.test(e)&&(t=!0),!t})),t}(n)&&(n=n.replace(S,t)),n}function $(e){return E()(e)||C()(e)}function G(e,t){if(null===e&&e===t)return!0;if("object"!=typeof e||"object"!=typeof t||$(e)||$(t))return e===t;for(var n in e)if(e[n]!==t[n])return!1;for(var n in t)if(!(n in e))return!1;return!0}function X(e){return e[e.length-1]}function Z(e){return"object"==typeof e&&null!==e}function K(e,t){var r=n({},e);return e&&t&&Object.keys(t).forEach((function(e){Z(r[e])?Array.isArray(t[e])?r[e]=Q(t[e]):r.hasOwnProperty(e)?r[e]=K(r[e],t[e]):r[e]=Y(t[e]):r[e]=t[e]})),r}function Q(e){return e.map((function(e){return Z(e)?Array.isArray(e)?Q(e):Y(e):e}))}function Y(e){var t=Object.keys(e);return t.length?t.reduce((function(t,n){return Z(e[n])?t[n]=Array.isArray(e[n])?Q(e[n]):Y(e[n]):t[n]=e[n],t}),{}):e}function J(e,t){return void 0===t&&(t={}),Object.keys(t).forEach((function(n){e.hasOwnProperty(n)&&"object"==typeof e[n]?Array.isArray(t[n])?e[n]=t[n]:J(e[n],t[n]):e[n]=t[n]})),e}function ee(e,t){return e>t?[t,e]:[e,t]}var te=c(311),ne=c(785),re=c(990),oe=c.n(re),ie=c(814),ae=c(481),se=c(695),le=c(479),ue=c(412);function ce(e,t){var n=e.nodes.paragraph;return t?n.create(null,b()(t)?e.text(t):t):n.createAndFill()}function pe(e,t,n){return e.text(t,n)}function de(e,t,n){void 0===n&&(n=t);var r=e.doc.content.size,o=r>0?r-1:1;return ie.TextSelection.create(e.doc,Math.min(t,o),Math.min(n,o))}function fe(e,t,n){var r=t.pos;return e.replaceWith(r,r,ce(n)),e.setSelection(de(e,r+1))}function he(e){for(var t=e.state,n=e.from,r=e.startIndex,o=e.endIndex,a=e.createText,s=t.tr,l=t.doc,u=t.schema,c=r;c<=o;c+=1){var p=l.child(c),d=p.nodeSize,f=p.textContent,h=p.content,m=a(f),v=m?pe(u,m):i.Fragment.empty,g=s.mapping.map(n),y=g+h.size;s.replaceWith(g,y,v),n+=d}return s}function me(e,t,n,r){var o=n.length;e.split(t).delete(t-o,t).insert(e.mapping.map(t),r).setSelection(de(e,e.mapping.map(t)-o))}function ve(e){return e.sourcepos[0][0]}function ge(e){return e.sourcepos[1][0]}function ye(e){return e.sourcepos[0][1]}function be(e){return e.sourcepos[1][1]}function we(e){var t=e.type;return"strike"===t||"strong"===t||"emph"===t||"code"===t||"link"===t||"image"===t}function ke(e){return e&&("item"===e.type||"list"===e.type)}function xe(e){return ke(e)&&"ordered"===e.listData.type}function Ce(e){return ke(e)&&"ordered"!==e.listData.type}function Te(e){return e&&("tableCell"===e.type||"tableDelimCell"===e.type)}function Ee(e,t,n){for(void 0===n&&(n=!0),e=n?e:e.parent;e&&"document"!==e.type;){if(t(e))return e;e=e.parent}return null}function Me(e,t){return[e[0],e[1]+t]}function Le(e,t){return[e[0],t]}function Ne(e){var t=e.firstChild.literal;switch(e.type){case"emph":return"*"+t+"*";case"strong":return"**"+t+"**";case"strike":return"~~"+t+"~~";case"code":return"`"+t+"`";case"link":case"image":var n=e,r=n.destination,o=n.title;return("link"===e.type?"":"!")+"["+t+"]("+r+(o?' "'+o+'"':"")+")";default:return null}}function Se(e){switch(e.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}function Ae(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var o=r.node;"text"===o.type&&t.push(o.literal)}return t.join("")}var De=[],Oe={},Ie=/\$\$widget\d+\s/;function Re(e){var t=e.search(Ie);if(-1!==t){var n=e.substring(t).replace(Ie,"").replace("$$","");e=e.substring(0,t),e+=Re(n)}return e}function Pe(e,t){return"$$"+e+" "+t+"$$"}function He(e,t){var n=Oe[e],r=n.rule,o=n.toDOM,i=Re(t).match(r);return i&&(t=i[0]),o(t)}function Be(){return De}function Fe(e){(De=e).forEach((function(e,t){Oe["widget"+t]=e}))}function qe(e,t,n,r){return e.concat(je(t,n,r))}function je(e,t,n){void 0===n&&(n=0);var r=[],o=(De[n]||{}).rule,i=n+1;if(e=Re(e),o&&o.test(e)){for(var a=void 0;-1!==(a=e.search(o));){var s=e.substring(0,a);s&&(r=qe(r,s,t,i));var l=(e=e.substring(a)).match(o)[0],u="widget"+n;r.push(t.nodes.widget.create({info:u},t.text(Pe(u,l)))),e=e.substring(l.length)}e&&(r=qe(r,e,t,i))}else e&&(r=n<De.length-1?qe(r,e,t,i):[t.text(e)]);return r}function _e(e){for(var t,n="",r=e.walker();t=r.next();){var o=t.node;t.entering&&(o!==e&&"text"!==o.type?(n+=Ne(o),r.resumeAt(e,!1),r.next()):"text"===o.type&&(n+=o.literal))}return n}function Ue(){return{deleteSelection:function(){return se.deleteSelection},selectAll:function(){return se.selectAll},undo:function(){return ue.undo},redo:function(){return ue.redo}}}var ze=c(322),Ve=c.n(ze),We=c(714),$e=c.n(We),Ge=c(471),Xe=c.n(Ge),Ze="[A-Za-z][A-Za-z0-9-]*",Ke="(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)",Qe="<("+Ze+")("+Ke+")*\\s*/?>",Ye="(?:"+Qe+"|"+("</("+Ze+")\\s*[>]")+")",Je=new RegExp("^"+Ye,"i"),et=/<br\s*\/*>/i,tt=/<! ---->|<!--(?:-?[^>-])(?:-?[^-])*-->/,nt="</p><p>";function rt(e,t,n){var r=parseInt(e.left,10),o=parseInt(e.top,10),i=parseInt(e.width,10)+parseInt(e.paddingLeft,10)+parseInt(e.paddingRight,10),a=parseInt(e.height,10)+parseInt(e.paddingTop,10)+parseInt(e.paddingBottom,10);return t>=r&&t<=r+i&&n>=o&&n<=o+a}var ot="toastui-editor-";function it(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r],a=void 0;(a=Array.isArray(i)?i[0]?i[1]:null:i)&&n.push(""+ot+a)}return n.join(" ")}function at(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.map((function(e){return ot+"md-"+e})).join(" ")}function st(e){return e&&e.nodeType===Node.ELEMENT_NODE}function lt(e){e.parentNode&&e.parentNode.removeChild(e)}function ut(e,t,n){C()(n)&&(n=!$e()(e,t)),(n?m():g())(e,t)}function ct(e,t){var n=document.createElement("div");b()(e)?n.innerHTML=e:n.appendChild(e);var r=n.firstChild;return t&&t.appendChild(r),r}function pt(e){var t=window.getComputedStyle(e);return["margin-left","margin-right"].reduce((function(e,n){return e+parseInt(t.getPropertyValue(n),10)}),0)+e.offsetWidth}function dt(e,t){var n;for(n=b()(t)?function(e){return Xe()(e,t)}:function(e){return e===t};e&&e!==document;){if(st(e)&&n(e))return e;e=e.parentNode}return null}function ft(e,t){for(var n=0,r=0;e&&e!==t;){if(n+=e.offsetTop,r+=e.offsetLeft,e.offsetParent===t.offsetParent)break;e=e.offsetParent}return{offsetTop:n,offsetLeft:r}}function ht(e,t){Object.keys(e).forEach((function(n){$(e[n])?t.removeAttribute(n):t.setAttribute(n,e[n])}))}function mt(e){var t=e;return t=(t=t.replace(/<img class="ProseMirror-separator" alt="">/g,"")).replace(/ class="ProseMirror-trailingBreak"/g,"")}var vt=new ie.PluginKey("widget"),gt=function(){function e(e,t){var n=this;this.popup=null,this.removeWidget=function(){n.popup&&(n.rootEl.removeChild(n.popup),n.popup=null)},this.rootEl=e.dom.parentElement,this.eventEmitter=t,this.eventEmitter.listen("blur",this.removeWidget),this.eventEmitter.listen("loadUI",(function(){n.rootEl=dt(e.dom.parentElement,"."+it("defaultUI"))})),this.eventEmitter.listen("removePopupWidget",this.removeWidget)}return e.prototype.update=function(e){var t=vt.getState(e.state);if(this.removeWidget(),t){var n=t.node,r=t.style,o=e.coordsAtPos(t.pos),i=o.top,a=o.left,s=o.bottom-i,l=this.rootEl.getBoundingClientRect(),u=i-l.top;f()(n,{opacity:"0"}),this.rootEl.appendChild(n),f()(n,{position:"absolute",left:a-l.left+5+"px",top:("bottom"===r?u+s-5:u-s)+"px",opacity:"1"}),this.popup=n,e.focus()}},e.prototype.destroy=function(){this.eventEmitter.removeEventHandler("blur",this.removeWidget)},e}();function yt(e){return new ie.Plugin({key:vt,state:{init:function(){return null},apply:function(e){return e.getMeta("widget")}},view:function(t){return new gt(t,e)}})}var bt=c(893),wt=c.n(bt);function kt(e,t,n){e.emit("addImageBlobHook",t,(function(n,r){e.emit("command","addImage",{imageUrl:n,altText:r||t.name||"image"})}),n)}function xt(e){var t=oe()(e).filter((function(e){return-1!==e.type.indexOf("image")}));if(1===t.length){var n=t[0];if(n)return n.getAsFile()}return null}function Ct(e){var t=e.eventEmitter;return new ie.Plugin({props:{handleDOMEvents:{drop:function(e,n){var r,o=null===(r=n.dataTransfer)||void 0===r?void 0:r.files;return o&&wt()(o,(function(e){return-1===e.type.indexOf("image")||(n.preventDefault(),n.stopPropagation(),kt(t,e,n.type),!1)})),!0}}}})}var Tt=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"node"},enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function Et(e){var t=document.createElement("span"),n=He(e.attrs.info,e.textContent);return t.className="tui-widget",t.appendChild(n),{dom:t}}function Mt(e){return"widget"===e.type.name}var Lt=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"widget"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{attrs:{info:{default:null}},group:"inline",inline:!0,content:"text*",selectable:!1,atom:!0,toDOM:function(){return["span",{class:"tui-widget"},0]},parseDOM:[{tag:"span.tui-widget",getAttrs:function(e){return{info:e.textContent.match(/\$\$(widget\d+)/)[1]}}}]}},enumerable:!1,configurable:!0}),n}(Tt),Nt=function(){function e(e){this.timer=null,this.el=document.createElement("div"),this.el.className="toastui-editor",this.eventEmitter=e,this.placeholder={text:""}}return e.prototype.createState=function(){return ie.EditorState.create({schema:this.schema,plugins:this.createPlugins()})},e.prototype.initEvent=function(){var e=this,t=e.eventEmitter,n=e.view,r=e.editorType;n.dom.addEventListener("focus",(function(){return t.emit("focus",r)})),n.dom.addEventListener("blur",(function(){return t.emit("blur",r)}))},e.prototype.emitChangeEvent=function(e){this.eventEmitter.emit("caretChange",this.editorType),e.docChanged&&this.eventEmitter.emit("change",this.editorType)},Object.defineProperty(e.prototype,"defaultPlugins",{get:function(){var e,t=this.createInputRules(),o=r(r([],this.keymaps),[(0,ae.keymap)(n({"Shift-Enter":se.baseKeymap.Enter},se.baseKeymap)),(0,ue.history)(),(e=this.placeholder,new ie.Plugin({props:{decorations:function(t){var n=t.doc;if(e.text&&1===n.childCount&&n.firstChild.isTextblock&&0===n.firstChild.content.size){var r=document.createElement("span");return m()(r,"placeholder"),e.className&&m()(r,e.className),r.textContent=e.text,te.DecorationSet.create(n,[te.Decoration.widget(1,r)])}return null}}})),yt(this.eventEmitter),Ct(this.context)]);return t?o.concat(t):o},enumerable:!1,configurable:!0}),e.prototype.createInputRules=function(){var e=Be().map((function(e){var t=e.rule;return new le.InputRule(t,(function(e,n,r,o){var i=e.schema,a=e.tr,s=e.doc,l=n.input.match(new RegExp(t,"g")),u=s.resolve(r),c=u.parent,p=0;if(Mt(c)&&(c=u.node(u.depth-1)),c.forEach((function(e){return Mt(e)&&(p+=1)})),l.length>p){var d=X(l),f=je(d,i);return a.replaceWith(o-d.length+1,o,f)}return null}))}));return e.length?(0,le.inputRules)({rules:e}):null},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.createSchema=function(){return new i.Schema({nodes:this.specs.nodes,marks:this.specs.marks})},e.prototype.createKeymaps=function(e){var t=Ue(),n=t.undo,r=t.redo,o=this.specs.keymaps(e),i={"Mod-z":n(),"Shift-Mod-z":r()};return e?o.concat((0,ae.keymap)(i)):o},e.prototype.createCommands=function(){return this.specs.commands(this.view)},e.prototype.createPluginProps=function(){var e=this;return this.extraPlugins.map((function(t){return t(e.eventEmitter)}))},e.prototype.focus=function(){var e=this;this.clearTimer(),this.timer=setTimeout((function(){e.view.focus(),e.view.dispatch(e.view.state.tr.scrollIntoView())}))},e.prototype.blur=function(){this.view.dom.blur()},e.prototype.destroy=function(){var e=this;this.clearTimer(),this.view.destroy(),Object.keys(this).forEach((function(t){delete e[t]}))},e.prototype.moveCursorToStart=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(de(t,1)).scrollIntoView()),e&&this.focus()},e.prototype.moveCursorToEnd=function(e){var t=this.view.state.tr;this.view.dispatch(t.setSelection(de(t,t.doc.content.size-1)).scrollIntoView()),e&&this.focus()},e.prototype.setScrollTop=function(e){this.view.dom.scrollTop=e},e.prototype.getScrollTop=function(){return this.view.dom.scrollTop},e.prototype.setPlaceholder=function(e){this.placeholder.text=e,this.view.dispatch(this.view.state.tr.scrollIntoView())},e.prototype.setHeight=function(e){f()(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){f()(this.el,{minHeight:e+"px"})},e.prototype.getElement=function(){return this.el},e}(),St=Nt,At=c(294),Dt=c.n(At),Ot=["Enter","Shift-Enter","Mod-Enter","Tab","Shift-Tab","Delete","Backspace","Mod-Delete","Mod-Backspace","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Mod-d","Mod-D","Alt-ArrowUp","Alt-ArrowDown"];function It(e,t,n){return e.focus(),t(n)(e.state,e.dispatch,e)}var Rt=function(){function e(e){this.specs=e}return Object.defineProperty(e.prototype,"nodes",{get:function(){return this.specs.filter((function(e){return"node"===e.type})).reduce((function(e,t){var r,o=t.name,i=t.schema;return n(n({},e),((r={})[o]=i,r))}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"marks",{get:function(){return this.specs.filter((function(e){return"mark"===e.type})).reduce((function(e,t){var r,o=t.name,i=t.schema;return n(n({},e),((r={})[o]=i,r))}),{})},enumerable:!1,configurable:!0}),e.prototype.commands=function(e,t){var r=this.specs.filter((function(e){return e.commands})).reduce((function(t,r){var o={},i=r.commands();return Dt()(i)?o[r.name]=function(t){return It(e,i,t)}:Object.keys(i).forEach((function(t){o[t]=function(n){return It(e,i[t],n)}})),n(n({},t),o)}),{}),o=Ue();return Object.keys(o).forEach((function(t){r[t]=function(n){return It(e,o[t],n)}})),t&&Object.keys(t).forEach((function(n){r[n]=function(r){return It(e,t[n],r)}})),r},e.prototype.keymaps=function(e){return this.specs.filter((function(e){return e.keymaps})).map((function(e){return e.keymaps()})).map((function(t){return e||Object.keys(t).forEach((function(e){q(Ot,e)||delete t[e]})),(0,ae.keymap)(t)}))},e.prototype.setContext=function(e){this.specs.forEach((function(t){t.setContext(e)}))},e}();function Pt(e){var t=e.from,n=e.to;return e instanceof ie.AllSelection?[t+1,n-1]:[t,n]}function Ht(e){return e.index(0)+1}function Bt(e,t,n){void 0===n&&(n=1);var r=0;return e.forEach((function(e,o){Mt(e)&&o+2<t&&(r+=2*n)})),r}function Ft(e,t,n){void 0===n&&(n=t);var r=t===n,o=e.resolve(t),i=Ht(o),a=i,s=o.start(1),l=s;if(!r){var u=e.resolve(n===e.content.size?n-1:n);l=u.start(1),a=Ht(u),u.pos===e.content.size&&(n=e.content.size-2)}var c=Math.max(t-s+1,1),p=Math.max(n-l+1,1);return[[i,c+Bt(e.child(i-1),c,-1)],[a,p+Bt(e.child(a-1),p,-1)]]}function qt(e,t){for(var n=[],r=0,o=0;r<t;r+=1){var i=e.child(r);n[r]=o,o+=i.nodeSize}return n}function jt(e,t,n){var r=qt(e,n[0]),o=t[0]-1,i=n[0]-1,a=e.child(o),s=e.child(i),l=r[o],u=r[i];return l+=t[1]+Bt(a,t[1]-1),u+=n[1]+Bt(s,n[1]-1),[l,Math.min(u,e.content.size)]}function _t(e){var t=e.$from,n=e.$to,r=e.from,o=e.to,i=t.doc;return e instanceof ie.AllSelection&&(t=i.resolve(r+1),n=i.resolve(o-1)),0===t.depth&&(n=t=i.resolve(r-1)),{startFromOffset:t.start(1),endFromOffset:n.start(1),startToOffset:t.end(1),endToOffset:n.end(1),startIndex:t.index(0),endIndex:n.index(0),from:t.pos,to:n.pos}}function Ut(e,t){for(var n=1,r=1,o=0,i=0;o<e.childCount;o+=1){var a=e.child(o).nodeSize;if(n=i+1,r=i+a-1,o===t)break;i+=a}return{startOffset:n,endOffset:r}}var zt="heading",Vt="link",Wt="code",$t="meta",Gt="delimiter",Xt="markedText",Zt={strong:2,emph:1,strike:2};function Kt(e,t,n,r){return{start:e,end:t,spec:{type:n,attrs:r}}}function Qt(e,t,n){var r=e.type,o=Me(t,Zt[r]),i=Me(n,-Zt[r]);return[Kt(o,i,r),Kt(t,o,Gt),Kt(i,n,Gt)]}function Yt(e,t,n,r){return[Kt(e,t,Vt),Kt(Le(e,n[1]+1),Le(t,r),Vt,{desc:!0}),Kt(Le(t,r+2),Me(t,-1),Vt,{url:!0})]}function Jt(e,t,r,o){var i={start:t,end:r,spec:{attrs:{className:o+"-line-background",codeStart:t[0],codeEnd:r[0]}},lineBackground:!0};return"item"!==e.type&&"blockQuote"!==e.type?[n(n({},i),{end:t,spec:{attrs:{className:o+"-line-background start"}}}),n(n({},i),{start:[Math.min(t[0]+1,r[0]),t[1]]})]:null}function en(e,t){for(var n=[];e;){var r=e.type;"paragraph"!==r&&"codeBlock"!==r||n.push(Kt([ve(e),ye(e)-1],[ge(e),be(e)+1],t)),e=e.next}return n}var tn={heading:function(e,t,n){var r=e.level,o=e.headingType,i=[Kt(t,n,zt,{level:r})];return"atx"===o?i.push(Kt(t,Me(t,r),Gt)):i.push(Kt(Le(n,0),n,zt,{seText:!0})),i},strong:Qt,emph:Qt,strike:Qt,link:function(e,t,n){var r=e.lastChild,o=e.extendedAutolink,i=r?be(r)+1:2;return o?[Kt(t,n,Vt,{desc:!0})]:Yt(t,n,t,i)},image:function(e,t,n){var o=e.lastChild,i=o?be(o)+1:3,a=Me(t,1);return r([Kt(t,a,$t)],Yt(t,n,a,i))},code:function(e,t,n){var r=e.tickCount,o=Me(t,r),i=Me(n,-r);return[Kt(t,n,Wt),Kt(t,o,Wt,{start:!0}),Kt(o,i,Wt,{marked:!0}),Kt(i,n,Wt,{end:!0})]},codeBlock:function(e,t,n,r){var o=e.fenceOffset,i=e.fenceLength,a=e.fenceChar,s=e.info,l=e.infoPadding,u=e.parent,c=o+i,p=[Kt(Le(t,1),n,"codeBlock")];a&&p.push(Kt(t,Me(t,c),Gt)),s&&p.push(Kt(Me(t,i),Me(t,i+l+s.length),$t)),new RegExp("^(\\s{0,4})("+a+"{"+i+",})").test(r)&&p.push(Kt(Le(n,1),n,Gt));var d=Jt(u,t,n,"code-block");return d?p.concat(d):p},blockQuote:function(e,t,n){var o=e.parent&&"blockQuote"!==e.parent.type?[Kt(t,n,"blockQuote")]:[];if(e.firstChild){var i=[];"paragraph"===e.firstChild.type?i=function(e){for(var t=[];e;)t.push(Kt([ve(e),ye(e)],[ge(e),be(e)+1],Xt)),e=e.next;return t}(e.firstChild.firstChild):"list"===e.firstChild.type&&(i=en(e.firstChild,Xt)),o=r(r([],o),i)}return o},item:function(e,t){var o=e.listData,i=o.padding,a=o.task,s=function(e){for(var t=0;e.parent.parent&&"item"===e.parent.parent.type;)e=e.parent.parent,t+=1;return["listItem",n(n({},[{odd:!0},{even:!0}][t%2]),{listStyle:!0})]}(e),l=[Kt.apply(void 0,r([t,Me(t,i)],s))];return a&&(l.push(Kt(Me(t,i),Me(t,i+3),"taskDelimiter")),l.push(Kt(Me(t,i+1),Me(t,i+2),$t))),l.concat(en(e.firstChild,Xt))},customBlock:function(e,t,n){var r=e,o=r.offset,i=r.syntaxLength,a=r.info,s=r.parent,l=o+i,u=[Kt(Le(t,1),n,"customBlock")];u.push(Kt(t,Me(t,l),Gt)),a&&u.push(Kt(Me(t,l),Me(t,i+a.length),$t)),u.push(Kt(Le(n,1),n,Gt));var c=Jt(s,t,n,"custom-block");return c?u.concat(c):u}},nn={thematicBreak:"thematicBreak",table:"table",tableCell:"tableCell",htmlInline:"html"};function rn(e,t,n,r){var o=e.type;return Dt()(tn[o])?tn[o](e,t,n,r):nn[o]?[Kt(t,n,nn[o])]:null}var on={};function an(e){var t=e.schema,n=e.toastMark;return new ie.Plugin({appendTransaction:function(e,r,o){var i=e[0],a=o.tr;if(i.docChanged){var s=[];i.getMeta("editResult").forEach((function(e){var t=e.nodes,r=e.removedNodeRange;if(t.length){s=s.concat(function(e,t){var n=e.doc,r=t[0].sourcepos[0],o=X(t).sourcepos,i=o[1],a=[r[0],r[1]],s=[i[0],i[1]+1],l=[];return function(e,t,n){var r=[];on={};for(var o=t[0]-1;o<n[0];o+=1){var i=e.child(o),a=i.attrs.codeEnd,s=i.attrs.codeStart;if(s&&a&&!q(r,s)){r.push(s),a=Math.min(a,e.childCount);for(var l=s-1,u=n[0],c=l;c<u;c+=1)on[c]=!0}}}(n,r,i),l.push({start:a,end:s}),l}(a,t));for(var o=0,i=t;o<i.length;o++)for(var l=i[o].walker(),u=l.next();u;){var c=u.node;u.entering&&(s=s.concat(ln(c,n))),u=l.next()}}else if(r)for(var p=a.doc.childCount-1,d=r.line,f=d[0],h=d[1],m=Math.min(f,p),v=Math.min(h,p),g=m;g<=v;g+=1)on[g]=!0})),function(e,t,n){var r=e.doc,o=t.nodes.paragraph,i=qt(r,r.childCount);n.forEach((function(n){var a=n.start,s=n.end,l=n.spec,u=n.lineBackground,c=Math.min(a[0],r.childCount)-1,p=Math.min(s[0],r.childCount)-1,d=r.child(c),f=r.child(p),h=i[c],m=i[p];(h+=a[1]+Bt(d,a[1]-1),m+=s[1]+Bt(f,s[1]-1),l)?u?function(e,t,n,r,o){void 0===o&&(o={});for(var i=r.startIndex,a=r.endIndex,s=r.from,l=r.to,u=!1,c=i;c<=a;c+=1)delete on[c],u=sn(t,c,o);u&&e.setBlockType(s,l,n,o)}(e,r,o,{from:h,to:m,startIndex:c,endIndex:p},l.attrs):e.addMark(h,m,t.mark(l.type,l.attrs)):e.removeMark(h,m)})),function(e,t,n){Object.keys(on).forEach((function(r){var o=Number(r),i=Math.min(Number(r)+1,e.doc.childCount-1),a=t[o],s=t[i]-1;o===i&&(s+=2),e.setBlockType(a,s,n)}))}(e,i,o)}(a,t,s)}return a.setMeta("widget",i.getMeta("widget"))}})}function sn(e,t,n){return Object.keys(n).some((function(r){return n[r]!==e.child(t).attrs[r]}))}function ln(e,t){var n=t.getLineTexts(),r=[ve(e),ye(e)],o=[ge(e),be(e)+1],i=rn(e,r,o,n[o[0]-1]);return null!=i?i:[]}var un=["taskList","orderedList","bulletList","table","strong","emph","strike","heading","thematicBreak","blockQuote","code","codeBlock","indent","outdent"];function cn(e){var t={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}},n=!0;return function(e,t,n){for(void 0===n&&(n=!0),e=n?e:e.parent;e&&"document"!==e.type;)t(e),e=e.parent}(e,(function(e){var r=function(e){var t=e.type;return ke(e)?e.listData.task?"taskList":"ordered"===e.listData.type?"orderedList":"bulletList":-1!==t.indexOf("table")?"table":q(un,t)?t:null}(e);r&&("bulletList"===r||"orderedList"===r?n&&(t[r]={active:!0},t.indent.disabled=!1,t.outdent.disabled=!1,n=!1):t[r]={active:!0})})),t}function pn(e){var t=e.toastMark,n=e.eventEmitter;return new ie.Plugin({view:function(){return{update:function(e,r){var o=e.state,i=o.doc,a=o.selection;if(!(r&&r.doc.eq(i)&&r.selection.eq(a))){var s=a.from,l=o.doc.resolve(s).start(),u=s-l;s===l&&(u+=1);var c=[o.doc.content.findIndex(s).index+1,u],p=t.findNodeAtPosition(c),d=cn(p);n.emit("changeToolbarState",{cursorPos:c,mdNode:p,toolbarState:d}),n.emit("setFocusedNode",p)}}}}})}var dn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"doc"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"block+"}},enumerable:!1,configurable:!0}),n}(Tt),fn=function(){function e(){}return Object.defineProperty(e.prototype,"type",{get:function(){return"mark"},enumerable:!1,configurable:!0}),e.prototype.setContext=function(e){this.context=e},e}();function hn(e,t){return mn(e,t-1)}function mn(e,t){return e.child(t).textContent}var vn=/^\s*> ?/,gn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("block-quote")},0]}}},enumerable:!1,configurable:!0}),n.prototype.createBlockQuoteText=function(e,t){return t?e.replace(vn,"").trim():"> "+e.trim()},n.prototype.extendBlockQuote=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.tr,a=t.schema,s=_t(r),l=s.endFromOffset,u=s.endToOffset,c=s.endIndex,p=s.to,d=mn(o,c);if(vn.test(d)&&p>l&&r.empty){if(!d.replace(vn,"").trim())i.deleteRange(l,u).split(i.mapping.map(u));else{var f=d.slice(p-l).trim();me(i,u,f,pe(a,e.createBlockQuoteText(f)))}return n(i),!0}return!1}},n.prototype.commands=function(){var e=this;return function(){return function(t,n){var r=t.selection,o=t.doc,i=_t(r),a=i.startFromOffset,s=i.endToOffset,l=i.startIndex,u=i.endIndex,c=vn.test(mn(o,l)),p=he({state:t,startIndex:l,endIndex:u,from:a,createText:function(t){return e.createBlockQuoteText(t,c)}});return n(p.setSelection(de(p,p.mapping.map(s)))),!0}}},n.prototype.keymaps=function(){var e=this.commands()();return{"alt-q":e,"alt-Q":e,Enter:this.extendBlockQuote()}},n}(fn),yn=/(^\s*)([-*+] |[\d]+\. )/,bn=/(^\s*)([\d])+\.( \[[ xX]])? /,wn=/^(\s*)((\d+)([.)]\s(?:\[(?:x|\s)\]\s)?))(.*)/,kn=/(^\s*)([-*+]|[\d]+\.)( \[[ xX]])? /,xn=/^(\s*)([-*+]+(\s(?:\[(?:x|\s)\]\s)?))(.*)/,Cn=/(^\s*)([-*+] |[\d]+\. )(\[[ xX]] )/,Tn=/(^\s*)([-*+])( \[[ xX]]) /;function En(e){return bn.test(e)?"ordered":"bullet"}function Mn(e){for(var t=0;e&&"document"!==e.type;)"list"===e.type&&(t+=1),e=e.parent;return t}function Ln(e,t,n,r){for(var o=e.getLineTexts().length,i=[],a=t;r?a<o:a>1;){a=r?a+1:a-1;var s=e.findFirstNodeAtLine(a),l=Mn(s);if(l===n)i.push({line:a,depth:n,mdNode:s});else if(l<n)break}return i}function Nn(e,t,n,r){void 0===r&&(r=0);var o=Number.MAX_VALUE,i=0,a=t.map((function(t,a){var s=t.line;o=Math.min(s-1,o),i=Math.max(s-1,i);var l=hn(e,s);return l="bullet"===n?function(e){if(!yn.test(e))return"* "+e;var t=En(e);return"bullet"===t&&kn.test(e)?e=e.replace(Tn,"$1$2 "):"ordered"===t&&(e=e.replace(bn,"$1* ")),e}(l):function(e,t){if(!yn.test(e))return t+". "+e;var n=En(e);if("bullet"===n||"ordered"===n&&kn.test(e))e=e.replace(kn,"$1"+t+". ");else if("ordered"===n){var r=wn.exec(e)[3];Number(r)!==t&&(e=e.replace(bn,"$1"+t+". "))}return e}(l,a+1+r),{text:l,line:s}}));return{changedResults:a,firstIndex:o,lastIndex:i}}function Sn(e,t){var n,r,o,i,a,s,l,u=(r=(n=t).toastMark,o=n.mdNode,i=n.line,a=Mn(o),s=Ln(r,i,a,!1).reverse(),l=Ln(r,i,a,!0),s.concat([{line:i,depth:a,mdNode:o}]).concat(l));return Nn(t.doc,u,e)}var An={bullet:function(e){return Sn("bullet",e)},ordered:function(e){return Sn("ordered",e)},task:function(e){var t=e.mdNode,n=e.doc,r=e.line,o=hn(n,r);return t.listData.task?o=o.replace(Cn,"$1$2"):ke(t)&&(o=o.replace(yn,"$1$2[ ] ")),{changedResults:[{text:o,line:r}]}}},Dn={bullet:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* "+hn(t,n),line:n}]}},ordered:function(e){for(var t=e.toastMark,n=e.doc,r=e.line,o=e.startLine,i=hn(n,r),a=1,s=o,l=0,u=o-1;u>0;u-=1){var c=t.findFirstNodeAtLine(u),p=hn(n,u)&&!!Ee(c,(function(e){return ke(e)})),d=wn.exec(hn(n,u));if(!d&&!p)break;if(d||!p){var f=d,h=f[1],m=f[3];if(!h){a=Number(m),s=u;break}}else l+=1}return{changedResults:[{text:a+r-s-l+". "+i,line:r}]}},task:function(e){var t=e.doc,n=e.line;return{changedResults:[{text:"* [ ] "+hn(t,n),line:n}]}}},On={bullet:function(e){var t=e.line,n=hn(e.doc,t),r=xn.exec(n);return{listSyntax:""+r[1]+r[2]}},ordered:function(e){var t=e.toastMark,r=e.line,o=e.mdNode,i=e.doc,a=Mn(o),s=hn(i,r),l=wn.exec(s),u=l[1],c=l[3],p=l[4],d=Number(c)+1,f=""+u+d+p,h=Ln(t,r,a,!0).filter((function(e){var t=wn.exec(hn(i,e.line));return t&&t[1].length===u.length&&!!Ee(e.mdNode,(function(e){return xe(e)}))}));return n({listSyntax:f},Nn(i,h,"ordered",d))}};function In(e,t,n,r,o){for(var i=[],a=hn(e,n),s=wn.exec(a);s;){var l=s[1],u=s[4],c=s[5],p=l.length;if(p===o)i.push(pe(t,""+l+r+u+c)),r+=1,n+=1;else if(p>o){var d=In(e,t,n,1,p);n=d.line,i=i.concat(d.nodes)}if(p<o||n>e.childCount)break;a=hn(e,n),s=wn.exec(a)}return{nodes:i,line:n}}var Rn=/(^\s{1,4})(.*)/;function Pn(e,t,n){return e<t||yn.test(n)||vn.test(n)}function Hn(e,t,n){var r=n.$from;0===r.depth&&(r=e.resolve(r.pos-1));var o=r.node(1),i=r.start(1),a=o.content.size;return o.rangeHasMark(0,a,t.marks.table)&&r.pos-i!==a&&r.pos!==i}function Bn(e,t){var n=t.from,r=t.to;if("indent"===t.type){n+=4,r+=4*(t.lineLen+1)}else{var o=t.spaceLenList;n-=o[0];for(var i=0;i<o.length;i+=1)r-=o[i]}return de(e,n,r)}var Fn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"paragraph"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"inline*",attrs:{className:{default:null},codeStart:{default:null},codeEnd:{default:null}},selectable:!1,group:"block",parseDOM:[{tag:"div"}],toDOM:function(e){var t=e.attrs;return t.className?["div",{class:at(t.className)},0]:["div",0]}}},enumerable:!1,configurable:!0}),n.prototype.reorderList=function(e,t){for(var n=this.context,r=n.view,o=n.toastMark,i=n.schema,a=r.state,s=a.tr,l=a.selection,u=a.doc,c=o.findFirstNodeAtLine(e),p=c;c&&!Ce(c)&&"document"!==c.parent.type;)if(xe(c=c.parent)){p=c;break}p&&(e=p.sourcepos[0][0]);var d=wn.exec(hn(u,e)),f=d[1],h=d[3],m=f.length,v=In(u,i,e,Number(h),m),g=v.line,y=v.nodes;t=Math.max(t,g-1);for(var b=Ut(u,e-1).startOffset,w=e-1;w<=t-1;w+=1){var k=u.child(w),x=k.nodeSize,C=k.content,T=s.mapping.map(b),E=T+C.size;s.replaceWith(T,E,y[w-e+1]),b+=x}var M=de(s,l.from,l.to);r.dispatch(s.setSelection(M))},n.prototype.indent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var o=n.schema,i=n.selection,a=n.doc,s=_t(i),l=s.from,u=s.to,c=s.startFromOffset,p=s.startIndex,d=s.endIndex;if(e&&Hn(a,o,i))return!1;var f=mn(a,p);if(e&&Pn(l,u,f)||!e&&yn.test(f)){var h=he({state:n,from:c,startIndex:p,endIndex:d,createText:function(e){return" "+e}}),m={type:"indent",from:l,to:u,lineLen:d-p};r(h.setSelection(Bn(h,m))),wn.test(f)&&t.reorderList(p+1,d+1)}else e&&r(n.tr.insert(u,pe(o," ")));return!0}}},n.prototype.outdent=function(e){var t=this;return void 0===e&&(e=!1),function(){return function(n,r){var o=n.selection,i=n.doc,a=n.schema,s=_t(o),l=s.from,u=s.to,c=s.startFromOffset,p=s.startIndex,d=s.endIndex;if(e&&Hn(i,a,o))return!1;var f=mn(i,p);if(e&&Pn(l,u,f)||!e&&yn.test(f)){var h=[],m=he({state:n,from:c,startIndex:p,endIndex:d,createText:function(e){var t=Rn.exec(e);return h.push(t?t[1].length:0),e.replace(Rn,"$2")}}),v={type:"outdent",from:l,to:u,spaceLenList:h};r(m.setSelection(Bn(m,v))),wn.test(f)&&t.reorderList(p+1,d+1)}else if(e){var g=f.slice(0,u-c),y=g.replace(/\s{1,4}$/,""),b=u-(g.length-y.length);r(n.tr.delete(b,u))}return!0}}},n.prototype.deleteLines=function(){var e=this;return function(t,n){var r=e.context.view,o=_t(t.selection),i=o.startFromOffset,a=o.endToOffset;return(0,se.chainCommands)((function(){return n(t.tr.deleteRange(i,a)),!0}),se.joinForward)(t,n,r)}},n.prototype.moveDown=function(){return function(e,t){var n=e.doc,r=e.tr,o=e.selection,i=e.schema,a=_t(o),s=a.startFromOffset,l=a.endToOffset,u=a.endIndex;if(u<n.content.childCount-1){var c=n.child(u+1),p=c.nodeSize,d=c.textContent;return r.delete(l,l+p).split(s).insert(r.mapping.map(s)-2,pe(i,d)),t(r),!0}return!1}},n.prototype.moveUp=function(){return function(e,t){var n=e.tr,r=e.doc,o=e.selection,i=e.schema,a=_t(o),s=a.startFromOffset,l=a.endToOffset,u=a.startIndex;if(u>0){var c=r.child(u-1),p=c.nodeSize,d=c.textContent;return n.delete(s-p,s).split(n.mapping.map(l)).insert(n.mapping.map(l),pe(i,d)),t(n),!0}return!1}},n.prototype.commands=function(){return{indent:this.indent(),outdent:this.outdent()}},n.prototype.keymaps=function(){return{Tab:this.indent(!0)(),"Shift-Tab":this.outdent(!0)(),"Mod-d":this.deleteLines(),"Mod-D":this.deleteLines(),"Alt-ArrowUp":this.moveUp(),"Alt-ArrowDown":this.moveDown()}},n}(Tt),qn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),n}(Tt),jn=/^#{1,6}\s/,_n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{attrs:{level:{default:1},seText:{default:!1}},toDOM:function(e){var t=e.attrs,n="heading|heading"+t.level;return t.seText&&(n+="|delimiter|setext"),["span",{class:at.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),n.prototype.createHeadingText=function(e,t,n){for(var r=t.replace(n,"").trim(),o="";e>0;)o+="#",e-=1;return o+" "+r},n.prototype.commands=function(){var e=this;return function(t){return function(n,r){var o=t.level,i=_t(n.selection),a=i.startFromOffset,s=i.endToOffset,l=he({state:n,from:a,startIndex:i.startIndex,endIndex:i.endIndex,createText:function(t){var n=t.match(jn),r=n?n[0]:"";return e.createHeadingText(o,t,r)}});return r(l.setSelection(de(l,l.mapping.map(s)))),!0}}},n}(fn),Un="```",zn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("code-block")},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,o=e.tr,i=_t(n),a=i.startFromOffset,s=i.endToOffset,l=pe(r,Un);return o.insert(a,l).split(a+3),o.split(o.mapping.map(s)).insert(o.mapping.map(s),l),t(o.setSelection(de(o,o.mapping.map(s)-5))),!0}}},n.prototype.keepIndentation=function(){var e=this;return function(t,n){var r=t.selection,o=t.tr,i=t.doc,a=t.schema,s=e.context.toastMark,l=_t(r),u=l.startFromOffset,c=l.endToOffset,p=l.endIndex,d=l.from,f=l.to,h=mn(i,p);if(d===f&&h.trim()){var m=h.match(/^\s+/);if(function(e){return e&&"codeBlock"===e.type}(s.findFirstNodeAtLine(p+1))&&m){var v=m[0],g=h.slice(f-u);return me(o,c,g,pe(a,v+g)),n(o),!0}}return!1}},n.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,Enter:this.keepIndentation()}},n}(fn),Vn=/\||\s/g;function Wn(e,t){for(var n="|",r=0;r<e;r+=1)n+=t?" --- |":" |";return n}var $n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("table")},0]}}},enumerable:!1,configurable:!0}),n.prototype.extendTable=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.tr,a=t.schema;if(!r.empty)return!1;var s=_t(r),l=s.endFromOffset,u=s.endToOffset,c=s.endIndex,p=s.to,d=mn(o,c),f=[c+1,p-l+1],h=Ee(e.context.toastMark.findNodeAtPosition(f),(function(e){return Te(e)&&("tableDelimRow"===e.parent.type||"tableBody"===e.parent.parent.type)}));if(h){var m=!d.replace(Vn,"").trim(),v=Wn(h.parent.parent.parent.columns.length);return m?i.deleteRange(l,u).split(i.mapping.map(u)):i.split(u).insert(i.mapping.map(u),pe(a,v)).setSelection(de(i,i.mapping.map(u)-2)),n(i),!0}return!1}},n.prototype.moveTableCell=function(e){var t=this;return function(n,r){var o=n.selection,i=n.tr,a=_t(o),s=a.endFromOffset,l=[a.endIndex+1,a.to-s],u=Ee(t.context.toastMark.findNodeAtPosition(l),(function(e){return Te(e)}));if(u){var c=u.parent,p=function(e){return e?{type:"next",parentType:"tableHead",childType:"firstChild"}:{type:"prev",parentType:"tableBody",childType:"lastChild"}}(e),d=p.type,f=p.parentType,h=p.childType,m=be(u);if(u[d])m=be(u[d])-1;else{var v=c[d]||c.parent.type!==f?c[d]:c.parent[d][h];if("next"===d)m+=(v?be(v[h]):0)+2;else"prev"===d&&(m=v?-4:0)}return r(i.setSelection(de(i,s+m))),!0}return!1}},n.prototype.addTable=function(){return function(e){return function(t,n){var o=t.selection,i=t.tr,a=t.schema,s=e,l=s.columnCount,u=s.rowCount,c=_t(o).endToOffset,p=function(e){return[Wn(e),Wn(e,!0)]}(l),d=function(e,t){for(var n=[],r=0;r<t;r+=1)n.push(Wn(e));return n}(l,u-1);return r(r([],p),d).forEach((function(e){i.split(i.mapping.map(c)).insert(i.mapping.map(c),pe(a,e))})),n(i.setSelection(de(i,c+4))),!0}}},n.prototype.commands=function(){return{addTable:this.addTable()}},n.prototype.keymaps=function(){return{Enter:this.extendTable(),Tab:this.moveTableCell(!0),"Shift-Tab":this.moveTableCell(!1)}},n}(fn),Gn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("thematic-break")},0]}}},enumerable:!1,configurable:!0}),n.prototype.hr=function(){return function(){return function(e,t){var n=e.selection,r=e.schema,o=e.tr,i=_t(n),a=i.from,s=i.to,l=i.endToOffset,u=pe(r,"***");return o.split(a).replaceWith(o.mapping.map(a),o.mapping.map(s),u).split(o.mapping.map(s)).setSelection(de(o,o.mapping.map(l))),t(o),!0}}},n.prototype.commands=function(){return{hr:this.hr()}},n.prototype.keymaps=function(){var e=this.hr()();return{"Mod-l":e,"Mod-L":e}},n}(fn);function Xn(e,t){var n=e.type;return t<=e.sourcepos[0][0]&&("codeBlock"===n||"heading"===n||n.match("table"))}var Zn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{attrs:{odd:{default:!1},even:{default:!1},listStyle:{default:!1}},toDOM:function(e){var t=e.attrs,n=t.odd,r=t.even,o="list-item";return t.listStyle&&(o+="|list-item-style"),n&&(o+="|list-item-odd"),r&&(o+="|list-item-even"),["span",{class:at.apply(void 0,o.split("|"))},0]}}},enumerable:!1,configurable:!0}),n.prototype.extendList=function(){var e=this;return function(t,n){var r=t.selection,o=t.doc,i=t.schema,a=t.tr,s=e.context.toastMark,l=_t(r),u=l.to,c=l.startFromOffset,p=l.endFromOffset,d=l.endIndex,f=l.endToOffset,h=mn(o,d);if(!yn.test(h)||r.from===c||!r.empty)return!1;if(!h.replace(kn,"").trim())a.deleteRange(p,f).split(a.mapping.map(f));else{var m=En(h),v=s.findFirstNodeAtLine(d+1),g=h.slice(u-p),y={toastMark:s,mdNode:v,doc:o,line:d+1},b=On[m](y),w=b.listSyntax,k=b.changedResults;if(null==k?void 0:k.length){a.split(u),k.unshift({text:w+g,line:d+1}),e.changeToListPerLine(a,k,{from:u,startLine:k[0].line,endLine:X(k).line});var x=a.mapping.map(f)-g.length;a.setSelection(de(a,x))}else{me(a,f,g,pe(i,w+g))}}return n(a),!0}},n.prototype.toList=function(e){var t=this;return function(){return function(n,r){for(var o=n.doc,i=n.tr,a=n.selection,s=t.context.toastMark,l=_t(a),u=l.startIndex+1,c=l.endIndex+1,p=l.endToOffset,d=[],f=u;f<=c;f+=1){var h=s.findFirstNodeAtLine(f);if(h&&Xn(h,f))break;if(-1===d.indexOf(f)){var m={toastMark:s,mdNode:h,doc:o,line:f,startLine:u},v=(ke(h)?An[e](m):Dn[e](m)).changedResults,g=t.changeToListPerLine(i,v,{from:Ut(o,v[0].line-1).startOffset,startLine:v[0].line,endLine:X(v).line,indexDiff:1});p=Math.max(g,p),v&&(d=d.concat(v.map((function(e){return e.line}))))}}return r(i.setSelection(de(i,i.mapping.map(p)))),!0}}},n.prototype.changeToListPerLine=function(e,t,n){for(var r=n.from,o=n.startLine,i=n.endLine,a=n.indexDiff,s=void 0===a?0:a,l=0,u=function(n){var o=e.doc.child(n),i=o.nodeSize,a=o.content,u=e.mapping.map(r),p=u+a.size,d=t.filter((function(e){return e.line-s===n}))[0];d&&(e.replaceWith(u,p,pe(c.context.schema,d.text)),l=Math.max(l,r+a.size)),r+=i},c=this,p=o-s;p<=i-s;p+=1)u(p);return l},n.prototype.toggleTask=function(){var e=this;return function(t,n){for(var r=t.selection,o=t.tr,i=t.doc,a=t.schema,s=e.context.toastMark,l=_t(r),u=l.startIndex,c=l.endIndex,p=null,d=u;d<=c;d+=1){var f=s.findFirstNodeAtLine(d+1);if(ke(f)&&f.listData.task){var h=f.listData,m=h.checked,v=h.padding,g=m?" ":"x",y=f.sourcepos[0],b=Ut(i,y[0]-1).startOffset;b+=y[1]+v,p=o.replaceWith(b,b+1,a.text(g))}}return!!p&&(n(p),!0)}},n.prototype.commands=function(){return{bulletList:this.toList("bullet"),orderedList:this.toList("ordered"),taskList:this.toList("task")}},n.prototype.keymaps=function(){var e=this.toList("bullet")(),t=this.toList("ordered")(),n=this.toList("task")(),r=this.toggleTask();return{"Mod-u":e,"Mod-U":e,"Mod-o":t,"Mod-O":t,"alt-t":n,"alt-T":n,"Shift-Ctrl-x":r,"Shift-Ctrl-X":r,Enter:this.extendList()}},n}(fn);function Kn(e,t){return function(){return function(n,r){var o=n.tr,i=n.selection,a=Dt()(e)?e:function(t){return e.test(t)},s=t.length,l=o.doc,u=Pt(i),c=u[0],p=u[1],d=Math.max(c-s,1),f=Math.min(p+s,l.content.size-1),h=i.content(),m=h.content.textBetween(0,h.content.size,"\n"),v=l.textBetween(d,c,"\n"),g=l.textBetween(p,f,"\n");if(m=""+v+m+g,v&&g&&a(m))o.delete(f-s,f).delete(d,d+s);else{o.insertText(t,p).insertText(t,c);var y=i.empty?de(o,c+s):de(o,c+s,p+s);o.setSelection(y)}return r(o),!0}}}var Qn=/^(\*{2}|_{2}).*([\s\S]*)\1$/m,Yn=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("strong")},0]}}},enumerable:!1,configurable:!0}),n.prototype.bold=function(){return Kn(Qn,"**")},n.prototype.commands=function(){return{bold:this.bold()}},n.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},n}(fn),Jn=/^(~{2}).*([\s\S]*)\1$/m,er=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("strike")},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return Kn(Jn,"~~")},n.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},n}(fn),tr=/^(\*|_).*([\s\S]*)\1$/m,nr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"emph"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("emph")},0]}}},enumerable:!1,configurable:!0}),n.prototype.italic=function(){return Kn(tr,"*")},n.prototype.commands=function(){return{italic:this.italic()}},n.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},n}(fn),rr=/^(`).*([\s\S]*)\1$/m,or=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{attrs:{start:{default:!1},end:{default:!1},marked:{default:!1}},toDOM:function(e){var t=e.attrs,n="code";return t.start&&(n+="|delimiter|start"),t.end&&(n+="|delimiter|end"),t.marked&&(n+="|marked-text"),["span",{class:at.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return Kn(rr,"`")},n.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},n}(fn),ir=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{attrs:{url:{default:!1},desc:{default:!1}},toDOM:function(e){var t=e.attrs,n="link";return t.url&&(n+="|link-url|marked-text"),t.desc&&(n+="|link-desc|marked-text"),["span",{class:at.apply(void 0,n.split("|"))},0]}}},enumerable:!1,configurable:!0}),n.prototype.addLinkOrImage=function(e){return function(t){return function(n,r){var o=n.selection,i=n.tr,a=n.schema,s=Pt(o),l=s[0],u=s[1],c=t,p=c.linkText,d=c.altText,f=c.linkUrl,h=c.imageUrl,m=p,v=f,g="";return"image"===e&&(m=d,v=h,g="!"),g+="["+(m=V(m))+"]("+v+")",r(i.replaceWith(l,u,pe(a,g))),!0}}},n.prototype.commands=function(){return{addImage:this.addLinkOrImage("image"),addLink:this.addLinkOrImage("link")}},n}(fn),ar=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"taskDelimiter"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("delimiter","list-item")},0]}}},enumerable:!1,configurable:!0}),n}(fn),sr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"delimiter"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("delimiter")},0]}}},enumerable:!1,configurable:!0}),n}(fn),lr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"meta"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("meta")},0]}}},enumerable:!1,configurable:!0}),n}(fn),ur=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"markedText"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("marked-text")},0]}}},enumerable:!1,configurable:!0}),n}(fn),cr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"tableCell"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("table-cell")},0]}}},enumerable:!1,configurable:!0}),n}(fn),pr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"html"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("html")},0]}}},enumerable:!1,configurable:!0}),n}(fn),dr="$$",fr=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{toDOM:function(){return["span",{class:at("custom-block")},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return function(e){return function(t,n){var r=t.selection,o=t.schema,i=t.tr,a=_t(r),s=a.startFromOffset,l=a.endToOffset;if(!(null==e?void 0:e.info))return!1;var u="$$"+e.info,c=pe(o,u),p=pe(o,dr);return i.insert(s,c).split(s+u.length),i.split(i.mapping.map(l)).insert(i.mapping.map(l),p),n(i.setSelection(de(i,i.mapping.map(l)-4))),!0}}},n}(fn),hr=/x|backspace/i,mr=/^\[(\s*)(x?)(\s*)\](?:\s+)/i;var vr="cut",gr=/\r\n|\n|\r/,yr=function(e){function o(t,r){var o=e.call(this,t)||this,i=r.toastMark,a=r.useCommandShortcut,s=void 0===a||a,l=r.mdPlugins,u=void 0===l?[]:l;return o.editorType="markdown",o.el.classList.add("md-mode"),o.toastMark=i,o.extraPlugins=u,o.specs=o.createSpecs(),o.schema=o.createSchema(),o.context=o.createContext(),o.keymaps=o.createKeymaps(s),o.view=o.createView(),o.commands=o.createCommands(),o.specs.setContext(n(n({},o.context),{view:o.view})),o.createClipboard(),o.eventEmitter.listen("changePreviewTabWrite",(function(e){return o.toggleActive(!0,e)})),o.eventEmitter.listen("changePreviewTabPreview",(function(){return o.toggleActive(!1)})),o.initEvent(),o}return t(o,e),o.prototype.toggleActive=function(e,t){ut(this.el,"active",e),e?t||this.focus():this.blur()},o.prototype.createClipboard=function(){var e=this;this.clipboard=document.createElement("textarea"),this.clipboard.className=it("pseudo-clipboard"),this.clipboard.addEventListener("paste",(function(t){var n=t.clipboardData||window.clipboardData,r=n&&n.items;if(r){var o=oe()(r).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!o){var i=xt(r);i&&(t.preventDefault(),kt(e.eventEmitter,i,t.type))}}})),this.clipboard.addEventListener("input",(function(t){var n=t.target.value;e.replaceSelection(n),t.preventDefault(),t.target.value=""})),this.el.insertBefore(this.clipboard,this.view.dom)},o.prototype.createContext=function(){return{toastMark:this.toastMark,schema:this.schema,eventEmitter:this.eventEmitter}},o.prototype.createSpecs=function(){return new Rt([new dn,new Fn,new Lt,new qn,new _n,new gn,new zn,new fr,new $n,new cr,new Gn,new Zn,new Yn,new er,new nr,new or,new ir,new sr,new ar,new ur,new lr,new pr])},o.prototype.createPlugins=function(){return r([an(this.context),pn(this.context),(e=this.context,t=e.schema,n=e.toastMark,new ie.Plugin({props:{handleDOMEvents:{keyup:function(e,r){var o,i=e.state,a=i.doc,s=i.tr,l=i.selection;if(l.empty&&hr.test(r.key)){var u=_t(l),c=u.startIndex,p=u.startFromOffset,d=[c+1,u.from-p+1],f=Ee(n.findNodeAtPosition(d),(function(e){var t;return"paragraph"===e.type&&"item"===(null===(t=e.parent)||void 0===t?void 0:t.type)}));if(null===(o=null==f?void 0:f.firstChild)||void 0===o?void 0:o.literal){var h=f.firstChild,m=h.literal.match(mr);if(m){var v=h.sourcepos[0],g=m[1],y=m[2],b=m[3],w=g.length+b.length,k=Ut(a,v[0]-1).startOffset,x=v[1]+k;if(y){var C=w?w+1:0;s.replaceWith(x,C+x,t.text(y)),e.dispatch(s)}else w||(s.insertText(" ",x),e.dispatch(s))}}}return!1}}}}))],this.createPluginProps()).concat(this.defaultPlugins);var e,t,n},o.prototype.createView=function(){var e=this;return new te.EditorView(this.el,{state:this.createState(),dispatchTransaction:function(t){e.updateMarkdown(t);var n=e.view.state.applyTransaction(t).state;e.view.updateState(n),e.emitChangeEvent(t)},handleKeyDown:function(t,n){return(n.metaKey||n.ctrlKey)&&"V"===n.key.toUpperCase()&&e.clipboard.focus(),e.eventEmitter.emit("keydown",e.editorType,n),!1},handleDOMEvents:{copy:function(t,n){return e.captureCopy(n)},cut:function(t,n){return e.captureCopy(n,vr)},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1}},nodeViews:{widget:Et}})},o.prototype.createCommands=function(){return this.specs.commands(this.view)},o.prototype.captureCopy=function(e,t){e.preventDefault();var n=this.view.state,r=n.selection,o=n.tr;if(r.empty)return!0;var i=this.getChanged(r.content());return e.clipboardData?e.clipboardData.setData("text/plain",i):window.clipboardData.setData("Text",i),t===vr&&this.view.dispatch(o.deleteSelection().scrollIntoView().setMeta("uiEvent",vr)),!0},o.prototype.updateMarkdown=function(e){var t=this;e.docChanged&&e.steps.forEach((function(n,r){if(n.slice&&!(n instanceof ne.ReplaceAroundStep)){var o=e.docs[r],i=[n.from,n.to],a=Ft(o,i[0],i[1]),s=a[0],l=a[1],u=t.getChanged(n.slice);s[0]===l[0]&&s[1]===l[1]&&""===u&&(u="\n");var c=t.toastMark.editMarkdown(s,l,u);t.eventEmitter.emit("updatePreview",c),e.setMeta("editResult",c).scrollIntoView()}}))},o.prototype.getChanged=function(e){var t="",n=e.content.size;return e.content.nodesBetween(0,n,(function(e,r){e.isText?t+=e.text.slice(Math.max(0,r)-r,n-r):e.isBlock&&r>0&&(t+="\n")})),t},o.prototype.setSelection=function(e,t){void 0===t&&(t=e);var n=this.view.state.tr,r=jt(n.doc,e,t),o=r[0],i=r[1];this.view.dispatch(n.setSelection(de(n,o,i)).scrollIntoView())},o.prototype.replaceSelection=function(e,t,n){var r,o=this.view.state,a=o.tr,s=o.schema,l=o.doc,u=e.split(gr).map((function(e){return ce(s,je(e,s))})),c=new i.Slice(i.Fragment.from(u),1,1);if(this.focus(),t&&n){var p=jt(l,t,n),d=p[0],f=p[1];r=a.replaceRange(d,f,c)}else r=a.replaceSelection(c);this.view.dispatch(r.scrollIntoView())},o.prototype.deleteSelection=function(e,t){var n,r=this.view.state,o=r.tr,i=r.doc;if(e&&t){var a=jt(i,e,t),s=a[0],l=a[1];n=o.deleteRange(s,l)}else n=o.deleteSelection();this.view.dispatch(n.scrollIntoView())},o.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,o=n.selection,i=o.from,a=o.to;if(e&&t){var s=jt(r,e,t);i=s[0],a=s[1]}return r.textBetween(i,a,"\n")},o.prototype.getSelection=function(){var e=this.view.state.selection,t=e.from,n=e.to;return Ft(this.view.state.tr.doc,t,n)},o.prototype.setMarkdown=function(e,t){void 0===t&&(t=!0);var n=e.split(gr),r=this.view.state,o=r.tr,i=r.doc,a=r.schema,s=n.map((function(e){return ce(a,je(e,a))}));this.view.dispatch(o.replaceWith(0,i.content.size,s)),t&&this.moveCursorToEnd(!0)},o.prototype.addWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=r.doc,a=r.selection,s=n?jt(i,n,n)[0]:a.to;this.view.dispatch(o.setMeta("widget",{pos:s,node:e,style:t}))},o.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=r.schema,a=jt(r.doc,e,t),s=je(n,i);this.view.dispatch(o.replaceWith(a[0],a[1],s))},o.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,o=e||Ft(n,r.from)[0],i=this.toastMark.findNodeAtPosition(o);return"text"===i.type&&"paragraph"!==i.parent.type&&(i=i.parent),i.sourcepos[1][1]+=1,{range:i.sourcepos,type:i.type}},o.prototype.getMarkdown=function(){return this.toastMark.getLineTexts().map((function(e){return Re(e)})).join("\n")},o.prototype.getToastMark=function(){return this.toastMark},o}(St),br=yr,wr=c(349),kr=c.n(wr),xr=c(348),Cr=c.n(xr),Tr=function(e,t){return Tr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Tr(e,t)};function Er(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Tr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Mr=function(){return Mr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Mr.apply(this,arguments)};function Lr(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var Nr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==c.g?c.g:"undefined"!=typeof self?self:{},Sr={};function Ar(e,t,n){var r,o,i,a,s,l="";for("string"!=typeof t&&(n=t,t=Ar.defaultChars),void 0===n&&(n=!0),s=function(e){var t,n,r=Sr[e];if(r)return r;for(r=Sr[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t<e.length;t++)r[e.charCodeAt(t)]=e[t];return r}(t),r=0,o=e.length;r<o;r++)if(i=e.charCodeAt(r),n&&37===i&&r+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(r+1,r+3)))l+=e.slice(r,r+3),r+=2;else if(i<128)l+=s[i];else if(i>=55296&&i<=57343){if(i>=55296&&i<=56319&&r+1<o&&(a=e.charCodeAt(r+1))>=56320&&a<=57343){l+=encodeURIComponent(e[r]+e[r+1]),r++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[r]);return l}Ar.defaultChars=";/?:@&=+$,-_.!~*'()#",Ar.componentChars="-_.!~*'()";var Dr=Ar,Or={},Ir={},Rr={Aacute:"Á",aacute:"á",Abreve:"?",abreve:"?",ac:"?",acd:"?",acE:"??",Acirc:"Â",acirc:"â",acute:"´",Acy:"?",acy:"?",AElig:"Æ",aelig:"æ",af:"?",Afr:"?",afr:"?",Agrave:"À",agrave:"à",alefsym:"?",aleph:"?",Alpha:"?",alpha:"?",Amacr:"?",amacr:"?",amalg:"?",amp:"&",AMP:"&",andand:"?",And:"?",and:"?",andd:"?",andslope:"?",andv:"?",ang:"?",ange:"?",angle:"?",angmsdaa:"?",angmsdab:"?",angmsdac:"?",angmsdad:"?",angmsdae:"?",angmsdaf:"?",angmsdag:"?",angmsdah:"?",angmsd:"?",angrt:"?",angrtvb:"?",angrtvbd:"?",angsph:"?",angst:"Å",angzarr:"?",Aogon:"?",aogon:"?",Aopf:"?",aopf:"?",apacir:"?",ap:"?",apE:"?",ape:"?",apid:"?",apos:"'",ApplyFunction:"?",approx:"?",approxeq:"?",Aring:"Å",aring:"å",Ascr:"?",ascr:"?",Assign:"?",ast:"*",asymp:"?",asympeq:"?",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"?",awint:"?",backcong:"?",backepsilon:"?",backprime:"?",backsim:"?",backsimeq:"?",Backslash:"?",Barv:"?",barvee:"?",barwed:"?",Barwed:"?",barwedge:"?",bbrk:"?",bbrktbrk:"?",bcong:"?",Bcy:"?",bcy:"?",bdquo:"?",becaus:"?",because:"?",Because:"?",bemptyv:"?",bepsi:"?",bernou:"?",Bernoullis:"?",Beta:"?",beta:"?",beth:"?",between:"?",Bfr:"?",bfr:"?",bigcap:"?",bigcirc:"?",bigcup:"?",bigodot:"?",bigoplus:"?",bigotimes:"?",bigsqcup:"?",bigstar:"?",bigtriangledown:"?",bigtriangleup:"?",biguplus:"?",bigvee:"?",bigwedge:"?",bkarow:"?",blacklozenge:"?",blacksquare:"?",blacktriangle:"?",blacktriangledown:"?",blacktriangleleft:"?",blacktriangleright:"?",blank:"?",blk12:"?",blk14:"?",blk34:"?",block:"?",bne:"=?",bnequiv:"??",bNot:"?",bnot:"?",Bopf:"?",bopf:"?",bot:"?",bottom:"?",bowtie:"?",boxbox:"?",boxdl:"?",boxdL:"?",boxDl:"?",boxDL:"?",boxdr:"?",boxdR:"?",boxDr:"?",boxDR:"?",boxh:"?",boxH:"?",boxhd:"?",boxHd:"?",boxhD:"?",boxHD:"?",boxhu:"?",boxHu:"?",boxhU:"?",boxHU:"?",boxminus:"?",boxplus:"?",boxtimes:"?",boxul:"?",boxuL:"?",boxUl:"?",boxUL:"?",boxur:"?",boxuR:"?",boxUr:"?",boxUR:"?",boxv:"?",boxV:"?",boxvh:"?",boxvH:"?",boxVh:"?",boxVH:"?",boxvl:"?",boxvL:"?",boxVl:"?",boxVL:"?",boxvr:"?",boxvR:"?",boxVr:"?",boxVR:"?",bprime:"?",breve:"?",Breve:"?",brvbar:"¦",bscr:"?",Bscr:"?",bsemi:"?",bsim:"?",bsime:"?",bsolb:"?",bsol:"\\",bsolhsub:"?",bull:"?",bullet:"?",bump:"?",bumpE:"?",bumpe:"?",Bumpeq:"?",bumpeq:"?",Cacute:"?",cacute:"?",capand:"?",capbrcup:"?",capcap:"?",cap:"?",Cap:"?",capcup:"?",capdot:"?",CapitalDifferentialD:"?",caps:"??",caret:"?",caron:"?",Cayleys:"?",ccaps:"?",Ccaron:"?",ccaron:"?",Ccedil:"Ç",ccedil:"ç",Ccirc:"?",ccirc:"?",Cconint:"?",ccups:"?",ccupssm:"?",Cdot:"?",cdot:"?",cedil:"¸",Cedilla:"¸",cemptyv:"?",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"?",Cfr:"?",CHcy:"?",chcy:"?",check:"?",checkmark:"?",Chi:"?",chi:"?",circ:"?",circeq:"?",circlearrowleft:"?",circlearrowright:"?",circledast:"?",circledcirc:"?",circleddash:"?",CircleDot:"?",circledR:"®",circledS:"?",CircleMinus:"?",CirclePlus:"?",CircleTimes:"?",cir:"?",cirE:"?",cire:"?",cirfnint:"?",cirmid:"?",cirscir:"?",ClockwiseContourIntegral:"?",CloseCurlyDoubleQuote:"?",CloseCurlyQuote:"?",clubs:"?",clubsuit:"?",colon:":",Colon:"?",Colone:"?",colone:"?",coloneq:"?",comma:",",commat:"@",comp:"?",compfn:"?",complement:"?",complexes:"?",cong:"?",congdot:"?",Congruent:"?",conint:"?",Conint:"?",ContourIntegral:"?",copf:"?",Copf:"?",coprod:"?",Coproduct:"?",copy:"©",COPY:"©",copysr:"?",CounterClockwiseContourIntegral:"?",crarr:"?",cross:"?",Cross:"?",Cscr:"?",cscr:"?",csub:"?",csube:"?",csup:"?",csupe:"?",ctdot:"?",cudarrl:"?",cudarrr:"?",cuepr:"?",cuesc:"?",cularr:"?",cularrp:"?",cupbrcap:"?",cupcap:"?",CupCap:"?",cup:"?",Cup:"?",cupcup:"?",cupdot:"?",cupor:"?",cups:"??",curarr:"?",curarrm:"?",curlyeqprec:"?",curlyeqsucc:"?",curlyvee:"?",curlywedge:"?",curren:"¤",curvearrowleft:"?",curvearrowright:"?",cuvee:"?",cuwed:"?",cwconint:"?",cwint:"?",cylcty:"?",dagger:"?",Dagger:"?",daleth:"?",darr:"?",Darr:"?",dArr:"?",dash:"?",Dashv:"?",dashv:"?",dbkarow:"?",dblac:"?",Dcaron:"?",dcaron:"?",Dcy:"?",dcy:"?",ddagger:"?",ddarr:"?",DD:"?",dd:"?",DDotrahd:"?",ddotseq:"?",deg:"°",Del:"?",Delta:"?",delta:"?",demptyv:"?",dfisht:"?",Dfr:"?",dfr:"?",dHar:"?",dharl:"?",dharr:"?",DiacriticalAcute:"´",DiacriticalDot:"?",DiacriticalDoubleAcute:"?",DiacriticalGrave:"`",DiacriticalTilde:"?",diam:"?",diamond:"?",Diamond:"?",diamondsuit:"?",diams:"?",die:"¨",DifferentialD:"?",digamma:"?",disin:"?",div:"÷",divide:"÷",divideontimes:"?",divonx:"?",DJcy:"?",djcy:"?",dlcorn:"?",dlcrop:"?",dollar:"$",Dopf:"?",dopf:"?",Dot:"¨",dot:"?",DotDot:"?",doteq:"?",doteqdot:"?",DotEqual:"?",dotminus:"?",dotplus:"?",dotsquare:"?",doublebarwedge:"?",DoubleContourIntegral:"?",DoubleDot:"¨",DoubleDownArrow:"?",DoubleLeftArrow:"?",DoubleLeftRightArrow:"?",DoubleLeftTee:"?",DoubleLongLeftArrow:"?",DoubleLongLeftRightArrow:"?",DoubleLongRightArrow:"?",DoubleRightArrow:"?",DoubleRightTee:"?",DoubleUpArrow:"?",DoubleUpDownArrow:"?",DoubleVerticalBar:"?",DownArrowBar:"?",downarrow:"?",DownArrow:"?",Downarrow:"?",DownArrowUpArrow:"?",DownBreve:"?",downdownarrows:"?",downharpoonleft:"?",downharpoonright:"?",DownLeftRightVector:"?",DownLeftTeeVector:"?",DownLeftVectorBar:"?",DownLeftVector:"?",DownRightTeeVector:"?",DownRightVectorBar:"?",DownRightVector:"?",DownTeeArrow:"?",DownTee:"?",drbkarow:"?",drcorn:"?",drcrop:"?",Dscr:"?",dscr:"?",DScy:"?",dscy:"?",dsol:"?",Dstrok:"?",dstrok:"?",dtdot:"?",dtri:"?",dtrif:"?",duarr:"?",duhar:"?",dwangle:"?",DZcy:"?",dzcy:"?",dzigrarr:"?",Eacute:"É",eacute:"é",easter:"?",Ecaron:"?",ecaron:"?",Ecirc:"Ê",ecirc:"ê",ecir:"?",ecolon:"?",Ecy:"?",ecy:"?",eDDot:"?",Edot:"?",edot:"?",eDot:"?",ee:"?",efDot:"?",Efr:"?",efr:"?",eg:"?",Egrave:"È",egrave:"è",egs:"?",egsdot:"?",el:"?",Element:"?",elinters:"?",ell:"?",els:"?",elsdot:"?",Emacr:"?",emacr:"?",empty:"?",emptyset:"?",EmptySmallSquare:"?",emptyv:"?",EmptyVerySmallSquare:"?",emsp13:"?",emsp14:"?",emsp:"?",ENG:"?",eng:"?",ensp:"?",Eogon:"?",eogon:"?",Eopf:"?",eopf:"?",epar:"?",eparsl:"?",eplus:"?",epsi:"?",Epsilon:"?",epsilon:"?",epsiv:"?",eqcirc:"?",eqcolon:"?",eqsim:"?",eqslantgtr:"?",eqslantless:"?",Equal:"?",equals:"=",EqualTilde:"?",equest:"?",Equilibrium:"?",equiv:"?",equivDD:"?",eqvparsl:"?",erarr:"?",erDot:"?",escr:"?",Escr:"?",esdot:"?",Esim:"?",esim:"?",Eta:"?",eta:"?",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"?",excl:"!",exist:"?",Exists:"?",expectation:"?",exponentiale:"?",ExponentialE:"?",fallingdotseq:"?",Fcy:"?",fcy:"?",female:"?",ffilig:"?",fflig:"?",ffllig:"?",Ffr:"?",ffr:"?",filig:"?",FilledSmallSquare:"?",FilledVerySmallSquare:"?",fjlig:"fj",flat:"?",fllig:"?",fltns:"?",fnof:"?",Fopf:"?",fopf:"?",forall:"?",ForAll:"?",fork:"?",forkv:"?",Fouriertrf:"?",fpartint:"?",frac12:"½",frac13:"?",frac14:"¼",frac15:"?",frac16:"?",frac18:"?",frac23:"?",frac25:"?",frac34:"¾",frac35:"?",frac38:"?",frac45:"?",frac56:"?",frac58:"?",frac78:"?",frasl:"?",frown:"?",fscr:"?",Fscr:"?",gacute:"?",Gamma:"?",gamma:"?",Gammad:"?",gammad:"?",gap:"?",Gbreve:"?",gbreve:"?",Gcedil:"?",Gcirc:"?",gcirc:"?",Gcy:"?",gcy:"?",Gdot:"?",gdot:"?",ge:"?",gE:"?",gEl:"?",gel:"?",geq:"?",geqq:"?",geqslant:"?",gescc:"?",ges:"?",gesdot:"?",gesdoto:"?",gesdotol:"?",gesl:"??",gesles:"?",Gfr:"?",gfr:"?",gg:"?",Gg:"?",ggg:"?",gimel:"?",GJcy:"?",gjcy:"?",gla:"?",gl:"?",glE:"?",glj:"?",gnap:"?",gnapprox:"?",gne:"?",gnE:"?",gneq:"?",gneqq:"?",gnsim:"?",Gopf:"?",gopf:"?",grave:"`",GreaterEqual:"?",GreaterEqualLess:"?",GreaterFullEqual:"?",GreaterGreater:"?",GreaterLess:"?",GreaterSlantEqual:"?",GreaterTilde:"?",Gscr:"?",gscr:"?",gsim:"?",gsime:"?",gsiml:"?",gtcc:"?",gtcir:"?",gt:">",GT:">",Gt:"?",gtdot:"?",gtlPar:"?",gtquest:"?",gtrapprox:"?",gtrarr:"?",gtrdot:"?",gtreqless:"?",gtreqqless:"?",gtrless:"?",gtrsim:"?",gvertneqq:"??",gvnE:"??",Hacek:"?",hairsp:"?",half:"½",hamilt:"?",HARDcy:"?",hardcy:"?",harrcir:"?",harr:"?",hArr:"?",harrw:"?",Hat:"^",hbar:"?",Hcirc:"?",hcirc:"?",hearts:"?",heartsuit:"?",hellip:"?",hercon:"?",hfr:"?",Hfr:"?",HilbertSpace:"?",hksearow:"?",hkswarow:"?",hoarr:"?",homtht:"?",hookleftarrow:"?",hookrightarrow:"?",hopf:"?",Hopf:"?",horbar:"?",HorizontalLine:"?",hscr:"?",Hscr:"?",hslash:"?",Hstrok:"?",hstrok:"?",HumpDownHump:"?",HumpEqual:"?",hybull:"?",hyphen:"?",Iacute:"Í",iacute:"í",ic:"?",Icirc:"Î",icirc:"î",Icy:"?",icy:"?",Idot:"?",IEcy:"?",iecy:"?",iexcl:"¡",iff:"?",ifr:"?",Ifr:"?",Igrave:"Ì",igrave:"ì",ii:"?",iiiint:"?",iiint:"?",iinfin:"?",iiota:"?",IJlig:"?",ijlig:"?",Imacr:"?",imacr:"?",image:"?",ImaginaryI:"?",imagline:"?",imagpart:"?",imath:"?",Im:"?",imof:"?",imped:"?",Implies:"?",incare:"?",in:"?",infin:"?",infintie:"?",inodot:"?",intcal:"?",int:"?",Int:"?",integers:"?",Integral:"?",intercal:"?",Intersection:"?",intlarhk:"?",intprod:"?",InvisibleComma:"?",InvisibleTimes:"?",IOcy:"?",iocy:"?",Iogon:"?",iogon:"?",Iopf:"?",iopf:"?",Iota:"?",iota:"?",iprod:"?",iquest:"¿",iscr:"?",Iscr:"?",isin:"?",isindot:"?",isinE:"?",isins:"?",isinsv:"?",isinv:"?",it:"?",Itilde:"?",itilde:"?",Iukcy:"?",iukcy:"?",Iuml:"Ï",iuml:"ï",Jcirc:"?",jcirc:"?",Jcy:"?",jcy:"?",Jfr:"?",jfr:"?",jmath:"?",Jopf:"?",jopf:"?",Jscr:"?",jscr:"?",Jsercy:"?",jsercy:"?",Jukcy:"?",jukcy:"?",Kappa:"?",kappa:"?",kappav:"?",Kcedil:"?",kcedil:"?",Kcy:"?",kcy:"?",Kfr:"?",kfr:"?",kgreen:"?",KHcy:"?",khcy:"?",KJcy:"?",kjcy:"?",Kopf:"?",kopf:"?",Kscr:"?",kscr:"?",lAarr:"?",Lacute:"?",lacute:"?",laemptyv:"?",lagran:"?",Lambda:"?",lambda:"?",lang:"?",Lang:"?",langd:"?",langle:"?",lap:"?",Laplacetrf:"?",laquo:"«",larrb:"?",larrbfs:"?",larr:"?",Larr:"?",lArr:"?",larrfs:"?",larrhk:"?",larrlp:"?",larrpl:"?",larrsim:"?",larrtl:"?",latail:"?",lAtail:"?",lat:"?",late:"?",lates:"??",lbarr:"?",lBarr:"?",lbbrk:"?",lbrace:"{",lbrack:"[",lbrke:"?",lbrksld:"?",lbrkslu:"?",Lcaron:"?",lcaron:"?",Lcedil:"?",lcedil:"?",lceil:"?",lcub:"{",Lcy:"?",lcy:"?",ldca:"?",ldquo:"?",ldquor:"?",ldrdhar:"?",ldrushar:"?",ldsh:"?",le:"?",lE:"?",LeftAngleBracket:"?",LeftArrowBar:"?",leftarrow:"?",LeftArrow:"?",Leftarrow:"?",LeftArrowRightArrow:"?",leftarrowtail:"?",LeftCeiling:"?",LeftDoubleBracket:"?",LeftDownTeeVector:"?",LeftDownVectorBar:"?",LeftDownVector:"?",LeftFloor:"?",leftharpoondown:"?",leftharpoonup:"?",leftleftarrows:"?",leftrightarrow:"?",LeftRightArrow:"?",Leftrightarrow:"?",leftrightarrows:"?",leftrightharpoons:"?",leftrightsquigarrow:"?",LeftRightVector:"?",LeftTeeArrow:"?",LeftTee:"?",LeftTeeVector:"?",leftthreetimes:"?",LeftTriangleBar:"?",LeftTriangle:"?",LeftTriangleEqual:"?",LeftUpDownVector:"?",LeftUpTeeVector:"?",LeftUpVectorBar:"?",LeftUpVector:"?",LeftVectorBar:"?",LeftVector:"?",lEg:"?",leg:"?",leq:"?",leqq:"?",leqslant:"?",lescc:"?",les:"?",lesdot:"?",lesdoto:"?",lesdotor:"?",lesg:"??",lesges:"?",lessapprox:"?",lessdot:"?",lesseqgtr:"?",lesseqqgtr:"?",LessEqualGreater:"?",LessFullEqual:"?",LessGreater:"?",lessgtr:"?",LessLess:"?",lesssim:"?",LessSlantEqual:"?",LessTilde:"?",lfisht:"?",lfloor:"?",Lfr:"?",lfr:"?",lg:"?",lgE:"?",lHar:"?",lhard:"?",lharu:"?",lharul:"?",lhblk:"?",LJcy:"?",ljcy:"?",llarr:"?",ll:"?",Ll:"?",llcorner:"?",Lleftarrow:"?",llhard:"?",lltri:"?",Lmidot:"?",lmidot:"?",lmoustache:"?",lmoust:"?",lnap:"?",lnapprox:"?",lne:"?",lnE:"?",lneq:"?",lneqq:"?",lnsim:"?",loang:"?",loarr:"?",lobrk:"?",longleftarrow:"?",LongLeftArrow:"?",Longleftarrow:"?",longleftrightarrow:"?",LongLeftRightArrow:"?",Longleftrightarrow:"?",longmapsto:"?",longrightarrow:"?",LongRightArrow:"?",Longrightarrow:"?",looparrowleft:"?",looparrowright:"?",lopar:"?",Lopf:"?",lopf:"?",loplus:"?",lotimes:"?",lowast:"?",lowbar:"_",LowerLeftArrow:"?",LowerRightArrow:"?",loz:"?",lozenge:"?",lozf:"?",lpar:"(",lparlt:"?",lrarr:"?",lrcorner:"?",lrhar:"?",lrhard:"?",lrm:"?",lrtri:"?",lsaquo:"?",lscr:"?",Lscr:"?",lsh:"?",Lsh:"?",lsim:"?",lsime:"?",lsimg:"?",lsqb:"[",lsquo:"?",lsquor:"?",Lstrok:"?",lstrok:"?",ltcc:"?",ltcir:"?",lt:"<",LT:"<",Lt:"?",ltdot:"?",lthree:"?",ltimes:"?",ltlarr:"?",ltquest:"?",ltri:"?",ltrie:"?",ltrif:"?",ltrPar:"?",lurdshar:"?",luruhar:"?",lvertneqq:"??",lvnE:"??",macr:"¯",male:"?",malt:"?",maltese:"?",Map:"?",map:"?",mapsto:"?",mapstodown:"?",mapstoleft:"?",mapstoup:"?",marker:"?",mcomma:"?",Mcy:"?",mcy:"?",mdash:"?",mDDot:"?",measuredangle:"?",MediumSpace:"?",Mellintrf:"?",Mfr:"?",mfr:"?",mho:"?",micro:"µ",midast:"*",midcir:"?",mid:"?",middot:"·",minusb:"?",minus:"?",minusd:"?",minusdu:"?",MinusPlus:"?",mlcp:"?",mldr:"?",mnplus:"?",models:"?",Mopf:"?",mopf:"?",mp:"?",mscr:"?",Mscr:"?",mstpos:"?",Mu:"?",mu:"?",multimap:"?",mumap:"?",nabla:"?",Nacute:"?",nacute:"?",nang:"??",nap:"?",napE:"??",napid:"??",napos:"?",napprox:"?",natural:"?",naturals:"?",natur:"?",nbsp:" ",nbump:"??",nbumpe:"??",ncap:"?",Ncaron:"?",ncaron:"?",Ncedil:"?",ncedil:"?",ncong:"?",ncongdot:"??",ncup:"?",Ncy:"?",ncy:"?",ndash:"?",nearhk:"?",nearr:"?",neArr:"?",nearrow:"?",ne:"?",nedot:"??",NegativeMediumSpace:"?",NegativeThickSpace:"?",NegativeThinSpace:"?",NegativeVeryThinSpace:"?",nequiv:"?",nesear:"?",nesim:"??",NestedGreaterGreater:"?",NestedLessLess:"?",NewLine:"\n",nexist:"?",nexists:"?",Nfr:"?",nfr:"?",ngE:"??",nge:"?",ngeq:"?",ngeqq:"??",ngeqslant:"??",nges:"??",nGg:"??",ngsim:"?",nGt:"??",ngt:"?",ngtr:"?",nGtv:"??",nharr:"?",nhArr:"?",nhpar:"?",ni:"?",nis:"?",nisd:"?",niv:"?",NJcy:"?",njcy:"?",nlarr:"?",nlArr:"?",nldr:"?",nlE:"??",nle:"?",nleftarrow:"?",nLeftarrow:"?",nleftrightarrow:"?",nLeftrightarrow:"?",nleq:"?",nleqq:"??",nleqslant:"??",nles:"??",nless:"?",nLl:"??",nlsim:"?",nLt:"??",nlt:"?",nltri:"?",nltrie:"?",nLtv:"??",nmid:"?",NoBreak:"?",NonBreakingSpace:" ",nopf:"?",Nopf:"?",Not:"?",not:"¬",NotCongruent:"?",NotCupCap:"?",NotDoubleVerticalBar:"?",NotElement:"?",NotEqual:"?",NotEqualTilde:"??",NotExists:"?",NotGreater:"?",NotGreaterEqual:"?",NotGreaterFullEqual:"??",NotGreaterGreater:"??",NotGreaterLess:"?",NotGreaterSlantEqual:"??",NotGreaterTilde:"?",NotHumpDownHump:"??",NotHumpEqual:"??",notin:"?",notindot:"??",notinE:"??",notinva:"?",notinvb:"?",notinvc:"?",NotLeftTriangleBar:"??",NotLeftTriangle:"?",NotLeftTriangleEqual:"?",NotLess:"?",NotLessEqual:"?",NotLessGreater:"?",NotLessLess:"??",NotLessSlantEqual:"??",NotLessTilde:"?",NotNestedGreaterGreater:"??",NotNestedLessLess:"??",notni:"?",notniva:"?",notnivb:"?",notnivc:"?",NotPrecedes:"?",NotPrecedesEqual:"??",NotPrecedesSlantEqual:"?",NotReverseElement:"?",NotRightTriangleBar:"??",NotRightTriangle:"?",NotRightTriangleEqual:"?",NotSquareSubset:"??",NotSquareSubsetEqual:"?",NotSquareSuperset:"??",NotSquareSupersetEqual:"?",NotSubset:"??",NotSubsetEqual:"?",NotSucceeds:"?",NotSucceedsEqual:"??",NotSucceedsSlantEqual:"?",NotSucceedsTilde:"??",NotSuperset:"??",NotSupersetEqual:"?",NotTilde:"?",NotTildeEqual:"?",NotTildeFullEqual:"?",NotTildeTilde:"?",NotVerticalBar:"?",nparallel:"?",npar:"?",nparsl:"??",npart:"??",npolint:"?",npr:"?",nprcue:"?",nprec:"?",npreceq:"??",npre:"??",nrarrc:"??",nrarr:"?",nrArr:"?",nrarrw:"??",nrightarrow:"?",nRightarrow:"?",nrtri:"?",nrtrie:"?",nsc:"?",nsccue:"?",nsce:"??",Nscr:"?",nscr:"?",nshortmid:"?",nshortparallel:"?",nsim:"?",nsime:"?",nsimeq:"?",nsmid:"?",nspar:"?",nsqsube:"?",nsqsupe:"?",nsub:"?",nsubE:"??",nsube:"?",nsubset:"??",nsubseteq:"?",nsubseteqq:"??",nsucc:"?",nsucceq:"??",nsup:"?",nsupE:"??",nsupe:"?",nsupset:"??",nsupseteq:"?",nsupseteqq:"??",ntgl:"?",Ntilde:"Ñ",ntilde:"ñ",ntlg:"?",ntriangleleft:"?",ntrianglelefteq:"?",ntriangleright:"?",ntrianglerighteq:"?",Nu:"?",nu:"?",num:"#",numero:"?",numsp:"?",nvap:"??",nvdash:"?",nvDash:"?",nVdash:"?",nVDash:"?",nvge:"??",nvgt:">?",nvHarr:"?",nvinfin:"?",nvlArr:"?",nvle:"??",nvlt:"<?",nvltrie:"??",nvrArr:"?",nvrtrie:"??",nvsim:"??",nwarhk:"?",nwarr:"?",nwArr:"?",nwarrow:"?",nwnear:"?",Oacute:"Ó",oacute:"ó",oast:"?",Ocirc:"Ô",ocirc:"ô",ocir:"?",Ocy:"?",ocy:"?",odash:"?",Odblac:"?",odblac:"?",odiv:"?",odot:"?",odsold:"?",OElig:"?",oelig:"?",ofcir:"?",Ofr:"?",ofr:"?",ogon:"?",Ograve:"Ò",ograve:"ò",ogt:"?",ohbar:"?",ohm:"?",oint:"?",olarr:"?",olcir:"?",olcross:"?",oline:"?",olt:"?",Omacr:"?",omacr:"?",Omega:"?",omega:"?",Omicron:"?",omicron:"?",omid:"?",ominus:"?",Oopf:"?",oopf:"?",opar:"?",OpenCurlyDoubleQuote:"?",OpenCurlyQuote:"?",operp:"?",oplus:"?",orarr:"?",Or:"?",or:"?",ord:"?",order:"?",orderof:"?",ordf:"ª",ordm:"º",origof:"?",oror:"?",orslope:"?",orv:"?",oS:"?",Oscr:"?",oscr:"?",Oslash:"Ø",oslash:"ø",osol:"?",Otilde:"Õ",otilde:"õ",otimesas:"?",Otimes:"?",otimes:"?",Ouml:"Ö",ouml:"ö",ovbar:"?",OverBar:"?",OverBrace:"?",OverBracket:"?",OverParenthesis:"?",para:"¶",parallel:"?",par:"?",parsim:"?",parsl:"?",part:"?",PartialD:"?",Pcy:"?",pcy:"?",percnt:"%",period:".",permil:"?",perp:"?",pertenk:"?",Pfr:"?",pfr:"?",Phi:"?",phi:"?",phiv:"?",phmmat:"?",phone:"?",Pi:"?",pi:"?",pitchfork:"?",piv:"?",planck:"?",planckh:"?",plankv:"?",plusacir:"?",plusb:"?",pluscir:"?",plus:"+",plusdo:"?",plusdu:"?",pluse:"?",PlusMinus:"±",plusmn:"±",plussim:"?",plustwo:"?",pm:"±",Poincareplane:"?",pointint:"?",popf:"?",Popf:"?",pound:"£",prap:"?",Pr:"?",pr:"?",prcue:"?",precapprox:"?",prec:"?",preccurlyeq:"?",Precedes:"?",PrecedesEqual:"?",PrecedesSlantEqual:"?",PrecedesTilde:"?",preceq:"?",precnapprox:"?",precneqq:"?",precnsim:"?",pre:"?",prE:"?",precsim:"?",prime:"?",Prime:"?",primes:"?",prnap:"?",prnE:"?",prnsim:"?",prod:"?",Product:"?",profalar:"?",profline:"?",profsurf:"?",prop:"?",Proportional:"?",Proportion:"?",propto:"?",prsim:"?",prurel:"?",Pscr:"?",pscr:"?",Psi:"?",psi:"?",puncsp:"?",Qfr:"?",qfr:"?",qint:"?",qopf:"?",Qopf:"?",qprime:"?",Qscr:"?",qscr:"?",quaternions:"?",quatint:"?",quest:"?",questeq:"?",quot:'"',QUOT:'"',rAarr:"?",race:"??",Racute:"?",racute:"?",radic:"?",raemptyv:"?",rang:"?",Rang:"?",rangd:"?",range:"?",rangle:"?",raquo:"»",rarrap:"?",rarrb:"?",rarrbfs:"?",rarrc:"?",rarr:"?",Rarr:"?",rArr:"?",rarrfs:"?",rarrhk:"?",rarrlp:"?",rarrpl:"?",rarrsim:"?",Rarrtl:"?",rarrtl:"?",rarrw:"?",ratail:"?",rAtail:"?",ratio:"?",rationals:"?",rbarr:"?",rBarr:"?",RBarr:"?",rbbrk:"?",rbrace:"}",rbrack:"]",rbrke:"?",rbrksld:"?",rbrkslu:"?",Rcaron:"?",rcaron:"?",Rcedil:"?",rcedil:"?",rceil:"?",rcub:"}",Rcy:"?",rcy:"?",rdca:"?",rdldhar:"?",rdquo:"?",rdquor:"?",rdsh:"?",real:"?",realine:"?",realpart:"?",reals:"?",Re:"?",rect:"?",reg:"®",REG:"®",ReverseElement:"?",ReverseEquilibrium:"?",ReverseUpEquilibrium:"?",rfisht:"?",rfloor:"?",rfr:"?",Rfr:"?",rHar:"?",rhard:"?",rharu:"?",rharul:"?",Rho:"?",rho:"?",rhov:"?",RightAngleBracket:"?",RightArrowBar:"?",rightarrow:"?",RightArrow:"?",Rightarrow:"?",RightArrowLeftArrow:"?",rightarrowtail:"?",RightCeiling:"?",RightDoubleBracket:"?",RightDownTeeVector:"?",RightDownVectorBar:"?",RightDownVector:"?",RightFloor:"?",rightharpoondown:"?",rightharpoonup:"?",rightleftarrows:"?",rightleftharpoons:"?",rightrightarrows:"?",rightsquigarrow:"?",RightTeeArrow:"?",RightTee:"?",RightTeeVector:"?",rightthreetimes:"?",RightTriangleBar:"?",RightTriangle:"?",RightTriangleEqual:"?",RightUpDownVector:"?",RightUpTeeVector:"?",RightUpVectorBar:"?",RightUpVector:"?",RightVectorBar:"?",RightVector:"?",ring:"?",risingdotseq:"?",rlarr:"?",rlhar:"?",rlm:"?",rmoustache:"?",rmoust:"?",rnmid:"?",roang:"?",roarr:"?",robrk:"?",ropar:"?",ropf:"?",Ropf:"?",roplus:"?",rotimes:"?",RoundImplies:"?",rpar:")",rpargt:"?",rppolint:"?",rrarr:"?",Rrightarrow:"?",rsaquo:"?",rscr:"?",Rscr:"?",rsh:"?",Rsh:"?",rsqb:"]",rsquo:"?",rsquor:"?",rthree:"?",rtimes:"?",rtri:"?",rtrie:"?",rtrif:"?",rtriltri:"?",RuleDelayed:"?",ruluhar:"?",rx:"?",Sacute:"?",sacute:"?",sbquo:"?",scap:"?",Scaron:"?",scaron:"?",Sc:"?",sc:"?",sccue:"?",sce:"?",scE:"?",Scedil:"?",scedil:"?",Scirc:"?",scirc:"?",scnap:"?",scnE:"?",scnsim:"?",scpolint:"?",scsim:"?",Scy:"?",scy:"?",sdotb:"?",sdot:"?",sdote:"?",searhk:"?",searr:"?",seArr:"?",searrow:"?",sect:"§",semi:";",seswar:"?",setminus:"?",setmn:"?",sext:"?",Sfr:"?",sfr:"?",sfrown:"?",sharp:"?",SHCHcy:"?",shchcy:"?",SHcy:"?",shcy:"?",ShortDownArrow:"?",ShortLeftArrow:"?",shortmid:"?",shortparallel:"?",ShortRightArrow:"?",ShortUpArrow:"?",shy:"",Sigma:"?",sigma:"?",sigmaf:"?",sigmav:"?",sim:"?",simdot:"?",sime:"?",simeq:"?",simg:"?",simgE:"?",siml:"?",simlE:"?",simne:"?",simplus:"?",simrarr:"?",slarr:"?",SmallCircle:"?",smallsetminus:"?",smashp:"?",smeparsl:"?",smid:"?",smile:"?",smt:"?",smte:"?",smtes:"??",SOFTcy:"?",softcy:"?",solbar:"?",solb:"?",sol:"/",Sopf:"?",sopf:"?",spades:"?",spadesuit:"?",spar:"?",sqcap:"?",sqcaps:"??",sqcup:"?",sqcups:"??",Sqrt:"?",sqsub:"?",sqsube:"?",sqsubset:"?",sqsubseteq:"?",sqsup:"?",sqsupe:"?",sqsupset:"?",sqsupseteq:"?",square:"?",Square:"?",SquareIntersection:"?",SquareSubset:"?",SquareSubsetEqual:"?",SquareSuperset:"?",SquareSupersetEqual:"?",SquareUnion:"?",squarf:"?",squ:"?",squf:"?",srarr:"?",Sscr:"?",sscr:"?",ssetmn:"?",ssmile:"?",sstarf:"?",Star:"?",star:"?",starf:"?",straightepsilon:"?",straightphi:"?",strns:"¯",sub:"?",Sub:"?",subdot:"?",subE:"?",sube:"?",subedot:"?",submult:"?",subnE:"?",subne:"?",subplus:"?",subrarr:"?",subset:"?",Subset:"?",subseteq:"?",subseteqq:"?",SubsetEqual:"?",subsetneq:"?",subsetneqq:"?",subsim:"?",subsub:"?",subsup:"?",succapprox:"?",succ:"?",succcurlyeq:"?",Succeeds:"?",SucceedsEqual:"?",SucceedsSlantEqual:"?",SucceedsTilde:"?",succeq:"?",succnapprox:"?",succneqq:"?",succnsim:"?",succsim:"?",SuchThat:"?",sum:"?",Sum:"?",sung:"?",sup1:"¹",sup2:"²",sup3:"³",sup:"?",Sup:"?",supdot:"?",supdsub:"?",supE:"?",supe:"?",supedot:"?",Superset:"?",SupersetEqual:"?",suphsol:"?",suphsub:"?",suplarr:"?",supmult:"?",supnE:"?",supne:"?",supplus:"?",supset:"?",Supset:"?",supseteq:"?",supseteqq:"?",supsetneq:"?",supsetneqq:"?",supsim:"?",supsub:"?",supsup:"?",swarhk:"?",swarr:"?",swArr:"?",swarrow:"?",swnwar:"?",szlig:"ß",Tab:"\t",target:"?",Tau:"?",tau:"?",tbrk:"?",Tcaron:"?",tcaron:"?",Tcedil:"?",tcedil:"?",Tcy:"?",tcy:"?",tdot:"?",telrec:"?",Tfr:"?",tfr:"?",there4:"?",therefore:"?",Therefore:"?",Theta:"?",theta:"?",thetasym:"?",thetav:"?",thickapprox:"?",thicksim:"?",ThickSpace:"??",ThinSpace:"?",thinsp:"?",thkap:"?",thksim:"?",THORN:"Þ",thorn:"þ",tilde:"?",Tilde:"?",TildeEqual:"?",TildeFullEqual:"?",TildeTilde:"?",timesbar:"?",timesb:"?",times:"×",timesd:"?",tint:"?",toea:"?",topbot:"?",topcir:"?",top:"?",Topf:"?",topf:"?",topfork:"?",tosa:"?",tprime:"?",trade:"?",TRADE:"?",triangle:"?",triangledown:"?",triangleleft:"?",trianglelefteq:"?",triangleq:"?",triangleright:"?",trianglerighteq:"?",tridot:"?",trie:"?",triminus:"?",TripleDot:"?",triplus:"?",trisb:"?",tritime:"?",trpezium:"?",Tscr:"?",tscr:"?",TScy:"?",tscy:"?",TSHcy:"?",tshcy:"?",Tstrok:"?",tstrok:"?",twixt:"?",twoheadleftarrow:"?",twoheadrightarrow:"?",Uacute:"Ú",uacute:"ú",uarr:"?",Uarr:"?",uArr:"?",Uarrocir:"?",Ubrcy:"?",ubrcy:"?",Ubreve:"?",ubreve:"?",Ucirc:"Û",ucirc:"û",Ucy:"?",ucy:"?",udarr:"?",Udblac:"?",udblac:"?",udhar:"?",ufisht:"?",Ufr:"?",ufr:"?",Ugrave:"Ù",ugrave:"ù",uHar:"?",uharl:"?",uharr:"?",uhblk:"?",ulcorn:"?",ulcorner:"?",ulcrop:"?",ultri:"?",Umacr:"?",umacr:"?",uml:"¨",UnderBar:"_",UnderBrace:"?",UnderBracket:"?",UnderParenthesis:"?",Union:"?",UnionPlus:"?",Uogon:"?",uogon:"?",Uopf:"?",uopf:"?",UpArrowBar:"?",uparrow:"?",UpArrow:"?",Uparrow:"?",UpArrowDownArrow:"?",updownarrow:"?",UpDownArrow:"?",Updownarrow:"?",UpEquilibrium:"?",upharpoonleft:"?",upharpoonright:"?",uplus:"?",UpperLeftArrow:"?",UpperRightArrow:"?",upsi:"?",Upsi:"?",upsih:"?",Upsilon:"?",upsilon:"?",UpTeeArrow:"?",UpTee:"?",upuparrows:"?",urcorn:"?",urcorner:"?",urcrop:"?",Uring:"?",uring:"?",urtri:"?",Uscr:"?",uscr:"?",utdot:"?",Utilde:"?",utilde:"?",utri:"?",utrif:"?",uuarr:"?",Uuml:"Ü",uuml:"ü",uwangle:"?",vangrt:"?",varepsilon:"?",varkappa:"?",varnothing:"?",varphi:"?",varpi:"?",varpropto:"?",varr:"?",vArr:"?",varrho:"?",varsigma:"?",varsubsetneq:"??",varsubsetneqq:"??",varsupsetneq:"??",varsupsetneqq:"??",vartheta:"?",vartriangleleft:"?",vartriangleright:"?",vBar:"?",Vbar:"?",vBarv:"?",Vcy:"?",vcy:"?",vdash:"?",vDash:"?",Vdash:"?",VDash:"?",Vdashl:"?",veebar:"?",vee:"?",Vee:"?",veeeq:"?",vellip:"?",verbar:"|",Verbar:"?",vert:"|",Vert:"?",VerticalBar:"?",VerticalLine:"|",VerticalSeparator:"?",VerticalTilde:"?",VeryThinSpace:"?",Vfr:"?",vfr:"?",vltri:"?",vnsub:"??",vnsup:"??",Vopf:"?",vopf:"?",vprop:"?",vrtri:"?",Vscr:"?",vscr:"?",vsubnE:"??",vsubne:"??",vsupnE:"??",vsupne:"??",Vvdash:"?",vzigzag:"?",Wcirc:"?",wcirc:"?",wedbar:"?",wedge:"?",Wedge:"?",wedgeq:"?",weierp:"?",Wfr:"?",wfr:"?",Wopf:"?",wopf:"?",wp:"?",wr:"?",wreath:"?",Wscr:"?",wscr:"?",xcap:"?",xcirc:"?",xcup:"?",xdtri:"?",Xfr:"?",xfr:"?",xharr:"?",xhArr:"?",Xi:"?",xi:"?",xlarr:"?",xlArr:"?",xmap:"?",xnis:"?",xodot:"?",Xopf:"?",xopf:"?",xoplus:"?",xotime:"?",xrarr:"?",xrArr:"?",Xscr:"?",xscr:"?",xsqcup:"?",xuplus:"?",xutri:"?",xvee:"?",xwedge:"?",Yacute:"Ý",yacute:"ý",YAcy:"?",yacy:"?",Ycirc:"?",ycirc:"?",Ycy:"?",ycy:"?",yen:"¥",Yfr:"?",yfr:"?",YIcy:"?",yicy:"?",Yopf:"?",yopf:"?",Yscr:"?",yscr:"?",YUcy:"?",yucy:"?",yuml:"ÿ",Yuml:"?",Zacute:"?",zacute:"?",Zcaron:"?",zcaron:"?",Zcy:"?",zcy:"?",Zdot:"?",zdot:"?",zeetrf:"?",ZeroWidthSpace:"?",Zeta:"?",zeta:"?",zfr:"?",Zfr:"?",ZHcy:"?",zhcy:"?",zigrarr:"?",zopf:"?",Zopf:"?",Zscr:"?",zscr:"?",zwj:"?",zwnj:"?"},Pr={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"},Hr={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'},Br={},Fr=Nr&&Nr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Br,"__esModule",{value:!0});var qr=Fr({0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}),jr=String.fromCodePoint||function(e){var t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e)};Br.default=function(e){return e>=55296&&e<=57343||e>1114111?"?":(e in qr.default&&(e=qr.default[e]),jr(e))};var _r=Nr&&Nr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.decodeHTML=Ir.decodeHTMLStrict=Ir.decodeXML=void 0;var Ur=_r(Rr),zr=_r(Pr),Vr=_r(Hr),Wr=_r(Br),$r=/&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;function Gr(e){var t=Zr(e);return function(e){return String(e).replace($r,t)}}Ir.decodeXML=Gr(Vr.default),Ir.decodeHTMLStrict=Gr(Ur.default);var Xr=function(e,t){return e<t?1:-1};function Zr(e){return function(t){if("#"===t.charAt(1)){var n=t.charAt(2);return"X"===n||"x"===n?Wr.default(parseInt(t.substr(3),16)):Wr.default(parseInt(t.substr(2),10))}return e[t.slice(1,-1)]||t}}Ir.decodeHTML=function(){for(var e=Object.keys(zr.default).sort(Xr),t=Object.keys(Ur.default).sort(Xr),n=0,r=0;n<t.length;n++)e[r]===t[n]?(t[n]+=";?",r++):t[n]+=";";var o=new RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),i=Zr(Ur.default);function a(e){return";"!==e.substr(-1)&&(e+=";"),i(e)}return function(e){return String(e).replace(o,a)}}();var Kr={},Qr=Nr&&Nr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.escapeUTF8=Kr.escape=Kr.encodeNonAsciiHTML=Kr.encodeHTML=Kr.encodeXML=void 0;var Yr=oo(Qr(Hr).default),Jr=io(Yr);Kr.encodeXML=co(Yr);var eo,to,no=oo(Qr(Rr).default),ro=io(no);function oo(e){return Object.keys(e).sort().reduce((function(t,n){return t[e[n]]="&"+n+";",t}),{})}function io(e){for(var t=[],n=[],r=0,o=Object.keys(e);r<o.length;r++){var i=o[r];1===i.length?t.push("\\"+i):n.push(i)}t.sort();for(var a=0;a<t.length-1;a++){for(var s=a;s<t.length-1&&t[s].charCodeAt(1)+1===t[s+1].charCodeAt(1);)s+=1;var l=1+s-a;l<3||t.splice(a,l,t[a]+"-"+t[s])}return n.unshift("["+t.join("")+"]"),new RegExp(n.join("|"),"g")}Kr.encodeHTML=(eo=no,to=ro,function(e){return e.replace(to,(function(e){return eo[e]})).replace(ao,lo)}),Kr.encodeNonAsciiHTML=co(no);var ao=/(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,so=null!=String.prototype.codePointAt?function(e){return e.codePointAt(0)}:function(e){return 1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536};function lo(e){return"&#x"+(e.length>1?so(e):e.charCodeAt(0)).toString(16).toUpperCase()+";"}var uo=new RegExp(Jr.source+"|"+ao.source,"g");function co(e){return function(t){return t.replace(uo,(function(t){return e[t]||lo(t)}))}}Kr.escape=function(e){return e.replace(uo,lo)},Kr.escapeUTF8=function(e){return e.replace(Jr,lo)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeXMLStrict=e.decodeHTML5Strict=e.decodeHTML4Strict=e.decodeHTML5=e.decodeHTML4=e.decodeHTMLStrict=e.decodeHTML=e.decodeXML=e.encodeHTML5=e.encodeHTML4=e.escapeUTF8=e.escape=e.encodeNonAsciiHTML=e.encodeHTML=e.encodeXML=e.encode=e.decodeStrict=e.decode=void 0;var t=Ir,n=Kr;e.decode=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTML)(e)},e.decodeStrict=function(e,n){return(!n||n<=0?t.decodeXML:t.decodeHTMLStrict)(e)},e.encode=function(e,t){return(!t||t<=0?n.encodeXML:n.encodeHTML)(e)};var r=Kr;Object.defineProperty(e,"encodeXML",{enumerable:!0,get:function(){return r.encodeXML}}),Object.defineProperty(e,"encodeHTML",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return r.encodeNonAsciiHTML}}),Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return r.escape}}),Object.defineProperty(e,"escapeUTF8",{enumerable:!0,get:function(){return r.escapeUTF8}}),Object.defineProperty(e,"encodeHTML4",{enumerable:!0,get:function(){return r.encodeHTML}}),Object.defineProperty(e,"encodeHTML5",{enumerable:!0,get:function(){return r.encodeHTML}});var o=Ir;Object.defineProperty(e,"decodeXML",{enumerable:!0,get:function(){return o.decodeXML}}),Object.defineProperty(e,"decodeHTML",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(e,"decodeHTMLStrict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML4",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(e,"decodeHTML5",{enumerable:!0,get:function(){return o.decodeHTML}}),Object.defineProperty(e,"decodeHTML4Strict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(e,"decodeHTML5Strict",{enumerable:!0,get:function(){return o.decodeHTMLStrict}}),Object.defineProperty(e,"decodeXMLStrict",{enumerable:!0,get:function(){return o.decodeXML}})}(Or);var po="&(?:#x[a-f0-9]{1,6}|#[0-9]{1,7}|[a-z][a-z0-9]{1,31});",fo=/[\\&]/,ho="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",mo=new RegExp("\\\\"+ho+"|"+po,"gi"),vo=new RegExp('[&<>"]',"g"),go=function(e){return 92===e.charCodeAt(0)?e.charAt(1):Or.decodeHTML(e)};function yo(e){return fo.test(e)?e.replace(mo,go):e}function bo(e){try{return Dr(e)}catch(t){return e}}function wo(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}}function ko(e){return vo.test(e)?e.replace(vo,wo):e}function xo(e,t){for(var n=[],r=0;r<t;r++)n.push(e);return n.join("")}function Co(e){return!e||!/[^ \t]+/.test(e)}var To=function(){function e(e){this.current=e,this.root=e,this.entering=!0}return e.prototype.next=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=Eo(e);return t&&n?e.firstChild?(this.current=e.firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e.next?(this.current=e.parent,this.entering=!1):(this.current=e.next,this.entering=!0),{entering:t,node:e}},e.prototype.resumeAt=function(e,t){this.current=e,this.entering=!0===t},e}();function Eo(e){switch(e.type){case"document":case"blockQuote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"strike":case"link":case"image":case"table":case"tableHead":case"tableBody":case"tableRow":case"tableCell":case"tableDelimRow":case"customInline":return!0;default:return!1}}var Mo=1,Lo={};function No(e){delete Lo[e]}var So=function(){function e(e,t){this.parent=null,this.prev=null,this.next=null,this.firstChild=null,this.lastChild=null,this.literal=null,this.id="document"===e?-1:Mo++,this.type=e,this.sourcepos=t,Lo[this.id]=this}return e.prototype.isContainer=function(){return Eo(this)},e.prototype.unlink=function(){this.prev?this.prev.next=this.next:this.parent&&(this.parent.firstChild=this.next),this.next?this.next.prev=this.prev:this.parent&&(this.parent.lastChild=this.prev),this.parent=null,this.next=null,this.prev=null},e.prototype.replaceWith=function(e){this.insertBefore(e),this.unlink()},e.prototype.insertAfter=function(e){e.unlink(),e.next=this.next,e.next&&(e.next.prev=e),e.prev=this,this.next=e,this.parent&&(e.parent=this.parent,e.next||(e.parent.lastChild=e))},e.prototype.insertBefore=function(e){e.unlink(),e.prev=this.prev,e.prev&&(e.prev.next=e),e.next=this,this.prev=e,e.parent=this.parent,e.prev||(e.parent.firstChild=e)},e.prototype.appendChild=function(e){e.unlink(),e.parent=this,this.lastChild?(this.lastChild.next=e,e.prev=this.lastChild,this.lastChild=e):(this.firstChild=e,this.lastChild=e)},e.prototype.prependChild=function(e){e.unlink(),e.parent=this,this.firstChild?(this.firstChild.prev=e,e.next=this.firstChild,this.firstChild=e):(this.firstChild=e,this.lastChild=e)},e.prototype.walker=function(){return new To(this)},e}(),Ao=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.open=!0,r.lineOffsets=null,r.stringContent=null,r.lastLineBlank=!1,r.lastLineChecked=!1,r.type=t,r}return Er(t,e),t}(So),Do=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.listData=null,t}return Er(t,e),t}(Ao),Oo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.level=0,t.headingType="atx",t}return Er(t,e),t}(Ao),Io=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isFenced=!1,t.fenceChar=null,t.fenceLength=0,t.fenceOffset=-1,t.info=null,t.infoPadding=0,t}return Er(t,e),t}(Ao),Ro=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.columns=[],t}return Er(t,e),t}(Ao),Po=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.startIdx=0,t.endIdx=0,t.paddingLeft=0,t.paddingRight=0,t.ignored=!1,t}return Er(t,e),t}(Ao),Ho=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.title="",t.dest="",t.label="",t}return Er(t,e),t}(Ao),Bo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.syntaxLength=0,t.offset=-1,t.info="",t}return Er(t,e),t}(Ao),Fo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.htmlBlockType=-1,t}return Er(t,e),t}(Ao),qo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.destination=null,t.title=null,t.extendedAutolink=!1,t}return Er(t,e),t}(So),jo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tickCount=0,t}return Er(t,e),t}(So),_o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.info="",t}return Er(t,e),t}(So);function Uo(e,t){switch(e){case"heading":return new Oo(e,t);case"list":case"item":return new Do(e,t);case"link":case"image":return new qo(e,t);case"codeBlock":return new Io(e,t);case"htmlBlock":return new Fo(e,t);case"table":return new Ro(e,t);case"tableCell":return new Po(e,t);case"document":case"paragraph":case"blockQuote":case"thematicBreak":case"tableRow":case"tableBody":case"tableHead":case"frontMatter":return new Ao(e,t);case"code":return new jo(e,t);case"refDef":return new Ho(e,t);case"customBlock":return new Bo(e,t);case"customInline":return new _o(e,t);default:return new So(e,t)}}function zo(e){return"codeBlock"===e.type}function Vo(e){return"list"===e.type}function Wo(e){return"refDef"===e.type}function $o(e){return"customBlock"===e.type}function Go(e,t){var n=Uo("text",t);return n.literal=e,n}var Xo,Zo="[A-Za-z][A-Za-z0-9-]*",Ko="<"+Zo+"(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",Qo="</"+Zo+"\\s*[>]",Yo=new RegExp("^"+("(?:"+Ko+"|"+Qo+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),"i");if(String.fromCodePoint)Xo=function(e){try{return String.fromCodePoint(e)}catch(e){if(e instanceof RangeError)return String.fromCharCode(65533);throw e}};else{var Jo=String.fromCharCode,ei=Math.floor;Xo=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,r,o=[],i=-1,a=e.length;if(!a)return"";for(var s="";++i<a;){var l=Number(e[i]);if(!isFinite(l)||l<0||l>1114111||ei(l)!==l)return String.fromCharCode(65533);l<=65535?o.push(l):(n=55296+((l-=65536)>>10),r=l%1024+56320,o.push(n,r)),(i+1===a||o.length>16384)&&(s+=Jo.apply(void 0,o),o.length=0)}return s}}var ti=Xo;function ni(e){var t=/\)+$/.exec(e);if(t){for(var n=0,r=0,o=e;r<o.length;r++){var i=o[r];"("===i?n<0?n=1:n+=1:")"===i&&(n-=1)}if(n<0){var a=Math.min(-n,t[0].length);return e.substring(0,e.length-a)}}return e}function ri(e){return e.replace(/&[A-Za-z0-9]+;$/,"")}function oi(e){return Lr(Lr([],function(e){for(var t,n=new RegExp("(www|https?://).(?:[w-]+.)*[A-Za-z0-9-]+.[A-Za-z0-9-]+[^<\\s]*[^<?!.,:*_?~\\s]","g"),r=[];t=n.exec(e);){var o=ri(ni(t[0])),i="www"===t[1]?"http://":"";r.push({text:o,range:[t.index,t.index+o.length-1],url:""+i+o})}return r}(e)),function(e){for(var t,n=new RegExp("[\\w.+-]+@(?:[\\w-]+\\.)+[\\w-]+","g"),r=[];t=n.exec(e);){var o=t[0];/[_-]+$/.test(o)||r.push({text:o,range:[t.index,t.index+o.length-1],url:"mailto:"+o})}return r}(e)).sort((function(e,t){return e.range[0]-t.range[0]}))}function ii(e){return e[e.length-1]}function ai(e){return e.slice(1,e.length-1).trim().replace(/[ \t\r\n]+/," ").toLowerCase().toUpperCase()}function si(e,t){Object.keys(e).forEach((function(n){t(n,e[n])}))}function li(e){return!Object.keys(e).length}var ui=126,ci=39,pi=34,di=36,fi="\\\\"+ho,hi=new RegExp(/[!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/),mi=new RegExp('^(?:"('+fi+'|[^"\\x00])*"|\'('+fi+"|[^'\\x00])*'|\\(("+fi+"|[^()\\x00])*\\))"),vi=/^(?:<(?:[^<>\n\\\x00]|\\.)*>)/,gi=new RegExp("^"+ho),yi=new RegExp("^"+po,"i"),bi=/`+/,wi=/^`+/,ki=/\.\.\./g,xi=/--+/g,Ci=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,Ti=/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i,Ei=/^ *(?:\n *)?/,Mi=/^[ \t\n\x0b\x0c\x0d]/,Li=/^\s/,Ni=/ *$/,Si=/^ */,Ai=/^ *(?:\n|$)/,Di=/^\[(?:[^\\\[\]]|\\.){0,1000}\]/,Oi=/^[^\n`\[\]\\!<&*_'"~$]+/m,Ii=function(){function e(e){this.subject="",this.delimiters=null,this.brackets=null,this.pos=0,this.lineStartNum=0,this.lineIdx=0,this.lineOffsets=[0],this.linePosOffset=0,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.options=e}return e.prototype.sourcepos=function(e,t){var n=this.linePosOffset+this.lineOffsets[this.lineIdx],r=this.lineStartNum+this.lineIdx,o=[r,e+n];return"number"==typeof t?[o,[r,t+n]]:o},e.prototype.nextLine=function(){this.lineIdx+=1,this.linePosOffset=-this.pos},e.prototype.match=function(e){var t=e.exec(this.subject.slice(this.pos));return null===t?null:(this.pos+=t.index+t[0].length,t[0])},e.prototype.peek=function(){return this.pos<this.subject.length?this.subject.charCodeAt(this.pos):-1},e.prototype.spnl=function(){return this.match(Ei),!0},e.prototype.parseBackticks=function(e){var t=this.pos+1,n=this.match(wi);if(null===n)return!1;for(var r,o=this.pos;null!==(r=this.match(bi));)if(r===n){var i=this.subject.slice(o,this.pos-n.length),a=this.sourcepos(t,this.pos),s=i.split("\n");if(s.length>1){var l=ii(s);this.lineIdx+=s.length-1,this.linePosOffset=-(this.pos-l.length-n.length),a[1]=this.sourcepos(this.pos),i=s.join(" ")}var u=Uo("code",a);return i.length>0&&null!==i.match(/[^ ]/)&&" "==i[0]&&" "==i[i.length-1]?u.literal=i.slice(1,i.length-1):u.literal=i,u.tickCount=n.length,e.appendChild(u),!0}return this.pos=o,e.appendChild(Go(n,this.sourcepos(t,this.pos-1))),!0},e.prototype.parseBackslash=function(e){var t,n=this.subject;this.pos+=1;var r=this.pos;return 10===this.peek()?(this.pos+=1,t=Uo("linebreak",this.sourcepos(this.pos-1,this.pos)),e.appendChild(t),this.nextLine()):gi.test(n.charAt(this.pos))?(e.appendChild(Go(n.charAt(this.pos),this.sourcepos(r,this.pos))),this.pos+=1):e.appendChild(Go("\\",this.sourcepos(r,r))),!0},e.prototype.parseAutolink=function(e){var t,n,r,o=this.pos+1;return(t=this.match(Ci))?(n=t.slice(1,t.length-1),(r=Uo("link",this.sourcepos(o,this.pos))).destination=bo("mailto:"+n),r.title="",r.appendChild(Go(n,this.sourcepos(o+1,this.pos-1))),e.appendChild(r),!0):!!(t=this.match(Ti))&&(n=t.slice(1,t.length-1),(r=Uo("link",this.sourcepos(o,this.pos))).destination=bo(n),r.title="",r.appendChild(Go(n,this.sourcepos(o+1,this.pos-1))),e.appendChild(r),!0)},e.prototype.parseHtmlTag=function(e){var t=this.pos+1,n=this.match(Yo);if(null===n)return!1;var r=Uo("htmlInline",this.sourcepos(t,this.pos));return r.literal=n,e.appendChild(r),!0},e.prototype.scanDelims=function(e){var t=0,n=this.pos;if(e===ci||e===pi)t++,this.pos++;else for(;this.peek()===e;)t++,this.pos++;if(0===t||t<2&&(e===ui||e===di))return this.pos=n,null;var r,o=0===n?"\n":this.subject.charAt(n-1),i=this.peek();r=-1===i?"\n":ti(i);var a,s,l=Li.test(r),u=hi.test(r),c=Li.test(o),p=hi.test(o),d=!l&&(!u||c||p),f=!c&&(!p||l||u);return 95===e?(a=d&&(!f||p),s=f&&(!d||u)):e===ci||e===pi?(a=d&&!f,s=f):e===di?(a=!l,s=!c):(a=d,s=f),this.pos=n,{numdelims:t,canOpen:a,canClose:s}},e.prototype.handleDelim=function(e,t){var n=this.scanDelims(e);if(!n)return!1;var r=n.numdelims,o=this.pos+1;this.pos+=r;var i=Go(e===ci?"?":e===pi?"?":this.subject.slice(o-1,this.pos),this.sourcepos(o,this.pos));return t.appendChild(i),(n.canOpen||n.canClose)&&(this.options.smart||e!==ci&&e!==pi)&&(this.delimiters={cc:e,numdelims:r,origdelims:r,node:i,previous:this.delimiters,next:null,canOpen:n.canOpen,canClose:n.canClose},this.delimiters.previous&&(this.delimiters.previous.next=this.delimiters)),!0},e.prototype.removeDelimiter=function(e){null!==e.previous&&(e.previous.next=e.next),null===e.next?this.delimiters=e.previous:e.next.previous=e.previous},e.prototype.removeDelimitersBetween=function(e,t){e.next!==t&&(e.next=t,t.previous=e)},e.prototype.processEmphasis=function(e){var t,n,r,o,i,a,s,l=!1,u=((t={})[95]=[e,e,e],t[42]=[e,e,e],t[39]=[e],t[34]=[e],t[126]=[e],t[36]=[e],t);for(r=this.delimiters;null!==r&&r.previous!==e;)r=r.previous;for(;null!==r;){var c=r.cc,p=95===c||42===c;if(r.canClose){for(n=r.previous,s=!1;null!==n&&n!==e&&n!==u[c][p?r.origdelims%3:0];){if(l=p&&(r.canOpen||n.canClose)&&r.origdelims%3!=0&&(n.origdelims+r.origdelims)%3==0,n.cc===r.cc&&n.canOpen&&!l){s=!0;break}n=n.previous}if(o=r,p||c===ui||c===di)if(s){if(n){var d=r.numdelims>=2&&n.numdelims>=2?2:1,f=p?0:1;i=n.node,a=r.node;var h=p?1===d?"emph":"strong":"strike";c===di&&(h="customInline");var m=Uo(h),v=i.sourcepos[1],g=a.sourcepos[0];m.sourcepos=[[v[0],v[1]-d+1],[g[0],g[1]+d-1]],i.sourcepos[1][1]-=d,a.sourcepos[0][1]+=d,i.literal=i.literal.slice(d),a.literal=a.literal.slice(d),n.numdelims-=d,r.numdelims-=d;for(var y=i.next,b=void 0;y&&y!==a;)b=y.next,y.unlink(),m.appendChild(y),y=b;if(c===di){var w=m.firstChild,k=w.literal||"",x=k.split(/\s/)[0];m.info=x,k.length<=x.length?w.unlink():(w.sourcepos[0][1]+=x.length,w.literal=k.replace(x+" ",""))}if(i.insertAfter(m),this.removeDelimitersBetween(n,r),n.numdelims<=f&&(0===n.numdelims&&i.unlink(),this.removeDelimiter(n)),r.numdelims<=f){0===r.numdelims&&a.unlink();var C=r.next;this.removeDelimiter(r),r=C}}}else r=r.next;else c===ci?(r.node.literal="?",s&&(n.node.literal="?"),r=r.next):c===pi&&(r.node.literal="?",s&&(n.node.literal="?"),r=r.next);s||(u[c][p?o.origdelims%3:0]=o.previous,o.canOpen||this.removeDelimiter(o))}else r=r.next}for(;null!==this.delimiters&&this.delimiters!==e;)this.removeDelimiter(this.delimiters)},e.prototype.parseLinkTitle=function(){var e=this.match(mi);return null===e?null:yo(e.substr(1,e.length-2))},e.prototype.parseLinkDestination=function(){var e=this.match(vi);if(null===e){if(60===this.peek())return null;for(var t=this.pos,n=0,r=void 0;-1!==(r=this.peek());)if(92===r&&gi.test(this.subject.charAt(this.pos+1)))this.pos+=1,-1!==this.peek()&&(this.pos+=1);else if(40===r)this.pos+=1,n+=1;else if(41===r){if(n<1)break;this.pos+=1,n-=1}else{if(null!==Mi.exec(ti(r)))break;this.pos+=1}return this.pos===t&&41!==r||0!==n?null:bo(yo(e=this.subject.substr(t,this.pos-t)))}return bo(yo(e.substr(1,e.length-2)))},e.prototype.parseLinkLabel=function(){var e=this.match(Di);return null===e||e.length>1001?0:e.length},e.prototype.parseOpenBracket=function(e){var t=this.pos;this.pos+=1;var n=Go("[",this.sourcepos(this.pos,this.pos));return e.appendChild(n),this.addBracket(n,t,!1),!0},e.prototype.parseBang=function(e){var t=this.pos;if(this.pos+=1,91===this.peek()){this.pos+=1;var n=Go("![",this.sourcepos(this.pos-1,this.pos));e.appendChild(n),this.addBracket(n,t+1,!0)}else{n=Go("!",this.sourcepos(this.pos,this.pos));e.appendChild(n)}return!0},e.prototype.parseCloseBracket=function(e){var t=null,n=null,r=!1;this.pos+=1;var o=this.pos,i=this.brackets;if(null===i)return e.appendChild(Go("]",this.sourcepos(o,o))),!0;if(!i.active)return e.appendChild(Go("]",this.sourcepos(o,o))),this.removeBracket(),!0;var a=i.image,s=this.pos;40===this.peek()&&(this.pos++,this.spnl()&&null!==(t=this.parseLinkDestination())&&this.spnl()&&(Mi.test(this.subject.charAt(this.pos-1))&&(n=this.parseLinkTitle()),1)&&this.spnl()&&41===this.peek()?(this.pos+=1,r=!0):this.pos=s);var l="";if(!r){var u=this.pos,c=this.parseLinkLabel();if(c>2?l=this.subject.slice(u,u+c):i.bracketAfter||(l=this.subject.slice(i.index,o)),0===c&&(this.pos=s),l){l=ai(l);var p=this.refMap[l];p&&(t=p.destination,n=p.title,r=!0)}}if(r){var d=Uo(a?"image":"link");d.destination=t,d.title=n||"",d.sourcepos=[i.startpos,this.sourcepos(this.pos)];for(var f=i.node.next,h=void 0;f;)h=f.next,f.unlink(),d.appendChild(f),f=h;if(e.appendChild(d),this.processEmphasis(i.previousDelimiter),this.removeBracket(),i.node.unlink(),!a)for(i=this.brackets;null!==i;)i.image||(i.active=!1),i=i.previous;return this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0}return this.removeBracket(),this.pos=o,e.appendChild(Go("]",this.sourcepos(o,o))),this.options.referenceDefinition&&(this.refLinkCandidateMap[e.id]={node:e,refLabel:l}),!0},e.prototype.addBracket=function(e,t,n){null!==this.brackets&&(this.brackets.bracketAfter=!0),this.brackets={node:e,startpos:this.sourcepos(t+(n?0:1)),previous:this.brackets,previousDelimiter:this.delimiters,index:t,image:n,active:!0}},e.prototype.removeBracket=function(){this.brackets&&(this.brackets=this.brackets.previous)},e.prototype.parseEntity=function(e){var t,n=this.pos+1;return!!(t=this.match(yi))&&(e.appendChild(Go(Or.decodeHTML(t),this.sourcepos(n,this.pos))),!0)},e.prototype.parseString=function(e){var t,n=this.pos+1;if(t=this.match(Oi)){if(this.options.smart){var r=t.replace(ki,"?").replace(xi,(function(e){var t=0,n=0;return e.length%3==0?n=e.length/3:e.length%2==0?t=e.length/2:e.length%3==2?(t=1,n=(e.length-2)/3):(t=2,n=(e.length-4)/3),xo("?",n)+xo("?",t)}));e.appendChild(Go(r,this.sourcepos(n,this.pos)))}else{var o=Go(t,this.sourcepos(n,this.pos));e.appendChild(o)}return!0}return!1},e.prototype.parseNewline=function(e){this.pos+=1;var t=e.lastChild;if(t&&"text"===t.type&&" "===t.literal[t.literal.length-1]){var n=" "===t.literal[t.literal.length-2],r=t.literal.length;t.literal=t.literal.replace(Ni,"");var o=r-t.literal.length;t.sourcepos[1][1]-=o,e.appendChild(Uo(n?"linebreak":"softbreak",this.sourcepos(this.pos-o,this.pos)))}else e.appendChild(Uo("softbreak",this.sourcepos(this.pos,this.pos)));return this.nextLine(),this.match(Si),!0},e.prototype.parseReference=function(e,t){if(!this.options.referenceDefinition)return 0;this.subject=e.stringContent,this.pos=0;var n=null,r=this.pos,o=this.parseLinkLabel();if(0===o)return 0;var i=this.subject.substr(0,o);if(58!==this.peek())return this.pos=r,0;this.pos++,this.spnl();var a=this.parseLinkDestination();if(null===a)return this.pos=r,0;var s=this.pos;this.spnl(),this.pos!==s&&(n=this.parseLinkTitle()),null===n&&(n="",this.pos=s);var l=!0;if(null===this.match(Ai)&&(""===n?l=!1:(n="",this.pos=s,l=null!==this.match(Ai))),!l)return this.pos=r,0;var u=ai(i);if(""===u)return this.pos=r,0;var c=this.getReferenceDefSourcepos(e);e.sourcepos[0][0]=c[1][0]+1;var p=Uo("refDef",c);return p.title=n,p.dest=a,p.label=u,e.insertBefore(p),t[u]?this.refDefCandidateMap[p.id]=p:t[u]=Ma(p),this.pos-r},e.prototype.mergeTextNodes=function(e){for(var t,n=[];t=e.next();){var r=t.entering,o=t.node;if(r&&"text"===o.type)n.push(o);else if(1===n.length)n=[];else if(n.length>1){var i=n[0],a=n[n.length-1];i.sourcepos&&a.sourcepos&&(i.sourcepos[1]=a.sourcepos[1]),i.next=a.next,i.next&&(i.next.prev=i);for(var s=1;s<n.length;s+=1)i.literal+=n[s].literal,n[s].unlink();n=[]}}},e.prototype.getReferenceDefSourcepos=function(e){for(var t=e.stringContent.split(/\n|\r\n/),n=!1,r=0,o={line:0,ch:0},i=0;i<t.length;i+=1){var a=t[i];if(Mi.test(a))break;if(/\:/.test(a)&&0===r){if(n)break;var s=a.indexOf(":")===a.length-1?i+1:i;o={line:s,ch:t[s].length},n=!0}var l=a.match(/'|"/g);if(l&&(r+=l.length),2===r){o={line:i,ch:a.length};break}}return[[e.sourcepos[0][0],e.sourcepos[0][1]],[e.sourcepos[0][0]+o.line,o.ch]]},e.prototype.parseInline=function(e){var t,n=!1,r=this.peek();if(-1===r)return!1;switch(r){case 10:n=this.parseNewline(e);break;case 92:n=this.parseBackslash(e);break;case 96:n=this.parseBackticks(e);break;case 42:case 95:case ui:case di:n=this.handleDelim(r,e);break;case ci:case pi:n=!!(null===(t=this.options)||void 0===t?void 0:t.smart)&&this.handleDelim(r,e);break;case 91:n=this.parseOpenBracket(e);break;case 33:n=this.parseBang(e);break;case 93:n=this.parseCloseBracket(e);break;case 60:n=this.parseAutolink(e)||this.parseHtmlTag(e);break;case 38:e.disabledEntityParse||(n=this.parseEntity(e));break;default:n=this.parseString(e)}return n||(this.pos+=1,e.appendChild(Go(ti(r),this.sourcepos(this.pos,this.pos+1)))),!0},e.prototype.parse=function(e){for(this.subject=e.stringContent.trim(),this.pos=0,this.delimiters=null,this.brackets=null,this.lineOffsets=e.lineOffsets||[0],this.lineIdx=0,this.linePosOffset=0,this.lineStartNum=e.sourcepos[0][0],function(e){return"heading"===e.type}(e)&&(this.lineOffsets[0]+=e.level+1);this.parseInline(e););e.stringContent=null,this.processEmphasis(null),this.mergeTextNodes(e.walker());var t=this.options,n=t.extendedAutolinks,r=t.customParser;if(n&&function(e,t){var n;"boolean"==typeof t&&(t=oi);for(var r=function(){var e=n.entering,r=n.node;if(e&&"text"===r.type&&"link"!==r.parent.type){var o=r.literal,i=t(o);if(!i||!i.length)return"continue";for(var a=0,s=r.sourcepos[0],l=s[0],u=s[1],c=function(e,t){return[[l,u+e],[l,u+t]]},p=[],d=0,f=i;d<f.length;d++){var h=f[d],m=h.range,v=h.url,g=h.text;m[0]>a&&p.push(Go(o.substring(a,m[0]),c(a,m[0]-1)));var y=Uo("link",c.apply(void 0,m));y.appendChild(Go(g,c.apply(void 0,m))),y.destination=v,y.extendedAutolink=!0,p.push(y),a=m[1]+1}a<o.length&&p.push(Go(o.substring(a),c(a,o.length-1)));for(var b=0,w=p;b<w.length;b++){var k=w[b];r.insertBefore(k)}r.unlink()}};n=e.next();)r()}(e.walker(),n),r&&e.firstChild)for(var o,i=e.firstChild.walker();o=i.next();){var a=o.node,s=o.entering;r[a.type]&&r[a.type](a,{entering:s,options:this.options})}},e}(),Ri=/^\[([ \txX])\][ \t]+/;var Pi=/[^ \t\f\v\r\n]/,Hi=/^(?:`{3,}|~{3,})(?= *$)/;function Bi(e){for(var t=e;t;){if(t.lastLineBlank)return!0;var n=t.type;if(t.lastLineChecked||"list"!==n&&"item"!==n){t.lastLineChecked=!0;break}t.lastLineChecked=!0,t=t.lastChild}return!1}function Fi(e,t){return t<e.length?e.charCodeAt(t):-1}function qi(e){return!Pi.test(e)}function ji(e){return 32===e||9===e}var _i=/^\$\$$/,Ui={continue:function(e,t){var n=e.currentLine,r=n.match(_i);if(r)return e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2;for(var o=t.offset;o>0&&ji(Fi(n,e.offset));)e.advanceOffset(1,!0),o--;return 0},finalize:function(e,t){if(null!==t.stringContent){var n=t.stringContent,r=n.indexOf("\n"),o=n.slice(0,r),i=n.slice(r+1),a=o.match(/^(\s*)(.*)/);t.info=yo(a[2].trim()),t.literal=i,t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},zi={continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!0},Vi={continue:function(){return 0},finalize:function(e,t){for(var n=t.firstChild;n;){if(Bi(n)&&n.next){t.listData.tight=!1;break}for(var r=n.firstChild;r;){if(Bi(r)&&(n.next||r.next)){t.listData.tight=!1;break}r=r.next}n=n.next}},canContain:function(e){return"item"===e},acceptsLines:!1},Wi={continue:function(e,t){if(e.blank){if(null===t.firstChild)return 1;e.advanceNextNonspace()}else{if(!(e.indent>=t.listData.markerOffset+t.listData.padding))return 1;e.advanceOffset(t.listData.markerOffset+t.listData.padding,!0)}return 0},finalize:function(e,t){if(t.firstChild&&"paragraph"===t.firstChild.type){var n=t.firstChild,r=n.stringContent.match(Ri);if(r){var o=r[0].length;n.stringContent=n.stringContent.substring(o-1),n.sourcepos[0][1]+=o,n.lineOffsets[0]+=o,t.listData.task=!0,t.listData.checked=/[xX]/.test(r[1])}}},canContain:function(e){return"item"!==e},acceptsLines:!1},$i={continue:function(e,t){var n=e.currentLine,r=e.indent;if(t.isFenced){var o=r<=3&&n.charAt(e.nextNonspace)===t.fenceChar&&n.slice(e.nextNonspace).match(Hi);if(o&&o[0].length>=t.fenceLength)return e.lastLineLength=e.offset+r+o[0].length,e.finalize(t,e.lineNumber),2;for(var i=t.fenceOffset;i>0&&ji(Fi(n,e.offset));)e.advanceOffset(1,!0),i--}else if(r>=4)e.advanceOffset(4,!0);else{if(!e.blank)return 1;e.advanceNextNonspace()}return 0},finalize:function(e,t){var n;if(null!==t.stringContent){if(t.isFenced){var r=t.stringContent,o=r.indexOf("\n"),i=r.slice(0,o),a=r.slice(o+1),s=i.match(/^(\s*)(.*)/);t.infoPadding=s[1].length,t.info=yo(s[2].trim()),t.literal=a}else t.literal=null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,"\n");t.stringContent=null}},canContain:function(){return!1},acceptsLines:!0},Gi={continue:function(e){return e.blank?1:0},finalize:function(e,t){if(null!==t.stringContent){for(var n,r=!1;91===Fi(t.stringContent,0)&&(n=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(n),r=!0;r&&qi(t.stringContent)&&t.unlink()}},canContain:function(){return!1},acceptsLines:!0},Xi={document:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},list:Vi,blockQuote:{continue:function(e){var t=e.currentLine;return e.indented||62!==Fi(t,e.nextNonspace)?1:(e.advanceNextNonspace(),e.advanceOffset(1,!1),ji(Fi(t,e.offset))&&e.advanceOffset(1,!0),0)},finalize:function(){},canContain:function(e){return"item"!==e},acceptsLines:!1},item:Wi,heading:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},thematicBreak:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},codeBlock:$i,htmlBlock:{continue:function(e,t){return!e.blank||6!==t.htmlBlockType&&7!==t.htmlBlockType?0:1},finalize:function(e,t){var n;t.literal=(null===(n=t.stringContent)||void 0===n?void 0:n.replace(/(\n *)+$/,""))||null,t.stringContent=null},canContain:function(){return!1},acceptsLines:!0},paragraph:Gi,table:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableHead"===e||"tableBody"===e},acceptsLines:!1},tableBody:{continue:function(){return 0},finalize:function(){},canContain:function(e){return"tableRow"===e},acceptsLines:!1},tableHead:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableRow"===e||"tableDelimRow"===e},acceptsLines:!1},tableRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableCell"===e},acceptsLines:!1},tableCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},tableDelimRow:{continue:function(){return 1},finalize:function(){},canContain:function(e){return"tableDelimCell"===e},acceptsLines:!1},tableDelimCell:{continue:function(){return 1},finalize:function(){},canContain:function(){return!1},acceptsLines:!1},refDef:zi,customBlock:Ui,frontMatter:zi};function Zi(e){for(var t=0,n=0,r=[],o=0;o<e.length;o+=1)if("|"===e[o]&&"\\"!==e[o-1]){var i=e.substring(t,o);0===t&&Co(i)?n=o+1:r.push(i),t=o+1}t<e.length&&(Co(i=e.substring(t,e.length))||r.push(i));return[n,r]}function Ki(e,t,n,r){for(var o=[],i=0,a=t;i<a.length;i++){var s=a[i],l=s.match(/^[ \t]+/),u=l?l[0].length:0,c=void 0,p=void 0;if(u===s.length)u=0,c=0,p="";else{var d=s.match(/[ \t]+$/);c=d?d[0].length:0,p=s.slice(u,s.length-c)}var f=r+u,h=Uo(e,[[n,r],[n,r+s.length-1]]);h.stringContent=p.replace(/\\\|/g,"|"),h.startIdx=o.length,h.endIdx=o.length,h.lineOffsets=[f-1],h.paddingLeft=u,h.paddingRight=c,o.push(h),r+=s.length+1}return o}function Qi(e){var t=null,n=e.stringContent,r=n[0];return":"===n[n.length-1]?t=":"===r?"center":"right":":"===r&&(t="left"),{align:t}}var Yi=/^(\$\$)(\s*[a-zA-Z])+/,Ji=/^(\$\$)(\s*[a-zA-Z])+.*(\$\$)/,ea=/^`{3,}(?!.*`)|^~{3,}/,ta=[/./,/^<(?:script|pre|style)(?:\s|>|$)/i,/^<!--/,/^<[?]/,/^<![A-Z]/,/^<!\[CDATA\[/,/^<[/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[/]?[>]|$)/i,new RegExp("^(?:"+Ko+"|"+Qo+")\\s*$","i")],na=/^(?:=+|-+)[ \t]*$/,ra=/^#{1,6}(?:[ \t]+|$)/,oa=/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/,ia=/^[*+-]/,aa=/^(\d{1,9})([.)])/;function sa(e,t){return e.options.disallowDeepHeading&&("blockQuote"===t.type||"item"===t.type)}var la=[function(e){return e.indented||62!==Fi(e.currentLine,e.nextNonspace)?0:(e.advanceNextNonspace(),e.advanceOffset(1,!1),ji(Fi(e.currentLine,e.offset))&&e.advanceOffset(1,!0),e.closeUnmatchedBlocks(),e.addChild("blockQuote",e.nextNonspace),1)},function(e,t){var n;if(!e.indented&&!sa(e,t)&&(n=e.currentLine.slice(e.nextNonspace).match(ra))){e.advanceNextNonspace(),e.advanceOffset(n[0].length,!1),e.closeUnmatchedBlocks();var r=e.addChild("heading",e.nextNonspace);return r.level=n[0].trim().length,r.headingType="atx",r.stringContent=e.currentLine.slice(e.offset).replace(/^[ \t]*#+[ \t]*$/,"").replace(/[ \t]+#+[ \t]*$/,""),e.advanceOffset(e.currentLine.length-e.offset),2}return 0},function(e){var t;if(!e.indented&&(t=e.currentLine.slice(e.nextNonspace).match(ea))){var n=t[0].length;e.closeUnmatchedBlocks();var r=e.addChild("codeBlock",e.nextNonspace);return r.isFenced=!0,r.fenceLength=n,r.fenceChar=t[0][0],r.fenceOffset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0},function(e,t){if(!e.indented&&60===Fi(e.currentLine,e.nextNonspace)){var n=e.currentLine.slice(e.nextNonspace),r=e.options.disallowedHtmlBlockTags,o=void 0;for(o=1;o<=7;o++){var i=n.match(ta[o]);if(i){if(7===o){if("paragraph"===t.type)return 0;if(r.length>0)if(new RegExp("</?(?:"+r.join("|")+")","i").test(i[0]))return 0}return e.closeUnmatchedBlocks(),e.addChild("htmlBlock",e.offset).htmlBlockType=o,2}}}return 0},function(e,t){var n;if(null!==t.stringContent&&!e.indented&&"paragraph"===t.type&&!sa(e,t.parent)&&(n=e.currentLine.slice(e.nextNonspace).match(na))){e.closeUnmatchedBlocks();for(var r=void 0;91===Fi(t.stringContent,0)&&(r=e.inlineParser.parseReference(t,e.refMap));)t.stringContent=t.stringContent.slice(r);if(t.stringContent.length>0){var o=Uo("heading",t.sourcepos);return o.level="="===n[0][0]?1:2,o.headingType="setext",o.stringContent=t.stringContent,t.insertAfter(o),t.unlink(),e.tip=o,e.advanceOffset(e.currentLine.length-e.offset,!1),2}return 0}return 0},function(e){return!e.indented&&oa.test(e.currentLine.slice(e.nextNonspace))?(e.closeUnmatchedBlocks(),e.addChild("thematicBreak",e.nextNonspace),e.advanceOffset(e.currentLine.length-e.offset,!1),2):0},function(e,t){var n,r,o,i=t;return e.indented&&"list"!==t.type||!(n=function(e,t){var n,r,o=e.currentLine.slice(e.nextNonspace),i={type:"bullet",tight:!0,bulletChar:"",start:0,delimiter:"",padding:0,markerOffset:e.indent,task:!1,checked:!1};if(e.indent>=4)return null;if(n=o.match(ia))i.type="bullet",i.bulletChar=n[0][0];else{if(!(n=o.match(aa))||"paragraph"===t.type&&"1"!==n[1])return null;i.type="ordered",i.start=parseInt(n[1],10),i.delimiter=n[2]}if(-1!==(r=Fi(e.currentLine,e.nextNonspace+n[0].length))&&9!==r&&32!==r)return null;if("paragraph"===t.type&&!e.currentLine.slice(e.nextNonspace+n[0].length).match(Pi))return null;e.advanceNextNonspace(),e.advanceOffset(n[0].length,!0);var a=e.column,s=e.offset;do{e.advanceOffset(1,!0),r=Fi(e.currentLine,e.offset)}while(e.column-a<5&&ji(r));var l=-1===Fi(e.currentLine,e.offset),u=e.column-a;return u>=5||u<1||l?(i.padding=n[0].length+1,e.column=a,e.offset=s,ji(Fi(e.currentLine,e.offset))&&e.advanceOffset(1,!0)):i.padding=n[0].length+u,i}(e,i))?0:(e.closeUnmatchedBlocks(),"list"===e.tip.type&&(r=i.listData,o=n,r.type===o.type&&r.delimiter===o.delimiter&&r.bulletChar===o.bulletChar)||((i=e.addChild("list",e.nextNonspace)).listData=n),(i=e.addChild("item",e.nextNonspace)).listData=n,1)},function(e){return e.indented&&"paragraph"!==e.tip.type&&!e.blank?(e.advanceOffset(4,!0),e.closeUnmatchedBlocks(),e.addChild("codeBlock",e.offset),2):0},function(e,t){var n=t.stringContent;if("paragraph"===t.type&&!e.indented&&!e.blank){var r=n.length-1,o=n.lastIndexOf("\n",r-1)+1,i=n.slice(o,r),a=e.currentLine.slice(e.nextNonspace),s=Zi(i),l=s[0],u=s[1],c=Zi(a),p=c[0],d=c[1],f=/^[ \t]*:?-+:?[ \t]*$/;if(!u.length||!d.length||d.some((function(e){return!f.test(e)}))||1===d.length&&0!==a.indexOf("|"))return 0;var h=t.lineOffsets,m=e.lineNumber-1,v=ii(h)+1,g=Uo("table",[[m,v],[e.lineNumber,e.offset]]);if(g.columns=d.map((function(){return{align:null}})),t.insertAfter(g),1===h.length)t.unlink();else{t.stringContent=n.slice(0,o);var y=o-(n.lastIndexOf("\n",o-2)+1)-1;e.lastLineLength=h[h.length-2]+y,e.finalize(t,m-1)}e.advanceOffset(e.currentLine.length-e.offset,!1);var b=Uo("tableHead",[[m,v],[e.lineNumber,e.offset]]);g.appendChild(b);var w=Uo("tableRow",[[m,v],[m,v+i.length-1]]),k=Uo("tableDelimRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.offset]]);b.appendChild(w),b.appendChild(k),Ki("tableCell",u,m,v+l).forEach((function(e){w.appendChild(e)}));var x=Ki("tableDelimCell",d,e.lineNumber,e.nextNonspace+1+p);return x.forEach((function(e){k.appendChild(e)})),g.columns=x.map(Qi),e.tip=g,2}return 0},function(e,t){if("table"!==t.type&&"tableBody"!==t.type||!e.blank&&-1===e.currentLine.indexOf("|"))return 0;if(e.advanceOffset(e.currentLine.length-e.offset,!1),e.blank){var n=t;return"tableBody"===t.type&&(n=t.parent,e.finalize(t,e.lineNumber-1)),e.finalize(n,e.lineNumber-1),0}var r=t;"table"===t.type&&((r=e.addChild("tableBody",e.nextNonspace)).stringContent=null);var o=Uo("tableRow",[[e.lineNumber,e.nextNonspace+1],[e.lineNumber,e.currentLine.length]]);r.appendChild(o);var i=r.parent,a=Zi(e.currentLine.slice(e.nextNonspace)),s=a[0];return Ki("tableCell",a[1],e.lineNumber,e.nextNonspace+1+s).forEach((function(e,t){t>=i.columns.length&&(e.ignored=!0),o.appendChild(e)})),2},function(e){var t;if(!e.indented&&!Ji.test(e.currentLine)&&(t=e.currentLine.match(Yi))){var n=t[1].length;e.closeUnmatchedBlocks();var r=e.addChild("customBlock",e.nextNonspace);return r.syntaxLength=n,r.offset=e.indent,e.advanceNextNonspace(),e.advanceOffset(n,!1),2}return 0}],ua=/^(-{3}|\+{3}|;{3})$/,ca=function(e,t){var n=e.currentLine,r=e.lineNumber,o=e.indented;return 1===r&&!o&&"document"===t.type&&ua.test(n)?(e.closeUnmatchedBlocks(),e.addChild("frontMatter",e.nextNonspace).stringContent=n,e.advanceNextNonspace(),e.advanceOffset(n.length,!1),2):0},pa={continue:function(e,t){var n=e.currentLine,r=n.match(ua);return"frontMatter"===t.type&&r?(t.stringContent+=n,e.lastLineLength=r[0].length,e.finalize(t,e.lineNumber),2):0},finalize:function(e,t){null!==t.stringContent&&(t.literal=t.stringContent,t.stringContent=null)},canContain:function(){return!1},acceptsLines:!0},da=[/./,/<\/(?:script|pre|style)>/i,/-->/,/\?>/,/>/,/\]\]>/],fa=/^[#`~*+_=<>0-9-;$]/,ha=/\r\n|\n|\r/;function ma(){return Uo("document",[[1,1],[0,0]])}var va={smart:!1,tagFilter:!1,extendedAutolinks:!1,disallowedHtmlBlockTags:[],referenceDefinition:!1,disallowDeepHeading:!1,customParser:null,frontMatter:!1},ga=function(){function e(e){this.options=Mr(Mr({},va),e),this.doc=ma(),this.tip=this.doc,this.oldtip=this.doc,this.lineNumber=0,this.offset=0,this.column=0,this.nextNonspace=0,this.nextNonspaceColumn=0,this.indent=0,this.currentLine="",this.indented=!1,this.blank=!1,this.partiallyConsumedTab=!1,this.allClosed=!0,this.lastMatchedContainer=this.doc,this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.lastLineLength=0,this.lines=[],this.options.frontMatter&&(Xi.frontMatter=pa,la.unshift(ca)),this.inlineParser=new Ii(this.options)}return e.prototype.advanceOffset=function(e,t){void 0===t&&(t=!1);for(var n,r,o,i=this.currentLine;e>0&&(o=i[this.offset]);)"\t"===o?(n=4-this.column%4,t?(this.partiallyConsumedTab=n>e,r=n>e?e:n,this.column+=r,this.offset+=this.partiallyConsumedTab?0:1,e-=r):(this.partiallyConsumedTab=!1,this.column+=n,this.offset+=1,e-=1)):(this.partiallyConsumedTab=!1,this.offset+=1,this.column+=1,e-=1)},e.prototype.advanceNextNonspace=function(){this.offset=this.nextNonspace,this.column=this.nextNonspaceColumn,this.partiallyConsumedTab=!1},e.prototype.findNextNonspace=function(){for(var e,t=this.currentLine,n=this.offset,r=this.column;""!==(e=t.charAt(n));)if(" "===e)n++,r++;else{if("\t"!==e)break;n++,r+=4-r%4}this.blank="\n"===e||"\r"===e||""===e,this.nextNonspace=n,this.nextNonspaceColumn=r,this.indent=this.nextNonspaceColumn-this.column,this.indented=this.indent>=4},e.prototype.addLine=function(){if(this.partiallyConsumedTab){this.offset+=1;var e=4-this.column%4;this.tip.stringContent+=xo(" ",e)}this.tip.lineOffsets?this.tip.lineOffsets.push(this.offset):this.tip.lineOffsets=[this.offset],this.tip.stringContent+=this.currentLine.slice(this.offset)+"\n"},e.prototype.addChild=function(e,t){for(;!Xi[this.tip.type].canContain(e);)this.finalize(this.tip,this.lineNumber-1);var n=t+1,r=Uo(e,[[this.lineNumber,n],[0,0]]);return r.stringContent="",this.tip.appendChild(r),this.tip=r,r},e.prototype.closeUnmatchedBlocks=function(){if(!this.allClosed){for(;this.oldtip!==this.lastMatchedContainer;){var e=this.oldtip.parent;this.finalize(this.oldtip,this.lineNumber-1),this.oldtip=e}this.allClosed=!0}},e.prototype.finalize=function(e,t){var n=e.parent;e.open=!1,e.sourcepos[1]=[t,this.lastLineLength],Xi[e.type].finalize(this,e),this.tip=n},e.prototype.processInlines=function(e){var t,n=this.options.customParser,r=e.walker();for(this.inlineParser.refMap=this.refMap,this.inlineParser.refLinkCandidateMap=this.refLinkCandidateMap,this.inlineParser.refDefCandidateMap=this.refDefCandidateMap,this.inlineParser.options=this.options;t=r.next();){var o=t.node,i=t.entering,a=o.type;n&&n[a]&&n[a](o,{entering:i,options:this.options}),i||"paragraph"!==a&&"heading"!==a&&("tableCell"!==a||o.ignored)||this.inlineParser.parse(o)}},e.prototype.incorporateLine=function(e){var t=this.doc;this.oldtip=this.tip,this.offset=0,this.column=0,this.blank=!1,this.partiallyConsumedTab=!1,this.lineNumber+=1,-1!==e.indexOf("\0")&&(e=e.replace(/\0/g,"?")),this.currentLine=e;for(var n,r=!0;(n=t.lastChild)&&n.open;){switch(t=n,this.findNextNonspace(),Xi[t.type].continue(this,t)){case 0:break;case 1:r=!1;break;case 2:return void(this.lastLineLength=e.length);default:throw new Error("continue returned illegal value, must be 0, 1, or 2")}if(!r){t=t.parent;break}}this.allClosed=t===this.oldtip,this.lastMatchedContainer=t;for(var o="paragraph"!==t.type&&Xi[t.type].acceptsLines,i=la.length;!o;){if(this.findNextNonspace(),"table"!==t.type&&"tableBody"!==t.type&&"paragraph"!==t.type&&!this.indented&&!fa.test(e.slice(this.nextNonspace))){this.advanceNextNonspace();break}for(var a=0;a<i;){var s=la[a](this,t);if(1===s){t=this.tip;break}if(2===s){t=this.tip,o=!0;break}a++}if(a===i){this.advanceNextNonspace();break}}if(this.allClosed||this.blank||"paragraph"!==this.tip.type){this.closeUnmatchedBlocks(),this.blank&&t.lastChild&&(t.lastChild.lastLineBlank=!0);for(var l=t.type,u=this.blank&&!("blockQuote"===l||zo(t)&&t.isFenced||"item"===l&&!t.firstChild&&t.sourcepos[0][0]===this.lineNumber),c=t;c;)c.lastLineBlank=u,c=c.parent;Xi[l].acceptsLines?(this.addLine(),function(e){return"htmlBlock"===e.type}(t)&&t.htmlBlockType>=1&&t.htmlBlockType<=5&&da[t.htmlBlockType].test(this.currentLine.slice(this.offset))&&(this.lastLineLength=e.length,this.finalize(t,this.lineNumber))):this.offset<e.length&&!this.blank&&(t=this.addChild("paragraph",this.offset),this.advanceNextNonspace(),this.addLine())}else this.addLine();this.lastLineLength=e.length},e.prototype.parse=function(e,t){this.doc=ma(),this.tip=this.doc,this.lineNumber=0,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";var n=e.split(ha),r=n.length;this.lines=t||n,this.options.referenceDefinition&&this.clearRefMaps(),10===e.charCodeAt(e.length-1)&&(r-=1);for(var o=0;o<r;o++)this.incorporateLine(n[o]);for(;this.tip;)this.finalize(this.tip,r);return this.processInlines(this.doc),this.doc},e.prototype.partialParseStart=function(e,t){this.doc=ma(),this.tip=this.doc,this.lineNumber=e-1,this.lastLineLength=0,this.offset=0,this.column=0,this.lastMatchedContainer=this.doc,this.currentLine="";for(var n=t.length,r=0;r<n;r++)this.incorporateLine(t[r]);return this.doc},e.prototype.partialParseExtends=function(e){for(var t=0;t<e.length;t++)this.incorporateLine(e[t])},e.prototype.partialParseFinish=function(){for(;this.tip;)this.finalize(this.tip,this.lineNumber);this.processInlines(this.doc)},e.prototype.setRefMaps=function(e,t,n){this.refMap=e,this.refLinkCandidateMap=t,this.refDefCandidateMap=n},e.prototype.clearRefMaps=function(){[this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap].forEach((function(e){var t;t=e,Object.keys(t).forEach((function(e){delete t[e]}))}))},e}();function ya(e,t){return e[0]<t[0]?1:e[0]>t[0]?-1:e[1]<t[1]?1:e[1]>t[1]?-1:0}function ba(e,t){var n=e[0];return 1===ya(e[1],t)?1:-1===ya(n,t)?-1:0}function wa(e,t){for(var n=0,r=t;n<r.length;n++){var o=r[n];e.insertBefore(o)}}function ka(e,t){var n=e[0];return e[1][0]<t?1:n[0]>t?-1:0}function xa(e,t){for(var n=e.firstChild;n;){var r=ka(n.sourcepos,t);if(0===r)return n;if(-1===r)return n.prev||n;n=n.next}return e.lastChild}function Ca(e){return function(e){return Lo[e]}(e)||null}function Ta(e,t,n){if(void 0===n&&(n=null),t)for(var r=t.walker();t&&t!==n;){e(t);var o=r.next();if(!o)break;t=o.node}}var Ea=/\r\n|\n|\r/;function Ma(e){return{id:e.id,title:e.title,sourcepos:e.sourcepos,unlinked:!1,destination:e.dest}}var La=function(){function e(e,t){this.refMap={},this.refLinkCandidateMap={},this.refDefCandidateMap={},this.referenceDefinition=!!(null==t?void 0:t.referenceDefinition),this.parser=new ga(t),this.parser.setRefMaps(this.refMap,this.refLinkCandidateMap,this.refDefCandidateMap),this.eventHandlerMap={change:[]},e=e||"",this.lineTexts=e.split(Ea),this.root=this.parser.parse(e,this.lineTexts)}return e.prototype.updateLineTexts=function(e,t,n){var r,o=e[0],i=e[1],a=t[0],s=t[1],l=n.split(Ea),u=l.length,c=this.lineTexts[o-1],p=this.lineTexts[a-1];l[0]=c.slice(0,i-1)+l[0],l[u-1]=l[u-1]+p.slice(s-1);var d=a-o+1;return(r=this.lineTexts).splice.apply(r,Lr([o-1,d],l)),u-d},e.prototype.updateRootNodeState=function(){if(1===this.lineTexts.length&&""===this.lineTexts[0])return this.root.lastLineBlank=!0,void(this.root.sourcepos=[[1,1],[1,0]]);this.root.lastChild&&(this.root.lastLineBlank=this.root.lastChild.lastLineBlank);for(var e=this.lineTexts,t=e.length-1;""===e[t];)t-=1;e.length-2>t&&(t+=1),this.root.sourcepos[1]=[t+1,e[t].length]},e.prototype.replaceRangeNodes=function(e,t,n){e?(wa(e,n),function(e,t){if(e.parent===t.parent&&e!==t){for(var n=e.next;n&&n!==t;){for(var r=n.next,o=0,i=["parent","prev","next"];o<i.length;o++){var a=i[o];n[a]&&(No(n[a].id),n[a]=null)}n=r}e.next=t.next,t.next?t.next.prev=e:e.parent.lastChild=e}}(e,t),[e.id,t.id].forEach((function(e){return No(e)})),e.unlink()):t?(wa(t,n),No(t.id),t.unlink()):function(e,t){for(var n=t.length-1;n>=0;n-=1)e.prependChild(t[n])}(this.root,n)},e.prototype.getNodeRange=function(e,t){var n=xa(this.root,e[0]),r=xa(this.root,t[0]);return r&&r.next&&t[0]+1===r.next.sourcepos[0][0]&&(r=r.next),[n,r]},e.prototype.trigger=function(e,t){this.eventHandlerMap[e].forEach((function(e){e(t)}))},e.prototype.extendEndLine=function(e){for(;""===this.lineTexts[e];)e+=1;return e},e.prototype.parseRange=function(e,t,n,r){var o;e&&e.prev&&(Vo(e.prev)&&function(e){var t=e.match(/^[ \t]+/);if(t&&(t[0].length>=2||/\t/.test(t[0])))return!0;var n=t?e.slice(t.length):e;return ia.test(n)||aa.test(n)}(this.lineTexts[n-1])||function(e){return"table"===e.type}(e.prev)&&(!qi(o=this.lineTexts[n-1])&&-1!==o.indexOf("|")))&&(n=(e=e.prev).sourcepos[0][0]);for(var i=this.lineTexts.slice(n-1,r),a=this.parser.partialParseStart(n,i),s=t?t.next:this.root.firstChild,l=a.lastChild,u=l&&zo(l)&&l.open,c=l&&$o(l)&&l.open,p=l&&Vo(l);(u||c)&&s||p&&s&&("list"===s.type||s.sourcepos[0][1]>=2);){var d=this.extendEndLine(s.sourcepos[1][0]);this.parser.partialParseExtends(this.lineTexts.slice(r,d)),e||(e=t),t=s,r=d,s=s.next}return this.parser.partialParseFinish(),{newNodes:function(e){for(var t=[],n=e.firstChild;n;)t.push(n),n=n.next;return t}(a),extStartNode:e,extEndNode:t}},e.prototype.getRemovedNodeRange=function(e,t){return!e||e&&Wo(e)||t&&Wo(t)?null:{id:[e.id,t.id],line:[e.sourcepos[0][0]-1,t.sourcepos[1][0]-1]}},e.prototype.markDeletedRefMap=function(e,t){var n=this;if(!li(this.refMap)){var r=function(e){if(Wo(e)){var t=n.refMap[e.label];t&&e.id===t.id&&(t.unlinked=!0)}};e&&Ta(r,e.parent,t),t&&Ta(r,t)}},e.prototype.replaceWithNewRefDefState=function(e){var t=this;if(!li(this.refMap)){var n=function(e){if(Wo(e)){var n=e.label,r=t.refMap[n];r&&!r.unlinked||(t.refMap[n]=Ma(e))}};e.forEach((function(e){Ta(n,e)}))}},e.prototype.replaceWithRefDefCandidate=function(){var e=this;li(this.refDefCandidateMap)||si(this.refDefCandidateMap,(function(t,n){var r=n.label,o=n.sourcepos,i=e.refMap[r];(!i||i.unlinked||i.sourcepos[0][0]>o[0][0])&&(e.refMap[r]=Ma(n))}))},e.prototype.getRangeWithRefDef=function(e,t,n,r,o){if(this.referenceDefinition&&!li(this.refMap)){var i=xa(this.root,e-1),a=xa(this.root,t+1);i&&Wo(i)&&i!==n&&i!==r&&(e=(n=i).sourcepos[0][0]),a&&Wo(a)&&a!==n&&a!==r&&(r=a,t=this.extendEndLine(r.sourcepos[1][0]+o))}return[n,r,e,t]},e.prototype.parse=function(e,t,n){void 0===n&&(n=0);var r=this.getNodeRange(e,t),o=r[0],i=r[1],a=o?Math.min(o.sourcepos[0][0],e[0]):e[0],s=this.extendEndLine((i?Math.max(i.sourcepos[1][0],t[0]):t[0])+n),l=this.parseRange.apply(this,this.getRangeWithRefDef(a,s,o,i,n)),u=l.newNodes,c=l.extStartNode,p=l.extEndNode,d=this.getRemovedNodeRange(c,p),f=p?p.next:this.root.firstChild;return this.referenceDefinition?(this.markDeletedRefMap(c,p),this.replaceRangeNodes(c,p,u),this.replaceWithNewRefDefState(u)):this.replaceRangeNodes(c,p,u),{nodes:u,removedNodeRange:d,nextNode:f}},e.prototype.parseRefLink=function(){var e=this,t=[];return li(this.refMap)||si(this.refMap,(function(n,r){r.unlinked&&delete e.refMap[n],si(e.refLinkCandidateMap,(function(r,o){var i=o.node;o.refLabel===n&&t.push(e.parse(i.sourcepos[0],i.sourcepos[1]))}))})),t},e.prototype.removeUnlinkedCandidate=function(){li(this.refDefCandidateMap)||[this.refLinkCandidateMap,this.refDefCandidateMap].forEach((function(e){si(e,(function(t){(function(e){var t=Ca(e);if(!t)return!0;for(;t&&"document"!==t.type;){if(!t.parent&&!t.prev&&!t.next)return!0;t=t.parent}return!1})(t)&&delete e[t]}))}))},e.prototype.editMarkdown=function(e,t,n){var r=this.updateLineTexts(e,t,n),o=this.parse(e,t,r),i=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Mr({},e);return t.forEach((function(e){delete r[e]})),r}(o,"nextNode");!function(e,t){if(e&&e.parent&&0!==t){var n,r=e.parent.walker();for(r.resumeAt(e,!0);n=r.next();){var o=n.node;n.entering&&(o.sourcepos[0][0]+=t,o.sourcepos[1][0]+=t)}}}(o.nextNode,r),this.updateRootNodeState();var a=[i];return this.referenceDefinition&&(this.removeUnlinkedCandidate(),this.replaceWithRefDefCandidate(),a=a.concat(this.parseRefLink())),this.trigger("change",a),a},e.prototype.getLineTexts=function(){return this.lineTexts},e.prototype.getRootNode=function(){return this.root},e.prototype.findNodeAtPosition=function(e){var t=function(e,t){for(var n=e,r=null;n;){var o=ba(n.sourcepos,t);if(0===o){if(!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===o)return r;if(!n.next)return r;n=n.next}}return n}(this.root,e);return t&&t!==this.root?t:null},e.prototype.findFirstNodeAtLine=function(e){return function(e,t){for(var n=e.firstChild,r=null;n;){var o=ka(n.sourcepos,t);if(0===o){if(n.sourcepos[0][0]===t||!n.firstChild)return n;r=n,n=n.firstChild}else{if(-1===o)break;r=n,n=n.next}}return r?function(e){for(;e.parent&&"document"!==e.parent.type&&e.parent.sourcepos[0][0]===e.sourcepos[0][0];)e=e.parent;return e}(function(e){for(;e.lastChild;)e=e.lastChild;return e}(r)):null}(this.root,e)},e.prototype.on=function(e,t){this.eventHandlerMap[e].push(t)},e.prototype.off=function(e,t){var n=this.eventHandlerMap[e],r=n.indexOf(t);n.splice(r,1)},e.prototype.findNodeById=function(e){return Ca(e)},e.prototype.removeAllNode=function(){Lo={}},e}(),Na=new RegExp("<(/?(?:"+["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"].join("|")+")[^>]*>)","ig");function Sa(e){return Na.test(e)?e.replace(Na,(function(e,t){return"<"+t})):e}var Aa={heading:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"h"+e.level,outerNewLine:!0}},text:function(e){return{type:"text",content:e.literal}},softbreak:function(e,t){return{type:"html",content:t.options.softbreak}},linebreak:function(){return{type:"html",content:"<br />\n"}},emph:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"em"}},strong:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"strong"}},paragraph:function(e,t){var n,r=t.entering,o=null===(n=e.parent)||void 0===n?void 0:n.parent;return o&&"list"===o.type&&o.listData.tight?null:{type:r?"openTag":"closeTag",tagName:"p",outerNewLine:!0}},thematicBreak:function(){return{type:"openTag",tagName:"hr",outerNewLine:!0,selfClose:!0}},blockQuote:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"blockquote",outerNewLine:!0,innerNewLine:!0}},list:function(e,t){var n=t.entering,r=e.listData,o=r.type,i=r.start,a="bullet"===o?"ul":"ol",s={};return"ol"===a&&null!==i&&1!==i&&(s.start=i.toString()),{type:n?"openTag":"closeTag",tagName:a,attributes:s,outerNewLine:!0}},item:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"li",outerNewLine:!0}},htmlInline:function(e,t){return{type:"html",content:t.options.tagFilter?Sa(e.literal):e.literal}},htmlBlock:function(e,t){var n=t.options,r=n.tagFilter?Sa(e.literal):e.literal;return n.nodeId?[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"html",content:r},{type:"closeTag",tagName:"div",outerNewLine:!0}]:{type:"html",content:r,outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code"},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e.info,n=t?t.split(/\s+/):[],r=[];return n.length>0&&n[0].length>0&&r.push("language-"+ko(n[0])),[{type:"openTag",tagName:"pre",outerNewLine:!0},{type:"openTag",tagName:"code",classNames:r},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre",outerNewLine:!0}]},link:function(e,t){if(t.entering){var n=e,r=n.title,o=n.destination;return{type:"openTag",tagName:"a",attributes:Mr({href:ko(o)},r&&{title:ko(r)})}}return{type:"closeTag",tagName:"a"}},image:function(e,t){var n=t.getChildrenText,r=t.skipChildren,o=e,i=o.title,a=o.destination;return r(),{type:"openTag",tagName:"img",selfClose:!0,attributes:Mr({src:ko(a),alt:n(e)},i&&{title:ko(i)})}},customBlock:function(e,t,n){var r=e.info.trim().toLowerCase(),o=n[r];if(o)try{return o(e,t)}catch(e){console.warn("[@toast-ui/editor] - The error occurred when "+r+" block node was parsed in markdown renderer: "+e)}return[{type:"openTag",tagName:"div",outerNewLine:!0},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},frontMatter:function(e){return[{type:"openTag",tagName:"div",outerNewLine:!0,attributes:{style:"white-space: pre; display: none;"}},{type:"text",content:e.literal},{type:"closeTag",tagName:"div",outerNewLine:!0}]},customInline:function(e,t,n){var r=e,o=r.info,i=r.firstChild,a=o.trim().toLowerCase(),s=n[a],l=t.entering;if(s)try{return s(e,t)}catch(e){console.warn("[@toast-ui/editor] - The error occurred when "+a+" inline node was parsed in markdown renderer: "+e)}return l?[{type:"openTag",tagName:"span"},{type:"text",content:"$$"+o+(i?" ":"")}]:[{type:"text",content:"$$"},{type:"closeTag",tagName:"span"}]}},Da={strike:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"del"}},item:function(e,t){var n=t.entering,r=e.listData,o=r.checked,i=r.task;if(n){var a={type:"openTag",tagName:"li",outerNewLine:!0};return i?[a,{type:"openTag",tagName:"input",selfClose:!0,attributes:Mr(Mr({},o&&{checked:""}),{disabled:"",type:"checkbox"})},{type:"text",content:" "}]:a}return{type:"closeTag",tagName:"li",outerNewLine:!0}},table:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"table",outerNewLine:!0}},tableHead:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"thead",outerNewLine:!0}},tableBody:function(e,t){return{type:t.entering?"openTag":"closeTag",tagName:"tbody",outerNewLine:!0}},tableRow:function(e,t){if(t.entering)return{type:"openTag",tagName:"tr",outerNewLine:!0};var n=[];if(e.lastChild)for(var r=e.parent.parent.columns.length,o=e.lastChild.endIdx+1;o<r;o+=1)n.push({type:"openTag",tagName:"td",outerNewLine:!0},{type:"closeTag",tagName:"td",outerNewLine:!0});return n.push({type:"closeTag",tagName:"tr",outerNewLine:!0}),n},tableCell:function(e,t){var n=t.entering;if(e.ignored)return{type:"text",content:""};var r=e.parent.parent,o="tableHead"===r.type?"th":"td",i=r.parent.columns[e.startIdx],a=(null==i?void 0:i.align)?{align:i.align}:null;return n?Mr({type:"openTag",tagName:o,outerNewLine:!0},a&&{attributes:a}):{type:"closeTag",tagName:o,outerNewLine:!0}}},Oa={softbreak:"\n",gfm:!1,tagFilter:!1,nodeId:!1};function Ia(e){for(var t=[],n=e.walker(),r=null;r=n.next();){var o=r.node;"text"===o.type&&t.push(o.literal)}return t.join("")}var Ra=function(){function e(e){this.buffer=[],this.options=Mr(Mr({},Oa),e),this.convertors=this.createConvertors(),delete this.options.convertors}return e.prototype.createConvertors=function(){var e=Mr({},Aa);if(this.options.gfm&&(e=Mr(Mr({},e),Da)),this.options.convertors){var t=this.options.convertors,n=Object.keys(t),r=Mr(Mr({},Aa),Da);n.forEach((function(n){var o=e[n],i=t[n],a=-1===Object.keys(r).indexOf(n)?n.toLowerCase():n;e[a]=o?function(e,t,n){return t.origin=function(){return o(e,t,n)},i(e,t)}:i}))}return e},e.prototype.getConvertors=function(){return this.convertors},e.prototype.getOptions=function(){return this.options},e.prototype.render=function(e){var t=this;this.buffer=[];for(var n=e.walker(),r=null,o=function(){var e=r.node,o=r.entering,a=i.convertors[e.type];if(!a)return"continue";var s=!1,l={entering:o,leaf:!Eo(e),options:i.options,getChildrenText:Ia,skipChildren:function(){s=!0}},u=$o(e)||function(e){return"customInline"===e.type}(e)?a(e,l,i.convertors):a(e,l);u&&((Array.isArray(u)?u:[u]).forEach((function(n,r){"openTag"===n.type&&t.options.nodeId&&0===r&&(n.attributes||(n.attributes={}),n.attributes["data-nodeid"]=String(e.id)),t.renderHTMLNode(n)})),s&&(n.resumeAt(e,!1),n.next()))},i=this;r=n.next();)o();return this.addNewLine(),this.buffer.join("")},e.prototype.renderHTMLNode=function(e){switch(e.type){case"openTag":case"closeTag":this.renderElementNode(e);break;case"text":this.renderTextNode(e);break;case"html":this.renderRawHtmlNode(e)}},e.prototype.generateOpenTagString=function(e){var t=this,n=e.tagName,r=e.classNames,o=e.attributes;this.buffer.push("<"+n),r&&r.length>0&&this.buffer.push(' class="'+r.join(" ")+'"'),o&&Object.keys(o).forEach((function(e){var n=o[e];t.buffer.push(" "+e+'="'+n+'"')})),e.selfClose&&this.buffer.push(" /"),this.buffer.push(">")},e.prototype.generateCloseTagString=function(e){var t=e.tagName;this.buffer.push("</"+t+">")},e.prototype.addNewLine=function(){this.buffer.length&&"\n"!==ii(ii(this.buffer))&&this.buffer.push("\n")},e.prototype.addOuterNewLine=function(e){e.outerNewLine&&this.addNewLine()},e.prototype.addInnerNewLine=function(e){e.innerNewLine&&this.addNewLine()},e.prototype.renderTextNode=function(e){this.buffer.push(ko(e.content))},e.prototype.renderRawHtmlNode=function(e){this.addOuterNewLine(e),this.buffer.push(e.content),this.addOuterNewLine(e)},e.prototype.renderElementNode=function(e){"openTag"===e.type?(this.addOuterNewLine(e),this.generateOpenTagString(e),e.selfClose?this.addOuterNewLine(e):this.addInnerNewLine(e)):(this.addInnerNewLine(e),this.generateCloseTagString(e),this.addOuterNewLine(e))},e}(),Pa=c(368),Ha=c.n(Pa),Ba=["iframe","embed"],Fa=[];function qa(e){q(Ba,e)&&Fa.push(e.toLowerCase())}function ja(e,t){return Ha().sanitize(e,n({ADD_TAGS:Fa,ADD_ATTR:["rel","target","hreflang","type"],FORBID_TAGS:["input","script","textarea","form","button","select","meta","style","link","title","object","base"]},t))}function _a(e,t){return e.literal.replace(new RegExp("(<\\s*"+t+"[^>]*>)|(</"+t+"\\s*[>])","ig"),"").trim()}function Ua(e){var t=(e=e.match(Je)[0]).match(new RegExp(Ke,"g"));return t?t.reduce((function(e,t){var n=t.trim().split("="),r=n[0],o=n.slice(1);return o.length&&(e[r]=o.join("=").replace(/'|"/g,"").trim()),e}),{}):{}}function za(e){return oe()(e.attributes).reduce((function(e,t){return e[t.nodeName]=t.nodeValue,e}),{})}function Va(e,t,n,r){var o=r.getToDOMNode(t)(e),i=n(o.outerHTML),a=document.createElement("div");return a.innerHTML=i,{dom:o=a.firstChild,htmlAttrs:za(o)}}var Wa={htmlBlock:function(e,t,n){return{atom:!0,content:"block+",group:"block",attrs:{htmlAttrs:{default:{}},childrenHTML:{default:""},htmlBlock:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:za(e),childrenHTML:e.innerHTML}}}],toDOM:function(o){var i=Va(o,e,t,n),a=i.dom,s=i.htmlAttrs;return s.class=s.class?s.class+" html-block":"html-block",r([e,s],oe()(a.childNodes))}}},htmlInline:function(e,t,n){return{attrs:{htmlAttrs:{default:{}},htmlInline:{default:!0}},parseDOM:[{tag:e,getAttrs:function(e){return{htmlAttrs:za(e)}}}],toDOM:function(r){var o=Va(r,e,t,n).htmlAttrs;return[e,o,0]}}}};var $a=/^\s*<\s*\//,Ga={paragraph:function(e,t){var n=t.entering,r=t.origin;return t.options.nodeId?{type:n?"openTag":"closeTag",outerNewLine:!0,tagName:"p"}:r()},softbreak:function(e){return{type:"html",content:e.prev&&"htmlInline"===e.prev.type&&/<br ?\/?>/.test(e.prev.literal)?"\n":"<br>\n"}},item:function(e,t){if(t.entering){var n={},r=[];return e.listData.task&&(n["data-task"]="",r.push("task-list-item"),e.listData.checked&&(r.push("checked"),n["data-task-checked"]="")),{type:"openTag",tagName:"li",classNames:r,attributes:n,outerNewLine:!0}}return{type:"closeTag",tagName:"li",outerNewLine:!0}},code:function(e){return[{type:"openTag",tagName:"code",attributes:{"data-backticks":String(e.tickCount)}},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"}]},codeBlock:function(e){var t=e,n=t.fenceLength,r=t.info,o=r?r.split(/\s+/):[],i=[],a={};if(n>3&&(a["data-backticks"]=n),o.length>0&&o[0].length>0){var s=o[0];i.push("lang-"+s),a["data-language"]=s}return[{type:"openTag",tagName:"pre",classNames:i},{type:"openTag",tagName:"code",attributes:a},{type:"text",content:e.literal},{type:"closeTag",tagName:"code"},{type:"closeTag",tagName:"pre"}]},customInline:function(e,t){var n=t.origin,r=t.entering,o=t.skipChildren,i=e.info;return-1!==i.indexOf("widget")&&r?(o(),[{type:"openTag",tagName:"span",classNames:["tui-widget"]},{type:"html",content:He(i,_e(e)).outerHTML},{type:"closeTag",tagName:"span"}]):n()}};function Xa(e,t){var r=n({},Ga);return e&&(r.link=function(t,r){var o=r.entering,i=(0,r.origin)();return o&&(i.attributes=n(n({},i.attributes),e)),i}),t&&Object.keys(t).forEach((function(e){var o=r[e],i=t[e];o&&Dt()(i)?r[e]=function(e,t){var r=n({},t);return r.origin=function(){return o(e,t)},i(e,r)}:q(["htmlBlock","htmlInline"],e)&&!Dt()(i)?r[e]=function(e,t){var r=e.literal.match(Je);if(r){var o=r[0],a=r[1],s=r[3],l=(a||s).toLowerCase(),u=i[l],c=_a(e,l);if(u){var p=n({},e);return p.attrs=Ua(o),p.childrenHTML=c,p.type=l,t.entering=!$a.test(e.literal),u(p,t)}}return t.origin()}:r[e]=i})),r}var Za=["list","item","blockQuote"],Ka=["UL","OL","BLOCKQUOTE"];function Qa(e,t){var n,r=e.child(t);return!r.childCount||1===r.childCount&&!(null===(n=r.firstChild.text)||void 0===n?void 0:n.trim())}function Ya(e,t,n){var r=ve(t)-1,o=ge(t)-1,i=n[r].getBoundingClientRect(),a=n[o].offsetTop-n[r].offsetTop+n[o].clientHeight;return{height:a<=0?n[r].clientHeight:a+Ja(e,n,Math.min(o+1,e.childCount-1)),rect:i}}function Ja(e,t,n){for(var r=e.childCount-1,o=0;n<=r&&Qa(e,n);)o+=t[n].clientHeight,n+=1;return o}function es(e,t){for(var n=0;e&&e!==t&&(q(Ka,e.tagName)||(n+=e.offsetTop),e.offsetParent!==t.offsetParent);)e=e.parentElement;return n}function ts(e,t,n){return e&&t>n+e.offsetTop?ts(e.nextElementSibling,t,n)||e:null}function ns(e,t){for(var n=e.querySelector('[data-nodeid="'+t.id+'"]');!n||we(t);)t=t.parent,n=e.querySelector('[data-nodeid="'+t.id+'"]');return function(e){var t=e.mdNode,n=e.el;for(;(q(Za,t.type)||"table"===t.type)&&t.firstChild;)t=t.firstChild,n=n.firstElementChild;return{mdNode:t,el:n}}({mdNode:t,el:n})}var rs={};function os(e){e&&(delete rs[Number(e.getAttribute("data-nodeid"))],oe()(e.children).forEach((function(e){os(e)})))}function is(e,t,n){var r,o=rs[r=n]&&rs[r].height,i=function(e){return rs[e]&&rs[e].offsetTop}(n),a=o||e.clientHeight,s=i||es(e,t)||e.offsetTop;return o||function(e,t){rs[e]=rs[e]||{},rs[e].height=t}(n,a),i||function(e,t){rs[e]=rs[e]||{},rs[e].offsetTop=t}(n,s),{nodeHeight:a,offsetTop:s}}var as=it("md-preview-highlight");var ss=function(){function e(e,t){var n=document.createElement("div");this.el=n,this.eventEmitter=e,this.isViewer=!!t.isViewer,this.el.className=it("md-preview");var r=t.linkAttributes,o=t.customHTMLRenderer,i=t.sanitizer,a=t.highlight,s=void 0!==a&&a;this.renderer=new Ra({gfm:!0,nodeId:!0,convertors:Xa(r,o)}),this.cursorNodeId=null,this.sanitizer=i,this.initEvent(s),this.initContentSection(),this.isViewer&&(this.previewContent.style.overflowWrap="break-word")}return e.prototype.initContentSection=function(){this.previewContent=ct('<div class="'+it("contents")+'"></div>'),this.isViewer||this.el.appendChild(this.previewContent)},e.prototype.toggleActive=function(e){ut(this.el,"active",e)},e.prototype.initEvent=function(e){var t=this;this.eventEmitter.listen("updatePreview",this.update.bind(this)),this.isViewer||(e&&(this.eventEmitter.listen("changeToolbarState",(function(e){var n=e.mdNode,r=e.cursorPos;t.updateCursorNode(n,r)})),this.eventEmitter.listen("blur",(function(){t.removeHighlight()}))),Cr()(this.el,"scroll",(function(e){t.eventEmitter.emit("scroll","preview",function(e,t){for(var n=t,r=null;n;){var o=n.firstElementChild;if(!o)break;r=n,n=ts(o,e,es(n,t))}var i=n||r;return i===t?null:i}(e.target.scrollTop,t.previewContent))})),this.eventEmitter.listen("changePreviewTabPreview",(function(){return t.toggleActive(!0)})),this.eventEmitter.listen("changePreviewTabWrite",(function(){return t.toggleActive(!1)})))},e.prototype.removeHighlight=function(){if(this.cursorNodeId){var e=this.getElementByNodeId(this.cursorNodeId);e&&g()(e,as)}},e.prototype.updateCursorNode=function(e,t){e&&("tableRow"===(e=Ee(e,(function(e){return!function(e){switch(e.type){case"code":case"text":case"emph":case"strong":case"strike":case"link":case"image":case"htmlInline":case"linebreak":case"softbreak":case"customInline":return!0;default:return!1}}(e)}))).type?e=function(e,t){for(var n=e.firstChild;n&&n.next&&!(ye(n.next)>t+1);)n=n.next;return n}(e,t[1]):"tableBody"===e.type&&(e=null));var n=e?e.id:null;if(this.cursorNodeId!==n){var r=this.getElementByNodeId(this.cursorNodeId),o=this.getElementByNodeId(n);r&&g()(r,as),o&&m()(o,as),this.cursorNodeId=n}},e.prototype.getElementByNodeId=function(e){return e?this.previewContent.querySelector('[data-nodeid="'+e+'"]'):null},e.prototype.update=function(e){var t=this;e.forEach((function(e){return t.replaceRangeNodes(e)})),this.eventEmitter.emit("afterPreviewRender",this)},e.prototype.replaceRangeNodes=function(e){var t=this,n=e.nodes,r=e.removedNodeRange,o=this.previewContent,i=this.eventEmitter.emitReduce("beforePreviewRender",this.sanitizer(n.map((function(e){return t.renderer.render(e)})).join("")));if(r){var a=r.id,s=a[0],l=a[1],u=this.getElementByNodeId(s),c=this.getElementByNodeId(l);if(u){u.insertAdjacentHTML("beforebegin",i);for(var p=u;p&&p!==c;){var d=p.nextElementSibling;lt(p),os(p),p=d}(null==p?void 0:p.parentNode)&&(lt(p),os(p))}}else o.insertAdjacentHTML("afterbegin",i)},e.prototype.getRenderer=function(){return this.renderer},e.prototype.destroy=function(){kr()(this.el,"scroll"),this.el=null},e.prototype.getElement=function(){return this.el},e.prototype.getHTML=function(){return mt(this.previewContent.innerHTML)},e.prototype.setHTML=function(e){this.previewContent.innerHTML=e},e.prototype.setHeight=function(e){f()(this.el,{height:e+"px"})},e.prototype.setMinHeight=function(e){f()(this.el,{minHeight:e+"px"})},e}(),ls=ss;function us(e,t){for(var n=e.depth;n;){var r=e.node(n);if(t(r,n))return{node:r,depth:n,offset:n>0?e.before(n):0};n-=1}return null}function cs(e){return!!us(e,(function(e){var t=e.type;return"listItem"===t.name||"bulletList"===t.name||"orderedList"===t.name}))}function ps(e){return!!us(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function ds(e){return us(e,(function(e){return"listItem"===e.type.name}))}function fs(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return n({},t&&{rawHTML:t})}}}function hs(e){return Object.keys(e).reduce((function(t,n){return"rawHTML"!==n&&e[n]&&(t[n="className"===n?"class":n]=e[n]),t}),{})}function ms(e){return{tag:e,getAttrs:function(e){return["rawHTML","colspan","rowspan","extended"].reduce((function(t,n){var r="rawHTML"===n?"data-raw-html":n,o=e.getAttribute(r);return o&&(t[n]=q(["rawHTML","extended"],n)?o:Number(o)),t}),{})}}}function vs(e){var t=e.htmlAttrs,r=e.classNames;return n(n({},t),{class:r?r.join(" "):null})}function gs(e,t,n,r){var o=t.$from,a=t.$to,s=t.depth,l=t,u=!1;if(s>=2&&o.node(s-1).type.compatibleContent(n)&&0===t.startIndex&&o.index(s-1)){var c=e.doc.resolve(t.start-2);l=new i.NodeRange(c,c,s),t.endIndex<t.parent.childCount&&(t=new i.NodeRange(o,e.doc.resolve(a.end(s)),s)),u=!0}var p=function(e,t,n,r){var o=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(i){var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}return null}(e,n),i=function(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(a){for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l<o;l+=1)s=s.matchType(n.child(l).type);if(s&&s.validEnd)return a}return null}(t,n);if(o&&i){var a=o.map((function(e){return{type:e}})),s=i.map((function(e){return{type:e,attrs:r}}));return a.concat({type:n}).concat(s)}return null}(l,t,n,r);return p?function(e,t,n,r,o){for(var a=t.start,s=t.end,l=t.startIndex,u=t.endIndex,c=t.parent,p=i.Fragment.empty,d=n.length-1;d>=0;d-=1)p=i.Fragment.from(n[d].type.create(n[d].attrs,p));e.step(new ne.ReplaceAroundStep(a-(r?2:0),s,a,s,new i.Slice(p,0,0),n.length,!0));var f=0;for(d=0;d<n.length;d+=1)if(n[d].type===o){f=d+1;break}for(var h=n.length-f,m=a+n.length-(r?2:0),v=(d=l,u);d<v;d+=1)!(d===l)&&(0,ne.canSplit)(e.doc,m,h)&&(e.split(m,h),m+=2*h),m+=c.child(d).nodeSize;return e}(e,t,p,u,n):e}function ys(e,t){for(var n=e.resolve(t);"paragraph"!==n.node().type.name;)t-=2,n=e.resolve(t);return ds(n)}function bs(e){return function(t,n){var r=t.selection,o=t.tr,i=r.$from,a=r.$to,s=i.blockRange(a);if(s){var l=cs(i)?function(e,t,n){var r=t.$from,o=t.$to,i=ds(r),a=ds(o);if(i&&a)for(;a;){var s=a.offset,l=a.node,u=a.depth;l.attrs.task&&e.setNodeMarkup(s,null,{task:!1,checked:!1});var c=e.doc.resolve(s);if(c.parent.type!==n){var p=c.before(u-1);e.setNodeMarkup(p,n)}if(s===i.offset)break;a=ys(e.doc,s)}return e}(o,s,e):gs(o,s,e);return n(l),!0}return!1}}function ws(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from,a=n.$to,s=i.blockRange(a);if(s){var l=cs(i)?function(e,t){var n=t.$from,r=t.$to,o=ds(n),i=ds(r);if(o&&i)for(;i;){var a=i.offset,s={task:!i.node.attrs.task,checked:!1};if(e.setNodeMarkup(a,null,s),a===o.offset)break;i=ys(e.doc,a)}return e}(r,s):gs(r,s,o.nodes.bulletList,{task:!0});return t(l),!0}return!1}}function ks(e){return function(t,n){var r=t.tr,o=t.selection,a=o.$from,s=o.$to,l=a.blockRange(s,(function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e}));if(l){var u=a.node(l.depth-1).type===e?function(e,t,n){var r=t.$from,o=t.$to,a=t.end,s=t.depth,l=t.parent,u=o.end(s);return a<u&&(e.step(new ne.ReplaceAroundStep(a-1,u,a,u,new i.Slice(i.Fragment.from(n.create(null,l.copy())),1,0),1,!0)),t=new i.NodeRange(e.doc.resolve(r.pos),e.doc.resolve(u),s)),e.lift(t,(0,ne.liftTarget)(t)),e}(r,l,e):function(e,t){for(var n=t.parent,r=t.end,o=t.endIndex-1,a=t.startIndex;o>a;o-=1)r-=n.child(o).nodeSize,e.delete(r-1,r+1);var s=e.doc.resolve(t.start),l=s.nodeAfter,u=0===t.startIndex,c=t.endIndex===n.childCount,p=s.node(-1),d=s.index(-1),f=p.canReplace(d+(u?0:1),d+1,null==l?void 0:l.content.append(c?i.Fragment.empty:i.Fragment.from(n)));if(l&&f){var h=s.pos,m=h+l.nodeSize;e.step(new ne.ReplaceAroundStep(h-(u?1:0),m+(c?1:0),h+1,m-1,new i.Slice((u?i.Fragment.empty:i.Fragment.from(n.copy(i.Fragment.empty))).append(c?i.Fragment.empty:i.Fragment.from(n.copy(i.Fragment.empty))),u?0:1,c?0:1),u?0:1))}return e}(r,l);return n(u),!0}return!1}}function xs(){return function(){return function(e,t){var n=e.selection,r=e.schema,o=n.$from,a=n.$to;return!(!o.blockRange(a)||!cs(o))&&function(e){return function(t,n){var r=t.tr,o=t.selection,a=o.$from,s=o.$to,l=a.blockRange(s,(function(t){var n=t.childCount,r=t.firstChild;return!!n&&r.type===e}));if(l&&l.startIndex>0){var u=l.parent,c=u.child(l.startIndex-1);if(c.type!==e)return!1;var p=c.lastChild&&c.lastChild.type===u.type,d=p?i.Fragment.from(e.create()):null,f=new i.Slice(i.Fragment.from(e.create(null,i.Fragment.from(u.type.create(null,d)))),p?3:1,0),h=l.start,m=l.end;return r.step(new ne.ReplaceAroundStep(h-(p?3:1),m,h,m,f,1,!0)),n(r),!0}return!1}}(r.nodes.listItem)(e,t)}}}function Cs(){return{indent:xs(),outdent:function(){return function(e,t){var n=e.selection,r=e.schema,o=n.$from,i=n.$to;return!(!o.blockRange(i)||!cs(o))&&ks(r.nodes.listItem)(e,t)}}}}var Ts=new Map,Es=function(){function e(e,t,n,r){this.table=e,this.tableRows=t,this.tableStartPos=n,this.rowInfo=r}return e.create=function(t){var n=us(t,(function(e){return"table"===e.type.name}));if(n){var r=n.node,o=n.depth,i=n.offset,a=Ts.get(r);if((null==a?void 0:a.tableStartPos)===i+1)return a;var s=[],l=t.start(o),u=r.child(0),c=r.child(1),p=Ms(u,l),d=Ms(c,l+u.nodeSize);u.forEach((function(e){return s.push(e)})),c.forEach((function(e){return s.push(e)}));var f=new e(r,s,l,p.concat(d));return Ts.set(r,f),f}return null},Object.defineProperty(e.prototype,"totalRowCount",{get:function(){return this.rowInfo.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalColumnCount",{get:function(){return this.rowInfo[0].length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableStartOffset",{get:function(){return this.tableStartPos},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableEndOffset",{get:function(){return this.tableStartPos+this.table.nodeSize-1},enumerable:!1,configurable:!0}),e.prototype.getCellInfo=function(e,t){return this.rowInfo[e][t]},e.prototype.posAt=function(e,t){for(var n=0,r=this.tableStartPos;;n+=1){var o=r+this.tableRows[n].nodeSize;if(n===e){for(var i=t;i<this.totalColumnCount&&this.rowInfo[n][i].offset<r;)i+=1;return i===this.totalColumnCount?o:this.rowInfo[n][i].offset}r=o}},e.prototype.getNodeAndPos=function(e,t){var n=this.rowInfo[e][t];return{node:this.table.nodeAt(n.offset-this.tableStartOffset),pos:n.offset}},e.prototype.extendedRowspan=function(e,t){return!1},e.prototype.extendedColspan=function(e,t){return!1},e.prototype.getRowspanCount=function(e,t){return 0},e.prototype.getColspanCount=function(e,t){return 0},e.prototype.decreaseColspanCount=function(e,t){return 0},e.prototype.decreaseRowspanCount=function(e,t){return 0},e.prototype.getColspanStartInfo=function(e,t){return null},e.prototype.getRowspanStartInfo=function(e,t){return null},e.prototype.getCellStartOffset=function(e,t){var n=this.rowInfo[e][t].offset;return this.extendedRowspan(e,t)?this.posAt(e,t):n},e.prototype.getCellEndOffset=function(e,t){var n=this.rowInfo[e][t],r=n.offset,o=n.nodeSize;return this.extendedRowspan(e,t)?this.posAt(e,t):r+o},e.prototype.getCellIndex=function(e){for(var t=0;t<this.totalRowCount;t+=1)for(var n=this.rowInfo[t],r=0;r<this.totalColumnCount;r+=1)if(n[r].offset+1>e.pos)return[t,r];return[0,0]},e.prototype.getRectOffsets=function(e,t){var n,r,o;void 0===t&&(t=e),e.pos>t.pos&&(e=(n=[t,e])[0],t=n[1]);var i=this.getCellIndex(e),a=i[0],s=i[1],l=this.getCellIndex(t),u=l[0],c=l[1];return a=(r=ee(a,u))[0],u=r[1],s=(o=ee(s,c))[0],c=o[1],this.getSpannedOffsets({startRowIdx:a,startColIdx:s,endRowIdx:u,endColIdx:c})},e.prototype.getSpannedOffsets=function(e){return e},e}(),Ms=function(e,t){var n=[];return e.forEach((function(e,r){var o={rowspanMap:{},colspanMap:{},length:0};e.forEach((function(e,n){for(var i=e.nodeSize,a=0;o[a];)a+=1;o[a]={offset:t+r+n+2,nodeSize:i},o.length+=1})),n.push(o)})),n};function Ls(e,t){return J(Es.prototype,e),Ms=t,Es}var Ns=function(e){function n(t,n){void 0===n&&(n=t);var r=this,o=t.node(0),i=Es.create(t),a=i.getRectOffsets(t,n),s=function(e,t,n){for(var r=n.startRowIdx,o=n.startColIdx,i=n.endRowIdx,a=n.endColIdx,s=[],l=r;l<=i;l+=1)for(var u=o;u<=a;u+=1){var c=t.getCellInfo(l,u),p=c.offset,d=c.nodeSize;s.push(new ie.SelectionRange(e.resolve(p+1),e.resolve(p+d-1)))}return s}(o,i,a);return(r=e.call(this,s[0].$from,s[0].$to,s)||this).startCell=t,r.endCell=n,r.offsetMap=i,r.isCellSelection=!0,r.visible=!1,r}return t(n,e),n.prototype.map=function(e,t){var r=this.startCell.pos,o=this.endCell.pos,i=e.resolve(t.map(r)),a=e.resolve(t.map(o)),s=Es.create(i);if(this.offsetMap.totalColumnCount>s.totalColumnCount||this.offsetMap.totalRowCount>s.totalRowCount){var l={tableBody:1,tableRow:2,tableCell:3,paragraph:4}[a.parent.type.name],u=a.end(a.depth-l),c=Math.min(u-4,a.pos);return ie.TextSelection.create(e,c)}return new n(i,a)},n.prototype.eq=function(e){return e instanceof n&&e.startCell.pos===this.startCell.pos&&e.endCell.pos===this.endCell.pos},n.prototype.content=function(){for(var e=this.startCell.node(-2),t=this.startCell.start(-2),n=e.child(1).firstChild,r=e.child(0).type.create(),o=e.child(1).type.create(),a=Es.create(this.startCell),s=a.getRectOffsets(this.startCell,this.endCell),l=s.startRowIdx,u=s.startColIdx,c=s.endRowIdx,p=s.endColIdx,d=!1,f=l;f<=c;f+=1){for(var h=[],m=u;m<=p;m+=1){var v=a.getCellInfo(f,m).offset,g=e.nodeAt(v-t);g&&(d="tableHeadCell"===g.type.name,a.extendedRowspan(f,m)||a.extendedColspan(f,m)?h.push(g.type.create({extended:!0})):h.push(g.copy(g.content)))}var y=n.copy(i.Fragment.from(h)),b=d?r:o;b.content=b.content.append(i.Fragment.from(y))}return new i.Slice(function(e,t){var n=[];return e.childCount&&n.push(e),t.childCount&&n.push(t),i.Fragment.from(n)}(r,o),1,1)},n.prototype.toJSON=function(){return JSON.stringify(this)},n}(ie.Selection),Ss=Ns;function As(e,t,n,r){for(var o=n.nodes,i=o.tableRow,a=o.tableBodyCell,s=o.paragraph,l=[],u=0;u<e;u+=1){for(var c=[],p=0;p<t;p+=1){var d=r&&r[u*t+p],f=s.create(null,d?n.text(d):[]);c.push(a.create(null,f))}l.push(i.create(null,c))}return l}function Ds(e,t,n,r){void 0===r&&(r=null);for(var o=n.nodes,i=o.tableHeadCell,a=o.tableBodyCell,s=o.paragraph,l=0===t?i:a,u=[],c=0;c<e;c+=1)u.push(l.create(r,s.create()));return u}function Os(e,t){for(;e&&e!==t;){if("TD"===e.nodeName||"TH"===e.nodeName)return e;e=e.parentNode}return null}function Is(e){return us(e,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))}function Rs(e){if(e instanceof ie.TextSelection){var t=e.$anchor,n=Is(t);if(n){var r=t.node(0).resolve(t.before(n.depth));return{anchor:r,head:r}}}var o=e;return{anchor:o.startCell,head:o.endCell}}function Ps(e){var t;if(e.size){var n=e.content,r=e.openStart,o=e.openEnd;if(1!==n.childCount)return null;for(;1===n.childCount&&(r>0&&o>0||"table"===(null===(t=n.firstChild)||void 0===t?void 0:t.type.name));)r-=1,o-=1,n=n.firstChild.content;if("tableHead"===n.firstChild.type.name||"tableBody"===n.firstChild.type.name)return n}return null}function Hs(e){var t=e.startRowIdx,n=e.startColIdx;return{rowCount:e.endRowIdx-t+1,columnCount:e.endColIdx-n+1}}function Bs(e,t){return n(n({},e.attrs),t)}var Fs=new ie.PluginKey("cellSelection"),qs=function(){function e(e){this.view=e,this.handlers={mousedown:this.handleMousedown.bind(this),mousemove:this.handleMousemove.bind(this),mouseup:this.handleMouseup.bind(this)},this.startCellPos=null,this.init()}return e.prototype.init=function(){this.view.dom.addEventListener("mousedown",this.handlers.mousedown)},e.prototype.handleMousedown=function(e){var t=Os(e.target,this.view.dom);if(2!==e.button){if(t){var n=this.getCellPos(e);n&&(this.startCellPos=n),this.bindEvent()}}else e.preventDefault()},e.prototype.handleMousemove=function(e){var t,n=Fs.getState(this.view.state),r=this.getCellPos(e),o=this.startCellPos;n?t=this.view.state.doc.resolve(n):o!==r&&(t=o),t&&o&&r&&this.setCellSelection(o,r)},e.prototype.handleMouseup=function(){this.startCellPos=null,this.unbindEvent(),null!==Fs.getState(this.view.state)&&this.view.dispatch(this.view.state.tr.setMeta(Fs,-1))},e.prototype.bindEvent=function(){var e=this.view.dom;e.addEventListener("mousemove",this.handlers.mousemove),e.addEventListener("mouseup",this.handlers.mouseup)},e.prototype.unbindEvent=function(){var e=this.view.dom;e.removeEventListener("mousemove",this.handlers.mousemove),e.removeEventListener("mouseup",this.handlers.mouseup)},e.prototype.getCellPos=function(e){var t=e.clientX,n=e.clientY,r=this.view.posAtCoords({left:t,top:n});if(r){var o=this.view.state.doc,i=o.resolve(r.pos),a=Is(i);if(a){var s=i.before(a.depth);return o.resolve(s)}}return null},e.prototype.setCellSelection=function(e,t){var n=this.view.state,r=n.selection,o=n.tr,i=null===Fs.getState(this.view.state),a=new Ss(e,t);if(i||!r.eq(a)){var s=o.setSelection(a);i&&s.setMeta(Fs,t.pos),this.view.dispatch(s)}},e.prototype.destroy=function(){this.view.dom.removeEventListener("mousedown",this.handlers.mousedown)},e}(),js=it("cell-selected");function _s(e){var t=e.selection,n=e.doc;if(t instanceof Ss){var r=[];return t.ranges.forEach((function(e){var t=e.$from,n=e.$to;r.push(te.Decoration.node(t.pos-1,n.pos+1,{class:js}))})),te.DecorationSet.create(n,r)}return null}var Us=c(928),zs=c.n(Us),Vs=function(){function e(){this.keys=[],this.values=[]}return e.prototype.getKeyIndex=function(e){return zs()(e,this.keys)},e.prototype.get=function(e){return this.values[this.getKeyIndex(e)]},e.prototype.set=function(e,t){var n=this.getKeyIndex(e);return n>-1?this.values[n]=t:(this.keys.push(e),this.values.push(t)),this},e.prototype.has=function(e){return this.getKeyIndex(e)>-1},e.prototype.delete=function(e){var t=this.getKeyIndex(e);return t>-1&&(this.keys.splice(t,1),this.values.splice(t,1),!0)},e.prototype.forEach=function(e,t){var n=this;void 0===t&&(t=this),this.values.forEach((function(r,o){r&&n.keys[o]&&e.call(t,r,n.keys[o],n)}))},e.prototype.clear=function(){this.keys=[],this.values=[]},e}(),Ws=Vs,$s="en-US",Gs=function(){function e(){this.code=$s,this.langs=new Ws}return e.prototype.setCode=function(e){this.code=e||$s},e.prototype.setLanguage=function(e,t){var n=this;(e=[].concat(e)).forEach((function(e){if(n.langs.has(e)){var r=n.langs.get(e);n.langs.set(e,u()(r,t))}else n.langs.set(e,t)}))},e.prototype.get=function(e,t){t||(t=this.code);var n=this.langs.get(t);n||(n=this.langs.get($s));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r},e}(),Xs=new Gs,Zs=[[{action:"Add row to up",command:"addRowToUp",disableInThead:!0,className:"add-row-up"},{action:"Add row to down",command:"addRowToDown",disableInThead:!0,className:"add-row-down"},{action:"Remove row",command:"removeRow",disableInThead:!0,className:"remove-row"}],[{action:"Add column to left",command:"addColumnToLeft",className:"add-column-left"},{action:"Add column to right",command:"addColumnToRight",className:"add-column-right"},{action:"Remove column",command:"removeColumn",className:"remove-column"}],[{action:"Align column to left",command:"alignColumn",payload:{align:"left"},className:"align-column-left"},{action:"Align column to center",command:"alignColumn",payload:{align:"center"},className:"align-column-center"},{action:"Align column to right",command:"alignColumn",payload:{align:"right"},className:"align-column-right"}],[{action:"Remove table",command:"removeTable",className:"remove-table"}]];function Ks(e,t){return Zs.map((function(n){return n.map((function(n){var r=n.action,o=n.command,i=n.payload,a=n.disableInThead,s=n.className;return{label:Xs.get(r),onClick:function(){e.emit("command",o,i)},disabled:t&&!!a,className:s}}))})).concat()}function Qs(e){return new ie.Plugin({props:{handleDOMEvents:{contextmenu:function(t,n){var r=Os(n.target,t.dom);if(r){n.preventDefault();var o=n,i=o.clientX,a=o.clientY,s=t.dom.parentNode.getBoundingClientRect(),l=s.left,u=s.top,c="TH"===r.nodeName;return e.emit("contextmenu",{pos:{left:i-l+10+"px",top:a-u+30+"px"},menuGroups:Ks(e,c),tableCell:r}),!0}return!1}}}})}var Ys=["image","link","customBlock","frontMatter"],Js=["strong","strike","emph","code"],el=["bulletList","orderedList","taskList"];function tl(e,t,n){var r=e.$from,o=e.$to,i=e.from,a=e.to,s={indent:{active:!1,disabled:!0},outdent:{active:!1,disabled:!0}};return t.nodesBetween(i,a,(function(e,t,i){var a=function(e,t){var n=e.type.name;return"listItem"===n?e.attrs.task?"taskList":t.type.name:-1!==n.indexOf("table")?"table":n}(e,i);q(Ys,a)||(q(el,a)?(!function(e,t){t[e]={active:!0},el.filter((function(t){return t!==e})).forEach((function(e){t[e]&&delete t[e]}))}(a,s),s.indent.disabled=!1,s.outdent.disabled=!1):"paragraph"===a||"text"===a?function(e,t,n,r){Js.forEach((function(o){var i=n.marks[o],a=e.marksAcross(t)||[];i.isInSet(a)&&(r[o]={active:!0})}))}(r,o,n,s):s[a]={active:!0})})),s}function nl(e){return new ie.Plugin({view:function(){return{update:function(t){var n=t.state,r=n.selection,o=n.doc,i=n.schema;e.emit("changeToolbarState",{toolbarState:tl(r,o,i)})}}}})}var rl=function(){function e(e,t,n,r){var o=this;this.openEditor=function(){if(o.innerEditorView)throw new Error("The editor is already opened.");o.dom.draggable=!1,o.wrapper.style.display="none",o.innerViewContainer.style.display="block",o.innerEditorView=new te.EditorView(o.innerViewContainer,{state:ie.EditorState.create({doc:o.node,plugins:[(0,ae.keymap)({"Mod-z":function(){return(0,ue.undo)(o.innerEditorView.state,o.innerEditorView.dispatch)},"Shift-Mod-z":function(){return(0,ue.redo)(o.innerEditorView.state,o.innerEditorView.dispatch)},Tab:function(e,t){return t(e.tr.insertText("\t")),!0},Enter:se.newlineInCode,Escape:function(){return o.cancelEditing(),!0},"Ctrl-Enter":function(){return o.saveAndFinishEditing(),!0}}),(0,ue.history)()]}),dispatchTransaction:function(e){return o.dispatchInner(e)},handleDOMEvents:{mousedown:function(){return o.editorView.hasFocus()&&o.innerEditorView.focus(),!0},blur:function(){return o.saveAndFinishEditing(),!0}}}),o.innerEditorView.focus()},this.node=e,this.editorView=t,this.getPos=n,this.toDOMAdaptor=r,this.innerEditorView=null,this.canceled=!1,this.dom=document.createElement("div"),this.dom.className=it("custom-block"),this.wrapper=document.createElement("div"),this.wrapper.className=it("custom-block-view"),this.createInnerViewContainer(),this.renderCustomBlock(),this.dom.appendChild(this.innerViewContainer),this.dom.appendChild(this.wrapper)}return e.prototype.renderToolArea=function(){var e=this,t=document.createElement("div"),n=document.createElement("span"),r=document.createElement("button");t.className="tool",n.textContent=this.node.attrs.info,n.className="info",r.type="button",r.addEventListener("click",(function(){return e.openEditor()})),t.appendChild(n),t.appendChild(r),this.wrapper.appendChild(t)},e.prototype.renderCustomBlock=function(){var e=this.toDOMAdaptor.getToDOMNode(this.node.attrs.info);if(e){for(var t=e(this.node);this.wrapper.hasChildNodes();)this.wrapper.removeChild(this.wrapper.lastChild);t&&this.wrapper.appendChild(t),this.renderToolArea()}},e.prototype.createInnerViewContainer=function(){this.innerViewContainer=document.createElement("div"),this.innerViewContainer.className=it("custom-block-editor"),this.innerViewContainer.style.display="none"},e.prototype.closeEditor=function(){this.innerEditorView&&(this.innerEditorView.destroy(),this.innerEditorView=null,this.innerViewContainer.style.display="none"),this.wrapper.style.display="block"},e.prototype.saveAndFinishEditing=function(){var e=this.editorView.state.selection.to,t=this.editorView.state;this.editorView.dispatch(t.tr.setSelection(de(t.tr,e))),this.editorView.focus(),this.renderCustomBlock(),this.closeEditor()},e.prototype.cancelEditing=function(){var e=(0,ue.undoDepth)(this.innerEditorView.state);for(this.canceled=!0;e--;)(0,ue.undo)(this.innerEditorView.state,this.innerEditorView.dispatch),(0,ue.undo)(this.editorView.state,this.editorView.dispatch);this.canceled=!1;var t=this.editorView.state.selection.to,n=this.editorView.state;this.editorView.dispatch(n.tr.setSelection(ie.TextSelection.create(n.doc,t))),this.editorView.focus(),this.closeEditor()},e.prototype.dispatchInner=function(e){var t=this.innerEditorView.state.applyTransaction(e),n=t.state,r=t.transactions;if(this.innerEditorView.updateState(n),!this.canceled&&Dt()(this.getPos)){for(var o=this.editorView.state.tr,i=ne.StepMap.offset(this.getPos()+1),a=0;a<r.length;a+=1)for(var s=r[a].steps,l=0;l<s.length;l+=1)o.step(s[l].map(i));o.docChanged&&this.editorView.dispatch(o)}},e.prototype.update=function(e){return!!e.sameMarkup(this.node)&&(this.node=e,this.innerEditorView||this.renderCustomBlock(),!0)},e.prototype.stopEvent=function(e){return!!this.innerEditorView&&!!e.target&&this.innerEditorView.dom.contains(e.target)},e.prototype.ignoreMutation=function(){return!0},e.prototype.destroy=function(){this.dom.removeEventListener("dblclick",this.openEditor),this.closeEditor()},e}(),ol="image-link",il=function(){function e(e,t,n,r){var o,i=this;this.handleMousedown=function(e){e.preventDefault();var t=e.target,n=e.offsetX,r=e.offsetY;if(i.imageLink&&Dt()(i.getPos)&&$e()(t,ol)){var o=getComputedStyle(t,":before");if(e.stopPropagation(),rt(o,n,r)){var a=i.view.state.tr,s=i.getPos();a.setSelection(de(a,s,s+1)),i.view.dispatch(a),i.eventEmitter.emit("openPopup","link",i.imageLink.attrs)}}},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=r,this.imageLink=null!==(o=e.marks.filter((function(e){return"link"===e.type.name}))[0])&&void 0!==o?o:null,this.dom=this.createElement(),this.bindEvent()}return e.prototype.createElement=function(){var e=this.createImageElement(this.node);if(this.imageLink){var t=document.createElement("span");return t.className=ol,t.appendChild(e),t}return e},e.prototype.createImageElement=function(e){var t=document.createElement("img"),n=e.attrs,r=n.imageUrl,o=n.altText,i=vs(e.attrs);return t.src=r,o&&(t.alt=o),ht(i,t),t},e.prototype.bindEvent=function(){this.imageLink&&this.dom.addEventListener("mousedown",this.handleMousedown)},e.prototype.stopEvent=function(){return!0},e.prototype.destroy=function(){this.imageLink&&this.dom.removeEventListener("mousedown",this.handleMousedown)},e}(),al=function(){function e(e,t,n,r){var o=this;this.contentDOM=null,this.input=null,this.timer=null,this.handleMousedown=function(e){var t=e.target;if("none"!==getComputedStyle(t,":after").backgroundImage&&Dt()(o.getPos)){var n=o.view.coordsAtPos(o.getPos()),r=n.top,i=n.right;o.createLanguageEditor({top:r,right:i})}},this.handleKeydown=function(e){"Enter"===e.key&&o.input&&(e.preventDefault(),o.changeLanguage())},this.node=e,this.view=t,this.getPos=n,this.eventEmitter=r,this.createElement(),this.bindDOMEvent(),this.bindEvent()}return e.prototype.createElement=function(){var e=this.node.attrs.language,t=document.createElement("div");t.setAttribute("data-language",e||"text"),t.className="toastui-editor-ww-code-block";var n=this.createCodeBlockElement(),r=n.firstChild;t.appendChild(n),this.dom=t,this.contentDOM=r},e.prototype.createCodeBlockElement=function(){var e=document.createElement("pre"),t=document.createElement("code"),n=this.node.attrs.language,r=vs(this.node.attrs);return n&&t.setAttribute("data-language",n),ht(r,e),e.appendChild(t),e},e.prototype.createLanguageEditor=function(e){var t=this,n=e.top,r=e.right,o=document.createElement("span");o.className="toastui-editor-ww-code-block-language";var i=document.createElement("input");i.type="text",i.value=this.node.attrs.language,o.appendChild(i),this.view.dom.parentElement.appendChild(o);var a=o.clientWidth;f()(o,{top:n+10+"px",left:r-a-10+"px",width:a+"px"}),this.input=i,this.input.addEventListener("blur",(function(){return t.changeLanguage()})),this.input.addEventListener("keydown",this.handleKeydown),this.clearTimer(),this.timer=setTimeout((function(){t.input.focus()}))},e.prototype.bindDOMEvent=function(){this.dom&&this.dom.addEventListener("click",this.handleMousedown)},e.prototype.bindEvent=function(){var e=this;this.eventEmitter.listen("scroll",(function(){e.input&&e.reset()}))},e.prototype.changeLanguage=function(){if(this.input&&Dt()(this.getPos)){var e=this.input.value;this.reset();var t=this.getPos(),n=this.view.state.tr;n.setNodeMarkup(t,null,{language:e}),this.view.dispatch(n)}},e.prototype.reset=function(){var e;if(null===(e=this.input)||void 0===e?void 0:e.parentElement){var t=this.input.parentElement;this.input=null,lt(t)}},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.stopEvent=function(){return!0},e.prototype.update=function(e){return!!e.sameMarkup(this.node)&&(this.node=e,!0)},e.prototype.destroy=function(){this.reset(),this.clearTimer(),this.dom&&this.dom.removeEventListener("click",this.handleMousedown)},e}(),sl=/MsoListParagraph/,ll=/style=(.|\n)*mso-/,ul=/mso-list:(.*)/,cl=/O:P/,pl=/^(n|u|l)/;function dl(e){for(var t=[],n=document.createTreeWalker(e,1,null,!1);n.nextNode();){var r=n.currentNode;if(st(r)){var o=r,i=o.outerHTML,a=o.textContent,s=ll.test(i),l=ul.test(i);s&&!l&&a?t.push([r,!0]):(cl.test(r.nodeName)||s&&!a||l)&&t.push([r,!1])}}return t.forEach((function(e){var t=e[0];e[1]?function(e){for(var t=[];e.firstChild;)t.push(e.firstChild),e.parentNode&&e.parentNode.insertBefore(e.firstChild,e);lt(e)}(t):lt(t)})),e.innerHTML.trim()}function fl(e){var t=[];return e.forEach((function(e,n){var r=t[n-1],o=function(e,t){var n=e.getAttribute("style");if(n){var r=n.match(ul)[1].trim().split(" ")[1];return{id:t,level:parseInt(r.replace("level",""),10),prev:null,parent:null,children:[],unordered:pl.test(e.textContent||""),contents:dl(e)}}return null}(e,n);o&&(r&&function(e,t){if(t.level<e.level)t.children.push(e),e.parent=t;else{for(;t&&t.level!==e.level;)t=t.parent;t&&(e.prev=t,e.parent=t.parent,e.parent&&e.parent.children.push(e))}}(o,r),t.push(o))})),t}function hl(e){var t=e[0].unordered?"ul":"ol",n=document.createElement(t);return e.forEach((function(e){var t=e.children,r=e.contents,o=document.createElement("li");o.innerHTML=r,n.appendChild(o),t.length&&n.appendChild(hl(t))})),n}function ml(e){return hl(fl(e).filter((function(e){return!e.parent})))}function vl(e){var t=document.createElement("div");t.innerHTML=e;var n,r,o,i=[],a=(n=t,r="p.MsoListParagraph",(o=oe()(n.querySelectorAll(r))).length?o:[]);return a.forEach((function(e){var n=function(e){for(;e&&!st(e);)e=e.nextSibling;return!e||!sl.test(e.className)}(e.nextSibling);if(i.push(e),n){var r=ml(i),o=e.nextSibling;o?function(e,t){t.parentNode&&t.parentNode.insertBefore(e,t)}(r,o):function(e,t){(t=Ve()(t)?oe()(t):[t]).forEach((function(t){e.appendChild(t)}))}(t,r),i=[]}lt(e)})),""+(a.length?"<p></p>":"")+t.innerHTML}var gl="\x3c!--StartFragment--\x3e";function yl(e){return function(e){return ll.test(e)}(e=function(e){return/<\/td>((?!<\/tr>)[\s\S])*$/i.test(e)&&(e="<tr>"+e+"</tr>"),/<\/tr>((?!<\/table>)[\s\S])*$/i.test(e)&&(e="<table>"+e+"</table>"),e}(e=function(e){var t=e.indexOf(gl),n=e.lastIndexOf("\x3c!--EndFragment--\x3e");return t>-1&&n>-1&&(e=e.slice(t+20,n)),e.replace(/<br[^>]*>/g,nt)}(e)))&&(e=vl(e)),e}function bl(e,t,n){for(var r=[],o=e.childCount,i=0;i<o;i+=1)if(!e.child(i).attrs.extended){var a=i<o?n.create(e.child(i).attrs,e.child(i).content):n.createAndFill();r.push(a)}return r}function wl(e,t,n){var r=n.nodes,o=r.tableRow,i=bl(e,0,r.tableHeadCell);return o.create(null,i)}function kl(e,t,n){var r=n.nodes,o=r.tableRow,i=bl(e,0,r.tableBodyCell);return o.create(null,i)}function xl(e){var t=[],n=[];"tableHead"===e.firstChild.type.name&&e.firstChild.forEach((function(e){return t.push(e)}));"tableBody"===e.lastChild.type.name&&e.lastChild.forEach((function(e){return n.push(e)}));return r(r([],t),n)}function Cl(e,t,n){var r=wl(e,0,n);return n.nodes.tableHead.create(null,r)}function Tl(e,t,n){var r=e.map((function(e){return kl(e,0,n)}));if(!e.length){var o=function(e,t){for(var n=t.nodes,r=n.tableRow,o=n.tableBodyCell,i=[],a=0;a<e;a+=1){var s=o.createAndFill();i.push(s)}return r.create({dummyRowForPasting:!0},i)}(t,n);r.push(o)}return n.nodes.tableBody.create(null,r)}function El(e,t,n){var r=[],o=e.content,a=e.openStart,s=e.openEnd;return o.forEach((function(e){if("table"===e.type.name){var o=Ps(new i.Slice(i.Fragment.from(e),0,0));if(o){var a=xl(o),s="tableBody"===o.firstChild.type.name,l=function(e,t,n,r){var o=function(e){return e.reduce((function(e,t){return e.childCount>t.childCount?e:t})).childCount}(e);if(n&&r)return t.nodes.table.create(null,[Tl(e,o,t)]);var i=e[0],a=e.slice(1),s=[Cl(i,0,t)];return a.length&&s.push(Tl(a,o,t)),t.nodes.table.create(null,s)}(a,t,s,n);r.push(l)}}else r.push(e)})),new i.Slice(i.Fragment.from(r),a,s)}function Ml(e){return 4*e}function Ll(e,t){var n=e.state,r=n.selection,o=n.schema,a=n.tr,s=Rs(r),l=s.anchor,u=s.head;if(l&&u){var c=Ps(t);if(!c)return!1;var p=Es.create(l),d=p.getRectOffsets(l,u),f=function(e,t,n){var r=[],o=xl(e),i=(o[0].childCount,o.length),a=0===t.startRowIdx,s=o.slice(0,i);if(a){var l=s.shift();if(l){var u=wl(l,0,n).content;r.push(u)}}return s.forEach((function(e){if(!e.attrs.dummyRowForPasting){var t=kl(e,0,n).content;r.push(t)}})),r}(c,d,o),h=function(e,t,n){for(var r=t.startRowIdx,o=t.startColIdx,i=n.length,a=0,s=function(e){var t=n[e].childCount;n[e].forEach((function(e){var n=e.attrs.colspan;n>1&&(t+=n-1)})),a=Math.max(a,t)},l=0;l<i;l+=1)s(l);var u=r+i-1,c=o+a-1;return{startRowIdx:r,startColIdx:o,endRowIdx:u,endColIdx:c,addedRowCount:Math.max(u+1-e.totalRowCount,0),addedColumnCount:Math.max(c+1-e.totalColumnCount,0)}}(p,d,f),m=[];return function(e,t){var n=e.getSpannedOffsets(t),r=Hs(n),o=r.rowCount,i=r.columnCount,a=Hs(t),s=a.rowCount,l=a.columnCount;return o===s&&i===l}(p,h)&&(function(e,t){for(var n=e.startRowIdx,r=e.startColIdx,o=e.endRowIdx,i=e.endColIdx,a=e.addedRowCount,s=e.addedColumnCount,l=n;l<=o-a;l+=1)t.push({rowIdx:l,startColIdx:r,endColIdx:i-s})}(h,m),h.addedColumnCount&&function(e,t,n,r,o){for(var i=r.startRowIdx,a=r.startColIdx,s=r.endRowIdx,l=r.endColIdx,u=r.addedRowCount,c=r.addedColumnCount,p=n.totalRowCount,d=0,f=0;f<p;f+=1){var h=n.getCellInfo(f,l-c),m=h.offset,v=h.nodeSize,g=e.mapping.map(m+v),y=Ds(c,f,t);if(e.insert(g,y),f>=i&&f<=s-u){var b=n.getCellInfo(f,l-c),w=e.mapping.map(b.offset),k=g+Ml(c);o[d]={rowIdx:f,startColIdx:a,endColIdx:l,dummyOffsets:[w,k]},d+=1}}}(a,o,p,h,m),h.addedRowCount&&function(e,t,n,r,o){var i=r.addedRowCount,a=r.addedColumnCount,s=r.startColIdx,l=r.endColIdx,u=e.mapping.maps.length,c=n.tableEndOffset-2,p=As(i,n.totalColumnCount+a,t),d=c;e.insert(e.mapping.slice(u).map(d),p);for(var f=0;f<i;f+=1){var h=d+Ml(s)+1,m=d+Ml(l+1)+1,v=d+Ml(n.totalColumnCount+a)+2;o.push({rowIdx:f+n.totalRowCount,startColIdx:s,endColIdx:l,dummyOffsets:[h,m]}),d=v}}(a,o,p,h,m),function(e,t,n,r){var o=e.mapping.maps.length;n.forEach((function(n,a){var s=n.rowIdx,l=n.startColIdx,u=n.endColIdx,c=n.dummyOffsets,p=e.mapping.slice(o),d=new i.Slice(t[a],0,0),f=c?c[0]:r.getCellStartOffset(s,l),h=c?c[1]:r.getCellEndOffset(s,u);e.replace(p.map(f),p.map(h),d)}))}(a,f,m,p),e.dispatch(a),function(e,t,n){var r=e.state,o=r.tr,i=r.doc,a=Es.create(i.resolve(n)),s=t[0],l=s.rowIdx,u=s.startColIdx,c=X(t),p=c.rowIdx,d=c.endColIdx,f=a.getCellInfo(l,u).offset,h=a.getCellInfo(p,d).offset;e.dispatch(o.setSelection(new Ss(i.resolve(f),i.resolve(h))))}(e,m,p.getCellInfo(0,0).offset)),!0}return!1}var Nl,Sl=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"doc"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"block+"}},enumerable:!1,configurable:!0}),n}(Tt),Al=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"paragraph"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"inline*",group:"block",attrs:n({},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"p"}],toDOM:function(e){return["p",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r}(Tt),Dl=/\s{1,4}$/,Ol=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"text"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{group:"inline"}},enumerable:!1,configurable:!0}),n.prototype.addSpaces=function(){return function(e,t){var n=e.selection,r=e.tr,o=n.$from,i=n.$to;return!(!o.blockRange(i)||cs(o)||ps(o))&&(t(r.insertText(" ",o.pos,i.pos)),!0)}},n.prototype.removeSpaces=function(){return function(e,t){var n=e.selection,r=e.tr,o=n.$from,i=n.$to,a=n.from;if(o.blockRange(i)&&!cs(o)&&!ps(o)){var s=o.nodeBefore;if(s&&s.isText){var l=s.text,u=l.replace(Dl,""),c=l.length-u.length;return t(r.delete(a-c,a)),!0}}return!1}},n.prototype.keymaps=function(){return{Tab:this.addSpaces(),"Shift-Tab":this.removeSpaces()}},n}(Tt),Il=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"heading"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"levels",{get:function(){return[1,2,3,4,5,6]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){var e=this.levels.map((function(e){return{tag:"h"+e,getAttrs:function(t){var r=t.getAttribute("data-raw-html");return n({level:e},r&&{rawHTML:r})}}}));return{attrs:n({level:{default:1},headingType:{default:"atx"},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"inline*",group:"block",defining:!0,parseDOM:e,toDOM:function(e){var t=e.attrs;return["h"+t.level,vs(t),0]}}},enumerable:!1,configurable:!0}),r.prototype.commands=function(){return function(e){return function(t,n){var r=t.schema.nodes[e.level?"heading":"paragraph"];return(0,se.setBlockType)(r,e)(t,n)}}},r}(Tt),Rl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"codeBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:n({language:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),code:!0,defining:!0,marks:"",parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(e){var t=e.getAttribute("data-raw-html"),r=e.firstElementChild;return n({language:(null==r?void 0:r.getAttribute("data-language"))||null},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"pre",["code",n({"data-language":t.language},vs(t)),0]]}}},enumerable:!1,configurable:!0}),r.prototype.commands=function(){return function(){return function(e,t){return(0,se.setBlockType)(e.schema.nodes.codeBlock)(e,t)}}},r.prototype.moveCursor=function(e){var t=this;return function(n,r){var o,i,a=n.tr,s=n.doc,l=n.schema,u=n.selection.$from;if(t.context.view.endOfTextblock(e)&&"codeBlock"===u.node().type.name){var c=u.parent.textContent.split("\n"),p="up"===e?u.start():u.end(),d="up"===e?[p,c[0].length+p]:[p-X(c).length,p],f=s.resolve("up"===e?u.before():u.after()),h="up"===e?f.nodeBefore:f.nodeAfter;if(o=u.pos,i=d[1],o>=d[0]&&o<=i&&!h){var m=fe(a,f,l);if(m)return r(m),!0}}return!1}},r.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-p":e,"Shift-Mod-P":e,ArrowUp:this.moveCursor("up"),ArrowDown:this.moveCursor("down")}},r}(Tt),Pl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"bulletList"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[fs("ul")],toDOM:function(e){return["ul",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r.prototype.changeList=function(){return function(e,t){return bs(e.schema.nodes.bulletList)(e,t)}},r.prototype.commands=function(){return{bulletList:this.changeList,taskList:ws}},r.prototype.keymaps=function(){var e=this.changeList(),t=Cs(),n=t.indent,r=t.outdent;return{"Mod-u":e,"Mod-U":e,Tab:n(),"Shift-Tab":r()}},r}(Tt),Hl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"orderedList"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"listItem+",group:"block",attrs:n({order:{default:1},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"ol",getAttrs:function(e){var t=e.getAttribute("start"),r=e.getAttribute("data-raw-html");return n({order:e.hasAttribute("start")?Number(t):1},r&&{rawHTML:r})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"ol",n({start:1===t.order?null:t.order},vs(t)),0]}}},enumerable:!1,configurable:!0}),r.prototype.commands=function(){return function(){return function(e,t){return bs(e.schema.nodes.orderedList)(e,t)}}},r.prototype.keymaps=function(){var e=this.commands()(),t=Cs(),n=t.indent,r=t.outdent;return{"Mod-o":e,"Mod-O":e,Tab:n(),"Shift-Tab":r()}},r}(Tt),Bl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"listItem"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"paragraph block*",selectable:!1,attrs:{task:{default:!1},checked:{default:!1},rawHTML:{default:null}},defining:!0,parseDOM:[{tag:"li",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return n({task:e.hasAttribute("data-task"),checked:e.hasAttribute("data-task-checked")},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs,r=t.task,o=t.checked;if(!r)return[t.rawHTML||"li",0];var i=["task-list-item"];return o&&i.push("checked"),[t.rawHTML||"li",n({class:i.join(" "),"data-task":r},o&&{"data-task-checked":o}),0]}}},enumerable:!1,configurable:!0}),r.prototype.liftToPrevListItem=function(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from,a=n.empty,s=o.nodes.listItem,l=i.parent,u=i.node(-1);if(a&&!l.childCount&&u.type===s){if(i.index(-2)>=1)return r.delete(i.start(-1)-1,i.end(-1)),t(r),!0;if(i.node(-3).type===s)return r.delete(i.start(-2)-1,i.end(-1)),t(r),!0}return!1}},r.prototype.keymaps=function(){return{Backspace:this.liftToPrevListItem(),Enter:function(e,t){return function(e){return function(t,n){var r=t.tr,o=t.selection,a=o.$from,s=o.$to;if(a.depth<2||!a.sameParent(s))return!1;var l=a.node(-1);if(l.type!==e)return!1;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==e||a.index(-2)!==a.node(-2).childCount-1)return!1;for(var u=a.index(-1)>0,c=i.Fragment.empty,p=a.depth-(u?1:2);p>=a.depth-3;p-=1)c=i.Fragment.from(a.node(p).copy(c));return c=c.append(i.Fragment.from(e.createAndFill())),r.replace(u?a.before():a.before(-1),a.after(-3),new i.Slice(c,u?3:2,2)),r.setSelection(ie.Selection.near(r.doc.resolve(a.pos+(u?3:2)))),n(r),!0}var d=s.pos===a.end()?l.contentMatchAt(0).defaultType:null,f=d&&[null,{type:d}];return r.delete(a.pos,s.pos),!!(0,ne.canSplit)(r.doc,a.pos,2,f)&&(r.split(a.pos,2,f),n(r),!0)}}(e.schema.nodes.listItem)(e,t)}}},r}(Tt),Fl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"blockQuote"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),content:"block+",group:"block",parseDOM:[fs("blockquote")],toDOM:function(e){return["blockquote",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r.prototype.commands=function(){return function(){return function(e,t){return(0,se.wrapIn)(e.schema.nodes.blockQuote)(e,t)}}},r.prototype.keymaps=function(){var e=this.commands()();return{"Alt-q":e,"Alt-Q":e}},r}(Tt),ql={left:function(e,t){var n=e[0],r=e[1],o=t.totalColumnCount,i=0===r;if(0!==n||!i){r-=1,i&&(n-=1,r=o-1);var a=t.getCellInfo(n,r);return a.offset+a.nodeSize-2}return null},right:function(e,t){var n=e[0],r=e[1],o=t.totalRowCount,i=t.totalColumnCount,a=r===i-1;if(n!==o-1||!a){var s=r+1,l=t.getColspanStartInfo(n,r);return(null==l?void 0:l.count)>1&&(s+=l.count-1),(a||s===i)&&(n+=1,s=0),t.getCellInfo(n,s).offset+2}return null},up:function(e,t){var n=e[0],r=e[1];if(n>0){var o=t.getCellInfo(n-1,r);return o.offset+o.nodeSize-2}return null},down:function(e,t){var n=e[0],r=e[1],o=t.totalRowCount;if(n<o-1){var i=n+1,a=t.getRowspanStartInfo(n,r);return(null==a?void 0:a.count)>1&&(i+=a.count-1),t.getCellInfo(i,r).offset+2}return null}};function jl(e,t,n,r){var o=t[0],i=t[1],a=o+3,s=i>=a,l=s?o+1:i,u=function(e,t,n,r,o){var i=t[0],a=t[1],s=t[2];if(e===Nl.LEFT||e===Nl.UP){if(o&&!function(e,t,n){var r=n[0],o=n[1],i=t.resolve(e.before(r-1));return o===r&&!i.nodeBefore}(n,r,[i,a]))return!1;var l=n.before(s);if(r.resolve(l).nodeBefore)return!1}return!0}(e,[i,a,l],n,r,s),c=function(e,t,n,r,o){if(e===Nl.RIGHT||e===Nl.DOWN){if(o&&!function(e){for(var t,n,r=e.depth;r&&"tableBodyCell"!==(n=e.node(r)).type.name;){if("listItem"===n.type.name){var o=e.node(r-1).lastChild===n,i="paragraph"!==(null===(t=n.lastChild)||void 0===t?void 0:t.type.name);return!!o&&!i}r-=1}return!1}(n))return!1;var i=n.after(t);if(r.resolve(i).nodeAfter)return!1}return!0}(e,l,n,r,s);return u&&c}function _l(e,t,n){var r=n[0],o=n[1],i=t.getRowspanStartInfo(r,o),a=e===Nl.UP&&0===r,s=e===Nl.DOWN&&((null==i?void 0:i.count)>1?r+i.count-1:r)===t.totalRowCount-1;return a||s}function Ul(e,t,n,r){void 0===r&&(r=!1);var o=e.doc.resolve(t.tableEndOffset);return r||!o.nodeAfter?fe(e,o,n):e.setSelection(ie.Selection.near(o,1))}function zl(e,t,n,r){var o=(0,ql[e])(n,r);if(o){var i=e===Nl.RIGHT||e===Nl.DOWN?1:-1;return t.setSelection(ie.Selection.near(t.doc.resolve(o),i))}return null}function Vl(e,t,n){var r=e.getCellInfo(t,0).offset,o=e.getCellInfo(t,n-1);return{from:r,to:o.offset+o.nodeSize}}!function(e){e.LEFT="left",e.RIGHT="right",e.UP="up",e.DOWN="down"}(Nl||(Nl={}));var Wl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"table"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"tableHead{1} tableBody{1}",group:"block",attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[fs("table")],toDOM:function(e){return["table",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r.prototype.addTable=function(){return function(e){return void 0===e&&(e={rowCount:2,columnCount:1,data:[]}),function(t,n){var r=e.rowCount,o=e.columnCount,i=e.data,a=t.schema,s=t.selection,l=t.tr,u=s.from,c=s.to,p=s.$from;if(u===c&&!ps(p)){var d=a.nodes,f=d.tableHead,h=d.tableBody,m=null==i?void 0:i.slice(0,o),v=null==i?void 0:i.slice(o,i.length),g=function(e,t,n){for(var r=t.nodes,o=r.tableRow,i=r.tableHeadCell,a=r.paragraph,s=[],l=0;l<e;l+=1){var u=n&&n[l],c=a.create(null,u?t.text(u):[]);s.push(i.create(null,c))}return[o.create(null,s)]}(o,a,m),y=As(r-1,o,a,v),b=a.nodes.table.create(null,[f.create(null,g),h.create(null,y)]);return n(l.replaceSelectionWith(b)),!0}return!1}}},r.prototype.removeTable=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,o=Es.create(n.$anchor);if(o){var i=o.tableStartOffset,a=o.tableEndOffset,s=i-1,l=de(r.delete(s,a),s);return t(r.setSelection(l)),!0}return!1}}},r.prototype.addColumn=function(e){return function(){return function(t,n){var r=t.selection,o=t.tr,i=t.schema,a=Rs(r),s=a.anchor,l=a.head;if(s&&l){for(var u=Es.create(s),c=u.getRectOffsets(s,l),p=e===Nl.LEFT?c.startColIdx:c.endColIdx+1,d=Hs(c).columnCount,f=u.totalRowCount,h=0;h<f;h+=1){var m=Ds(d,h,i);o.insert(o.mapping.map(u.posAt(h,p)),m)}return n(o),!0}return!1}}},r.prototype.removeColumn=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,o=Rs(n),i=o.anchor,a=o.head;if(i&&a){var s=Es.create(i),l=s.getRectOffsets(i,a),u=s.totalColumnCount,c=s.totalRowCount;if(Hs(l).columnCount===u)return!1;for(var p=l.startColIdx,d=l.endColIdx,f=r.mapping.maps.length,h=0;h<c;h+=1)for(var m=d;m>=p;m-=1){var v=s.getCellInfo(h,m),g=v.offset,y=v.nodeSize,b=r.mapping.slice(f).map(g),w=b+y;r.delete(b,w)}return t(r),!0}return!1}}},r.prototype.addRow=function(e){return function(){return function(t,n){var r=t.selection,o=t.schema,i=t.tr,a=Rs(r),s=a.anchor,l=a.head;if(s&&l){var u=Es.create(s),c=u.totalColumnCount,p=u.getRectOffsets(s,l),d=Hs(p).rowCount,f=function(e,t,n){var r,o,i;return e===Nl.UP?(r=n.startRowIdx,o=0,i=-1):(r=n.endRowIdx,o=t.totalColumnCount-1,i=t.getCellInfo(r,o).nodeSize+1),{targetRowIdx:r,insertColIdx:o,nodeSize:i}}(e,u,p),h=f.targetRowIdx,m=f.insertColIdx,v=f.nodeSize;if(!(0===h)){for(var g=[],y=i.mapping.map(u.posAt(h,m))+v,b=[],w=0;w<c;w+=1)b=b.concat(Ds(1,h,o));for(var k=0;k<d;k+=1)g.push(o.nodes.tableRow.create(null,b));return n(i.insert(y,g)),!0}}return!1}}},r.prototype.removeRow=function(){return function(){return function(e,t){var n=e.selection,r=e.tr,o=Rs(n),i=o.anchor,a=o.head;if(i&&a){var s=Es.create(i),l=s.totalRowCount,u=s.totalColumnCount,c=s.getRectOffsets(i,a),p=Hs(c).rowCount,d=c.startRowIdx,f=c.endRowIdx;if(p===l-1||0===d)return!1;for(var h=f;h>=d;h-=1){var m=Vl(s,h,u),v=m.from,g=m.to;r.delete(v-1,g+1)}return t(r),!0}return!1}}},r.prototype.alignColumn=function(){return function(e){return void 0===e&&(e={align:"center"}),function(t,n){var r=e.align,o=t.selection,i=t.tr,a=Rs(o),s=a.anchor,l=a.head;if(s&&l){for(var u=Es.create(s),c=u.totalRowCount,p=u.getRectOffsets(s,l),d=p.startColIdx,f=p.endColIdx,h=0;h<c;h+=1)for(var m=d;m<=f;m+=1)if(!u.extendedRowspan(h,m)&&!u.extendedColspan(h,m)){var v=u.getNodeAndPos(h,m),g=v.node,y=v.pos,b=Bs(g,{align:r});i.setNodeMarkup(y,null,b)}return n(i),!0}return!1}}},r.prototype.moveToCell=function(e){return function(t,n){var r=t.selection,o=t.tr,i=t.schema,a=Rs(r),s=a.anchor,l=a.head;if(s&&l){var u=Es.create(s),c=u.getCellIndex(s),p=void 0;if(p=_l(e,u,c)?Ul(o,u,i):zl(e,o,c,u))return n(p),!0}return!1}},r.prototype.moveInCell=function(e){var t=this;return function(n,r){var o=n.selection,i=n.tr,a=n.doc,s=n.schema,l=o.$from;if(!t.context.view.endOfTextblock(e))return!1;var u=us(l,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}));if(u){var c=us(l,(function(e){return"paragraph"===e.type.name})),p=u.depth;if(c&&jl(e,[p,c.depth],l,a)){var d=Rs(o).anchor,f=Es.create(d),h=f.getCellIndex(d),m=void 0;if(!function(e,t,n){var r=n[0],o=n[1];if(e===Nl.UP||e===Nl.DOWN)return!1;var i=t.tableStartOffset,a=t.tableEndOffset,s=t.getCellInfo(r,o),l=s.offset,u=s.nodeSize;return(e===Nl.LEFT?i:a)===(e===Nl.LEFT?l-2:l+u+3)}(e,f,h)?_l(e,f,h)?e===Nl.UP?m=function(e,t,n){var r=e.doc.resolve(t.tableStartOffset-1);return r.nodeBefore?e.setSelection(ie.Selection.near(r,-1)):fe(e,r,n)}(i,f,s):e===Nl.DOWN&&(m=Ul(i,f,s)):m=zl(e,i,h,f):m=function(e,t,n){var r=e.doc.resolve(t.before(n-3));return e.setSelection(new ie.NodeSelection(r))}(i,l,p),m)return r(m),!0}}return!1}},r.prototype.deleteCells=function(){return function(e,t){var n=e.schema,r=e.selection,o=e.tr,i=Rs(r),a=i.anchor,s=i.head,l=r instanceof ie.TextSelection;if(a&&s&&!l){for(var u=Es.create(a),c=u.getRectOffsets(a,s),p=c.startRowIdx,d=c.startColIdx,f=c.endRowIdx,h=c.endColIdx,m=p;m<=f;m+=1)for(var v=d;v<=h;v+=1)if(!u.extendedRowspan(m,v)&&!u.extendedColspan(m,v)){var g=u.getNodeAndPos(m,v),y=g.node,b=g.pos,w=Ds(1,m,n,y.attrs);o.replaceWith(o.mapping.map(b),o.mapping.map(b+y.nodeSize),w)}return t(o),!0}return!1}},r.prototype.exitTable=function(){return function(e,t){var n=e.selection,r=e.tr,o=e.schema,i=n.$from;if(us(i,(function(e){var t=e.type;return"tableHeadCell"===t.name||"tableBodyCell"===t.name}))&&us(i,(function(e){return"paragraph"===e.type.name}))){var a=Rs(n).anchor;return t(Ul(r,Es.create(a),o,!0)),!0}return!1}},r.prototype.commands=function(){return{addTable:this.addTable(),removeTable:this.removeTable(),addColumnToLeft:this.addColumn(Nl.LEFT),addColumnToRight:this.addColumn(Nl.RIGHT),removeColumn:this.removeColumn(),addRowToUp:this.addRow(Nl.UP),addRowToDown:this.addRow(Nl.DOWN),removeRow:this.removeRow(),alignColumn:this.alignColumn()}},r.prototype.keymaps=function(){var e=this.deleteCells();return{Tab:this.moveToCell(Nl.RIGHT),"Shift-Tab":this.moveToCell(Nl.LEFT),ArrowUp:this.moveInCell(Nl.UP),ArrowDown:this.moveInCell(Nl.DOWN),ArrowLeft:this.moveInCell(Nl.LEFT),ArrowRight:this.moveInCell(Nl.RIGHT),Backspace:e,"Mod-Backspace":e,Delete:e,"Mod-Delete":e,"Mod-Enter":this.exitTable()}},r}(Tt),$l=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"tableHead"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"tableRow{1}",attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[fs("thead")],toDOM:function(e){return["thead",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r}(Tt),Gl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"tableBody"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"tableRow+",attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"tbody",getAttrs:function(e){var t=e.querySelectorAll("tr")[0].children.length,r=e.getAttribute("data-raw-html");return!!t&&n({},r&&{rawHTML:r})}}],toDOM:function(e){return["tbody",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r}(Tt),Xl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"tableRow"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"(tableHeadCell | tableBodyCell)*",attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"tr",getAttrs:function(e){var t=e.children.length,r=e.getAttribute("data-raw-html");return!!t&&n({},r&&{rawHTML:r})}}],toDOM:function(e){return["tr",vs(e.attrs),0]}}},enumerable:!1,configurable:!0}),r}(Tt),Zl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"tableHeadCell"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{content:"paragraph+",attrs:n({align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},extended:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),isolating:!0,parseDOM:[ms("th")],toDOM:function(e){var t=e.attrs,r=hs(t);return["th",n(n({},r),vs(t)),0]}}},enumerable:!1,configurable:!0}),r}(Tt),Kl=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"tableBodyCell"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"(paragraph | bulletList | orderedList)+",attrs:{align:{default:null},className:{default:null},rawHTML:{default:null},colspan:{default:null},rowspan:{default:null},extended:{default:null}},isolating:!0,parseDOM:[ms("td")],toDOM:function(e){return["td",hs(e.attrs),0]}}},enumerable:!1,configurable:!0}),n}(Tt),Ql=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"image"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{inline:!0,attrs:n({imageUrl:{default:""},altText:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),group:"inline",selectable:!1,parseDOM:[{tag:"img[src]",getAttrs:function(e){var t=ja(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,r=t.getAttribute("src")||"",o=t.getAttribute("data-raw-html"),i=t.getAttribute("alt");return n({imageUrl:r,altText:i},o&&{rawHTML:o})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"img",n(n({src:F(t.imageUrl)},t.altText&&{alt:t.altText}),vs(t))]}}},enumerable:!1,configurable:!0}),r.prototype.addImage=function(){return function(e){return function(t,r){var o=t.schema,i=t.tr,a=e,s=a.imageUrl,l=a.altText;if(!s)return!1;var u=o.nodes.image.createAndFill(n({imageUrl:s},l&&{altText:l}));return r(i.replaceSelectionWith(u).scrollIntoView()),!0}}},r.prototype.commands=function(){return{addImage:this.addImage()}},r}(Tt),Yl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"thematicBreak"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),group:"block",parseDOM:[{tag:"hr"}],selectable:!1,toDOM:function(e){var t=e.attrs;return["div",vs(t),[t.rawHTML||"hr"]]}}},enumerable:!1,configurable:!0}),r.prototype.hr=function(){var e=this;return function(){return function(t,n){var r,o=t.selection,i=o.$from;if(i===o.$to){var a=t.doc,s=t.schema.nodes,l=s.thematicBreak,u=s.paragraph,c=[l.create()],p=i.node(1),d=a.child(a.childCount-1)===p,f=a.resolve(i.after(1)),h=(null===(r=i.nodeAfter)||void 0===r?void 0:r.type.name)===e.name;return(d||h)&&c.push(u.create()),n(t.tr.insert(f.pos,c).scrollIntoView()),!0}return!1}}},r.prototype.commands=function(){return{hr:this.hr()}},r.prototype.keymaps=function(){var e=this.hr()();return{"Mod-l":e,"Mod-L":e}},r}(Tt),Jl=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"strong"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){var e=["b","strong"].map((function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return n({},t&&{rawHTML:t})}}}));return{attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"strong",vs(t)]}}},enumerable:!1,configurable:!0}),r.prototype.bold=function(){return function(){return function(e,t){return(0,se.toggleMark)(e.schema.marks.strong)(e,t)}}},r.prototype.commands=function(){return{bold:this.bold()}},r.prototype.keymaps=function(){var e=this.bold()();return{"Mod-b":e,"Mod-B":e}},r}(fn),eu=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"emph"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){var e=["i","em"].map((function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return n({},t&&{rawHTML:t})}}}));return{attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"em",vs(t)]}}},enumerable:!1,configurable:!0}),r.prototype.italic=function(){return function(){return function(e,t){return(0,se.toggleMark)(e.schema.marks.emph)(e,t)}}},r.prototype.commands=function(){return{italic:this.italic()}},r.prototype.keymaps=function(){var e=this.italic()();return{"Mod-i":e,"Mod-I":e}},r}(fn),tu=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"strike"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){var e=["s","del"].map((function(e){return{tag:e,getAttrs:function(e){var t=e.getAttribute("data-raw-html");return n({},t&&{rawHTML:t})}}}));return{attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:e,toDOM:function(e){var t=e.attrs;return[t.rawHTML||"del",vs(t)]}}},enumerable:!1,configurable:!0}),r.prototype.commands=function(){return function(){return function(e,t){return(0,se.toggleMark)(e.schema.marks.strike)(e,t)}}},r.prototype.keymaps=function(){var e=this.commands()();return{"Mod-s":e,"Mod-S":e}},r}(fn),nu=function(e){function r(t){var n=e.call(this)||this;return n.linkAttributes=t,n}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"link"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){var e=this;return{attrs:n({linkUrl:{default:""},title:{default:null},rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){var t=ja(e,{RETURN_DOM_FRAGMENT:!0}).firstChild,r=t.getAttribute("href")||"",o=t.getAttribute("title")||"",i=t.getAttribute("data-raw-html");return n({linkUrl:r,title:o},i&&{rawHTML:i})}}],toDOM:function(t){var r=t.attrs;return[r.rawHTML||"a",n(n({href:F(r.linkUrl)},e.linkAttributes),vs(r))]}}},enumerable:!1,configurable:!0}),r.prototype.addLink=function(){return function(e){return function(t,n){var r=e,o=r.linkUrl,i=r.linkText,a=void 0===i?"":i,s=t.schema,l=t.tr,u=t.selection,c=u.empty,p=u.from,d=u.to;if(p&&d&&o){var f={linkUrl:o},h=s.mark("link",f);if(c&&a){var m=pe(s,a,h);l.replaceRangeWith(p,d,m)}else l.addMark(p,d,h);return n(l.scrollIntoView()),!0}return!1}}},r.prototype.toggleLink=function(){return function(e){return function(t,n){return(0,se.toggleMark)(t.schema.marks.link,e)(t,n)}}},r.prototype.commands=function(){return{addLink:this.addLink(),toggleLink:this.toggleLink()}},r}(fn),ru=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"name",{get:function(){return"code"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"schema",{get:function(){return{attrs:n({rawHTML:{default:null}},{htmlAttrs:{default:null},classNames:{default:null}}),parseDOM:[{tag:"code",getAttrs:function(e){var t=e.getAttribute("data-raw-html");return n({},t&&{rawHTML:t})}}],toDOM:function(e){var t=e.attrs;return[t.rawHTML||"code",vs(t)]}}},enumerable:!1,configurable:!0}),r.prototype.commands=function(){return function(){return function(e,t){return(0,se.toggleMark)(e.schema.marks.code)(e,t)}}},r.prototype.keymaps=function(){var e=this.commands()();return{"Shift-Mod-c":e,"Shift-Mod-C":e}},r}(fn),ou=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"customBlock"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"text*",group:"block",attrs:{info:{default:null}},atom:!0,code:!0,defining:!0,parseDOM:[{tag:"div[data-custom-info]",getAttrs:function(e){return{info:e.getAttribute("data-custom-info")}}}],toDOM:function(e){return["div",{"data-custom-info":e.attrs.info||null},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return function(e){return function(t,n){return!!(null==e?void 0:e.info)&&(0,se.setBlockType)(t.schema.nodes.customBlock,e)(t,n)}}},n}(Tt),iu=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"frontMatter"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-front-matter]"}],toDOM:function(){return["div",{"data-front-matter":"true"},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return function(){return function(e,t,n){var r=e.selection.$from;return!(!n.endOfTextblock("down")||"frontMatter"!==r.node().type.name)&&(0,se.exitCode)(e,t)}}},n.prototype.keymaps=function(){return{Enter:this.commands()()}},n}(Tt),au=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),Object.defineProperty(n.prototype,"name",{get:function(){return"htmlComment"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"schema",{get:function(){return{content:"text*",group:"block",code:!0,defining:!0,parseDOM:[{preserveWhitespace:"full",tag:"div[data-html-comment]"}],toDOM:function(){return["div",{"data-html-comment":"true"},0]}}},enumerable:!1,configurable:!0}),n.prototype.commands=function(){return function(){return function(e,t,n){var r=e.selection.$from;return!(!n.endOfTextblock("down")||"htmlComment"!==r.node().type.name)&&(0,se.exitCode)(e,t)}}},n.prototype.keymaps=function(){return{Enter:this.commands()()}},n}(Tt);var su=it("contents"),lu=function(e){function o(t,r){var o=e.call(this,t)||this,i=r.toDOMAdaptor,a=r.htmlSchemaMap,s=void 0===a?{}:a,l=r.linkAttributes,u=void 0===l?{}:l,c=r.useCommandShortcut,p=void 0===c||c,d=r.wwPlugins,f=void 0===d?[]:d,h=r.wwNodeViews,m=void 0===h?{}:h;return o.editorType="wysiwyg",o.el.classList.add("ww-mode"),o.toDOMAdaptor=i,o.linkAttributes=u,o.extraPlugins=f,o.pluginNodeViews=m,o.specs=o.createSpecs(),o.schema=o.createSchema(s),o.context=o.createContext(),o.keymaps=o.createKeymaps(p),o.view=o.createView(),o.commands=o.createCommands(),o.specs.setContext(n(n({},o.context),{view:o.view})),o.initEvent(),o}return t(o,e),o.prototype.createSpecs=function(){return e=this.linkAttributes,new Rt([new Sl,new Al,new Ol,new Il,new Rl,new Pl,new Hl,new Bl,new Fl,new Wl,new $l,new Gl,new Xl,new Zl,new Kl,new Ql,new Yl,new Jl,new eu,new tu,new nu(e),new ru,new ou,new iu,new Lt,new au]);var e},o.prototype.createContext=function(){return{schema:this.schema,eventEmitter:this.eventEmitter}},o.prototype.createSchema=function(e){return new i.Schema({nodes:n(n({},this.specs.nodes),e.nodes),marks:n(n({},this.specs.marks),e.marks)})},o.prototype.createPlugins=function(){return r([new ie.Plugin({key:Fs,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(Fs);if(n)return-1===n?null:n;if(E()(t)||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:_s,createSelectionBetween:function(e){var t=e.state;return E()(Fs.getState(t))?null:t.selection}},view:function(e){return new qs(e)}}),Qs(this.eventEmitter),new ie.Plugin({props:{handleDOMEvents:{mousedown:function(e,t){var r=t,o=r.clientX,i=r.clientY,a=e.posAtCoords({left:o,top:i});if(a){var s=e.state,l=s.doc,u=s.tr,c=l.resolve(a.pos),p=ds(c),d=t.target,f=getComputedStyle(d,":before"),h=t,m=h.offsetX,v=h.offsetY;if(!p||!rt(f,m,v))return!1;t.preventDefault();var g=c.before(p.depth),y=p.node.attrs;return u.setNodeMarkup(g,null,n(n({},y),{checked:!y.checked})),e.dispatch(u),!0}return!1}}}}),nl(this.eventEmitter)],this.createPluginProps()).concat(this.defaultPlugins)},o.prototype.createPluginNodeViews=function(){var e=this.eventEmitter,t=this.pluginNodeViews,n={};return t&&Object.keys(t).forEach((function(r){n[r]=function(n,o,i){return t[r](n,o,i,e)}})),n},o.prototype.createView=function(){var e=this,t=this.toDOMAdaptor,r=this.eventEmitter;return new te.EditorView(this.el,{state:this.createState(),attributes:{class:su},nodeViews:n({customBlock:function(e,n,r){return new rl(e,n,r,t)},image:function(e,t,n){return new il(e,t,n,r)},codeBlock:function(e,t,n){return new al(e,t,n,r)},widget:Et},this.createPluginNodeViews()),dispatchTransaction:function(t){var n=e.view.state.applyTransaction(t).state;e.view.updateState(n),e.emitChangeEvent(t.scrollIntoView()),e.eventEmitter.emit("setFocusedNode",n.selection.$from.node(1))},transformPastedHTML:yl,transformPasted:function(t){return El(t,e.schema,ps(e.view.state.selection.$from))},handlePaste:function(e,t,n){return Ll(e,n)},handleKeyDown:function(t,n){return e.eventEmitter.emit("keydown",e.editorType,n),!1},handleDOMEvents:{paste:function(t,n){var r=n.clipboardData||window.clipboardData,o=null==r?void 0:r.items;if(o){var i=oe()(o).some((function(e){return"string"===e.kind&&"text/rtf"===e.type}));if(!i){var a=xt(o);a&&(n.preventDefault(),kt(e.eventEmitter,a,n.type))}}return!1},keyup:function(t,n){return e.eventEmitter.emit("keyup",e.editorType,n),!1},scroll:function(){return e.eventEmitter.emit("scroll","editor"),!0}}})},o.prototype.createCommands=function(){return this.specs.commands(this.view,Cs())},o.prototype.getHTML=function(){return mt(this.view.dom.innerHTML)},o.prototype.getModel=function(){return this.view.state.doc},o.prototype.getSelection=function(){var e=this.view.state.selection;return[e.from,e.to]},o.prototype.getSchema=function(){return this.view.state.schema},o.prototype.replaceSelection=function(e,t,n){var r=this.view.state,o=r.schema,a=r.tr,s=e.split("\n").map((function(e){return ce(o,je(e,o))})),l=new i.Slice(i.Fragment.from(s),1,1),u=k()(t)&&k()(n)?a.replaceRange(t,n,l):a.replaceSelection(l);this.view.dispatch(u),this.focus()},o.prototype.deleteSelection=function(e,t){var n=this.view.state.tr,r=k()(e)&&k()(t)?n.deleteRange(e,t):n.deleteSelection();this.view.dispatch(r.scrollIntoView())},o.prototype.getSelectedText=function(e,t){var n=this.view.state,r=n.doc,o=n.selection,i=o.from,a=o.to;return k()(e)&&k()(t)&&(i=e,a=t),r.textBetween(i,a,"\n")},o.prototype.setModel=function(e,t){void 0===t&&(t=!1);var n=this.view.state,r=n.tr,o=n.doc;this.view.dispatch(r.replaceWith(0,o.content.size,e)),t&&this.moveCursorToEnd(!0)},o.prototype.setSelection=function(e,t){void 0===t&&(t=e);var n=this.view.state.tr,r=de(n,e,t);this.view.dispatch(n.setSelection(r).scrollIntoView())},o.prototype.addWidget=function(e,t,n){var r=this.view,o=r.dispatch,i=r.state;o(i.tr.setMeta("widget",{pos:null!=n?n:i.selection.to,node:e,style:t}))},o.prototype.replaceWithWidget=function(e,t,n){var r=this.view.state,o=r.tr,i=je(n,r.schema);this.view.dispatch(o.replaceWith(e,t,i))},o.prototype.getRangeInfoOfNode=function(e){var t=this.view.state,n=t.doc,r=t.selection,o=e?n.resolve(e):r.$from,i=o.marks(),a=o.node(),s=o.start(),l=o.end(),u=a.type.name;if(i.length||"paragraph"===u){var c=i[i.length-1];u=c?c.type.name:"text",a.forEach((function(e,t){var n=e.isText,r=e.nodeSize,i=e.marks,a=o.pos-s;n&&t<=a&&t+r>=a&&function(e){return!e.length||q(e,c)}(i)&&(l=(s+=t)+r)}))}return{range:[s,l],type:u}},o}(St),uu=lu,cu=c(404),pu=c.n(cu),du=["afterPreviewRender","updatePreview","changeMode","needChangeMode","command","changePreviewStyle","changePreviewTabPreview","changePreviewTabWrite","scroll","contextmenu","show","hide","changeLanguage","changeToolbarState","toggleScrollSync","mixinTableOffsetMapPrototype","setFocusedNode","removePopupWidget","query","openPopup","closePopup","addImageBlobHook","beforePreviewRender","beforeConvertWysiwygToMarkdown","load","loadUI","change","caretChange","destroy","focus","blur","keydown","keyup"],fu=function(){function e(){var e=this;this.events=new Ws,this.eventTypes=du.reduce((function(e,t){return n(n({},e),{type:t})}),{}),this.hold=!1,du.forEach((function(t){e.addEventType(t)}))}return e.prototype.listen=function(e,t){var n=this.getTypeInfo(e),r=this.events.get(n.type)||[];if(!this.hasEventType(n.type))throw new Error("There is no event type "+n.type);n.namespace&&(t.namespace=n.namespace),r.push(t),this.events.set(n.type,r)},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.getTypeInfo(e),o=this.events.get(r.type),i=[];return!this.hold&&o&&o.forEach((function(e){var n=e.apply(void 0,t);C()(n)||i.push(n)})),i},e.prototype.emitReduce=function(e,t){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var i=this.events.get(e);return!this.hold&&i&&i.forEach((function(e){var o=e.apply(void 0,r([t],n));pu()(o)||(t=o)})),t},e.prototype.getTypeInfo=function(e){var t=e.split(".");return{type:t[0],namespace:t[1]}},e.prototype.hasEventType=function(e){return!C()(this.eventTypes[this.getTypeInfo(e).type])},e.prototype.addEventType=function(e){if(this.hasEventType(e))throw new Error("There is already have event type "+e);this.eventTypes[e]=e},e.prototype.removeEventHandler=function(e,t){var n=this,r=this.getTypeInfo(e),o=r.type,i=r.namespace;o&&t?this.removeEventHandlerWithHandler(o,t):o&&!i?this.events.delete(o):!o&&i?this.events.forEach((function(e,t){n.removeEventHandlerWithTypeInfo(t,i)})):o&&i&&this.removeEventHandlerWithTypeInfo(o,i)},e.prototype.removeEventHandlerWithHandler=function(e,t){var n=this.events.get(e);if(n){var r=n.indexOf(t);n.indexOf(t)>=0&&n.splice(r,1)}},e.prototype.removeEventHandlerWithTypeInfo=function(e,t){var n=[],r=this.events.get(e);r&&(r.map((function(e){return e.namespace!==t&&n.push(e),null})),this.events.set(e,n))},e.prototype.getEvents=function(){return this.events},e.prototype.holdEventInvoke=function(e){this.hold=!0,e(),this.hold=!1},e}(),hu=fu,mu=function(){function e(e,t,n,r){this.eventEmitter=e,this.mdCommands=t,this.wwCommands=n,this.getEditorType=r,this.initEvent()}return e.prototype.initEvent=function(){var e=this;this.eventEmitter.listen("command",(function(t,n){e.exec(t,n)}))},e.prototype.addCommand=function(e,t,n){"markdown"===e?this.mdCommands[t]=n:this.wwCommands[t]=n},e.prototype.deleteCommand=function(e,t){"markdown"===e?delete this.mdCommands[t]:delete this.wwCommands[t]},e.prototype.exec=function(e,t){"markdown"===this.getEditorType()?this.mdCommands[e](t):this.wwCommands[e](t)},e}(),vu=mu;function gu(e){return"\n"===e[e.length-1]?e.slice(0,e.length-1):e}function yu(e,t){var n=e.schema,r=t.literal.match(Je);if(r){var o=r[1],i=r[3],a=(o||i).toLowerCase();return"htmlInline"===t.type&&!(!n.marks[a]&&!n.nodes[a])}return!1}function bu(e){return q(["text","strong","emph","strike","image","link","code"],e.type)}function wu(e){return"softbreak"===(null==e?void 0:e.type)}function ku(e){var t=e.type,n=e.literal,r="htmlInline"===t&&n.match(Je);if(r){var o=r[1],i=r[3],a=o||i;if(a)return q(["ul","ol","li"],a.toLowerCase())}return!1}function xu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=document.createElement("div");r.innerHTML=ja(e);var o=r.firstChild;return t.map((function(e){return o.getAttribute(e)||""}))}var Cu={"b, strong":function(e,t,n){var r=e.schema.marks.strong;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},"i, em":function(e,t,n){var r=e.schema.marks.emph;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},"s, del":function(e,t,n){var r=e.schema.marks.strike;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},code:function(e,t,n){var r=e.schema.marks.code;n?e.openMark(r.create({rawHTML:n})):e.closeMark(r)},a:function(e,t,n){var r=t.literal,o=e.schema.marks.link;if(n){var i=xu(r,"href")[0];e.openMark(o.create({linkUrl:i,rawHTML:n}))}else e.closeMark(o)},img:function(e,t,r){var o=t.literal;if(r){var i=xu(o,"src","alt"),a=i[0],s=i[1],l=e.schema.nodes.image;e.addNode(l,n({rawHTML:r,imageUrl:a},s&&{altText:s}))}},hr:function(e,t,n){e.addNode(e.schema.nodes.thematicBreak,{rawHTML:n})},br:function(e,t){var n=e.schema.nodes.paragraph,r=t.parent,o=t.prev,i=t.next;"paragraph"===(null==r?void 0:r.type)?(wu(o)&&e.openNode(n),wu(i)?e.closeNode():i&&(e.closeNode(),e.openNode(n))):"tableCell"===(null==r?void 0:r.type)&&(o&&(bu(o)||yu(e,o))&&e.closeNode(),i&&(bu(i)||yu(e,i))&&e.openNode(n))},pre:function(e,t,n){var r,o,i=document.createElement("div");i.innerHTML=t.literal;var a=null===(o=null===(r=i.firstChild)||void 0===r?void 0:r.firstChild)||void 0===o?void 0:o.textContent;e.openNode(e.schema.nodes.codeBlock,{rawHTML:n}),e.addText(gu(a)),e.closeNode()},"ul, ol":function(e,t,n){if("tableCell"===t.parent.type){var r=e.schema.nodes,o=r.bulletList,i=r.orderedList,a=r.paragraph,s="ul"===n?o:i;n?(t.prev&&!ku(t.prev)&&e.closeNode(),e.openNode(s,{rawHTML:n})):(e.closeNode(),t.next&&!ku(t.next)&&e.openNode(a))}},li:function(e,t,r){var o;if("tableCell"===(null===(o=t.parent)||void 0===o?void 0:o.type)){var i=e.schema.nodes,a=i.listItem,s=i.paragraph;if(r){var l=function(e){var t=e.literal;return{task:/data-task/.test(t),checked:/data-task-checked/.test(t)}}(t);t.prev&&!ku(t.prev)&&e.closeNode(),e.openNode(a,n({rawHTML:r},l)),t.next&&!ku(t.next)&&e.openNode(s)}else t.prev&&!ku(t.prev)&&e.closeNode(),e.closeNode()}}},Tu=function(e){var t={};return Object.keys(e).forEach((function(n){n.split(", ").forEach((function(r){var o=r.toLowerCase();t[o]=e[n]}))})),t}(Cu);function Eu(e){return"htmlInline"===e.type&&et.test(e.literal)}function Mu(e){oe()(e.childNodes).forEach((function(e){if(st(e)){var t=e.nodeName.toLowerCase();e.setAttribute("data-raw-html",t),e.childNodes&&Mu(e)}}))}var Lu={text:function(e,t){e.addText(t.literal||"")},paragraph:function(e,t,n,r){var o;if(n.entering){var i=e.schema.nodes.paragraph;"paragraph"===(null===(o=t.prev)||void 0===o?void 0:o.type)&&(e.openNode(i,r),e.closeNode()),e.openNode(i,r)}else e.closeNode()},heading:function(e,t,r,o){if(r.entering){var i=t,a=i.level,s=i.headingType;e.openNode(e.schema.nodes.heading,n({level:a,headingType:s},o))}else e.closeNode()},codeBlock:function(e,t,r){var o=e.schema.nodes.codeBlock,i=t,a=i.info,s=i.literal;e.openNode(o,n({language:a},r)),e.addText(gu(s||"")),e.closeNode()},list:function(e,t,r,o){if(r.entering){var i=e.schema.nodes,a=i.bulletList,s=i.orderedList,l=t.listData,u=l.type,c=l.start;"bullet"===u?e.openNode(a,o):e.openNode(s,n({order:c},o))}else e.closeNode()},item:function(e,t,r,o){var i=r.entering,a=e.schema.nodes.listItem,s=t.listData,l=s.task,u=s.checked;if(i){var c=n(n(n({},l&&{task:l}),u&&{checked:u}),o);e.openNode(a,c)}else e.closeNode()},blockQuote:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.blockQuote,r):e.closeNode()},image:function(e,t,r,o){var i=r.entering,a=r.skipChildren,s=e.schema.nodes.image,l=t,u=l.destination,c=l.firstChild;i&&a&&a(),e.addNode(s,n(n({imageUrl:u},c&&{altText:c.literal}),o))},thematicBreak:function(e,t,n,r){e.addNode(e.schema.nodes.thematicBreak,r)},strong:function(e,t,n,r){var o=n.entering,i=e.schema.marks.strong;o?e.openMark(i.create(r)):e.closeMark(i)},emph:function(e,t,n,r){var o=n.entering,i=e.schema.marks.emph;o?e.openMark(i.create(r)):e.closeMark(i)},link:function(e,t,r,o){var i=r.entering,a=e.schema.marks.link,s=t,l=s.destination,u=s.title;if(i){var c=n({linkUrl:l,title:u},o);e.openMark(a.create(c))}else e.closeMark(a)},softbreak:function(e,t){if("paragraph"===t.parent.type){var n=t.prev,r=t.next;n&&!Eu(n)&&e.closeNode(),r&&!Eu(r)&&e.openNode(e.schema.nodes.paragraph)}},table:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.table,r):e.closeNode()},tableHead:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.tableHead,r):e.closeNode()},tableBody:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.tableBody,r):e.closeNode()},tableRow:function(e,t,n,r){n.entering?e.openNode(e.schema.nodes.tableRow,r):e.closeNode()},tableCell:function(e,t,r){var o=r.entering;if(!t.ignored){var i=function(t){return t&&(bu(t)||yu(e,t))};if(o){var a=e.schema.nodes,s=a.tableHeadCell,l=a.tableBodyCell,u=a.paragraph,c=t.parent.parent,p="tableHead"===c.type?s:l,d=(c.parent.columns[t.startIdx]||{}).align,f=n({},t.attrs);d&&(f.align=d),e.openNode(p,f),i(t.firstChild)&&e.openNode(u)}else i(t.lastChild)&&e.closeNode(),e.closeNode()}},strike:function(e,t,n,r){var o=n.entering,i=e.schema.marks.strike;o?e.openMark(i.create(r)):e.closeMark(i)},code:function(e,t,n,r){var o=e.schema.marks.code;e.openMark(o.create(r)),e.addText(gu(t.literal||"")),e.closeMark(o)},customBlock:function(e,t){var n=e.schema.nodes,r=n.customBlock,o=n.paragraph,i=t,a=i.info,s=i.literal;e.openNode(r,{info:a}),e.addText(gu(s||"")),e.closeNode(),t.next||(e.openNode(o),e.closeNode())},frontMatter:function(e,t){e.openNode(e.schema.nodes.frontMatter),e.addText(t.literal),e.closeNode()},htmlInline:function(e,t){var n=t.literal,r=n.match(Je),o=r[1],i=r[3],a=(o||i).toLowerCase(),s=e.schema.marks[a],l=ja(n);if(null==s?void 0:s.spec.attrs.htmlInline)if(o){var u=Ua(l);e.openMark(s.create({htmlAttrs:u}))}else e.closeMark(s);else{var c=Tu[a];c&&c(e,t,o)}},htmlBlock:function(e,t){var n=t.literal,r=document.createElement("div");if(tt.test(n))e.openNode(e.schema.nodes.htmlComment),e.addText(t.literal),e.closeNode();else{var o=n.match(Je),i=o[1],a=o[3],s=(i||a).toLowerCase(),l=e.schema.nodes[s],u=ja(n);if(null==l?void 0:l.spec.attrs.htmlBlock){var c=Ua(u),p=_a(t,s);e.addNode(l,{htmlAttrs:c,childrenHTML:p})}else r.innerHTML=u,Mu(r),e.convertByDOMParser(r)}},customInline:function(e,t,n){var r=n.entering,o=n.skipChildren,i=t,a=i.info,s=i.firstChild,l=e.schema;if(-1!==a.indexOf("widget")&&r){var u=_e(t);o(),e.addNode(l.nodes.widget,{info:a},[l.text(Pe(a,u))])}else{var c="$$";r&&(c+=s?a+" ":a),e.addText(c)}}};var Nu=function(){function e(e,t){this.schema=e,this.convertors=t,this.stack=[{type:this.schema.topNodeType,attrs:null,content:[]}],this.marks=i.Mark.none}return e.prototype.top=function(){return X(this.stack)},e.prototype.push=function(e){this.stack.length&&this.top().content.push(e)},e.prototype.addText=function(e){if(e){var t=this.top().content,n=X(t),r=this.schema.text(e,this.marks),o=n&&(s=r,!!((a=n).isText&&s.isText&&i.Mark.sameSet(a.marks,s.marks))&&a.withText(a.text+s.text));o?t[t.length-1]=o:t.push(r)}var a,s},e.prototype.openMark=function(e){this.marks=e.addToSet(this.marks)},e.prototype.closeMark=function(e){this.marks=e.removeFromSet(this.marks)},e.prototype.addNode=function(e,t,n){var r=e.createAndFill(t,n,this.marks);return r?(this.push(r),r):null},e.prototype.openNode=function(e,t){this.stack.push({type:e,attrs:t,content:[]})},e.prototype.closeNode=function(){this.marks.length&&(this.marks=i.Mark.none);var e=this.stack.pop(),t=e.type,n=e.attrs,r=e.content;return this.addNode(t,n,r)},e.prototype.convertByDOMParser=function(e){var t=this;i.DOMParser.fromSchema(this.schema).parse(e).content.forEach((function(e){return t.push(e)}))},e.prototype.closeUnmatchedHTMLInline=function(e,t){var n;if(!t&&"htmlInline"!==e.type)for(var r=this.stack.length-1;r>=0;r-=1){var o=this.stack[r];if(!(null===(n=o.attrs)||void 0===n?void 0:n.rawHTML))break;o.content.length?this.closeNode():this.stack.pop()}},e.prototype.convert=function(e,t){for(var n=e.walker(),r=n.next(),o=function(){var e=r.node,o=r.entering,a=i.convertors[e.type],s=!1;if(a){var l={entering:o,leaf:!Se(e),getChildrenText:Ae,options:{gfm:!0,nodeId:!1,tagFilter:!1,softbreak:"\n"},skipChildren:function(){s=!0}};if(i.closeUnmatchedHTMLInline(e,o),a(i,e,l),(null==t?void 0:t.node)===e){var u=i.stack.reduce((function(e,t){return e+t.content.reduce((function(e,t){return e+t.nodeSize}),0)}),0)+1;t.setMappedPos(u)}}s&&(n.resumeAt(e,!1),n.next()),r=n.next()},i=this;r;)o()},e.prototype.convertNode=function(e,t){return this.convert(e,t),this.stack.length?this.closeNode():null},e}(),Su=Nu;var Au={text:function(e,t){var n,r=t.node,o=null!==(n=r.text)&&void 0!==n?n:"";(r.marks||[]).some((function(e){return"link"===e.type.name}))?e.text(V(o),!1):e.text(o)},paragraph:function(e,t){var n=t.node,r=t.parent,o=t.index,i=void 0===o?0:o;if(e.stopNewline)e.convertInline(n);else{var a=0===i,s=!a&&r.child(i-1),l=s&&0===s.childCount,u=i<r.childCount-1&&r.child(i+1),c=u&&"paragraph"===u.type.name,p=0===n.childCount;if(p&&l)e.write("<br>\n");else if(!p||l||a)e.convertInline(n),c?e.write("\n"):e.closeBlock(n);else{if("listItem"===(null==r?void 0:r.type.name)){var d=e.getDelim();e.setDelim(""),e.write("<br>"),e.setDelim(d)}e.write("\n")}}},heading:function(e,t,n){var r=t.node,o=n.delim;"atx"===r.attrs.headingType?(e.write(o+" "),e.convertInline(r),e.closeBlock(r)):(e.convertInline(r),e.ensureNewLine(),e.write(o),e.closeBlock(r))},codeBlock:function(e,t,n){var r=t.node,o=n.delim,i=n.text,a=o,s=a[0],l=a[1];e.write(s),e.ensureNewLine(),e.text(i,!1),e.ensureNewLine(),e.write(l),e.closeBlock(r)},blockQuote:function(e,t,n){var r=t.node,o=t.parent,i=n.delim;(null==o?void 0:o.type.name)===r.type.name&&e.flushClose(1),e.wrapBlock(i,null,r,(function(){return e.convertNode(r)}))},bulletList:function(e,t,n){var r=t.node,o=n.delim;e.convertList(r,z(" ",4),(function(){return o+" "}))},orderedList:function(e,t){var n=t.node,r=n.attrs.order||1;e.convertList(n,z(" ",4),(function(e){return String(r+e)+". "}))},listItem:function(e,t){var n=t.node,r=n.attrs,o=r.task,i=r.checked;o&&e.write("["+(i?"x":" ")+"] "),e.convertNode(n)},image:function(e,t,n){var r=n.attrs;e.write("+")")},thematicBreak:function(e,t,n){var r=t.node,o=n.delim;e.write(o),e.closeBlock(r)},table:function(e,t){var n=t.node;e.convertNode(n),e.closeBlock(n)},tableHead:function(e,t,n){var r=t.node,o=n.delim,i=r.firstChild;e.convertNode(r);var a=null!=o?o:"";!o&&i&&i.forEach((function(e){var t=function(e,t){var n=e.length,r="",o="";return"left"===t?(r=":",n-=1):"right"===t?(o=":",n-=1):"center"===t&&(r=":",o=":",n-=2),""+r+z("-",Math.max(n,3))+o}(e.textContent,e.attrs.align);a+="| "+t+" "})),e.write(a+"|"),e.ensureNewLine()},tableBody:function(e,t){var n=t.node;e.convertNode(n)},tableRow:function(e,t){var n=t.node;e.convertNode(n),e.write("|"),e.ensureNewLine()},tableHeadCell:function(e,t,n){var r=t.node,o=n.delim,i=void 0===o?"| ":o;e.write(i),e.convertTableCell(r),e.write(" ")},tableBodyCell:function(e,t,n){var r=t.node,o=n.delim,i=void 0===o?"| ":o;e.write(i),e.convertTableCell(r),e.write(" ")},customBlock:function(e,t,n){var r=t.node,o=n.delim,i=n.text,a=o,s=a[0],l=a[1];e.write(s),e.ensureNewLine(),e.text(i,!1),e.ensureNewLine(),e.write(l),e.closeBlock(r)},frontMatter:function(e,t,n){var r=t.node,o=n.text;e.text(o,!1),e.closeBlock(r)},widget:function(e,t,n){var r=n.text;e.write(r)},html:function(e,t,n){var r=t.node,o=n.text;e.write(o),r.attrs.htmlBlock&&e.closeBlock(r)},htmlComment:function(e,t,n){var r=t.node,o=n.text;e.write(o),e.closeBlock(r)}};function Du(e,t){var n=e.text,r=/`+/g,o=0;if(e.isText&&n)for(var i=r.exec(n);i;)o=Math.max(o,i[0].length),i=r.exec(n);for(var a=o>0&&t>0?" `":"`",s=0;s<o;s+=1)a+="`";return o>0&&t<0&&(a+=" "),a}function Ou(e){return e?["<"+e+">","</"+e+">"]:null}function Iu(e){return e?"<"+e+">":null}function Ru(e){return e?"</"+e+">":null}var Pu={heading:function(e){var t=e.node.attrs,n=t.level,r=z("#",n);return"setext"===t.headingType&&(r=1===n?"===":"---"),{delim:r,rawHTML:Ou(t.rawHTML)}},codeBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["```"+(n.language||""),"```"],rawHTML:Ou(n.rawHTML),text:r}},blockQuote:function(e){return{delim:"> ",rawHTML:Ou(e.node.attrs.rawHTML)}},bulletList:function(e,t){var n=e.node,r=t.inTable,o=n.attrs.rawHTML;return r&&(o=o||"ul"),{delim:"*",rawHTML:Ou(o)}},orderedList:function(e,t){var n=e.node,r=t.inTable,o=n.attrs.rawHTML;return r&&(o=o||"ol"),{rawHTML:Ou(o)}},listItem:function(e,t){var n=e.node,r=t.inTable,o=n.attrs,i=o.task,a=o.checked,s=n.attrs.rawHTML;return r&&(s=s||"li"),{rawHTML:s?["<"+s+(i?' class="task-list-item'+(a?" checked":"")+'"':"")+(i?" data-task"+(a?" data-task-checked":""):"")+">","</"+s+">"]:null}},table:function(e){return{rawHTML:Ou(e.node.attrs.rawHTML)}},tableHead:function(e){return{rawHTML:Ou(e.node.attrs.rawHTML)}},tableBody:function(e){return{rawHTML:Ou(e.node.attrs.rawHTML)}},tableRow:function(e){return{rawHTML:Ou(e.node.attrs.rawHTML)}},tableHeadCell:function(e){return{rawHTML:Ou(e.node.attrs.rawHTML)}},tableBodyCell:function(e){return{rawHTML:Ou(e.node.attrs.rawHTML)}},image:function(e){var t=e.node.attrs,n=t.rawHTML,r=t.altText,o=t.imageUrl.replace(/&/g,"&"),i=r?' alt="'+F(r)+'"':"";return{rawHTML:n?"<"+n+' src="'+F(o)+'"'+i+">":null,attrs:{altText:V(r||""),imageUrl:o}}},thematicBreak:function(e){return{delim:"***",rawHTML:Iu(e.node.attrs.rawHTML)}},customBlock:function(e){var t=e.node,n=t.attrs,r=t.textContent;return{delim:["$$"+n.info,"$$"],text:r}},frontMatter:function(e){return{text:e.node.textContent}},widget:function(e){return{text:e.node.textContent}},strong:function(e,t){var n=e.node,r=t.entering,o=n.attrs.rawHTML;return{delim:"**",rawHTML:r?Iu(o):Ru(o)}},emph:function(e,t){var n=e.node,r=t.entering,o=n.attrs.rawHTML;return{delim:"*",rawHTML:r?Iu(o):Ru(o)}},strike:function(e,t){var n=e.node,r=t.entering,o=n.attrs.rawHTML;return{delim:"~~",rawHTML:r?Iu(o):Ru(o)}},link:function(e,t){var n,r,o=e.node,i=t.entering,a=o.attrs,s=a.title,l=a.rawHTML,u=a.linkUrl.replace(/&/g,"&"),c=s?' title="'+F(s)+'"':"";return i?{delim:"[",rawHTML:l?"<"+l+' href="'+F(u)+'"'+c+">":null}:{delim:"]("+u+(s?" "+(n=V(s),(r=-1===n.indexOf('"')?'""':-1===n.indexOf("'")?"''":"()")[0]+n+r[1]):"")+")",rawHTML:Ru(l)}},code:function(e,t){var n=e.node,r=e.parent,o=e.index,i=void 0===o?0:o,a=t.entering;return{delim:a?Du(r.child(i),-1):Du(r.child(i-1),1),rawHTML:a?Iu(n.attrs.rawHTML):Ru(n.attrs.rawHTML)}},htmlComment:function(e){return{text:e.node.textContent}},html:function(e,t){var n=e.node,r=t.entering,o=n.type.name,i=n.attrs.htmlAttrs,a="<"+o,s="</"+o+">";return Object.keys(i).forEach((function(e){a+=" "+e+'="'+i[e].replace(/"/g,"'")+'"'})),a+=">",n.attrs.htmlInline?{rawHTML:r?a:s}:{text:""+a+n.attrs.childrenHTML+s}}},Hu={strong:{mixable:!0,removedEnclosingWhitespace:!0},emph:{mixable:!0,removedEnclosingWhitespace:!0},strike:{mixable:!0,removedEnclosingWhitespace:!0},code:{escape:!1},link:null,html:null};function Bu(e){var t={};return Object.keys(Au).forEach((function(n){t[n]=function(t,r){if(Au[n]){var o=e[n],i=o?o(r,{inTable:t.inTable}):{};!function(e,t){var n=t.state,r=t.nodeInfo,o=t.params,i=o.rawHTML;i?zs()(e,["heading","codeBlock"])>-1?function(e,t,n){var r=n[0],o=n[1];e.write(r),e.convertInline(t),e.write(o)}(n,r.node,i):zs()(e,["image","thematicBreak"])>-1?n.write(i):function(e,t,n){var r=t.node,o=t.parent,i=n[0],a=n[1];e.stopNewline=!0,e.write(i),e.convertNode(r),e.write(a),"doc"===(null==o?void 0:o.type.name)&&(e.closeBlock(r),e.stopNewline=!1)}(n,r,i):Au[e](n,r,o)}(n,{state:t,nodeInfo:r,params:i})}}})),t}function Fu(e){Object.keys(e).forEach((function(t){var n=Pu[t],r=e[t];Pu[t]=n?function(e,t){return t.origin=function(){return n(e,t)},r(e,t)}:r,delete e[t]}));var t=Bu(Pu),r=function(e){var t={};return Object.keys(Hu).forEach((function(r){t[r]=function(t,o){var i=Hu[r],a=e[r],s=a&&t&&!C()(o)?a(t,{entering:o}):{};return n(n({},s),i)}})),t}(Pu);return{nodeTypeConvertors:t,markTypeConvertors:r}}var qu=function(){function e(e){var t=e.nodeTypeConvertors,n=e.markTypeConvertors;this.nodeTypeConvertors=t,this.markTypeConvertors=n,this.delim="",this.result="",this.closed=!1,this.tightList=!1,this.stopNewline=!1,this.inTable=!1}return e.prototype.getMarkConvertor=function(e){var t=e.attrs.htmlInline?"html":e.type.name;return this.markTypeConvertors[t]},e.prototype.isInBlank=function(){return/(^|\n)$/.test(this.result)},e.prototype.markText=function(e,t,n,r){var o=this.getMarkConvertor(e);if(o){var i=o({node:e,parent:n,index:r},t),a=i.delim;return i.rawHTML||a}return""},e.prototype.setDelim=function(e){this.delim=e},e.prototype.getDelim=function(){return this.delim},e.prototype.flushClose=function(e){if(!this.stopNewline&&this.closed){if(this.isInBlank()||(this.result+="\n"),e||(e=2),e>1){var t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(var r=1;r<e;r+=1)this.result+=t+"\n"}this.closed=!1}},e.prototype.wrapBlock=function(e,t,n,r){var o=this.getDelim();this.write(t||e),this.setDelim(this.getDelim()+e),r(),this.setDelim(o),this.closeBlock(n)},e.prototype.ensureNewLine=function(){this.isInBlank()||(this.result+="\n")},e.prototype.write=function(e){void 0===e&&(e=""),this.flushClose(),this.delim&&this.isInBlank()&&(this.result+=this.delim),e&&(this.result+=e)},e.prototype.closeBlock=function(e){this.closed=e},e.prototype.text=function(e,t){void 0===t&&(t=!0);for(var n=e.split("\n"),r=0;r<n.length;r+=1)this.write(),this.result+=t?W(n[r]):n[r],r!==n.length-1&&(this.result+="\n")},e.prototype.convertBlock=function(e,t,n){var r=e.type.name,o=this.nodeTypeConvertors[r],i={node:e,parent:t,index:n};e.attrs.htmlBlock?this.nodeTypeConvertors.html(this,i):o&&o(this,i)},e.prototype.convertInline=function(e){var t=this,n=[],r="",o=function(o,i,a){var s=o?o.marks:[],l=r;r="";var u=o&&o.isText&&s.some((function(e){var n=t.getMarkConvertor(e),r=n&&n();return r&&r.removedEnclosingWhitespace}));if(u&&o&&o.text){var c=/^(\s*)(.*?)(\s*)$/m.exec(o.text),p=c[1],d=c[2],f=c[3];l+=p,r=f,(p||f)&&((o=d?o.withText(d):null)||(s=n))}for(var h=s.length&&X(s),m=h&&t.getMarkConvertor(h),v=m&&m(),g=v&&!1===v.escape,y=s.length-(g?1:0),b=0;b<y;b+=1){d=s[b];if(v&&!v.mixable)break;for(var w=0;w<n.length;w+=1){var k=n[w];if(v&&!v.mixable)break;if(d.eq(k)){b>w?s=s.slice(0,w).concat(d).concat(s.slice(w,b)).concat(s.slice(b+1,y)):w>b&&(s=s.slice(0,b).concat(s.slice(b+1,w)).concat(d).concat(s.slice(w,y)));break}}}for(var x=0;x<Math.min(n.length,y)&&s[x].eq(n[x]);)x+=1;for(;x<n.length;){var C=n.pop();C&&t.text(t.markText(C,!1,e,a),!1)}if(l&&t.text(l),o){for(;n.length<y;){d=s[n.length];n.push(d),t.text(t.markText(d,!0,e,a),!1)}g&&o.isText?t.text(t.markText(h,!0,e,a)+o.text+t.markText(h,!1,e,a+1),!1):t.convertBlock(o,e,a)}};e.forEach(o),o(null,0,e.childCount)},e.prototype.convertList=function(e,t,n){var r,o=this;this.closed&&this.closed.type===e.type?this.flushClose(3):this.tightList&&this.flushClose(1);var i=null===(r=e.attrs.tight)||void 0===r||r,a=this.tightList;this.tightList=i,e.forEach((function(r,a,s){s&&i&&o.flushClose(1),o.wrapBlock(t,n(s),e,(function(){return o.convertBlock(r,e,s)}))})),this.tightList=a},e.prototype.convertTableCell=function(e){var t=this;this.stopNewline=!0,this.inTable=!0,e.forEach((function(n,r,o){q(["bulletList","orderedList"],n.type.name)?(t.convertBlock(n,e,o),t.closed=!1):(t.convertInline(n),o<e.childCount-1&&"paragraph"===e.child(o+1).type.name&&t.write("<br>"))})),this.stopNewline=!1,this.inTable=!1},e.prototype.convertNode=function(e,t){var n=this;return e.forEach((function(r,o,i){if(n.convertBlock(r,e,i),(null==t?void 0:t.node)===r){var a=n.result.split("\n");t.setMappedPos([a.length,X(a).length+1])}})),this.result},e}(),ju=qu,_u=function(){function e(e,t,r,o){var i=this;this.setMappedPos=function(e){i.mappedPosWhenConverting=e},this.schema=e,this.eventEmitter=o,this.focusedNode=null,this.mappedPosWhenConverting=null,this.toWwConvertors=function(e){var t=Object.keys(e),r=n({},Lu),o=new Ra({gfm:!0,nodeId:!0,convertors:e}).getConvertors();return t.forEach((function(t){var n=Lu[t];n&&!q(["htmlBlock","htmlInline"],t)&&(r[t]=function(r,i,a){a.origin=function(){return o[t](i,a,o)};var s,l=e[t](i,a);if(l){var u=Array.isArray(l)?l[0]:l;s={htmlAttrs:u.attributes,classNames:u.classNames}}n(r,i,a,s)})})),r}(r),this.toMdConvertors=Fu(t||{}),this.eventEmitter.listen("setFocusedNode",(function(e){return i.focusedNode=e}))}return e.prototype.getMappedPos=function(){return this.mappedPosWhenConverting},e.prototype.getInfoForPosSync=function(){return{node:this.focusedNode,setMappedPos:this.setMappedPos}},e.prototype.toWysiwygModel=function(e){return new Su(this.schema,this.toWwConvertors).convertNode(e,this.getInfoForPosSync())},e.prototype.toMarkdownText=function(e){var t=new ju(this.toMdConvertors).convertNode(e,this.getInfoForPosSync());return t=this.eventEmitter.emitReduce("beforeConvertWysiwygToMarkdown",t)},e}(),Uu=_u;function zu(e){var t=e.plugins,r=e.eventEmitter,o=e.usageStatistics,a=e.instance;return r.listen("mixinTableOffsetMapPrototype",Ls),(null!=t?t:[]).reduce((function(e,t){var s=function(e){var t=e.plugin,n={eventEmitter:e.eventEmitter,usageStatistics:e.usageStatistics,instance:e.instance,pmState:{Plugin:ie.Plugin,PluginKey:ie.PluginKey,Selection:ie.Selection,TextSelection:ie.TextSelection},pmView:{Decoration:te.Decoration,DecorationSet:te.DecorationSet},pmModel:{Fragment:i.Fragment},pmRules:{InputRule:le.InputRule,inputRules:le.inputRules,undoInputRule:le.undoInputRule},pmKeymap:{keymap:ae.keymap},i18n:Xs};if(Ve()(t)){var r=t[0],o=t[1];return r(n,void 0===o?{}:o)}return t(n)}({plugin:t,eventEmitter:r,usageStatistics:o,instance:a});if(!s)throw new Error("The return value of the executed plugin is empty.");var l=s.markdownParsers,u=s.toHTMLRenderers,c=s.toMarkdownRenderers,p=s.markdownPlugins,d=s.wysiwygPlugins,f=s.wysiwygNodeViews,h=s.markdownCommands,m=s.wysiwygCommands,v=s.toolbarItems;return u&&(e.toHTMLRenderers=K(e.toHTMLRenderers,u)),c&&(e.toMarkdownRenderers=K(e.toMarkdownRenderers,c)),p&&(e.mdPlugins=e.mdPlugins.concat(p)),d&&(e.wwPlugins=e.wwPlugins.concat(d)),f&&(e.wwNodeViews=n(n({},e.wwNodeViews),f)),h&&(e.mdCommands=n(n({},e.mdCommands),h)),m&&(e.wwCommands=n(n({},e.wwCommands),m)),v&&(e.toolbarItems=e.toolbarItems.concat(v)),l&&(e.markdownParsers=n(n({},e.markdownParsers),l)),e}),{toHTMLRenderers:{},toMarkdownRenderers:{},mdPlugins:[],wwPlugins:[],wwNodeViews:{},mdCommands:{},wwCommands:{},toolbarItems:[],markdownParsers:{}})}var Vu=function(){function e(e){var t=this;this.options=u()({linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,usageStatistics:!0,theme:"light"},e),this.eventEmitter=new hu;var r,o=U(this.options.linkAttributes),i=zu({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this})||{},a=i.toHTMLRenderers,l=i.markdownParsers,c=this.options,p=c.customHTMLRenderer,d=c.extendedAutolinks,f=c.referenceDefinition,h=c.frontMatter,m=c.customHTMLSanitizer,v={linkAttributes:o,customHTMLRenderer:n(n({},a),p),extendedAutolinks:d,referenceDefinition:f,frontMatter:h,sanitizer:m||ja};r=v.customHTMLRenderer,["htmlBlock","htmlInline"].forEach((function(e){r[e]&&Object.keys(r[e]).forEach((function(e){return qa(e)}))})),this.options.events&&s()(this.options.events,(function(e,n){t.on(n,e)}));var g=this.options,y=g.el,b=g.initialValue,w=g.theme,k=y.innerHTML;"light"!==w&&y.classList.add(it(w)),y.innerHTML="",this.toastMark=new La("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:d,referenceDefinition:f,disallowDeepHeading:!0,frontMatter:h,customParser:l}),this.preview=new ls(this.eventEmitter,n(n({},v),{isViewer:!0})),Cr()(this.preview.previewContent,"mousedown",this.toggleTask.bind(this)),b?this.setMarkdown(b):k&&this.preview.setHTML(k),y.appendChild(this.preview.previewContent),this.eventEmitter.emit("load",this)}return e.prototype.toggleTask=function(e){var t=e.target,n=getComputedStyle(t,":before");!t.hasAttribute("data-task-disabled")&&t.hasAttribute("data-task")&&rt(n,e.offsetX,e.offsetY)&&(ut(t,"checked"),this.eventEmitter.emit("change",{source:"viewer",date:e}))},e.prototype.setMarkdown=function(e){var t=this.toastMark.getLineTexts(),n=[t.length,X(t).length+1],r=this.toastMark.editMarkdown([1,1],n,e||"");this.eventEmitter.emit("updatePreview",r)},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.destroy=function(){kr()(this.preview.el,"mousedown",this.toggleTask.bind(this)),this.preview.destroy(),this.eventEmitter.emit("destroy")},e.prototype.isViewer=function(){return!0},e.prototype.isMarkdownMode=function(){return!1},e.prototype.isWysiwygMode=function(){return!1},e}(),Wu=Vu;function $u(e){return e instanceof i.Node}function Gu(e){return q(["document","blockQuote","bulletList","orderedList","listItem","paragraph","heading","emph","strong","strike","link","image","table","tableHead","tableBody","tableRow","tableHeadCell","tableBodyCell"],e)}var Xu={openTag:function(e,t){var r=e,o=r.tagName,i=r.classNames,a=r.attributes,s=document.createElement(o),l={};i&&(s.className=i.join(" ")),a&&(l=n(n({},l),a)),ht(l,s),t.push(s)},closeTag:function(e,t){if(t.length>1){var n=t.pop();X(t).appendChild(n)}},html:function(e,t){X(t).insertAdjacentHTML("beforeend",e.content)},text:function(e,t){var n=document.createTextNode(e.content);X(t).appendChild(n)}},Zu=function(){function e(e,t){var r=Xa(e,t),o=n(n({},t.htmlBlock),t.htmlInline);this.customConvertorKeys=Object.keys(t).concat(Object.keys(o)),this.renderer=new Ra({gfm:!0,convertors:n(n({},r),o)}),this.convertors=this.renderer.getConvertors()}return e.prototype.generateTokens=function(e){var t=function(e){var t=e.attrs,r=e.type.name,o={type:r,wysiwygNode:!0,literal:!Gu(r)&&$u(e)?e.textContent:null},i={heading:{level:t.level},link:{destination:t.linkUrl,title:t.title},image:{destination:t.imageUrl},codeBlock:{info:t.language},bulletList:{type:"list",listData:{type:"bullet"}},orderedList:{type:"list",listData:{type:"ordered",start:t.order}},listItem:{type:"item",listData:{task:t.task,checked:t.checked}},tableHeadCell:{type:"tableCell",cellType:"head",align:t.align},tableBodyCell:{type:"tableCell",cellType:"body",align:t.align},customBlock:{info:t.info}}[r],a=n(n({},o),i),s=e.attrs,l=s.htmlAttrs,u=s.childrenHTML;return l?n(n({},a),{attrs:l,childrenHTML:u}):a}(e),r={entering:!0,leaf:!!$u(e)&&e.isLeaf,options:this.renderer.getOptions(),getChildrenText:function(){return $u(e)?e.textContent:""},skipChildren:function(){return!1}},o=this.convertors[e.type.name],i=o(t,r,this.convertors),a=Ve()(i)?i:[i];return(Gu(e.type.name)||e.attrs.htmlInline)&&(r.entering=!1,a.push({type:"text",content:$u(e)?e.textContent:""}),a=a.concat(o(t,r,this.convertors))),a},e.prototype.toDOMNode=function(e){var t=this.generateTokens(e),n=[];return t.forEach((function(e){return Xu[e.type](e,n)})),n[0]},e.prototype.getToDOMNode=function(e){return q(this.customConvertorKeys,e)?this.toDOMNode.bind(this):null},e}(),Ku=null,Qu=null;function Yu(e,t){var n=t.syncScrollTop,r=t.releaseEventBlock;Qu&&clearTimeout(Qu),n(e),Qu=setTimeout((function(){r()}),15)}var Ju=function(){function e(e,t,n){this.latestEditorScrollTop=null,this.latestPreviewScrollTop=null,this.blockedScroll=null,this.active=!0,this.timer=null;var r=t.previewContent,o=t.el;this.previewRoot=r,this.previewEl=o,this.mdEditor=e,this.editorView=e.view,this.toastMark=e.getToastMark(),this.eventEmitter=n,this.addScrollSyncEvent()}return e.prototype.addScrollSyncEvent=function(){var e=this;this.eventEmitter.listen("afterPreviewRender",(function(){e.clearTimer(),e.timer=setTimeout((function(){e.syncPreviewScrollTop(!0)}),200)})),this.eventEmitter.listen("scroll",(function(t,n){e.active&&("editor"===t&&"editor"!==e.blockedScroll?e.syncPreviewScrollTop():"preview"===t&&"preview"!==e.blockedScroll&&e.syncEditorScrollTop(n))})),this.eventEmitter.listen("toggleScrollSync",(function(t){e.active=t}))},e.prototype.getMdNodeAtPos=function(e,t){var n=e.content.findIndex(t.pos).index;return this.toastMark.findFirstNodeAtLine(n+1)},e.prototype.getScrollTopByCaretPos=function(){var e=this.mdEditor.getSelection(),t=this.toastMark.findFirstNodeAtLine(e[0][0]),n=this.previewEl.clientHeight,r=ns(this.previewRoot,t).el,o=(es(r,this.previewRoot)||r.offsetTop)+r.clientHeight-.5*n;return this.latestEditorScrollTop=null,r.getBoundingClientRect().top-this.previewEl.getBoundingClientRect().top<n?null:o},e.prototype.syncPreviewScrollTop=function(e){void 0===e&&(e=!1);var t=this,n=t.editorView,r=t.previewEl,o=t.previewRoot,i=n.dom.getBoundingClientRect(),a=i.left,s=i.top,l=n.posAtCoords({left:a,top:s}),u=n.state.doc,c=this.getMdNodeAtPos(u,l);if(c&&!function(e){var t=e.type;return"htmlBlock"===t||"htmlInline"===t}(c)){var p=r.scrollTop,d=n.dom,f=d.scrollTop,h=d.scrollHeight,m=d.clientHeight,v=d.children,g=h-f<=m+18,y=g?r.scrollHeight:0;if(f&&!g){if(e){var b=this.getScrollTopByCaretPos();if(!b)return;y=b}else{var w=ns(this.previewRoot,c),k=w.el,x=Ya(u,w.mdNode,v),C=x.height,T=x.rect;y=(es(k,o)||k.offsetTop)+k.clientHeight*(s>T.top?Math.min((s-T.top)/C,1):0)}y=this.getResolvedScrollTop("editor",f,y,p),this.latestEditorScrollTop=f}y!==p&&this.run("editor",y,p)}},e.prototype.syncEditorScrollTop=function(e){var t=this,n=t.toastMark,r=t.editorView,o=t.previewRoot,i=t.previewEl,a=r.dom,s=r.state,l=i.scrollTop,u=i.clientHeight,c=i.scrollHeight-l<=u,p=a.scrollTop,d=c?a.scrollHeight:0;if(l&&e&&!c){if(e=function(e,t){for(;!e.getAttribute("data-nodeid")&&e.parentElement!==t;)e=e.parentElement;return e}(e,o),!e.getAttribute("data-nodeid"))return;var f=a.children,h=Number(e.getAttribute("data-nodeid")),m=ns(this.previewRoot,n.findNodeById(h)),v=m.mdNode,g=m.el;d=f[ve(v)-1].offsetTop;var y=Ya(s.doc,v,f).height,b=is(g,o,h),w=b.nodeHeight;d+=function(e,t,n,r){return Math.min((e-t)/n,1)*r}(l,b.offsetTop,w,y),d=this.getResolvedScrollTop("preview",l,d,p),this.latestPreviewScrollTop=l}d!==p&&this.run("preview",d,p)},e.prototype.getResolvedScrollTop=function(e,t,n,r){var o="editor"===e?this.latestEditorScrollTop:this.latestPreviewScrollTop;return null===o?n:o<t?Math.max(n,r):Math.min(n,r)},e.prototype.run=function(e,t,n){var r,o=this;"editor"===e?(r=this.previewEl,this.blockedScroll="preview"):(r=this.editorView.dom,this.blockedScroll="editor"),function(e,t,n){var r=t-e,o=Date.now(),i=function(){var a,s=(Date.now()-o)/100;Ku&&clearTimeout(Ku),s<1?(a=e+r*Math.cos((1-s)*Math.PI/2),Yu(Math.ceil(a),n),Ku=setTimeout(i,1)):(Yu(t,n),Ku=null)};i()}(n,t,{syncScrollTop:function(e){return r.scrollTop=e},releaseEventBlock:function(){return o.blockedScroll=null}})},e.prototype.clearTimer=function(){this.timer&&(clearTimeout(this.timer),this.timer=null)},e.prototype.destroy=function(){this.clearTimer(),this.eventEmitter.removeEventHandler("scroll"),this.eventEmitter.removeEventHandler("afterPreviewRender")},e}(),ec={getPopupInitialValues:function(e,t){return"link"===t.popupName?{linkText:e.getSelectedText()}:{}}};var tc=function(){function e(e){var t=this;this.initialHTML=e.el.innerHTML,e.el.innerHTML="",this.options=u()({previewStyle:"tab",previewHighlight:!0,initialEditType:"markdown",height:"300px",minHeight:"200px",language:"en-US",useCommandShortcut:!0,usageStatistics:!0,toolbarItems:[["heading","bold","italic","strike"],["hr","quote"],["ul","ol","task","indent","outdent"],["table","image","link"],["code","codeblock"],["scrollSync"]],hideModeSwitch:!1,linkAttributes:null,extendedAutolinks:!1,customHTMLRenderer:null,customMarkdownRenderer:null,referenceDefinition:!1,customHTMLSanitizer:null,frontMatter:!1,widgetRules:[],theme:"light",autofocus:!0},e);var r=this.options,o=r.customHTMLRenderer,i=r.extendedAutolinks,a=r.referenceDefinition,l=r.frontMatter,c=r.customMarkdownRenderer,p=r.useCommandShortcut,d=r.initialEditType,f=r.widgetRules,h=r.customHTMLSanitizer;this.mode=d||"markdown",this.mdPreviewStyle=this.options.previewStyle,this.i18n=Xs,this.i18n.setCode(this.options.language),this.eventEmitter=new hu,Fe(f);var m=U(this.options.linkAttributes);this.pluginInfo=zu({plugins:this.options.plugins,eventEmitter:this.eventEmitter,usageStatistics:this.options.usageStatistics,instance:this});var v=this.pluginInfo,g=v.toHTMLRenderers,y=v.toMarkdownRenderers,b=v.mdPlugins,w=v.wwPlugins,k=v.wwNodeViews,x=v.mdCommands,C=v.wwCommands,T=v.markdownParsers,E={linkAttributes:m,customHTMLRenderer:K(g,o),extendedAutolinks:i,referenceDefinition:a,frontMatter:l,sanitizer:h||ja},M=new Zu(m,E.customHTMLRenderer),N=function(e,t,n){var r={nodes:{},marks:{}};return["htmlBlock","htmlInline"].forEach((function(o){e[o]&&Object.keys(e[o]).forEach((function(e){var i="htmlBlock"===o?"nodes":"marks";qa(e),r[i][e]=Wa[o](e,t,n)}))})),r}(E.customHTMLRenderer,E.sanitizer,M);this.toastMark=new La("",{disallowedHtmlBlockTags:["br","img"],extendedAutolinks:i,referenceDefinition:a,disallowDeepHeading:!0,frontMatter:l,customParser:T}),this.mdEditor=new br(this.eventEmitter,{toastMark:this.toastMark,useCommandShortcut:p,mdPlugins:b}),this.preview=new ls(this.eventEmitter,n(n({},E),{isViewer:!1,highlight:this.options.previewHighlight})),this.wwEditor=new uu(this.eventEmitter,{toDOMAdaptor:M,useCommandShortcut:p,htmlSchemaMap:N,linkAttributes:m,wwPlugins:w,wwNodeViews:k}),this.convertor=new Uu(this.wwEditor.getSchema(),n(n({},y),c),Xa(m,E.customHTMLRenderer),this.eventEmitter),this.setMinHeight(this.options.minHeight),this.setHeight(this.options.height),this.setMarkdown(this.options.initialValue,!1),this.options.placeholder&&this.setPlaceholder(this.options.placeholder),this.options.initialValue||this.setHTML(this.initialHTML,!1),this.commandManager=new vu(this.eventEmitter,this.mdEditor.commands,this.wwEditor.commands,(function(){return t.mode})),this.options.usageStatistics&&L()("editor","UA-129966929-1"),this.scrollSync=new Ju(this.mdEditor,this.preview,this.eventEmitter),this.addInitEvent(),this.addInitCommand(x,C),function(e){e.eventEmitter.listen("query",(function(t,n){return ec[t](e,n)}))}(this),this.options.hooks&&s()(this.options.hooks,(function(e,n){return t.addHook(n,e)})),this.options.events&&s()(this.options.events,(function(e,n){return t.on(n,e)})),this.eventEmitter.emit("load",this),this.moveCursorToStart(this.options.autofocus)}return e.prototype.addInitEvent=function(){var e=this;this.on("needChangeMode",this.changeMode.bind(this)),this.on("loadUI",(function(){if("auto"!==e.height){var t=Math.min(parseInt(e.minHeight,10),parseInt(e.height,10)-75)+"px";e.setMinHeight(t)}})),function(e){e.listen("addImageBlobHook",(function(e,t){var n=new FileReader;n.onload=function(e){var n=e.target;return t(n.result)},n.readAsDataURL(e)}))}(this.eventEmitter)},e.prototype.addInitCommand=function(e,t){var n=this,r=function(e,t){Object.keys(t).forEach((function(r){n.addCommand(e,r,t[r])}))};this.addCommand("markdown","toggleScrollSync",(function(e){return n.eventEmitter.emit("toggleScrollSync",e.active),!0})),r("markdown",e),r("wysiwyg",t)},e.prototype.getCurrentModeEditor=function(){return this.isMarkdownMode()?this.mdEditor:this.wwEditor},e.factory=function(t){return t.viewer?new Wu(t):new e(t)},e.setLanguage=function(e,t){Xs.setLanguage(e,t)},e.prototype.changePreviewStyle=function(e){this.mdPreviewStyle!==e&&(this.mdPreviewStyle=e,this.eventEmitter.emit("changePreviewStyle",e))},e.prototype.exec=function(e,t){this.commandManager.exec(e,t)},e.prototype.addCommand=function(e,t,n){var r=this;this.commandManager.addCommand(e,t,(function(t){void 0===t&&(t={});var o=("markdown"===e?r.mdEditor:r.wwEditor).view;n(t,o.state,o.dispatch,o)}))},e.prototype.on=function(e,t){this.eventEmitter.listen(e,t)},e.prototype.off=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.addHook=function(e,t){this.eventEmitter.removeEventHandler(e),this.eventEmitter.listen(e,t)},e.prototype.removeHook=function(e){this.eventEmitter.removeEventHandler(e)},e.prototype.focus=function(){this.getCurrentModeEditor().focus()},e.prototype.blur=function(){this.getCurrentModeEditor().blur()},e.prototype.moveCursorToEnd=function(e){void 0===e&&(e=!0),this.getCurrentModeEditor().moveCursorToEnd(e)},e.prototype.moveCursorToStart=function(e){void 0===e&&(e=!0),this.getCurrentModeEditor().moveCursorToStart(e)},e.prototype.setMarkdown=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=!0),this.mdEditor.setMarkdown(e,t),this.isWysiwygMode()){var n=this.toastMark.getRootNode(),r=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(r,t)}},e.prototype.setHTML=function(e,t){void 0===e&&(e=""),void 0===t&&(t=!0);var n=document.createElement("div");n.innerHTML=function(e){var t=e.replace(/<p><br\s*\/*><\/p>/gi,"<p></p>"),n=new RegExp(Ye,"ig"),r=t.match(n);return null==r||r.forEach((function(e,n){if(et.test(e)){var o=nt;if(n){var i=r[n-1].match(Qe);if(i&&!/br/i.test(i[1])){var a=i[1];o="</"+a+"><"+a+">"}}t=t.replace(et,o)}})),t}(e);var r=i.DOMParser.fromSchema(this.wwEditor.schema).parse(n);this.isMarkdownMode()?this.mdEditor.setMarkdown(this.convertor.toMarkdownText(r),t):this.wwEditor.setModel(r,t)},e.prototype.getMarkdown=function(){return this.isMarkdownMode()?this.mdEditor.getMarkdown():this.convertor.toMarkdownText(this.wwEditor.getModel())},e.prototype.getHTML=function(){var e=this;this.eventEmitter.holdEventInvoke((function(){if(e.isMarkdownMode()){var t=e.toastMark.getRootNode(),n=e.convertor.toWysiwygModel(t);e.wwEditor.setModel(n)}}));var t=mt(this.wwEditor.view.dom.innerHTML);if(this.placeholder){var n=new RegExp('<span class="placeholder[^>]+>'+this.placeholder+"</span>","i");return t.replace(n,"")}return t},e.prototype.insertText=function(e){this.getCurrentModeEditor().replaceSelection(e)},e.prototype.setSelection=function(e,t){this.getCurrentModeEditor().setSelection(e,t)},e.prototype.replaceSelection=function(e,t,n){this.getCurrentModeEditor().replaceSelection(e,t,n)},e.prototype.deleteSelection=function(e,t){this.getCurrentModeEditor().deleteSelection(e,t)},e.prototype.getSelectedText=function(e,t){return this.getCurrentModeEditor().getSelectedText(e,t)},e.prototype.getRangeInfoOfNode=function(e){return this.getCurrentModeEditor().getRangeInfoOfNode(e)},e.prototype.addWidget=function(e,t,n){this.getCurrentModeEditor().addWidget(e,t,n)},e.prototype.replaceWithWidget=function(e,t,n){this.getCurrentModeEditor().replaceWithWidget(e,t,n)},e.prototype.setHeight=function(e){var t=this.options.el;b()(e)&&("auto"===e?m()(t,"auto-height"):g()(t,"auto-height"),this.setMinHeight(this.getMinHeight())),f()(t,{height:e}),this.height=e},e.prototype.getHeight=function(){return this.height},e.prototype.setMinHeight=function(e){if(e!==this.minHeight){var t=this.height||this.options.height;"auto"!==t&&this.options.el.querySelector("."+it("main"))&&(e=Math.min(parseInt(e,10),parseInt(t,10)-75)+"px");var n=parseInt(e,10);this.minHeight=e,this.wwEditor.setMinHeight(n),this.mdEditor.setMinHeight(n),this.preview.setMinHeight(n)}},e.prototype.getMinHeight=function(){return this.minHeight},e.prototype.isMarkdownMode=function(){return"markdown"===this.mode},e.prototype.isWysiwygMode=function(){return"wysiwyg"===this.mode},e.prototype.isViewer=function(){return!1},e.prototype.getCurrentPreviewStyle=function(){return this.mdPreviewStyle},e.prototype.changeMode=function(e,t){if(this.mode!==e){if(this.mode=e,this.isWysiwygMode()){var n=this.toastMark.getRootNode(),r=this.convertor.toWysiwygModel(n);this.wwEditor.setModel(r)}else{r=this.wwEditor.getModel();this.mdEditor.setMarkdown(this.convertor.toMarkdownText(r),!t)}if(this.eventEmitter.emit("removePopupWidget"),this.eventEmitter.emit("changeMode",e),!t){var o=this.convertor.getMappedPos();this.focus(),this.isWysiwygMode()&&k()(o)?this.wwEditor.setSelection(o):Array.isArray(o)&&this.mdEditor.setSelection(o)}}},e.prototype.destroy=function(){var e=this;this.wwEditor.destroy(),this.mdEditor.destroy(),this.preview.destroy(),this.scrollSync.destroy(),this.eventEmitter.emit("destroy"),this.eventEmitter.getEvents().forEach((function(t,n){return e.off(n)}))},e.prototype.hide=function(){this.eventEmitter.emit("hide")},e.prototype.show=function(){this.eventEmitter.emit("show")},e.prototype.setScrollTop=function(e){this.getCurrentModeEditor().setScrollTop(e)},e.prototype.getScrollTop=function(){return this.getCurrentModeEditor().getScrollTop()},e.prototype.reset=function(){this.wwEditor.setModel([]),this.mdEditor.setMarkdown("")},e.prototype.getSelection=function(){return this.getCurrentModeEditor().getSelection()},e.prototype.setPlaceholder=function(e){this.placeholder=e,this.mdEditor.setPlaceholder(e),this.wwEditor.setPlaceholder(e)},e.prototype.getEditorElements=function(){return{mdEditor:this.mdEditor.getElement(),mdPreview:this.preview.getElement(),wwEditor:this.wwEditor.getElement()}},e.prototype.convertPosToMatchEditorMode=function(e,t,n){var r,o;void 0===t&&(t=e),void 0===n&&(n=this.mode);var i=this.mdEditor.view.state.doc,a=Array.isArray(e),s=Array.isArray(t),l=e,u=t;if(a!==s)throw new Error("Types of arguments must be same");return"markdown"!==n||a||s?"wysiwyg"===n&&a&&s&&(l=(o=jt(i,e,t))[0],u=o[1]):(l=(r=Ft(i,e,t))[0],u=r[1]),[l,u]},e}(),nc=tc;var rc=c(326),oc=c.n(rc),ic=function(){function e(e){this.current=e,this.root=e,this.entering=!0}return e.prototype.walk=function(){var e=this.entering,t=this.current;return t?(e?t.firstChild?(this.current=t.firstChild,this.entering=!0):this.entering=!1:t===this.root?this.current=null:t.next?(this.current=t.next,this.entering=!0):(this.current=t.parent,this.entering=!1),{vnode:t,entering:e}):null},e}(),ac=function(){function e(e,t,n){this.parent=null,this.old=null,this.firstChild=null,this.next=null,this.skip=!1,this.type=e,this.props=t,this.children=n,this.props.children=n,t.ref&&(this.ref=t.ref,delete t.ref),t.key&&(this.key=t.key,delete t.key)}return e.prototype.walker=function(){return new ic(this)},e.removalNodes=[],e}();function sc(e,t){var n,r=e;oc()(e)||null==e?r=null:(b()(e)||k()(e))&&(n=String(e),r=new ac("TEXT_NODE",{nodeValue:n},[])),r&&t.push(r)}var lc=function(e){for(var t,n,r=arguments,o=1,i="",a="",s=[0],l=function(e){1===o&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(e?r[e]:i):3===o&&(e||i)?(s[1]=e?r[e]:i,o=2):2===o&&"..."===i&&e?s[2]=J(s[2]||{},r[e]):2===o&&i&&!e?(s[2]=s[2]||{})[i]=!0:o>=5&&(5===o?((s[2]=s[2]||{})[n]=e?i?i+r[e]:r[e]:i,o=6):(e||i)&&(s[2][n]+=e?i+r[e]:i)),i=""},u=0;u<e.length;u++){u&&(1===o&&l(),l(u));for(var c=0;c<e[u].length;c++)t=e[u][c],1===o?"<"===t?(l(),s=[s,"",null],o=3):i+=t:4===o?"--"===i&&">"===t?(o=1,i=""):i=t+i[0]:a?t===a?a="":i+=t:'"'===t||"'"===t?a=t:">"===t?(l(),o=1):o&&("="===t?(o=5,n=i,i=""):"/"===t&&(o<5||">"===e[u][c+1])?(l(),3===o&&(s=s[0]),o=s,(s=s[0]).push(this.apply(null,o.slice(1))),o=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(l(),o=2):i+=t),3===o&&"!--"===i&&(o=4,s=s[0])}return l(),s.length>2?s.slice(1):s[1]}.bind((function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=[];return n.forEach((function(e){Array.isArray(e)?e.forEach((function(e){sc(e,o)})):sc(e,o)})),new ac(e,t||{},o)})),uc=c(73),cc=c.n(uc);function pc(e){var t;return"TEXT_NODE"===e.type?t=document.createTextNode(e.props.nodeValue):mc(t=document.createElement(e.type),{},e.props),t}function dc(e,t){e.node?t.removeChild(e.node):dc(e.firstChild,t)}function fc(e,t,n){Object.keys(t).forEach((function(r){if(/^on/.test(r)){if(!n[r]||t[r]!==n[r]){var o=r.slice(2).toLowerCase();e.removeEventListener(o,t[r])}}else"children"===r||n[r]||function(e){return(null==e?void 0:e.nodeType)===Node.TEXT_NODE}(e)||e.removeAttribute(r)})),mc(e,t,n,(function(e){return!G(t[e],n[e])}))}var hc=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function mc(e,t,n,r){Object.keys(n).forEach((function(o){if(!r||r(o))if(/^on/.test(o)){var i=o.slice(2).toLowerCase();e.addEventListener(i,n[o])}else"nodeValue"===o?e[o]=n[o]:"style"===o&&cc()(n[o])?function(e,t,n){t&&Object.keys(t).forEach((function(t){e.style[t]=""}));Object.keys(n).forEach((function(t){var r=n[t];e.style[t]=k()(r)&&!hc.test(t)?r+"px":r}))}(e,t[o],n[o]):"children"!==o&&(!1===n[o]?e.removeAttribute(o):e.setAttribute(o,n[o]))}))}function vc(e){if(ac.removalNodes.forEach((function(e){return yc(e)})),e)for(var t=void 0,n=e.walker();t=n.walk();)if(e=t.vnode,t.entering)yc(e);else if(Dt()(e.type)){var r=e.component;if(!e.old&&r.mounted&&r.mounted(),e.old&&r.updated){var o=r.prevProps||{};r.updated(o)}}}function gc(e){for(var t=e.parent;!t.node;)t=t.parent;return t.node}function yc(e){if(e&&e.parent){if(e.node){var t=gc(e);"A"===e.effect?t.appendChild(e.node):"U"===e.effect&&fc(e.node,e.old.props,e.props)}if("D"===e.effect)for(var n=void 0,r=e.walker();n=r.walk();)if(e=n.vnode,!n.entering)if(Dt()(e.type)){var o=e.component;o.beforeDestroy&&o.beforeDestroy()}else{dc(e,t=gc(e))}e.ref&&(e.component?e.ref(e.component):e.node&&e.ref(e.node))}}function bc(e,t){var n=t.props,r=t.component;return r?(r.prevProps=r.props,r.props=t.props,r):new e(n)}function wc(e){for(var t=e;e&&!e.skip;){if(Dt()(e.type)){var n=bc(e.type,e);n.vnode=e,e.component=n,e.props.children=e.children=[n.render()],kc(e)}else e.node||(e.node=pc(e)),kc(e);if(e.firstChild)e=e.firstChild;else{for(;e&&e.parent&&!e.next&&(e=e.parent)!==t;);e=e.next}}}function kc(e){var t=e.children,n=e.old?e.old.firstChild:null,r=null;t.forEach((function(t,o){var i=function(e,t){return e&&t&&t.type===e.type&&(!t.key||t.key===e.key)}(n,t);i&&(t.old=n,t.parent=e,t.node=n.node,t.component=n.component,t.effect="U"),t&&!i&&(t.old=null,t.parent=e,t.node=null,t.effect="A"),n&&!i&&(ac.removalNodes.push(n),n.effect="D"),n&&(n=n.next),0===o?e.firstChild=t:t&&(r.next=t),r=t}));var o=X(t);if(!t.length)for(;n;)ac.removalNodes.push(n),n.effect="D",n=n.next;for(;n&&o;)n&&o.old!==n&&(ac.removalNodes.push(n),n.effect="D",n=n.next)}function xc(e,t){var n=new ac(e.tagName.toLowerCase(),{},[t]);return n.node=e,ac.removalNodes=[],wc(n),vc(n),function(){return function(e){e.effect="D",ac.removalNodes=[e],vc(),ac.removalNodes=[]}(n.firstChild)}}var Cc,Tc=function(){function e(e){this.props=e,this.state={},this.refs={}}return e.prototype.setState=function(e){var t=n(n({},this.state),e);G(this.state,t)||(this.state=t,function(e){var t=e.vnode;t.effect="U",t.old=t,t.next&&(t.next.skip=!0),ac.removalNodes=[],wc(t),vc(t),t.next&&(t.next.skip=!1)}(this))},e}(),Ec=function(e){function n(t){var n=e.call(this,t)||this;return n.state={hide:!1},n}return t(n,e),n.prototype.show=function(){this.setState({hide:!1})},n.prototype.hide=function(){this.setState({hide:!0})},n.prototype.render=function(){var e=this.props,t=e.editorType,n=e.eventEmitter;return lc(Cc||(Cc=o(['\n <div class="','" style="display: ','">\n <div\n class="tab-item','"\n onClick=',"\n >\n ",'\n </div>\n <div\n class="tab-item','"\n onClick=',"\n >\n ","\n </div>\n </div>\n "],['\n <div class="','" style="display: ','">\n <div\n class="tab-item','"\n onClick=',"\n >\n ",'\n </div>\n <div\n class="tab-item','"\n onClick=',"\n >\n ","\n </div>\n </div>\n "])),it("mode-switch"),this.state.hide?"none":"block","markdown"===t?" active":"",(function(){n.emit("needChangeMode","markdown")}),Xs.get("Markdown"),"wysiwyg"===t?" active":"",(function(){n.emit("needChangeMode","wysiwyg")}),Xs.get("WYSIWYG"))},n}(Tc),Mc=c(423),Lc=c.n(Mc),Nc=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),Sc="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,Ac=void 0!==c.g&&c.g.Math===Math?c.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),Dc="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(Ac):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var Oc=["top","right","bottom","left","width","height","size","weight"],Ic="undefined"!=typeof MutationObserver,Rc=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&s()}function a(){Dc(i)}function s(){var e=Date.now();if(n){if(e-o<2)return;r=!0}else n=!0,r=!1,setTimeout(a,t);o=e}return s}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){Sc&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ic?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Sc&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;Oc.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Pc=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},Hc=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||Ac},Bc=zc(0,0,0,0);function Fc(e){return parseFloat(e)||0}function qc(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+Fc(e["border-"+n+"-width"])}),0)}function jc(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Bc;var r=Hc(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=Fc(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,s=Fc(r.width),l=Fc(r.height);if("border-box"===r.boxSizing&&(Math.round(s+i)!==t&&(s-=qc(r,"left","right")+i),Math.round(l+a)!==n&&(l-=qc(r,"top","bottom")+a)),!function(e){return e===Hc(e).document.documentElement}(e)){var u=Math.round(s+i)-t,c=Math.round(l+a)-n;1!==Math.abs(u)&&(s-=u),1!==Math.abs(c)&&(l-=c)}return zc(o.left,o.top,s,l)}var _c="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof Hc(e).SVGGraphicsElement}:function(e){return e instanceof Hc(e).SVGElement&&"function"==typeof e.getBBox};function Uc(e){return Sc?_c(e)?function(e){var t=e.getBBox();return zc(0,0,t.width,t.height)}(e):jc(e):Bc}function zc(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Vc=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=zc(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=Uc(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),Wc=function(e,t){var n=function(e){var t=e.x,n=e.y,r=e.width,o=e.height,i="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(i.prototype);return Pc(a,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),a}(t);Pc(this,{target:e,contentRect:n})},$c=function(){function e(e,t,n){if(this.activeObservations_=[],this.observations_=new Nc,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=n}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Hc(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new Vc(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof Hc(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new Wc(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),Gc="undefined"!=typeof WeakMap?new WeakMap:new Nc,Xc=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Rc.getInstance(),r=new $c(t,n,this);Gc.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Xc.prototype[e]=function(){var t;return(t=Gc.get(this))[e].apply(t,arguments)}}));var Zc,Kc,Qc,Yc,Jc,ep,tp,np,rp,op,ip,ap,sp,lp,up,cp,pp=void 0!==Ac.ResizeObserver?Ac.ResizeObserver:Xc,dp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.execCommand=function(e){var t=dt(e.target,"li");this.props.execCommand("heading",{level:Number(t.getAttribute("data-level"))})},n.prototype.render=function(){var e=this;return lc(Kc||(Kc=o(["\n <ul\n onClick=",'\n aria-role="menu"\n aria-label="','"\n >\n ','\n <li data-type="Paragraph" aria-role="menuitem">\n <div>',"</div>\n </li>\n </ul>\n "],["\n <ul\n onClick=",'\n aria-role="menu"\n aria-label="','"\n >\n ','\n <li data-type="Paragraph" aria-role="menuitem">\n <div>',"</div>\n </li>\n </ul>\n "])),(function(t){return e.execCommand(t)}),Xs.get("Headings"),[1,2,3,4,5,6].map((function(e){return lc(Zc||(Zc=o(['\n <li data-level="','" data-type="Heading" aria-role="menuitem">\n <',">"," ","</$>\n </li>\n "],['\n <li data-level="','" data-type="Heading" aria-role="menuitem">\n <',">"," ","</$>\n </li>\n "])),e,"h"+e,Xs.get("Heading"),e)})),Xs.get("Paragraph"))},n}(Tc),fp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.toggleTab=function(e,t){this.props.onClick(e,t)},n.prototype.render=function(){var e=this;return lc(Yc||(Yc=o(['\n <div class="','" aria-role="tabpanel">\n ',"\n </div>\n "],['\n <div class="','" aria-role="tabpanel">\n ',"\n </div>\n "])),it("tabs"),this.props.tabs.map((function(t){var n=t.name,r=t.text,i=e.props.activeTab===n;return lc(Qc||(Qc=o(['\n <div\n class="tab-item','"\n onClick=','\n aria-role="tab"\n aria-label="','"\n aria-selected="','"\n tabindex="','"\n >\n ',"\n </div>\n "],['\n <div\n class="tab-item','"\n onClick=','\n aria-role="tab"\n aria-label="','"\n aria-selected="','"\n tabindex="','"\n >\n ',"\n </div>\n "])),i?" active":"",(function(t){return e.toggleTab(t,n)}),Xs.get(r),i?"true":"false",i?"0":"-1",Xs.get(r))})))},n}(Tc),hp=function(e){function n(t){var n=e.call(this,t)||this;return n.initialize=function(e){void 0===e&&(e="file");var t=n.refs.url;t.value="",n.refs.altText.value="",n.refs.file.value="",g()(t,"wrong"),n.setState({activeTab:e,file:null,fileNameElClassName:""})},n.execCommand=function(){"file"===n.state.activeTab?n.emitAddImageBlob():n.emitAddImage()},n.toggleTab=function(e,t){t!==n.state.activeTab&&n.initialize(t)},n.showFileSelectBox=function(){n.refs.file.click()},n.changeFile=function(e){var t=e.target.files;(null==t?void 0:t.length)&&n.setState({file:t[0]})},n.state={activeTab:"file",file:null,fileNameElClassName:""},n.tabs=[{name:"file",text:"File"},{name:"url",text:"URL"}],n}return t(n,e),n.prototype.emitAddImageBlob=function(){var e=this,t=this.refs.file.files,n=this.refs.altText,r=" wrong";if(null==t?void 0:t.length){r="";var o=t.item(0);this.props.eventEmitter.emit("addImageBlobHook",o,(function(t,r){return e.props.execCommand("addImage",{imageUrl:t,altText:r||n.value})}),"ui")}this.setState({fileNameElClassName:r})},n.prototype.emitAddImage=function(){var e=this.refs.url,t=this.refs.altText,n=e.value,r=t.value||"image";g()(e,"wrong"),n.length?n&&this.props.execCommand("addImage",{imageUrl:n,altText:r}):m()(e,"wrong")},n.prototype.preventSelectStart=function(e){e.preventDefault()},n.prototype.updated=function(){this.props.show||this.initialize()},n.prototype.render=function(){var e=this,t=this.state,n=t.activeTab,r=t.file,i=t.fileNameElClassName;return lc(Jc||(Jc=o(['\n <div aria-label="','">\n <'," tabs="," activeTab="," onClick=",' />\n <div style="display:','">\n <label for="toastuiImageUrlInput">','</label>\n <input\n id="toastuiImageUrlInput"\n type="text"\n ref=','\n />\n </div>\n <div style="display:',';position: relative;">\n <label for="toastuiImageFileInput">','</label>\n <span\n class="',"",'"\n onClick=',"\n onSelectstart=","\n >\n ",'\n </span>\n <button\n type="button"\n class="','"\n onClick=',"\n >\n ",'\n </button>\n <input\n id="toastuiImageFileInput"\n type="file"\n accept="image/*"\n onChange=',"\n ref=",'\n />\n </div>\n <label for="toastuiAltTextInput">','</label>\n <input\n id="toastuiAltTextInput"\n type="text"\n ref=','\n />\n <div class="','">\n <button type="button" class="','" onClick=',">\n ",'\n </button>\n <button type="button" class="','" onClick=',">\n ","\n </button>\n </div>\n </div>\n "],['\n <div aria-label="','">\n <'," tabs="," activeTab="," onClick=",' />\n <div style="display:','">\n <label for="toastuiImageUrlInput">','</label>\n <input\n id="toastuiImageUrlInput"\n type="text"\n ref=','\n />\n </div>\n <div style="display:',';position: relative;">\n <label for="toastuiImageFileInput">','</label>\n <span\n class="',"",'"\n onClick=',"\n onSelectstart=","\n >\n ",'\n </span>\n <button\n type="button"\n class="','"\n onClick=',"\n >\n ",'\n </button>\n <input\n id="toastuiImageFileInput"\n type="file"\n accept="image/*"\n onChange=',"\n ref=",'\n />\n </div>\n <label for="toastuiAltTextInput">','</label>\n <input\n id="toastuiAltTextInput"\n type="text"\n ref=','\n />\n <div class="','">\n <button type="button" class="','" onClick=',">\n ",'\n </button>\n <button type="button" class="','" onClick=',">\n ","\n </button>\n </div>\n </div>\n "])),Xs.get("Insert image"),fp,this.tabs,n,this.toggleTab,"url"===n?"block":"none",Xs.get("Image URL"),(function(t){return e.refs.url=t}),"file"===n?"block":"none",Xs.get("Select image file"),it("file-name"),r?" has-file":i,this.showFileSelectBox,this.preventSelectStart,r?r.name:Xs.get("No file"),it("file-select-button"),this.showFileSelectBox,Xs.get("Choose a file"),this.changeFile,(function(t){return e.refs.file=t}),Xs.get("Description"),(function(t){return e.refs.altText=t}),it("button-container"),it("close-button"),this.props.hidePopup,Xs.get("Cancel"),it("ok-button"),this.execCommand,Xs.get("OK"))},n}(Tc),mp=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.execCommand=function(){var e=t.refs.url,n=t.refs.text;(g()(e,"wrong"),g()(n,"wrong"),e.value.length<1)?m()(e,"wrong"):C()(t.props.initialValues.linkUrl)&&n.value.length<1?m()(n,"wrong"):t.props.execCommand("addLink",{linkUrl:e.value,linkText:n.value})},t}return t(n,e),n.prototype.initialize=function(){var e=this.props.initialValues,t=e.linkUrl,n=e.linkText,r=this.refs.url,o=this.refs.text;g()(r,"wrong"),g()(o,"wrong","disabled"),o.removeAttribute("disabled"),t&&(m()(o,"disabled"),o.setAttribute("disabled","disabled")),r.value=t||"",o.value=n||""},n.prototype.mounted=function(){this.initialize()},n.prototype.updated=function(e){!e.show&&this.props.show&&this.initialize()},n.prototype.render=function(){var e=this;return lc(ep||(ep=o(['\n <div aria-label="','">\n <label for="toastuiLinkUrlInput">','</label>\n <input\n id="toastuiLinkUrlInput"\n type="text"\n ref=','\n />\n <label for="toastuiLinkTextInput">','</label>\n <input\n id="toastuiLinkTextInput"\n type="text"\n ref=','\n />\n <div class="','">\n <button type="button" class="','" onClick=',">\n ",'\n </button>\n <button type="button" class="','" onClick=',">\n ","\n </button>\n </div>\n </div>\n "],['\n <div aria-label="','">\n <label for="toastuiLinkUrlInput">','</label>\n <input\n id="toastuiLinkUrlInput"\n type="text"\n ref=','\n />\n <label for="toastuiLinkTextInput">','</label>\n <input\n id="toastuiLinkTextInput"\n type="text"\n ref=','\n />\n <div class="','">\n <button type="button" class="','" onClick=',">\n ",'\n </button>\n <button type="button" class="','" onClick=',">\n ","\n </button>\n </div>\n </div>\n "])),Xs.get("Insert link"),Xs.get("URL"),(function(t){return e.refs.url=t}),Xs.get("Link text"),(function(t){return e.refs.text=t}),it("button-container"),it("close-button"),this.props.hidePopup,Xs.get("Cancel"),it("ok-button"),this.execCommand,Xs.get("OK"))},n}(Tc),vp=function(e){function r(t){var r=e.call(this,t)||this;return r.extendSelectionRange=function(e){var t=e.pageX,o=e.pageY,i=t-r.offsetRect.left,a=o-r.offsetRect.top,s=r.getSelectionRangeByOffset(i,a);r.setState(n({},s))},r.execCommand=function(){r.props.execCommand("addTable",{rowCount:r.state.rowIdx+1,columnCount:r.state.colIdx+1})},r.state={rowIdx:-1,colIdx:-1},r}return t(r,e),r.prototype.getDescription=function(){return-1===this.state.colIdx?"":this.state.colIdx+1+" x "+(this.state.rowIdx+1)},r.prototype.getBoundByRange=function(e,t){return{width:20*(e+1),height:20*(t+1)}},r.prototype.getRangeByOffset=function(e,t){return{colIdx:Math.floor(e/20),rowIdx:Math.floor(t/20)}},r.prototype.getTableRange=function(){var e=this.state,t=e.colIdx,n=e.rowIdx,r=Math.max(t,5),o=Math.max(n,5);return t>=5&&r<9&&(r+=1),n>=5&&o<14&&(o+=1),{colIdx:r+1,rowIdx:o+1}},r.prototype.getSelectionAreaBound=function(){var e=this.getBoundByRange(this.state.colIdx,this.state.rowIdx),t=e.width,n=e.height;return t||n?{width:t-1,height:n-1,display:"block"}:{display:"none"}},r.prototype.getSelectionRangeByOffset=function(e,t){var n=this.getRangeByOffset(e,t);return n.rowIdx=Math.min(Math.max(n.rowIdx,1),14),n.colIdx=Math.min(Math.max(n.colIdx,1),9),n},r.prototype.updated=function(){if(this.props.show){if(-1===this.state.colIdx&&-1===this.state.rowIdx){var e=this.refs.tableEl.getBoundingClientRect(),t=e.left,n=e.top;this.offsetRect={left:window.pageXOffset+t,top:window.pageYOffset+n}}}else this.setState({colIdx:-1,rowIdx:-1})},r.prototype.createTableArea=function(e){for(var t=e.colIdx,n=e.rowIdx,r=[],i=0;i<n;i+=1){for(var a=[],s=0;s<t;s+=1){var l=it("table-cell")+(i>0?"":" header");a.push(lc(tp||(tp=o(['<div class="','"></div>'],['<div class="','"></div>'])),l))}r.push(lc(np||(np=o(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),it("table-row"),a))}return lc(rp||(rp=o(['<div class="','">',"</div>"],['<div class="','">',"</div>"])),it("table"),r)},r.prototype.render=function(){var e=this,t=this.getTableRange(),n=this.getSelectionAreaBound();return lc(op||(op=o(['\n <div aria-label="','">\n <div\n class="','"\n ref=',"\n onMousemove=","\n onClick=","\n >\n ",'\n <div class="','" style=','></div>\n </div>\n <p class="','">',"</p>\n </div>\n "],['\n <div aria-label="','">\n <div\n class="','"\n ref=',"\n onMousemove=","\n onClick=","\n >\n ",'\n <div class="','" style=','></div>\n </div>\n <p class="','">',"</p>\n </div>\n "])),Xs.get("Insert table"),it("table-selection"),(function(t){return e.refs.tableEl=t}),this.extendSelectionRange,this.execCommand,this.createTableArea(t),it("table-selection-layer"),n,it("table-description"),this.getDescription())},r}(Tc),gp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.mounted=function(){this.refs.el.appendChild(this.props.body)},n.prototype.updated=function(e){this.refs.el.replaceChild(this.props.body,e.body)},n.prototype.render=function(){var e=this;return lc(ip||(ip=o(["<div ref=","></div>"],["<div ref=","></div>"])),(function(t){return e.refs.el=t}))},n}(Tc);function yp(e){return b()(e)?function(e){var t;switch(e){case"heading":t={name:"heading",className:"heading",tooltip:Xs.get("Headings"),state:"heading"};break;case"bold":t={name:"bold",className:"bold",command:"bold",tooltip:Xs.get("Bold"),state:"strong"};break;case"italic":t={name:"italic",className:"italic",command:"italic",tooltip:Xs.get("Italic"),state:"emph"};break;case"strike":t={name:"strike",className:"strike",command:"strike",tooltip:Xs.get("Strike"),state:"strike"};break;case"hr":t={name:"hr",className:"hrline",command:"hr",tooltip:Xs.get("Line"),state:"thematicBreak"};break;case"quote":t={name:"quote",className:"quote",command:"blockQuote",tooltip:Xs.get("Blockquote"),state:"blockQuote"};break;case"ul":t={name:"ul",className:"bullet-list",command:"bulletList",tooltip:Xs.get("Unordered list"),state:"bulletList"};break;case"ol":t={name:"ol",className:"ordered-list",command:"orderedList",tooltip:Xs.get("Ordered list"),state:"orderedList"};break;case"task":t={name:"task",className:"task-list",command:"taskList",tooltip:Xs.get("Task"),state:"taskList"};break;case"table":t={name:"table",className:"table",tooltip:Xs.get("Insert table"),state:"table"};break;case"image":t={name:"image",className:"image",tooltip:Xs.get("Insert image")};break;case"link":t={name:"link",className:"link",tooltip:Xs.get("Insert link")};break;case"code":t={name:"code",className:"code",command:"code",tooltip:Xs.get("Code"),state:"code"};break;case"codeblock":t={name:"codeblock",className:"codeblock",command:"codeBlock",tooltip:Xs.get("Insert CodeBlock"),state:"codeBlock"};break;case"indent":t={name:"indent",className:"indent",command:"indent",tooltip:Xs.get("Indent"),state:"indent"};break;case"outdent":t={name:"outdent",className:"outdent",command:"outdent",tooltip:Xs.get("Outdent"),state:"outdent"};break;case"scrollSync":t=function(){var e=document.createElement("label"),t=document.createElement("input"),n=document.createElement("span");e.className="scroll-sync active",t.type="checkbox",t.checked=!0,n.className="switch";var r=function(n){return t.addEventListener("change",(function(t){var r=t.target.checked;r?m()(e,"active"):g()(e,"active"),n("toggleScrollSync",{active:r})}))};return e.appendChild(t),e.appendChild(n),{name:"scrollSync",el:e,onMounted:r}}();break;case"more":t={name:"more",className:"more",tooltip:Xs.get("More")}}"scrollSync"!==t.name&&(t.className+=" "+it("toolbar-icons"));return t}(e):e}function bp(e,t){var r=t.el,i=t.pos,a=t.popup,s=t.initialValues;switch(e){case"heading":return{render:function(e){return lc(ap||(ap=o(["<"," ..."," />"],["<"," ..."," />"])),dp,e)},className:it("popup-add-heading"),fromEl:r,pos:i};case"link":return{render:function(e){return lc(sp||(sp=o(["<"," ..."," />"],["<"," ..."," />"])),mp,e)},className:it("popup-add-link"),fromEl:r,pos:i,initialValues:s};case"image":return{render:function(e){return lc(lp||(lp=o(["<"," ..."," />"],["<"," ..."," />"])),hp,e)},className:it("popup-add-image"),fromEl:r,pos:i};case"table":return{render:function(e){return lc(up||(up=o(["<"," ..."," />"],["<"," ..."," />"])),vp,e)},className:it("popup-add-table"),fromEl:r,pos:i};case"customPopupBody":return a?n({render:function(e){return lc(cp||(cp=o(["<"," ..."," body="," />"],["<"," ..."," body="," />"])),gp,e,a.body)},fromEl:r,pos:i},a):null;default:return null}}function wp(e){e.hidden=e.length===e.filter((function(e){return e.hidden})).length}function kp(e,t){return e.reduce((function(e,n){e.push(n.map((function(e){return function(e){return e.hidden="scrollSync"===e.name&&t,e}(yp(e))})));var r=e[(e.length||1)-1];return r&&wp(r),e}),[])}var xp,Cp,Tp=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMousedown=function(e){dt(e.target,"."+it("popup"))||dt(e.target,t.props.info.fromEl)||t.props.hidePopup()},t}return t(r,e),r.prototype.mounted=function(){document.addEventListener("mousedown",this.handleMousedown),this.props.eventEmitter.listen("closePopup",this.props.hidePopup)},r.prototype.beforeDestroy=function(){document.removeEventListener("mousedown",this.handleMousedown)},r.prototype.updated=function(e){var t=this.props,r=t.show,o=t.info;if(r&&o.pos&&e.show!==r){var i=n({},o.pos),a=this.refs.el.offsetWidth,s=dt(this.refs.el,"."+it("toolbar")).offsetWidth;i.left+a>=s&&(i.left=s-a-20),G(this.state.popupPos,i)||this.setState({popupPos:i})}},r.prototype.render=function(){var e=this,t=this.props,r=t.info,i=t.show,a=t.hidePopup,s=t.eventEmitter,l=t.execCommand,u=r||{},c=u.className,p=void 0===c?"":c,d=u.style,f=u.render,h=u.initialValues,m=void 0===h?{}:h,v=n(n({display:i?"block":"none"},d),this.state.popupPos);return lc(xp||(xp=o(['\n <div\n class="'," ",'"\n style=',"\n ref=",'\n aria-role="dialog"\n >\n <div class="','">\n ',"\n </div>\n </div>\n "],['\n <div\n class="'," ",'"\n style=',"\n ref=",'\n aria-role="dialog"\n >\n <div class="','">\n ',"\n </div>\n </div>\n "])),it("popup"),p,v,(function(t){return e.refs.el=t}),it("popup-body"),f&&f({eventEmitter:s,show:i,hidePopup:a,execCommand:l,initialValues:m}))},r}(Tc);function Ep(e){return function(n){function r(e){var t=n.call(this,e)||this;return t.showTooltip=function(e){var n=t.props.item.tooltip;if(!t.props.disabled&&n){var r=t.getBound(e),o=r.left+6+"px",i=r.top+6+"px";f()(t.props.tooltipRef.current,{display:"block",left:o,top:i}),t.props.tooltipRef.current.querySelector(".text").textContent=n}},t.hideTooltip=function(){f()(t.props.tooltipRef.current,"display","none")},t.state={active:!1,disabled:e.disabled},t.addEvent(),t}return t(r,n),r.prototype.addEvent=function(){var e=this,t=this.props,n=t.item,r=t.eventEmitter;n.state&&r.listen("changeToolbarState",(function(t){var r,o=null!==(r=t.toolbarState[n.state])&&void 0!==r?r:{},i=o.active,a=o.disabled;e.setState({active:!!i,disabled:null!=a?a:e.props.disabled})}))},r.prototype.getBound=function(e){var t=ft(e,dt(e,"."+it("toolbar"))),n=t.offsetLeft,r=t.offsetTop;return{left:n,top:e.offsetHeight+r}},r.prototype.render=function(){return lc(Cp||(Cp=o(["\n <","\n ...","\n active=","\n showTooltip=","\n hideTooltip=","\n getBound=","\n disabled=","\n />\n "],["\n <","\n ...","\n active=","\n showTooltip=","\n hideTooltip=","\n getBound=","\n disabled=","\n />\n "])),e,this.props,this.state.active,this.showTooltip,this.hideTooltip,this.getBound,this.state.disabled||this.props.disabled)},r}(Tc)}var Mp,Lp,Np,Sp,Ap,Dp,Op,Ip,Rp,Pp,Hp,Bp,Fp,qp,jp=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.showTooltip=function(){t.props.showTooltip(t.refs.el)},t.execCommand=function(){var e=t.props,n=e.item,r=e.execCommand,o=e.setPopupInfo,i=e.getBound,a=e.eventEmitter,s=n.command,l=n.name,u=n.popup;if(s)r(s);else{var c=u?"customPopupBody":l,p=a.emit("query","getPopupInitialValues",{popupName:c})[0],d=bp(c,{el:t.refs.el,pos:i(t.refs.el),popup:u,initialValues:p});d&&o(d)}},t}return t(r,e),r.prototype.mounted=function(){this.setItemWidth()},r.prototype.updated=function(e){e.item.name!==this.props.item.name&&this.setItemWidth()},r.prototype.setItemWidth=function(){var e=this.props,t=e.setItemWidth,n=e.item;t&&t(n.name,pt(this.refs.el)+(n.hidden?80:0))},r.prototype.render=function(){var e=this,t=this.props,r=t.hideTooltip,i=t.disabled,a=t.item,s=t.active,l=n({display:a.hidden?"none":null},a.style),u=(a.className||"")+(s?" active":"");return lc(Mp||(Mp=o(["\n <button\n ref=",'\n type="button"\n style=',"\n class=","\n onClick=","\n onMouseover=","\n onMouseout=","\n disabled=","\n aria-label=","\n >\n ","\n </button>\n "],["\n <button\n ref=",'\n type="button"\n style=',"\n class=","\n onClick=","\n onMouseover=","\n onMouseout=","\n disabled=","\n aria-label=","\n >\n ","\n </button>\n "])),(function(t){return e.refs.el=t}),l,u,this.execCommand,this.showTooltip,r,!!i,a.text||a.tooltip||"",a.text||"")},r}(Tc),_p=Ep(jp),Up=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.showTooltip=function(){t.props.showTooltip(t.refs.el)},t.showPopup=function(){var e=bp("customPopupBody",{el:t.refs.el,pos:t.props.getBound(t.refs.el),popup:t.props.item.popup});e&&t.props.setPopupInfo(e)},t}return t(n,e),n.prototype.mounted=function(){var e=this.props,t=e.setItemWidth,n=e.item;this.refs.el.appendChild(n.el),t&&t(n.name,pt(this.refs.el)),n.onMounted&&n.onMounted(this.props.execCommand)},n.prototype.updated=function(e){var t,n=this.props,r=n.item,o=n.active,i=n.disabled;e.active===o&&e.disabled===i||null===(t=r.onUpdated)||void 0===t||t.call(r,{active:o,disabled:i})},n.prototype.render=function(){var e=this,t=this.props,n=t.disabled,r={display:t.item.hidden?"none":"inline-block"},i=function(e){return n?null:e};return lc(Lp||(Lp=o(["\n <div\n ref=","\n style=","\n class=","\n onClick=","\n onMouseover=","\n onMouseout=","\n ></div>\n "],["\n <div\n ref=","\n style=","\n class=","\n onClick=","\n onMouseover=","\n onMouseout=","\n ></div>\n "])),(function(t){return e.refs.el=t}),r,it("toolbar-item-wrapper"),i(this.showPopup),i(this.showTooltip),i(this.props.hideTooltip))},n}(Tc),zp=Ep(Up),Vp=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.render=function(){var e=this,t=this.props,n=t.group,r=t.hiddenDivider,i=n.hidden?{display:"none"}:null,a=r?{display:"none"}:null;return lc(Sp||(Sp=o(['\n <div class="','" style=',">\n ",'\n <div class="','" style=',"></div>\n </div>\n "],['\n <div class="','" style=',">\n ",'\n <div class="','" style=',"></div>\n </div>\n "])),it("toolbar-group"),i,n.map((function(t){var n=t.el?zp:_p;return lc(Np||(Np=o(["<"," key="," ..."," item="," />"],["<"," key="," ..."," item="," />"])),n,t.name,e.props,t)})),it("toolbar-divider"),a)},n}(Tc),Wp=function(e){function r(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){var t=e.target;dt(t,"."+it("dropdown-toolbar"))||dt(t,".more")||n.setState({showDropdown:!1,dropdownPos:null})},n.showTooltip=function(){n.props.showTooltip(n.refs.el)},n.state={showDropdown:!1,dropdownPos:null},n}return t(r,e),r.prototype.getBound=function(){var e=this.props.getBound(this.refs.el);return e.top+=4,n(n({},e),{left:null,right:10})},r.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},r.prototype.updated=function(){this.state.showDropdown&&!this.state.dropdownPos&&this.setState({dropdownPos:this.getBound()})},r.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},r.prototype.render=function(){var e=this,t=this.state,r=t.showDropdown,i=t.dropdownPos,a=this.props,s=a.disabled,l=a.item,u=a.items,c=a.hideTooltip,p=u.filter((function(e){return!e.hidden})),d=p.length?null:{display:"none"},f=r?null:{display:"none"};return lc(Dp||(Dp=o(['\n <div class="','" style=',">\n <button\n ref=",'\n type="button"\n class=',"\n onClick=","\n onMouseover=","\n onMouseout=","\n disabled=",'\n ></button>\n <div\n class="','"\n style=',"\n ref=","\n >\n ","\n </div>\n </div>\n "],['\n <div class="','" style=',">\n <button\n ref=",'\n type="button"\n class=',"\n onClick=","\n onMouseover=","\n onMouseout=","\n disabled=",'\n ></button>\n <div\n class="','"\n style=',"\n ref=","\n >\n ","\n </div>\n </div>\n "])),it("toolbar-group"),d,(function(t){return e.refs.el=t}),l.className,(function(){return e.setState({showDropdown:!0})}),this.showTooltip,c,s,it("dropdown-toolbar"),n(n({},f),i),(function(t){return e.refs.dropdownEl=t}),p.length?p.map((function(t,n){var r;return lc(Ap||(Ap=o(["\n <","\n group=","\n hiddenDivider=","\n ...","\n />\n "],["\n <","\n group=","\n hiddenDivider=","\n ...","\n />\n "])),Vp,t,n===p.length-1||(null===(r=p[n+1])||void 0===r?void 0:r.hidden),e.props)})):null)},r}(Tc),$p=Ep(Wp),Gp=function(e){function n(t){var n=e.call(this,t)||this;return n.toggleTab=function(e,t){var r=n.props.eventEmitter;if(n.state.activeTab!==t){var o="write"===t?"changePreviewTabWrite":"changePreviewTabPreview";r.emit(o),n.setState({activeTab:t})}},n.setItemWidth=function(e,t){n.itemWidthMap[e]=t},n.setPopupInfo=function(e){n.setState({showPopup:!0,popupInfo:e})},n.openPopup=function(e,t){void 0===t&&(t={});var r=n.refs.el.querySelector("."+it("toolbar-group")+" ."+e);if(r){var o=ft(r,dt(r,"."+it("toolbar"))),i=o.offsetLeft,a=o.offsetTop,s=bp(e,{el:r,pos:{left:i,top:r.offsetHeight+a},initialValues:t});s&&n.setPopupInfo(s)}},n.hidePopup=function(){n.state.showPopup&&n.setState({showPopup:!1})},n.execCommand=function(e,t){n.props.eventEmitter.emit("command",e,t),n.hidePopup()},n.tabs=[{name:"write",text:"Write"},{name:"preview",text:"Preview"}],n.itemWidthMap={},n.initialItems=kp(t.toolbarItems||[],n.hiddenScrollSync()),n.state={items:n.initialItems,dropdownItems:[],showPopup:!1,popupInfo:{},activeTab:"write"},n.tooltipRef={current:null},n.resizeObserver=new pp((function(){return n.handleResize()})),n.addEvent(),n}return t(n,e),n.prototype.insertToolbarItem=function(e,t){var n=e.groupIndex,r=e.itemIndex,o=this.initialItems[n];t=yp(t),o?o.splice(r,0,t):this.initialItems.push([t]),this.setState(this.classifyToolbarItems())},n.prototype.removeToolbarItem=function(e){var t=this;wt()(this.initialItems,(function(n){var r=!1;return wt()(n,(function(o,i){return o.name!==e||(r=!0,n.splice(i,1),t.setState(t.classifyToolbarItems()),!1)})),!r}))},n.prototype.addEvent=function(){var e=this,t=this.props.eventEmitter;this.handleResize=Lc()((function(){e.setState({items:e.initialItems,dropdownItems:[]}),e.setState(e.classifyToolbarItems())}),200),t.listen("openPopup",this.openPopup)},n.prototype.appendTooltipToRoot=function(){var e='<div class="'+it("tooltip")+'" style="display:none">\n <div class="arrow"></div>\n <span class="text"></span>\n </div>';this.tooltipRef.current=ct(e,this.refs.el)},n.prototype.hiddenScrollSync=function(){return"wysiwyg"===this.props.editorType||"tab"===this.props.previewStyle},n.prototype.movePrevItemToDropdownToolbar=function(e,t,n,r){var o=function(e){var t=e.pop();t&&r.push(t)};if(e>1)o(n);else{var i=X(t);i&&o(i)}},n.prototype.classifyToolbarItems=function(){var e=this,t=0,n=this.refs.el.clientWidth,r=this.refs.el.querySelector("."+it("toolbar-divider")),o=r?pt(r):0,i=[],a=[],s=!1;return this.initialItems.forEach((function(r,l){var u=[],c=[];r.forEach((function(r,o){r.hidden||((t+=e.itemWidthMap[r.name])>n-50?(s||(e.movePrevItemToDropdownToolbar(o,i,u,c),s=!0),c.push(r)):u.push(r))})),u.length&&(wp(u),i.push(u)),c.length&&(wp(c),a.push(c)),l<e.state.items.length-1&&(t+=o)})),{items:i,dropdownItems:a}},n.prototype.mounted=function(){"tab"===this.props.previewStyle&&this.props.eventEmitter.emit("changePreviewTabWrite",!0),this.setState(this.classifyToolbarItems()),this.appendTooltipToRoot(),this.resizeObserver.observe(this.refs.el)},n.prototype.updated=function(e){var t,n,r=this.props,o=r.editorType,i=r.previewStyle,a=r.eventEmitter,s=i!==e.previewStyle,l=o!==e.editorType;if(s||l){t=this.initialItems,n=this.hiddenScrollSync(),t.forEach((function(e){e.forEach((function(e){return e.hidden="scrollSync"===e.name&&n})),wp(e)}));var u=this.classifyToolbarItems();(s||"tab"===i&&"markdown"===o)&&(a.emit("changePreviewTabWrite"),u.activeTab="write"),this.setState(u)}},n.prototype.beforeDestroy=function(){window.removeEventListener("resize",this.handleResize),this.resizeObserver.disconnect(),lt(this.tooltipRef.current)},n.prototype.render=function(){var e=this,t=this.props,n=t.previewStyle,r=t.eventEmitter,i=t.editorType,a=this.state,s=a.popupInfo,l=a.showPopup,u=a.activeTab,c=a.items,p=a.dropdownItems,d={eventEmitter:r,tooltipRef:this.tooltipRef,disabled:"markdown"===i&&"tab"===n&&"preview"===u,execCommand:this.execCommand,setPopupInfo:this.setPopupInfo},f="tab"===n?{borderTopLeftRadius:0}:null;return lc(Ip||(Ip=o(['\n <div class="','">\n <div\n class="','"\n style="display: ','"\n >\n <'," tabs="," activeTab="," onClick=",' />\n </div>\n <div\n class="','"\n ref=',"\n style=","\n >\n ","\n <","\n item=","\n items=","\n ...","\n />\n </div>\n <","\n info=","\n show=","\n eventEmitter=","\n hidePopup=","\n execCommand=","\n />\n </div>\n "],['\n <div class="','">\n <div\n class="','"\n style="display: ','"\n >\n <'," tabs="," activeTab="," onClick=",' />\n </div>\n <div\n class="','"\n ref=',"\n style=","\n >\n ","\n <","\n item=","\n items=","\n ...","\n />\n </div>\n <","\n info=","\n show=","\n eventEmitter=","\n hidePopup=","\n execCommand=","\n />\n </div>\n "])),it("toolbar"),it("md-tab-container"),"wysiwyg"===i||"vertical"===n?"none":"block",fp,this.tabs,u,this.toggleTab,it("defaultUI-toolbar"),(function(t){return e.refs.el=t}),f,c.map((function(t,n){var r;return lc(Op||(Op=o(["\n <","\n group=","\n hiddenDivider=","\n setItemWidth=","\n ...","\n />\n "],["\n <","\n group=","\n hiddenDivider=","\n setItemWidth=","\n ...","\n />\n "])),Vp,t,n===c.length-1||(null===(r=c[n+1])||void 0===r?void 0:r.hidden),e.setItemWidth,d)})),$p,yp("more"),p,d,Tp,s,l,r,this.hidePopup,this.execCommand)},n}(Tc),Xp=function(e){function r(t){var n=e.call(this,t)||this;return n.handleClickDocument=function(e){dt(e.target,"."+it("context-menu"))||n.setState({pos:null})},n.state={pos:null,menuGroups:[]},n.addEvent(),n}return t(r,e),r.prototype.addEvent=function(){var e=this;this.props.eventEmitter.listen("contextmenu",(function(t){var n=t.pos,r=t.menuGroups;e.setState({pos:n,menuGroups:r})}))},r.prototype.mounted=function(){document.addEventListener("click",this.handleClickDocument)},r.prototype.beforeDestroy=function(){document.removeEventListener("click",this.handleClickDocument)},r.prototype.getMenuGroupElements=function(){var e=this,t=this.state,n=t.pos,r=t.menuGroups;return n?r.reduce((function(t,n){var r=[];return n.forEach((function(t){var n=t.label,i=t.className,a=void 0!==i&&i,s=t.disabled,l=t.onClick;r.push(lc(Rp||(Rp=o(["\n <li\n onClick=",'\n class="menu-item','"\n aria-role="menuitem"\n >\n <span class="','">',"</span>\n </li>\n "],["\n <li\n onClick=",'\n class="menu-item','"\n aria-role="menuitem"\n >\n <span class="','">',"</span>\n </li>\n "])),(function(){s||(l(),e.setState({pos:null}))}),s?" disabled":"",a,n))})),t.push(lc(Pp||(Pp=o(['<ul class="menu-group">\n ',"\n </ul>"],['<ul class="menu-group">\n ',"\n </ul>"])),r)),t}),[]):[]},r.prototype.render=function(){var e=n({display:this.state.pos?"block":"none"},this.state.pos);return lc(Hp||(Hp=o(['<div class="','" style=',' aria-role="menu">\n ',"\n </div>"],['<div class="','" style=',' aria-role="menu">\n ',"\n </div>"])),it("context-menu"),e,this.getMenuGroupElements())},r}(Tc),Zp=function(e){function n(t){var n=e.call(this,t)||this;n.changeMode=function(e){e!==n.state.editorType&&n.setState({editorType:e})},n.changePreviewStyle=function(e){e!==n.state.previewStyle&&n.setState({previewStyle:e})},n.hide=function(){n.setState({hide:!0})},n.show=function(){n.setState({hide:!1})};var r=t.editorType,o=t.previewStyle;return n.state={editorType:r,previewStyle:o,hide:!1},n.addEvent(),n}return t(n,e),n.prototype.mounted=function(){var e=this.props.slots,t=e.wwEditor,n=e.mdEditor,r=e.mdPreview;this.refs.wwContainer.appendChild(t),this.refs.mdContainer.insertAdjacentElement("afterbegin",n),this.refs.mdContainer.appendChild(r)},n.prototype.insertToolbarItem=function(e,t){this.toolbar.insertToolbarItem(e,t)},n.prototype.removeToolbarItem=function(e){this.toolbar.removeToolbarItem(e)},n.prototype.render=function(){var e=this,t=this.props,n=t.eventEmitter,r=t.hideModeSwitch,i=t.toolbarItems,a=t.theme,s=this.state,l=s.hide,u=s.previewStyle,c=s.editorType,p=l?" hidden":"",d=it("markdown"===c?"md-mode":"ww-mode"),f=it("md")+"-"+u+"-style",h=it(["light"!==a,a+" "]);return lc(Fp||(Fp=o(['\n <div\n class="',"","",'"\n ref=',"\n >\n <","\n ref=","\n eventEmitter=","\n previewStyle=","\n toolbarItems=","\n editorType=",'\n />\n <div\n class="'," ",'"\n ref=','\n >\n <div class="','">\n <div\n class="'," ",'"\n ref=','\n >\n <div class="','"></div>\n </div>\n <div\n class="','"\n ref=',"\n />\n </div>\n </div>\n ","\n <"," eventEmitter="," />\n </div>\n "],['\n <div\n class="',"","",'"\n ref=',"\n >\n <","\n ref=","\n eventEmitter=","\n previewStyle=","\n toolbarItems=","\n editorType=",'\n />\n <div\n class="'," ",'"\n ref=','\n >\n <div class="','">\n <div\n class="'," ",'"\n ref=','\n >\n <div class="','"></div>\n </div>\n <div\n class="','"\n ref=',"\n />\n </div>\n </div>\n ","\n <"," eventEmitter="," />\n </div>\n "])),h,it("defaultUI"),p,(function(t){return e.refs.el=t}),Gp,(function(t){return e.toolbar=t}),n,u,i,c,it("main"),d,(function(t){return e.refs.editorSection=t}),it("main-container"),it("md-container"),f,(function(t){return e.refs.mdContainer=t}),it("md-splitter"),it("ww-container"),(function(t){return e.refs.wwContainer=t}),!r&&lc(Bp||(Bp=o(["<"," eventEmitter="," editorType="," />"],["<"," eventEmitter="," editorType="," />"])),Ec,n,c),Xp,n)},n.prototype.addEvent=function(){var e=this.props.eventEmitter;e.listen("hide",this.hide),e.listen("show",this.show),e.listen("changeMode",this.changeMode),e.listen("changePreviewStyle",this.changePreviewStyle)},n}(Tc),Kp=function(e){function n(t){var n,r,i=e.call(this,t)||this,a=xc(i.options.el,lc(qp||(qp=o(["\n <","\n ref=","\n eventEmitter=","\n slots=","\n hideModeSwitch=","\n toolbarItems=","\n previewStyle=","\n editorType=","\n theme=","\n />\n "],["\n <","\n ref=","\n eventEmitter=","\n slots=","\n hideModeSwitch=","\n toolbarItems=","\n previewStyle=","\n editorType=","\n theme=","\n />\n "])),Zp,(function(e){return r=e}),i.eventEmitter,i.getEditorElements(),i.options.hideModeSwitch,i.options.toolbarItems,i.options.previewStyle,i.options.initialEditType,i.options.theme));return i.setMinHeight(i.options.minHeight),i.setHeight(i.options.height),i.defaultUI={insertToolbarItem:r.insertToolbarItem.bind(r),removeToolbarItem:r.removeToolbarItem.bind(r),destroy:a},null===(n=i.pluginInfo.toolbarItems)||void 0===n||n.forEach((function(e){var t=e.groupIndex,n=e.itemIndex,r=e.item;i.defaultUI.insertToolbarItem({groupIndex:t,itemIndex:n},r)})),i.eventEmitter.emit("loadUI",i),i}return t(n,e),n.factory=function(e){return e.viewer?new Wu(e):new n(e)},n.prototype.insertToolbarItem=function(e,t){this.defaultUI.insertToolbarItem(e,t)},n.prototype.removeToolbarItem=function(e){this.defaultUI.removeToolbarItem(e)},n.prototype.destroy=function(){e.prototype.destroy.call(this),this.defaultUI.destroy()},n}(nc),Qp=Kp;nc.setLanguage(["en","en-US"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Write",Preview:"Preview",Headings:"Headings",Paragraph:"Paragraph",Bold:"Bold",Italic:"Italic",Strike:"Strike",Code:"Inline code",Line:"Line",Blockquote:"Blockquote","Unordered list":"Unordered list","Ordered list":"Ordered list",Task:"Task",Indent:"Indent",Outdent:"Outdent","Insert link":"Insert link","Insert CodeBlock":"Insert codeBlock","Insert table":"Insert table","Insert image":"Insert image",Heading:"Heading","Image URL":"Image URL","Select image file":"Select image file","Choose a file":"Choose a file","No file":"No file",Description:"Description",OK:"OK",More:"More",Cancel:"Cancel",File:"File",URL:"URL","Link text":"Link text","Add row to up":"Add row to up","Add row to down":"Add row to down","Add column to left":"Add column to left","Add column to right":"Add column to right","Remove row":"Remove row","Remove column":"Remove column","Align column to left":"Align column to left","Align column to center":"Align column to center","Align column to right":"Align column to right","Remove table":"Remove table","Would you like to paste as table?":"Would you like to paste as table?","Text color":"Text color","Auto scroll enabled":"Auto scroll enabled","Auto scroll disabled":"Auto scroll disabled","Choose language":"Choose language"});var Yp=Qp}(),p=p.default}()}));
//# sourceMappingURL=/sm/65338823896ef87af9f9712458286ad3b8aeb394eeb0d37b4dc2e76ddc210b99.map
|