UNPKG

md-editor-rt

Version:

Markdown editor for react, 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 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("./chunks/Editor.cjs"),Ae=require("./NormalToolbar.cjs"),Te=require("./DropdownToolbar.cjs"),ke=require("./ModalToolbar.cjs"),xe=require("./chunks/index.cjs"),Se=require("./chunks/dom.cjs"),Ee=require("react/jsx-runtime"),X=require("./chunks/config.cjs"),_e=require("./chunks/index2.cjs"),Ce=require("./MdPreview.cjs"),Le=require("./chunks/index3.cjs"),pe=require("./config.cjs"),te=require("./chunks/hooks.cjs");function Ie(t,n){for(var i=0;i<n.length;i++){const l=n[i];if(typeof l!="string"&&!Array.isArray(l)){for(const g in l)if(g!=="default"&&!(g in t)){const e=Object.getOwnPropertyDescriptor(l,g);e&&Object.defineProperty(t,g,e.get?e:{enumerable:!0,get:()=>l[g]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const qe=t=>Ee.jsx("div",{className:_e.classnames([`${X.prefix}-footer-item`,t.disabled&&`${X.prefix}-disabled`]),onClick:n=>{t.disabled||t.onClick?.(n)},children:t.children});function Pe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={exports:{}},w={},B={exports:{}},F={},ae;function ve(){if(ae)return F;ae=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 l=/javascript\s*\:/img;function g(e,v){return l.test(v)?"":v}return F.whiteList=t(),F.getDefaultWhiteList=t,F.onAttr=n,F.onIgnoreAttr=i,F.safeAttrValue=g,F}var Q,ie;function he(){return ie||(ie=1,Q={indexOf:function(t,n){var i,l;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,l=t.length;i<l;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var l,g;if(Array.prototype.forEach)return t.forEach(n,i);for(l=0,g=t.length;l<g;l++)n.call(i,t[l],l,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,"")}}),Q}var Z,ne;function Re(){if(ne)return Z;ne=1;var t=he();function n(i,l){i=t.trimRight(i),i[i.length-1]!==";"&&(i+=";");var g=i.length,e=!1,v=0,u=0,T="";function x(){if(!e){var f=t.trim(i.slice(v,u)),a=f.indexOf(":");if(a!==-1){var y=t.trim(f.slice(0,a)),k=t.trim(f.slice(a+1));if(y){var c=l(v,T.length,y,k,f);c&&(T+=c+"; ")}}}v=u+1}for(;u<g;u++){var S=i[u];if(S==="/"&&i[u+1]==="*"){var r=i.indexOf("*/",u+2);if(r===-1)break;u=r+1,v=u+1,e=!1}else S==="("?e=!0:S===")"?e=!1:S===";"?e||x():S===` `&&x()}return t.trim(T)}return Z=n,Z}var J,se;function Oe(){if(se)return J;se=1;var t=ve(),n=Re();he();function i(e){return e==null}function l(e){var v={};for(var u in e)v[u]=e[u];return v}function g(e){e=l(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,x=u.onAttr,S=u.onIgnoreAttr,r=u.safeAttrValue,f=n(e,function(a,y,k,c,I){var p=T[k],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(k,c),!!c){var _={position:y,sourcePosition:a,source:I,isWhite:d};if(d){var m=x(k,c,_);return i(m)?k+":"+c:m}else{var m=S(k,c,_);if(!i(m))return m}}});return f},J=g,J}var oe;function ee(){return oe||(oe=1,(function(t,n){var i=ve(),l=Oe();function g(v,u){var T=new l(u);return T.process(v)}n=t.exports=g,n.FilterCSS=l;for(var e in i)n[e]=i[e];typeof window<"u"&&(window.filterCSS=t.exports)})(B,B.exports)),B.exports}var K,le;function re(){return le||(le=1,K={indexOf:function(t,n){var i,l;if(Array.prototype.indexOf)return t.indexOf(n);for(i=0,l=t.length;i<l;i++)if(t[i]===n)return i;return-1},forEach:function(t,n,i){var l,g;if(Array.prototype.forEach)return t.forEach(n,i);for(l=0,g=t.length;l<g;l++)n.call(i,t[l],l,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}}),K}var fe;function be(){if(fe)return w;fe=1;var t=ee().FilterCSS,n=ee().getDefaultWhiteList,i=re();function l(){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(s,b,o){}function v(s,b,o){}function u(s,b,o){}function T(s,b,o){}function x(s){return s.replace(r,"&lt;").replace(f,"&gt;")}function S(s,b,o,h){if(o=G(o),b==="href"||b==="src"){if(o=i.trim(o),o==="#")return"#";if(!(o.substr(0,7)==="http://"||o.substr(0,8)==="https://"||o.substr(0,7)==="mailto:"||o.substr(0,4)==="tel:"||o.substr(0,11)==="data:image/"||o.substr(0,6)==="ftp://"||o.substr(0,2)==="./"||o.substr(0,3)==="../"||o[0]==="#"||o[0]==="/"))return""}else if(b==="background"){if(p.lastIndex=0,p.test(o))return""}else if(b==="style"){if(d.lastIndex=0,d.test(o)||(_.lastIndex=0,_.test(o)&&(p.lastIndex=0,p.test(o))))return"";h!==!1&&(h=h||g,o=h.process(o))}return o=q(o),o}var r=/</g,f=/>/g,a=/"/g,y=/&quot;/g,k=/&#([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,_=/u\s*r\s*l\s*\(.*/gi;function m(s){return s.replace(a,"&quot;")}function A(s){return s.replace(y,'"')}function E(s){return s.replace(k,function(o,h){return h[0]==="x"||h[0]==="X"?String.fromCharCode(parseInt(h.substr(1),16)):String.fromCharCode(parseInt(h,10))})}function C(s){return s.replace(c,":").replace(I," ")}function W(s){for(var b="",o=0,h=s.length;o<h;o++)b+=s.charCodeAt(o)<32?" ":s.charAt(o);return i.trim(b)}function G(s){return s=A(s),s=E(s),s=C(s),s=W(s),s}function q(s){return s=m(s),s=x(s),s}function R(){return""}function H(s,b){typeof b!="function"&&(b=function(){});var o=!Array.isArray(s);function h(L){return o?!0:i.indexOf(s,L)!==-1}var P=[],O=!1;return{onIgnoreTag:function(L,M,N){if(h(L))if(N.isClosing){var U="[/removed]",we=N.position+U.length;return P.push([O!==!1?O:N.position,we]),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(P,function(U){M+=L.slice(N,U[0]),N=U[1]}),M+=L.slice(N),M}}}function V(s){for(var b="",o=0;o<s.length;){var h=s.indexOf("<!--",o);if(h===-1){b+=s.slice(o);break}b+=s.slice(o,h);var P=s.indexOf("-->",h);if(P===-1)break;o=P+3}return b}function D(s){var b=s.split("");return b=b.filter(function(o){var h=o.charCodeAt(0);return h===127?!1:h<=31?h===10||h===13:!0}),b.join("")}return w.whiteList=l(),w.getDefaultWhiteList=l,w.onTag=e,w.onIgnoreTag=v,w.onTagAttr=u,w.onIgnoreTagAttr=T,w.safeAttrValue=S,w.escapeHtml=x,w.escapeQuote=m,w.unescapeQuote=A,w.escapeHtmlEntities=E,w.escapeDangerHtml5Entities=C,w.clearNonPrintableCharacter=W,w.friendlyAttrValue=G,w.escapeAttrValue=q,w.onIgnoreTagStripAll=R,w.StripTagBody=H,w.stripCommentTag=V,w.stripBlankChar=D,w.attributeWrapSign='"',w.cssFilter=g,w.getDefaultCSSWhiteList=n,w}var j={},ue;function me(){if(ue)return j;ue=1;var t=re();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 l(r,f,a){var y="",k=0,c=!1,I=!1,p=0,d=r.length,_="",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(k,p)),c=p,k=p;continue}if(A===">"||p===d-1){y+=a(r.slice(k,c)),m=r.slice(c,p+1),_=n(m),y+=f(c,y.length,_,m,i(m)),k=p+1,c=!1;continue}if(A==='"'||A==="'")for(var E=1,C=r.charAt(p-E);C.trim()===""||C==="=";){if(C==="="){I=A;continue e}C=r.charAt(p-++E)}}else if(A===I){I=!1;continue}}return k<d&&(y+=a(r.substr(k))),y}var g=/[^a-zA-Z0-9\\_:.-]/gim;function e(r,f){var a=0,y=0,k=[],c=!1,I=r.length;function p(E,C){if(E=t.trim(E),E=E.replace(g,"").toLowerCase(),!(E.length<1)){var W=f(E,C||"");W&&k.push(W)}}for(var d=0;d<I;d++){var _=r.charAt(d),m,A;if(c===!1&&_==="="){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(_,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(_))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=S(m),p(c,m),c=!1,a=d+1;continue}else continue}return a<r.length&&(c===!1?p(r.slice(a)):p(c,S(t.trim(r.slice(a))))),t.trim(k.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 x(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'"}function S(r){return x(r)?r.substr(1,r.length-2):r}return j.parseTag=l,j.parseAttr=e,j}var Y,ce;function Ne(){if(ce)return Y;ce=1;var t=ee().FilterCSS,n=be(),i=me(),l=i.parseTag,g=i.parseAttr,e=re();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 x(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 S(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=x(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 S.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var f=this,a=f.options,y=a.whiteList,k=a.onTag,c=a.onIgnoreTag,I=a.onTagAttr,p=a.onIgnoreTagAttr,d=a.safeAttrValue,_=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 C=l(r,function(W,G,q,R,H){var V={sourcePosition:W,position:G,isClosing:H,isWhite:Object.prototype.hasOwnProperty.call(y,q)},D=k(q,R,V);if(!v(D))return D;if(V.isWhite){if(V.isClosing)return"</"+q+">";var s=u(R),b=y[q],o=g(s.html,function(h,P){var O=e.indexOf(b,h)!==-1,L=I(q,h,P,O);return v(L)?O?(P=d(q,h,P,A),P?h+"="+m+P+m:h):(L=p(q,h,P,O),v(L)?void 0:L):L});return R="<"+q,o&&(R+=" "+o),s.closing&&(R+=" /"),R+=">",R}else return D=c(q,R,V),v(D)?_(R):D},_);return E&&(C=E.remove(C)),C},Y=S,Y}var ge;function We(){return ge||(ge=1,(function(t,n){var i=be(),l=me(),g=Ne();function e(u,T){var x=new g(T);return x.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 l)n[T]=l[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 $=We();const De=Pe($),Fe=Ie({__proto__:null,default:De},[$]),de={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:l={}}=n;let g;if(typeof l=="function")g=new $.FilterXSS(l(Fe));else{const e=$.getDefaultWhiteList();[...Object.keys(i),...Object.keys(de)].forEach(u=>{const T=e[u]||[],x=de[u]||[],S=i[u]||[];e[u]=[...new Set([...T,...x,...S])]}),g=new $.FilterXSS({whiteList:e,...l})}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(x=>{x.type==="html_inline"&&(x.content=g.process(x.content))});break}}}})},Ve=()=>{Object.keys(te.CDN_IDS).forEach(t=>{const n=document.getElementById(te.CDN_IDS[t]);n&&n.remove()})};exports.MdEditor=ye.Editor;exports.NormalToolbar=Ae;exports.DropdownToolbar=Te;exports.ModalToolbar=ke;exports.MdModal=xe.Modal;exports.StrIcon=Se.StrIcon;exports.allFooter=X.allFooter;exports.allToolbar=X.allToolbar;exports.config=X.config;exports.editorExtensionsAttrs=X.editorExtensionsAttrs;exports.prefix=X.prefix;exports.MdPreview=Ce;exports.MdCatalog=Le.MdCatalog;exports.en_US=pe.en_US;exports.zh_CN=pe.zh_CN;exports.NormalFooterToolbar=qe;exports.XSSPlugin=Xe;exports.clearSideEffects=Ve;