UNPKG

md-editor-v3

Version:

Markdown editor for vue3, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...

3 lines (2 loc) 21.3 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("./MdEditor.cjs"),Se=require("./NormalToolbar.cjs"),ke=require("./chunks/index.cjs"),xe=require("./ModalToolbar.cjs"),Ee=require("./chunks/index2.cjs"),Ce=require("./chunks/dom.cjs"),ie=require("vue"),X=require("./chunks/config.cjs"),_e=require("./chunks/vue-tsx.cjs"),re=require("./chunks/index3.cjs"),Le=require("./chunks/index4.cjs"),he=require("./config.cjs");function Ie(t,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const g in s)if(g!=="default"&&!(g in t)){const e=Object.getOwnPropertyDescriptor(s,g);e&&Object.defineProperty(t,g,e.get?e:{enumerable:!0,get:()=>s[g]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Pe={onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},Q=ie.defineComponent({name:"NormalFooterToolbar",props:Pe,emits:["onClick"],setup(t,n){return()=>{const i=_e.getSlot({props:t,ctx:n});return ie.createVNode("div",{class:[`${X.prefix}-footer-item`,t.disabled&&`${X.prefix}-disabled`],onClick:s=>{t.disabled||(t.onClick?.(s),n.emit("onClick",s))}},[i])}}});Q.install=t=>(t.component(Q.name,Q),t);function qe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={exports:{}},w={},B={exports:{}},W={},ne;function be(){if(ne)return W;ne=1;function t(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function n(e,v,u){}function i(e,v,u){}var s=/javascript\s*\:/img;function g(e,v){return s.test(v)?"":v}return W.whiteList=t(),W.getDefaultWhiteList=t,W.onAttr=n,W.onIgnoreAttr=i,W.safeAttrValue=g,W}var Z,se;function me(){return se||(se=1,Z={indexOf:function(t,n){var i,s;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,s=t.length;i<s;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var s,g;if(Array.prototype.forEach)return t.forEach(n,i);for(s=0,g=t.length;s<g;s++)n.call(i,t[s],s,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}}),Z}var J,oe;function Re(){if(oe)return J;oe=1;var t=me();function n(i,s){i=t.trimRight(i),i[i.length-1]!==";"&&(i+=";");var g=i.length,e=!1,v=0,u=0,T="";function k(){if(!e){var f=t.trim(i.slice(v,u)),a=f.indexOf(":");if(a!==-1){var y=t.trim(f.slice(0,a)),S=t.trim(f.slice(a+1));if(y){var c=s(v,T.length,y,S,f);c&&(T+=c+"; ")}}}v=u+1}for(;u<g;u++){var x=i[u];if(x==="/"&&i[u+1]==="*"){var r=i.indexOf("*/",u+2);if(r===-1)break;u=r+1,v=u+1,e=!1}else x==="("?e=!0:x===")"?e=!1:x===";"?e||k():x===` `&&k()}return t.trim(T)}return J=n,J}var K,le;function Oe(){if(le)return K;le=1;var t=be(),n=Re();me();function i(e){return e==null}function s(e){var v={};for(var u in e)v[u]=e[u];return v}function g(e){e=s(e||{}),e.whiteList=e.whiteList||t.whiteList,e.onAttr=e.onAttr||t.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||t.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||t.safeAttrValue,this.options=e}return g.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var v=this,u=v.options,T=u.whiteList,k=u.onAttr,x=u.onIgnoreAttr,r=u.safeAttrValue,f=n(e,function(a,y,S,c,I){var p=T[S],d=!1;if(p===!0?d=p:typeof p=="function"?d=p(c):p instanceof RegExp&&(d=p.test(c)),d!==!0&&(d=!1),c=r(S,c),!!c){var C={position:y,sourcePosition:a,source:I,isWhite:d};if(d){var m=k(S,c,C);return i(m)?S+":"+c:m}else{var m=x(S,c,C);if(!i(m))return m}}});return f},K=g,K}var fe;function te(){return fe||(fe=1,(function(t,n){var i=be(),s=Oe();function g(v,u){var T=new s(u);return T.process(v)}n=t.exports=g,n.FilterCSS=s;for(var e in i)n[e]=i[e];typeof window<"u"&&(window.filterCSS=t.exports)})(B,B.exports)),B.exports}var Y,ue;function ae(){return ue||(ue=1,Y={indexOf:function(t,n){var i,s;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,s=t.length;i<s;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var s,g;if(Array.prototype.forEach)return t.forEach(n,i);for(s=0,g=t.length;s<g;s++)n.call(i,t[s],s,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var n=/\s|\n|\t/,i=n.exec(t);return i?i.index:-1}}),Y}var ce;function we(){if(ce)return w;ce=1;var t=te().FilterCSS,n=te().getDefaultWhiteList,i=ae();function s(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var g=new t;function e(o,b,l){}function v(o,b,l){}function u(o,b,l){}function T(o,b,l){}function k(o){return o.replace(r,"&lt;").replace(f,"&gt;")}function x(o,b,l,h){if(l=$(l),b==="href"||b==="src"){if(l=i.trim(l),l==="#")return"#";if(!(l.substr(0,7)==="http://"||l.substr(0,8)==="https://"||l.substr(0,7)==="mailto:"||l.substr(0,4)==="tel:"||l.substr(0,11)==="data:image/"||l.substr(0,6)==="ftp://"||l.substr(0,2)==="./"||l.substr(0,3)==="../"||l[0]==="#"||l[0]==="/"))return""}else if(b==="background"){if(p.lastIndex=0,p.test(l))return""}else if(b==="style"){if(d.lastIndex=0,d.test(l)||(C.lastIndex=0,C.test(l)&&(p.lastIndex=0,p.test(l))))return"";h!==!1&&(h=h||g,l=h.process(l))}return l=P(l),l}var r=/</g,f=/>/g,a=/"/g,y=/&quot;/g,S=/&#([a-zA-Z0-9]*);?/gim,c=/&colon;?/gim,I=/&newline;?/gim,p=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,d=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,C=/u\s*r\s*l\s*\(.*/gi;function m(o){return o.replace(a,"&quot;")}function A(o){return o.replace(y,'"')}function E(o){return o.replace(S,function(l,h){return h[0]==="x"||h[0]==="X"?String.fromCharCode(parseInt(h.substr(1),16)):String.fromCharCode(parseInt(h,10))})}function _(o){return o.replace(c,":").replace(I," ")}function D(o){for(var b="",l=0,h=o.length;l<h;l++)b+=o.charCodeAt(l)<32?" ":o.charAt(l);return i.trim(b)}function $(o){return o=A(o),o=E(o),o=_(o),o=D(o),o}function P(o){return o=m(o),o=k(o),o}function R(){return""}function j(o,b){typeof b!="function"&&(b=function(){});var l=!Array.isArray(o);function h(L){return l?!0:i.indexOf(o,L)!==-1}var q=[],O=!1;return{onIgnoreTag:function(L,M,N){if(h(L))if(N.isClosing){var U="[/removed]",Ae=N.position+U.length;return q.push([O!==!1?O:N.position,Ae]),O=!1,U}else return O||(O=N.position),"[removed]";else return b(L,M,N)},remove:function(L){var M="",N=0;return i.forEach(q,function(U){M+=L.slice(N,U[0]),N=U[1]}),M+=L.slice(N),M}}}function V(o){for(var b="",l=0;l<o.length;){var h=o.indexOf("<!--",l);if(h===-1){b+=o.slice(l);break}b+=o.slice(l,h);var q=o.indexOf("-->",h);if(q===-1)break;l=q+3}return b}function F(o){var b=o.split("");return b=b.filter(function(l){var h=l.charCodeAt(0);return h===127?!1:h<=31?h===10||h===13:!0}),b.join("")}return w.whiteList=s(),w.getDefaultWhiteList=s,w.onTag=e,w.onIgnoreTag=v,w.onTagAttr=u,w.onIgnoreTagAttr=T,w.safeAttrValue=x,w.escapeHtml=k,w.escapeQuote=m,w.unescapeQuote=A,w.escapeHtmlEntities=E,w.escapeDangerHtml5Entities=_,w.clearNonPrintableCharacter=D,w.friendlyAttrValue=$,w.escapeAttrValue=P,w.onIgnoreTagStripAll=R,w.StripTagBody=j,w.stripCommentTag=V,w.stripBlankChar=F,w.attributeWrapSign='"',w.cssFilter=g,w.getDefaultCSSWhiteList=n,w}var H={},ge;function ye(){if(ge)return H;ge=1;var t=ae();function n(r){var f=t.spaceIndex(r),a;return f===-1?a=r.slice(1,-1):a=r.slice(1,f+1),a=t.trim(a).toLowerCase(),a.slice(0,1)==="/"&&(a=a.slice(1)),a.slice(-1)==="/"&&(a=a.slice(0,-1)),a}function i(r){return r.slice(0,2)==="</"}function s(r,f,a){var y="",S=0,c=!1,I=!1,p=0,d=r.length,C="",m="";e:for(p=0;p<d;p++){var A=r.charAt(p);if(c===!1){if(A==="<"){c=p;continue}}else if(I===!1){if(A==="<"){y+=a(r.slice(S,p)),c=p,S=p;continue}if(A===">"||p===d-1){y+=a(r.slice(S,c)),m=r.slice(c,p+1),C=n(m),y+=f(c,y.length,C,m,i(m)),S=p+1,c=!1;continue}if(A==='"'||A==="'")for(var E=1,_=r.charAt(p-E);_.trim()===""||_==="=";){if(_==="="){I=A;continue e}_=r.charAt(p-++E)}}else if(A===I){I=!1;continue}}return S<d&&(y+=a(r.substr(S))),y}var g=/[^a-zA-Z0-9\\_:.-]/gim;function e(r,f){var a=0,y=0,S=[],c=!1,I=r.length;function p(E,_){if(E=t.trim(E),E=E.replace(g,"").toLowerCase(),!(E.length<1)){var D=f(E,_||"");D&&S.push(D)}}for(var d=0;d<I;d++){var C=r.charAt(d),m,A;if(c===!1&&C==="="){c=r.slice(a,d),a=d+1,y=r.charAt(a)==='"'||r.charAt(a)==="'"?a:u(r,d+1);continue}if(c!==!1&&d===y){if(A=r.indexOf(C,d+1),A===-1)break;m=t.trim(r.slice(y+1,A)),p(c,m),c=!1,d=A,a=d+1;continue}if(/\s|\n|\t/.test(C))if(r=r.replace(/\s|\n|\t/g," "),c===!1)if(A=v(r,d),A===-1){m=t.trim(r.slice(a,d)),p(m),c=!1,a=d+1;continue}else{d=A-1;continue}else if(A=T(r,d-1),A===-1){m=t.trim(r.slice(a,d)),m=x(m),p(c,m),c=!1,a=d+1;continue}else continue}return a<r.length&&(c===!1?p(r.slice(a)):p(c,x(t.trim(r.slice(a))))),t.trim(S.join(" "))}function v(r,f){for(;f<r.length;f++){var a=r[f];if(a!==" ")return a==="="?f:-1}}function u(r,f){for(;f<r.length;f++){var a=r[f];if(a!==" ")return a==="'"||a==='"'?f:-1}}function T(r,f){for(;f>0;f--){var a=r[f];if(a!==" ")return a==="="?f:-1}}function k(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'"}function x(r){return k(r)?r.substr(1,r.length-2):r}return H.parseTag=s,H.parseAttr=e,H}var ee,de;function Ne(){if(de)return ee;de=1;var t=te().FilterCSS,n=we(),i=ye(),s=i.parseTag,g=i.parseAttr,e=ae();function v(r){return r==null}function u(r){var f=e.spaceIndex(r);if(f===-1)return{html:"",closing:r[r.length-2]==="/"};r=e.trim(r.slice(f+1,-1));var a=r[r.length-1]==="/";return a&&(r=e.trim(r.slice(0,-1))),{html:r,closing:a}}function T(r){var f={};for(var a in r)f[a]=r[a];return f}function k(r){var f={};for(var a in r)Array.isArray(r[a])?f[a.toLowerCase()]=r[a].map(function(y){return y.toLowerCase()}):f[a.toLowerCase()]=r[a];return f}function x(r){r=T(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=n.onIgnoreTagStripAll),r.whiteList||r.allowList?r.whiteList=k(r.whiteList||r.allowList):r.whiteList=n.whiteList,this.attributeWrapSign=r.singleQuotedAttributeValue===!0?"'":n.attributeWrapSign,r.onTag=r.onTag||n.onTag,r.onTagAttr=r.onTagAttr||n.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||n.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||n.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||n.safeAttrValue,r.escapeHtml=r.escapeHtml||n.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new t(r.css))}return x.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var f=this,a=f.options,y=a.whiteList,S=a.onTag,c=a.onIgnoreTag,I=a.onTagAttr,p=a.onIgnoreTagAttr,d=a.safeAttrValue,C=a.escapeHtml,m=f.attributeWrapSign,A=f.cssFilter;a.stripBlankChar&&(r=n.stripBlankChar(r)),a.allowCommentTag||(r=n.stripCommentTag(r));var E=!1;a.stripIgnoreTagBody&&(E=n.StripTagBody(a.stripIgnoreTagBody,c),c=E.onIgnoreTag);var _=s(r,function(D,$,P,R,j){var V={sourcePosition:D,position:$,isClosing:j,isWhite:Object.prototype.hasOwnProperty.call(y,P)},F=S(P,R,V);if(!v(F))return F;if(V.isWhite){if(V.isClosing)return"</"+P+">";var o=u(R),b=y[P],l=g(o.html,function(h,q){var O=e.indexOf(b,h)!==-1,L=I(P,h,q,O);return v(L)?O?(q=d(P,h,q,A),q?h+"="+m+q+m:h):(L=p(P,h,q,O),v(L)?void 0:L):L});return R="<"+P,l&&(R+=" "+l),o.closing&&(R+=" /"),R+=">",R}else return F=c(P,R,V),v(F)?C(R):F},C);return E&&(_=E.remove(_)),_},ee=x,ee}var pe;function De(){return pe||(pe=1,(function(t,n){var i=we(),s=ye(),g=Ne();function e(u,T){var k=new g(T);return k.process(u)}n=t.exports=e,n.filterXSS=e,n.FilterXSS=g,(function(){for(var u in i)n[u]=i[u];for(var T in s)n[T]=s[T]})(),typeof window<"u"&&(window.filterXSS=t.exports);function v(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}v()&&(self.filterXSS=t.exports)})(z,z.exports)),z.exports}var G=De();const Fe=qe(G),We=Ie({__proto__:null,default:Fe},[G]),ve={img:["class"],input:["class","disabled","type","checked"],iframe:["class","width","height","src","title","border","frameborder","framespacing","allow","allowfullscreen"]},Xe=(t,n)=>{const{extendedWhiteList:i={},xss:s={}}=n;let g;if(typeof s=="function")g=new G.FilterXSS(s(We));else{const e=G.getDefaultWhiteList();[...Object.keys(i),...Object.keys(ve)].forEach(u=>{const T=e[u]||[],k=ve[u]||[],x=i[u]||[];e[u]=[...new Set([...T,...k,...x])]}),g=new G.FilterXSS({whiteList:e,...s})}t.core.ruler.after("linkify","xss",e=>{for(let v=0;v<e.tokens.length;v++){const u=e.tokens[v];switch(u.type){case"html_block":{u.content=g.process(u.content);break}case"inline":{(u.children||[]).forEach(k=>{k.type==="html_inline"&&(k.content=g.process(k.content))});break}}}})},Ve=()=>{Object.keys(re.CDN_IDS).forEach(t=>{const n=document.getElementById(re.CDN_IDS[t]);n&&n.remove()})};exports.MdEditor=Te;exports.NormalToolbar=Se;exports.DropdownToolbar=ke.DropdownToolbar;exports.ModalToolbar=xe;exports.MdModal=Ee.MdModal;exports.StrIcon=Ce.StrIcon;exports.allFooter=X.allFooter;exports.allToolbar=X.allToolbar;exports.config=X.config;exports.editorExtensionsAttrs=X.editorExtensionsAttrs;exports.prefix=X.prefix;exports.MdPreview=re.MdPreview;exports.MdCatalog=Le.MdCatalog;exports.en_US=he.en_US;exports.zh_CN=he.zh_CN;exports.NormalFooterToolbar=Q;exports.XSSPlugin=Xe;exports.clearSideEffects=Ve;