/** * TinyMCE version 6.7.0 (2023-08-30) */ !function(){"use strict";var e=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},n=t((function(e,t){return e===t})),o=function(e){return t((function(t,n){if(t.length!==n.length)return!1;for(var o=t.length,r=0;r{var o;return!!n(e,t.prototype)||(null===(o=e.constructor)||void 0===o?void 0:o.name)===t.name},l=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&i(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,d=e=>t=>typeof t===e,c=e=>t=>e===t,u=(e,t)=>f(e)&&i(e,t,((e,t)=>a(e)===t)),m=l("string"),f=l("object"),g=e=>u(e,Object),p=l("array"),h=c(null),b=d("boolean"),v=c(void 0),y=e=>null==e,C=e=>!y(e),w=d("function"),x=d("number"),k=(e,t)=>{if(p(e)){for(let n=0,o=e.length;n{},S=(e,t)=>(...n)=>e(t.apply(null,n)),_=(e,t)=>n=>e(t(n)),N=e=>()=>e,R=e=>e,A=(e,t)=>e===t;function O(e,...t){return(...n)=>{const o=t.concat(n);return e.apply(null,o)}}const T=e=>t=>!e(t),B=e=>()=>{throw new Error(e)},D=e=>e(),P=e=>{e()},L=N(!1),M=N(!0);class I{constructor(e,t){this.tag=e,this.value=t}static some(e){return new I(!0,e)}static none(){return I.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?I.some(e(this.value)):I.none()}bind(e){return this.tag?e(this.value):I.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:I.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return C(e)?I.some(e):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const F=Array.prototype.slice,U=Array.prototype.indexOf,z=Array.prototype.push,j=(e,t)=>U.call(e,t),H=(e,t)=>j(e,t)>-1,$=(e,t)=>{for(let n=0,o=e.length;n{const n=e.length,o=new Array(n);for(let r=0;r{for(let n=0,o=e.length;n{for(let n=e.length-1;n>=0;n--)t(e[n],n)},K=(e,t)=>{const n=[],o=[];for(let r=0,s=e.length;r{const n=[];for(let o=0,r=e.length;o(W(e,((e,o)=>{n=t(n,e,o)})),n),X=(e,t,n)=>(q(e,((e,o)=>{n=t(n,e,o)})),n),Q=(e,t,n)=>{for(let o=0,r=e.length;oQ(e,t,L),Z=(e,t)=>{for(let n=0,o=e.length;n{const t=[];for(let n=0,o=e.length;nee(V(e,t)),ne=(e,t)=>{for(let n=0,o=e.length;n{const t=F.call(e,0);return t.reverse(),t},re=(e,t)=>G(e,(e=>!H(t,e))),se=(e,t)=>{const n={};for(let o=0,r=e.length;o{const n=F.call(e,0);return n.sort(t),n},ie=(e,t)=>t>=0&&tie(e,0),de=e=>ie(e,e.length-1),ce=w(Array.from)?Array.from:e=>F.call(e),ue=(e,t)=>{for(let n=0;n{const n=me(e);for(let o=0,r=n.length;ohe(e,((e,n)=>({k:n,v:t(e,n)}))),he=(e,t)=>{const n={};return ge(e,((e,o)=>{const r=t(e,o);n[r.k]=r.v})),n},be=e=>(t,n)=>{e[n]=t},ve=(e,t,n,o)=>{ge(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))},ye=(e,t)=>{const n={};return ve(e,t,be(n),E),n},Ce=(e,t)=>{const n=[];return ge(e,((e,o)=>{n.push(t(e,o))})),n},we=e=>Ce(e,R),xe=(e,t)=>ke(e,t)?I.from(e[t]):I.none(),ke=(e,t)=>fe.call(e,t),Ee=(e,t)=>ke(e,t)&&void 0!==e[t]&&null!==e[t],Se=e=>{const t={};return q(e,(e=>{t[e]={}})),me(t)},_e=e=>void 0!==e.length,Ne=Array.isArray,Re=(e,t,n)=>{if(!e)return!1;if(n=n||e,_e(e)){for(let o=0,r=e.length;o{const n=[];return Re(e,((o,r)=>{n.push(t(o,r,e))})),n},Oe=(e,t)=>{const n=[];return Re(e,((o,r)=>{t&&!t(o,r,e)||n.push(o)})),n},Te=(e,t,n,o)=>{let r=v(n)?e[0]:n;for(let n=0;n{for(let o=0,r=e.length;oe[e.length-1],Pe=e=>{let t,n=!1;return(...o)=>(n||(n=!0,t=e.apply(null,o)),t)},Le=()=>Me(0,0),Me=(e,t)=>({major:e,minor:t}),Ie={nu:Me,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?Le():((e,t)=>{const n=((e,t)=>{for(let n=0;nNumber(t.replace(n,"$"+e));return Me(o(1),o(2))})(e,n)},unknown:Le},Fe=(e,t)=>{const n=String(t).toLowerCase();return J(e,(e=>e.search(n)))},Ue=(e,t,n)=>""===t||e.length>=t.length&&e.substr(n,n+t.length)===t,ze=(e,t)=>He(e,t)?((e,t)=>e.substring(t))(e,t.length):e,je=(e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!v(o)||r+t.length<=o)},He=(e,t)=>Ue(e,t,0),$e=(e,t)=>Ue(e,t,e.length-t.length),Ve=e=>t=>t.replace(e,""),qe=Ve(/^\s+|\s+$/g),We=Ve(/^\s+/g),Ke=Ve(/\s+$/g),Ge=e=>e.length>0,Ye=e=>!Ge(e),Xe=(e,t=10)=>{const n=parseInt(e,t);return isNaN(n)?I.none():I.some(n)},Qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Je=e=>t=>je(t,e),Ze=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qe],search:e=>je(e,"chrome")&&!je(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>je(e,"msie")||je(e,"trident")},{name:"Opera",versionRegexes:[Qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Je("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Je("firefox")},{name:"Safari",versionRegexes:[Qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}],et=[{name:"Windows",search:Je("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>je(e,"iphone")||je(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Je("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Je("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Je("linux"),versionRegexes:[]},{name:"Solaris",search:Je("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Je("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Je("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],tt={browsers:N(Ze),oses:N(et)},nt="Edge",ot="Chromium",rt="Opera",st="Firefox",at="Safari",it=e=>{const t=e.current,n=e.version,o=e=>()=>t===e;return{current:t,version:n,isEdge:o(nt),isChromium:o(ot),isIE:o("IE"),isOpera:o(rt),isFirefox:o(st),isSafari:o(at)}},lt=()=>it({current:void 0,version:Ie.unknown()}),dt=it,ct=(N(nt),N(ot),N("IE"),N(rt),N(st),N(at),"Windows"),ut="Android",mt="Linux",ft="macOS",gt="Solaris",pt="FreeBSD",ht="ChromeOS",bt=e=>{const t=e.current,n=e.version,o=e=>()=>t===e;return{current:t,version:n,isWindows:o(ct),isiOS:o("iOS"),isAndroid:o(ut),isMacOS:o(ft),isLinux:o(mt),isSolaris:o(gt),isFreeBSD:o(pt),isChromeOS:o(ht)}},vt=()=>bt({current:void 0,version:Ie.unknown()}),yt=bt,Ct=(N(ct),N("iOS"),N(ut),N(mt),N(ft),N(gt),N(pt),N(ht),e=>window.matchMedia(e).matches);let wt=Pe((()=>((e,t,n)=>{const o=tt.browsers(),r=tt.oses(),s=t.bind((e=>((e,t)=>ue(t.brands,(t=>{const n=t.brand.toLowerCase();return J(e,(e=>{var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Ie.nu(parseInt(t.version,10),0)})))})))(o,e))).orThunk((()=>((e,t)=>Fe(e,t).map((e=>{const n=Ie.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e))).fold(lt,dt),a=((e,t)=>Fe(e,t).map((e=>{const n=Ie.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e).fold(vt,yt),i=((e,t,n,o)=>{const r=e.isiOS()&&!0===/ipad/i.test(n),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||o("(pointer:coarse)"),l=r||!s&&a&&o("(min-device-width:768px)"),d=s||a&&!l,c=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),u=!d&&!l&&!c;return{isiPad:N(r),isiPhone:N(s),isTablet:N(l),isPhone:N(d),isTouch:N(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:N(c),isDesktop:N(u)}})(a,s,e,n);return{browser:s,os:a,deviceType:i}})(navigator.userAgent,I.from(navigator.userAgentData),Ct)));const xt=()=>wt(),kt=navigator.userAgent,Et=xt(),St=Et.browser,_t=Et.os,Nt=Et.deviceType,Rt=-1!==kt.indexOf("Windows Phone"),At={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:St.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!St.isIE(),windowsPhone:Rt,browser:{current:St.current,version:St.version,isChromium:St.isChromium,isEdge:St.isEdge,isFirefox:St.isFirefox,isIE:St.isIE,isOpera:St.isOpera,isSafari:St.isSafari},os:{current:_t.current,version:_t.version,isAndroid:_t.isAndroid,isChromeOS:_t.isChromeOS,isFreeBSD:_t.isFreeBSD,isiOS:_t.isiOS,isLinux:_t.isLinux,isMacOS:_t.isMacOS,isSolaris:_t.isSolaris,isWindows:_t.isWindows},deviceType:{isDesktop:Nt.isDesktop,isiPad:Nt.isiPad,isiPhone:Nt.isiPhone,isPhone:Nt.isPhone,isTablet:Nt.isTablet,isTouch:Nt.isTouch,isWebView:Nt.isWebView}},Ot=/^\s*|\s*$/g,Tt=e=>y(e)?"":(""+e).replace(Ot,""),Bt=function(e,t,n,o){o=o||this,e&&(n&&(e=e[n]),Re(e,((e,r)=>!1!==t.call(o,e,r,n)&&(Bt(e,t,n,o),!0))))},Dt={trim:Tt,isArray:Ne,is:(e,t)=>t?!("array"!==t||!Ne(e))||typeof e===t:void 0!==e,toArray:e=>{if(Ne(e))return e;{const t=[];for(let n=0,o=e.length;n{const o=m(e)?e.split(t||","):e||[];let r=o.length;for(;r--;)n[o[r]]={};return n},each:Re,map:Ae,grep:Oe,inArray:(e,t)=>{if(e)for(let n=0,o=e.length;n{for(let n=0;n{const n=e.split(".");for(let e=0,o=n.length;ep(e)?e:""===e?[]:Ae(e.split(t||","),Tt),_addCacheSuffix:e=>{const t=At.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Pt=(e,t,n=A)=>e.exists((e=>n(e,t))),Lt=(e,t,n=A)=>Mt(e,t,n).getOr(e.isNone()&&t.isNone()),Mt=(e,t,n)=>e.isSome()&&t.isSome()?I.some(n(e.getOrDie(),t.getOrDie())):I.none(),It=(e,t)=>e?I.some(t):I.none(),Ft="undefined"!=typeof window?window:Function("return this;")(),Ut=(e,t)=>((e,t)=>{let n=null!=t?t:Ft;for(let t=0;t{const t=Ut("ownerDocument.defaultView",e);return f(e)&&((e=>((e,t)=>{const n=((e,t)=>Ut(e,t))(e,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(zt(e).constructor.name))},Ht=e=>e.dom.nodeName.toLowerCase(),$t=e=>e.dom.nodeType,Vt=e=>t=>$t(t)===e,qt=e=>Wt(e)&&jt(e.dom),Wt=Vt(1),Kt=Vt(3),Gt=Vt(9),Yt=Vt(11),Xt=e=>t=>Wt(t)&&Ht(t)===e,Qt=(e,t,n)=>{if(!(m(n)||b(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Jt=(e,t,n)=>{Qt(e.dom,t,n)},Zt=(e,t)=>{const n=e.dom;ge(t,((e,t)=>{Qt(n,t,e)}))},en=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},tn=(e,t)=>I.from(en(e,t)),nn=(e,t)=>{const n=e.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},on=(e,t)=>{e.dom.removeAttribute(t)},rn=e=>X(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),sn=(e,t)=>{const n=en(e,t);return void 0===n||""===n?[]:n.split(" ")},an=e=>void 0!==e.dom.classList,ln=e=>sn(e,"class"),dn=(e,t)=>((e,t,n)=>{const o=sn(e,t).concat([n]);return Jt(e,t,o.join(" ")),!0})(e,"class",t),cn=(e,t)=>((e,t,n)=>{const o=G(sn(e,t),(e=>e!==n));return o.length>0?Jt(e,t,o.join(" ")):on(e,t),!1})(e,"class",t),un=(e,t)=>{an(e)?e.dom.classList.add(t):dn(e,t)},mn=e=>{0===(an(e)?e.dom.classList:ln(e)).length&&on(e,"class")},fn=(e,t)=>{an(e)?e.dom.classList.remove(t):cn(e,t),mn(e)},gn=(e,t)=>an(e)&&e.dom.classList.contains(t),pn=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},hn=(e,t)=>{const n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return pn(n.childNodes[0])},bn=(e,t)=>{const n=(t||document).createElement(e);return pn(n)},vn=(e,t)=>{const n=(t||document).createTextNode(e);return pn(n)},yn=pn,Cn=(e,t,n)=>I.from(e.dom.elementFromPoint(t,n)).map(pn),wn=(e,t)=>{const n=[],o=e=>(n.push(e),t(e));let r=t(e);do{r=r.bind(o)}while(r.isSome());return n},xn=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},kn=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,En=(e,t)=>e.dom===t.dom,Sn=(e,t)=>{const n=e.dom,o=t.dom;return n!==o&&n.contains(o)},_n=e=>yn(e.dom.ownerDocument),Nn=e=>Gt(e)?e:_n(e),Rn=e=>yn(Nn(e).dom.defaultView),An=e=>I.from(e.dom.parentNode).map(yn),On=e=>I.from(e.dom.parentElement).map(yn),Tn=(e,t)=>{const n=w(t)?t:L;let o=e.dom;const r=[];for(;null!==o.parentNode&&void 0!==o.parentNode;){const e=o.parentNode,t=yn(e);if(r.push(t),!0===n(t))break;o=e}return r},Bn=e=>I.from(e.dom.previousSibling).map(yn),Dn=e=>I.from(e.dom.nextSibling).map(yn),Pn=e=>oe(wn(e,Bn)),Ln=e=>wn(e,Dn),Mn=e=>V(e.dom.childNodes,yn),In=(e,t)=>{const n=e.dom.childNodes;return I.from(n[t]).map(yn)},Fn=e=>In(e,0),Un=e=>In(e,e.dom.childNodes.length-1),zn=e=>e.dom.childNodes.length,jn=e=>Yt(e)&&C(e.dom.host),Hn=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),$n=N(Hn),Vn=Hn?e=>yn(e.dom.getRootNode()):Nn,qn=e=>jn(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return yn(t)})(Nn(e)),Wn=e=>yn(e.dom.host),Kn=e=>{if($n()&&C(e.target)){const t=yn(e.target);if(Wt(t)&&Gn(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return le(t)}}return I.from(e.target)},Gn=e=>C(e.dom.shadowRoot),Yn=e=>{const t=Kt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=Vn(e);return jn(t)?I.some(t):I.none()})(yn(t)).fold((()=>n.body.contains(t)),_(Yn,Wn))};var Xn=(e,t,n,o,r)=>e(n,o)?I.some(n):w(r)&&r(n)?I.none():t(n,o,r);const Qn=(e,t,n)=>{let o=e.dom;const r=w(n)?n:L;for(;o.parentNode;){o=o.parentNode;const e=yn(o);if(t(e))return I.some(e);if(r(e))break}return I.none()},Jn=(e,t,n)=>Xn(((e,t)=>t(e)),Qn,e,t,n),Zn=(e,t,n)=>Qn(e,(e=>xn(e,t)),n),eo=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return kn(n)?I.none():I.from(n.querySelector(e)).map(yn)})(t,e),to=(e,t,n)=>Xn(((e,t)=>xn(e,t)),Zn,e,t,n),no=(e,t=!1)=>{return Yn(e)?e.dom.isContentEditable:(n=e,to(n,"[contenteditable]")).fold(N(t),(e=>"true"===oo(e)));var n},oo=e=>e.dom.contentEditable,ro=e=>void 0!==e.style&&w(e.style.getPropertyValue),so=(e,t,n)=>{if(!m(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);ro(e)&&e.style.setProperty(t,n)},ao=(e,t,n)=>{const o=e.dom;so(o,t,n)},io=(e,t)=>{const n=e.dom;ge(t,((e,t)=>{so(n,t,e)}))},lo=(e,t)=>{const n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||Yn(e)?o:co(n,t)},co=(e,t)=>ro(e)?e.style.getPropertyValue(t):"",uo=(e,t)=>{const n=e.dom,o=co(n,t);return I.from(o).filter((e=>e.length>0))},mo=e=>{const t={},n=e.dom;if(ro(n))for(let e=0;e{((e,t)=>{ro(e)&&e.style.removeProperty(t)})(e.dom,t),Pt(tn(e,"style").map(qe),"")&&on(e,"style")},go=(e,t)=>{An(e).each((n=>{n.dom.insertBefore(t.dom,e.dom)}))},po=(e,t)=>{Dn(e).fold((()=>{An(e).each((e=>{bo(e,t)}))}),(e=>{go(e,t)}))},ho=(e,t)=>{Fn(e).fold((()=>{bo(e,t)}),(n=>{e.dom.insertBefore(t.dom,n.dom)}))},bo=(e,t)=>{e.dom.appendChild(t.dom)},vo=(e,t)=>{go(e,t),bo(t,e)},yo=(e,t)=>{q(t,(t=>{bo(e,t)}))},Co=e=>{e.dom.textContent="",q(Mn(e),(e=>{wo(e)}))},wo=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},xo=e=>{const t=Mn(e);var n,o;t.length>0&&(n=e,q(o=t,((e,t)=>{const r=0===t?n:o[t-1];po(r,e)}))),wo(e)},ko=e=>V(e,yn),Eo=e=>e.dom.innerHTML,So=(e,t)=>{const n=_n(e).dom,o=yn(n.createDocumentFragment()),r=((e,t)=>{const n=(t||document).createElement("div");return n.innerHTML=e,Mn(yn(n))})(t,n);yo(o,r),Co(e),bo(e,o)},_o=(e,t,n,o)=>((e,t,n,o,r)=>{const s=((e,t)=>n=>{e(n)&&t((e=>{const t=yn(Kn(e).getOr(e.target)),n=()=>e.stopPropagation(),o=()=>e.preventDefault(),r=S(o,n);return((e,t,n,o,r,s,a)=>({target:e,x:t,y:n,stop:o,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,n,o,r,e)})(n))})(n,o);return e.dom.addEventListener(t,s,false),{unbind:O(No,e,t,s,false)}})(e,t,n,o),No=(e,t,n,o)=>{e.dom.removeEventListener(t,n,o)},Ro=(e,t)=>({left:e,top:t,translate:(n,o)=>Ro(e+n,t+o)}),Ao=Ro,Oo=(e,t)=>void 0!==e?e:void 0!==t?t:0,To=e=>{const t=e.dom,n=t.ownerDocument.body;return n===t?Ao(n.offsetLeft,n.offsetTop):Yn(e)?(e=>{const t=e.getBoundingClientRect();return Ao(t.left,t.top)})(t):Ao(0,0)},Bo=e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;return Ao(n,o)},Do=(e,t,n)=>{const o=(void 0!==n?n.dom:document).defaultView;o&&o.scrollTo(e,t)},Po=(e,t)=>{xt().browser.isSafari()&&w(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},Lo=(e,t,n,o)=>({x:e,y:t,width:n,height:o,right:e+n,bottom:t+o}),Mo=e=>{const t=void 0===e?window:e,n=t.document,o=Bo(yn(n));return(e=>{const t=void 0===e?window:e;return xt().browser.isFirefox()?I.none():I.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,n=e.clientWidth,r=e.clientHeight;return Lo(o.left,o.top,n,r)}),(e=>Lo(Math.max(e.pageLeft,o.left),Math.max(e.pageTop,o.top),e.width,e.height)))},Io=(e,t)=>{let n=[];return q(Mn(e),(e=>{t(e)&&(n=n.concat([e])),n=n.concat(Io(e,t))})),n},Fo=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return kn(n)?[]:V(n.querySelectorAll(e),yn)})(t,e),Uo=(e,t,n)=>Zn(e,t,n).isSome();class zo{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,n,o){if(e){if(!o&&e[t])return e[t];if(e!==this.rootNode){let t=e[n];if(t)return t;for(let o=e.parentNode;o&&o!==this.rootNode;o=o.parentNode)if(t=o[n],t)return t}}}findPreviousNode(e,t){if(e){const n=e.previousSibling;if(this.rootNode&&n===this.rootNode)return;if(n){if(!t)for(let e=n.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return n}const o=e.parentNode;if(o&&o!==this.rootNode)return o}}}const jo=e=>t=>!!t&&t.nodeType===e,Ho=e=>!!e&&!Object.getPrototypeOf(e),$o=jo(1),Vo=e=>{const t=e.toLowerCase();return e=>C(e)&&e.nodeName.toLowerCase()===t},qo=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const n=e.nodeName.toLowerCase();return H(t,n)}return!1}},Wo=(e,t)=>{const n=t.toLowerCase().split(" ");return t=>{if($o(t)){const o=t.ownerDocument.defaultView;if(o)for(let r=0;rt=>$o(t)&&t.hasAttribute(e),Go=e=>$o(e)&&e.hasAttribute("data-mce-bogus"),Yo=e=>$o(e)&&"TABLE"===e.tagName,Xo=e=>t=>{if($o(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},Qo=qo(["textarea","input"]),Jo=jo(3),Zo=jo(4),er=jo(7),tr=jo(8),nr=jo(9),or=jo(11),rr=Vo("br"),sr=Vo("img"),ar=Xo("true"),ir=Xo("false"),lr=qo(["td","th"]),dr=qo(["td","th","caption"]),cr=qo(["video","audio","object","embed"]),ur=Vo("li"),mr=Vo("details"),fr=Vo("summary"),gr="\ufeff",pr="\xa0",hr=e=>e===gr,br=((e,t)=>{const n=t=>e(t)?I.from(t.dom.nodeValue):I.none();return{get:t=>{if(!e(t))throw new Error("Can only get text value of a text node");return n(t).getOr("")},getOption:n,set:(t,n)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=n}}})(Kt),vr=e=>br.get(e),yr=e=>br.getOption(e),Cr=["pre"].concat(["h1","h2","h3","h4","h5","h6"]),wr=e=>{let t;return n=>(t=t||se(e,M),ke(t,Ht(n)))},xr=wr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),kr=e=>Wt(e)&&!xr(e),Er=e=>Wt(e)&&"br"===Ht(e),Sr=wr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),_r=wr(["ul","ol","dl"]),Nr=wr(["li","dd","dt"]),Rr=wr(["thead","tbody","tfoot"]),Ar=wr(["td","th"]),Or=wr(["pre","script","textarea","style"]),Tr=wr(Cr),Br=e=>Tr(e)||kr(e),Dr=()=>{const e=bn("br");return Jt(e,"data-mce-bogus","1"),e},Pr=e=>{Co(e),bo(e,Dr())},Lr=e=>{Un(e).each((t=>{Bn(t).each((n=>{xr(e)&&Er(t)&&xr(n)&&wo(t)}))}))},Mr=gr,Ir=hr,Fr=e=>e.replace(/\uFEFF/g,""),Ur=$o,zr=Jo,jr=e=>(zr(e)&&(e=e.parentNode),Ur(e)&&e.hasAttribute("data-mce-caret")),Hr=e=>zr(e)&&Ir(e.data),$r=e=>jr(e)||Hr(e),Vr=e=>e.firstChild!==e.lastChild||!rr(e.firstChild),qr=e=>{const t=e.container();return!!Jo(t)&&(t.data.charAt(e.offset())===Mr||e.isAtStart()&&Hr(t.previousSibling))},Wr=e=>{const t=e.container();return!!Jo(t)&&(t.data.charAt(e.offset()-1)===Mr||e.isAtEnd()&&Hr(t.nextSibling))},Kr=e=>zr(e)&&e.data[0]===Mr,Gr=e=>zr(e)&&e.data[e.data.length-1]===Mr,Yr=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const n=e.getElementsByTagName("br"),o=n[n.length-1];Go(o)&&(null===(t=o.parentNode)||void 0===t||t.removeChild(o))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,Xr=e=>jr(e.startContainer),Qr=ar,Jr=ir,Zr=rr,es=Jo,ts=qo(["script","style","textarea"]),ns=qo(["img","input","textarea","hr","iframe","video","audio","object","embed"]),os=qo(["table"]),rs=$r,ss=e=>!rs(e)&&(es(e)?!ts(e.parentNode):ns(e)||Zr(e)||os(e)||as(e)),as=e=>!(e=>$o(e)&&"true"===e.getAttribute("unselectable"))(e)&&Jr(e),is=(e,t)=>ss(e)&&((e,t)=>{for(let n=e.parentNode;n&&n!==t;n=n.parentNode){if(as(n))return!1;if(Qr(n))return!0}return!0})(e,t),ls=/^[ \t\r\n]*$/,ds=e=>ls.test(e),cs=e=>{for(const t of e)if(!hr(t))return!1;return!0},us=e=>"\n"===e||"\r"===e,ms=(e,t=4,n=!0,o=!0)=>{const r=((e,t)=>t<=0?"":new Array(t+1).join(" "))(0,t),s=e.replace(/\t/g,r),a=X(s,((e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===pr?e.pcIsSpace||""===e.str&&n||e.str.length===s.length-1&&o||((e,t)=>t=0&&us(e[t]))(s,e.str.length+1)?{pcIsSpace:!1,str:e.str+pr}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:us(t),str:e.str+t}),{pcIsSpace:!1,str:""});return a.str},fs=(e,t)=>ss(e)&&!((e,t)=>Jo(e)&&ds(e.data)&&!((e,t)=>{const n=yn(t),o=yn(e);return Uo(o,"pre,code",O(En,n))})(e,t))(e,t)||(e=>$o(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(e)||gs(e),gs=Ko("data-mce-bookmark"),ps=Ko("data-mce-bogus"),hs=("data-mce-bogus","all",e=>$o(e)&&"all"===e.getAttribute("data-mce-bogus"));const bs=(e,t=!0)=>((e,t)=>{let n=0;if(fs(e,e))return!1;{let o=e.firstChild;if(!o)return!0;const r=new zo(o,e);do{if(t){if(hs(o)){o=r.next(!0);continue}if(ps(o)){o=r.next();continue}}if(rr(o))n++,o=r.next();else{if(fs(o,e))return!1;o=r.next()}}while(o);return n<=1}})(e.dom,t),vs="data-mce-block",ys=e=>(e=>G(me(e),(e=>!/[A-Z]/.test(e))))(e).join(","),Cs=(e,t)=>C(t.querySelector(e))?(t.setAttribute(vs,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(vs),!1),ws=(e,t)=>{const n=ys(e.getTransparentElements()),o=ys(e.getBlockElements());return G(t.querySelectorAll(n),(e=>Cs(o,e)))},xs=(e,t)=>{var n;const o=t?"lastChild":"firstChild";for(let t=e[o];t;t=t[o])if(bs(yn(t)))return void(null===(n=t.parentNode)||void 0===n||n.removeChild(t))},ks=(e,t,n)=>{const o=e.getBlockElements(),r=yn(t),s=e=>Ht(e)in o,a=e=>En(e,r);q(ko(n),(t=>{Qn(t,s,a).each((n=>{const o=((t,o)=>G(Mn(t),(t=>s(t)&&!e.isValidChild(Ht(n),Ht(t)))))(t);if(o.length>0){const t=On(n);q(o,(e=>{Qn(e,s,a).each((t=>{((e,t)=>{const n=document.createRange(),o=e.parentNode;if(o){n.setStartBefore(e),n.setEndBefore(t);const r=n.extractContents();xs(r,!0),n.setStartAfter(t),n.setEndAfter(e);const s=n.extractContents();xs(s,!1),bs(yn(r))||o.insertBefore(r,e),bs(yn(t))||o.insertBefore(t,e),bs(yn(s))||o.insertBefore(s,e),o.removeChild(e)}})(t.dom,e.dom)}))})),t.each((t=>ws(e,t.dom)))}}))}))},Es=(e,t)=>{const n=ws(e,t);ks(e,t,n),((e,t,n)=>{q([...n,...As(e,t)?[t]:[]],(t=>q(Fo(yn(t),t.nodeName.toLowerCase()),(t=>{Os(e,t.dom)&&xo(t)}))))})(e,t,n)},Ss=(e,t)=>{if(Rs(e,t)){const n=ys(e.getBlockElements());Cs(n,t)}},_s=e=>e.hasAttribute(vs),Ns=(e,t)=>ke(e.getTransparentElements(),t),Rs=(e,t)=>$o(t)&&Ns(e,t.nodeName),As=(e,t)=>Rs(e,t)&&_s(t),Os=(e,t)=>Rs(e,t)&&!_s(t),Ts=(e,t)=>1===t.type&&Ns(e,t.name)&&m(t.attr(vs)),Bs=xt().browser,Ds=e=>J(e,Wt),Ps=(e,t)=>e.children&&H(e.children,t),Ls=(e,t={})=>{let n=0;const o={},r=yn(e),s=Nn(r),a=e=>new Promise(((a,i)=>{let l;const d=Dt._addCacheSuffix(e),c=(e=>xe(o,e).getOrThunk((()=>({id:"mce-u"+n++,passed:[],failed:[],count:0}))))(d);o[d]=c,c.count++;const u=(e,t)=>{q(e,P),c.status=t,c.passed=[],c.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},m=()=>u(c.passed,2),f=()=>u(c.failed,3);if(a&&c.passed.push(a),i&&c.failed.push(i),1===c.status)return;if(2===c.status)return void m();if(3===c.status)return void f();c.status=1;const g=bn("link",s.dom);var p;Zt(g,{rel:"stylesheet",type:"text/css",id:c.id}),t.contentCssCors&&Jt(g,"crossOrigin","anonymous"),t.referrerPolicy&&Jt(g,"referrerpolicy",t.referrerPolicy),l=g.dom,l.onload=m,l.onerror=f,p=g,bo(qn(r),p),Jt(g,"href",d)})),i=e=>{const t=Dt._addCacheSuffix(e);xe(o,t).each((e=>{0==--e.count&&(delete o[t],(e=>{const t=qn(r);eo(t,"#"+e).each(wo)})(e.id))}))};return{load:a,loadAll:e=>Promise.allSettled(V(e,(e=>a(e).then(N(e))))).then((e=>{const t=K(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject(V(t.fail,(e=>e.reason))):V(t.pass,(e=>e.value))})),unload:i,unloadAll:e=>{q(e,(e=>{i(e)}))},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},Ms=(()=>{const e=new WeakMap;return{forElement:(t,n)=>{const o=Vn(t).dom;return I.from(e.get(o)).getOrThunk((()=>{const t=Ls(o,n);return e.set(o,t),t}))}}})(),Is=(e,t)=>C(e)&&(fs(e,t)||kr(yn(e))),Fs=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),Us=(e,t,n)=>{var o;const r=n||t;if($o(t)&&Fs(t))return t;const s=t.childNodes;for(let t=s.length-1;t>=0;t--)Us(e,s[t],r);if($o(t)){const e=t.childNodes;1===e.length&&Fs(e[0])&&(null===(o=t.parentNode)||void 0===o||o.insertBefore(e[0],t))}return(e=>or(e)||nr(e))(t)||fs(t,r)||(e=>!!$o(e)&&e.childNodes.length>0)(t)||((e,t)=>Jo(e)&&e.data.length>0&&((e,t)=>{const n=new zo(e,t).prev(!1),o=new zo(e,t).next(!1),r=v(n)||Is(n,t),s=v(o)||Is(o,t);return r&&s})(e,t))(t,r)||e.remove(t),t},zs=Dt.makeMap,js=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Hs=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$s=/[<>&\"\']/g,Vs=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,qs={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"},Ws={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Ks={"<":"<",">":">","&":"&",""":'"',"'":"'"},Gs=(e,t)=>{const n={};if(e){const o=e.split(",");t=t||10;for(let e=0;ee.replace(t?js:Hs,(e=>Ws[e]||e)),Qs=(e,t)=>e.replace(t?js:Hs,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Ws[e]||"&#"+e.charCodeAt(0)+";")),Js=(e,t,n)=>{const o=n||Ys;return e.replace(t?js:Hs,(e=>Ws[e]||o[e]||e))},Zs={encodeRaw:Xs,encodeAllRaw:e=>(""+e).replace($s,(e=>Ws[e]||e)),encodeNumeric:Qs,encodeNamed:Js,getEncodeFunc:(e,t)=>{const n=Gs(t)||Ys,o=zs(e.replace(/\+/g,","));return o.named&&o.numeric?(e,t)=>e.replace(t?js:Hs,(e=>void 0!==Ws[e]?Ws[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";")):o.named?t?(e,t)=>Js(e,t,n):Js:o.numeric?Qs:Xs},decode:e=>e.replace(Vs,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):qs[t]||String.fromCharCode(t):Ks[e]||Ys[e]||(e=>{const t=bn("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e)))},ea=(e,t)=>(e=Dt.trim(e))?e.split(t||" "):[],ta=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$"),na={},oa=Dt.makeMap,ra=Dt.each,sa=Dt.extend,aa=Dt.explode,ia=(e,t={})=>{const n=oa(e," ",oa(e.toUpperCase()," "));return sa(n,t)},la=e=>ia("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),da=(e,t)=>{if(e){const n={};return m(e)&&(e={"*":e}),ra(e,((e,o)=>{n[o]=n[o.toUpperCase()]="map"===t?oa(e,/[, ]/):aa(e,/[, ]/)})),n}},ca=(e={})=>{var t;const n={},o={};let r=[];const s={},a={},i=(t,n,o)=>{const r=e[t];if(r)return oa(r,/[, ]/,oa(r.toUpperCase(),/[, ]/));{let e=na[t];return e||(e=ia(n,o),na[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",d=(e=>{const{globalAttributes:t,phrasingContent:n,flowContent:o}=(e=>{let t,n,o,r;return t="id accesskey class dir lang style tabindex title role",n="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",o="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(t+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",n+=" article aside details dialog figure main header footer hgroup section nav a ins del canvas map",o+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(t+=" xml:lang",o=[o,"acronym applet basefont big font strike tt"].join(" "),n=[n,"center dir isindex noframes"].join(" "),r=[n,o].join(" ")),r=r||[n,o].join(" "),{globalAttributes:t,blockContent:n,phrasingContent:o,flowContent:r}})(e),r={},s=(e,n="",o="")=>{const s=ea(o),a=ea(e);let i=a.length;for(;i--;){const e=ea([t,n].join(" "));r[a[i]]={attributes:se(e,N({})),attributesOrder:e,children:se(s,N({}))}}},a=(e,t)=>{const n=ea(e),o=ea(t);let s=n.length;for(;s--;){const e=r[n[s]];for(let t=0,n=o.length;t{s(e,"",n)})),q(ea("center dir isindex noframes"),(e=>{s(e,"",o)}))),s("html","manifest","head body"),s("head","","base command link meta noscript script style title"),s("title hr noscript br"),s("base","href target"),s("link","href rel media hreflang type sizes hreflang"),s("meta","name http-equiv content charset"),s("style","media type scoped"),s("script","src async defer type charset"),s("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",o),s("dd div","",o),s("address dt caption","","html4"===e?n:o),s("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),s("blockquote","cite",o),s("ol","reversed start type","li"),s("ul","","li"),s("li","value",o),s("dl","","dt dd"),s("a","href target rel media hreflang type","html4"===e?n:o),s("q","cite",n),s("ins del","cite datetime",o),s("img","src sizes srcset alt usemap ismap width height"),s("iframe","src name width height",o),s("embed","src type width height"),s("object","data type typemustmatch name usemap form width height",[o,"param"].join(" ")),s("param","name value"),s("map","name",[o,"area"].join(" ")),s("area","alt coords shape href target rel media hreflang type"),s("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),s("colgroup","span","col"),s("col","span"),s("tbody thead tfoot","","tr"),s("tr","","td th"),s("td","colspan rowspan headers",o),s("th","colspan rowspan headers scope abbr",o),s("form","accept-charset action autocomplete enctype method name novalidate target",o),s("fieldset","disabled form name",[o,"legend"].join(" ")),s("label","form for",n),s("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),s("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?o:n),s("select","disabled form multiple name required size","option optgroup"),s("optgroup","disabled label","option"),s("option","disabled label selected value"),s("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),s("menu","type label",[o,"li"].join(" ")),s("noscript","",o),"html4"!==e&&(s("wbr"),s("ruby","",[n,"rt rp"].join(" ")),s("figcaption","",o),s("mark rt rp summary bdi","",n),s("canvas","width height",o),s("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[o,"track source"].join(" ")),s("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[o,"track source"].join(" ")),s("picture","","img source"),s("source","src srcset type media sizes"),s("track","kind src srclang label default"),s("datalist","",[n,"option"].join(" ")),s("article section nav aside main header footer","",o),s("hgroup","","h1 h2 h3 h4 h5 h6"),s("figure","",[o,"figcaption"].join(" ")),s("time","datetime",n),s("dialog","open",o),s("command","type label icon disabled checked radiogroup command"),s("output","for form name",n),s("progress","value max",n),s("meter","value min max low high optimum",n),s("details","open",[o,"summary"].join(" ")),s("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(a("script","language xml:space"),a("style","xml:space"),a("object","declare classid code codebase codetype archive standby align border hspace vspace"),a("embed","align name hspace vspace"),a("param","valuetype type"),a("a","charset name rev shape coords"),a("br","clear"),a("applet","codebase archive code object alt name width height align hspace vspace"),a("img","name longdesc align border hspace vspace"),a("iframe","longdesc frameborder marginwidth marginheight scrolling align"),a("font basefont","size color face"),a("input","usemap align"),a("select"),a("textarea"),a("h1 h2 h3 h4 h5 h6 div p legend caption","align"),a("ul","type compact"),a("li","type"),a("ol dl menu dir","compact"),a("pre","width xml:space"),a("hr","align noshade size width"),a("isindex","prompt"),a("table","summary width frame rules cellspacing cellpadding align bgcolor"),a("col","width align char charoff valign"),a("colgroup","width align char charoff valign"),a("thead","align char charoff valign"),a("tr","align char charoff valign bgcolor"),a("th","axis align char charoff valign nowrap bgcolor width height"),a("form","accept"),a("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),a("tfoot","align char charoff valign"),a("tbody","align char charoff valign"),a("area","nohref"),a("body","background bgcolor text link vlink alink")),"html4"!==e&&(a("input button select textarea","autofocus"),a("input textarea","placeholder"),a("a","download"),a("link script img","crossorigin"),a("img","loading"),a("iframe","sandbox seamless allow allowfullscreen loading")),"html4"!==e&&q([r.video,r.audio],(e=>{delete e.children.audio,delete e.children.video})),q(ea("a form meter progress dfn"),(e=>{r[e]&&delete r[e].children[e]})),delete r.caption.children.table,delete r.script,r})(l);!1===e.verify_html&&(e.valid_elements="*[*]");const c=da(e.valid_styles),u=da(e.invalid_styles,"map"),m=da(e.valid_classes,"map"),f=i("whitespace_elements","pre script noscript style textarea video audio iframe object code"),g=i("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),p=i("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),h=i("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),b="td th iframe video audio object script code",v=i("non_empty_elements",b+" pre",p),y=i("move_caret_before_on_enter_elements",b+" table",p),C=i("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),w=i("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",C),x=i("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),k=i("transparent_elements","a ins del canvas map");ra("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{a[e]=new RegExp("]*>","gi")}));const E=e=>{const t=I.from(n["@"]),o=/[*?+]/;q(((e,t)=>{const n=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return te(ea(t,","),(t=>{const o=n.exec(t);if(o){const t=o[1],n=o[2],r=o[3],s=o[4],a=o[5],i={attributes:{},attributesOrder:[]};if(e.each((e=>((e,t)=>{ge(e.attributes,((e,n)=>{t.attributes[n]=e})),t.attributesOrder.push(...e.attributesOrder)})(e,i))),"#"===t?i.paddEmpty=!0:"-"===t&&(i.removeEmpty=!0),"!"===s&&(i.removeEmptyAttrs=!0),a&&((e,t)=>{const n=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,o=/[*?+]/,{attributes:r,attributesOrder:s}=t;q(ea(e,"|"),(e=>{const a=n.exec(e);if(a){const e={},n=a[1],i=a[2].replace(/[\\:]:/g,":"),l=a[3],d=a[4];if("!"===n&&(t.attributesRequired=t.attributesRequired||[],t.attributesRequired.push(i),e.required=!0),"-"===n)return delete r[i],void s.splice(Dt.inArray(s,i),1);if(l&&("="===l?(t.attributesDefault=t.attributesDefault||[],t.attributesDefault.push({name:i,value:d}),e.defaultValue=d):"~"===l?(t.attributesForced=t.attributesForced||[],t.attributesForced.push({name:i,value:d}),e.forcedValue=d):"<"===l&&(e.validValues=Dt.makeMap(d,"?"))),o.test(i)){const n=e;t.attributePatterns=t.attributePatterns||[],n.pattern=ta(i),t.attributePatterns.push(n)}else r[i]||s.push(i),r[i]=e}}))})(a,i),r&&(i.outputName=n),"@"===n){if(!e.isNone())return[];e=I.some(i)}return[r?{name:n,element:i,aliasName:r}:{name:n,element:i}]}return[]}))})(t,null!=e?e:""),(({name:e,element:t,aliasName:s})=>{if(s&&(n[s]=t),o.test(e)){const n=t;n.pattern=ta(e),r.push(n)}else n[e]=t}))},S=e=>{r=[],q(me(n),(e=>{delete n[e]})),E(e)},_=e=>{delete na.text_block_elements,delete na.block_elements,q((e=>{const t=/^(~)?(.+)$/;return te(ea(e,","),(e=>{const n=t.exec(e);if(n){const e="~"===n[1];return[{inline:e,cloneName:e?"span":"div",name:n[2]}]}return[]}))})(null!=e?e:""),(({inline:e,name:t,cloneName:r})=>{if(o[t]=o[r],s[t]=r,v[t.toUpperCase()]={},v[t]={},e||(w[t.toUpperCase()]={},w[t]={}),!n[t]){let e=n[r];e=sa({},e),delete e.removeEmptyAttrs,delete e.removeEmpty,n[t]=e}ge(o,((e,n)=>{e[r]&&(o[n]=e=sa({},o[n]),e[t]=e[r])}))}))},R=e=>{q((e=>{const t=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return te(ea(e,","),(e=>{const n=t.exec(e);if(n){const e=n[1],t=e?(e=>"-"===e?"remove":"add")(e):"replace";return[{operation:t,name:n[2],validChildren:ea(n[3],"|")}]}return[]}))})(null!=e?e:""),(({operation:e,name:t,validChildren:n})=>{const r="replace"===e?{"#comment":{}}:o[t];q(n,(t=>{"remove"===e?delete r[t]:r[t]={}})),o[t]=r}))},A=e=>{const t=n[e];if(t)return t;let o=r.length;for(;o--;){const t=r[o];if(t.pattern.test(e))return t}};e.valid_elements?(S(e.valid_elements),ra(d,((e,t)=>{o[t]=e.children}))):(ra(d,((e,t)=>{n[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},o[t]=e.children})),ra(ea("strong/b em/i"),(e=>{const t=ea(e,"/");n[t[1]].outputName=t[0]})),ra(x,((t,o)=>{n[o]&&(e.padd_empty_block_inline_children&&(n[o].paddInEmptyBlock=!0),n[o].removeEmpty=!0)})),ra(ea("ol ul blockquote a table tbody"),(e=>{n[e]&&(n[e].removeEmpty=!0)})),ra(ea("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),(e=>{n[e]&&(n[e].paddEmpty=!0)})),ra(ea("span"),(e=>{n[e].removeEmptyAttrs=!0}))),_(e.custom_elements),R(e.valid_children),E(e.extended_valid_elements),R("+ol[ul|ol],+ul[ul|ol]"),ra({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},((e,t)=>{n[t]&&(n[t].parentsRequired=ea(e))})),e.invalid_elements&&ra(aa(e.invalid_elements),(e=>{n[e]&&delete n[e]})),A("span")||E("span[!data-mce-type|*]");const O=N(c),T=N(u),B=N(m),D=N(h),P=N(w),L=N(C),M=N(x),F=N(Object.seal(p)),U=N(g),z=N(v),j=N(y),H=N(f),$=N(k),V=N(Object.seal(a)),W=N(s);return{type:l,children:o,elements:n,getValidStyles:O,getValidClasses:B,getBlockElements:P,getInvalidStyles:T,getVoidElements:F,getTextBlockElements:L,getTextInlineElements:M,getBoolAttrs:D,getElementRule:A,getSelfClosingElements:U,getNonEmptyElements:z,getMoveCaretBeforeOnEnterElements:j,getWhitespaceElements:H,getTransparentElements:$,getSpecialElements:V,isValidChild:(e,t)=>{const n=o[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:(e,t)=>{const n=A(e);if(n){if(!t)return!0;{if(n.attributes[t])return!0;const e=n.attributePatterns;if(e){let n=e.length;for(;n--;)if(e[n].pattern.test(t))return!0}}}return!1},getCustomElements:W,addValidElements:E,setValidElements:S,addCustomElements:_,addValidChildren:R}},ua=(e={},t)=>{const n=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,r=/\s+$/,s={};let a,i;const l=gr;t&&(a=t.getValidStyles(),i=t.getInvalidStyles());const d="\\\" \\' \\; \\: ; : \ufeff".split(" ");for(let e=0;e{const a={};let i=!1;const d=e.url_converter,u=e.url_converter_scope||c,m=(e,t,n)=>{const o=a[e+"-top"+t];if(!o)return;const r=a[e+"-right"+t];if(!r)return;const s=a[e+"-bottom"+t];if(!s)return;const i=a[e+"-left"+t];if(!i)return;const l=[o,r,s,i];let d=l.length-1;for(;d--&&l[d]===l[d+1];);d>-1&&n||(a[e+t]=-1===d?l[0]:l.join(" "),delete a[e+"-top"+t],delete a[e+"-right"+t],delete a[e+"-bottom"+t],delete a[e+"-left"+t])},f=e=>{const t=a[e];if(!t)return;const n=t.indexOf(",")>-1?[t]:t.split(" ");let o=n.length;for(;o--;)if(n[o]!==n[0])return!1;return a[e]=n[0],!0},g=e=>(i=!0,s[e]),p=(e,t)=>(i&&(e=e.replace(/\uFEFF[0-9]/g,(e=>s[e]))),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e),h=e=>String.fromCharCode(parseInt(e.slice(1),16)),b=e=>e.replace(/\\[0-9a-f]+/gi,h),v=(t,n,o,r,s,a)=>{if(s=s||a)return"'"+(s=p(s)).replace(/\'/g,"\\'")+"'";if(n=p(n||o||r||""),!e.allow_script_urls){const t=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(t))return"";if(!e.allow_svg_data_urls&&/^data:image\/svg/i.test(t))return""}return d&&(n=d.call(u,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"};if(t){let s;for(t=(t=t.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,g)));s=o.exec(t);){o.lastIndex=s.index+s[0].length;let t=s[1].replace(r,"").toLowerCase(),d=s[2].replace(r,"");if(t&&d){if(t=b(t),d=b(d),-1!==t.indexOf(l)||-1!==t.indexOf('"'))continue;if(!e.allow_script_urls&&("behavior"===t||/expression\s*\(|\/\*|\*\//.test(d)))continue;"font-weight"===t&&"700"===d?d="bold":"color"!==t&&"background-color"!==t||(d=d.toLowerCase()),d=d.replace(n,v),a[t]=i?p(d,!0):d}}m("border","",!0),m("border","-width"),m("border","-color"),m("border","-style"),m("padding",""),m("margin",""),"border",C="border-style",w="border-color",f(y="border-width")&&f(C)&&f(w)&&(a.border=a[y]+" "+a[C]+" "+a[w],delete a[y],delete a[C],delete a[w]),"medium none"===a.border&&delete a.border,"none"===a["border-image"]&&delete a["border-image"]}var y,C,w;return a},serialize:(e,t)=>{let n="";const o=(t,o)=>{const r=o[t];if(r)for(let t=0,o=r.length;t0?" ":"")+o+": "+s+";")}};return t&&a?(o("*",a),o(t,a)):ge(e,((e,o)=>{e&&((e,t)=>{if(!i||!t)return!0;let n=i["*"];return!(n&&n[e]||(n=i[t],n&&n[e]))})(o,t)&&(n+=(n.length>0?" ":"")+o+": "+e+";")})),n}};return c},ma={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},fa=(e,t)=>{const n=null!=t?t:{};for(const t in e)ke(ma,t)||(n[t]=e[t]);return C(e.composedPath)&&(n.composedPath=()=>e.composedPath()),n},ga=(e,t,n,o)=>{var r;const s=fa(t,o);return s.type=e,y(s.target)&&(s.target=null!==(r=s.srcElement)&&void 0!==r?r:n),(e=>y(e.preventDefault)||(e=>e instanceof Event||w(e.initEvent))(e))(t)&&(s.preventDefault=()=>{s.defaultPrevented=!0,s.isDefaultPrevented=M,w(t.preventDefault)&&t.preventDefault()},s.stopPropagation=()=>{s.cancelBubble=!0,s.isPropagationStopped=M,w(t.stopPropagation)&&t.stopPropagation()},s.stopImmediatePropagation=()=>{s.isImmediatePropagationStopped=M,s.stopPropagation()},(e=>e.isDefaultPrevented===M||e.isDefaultPrevented===L)(s)||(s.isDefaultPrevented=!0===s.defaultPrevented?M:L,s.isPropagationStopped=!0===s.cancelBubble?M:L,s.isImmediatePropagationStopped=L)),s},pa=/^(?:mouse|contextmenu)|click/,ha=(e,t,n,o)=>{e.addEventListener(t,n,o||!1)},ba=(e,t,n,o)=>{e.removeEventListener(t,n,o||!1)},va=(e,t)=>{const n=ga(e.type,e,document,t);if((e=>C(e)&&pa.test(e.type))(e)&&v(e.pageX)&&!v(e.clientX)){const t=n.target.ownerDocument||document,o=t.documentElement,r=t.body,s=n;s.pageX=e.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),s.pageY=e.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)}return n},ya=(e,t,n)=>{const o=e.document,r={type:"ready"};if(n.domLoaded)return void t(r);const s=()=>{ba(e,"DOMContentLoaded",s),ba(e,"load",s),n.domLoaded||(n.domLoaded=!0,t(r)),e=null};"complete"===o.readyState||"interactive"===o.readyState&&o.body?s():ha(e,"DOMContentLoaded",s),n.domLoaded||ha(e,"load",s)};class Ca{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(e,t,n,o){const r=this;let s;const a=window,i=e=>{r.executeHandlers(va(e||a.event),l)};if(!e||Jo(e)||tr(e))return n;let l;e[r.expando]?l=e[r.expando]:(l=r.count++,e[r.expando]=l,r.events[l]={}),o=o||e;const d=t.split(" ");let c=d.length;for(;c--;){let t=d[c],u=i,m=!1,f=!1;"DOMContentLoaded"===t&&(t="ready"),r.domLoaded&&"ready"===t&&"complete"===e.readyState?n.call(o,va({type:t})):(r.hasFocusIn||"focusin"!==t&&"focusout"!==t||(m=!0,f="focusin"===t?"focus":"blur",u=e=>{const t=va(e||a.event);t.type="focus"===t.type?"focusin":"focusout",r.executeHandlers(t,l)}),s=r.events[l][t],s?"ready"===t&&r.domLoaded?n(va({type:t})):s.push({func:n,scope:o}):(r.events[l][t]=s=[{func:n,scope:o}],s.fakeName=f,s.capture=m,s.nativeHandler=u,"ready"===t?ya(e,u,r):ha(e,f||t,u,m)))}return e=s=null,n}unbind(e,t,n){if(!e||Jo(e)||tr(e))return this;const o=e[this.expando];if(o){let r=this.events[o];if(t){const o=t.split(" ");let s=o.length;for(;s--;){const t=o[s],a=r[t];if(a){if(n){let e=a.length;for(;e--;)if(a[e].func===n){const n=a.nativeHandler,o=a.fakeName,s=a.capture,i=a.slice(0,e).concat(a.slice(e+1));i.nativeHandler=n,i.fakeName=o,i.capture=s,r[t]=i}}n&&0!==a.length||(delete r[t],ba(e,a.fakeName||t,a.nativeHandler,a.capture))}}}else ge(r,((t,n)=>{ba(e,t.fakeName||n,t.nativeHandler,t.capture)})),r={};for(const e in r)if(ke(r,e))return this;delete this.events[o];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,n){return this.dispatch(e,t,n)}dispatch(e,t,n){if(!e||Jo(e)||tr(e))return this;const o=va({type:t,target:e},n);do{const t=e[this.expando];t&&this.executeHandlers(o,t),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!o.isPropagationStopped());return this}clean(e){if(!e||Jo(e)||tr(e))return this;if(e[this.expando]&&this.unbind(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let n=t.length;for(;n--;)(e=t[n])[this.expando]&&this.unbind(e)}return this}destroy(){this.events={}}cancel(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}executeHandlers(e,t){const n=this.events[t],o=n&&n[e.type];if(o)for(let t=0,n=o.length;t{y(n)||""===n?on(e,t):Jt(e,t,n)},_a=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),Na=(e,t)=>{let n=0;if(e)for(let o=e.nodeType,r=e.previousSibling;r;r=r.previousSibling){const e=r.nodeType;(!t||!Jo(r)||e!==o&&r.data.length)&&(n++,o=e)}return n},Ra=(e,t)=>{const n=en(t,"style"),o=e.serialize(e.parse(n),Ht(t));Sa(t,ka,o)},Aa=(e,t,n)=>{const o=_a(t);y(n)||""===n?fo(e,o):ao(e,o,((e,t)=>x(e)?ke(Ea,t)?e+"":e+"px":e)(n,o))},Oa=(e,t={})=>{const n={},o=window,r={};let s=0;const a=Ms.forElement(yn(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy}),i=[],l=t.schema?t.schema:ca({}),d=ua({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),c=t.ownEvents?new Ca:Ca.Event,u=l.getBlockElements(),f=t=>t&&e&&m(t)?e.getElementById(t):t,g=e=>{const t=f(e);return C(t)?yn(t):null},h=(e,t,n="")=>{let o;const r=g(e);if(C(r)&&Wt(r)){const e=Y[t];o=e&&e.get?e.get(r.dom,t):en(r,t)}return C(o)?o:n},b=e=>{const t=f(e);return y(t)?[]:t.attributes},v=(e,n,o)=>{T(e,(e=>{if($o(e)){const r=yn(e),s=""===o?null:o,a=en(r,n),i=Y[n];i&&i.set?i.set(r.dom,s,n):Sa(r,n,s),a!==s&&t.onSetAttrib&&t.onSetAttrib({attrElm:r.dom,attrName:n,attrValue:s})}}))},x=()=>t.root_element||e.body,k=(t,n)=>((e,t,n)=>{let o=0,r=0;const s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===lo(yn(e),"position")){const n=t.getBoundingClientRect();return o=n.left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,r=n.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop,{x:o,y:r}}let a=t;for(;a&&a!==n&&a.nodeType&&!Ps(a,n);){const e=a;o+=e.offsetLeft||0,r+=e.offsetTop||0,a=e.offsetParent}for(a=t.parentNode;a&&a!==n&&a.nodeType&&!Ps(a,n);)o-=a.scrollLeft||0,r-=a.scrollTop||0,a=a.parentNode;r+=(e=>Bs.isFirefox()&&"table"===Ht(e)?Ds(Mn(e)).filter((e=>"caption"===Ht(e))).bind((e=>Ds(Ln(e)).map((t=>{const n=t.dom.offsetTop,o=e.dom.offsetTop,r=e.dom.offsetHeight;return n<=o?-r:0})))).getOr(0):0)(yn(t))}return{x:o,y:r}})(e.body,f(t),n),S=(e,t,n)=>{const o=f(e);if(!y(o)&&$o(o))return n?lo(yn(o),_a(t)):("float"===(t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase())))&&(t="cssFloat"),o.style?o.style[t]:void 0)},_=e=>{const t=f(e);if(!t)return{w:0,h:0};let n=S(t,"width"),o=S(t,"height");return n&&-1!==n.indexOf("px")||(n="0"),o&&-1!==o.indexOf("px")||(o="0"),{w:parseInt(n,10)||t.offsetWidth||t.clientWidth,h:parseInt(o,10)||t.offsetHeight||t.clientHeight}},R=(e,t)=>{if(!e)return!1;const n=p(e)?e:[e];return $(n,(e=>xn(yn(e),t)))},A=(e,t,n,o)=>{const r=[];let s=f(e);o=void 0===o;const a=n||("BODY"!==x().nodeName?x().parentNode:null);if(m(t))if("*"===t)t=$o;else{const e=t;t=t=>R(t,e)}for(;s&&!(s===a||y(s.nodeType)||nr(s)||or(s));){if(!t||t(s)){if(!o)return[s];r.push(s)}s=s.parentNode}return o?r:null},O=(e,t,n)=>{let o=t;if(e){m(t)&&(o=e=>R(e,t));for(let t=e[n];t;t=t[n])if(w(o)&&o(t))return t}return null},T=function(e,t,n){const o=null!=n?n:this;if(p(e)){const n=[];return wa(e,((e,r)=>{const s=f(e);s&&n.push(t.call(o,s,r))})),n}{const n=f(e);return!!n&&t.call(o,n)}},B=(e,t)=>{T(e,(e=>{ge(t,((t,n)=>{v(e,n,t)}))}))},D=(e,t)=>{T(e,(e=>{const n=yn(e);So(n,t)}))},P=(t,n,o,r,s)=>T(t,(t=>{const a=m(n)?e.createElement(n):n;return C(o)&&B(a,o),r&&(!m(r)&&r.nodeType?a.appendChild(r):m(r)&&D(a,r)),s?a:t.appendChild(a)})),L=(t,n,o)=>P(e.createElement(t),t,n,o,!0),M=Zs.encodeAllRaw,I=(e,t)=>T(e,(e=>{const n=yn(e);return t&&q(Mn(n),(e=>{Kt(e)&&0===e.dom.length?wo(e):go(n,e)})),wo(n),n.dom})),F=(e,t,n)=>{T(e,(e=>{if($o(e)){const o=yn(e),r=t.split(" ");q(r,(e=>{C(n)?(n?un:fn)(o,e):((e,t)=>{const n=an(e)?e.dom.classList.toggle(t):((e,t)=>H(ln(e),t)?cn(e,t):dn(e,t))(e,t);mn(e)})(o,e)}))}}))},U=(e,t,n)=>T(t,(o=>{var r;const s=p(t)?e.cloneNode(!0):e;return n&&wa(xa(o.childNodes),(e=>{s.appendChild(e)})),null===(r=o.parentNode)||void 0===r||r.replaceChild(s,o),o})),z=e=>{if($o(e)){const t="a"===e.nodeName.toLowerCase()&&!h(e,"href")&&h(e,"id");if(h(e,"name")||h(e,"data-mce-bookmark")||t)return!0}return!1},j=()=>e.createRange(),V=(n,r,s,a)=>{if(p(n)){let e=n.length;const t=[];for(;e--;)t[e]=V(n[e],r,s,a);return t}return!t.collect||n!==e&&n!==o||i.push([n,r,s,a]),c.bind(n,r,s,a||G)},W=(t,n,r)=>{if(p(t)){let e=t.length;const o=[];for(;e--;)o[e]=W(t[e],n,r);return o}if(i.length>0&&(t===e||t===o)){let e=i.length;for(;e--;){const[o,s,a]=i[e];t!==o||n&&n!==s||r&&r!==a||c.unbind(o,s,a)}}return c.unbind(t,n,r)},K=e=>{if(e&&$o(e)){const t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},G={doc:e,settings:t,win:o,files:r,stdMode:!0,boxModel:!0,styleSheetLoader:a,boundEvents:i,styles:d,schema:l,events:c,isBlock:e=>m(e)?ke(u,e):$o(e)&&(ke(u,e.nodeName)||As(l,e)),root:null,clone:(e,t)=>e.cloneNode(t),getRoot:x,getViewPort:e=>{const t=Mo(e);return{x:t.x,y:t.y,w:t.width,h:t.height}},getRect:e=>{const t=f(e),n=k(t),o=_(t);return{x:n.x,y:n.y,w:o.w,h:o.h}},getSize:_,getParent:(e,t,n)=>{const o=A(e,t,n,!1);return o&&o.length>0?o[0]:null},getParents:A,get:f,getNext:(e,t)=>O(e,t,"nextSibling"),getPrev:(e,t)=>O(e,t,"previousSibling"),select:(n,o)=>{var r,s;const a=null!==(s=null!==(r=f(o))&&void 0!==r?r:t.root_element)&&void 0!==s?s:e;return w(a.querySelectorAll)?ce(a.querySelectorAll(n)):[]},is:R,add:P,create:L,createHTML:(e,t,n="")=>{let o="<"+e;for(const e in t)Ee(t,e)&&(o+=" "+e+'="'+M(t[e])+'"');return Ye(n)&&ke(l.getVoidElements(),e)?o+" />":o+">"+n+""},createFragment:t=>{const n=e.createElement("div"),o=e.createDocumentFragment();let r;for(o.appendChild(n),t&&(n.innerHTML=t);r=n.firstChild;)o.appendChild(r);return o.removeChild(n),o},remove:I,setStyle:(e,n,o)=>{T(e,(e=>{const r=yn(e);Aa(r,n,o),t.update_styles&&Ra(d,r)}))},getStyle:S,setStyles:(e,n)=>{T(e,(e=>{const o=yn(e);ge(n,((e,t)=>{Aa(o,t,e)})),t.update_styles&&Ra(d,o)}))},removeAllAttribs:e=>T(e,(e=>{const t=e.attributes;for(let n=t.length-1;n>=0;n--)e.removeAttributeNode(t.item(n))})),setAttrib:v,setAttribs:B,getAttrib:h,getPos:k,parseStyle:e=>d.parse(e),serializeStyle:(e,t)=>d.serialize(e,t),addStyle:t=>{if(G!==Oa.DOM&&e===document){if(n[t])return;n[t]=!0}let o=e.getElementById("mceDefaultStyles");if(!o){o=e.createElement("style"),o.id="mceDefaultStyles",o.type="text/css";const t=e.head;t.firstChild?t.insertBefore(o,t.firstChild):t.appendChild(o)}o.styleSheet?o.styleSheet.cssText+=t:o.appendChild(e.createTextNode(t))},loadCSS:e=>{e||(e=""),q(e.split(","),(e=>{r[e]=!0,a.load(e).catch(E)}))},addClass:(e,t)=>{F(e,t,!0)},removeClass:(e,t)=>{F(e,t,!1)},hasClass:(e,t)=>{const n=g(e),o=t.split(" ");return C(n)&&ne(o,(e=>gn(n,e)))},toggleClass:F,show:e=>{T(e,(e=>fo(yn(e),"display")))},hide:e=>{T(e,(e=>ao(yn(e),"display","none")))},isHidden:e=>{const t=g(e);return C(t)&&Pt(uo(t,"display"),"none")},uniqueId:e=>(e||"mce_")+s++,setHTML:D,getOuterHTML:e=>{const t=g(e);return C(t)?$o(t.dom)?t.dom.outerHTML:(e=>{const t=bn("div"),n=yn(e.dom.cloneNode(!0));return bo(t,n),Eo(t)})(t):""},setOuterHTML:(e,t)=>{T(e,(e=>{$o(e)&&(e.outerHTML=t)}))},decode:Zs.decode,encode:M,insertAfter:(e,t)=>{const n=f(t);return T(e,(e=>{const t=null==n?void 0:n.parentNode,o=null==n?void 0:n.nextSibling;return t&&(o?t.insertBefore(e,o):t.appendChild(e)),e}))},replace:U,rename:(e,t)=>{if(e.nodeName!==t.toUpperCase()){const n=L(t);return wa(b(e),(t=>{v(n,t.nodeName,h(e,t.nodeName))})),U(n,e,!0),n}return e},findCommonAncestor:(e,t)=>{let n=e;for(;n;){let e=t;for(;e&&n!==e;)e=e.parentNode;if(n===e)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},run:T,getAttribs:b,isEmpty:(e,t,n)=>{let o=0;if(z(e))return!1;const r=e.firstChild;if(r){const s=new zo(r,e),a=l?l.getWhitespaceElements():{},i=t||(l?l.getNonEmptyElements():null);let d=r;do{if($o(d)){const e=d.getAttribute("data-mce-bogus");if(e){d=s.next("all"===e);continue}const t=d.nodeName.toLowerCase();if(i&&i[t]){if("br"===t){o++,d=s.next();continue}return!1}if(z(d))return!1}if(tr(d))return!1;if(Jo(d)&&!ds(d.data)&&(!(null==n?void 0:n.includeZwsp)||!cs(d.data)))return!1;if(Jo(d)&&d.parentNode&&a[d.parentNode.nodeName]&&ds(d.data))return!1;d=s.next()}while(d)}return o<=1},createRng:j,nodeIndex:Na,split:(e,t,n)=>{let o,r,s=j();if(e&&t&&e.parentNode&&t.parentNode){const a=e.parentNode;return s.setStart(a,Na(e)),s.setEnd(t.parentNode,Na(t)),o=s.extractContents(),s=j(),s.setStart(t.parentNode,Na(t)+1),s.setEnd(a,Na(e)+1),r=s.extractContents(),a.insertBefore(Us(G,o),e),n?a.insertBefore(n,e):a.insertBefore(t,e),a.insertBefore(Us(G,r),e),I(e),n||t}},bind:V,unbind:W,fire:(e,t,n)=>c.dispatch(e,t,n),dispatch:(e,t,n)=>c.dispatch(e,t,n),getContentEditable:K,getContentEditableParent:e=>{const t=x();let n=null;for(let o=e;o&&o!==t&&(n=K(o),null===n);o=o.parentNode);return n},isEditable:e=>{if(C(e)){const t=$o(e)?e:e.parentElement;return C(t)&&no(yn(t))}return!1},destroy:()=>{if(i.length>0){let e=i.length;for(;e--;){const[t,n,o]=i[e];c.unbind(t,n,o)}}ge(r,((e,t)=>{a.unload(t),delete r[t]}))},isChildOf:(e,t)=>e===t||t.contains(e),dumpRng:e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},Y=((e,t,n)=>{const o=t.keep_values,r={set:(e,o,r)=>{const s=yn(e);w(t.url_converter)&&C(o)&&(o=t.url_converter.call(t.url_converter_scope||n(),String(o),r,e)),Sa(s,"data-mce-"+r,o),Sa(s,r,o)},get:(e,t)=>{const n=yn(e);return en(n,"data-mce-"+t)||en(n,t)}},s={style:{set:(t,n)=>{const r=yn(t);o&&Sa(r,ka,n),on(r,"style"),m(n)&&io(r,e.parse(n))},get:t=>{const n=yn(t),o=en(n,ka)||en(n,"style");return e.serialize(e.parse(o),Ht(n))}}};return o&&(s.href=s.src=r),s})(d,t,N(G));return G};Oa.DOM=Oa(document),Oa.nodeIndex=Na;const Ta=Oa.DOM;class Ba{constructor(e={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise(((t,n)=>{const o=Ta;let r;const s=()=>{o.remove(a),r&&(r.onerror=r.onload=r=null)},a=o.uniqueId();r=document.createElement("script"),r.id=a,r.type="text/javascript",r.src=Dt._addCacheSuffix(e),this.settings.referrerPolicy&&o.setAttrib(r,"referrerpolicy",this.settings.referrerPolicy),r.onload=()=>{s(),t()},r.onerror=()=>{s(),n("Failed to load script: "+e)},(document.getElementsByTagName("head")[0]||document.body).appendChild(r)}))}isDone(e){return 2===this.states[e]}markDone(e){this.states[e]=2}add(e){const t=this;return t.queue.push(e),void 0===t.states[e]&&(t.states[e]=0),new Promise(((n,o)=>{t.scriptLoadedCallbacks[e]||(t.scriptLoadedCallbacks[e]=[]),t.scriptLoadedCallbacks[e].push({resolve:n,reject:o})}))}load(e){return this.add(e)}remove(e){delete this.states[e],delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;return this.queue=[],this.loadScripts(e)}loadScripts(e){const t=this,n=(e,n)=>{xe(t.scriptLoadedCallbacks,n).each((t=>{q(t,(t=>t[e](n)))})),delete t.scriptLoadedCallbacks[n]},o=e=>{const t=G(e,(e=>"rejected"===e.status));return t.length>0?Promise.reject(te(t,(({reason:e})=>p(e)?e:[e]))):Promise.resolve()},r=e=>Promise.allSettled(V(e,(e=>2===t.states[e]?(n("resolve",e),Promise.resolve()):3===t.states[e]?(n("reject",e),Promise.reject(e)):(t.states[e]=1,t.loadScript(e).then((()=>{t.states[e]=2,n("resolve",e);const s=t.queue;return s.length>0?(t.queue=[],r(s).then(o)):Promise.resolve()}),(()=>(t.states[e]=3,n("reject",e),Promise.reject(e)))))))),s=e=>(t.loading=!0,r(e).then((e=>{t.loading=!1;const n=t.queueLoadedCallbacks.shift();return I.from(n).each(P),o(e)}))),a=Se(e);return t.loading?new Promise(((e,n)=>{t.queueLoadedCallbacks.push((()=>{s(a).then(e,n)}))})):s(a)}}Ba.ScriptLoader=new Ba;const Da=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},Pa={},La=Da("en"),Ma=()=>xe(Pa,La.get()),Ia={getData:()=>pe(Pa,(e=>({...e}))),setCode:e=>{e&&La.set(e)},getCode:()=>La.get(),add:(e,t)=>{let n=Pa[e];n||(Pa[e]=n={});const o=V(me(t),(e=>e.toLowerCase()));ge(t,((e,r)=>{const s=r.toLowerCase();s!==r&&((e,t)=>{const n=e.indexOf(t);return-1!==n&&e.indexOf(t,n+1)>n})(o,s)?(ke(t,s)||(n[s]=e),n[r]=e):n[s]=e}))},translate:e=>{const t=Ma().getOr({}),n=e=>w(e)?Object.prototype.toString.call(e):o(e)?"":""+e,o=e=>""===e||null==e,r=e=>{const o=n(e);return ke(t,o)?n(t[o]):xe(t,o.toLowerCase()).map(n).getOr(o)},s=e=>e.replace(/{context:\w+}$/,"");if(o(e))return"";if(f(a=e)&&ke(a,"raw"))return n(e.raw);var a;if((e=>p(e)&&e.length>1)(e)){const t=e.slice(1);return s(r(e[0]).replace(/\{([0-9]+)\}/g,((e,o)=>ke(t,o)?n(t[o]):e)))}return s(r(e))},isRtl:()=>Ma().bind((e=>xe(e,"_dir"))).exists((e=>"rtl"===e)),hasCode:e=>ke(Pa,e)},Fa=()=>{const e=[],t={},n={},o=[],r=(e,t)=>{const n=G(o,(n=>n.name===e&&n.state===t));q(n,(e=>e.resolve()))},s=e=>ke(t,e),a=(e,n)=>{const o=Ia.getCode();!o||n&&-1===(","+(n||"")+",").indexOf(","+o+",")||Ba.ScriptLoader.add(t[e]+"/langs/"+o+".js")},i=(e,t="added")=>"added"===t&&(e=>ke(n,e))(e)||"loaded"===t&&s(e)?Promise.resolve():new Promise((n=>{o.push({name:e,state:t,resolve:n})}));return{items:e,urls:t,lookup:n,get:e=>{if(n[e])return n[e].instance},requireLangPack:(e,t)=>{!1!==Fa.languageLoad&&(s(e)?a(e,t):i(e,"loaded").then((()=>a(e,t))))},add:(t,o)=>(e.push(o),n[t]={instance:o},r(t,"added"),o),remove:e=>{delete t[e],delete n[e]},createUrl:(e,t)=>m(t)?m(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}:t,load:(e,o)=>{if(t[e])return Promise.resolve();let s=m(o)?o:o.prefix+o.resource+o.suffix;0!==s.indexOf("/")&&-1===s.indexOf("://")&&(s=Fa.baseURL+"/"+s),t[e]=s.substring(0,s.lastIndexOf("/"));const a=()=>(r(e,"loaded"),Promise.resolve());return n[e]?a():Ba.ScriptLoader.add(s).then(a)},waitFor:i}};Fa.languageLoad=!0,Fa.baseURL="",Fa.PluginManager=Fa(),Fa.ThemeManager=Fa(),Fa.ModelManager=Fa();const Ua=e=>{const t=Da(I.none()),n=()=>t.get().each((e=>clearInterval(e)));return{clear:()=>{n(),t.set(I.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:o=>{n(),t.set(I.some(setInterval(o,e)))}}},za=()=>{const e=(e=>{const t=Da(I.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(I.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(I.some(e))}}})(E);return{...e,on:t=>e.get().each(t)}},ja=(e,t)=>{let n=null;return{cancel:()=>{h(n)||(clearTimeout(n),n=null)},throttle:(...o)=>{h(n)&&(n=setTimeout((()=>{n=null,e.apply(null,o)}),t))}}},Ha=(e,t)=>{let n=null;const o=()=>{h(n)||(clearTimeout(n),n=null)};return{cancel:o,throttle:(...r)=>{o(),n=setTimeout((()=>{n=null,e.apply(null,r)}),t)}}},$a=N("mce-annotation"),Va=N("data-mce-annotation"),qa=N("data-mce-annotation-uid"),Wa=N("data-mce-annotation-active"),Ka=N("data-mce-annotation-classes"),Ga=N("data-mce-annotation-attrs"),Ya=e=>t=>En(t,e),Xa=(e,t)=>{const n=e.selection.getRng(),o=yn(n.startContainer),r=yn(e.getBody()),s=t.fold((()=>"."+$a()),(e=>`[${Va()}="${e}"]`)),a=In(o,n.startOffset).getOr(o);return to(a,s,Ya(r)).bind((t=>tn(t,`${qa()}`).bind((n=>tn(t,`${Va()}`).map((t=>{const o=Ja(e,n);return{uid:n,name:t,elements:o}}))))))},Qa=(e,t)=>nn(e,"data-mce-bogus")||Uo(e,'[data-mce-bogus="all"]',Ya(t)),Ja=(e,t)=>{const n=yn(e.getBody()),o=Fo(n,`[${qa()}="${t}"]`);return G(o,(e=>!Qa(e,n)))},Za=(e,t)=>{const n=yn(e.getBody()),o=Fo(n,`[${Va()}="${t}"]`),r={};return q(o,(e=>{if(!Qa(e,n)){const t=en(e,qa()),n=xe(r,t).getOr([]);r[t]=n.concat([e])}})),r};let ei=0;const ti=e=>{const t=(new Date).getTime(),n=Math.floor(1e9*Math.random());return ei++,e+"_"+n+ei+String(t)},ni=(e,t)=>yn(e.dom.cloneNode(t)),oi=e=>ni(e,!1),ri=e=>ni(e,!0),si=(e,t,n=L)=>{const o=new zo(e,t),r=e=>{let t;do{t=o[e]()}while(t&&!Jo(t)&&!n(t));return I.from(t).filter(Jo)};return{current:()=>I.from(o.current()).filter(Jo),next:()=>r("next"),prev:()=>r("prev"),prev2:()=>r("prev2")}},ai=(e,t)=>{const n=t||(t=>e.isBlock(t)||rr(t)||ir(t)),o=(e,t,n,r)=>{if(Jo(e)){const n=r(e,t,e.data);if(-1!==n)return I.some({container:e,offset:n})}return n().bind((e=>o(e.container,e.offset,n,r)))};return{backwards:(t,r,s,a)=>{const i=si(t,null!=a?a:e.getRoot(),n);return o(t,r,(()=>i.prev().map((e=>({container:e,offset:e.length})))),s).getOrNull()},forwards:(t,r,s,a)=>{const i=si(t,null!=a?a:e.getRoot(),n);return o(t,r,(()=>i.next().map((e=>({container:e,offset:0})))),s).getOrNull()}}},ii=Math.round,li=e=>e?{left:ii(e.left),top:ii(e.top),bottom:ii(e.bottom),right:ii(e.right),width:ii(e.width),height:ii(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},di=(e,t)=>(e=li(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e),ci=(e,t,n)=>e>=0&&e<=Math.min(t.height,n.height)/2,ui=(e,t)=>{const n=Math.min(t.height/2,e.height/2);return e.bottom-nt.bottom)&&ci(t.top-e.bottom,e,t)},mi=(e,t)=>e.top>t.bottom||!(e.bottom{const o=Math.max(Math.min(t,e.left+e.width),e.left),r=Math.max(Math.min(n,e.top+e.height),e.top);return Math.sqrt((t-o)*(t-o)+(n-r)*(n-r))},gi=e=>{const t=e.startContainer,n=e.startOffset;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},pi=(e,t)=>{if($o(e)&&e.hasChildNodes()){const n=e.childNodes,o=((e,t,n)=>Math.min(Math.max(e,0),n))(t,0,n.length-1);return n[o]}return e},hi=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),bi=e=>m(e)&&e.charCodeAt(0)>=768&&hi.test(e),vi=$o,yi=ss,Ci=Wo("display","block table"),wi=Wo("float","left right"),xi=((...e)=>t=>{for(let n=0;nt<0&&$o(e)&&e.hasChildNodes()?void 0:pi(e,t),Ri=e=>e?e.createRange():Oa.DOM.createRng(),Ai=e=>m(e)&&/[\r\n\t ]/.test(e),Oi=e=>!!e.setStart&&!!e.setEnd,Ti=e=>{const t=e.startContainer,n=e.startOffset;if(Ai(e.toString())&&ki(t.parentNode)&&Jo(t)){const e=t.data;if(Ai(e[n-1])||Ai(e[n+1]))return!0}return!1},Bi=e=>0===e.left&&0===e.right&&0===e.top&&0===e.bottom,Di=e=>{var t;let n;const o=e.getClientRects();return n=o.length>0?li(o[0]):li(e.getBoundingClientRect()),!Oi(e)&&Si(e)&&Bi(n)?(e=>{const t=e.ownerDocument,n=Ri(t),o=t.createTextNode(pr),r=e.parentNode;r.insertBefore(o,e),n.setStart(o,0),n.setEnd(o,1);const s=li(n.getBoundingClientRect());return r.removeChild(o),s})(e):Bi(n)&&Oi(e)&&null!==(t=(e=>{const t=e.startContainer,n=e.endContainer,o=e.startOffset,r=e.endOffset;if(t===n&&Jo(n)&&0===o&&1===r){const t=e.cloneRange();return t.setEndAfter(n),Di(t)}return null})(e))&&void 0!==t?t:n},Pi=(e,t)=>{const n=di(e,t);return n.width=1,n.right=n.left+1,n},Li=(e,t,n)=>{const o=()=>(n||(n=(e=>{const t=[],n=e=>{var n,o;0!==e.height&&(t.length>0&&(n=e,o=t[t.length-1],n.left===o.left&&n.top===o.top&&n.bottom===o.bottom&&n.right===o.right)||t.push(e))},o=(e,t)=>{const o=Ri(e.ownerDocument);if(t0&&(o.setStart(e,t-1),o.setEnd(e,t),Ti(o)||n(Pi(Di(o),!1))),t{const n=Ri(e.ownerDocument);return n.setStart(e,t),n.setEnd(e,t),n},getClientRects:o,isVisible:()=>o().length>0,isAtStart:()=>(Ei(e),0===t),isAtEnd:()=>Ei(e)?t>=e.data.length:t>=e.childNodes.length,isEqual:n=>n&&e===n.container()&&t===n.offset(),getNode:n=>Ni(e,n?t-1:t)}};Li.fromRangeStart=e=>Li(e.startContainer,e.startOffset),Li.fromRangeEnd=e=>Li(e.endContainer,e.endOffset),Li.after=e=>Li(e.parentNode,_i(e)+1),Li.before=e=>Li(e.parentNode,_i(e)),Li.isAbove=(e,t)=>Mt(le(t.getClientRects()),de(e.getClientRects()),ui).getOr(!1),Li.isBelow=(e,t)=>Mt(de(t.getClientRects()),le(e.getClientRects()),mi).getOr(!1),Li.isAtStart=e=>!!e&&e.isAtStart(),Li.isAtEnd=e=>!!e&&e.isAtEnd(),Li.isTextPosition=e=>!!e&&Jo(e.container()),Li.isElementPosition=e=>!Li.isTextPosition(e);const Mi=(e,t)=>{Jo(t)&&0===t.data.length&&e.remove(t)},Ii=(e,t,n)=>{or(n)?((e,t,n)=>{const o=I.from(n.firstChild),r=I.from(n.lastChild);t.insertNode(n),o.each((t=>Mi(e,t.previousSibling))),r.each((t=>Mi(e,t.nextSibling)))})(e,t,n):((e,t,n)=>{t.insertNode(n),Mi(e,n.previousSibling),Mi(e,n.nextSibling)})(e,t,n)},Fi=Jo,Ui=Go,zi=Oa.nodeIndex,ji=e=>{const t=e.parentNode;return Ui(t)?ji(t):t},Hi=e=>e?Te(e.childNodes,((e,t)=>(Ui(t)&&"BR"!==t.nodeName?e=e.concat(Hi(t)):e.push(t),e)),[]):[],$i=e=>t=>e===t,Vi=e=>(Fi(e)?"text()":e.nodeName.toLowerCase())+"["+(e=>{let t,n;t=Hi(ji(e)),n=Be(t,$i(e),e),t=t.slice(0,n+1);const o=Te(t,((e,n,o)=>(Fi(n)&&Fi(t[o-1])&&e++,e)),0);return t=Oe(t,qo([e.nodeName])),n=Be(t,$i(e),e),n-o})(e)+"]",qi=(e,t)=>{let n,o=[],r=t.container(),s=t.offset();if(Fi(r))n=((e,t)=>{let n=e;for(;(n=n.previousSibling)&&Fi(n);)t+=n.data.length;return t})(r,s);else{const e=r.childNodes;s>=e.length?(n="after",s=e.length-1):n="before",r=e[s]}o.push(Vi(r));let a=((e,t,n)=>{const o=[];for(let n=t.parentNode;n&&n!==e;n=n.parentNode)o.push(n);return o})(e,r);return a=Oe(a,T(Go)),o=o.concat(Ae(a,(e=>Vi(e)))),o.reverse().join("/")+","+n},Wi=(e,t)=>{if(!t)return null;const n=t.split(","),o=n[0].split("/"),r=n.length>1?n[1]:"before",s=Te(o,((e,t)=>{const n=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);return n?("text()"===n[1]&&(n[1]="#text"),((e,t,n)=>{let o=Hi(e);return o=Oe(o,((e,t)=>!Fi(e)||!Fi(o[t-1]))),o=Oe(o,qo([t])),o[n]})(e,n[1],parseInt(n[2],10))):null}),e);if(!s)return null;if(!Fi(s)&&s.parentNode){let e;return e="after"===r?zi(s)+1:zi(s),Li(s.parentNode,e)}return((e,t)=>{let n=e,o=0;for(;Fi(n);){const r=n.data.length;if(t>=o&&t<=o+r){e=n,t-=o;break}if(!Fi(n.nextSibling)){e=n,t=r;break}o+=r,n=n.nextSibling}return Fi(e)&&t>e.data.length&&(t=e.data.length),Li(e,t)})(s,parseInt(r,10))},Ki=ir,Gi=(e,t,n,o,r)=>{const s=r?o.startContainer:o.endContainer;let a=r?o.startOffset:o.endOffset;const i=[],l=e.getRoot();if(Jo(s))i.push(n?((e,t,n)=>{let o=e(t.data.slice(0,n)).length;for(let n=t.previousSibling;n&&Jo(n);n=n.previousSibling)o+=e(n.data).length;return o})(t,s,a):a);else{let t=0;const o=s.childNodes;a>=o.length&&o.length&&(t=1,a=Math.max(0,o.length-1)),i.push(e.nodeIndex(o[a],n)+t)}for(let t=s;t&&t!==l;t=t.parentNode)i.push(e.nodeIndex(t,n));return i},Yi=(e,t,n)=>{let o=0;return Dt.each(e.select(t),(e=>"all"===e.getAttribute("data-mce-bogus")?void 0:e!==n&&void o++)),o},Xi=(e,t)=>{let n=t?e.startContainer:e.endContainer,o=t?e.startOffset:e.endOffset;if($o(n)&&"TR"===n.nodeName){const r=n.childNodes;n=r[Math.min(t?o:o-1,r.length-1)],n&&(o=t?0:n.childNodes.length,t?e.setStart(n,o):e.setEnd(n,o))}},Qi=e=>(Xi(e,!0),Xi(e,!1),e),Ji=(e,t)=>{if($o(e)&&(e=pi(e,t),Ki(e)))return e;if($r(e)){Jo(e)&&jr(e)&&(e=e.parentNode);let t=e.previousSibling;if(Ki(t))return t;if(t=e.nextSibling,Ki(t))return t}},Zi=(e,t,n)=>{const o=n.getNode(),r=n.getRng();if("IMG"===o.nodeName||Ki(o)){const e=o.nodeName;return{name:e,index:Yi(n.dom,e,o)}}const s=(e=>Ji(e.startContainer,e.startOffset)||Ji(e.endContainer,e.endOffset))(r);if(s){const e=s.tagName;return{name:e,index:Yi(n.dom,e,s)}}return((e,t,n,o)=>{const r=t.dom,s=Gi(r,e,n,o,!0),a=t.isForward(),i=Xr(o)?{isFakeCaret:!0}:{};return t.isCollapsed()?{start:s,forward:a,...i}:{start:s,end:Gi(r,e,n,o,!1),forward:a,...i}})(e,n,t,r)},el=(e,t,n)=>{const o={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",o,""):e.create("span",o)},tl=(e,t)=>{const n=e.dom;let o=e.getRng();const r=n.uniqueId(),s=e.isCollapsed(),a=e.getNode(),i=a.nodeName,l=e.isForward();if("IMG"===i)return{name:i,index:Yi(n,i,a)};const d=Qi(o.cloneRange());if(!s){d.collapse(!1);const e=el(n,r+"_end",t);Ii(n,d,e)}o=Qi(o),o.collapse(!0);const c=el(n,r+"_start",t);return Ii(n,o,c),e.moveToBookmark({id:r,keep:!0,forward:l}),{id:r,forward:l}},nl=O(Zi,R,!0),ol=e=>{const t=t=>t(e),n=N(e),o=()=>r,r={tag:!0,inner:e,fold:(t,n)=>n(e),isValue:M,isError:L,map:t=>sl.value(t(e)),mapError:o,bind:t,exists:t,forall:t,getOr:n,or:o,getOrThunk:n,orThunk:o,getOrDie:n,each:t=>{t(e)},toOptional:()=>I.some(e)};return r},rl=e=>{const t=()=>n,n={tag:!1,inner:e,fold:(t,n)=>t(e),isValue:L,isError:M,map:t,mapError:t=>sl.error(t(e)),bind:t,exists:L,forall:M,getOr:R,or:R,getOrThunk:D,orThunk:D,getOrDie:B(String(e)),each:E,toOptional:I.none};return n},sl={value:ol,error:rl,fromOption:(e,t)=>e.fold((()=>rl(t)),ol)},al=e=>{if(!p(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],n={};return q(e,((o,r)=>{const s=me(o);if(1!==s.length)throw new Error("one and only one name per case");const a=s[0],i=o[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!p(i))throw new Error("case arguments must be an array");t.push(a),n[a]=(...n)=>{const o=n.length;if(o!==i.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+o);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,n)},match:e=>{const o=me(e);if(t.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+o.join(","));if(!ne(t,(e=>H(o,e))))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)},log:e=>{console.log(e,{constructors:t,constructor:a,params:n})}}}})),n};al([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const il=e=>"inline-command"===e.type||"inline-format"===e.type,ll=e=>"block-command"===e.type||"block-format"===e.type,dl=e=>{const t=t=>sl.error({message:t,pattern:e}),n=(n,o,r)=>{if(void 0!==e.format){let r;if(p(e.format)){if(!ne(e.format,m))return t(n+" pattern has non-string items in the `format` array");r=e.format}else{if(!m(e.format))return t(n+" pattern has non-string `format` parameter");r=[e.format]}return sl.value(o(r))}return void 0!==e.cmd?m(e.cmd)?sl.value(r(e.cmd,e.value)):t(n+" pattern has non-string `cmd` parameter"):t(n+" pattern is missing both `format` and `cmd` parameters")};if(!f(e))return t("Raw pattern is not an object");if(!m(e.start))return t("Raw pattern is missing `start` parameter");if(void 0!==e.end){if(!m(e.end))return t("Inline pattern has non-string `end` parameter");if(0===e.start.length&&0===e.end.length)return t("Inline pattern has empty `start` and `end` parameters");let o=e.start,r=e.end;return 0===r.length&&(r=o,o=""),n("Inline",(e=>({type:"inline-format",start:o,end:r,format:e})),((e,t)=>({type:"inline-command",start:o,end:r,cmd:e,value:t})))}return void 0!==e.replacement?m(e.replacement)?0===e.start.length?t("Replacement pattern has empty `start` parameter"):sl.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement}):t("Replacement pattern has non-string `replacement` parameter"):0===e.start.length?t("Block pattern has empty `start` parameter"):n("Block",(t=>({type:"block-format",start:e.start,format:t[0]})),((t,n)=>({type:"block-command",start:e.start,cmd:t,value:n})))},cl=e=>G(e,ll),ul=e=>G(e,il),ml=e=>{const t=(e=>{const t=[],n=[];return q(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{n.push(e)}))})),{errors:t,values:n}})(V(e,dl));return q(t.errors,(e=>console.error(e.message,e.pattern))),t.values},fl=xt().deviceType,gl=fl.isTouch(),pl=Oa.DOM,hl=e=>u(e,RegExp),bl=e=>t=>t.options.get(e),vl=e=>m(e)||f(e),yl=(e,t="")=>n=>{const o=m(n);if(o){if(-1!==n.indexOf("=")){const r=(e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return X(t,((e,t)=>{const n=t.split("="),o=n[0],r=n.length>1?n[1]:o;return e[qe(o)]=qe(r),e}),{})})(n);return{value:xe(r,e.id).getOr(t),valid:o}}return{value:n,valid:o}}return{valid:!1,message:"Must be a string."}},Cl=bl("iframe_attrs"),wl=bl("doctype"),xl=bl("document_base_url"),kl=bl("body_id"),El=bl("body_class"),Sl=bl("content_security_policy"),_l=bl("br_in_pre"),Nl=bl("forced_root_block"),Rl=bl("forced_root_block_attrs"),Al=bl("newline_behavior"),Ol=bl("br_newline_selector"),Tl=bl("no_newline_selector"),Bl=bl("keep_styles"),Dl=bl("end_container_on_empty_block"),Pl=bl("automatic_uploads"),Ll=bl("images_reuse_filename"),Ml=bl("images_replace_blob_uris"),Il=bl("icons"),Fl=bl("icons_url"),Ul=bl("images_upload_url"),zl=bl("images_upload_base_path"),jl=bl("images_upload_credentials"),Hl=bl("images_upload_handler"),$l=bl("content_css_cors"),Vl=bl("referrer_policy"),ql=bl("language"),Wl=bl("language_url"),Kl=bl("indent_use_margin"),Gl=bl("indentation"),Yl=bl("content_css"),Xl=bl("content_style"),Ql=bl("font_css"),Jl=bl("directionality"),Zl=bl("inline_boundaries_selector"),ed=bl("object_resizing"),td=bl("resize_img_proportional"),nd=bl("placeholder"),od=bl("event_root"),rd=bl("service_message"),sd=bl("theme"),ad=bl("theme_url"),id=bl("model"),ld=bl("model_url"),dd=bl("inline_boundaries"),cd=bl("formats"),ud=bl("preview_styles"),md=bl("format_empty_lines"),fd=bl("format_noneditable_selector"),gd=bl("custom_ui_selector"),pd=bl("inline"),hd=bl("hidden_input"),bd=bl("submit_patch"),vd=bl("add_form_submit_trigger"),yd=bl("add_unload_trigger"),Cd=bl("custom_undo_redo_levels"),wd=bl("disable_nodechange"),xd=bl("readonly"),kd=bl("editable_root"),Ed=bl("content_css_cors"),Sd=bl("plugins"),_d=bl("external_plugins"),Nd=bl("block_unsupported_drop"),Rd=bl("visual"),Ad=bl("visual_table_class"),Od=bl("visual_anchor_class"),Td=bl("iframe_aria_text"),Bd=bl("setup"),Dd=bl("init_instance_callback"),Pd=bl("urlconverter_callback"),Ld=bl("auto_focus"),Md=bl("browser_spellcheck"),Id=bl("protect"),Fd=bl("paste_block_drop"),Ud=bl("paste_data_images"),zd=bl("paste_preprocess"),jd=bl("paste_postprocess"),Hd=bl("newdocument_content"),$d=bl("paste_webkit_styles"),Vd=bl("paste_remove_styles_if_webkit"),qd=bl("paste_merge_formats"),Wd=bl("smart_paste"),Kd=bl("paste_as_text"),Gd=bl("paste_tab_spaces"),Yd=bl("allow_html_data_urls"),Xd=bl("text_patterns"),Qd=bl("text_patterns_lookup"),Jd=bl("noneditable_class"),Zd=bl("editable_class"),ec=bl("noneditable_regexp"),tc=bl("preserve_cdata"),nc=bl("highlight_on_focus"),oc=bl("xss_sanitization"),rc=bl("init_content_sync"),sc=e=>Dt.explode(e.options.get("images_file_types")),ac=bl("table_tab_navigation"),ic=bl("details_initial_state"),lc=bl("details_serialized_state"),dc=$o,cc=Jo,uc=e=>{const t=e.parentNode;t&&t.removeChild(e)},mc=e=>{const t=Fr(e);return{count:e.length-t.length,text:t}},fc=e=>{let t;for(;-1!==(t=e.data.lastIndexOf(Mr));)e.deleteData(t,1)},gc=(e,t)=>(hc(e),t),pc=(e,t)=>Li.isTextPosition(t)?((e,t)=>cc(e)&&t.container()===e?((e,t)=>{const n=mc(e.data.substr(0,t.offset())),o=mc(e.data.substr(t.offset()));return(n.text+o.text).length>0?(fc(e),Li(e,t.offset()-n.count)):t})(e,t):gc(e,t))(e,t):((e,t)=>t.container()===e.parentNode?((e,t)=>{const n=t.container(),o=((e,t)=>{const n=j(e,t);return-1===n?I.none():I.some(n)})(ce(n.childNodes),e).map((e=>e{dc(e)&&$r(e)&&(Vr(e)?e.removeAttribute("data-mce-caret"):uc(e)),cc(e)&&(fc(e),0===e.data.length&&uc(e))},bc=ir,vc=cr,yc=lr,Cc=(e,t,n)=>{const o=di(t.getBoundingClientRect(),n);let r,s;if("BODY"===e.tagName){const t=e.ownerDocument.documentElement;r=e.scrollLeft||t.scrollLeft,s=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();r=e.scrollLeft-t.left,s=e.scrollTop-t.top}o.left+=r,o.right+=r,o.top+=s,o.bottom+=s,o.width=1;let a=t.offsetWidth-t.clientWidth;return a>0&&(n&&(a*=-1),o.left+=a,o.right+=a),o},wc=(e,t,n,o)=>{const r=za();let s,a;const i=Nl(e),l=e.dom,d=()=>{(e=>{var t,n;const o=Fo(yn(e),"*[contentEditable=false],video,audio,embed,object");for(let e=0;e{l.remove(e.caret),r.clear()})),s&&(clearInterval(s),s=void 0)};return{show:(e,c)=>{let u;if(d(),yc(c))return null;if(!n(c))return a=((e,t)=>{var n;const o=(null!==(n=e.ownerDocument)&&void 0!==n?n:document).createTextNode(Mr),r=e.parentNode;if(t){const t=e.previousSibling;if(zr(t)){if($r(t))return t;if(Gr(t))return t.splitText(t.data.length-1)}null==r||r.insertBefore(o,e)}else{const t=e.nextSibling;if(zr(t)){if($r(t))return t;if(Kr(t))return t.splitText(1),t}e.nextSibling?null==r||r.insertBefore(o,e.nextSibling):null==r||r.appendChild(o)}return o})(c,e),u=c.ownerDocument.createRange(),kc(a.nextSibling)?(u.setStart(a,0),u.setEnd(a,0)):(u.setStart(a,1),u.setEnd(a,1)),u;{const n=((e,t,n)=>{var o;const r=(null!==(o=t.ownerDocument)&&void 0!==o?o:document).createElement(e);r.setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(Dr().dom);const s=t.parentNode;return n?null==s||s.insertBefore(r,t):t.nextSibling?null==s||s.insertBefore(r,t.nextSibling):null==s||s.appendChild(r),r})(i,c,e),d=Cc(t,c,e);l.setStyle(n,"top",d.top),a=n;const m=l.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});l.setStyles(m,{...d}),l.add(t,m),r.set({caret:m,element:c,before:e}),e&&l.addClass(m,"mce-visual-caret-before"),s=setInterval((()=>{r.on((e=>{o()?l.toggleClass(e.caret,"mce-visual-caret-hidden"):l.addClass(e.caret,"mce-visual-caret-hidden")}))}),500),u=c.ownerDocument.createRange(),u.setStart(n,0),u.setEnd(n,0)}return u},hide:d,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{r.on((e=>{const n=Cc(t,e.element,e.before);l.setStyles(e.caret,{...n})}))},destroy:()=>clearInterval(s)}},xc=()=>At.browser.isFirefox(),kc=e=>bc(e)||vc(e),Ec=e=>(kc(e)||Yo(e)&&xc())&&On(yn(e)).exists(no),Sc=ar,_c=ir,Nc=cr,Rc=Wo("display","block table table-cell table-caption list-item"),Ac=$r,Oc=jr,Tc=$o,Bc=Jo,Dc=ss,Pc=e=>e>0,Lc=e=>e<0,Mc=(e,t)=>{let n;for(;n=e(t);)if(!Oc(n))return n;return null},Ic=(e,t,n,o,r)=>{const s=new zo(e,o),a=_c(e)||Oc(e);let i;if(Lc(t)){if(a&&(i=Mc(s.prev.bind(s),!0),n(i)))return i;for(;i=Mc(s.prev.bind(s),r);)if(n(i))return i}if(Pc(t)){if(a&&(i=Mc(s.next.bind(s),!0),n(i)))return i;for(;i=Mc(s.next.bind(s),r);)if(n(i))return i}return null},Fc=(e,t)=>{for(;e&&e!==t;){if(Rc(e))return e;e=e.parentNode}return null},Uc=(e,t,n)=>Fc(e.container(),n)===Fc(t.container(),n),zc=(e,t)=>{if(!t)return I.none();const n=t.container(),o=t.offset();return Tc(n)?I.from(n.childNodes[o+e]):I.none()},jc=(e,t)=>{var n;const o=(null!==(n=t.ownerDocument)&&void 0!==n?n:document).createRange();return e?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)),o},Hc=(e,t,n)=>Fc(t,e)===Fc(n,e),$c=(e,t,n)=>{const o=e?"previousSibling":"nextSibling";let r=n;for(;r&&r!==t;){let e=r[o];if(e&&Ac(e)&&(e=e[o]),_c(e)||Nc(e)){if(Hc(t,e,r))return e;break}if(Dc(e))break;r=r.parentNode}return null},Vc=O(jc,!0),qc=O(jc,!1),Wc=(e,t,n)=>{let o;const r=O($c,!0,t),s=O($c,!1,t),a=n.startContainer,i=n.startOffset;if(jr(a)){const e=Bc(a)?a.parentNode:a,t=e.getAttribute("data-mce-caret");if("before"===t&&(o=e.nextSibling,Ec(o)))return Vc(o);if("after"===t&&(o=e.previousSibling,Ec(o)))return qc(o)}if(!n.collapsed)return n;if(Jo(a)){if(Ac(a)){if(1===e){if(o=s(a),o)return Vc(o);if(o=r(a),o)return qc(o)}if(-1===e){if(o=r(a),o)return qc(o);if(o=s(a),o)return Vc(o)}return n}if(Gr(a)&&i>=a.data.length-1)return 1===e&&(o=s(a),o)?Vc(o):n;if(Kr(a)&&i<=1)return-1===e&&(o=r(a),o)?qc(o):n;if(i===a.data.length)return o=s(a),o?Vc(o):n;if(0===i)return o=r(a),o?qc(o):n}return n},Kc=(e,t)=>zc(e?0:-1,t).filter(_c),Gc=(e,t,n)=>{const o=Wc(e,t,n);return-1===e?Li.fromRangeStart(o):Li.fromRangeEnd(o)},Yc=e=>I.from(e.getNode()).map(yn),Xc=(e,t)=>{let n=t;for(;n=e(n);)if(n.isVisible())return n;return n},Qc=(e,t)=>{const n=Uc(e,t);return!(n||!rr(e.getNode()))||n};var Jc;!function(e){e[e.Backwards=-1]="Backwards",e[e.Forwards=1]="Forwards"}(Jc||(Jc={}));const Zc=ir,eu=Jo,tu=$o,nu=rr,ou=ss,ru=e=>ns(e)||(e=>!!as(e)&&!X(ce(e.getElementsByTagName("*")),((e,t)=>e||Qr(t)),!1))(e),su=is,au=(e,t)=>e.hasChildNodes()&&t{if(Pc(e)){if(ou(t.previousSibling)&&!eu(t.previousSibling))return Li.before(t);if(eu(t))return Li(t,0)}if(Lc(e)){if(ou(t.nextSibling)&&!eu(t.nextSibling))return Li.after(t);if(eu(t))return Li(t,t.data.length)}return Lc(e)?nu(t)?Li.before(t):Li.after(t):Li.before(t)},lu=(e,t,n)=>{let o,r,s,a;if(!tu(n)||!t)return null;if(t.isEqual(Li.after(n))&&n.lastChild){if(a=Li.after(n.lastChild),Lc(e)&&ou(n.lastChild)&&tu(n.lastChild))return nu(n.lastChild)?Li.before(n.lastChild):a}else a=t;const i=a.container();let l=a.offset();if(eu(i)){if(Lc(e)&&l>0)return Li(i,--l);if(Pc(e)&&l0&&(r=au(i,l-1),ou(r)))return!ru(r)&&(s=Ic(r,e,su,r),s)?eu(s)?Li(s,s.data.length):Li.after(s):eu(r)?Li(r,r.data.length):Li.before(r);if(Pc(e)&&l{const n=t.nextSibling;return n&&ou(n)?eu(n)?Li(n,0):Li.before(n):lu(Jc.Forwards,Li.after(t),e)})(n,r):!ru(r)&&(s=Ic(r,e,su,r),s)?eu(s)?Li(s,0):Li.before(s):eu(r)?Li(r,0):Li.after(r);o=r||a.getNode()}if(o&&(Pc(e)&&a.isAtEnd()||Lc(e)&&a.isAtStart())&&(o=Ic(o,e,M,n,!0),su(o,n)))return iu(e,o);r=o?Ic(o,e,su,n):o;const d=De(G(((e,t)=>{const n=[];let o=e;for(;o&&o!==t;)n.push(o),o=o.parentNode;return n})(i,n),Zc));return!d||r&&d.contains(r)?r?iu(e,r):null:(a=Pc(e)?Li.after(d):Li.before(d),a)},du=e=>({next:t=>lu(Jc.Forwards,t,e),prev:t=>lu(Jc.Backwards,t,e)}),cu=e=>Li.isTextPosition(e)?0===e.offset():ss(e.getNode()),uu=e=>{if(Li.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}return ss(e.getNode(!0))},mu=(e,t)=>!Li.isTextPosition(e)&&!Li.isTextPosition(t)&&e.getNode()===t.getNode(!0),fu=(e,t,n)=>{const o=du(t);return I.from(e?o.next(n):o.prev(n))},gu=(e,t,n)=>fu(e,t,n).bind((o=>Uc(n,o,t)&&((e,t,n)=>{return e?!mu(t,n)&&(o=t,!(!Li.isTextPosition(o)&&rr(o.getNode())))&&uu(t)&&cu(n):!mu(n,t)&&cu(t)&&uu(n);var o})(e,n,o)?fu(e,t,o):I.some(o))),pu=(e,t,n,o)=>gu(e,t,n).bind((n=>o(n)?pu(e,t,n,o):I.some(n))),hu=(e,t)=>{const n=e?t.firstChild:t.lastChild;return Jo(n)?I.some(Li(n,e?0:n.data.length)):n?ss(n)?I.some(e?Li.before(n):rr(o=n)?Li.before(o):Li.after(o)):((e,t,n)=>{const o=e?Li.before(n):Li.after(n);return fu(e,t,o)})(e,t,n):I.none();var o},bu=O(fu,!0),vu=O(fu,!1),yu=O(hu,!0),Cu=O(hu,!1),wu="_mce_caret",xu=e=>$o(e)&&e.id===wu,ku=(e,t)=>{let n=t;for(;n&&n!==e;){if(xu(n))return n;n=n.parentNode}return null},Eu=e=>ke(e,"name"),Su=e=>Dt.isArray(e.start),_u=e=>!(!Eu(e)&&b(e.forward))||e.forward,Nu=(e,t)=>($o(t)&&e.isBlock(t)&&!t.innerHTML&&(t.innerHTML='
'),t),Ru=(e,t)=>Cu(e).fold(L,(e=>(t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0))),Au=(e,t,n)=>!(!(e=>!e.hasChildNodes())(t)||!ku(e,t)||(((e,t)=>{var n;const o=(null!==(n=e.ownerDocument)&&void 0!==n?n:document).createTextNode(Mr);e.appendChild(o),t.setStart(o,0),t.setEnd(o,0)})(t,n),0)),Ou=(e,t,n,o)=>{const r=n[t?"start":"end"],s=e.getRoot();if(r){let e=s,n=r[0];for(let t=r.length-1;e&&t>=1;t--){const n=e.childNodes;if(Au(s,e,o))return!0;if(r[t]>n.length-1)return!!Au(s,e,o)||Ru(e,o);e=n[r[t]]}Jo(e)&&(n=Math.min(r[0],e.data.length)),$o(e)&&(n=Math.min(r[0],e.childNodes.length)),t?o.setStart(e,n):o.setEnd(e,n)}return!0},Tu=e=>Jo(e)&&e.data.length>0,Bu=(e,t,n)=>{const o=e.get(n.id+"_"+t),r=null==o?void 0:o.parentNode,s=n.keep;if(o&&r){let a,i;if("start"===t?s?o.hasChildNodes()?(a=o.firstChild,i=1):Tu(o.nextSibling)?(a=o.nextSibling,i=0):Tu(o.previousSibling)?(a=o.previousSibling,i=o.previousSibling.data.length):(a=r,i=e.nodeIndex(o)+1):(a=r,i=e.nodeIndex(o)):s?o.hasChildNodes()?(a=o.firstChild,i=1):Tu(o.previousSibling)?(a=o.previousSibling,i=o.previousSibling.data.length):(a=r,i=e.nodeIndex(o)):(a=r,i=e.nodeIndex(o)),!s){const r=o.previousSibling,s=o.nextSibling;let l;for(Dt.each(Dt.grep(o.childNodes),(e=>{Jo(e)&&(e.data=e.data.replace(/\uFEFF/g,""))}));l=e.get(n.id+"_"+t);)e.remove(l,!0);if(Jo(s)&&Jo(r)&&!At.browser.isOpera()){const t=r.data.length;r.appendData(s.data),e.remove(s),a=r,i=t}}return I.some(Li(a,i))}return I.none()},Du=(e,t,n)=>((e,t,n=!1)=>2===t?Zi(Fr,n,e):3===t?(e=>{const t=e.getRng();return{start:qi(e.dom.getRoot(),Li.fromRangeStart(t)),end:qi(e.dom.getRoot(),Li.fromRangeEnd(t)),forward:e.isForward()}})(e):t?(e=>({rng:e.getRng(),forward:e.isForward()}))(e):tl(e,!1))(e,t,n),Pu=(e,t)=>{((e,t)=>{const n=e.dom;if(t){if(Su(t))return((e,t)=>{const n=e.createRng();return Ou(e,!0,t,n)&&Ou(e,!1,t,n)?I.some({range:n,forward:_u(t)}):I.none()})(n,t);if((e=>m(e.start))(t))return((e,t)=>{const n=I.from(Wi(e.getRoot(),t.start)),o=I.from(Wi(e.getRoot(),t.end));return Mt(n,o,((n,o)=>{const r=e.createRng();return r.setStart(n.container(),n.offset()),r.setEnd(o.container(),o.offset()),{range:r,forward:_u(t)}}))})(n,t);if((e=>ke(e,"id"))(t))return((e,t)=>{const n=Bu(e,"start",t),o=Bu(e,"end",t);return Mt(n,o.or(n),((n,o)=>{const r=e.createRng();return r.setStart(Nu(e,n.container()),n.offset()),r.setEnd(Nu(e,o.container()),o.offset()),{range:r,forward:_u(t)}}))})(n,t);if(Eu(t))return((e,t)=>I.from(e.select(t.name)[t.index]).map((t=>{const n=e.createRng();return n.selectNode(t),{range:n,forward:!0}})))(n,t);if((e=>ke(e,"rng"))(t))return I.some({range:t.rng,forward:_u(t)})}return I.none()})(e,t).each((({range:t,forward:n})=>{e.setRng(t,n)}))},Lu=e=>$o(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type"),Mu=(Iu=pr,e=>Iu===e);var Iu;const Fu=e=>""!==e&&-1!==" \f\n\r\t\v".indexOf(e),Uu=e=>!Fu(e)&&!Mu(e)&&!hr(e),zu=e=>{const t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},ju=e=>(e=>{return{value:(t=e,ze(t,"#").toUpperCase())};var t})(zu(e.red)+zu(e.green)+zu(e.blue)),Hu=/^\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/i,$u=/^\s*rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?(?:\.\d+)?)\s*\)\s*$/i,Vu=(e,t,n,o)=>({red:e,green:t,blue:n,alpha:o}),qu=(e,t,n,o)=>{const r=parseInt(e,10),s=parseInt(t,10),a=parseInt(n,10),i=parseFloat(o);return Vu(r,s,a,i)},Wu=e=>(e=>{if("transparent"===e)return I.some(Vu(0,0,0,0));const t=Hu.exec(e);if(null!==t)return I.some(qu(t[1],t[2],t[3],"1"));const n=$u.exec(e);return null!==n?I.some(qu(n[1],n[2],n[3],n[4])):I.none()})(e).map(ju).map((e=>"#"+e.value)).getOr(e),Ku=e=>{const t=[];if(e)for(let n=0;n{const n=Fo(t,"td[data-mce-selected],th[data-mce-selected]");return n.length>0?n:(e=>G((e=>te(e,(e=>{const t=gi(e);return t?[yn(t)]:[]})))(e),Ar))(e)},Yu=e=>Gu(Ku(e.selection.getSel()),yn(e.getBody())),Xu=(e,t)=>Zn(e,"table",t),Qu=e=>Fn(e).fold(N([e]),(t=>[e].concat(Qu(t)))),Ju=e=>Un(e).fold(N([e]),(t=>"br"===Ht(t)?Bn(t).map((t=>[e].concat(Ju(t)))).getOr([]):[e].concat(Ju(t)))),Zu=(e,t)=>Mt((e=>{const t=e.startContainer,n=e.startOffset;return Jo(t)?0===n?I.some(yn(t)):I.none():I.from(t.childNodes[n]).map(yn)})(t),(e=>{const t=e.endContainer,n=e.endOffset;return Jo(t)?n===t.data.length?I.some(yn(t)):I.none():I.from(t.childNodes[n-1]).map(yn)})(t),((t,n)=>{const o=J(Qu(e),O(En,t)),r=J(Ju(e),O(En,n));return o.isSome()&&r.isSome()})).getOr(!1),em=(e,t,n,o)=>{const r=n,s=new zo(n,r),a=ye(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!H(["td","th","table"],t.toLowerCase())));let i=n;do{if(Jo(i)&&0!==Dt.trim(i.data).length)return void(o?t.setStart(i,0):t.setEnd(i,i.data.length));if(a[i.nodeName])return void(o?t.setStartBefore(i):"BR"===i.nodeName?t.setEndBefore(i):t.setEndAfter(i))}while(i=o?s.next():s.prev());"BODY"===r.nodeName&&(o?t.setStart(r,0):t.setEnd(r,r.childNodes.length))},tm=e=>{const t=e.selection.getSel();return C(t)&&t.rangeCount>0},nm=(e,t)=>{const n=Yu(e);n.length>0?q(n,(n=>{const o=n.dom,r=e.dom.createRng();r.setStartBefore(o),r.setEndAfter(o),t(r,!0)})):t(e.selection.getRng(),!1)},om=(e,t,n)=>{const o=tl(e,t);n(o),e.moveToBookmark(o)},rm=e=>x(null==e?void 0:e.nodeType),sm=e=>$o(e)&&!Lu(e)&&!xu(e)&&!Go(e),am=e=>!0===e.isContentEditable,im=(e,t,n)=>{const{selection:o,dom:r}=e,s=o.getNode(),a=ir(s);om(o,!0,(()=>{t()})),a&&ir(s)&&r.isChildOf(s,e.getBody())?e.selection.select(s):n(o.getStart())&&lm(r,o)},lm=(e,t)=>{var n,o;const r=t.getRng(),{startContainer:s,startOffset:a}=r;if(!((e,t)=>{if(sm(t)&&!/^(TD|TH)$/.test(t.nodeName)){const n=e.getAttrib(t,"data-mce-selected"),o=parseInt(n,10);return!isNaN(o)&&o>0}return!1})(e,t.getNode())&&$o(s)){const i=s.childNodes,l=e.getRoot();let d;if(a{if(e){const o=t?"nextSibling":"previousSibling";for(e=n?e:e[o];e;e=e[o])if($o(e)||!mm(e))return e}},cm=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||As(e,t),um=(e,t,n)=>e.schema.isValidChild(t,n),mm=(e,t=!1)=>{if(C(e)&&Jo(e)){const n=t?e.data.replace(/ /g,"\xa0"):e.data;return ds(n)}return!1},fm=(e,t)=>{const n=e.dom;return sm(t)&&"false"===n.getContentEditable(t)&&((e,t)=>{const n="[data-mce-cef-wrappable]",o=fd(e),r=Ye(o)?n:`${n},${o}`;return xn(yn(t),r)})(e,t)&&0===n.select('[contenteditable="true"]',t).length},gm=(e,t)=>w(e)?e(t):(C(t)&&(e=e.replace(/%(\w+)/g,((e,n)=>t[n]||e))),e),pm=(e,t)=>(t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()),hm=(e,t)=>{if(y(e))return null;{let n=String(e);return"color"!==t&&"backgroundColor"!==t||(n=Wu(n)),"fontWeight"===t&&700===e&&(n="bold"),"fontFamily"===t&&(n=n.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),n}},bm=(e,t,n)=>{const o=e.getStyle(t,n);return hm(o,n)},vm=(e,t)=>{let n;return e.getParent(t,(t=>!!$o(t)&&(n=e.getStyle(t,"text-decoration"),!!n&&"none"!==n))),n},ym=(e,t,n)=>e.getParents(t,n,e.getRoot()),Cm=(e,t,n)=>{const o=e.formatter.get(t);return C(o)&&$(o,n)},wm=e=>Ee(e,"block"),xm=e=>Ee(e,"selector"),km=e=>Ee(e,"inline"),Em=e=>xm(e)&&!1!==e.expand&&!km(e),Sm=Lu,_m=ym,Nm=mm,Rm=cm,Am=(e,t)=>{let n=t;for(;n;){if($o(n)&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},Om=(e,t,n,o)=>{const r=t.data;if(e){for(let e=n;e>0;e--)if(o(r.charAt(e-1)))return e}else for(let e=n;eOm(e,t,n,(e=>Mu(e)||Fu(e))),Bm=(e,t,n)=>Om(e,t,n,Uu),Dm=(e,t,n,o,r,s)=>{let a;const i=e.getParent(n,e.isBlock)||t,l=(t,n,o)=>{const s=ai(e),l=r?s.backwards:s.forwards;return I.from(l(t,n,((e,t)=>Sm(e.parentNode)?-1:(a=e,o(r,e,t))),i))};return l(n,o,Tm).bind((e=>s?l(e.container,e.offset+(r?-1:0),Bm):I.some(e))).orThunk((()=>a?I.some({container:a,offset:r?0:a.length}):I.none()))},Pm=(e,t,n,o,r)=>{const s=o[r];Jo(o)&&Ye(o.data)&&s&&(o=s);const a=_m(e,o);for(let o=0;o{var r;let s=n;const a=e.getRoot(),i=t[0];if(wm(i)&&(s=i.wrapper?null:e.getParent(n,i.block,a)),!s){const t=null!==(r=e.getParent(n,"LI,TD,TH"))&&void 0!==r?r:a;s=e.getParent(Jo(n)?n.parentNode:n,(t=>t!==a&&Rm(e.schema,t)),t)}if(s&&wm(i)&&i.wrapper&&(s=_m(e,s,"ul,ol").reverse()[0]||s),!s)for(s=n;s&&s[o]&&!e.isBlock(s[o])&&(s=s[o],!pm(s,"br")););return s||n},Mm=(e,t,n,o)=>{const r=n.parentNode;return!C(n[o])&&(!(r!==t&&!y(r)&&!e.isBlock(r))||Mm(e,t,r,o))},Im=(e,t,n,o,r)=>{let s=n;const a=r?"previousSibling":"nextSibling",i=e.getRoot();if(Jo(n)&&!Nm(n)&&(r?o>0:oSm(e.parentNode)||Sm(e),Um=(e,t,n,o=!1)=>{let{startContainer:r,startOffset:s,endContainer:a,endOffset:i}=t;const l=n[0];return $o(r)&&r.hasChildNodes()&&(r=pi(r,s),Jo(r)&&(s=0)),$o(a)&&a.hasChildNodes()&&(a=pi(a,t.collapsed?i:i-1),Jo(a)&&(i=a.data.length)),r=Am(e,r),a=Am(e,a),Fm(r)&&(r=Sm(r)?r:r.parentNode,r=t.collapsed?r.previousSibling||r:r.nextSibling||r,Jo(r)&&(s=t.collapsed?r.length:0)),Fm(a)&&(a=Sm(a)?a:a.parentNode,a=t.collapsed?a.nextSibling||a:a.previousSibling||a,Jo(a)&&(i=t.collapsed?0:a.length)),t.collapsed&&(Dm(e,e.getRoot(),r,s,!0,o).each((({container:e,offset:t})=>{r=e,s=t})),Dm(e,e.getRoot(),a,i,!1,o).each((({container:e,offset:t})=>{a=e,i=t}))),(km(l)||l.block_expand)&&(km(l)&&Jo(r)&&0!==s||(r=Im(e,n,r,s,!0)),km(l)&&Jo(a)&&i!==a.data.length||(a=Im(e,n,a,i,!1))),Em(l)&&(r=Pm(e,n,t,r,"previousSibling"),a=Pm(e,n,t,a,"nextSibling")),(wm(l)||xm(l))&&(r=Lm(e,n,r,"previousSibling"),a=Lm(e,n,a,"nextSibling"),wm(l)&&(e.isBlock(r)||(r=Im(e,n,r,s,!0)),e.isBlock(a)||(a=Im(e,n,a,i,!1)))),$o(r)&&r.parentNode&&(s=e.nodeIndex(r),r=r.parentNode),$o(a)&&a.parentNode&&(i=e.nodeIndex(a)+1,a=a.parentNode),{startContainer:r,startOffset:s,endContainer:a,endOffset:i}},zm=(e,t,n)=>{var o;const r=t.startOffset,s=pi(t.startContainer,r),a=t.endOffset,i=pi(t.endContainer,a-1),l=e=>{const t=e[0];Jo(t)&&t===s&&r>=t.data.length&&e.splice(0,1);const n=e[e.length-1];return 0===a&&e.length>0&&n===i&&Jo(n)&&e.splice(e.length-1,1),e},d=(e,t,n)=>{const o=[];for(;e&&e!==n;e=e[t])o.push(e);return o},c=(t,n)=>e.getParent(t,(e=>e.parentNode===n),n),u=(e,t,o)=>{const r=o?"nextSibling":"previousSibling";for(let s=e,a=s.parentNode;s&&s!==t;s=a){a=s.parentNode;const t=d(s===e?s:s[r],r);t.length&&(o||t.reverse(),n(l(t)))}};if(s===i)return n(l([s]));const m=null!==(o=e.findCommonAncestor(s,i))&&void 0!==o?o:e.getRoot();if(e.isChildOf(s,i))return u(s,m,!0);if(e.isChildOf(i,s))return u(i,m);const f=c(s,m)||s,g=c(i,m)||i;u(s,f,!0);const p=d(f===s?f:f.nextSibling,"nextSibling",g===i?g.nextSibling:g);p.length&&n(l(p)),u(i,g)},jm=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"],Hm=(e,t,n,o,r,s)=>{const{uid:a=t,...i}=n;un(e,$a()),Jt(e,`${qa()}`,a),Jt(e,`${Va()}`,o);const{attributes:l={},classes:d=[]}=r(a,i);if(Zt(e,l),((e,t)=>{q(t,(t=>{un(e,t)}))})(e,d),s){d.length>0&&Jt(e,`${Ka()}`,d.join(","));const t=me(l);t.length>0&&Jt(e,`${Ga()}`,t.join(","))}},$m=(e,t,n,o,r)=>{const s=bn("span",e);return Hm(s,t,n,o,r,!1),s},Vm=(e,t,n,o,r,s)=>{const a=[],i=$m(e.getDoc(),n,s,o,r),l=za(),d=()=>{l.clear()},c=e=>{q(e,u)},u=t=>{switch(((e,t,n,o)=>An(t).fold((()=>"skipping"),(r=>"br"===o||(e=>Kt(e)&&vr(e)===Mr)(t)?"valid":(e=>Wt(e)&&gn(e,$a()))(t)?"existing":xu(t.dom)?"caret":$(jm,(e=>xn(t,e)))?"valid-block":um(e,n,o)&&um(e,Ht(r),n)?"valid":"invalid-child")))(e,t,"span",Ht(t))){case"invalid-child":{d();const e=Mn(t);c(e),d();break}case"valid-block":d(),Hm(t,n,s,o,r,!0);break;case"valid":{const e=l.get().getOrThunk((()=>{const e=oi(i);return a.push(e),l.set(e),e}));vo(t,e);break}}};return zm(e.dom,t,(e=>{d(),(e=>{const t=V(e,yn);c(t)})(e)})),a},qm=e=>{const t=(()=>{const e={};return{register:(t,n)=>{e[t]={name:t,settings:n}},lookup:t=>xe(e,t).map((e=>e.settings)),getNames:()=>me(e)}})();((e,t)=>{const n=Va(),o=e=>I.from(e.attr(n)).bind(t.lookup),r=e=>{var t,n;e.attr(qa(),null),e.attr(Va(),null),e.attr(Wa(),null);const o=I.from(e.attr(Ga())).map((e=>e.split(","))).getOr([]),r=I.from(e.attr(Ka())).map((e=>e.split(","))).getOr([]);q(o,(t=>e.attr(t,null)));const s=null!==(n=null===(t=e.attr("class"))||void 0===t?void 0:t.split(" "))&&void 0!==n?n:[],a=re(s,[$a()].concat(r));e.attr("class",a.length>0?a.join(" "):null),e.attr(Ka(),null),e.attr(Ga(),null)};e.serializer.addTempAttr(Wa()),e.serializer.addAttributeFilter(n,(e=>{for(const t of e)o(t).each((e=>{!1===e.persistent&&("span"===t.name?t.unwrap():r(t))}))}))})(e,t);const n=((e,t)=>{const n=Da({}),o=()=>({listeners:[],previous:za()}),r=(e,t)=>{s(e,(e=>(t(e),e)))},s=(e,t)=>{const r=n.get(),s=t(xe(r,e).getOrThunk(o));r[e]=s,n.set(r)},a=(t,n)=>{q(Ja(e,t),(e=>{n?Jt(e,Wa(),"true"):on(e,Wa())}))},i=Ha((()=>{const n=ae(t.getNames());q(n,(t=>{s(t,(n=>{const o=n.previous.get();return Xa(e,I.some(t)).fold((()=>{o.each((e=>{(e=>{r(e,(t=>{q(t.listeners,(t=>t(!1,e)))}))})(t),n.previous.clear(),a(e,!1)}))}),(({uid:e,name:t,elements:s})=>{Pt(o,e)||(o.each((e=>a(e,!1))),((e,t,n)=>{r(e,(o=>{q(o.listeners,(o=>o(!0,e,{uid:t,nodes:V(n,(e=>e.dom))})))}))})(t,e,s),n.previous.set(e),a(e,!0))})),{previous:n.previous,listeners:n.listeners}}))}))}),30);return e.on("remove",(()=>{i.cancel()})),e.on("NodeChange",(()=>{i.throttle()})),{addListener:(e,t)=>{s(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))}}})(e,t),o=Xt("span"),r=e=>{q(e,(e=>{o(e)?xo(e):(e=>{fn(e,$a()),on(e,`${qa()}`),on(e,`${Va()}`),on(e,`${Wa()}`);const t=tn(e,`${Ga()}`).map((e=>e.split(","))).getOr([]),n=tn(e,`${Ka()}`).map((e=>e.split(","))).getOr([]);var o;q(t,(t=>on(e,t))),o=e,q(n,(e=>{fn(o,e)})),on(e,`${Ka()}`),on(e,`${Ga()}`)})(e)}))};return{register:(e,n)=>{t.register(e,n)},annotate:(n,o)=>{t.lookup(n).each((t=>{((e,t,n,o)=>{e.undoManager.transact((()=>{const r=e.selection,s=r.getRng(),a=Yu(e).length>0,i=ti("mce-annotation");if(s.collapsed&&!a&&((e,t)=>{const n=Um(e.dom,t,[{inline:"span"}]);t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t)})(e,s),r.getRng().collapsed&&!a){const s=$m(e.getDoc(),i,o,t,n.decorate);So(s,pr),r.getRng().insertNode(s.dom),r.select(s.dom)}else om(r,!1,(()=>{nm(e,(r=>{Vm(e,r,i,t,n.decorate,o)}))}))}))})(e,n,t,o)}))},annotationChanged:(e,t)=>{n.addListener(e,t)},remove:t=>{Xa(e,I.some(t)).each((({elements:t})=>{const n=e.selection.getBookmark();r(t),e.selection.moveToBookmark(n)}))},removeAll:t=>{const n=e.selection.getBookmark();ge(Za(e,t),((e,t)=>{r(e)})),e.selection.moveToBookmark(n)},getAll:t=>{const n=Za(e,t);return pe(n,(e=>V(e,(e=>e.dom))))}}},Wm=e=>({getBookmark:O(Du,e),moveToBookmark:O(Pu,e)});Wm.isBookmarkNode=Lu;const Km=(e,t,n)=>!n.collapsed&&$(n.getClientRects(),(n=>((e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom)(n,e,t))),Gm=(e,t,n)=>{e.dispatch(t,n)},Ym=(e,t,n,o)=>{e.dispatch("FormatApply",{format:t,node:n,vars:o})},Xm=(e,t,n,o)=>{e.dispatch("FormatRemove",{format:t,node:n,vars:o})},Qm=(e,t)=>e.dispatch("SetContent",t),Jm=(e,t)=>e.dispatch("GetContent",t),Zm=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t}),ef={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,ESC:27,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,modifierPressed:e=>e.shiftKey||e.ctrlKey||e.altKey||ef.metaKeyPressed(e),metaKeyPressed:e=>At.os.isMacOS()||At.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey},tf="data-mce-selected",nf=Math.abs,of=Math.round,rf={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},sf=(e,t)=>{const n=t.dom,o=t.getDoc(),r=document,s=t.getBody();let a,i,l,d,c,u,m,f,g,p,h,b,v,y,w;const x=e=>C(e)&&(sr(e)||n.is(e,"figure.image")),k=e=>cr(e)||n.hasClass(e,"mce-preview-object"),E=e=>{const n=e.target;((e,t)=>{if((e=>"longpress"===e.type||0===e.type.indexOf("touch"))(e)){const n=e.touches[0];return x(e.target)&&!Km(n.clientX,n.clientY,t)}return x(e.target)&&!Km(e.clientX,e.clientY,t)})(e,t.selection.getRng())&&!e.isDefaultPrevented()&&t.selection.select(n)},S=e=>n.hasClass(e,"mce-preview-object")&&C(e.firstElementChild)?[e,e.firstElementChild]:n.is(e,"figure.image")?[e.querySelector("img")]:[e],_=e=>{const o=ed(t);return!!o&&"false"!==e.getAttribute("data-mce-resize")&&e!==t.getBody()&&(n.hasClass(e,"mce-preview-object")&&C(e.firstElementChild)?xn(yn(e.firstElementChild),o):xn(yn(e),o))},N=(e,o,r)=>{if(C(r)){const s=S(e);q(s,(e=>{e.style[o]||!t.schema.isValid(e.nodeName.toLowerCase(),o)?n.setStyle(e,o,r):n.setAttrib(e,o,""+r)}))}},R=(e,t,n)=>{N(e,"width",t),N(e,"height",n)},A=e=>{let o,r,c,C,E;o=e.screenX-u,r=e.screenY-m,b=o*d[2]+f,v=r*d[3]+g,b=b<5?5:b,v=v<5?5:v,c=(x(a)||k(a))&&!1!==td(t)?!ef.modifierPressed(e):ef.modifierPressed(e),c&&(nf(o)>nf(r)?(v=of(b*p),b=of(v/p)):(b=of(v/p),v=of(b*p))),R(i,b,v),C=d.startPos.x+o,E=d.startPos.y+r,C=C>0?C:0,E=E>0?E:0,n.setStyles(l,{left:C,top:E,display:"block"}),l.innerHTML=b+" × "+v,d[2]<0&&i.clientWidth<=b&&n.setStyle(i,"left",void 0+(f-b)),d[3]<0&&i.clientHeight<=v&&n.setStyle(i,"top",void 0+(g-v)),o=s.scrollWidth-y,r=s.scrollHeight-w,o+r!==0&&n.setStyles(l,{left:C-o,top:E-r}),h||(((e,t,n,o,r)=>{e.dispatch("ObjectResizeStart",{target:t,width:n,height:o,origin:r})})(t,a,f,g,"corner-"+d.name),h=!0)},O=()=>{const e=h;h=!1,e&&(N(a,"width",b),N(a,"height",v)),n.unbind(o,"mousemove",A),n.unbind(o,"mouseup",O),r!==o&&(n.unbind(r,"mousemove",A),n.unbind(r,"mouseup",O)),n.remove(i),n.remove(l),n.remove(c),T(a),e&&(((e,t,n,o,r)=>{e.dispatch("ObjectResized",{target:t,width:n,height:o,origin:r})})(t,a,b,v,"corner-"+d.name),n.setAttrib(a,"style",n.getAttrib(a,"style"))),t.nodeChanged()},T=e=>{M();const h=n.getPos(e,s),C=h.x,x=h.y,E=e.getBoundingClientRect(),N=E.width||E.right-E.left,T=E.height||E.bottom-E.top;a!==e&&(D(),a=e,b=v=0);const B=t.dispatch("ObjectSelected",{target:e});_(e)&&!B.isDefaultPrevented()?ge(rf,((e,t)=>{let h=n.get("mceResizeHandle"+t);h&&n.remove(h),h=n.add(s,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+t+"-resize; margin:0; padding:0"}),n.bind(h,"mousedown",(h=>{h.stopImmediatePropagation(),h.preventDefault(),(h=>{const b=S(a)[0];var v;u=h.screenX,m=h.screenY,f=b.clientWidth,g=b.clientHeight,p=g/f,d=e,d.name=t,d.startPos={x:N*e[0]+C,y:T*e[1]+x},y=s.scrollWidth,w=s.scrollHeight,c=n.add(s,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),n.setStyles(c,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),i=k(v=a)?n.create("img",{src:At.transparentSrc}):v.cloneNode(!0),n.addClass(i,"mce-clonedresizable"),n.setAttrib(i,"data-mce-bogus","all"),i.contentEditable="false",n.setStyles(i,{left:C,top:x,margin:0}),R(i,N,T),i.removeAttribute(tf),s.appendChild(i),n.bind(o,"mousemove",A),n.bind(o,"mouseup",O),r!==o&&(n.bind(r,"mousemove",A),n.bind(r,"mouseup",O)),l=n.add(s,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},f+" × "+g)})(h)})),e.elm=h,n.setStyles(h,{left:N*e[0]+C-h.offsetWidth/2,top:T*e[1]+x-h.offsetHeight/2})})):D(!1)},B=ja(T,0),D=(e=!0)=>{B.cancel(),M(),a&&e&&a.removeAttribute(tf),ge(rf,((e,t)=>{const o=n.get("mceResizeHandle"+t);o&&(n.unbind(o),n.remove(o))}))},P=(e,t)=>n.isChildOf(e,t),L=o=>{if(h||t.removed||t.composing)return;const r="mousedown"===o.type?o.target:e.getNode(),a=to(yn(r),"table,img,figure.image,hr,video,span.mce-preview-object,details").map((e=>e.dom)).filter((e=>n.isEditable(e.parentElement))).getOrUndefined(),i=C(a)?n.getAttrib(a,tf,"1"):"1";if(q(n.select(`img[${tf}],hr[${tf}]`),(e=>{e.removeAttribute(tf)})),C(a)&&P(a,s)&&t.hasFocus()){I();const t=e.getStart(!0);if(P(t,a)&&P(e.getEnd(!0),a))return n.setAttrib(a,tf,i),void B.throttle(a)}D()},M=()=>{ge(rf,(e=>{e.elm&&(n.unbind(e.elm),delete e.elm)}))},I=()=>{try{t.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(e){}};return t.on("init",(()=>{I(),t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",L),t.on("keyup compositionend",(e=>{a&&"TABLE"===a.nodeName&&L(e)})),t.on("hide blur",D),t.on("contextmenu longpress",E,!0)})),t.on("remove",M),{isResizable:_,showResizeRect:T,hideResizeRect:D,updateResizeRect:L,destroy:()=>{B.cancel(),a=i=c=null}}},af=(e,t,n)=>{const o=e.document.createRange();var r;return r=o,t.fold((e=>{r.setStartBefore(e.dom)}),((e,t)=>{r.setStart(e.dom,t)}),(e=>{r.setStartAfter(e.dom)})),((e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,n)=>{e.setEnd(t.dom,n)}),(t=>{e.setEndAfter(t.dom)}))})(o,n),o},lf=(e,t,n,o,r)=>{const s=e.document.createRange();return s.setStart(t.dom,n),s.setEnd(o.dom,r),s},df=al([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),cf=(e,t,n)=>t(yn(n.startContainer),n.startOffset,yn(n.endContainer),n.endOffset);df.ltr,df.rtl;const uf=(e,t,n,o)=>({start:e,soffset:t,finish:n,foffset:o}),mf=document.caretPositionFromPoint?(e,t,n)=>{var o,r;return I.from(null===(r=(o=e.dom).caretPositionFromPoint)||void 0===r?void 0:r.call(o,t,n)).bind((t=>{if(null===t.offsetNode)return I.none();const n=e.dom.createRange();return n.setStart(t.offsetNode,t.offset),n.collapse(),I.some(n)}))}:document.caretRangeFromPoint?(e,t,n)=>{var o,r;return I.from(null===(r=(o=e.dom).caretRangeFromPoint)||void 0===r?void 0:r.call(o,t,n))}:I.none,ff=al([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),gf={before:ff.before,on:ff.on,after:ff.after,cata:(e,t,n,o)=>e.fold(t,n,o),getStart:e=>e.fold(R,R,R)},pf=al([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),hf={domRange:pf.domRange,relative:pf.relative,exact:pf.exact,exactFromRange:e=>pf.exact(e.start,e.soffset,e.finish,e.foffset),getWin:e=>{const t=(e=>e.match({domRange:e=>yn(e.startContainer),relative:(e,t)=>gf.getStart(e),exact:(e,t,n,o)=>e}))(e);return Rn(t)},range:uf},bf=(e,t)=>{const n=Ht(e);return"input"===n?gf.after(e):H(["br","img"],n)?0===t?gf.before(e):gf.after(e):gf.on(e,t)},vf=(e,t)=>{const n=e.fold(gf.before,bf,gf.after),o=t.fold(gf.before,bf,gf.after);return hf.relative(n,o)},yf=(e,t,n,o)=>{const r=bf(e,t),s=bf(n,o);return hf.relative(r,s)},Cf=(e,t)=>{const n=(t||document).createDocumentFragment();return q(e,(e=>{n.appendChild(e.dom)})),yn(n)},wf=e=>{const t=hf.getWin(e).dom,n=(e,n,o,r)=>lf(t,e,n,o,r),o=(e=>e.match({domRange:e=>{const t=yn(e.startContainer),n=yn(e.endContainer);return yf(t,e.startOffset,n,e.endOffset)},relative:vf,exact:yf}))(e);return((e,t)=>{const n=((e,t)=>t.match({domRange:e=>({ltr:N(e),rtl:I.none}),relative:(t,n)=>({ltr:Pe((()=>af(e,t,n))),rtl:Pe((()=>I.some(af(e,n,t))))}),exact:(t,n,o,r)=>({ltr:Pe((()=>lf(e,t,n,o,r))),rtl:Pe((()=>I.some(lf(e,o,r,t,n))))})}))(e,t);return((e,t)=>{const n=t.ltr();return n.collapsed?t.rtl().filter((e=>!1===e.collapsed)).map((e=>df.rtl(yn(e.endContainer),e.endOffset,yn(e.startContainer),e.startOffset))).getOrThunk((()=>cf(0,df.ltr,n))):cf(0,df.ltr,n)})(0,n)})(t,o).match({ltr:n,rtl:n})},xf=(e,t,n)=>((e,t,n)=>((e,t,n)=>{const o=yn(e.document);return mf(o,t,n).map((e=>uf(yn(e.startContainer),e.startOffset,yn(e.endContainer),e.endOffset)))})(e,t,n))(Rn(yn(n)).dom,e,t).map((e=>{const t=n.createRange();return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),t})).getOrUndefined(),kf=(e,t)=>C(e)&&C(t)&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset,Ef=(e,t,n)=>null!==((e,t,n)=>{let o=e;for(;o&&o!==t;){if(n(o))return o;o=o.parentNode}return null})(e,t,n),Sf=(e,t,n)=>Ef(e,t,(e=>e.nodeName===n)),_f=(e,t)=>$r(e)&&!Ef(e,t,xu),Nf=(e,t,n)=>{const o=t.parentNode;if(o){const r=new zo(t,e.getParent(o,e.isBlock)||e.getRoot());let s;for(;s=r[n?"prev":"next"]();)if(rr(s))return!0}return!1},Rf=(e,t,n,o,r)=>{const s=e.getRoot(),a=e.schema.getNonEmptyElements(),i=r.parentNode;let l,d;if(!i)return I.none();const c=e.getParent(i,e.isBlock)||s;if(o&&rr(r)&&t&&e.isEmpty(c))return I.some(Li(i,e.nodeIndex(r)));const u=new zo(r,c);for(;d=u[o?"prev":"next"]();){if("false"===e.getContentEditableParent(d)||_f(d,s))return I.none();if(Jo(d)&&d.data.length>0)return Sf(d,s,"A")?I.none():I.some(Li(d,o?d.data.length:0));if(e.isBlock(d)||a[d.nodeName.toLowerCase()])return I.none();l=d}return tr(l)?I.none():n&&l?I.some(Li(l,0)):I.none()},Af=(e,t,n,o)=>{const r=e.getRoot();let s,a=!1,i=n?o.startContainer:o.endContainer,l=n?o.startOffset:o.endOffset;const d=$o(i)&&l===i.childNodes.length,c=e.schema.getNonEmptyElements();let u=n;if($r(i))return I.none();if($o(i)&&l>i.childNodes.length-1&&(u=!1),nr(i)&&(i=r,l=0),i===r){if(u&&(s=i.childNodes[l>0?l-1:0],s)){if($r(s))return I.none();if(c[s.nodeName]||Yo(s))return I.none()}if(i.hasChildNodes()){if(l=Math.min(!u&&l>0?l-1:l,i.childNodes.length-1),i=i.childNodes[l],l=Jo(i)&&d?i.data.length:0,!t&&i===r.lastChild&&Yo(i))return I.none();if(((e,t)=>{let n=t;for(;n&&n!==e;){if(ir(n))return!0;n=n.parentNode}return!1})(r,i)||$r(i))return I.none();if(i.hasChildNodes()&&!Yo(i)){s=i;const t=new zo(i,r);do{if(ir(s)||$r(s)){a=!1;break}if(Jo(s)&&s.data.length>0){l=u?0:s.data.length,i=s,a=!0;break}if(c[s.nodeName.toLowerCase()]&&!dr(s)){l=e.nodeIndex(s),i=s.parentNode,u||l++,a=!0;break}}while(s=u?t.next():t.prev())}}}return t&&(Jo(i)&&0===l&&Rf(e,d,t,!0,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),$o(i)&&(s=i.childNodes[l],s||(s=i.childNodes[l-1]),!s||!rr(s)||((e,t)=>{var n;return"A"===(null===(n=e.previousSibling)||void 0===n?void 0:n.nodeName)})(s)||Nf(e,s,!1)||Nf(e,s,!0)||Rf(e,d,t,!0,s).each((e=>{i=e.container(),l=e.offset(),a=!0})))),u&&!t&&Jo(i)&&l===i.data.length&&Rf(e,d,t,!1,i).each((e=>{i=e.container(),l=e.offset(),a=!0})),a&&i?I.some(Li(i,l)):I.none()},Of=(e,t)=>{const n=t.collapsed,o=t.cloneRange(),r=Li.fromRangeStart(t);return Af(e,n,!0,o).each((e=>{n&&Li.isAbove(r,e)||o.setStart(e.container(),e.offset())})),n||Af(e,n,!1,o).each((e=>{o.setEnd(e.container(),e.offset())})),n&&o.collapse(!0),kf(t,o)?I.none():I.some(o)},Tf=(e,t)=>e.splitText(t),Bf=e=>{let t=e.startContainer,n=e.startOffset,o=e.endContainer,r=e.endOffset;if(t===o&&Jo(t)){if(n>0&&nn){r-=n;const e=Tf(o,r).previousSibling;t=o=e,r=e.data.length,n=0}else r=0}else if(Jo(t)&&n>0&&n0&&r({walk:(t,n)=>zm(e,t,n),split:Bf,expand:(t,n={type:"word"})=>{if("word"===n.type){const n=Um(e,t,[{inline:"span"}]),o=e.createRng();return o.setStart(n.startContainer,n.startOffset),o.setEnd(n.endContainer,n.endOffset),o}return t},normalize:t=>Of(e,t).fold(L,(e=>(t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0)))});Df.compareRanges=kf,Df.getCaretRangeFromPoint=xf,Df.getSelectedNode=gi,Df.getNode=pi;const Pf=((e,t)=>{const n=t=>{const n=(e=>{const t=e.dom;return Yn(e)?t.getBoundingClientRect().height:t.offsetHeight})(t);if(n<=0||null===n){const n=lo(t,e);return parseFloat(n)||0}return n},o=(e,t)=>X(t,((t,n)=>{const o=lo(e,n),r=void 0===o?0:parseInt(o,10);return isNaN(r)?t:t+r}),0);return{set:(t,n)=>{if(!x(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);const o=t.dom;ro(o)&&(o.style[e]=n+"px")},get:n,getOuter:n,aggregate:o,max:(e,t,n)=>{const r=o(e,n);return t>r?t-r:0}}})("height"),Lf=()=>yn(document),Mf=(e,t)=>e.view(t).fold(N([]),(t=>{const n=e.owner(t),o=Mf(e,n);return[t].concat(o)}));var If=Object.freeze({__proto__:null,view:e=>{var t;return(e.dom===document?I.none():I.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(yn)},owner:e=>Nn(e)});const Ff=e=>"textarea"===Ht(e),Uf=(e,t)=>{const n=(e=>{const t=e.dom.ownerDocument,n=t.body,o=t.defaultView,r=t.documentElement;if(n===e.dom)return Ao(n.offsetLeft,n.offsetTop);const s=Oo(null==o?void 0:o.pageYOffset,r.scrollTop),a=Oo(null==o?void 0:o.pageXOffset,r.scrollLeft),i=Oo(r.clientTop,n.clientTop),l=Oo(r.clientLeft,n.clientLeft);return To(e).translate(a-l,s-i)})(e),o=(e=>Pf.get(e))(e);return{element:e,bottom:n.top+o,height:o,pos:n,cleanup:t}},zf=(e,t,n,o)=>{Vf(e,((r,s)=>Hf(e,t,n,o)),n)},jf=(e,t,n,o,r)=>{const s={elm:o.element.dom,alignToTop:r};((e,t)=>e.dispatch("ScrollIntoView",t).isDefaultPrevented())(e,s)||(n(e,t,Bo(t).top,o,r),((e,t)=>{e.dispatch("AfterScrollIntoView",t)})(e,s))},Hf=(e,t,n,o)=>{const r=yn(e.getBody()),s=yn(e.getDoc());r.dom.offsetWidth;const a=((e,t)=>{const n=((e,t)=>{const n=Mn(e);if(0===n.length||Ff(e))return{element:e,offset:t};if(t\ufeff');return go(n.element,o),Uf(o,(()=>wo(o)))})(yn(n.startContainer),n.startOffset);jf(e,s,t,a,o),a.cleanup()},$f=(e,t,n,o)=>{const r=yn(e.getDoc());jf(e,r,n,(e=>Uf(yn(e),E))(t),o)},Vf=(e,t,n)=>{const o=n.startContainer,r=n.startOffset,s=n.endContainer,a=n.endOffset;t(yn(o),yn(s));const i=e.dom.createRng();i.setStart(o,r),i.setEnd(s,a),e.selection.setRng(n)},qf=(e,t,n,o,r)=>{const s=t.pos;if(o)Do(s.left,s.top,r);else{const o=s.top-n+t.height;Do(-e.getBody().getBoundingClientRect().left,o,r)}},Wf=(e,t,n,o,r,s)=>{const a=o+n,i=r.pos.top,l=r.bottom,d=l-i>=o;ia?qf(e,r,o,d?!1!==s:!0===s,t):l>a&&!d&&qf(e,r,o,!0===s,t)},Kf=(e,t,n,o,r)=>{const s=Rn(t).dom.innerHeight;Wf(e,t,n,s,o,r)},Gf=(e,t,n,o,r)=>{const s=Rn(t).dom.innerHeight;Wf(e,t,n,s,o,r);const a=(e=>{const t=Lf(),n=Bo(t),o=((e,t)=>{const n=t.owner(e);return Mf(t,n)})(e,If),r=To(e),s=Y(o,((e,t)=>{const n=To(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return Ao(s.left+r.left+n.left,s.top+r.top+n.top)})(o.element),i=Mo(window);a.topi.bottom&&Po(o.element,!0===r)},Yf=(e,t,n)=>zf(e,Kf,t,n),Xf=(e,t,n)=>$f(e,t,Kf,n),Qf=(e,t,n)=>zf(e,Gf,t,n),Jf=(e,t,n)=>$f(e,t,Gf,n),Zf=(e,t,n)=>{(e.inline?Yf:Qf)(e,t,n)},eg=e=>e.dom.focus(),tg=e=>{const t=Vn(e).dom;return e.dom===t.activeElement},ng=(e=Lf())=>I.from(e.dom.activeElement).map(yn),og=(e,t)=>{const n=Kt(t)?vr(t).length:Mn(t).length+1;return e>n?n:e<0?0:e},rg=e=>hf.range(e.start,og(e.soffset,e.start),e.finish,og(e.foffset,e.finish)),sg=(e,t)=>!Ho(t.dom)&&(Sn(e,t)||En(e,t)),ag=e=>t=>sg(e,t.start)&&sg(e,t.finish),ig=e=>hf.range(yn(e.startContainer),e.startOffset,yn(e.endContainer),e.endOffset),lg=e=>{const t=document.createRange();try{return t.setStart(e.start.dom,e.soffset),t.setEnd(e.finish.dom,e.foffset),I.some(t)}catch(e){return I.none()}},dg=e=>{const t=(e=>e.inline||At.browser.isFirefox())(e)?(n=yn(e.getBody()),(e=>{const t=e.getSelection();return(t&&0!==t.rangeCount?I.from(t.getRangeAt(0)):I.none()).map(ig)})(Rn(n).dom).filter(ag(n))):I.none();var n;e.bookmark=t.isSome()?t:e.bookmark},cg=e=>(e.bookmark?e.bookmark:I.none()).bind((t=>{return n=yn(e.getBody()),o=t,I.from(o).filter(ag(n)).map(rg);var n,o})).bind(lg),ug={isEditorUIElement:e=>{const t=e.className.toString();return-1!==t.indexOf("tox-")||-1!==t.indexOf("mce-")}},mg={setEditorTimeout:(e,t,n)=>((e,t)=>(x(t)||(t=0),setTimeout(e,t)))((()=>{e.removed||t()}),n),setEditorInterval:(e,t,n)=>{const o=((e,t)=>(x(t)||(t=0),setInterval(e,t)))((()=>{e.removed?clearInterval(o):t()}),n);return o}};let fg;const gg=Oa.DOM,pg=e=>{const t=e.classList;return void 0!==t&&(t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body"))},hg=(e,t)=>{const n=gd(e),o=gg.getParent(t,(t=>(e=>$o(e)&&ug.isEditorUIElement(e))(t)||!!n&&e.dom.is(t,n)));return null!==o},bg=e=>{try{const t=Vn(yn(e.getElement()));return ng(t).fold((()=>document.body),(e=>e.dom))}catch(e){return document.body}},vg=(e,t)=>{const n=t.editor;(e=>{const t=ja((()=>{dg(e)}),0);e.on("init",(()=>{e.inline&&((e,t)=>{const n=()=>{t.throttle()};Oa.DOM.bind(document,"mouseup",n),e.on("remove",(()=>{Oa.DOM.unbind(document,"mouseup",n)}))})(e,t),((e,t)=>{((e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))})(e,t),e.on("keyup NodeChange AfterSetSelectionRange",(t=>{(e=>"nodechange"===e.type&&e.selectionChange)(t)||dg(e)}))})(e,t)})),e.on("remove",(()=>{t.cancel()}))})(n);const o=(e,t)=>{nc(e)&&!0!==e.inline&&t(yn(e.getContainer()),"tox-edit-focus")};n.on("focusin",(()=>{const t=e.focusedEditor;pg(bg(n))&&o(n,un),t!==n&&(t&&t.dispatch("blur",{focusedEditor:n}),e.setActive(n),e.focusedEditor=n,n.dispatch("focus",{blurredEditor:t}),n.focus(!0))})),n.on("focusout",(()=>{mg.setEditorTimeout(n,(()=>{const t=e.focusedEditor;pg(bg(n))&&t===n||o(n,fn),hg(n,bg(n))||t!==n||(n.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null)}))})),fg||(fg=t=>{const n=e.activeEditor;n&&Kn(t).each((t=>{const o=t;o.ownerDocument===document&&(o===document.body||hg(n,o)||e.focusedEditor!==n||(n.dispatch("blur",{focusedEditor:null}),e.focusedEditor=null))}))},gg.bind(document,"focusin",fg))},yg=(e,t)=>{e.focusedEditor===t.editor&&(e.focusedEditor=null),!e.activeEditor&&fg&&(gg.unbind(document,"focusin",fg),fg=null)},Cg=(e,t)=>{((e,t)=>(e=>e.collapsed?I.from(pi(e.startContainer,e.startOffset)).map(yn):I.none())(t).bind((t=>Rr(t)?I.some(t):Sn(e,t)?I.none():I.some(e))))(yn(e.getBody()),t).bind((e=>yu(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))},wg=e=>{if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},xg=e=>e.inline?(e=>{const t=e.getBody();return t&&(n=yn(t),tg(n)||(o=n,ng(Vn(o)).filter((e=>o.dom.contains(e.dom)))).isSome());var n,o})(e):(e=>C(e.iframeElement)&&tg(yn(e.iframeElement)))(e),kg=e=>e.editorManager.setActive(e),Eg=(e,t,n,o,r)=>{const s=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return I.from(s).map(yn).map((e=>o&&t.collapsed?e:In(e,r(e,a)).getOr(e))).bind((e=>Wt(e)?I.some(e):An(e).filter(Wt))).map((e=>e.dom)).getOr(e)},Sg=(e,t,n=!1)=>Eg(e,t,!0,n,((e,t)=>Math.min(zn(e),t))),_g=(e,t,n=!1)=>Eg(e,t,!1,n,((e,t)=>t>0?t-1:t)),Ng=(e,t)=>{const n=e;for(;e&&Jo(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Rg=(e,t)=>V(t,(t=>{const n=e.dispatch("GetSelectionRange",{range:t});return n.range!==t?n.range:t})),Ag=["img","br"],Og=e=>{const t=yr(e).filter((e=>0!==e.trim().length||e.indexOf(pr)>-1)).isSome();return t||H(Ag,Ht(e))||(e=>qt(e)&&"false"===en(e,"contenteditable"))(e)},Tg="[data-mce-autocompleter]",Bg=(e,t)=>{if(Dg(yn(e.getBody())).isNone()){const o=hn('',e.getDoc());bo(o,yn(t.extractContents())),t.insertNode(o.dom),An(o).each((e=>e.dom.normalize())),(n=o,((e,t)=>{const n=e=>{const o=Mn(e);for(let e=o.length-1;e>=0;e--){const r=o[e];if(t(r))return I.some(r);const s=n(r);if(s.isSome())return s}return I.none()};return n(e)})(n,Og)).map((t=>{e.selection.setCursorLocation(t.dom,(e=>"img"===Ht(e)?1:yr(e).fold((()=>Mn(e).length),(e=>e.length)))(t))}))}var n},Dg=e=>eo(e,Tg),Pg={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Lg=(e,t,n)=>{const o=n?"lastChild":"firstChild",r=n?"prev":"next";if(e[o])return e[o];if(e!==t){let n=e[r];if(n)return n;for(let o=e.parent;o&&o!==t;o=o.parent)if(n=o[r],n)return n}},Mg=e=>{var t;const n=null!==(t=e.value)&&void 0!==t?t:"";if(!ds(n))return!1;const o=e.parent;return!o||"span"===o.name&&!o.attr("style")||!/^[ ]+$/.test(n)},Ig=e=>{const t="a"===e.name&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class Fg{static create(e,t){const n=new Fg(e,Pg[e]||1);return t&&ge(t,((e,t)=>{n.attr(t,e)})),n}constructor(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}replace(e){const t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t}attr(e,t){const n=this;if(!m(e))return C(e)&&ge(e,((e,t)=>{n.attr(t,e)})),n;const o=n.attributes;if(o){if(void 0!==t){if(null===t){if(e in o.map){delete o.map[e];let t=o.length;for(;t--;)if(o[t].name===e)return o.splice(t,1),n}return n}if(e in o.map){let n=o.length;for(;n--;)if(o[n].name===e){o[n].value=t;break}}else o.push({name:e,value:t});return o.map[e]=t,n}return o.map[e]}}clone(){const e=this,t=new Fg(e.name,e.type),n=e.attributes;if(n){const e=[];e.map={};for(let t=0,o=n.length;t{const o=e.toLowerCase();if(-1!==o.indexOf("[if ",n)&&((e,t)=>/^\s*\[if [\w\W]+\]>.*/.test(e.substr(t)))(o,n)){const e=o.indexOf("[endif]",n);return o.indexOf(">",e)}if(t){const e=o.indexOf(">",n);return-1!==e?e:o.length}{const t=/--!?>/g;t.lastIndex=n;const r=t.exec(e);return r?r.index+r[0].length:o.length}},zg=(e,t,n)=>{const o=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,r=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,s=e.getVoidElements();let a=1,i=n;for(;0!==a;)for(o.lastIndex=i;;){const e=o.exec(t);if(null===e)return i;if("!"===e[1]){i=He(e[2],"--")?Ug(t,!1,e.index+3):Ug(t,!0,e.index+1);break}{r.lastIndex=o.lastIndex;const n=r.exec(t);if(h(n)||n.index!==o.lastIndex)continue;"/"===e[1]?a-=1:ke(s,e[2])||(a+=1),i=o.lastIndex+n[0].length;break}}return i},jg=(e,t)=>{const n=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,o=e.schema;let r=((e,t)=>{const n=new RegExp(["\\s?("+e.join("|")+')="[^"]+"'].join("|"),"gi");return t.replace(n,"")})(e.getTempAttrs(),t);const s=o.getVoidElements();let a;for(;a=n.exec(r);){const e=n.lastIndex,t=a[0].length;let i;i=s[a[1]]?e:zg(o,r,e),r=r.substring(0,e-t)+r.substring(i),n.lastIndex=e-t}return Fr(r)},Hg=jg,$g=e=>{const t=Fo(e,"[data-mce-bogus]");q(t,(e=>{"all"===en(e,"data-mce-bogus")?wo(e):Er(e)?(go(e,vn(gr)),wo(e)):xo(e)}))},Vg=e=>{const t=Fo(e,"input");q(t,(e=>{on(e,"name")}))},qg=(e,t,n)=>{let o;return o="raw"===t.format?Dt.trim(Hg(e.serializer,n.innerHTML)):"text"===t.format?((e,t)=>{const n=e.getDoc(),o=Vn(yn(e.getBody())),r=bn("div",n);Jt(r,"data-mce-bogus","all"),io(r,{position:"fixed",left:"-9999999px",top:"0"}),So(r,t.innerHTML),$g(r),Vg(r);const s=(e=>jn(e)?e:yn(Nn(e).dom.body))(o);bo(s,r);const a=Fr(r.dom.innerText);return wo(r),a})(e,n):"tree"===t.format?e.serializer.serialize(n,t):((e,t)=>{const n=Nl(e),o=new RegExp(`^(<${n}[^>]*>( | |\\s|\xa0|
|)<\\/${n}>[\r\n]*|
[\r\n]*)$`);return t.replace(o,"")})(e,e.serializer.serialize(n,t)),"text"!==t.format&&!Or(yn(n))&&m(o)?Dt.trim(o):o},Wg=Dt.makeMap,Kg=e=>{const t=[],n=(e=e||{}).indent,o=Wg(e.indent_before||""),r=Wg(e.indent_after||""),s=Zs.getEncodeFunc(e.entity_encoding||"raw",e.entities),a="xhtml"!==e.element_format;return{start:(e,i,l)=>{if(n&&o[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}if(t.push("<",e),i)for(let e=0,n=i.length;e":" />",l&&n&&r[e]&&t.length>0){const e=t[t.length-1];e.length>0&&"\n"!==e&&t.push("\n")}},end:e=>{let o;t.push(""),n&&r[e]&&t.length>0&&(o=t[t.length-1],o.length>0&&"\n"!==o&&t.push("\n"))},text:(e,n)=>{e.length>0&&(t[t.length]=n?e:s(e))},cdata:e=>{t.push("")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,o)=>{o?t.push(""):t.push(""),n&&t.push("\n")},doctype:e=>{t.push("",n?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}},Gg=(e={},t=ca())=>{const n=Kg(e);return e.validate=!("validate"in e)||e.validate,{serialize:o=>{const r=e.validate,s={3:e=>{var t;n.text(null!==(t=e.value)&&void 0!==t?t:"",e.raw)},8:e=>{var t;n.comment(null!==(t=e.value)&&void 0!==t?t:"")},7:e=>{n.pi(e.name,e.value)},10:e=>{var t;n.doctype(null!==(t=e.value)&&void 0!==t?t:"")},4:e=>{var t;n.cdata(null!==(t=e.value)&&void 0!==t?t:"")},11:e=>{let t=e;if(t=t.firstChild)do{a(t)}while(t=t.next)}};n.reset();const a=e=>{var o;const i=s[e.type];if(i)i(e);else{const s=e.name,i=s in t.getVoidElements();let l=e.attributes;if(r&&l&&l.length>1){const n=[];n.map={};const o=t.getElementRule(e.name);if(o){for(let e=0,t=o.attributesOrder.length;e{Yg.add(e)}));const Xg=["font","text-decoration","text-emphasis"],Qg=(e,t)=>me(e.parseStyle(e.getAttrib(t,"style"))),Jg=(e,t,n)=>{const o=Qg(e,t),r=Qg(e,n),s=o=>{var r,s;const a=null!==(r=e.getStyle(t,o))&&void 0!==r?r:"",i=null!==(s=e.getStyle(n,o))&&void 0!==s?s:"";return Ge(a)&&Ge(i)&&a!==i};return $(o,(e=>{const t=t=>$(t,(t=>t===e));if(!t(r)&&t(Xg)){const e=G(r,(e=>$(Xg,(t=>He(e,t)))));return $(e,s)}return s(e)}))},Zg=(e,t,n)=>I.from(n.container()).filter(Jo).exists((o=>{const r=e?0:-1;return t(o.data.charAt(n.offset()+r))})),ep=O(Zg,!0,Fu),tp=O(Zg,!1,Fu),np=e=>{const t=e.container();return Jo(t)&&(0===t.data.length||Ir(t.data)&&Wm.isBookmarkNode(t.parentNode))},op=(e,t)=>n=>zc(e?0:-1,n).filter(t).isSome(),rp=e=>sr(e)&&"block"===lo(yn(e),"display"),sp=e=>ir(e)&&!(e=>$o(e)&&"all"===e.getAttribute("data-mce-bogus"))(e),ap=op(!0,rp),ip=op(!1,rp),lp=op(!0,cr),dp=op(!1,cr),cp=op(!0,Yo),up=op(!1,Yo),mp=op(!0,sp),fp=op(!1,sp),gp=(e,t)=>((e,t,n)=>Sn(t,e)?Tn(e,(e=>n(e)||En(e,t))).slice(0,-1):[])(e,t,L),pp=(e,t)=>[e].concat(gp(e,t)),hp=(e,t,n)=>pu(e,t,n,np),bp=(e,t)=>J(pp(yn(t.container()),e),xr),vp=(e,t,n)=>hp(e,t.dom,n).forall((e=>bp(t,n).fold((()=>!Uc(e,n,t.dom)),(o=>!Uc(e,n,t.dom)&&Sn(o,yn(e.container())))))),yp=(e,t,n)=>bp(t,n).fold((()=>hp(e,t.dom,n).forall((e=>!Uc(e,n,t.dom)))),(t=>hp(e,t.dom,n).isNone())),Cp=O(yp,!1),wp=O(yp,!0),xp=O(vp,!1),kp=O(vp,!0),Ep=e=>Yc(e).exists(Er),Sp=(e,t,n)=>{const o=G(pp(yn(n.container()),t),xr),r=le(o).getOr(t);return fu(e,r.dom,n).filter(Ep)},_p=(e,t)=>Yc(t).exists(Er)||Sp(!0,e,t).isSome(),Np=(e,t)=>(e=>I.from(e.getNode(!0)).map(yn))(t).exists(Er)||Sp(!1,e,t).isSome(),Rp=O(Sp,!1),Ap=O(Sp,!0),Op=e=>Li.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd(),Tp=(e,t)=>{const n=G(pp(yn(t.container()),e),xr);return le(n).getOr(e)},Bp=(e,t)=>Op(t)?tp(t):tp(t)||vu(Tp(e,t).dom,t).exists(tp),Dp=(e,t)=>Op(t)?ep(t):ep(t)||bu(Tp(e,t).dom,t).exists(ep),Pp=e=>Yc(e).bind((e=>Jn(e,Wt))).exists((e=>(e=>H(["pre","pre-wrap"],e))(lo(e,"white-space")))),Lp=(e,t)=>n=>{return o=new zo(n,e)[t](),C(o)&&ir(o)&&Rc(o);var o},Mp=(e,t)=>!Pp(t)&&(((e,t)=>((e,t)=>vu(e.dom,t).isNone())(e,t)||((e,t)=>bu(e.dom,t).isNone())(e,t)||Cp(e,t)||wp(e,t)||Np(e,t)||_p(e,t))(e,t)||Bp(e,t)||Dp(e,t)),Ip=(e,t)=>!Pp(t)&&(Cp(e,t)||xp(e,t)||Np(e,t)||Bp(e,t)||((e,t)=>{const n=vu(e.dom,t).getOr(t),o=Lp(e.dom,"prev");return t.isAtStart()&&(o(t.container())||o(n.container()))})(e,t)),Fp=(e,t)=>!Pp(t)&&(wp(e,t)||kp(e,t)||_p(e,t)||Dp(e,t)||((e,t)=>{const n=bu(e.dom,t).getOr(t),o=Lp(e.dom,"next");return t.isAtEnd()&&(o(t.container())||o(n.container()))})(e,t)),Up=(e,t)=>Ip(e,t)||Fp(e,(e=>{const t=e.container(),n=e.offset();return Jo(t)&&nMu(e.charAt(t)),jp=(e,t)=>Fu(e.charAt(t)),Hp=(e,t,n)=>{const o=t.data,r=Li(t,0);return n||!zp(o,0)||Up(e,r)?!!(n&&jp(o,0)&&Ip(e,r))&&(t.data=pr+o.slice(1),!0):(t.data=" "+o.slice(1),!0)},$p=(e,t,n)=>{const o=t.data,r=Li(t,o.length-1);return n||!zp(o,o.length-1)||Up(e,r)?!!(n&&jp(o,o.length-1)&&Fp(e,r))&&(t.data=o.slice(0,-1)+pr,!0):(t.data=o.slice(0,-1)+" ",!0)},Vp=(e,t)=>{const n=t.container();if(!Jo(n))return I.none();if((e=>{const t=e.container();return Jo(t)&&je(t.data,pr)})(t)){const o=Hp(e,n,!1)||(e=>{const t=e.data,n=(e=>{const t=e.split("");return V(t,((e,n)=>Mu(e)&&n>0&&n{if(0===n)return;const o=yn(e),r=Qn(o,xr).getOr(o),s=e.data.slice(t,t+n),a=t+n>=e.data.length&&Fp(r,Li(e,e.data.length)),i=0===t&&Ip(r,Li(e,0));e.replaceData(t,n,ms(s,4,i,a))},Wp=(e,t)=>{const n=e.data.slice(t),o=n.length-We(n).length;qp(e,t,o)},Kp=(e,t)=>{const n=e.data.slice(0,t),o=n.length-Ke(n).length;qp(e,t-o,o)},Gp=(e,t,n,o=!0)=>{const r=Ke(e.data).length,s=o?e:t,a=o?t:e;return o?s.appendData(a.data):s.insertData(0,a.data),wo(yn(a)),n&&Wp(s,r),s},Yp=(e,t)=>((e,t)=>{const n=e.container(),o=e.offset();return!Li.isTextPosition(e)&&n===t.parentNode&&o>Li.before(t).offset()})(t,e)?Li(t.container(),t.offset()-1):t,Xp=e=>{return ss(e.previousSibling)?I.some((t=e.previousSibling,Jo(t)?Li(t,t.data.length):Li.after(t))):e.previousSibling?Cu(e.previousSibling):I.none();var t},Qp=e=>{return ss(e.nextSibling)?I.some((t=e.nextSibling,Jo(t)?Li(t,0):Li.before(t))):e.nextSibling?yu(e.nextSibling):I.none();var t},Jp=(e,t,n)=>((e,t,n)=>e?((e,t)=>Qp(t).orThunk((()=>Xp(t))).orThunk((()=>((e,t)=>bu(e,Li.after(t)).orThunk((()=>vu(e,Li.before(t)))))(e,t))))(t,n):((e,t)=>Xp(t).orThunk((()=>Qp(t))).orThunk((()=>((e,t)=>I.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>vu(e,Li.before(t)))).orThunk((()=>bu(e,Li.after(t)))))(e,t))))(t,n))(e,t,n).map(O(Yp,n)),Zp=(e,t,n)=>{n.fold((()=>{e.focus()}),(n=>{e.selection.setRng(n.toRange(),t)}))},eh=(e,t)=>t&&ke(e.schema.getBlockElements(),Ht(t)),th=e=>{if(bs(e)){const t=hn('
');return Co(e),bo(e,t),I.some(Li.before(t.dom))}return I.none()},nh=(e,t,n,o=!0)=>{const r=Jp(t,e.getBody(),n.dom),s=Qn(n,O(eh,e),(a=e.getBody(),e=>e.dom===a));var a;const i=((e,t,n)=>{const o=Bn(e).filter(Kt),r=Dn(e).filter(Kt);return wo(e),(s=o,a=r,i=t,l=(e,t,o)=>{const r=e.dom,s=t.dom,a=r.data.length;return Gp(r,s,n),o.container()===s?Li(r,a):o},s.isSome()&&a.isSome()&&i.isSome()?I.some(l(s.getOrDie(),a.getOrDie(),i.getOrDie())):I.none()).orThunk((()=>(n&&(o.each((e=>Kp(e.dom,e.dom.length))),r.each((e=>Wp(e.dom,0)))),t)));var s,a,i,l})(n,r,((e,t)=>ke(e.schema.getTextInlineElements(),Ht(t)))(e,n));e.dom.isEmpty(e.getBody())?(e.setContent(""),e.selection.setCursorLocation()):s.bind(th).fold((()=>{o&&Zp(e,t,i)}),(n=>{o&&Zp(e,t,I.some(n))}))},oh=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,rh=(e,t)=>xn(yn(t),Zl(e))&&!As(e.schema,t)&&e.dom.isEditable(t),sh=e=>{var t;return"rtl"===Oa.DOM.getStyle(e,"direction",!0)||(e=>oh.test(e))(null!==(t=e.textContent)&&void 0!==t?t:"")},ah=(e,t,n)=>{const o=((e,t,n)=>G(Oa.DOM.getParents(n.container(),"*",t),e))(e,t,n);return I.from(o[o.length-1])},ih=(e,t)=>{const n=t.container(),o=t.offset();return e?Hr(n)?Jo(n.nextSibling)?Li(n.nextSibling,0):Li.after(n):qr(t)?Li(n,o+1):t:Hr(n)?Jo(n.previousSibling)?Li(n.previousSibling,n.previousSibling.data.length):Li.before(n):Wr(t)?Li(n,o-1):t},lh=O(ih,!0),dh=O(ih,!1),ch=(e,t)=>{const n=e=>e.stopImmediatePropagation();e.on("beforeinput input",n,!0),e.getDoc().execCommand(t),e.off("beforeinput input",n)},uh=e=>ch(e,"Delete"),mh=e=>Sr(e)||Nr(e),fh=(e,t)=>Sn(e,t)?Jn(t,mh,(e=>t=>Pt(An(t),e,En))(e)):I.none(),gh=(e,t=!0)=>{e.dom.isEmpty(e.getBody())&&e.setContent("",{no_selection:!t})},ph=(e,t,n)=>Mt(yu(n),Cu(n),((o,r)=>{const s=ih(!0,o),a=ih(!1,r),i=ih(!1,t);return e?bu(n,i).exists((e=>e.isEqual(a)&&t.isEqual(s))):vu(n,i).exists((e=>e.isEqual(s)&&t.isEqual(a)))})).getOr(!0),hh=e=>{var t;return(8===$t(t=e)||"#comment"===Ht(t)?Bn(e):Un(e)).bind(hh).orThunk((()=>I.some(e)))},bh=(e,t,n,o=!0)=>{var r;t.deleteContents();const s=hh(n).getOr(n),a=yn(null!==(r=e.dom.getParent(s.dom,e.dom.isBlock))&&void 0!==r?r:n.dom);if(a.dom===e.getBody()?gh(e,o):bs(a)&&(Pr(a),o&&e.selection.setCursorLocation(a.dom,0)),!En(n,a)){const e=Pt(An(a),n)?[]:An(i=a).map(Mn).map((e=>G(e,(e=>!En(i,e))))).getOr([]);q(e.concat(Mn(n)),(e=>{En(e,a)||Sn(e,a)||!bs(e)||wo(e)}))}var i},vh=e=>Fo(e,"td,th"),yh=(e,t)=>({start:e,end:t}),Ch=al([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),wh=(e,t)=>to(yn(e),"td,th",t),xh=e=>!En(e.start,e.end),kh=(e,t)=>Xu(e.start,t).bind((n=>Xu(e.end,t).bind((e=>It(En(n,e),n))))),Eh=e=>t=>kh(t,e).map((e=>((e,t,n)=>({rng:e,table:t,cells:n}))(t,e,vh(e)))),Sh=(e,t,n,o)=>{if(n.collapsed||!e.forall(xh))return I.none();if(t.isSameTable){const t=e.bind(Eh(o));return I.some({start:t,end:t})}{const e=wh(n.startContainer,o),t=wh(n.endContainer,o),r=e.bind((e=>t=>Xu(t,e).bind((e=>de(vh(e)).map((e=>yh(t,e))))))(o)).bind(Eh(o)),s=t.bind((e=>t=>Xu(t,e).bind((e=>le(vh(e)).map((e=>yh(e,t))))))(o)).bind(Eh(o));return I.some({start:r,end:s})}},_h=(e,t)=>Z(e,(e=>En(e,t))),Nh=e=>Mt(_h(e.cells,e.rng.start),_h(e.cells,e.rng.end),((t,n)=>e.cells.slice(t,n+1))),Rh=(e,t)=>{const{startTable:n,endTable:o}=t,r=e.cloneRange();return n.each((e=>r.setStartAfter(e.dom))),o.each((e=>r.setEndBefore(e.dom))),r},Ah=(e,t)=>{const n=(e=>t=>En(e,t))(e),o=((e,t)=>{const n=wh(e.startContainer,t),o=wh(e.endContainer,t);return Mt(n,o,yh)})(t,n),r=((e,t)=>{const n=e=>Xu(yn(e),t),o=n(e.startContainer),r=n(e.endContainer),s=o.isSome(),a=r.isSome(),i=Mt(o,r,En).getOr(!1);return{startTable:o,endTable:r,isStartInTable:s,isEndInTable:a,isSameTable:i,isMultiTable:!i&&s&&a}})(t,n);return((e,t,n)=>e.exists((e=>((e,t)=>!xh(e)&&kh(e,t).exists((e=>{const t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})))(e,n)&&Zu(e.start,t))))(o,t,n)?o.map((e=>Ch.singleCellTable(t,e.start))):r.isMultiTable?((e,t,n,o)=>Sh(e,t,n,o).bind((({start:e,end:o})=>{const r=e.bind(Nh).getOr([]),s=o.bind(Nh).getOr([]);if(r.length>0&&s.length>0){const e=Rh(n,t);return I.some(Ch.multiTable(r,s,e))}return I.none()})))(o,r,t,n):((e,t,n,o)=>Sh(e,t,n,o).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:o}=t,r=Nh(e).getOr([]);if(o&&e.cells.length===r.length)return I.some(Ch.fullTable(e.table));if(r.length>0){if(o)return I.some(Ch.partialTable(r,I.none()));{const e=Rh(n,t);return I.some(Ch.partialTable(r,I.some({...t,rng:e})))}}return I.none()})))(o,r,t,n)},Oh=e=>q(e,(e=>{on(e,"contenteditable"),Pr(e)})),Th=(e,t,n,o)=>{const r=n.cloneRange();o?(r.setStart(n.startContainer,n.startOffset),r.setEndAfter(t.dom.lastChild)):(r.setStartBefore(t.dom.firstChild),r.setEnd(n.endContainer,n.endOffset)),Lh(e,r,t,!1).each((e=>e()))},Bh=e=>{const t=Yu(e),n=yn(e.selection.getNode());lr(n.dom)&&bs(n)?e.selection.setCursorLocation(n.dom,0):e.selection.collapse(!0),t.length>1&&$(t,(e=>En(e,n)))&&Jt(n,"data-mce-selected","1")},Dh=(e,t,n)=>I.some((()=>{const o=e.selection.getRng(),r=n.bind((({rng:n,isStartInTable:r})=>{const s=((e,t)=>I.from(e.dom.getParent(t,e.dom.isBlock)).map(yn))(e,r?n.endContainer:n.startContainer);n.deleteContents(),((e,t,n)=>{n.each((n=>{t?wo(n):(Pr(n),e.selection.setCursorLocation(n.dom,0))}))})(e,r,s.filter(bs));const a=r?t[0]:t[t.length-1];return Th(e,a,o,r),bs(a)?I.none():I.some(r?t.slice(1):t.slice(0,-1))})).getOr(t);Oh(r),Bh(e)})),Ph=(e,t,n,o)=>I.some((()=>{const r=e.selection.getRng(),s=t[0],a=n[n.length-1];Th(e,s,r,!0),Th(e,a,r,!1);const i=bs(s)?t:t.slice(1),l=bs(a)?n:n.slice(0,-1);Oh(i.concat(l)),o.deleteContents(),Bh(e)})),Lh=(e,t,n,o=!0)=>I.some((()=>{bh(e,t,n,o)})),Mh=(e,t)=>I.some((()=>nh(e,!1,t))),Ih=(e,t)=>J(pp(t,e),Ar),Fh=(e,t)=>J(pp(t,e),Xt("caption")),Uh=(e,t)=>I.some((()=>{Pr(t),e.selection.setCursorLocation(t.dom,0)})),zh=(e,t)=>e?cp(t):up(t),jh=(e,t,n)=>{const o=yn(e.getBody());return Fh(o,n).fold((()=>((e,t,n,o)=>{const r=Li.fromRangeStart(e.selection.getRng());return Ih(n,o).bind((o=>bs(o)?Uh(e,o):((e,t,n,o,r)=>gu(n,e.getBody(),r).bind((e=>Ih(t,yn(e.getNode())).bind((e=>En(e,o)?I.none():I.some(E))))))(e,n,t,o,r)))})(e,t,o,n).orThunk((()=>It(((e,t)=>{const n=Li.fromRangeStart(e.selection.getRng());return zh(t,n)||fu(t,e.getBody(),n).exists((e=>zh(t,e)))})(e,t),E)))),(n=>((e,t,n,o)=>{const r=Li.fromRangeStart(e.selection.getRng());return bs(o)?Uh(e,o):((e,t,n,o,r)=>gu(n,e.getBody(),r).fold((()=>I.some(E)),(s=>((e,t,n,o)=>yu(e.dom).bind((r=>Cu(e.dom).map((e=>t?n.isEqual(r)&&o.isEqual(e):n.isEqual(e)&&o.isEqual(r))))).getOr(!0))(o,n,r,s)?((e,t)=>Uh(e,t))(e,o):((e,t,n)=>Fh(e,yn(n.getNode())).fold((()=>I.some(E)),(e=>It(!En(e,t),E))))(t,o,s))))(e,n,t,o,r)})(e,t,o,n)))},Hh=(e,t)=>{const n=yn(e.selection.getStart(!0)),o=Yu(e);return e.selection.isCollapsed()&&0===o.length?jh(e,t,n):((e,t,n)=>{const o=yn(e.getBody()),r=e.selection.getRng();return 0!==n.length?Dh(e,n,I.none()):((e,t,n,o)=>Fh(t,o).fold((()=>((e,t,n)=>Ah(t,n).bind((t=>t.fold(O(Lh,e),O(Mh,e),O(Dh,e),O(Ph,e)))))(e,t,n)),(t=>((e,t)=>Uh(e,t))(e,t))))(e,o,r,t)})(e,n,o)},$h=(e,t)=>{let n=t;for(;n&&n!==e;){if(ar(n)||ir(n))return n;n=n.parentNode}return null},Vh=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"],qh=Dt.each,Wh=e=>{const t=e.dom,n=new Set(e.serializer.getTempAttrs()),o=e=>$(Vh,(t=>He(e,t)))||n.has(e);return{compare:(e,n)=>{if(e.nodeName!==n.nodeName||e.nodeType!==n.nodeType)return!1;const r=e=>{const n={};return qh(t.getAttribs(e),(r=>{const s=r.nodeName.toLowerCase();"style"===s||o(s)||(n[s]=t.getAttrib(e,s))})),n},s=(e,t)=>{for(const n in e)if(ke(e,n)){const o=t[n];if(v(o))return!1;if(e[n]!==o)return!1;delete t[n]}for(const e in t)if(ke(t,e))return!1;return!0};if($o(e)&&$o(n)){if(!s(r(e),r(n)))return!1;if(!s(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style"))))return!1}return!Lu(e)&&!Lu(n)},isAttributeInternal:o}},Kh=(e,t,n,o)=>{const r=n.name;for(let t=0,s=e.length;t{const n=(e,n)=>{ge(e,(e=>{const o=ce(e.nodes);q(e.filter.callbacks,(r=>{for(let t=o.length-1;t>=0;t--){const r=o[t];(n?void 0!==r.attr(e.filter.name):r.name===e.filter.name)&&!y(r.parent)||o.splice(t,1)}o.length>0&&r(o,e.filter.name,t)}))}))};n(e.nodes,!1),n(e.attributes,!0)},Yh=(e,t,n,o={})=>{const r=((e,t,n)=>{const o={nodes:{},attributes:{}};return n.firstChild&&((n,r)=>{let s=n;for(;s=s.walk();)Kh(e,t,s,o)})(n),o})(e,t,n);Gh(r,o)},Xh=(e,t,n,o)=>{if((e.pad_empty_with_br||t.insert)&&n(o)){const e=new Fg("br",1);t.insert&&e.attr("data-mce-bogus","1"),o.empty().append(e)}else o.empty().append(new Fg("#text",3)).value=pr},Qh=(e,t)=>{const n=null==e?void 0:e.firstChild;return C(n)&&n===e.lastChild&&n.name===t},Jh=(e,t,n,o)=>o.isEmpty(t,n,(t=>((e,t)=>{const n=e.getElementRule(t.name);return!0===(null==n?void 0:n.paddEmpty)})(e,t))),Zh=e=>{let t;for(let n=e;n;n=n.parent){const e=n.attr("contenteditable");if("false"===e)break;"true"===e&&(t=n)}return I.from(t)},eb=(e,t,n=e.parent)=>{if(t.getSpecialElements()[e.name])e.empty().remove();else{const o=e.children();for(const e of o)n&&!t.isValidChild(n.name,e.name)&&eb(e,t,n);e.unwrap()}},tb=(e,t,n,o=E)=>{const r=t.getTextBlockElements(),s=t.getNonEmptyElements(),a=t.getWhitespaceElements(),i=Dt.makeMap("tr,td,th,tbody,thead,tfoot,table,summary"),l=new Set,d=e=>e!==n&&!i[e.name];for(let n=0;n1)if(t.isValidChild(c.name,i.name)){f.reverse(),u=f[0].clone(),o(u);let e=u;for(let n=0;n0?(m=f[n].clone(),o(m),e.append(m)):m=e;for(let e=f[n].firstChild;e&&e!==f[n+1];){const t=e.next;m.append(e),e=t}e=m}Jh(t,s,a,u)?c.insert(i,f[0],!0):(c.insert(u,f[0],!0),c.insert(i,u)),c=f[0],(Jh(t,s,a,c)||Qh(c,"br"))&&c.empty().remove()}else eb(i,t);else if(i.parent){if("li"===i.name){let e=i.prev;if(e&&("ul"===e.name||"ol"===e.name)){e.append(i);continue}if(e=i.next,e&&("ul"===e.name||"ol"===e.name)&&e.firstChild){e.insert(i,e.firstChild,!0);continue}const t=new Fg("ul",1);o(t),i.wrap(t);continue}if(t.isValidChild(i.parent.name,"div")&&t.isValidChild("div",i.name)){const e=new Fg("div",1);o(e),i.wrap(e)}else eb(i,t)}}},nb=(e,t,n=t.parent)=>!(!n||!e.children[t.name]||e.isValidChild(n.name,t.name))||!(!n||"a"!==t.name||!((e,t)=>{let n=e;for(;n;){if("a"===n.name)return!0;n=n.parent}return!1})(n)),ob=e=>e.collapsed?e:(e=>{const t=Li.fromRangeStart(e),n=Li.fromRangeEnd(e),o=e.commonAncestorContainer;return fu(!1,o,n).map((r=>!Uc(t,n,o)&&Uc(t,r,o)?((e,t,n,o)=>{const r=document.createRange();return r.setStart(e,t),r.setEnd(n,o),r})(t.container(),t.offset(),r.container(),r.offset()):e)).getOr(e)})(e),rb=(e,t)=>{let n=t.firstChild,o=t.lastChild;return n&&"meta"===n.name&&(n=n.next),o&&"mce_marker"===o.attr("id")&&(o=o.prev),((e,t)=>{const n=e.getNonEmptyElements();return C(t)&&(t.isEmpty(n)||((e,t)=>e.getBlockElements()[t.name]&&(e=>C(e.firstChild)&&e.firstChild===e.lastChild)(t)&&(e=>"br"===e.name||e.value===pr)(t.firstChild))(e,t))})(e,o)&&(o=null==o?void 0:o.prev),!(!n||n!==o||"ul"!==n.name&&"ol"!==n.name)},sb=e=>{return e.length>0&&(!(n=e[e.length-1]).firstChild||C(null==(t=n)?void 0:t.firstChild)&&t.firstChild===t.lastChild&&(e=>e.data===pr||rr(e))(t.firstChild))?e.slice(0,-1):e;var t,n},ab=(e,t)=>{const n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},ib=(e,t)=>{const n=Li.after(e),o=du(t).prev(n);return o?o.toRange():null},lb=(e,t,n,o)=>{const r=((e,t,n)=>{const o=t.serialize(n);return(e=>{var t,n;const o=e.firstChild,r=e.lastChild;return o&&"META"===o.nodeName&&(null===(t=o.parentNode)||void 0===t||t.removeChild(o)),r&&"mce_marker"===r.id&&(null===(n=r.parentNode)||void 0===n||n.removeChild(r)),e})(e.createFragment(o))})(t,e,o),s=ab(t,n.startContainer),a=sb((i=r.firstChild,G(null!==(l=null==i?void 0:i.childNodes)&&void 0!==l?l:[],(e=>"LI"===e.nodeName))));var i,l;const d=t.getRoot(),c=e=>{const o=Li.fromRangeStart(n),r=du(t.getRoot()),a=1===e?r.prev(o):r.next(o),i=null==a?void 0:a.getNode();return!i||ab(t,i)!==s};return s?c(1)?((e,t,n)=>{const o=e.parentNode;return o&&Dt.each(t,(t=>{o.insertBefore(t,e)})),((e,t)=>{const n=Li.before(e),o=du(t).next(n);return o?o.toRange():null})(e,n)})(s,a,d):c(2)?((e,t,n,o)=>(o.insertAfter(t.reverse(),e),ib(t[0],n)))(s,a,d,t):((e,t,n,o)=>{const r=((e,t)=>{const n=t.cloneRange(),o=t.cloneRange();return n.setStartBefore(e),o.setEndAfter(e),[n.cloneContents(),o.cloneContents()]})(e,o),s=e.parentNode;return s&&(s.insertBefore(r[0],e),Dt.each(t,(t=>{s.insertBefore(t,e)})),s.insertBefore(r[1],e),s.removeChild(e)),ib(t[t.length-1],n)})(s,a,d,n):null},db=["pre"],cb=lr,ub=(e,t,n)=>{var o,r;const s=e.selection,a=e.dom,i=e.parser,l=n.merge,d=Gg({validate:!0},e.schema),c='';-1===t.indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,c);let u=s.getRng();const m=u.startContainer,f=e.getBody();m===f&&s.isCollapsed()&&a.isBlock(f.firstChild)&&((e,t)=>C(t)&&!e.schema.getVoidElements()[t.nodeName])(e,f.firstChild)&&a.isEmpty(f.firstChild)&&(u=a.createRng(),u.setStart(f.firstChild,0),u.setEnd(f.firstChild,0),s.setRng(u)),s.isCollapsed()||(e=>{const t=e.dom,n=ob(e.selection.getRng());e.selection.setRng(n);const o=t.getParent(n.startContainer,cb);((e,t,n)=>!!C(n)&&n===e.getParent(t.endContainer,cb)&&Zu(yn(n),t))(t,n,o)?Lh(e,n,yn(o)):n.startContainer===n.endContainer&&n.endOffset-n.startOffset==1&&Jo(n.startContainer.childNodes[n.startOffset])?n.deleteContents():e.getDoc().execCommand("Delete",!1)})(e);const g=s.getNode(),p={context:g.nodeName.toLowerCase(),data:n.data,insert:!0},h=i.parse(t,p);if(!0===n.paste&&rb(e.schema,h)&&((e,t)=>!!ab(e,t))(a,g))return u=lb(d,a,s.getRng(),h),u&&s.setRng(u),t;!0===n.paste&&((e,t,n,o)=>{var r;const s=t.firstChild,a=t.lastChild,i=s===("bookmark"===a.attr("data-mce-type")?a.prev:a),l=H(db,s.name);if(i&&l){const t="false"!==s.attr("contenteditable"),a=(null===(r=e.getParent(n,e.isBlock))||void 0===r?void 0:r.nodeName.toLowerCase())===s.name,i=I.from($h(o,n)).forall(ar);return t&&a&&i}return!1})(a,h,g,e.getBody())&&(null===(o=h.firstChild)||void 0===o||o.unwrap()),(e=>{let t=e;for(;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")})(h);let b=h.lastChild;if(b&&"mce_marker"===b.attr("id")){const t=b;for(b=b.prev;b;b=b.walk(!0))if(3===b.type||!a.isBlock(b.name)){b.parent&&e.schema.isValidChild(b.parent.name,"span")&&b.parent.insert(t,b,"br"===b.name);break}}if(e._selectionOverrides.showBlockCaretContainer(g),p.invalid){e.selection.setContent(c);let n,o=s.getNode();const l=e.getBody();for(nr(o)?o=n=l:n=o;n&&n!==l;)o=n,n=n.parentNode;t=o===l?l.innerHTML:a.getOuterHTML(o);const u=i.parse(t),m=(e=>{for(let t=e;t;t=t.walk())if("mce_marker"===t.attr("id"))return I.some(t);return I.none()})(u),f=m.bind(Zh).getOr(u);m.each((e=>e.replace(h)));const g=h.children(),p=null!==(r=h.parent)&&void 0!==r?r:u;h.unwrap();const b=G(g,(t=>nb(e.schema,t,p)));tb(b,e.schema,f),Yh(i.getNodeFilters(),i.getAttributeFilters(),u),t=d.serialize(u),o===l?a.setHTML(l,t):a.setOuterHTML(o,t)}else t=d.serialize(h),((e,t,n)=>{var o;if("all"===n.getAttribute("data-mce-bogus"))null===(o=n.parentNode)||void 0===o||o.insertBefore(e.dom.createFragment(t),n);else{const o=n.firstChild,r=n.lastChild;!o||o===r&&"BR"===o.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t,{no_events:!0})}})(e,t,g);var v;return((e,t)=>{const n=e.schema.getTextInlineElements(),o=e.dom;if(t){const t=e.getBody(),r=Wh(e);Dt.each(o.select("*[data-mce-fragment]"),(e=>{if(C(n[e.nodeName.toLowerCase()])&&((e,t)=>ne(Qg(e,t),(e=>!(e=>Yg.has(e))(e))))(o,e))for(let n=e.parentElement;C(n)&&n!==t&&!Jg(o,e,n);n=n.parentElement)if(r.compare(n,e)){o.remove(e,!0);break}}))}})(e,l),((e,t)=>{var n,o,r;let s;const a=e.dom,i=e.selection;if(!t)return;i.scrollIntoView(t);const l=$h(e.getBody(),t);if(l&&"false"===a.getContentEditable(l))return a.remove(t),void i.select(l);let d=a.createRng();const c=t.previousSibling;if(Jo(c)){d.setStart(c,null!==(o=null===(n=c.nodeValue)||void 0===n?void 0:n.length)&&void 0!==o?o:0);const e=t.nextSibling;Jo(e)&&(c.appendData(e.data),null===(r=e.parentNode)||void 0===r||r.removeChild(e))}else d.setStartBefore(t),d.setEndBefore(t);const u=a.getParent(t,a.isBlock);if(a.remove(t),u&&a.isEmpty(u)){const t=cb(u);Co(yn(u)),d.setStart(u,0),d.setEnd(u,0),t||(e=>!!e.getAttribute("data-mce-fragment"))(u)||!(s=(t=>{let n=Li.fromRangeStart(t);return n=du(e.getBody()).next(n),null==n?void 0:n.toRange()})(d))?a.add(u,a.create("br",t?{}:{"data-mce-bogus":"1"})):(d=s,a.remove(u))}i.setRng(d)})(e,a.get("mce_marker")),v=e.getBody(),Dt.each(v.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")})),((e,t)=>{I.from(e.getParent(t,"td,th")).map(yn).each(Lr)})(a,s.getStart()),((e,t,n)=>{const o=Tn(yn(n),(e=>En(e,yn(t))));ie(o,o.length-2).filter(Wt).fold((()=>Es(e,t)),(t=>Es(e,t.dom)))})(e.schema,e.getBody(),s.getStart()),t},mb=e=>e instanceof Fg,fb=(e,t,n)=>{e.dom.setHTML(e.getBody(),t),!0!==n&&(e=>{xg(e)&&yu(e.getBody()).each((t=>{const n=t.getNode(),o=Yo(n)?yu(n).getOr(t):t;e.selection.setRng(o.toRange())}))})(e)},gb=(e,t)=>((e,t)=>{const n=e.dom;return n.parentNode?((e,t)=>J(e.dom.childNodes,(e=>t(yn(e)))).map(yn))(yn(n.parentNode),(n=>!En(e,n)&&t(n))):I.none()})(e,t).isSome(),pb=e=>w(e)?e:L,hb=(e,t,n)=>{const o=t(e),r=pb(n);return o.orThunk((()=>r(e)?I.none():((e,t,n)=>{let o=e.dom;const r=pb(n);for(;o.parentNode;){o=o.parentNode;const e=yn(o),n=t(e);if(n.isSome())return n;if(r(e))break}return I.none()})(e,t,r)))},bb=pm,vb=(e,t,n)=>{const o=e.formatter.get(n);if(o)for(let n=0;n{const s=e.dom.getRoot();if(t===s)return!1;const a=e.dom.getParent(t,(t=>!!vb(e,t,n)||t.parentNode===s||!!xb(e,t,n,o,!0)));return!!xb(e,a,n,o,r)},Cb=(e,t,n)=>!(!km(n)||!bb(t,n.inline))||!(!wm(n)||!bb(t,n.block))||!!xm(n)&&$o(t)&&e.is(t,n.selector),wb=(e,t,n,o,r,s)=>{const a=n[o],i="attributes"===o;if(w(n.onmatch))return n.onmatch(t,n,o);if(a)if(_e(a)){for(let n=0;n{const s=e.formatter.get(n),a=e.dom;if(s&&$o(t))for(let n=0;n{if(o)return yb(e,o,t,n,r);if(o=e.selection.getNode(),yb(e,o,t,n,r))return!0;const s=e.selection.getStart();return!(s===o||!yb(e,s,t,n,r))},Eb=Mr,Sb=e=>(e=>{const t=[];let n=e;for(;n;){if(Jo(n)&&n.data!==Eb||n.childNodes.length>1)return[];$o(n)&&t.push(n),n=n.firstChild}return t})(e).length>0,_b=e=>{if(e){const t=new zo(e,e);for(let e=t.current();e;e=t.next())if(Jo(e))return e}return null},Nb=e=>{const t=bn("span");return Zt(t,{id:wu,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&bo(t,vn(Eb)),t},Rb=(e,t,n=!0)=>{const o=e.dom,r=e.selection;if(Sb(t))nh(e,!1,yn(t),n);else{const e=r.getRng(),n=o.getParent(t,o.isBlock),s=e.startContainer,a=e.startOffset,i=e.endContainer,l=e.endOffset,d=(e=>{const t=_b(e);return t&&t.data.charAt(0)===Eb&&t.deleteData(0,1),t})(t);o.remove(t,!0),s===d&&a>0&&e.setStart(d,a-1),i===d&&l>0&&e.setEnd(d,l-1),n&&o.isEmpty(n)&&Pr(yn(n)),r.setRng(e)}},Ab=(e,t,n=!0)=>{const o=e.dom,r=e.selection;if(t)Rb(e,t,n);else if(!(t=ku(e.getBody(),r.getStart())))for(;t=o.get(wu);)Rb(e,t,n)},Ob=(e,t)=>(e.appendChild(t),t),Tb=(e,t)=>{var n;const o=Y(e,((e,t)=>Ob(e,t.cloneNode(!1))),t),r=null!==(n=o.ownerDocument)&&void 0!==n?n:document;return Ob(o,r.createTextNode(Eb))},Bb=(e,t,n,o)=>{const a=e.dom,i=e.selection;let l=!1;const d=e.formatter.get(t);if(!d)return;const c=i.getRng(),u=c.startContainer,m=c.startOffset;let f=u;Jo(u)&&(m!==u.data.length&&(l=!0),f=f.parentNode);const g=[];let h;for(;f;){if(xb(e,f,t,n,o)){h=f;break}f.nextSibling&&(l=!0),g.push(f),f=f.parentNode}if(h)if(l){const r=i.getBookmark();c.collapse(!0);let s=Um(a,c,d,!0);s=Bf(s),e.formatter.remove(t,n,s,o),i.moveToBookmark(r)}else{const l=ku(e.getBody(),h),d=Nb(!1).dom;((e,t,n)=>{var o,r;const s=e.dom,a=s.getParent(n,O(cm,e.schema));a&&s.isEmpty(a)?null===(o=n.parentNode)||void 0===o||o.replaceChild(t,n):((e=>{const t=Fo(e,"br"),n=G((e=>{const t=[];let n=e.dom;for(;n;)t.push(yn(n)),n=n.lastChild;return t})(e).slice(-1),Er);t.length===n.length&&q(n,wo)})(yn(n)),s.isEmpty(n)?null===(r=n.parentNode)||void 0===r||r.replaceChild(t,n):s.insertAfter(t,n))})(e,d,null!=l?l:h);const c=((e,t,n,o,a,i)=>{const l=e.formatter,d=e.dom,c=G(me(l.get()),(e=>e!==o&&!je(e,"removeformat"))),u=((e,t,n)=>X(n,((n,o)=>{const r=((e,t)=>Cm(e,t,(e=>{const t=e=>w(e)||e.length>1&&"%"===e.charAt(0);return $(["styles","attributes"],(n=>xe(e,n).exists((e=>{const n=p(e)?e:we(e);return $(n,t)}))))})))(e,o);return e.formatter.matchNode(t,o,{},r)?n.concat([o]):n}),[]))(e,n,c);if(G(u,(t=>!((e,t,n)=>{const o=["inline","block","selector","attributes","styles","classes"],a=e=>ye(e,((e,t)=>$(o,(e=>e===t))));return Cm(e,t,(t=>{const o=a(t);return Cm(e,n,(e=>{const t=a(e);return((e,t,n=s)=>r(n).eq(e,t))(o,t)}))}))})(e,t,o))).length>0){const e=n.cloneNode(!1);return d.add(t,e),l.remove(o,a,e,i),d.remove(e),I.some(e)}return I.none()})(e,d,h,t,n,o),u=Tb(g.concat(c.toArray()),d);l&&Rb(e,l,!1),i.setCursorLocation(u,1),a.isEmpty(h)&&a.remove(h)}},Db=e=>{const t=Nb(!1),n=Tb(e,t.dom);return{caretContainer:t,caretPosition:Li(n,0)}},Pb=(e,t)=>{const{caretContainer:n,caretPosition:o}=Db(t);return go(yn(e),n),wo(yn(e)),o},Lb=(e,t)=>{const n=e.schema.getTextInlineElements();return ke(n,Ht(t))&&!xu(t.dom)&&!Go(t.dom)},Mb=e=>xu(e.dom)&&Sb(e.dom),Ib={},Fb=qo(["pre"]);((e,t)=>{Ib[e]||(Ib[e]=[]),Ib[e].push((e=>{if(!e.selection.getRng().collapsed){const t=e.selection.getSelectedBlocks(),n=G(G(t,Fb),(e=>t=>{const n=t.previousSibling;return Fb(n)&&H(e,n)})(t));q(n,(e=>{((e,t)=>{const n=yn(t),o=Nn(n).dom;wo(n),yo(yn(e),[bn("br",o),bn("br",o),...Mn(n)])})(e.previousSibling,e)}))}}))})("pre");const Ub=["fontWeight","fontStyle","color","fontSize","fontFamily"],zb=(e,t)=>{const n=e.get(t);return p(n)?J(n,(e=>km(e)&&"span"===e.inline&&(e=>f(e.styles)&&$(me(e.styles),(e=>H(Ub,e))))(e))):I.none()},jb=(e,t)=>vu(t,Li.fromRangeStart(e)).isNone(),Hb=(e,t)=>!1===bu(t,Li.fromRangeEnd(e)).exists((e=>!rr(e.getNode())||bu(t,e).isSome())),$b=e=>t=>ur(t)&&e.isEditable(t),Vb=e=>G(e.getSelectedBlocks(),$b(e.dom)),qb=Dt.each,Wb=e=>$o(e)&&!Lu(e)&&!xu(e)&&!Go(e),Kb=(e,t)=>{for(let n=e;n;n=n[t]){if(Jo(n)&&Ge(n.data))return e;if($o(n)&&!Lu(n))return n}return e},Gb=(e,t,n)=>{const o=Wh(e),r=$o(t)&&am(t),s=$o(n)&&am(n);if(r&&s){const r=Kb(t,"previousSibling"),s=Kb(n,"nextSibling");if(o.compare(r,s)){for(let e=r.nextSibling;e&&e!==s;){const t=e;e=e.nextSibling,r.appendChild(t)}return e.dom.remove(s),Dt.each(Dt.grep(s.childNodes),(e=>{r.appendChild(e)})),r}}return n},Yb=(e,t,n,o)=>{var r;if(o&&!1!==t.merge_siblings){const t=null!==(r=Gb(e,dm(o),o))&&void 0!==r?r:o;Gb(e,t,dm(t,!0))}},Xb=(e,t,n)=>{qb(e.childNodes,(e=>{Wb(e)&&(t(e)&&n(e),e.hasChildNodes()&&Xb(e,t,n))}))},Qb=(e,t)=>n=>!(!n||!bm(e,n,t)),Jb=(e,t,n)=>o=>{e.setStyle(o,t,n),""===o.getAttribute("style")&&o.removeAttribute("style"),((e,t)=>{"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)})(e,o)},Zb=al([{keep:[]},{rename:["name"]},{removed:[]}]),ev=/^(src|href|style)$/,tv=Dt.each,nv=pm,ov=(e,t,n)=>e.isChildOf(t,n)&&t!==n&&!e.isBlock(n),rv=(e,t,n)=>{let o=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"];if($o(o)){const e=o.childNodes.length-1;!n&&r&&r--,o=o.childNodes[r>e?e:r]}return Jo(o)&&n&&r>=o.data.length&&(o=new zo(o,e.getBody()).next()||o),Jo(o)&&!n&&0===r&&(o=new zo(o,e.getBody()).prev()||o),o},sv=(e,t)=>{const n=t?"firstChild":"lastChild",o=e[n];return(e=>/^(TR|TH|TD)$/.test(e.nodeName))(e)&&o?"TR"===e.nodeName&&o[n]||o:e},av=(e,t,n,o)=>{var r;const s=e.create(n,o);return null===(r=t.parentNode)||void 0===r||r.insertBefore(s,t),s.appendChild(t),s},iv=(e,t,n,o,r)=>{const s=yn(t),a=yn(e.create(o,r)),i=n?Ln(s):Pn(s);return yo(a,i),n?(go(s,a),ho(a,s)):(po(s,a),bo(a,s)),a.dom},lv=(e,t,n)=>{const o=t.parentNode;let r;const s=e.dom,a=Nl(e);wm(n)&&o===s.getRoot()&&(n.list_block&&nv(t,n.list_block)||q(ce(t.childNodes),(t=>{um(e,a,t.nodeName.toLowerCase())?r?r.appendChild(t):(r=av(s,t,a),s.setAttribs(r,Rl(e))):r=null}))),(e=>xm(e)&&km(e)&&Pt(xe(e,"mixed"),!0))(n)&&!nv(n.inline,t)||s.remove(t,!0)},dv=(e,t,n)=>x(e)?{name:t,value:null}:{name:e,value:gm(t,n)},cv=(e,t)=>{""===e.getAttrib(t,"style")&&(t.removeAttribute("style"),t.removeAttribute("data-mce-style"))},uv=(e,t,n,o,r)=>{let s=!1;tv(n.styles,((a,i)=>{const{name:l,value:d}=dv(i,a,o),c=hm(d,l);(n.remove_similar||h(d)||!$o(r)||nv(bm(e,r,l),c))&&e.setStyle(t,l,""),s=!0})),s&&cv(e,t)},mv=(e,t,n,o,r)=>{const s=e.dom,a=Wh(e),i=e.schema;if(km(t)&&Ns(i,t.inline)&&As(i,o)&&o.parentElement===e.getBody())return lv(e,o,t),Zb.removed();if(!t.ceFalseOverride&&o&&"false"===s.getContentEditableParent(o))return Zb.keep();if(o&&!Cb(s,o,t)&&!((e,t)=>t.links&&"A"===e.nodeName)(o,t))return Zb.keep();const l=o,d=t.preserve_attributes;if(km(t)&&"all"===t.remove&&p(d)){const e=G(s.getAttribs(l),(e=>H(d,e.name.toLowerCase())));if(s.removeAllAttribs(l),q(e,(e=>s.setAttrib(l,e.name,e.value))),e.length>0)return Zb.rename("span")}if("all"!==t.remove){uv(s,l,t,n,r),tv(t.attributes,((e,o)=>{const{name:a,value:i}=dv(o,e,n);if(t.remove_similar||h(i)||!$o(r)||nv(s.getAttrib(r,a),i)){if("class"===a){const e=s.getAttrib(l,a);if(e){let t="";if(q(e.split(/\s+/),(e=>{/mce\-\w+/.test(e)&&(t+=(t?" ":"")+e)})),t)return void s.setAttrib(l,a,t)}}if(ev.test(a)&&l.removeAttribute("data-mce-"+a),"style"===a&&qo(["li"])(l)&&"none"===s.getStyle(l,"list-style-type"))return l.removeAttribute(a),void s.setStyle(l,"list-style-type","none");"class"===a&&l.removeAttribute("className"),l.removeAttribute(a)}})),tv(t.classes,(e=>{e=gm(e,n),$o(r)&&!s.hasClass(r,e)||s.removeClass(l,e)}));const e=s.getAttribs(l);for(let t=0;tmv(e,t,n,o,o).fold(N(o),(t=>(e.dom.createFragment().appendChild(o),e.dom.rename(o,t))),N(null)),gv=(e,t,n,o,r)=>{(o||e.selection.isEditable())&&((e,t,n,o,r)=>{const s=e.formatter.get(t),a=s[0],i=e.dom,l=e.selection,d=o=>{const i=((e,t,n,o,r)=>{let s;return t.parentNode&&q(ym(e.dom,t.parentNode).reverse(),(t=>{if(!s&&$o(t)&&"_start"!==t.id&&"_end"!==t.id){const a=xb(e,t,n,o,r);a&&!1!==a.split&&(s=t)}})),s})(e,o,t,n,r);return((e,t,n,o,r,s,a,i)=>{var l,d;let c,u;const m=e.dom;if(n){const s=n.parentNode;for(let n=o.parentNode;n&&n!==s;n=n.parentNode){let o=m.clone(n,!1);for(let n=0;n$(s,(o=>pv(e,o,n,t,t))),u=t=>{const n=ce(t.childNodes),o=c(t)||$(s,(e=>Cb(i,t,e))),r=t.parentNode;if(!o&&C(r)&&Em(a)&&c(r),a.deep&&n.length)for(let e=0;e{$o(t)&&e.dom.getStyle(t,"text-decoration")===n&&t.parentNode&&vm(i,t.parentNode)===n&&pv(e,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},void 0,t)}))},m=e=>{const t=i.get(e?"_start":"_end");if(t){let n=t[e?"firstChild":"lastChild"];return(e=>Lu(e)&&$o(e)&&("_start"===e.id||"_end"===e.id))(n)&&(n=n[e?"firstChild":"lastChild"]),Jo(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),i.remove(t,!0),n}return null},f=t=>{let n,o,r=Um(i,t,s,t.collapsed);if(a.split){if(r=Bf(r),n=rv(e,r,!0),o=rv(e,r),n!==o){if(n=sv(n,!0),o=sv(o,!1),ov(i,n,o)){const e=I.from(n.firstChild).getOr(n);return d(iv(i,e,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void m(!0)}if(ov(i,o,n)){const e=I.from(o.lastChild).getOr(o);return d(iv(i,e,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void m(!1)}n=av(i,n,"span",{id:"_start","data-mce-type":"bookmark"}),o=av(i,o,"span",{id:"_end","data-mce-type":"bookmark"});const e=i.createRng();e.setStartAfter(n),e.setEndBefore(o),zm(i,e,(e=>{q(e,(e=>{Lu(e)||Lu(e.parentNode)||d(e)}))})),d(n),d(o),n=m(!0),o=m()}else n=o=d(n);r.startContainer=n.parentNode?n.parentNode:n,r.startOffset=i.nodeIndex(n),r.endContainer=o.parentNode?o.parentNode:o,r.endOffset=i.nodeIndex(o)+1}zm(i,r,(e=>{q(e,u)}))};if(o){if(rm(o)){const e=i.createRng();e.setStartBefore(o),e.setEndAfter(o),f(e)}else f(o);Xm(e,t,o,n)}else l.isCollapsed()&&km(a)&&!Yu(e).length?Bb(e,t,n,r):(im(e,(()=>nm(e,f)),(o=>km(a)&&kb(e,t,n,o))),e.nodeChanged()),((e,t,n)=>{"removeformat"===t?q(Vb(e.selection),(t=>{q(Ub,(n=>e.dom.setStyle(t,n,""))),cv(e.dom,t)})):zb(e.formatter,t).each((t=>{q(Vb(e.selection),(o=>uv(e.dom,o,t,n,null)))}))})(e,t,n),Xm(e,t,o,n)})(e,t,n,o,r)},pv=(e,t,n,o,r)=>mv(e,t,n,o,r).fold(L,(t=>(e.dom.rename(o,t),!0)),M),hv=Dt.each,bv=Dt.each,vv=(e,t,n,o)=>{if(bv(n.styles,((n,r)=>{e.setStyle(t,r,gm(n,o))})),n.styles){const n=e.getAttrib(t,"style");n&&e.setAttrib(t,"data-mce-style",n)}},yv=(e,t,n,o)=>{const r=e.formatter.get(t),s=r[0],a=!o&&e.selection.isCollapsed(),i=e.dom,l=e.selection,d=(e,t=s)=>{w(t.onformat)&&t.onformat(e,t,n,o),vv(i,e,t,n),bv(t.attributes,((t,o)=>{i.setAttrib(e,o,gm(t,n))})),bv(t.classes,(t=>{const o=gm(t,n);i.hasClass(e,o)||i.addClass(e,o)}))},c=(e,t)=>{let n=!1;return bv(e,(e=>!(!xm(e)||("false"!==i.getContentEditable(t)||e.ceFalseOverride)&&(!C(e.collapsed)||e.collapsed===a)&&i.is(t,e.selector)&&!xu(t)&&(d(t,e),n=!0,1)))),n},u=e=>{if(m(e)){const t=i.create(e);return d(t),t}return null},f=(o,a,i)=>{const l=[];let m=!0;const f=s.inline||s.block,g=u(f);zm(o,a,(a=>{let u;const p=a=>{let h=!1,b=m,v=!1;const y=a.parentNode,w=y.nodeName.toLowerCase(),x=o.getContentEditable(a);C(x)&&(b=m,m="true"===x,h=!0,v=fm(e,a));const k=m&&!h;if(rr(a)&&!((e,t,n,o)=>{if(md(e)&&km(t)&&n.parentNode){const t=la(e.schema),r=gb(yn(n),(e=>xu(e.dom)));return Ee(t,o)&&bs(yn(n.parentNode),!1)&&!r}return!1})(e,s,a,w))return u=null,void(wm(s)&&o.remove(a));if((o=>(e=>wm(e)&&!0===e.wrapper)(s)&&xb(e,o,t,n))(a))u=null;else{if(((t,n,o)=>{const r=(e=>wm(e)&&!0!==e.wrapper)(s)&&cm(e.schema,t)&&um(e,n,f);return o&&r})(a,w,k)){const e=o.rename(a,f);return d(e),l.push(e),void(u=null)}if(xm(s)){let e=c(r,a);if(!e&&C(y)&&Em(s)&&(e=c(r,y)),!km(s)||e)return void(u=null)}C(g)&&((t,n,r,a)=>{const l=t.nodeName.toLowerCase(),d=um(e,f,l)&&um(e,n,f),c=!i&&Jo(t)&&Ir(t.data),u=xu(t),m=!km(s)||!o.isBlock(t);return(r||a)&&d&&!c&&!u&&m})(a,w,k,v)?(u||(u=o.clone(g,!1),y.insertBefore(u,a),l.push(u)),v&&h&&(m=b),u.appendChild(a)):(u=null,q(ce(a.childNodes),p),h&&(m=b),u=null)}};q(a,p)})),!0===s.links&&q(l,(e=>{const t=e=>{"A"===e.nodeName&&d(e,s),q(ce(e.childNodes),t)};t(e)})),q(l,(a=>{const i=(e=>{let t=0;return q(e.childNodes,(e=>{(e=>C(e)&&Jo(e)&&0===e.length)(e)||Lu(e)||t++})),t})(a);!(l.length>1)&&o.isBlock(a)||0!==i?(km(s)||wm(s)&&s.wrapper)&&(s.exact||1!==i||(a=(e=>{const t=J(e.childNodes,sm).filter((e=>"false"!==o.getContentEditable(e)&&Cb(o,e,s)));return t.map((t=>{const n=o.clone(t,!1);return d(n),o.replace(n,e,!0),o.remove(t,!0),n})).getOr(e)})(a)),((e,t,n,o)=>{hv(t,(t=>{km(t)&&hv(e.dom.select(t.inline,o),(o=>{Wb(o)&&pv(e,t,n,o,t.exact?o:null)})),((e,t,n)=>{if(t.clear_child_styles){const o=t.links?"*:not(a)":"*";qb(e.select(o,n),(n=>{Wb(n)&&am(n)&&qb(t.styles,((t,o)=>{e.setStyle(n,o,"")}))}))}})(e.dom,t,o)}))})(e,r,n,a),((e,t,n,o,r)=>{const s=r.parentNode;xb(e,s,n,o)&&pv(e,t,o,r)||t.merge_with_parents&&s&&e.dom.getParent(s,(s=>!!xb(e,s,n,o)&&(pv(e,t,o,r),!0)))})(e,s,t,n,a),((e,t,n,o)=>{if(t.styles&&t.styles.backgroundColor){const r=Qb(e,"fontSize");Xb(o,(e=>r(e)&&am(e)),Jb(e,"backgroundColor",gm(t.styles.backgroundColor,n)))}})(o,s,n,a),((e,t,n,o)=>{const r=t=>{if($o(t)&&$o(t.parentNode)&&am(t)){const n=vm(e,t.parentNode);e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null)}};t.styles&&(t.styles.color||t.styles.textDecoration)&&(Dt.walk(o,r,"childNodes"),r(o))})(o,s,0,a),((e,t,n,o)=>{if(km(t)&&("sub"===t.inline||"sup"===t.inline)){const n=Qb(e,"fontSize");Xb(o,(e=>n(e)&&am(e)),Jb(e,"fontSize",""));const r=G(e.select("sup"===t.inline?"sub":"sup",o),am);e.remove(r,!0)}})(o,s,0,a),Yb(e,s,0,a)):o.remove(a,!0)}))},g=rm(o)?o:l.getNode();if("false"===i.getContentEditable(g)&&!fm(e,g))return c(r,o=g),void Ym(e,t,o,n);if(s){if(o)if(rm(o)){if(!c(r,o)){const e=i.createRng();e.setStartBefore(o),e.setEndAfter(o),f(i,Um(i,e,r),!0)}}else f(i,o,!0);else a&&km(s)&&!Yu(e).length?((e,t,n)=>{let o;const r=e.selection,s=e.formatter.get(t);if(!s)return;const a=r.getRng();let i=a.startOffset;const l=a.startContainer.nodeValue;o=ku(e.getBody(),r.getStart());const d=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&i>0&&i{nm(e,((e,t)=>{const n=t?e:Um(i,e,r);f(i,n,!1)}))}),M),e.nodeChanged()),zb(e.formatter,t).each((t=>{q((e=>G((e=>{const t=e.getSelectedBlocks(),n=e.getRng();if(e.isCollapsed())return[];if(1===t.length)return jb(n,t[0])&&Hb(n,t[0])?t:[];{const e=le(t).filter((e=>jb(n,e))).toArray(),o=de(t).filter((e=>Hb(n,e))).toArray(),r=t.slice(1,-1);return e.concat(r).concat(o)}})(e),$b(e.dom)))(e.selection),(e=>vv(i,e,t,n)))}));((e,t)=>{ke(Ib,e)&&q(Ib[e],(e=>{e(t)}))})(t,e)}Ym(e,t,o,n)},Cv=(e,t,n,o)=>{(o||e.selection.isEditable())&&yv(e,t,n,o)},wv=e=>ke(e,"vars"),xv=e=>e.selection.getStart(),kv=(e,t,n,o,r)=>Q(t,(t=>{const s=e.formatter.matchNode(t,n,null!=r?r:{},o);return!v(s)}),(t=>!!vb(e,t,n)||!o&&C(e.formatter.matchNode(t,n,r,!0)))),Ev=(e,t)=>{const n=null!=t?t:xv(e);return G(ym(e.dom,n),(e=>$o(e)&&!Go(e)))},Sv=(e,t,n)=>{const o=Ev(e,t);ge(n,((n,r)=>{const s=n=>{const s=kv(e,o,r,n.similar,wv(n)?n.vars:void 0),a=s.isSome();if(n.state.get()!==a){n.state.set(a);const e=s.getOr(t);wv(n)?n.callback(a,{node:e,format:r,parents:o}):q(n.callbacks,(t=>t(a,{node:e,format:r,parents:o})))}};q([n.withSimilar,n.withoutSimilar],s),q(n.withVars,s)}))},_v=Dt.explode,Nv=()=>{const e={};return{addFilter:(t,n)=>{q(_v(t),(t=>{ke(e,t)||(e[t]={name:t,callbacks:[]}),e[t].callbacks.push(n)}))},getFilters:()=>we(e),removeFilter:(t,n)=>{q(_v(t),(t=>{if(ke(e,t))if(C(n)){const o=e[t],r=G(o.callbacks,(e=>e!==n));r.length>0?o.callbacks=r:delete e[t]}else delete e[t]}))}}},Rv=(e,t,n)=>{var o;const r=ua();t.convert_fonts_to_spans&&((e,t,n)=>{e.addNodeFilter("font",(e=>{q(e,(e=>{const o=t.parse(e.attr("style")),r=e.attr("color"),s=e.attr("face"),a=e.attr("size");r&&(o.color=r),s&&(o["font-family"]=s),a&&Xe(a).each((e=>{o["font-size"]=n[e-1]})),e.name="span",e.attr("style",t.serialize(o)),((e,t)=>{q(["color","face","size"],(t=>{e.attr(t,null)}))})(e)}))}))})(e,r,Dt.explode(null!==(o=t.font_size_legacy_values)&&void 0!==o?o:"")),((e,t,n)=>{e.addNodeFilter("strike",(e=>{const o="html4"!==t.type;q(e,(e=>{if(o)e.name="s";else{const t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))}}))}))})(e,n,r)},Av=(e,t,n)=>{t.addNodeFilter("br",((t,o,r)=>{const s=Dt.extend({},n.getBlockElements()),a=n.getNonEmptyElements(),i=n.getWhitespaceElements();s.body=1;const l=e=>e.name in s||Ts(n,e);for(let o=0,d=t.length;o{const[t,...n]=e.split(","),o=n.join(","),r=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(r){const e=";base64"===r[2],t=e?(e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""})(o):decodeURIComponent(o);return I.some({type:r[1],data:t,base64Encoded:e})}return I.none()},Tv=(e,t,n=!0)=>{let o=t;if(n)try{o=atob(t)}catch(e){return I.none()}const r=new Uint8Array(o.length);for(let e=0;enew Promise(((t,n)=>{const o=new FileReader;o.onloadend=()=>{t(o.result)},o.onerror=()=>{var e;n(null===(e=o.error)||void 0===e?void 0:e.message)},o.readAsDataURL(e)}));let Dv=0;const Pv=(e,t,n)=>Ov(e).bind((({data:e,type:o,base64Encoded:r})=>{if(t&&!r)return I.none();{const t=r?e:btoa(e);return n(t,o)}})),Lv=(e,t,n)=>{const o=e.create("blobid"+Dv++,t,n);return e.add(o),o},Mv=(e,t,n=!1)=>Pv(t,n,((t,n)=>I.from(e.getByData(t,n)).orThunk((()=>Tv(n,t).map((n=>Lv(e,n,t))))))),Iv=(e,t)=>{const n=e.schema;t.remove_trailing_brs&&Av(t,e,n),e.addAttributeFilter("href",(e=>{let n=e.length;const o=e=>{const t=e?Dt.trim(e):"";return/\b(noopener)\b/g.test(t)?t:(e=>e.split(" ").filter((e=>e.length>0)).concat(["noopener"]).sort().join(" "))(t)};if(!t.allow_unsafe_link_target)for(;n--;){const t=e[n];"a"===t.name&&"_blank"===t.attr("target")&&t.attr("rel",o(t.attr("rel")))}})),t.allow_html_in_named_anchor||e.addAttributeFilter("id,name",(e=>{let t,n,o,r,s=e.length;for(;s--;)if(r=e[s],"a"===r.name&&r.firstChild&&!r.attr("href"))for(o=r.parent,t=r.lastChild;t&&o;)n=t.prev,o.insert(t,r),t=n})),t.fix_list_elements&&e.addNodeFilter("ul,ol",(e=>{let t,n,o=e.length;for(;o--;)if(t=e[o],n=t.parent,n&&("ul"===n.name||"ol"===n.name))if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{const e=new Fg("li",1);e.attr("style","list-style-type: none"),t.wrap(e)}}));const o=n.getValidClasses();t.validate&&o&&e.addAttributeFilter("class",(e=>{var t;let n=e.length;for(;n--;){const r=e[n],s=null!==(t=r.attr("class"))&&void 0!==t?t:"",a=Dt.explode(s," ");let i="";for(let e=0;e{const{blob_cache:n}=t;if(n){const t=e=>{const t=e.attr("src");(e=>e.attr("src")===At.transparentSrc||C(e.attr("data-mce-placeholder")))(e)||(e=>C(e.attr("data-mce-bogus")))(e)||y(t)||Mv(n,t,!0).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>q(e,t)))}})(e,t)};function Fv(e){return Fv="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},Fv(e)}function Uv(e,t){return Uv=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Uv(e,t)}function zv(e,t,n){return zv=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&Uv(r,n.prototype),r},zv.apply(null,arguments)}function jv(e){return function(e){if(Array.isArray(e))return Hv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Hv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hv(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n1?n-1:0),r=1;r/gm),Ry=Yv(/^data-[\-\w.\u00B7-\uFFFF]/),Ay=Yv(/^aria-[\-\w]+$/),Oy=Yv(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ty=Yv(/^(?:\w+script|data):/i),By=Yv(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Dy=Yv(/^html$/i),Py=function(){return"undefined"==typeof window?null:window},Ly=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Py(),n=function(t){return e(t)};if(n.version="2.3.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var o=t.document,r=t.document,s=t.DocumentFragment,a=t.HTMLTemplateElement,i=t.Node,l=t.Element,d=t.NodeFilter,c=t.NamedNodeMap,u=void 0===c?t.NamedNodeMap||t.MozNamedAttrMap:c,m=t.HTMLFormElement,f=t.DOMParser,g=t.trustedTypes,p=l.prototype,h=gy(p,"cloneNode"),b=gy(p,"nextSibling"),v=gy(p,"childNodes"),y=gy(p,"parentNode");if("function"==typeof a){var C=r.createElement("template");C.content&&C.content.ownerDocument&&(r=C.content.ownerDocument)}var w=function(e,t){if("object"!==Fv(e)||"function"!=typeof e.createPolicy)return null;var n=null,o="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(o)&&(n=t.currentScript.getAttribute(o));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(g,o),x=w?w.createHTML(""):"",k=r,E=k.implementation,S=k.createNodeIterator,_=k.createDocumentFragment,N=k.getElementsByTagName,R=o.importNode,A={};try{A=fy(r).documentMode?r.documentMode:{}}catch(e){}var O={};n.isSupported="function"==typeof y&&E&&void 0!==E.createHTMLDocument&&9!==A;var T,B,D=_y,P=Ny,L=Ry,M=Ay,I=Ty,F=By,U=Oy,z=null,j=my({},[].concat(jv(py),jv(hy),jv(by),jv(yy),jv(wy))),H=null,$=my({},[].concat(jv(xy),jv(ky),jv(Ey),jv(Sy))),V=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,W=null,K=!0,G=!0,Y=!1,X=!1,Q=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!1,oe=!0,re=!0,se=!1,ae={},ie=null,le=my({},["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"]),de=null,ce=my({},["audio","video","img","source","image","track"]),ue=null,me=my({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",he=pe,be=!1,ve=["application/xhtml+xml","text/html"],ye=null,Ce=r.createElement("form"),we=function(e){return e instanceof RegExp||e instanceof Function},xe=function(e){ye&&ye===e||(e&&"object"===Fv(e)||(e={}),e=fy(e),z="ALLOWED_TAGS"in e?my({},e.ALLOWED_TAGS):j,H="ALLOWED_ATTR"in e?my({},e.ALLOWED_ATTR):$,ue="ADD_URI_SAFE_ATTR"in e?my(fy(me),e.ADD_URI_SAFE_ATTR):me,de="ADD_DATA_URI_TAGS"in e?my(fy(ce),e.ADD_DATA_URI_TAGS):ce,ie="FORBID_CONTENTS"in e?my({},e.FORBID_CONTENTS):le,q="FORBID_TAGS"in e?my({},e.FORBID_TAGS):{},W="FORBID_ATTR"in e?my({},e.FORBID_ATTR):{},ae="USE_PROFILES"in e&&e.USE_PROFILES,K=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,Y=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,Q=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,oe=!1!==e.SANITIZE_DOM,re=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,U=e.ALLOWED_URI_REGEXP||U,he=e.NAMESPACE||pe,e.CUSTOM_ELEMENT_HANDLING&&we(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&we(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),T=T=-1===ve.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,B="application/xhtml+xml"===T?function(e){return e}:ry,X&&(G=!1),te&&(ee=!0),ae&&(z=my({},jv(wy)),H=[],!0===ae.html&&(my(z,py),my(H,xy)),!0===ae.svg&&(my(z,hy),my(H,ky),my(H,Sy)),!0===ae.svgFilters&&(my(z,by),my(H,ky),my(H,Sy)),!0===ae.mathMl&&(my(z,yy),my(H,Ey),my(H,Sy))),e.ADD_TAGS&&(z===j&&(z=fy(z)),my(z,e.ADD_TAGS)),e.ADD_ATTR&&(H===$&&(H=fy(H)),my(H,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&my(ue,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ie===le&&(ie=fy(ie)),my(ie,e.FORBID_CONTENTS)),re&&(z["#text"]=!0),Q&&my(z,["html","head","body"]),z.table&&(my(z,["tbody"]),delete q.tbody),Gv&&Gv(e),ye=e)},ke=my({},["mi","mo","mn","ms","mtext"]),Ee=my({},["foreignobject","desc","title","annotation-xml"]),Se=my({},["title","style","font","a","script"]),_e=my({},hy);my(_e,by),my(_e,vy);var Ne=my({},yy);my(Ne,Cy);var Re=function(e){oy(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Ae=function(e,t){try{oy(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){oy(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(ee||te)try{Re(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Oe=function(e){var t,n;if(Z)e=""+e;else{var o=sy(e,/^[\r\n\t ]+/);n=o&&o[0]}"application/xhtml+xml"===T&&(e=''+e+"");var s=w?w.createHTML(e):e;if(he===pe)try{t=(new f).parseFromString(s,T)}catch(e){}if(!t||!t.documentElement){t=E.createDocument(he,"template",null);try{t.documentElement.innerHTML=be?"":s}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(r.createTextNode(n),a.childNodes[0]||null),he===pe?N.call(t,Q?"html":"body")[0]:Q?t.documentElement:a},Te=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Be=function(e){return"object"===Fv(i)?e instanceof i:e&&"object"===Fv(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},De=function(e,t,o){O[e]&&ty(O[e],(function(e){e.call(n,t,o,ye)}))},Pe=function(e){var t,o;if(De("beforeSanitizeElements",e,null),(o=e)instanceof m&&("string"!=typeof o.nodeName||"string"!=typeof o.textContent||"function"!=typeof o.removeChild||!(o.attributes instanceof u)||"function"!=typeof o.removeAttribute||"function"!=typeof o.setAttribute||"string"!=typeof o.namespaceURI||"function"!=typeof o.insertBefore))return Re(e),!0;if(dy(/[\u0080-\uFFFF]/,e.nodeName))return Re(e),!0;var r=B(e.nodeName);if(De("uponSanitizeElement",e,{tagName:r,allowedTags:z}),e.hasChildNodes()&&!Be(e.firstElementChild)&&(!Be(e.content)||!Be(e.content.firstElementChild))&&dy(/<[/\w]/g,e.innerHTML)&&dy(/<[/\w]/g,e.textContent))return Re(e),!0;if("select"===r&&dy(/