!function(){"use strict";functionn(t){returnfunction(n){returntypeofn===t}}functioni(n){returnfunction(){returnn}}functiont(n){returnn}functione(){returnl}varo,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n){returne=typeof(t=n),(null===t?"null":"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e)===o;vart,e},c=n("boolean"),a=n("number"),s=i(!(o="string")),f=i(!0),l={fold:function(n,t){returnn()},isSome:s,isNone:f,getOr:t,getOrThunk:d,getOrDie:function(n){thrownewError(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void0),or:t,orThunk:d,map:e,each:function(){},bind:e,exists:s,forall:f,filter:function(){returnl},toArray:function(){return[]},toString:i("none()")};functiond(n){returnn()}functionm(n,t){for(vare=0,o=n.length;e<o;e++)t(n[e],e)}functionv(n,t){for(vare=h(n),o=0,r=e.length;o<r;o++){vari=e[o];t(n[i],i)}}varg=function(e){functionn(){returnr}functiont(n){returnn(e)}varo=i(e),r={fold:function(n,t){returnt(e)},isSome:f,isNone:s,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){returng(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){returnn(e)?r:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};returnr},h=Object.keys;functionp(n){returnn.dom.nodeValue}functiony(n,t,e){!function(n,t,e){if(!(u(e)||c(e)||a(e)))throwconsole.error("Invalid call to Attribute.set. Key ",t,":: Value ",e,":: Element ",n),newError("Attribute value was not simple");n.setAttribute(t,e+"")}(n.dom,t,e)}functionb(n,t){n.dom.removeAttribute(t)}functionw(n,t){vare,o=null===(e=n.dom.getAttribute(t))?void0:e;returnvoid0===o||""===o?[]:o.split(" ")}functionT(n){returnvoid0!==n.dom.classList}functionk(n,t){returni=t,0<(o=function(n){for(vart=[],e=0,o=n.length;e<o;e++){varr=n[e];r!==i&&t.push(r)}returnt}(w(e=n,"class"))).length?y(e,"class",o.join(" ")):b(e,"class"),0;vare,i,o}functionN(n,t){vare="";returnv(n,function(n,t){e+=t}),newRegExp("["+e+"]",t?"g":"")}functionA(n){return'<span data-mce-bogus="1" class="mce-'+H[n]+'">'+n+"</span>"}functionO(n){vart=p(n);returnj(n)&&void0!==t&&_.test(t)}functionC(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")}functionS(f,n){m(K(M.fromDom(n),O),function(n){vart,e,o,r,i,u=n.dom.parentNode;if(C(u))t=M.fromDom(u),e=U,T(t)?t.dom.classList.add(e):(r=e,i=w(o=t,"class").concat([r]),y(o,"class",i.join(" ")));else{for(varc,a=f.dom.encode(p(n)).replace(F,A),s=f.dom.create("div",null,a);c=s.lastChild;)f.dom.insertAfter(c,n.dom);f.dom.remove(n.dom)}})}functionD(r,n){m(r.dom.select(I,n),function(n){vart,e,o;C(n)?(t=M.fromDom(n),e=U,T(t)?t.dom.classList.remove(e):k(t,e),0===(T(o=t)?o.dom.classList:w(o,"class")).length&&b(o,"class")):r.dom.remove(n,!0)})}functionE(n){vart=n.getBody(),e=n.selection.getBookmark(),o=function(n,t){for(;n.parentNode;){if(n.parentNode===t)returnn;n=n.parentNode}}(n.selection.getNode(),t);D(n,o=void0!==o?o:t),S(n,o),n.selection.moveToBookmark(e)}functionL(n,t){vare=n,o=t.get();e.fire("VisualChars",{state:o});varr=n.getBody();(!0===t.get()?S:D)(n,r)}functionx(n,t){n.addCommand("mceVisualChars",function(){!function(n,t){t.set(!t.get());vare=n.selection.getBookmark();L(n,t),n.selection.moveToBookmark(e)}(n,t)})}functionB(e,o){returnfunction(t){functionn(n){returnt.setActive(n.state)}returnt.setActive(o.get()),e.on("VisualChars",n),function(){returne.off("VisualChars",n)}}}"undefined"!=typeofwindow||Function("return this;")();functionP(n){if(null==n)thrownewError("Node cannot be null or undefined");return{dom:n}}varV,j=function(n){return3===n.dom.nodeType},M={fromHtml:function(n,t){vare=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throwconsole.error("HTML does not have a single root node",n),newError("HTML must have a single root node");returnP(e