!function(r){"use strict";varn,e,t,o,i,u,c=function(n){vare=n,t=function(){returne};return{get:t,set:function(n){e=n},clone:function(){returnc(t())}}},a=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=function(n){return{isEnabled:function(){returnn.get()}}},d=function(n,e){returnn.fire("VisualChars",{state:e})},s=function(){},l=function(n){returnfunction(){returnn}},m=l(!1),N=l(!0),g=function(){returnE},E=(n=function(n){returnn.isNone()},o={fold:function(n,e){returnn()},is:m,isSome:m,isNone:N,getOr:t=function(n){returnn},getOrThunk:e=function(n){returnn()},getOrDie:function(n){thrownewError(n||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:t,orThunk:e,map:g,each:s,bind:g,exists:m,forall:N,filter:g,equals:n,equals_:n,toArray:function(){return[]},toString:l("none()")},Object.freeze&&Object.freeze(o),o),h=function(t){varn=l(t),e=function(){returno},r=function(n){returnn(t)},o={fold:function(n,e){returne(t)},is:function(n){returnt===n},isSome:N,isNone:m,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){returnh(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){returnn(t)?o:E},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){returnn.is(t)},equals_:function(n,e){returnn.fold(m,function(n){returne(t,n)})}};returno},v=function(n){returnnull===n||n===undefined?E:h(n)},T=(i="function",function(n){returnfunction(n){if(null===n)return"null";vare=typeofn;return"object"===e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e}(n)===i}),p=(Array.prototype.slice,function(n,e){for(vart=0,r=n.length;t<r;t++)e(n[t],t)}),O=(T(Array.from)&&Array.from,function(n){if(null===n||n===undefined)thrownewError("Node cannot be null or undefined");return{dom:l(n)}}),y={fromHtml:function(n,e){vart=(e||r.document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throwr.console.error("HTML does not have a single root node",n),newError("HTML must have a single root node");returnO(t.childNodes[0])},fromTag:function(n,e){vart=(e||r.document).createElement(n);returnO(t)},fromText:function(n,e){vart=(e||r.document).createTextNode(n);returnO(t)},fromDom:O,fromPoint:function(n,e,t){varr=n.dom();returnv(r.elementFromPoint(e,t)).map(O)}},D=(r.Node.ATTRIBUTE_NODE,r.Node.CDATA_SECTION_NODE,r.Node.COMMENT_NODE,r.Node.DOCUMENT_NODE,r.Node.DOCUMENT_TYPE_NODE,r.Node.DOCUMENT_FRAGMENT_NODE,r.Node.ELEMENT_NODE,r.Node.TEXT_NODE),_=(r.Node.PROCESSING_INSTRUCTION_NODE,r.Node.ENTITY_REFERENCE_NODE,r.Node.ENTITY_NODE,r.Node.NOTATION_NODE,"undefined"!=typeofr.window?r.window:Function("return this;")(),function(n){returnn.dom().nodeValue}),C=(u=D,function(n){returnn.dom().nodeType===u}),w={"\xa0":"nbsp","\xad":"shy"},M=function(n,e){vart,r="";for(tinn)r+=t;returnnewRegExp("["+r+"]",e?"g":"")},b=function(n){vare,t="";for(einn)t&&(t+=","),t+="span.mce-"+n[e];returnt},k={charMap:w,regExp:M(w),regExpGlobal:M(w,!0),selector:b(w),charMapToRegExp:M,charMapToSelector:b},S=function(n){return'<span data-mce-bogus="1" class="mce-'+k.charMap[n]+'">'+n+"</span>"},A=function(n,e){vart=[],r=function(n,e){for(vart=n.length,r=newArray(t),o=0;o<t;o++){vari=n[o];r[o]=e(i,o)}returnr}(n.dom().childNodes,y.fromDom);returnp(r,function(n){e(n)&&(t=t.concat([n])),t=t.concat(A(n,e))}),t},x={isMatch:function(n){vare=_(n);returnC(n)&&e!==undefined&&k.regExp.test(e)},filterDescendants:A,findParentElm:function(n,e){for(;n.parentNode;){if(n.parentNode===e)returnn;n=n.parentNode}},replaceWithSpans:function(n){returnn.replace(k.regExpGlobal,S)}},P=function(t,n){varr,o,e=x.filterDescendants(y.fromDom(n),x.isMatch);p(e,function(n){vare=x.replaceWithSpans(t.dom.encode(_(n)));for(o=t.dom.create("div",null,e);r=o.lastChild;)t.dom.insertAfter(r,n.dom());t.dom.remove(n.dom())})},R=function(e,n){vart=e.dom.select(k.selector,n);p(t,f