%PDF- %PDF-
Direktori : /var/www/projetos/suporte.iigd.com.br/public/lib/ |
Current File : /var/www/projetos/suporte.iigd.com.br/public/lib/tinymce.min.js |
(()=>{var e=[,e=>{(function(){"use strict";var t=function(e){if(e===null){return"null"}if(e===undefined){return"undefined"}var t=typeof e;if(t==="object"&&(Array.prototype.isPrototypeOf(e)||e.constructor&&e.constructor.name==="Array")){return"array"}if(t==="object"&&(String.prototype.isPrototypeOf(e)||e.constructor&&e.constructor.name==="String")){return"string"}return t};var o=function(e){return["undefined","boolean","number","string","function","xml","null"].indexOf(e)!==-1};var n=function(e,t){var o=Array.prototype.slice.call(e);return o.sort(t)};var s=function(e,t){return r((function(o,n){return e.eq(t(o),t(n))}))};var r=function(e){return{eq:e}};var a=r((function(e,t){return e===t}));var c=a;var i=function(e){return r((function(t,o){if(t.length!==o.length){return false}var n=t.length;for(var s=0;s<n;s++){if(!e.eq(t[s],o[s])){return false}}return true}))};var l=function(e,t){return s(i(e),(function(e){return n(e,t)}))};var d=function(e){return r((function(t,o){var n=Object.keys(t);var s=Object.keys(o);if(!l(c).eq(n,s)){return false}var r=n.length;for(var a=0;a<r;a++){var i=n[a];if(!e.eq(t[i],o[i])){return false}}return true}))};var u=r((function(e,n){if(e===n){return true}var s=t(e);var r=t(n);if(s!==r){return false}if(o(s)){return e===n}else if(s==="array"){return i(u).eq(e,n)}else if(s==="object"){return d(u).eq(e,n)}return false}));const f=Object.getPrototypeOf;const m=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const g=e=>{const t=typeof e;if(e===null){return"null"}else if(t==="object"&&Array.isArray(e)){return"array"}else if(t==="object"&&m(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return t}};const p=e=>t=>g(t)===e;const h=e=>t=>typeof t===e;const y=e=>t=>e===t;const b=(e,t)=>k(e)&&m(e,t,((e,t)=>f(e)===t));const v=p("string");const k=p("object");const w=e=>b(e,Object);const _=p("array");const x=y(null);const C=h("boolean");const S=y(undefined);const z=e=>e===null||e===undefined;const T=e=>!z(e);const E=h("function");const O=h("number");const A=(e,t)=>{if(_(e)){for(let o=0,n=e.length;o<n;++o){if(!t(e[o])){return false}}return true}return false};const D=()=>{};const N=(e,t)=>(...o)=>e(t.apply(null,o));const M=(e,t)=>o=>e(t(o));const R=e=>()=>e;const B=e=>e;const L=(e,t)=>e===t;function H(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const I=e=>t=>!e(t);const P=e=>()=>{throw new Error(e)};const F=e=>e();const V=e=>{e()};const j=R(false);const Z=R(true);class U{constructor(e,t){this.tag=e;this.value=t}static some(e){return new U(true,e)}static none(){return U.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return U.some(e(this.value))}else{return U.none()}}bind(e){if(this.tag){return e(this.value)}else{return U.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return U.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return T(e)?U.some(e):U.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}U.singletonNone=new U(false);const q=Array.prototype.slice;const W=Array.prototype.indexOf;const $=Array.prototype.push;const G=(e,t)=>W.call(e,t);const K=(e,t)=>{const o=G(e,t);return o===-1?U.none():U.some(o)};const Y=(e,t)=>G(e,t)>-1;const X=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return true}}return false};const J=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const Q=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const ee=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}};const te=(e,t)=>{const o=[];const n=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];const a=t(r,s)?o:n;a.push(r)}return{pass:o,fail:n}};const oe=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const ne=(e,t,o)=>{ee(e,((e,n)=>{o=t(o,e,n)}));return o};const se=(e,t,o)=>{Q(e,((e,n)=>{o=t(o,e,n)}));return o};const re=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){return U.some(s)}else if(o(s,n)){break}}return U.none()};const ae=(e,t)=>re(e,t,j);const ce=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return U.some(o)}}return U.none()};const ie=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!_(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}$.apply(t,e[o])}return t};const le=(e,t)=>ie(J(e,t));const de=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(t(n,o)!==true){return false}}return true};const ue=e=>{const t=q.call(e,0);t.reverse();return t};const fe=(e,t)=>oe(e,(e=>!Y(t,e)));const me=(e,t)=>{const o={};for(let n=0,s=e.length;n<s;n++){const s=e[n];o[String(s)]=t(s,n)}return o};const ge=(e,t)=>{const o=q.call(e,0);o.sort(t);return o};const pe=(e,t)=>t>=0&&t<e.length?U.some(e[t]):U.none();const he=e=>pe(e,0);const ye=e=>pe(e,e.length-1);const be=E(Array.from)?Array.from:e=>q.call(e);const ve=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return U.none()};const ke=(e,t)=>{const o=[];const n=E(t)?e=>X(o,(o=>t(o,e))):e=>Y(o,e);for(let t=0,s=e.length;t<s;t++){const s=e[t];if(!n(s)){o.push(s)}}return o};const we=Object.keys;const _e=Object.hasOwnProperty;const xe=(e,t)=>{const o=we(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const Ce=(e,t)=>Se(e,((e,o)=>({k:o,v:t(e,o)})));const Se=(e,t)=>{const o={};xe(e,((e,n)=>{const s=t(e,n);o[s.k]=s.v}));return o};const ze=e=>(t,o)=>{e[o]=t};const Te=(e,t,o,n)=>{xe(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const Ee=(e,t)=>{const o={};const n={};Te(e,t,ze(o),ze(n));return{t:o,f:n}};const Oe=(e,t)=>{const o={};Te(e,t,ze(o),D);return o};const Ae=(e,t)=>{const o=[];xe(e,((e,n)=>{o.push(t(e,n))}));return o};const De=e=>Ae(e,B);const Ne=(e,t)=>Me(e,t)?U.from(e[t]):U.none();const Me=(e,t)=>_e.call(e,t);const Re=(e,t)=>Me(e,t)&&e[t]!==undefined&&e[t]!==null;const Be=(e,t,o=u)=>d(o).eq(e,t);const Le=e=>{const t={};Q(e,(e=>{t[e]={}}));return we(t)};const He=e=>e.length!==undefined;const Ie=Array.isArray;const Pe=e=>{if(!Ie(e)){const t=[];for(let o=0,n=e.length;o<n;o++){t[o]=e[o]}return t}else{return e}};const Fe=(e,t,o)=>{if(!e){return false}o=o||e;if(He(e)){for(let n=0,s=e.length;n<s;n++){if(t.call(o,e[n],n,e)===false){return false}}}else{for(const n in e){if(Me(e,n)){if(t.call(o,e[n],n,e)===false){return false}}}}return true};const Ve=(e,t)=>{const o=[];Fe(e,((n,s)=>{o.push(t(n,s,e))}));return o};const je=(e,t)=>{const o=[];Fe(e,((n,s)=>{if(!t||t(n,s,e)){o.push(n)}}));return o};const Ze=(e,t)=>{if(e){for(let o=0,n=e.length;o<n;o++){if(e[o]===t){return o}}}return-1};const Ue=(e,t,o,n)=>{let s=S(o)?e[0]:o;for(let o=0;o<e.length;o++){s=t.call(n,s,e[o],o)}return s};const qe=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){if(t.call(o,e[n],n,e)){return n}}return-1};const We=e=>e[e.length-1];const $e=e=>{let t=false;let o;return(...n)=>{if(!t){t=true;o=e.apply(null,n)}return o}};const Ge=(e,t,o,n)=>{const s=e.isiOS()&&/ipad/i.test(o)===true;const r=e.isiOS()&&!s;const a=e.isiOS()||e.isAndroid();const c=a||n("(pointer:coarse)");const i=s||!r&&a&&n("(min-device-width:768px)");const l=r||a&&!i;const d=t.isSafari()&&e.isiOS()&&/safari/i.test(o)===false;const u=!l&&!i&&!d;return{isiPad:R(s),isiPhone:R(r),isTablet:R(i),isPhone:R(l),isTouch:R(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:R(d),isDesktop:R(u)}};const Ke=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t)){return n}}return undefined};const Ye=(e,t)=>{const o=Ke(e,t);if(!o){return{major:0,minor:0}}const n=e=>Number(t.replace(o,"$"+e));return Qe(n(1),n(2))};const Xe=(e,t)=>{const o=String(t).toLowerCase();if(e.length===0){return Je()}return Ye(e,o)};const Je=()=>Qe(0,0);const Qe=(e,t)=>({major:e,minor:t});const et={nu:Qe,detect:Xe,unknown:Je};const tt=(e,t)=>ve(t.brands,(t=>{const o=t.brand.toLowerCase();return ae(e,(e=>{var t;return o===((t=e.brand)===null||t===void 0?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:et.nu(parseInt(t.version,10),0)})))}));const ot=(e,t)=>{const o=String(t).toLowerCase();return ae(e,(e=>e.search(o)))};const nt=(e,t)=>ot(e,t).map((e=>{const o=et.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const st=(e,t)=>ot(e,t).map((e=>{const o=et.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const rt=(e,t)=>e.substring(t);const at=(e,t,o)=>t===""||e.length>=t.length&&e.substr(o,o+t.length)===t;const ct=(e,t)=>lt(e,t)?rt(e,t.length):e;const it=(e,t,o=0,n)=>{const s=e.indexOf(t,o);if(s!==-1){return S(n)?true:s+t.length<=n}else{return false}};const lt=(e,t)=>at(e,t,0);const dt=(e,t)=>at(e,t,e.length-t.length);const ut=e=>t=>t.replace(e,"");const ft=ut(/^\s+|\s+$/g);const mt=ut(/^\s+/g);const gt=ut(/\s+$/g);const pt=e=>e.length>0;const ht=e=>!pt(e);const yt=(e,t)=>t<=0?"":new Array(t+1).join(e);const bt=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?U.none():U.some(o)};const vt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/;const kt=e=>t=>it(t,e);const wt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>it(e,"edge/")&&it(e,"chrome")&&it(e,"safari")&&it(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,vt],search:e=>it(e,"chrome")&&!it(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>it(e,"msie")||it(e,"trident")},{name:"Opera",versionRegexes:[vt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:kt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:kt("firefox")},{name:"Safari",versionRegexes:[vt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(it(e,"safari")||it(e,"mobile/"))&&it(e,"applewebkit")}];const _t=[{name:"Windows",search:kt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>it(e,"iphone")||it(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:kt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:kt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:kt("linux"),versionRegexes:[]},{name:"Solaris",search:kt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:kt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:kt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}];const xt={browsers:R(wt),oses:R(_t)};const Ct="Edge";const St="Chromium";const zt="IE";const Tt="Opera";const Et="Firefox";const Ot="Safari";const At=()=>Dt({current:undefined,version:et.unknown()});const Dt=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isEdge:n(Ct),isChromium:n(St),isIE:n(zt),isOpera:n(Tt),isFirefox:n(Et),isSafari:n(Ot)}};const Nt={unknown:At,nu:Dt,edge:R(Ct),chromium:R(St),ie:R(zt),opera:R(Tt),firefox:R(Et),safari:R(Ot)};const Mt="Windows";const Rt="iOS";const Bt="Android";const Lt="Linux";const Ht="macOS";const It="Solaris";const Pt="FreeBSD";const Ft="ChromeOS";const Vt=()=>jt({current:undefined,version:et.unknown()});const jt=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Mt),isiOS:n(Rt),isAndroid:n(Bt),isMacOS:n(Ht),isLinux:n(Lt),isSolaris:n(It),isFreeBSD:n(Pt),isChromeOS:n(Ft)}};const Zt={unknown:Vt,nu:jt,windows:R(Mt),ios:R(Rt),android:R(Bt),linux:R(Lt),macos:R(Ht),solaris:R(It),freebsd:R(Pt),chromeos:R(Ft)};const Ut=(e,t,o)=>{const n=xt.browsers();const s=xt.oses();const r=t.bind((e=>tt(n,e))).orThunk((()=>nt(n,e))).fold(Nt.unknown,Nt.nu);const a=st(s,e).fold(Zt.unknown,Zt.nu);const c=Ge(a,r,e,o);return{browser:r,os:a,deviceType:c}};const qt={detect:Ut};const Wt=e=>window.matchMedia(e).matches;let $t=$e((()=>qt.detect(navigator.userAgent,U.from(navigator.userAgentData),Wt)));const Gt=()=>$t();const Kt=navigator.userAgent;const Yt=Gt();const Xt=Yt.browser;const Jt=Yt.os;const Qt=Yt.deviceType;const eo=Kt.indexOf("Windows Phone")!==-1;const to={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:Xt.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!Xt.isIE(),windowsPhone:eo,browser:{current:Xt.current,version:Xt.version,isChromium:Xt.isChromium,isEdge:Xt.isEdge,isFirefox:Xt.isFirefox,isIE:Xt.isIE,isOpera:Xt.isOpera,isSafari:Xt.isSafari},os:{current:Jt.current,version:Jt.version,isAndroid:Jt.isAndroid,isChromeOS:Jt.isChromeOS,isFreeBSD:Jt.isFreeBSD,isiOS:Jt.isiOS,isLinux:Jt.isLinux,isMacOS:Jt.isMacOS,isSolaris:Jt.isSolaris,isWindows:Jt.isWindows},deviceType:{isDesktop:Qt.isDesktop,isiPad:Qt.isiPad,isiPhone:Qt.isiPhone,isPhone:Qt.isPhone,isTablet:Qt.isTablet,isTouch:Qt.isTouch,isWebView:Qt.isWebView}};const oo=/^\s*|\s*$/g;const no=e=>z(e)?"":(""+e).replace(oo,"");const so=(e,t)=>{if(!t){return e!==undefined}if(t==="array"&&Ie(e)){return true}return typeof e===t};const ro=(e,t,o={})=>{const n=v(e)?e.split(t||","):e||[];let s=n.length;while(s--){o[n[s]]={}}return o};const ao=Me;const co=(e,...t)=>{for(let o=0;o<t.length;o++){const n=t[o];for(const t in n){if(Me(n,t)){const o=n[t];if(o!==undefined){e[t]=o}}}}return e};const io=function(e,t,o,n){n=n||this;if(e){if(o){e=e[o]}Fe(e,((e,s)=>{if(t.call(n,e,s,o)===false){return false}else{io(e,t,o,n);return true}}))}};const lo=(e,t=window)=>{const o=e.split(".");for(let e=0,n=o.length;e<n;e++){t=t[o[e]];if(!t){break}}return t};const uo=(e,t)=>{if(_(e)){return e}else if(e===""){return[]}else{return Ve(e.split(t||","),no)}};const fo=e=>{const t=to.cacheSuffix;if(t){e+=(e.indexOf("?")===-1?"?":"&")+t}return e};const mo={trim:no,isArray:Ie,is:so,toArray:Pe,makeMap:ro,each:Fe,map:Ve,grep:je,inArray:Ze,hasOwn:ao,extend:co,walk:io,resolve:lo,explode:uo,_addCacheSuffix:fo};const go=(e,t,o=L)=>e.exists((e=>o(e,t)));const po=(e,t,o=L)=>yo(e,t,o).getOr(e.isNone()&&t.isNone());const ho=e=>{const t=[];const o=e=>{t.push(e)};for(let t=0;t<e.length;t++){e[t].each(o)}return t};const yo=(e,t,o)=>e.isSome()&&t.isSome()?U.some(o(e.getOrDie(),t.getOrDie())):U.none();const bo=(e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?U.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):U.none();const vo=(e,t)=>e?U.some(t):U.none();const ko=typeof window!=="undefined"?window:Function("return this;")();const wo=(e,t)=>{let o=t!==undefined&&t!==null?t:ko;for(let t=0;t<e.length&&o!==undefined&&o!==null;++t){o=o[e[t]]}return o};const _o=(e,t)=>{const o=e.split(".");return wo(o,t)};const xo=(e,t)=>_o(e,t);const Co=(e,t)=>{const o=xo(e,t);if(o===undefined||o===null){throw new Error(e+" not available on this browser")}return o};const So=Object.getPrototypeOf;const zo=e=>Co("HTMLElement",e);const To=e=>{const t=_o("ownerDocument.defaultView",e);return k(e)&&(zo(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(So(e).constructor.name))};const Eo=8;const Oo=9;const Ao=11;const Do=1;const No=3;const Mo=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const Ro=e=>e.dom.nodeType;const Bo=e=>t=>Ro(t)===e;const Lo=e=>Ro(e)===Eo||Mo(e)==="#comment";const Ho=e=>Io(e)&&To(e.dom);const Io=Bo(Do);const Po=Bo(No);const Fo=Bo(Oo);const Vo=Bo(Ao);const jo=e=>t=>Io(t)&&Mo(t)===e;const Zo=(e,t,o)=>{if(v(o)||C(o)||O(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const Uo=(e,t,o)=>{Zo(e.dom,t,o)};const qo=(e,t)=>{const o=e.dom;xe(t,((e,t)=>{Zo(o,t,e)}))};const Wo=(e,t)=>{const o=e.dom.getAttribute(t);return o===null?undefined:o};const $o=(e,t)=>U.from(Wo(e,t));const Go=(e,t)=>{const o=e.dom;return o&&o.hasAttribute?o.hasAttribute(t):false};const Ko=(e,t)=>{e.dom.removeAttribute(t)};const Yo=e=>{const t=e.dom.attributes;return t===undefined||t===null||t.length===0};const Xo=e=>se(e.dom.attributes,((e,t)=>{e[t.name]=t.value;return e}),{});const Jo=(e,t)=>{const o=Wo(e,t);return o===undefined||o===""?[]:o.split(" ")};const Qo=(e,t,o)=>{const n=Jo(e,t);const s=n.concat([o]);Uo(e,t,s.join(" "));return true};const en=(e,t,o)=>{const n=oe(Jo(e,t),(e=>e!==o));if(n.length>0){Uo(e,t,n.join(" "))}else{Ko(e,t)}return false};const tn=e=>e.dom.classList!==undefined;const on=e=>Jo(e,"class");const nn=(e,t)=>Qo(e,"class",t);const sn=(e,t)=>en(e,"class",t);const rn=(e,t)=>{if(Y(on(e),t)){return sn(e,t)}else{return nn(e,t)}};const an=(e,t)=>{if(tn(e)){e.dom.classList.add(t)}else{nn(e,t)}};const cn=e=>{const t=tn(e)?e.dom.classList:on(e);if(t.length===0){Ko(e,"class")}};const ln=(e,t)=>{if(tn(e)){const o=e.dom.classList;o.remove(t)}else{sn(e,t)}cn(e)};const dn=(e,t)=>{const o=tn(e)?e.dom.classList.toggle(t):rn(e,t);cn(e);return o};const un=(e,t)=>tn(e)&&e.dom.classList.contains(t);const fn=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return pn(n.childNodes[0])};const mn=(e,t)=>{const o=t||document;const n=o.createElement(e);return pn(n)};const gn=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return pn(n)};const pn=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const hn=(e,t,o)=>U.from(e.dom.elementFromPoint(t,o)).map(pn);const yn={fromHtml:fn,fromTag:mn,fromText:gn,fromDom:pn,fromPoint:hn};const bn=(e,t)=>{const o=[];const n=e=>{o.push(e);return t(e)};let s=t(e);do{s=s.bind(n)}while(s.isSome());return o};const vn=(e,t)=>{const o=e.dom;if(o.nodeType!==Do){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const kn=e=>e.nodeType!==Do&&e.nodeType!==Oo&&e.nodeType!==Ao||e.childElementCount===0;const wn=(e,t)=>{const o=t===undefined?document:t.dom;return kn(o)?[]:J(o.querySelectorAll(e),yn.fromDom)};const _n=(e,t)=>{const o=t===undefined?document:t.dom;return kn(o)?U.none():U.from(o.querySelector(e)).map(yn.fromDom)};const xn=(e,t)=>e.dom===t.dom;const Cn=(e,t)=>{const o=e.dom;const n=t.dom;return o===n?false:o.contains(n)};const Sn=e=>yn.fromDom(e.dom.ownerDocument);const zn=e=>Fo(e)?e:Sn(e);const Tn=e=>yn.fromDom(zn(e).dom.documentElement);const En=e=>yn.fromDom(zn(e).dom.defaultView);const On=e=>U.from(e.dom.parentNode).map(yn.fromDom);const An=e=>U.from(e.dom.parentElement).map(yn.fromDom);const Dn=(e,t)=>{const o=E(t)?t:j;let n=e.dom;const s=[];while(n.parentNode!==null&&n.parentNode!==undefined){const e=n.parentNode;const t=yn.fromDom(e);s.push(t);if(o(t)===true){break}else{n=e}}return s};const Nn=e=>{const t=t=>oe(t,(t=>!xn(e,t)));return On(e).map(Hn).map(t).getOr([])};const Mn=e=>U.from(e.dom.previousSibling).map(yn.fromDom);const Rn=e=>U.from(e.dom.nextSibling).map(yn.fromDom);const Bn=e=>ue(bn(e,Mn));const Ln=e=>bn(e,Rn);const Hn=e=>J(e.dom.childNodes,yn.fromDom);const In=(e,t)=>{const o=e.dom.childNodes;return U.from(o[t]).map(yn.fromDom)};const Pn=e=>In(e,0);const Fn=e=>In(e,e.dom.childNodes.length-1);const Vn=e=>e.dom.childNodes.length;const jn=e=>{const t=e.dom.head;if(t===null||t===undefined){throw new Error("Head is not available yet")}return yn.fromDom(t)};const Zn=e=>Vo(e)&&T(e.dom.host);const Un=E(Element.prototype.attachShadow)&&E(Node.prototype.getRootNode);const qn=R(Un);const Wn=Un?e=>yn.fromDom(e.dom.getRootNode()):zn;const $n=e=>Zn(e)?e:jn(zn(e));const Gn=e=>Zn(e)?e:yn.fromDom(zn(e).dom.body);const Kn=e=>{const t=Wn(e);return Zn(t)?U.some(t):U.none()};const Yn=e=>yn.fromDom(e.dom.host);const Xn=e=>{if(qn()&&T(e.target)){const t=yn.fromDom(e.target);if(Io(t)&&Jn(t)){if(e.composed&&e.composedPath){const t=e.composedPath();if(t){return he(t)}}}}return U.from(e.target)};const Jn=e=>T(e.dom.shadowRoot);const Qn=e=>{const t=Po(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return Kn(yn.fromDom(t)).fold((()=>o.body.contains(t)),M(Qn,Yn))};var es=(e,t,o,n,s)=>{if(e(o,n)){return U.some(o)}else if(E(s)&&s(o)){return U.none()}else{return t(o,n,s)}};const ts=(e,t,o)=>{let n=e.dom;const s=E(o)?o:j;while(n.parentNode){n=n.parentNode;const e=yn.fromDom(n);if(t(e)){return U.some(e)}else if(s(e)){break}}return U.none()};const os=(e,t,o)=>{const n=(e,t)=>t(e);return es(n,ts,e,t,o)};const ns=(e,t)=>{const o=e.dom;if(!o.parentNode){return U.none()}return ss(yn.fromDom(o.parentNode),(o=>!xn(e,o)&&t(o)))};const ss=(e,t)=>{const o=e=>t(yn.fromDom(e));const n=ae(e.dom.childNodes,o);return n.map(yn.fromDom)};const rs=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const s=yn.fromDom(e.childNodes[n]);if(t(s)){return U.some(s)}const r=o(e.childNodes[n]);if(r.isSome()){return r}}return U.none()};return o(e.dom)};const as=(e,t,o)=>ts(e,(e=>vn(e,t)),o);const cs=(e,t)=>_n(t,e);const is=(e,t,o)=>{const n=(e,t)=>vn(e,t);return es(n,as,e,t,o)};const ls=e=>is(e,"[contenteditable]");const ds=(e,t=false)=>{if(Qn(e)){return e.dom.isContentEditable}else{return ls(e).fold(R(t),(e=>us(e)==="true"))}};const us=e=>e.dom.contentEditable;const fs=e=>e.style!==undefined&&E(e.style.getPropertyValue);const ms=(e,t,o)=>{if(!v(o)){console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e);throw new Error("CSS value must be a string: "+o)}if(fs(e)){e.style.setProperty(t,o)}};const gs=(e,t)=>{if(fs(e)){e.style.removeProperty(t)}};const ps=(e,t,o)=>{const n=e.dom;ms(n,t,o)};const hs=(e,t)=>{const o=e.dom;xe(t,((e,t)=>{ms(o,t,e)}))};const ys=(e,t)=>{const o=e.dom;const n=window.getComputedStyle(o);const s=n.getPropertyValue(t);return s===""&&!Qn(e)?bs(o,t):s};const bs=(e,t)=>fs(e)?e.style.getPropertyValue(t):"";const vs=(e,t)=>{const o=e.dom;const n=bs(o,t);return U.from(n).filter((e=>e.length>0))};const ks=e=>{const t={};const o=e.dom;if(fs(o)){for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}}return t};const ws=(e,t)=>{const o=e.dom;gs(o,t);if(go($o(e,"style").map(ft),"")){Ko(e,"style")}};const _s=e=>e.dom.offsetWidth;const xs=(e,t)=>{const o=On(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))};const Cs=(e,t)=>{const o=Rn(e);o.fold((()=>{const o=On(e);o.each((e=>{zs(e,t)}))}),(e=>{xs(e,t)}))};const Ss=(e,t)=>{const o=Pn(e);o.fold((()=>{zs(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))};const zs=(e,t)=>{e.dom.appendChild(t.dom)};const Ts=(e,t)=>{xs(e,t);zs(t,e)};const Es=(e,t)=>{Q(t,((o,n)=>{const s=n===0?e:t[n-1];Cs(s,o)}))};const Os=(e,t)=>{Q(t,(t=>{zs(e,t)}))};const As=e=>{e.dom.textContent="";Q(Hn(e),(e=>{Ds(e)}))};const Ds=e=>{const t=e.dom;if(t.parentNode!==null){t.parentNode.removeChild(t)}};const Ns=e=>{const t=Hn(e);if(t.length>0){Es(e,t)}Ds(e)};const Ms=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;return Hn(yn.fromDom(n))};const Rs=e=>J(e,yn.fromDom);const Bs=e=>e.dom.innerHTML;const Ls=(e,t)=>{const o=Sn(e);const n=o.dom;const s=yn.fromDom(n.createDocumentFragment());const r=Ms(t,n);Os(s,r);As(e);zs(e,s)};const Hs=e=>{const t=yn.fromTag("div");const o=yn.fromDom(e.dom.cloneNode(true));zs(t,o);return Bs(t)};const Is=(e,t,o,n,s,r,a)=>({target:e,x:t,y:o,stop:n,prevent:s,kill:r,raw:a});const Ps=e=>{const t=yn.fromDom(Xn(e).getOr(e.target));const o=()=>e.stopPropagation();const n=()=>e.preventDefault();const s=N(n,o);return Is(t,e.clientX,e.clientY,o,n,s,e)};const Fs=(e,t)=>o=>{if(e(o)){t(Ps(o))}};const Vs=(e,t,o,n,s)=>{const r=Fs(o,n);e.dom.addEventListener(t,r,s);return{unbind:H(Zs,e,t,r,s)}};const js=(e,t,o,n)=>Vs(e,t,o,n,false);const Zs=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)};const Us=(e,t)=>{const o=(o,n)=>Us(e+o,t+n);return{left:e,top:t,translate:o}};const qs=Us;const Ws=e=>{const t=e.getBoundingClientRect();return qs(t.left,t.top)};const $s=(e,t)=>{if(e!==undefined){return e}else{return t!==undefined?t:0}};const Gs=e=>{const t=e.dom.ownerDocument;const o=t.body;const n=t.defaultView;const s=t.documentElement;if(o===e.dom){return qs(o.offsetLeft,o.offsetTop)}const r=$s(n===null||n===void 0?void 0:n.pageYOffset,s.scrollTop);const a=$s(n===null||n===void 0?void 0:n.pageXOffset,s.scrollLeft);const c=$s(s.clientTop,o.clientTop);const i=$s(s.clientLeft,o.clientLeft);return Ks(e).translate(a-i,r-c)};const Ks=e=>{const t=e.dom;const o=t.ownerDocument;const n=o.body;if(n===t){return qs(n.offsetLeft,n.offsetTop)}if(!Qn(e)){return qs(0,0)}return Ws(t)};const Ys=e=>{const t=e!==undefined?e.dom:document;const o=t.body.scrollLeft||t.documentElement.scrollLeft;const n=t.body.scrollTop||t.documentElement.scrollTop;return qs(o,n)};const Xs=(e,t,o)=>{const n=o!==undefined?o.dom:document;const s=n.defaultView;if(s){s.scrollTo(e,t)}};const Js=(e,t)=>{const o=Gt().browser.isSafari();if(o&&E(e.dom.scrollIntoViewIfNeeded)){e.dom.scrollIntoViewIfNeeded(false)}else{e.dom.scrollIntoView(t)}};const Qs=e=>{const t=e===undefined?window:e;if(Gt().browser.isFirefox()){return U.none()}else{return U.from(t.visualViewport)}};const er=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n});const tr=e=>{const t=e===undefined?window:e;const o=t.document;const n=Ys(yn.fromDom(o));return Qs(t).fold((()=>{const e=t.document.documentElement;const o=e.clientWidth;const s=e.clientHeight;return er(n.left,n.top,o,s)}),(e=>er(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))};const or=(e,t)=>oe(Hn(e),t);const nr=(e,t)=>{let o=[];Q(Hn(e),(e=>{if(t(e)){o=o.concat([e])}o=o.concat(nr(e,t))}));return o};const sr=(e,t)=>wn(t,e);const rr=(e,t,o)=>ts(e,t,o).isSome();const ar=(e,t)=>ns(e,t).isSome();const cr=(e,t)=>rs(e,t).isSome();class ir{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){this.node=this.findSibling(this.node,"firstChild","nextSibling",e);return this.node}prev(e){this.node=this.findSibling(this.node,"lastChild","previousSibling",e);return this.node}prev2(e){this.node=this.findPreviousNode(this.node,e);return this.node}findSibling(e,t,o,n){if(e){if(!n&&e[t]){return e[t]}if(e!==this.rootNode){let t=e[o];if(t){return t}for(let n=e.parentNode;n&&n!==this.rootNode;n=n.parentNode){t=n[o];if(t){return t}}}}return undefined}findPreviousNode(e,t){if(e){const o=e.previousSibling;if(this.rootNode&&o===this.rootNode){return}if(o){if(!t){for(let e=o.lastChild;e;e=e.lastChild){if(!e.lastChild){return e}}}return o}const n=e.parentNode;if(n&&n!==this.rootNode){return n}}return undefined}}const lr="\ufeff";const dr=" ";const ur=e=>e===lr;const fr=e=>e.replace(/\uFEFF/g,"");const mr=/^[ \t\r\n]*$/;const gr=e=>mr.test(e);const pr=e=>{for(const t of e){if(!ur(t)){return false}}return true};const hr=e=>" \f\t\v".indexOf(e)!==-1;const yr=e=>e==="\n"||e==="\r";const br=(e,t)=>t<e.length&&t>=0?yr(e[t]):false;const vr=(e,t=4,o=true,n=true)=>{const s=yt(" ",t);const r=e.replace(/\t/g,s);const a=se(r,((e,t)=>{if(hr(t)||t===dr){if(e.pcIsSpace||e.str===""&&o||e.str.length===r.length-1&&n||br(r,e.str.length+1)){return{pcIsSpace:false,str:e.str+dr}}else{return{pcIsSpace:true,str:e.str+" "}}}else{return{pcIsSpace:yr(t),str:e.str+t}}}),{pcIsSpace:false,str:""});return a.str};const kr=e=>t=>!!t&&t.nodeType===e;const wr=e=>!!e&&!Object.getPrototypeOf(e);const _r=kr(1);const xr=e=>_r(e)&&Ho(yn.fromDom(e));const Cr=e=>_r(e)&&e.namespaceURI==="http://www.w3.org/2000/svg";const Sr=e=>{const t=e.toLowerCase();return e=>T(e)&&e.nodeName.toLowerCase()===t};const zr=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const o=e.nodeName.toLowerCase();return Y(t,o)}return false}};const Tr=(e,t)=>{const o=t.toLowerCase().split(" ");return t=>{if(_r(t)){const n=t.ownerDocument.defaultView;if(n){for(let s=0;s<o.length;s++){const r=n.getComputedStyle(t,null);const a=r?r.getPropertyValue(e):null;if(a===o[s]){return true}}}}return false}};const Er=e=>t=>_r(t)&&t.hasAttribute(e);const Or=e=>_r(e)&&e.hasAttribute("data-mce-bogus");const Ar=e=>_r(e)&&e.getAttribute("data-mce-bogus")==="all";const Dr=e=>_r(e)&&e.tagName==="TABLE";const Nr=e=>t=>{if(xr(t)){if(t.contentEditable===e){return true}if(t.getAttribute("data-mce-contenteditable")===e){return true}}return false};const Mr=zr(["textarea","input"]);const Rr=kr(3);const Br=kr(4);const Lr=kr(7);const Hr=kr(8);const Ir=kr(9);const Pr=kr(11);const Fr=Sr("br");const Vr=Sr("img");const jr=Nr("true");const Zr=Nr("false");const Ur=zr(["td","th"]);const qr=zr(["td","th","caption"]);const Wr=zr(["video","audio","object","embed"]);const $r=Sr("li");const Gr=Sr("details");const Kr=Sr("summary");const Yr={skipBogus:true,includeZwsp:false,checkRootAsContent:false};const Xr=(e,t,o)=>{const n=yn.fromDom(t);const s=yn.fromDom(e);const r=o.getWhitespaceElements();const a=e=>Me(r,Mo(e));return rr(s,a,H(xn,n))};const Jr=e=>_r(e)&&e.nodeName==="A"&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id"));const Qr=(e,t)=>_r(e)&&Me(t.getNonEmptyElements(),e.nodeName);const ea=Er("data-mce-bookmark");const ta=e=>An(yn.fromDom(e)).exists((e=>!ds(e)));const oa=(e,t,o)=>gr(e.data)&&!Xr(e,t,o);const na=(e,t,o,n)=>Rr(e)&&!oa(e,t,o)&&(!n.includeZwsp||!pr(e.data));const sa=(e,t,o,n)=>E(n.isContent)&&n.isContent(t)||Qr(t,e)||ea(t)||Jr(t)||na(t,o,e,n)||Zr(t)||jr(t)&&ta(t);const ra=(e,t,o)=>{const n={...Yr,...o};if(n.checkRootAsContent){if(sa(e,t,t,n)){return false}}let s=t.firstChild;let r=0;if(!s){return true}const a=new ir(s,t);do{if(n.skipBogus&&_r(s)){const e=s.getAttribute("data-mce-bogus");if(e){s=a.next(e==="all");continue}}if(Hr(s)){s=a.next(true);continue}if(Fr(s)){r++;s=a.next();continue}if(sa(e,s,t,n)){return false}s=a.next()}while(s);return r<=1};const aa=(e,t,o)=>ra(e,t.dom,{checkRootAsContent:true,...o});const ca=(e,t,o)=>sa(e,t,t,{includeZwsp:Yr.includeZwsp,...o});const ia=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};const la=e=>{const t=ia(U.none());const o=()=>t.get().each(e);const n=()=>{o();t.set(U.none())};const s=()=>t.get().isSome();const r=()=>t.get();const a=e=>{o();t.set(U.some(e))};return{clear:n,isSet:s,get:r,set:a}};const da=e=>{const t=ia(U.none());const o=()=>t.get().each((e=>clearInterval(e)));const n=()=>{o();t.set(U.none())};const s=()=>t.get().isSome();const r=()=>t.get();const a=n=>{o();t.set(U.some(setInterval(n,e)))};return{clear:n,isSet:s,get:r,set:a}};const ua=()=>{const e=la(D);const t=t=>e.get().each(t);return{...e,on:t}};const fa=e=>{const t=e.toLowerCase();if(t==="svg"){return"svg"}else if(t==="math"){return"math"}else{return"html"}};const ma=e=>fa(e)!=="html";const ga=e=>ma(e.nodeName);const pa=e=>fa(e.nodeName);const ha=["svg","math"];const ya=()=>{const e=ua();const t=()=>e.get().map(pa).getOr("html");const o=o=>{if(ga(o)){e.set(o)}else if(e.get().exists((e=>!e.contains(o)))){e.clear()}return t()};const n=()=>{e.clear()};return{track:o,current:t,reset:n}};const ba="data-mce-block";const va=e=>oe(we(e),(e=>!/[A-Z]/.test(e)));const ka=e=>J(va(e),(e=>{const t=CSS.escape(e);return`${t}:`+J(ha,(e=>`not(${e} ${t})`)).join(":")})).join(",");const wa=(e,t)=>{if(T(t.querySelector(e))){t.setAttribute(ba,"true");if(t.getAttribute("data-mce-selected")==="inline-boundary"){t.removeAttribute("data-mce-selected")}return true}else{t.removeAttribute(ba);return false}};const _a=(e,t)=>{const o=ka(e.getTransparentElements());const n=ka(e.getBlockElements());return oe(t.querySelectorAll(o),(e=>wa(n,e)))};const xa=(e,t,o)=>{var n;const s=o?"lastChild":"firstChild";for(let o=t[s];o;o=o[s]){if(ra(e,o,{checkRootAsContent:true})){(n=o.parentNode)===null||n===void 0?void 0:n.removeChild(o);return}}};const Ca=(e,t,o)=>{const n=document.createRange();const s=t.parentNode;if(s){n.setStartBefore(t);n.setEndBefore(o);const r=n.extractContents();xa(e,r,true);n.setStartAfter(o);n.setEndAfter(t);const a=n.extractContents();xa(e,a,false);if(!ra(e,r,{checkRootAsContent:true})){s.insertBefore(r,t)}if(!ra(e,o,{checkRootAsContent:true})){s.insertBefore(o,t)}if(!ra(e,a,{checkRootAsContent:true})){s.insertBefore(a,t)}s.removeChild(t)}};const Sa=(e,t,o)=>{const n=e.getBlockElements();const s=yn.fromDom(t);const r=e=>Mo(e)in n;const a=e=>xn(e,s);Q(Rs(o),(t=>{ts(t,r,a).each((o=>{const n=or(t,(t=>r(t)&&!e.isValidChild(Mo(o),Mo(t))));if(n.length>0){const t=An(o);Q(n,(t=>{ts(t,r,a).each((o=>{Ca(e,o.dom,t.dom)}))}));t.each((t=>_a(e,t.dom)))}}))}))};const za=(e,t,o)=>{Q([...o,...Ma(e,t)?[t]:[]],(t=>Q(sr(yn.fromDom(t),t.nodeName.toLowerCase()),(t=>{if(Ra(e,t.dom)){Ns(t)}}))))};const Ta=(e,t)=>{const o=_a(e,t);Sa(e,t,o);za(e,t,o)};const Ea=(e,t)=>{if(Na(e,t)){const o=ka(e.getBlockElements());wa(o,t)}};const Oa=(e,t,o)=>{const n=e=>xn(e,yn.fromDom(t));const s=Dn(yn.fromDom(o),n);pe(s,s.length-2).filter(Io).fold((()=>Ta(e,t)),(t=>Ta(e,t.dom)))};const Aa=e=>e.hasAttribute(ba);const Da=(e,t)=>Me(e.getTransparentElements(),t);const Na=(e,t)=>_r(t)&&Da(e,t.nodeName);const Ma=(e,t)=>Na(e,t)&&Aa(t);const Ra=(e,t)=>Na(e,t)&&!Aa(t);const Ba=(e,t)=>t.type===1&&Da(e,t.name)&&v(t.attr(ba));const La=Gt().browser;const Ha=e=>ae(e,Io);const Ia=e=>{if(La.isFirefox()&&Mo(e)==="table"){return Ha(Hn(e)).filter((e=>Mo(e)==="caption")).bind((e=>Ha(Ln(e)).map((t=>{const o=t.dom.offsetTop;const n=e.dom.offsetTop;const s=e.dom.offsetHeight;return o<=n?-s:0})))).getOr(0)}else{return 0}};const Pa=(e,t)=>e.children&&Y(e.children,t);const Fa=(e,t,o)=>{let n=0,s=0;const r=e.ownerDocument;o=o?o:e;if(t){if(o===e&&t.getBoundingClientRect&&ys(yn.fromDom(e),"position")==="static"){const o=t.getBoundingClientRect();n=o.left+(r.documentElement.scrollLeft||e.scrollLeft)-r.documentElement.clientLeft;s=o.top+(r.documentElement.scrollTop||e.scrollTop)-r.documentElement.clientTop;return{x:n,y:s}}let a=t;while(a&&a!==o&&a.nodeType&&!Pa(a,o)){const e=a;n+=e.offsetLeft||0;s+=e.offsetTop||0;a=e.offsetParent}a=t.parentNode;while(a&&a!==o&&a.nodeType&&!Pa(a,o)){n-=a.scrollLeft||0;s-=a.scrollTop||0;a=a.parentNode}s+=Ia(yn.fromDom(t))}return{x:n,y:s}};const Va=(e,t={})=>{let o=0;const n={};const s=yn.fromDom(e);const r=zn(s);const a=e=>{t.referrerPolicy=e};const c=e=>{t.contentCssCors=e};const i=e=>{zs($n(s),e)};const l=e=>{const t=$n(s);cs(t,"#"+e).each(Ds)};const d=e=>Ne(n,e).getOrThunk((()=>({id:"mce-u"+o++,passed:[],failed:[],count:0})));const u=e=>new Promise(((o,s)=>{let a;const c=mo._addCacheSuffix(e);const l=d(c);n[c]=l;l.count++;const u=(e,t)=>{Q(e,V);l.status=t;l.passed=[];l.failed=[];if(a){a.onload=null;a.onerror=null;a=null}};const f=()=>u(l.passed,2);const m=()=>u(l.failed,3);if(o){l.passed.push(o)}if(s){l.failed.push(s)}if(l.status===1){return}if(l.status===2){f();return}if(l.status===3){m();return}l.status=1;const g=yn.fromTag("link",r.dom);qo(g,{rel:"stylesheet",type:"text/css",id:l.id});if(t.contentCssCors){Uo(g,"crossOrigin","anonymous")}if(t.referrerPolicy){Uo(g,"referrerpolicy",t.referrerPolicy)}a=g.dom;a.onload=f;a.onerror=m;i(g);Uo(g,"href",c)}));const f=(e,t)=>{const o=d(e);n[e]=o;o.count++;const s=yn.fromTag("style",r.dom);qo(s,{rel:"stylesheet",type:"text/css",id:o.id});s.dom.innerHTML=t;i(s)};const m=e=>{const t=Promise.allSettled(J(e,(e=>u(e).then(R(e)))));return t.then((e=>{const t=te(e,(e=>e.status==="fulfilled"));if(t.fail.length>0){return Promise.reject(J(t.fail,(e=>e.reason)))}else{return J(t.pass,(e=>e.value))}}))};const g=e=>{const t=mo._addCacheSuffix(e);Ne(n,t).each((e=>{const o=--e.count;if(o===0){delete n[t];l(e.id)}}))};const p=e=>{Ne(n,e).each((t=>{const o=--t.count;if(o===0){delete n[e];l(t.id)}}))};const h=e=>{Q(e,(e=>{g(e)}))};return{load:u,loadRawCss:f,loadAll:m,unload:g,unloadRawCss:p,unloadAll:h,_setReferrerPolicy:a,_setContentCssCors:c}};const ja=()=>{const e=new WeakMap;const t=(t,o)=>{const n=Wn(t);const s=n.dom;return U.from(e.get(s)).getOrThunk((()=>{const t=Va(s,o);e.set(s,t);return t}))};return{forElement:t}};const Za=ja();const Ua=e=>e.nodeName.toLowerCase()==="span";const qa=(e,t)=>T(e)&&(ca(t,e)||t.isInline(e.nodeName.toLowerCase()));const Wa=(e,t,o)=>{const n=new ir(e,t).prev(false);const s=new ir(e,t).next(false);const r=S(n)||qa(n,o);const a=S(s)||qa(s,o);return r&&a};const $a=e=>Ua(e)&&e.getAttribute("data-mce-type")==="bookmark";const Ga=(e,t,o)=>Rr(e)&&e.data.length>0&&Wa(e,t,o);const Ka=e=>_r(e)?e.childNodes.length>0:false;const Ya=e=>Pr(e)||Ir(e);const Xa=(e,t,o,n)=>{var s;const r=n||t;if(_r(t)&&$a(t)){return t}const a=t.childNodes;for(let t=a.length-1;t>=0;t--){Xa(e,a[t],o,r)}if(_r(t)){const e=t.childNodes;if(e.length===1&&$a(e[0])){(s=t.parentNode)===null||s===void 0?void 0:s.insertBefore(e[0],t)}}if(!Ya(t)&&!ca(o,t)&&!Ka(t)&&!Ga(t,r,o)){e.remove(t)}return t};const Ja=mo.makeMap;const Qa=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;const ec=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;const tc=/[<>&\"\']/g;const oc=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi;const nc={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};const sc={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"};const rc={"<":"<",">":">","&":"&",""":'"',"'":`'`};const ac=e=>{const t=yn.fromTag("div").dom;t.innerHTML=e;return t.textContent||t.innerText||e};const cc=(e,t)=>{const o={};if(e){const n=e.split(",");t=t||10;for(let e=0;e<n.length;e+=2){const s=String.fromCharCode(parseInt(n[e],t));if(!sc[s]){const t="&"+n[e+1]+";";o[s]=t;o[t]=s}}return o}else{return undefined}};const ic=cc("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,"+"5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,"+"5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,"+"5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,"+"68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,"+"6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,"+"6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,"+"75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,"+"7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,"+"7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,"+"sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,"+"st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,"+"t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,"+"tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,"+"u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,"+"81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,"+"8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,"+"8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,"+"8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,"+"8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,"+"nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,"+"rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,"+"Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,"+"80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,"+"811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);const lc=(e,t)=>e.replace(t?Qa:ec,(e=>sc[e]||e));const dc=e=>(""+e).replace(tc,(e=>sc[e]||e));const uc=(e,t)=>e.replace(t?Qa:ec,(e=>{if(e.length>1){return"&#"+((e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320)+65536)+";"}return sc[e]||"&#"+e.charCodeAt(0)+";"}));const fc=(e,t,o)=>{const n=o||ic;return e.replace(t?Qa:ec,(e=>sc[e]||n[e]||e))};const mc=(e,t)=>{const o=cc(t)||ic;const n=(e,t)=>e.replace(t?Qa:ec,(e=>{if(sc[e]!==undefined){return sc[e]}if(o[e]!==undefined){return o[e]}if(e.length>1){return"&#"+((e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320)+65536)+";"}return"&#"+e.charCodeAt(0)+";"}));const s=(e,t)=>fc(e,t,o);const r=Ja(e.replace(/\+/g,","));if(r.named&&r.numeric){return n}if(r.named){if(t){return s}return fc}if(r.numeric){return uc}return lc};const gc=e=>e.replace(oc,((e,t)=>{if(t){if(t.charAt(0).toLowerCase()==="x"){t=parseInt(t.substr(1),16)}else{t=parseInt(t,10)}if(t>65535){t-=65536;return String.fromCharCode(55296+(t>>10),56320+(t&1023))}return nc[t]||String.fromCharCode(t)}return rc[e]||ic[e]||ac(e)}));const pc={encodeRaw:lc,encodeAllRaw:dc,encodeNumeric:uc,encodeNamed:fc,getEncodeFunc:mc,decode:gc};const hc=(e,t)=>{e=mo.trim(e);return e?e.split(t||" "):[]};const yc=e=>new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$");const bc=e=>k(e)&&e.source&&Object.prototype.toString.call(e)==="[object RegExp]";const vc=e=>{const t=e=>{if(_(e)){return J(e,t)}else if(bc(e)){return new RegExp(e.source,e.flags)}else if(k(e)){return Ce(e,t)}else{return e}};return t(e)};const kc=e=>{const t=/^(~)?(.+)$/;return le(hc(e,","),(e=>{const o=t.exec(e);if(o){const e=o[1]==="~";const t=e?"span":"div";const n=o[2];return[{cloneName:t,name:n}]}else{return[]}}))};const wc=e=>Object.freeze(["id","accesskey","class","dir","lang","style","tabindex","title","role",...e!=="html4"?["contenteditable","contextmenu","draggable","dropzone","hidden","spellcheck","translate","itemprop","itemscope","itemtype"]:[],...e!=="html5-strict"?["xml:lang"]:[]]);const _c=e=>{let t;let o;t="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";if(e!=="html4"){const e="a ins del canvas map";t+=" article aside details dialog figure main header footer hgroup section nav "+e;o+=" audio canvas command data datalist mark meter output picture "+"progress time wbr video ruby bdi keygen svg"}if(e!=="html5-strict"){const e="acronym applet basefont big font strike tt";o=[o,e].join(" ");const n="center dir isindex noframes";t=[t,n].join(" ")}const n=[t,o].join(" ");return{blockContent:t,phrasingContent:o,flowContent:n}};const xc=e=>{const{blockContent:t,phrasingContent:o,flowContent:n}=_c(e);const s=e=>Object.freeze(e.split(" "));return Object.freeze({blockContent:s(t),phrasingContent:s(o),flowContent:s(n)})};const Cc={html4:$e((()=>xc("html4"))),html5:$e((()=>xc("html5"))),"html5-strict":$e((()=>xc("html5-strict")))};const Sc=(e,t)=>{const{blockContent:o,phrasingContent:n,flowContent:s}=Cc[e]();if(t==="blocks"){return U.some(o)}else if(t==="phrasing"){return U.some(n)}else if(t==="flow"){return U.some(s)}else{return U.none()}};const zc=e=>{const t=wc(e);const{phrasingContent:o,flowContent:n}=_c(e);const s={};const r=(e,t,o)=>{s[e]={attributes:me(t,R({})),attributesOrder:t,children:me(o,R({}))}};const a=(e,o="",n="")=>{const s=hc(n);const a=hc(e);let c=a.length;const i=[...t,...hc(o)];while(c--){r(a[c],i.slice(),s)}};const c=(e,t)=>{const o=hc(e);const n=hc(t);let r=o.length;while(r--){const e=s[o[r]];for(let t=0,o=n.length;t<o;t++){e.attributes[n[t]]={};e.attributesOrder.push(n[t])}}};if(e!=="html5-strict"){const e="acronym applet basefont big font strike tt";Q(hc(e),(e=>{a(e,"",o)}));const t="center dir isindex noframes";Q(hc(t),(e=>{a(e,"",n)}))}a("html","manifest","head body");a("head","","base command link meta noscript script style title");a("title hr noscript br");a("base","href target");a("link","href rel media hreflang type sizes hreflang");a("meta","name http-equiv content charset");a("style","media type scoped");a("script","src async defer type charset");a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus "+"onhashchange onload onmessage onoffline ononline onpagehide onpageshow "+"onpopstate onresize onscroll onstorage onunload",n);a("dd div","",n);a("address dt caption","",e==="html4"?o:n);a("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","",o);a("blockquote","cite",n);a("ol","reversed start type","li");a("ul","","li");a("li","value",n);a("dl","","dt dd");a("a","href target rel media hreflang type",e==="html4"?o:n);a("q","cite",o);a("ins del","cite datetime",n);a("img","src sizes srcset alt usemap ismap width height");a("iframe","src name width height",n);a("embed","src type width height");a("object","data type typemustmatch name usemap form width height",[n,"param"].join(" "));a("param","name value");a("map","name",[n,"area"].join(" "));a("area","alt coords shape href target rel media hreflang type");a("table","border","caption colgroup thead tfoot tbody tr"+(e==="html4"?" col":""));a("colgroup","span","col");a("col","span");a("tbody thead tfoot","","tr");a("tr","","td th");a("td","colspan rowspan headers",n);a("th","colspan rowspan headers scope abbr",n);a("form","accept-charset action autocomplete enctype method name novalidate target",n);a("fieldset","disabled form name",[n,"legend"].join(" "));a("label","form for",o);a("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");a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",e==="html4"?n:o);a("select","disabled form multiple name required size","option optgroup");a("optgroup","disabled label","option");a("option","disabled label selected value");a("textarea","cols dirname disabled form maxlength name readonly required rows wrap");a("menu","type label",[n,"li"].join(" "));a("noscript","",n);if(e!=="html4"){a("wbr");a("ruby","",[o,"rt rp"].join(" "));a("figcaption","",n);a("mark rt rp bdi","",o);a("summary","",[o,"h1 h2 h3 h4 h5 h6"].join(" "));a("canvas","width height",n);a("data","value",o);a("video","src crossorigin poster preload autoplay mediagroup loop "+"muted controls width height buffered",[n,"track source"].join(" "));a("audio","src crossorigin preload autoplay mediagroup loop muted controls "+"buffered volume",[n,"track source"].join(" "));a("picture","","img source");a("source","src srcset type media sizes");a("track","kind src srclang label default");a("datalist","",[o,"option"].join(" "));a("article section nav aside main header footer","",n);a("hgroup","","h1 h2 h3 h4 h5 h6");a("figure","",[n,"figcaption"].join(" "));a("time","datetime",o);a("dialog","open",n);a("command","type label icon disabled checked radiogroup command");a("output","for form name",o);a("progress","value max",o);a("meter","value min max low high optimum",o);a("details","open",[n,"summary"].join(" "));a("keygen","autofocus challenge disabled form keytype name");r("svg","id tabindex lang xml:space class style x y width height viewBox preserveAspectRatio zoomAndPan transform".split(" "),[])}if(e!=="html5-strict"){c("script","language xml:space");c("style","xml:space");c("object","declare classid code codebase codetype archive standby align border hspace vspace");c("embed","align name hspace vspace");c("param","valuetype type");c("a","charset name rev shape coords");c("br","clear");c("applet","codebase archive code object alt name width height align hspace vspace");c("img","name longdesc align border hspace vspace");c("iframe","longdesc frameborder marginwidth marginheight scrolling align");c("font basefont","size color face");c("input","usemap align");c("select");c("textarea");c("h1 h2 h3 h4 h5 h6 div p legend caption","align");c("ul","type compact");c("li","type");c("ol dl menu dir","compact");c("pre","width xml:space");c("hr","align noshade size width");c("isindex","prompt");c("table","summary width frame rules cellspacing cellpadding align bgcolor");c("col","width align char charoff valign");c("colgroup","width align char charoff valign");c("thead","align char charoff valign");c("tr","align char charoff valign bgcolor");c("th","axis align char charoff valign nowrap bgcolor width height");c("form","accept");c("td","abbr axis scope align char charoff valign nowrap bgcolor width height");c("tfoot","align char charoff valign");c("tbody","align char charoff valign");c("area","nohref");c("body","background bgcolor text link vlink alink")}if(e!=="html4"){c("input button select textarea","autofocus");c("input textarea","placeholder");c("a","download");c("link script img","crossorigin");c("img","loading");c("iframe","sandbox seamless allow allowfullscreen loading referrerpolicy")}if(e!=="html4"){Q([s.video,s.audio],(e=>{delete e.children.audio;delete e.children.video}))}Q(hc("a form meter progress dfn"),(e=>{if(s[e]){delete s[e].children[e]}}));delete s.caption.children.table;delete s.script;return s};const Tc=e=>e==="-"?"remove":"add";const Ec=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 U.from(t.exec(e)).map((e=>({preset:e[1]==="@",name:e[2]})))};const Oc=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 le(hc(e,","),(e=>{const o=t.exec(e);if(o){const e=o[1];const t=e?Tc(e):"replace";const n=o[2];const s=le(hc(o[3],"|"),(e=>Ec(e).toArray()));return[{operation:t,name:n,validChildren:s}]}else{return[]}}))};const Ac=(e,t)=>{const o=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/;const n=/[*?+]/;const{attributes:s,attributesOrder:r}=t;return Q(hc(e,"|"),(e=>{const a=o.exec(e);if(a){const e={};const o=a[1];const c=a[2].replace(/[\\:]:/g,":");const i=a[3];const l=a[4];if(o==="!"){t.attributesRequired=t.attributesRequired||[];t.attributesRequired.push(c);e.required=true}if(o==="-"){delete s[c];r.splice(mo.inArray(r,c),1);return}if(i){if(i==="="){t.attributesDefault=t.attributesDefault||[];t.attributesDefault.push({name:c,value:l});e.defaultValue=l}else if(i==="~"){t.attributesForced=t.attributesForced||[];t.attributesForced.push({name:c,value:l});e.forcedValue=l}else if(i==="<"){e.validValues=mo.makeMap(l,"?")}}if(n.test(c)){const o=e;t.attributePatterns=t.attributePatterns||[];o.pattern=yc(c);t.attributePatterns.push(o)}else{if(!s[c]){r.push(c)}s[c]=e}}}))};const Dc=(e,t)=>{xe(e.attributes,((e,o)=>{t.attributes[o]=e}));t.attributesOrder.push(...e.attributesOrder)};const Nc=(e,t)=>{const o=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return le(hc(t,","),(t=>{const n=o.exec(t);if(n){const t=n[1];const o=n[2];const s=n[3];const r=n[4];const a=n[5];const c={attributes:{},attributesOrder:[]};e.each((e=>Dc(e,c)));if(t==="#"){c.paddEmpty=true}else if(t==="-"){c.removeEmpty=true}if(r==="!"){c.removeEmptyAttrs=true}if(a){Ac(a,c)}if(s){c.outputName=o}if(o==="@"){if(e.isNone()){e=U.some(c)}else{return[]}}return[s?{name:o,element:c,aliasName:s}:{name:o,element:c}]}else{return[]}}))};const Mc={};const Rc=mo.makeMap,Bc=mo.each,Lc=mo.extend,Hc=mo.explode;const Ic=(e,t={})=>{const o=Rc(e," ",Rc(e.toUpperCase()," "));return Lc(o,t)};const Pc=e=>Ic("td th li dt dd figcaption caption details summary",e.getTextBlockElements());const Fc=(e,t)=>{if(e){const o={};if(v(e)){e={"*":e}}Bc(e,((e,n)=>{o[n]=o[n.toUpperCase()]=t==="map"?Rc(e,/[, ]/):Hc(e,/[, ]/)}));return o}else{return undefined}};const Vc=(e={})=>{var t;const o={};const n={};let s=[];const r={};const a={};const c=(t,o,n)=>{const s=e[t];if(!s){let e=Mc[t];if(!e){e=Ic(o,n);Mc[t]=e}return e}else{return Rc(s,/[, ]/,Rc(s.toUpperCase(),/[, ]/))}};const i=(t=e.schema)!==null&&t!==void 0?t:"html5";const l=zc(i);if(e.verify_html===false){e.valid_elements="*[*]"}const d=Fc(e.valid_styles);const u=Fc(e.invalid_styles,"map");const f=Fc(e.valid_classes,"map");const m=c("whitespace_elements","pre script noscript style textarea video audio iframe object code");const g=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");const p=c("void_elements","area base basefont br col frame hr img input isindex link "+"meta param embed source wbr track");const h=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize "+"noshade nowrap readonly selected autoplay loop controls allowfullscreen");const y="td th iframe video audio object script code";const b=c("non_empty_elements",y+" pre svg textarea summary",p);const w=c("move_caret_before_on_enter_elements",y+" table",p);const x="h1 h2 h3 h4 h5 h6";const S=c("text_block_elements",x+" p div address pre form "+"blockquote center dir fieldset header footer article section hgroup aside main nav figure");const z=c("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 html body multicol listing",S);const T=c("text_inline_elements","span strong b em i font s strike u var cite "+"dfn code mark q sup sub samp");const E=c("transparent_elements","a ins del canvas map");const O=c("wrap_block_elements","pre "+x);Bc("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),(e=>{a[e]=new RegExp("</"+e+"[^>]*>","gi")}));const A=e=>{const t=U.from(o["@"]);const n=/[*?+]/;Q(Nc(t,e!==null&&e!==void 0?e:""),(({name:e,element:t,aliasName:r})=>{if(r){o[r]=t}if(n.test(e)){const o=t;o.pattern=yc(e);s.push(o)}else{o[e]=t}}))};const D=e=>{s=[];Q(we(o),(e=>{delete o[e]}));A(e)};const N=(e,t)=>{var s,a;delete Mc.text_block_elements;delete Mc.block_elements;const c=t.extends?!se(t.extends):false;const l=t.extends;n[e]=l?n[l]:{};r[e]=l!==null&&l!==void 0?l:e;b[e.toUpperCase()]={};b[e]={};if(!c){z[e.toUpperCase()]={};z[e]={}}if(l&&!o[e]&&o[l]){const t=vc(o[l]);delete t.removeEmptyAttrs;delete t.removeEmpty;o[e]=t}else{o[e]={attributesOrder:[],attributes:{}}}if(_(t.attributes)){const n=e=>{r.attributesOrder.push(e);r.attributes[e]={}};const r=(s=o[e])!==null&&s!==void 0?s:{};delete r.attributesDefault;delete r.attributesForced;delete r.attributePatterns;delete r.attributesRequired;r.attributesOrder=[];r.attributes={};Q(t.attributes,(e=>{const t=wc(i);Ec(e).each((({preset:e,name:o})=>{if(e){if(o==="global"){Q(t,n)}}else{n(o)}}))}));o[e]=r}if(C(t.padEmpty)){const n=(a=o[e])!==null&&a!==void 0?a:{};n.paddEmpty=t.padEmpty;o[e]=n}if(_(t.children)){const o={};const s=e=>{o[e]={}};const r=e=>{Sc(i,e).each((e=>{Q(e,s)}))};Q(t.children,(e=>{Ec(e).each((({preset:e,name:t})=>{if(e){r(t)}else{s(t)}}))}));n[e]=o}if(l){xe(n,((t,o)=>{if(t[l]){n[o]=t=Lc({},n[o]);t[e]=t[l]}}))}};const M=e=>{Q(kc(e!==null&&e!==void 0?e:""),(({name:e,cloneName:t})=>{N(e,{extends:t})}))};const B=e=>{if(k(e)){xe(e,((e,t)=>N(t,e)))}else if(v(e)){M(e)}};const L=e=>{Q(Oc(e!==null&&e!==void 0?e:""),(({operation:e,name:t,validChildren:o})=>{const s=e==="replace"?{"#comment":{}}:n[t];const r=t=>{if(e==="remove"){delete s[t]}else{s[t]={}}};const a=e=>{Sc(i,e).each((e=>{Q(e,r)}))};Q(o,(({preset:e,name:t})=>{if(e){a(t)}else{r(t)}}));n[t]=s}))};const H=e=>{const t=o[e];if(t){return t}let n=s.length;while(n--){const t=s[n];if(t.pattern.test(e)){return t}}return undefined};const I=()=>{if(!e.valid_elements){Bc(l,((e,t)=>{o[t]={attributes:e.attributes,attributesOrder:e.attributesOrder};n[t]=e.children}));Bc(hc("strong/b em/i"),(e=>{const t=hc(e,"/");o[t[1]].outputName=t[0]}));Bc(T,((t,n)=>{if(o[n]){if(e.padd_empty_block_inline_children){o[n].paddInEmptyBlock=true}o[n].removeEmpty=true}}));Bc(hc("ol ul blockquote a table tbody"),(e=>{if(o[e]){o[e].removeEmpty=true}}));Bc(hc("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),(e=>{if(o[e]){o[e].paddEmpty=true}}));Bc(hc("span"),(e=>{o[e].removeEmptyAttrs=true}))}else{D(e.valid_elements);Bc(l,((e,t)=>{n[t]=e.children}))}delete o.svg;B(e.custom_elements);L(e.valid_children);A(e.extended_valid_elements);L("+ol[ul|ol],+ul[ul|ol]");Bc({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)=>{if(o[t]){o[t].parentsRequired=hc(e)}}));if(e.invalid_elements){Bc(Hc(e.invalid_elements),(e=>{if(o[e]){delete o[e]}}))}if(!H("span")){A("span[!data-mce-type|*]")}};const P=R(d);const F=R(u);const V=R(f);const j=R(h);const Z=R(z);const q=R(S);const W=R(T);const $=R(Object.seal(p));const G=R(g);const K=R(b);const Y=R(w);const X=R(m);const J=R(E);const ee=R(O);const te=R(Object.seal(a));const oe=(e,t)=>{const o=n[e.toLowerCase()];return!!(o&&o[t.toLowerCase()])};const ne=(e,t)=>{const o=H(e);if(o){if(t){if(o.attributes[t]){return true}const e=o.attributePatterns;if(e){let o=e.length;while(o--){if(e[o].pattern.test(t)){return true}}}}else{return true}}return false};const se=e=>Me(Z(),e);const re=e=>!lt(e,"#")&&ne(e)&&!se(e);const ae=e=>Me(ee(),e)||re(e);const ce=R(r);I();return{type:i,children:n,elements:o,getValidStyles:P,getValidClasses:V,getBlockElements:Z,getInvalidStyles:F,getVoidElements:$,getTextBlockElements:q,getTextInlineElements:W,getBoolAttrs:j,getElementRule:H,getSelfClosingElements:G,getNonEmptyElements:K,getMoveCaretBeforeOnEnterElements:Y,getWhitespaceElements:X,getTransparentElements:J,getSpecialElements:te,isValidChild:oe,isValid:ne,isBlock:se,isInline:re,isWrapper:ae,getCustomElements:ce,addValidElements:A,setValidElements:D,addCustomElements:B,addValidChildren:L}};const jc=e=>({value:Zc(e)});const Zc=e=>ct(e,"#").toUpperCase();const Uc=e=>{const t=e.toString(16);return(t.length===1?"0"+t:t).toUpperCase()};const qc=e=>{const t=Uc(e.red)+Uc(e.green)+Uc(e.blue);return jc(t)};const Wc=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i;const $c=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i;const Gc=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n});const Kc=(e,t,o,n)=>{const s=parseInt(e,10);const r=parseInt(t,10);const a=parseInt(o,10);const c=parseFloat(n);return Gc(s,r,a,c)};const Yc=e=>{if(Wc.test(e)){return"rgb"}else if($c.test(e)){return"rgba"}return"other"};const Xc=e=>{const t=Wc.exec(e);if(t!==null){return U.some(Kc(t[1],t[2],t[3],"1"))}const o=$c.exec(e);if(o!==null){return U.some(Kc(o[1],o[2],o[3],o[4]))}return U.none()};const Jc=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`;const Qc=e=>Xc(e).map(qc).map((e=>"#"+e.value)).getOr(e);const ei=(e={},t)=>{const o=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi;const n=/\s*([^:]+):\s*([^;]+);?/g;const s=/\s+$/;const r={};let a;let c;const i=lr;if(t){a=t.getValidStyles();c=t.getInvalidStyles()}const l=(`\\" \\' \\; \\: ; : `+i).split(" ");for(let e=0;e<l.length;e++){r[l[e]]=i+e;r[i+e]=l[e]}const d={parse:t=>{const a={};let c=false;const l=e.url_converter;const u=e.url_converter_scope||d;const f=(e,t,o)=>{const n=a[e+"-top"+t];if(!n){return}const s=a[e+"-right"+t];if(!s){return}const r=a[e+"-bottom"+t];if(!r){return}const c=a[e+"-left"+t];if(!c){return}const i=[n,s,r,c];let l=i.length-1;while(l--){if(i[l]!==i[l+1]){break}}if(l>-1&&o){return}a[e+t]=l===-1?i[0]:i.join(" ");delete a[e+"-top"+t];delete a[e+"-right"+t];delete a[e+"-bottom"+t];delete a[e+"-left"+t]};const m=e=>{const t=a[e];if(!t){return}const o=t.indexOf(",")>-1?[t]:t.split(" ");let n=o.length;while(n--){if(o[n]!==o[0]){return false}}a[e]=o[0];return true};const g=(e,t,o,n)=>{if(!m(t)){return}if(!m(o)){return}if(!m(n)){return}a[e]=a[t]+" "+a[o]+" "+a[n];delete a[t];delete a[o];delete a[n]};const p=e=>{c=true;return r[e]};const h=(e,t)=>{if(c){e=e.replace(/\uFEFF[0-9]/g,(e=>r[e]))}if(!t){e=e.replace(/\\([\'\";:])/g,"$1")}return e};const y=e=>String.fromCharCode(parseInt(e.slice(1),16));const b=e=>e.replace(/\\[0-9a-f]+/gi,y);const v=(t,o,n,s,r,a)=>{r=r||a;if(r){r=h(r);return`'`+r.replace(/\'/g,`\\'`)+`'`}o=h(o||n||s||"");if(!e.allow_script_urls){const t=o.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""}}if(l){o=l.call(u,o,"style")}return`url('`+o.replace(/\'/g,`\\'`)+`')`};if(t){t=t.replace(/[\u0000-\u001F]/g,"");t=t.replace(/\\[\"\';:\uFEFF]/g,p).replace(/\"[^\"]+\"|\'[^\']+\'/g,(e=>e.replace(/[;:]/g,p)));let r;while(r=n.exec(t)){n.lastIndex=r.index+r[0].length;let t=r[1].replace(s,"").toLowerCase();let l=r[2].replace(s,"");if(t&&l){t=b(t);l=b(l);if(t.indexOf(i)!==-1||t.indexOf('"')!==-1){continue}if(!e.allow_script_urls&&(t==="behavior"||/expression\s*\(|\/\*|\*\//.test(l))){continue}if(t==="font-weight"&&l==="700"){l="bold"}else if(t==="color"||t==="background-color"){l=l.toLowerCase()}if(Yc(l)==="rgb"){Xc(l).each((e=>{l=Qc(Jc(e)).toLowerCase()}))}l=l.replace(o,v);a[t]=c?h(l,true):l}}f("border","",true);f("border","-width");f("border","-color");f("border","-style");f("padding","");f("margin","");g("border","border-width","border-style","border-color");if(a.border==="medium none"){delete a.border}if(a["border-image"]==="none"){delete a["border-image"]}}return a},serialize:(e,t)=>{let o="";const n=(t,n)=>{const s=n[t];if(s){for(let t=0,n=s.length;t<n;t++){const n=s[t];const r=e[n];if(r){o+=(o.length>0?" ":"")+n+": "+r+";"}}}};const s=(e,t)=>{if(!c||!t){return true}let o=c["*"];if(o&&o[e]){return false}o=c[t];return!(o&&o[e])};if(t&&a){n("*",a);n(t,a)}else{xe(e,((e,n)=>{if(e&&s(n,t)){o+=(o.length>0?" ":"")+n+": "+e+";"}}))}return o}};return d};const ti={keyLocation:true,layerX:true,layerY:true,returnValue:true,webkitMovementX:true,webkitMovementY:true,keyIdentifier:true,mozPressure:true};const oi=e=>e instanceof Event||E(e.initEvent);const ni=e=>e.isDefaultPrevented===Z||e.isDefaultPrevented===j;const si=e=>z(e.preventDefault)||oi(e);const ri=(e,t)=>{const o=t!==null&&t!==void 0?t:{};for(const t in e){if(!Me(ti,t)){o[t]=e[t]}}if(T(e.composedPath)){o.composedPath=()=>e.composedPath()}if(T(e.getModifierState)){o.getModifierState=t=>e.getModifierState(t)}if(T(e.getTargetRanges)){o.getTargetRanges=()=>e.getTargetRanges()}return o};const ai=(e,t,o,n)=>{var s;const r=ri(t,n);r.type=e;if(z(r.target)){r.target=(s=r.srcElement)!==null&&s!==void 0?s:o}if(si(t)){r.preventDefault=()=>{r.defaultPrevented=true;r.isDefaultPrevented=Z;if(E(t.preventDefault)){t.preventDefault()}};r.stopPropagation=()=>{r.cancelBubble=true;r.isPropagationStopped=Z;if(E(t.stopPropagation)){t.stopPropagation()}};r.stopImmediatePropagation=()=>{r.isImmediatePropagationStopped=Z;r.stopPropagation()};if(!ni(r)){r.isDefaultPrevented=r.defaultPrevented===true?Z:j;r.isPropagationStopped=r.cancelBubble===true?Z:j;r.isImmediatePropagationStopped=j}}return r};const ci="mce-data-";const ii=/^(?:mouse|contextmenu)|click/;const li=(e,t,o,n)=>{e.addEventListener(t,o,n||false)};const di=(e,t,o,n)=>{e.removeEventListener(t,o,n||false)};const ui=e=>T(e)&&ii.test(e.type);const fi=(e,t)=>{const o=ai(e.type,e,document,t);if(ui(e)&&S(e.pageX)&&!S(e.clientX)){const t=o.target.ownerDocument||document;const n=t.documentElement;const s=t.body;const r=o;r.pageX=e.clientX+(n&&n.scrollLeft||s&&s.scrollLeft||0)-(n&&n.clientLeft||s&&s.clientLeft||0);r.pageY=e.clientY+(n&&n.scrollTop||s&&s.scrollTop||0)-(n&&n.clientTop||s&&s.clientTop||0)}return o};const mi=(e,t,o)=>{const n=e.document,s={type:"ready"};if(o.domLoaded){t(s);return}const r=()=>n.readyState==="complete"||n.readyState==="interactive"&&n.body;const a=()=>{di(e,"DOMContentLoaded",a);di(e,"load",a);if(!o.domLoaded){o.domLoaded=true;t(s)}e=null};if(r()){a()}else{li(e,"DOMContentLoaded",a)}if(!o.domLoaded){li(e,"load",a)}};class gi{constructor(){this.domLoaded=false;this.events={};this.count=1;this.expando=ci+(+new Date).toString(32);this.hasFocusIn="onfocusin"in document.documentElement;this.count=1}bind(e,t,o,n){const s=this;let r;const a=window;const c=e=>{s.executeHandlers(fi(e||a.event),i)};if(!e||Rr(e)||Hr(e)){return o}let i;if(!e[s.expando]){i=s.count++;e[s.expando]=i;s.events[i]={}}else{i=e[s.expando]}n=n||e;const l=t.split(" ");let d=l.length;while(d--){let t=l[d];let u=c;let f=false;let m=false;if(t==="DOMContentLoaded"){t="ready"}if(s.domLoaded&&t==="ready"&&e.readyState==="complete"){o.call(n,fi({type:t}));continue}if(!s.hasFocusIn&&(t==="focusin"||t==="focusout")){f=true;m=t==="focusin"?"focus":"blur";u=e=>{const t=fi(e||a.event);t.type=t.type==="focus"?"focusin":"focusout";s.executeHandlers(t,i)}}r=s.events[i][t];if(!r){s.events[i][t]=r=[{func:o,scope:n}];r.fakeName=m;r.capture=f;r.nativeHandler=u;if(t==="ready"){mi(e,u,s)}else{li(e,m||t,u,f)}}else{if(t==="ready"&&s.domLoaded){o(fi({type:t}))}else{r.push({func:o,scope:n})}}}e=r=null;return o}unbind(e,t,o){if(!e||Rr(e)||Hr(e)){return this}const n=e[this.expando];if(n){let s=this.events[n];if(t){const n=t.split(" ");let r=n.length;while(r--){const t=n[r];const a=s[t];if(a){if(o){let e=a.length;while(e--){if(a[e].func===o){const o=a.nativeHandler;const n=a.fakeName,r=a.capture;const c=a.slice(0,e).concat(a.slice(e+1));c.nativeHandler=o;c.fakeName=n;c.capture=r;s[t]=c}}}if(!o||a.length===0){delete s[t];di(e,a.fakeName||t,a.nativeHandler,a.capture)}}}}else{xe(s,((t,o)=>{di(e,t.fakeName||o,t.nativeHandler,t.capture)}));s={}}for(const e in s){if(Me(s,e)){return this}}delete this.events[n];try{delete e[this.expando]}catch(t){e[this.expando]=null}}return this}fire(e,t,o){return this.dispatch(e,t,o)}dispatch(e,t,o){if(!e||Rr(e)||Hr(e)){return this}const n=fi({type:t,target:e},o);do{const t=e[this.expando];if(t){this.executeHandlers(n,t)}e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow}while(e&&!n.isPropagationStopped());return this}clean(e){if(!e||Rr(e)||Hr(e)){return this}if(e[this.expando]){this.unbind(e)}if(!e.getElementsByTagName){e=e.document}if(e&&e.getElementsByTagName){this.unbind(e);const t=e.getElementsByTagName("*");let o=t.length;while(o--){e=t[o];if(e[this.expando]){this.unbind(e)}}}return this}destroy(){this.events={}}cancel(e){if(e){e.preventDefault();e.stopImmediatePropagation()}return false}executeHandlers(e,t){const o=this.events[t];const n=o&&o[e.type];if(n){for(let t=0,o=n.length;t<o;t++){const o=n[t];if(o&&o.func.call(o.scope,e)===false){e.preventDefault()}if(e.isImmediatePropagationStopped()){return}}}}}gi.Event=new gi;const pi=mo.each;const hi=mo.grep;const yi="data-mce-style";const bi=mo.makeMap("fill-opacity font-weight line-height opacity orphans widows z-index zoom"," ");const vi=(e,t,o)=>{if(z(o)||o===""){Ko(e,t)}else{Uo(e,t,o)}};const ki=e=>e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()));const wi=(e,t)=>{let o=0;if(e){for(let n=e.nodeType,s=e.previousSibling;s;s=s.previousSibling){const e=s.nodeType;if(t&&Rr(s)){if(e===n||!s.data.length){continue}}o++;n=e}}return o};const _i=(e,t)=>{const o=Wo(t,"style");const n=e.serialize(e.parse(o),Mo(t));vi(t,yi,n)};const xi=(e,t)=>{if(O(e)){return Me(bi,t)?e+"":e+"px"}else{return e}};const Ci=(e,t,o)=>{const n=ki(t);if(z(o)||o===""){ws(e,n)}else{ps(e,n,xi(o,n))}};const Si=(e,t,o)=>{const n=t.keep_values;const s={set:(e,n,s)=>{const r=yn.fromDom(e);if(E(t.url_converter)&&T(n)){n=t.url_converter.call(t.url_converter_scope||o(),String(n),s,e)}const a="data-mce-"+s;vi(r,a,n);vi(r,s,n)},get:(e,t)=>{const o=yn.fromDom(e);return Wo(o,"data-mce-"+t)||Wo(o,t)}};const r={style:{set:(t,o)=>{const s=yn.fromDom(t);if(n){vi(s,yi,o)}Ko(s,"style");if(v(o)){hs(s,e.parse(o))}},get:t=>{const o=yn.fromDom(t);const n=Wo(o,yi)||Wo(o,"style");return e.serialize(e.parse(n),Mo(o))}}};if(n){r.href=r.src=s}return r};const zi=(e,t={})=>{const o={};const n=window;const s={};let r=0;const a=true;const c=true;const i=Za.forElement(yn.fromDom(e),{contentCssCors:t.contentCssCors,referrerPolicy:t.referrerPolicy});const l=[];const d=t.schema?t.schema:Vc({});const u=ei({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema);const f=t.ownEvents?new gi:gi.Event;const m=d.getBlockElements();const g=e=>{if(v(e)){return Me(m,e)}else{return _r(e)&&(Me(m,e.nodeName)||Ma(d,e))}};const p=t=>t&&e&&v(t)?e.getElementById(t):t;const h=e=>{const t=p(e);return T(t)?yn.fromDom(t):null};const y=(e,t,o="")=>{let n;const s=h(e);if(T(s)&&Io(s)){const e=Ve[t];if(e&&e.get){n=e.get(s.dom,t)}else{n=Wo(s,t)}}return T(n)?n:o};const b=e=>{const t=p(e);return z(t)?[]:t.attributes};const k=(e,o,n)=>{q(e,(e=>{if(_r(e)){const s=yn.fromDom(e);const r=n===""?null:n;const a=Wo(s,o);const c=Ve[o];if(c&&c.set){c.set(s.dom,r,o)}else{vi(s,o,r)}if(a!==r&&t.onSetAttrib){t.onSetAttrib({attrElm:s.dom,attrName:o,attrValue:r})}}}))};const x=(e,t)=>e.cloneNode(t);const C=()=>t.root_element||e.body;const S=e=>{const t=tr(e);return{x:t.x,y:t.y,w:t.width,h:t.height}};const O=(t,o)=>Fa(e.body,p(t),o);const A=(e,o,n)=>{q(e,(e=>{const s=yn.fromDom(e);Ci(s,o,n);if(t.update_styles){_i(u,s)}}))};const N=(e,o)=>{q(e,(e=>{const n=yn.fromDom(e);xe(o,((e,t)=>{Ci(n,t,e)}));if(t.update_styles){_i(u,n)}}))};const M=(e,t,o)=>{const n=p(e);if(z(n)||!xr(n)&&!Cr(n)){return undefined}if(o){return ys(yn.fromDom(n),ki(t))}else{t=t.replace(/-(\D)/g,((e,t)=>t.toUpperCase()));if(t==="float"){t="cssFloat"}return n.style?n.style[t]:undefined}};const B=e=>{const t=p(e);if(!t){return{w:0,h:0}}let o=M(t,"width");let n=M(t,"height");if(!o||o.indexOf("px")===-1){o="0"}if(!n||n.indexOf("px")===-1){n="0"}return{w:parseInt(o,10)||t.offsetWidth||t.clientWidth,h:parseInt(n,10)||t.offsetHeight||t.clientHeight}};const L=e=>{const t=p(e);const o=O(t);const n=B(t);return{x:o.x,y:o.y,w:n.w,h:n.h}};const H=(e,t)=>{if(!e){return false}const o=_(e)?e:[e];return X(o,(e=>vn(yn.fromDom(e),t)))};const I=(e,t,o,n)=>{const s=[];let r=p(e);n=n===undefined;const a=o||(C().nodeName!=="BODY"?C().parentNode:null);if(v(t)){if(t==="*"){t=_r}else{const e=t;t=t=>H(t,e)}}while(r){if(r===a||z(r.nodeType)||Ir(r)||Pr(r)){break}if(!t||t(r)){if(n){s.push(r)}else{return[r]}}r=r.parentNode}return n?s:null};const P=(e,t,o)=>{const n=I(e,t,o,false);return n&&n.length>0?n[0]:null};const F=(e,t,o)=>{let n=t;if(e){if(v(t)){n=e=>H(e,t)}for(let t=e[o];t;t=t[o]){if(E(n)&&n(t)){return t}}}return null};const V=(e,t)=>F(e,t,"nextSibling");const j=(e,t)=>F(e,t,"previousSibling");const Z=e=>E(e.querySelectorAll);const U=(o,n)=>{var s,r;const a=(r=(s=p(n))!==null&&s!==void 0?s:t.root_element)!==null&&r!==void 0?r:e;return Z(a)?be(a.querySelectorAll(o)):[]};const q=function(e,t,o){const n=o!==null&&o!==void 0?o:this;if(_(e)){const o=[];pi(e,((e,s)=>{const r=p(e);if(r){o.push(t.call(n,r,s))}}));return o}else{const o=p(e);return!o?false:t.call(n,o)}};const W=(e,t)=>{q(e,(e=>{xe(t,((t,o)=>{k(e,o,t)}))}))};const $=(e,t)=>{q(e,(e=>{const o=yn.fromDom(e);Ls(o,t)}))};const G=(t,o,n,s,r)=>q(t,(t=>{const a=v(o)?e.createElement(o):o;if(T(n)){W(a,n)}if(s){if(!v(s)&&s.nodeType){a.appendChild(s)}else if(v(s)){$(a,s)}}return!r?t.appendChild(a):a}));const K=(t,o,n)=>G(e.createElement(t),t,o,n,true);const Y=pc.decode;const J=pc.encodeAllRaw;const ee=(e,t,o="")=>{let n="<"+e;for(const e in t){if(Re(t,e)){n+=" "+e+'="'+J(t[e])+'"'}}if(ht(o)&&Me(d.getVoidElements(),e)){return n+" />"}else{return n+">"+o+"</"+e+">"}};const te=t=>{const o=e.createElement("div");const n=e.createDocumentFragment();n.appendChild(o);if(t){o.innerHTML=t}let s;while(s=o.firstChild){n.appendChild(s)}n.removeChild(o);return n};const oe=(e,t)=>q(e,(e=>{const o=yn.fromDom(e);if(t){Q(Hn(o),(e=>{if(Po(e)&&e.dom.length===0){Ds(e)}else{xs(o,e)}}))}Ds(o);return o.dom}));const ne=e=>q(e,(e=>{const t=e.attributes;for(let o=t.length-1;o>=0;o--){e.removeAttributeNode(t.item(o))}}));const se=e=>u.parse(e);const re=(e,t)=>u.serialize(e,t);const ae=t=>{if(Fe!==zi.DOM&&e===document){if(o[t]){return}o[t]=true}let n=e.getElementById("mceDefaultStyles");if(!n){n=e.createElement("style");n.id="mceDefaultStyles";n.type="text/css";const t=e.head;if(t.firstChild){t.insertBefore(n,t.firstChild)}else{t.appendChild(n)}}if(n.styleSheet){n.styleSheet.cssText+=t}else{n.appendChild(e.createTextNode(t))}};const ce=e=>{if(!e){e=""}Q(e.split(","),(e=>{s[e]=true;i.load(e).catch(D)}))};const ie=(e,t,o)=>{q(e,(e=>{if(_r(e)){const n=yn.fromDom(e);const s=t.split(" ");Q(s,(e=>{if(T(o)){const t=o?an:ln;t(n,e)}else{dn(n,e)}}))}}))};const le=(e,t)=>{ie(e,t,true)};const ue=(e,t)=>{ie(e,t,false)};const fe=(e,t)=>{const o=h(e);const n=t.split(" ");return T(o)&&de(n,(e=>un(o,e)))};const me=e=>{q(e,(e=>ws(yn.fromDom(e),"display")))};const ge=e=>{q(e,(e=>ps(yn.fromDom(e),"display","none")))};const pe=e=>{const t=h(e);return T(t)&&go(vs(t,"display"),"none")};const he=e=>(!e?"mce_":e)+r++;const ye=e=>{const t=h(e);if(T(t)){return _r(t.dom)?t.dom.outerHTML:Hs(t)}else{return""}};const ve=(e,t)=>{q(e,(e=>{if(_r(e)){e.outerHTML=t}}))};const ke=(e,t)=>{const o=p(t);return q(e,(e=>{const t=o===null||o===void 0?void 0:o.parentNode;const n=o===null||o===void 0?void 0:o.nextSibling;if(t){if(n){t.insertBefore(e,n)}else{t.appendChild(e)}}return e}))};const we=(e,t,o)=>q(t,(n=>{var s;const r=_(t)?e.cloneNode(true):e;if(o){pi(hi(n.childNodes),(e=>{r.appendChild(e)}))}(s=n.parentNode)===null||s===void 0?void 0:s.replaceChild(r,n);return n}));const _e=(e,t)=>{if(e.nodeName!==t.toUpperCase()){const o=K(t);pi(b(e),(t=>{k(o,t.nodeName,y(e,t.nodeName))}));we(o,e,true);return o}else{return e}};const Ce=(e,t)=>{let o=e;while(o){let e=t;while(e&&o!==e){e=e.parentNode}if(o===e){break}o=o.parentNode}if(!o&&e.ownerDocument){return e.ownerDocument.documentElement}else{return o}};const Se=(e,t,o)=>{if(w(t)){const n=e=>{const o=e.nodeName.toLowerCase();return Boolean(t[o])};return ra(d,e,{...o,isContent:n})}else{return ra(d,e,o)}};const ze=()=>e.createRange();const Te=(e,t,o)=>{let n=ze();let s;let r;if(e&&t&&e.parentNode&&t.parentNode){const a=e.parentNode;n.setStart(a,wi(e));n.setEnd(t.parentNode,wi(t));s=n.extractContents();n=ze();n.setStart(t.parentNode,wi(t)+1);n.setEnd(a,wi(e)+1);r=n.extractContents();a.insertBefore(Xa(Fe,s,d),e);if(o){a.insertBefore(o,e)}else{a.insertBefore(t,e)}a.insertBefore(Xa(Fe,r,d),e);oe(e);return o||t}else{return undefined}};const Ee=(o,s,r,a)=>{if(_(o)){let e=o.length;const t=[];while(e--){t[e]=Ee(o[e],s,r,a)}return t}else{if(t.collect&&(o===e||o===n)){l.push([o,s,r,a])}return f.bind(o,s,r,a||Fe)}};const Oe=(t,o,s)=>{if(_(t)){let e=t.length;const n=[];while(e--){n[e]=Oe(t[e],o,s)}return n}else{if(l.length>0&&(t===e||t===n)){let e=l.length;while(e--){const[n,r,a]=l[e];if(t===n&&(!o||o===r)&&(!s||s===a)){f.unbind(n,r,a)}}}return f.unbind(t,o,s)}};const Ae=(e,t,o)=>f.dispatch(e,t,o);const De=(e,t,o)=>f.dispatch(e,t,o);const Ne=e=>{if(e&&xr(e)){const t=e.getAttribute("data-mce-contenteditable");if(t&&t!=="inherit"){return t}return e.contentEditable!=="inherit"?e.contentEditable:null}else{return null}};const Be=e=>{const t=C();let o=null;for(let n=e;n&&n!==t;n=n.parentNode){o=Ne(n);if(o!==null){break}}return o};const Le=e=>{if(T(e)){const t=_r(e)?e:e.parentElement;return T(t)&&xr(t)&&ds(yn.fromDom(t))}else{return false}};const He=()=>{if(l.length>0){let e=l.length;while(e--){const[t,o,n]=l[e];f.unbind(t,o,n)}}xe(s,((e,t)=>{i.unload(t);delete s[t]}))};const Ie=(e,t)=>e===t||t.contains(e);const Pe=e=>"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset;const Fe={doc:e,settings:t,win:n,files:s,stdMode:a,boxModel:c,styleSheetLoader:i,boundEvents:l,styles:u,schema:d,events:f,isBlock:g,root:null,clone:x,getRoot:C,getViewPort:S,getRect:L,getSize:B,getParent:P,getParents:I,get:p,getNext:V,getPrev:j,select:U,is:H,add:G,create:K,createHTML:ee,createFragment:te,remove:oe,setStyle:A,getStyle:M,setStyles:N,removeAllAttribs:ne,setAttrib:k,setAttribs:W,getAttrib:y,getPos:O,parseStyle:se,serializeStyle:re,addStyle:ae,loadCSS:ce,addClass:le,removeClass:ue,hasClass:fe,toggleClass:ie,show:me,hide:ge,isHidden:pe,uniqueId:he,setHTML:$,getOuterHTML:ye,setOuterHTML:ve,decode:Y,encode:J,insertAfter:ke,replace:we,rename:_e,findCommonAncestor:Ce,run:q,getAttribs:b,isEmpty:Se,createRng:ze,nodeIndex:wi,split:Te,bind:Ee,unbind:Oe,fire:De,dispatch:Ae,getContentEditable:Ne,getContentEditableParent:Be,isEditable:Le,destroy:He,isChildOf:Ie,dumpRng:Pe};const Ve=Si(u,t,R(Fe));return Fe};zi.DOM=zi(document);zi.nodeIndex=wi;const Ti=zi.DOM;const Ei=0;const Oi=1;const Ai=2;const Di=3;class Ni{constructor(e={}){this.states={};this.queue=[];this.scriptLoadedCallbacks={};this.queueLoadedCallbacks=[];this.loading=false;this.settings=e}_setReferrerPolicy(e){this.settings.referrerPolicy=e}loadScript(e){return new Promise(((t,o)=>{const n=Ti;let s;const r=()=>{n.remove(i);if(s){s.onerror=s.onload=s=null}};const a=()=>{r();t()};const c=()=>{r();o("Failed to load script: "+e)};const i=n.uniqueId();s=document.createElement("script");s.id=i;s.type="text/javascript";s.src=mo._addCacheSuffix(e);if(this.settings.referrerPolicy){n.setAttrib(s,"referrerpolicy",this.settings.referrerPolicy)}s.onload=a;s.onerror=c;(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}))}isDone(e){return this.states[e]===Ai}markDone(e){this.states[e]=Ai}add(e){const t=this;t.queue.push(e);const o=t.states[e];if(o===undefined){t.states[e]=Ei}return new Promise(((o,n)=>{if(!t.scriptLoadedCallbacks[e]){t.scriptLoadedCallbacks[e]=[]}t.scriptLoadedCallbacks[e].push({resolve:o,reject:n})}))}load(e){return this.add(e)}remove(e){delete this.states[e];delete this.scriptLoadedCallbacks[e]}loadQueue(){const e=this.queue;this.queue=[];return this.loadScripts(e)}loadScripts(e){const t=this;const o=(e,o)=>{Ne(t.scriptLoadedCallbacks,o).each((t=>{Q(t,(t=>t[e](o)))}));delete t.scriptLoadedCallbacks[o]};const n=e=>{const t=oe(e,(e=>e.status==="rejected"));if(t.length>0){return Promise.reject(le(t,(({reason:e})=>_(e)?e:[e])))}else{return Promise.resolve()}};const s=e=>Promise.allSettled(J(e,(e=>{if(t.states[e]===Ai){o("resolve",e);return Promise.resolve()}else if(t.states[e]===Di){o("reject",e);return Promise.reject(e)}else{t.states[e]=Oi;return t.loadScript(e).then((()=>{t.states[e]=Ai;o("resolve",e);const r=t.queue;if(r.length>0){t.queue=[];return s(r).then(n)}else{return Promise.resolve()}}),(()=>{t.states[e]=Di;o("reject",e);return Promise.reject(e)}))}})));const r=e=>{t.loading=true;return s(e).then((e=>{t.loading=false;const o=t.queueLoadedCallbacks.shift();U.from(o).each(V);return n(e)}))};const a=Le(e);if(t.loading){return new Promise(((e,o)=>{t.queueLoadedCallbacks.push((()=>{r(a).then(e,o)}))}))}else{return r(a)}}}Ni.ScriptLoader=new Ni;const Mi=(e,t)=>{const o=e.indexOf(t);return o!==-1&&e.indexOf(t,o+1)>o};const Ri=e=>k(e)&&Me(e,"raw");const Bi=e=>_(e)&&e.length>1;const Li={};const Hi=ia("en");const Ii=()=>Ne(Li,Hi.get());const Pi=()=>Ce(Li,(e=>({...e})));const Fi=e=>{if(e){Hi.set(e)}};const Vi=()=>Hi.get();const ji=(e,t)=>{let o=Li[e];if(!o){Li[e]=o={}}const n=J(we(t),(e=>e.toLowerCase()));xe(t,((e,s)=>{const r=s.toLowerCase();if(r!==s&&Mi(n,r)){if(!Me(t,r)){o[r]=e}o[s]=e}else{o[r]=e}}))};const Zi=e=>{const t=Ii().getOr({});const o=e=>{if(E(e)){return Object.prototype.toString.call(e)}return!n(e)?""+e:""};const n=e=>e===""||e===null||e===undefined;const s=e=>{const n=o(e);return Me(t,n)?o(t[n]):Ne(t,n.toLowerCase()).map(o).getOr(n)};const r=e=>e.replace(/{context:\w+}$/,"");if(n(e)){return""}if(Ri(e)){return o(e.raw)}if(Bi(e)){const t=e.slice(1);const n=s(e[0]).replace(/\{([0-9]+)\}/g,((e,n)=>Me(t,n)?o(t[n]):e));return r(n)}return r(s(e))};const Ui=()=>Ii().bind((e=>Ne(e,"_dir"))).exists((e=>e==="rtl"));const qi=e=>Me(Li,e);const Wi={getData:Pi,setCode:Fi,getCode:Vi,add:ji,translate:Zi,isRtl:Ui,hasCode:qi};const $i=()=>{const e=[];const t={};const o={};const n=[];const s=(e,t)=>{const o=oe(n,(o=>o.name===e&&o.state===t));Q(o,(e=>e.resolve()))};const r=e=>Me(t,e);const a=e=>Me(o,e);const c=e=>{if(o[e]){return o[e].instance}return undefined};const i=(e,o)=>{const n=Wi.getCode();const s=","+(o||"")+",";if(!n||o&&s.indexOf(","+n+",")===-1){return}Ni.ScriptLoader.add(t[e]+"/langs/"+n+".js")};const l=(e,t)=>{if($i.languageLoad!==false){if(r(e)){i(e,t)}else{g(e,"loaded").then((()=>i(e,t)))}}};const d=(t,n)=>{e.push(n);o[t]={instance:n};s(t,"added");return n};const u=e=>{delete t[e];delete o[e]};const f=(e,t)=>{if(v(t)){return v(e)?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}}else{return t}};const m=(e,n)=>{if(t[e]){return Promise.resolve()}let r=v(n)?n:n.prefix+n.resource+n.suffix;if(r.indexOf("/")!==0&&r.indexOf("://")===-1){r=$i.baseURL+"/"+r}t[e]=r.substring(0,r.lastIndexOf("/"));const a=()=>{s(e,"loaded");return Promise.resolve()};if(o[e]){return a()}else{return Ni.ScriptLoader.add(r).then(a)}};const g=(e,t="added")=>{if(t==="added"&&a(e)){return Promise.resolve()}else if(t==="loaded"&&r(e)){return Promise.resolve()}else{return new Promise((o=>{n.push({name:e,state:t,resolve:o})}))}};return{items:e,urls:t,lookup:o,get:c,requireLangPack:l,add:d,remove:u,createUrl:f,load:m,waitFor:g}};$i.languageLoad=true;$i.baseURL="";$i.PluginManager=$i();$i.ThemeManager=$i();$i.ModelManager=$i();const Gi=(e,t)=>{let o=null;const n=()=>{if(!x(o)){clearTimeout(o);o=null}};const s=(...n)=>{if(x(o)){o=setTimeout((()=>{o=null;e.apply(null,n)}),t)}};return{cancel:n,throttle:s}};const Ki=(e,t)=>{let o=null;const n=()=>{if(!x(o)){clearTimeout(o);o=null}};const s=(...s)=>{n();o=setTimeout((()=>{o=null;e.apply(null,s)}),t)};return{cancel:n,throttle:s}};const Yi=(e,t,o)=>as(e,t,o).isSome();const Xi=R("mce-annotation");const Ji=R("data-mce-annotation");const Qi=R("data-mce-annotation-uid");const el=R("data-mce-annotation-active");const tl=R("data-mce-annotation-classes");const ol=R("data-mce-annotation-attrs");const nl=e=>t=>xn(t,e);const sl=(e,t)=>{const o=e.selection.getRng();const n=yn.fromDom(o.startContainer);const s=yn.fromDom(e.getBody());const r=t.fold((()=>"."+Xi()),(e=>`[${Ji()}="${e}"]`));const a=In(n,o.startOffset).getOr(n);const c=is(a,r,nl(s));return c.bind((t=>$o(t,`${Qi()}`).bind((o=>$o(t,`${Ji()}`).map((t=>{const n=cl(e,o);return{uid:o,name:t,elements:n}}))))))};const rl=e=>Io(e)&&un(e,Xi());const al=(e,t)=>Go(e,"data-mce-bogus")||Yi(e,'[data-mce-bogus="all"]',nl(t));const cl=(e,t)=>{const o=yn.fromDom(e.getBody());const n=sr(o,`[${Qi()}="${t}"]`);return oe(n,(e=>!al(e,o)))};const il=(e,t)=>{const o=yn.fromDom(e.getBody());const n=sr(o,`[${Ji()}="${t}"]`);const s={};Q(n,(e=>{if(!al(e,o)){const t=Wo(e,Qi());const o=Ne(s,t).getOr([]);s[t]=o.concat([e])}}));return s};const ll=(e,t)=>{const o=ia({});const n=()=>({listeners:[],previous:ua()});const s=(e,t)=>{r(e,(e=>{t(e);return e}))};const r=(e,t)=>{const s=o.get();const r=Ne(s,e).getOrThunk(n);const a=t(r);s[e]=a;o.set(s)};const a=(e,t,o)=>{s(e,(n=>{Q(n.listeners,(n=>n(true,e,{uid:t,nodes:J(o,(e=>e.dom))})))}))};const c=e=>{s(e,(t=>{Q(t.listeners,(t=>t(false,e)))}))};const i=(t,o)=>{Q(cl(e,t),(e=>{if(o){Uo(e,el(),"true")}else{Ko(e,el())}}))};const l=Ki((()=>{const o=ge(t.getNames());Q(o,(t=>{r(t,(o=>{const n=o.previous.get();sl(e,U.some(t)).fold((()=>{n.each((e=>{c(t);o.previous.clear();i(e,false)}))}),(({uid:e,name:t,elements:s})=>{if(!go(n,e)){n.each((e=>i(e,false)));a(t,e,s);o.previous.set(e);i(e,true)}}));return{previous:o.previous,listeners:o.listeners}}))}))}),30);e.on("remove",(()=>{l.cancel()}));e.on("NodeChange",(()=>{l.throttle()}));const d=(e,t)=>{r(e,(e=>({previous:e.previous,listeners:e.listeners.concat([t])})))};return{addListener:d}};const dl=(e,t)=>{const o=Ji();const n=e=>U.from(e.attr(o)).bind(t.lookup);const s=e=>{var t,o;e.attr(Qi(),null);e.attr(Ji(),null);e.attr(el(),null);const n=U.from(e.attr(ol())).map((e=>e.split(","))).getOr([]);const s=U.from(e.attr(tl())).map((e=>e.split(","))).getOr([]);Q(n,(t=>e.attr(t,null)));const r=(o=(t=e.attr("class"))===null||t===void 0?void 0:t.split(" "))!==null&&o!==void 0?o:[];const a=fe(r,[Xi()].concat(s));e.attr("class",a.length>0?a.join(" "):null);e.attr(tl(),null);e.attr(ol(),null)};e.serializer.addTempAttr(el());e.serializer.addAttributeFilter(o,(e=>{for(const t of e){n(t).each((e=>{if(e.persistent===false){if(t.name==="span"){t.unwrap()}else{s(t)}}}))}}))};const ul=()=>{const e={};const t=(t,o)=>{e[t]={name:t,settings:o}};const o=t=>Ne(e,t).map((e=>e.settings));const n=()=>we(e);return{register:t,lookup:o,getNames:n}};let fl=0;const ml=e=>{const t=new Date;const o=t.getTime();const n=Math.floor(Math.random()*1e9);fl++;return e+"_"+n+fl+String(o)};const gl=(e,t)=>{Q(t,(t=>{an(e,t)}))};const pl=(e,t)=>{Q(t,(t=>{ln(e,t)}))};const hl=(e,t)=>yn.fromDom(e.dom.cloneNode(t));const yl=e=>hl(e,false);const bl=e=>hl(e,true);const vl=(e,t)=>{const o=yn.fromTag(t);const n=Xo(e);qo(o,n);return o};const kl=(e,t)=>{const o=vl(e,t);Cs(e,o);const n=Hn(e);Os(o,n);Ds(e);return o};const wl=(e,t,o=j)=>{const n=new ir(e,t);const s=e=>{let t;do{t=n[e]()}while(t&&!Rr(t)&&!o(t));return U.from(t).filter(Rr)};return{current:()=>U.from(n.current()).filter(Rr),next:()=>s("next"),prev:()=>s("prev"),prev2:()=>s("prev2")}};const _l=(e,t)=>{const o=t?t:t=>e.isBlock(t)||Fr(t)||Zr(t);const n=(e,t,o,s)=>{if(Rr(e)){const o=s(e,t,e.data);if(o!==-1){return U.some({container:e,offset:o})}}return o().bind((e=>n(e.container,e.offset,o,s)))};const s=(t,s,r,a)=>{const c=wl(t,a!==null&&a!==void 0?a:e.getRoot(),o);return n(t,s,(()=>c.prev().map((e=>({container:e,offset:e.length})))),r).getOrNull()};const r=(t,s,r,a)=>{const c=wl(t,a!==null&&a!==void 0?a:e.getRoot(),o);return n(t,s,(()=>c.next().map((e=>({container:e,offset:0})))),r).getOrNull()};return{backwards:s,forwards:r}};const xl=(e,t)=>{const o=o=>{if(!e(o)){throw new Error("Can only get "+t+" value of a "+t+" node")}return n(o).getOr("")};const n=t=>e(t)?U.from(t.dom.nodeValue):U.none();const s=(o,n)=>{if(!e(o)){throw new Error("Can only set raw "+t+" value of a "+t+" node")}o.dom.nodeValue=n};return{get:o,getOption:n,set:s}};const Cl=xl(Po,"text");const Sl=e=>Cl.get(e);const zl=e=>Cl.getOption(e);const Tl=(e,t)=>Cl.set(e,t);const El=["td","th"];const Ol=["thead","tbody","tfoot"];const Al=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"];const Dl=["li","dd","dt"];const Nl=["ul","ol","dl"];const Ml=["pre","script","textarea","style"];const Rl=e=>{let t;return o=>{t=t?t:me(e,Z);return Me(t,Mo(o))}};const Bl=e=>Mo(e)==="table";const Ll=e=>Io(e)&&Mo(e)==="br";const Hl=Rl(Al);const Il=Rl(Nl);const Pl=Rl(Dl);const Fl=Rl(Ol);const Vl=Rl(El);const jl=Rl(Ml);const Zl=e=>{const t=[];let o=e.dom;while(o){t.push(yn.fromDom(o));o=o.lastChild}return t};const Ul=e=>{const t=sr(e,"br");const o=oe(Zl(e).slice(-1),Ll);if(t.length===o.length){Q(o,Ds)}};const ql=()=>{const e=yn.fromTag("br");Uo(e,"data-mce-bogus","1");return e};const Wl=e=>{As(e);zs(e,ql())};const $l=(e,t)=>{Fn(e).each((o=>{Mn(o).each((n=>{if(t.isBlock(Mo(e))&&Ll(o)&&t.isBlock(Mo(n))){Ds(o)}}))}))};const Gl=lr;const Kl=ur;const Yl=fr;const Xl=e=>e.insertContent(Gl,{preserve_zwsp:true});const Jl=_r;const Ql=Rr;const ed=e=>{if(Ql(e)){e=e.parentNode}return Jl(e)&&e.hasAttribute("data-mce-caret")};const td=e=>Ql(e)&&Kl(e.data);const od=e=>ed(e)||td(e);const nd=e=>e.firstChild!==e.lastChild||!Fr(e.firstChild);const sd=(e,t)=>{var o;const n=(o=e.ownerDocument)!==null&&o!==void 0?o:document;const s=n.createTextNode(Gl);const r=e.parentNode;if(!t){const t=e.nextSibling;if(Ql(t)){if(od(t)){return t}if(id(t)){t.splitText(1);return t}}if(e.nextSibling){r===null||r===void 0?void 0:r.insertBefore(s,e.nextSibling)}else{r===null||r===void 0?void 0:r.appendChild(s)}}else{const t=e.previousSibling;if(Ql(t)){if(od(t)){return t}if(ld(t)){return t.splitText(t.data.length-1)}}r===null||r===void 0?void 0:r.insertBefore(s,e)}return s};const rd=e=>{const t=e.container();if(!Rr(t)){return false}return t.data.charAt(e.offset())===Gl||e.isAtStart()&&td(t.previousSibling)};const ad=e=>{const t=e.container();if(!Rr(t)){return false}return t.data.charAt(e.offset()-1)===Gl||e.isAtEnd()&&td(t.nextSibling)};const cd=(e,t,o)=>{var n;const s=(n=t.ownerDocument)!==null&&n!==void 0?n:document;const r=s.createElement(e);r.setAttribute("data-mce-caret",o?"before":"after");r.setAttribute("data-mce-bogus","all");r.appendChild(ql().dom);const a=t.parentNode;if(!o){if(t.nextSibling){a===null||a===void 0?void 0:a.insertBefore(r,t.nextSibling)}else{a===null||a===void 0?void 0:a.appendChild(r)}}else{a===null||a===void 0?void 0:a.insertBefore(r,t)}return r};const id=e=>Ql(e)&&e.data[0]===Gl;const ld=e=>Ql(e)&&e.data[e.data.length-1]===Gl;const dd=e=>{var t;const o=e.getElementsByTagName("br");const n=o[o.length-1];if(Or(n)){(t=n.parentNode)===null||t===void 0?void 0:t.removeChild(n)}};const ud=e=>{if(e&&e.hasAttribute("data-mce-caret")){dd(e);e.removeAttribute("data-mce-caret");e.removeAttribute("data-mce-bogus");e.removeAttribute("style");e.removeAttribute("data-mce-style");e.removeAttribute("_moz_abspos");return e}return null};const fd=e=>ed(e.startContainer);const md=Math.round;const gd=e=>{if(!e){return{left:0,top:0,bottom:0,right:0,width:0,height:0}}return{left:md(e.left),top:md(e.top),bottom:md(e.bottom),right:md(e.right),width:md(e.width),height:md(e.height)}};const pd=(e,t)=>{e=gd(e);if(t){e.right=e.left}else{e.left=e.left+e.width;e.right=e.left}e.width=0;return e};const hd=(e,t)=>e.left===t.left&&e.top===t.top&&e.bottom===t.bottom&&e.right===t.right;const yd=(e,t,o)=>e>=0&&e<=Math.min(t.height,o.height)/2;const bd=(e,t)=>{const o=Math.min(t.height/2,e.height/2);if(e.bottom-o<t.top){return true}if(e.top>t.bottom){return false}return yd(t.top-e.bottom,e,t)};const vd=(e,t)=>{if(e.top>t.bottom){return true}if(e.bottom<t.top){return false}return yd(t.bottom-e.top,e,t)};const kd=(e,t,o)=>t>=e.left&&t<=e.right&&o>=e.top&&o<=e.bottom;const wd=e=>se(e,((e,t)=>e.fold((()=>U.some(t)),(e=>{const o=Math.min(t.left,e.left);const n=Math.min(t.top,e.top);const s=Math.max(t.right,e.right);const r=Math.max(t.bottom,e.bottom);return U.some({top:n,right:s,bottom:r,left:o,width:s-o,height:r-n})}))),U.none());const _d=(e,t,o)=>{const n=Math.max(Math.min(t,e.left+e.width),e.left);const s=Math.max(Math.min(o,e.top+e.height),e.top);return Math.sqrt((t-n)*(t-n)+(o-s)*(o-s))};const xd=(e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top));const Cd=(e,t,o)=>Math.min(Math.max(e,t),o);const Sd=e=>{const t=e.startContainer,o=e.startOffset;if(t===e.endContainer&&t.hasChildNodes()&&e.endOffset===o+1){return t.childNodes[o]}return null};const zd=(e,t)=>{if(_r(e)&&e.hasChildNodes()){const o=e.childNodes;const n=Cd(t,0,o.length-1);return o[n]}else{return e}};const Td=(e,t)=>{if(t<0&&_r(e)&&e.hasChildNodes()){return undefined}else{return zd(e,t)}};const Ed=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ؚ"+"ً-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް"+"߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़"+"ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣ"+"ਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼"+"ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗ"+"ୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖ"+"ౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ"+"്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູ"+"ົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗ"+"ྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴ"+"ႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵"+"ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘ"+"ᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴"+"ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩ"+"ᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹"+"᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⳱"+"⵿ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱"+"ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼ"+"ꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁"+"ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]");const Od=e=>v(e)&&e.charCodeAt(0)>=768&&Ed.test(e);const Ad=(...e)=>t=>{for(let o=0;o<e.length;o++){if(e[o](t)){return true}}return false};const Dd=(...e)=>t=>{for(let o=0;o<e.length;o++){if(!e[o](t)){return false}}return true};const Nd=jr;const Md=Zr;const Rd=Fr;const Bd=Rr;const Ld=zr(["script","style","textarea"]);const Hd=zr(["img","input","textarea","hr","iframe","video","audio","object","embed"]);const Id=zr(["table"]);const Pd=od;const Fd=e=>{if(Pd(e)){return false}if(Bd(e)){return!Ld(e.parentNode)}return Hd(e)||Rd(e)||Id(e)||jd(e)};const Vd=e=>_r(e)&&e.getAttribute("unselectable")==="true";const jd=e=>!Vd(e)&&Md(e);const Zd=(e,t)=>{for(let o=e.parentNode;o&&o!==t;o=o.parentNode){if(jd(o)){return false}if(Nd(o)){return true}}return true};const Ud=e=>{if(!jd(e)){return false}return!se(be(e.getElementsByTagName("*")),((e,t)=>e||Nd(t)),false)};const qd=e=>Hd(e)||Ud(e);const Wd=(e,t)=>Fd(e)&&Zd(e,t);const $d=_r;const Gd=Fd;const Kd=Tr("display","block table");const Yd=Tr("float","left right");const Xd=Dd($d,Gd,I(Yd));const Jd=I(Tr("white-space","pre pre-line pre-wrap"));const Qd=Rr;const eu=Fr;const tu=zi.nodeIndex;const ou=Td;const nu=e=>e?e.createRange():zi.DOM.createRng();const su=e=>v(e)&&/[\r\n\t ]/.test(e);const ru=e=>!!e.setStart&&!!e.setEnd;const au=e=>{const t=e.startContainer;const o=e.startOffset;if(su(e.toString())&&Jd(t.parentNode)&&Rr(t)){const e=t.data;if(su(e[o-1])||su(e[o+1])){return true}}return false};const cu=e=>{const t=e.ownerDocument;const o=nu(t);const n=t.createTextNode(dr);const s=e.parentNode;s.insertBefore(n,e);o.setStart(n,0);o.setEnd(n,1);const r=gd(o.getBoundingClientRect());s.removeChild(n);return r};const iu=e=>{const t=e.startContainer;const o=e.endContainer;const n=e.startOffset;const s=e.endOffset;if(t===o&&Rr(o)&&n===0&&s===1){const t=e.cloneRange();t.setEndAfter(o);return du(t)}else{return null}};const lu=e=>e.left===0&&e.right===0&&e.top===0&&e.bottom===0;const du=e=>{var t;let o;const n=e.getClientRects();if(n.length>0){o=gd(n[0])}else{o=gd(e.getBoundingClientRect())}if(!ru(e)&&eu(e)&&lu(o)){return cu(e)}if(lu(o)&&ru(e)){return(t=iu(e))!==null&&t!==void 0?t:o}return o};const uu=(e,t)=>{const o=pd(e,t);o.width=1;o.right=o.left+1;return o};const fu=e=>{const t=[];const o=e=>{if(e.height===0){return}if(t.length>0){if(hd(e,t[t.length-1])){return}}t.push(e)};const n=(e,t)=>{const n=nu(e.ownerDocument);if(t<e.data.length){if(Od(e.data[t])){return}if(Od(e.data[t-1])){n.setStart(e,t);n.setEnd(e,t+1);if(!au(n)){o(uu(du(n),false));return}}}if(t>0){n.setStart(e,t-1);n.setEnd(e,t);if(!au(n)){o(uu(du(n),false))}}if(t<e.data.length){n.setStart(e,t);n.setEnd(e,t+1);if(!au(n)){o(uu(du(n),true))}}};const s=e.container();const r=e.offset();if(Qd(s)){n(s,r);return t}if($d(s)){if(e.isAtEnd()){const e=ou(s,r);if(Qd(e)){n(e,e.data.length)}if(Xd(e)&&!eu(e)){o(uu(du(e),false))}}else{const a=ou(s,r);if(Qd(a)){n(a,0)}if(Xd(a)&&e.isAtEnd()){o(uu(du(a),false));return t}const c=ou(e.container(),e.offset()-1);if(Xd(c)&&!eu(c)){if(Kd(c)||Kd(a)||!Xd(a)){o(uu(du(c),false))}}if(Xd(a)){o(uu(du(a),true))}}}return t};const mu=(e,t,o)=>{const n=()=>{if(Qd(e)){return t===0}return t===0};const s=()=>{if(Qd(e)){return t>=e.data.length}return t>=e.childNodes.length};const r=()=>{const o=nu(e.ownerDocument);o.setStart(e,t);o.setEnd(e,t);return o};const a=()=>{if(!o){o=fu(mu(e,t))}return o};const c=()=>a().length>0;const i=o=>o&&e===o.container()&&t===o.offset();const l=o=>ou(e,o?t-1:t);return{container:R(e),offset:R(t),toRange:r,getClientRects:a,isVisible:c,isAtStart:n,isAtEnd:s,isEqual:i,getNode:l}};mu.fromRangeStart=e=>mu(e.startContainer,e.startOffset);mu.fromRangeEnd=e=>mu(e.endContainer,e.endOffset);mu.after=e=>mu(e.parentNode,tu(e)+1);mu.before=e=>mu(e.parentNode,tu(e));mu.isAbove=(e,t)=>yo(he(t.getClientRects()),ye(e.getClientRects()),bd).getOr(false);mu.isBelow=(e,t)=>yo(ye(t.getClientRects()),he(e.getClientRects()),vd).getOr(false);mu.isAtStart=e=>e?e.isAtStart():false;mu.isAtEnd=e=>e?e.isAtEnd():false;mu.isTextPosition=e=>e?Rr(e.container()):false;mu.isElementPosition=e=>!mu.isTextPosition(e);const gu=(e,t)=>{if(Rr(t)&&t.data.length===0){e.remove(t)}};const pu=(e,t,o)=>{t.insertNode(o);gu(e,o.previousSibling);gu(e,o.nextSibling)};const hu=(e,t,o)=>{const n=U.from(o.firstChild);const s=U.from(o.lastChild);t.insertNode(o);n.each((t=>gu(e,t.previousSibling)));s.each((t=>gu(e,t.nextSibling)))};const yu=(e,t,o)=>{if(Pr(o)){hu(e,t,o)}else{pu(e,t,o)}};const bu=Rr;const vu=Or;const ku=zi.nodeIndex;const wu=e=>{const t=e.parentNode;if(vu(t)){return wu(t)}return t};const _u=e=>{if(!e){return[]}return Ue(e.childNodes,((e,t)=>{if(vu(t)&&t.nodeName!=="BR"){e=e.concat(_u(t))}else{e.push(t)}return e}),[])};const xu=(e,t)=>{let o=e;while(o=o.previousSibling){if(!bu(o)){break}t+=o.data.length}return t};const Cu=e=>t=>e===t;const Su=e=>{let t,o;t=_u(wu(e));o=qe(t,Cu(e),e);t=t.slice(0,o+1);const n=Ue(t,((e,o,n)=>{if(bu(o)&&bu(t[n-1])){e++}return e}),0);t=je(t,zr([e.nodeName]));o=qe(t,Cu(e),e);return o-n};const zu=e=>{const t=bu(e)?"text()":e.nodeName.toLowerCase();return t+"["+Su(e)+"]"};const Tu=(e,t,o)=>{const n=[];for(let s=t.parentNode;s&&s!==e;s=s.parentNode){if(o&&o(s)){break}n.push(s)}return n};const Eu=(e,t)=>{let o=[];let n=t.container();let s=t.offset();let r;if(bu(n)){r=xu(n,s)}else{const e=n.childNodes;if(s>=e.length){r="after";s=e.length-1}else{r="before"}n=e[s]}o.push(zu(n));let a=Tu(e,n);a=je(a,I(Or));o=o.concat(Ve(a,(e=>zu(e))));return o.reverse().join("/")+","+r};const Ou=(e,t,o)=>{let n=_u(e);n=je(n,((e,t)=>!bu(e)||!bu(n[t-1])));n=je(n,zr([t]));return n[o]};const Au=(e,t)=>{let o=e;let n=0;while(bu(o)){const s=o.data.length;if(t>=n&&t<=n+s){e=o;t=t-n;break}if(!bu(o.nextSibling)){e=o;t=s;break}n+=s;o=o.nextSibling}if(bu(e)&&t>e.data.length){t=e.data.length}return mu(e,t)};const Du=(e,t)=>{if(!t){return null}const o=t.split(",");const n=o[0].split("/");const s=o.length>1?o[1]:"before";const r=Ue(n,((e,t)=>{const o=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t);if(!o){return null}if(o[1]==="text()"){o[1]="#text"}return Ou(e,o[1],parseInt(o[2],10))}),e);if(!r){return null}if(!bu(r)&&r.parentNode){let e;if(s==="after"){e=ku(r)+1}else{e=ku(r)}return mu(r.parentNode,e)}return Au(r,parseInt(s,10))};const Nu=Zr;const Mu=(e,t,o)=>{let n=e(t.data.slice(0,o)).length;for(let o=t.previousSibling;o&&Rr(o);o=o.previousSibling){n+=e(o.data).length}return n};const Ru=(e,t,o,n,s)=>{const r=s?n.startContainer:n.endContainer;let a=s?n.startOffset:n.endOffset;const c=[];const i=e.getRoot();if(Rr(r)){c.push(o?Mu(t,r,a):a)}else{let t=0;const n=r.childNodes;if(a>=n.length&&n.length){t=1;a=Math.max(0,n.length-1)}c.push(e.nodeIndex(n[a],o)+t)}for(let t=r;t&&t!==i;t=t.parentNode){c.push(e.nodeIndex(t,o))}return c};const Bu=(e,t,o,n)=>{const s=t.dom;const r=Ru(s,e,o,n,true);const a=t.isForward();const c=fd(n)?{isFakeCaret:true}:{};if(!t.isCollapsed()){const t=Ru(s,e,o,n,false);return{start:r,end:t,forward:a,...c}}else{return{start:r,forward:a,...c}}};const Lu=(e,t,o)=>{let n=0;mo.each(e.select(t),(e=>{if(e.getAttribute("data-mce-bogus")==="all"){return}else if(e===o){return false}else{n++;return}}));return n};const Hu=(e,t)=>{let o=t?e.startContainer:e.endContainer;let n=t?e.startOffset:e.endOffset;if(_r(o)&&o.nodeName==="TR"){const s=o.childNodes;o=s[Math.min(t?n:n-1,s.length-1)];if(o){n=t?0:o.childNodes.length;if(t){e.setStart(o,n)}else{e.setEnd(o,n)}}}};const Iu=e=>{Hu(e,true);Hu(e,false);return e};const Pu=(e,t)=>{if(_r(e)){e=zd(e,t);if(Nu(e)){return e}}if(od(e)){if(Rr(e)&&ed(e)){e=e.parentNode}let t=e.previousSibling;if(Nu(t)){return t}t=e.nextSibling;if(Nu(t)){return t}}return undefined};const Fu=e=>Pu(e.startContainer,e.startOffset)||Pu(e.endContainer,e.endOffset);const Vu=(e,t,o)=>{const n=o.getNode();const s=o.getRng();if(n.nodeName==="IMG"||Nu(n)){const e=n.nodeName;return{name:e,index:Lu(o.dom,e,n)}}const r=Fu(s);if(r){const e=r.tagName;return{name:e,index:Lu(o.dom,e,r)}}return Bu(e,o,t,s)};const ju=e=>{const t=e.getRng();return{start:Eu(e.dom.getRoot(),mu.fromRangeStart(t)),end:Eu(e.dom.getRoot(),mu.fromRangeEnd(t)),forward:e.isForward()}};const Zu=e=>({rng:e.getRng(),forward:e.isForward()});const Uu=(e,t,o)=>{const n={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return o?e.create("span",n,""):e.create("span",n)};const qu=(e,t)=>{const o=e.dom;let n=e.getRng();const s=o.uniqueId();const r=e.isCollapsed();const a=e.getNode();const c=a.nodeName;const i=e.isForward();if(c==="IMG"){return{name:c,index:Lu(o,c,a)}}const l=Iu(n.cloneRange());if(!r){l.collapse(false);const e=Uu(o,s+"_end",t);yu(o,l,e)}n=Iu(n);n.collapse(true);const d=Uu(o,s+"_start",t);yu(o,n,d);e.moveToBookmark({id:s,keep:true,forward:i});return{id:s,forward:i}};const Wu=(e,t,o=false)=>{if(t===2){return Vu(Yl,o,e)}else if(t===3){return ju(e)}else if(t){return Zu(e)}else{return qu(e,false)}};const $u=H(Vu,B,true);const Gu=e=>{const t=t=>t(e);const o=R(e);const n=()=>s;const s={tag:true,inner:e,fold:(t,o)=>o(e),isValue:Z,isError:j,map:t=>Xu.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>U.some(e)};return s};const Ku=e=>{const t=()=>o;const o={tag:false,inner:e,fold:(t,o)=>t(e),isValue:j,isError:Z,map:t,mapError:t=>Xu.error(t(e)),bind:t,exists:j,forall:Z,getOr:B,or:B,getOrThunk:F,orThunk:F,getOrDie:P(String(e)),each:D,toOptional:U.none};return o};const Yu=(e,t)=>e.fold((()=>Ku(t)),Gu);const Xu={value:Gu,error:Ku,fromOption:Yu};const Ju=e=>{if(!_(e)){throw new Error("cases must be an array")}if(e.length===0){throw new Error("there must be at least one case")}const t=[];const o={};Q(e,((n,s)=>{const r=we(n);if(r.length!==1){throw new Error("one and only one name per case")}const a=r[0];const c=n[a];if(o[a]!==undefined){throw new Error("duplicate key detected:"+a)}else if(a==="cata"){throw new Error("cannot have a case named cata (sorry)")}else if(!_(c)){throw new Error("case arguments must be an array")}t.push(a);o[a]=(...o)=>{const n=o.length;if(n!==c.length){throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+n)}const r=e=>{const n=we(e);if(t.length!==n.length){throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","))}const s=de(t,(e=>Y(n,e)));if(!s){throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "))}return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length){throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length)}const n=t[s];return n.apply(null,o)},match:r,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}}));return o};const Qu={generate:Ju};Qu.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ef=e=>{const t=[];const o=[];Q(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))}));return{errors:t,values:o}};const tf=e=>e.type==="inline-command"||e.type==="inline-format";const of=e=>e.type==="block-command"||e.type==="block-format";const nf=(e,t)=>(e.type==="block-command"||e.type==="block-format")&&e.trigger===t;const sf=e=>{var t;const o=t=>Xu.error({message:t,pattern:e});const n=(t,n,s)=>{if(e.format!==undefined){let s;if(_(e.format)){if(!de(e.format,v)){return o(t+" pattern has non-string items in the `format` array")}s=e.format}else if(v(e.format)){s=[e.format]}else{return o(t+" pattern has non-string `format` parameter")}return Xu.value(n(s))}else if(e.cmd!==undefined){if(!v(e.cmd)){return o(t+" pattern has non-string `cmd` parameter")}return Xu.value(s(e.cmd,e.value))}else{return o(t+" pattern is missing both `format` and `cmd` parameters")}};if(!k(e)){return o("Raw pattern is not an object")}if(!v(e.start)){return o("Raw pattern is missing `start` parameter")}if(e.end!==undefined){if(!v(e.end)){return o("Inline pattern has non-string `end` parameter")}if(e.start.length===0&&e.end.length===0){return o("Inline pattern has empty `start` and `end` parameters")}let t=e.start;let s=e.end;if(s.length===0){s=t;t=""}return n("Inline",(e=>({type:"inline-format",start:t,end:s,format:e})),((e,o)=>({type:"inline-command",start:t,end:s,cmd:e,value:o})))}else if(e.replacement!==undefined){if(!v(e.replacement)){return o("Replacement pattern has non-string `replacement` parameter")}if(e.start.length===0){return o("Replacement pattern has empty `start` parameter")}return Xu.value({type:"inline-command",start:"",end:e.start,cmd:"mceInsertContent",value:e.replacement})}else{const s=(t=e.trigger)!==null&&t!==void 0?t:"space";if(e.start.length===0){return o("Block pattern has empty `start` parameter")}return n("Block",(t=>({type:"block-format",start:e.start,format:t[0],trigger:s})),((t,o)=>({type:"block-command",start:e.start,cmd:t,value:o,trigger:s})))}};const rf=e=>oe(e,of);const af=e=>oe(e,tf);const cf=(e,t)=>({inlinePatterns:af(e),blockPatterns:rf(e),dynamicPatternsLookup:t});const lf=(e,t)=>({...e,blockPatterns:oe(e.blockPatterns,(e=>nf(e,t)))});const df=e=>{const t=ef(J(e,sf));Q(t.errors,(e=>console.error(e.message,e.pattern)));return t.values};const uf=e=>t=>{const o=e(t);return df(o)};const ff=Gt().deviceType;const mf=ff.isTouch();const gf=zi.DOM;const pf=e=>{const t=e.indexOf("=")>0?e.split(/[;,](?![^=;,]*(?:[;,]|$))/):e.split(",");return se(t,((e,t)=>{const o=t.split("=");const n=o[0];const s=o.length>1?o[1]:n;e[ft(n)]=ft(s);return e}),{})};const hf=e=>b(e,RegExp);const yf=e=>t=>t.options.get(e);const bf=e=>v(e)||k(e);const vf=(e,t="")=>o=>{const n=v(o);if(n){if(o.indexOf("=")!==-1){const s=pf(o);return{value:Ne(s,e.id).getOr(t),valid:n}}else{return{value:o,valid:n}}}else{return{valid:false,message:"Must be a string."}}};const kf=e=>{const t=e.options.register;t("id",{processor:"string",default:e.id});t("selector",{processor:"string"});t("target",{processor:"object"});t("suffix",{processor:"string"});t("cache_suffix",{processor:"string"});t("base_url",{processor:"string"});t("referrer_policy",{processor:"string",default:""});t("language_load",{processor:"boolean",default:true});t("inline",{processor:"boolean",default:false});t("iframe_attrs",{processor:"object",default:{}});t("doctype",{processor:"string",default:"<!DOCTYPE html>"});t("document_base_url",{processor:"string",default:e.documentBaseUrl});t("body_id",{processor:vf(e,"tinymce"),default:"tinymce"});t("body_class",{processor:vf(e),default:""});t("content_security_policy",{processor:"string",default:""});t("br_in_pre",{processor:"boolean",default:true});t("forced_root_block",{processor:e=>{const t=v(e)&&pt(e);if(t){return{value:e,valid:t}}else{return{valid:false,message:"Must be a non-empty string."}}},default:"p"});t("forced_root_block_attrs",{processor:"object",default:{}});t("newline_behavior",{processor:e=>{const t=Y(["block","linebreak","invert","default"],e);return t?{value:e,valid:t}:{valid:false,message:"Must be one of: block, linebreak, invert or default."}},default:"default"});t("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"});t("no_newline_selector",{processor:"string",default:""});t("keep_styles",{processor:"boolean",default:true});t("end_container_on_empty_block",{processor:e=>{if(C(e)){return{valid:true,value:e}}else if(v(e)){return{valid:true,value:e}}else{return{valid:false,message:"Must be boolean or a string"}}},default:"blockquote"});t("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"});t("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"});t("font_size_classes",{processor:"string",default:""});t("automatic_uploads",{processor:"boolean",default:true});t("images_reuse_filename",{processor:"boolean",default:false});t("images_replace_blob_uris",{processor:"boolean",default:true});t("icons",{processor:"string",default:""});t("icons_url",{processor:"string",default:""});t("images_upload_url",{processor:"string",default:""});t("images_upload_base_path",{processor:"string",default:""});t("images_upload_credentials",{processor:"boolean",default:false});t("images_upload_handler",{processor:"function"});t("language",{processor:"string",default:"en"});t("language_url",{processor:"string",default:""});t("entity_encoding",{processor:"string",default:"named"});t("indent",{processor:"boolean",default:true});t("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,"+"tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"});t("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,"+"tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"});t("indent_use_margin",{processor:"boolean",default:false});t("indentation",{processor:"string",default:"40px"});t("content_css",{processor:e=>{const t=e===false||v(e)||A(e,v);if(t){if(v(e)){return{value:J(e.split(","),ft),valid:t}}else if(_(e)){return{value:e,valid:t}}else if(e===false){return{value:[],valid:t}}else{return{value:e,valid:t}}}else{return{valid:false,message:"Must be false, a string or an array of strings."}}},default:hm(e)?[]:["default"]});t("content_style",{processor:"string"});t("content_css_cors",{processor:"boolean",default:false});t("font_css",{processor:e=>{const t=v(e)||A(e,v);if(t){const o=_(e)?e:J(e.split(","),ft);return{value:o,valid:t}}else{return{valid:false,message:"Must be a string or an array of strings."}}},default:[]});t("inline_boundaries",{processor:"boolean",default:true});t("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"});t("object_resizing",{processor:e=>{const t=C(e)||v(e);if(t){if(e===false||ff.isiPhone()||ff.isiPad()){return{value:"",valid:t}}else{return{value:e===true?"table,img,figure.image,div,video,iframe":e,valid:t}}}else{return{valid:false,message:"Must be boolean or a string"}}},default:!mf});t("resize_img_proportional",{processor:"boolean",default:true});t("event_root",{processor:"string"});t("service_message",{processor:"string"});t("theme",{processor:e=>e===false||v(e)||E(e),default:"silver"});t("theme_url",{processor:"string"});t("formats",{processor:"object"});t("format_empty_lines",{processor:"boolean",default:false});t("format_noneditable_selector",{processor:"string",default:""});t("preview_styles",{processor:e=>{const t=e===false||v(e);if(t){return{value:e===false?"":e,valid:t}}else{return{valid:false,message:"Must be false or a string"}}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"});t("custom_ui_selector",{processor:"string",default:""});t("hidden_input",{processor:"boolean",default:true});t("submit_patch",{processor:"boolean",default:true});t("encoding",{processor:"string"});t("add_form_submit_trigger",{processor:"boolean",default:true});t("add_unload_trigger",{processor:"boolean",default:true});t("custom_undo_redo_levels",{processor:"number",default:0});t("disable_nodechange",{processor:"boolean",default:false});t("readonly",{processor:"boolean",default:false});t("editable_root",{processor:"boolean",default:true});t("plugins",{processor:"string[]",default:[]});t("external_plugins",{processor:"object"});t("forced_plugins",{processor:"string[]"});t("model",{processor:"string",default:e.hasPlugin("rtc")?"plugin":"dom"});t("model_url",{processor:"string"});t("block_unsupported_drop",{processor:"boolean",default:true});t("visual",{processor:"boolean",default:true});t("visual_table_class",{processor:"string",default:"mce-item-table"});t("visual_anchor_class",{processor:"string",default:"mce-item-anchor"});t("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."});t("setup",{processor:"function"});t("init_instance_callback",{processor:"function"});t("url_converter",{processor:"function",default:e.convertURL});t("url_converter_scope",{processor:"object",default:e});t("urlconverter_callback",{processor:"function"});t("allow_conditional_comments",{processor:"boolean",default:false});t("allow_html_data_urls",{processor:"boolean",default:false});t("allow_svg_data_urls",{processor:"boolean"});t("allow_html_in_named_anchor",{processor:"boolean",default:false});t("allow_script_urls",{processor:"boolean",default:false});t("allow_unsafe_link_target",{processor:"boolean",default:false});t("convert_fonts_to_spans",{processor:"boolean",default:true,deprecated:true});t("fix_list_elements",{processor:"boolean",default:false});t("preserve_cdata",{processor:"boolean",default:false});t("remove_trailing_brs",{processor:"boolean",default:true});t("pad_empty_with_br",{processor:"boolean",default:false});t("inline_styles",{processor:"boolean",default:true,deprecated:true});t("element_format",{processor:"string",default:"html"});t("entities",{processor:"string"});t("schema",{processor:"string",default:"html5"});t("convert_urls",{processor:"boolean",default:true});t("relative_urls",{processor:"boolean",default:true});t("remove_script_host",{processor:"boolean",default:true});t("custom_elements",{processor:bf});t("extended_valid_elements",{processor:"string"});t("invalid_elements",{processor:"string"});t("invalid_styles",{processor:bf});t("valid_children",{processor:"string"});t("valid_classes",{processor:bf});t("valid_elements",{processor:"string"});t("valid_styles",{processor:bf});t("verify_html",{processor:"boolean",default:true});t("auto_focus",{processor:e=>v(e)||e===true});t("browser_spellcheck",{processor:"boolean",default:false});t("protect",{processor:"array"});t("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"});t("deprecation_warnings",{processor:"boolean",default:true});t("a11y_advanced_options",{processor:"boolean",default:false});t("api_key",{processor:"string"});t("license_key",{processor:"string"});t("paste_block_drop",{processor:"boolean",default:false});t("paste_data_images",{processor:"boolean",default:true});t("paste_preprocess",{processor:"function"});t("paste_postprocess",{processor:"function"});t("paste_webkit_styles",{processor:"string",default:"none"});t("paste_remove_styles_if_webkit",{processor:"boolean",default:true});t("paste_merge_formats",{processor:"boolean",default:true});t("smart_paste",{processor:"boolean",default:true});t("paste_as_text",{processor:"boolean",default:false});t("paste_tab_spaces",{processor:"number",default:4});t("text_patterns",{processor:e=>{if(A(e,k)||e===false){const t=e===false?[]:e;return{value:df(t),valid:true}}else{return{valid:false,message:"Must be an array of objects or false."}}},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1",trigger:"space"},{start:"##",format:"h2",trigger:"space"},{start:"###",format:"h3",trigger:"space"},{start:"####",format:"h4",trigger:"space"},{start:"#####",format:"h5",trigger:"space"},{start:"######",format:"h6",trigger:"space"},{start:"1.",cmd:"InsertOrderedList",trigger:"space"},{start:"*",cmd:"InsertUnorderedList",trigger:"space"},{start:"-",cmd:"InsertUnorderedList",trigger:"space"},{start:">",cmd:"mceBlockQuote",trigger:"space"},{start:"---",cmd:"InsertHorizontalRule",trigger:"space"}]});t("text_patterns_lookup",{processor:e=>{if(E(e)){return{value:uf(e),valid:true}}else{return{valid:false,message:"Must be a single function"}}},default:e=>[]});t("noneditable_class",{processor:"string",default:"mceNonEditable"});t("editable_class",{processor:"string",default:"mceEditable"});t("noneditable_regexp",{processor:e=>{if(A(e,hf)){return{value:e,valid:true}}else if(hf(e)){return{value:[e],valid:true}}else{return{valid:false,message:"Must be a RegExp or an array of RegExp."}}},default:[]});t("table_tab_navigation",{processor:"boolean",default:true});t("highlight_on_focus",{processor:"boolean",default:true});t("xss_sanitization",{processor:"boolean",default:true});t("details_initial_state",{processor:e=>{const t=Y(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:false,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"});t("details_serialized_state",{processor:e=>{const t=Y(["inherited","collapsed","expanded"],e);return t?{value:e,valid:t}:{valid:false,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"});t("init_content_sync",{processor:"boolean",default:false});t("newdocument_content",{processor:"string",default:""});t("sandbox_iframes",{processor:"boolean",default:true});t("sandbox_iframes_exclusions",{processor:"string[]",default:["youtube.com","youtu.be","vimeo.com","player.vimeo.com","dailymotion.com","embed.music.apple.com","open.spotify.com","giphy.com","dai.ly","codepen.io"]});t("convert_unsafe_embeds",{processor:"boolean",default:true});e.on("ScriptsLoaded",(()=>{t("directionality",{processor:"string",default:Wi.isRtl()?"rtl":undefined});t("placeholder",{processor:"string",default:gf.getAttrib(e.getElement(),"placeholder")})}))};const wf=yf("iframe_attrs");const _f=yf("doctype");const xf=yf("document_base_url");const Cf=yf("body_id");const Sf=yf("body_class");const zf=yf("content_security_policy");const Tf=yf("br_in_pre");const Ef=yf("forced_root_block");const Of=yf("forced_root_block_attrs");const Af=yf("newline_behavior");const Df=yf("br_newline_selector");const Nf=yf("no_newline_selector");const Mf=yf("keep_styles");const Rf=yf("end_container_on_empty_block");const Bf=yf("automatic_uploads");const Lf=yf("images_reuse_filename");const Hf=yf("images_replace_blob_uris");const If=yf("icons");const Pf=yf("icons_url");const Ff=yf("images_upload_url");const Vf=yf("images_upload_base_path");const jf=yf("images_upload_credentials");const Zf=yf("images_upload_handler");const Uf=yf("content_css_cors");const qf=yf("referrer_policy");const Wf=yf("language");const $f=yf("language_url");const Gf=yf("indent_use_margin");const Kf=yf("indentation");const Yf=yf("content_css");const Xf=yf("content_style");const Jf=yf("font_css");const Qf=yf("directionality");const em=yf("inline_boundaries_selector");const tm=yf("object_resizing");const om=yf("resize_img_proportional");const nm=yf("placeholder");const sm=yf("event_root");const rm=yf("service_message");const am=yf("theme");const cm=yf("theme_url");const im=yf("model");const lm=yf("model_url");const dm=yf("inline_boundaries");const um=yf("formats");const fm=yf("preview_styles");const mm=yf("format_empty_lines");const gm=yf("format_noneditable_selector");const pm=yf("custom_ui_selector");const hm=yf("inline");const ym=yf("hidden_input");const bm=yf("submit_patch");const vm=yf("add_form_submit_trigger");const km=yf("add_unload_trigger");const wm=yf("custom_undo_redo_levels");const _m=yf("disable_nodechange");const xm=yf("readonly");const Cm=yf("editable_root");const Sm=yf("content_css_cors");const zm=yf("plugins");const Tm=yf("external_plugins");const Em=yf("block_unsupported_drop");const Om=yf("visual");const Am=yf("visual_table_class");const Dm=yf("visual_anchor_class");const Nm=yf("iframe_aria_text");const Mm=yf("setup");const Rm=yf("init_instance_callback");const Bm=yf("urlconverter_callback");const Lm=yf("auto_focus");const Hm=yf("browser_spellcheck");const Im=yf("protect");const Pm=yf("paste_block_drop");const Fm=yf("paste_data_images");const Vm=yf("paste_preprocess");const jm=yf("paste_postprocess");const Zm=yf("newdocument_content");const Um=yf("paste_webkit_styles");const qm=yf("paste_remove_styles_if_webkit");const Wm=yf("paste_merge_formats");const $m=yf("smart_paste");const Gm=yf("paste_as_text");const Km=yf("paste_tab_spaces");const Ym=yf("allow_html_data_urls");const Xm=yf("text_patterns");const Jm=yf("text_patterns_lookup");const Qm=yf("noneditable_class");const eg=yf("editable_class");const tg=yf("noneditable_regexp");const og=yf("preserve_cdata");const ng=yf("highlight_on_focus");const sg=yf("xss_sanitization");const rg=yf("init_content_sync");const ag=e=>e.options.isSet("text_patterns_lookup");const cg=e=>mo.explode(e.options.get("font_size_style_values"));const ig=e=>mo.explode(e.options.get("font_size_classes"));const lg=e=>e.options.get("encoding")==="xml";const dg=e=>mo.explode(e.options.get("images_file_types"));const ug=yf("table_tab_navigation");const fg=yf("details_initial_state");const mg=yf("details_serialized_state");const gg=yf("sandbox_iframes");const pg=e=>e.options.get("sandbox_iframes_exclusions");const hg=yf("convert_unsafe_embeds");const yg=yf("license_key");const bg=yf("api_key");const vg=_r;const kg=Rr;const wg=e=>{const t=e.parentNode;if(t){t.removeChild(e)}};const _g=e=>{const t=Yl(e);return{count:e.length-t.length,text:t}};const xg=e=>{let t;while((t=e.data.lastIndexOf(Gl))!==-1){e.deleteData(t,1)}};const Cg=(e,t)=>{Ag(e);return t};const Sg=(e,t)=>{const o=_g(e.data.substr(0,t.offset()));const n=_g(e.data.substr(t.offset()));const s=o.text+n.text;if(s.length>0){xg(e);return mu(e,t.offset()-o.count)}else{return t}};const zg=(e,t)=>{const o=t.container();const n=K(be(o.childNodes),e).map((e=>e<t.offset()?mu(o,t.offset()-1):t)).getOr(t);Ag(e);return n};const Tg=(e,t)=>kg(e)&&t.container()===e?Sg(e,t):Cg(e,t);const Eg=(e,t)=>t.container()===e.parentNode?zg(e,t):Cg(e,t);const Og=(e,t)=>mu.isTextPosition(t)?Tg(e,t):Eg(e,t);const Ag=e=>{if(vg(e)&&od(e)){if(nd(e)){e.removeAttribute("data-mce-caret")}else{wg(e)}}if(kg(e)){xg(e);if(e.data.length===0){wg(e)}}};const Dg=Zr;const Ng=Wr;const Mg=Ur;const Rg="*[contentEditable=false],video,audio,embed,object";const Bg=(e,t,o)=>{const n=pd(t.getBoundingClientRect(),o);let s;let r;if(e.tagName==="BODY"){const t=e.ownerDocument.documentElement;s=e.scrollLeft||t.scrollLeft;r=e.scrollTop||t.scrollTop}else{const t=e.getBoundingClientRect();s=e.scrollLeft-t.left;r=e.scrollTop-t.top}n.left+=s;n.right+=s;n.top+=r;n.bottom+=r;n.width=1;let a=t.offsetWidth-t.clientWidth;if(a>0){if(o){a*=-1}n.left+=a;n.right+=a}return n};const Lg=e=>{var t,o;const n=sr(yn.fromDom(e),Rg);for(let e=0;e<n.length;e++){const s=n[e].dom;let r=s.previousSibling;if(ld(r)){const e=r.data;if(e.length===1){(t=r.parentNode)===null||t===void 0?void 0:t.removeChild(r)}else{r.deleteData(e.length-1,1)}}r=s.nextSibling;if(id(r)){const e=r.data;if(e.length===1){(o=r.parentNode)===null||o===void 0?void 0:o.removeChild(r)}else{r.deleteData(0,1)}}}};const Hg=(e,t,o,n)=>{const s=ua();let r;let a;const c=Ef(e);const i=e.dom;const l=(e,n)=>{let r;d();if(Mg(n)){return null}if(o(n)){const o=cd(c,n,e);const l=Bg(t,n,e);i.setStyle(o,"top",l.top);i.setStyle(o,"caret-color","transparent");a=o;const d=i.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});i.setStyles(d,{...l});i.add(t,d);s.set({caret:d,element:n,before:e});if(e){i.addClass(d,"mce-visual-caret-before")}u();r=n.ownerDocument.createRange();r.setStart(o,0);r.setEnd(o,0)}else{a=sd(n,e);r=n.ownerDocument.createRange();if(Pg(a.nextSibling)){r.setStart(a,0);r.setEnd(a,0)}else{r.setStart(a,1);r.setEnd(a,1)}return r}return r};const d=()=>{Lg(t);if(a){Ag(a);a=null}s.on((e=>{i.remove(e.caret);s.clear()}));if(r){clearInterval(r);r=undefined}};const u=()=>{r=setInterval((()=>{s.on((e=>{if(n()){i.toggleClass(e.caret,"mce-visual-caret-hidden")}else{i.addClass(e.caret,"mce-visual-caret-hidden")}}))}),500)};const f=()=>{s.on((e=>{const o=Bg(t,e.element,e.before);i.setStyles(e.caret,{...o})}))};const m=()=>clearInterval(r);const g=()=>".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;"+"}";return{show:l,hide:d,getCss:g,reposition:f,destroy:m}};const Ig=()=>to.browser.isFirefox();const Pg=e=>Dg(e)||Ng(e);const Fg=e=>{const t=Pg(e)||Dr(e)&&Ig();return t&&An(yn.fromDom(e)).exists(ds)};const Vg=jr;const jg=Zr;const Zg=Wr;const Ug=Tr("display","block table table-cell table-caption list-item");const qg=od;const Wg=ed;const $g=_r;const Gg=Rr;const Kg=Fd;const Yg=e=>e>0;const Xg=e=>e<0;const Jg=(e,t)=>{let o;while(o=e(t)){if(!Wg(o)){return o}}return null};const Qg=(e,t,o,n,s)=>{const r=new ir(e,n);const a=jg(e)||Wg(e);let c;if(Xg(t)){if(a){c=Jg(r.prev.bind(r),true);if(o(c)){return c}}while(c=Jg(r.prev.bind(r),s)){if(o(c)){return c}}}if(Yg(t)){if(a){c=Jg(r.next.bind(r),true);if(o(c)){return c}}while(c=Jg(r.next.bind(r),s)){if(o(c)){return c}}}return null};const ep=(e,t)=>{const o=e=>Vg(e.dom);const n=e=>e.dom===t;return ts(yn.fromDom(e),o,n).map((e=>e.dom)).getOr(t)};const tp=(e,t)=>{while(e&&e!==t){if(Ug(e)){return e}e=e.parentNode}return null};const op=(e,t,o)=>tp(e.container(),o)===tp(t.container(),o);const np=(e,t)=>{if(!t){return U.none()}const o=t.container();const n=t.offset();if(!$g(o)){return U.none()}return U.from(o.childNodes[n+e])};const sp=(e,t)=>{var o;const n=(o=t.ownerDocument)!==null&&o!==void 0?o:document;const s=n.createRange();if(e){s.setStartBefore(t);s.setEndBefore(t)}else{s.setStartAfter(t);s.setEndAfter(t)}return s};const rp=(e,t,o)=>tp(t,e)===tp(o,e);const ap=(e,t,o)=>{const n=e?"previousSibling":"nextSibling";let s=o;while(s&&s!==t){let e=s[n];if(e&&qg(e)){e=e[n]}if(jg(e)||Zg(e)){if(rp(t,e,s)){return e}break}if(Kg(e)){break}s=s.parentNode}return null};const cp=H(sp,true);const ip=H(sp,false);const lp=(e,t,o)=>{let n;const s=H(ap,true,t);const r=H(ap,false,t);const a=o.startContainer;const c=o.startOffset;if(ed(a)){const e=Gg(a)?a.parentNode:a;const t=e.getAttribute("data-mce-caret");if(t==="before"){n=e.nextSibling;if(Fg(n)){return cp(n)}}if(t==="after"){n=e.previousSibling;if(Fg(n)){return ip(n)}}}if(!o.collapsed){return o}if(Rr(a)){if(qg(a)){if(e===1){n=r(a);if(n){return cp(n)}n=s(a);if(n){return ip(n)}}if(e===-1){n=s(a);if(n){return ip(n)}n=r(a);if(n){return cp(n)}}return o}if(ld(a)&&c>=a.data.length-1){if(e===1){n=r(a);if(n){return cp(n)}}return o}if(id(a)&&c<=1){if(e===-1){n=s(a);if(n){return ip(n)}}return o}if(c===a.data.length){n=r(a);if(n){return cp(n)}return o}if(c===0){n=s(a);if(n){return ip(n)}return o}}return o};const dp=(e,t)=>np(e?0:-1,t).filter(jg);const up=(e,t,o)=>{const n=lp(e,t,o);return e===-1?mu.fromRangeStart(n):mu.fromRangeEnd(n)};const fp=e=>U.from(e.getNode()).map(yn.fromDom);const mp=e=>U.from(e.getNode(true)).map(yn.fromDom);const gp=(e,t)=>{let o=t;while(o=e(o)){if(o.isVisible()){return o}}return o};const pp=(e,t)=>{const o=op(e,t);if(!o&&Fr(e.getNode())){return true}return o};var hp;(function(e){e[e["Backwards"]=-1]="Backwards";e[e["Forwards"]=1]="Forwards"})(hp||(hp={}));const yp=Zr;const bp=Rr;const vp=_r;const kp=Fr;const wp=Fd;const _p=qd;const xp=Wd;const Cp=(e,t)=>{const o=[];let n=e;while(n&&n!==t){o.push(n);n=n.parentNode}return o};const Sp=(e,t)=>{if(e.hasChildNodes()&&t<e.childNodes.length){return e.childNodes[t]}return null};const zp=(e,t)=>{if(Yg(e)){if(wp(t.previousSibling)&&!bp(t.previousSibling)){return mu.before(t)}if(bp(t)){return mu(t,0)}}if(Xg(e)){if(wp(t.nextSibling)&&!bp(t.nextSibling)){return mu.after(t)}if(bp(t)){return mu(t,t.data.length)}}if(Xg(e)){if(kp(t)){return mu.before(t)}return mu.after(t)}return mu.before(t)};const Tp=(e,t)=>{const o=t.nextSibling;if(o&&wp(o)){if(bp(o)){return mu(o,0)}else{return mu.before(o)}}else{return Ep(hp.Forwards,mu.after(t),e)}};const Ep=(e,t,o)=>{let n;let s;let r;let a;if(!vp(o)||!t){return null}if(t.isEqual(mu.after(o))&&o.lastChild){a=mu.after(o.lastChild);if(Xg(e)&&wp(o.lastChild)&&vp(o.lastChild)){return kp(o.lastChild)?mu.before(o.lastChild):a}}else{a=t}const c=a.container();let i=a.offset();if(bp(c)){if(Xg(e)&&i>0){return mu(c,--i)}if(Yg(e)&&i<c.length){return mu(c,++i)}n=c}else{if(Xg(e)&&i>0){s=Sp(c,i-1);if(wp(s)){if(!_p(s)){r=Qg(s,e,xp,s);if(r){if(bp(r)){return mu(r,r.data.length)}return mu.after(r)}}if(bp(s)){return mu(s,s.data.length)}return mu.before(s)}}if(Yg(e)&&i<c.childNodes.length){s=Sp(c,i);if(wp(s)){if(kp(s)){return Tp(o,s)}if(!_p(s)){r=Qg(s,e,xp,s);if(r){if(bp(r)){return mu(r,0)}return mu.before(r)}}if(bp(s)){return mu(s,0)}return mu.after(s)}}n=s?s:a.getNode()}if(n&&(Yg(e)&&a.isAtEnd()||Xg(e)&&a.isAtStart())){n=Qg(n,e,Z,o,true);if(xp(n,o)){return zp(e,n)}}s=n?Qg(n,e,xp,o):n;const l=We(oe(Cp(c,o),yp));if(l&&(!s||!l.contains(s))){if(Yg(e)){a=mu.after(l)}else{a=mu.before(l)}return a}if(s){return zp(e,s)}return null};const Op=e=>({next:t=>Ep(hp.Forwards,t,e),prev:t=>Ep(hp.Backwards,t,e)});const Ap=(e,t,o)=>{const n=e?mu.before(o):mu.after(o);return Hp(e,t,n)};const Dp=e=>Fr(e)?mu.before(e):mu.after(e);const Np=e=>{if(mu.isTextPosition(e)){return e.offset()===0}else{return Fd(e.getNode())}};const Mp=e=>{if(mu.isTextPosition(e)){const t=e.container();return e.offset()===t.data.length}else{return Fd(e.getNode(true))}};const Rp=(e,t)=>!mu.isTextPosition(e)&&!mu.isTextPosition(t)&&e.getNode()===t.getNode(true);const Bp=e=>!mu.isTextPosition(e)&&Fr(e.getNode());const Lp=(e,t,o)=>{if(e){return!Rp(t,o)&&!Bp(t)&&Mp(t)&&Np(o)}else{return!Rp(o,t)&&Np(t)&&Mp(o)}};const Hp=(e,t,o)=>{const n=Op(t);return U.from(e?n.next(o):n.prev(o))};const Ip=(e,t,o)=>Hp(e,t,o).bind((n=>{if(op(o,n,t)&&Lp(e,o,n)){return Hp(e,t,n)}else{return U.some(n)}}));const Pp=(e,t,o,n)=>Ip(e,t,o).bind((o=>n(o)?Pp(e,t,o,n):U.some(o)));const Fp=(e,t)=>{const o=e?t.firstChild:t.lastChild;if(Rr(o)){return U.some(mu(o,e?0:o.data.length))}else if(o){if(Fd(o)){return U.some(e?mu.before(o):Dp(o))}else{return Ap(e,t,o)}}else{return U.none()}};const Vp=H(Hp,true);const jp=H(Hp,false);const Zp=H(Fp,true);const Up=H(Fp,false);const qp="_mce_caret";const Wp=e=>_r(e)&&e.id===qp;const $p=(e,t)=>{let o=t;while(o&&o!==e){if(Wp(o)){return o}o=o.parentNode}return null};const Gp=e=>v(e.start);const Kp=e=>Me(e,"rng");const Yp=e=>Me(e,"id");const Xp=e=>Me(e,"name");const Jp=e=>mo.isArray(e.start);const Qp=e=>!Xp(e)&&C(e.forward)?e.forward:true;const eh=(e,t)=>{if(_r(t)&&e.isBlock(t)&&!t.innerHTML){t.innerHTML='<br data-mce-bogus="1" />'}return t};const th=(e,t)=>{const o=U.from(Du(e.getRoot(),t.start));const n=U.from(Du(e.getRoot(),t.end));return yo(o,n,((o,n)=>{const s=e.createRng();s.setStart(o.container(),o.offset());s.setEnd(n.container(),n.offset());return{range:s,forward:Qp(t)}}))};const oh=(e,t)=>{var o;const n=(o=e.ownerDocument)!==null&&o!==void 0?o:document;const s=n.createTextNode(Gl);e.appendChild(s);t.setStart(s,0);t.setEnd(s,0)};const nh=e=>!e.hasChildNodes();const sh=(e,t)=>Up(e).fold(j,(e=>{t.setStart(e.container(),e.offset());t.setEnd(e.container(),e.offset());return true}));const rh=(e,t,o)=>{if(nh(t)&&$p(e,t)){oh(t,o);return true}else{return false}};const ah=(e,t,o,n)=>{const s=o[t?"start":"end"];const r=e.getRoot();if(s){let e=r;let o=s[0];for(let t=s.length-1;e&&t>=1;t--){const o=e.childNodes;if(rh(r,e,n)){return true}if(s[t]>o.length-1){if(rh(r,e,n)){return true}return sh(e,n)}e=o[s[t]]}if(Rr(e)){o=Math.min(s[0],e.data.length)}if(_r(e)){o=Math.min(s[0],e.childNodes.length)}if(t){n.setStart(e,o)}else{n.setEnd(e,o)}}return true};const ch=e=>Rr(e)&&e.data.length>0;const ih=(e,t,o)=>{const n=e.get(o.id+"_"+t);const s=n===null||n===void 0?void 0:n.parentNode;const r=o.keep;if(n&&s){let a;let c;if(t==="start"){if(!r){a=s;c=e.nodeIndex(n)}else{if(n.hasChildNodes()){a=n.firstChild;c=1}else if(ch(n.nextSibling)){a=n.nextSibling;c=0}else if(ch(n.previousSibling)){a=n.previousSibling;c=n.previousSibling.data.length}else{a=s;c=e.nodeIndex(n)+1}}}else{if(!r){a=s;c=e.nodeIndex(n)}else{if(n.hasChildNodes()){a=n.firstChild;c=1}else if(ch(n.previousSibling)){a=n.previousSibling;c=n.previousSibling.data.length}else{a=s;c=e.nodeIndex(n)}}}if(!r){const s=n.previousSibling;const r=n.nextSibling;mo.each(mo.grep(n.childNodes),(e=>{if(Rr(e)){e.data=e.data.replace(/\uFEFF/g,"")}}));let i;while(i=e.get(o.id+"_"+t)){e.remove(i,true)}if(Rr(r)&&Rr(s)&&!to.browser.isOpera()){const t=s.data.length;s.appendData(r.data);e.remove(r);a=s;c=t}}return U.some(mu(a,c))}else{return U.none()}};const lh=(e,t)=>{const o=e.createRng();if(ah(e,true,t,o)&&ah(e,false,t,o)){return U.some({range:o,forward:Qp(t)})}else{return U.none()}};const dh=(e,t)=>{const o=ih(e,"start",t);const n=ih(e,"end",t);return yo(o,n.or(o),((o,n)=>{const s=e.createRng();s.setStart(eh(e,o.container()),o.offset());s.setEnd(eh(e,n.container()),n.offset());return{range:s,forward:Qp(t)}}))};const uh=(e,t)=>U.from(e.select(t.name)[t.index]).map((t=>{const o=e.createRng();o.selectNode(t);return{range:o,forward:true}}));const fh=(e,t)=>{const o=e.dom;if(t){if(Jp(t)){return lh(o,t)}else if(Gp(t)){return th(o,t)}else if(Yp(t)){return dh(o,t)}else if(Xp(t)){return uh(o,t)}else if(Kp(t)){return U.some({range:t.rng,forward:Qp(t)})}}return U.none()};const mh=(e,t,o)=>Wu(e,t,o);const gh=(e,t)=>{fh(e,t).each((({range:t,forward:o})=>{e.setRng(t,o)}))};const ph=e=>_r(e)&&e.tagName==="SPAN"&&e.getAttribute("data-mce-type")==="bookmark";const hh=e=>t=>e===t;const yh=hh(dr);const bh=e=>e!==""&&" \f\n\r\t\v".indexOf(e)!==-1;const vh=e=>!bh(e)&&!yh(e)&&!ur(e);const kh=e=>{const t=[];if(e){for(let o=0;o<e.rangeCount;o++){t.push(e.getRangeAt(o))}}return t};const wh=e=>le(e,(e=>{const t=Sd(e);return t?[yn.fromDom(t)]:[]}));const _h=e=>kh(e).length>1;const xh=e=>oe(wh(e),Vl);const Ch=e=>sr(e,"td[data-mce-selected],th[data-mce-selected]");const Sh=(e,t)=>{const o=Ch(t);return o.length>0?o:xh(e)};const zh=e=>Sh(kh(e.selection.getSel()),yn.fromDom(e.getBody()));const Th=(e,t)=>as(e,"table",t);const Eh=e=>{const t=e.startContainer,o=e.startOffset;if(Rr(t)){return o===0?U.some(yn.fromDom(t)):U.none()}else{return U.from(t.childNodes[o]).map(yn.fromDom)}};const Oh=e=>{const t=e.endContainer,o=e.endOffset;if(Rr(t)){return o===t.data.length?U.some(yn.fromDom(t)):U.none()}else{return U.from(t.childNodes[o-1]).map(yn.fromDom)}};const Ah=e=>Pn(e).fold(R([e]),(t=>[e].concat(Ah(t))));const Dh=e=>Fn(e).fold(R([e]),(t=>{if(Mo(t)==="br"){return Mn(t).map((t=>[e].concat(Dh(t)))).getOr([])}else{return[e].concat(Dh(t))}}));const Nh=(e,t)=>yo(Eh(t),Oh(t),((t,o)=>{const n=ae(Ah(e),H(xn,t));const s=ae(Dh(e),H(xn,o));return n.isSome()&&s.isSome()})).getOr(false);const Mh=(e,t,o,n)=>{const s=o;const r=new ir(o,s);const a=Oe(e.schema.getMoveCaretBeforeOnEnterElements(),((e,t)=>!Y(["td","th","table"],t.toLowerCase())));let c=o;do{if(Rr(c)&&mo.trim(c.data).length!==0){if(n){t.setStart(c,0)}else{t.setEnd(c,c.data.length)}return}if(a[c.nodeName]){if(n){t.setStartBefore(c)}else{if(c.nodeName==="BR"){t.setEndBefore(c)}else{t.setEndAfter(c)}}return}}while(c=n?r.next():r.prev());if(s.nodeName==="BODY"){if(n){t.setStart(s,0)}else{t.setEnd(s,s.childNodes.length)}}};const Rh=e=>{const t=e.selection.getSel();return T(t)&&t.rangeCount>0};const Bh=(e,t)=>{const o=zh(e);if(o.length>0){Q(o,(o=>{const n=o.dom;const s=e.dom.createRng();s.setStartBefore(n);s.setEndAfter(n);t(s,true)}))}else{t(e.selection.getRng(),false)}};const Lh=(e,t,o)=>{const n=qu(e,t);o(n);e.moveToBookmark(n)};const Hh=e=>O(e===null||e===void 0?void 0:e.nodeType);const Ih=e=>_r(e)&&!ph(e)&&!Wp(e)&&!Or(e);const Ph=(e,t)=>{if(Ih(t)&&!/^(TD|TH)$/.test(t.nodeName)){const o=e.getAttrib(t,"data-mce-selected");const n=parseInt(o,10);return!isNaN(n)&&n>0}else{return false}};const Fh=(e,t,o)=>{const{selection:n,dom:s}=e;const r=n.getNode();const a=Zr(r);Lh(n,true,(()=>{t()}));const c=a&&Zr(r);if(c&&s.isChildOf(r,e.getBody())){e.selection.select(r)}else if(o(n.getStart())){Vh(s,n)}};const Vh=(e,t)=>{var o,n;const s=t.getRng();const{startContainer:r,startOffset:a}=s;const c=t.getNode();if(Ph(e,c)){return}if(_r(r)){const c=r.childNodes;const i=e.getRoot();let l;if(a<c.length){const t=c[a];l=new ir(t,(o=e.getParent(t,e.isBlock))!==null&&o!==void 0?o:i)}else{const t=c[c.length-1];l=new ir(t,(n=e.getParent(t,e.isBlock))!==null&&n!==void 0?n:i);l.next(true)}for(let o=l.current();o;o=l.next()){if(e.getContentEditable(o)==="false"){return}else if(Rr(o)&&!qh(o)){s.setStart(o,0);t.setRng(s);return}}}};const jh=(e,t,o)=>{if(e){const n=t?"nextSibling":"previousSibling";for(e=o?e:e[n];e;e=e[n]){if(_r(e)||!qh(e)){return e}}}return undefined};const Zh=(e,t)=>!!e.getTextBlockElements()[t.nodeName.toLowerCase()]||Ma(e,t);const Uh=(e,t,o)=>e.schema.isValidChild(t,o);const qh=(e,t=false)=>{if(T(e)&&Rr(e)){const o=t?e.data.replace(/ /g," "):e.data;return gr(o)}else{return false}};const Wh=e=>T(e)&&Rr(e)&&e.length===0;const $h=(e,t)=>{const o="[data-mce-cef-wrappable]";const n=gm(e);const s=ht(n)?o:`${o},${n}`;return vn(yn.fromDom(t),s)};const Gh=(e,t)=>{const o=e.dom;return Ih(t)&&o.getContentEditable(t)==="false"&&$h(e,t)&&o.select('[contenteditable="true"]',t).length===0};const Kh=(e,t)=>{if(E(e)){return e(t)}else if(T(t)){e=e.replace(/%(\w+)/g,((e,o)=>t[o]||e))}return e};const Yh=(e,t)=>{e=e||"";t=t||"";e=""+(e.nodeName||e);t=""+(t.nodeName||t);return e.toLowerCase()===t.toLowerCase()};const Xh=(e,t)=>{if(z(e)){return null}else{let o=String(e);if(t==="color"||t==="backgroundColor"){o=Qc(o)}if(t==="fontWeight"&&e===700){o="bold"}if(t==="fontFamily"){o=o.replace(/[\'\"]/g,"").replace(/,\s+/g,",")}return o}};const Jh=(e,t,o)=>{const n=e.getStyle(t,o);return Xh(n,o)};const Qh=(e,t)=>{let o;e.getParent(t,(t=>{if(_r(t)){o=e.getStyle(t,"text-decoration");return!!o&&o!=="none"}else{return false}}));return o};const ey=(e,t,o)=>e.getParents(t,o,e.getRoot());const ty=(e,t,o)=>{const n=e.formatter.get(t);return T(n)&&X(n,o)};const oy=(e,t)=>{const o=e=>{const t=e=>E(e)||e.length>1&&e.charAt(0)==="%";return X(["styles","attributes"],(o=>Ne(e,o).exists((e=>{const o=_(e)?e:De(e);return X(o,t)}))))};return ty(e,t,o)};const ny=(e,t,o)=>{const n=["inline","block","selector","attributes","styles","classes"];const s=e=>Oe(e,((e,t)=>X(n,(e=>e===t))));return ty(e,t,(t=>{const n=s(t);return ty(e,o,(e=>{const t=s(e);return Be(n,t)}))}))};const sy=e=>Re(e,"block");const ry=e=>sy(e)&&e.wrapper===true;const ay=e=>sy(e)&&e.wrapper!==true;const cy=e=>Re(e,"selector");const iy=e=>Re(e,"inline");const ly=e=>cy(e)&&iy(e)&&go(Ne(e,"mixed"),true);const dy=e=>cy(e)&&e.expand!==false&&!iy(e);const uy=e=>{const t=[];let o=e;while(o){if(Rr(o)&&o.data!==Gl||o.childNodes.length>1){return[]}if(_r(o)){t.push(o)}o=o.firstChild}return t};const fy=e=>uy(e).length>0;const my=e=>Wp(e.dom)&&fy(e.dom);const gy=ph;const py=ey;const hy=qh;const yy=Zh;const by=e=>Fr(e)&&e.getAttribute("data-mce-bogus")&&!e.nextSibling;const vy=(e,t)=>{let o=t;while(o){if(_r(o)&&e.getContentEditable(o)){return e.getContentEditable(o)==="false"?o:t}o=o.parentNode}return t};const ky=(e,t,o,n)=>{const s=t.data;if(e){for(let e=o;e>0;e--){if(n(s.charAt(e-1))){return e}}}else{for(let e=o;e<s.length;e++){if(n(s.charAt(e))){return e}}}return-1};const wy=(e,t,o)=>ky(e,t,o,(e=>yh(e)||bh(e)));const _y=(e,t,o)=>ky(e,t,o,vh);const xy=(e,t,o,n,s,r)=>{let a;const c=e.getParent(o,e.isBlock)||t;const i=(t,o,n)=>{const r=_l(e);const i=s?r.backwards:r.forwards;return U.from(i(t,o,((e,t)=>{if(gy(e.parentNode)){return-1}else{a=e;return n(s,e,t)}}),c))};const l=i(o,n,wy);return l.bind((e=>r?i(e.container,e.offset+(s?-1:0),_y):U.some(e))).orThunk((()=>a?U.some({container:a,offset:s?0:a.length}):U.none()))};const Cy=(e,t,o,n,s)=>{const r=n[s];if(Rr(n)&&ht(n.data)&&r){n=r}const a=py(e,n);for(let n=0;n<a.length;n++){for(let s=0;s<t.length;s++){const r=t[s];if(T(r.collapsed)&&r.collapsed!==o.collapsed){continue}if(cy(r)&&e.is(a[n],r.selector)){return a[n]}}}return n};const Sy=(e,t,o,n)=>{var s;let r=o;const a=e.getRoot();const c=t[0];if(sy(c)){r=c.wrapper?null:e.getParent(o,c.block,a)}if(!r){const t=(s=e.getParent(o,"LI,TD,TH,SUMMARY"))!==null&&s!==void 0?s:a;r=e.getParent(Rr(o)?o.parentNode:o,(t=>t!==a&&yy(e.schema,t)),t)}if(r&&sy(c)&&c.wrapper){r=py(e,r,"ul,ol").reverse()[0]||r}if(!r){r=o;while(r&&r[n]&&!e.isBlock(r[n])){r=r[n];if(Yh(r,"br")){break}}}return r||o};const zy=(e,t,o,n)=>{const s=o.parentNode;if(T(o[n])){return false}else if(s===t||z(s)||e.isBlock(s)){return true}else{return zy(e,t,s,n)}};const Ty=(e,t,o,n,s)=>{let r=o;const a=s?"previousSibling":"nextSibling";const c=e.getRoot();if(Rr(o)&&!hy(o)){if(s?n>0:n<o.data.length){return o}}while(r){if(!t[0].block_expand&&e.isBlock(r)){return r}for(let t=r[a];t;t=t[a]){const o=Rr(t)&&!zy(e,c,t,a);if(!gy(t)&&!by(t)&&!hy(t,o)){return r}}if(r===c||r.parentNode===c){o=r;break}r=r.parentNode}return o};const Ey=e=>gy(e.parentNode)||gy(e);const Oy=(e,t,o,n=false)=>{let{startContainer:s,startOffset:r,endContainer:a,endOffset:c}=t;const i=o[0];if(_r(s)&&s.hasChildNodes()){s=zd(s,r);if(Rr(s)){r=0}}if(_r(a)&&a.hasChildNodes()){a=zd(a,t.collapsed?c:c-1);if(Rr(a)){c=a.data.length}}s=vy(e,s);a=vy(e,a);if(Ey(s)){s=gy(s)?s:s.parentNode;if(t.collapsed){s=s.previousSibling||s}else{s=s.nextSibling||s}if(Rr(s)){r=t.collapsed?s.length:0}}if(Ey(a)){a=gy(a)?a:a.parentNode;if(t.collapsed){a=a.nextSibling||a}else{a=a.previousSibling||a}if(Rr(a)){c=t.collapsed?0:a.length}}if(t.collapsed){const t=xy(e,e.getRoot(),s,r,true,n);t.each((({container:e,offset:t})=>{s=e;r=t}));const o=xy(e,e.getRoot(),a,c,false,n);o.each((({container:e,offset:t})=>{a=e;c=t}))}if(iy(i)||i.block_expand){if(!iy(i)||(!Rr(s)||r===0)){s=Ty(e,o,s,r,true)}if(!iy(i)||(!Rr(a)||c===a.data.length)){a=Ty(e,o,a,c,false)}}if(dy(i)){s=Cy(e,o,t,s,"previousSibling");a=Cy(e,o,t,a,"nextSibling")}if(sy(i)||cy(i)){s=Sy(e,o,s,"previousSibling");a=Sy(e,o,a,"nextSibling");if(sy(i)){if(!e.isBlock(s)){s=Ty(e,o,s,r,true);if(Rr(s)){r=0}}if(!e.isBlock(a)){a=Ty(e,o,a,c,false);if(Rr(a)){c=a.data.length}}}}if(_r(s)&&s.parentNode){r=e.nodeIndex(s);s=s.parentNode}if(_r(a)&&a.parentNode){c=e.nodeIndex(a)+1;a=a.parentNode}return{startContainer:s,startOffset:r,endContainer:a,endOffset:c}};const Ay=(e,t,o)=>{var n;const s=t.startOffset;const r=zd(t.startContainer,s);const a=t.endOffset;const c=zd(t.endContainer,a-1);const i=e=>{const t=e[0];if(Rr(t)&&t===r&&s>=t.data.length){e.splice(0,1)}const o=e[e.length-1];if(a===0&&e.length>0&&o===c&&Rr(o)){e.splice(e.length-1,1)}return e};const l=(e,t,o)=>{const n=[];for(;e&&e!==o;e=e[t]){n.push(e)}return n};const d=(t,o)=>e.getParent(t,(e=>e.parentNode===o),o);const u=(e,t,n)=>{const s=n?"nextSibling":"previousSibling";for(let r=e,a=r.parentNode;r&&r!==t;r=a){a=r.parentNode;const t=l(r===e?r:r[s],s);if(t.length){if(!n){t.reverse()}o(i(t))}}};if(r===c){return o(i([r]))}const f=(n=e.findCommonAncestor(r,c))!==null&&n!==void 0?n:e.getRoot();if(e.isChildOf(r,c)){return u(r,f,true)}if(e.isChildOf(c,r)){return u(c,f)}const m=d(r,f)||r;const g=d(c,f)||c;u(r,m,true);const p=l(m===r?m:m.nextSibling,"nextSibling",g===c?g.nextSibling:g);if(p.length){o(i(p))}u(c,g)};const Dy=['pre[class*=language-][contenteditable="false"]',"figure.image","div[data-ephox-embed-iri]","div.tiny-pageembed","div.mce-toc","div[data-mce-toc]"];const Ny=e=>Po(e)&&Sl(e)===Gl;const My=(e,t,o,n)=>On(t).fold((()=>"skipping"),(s=>{if(n==="br"||Ny(t)){return"valid"}else if(rl(t)){return"existing"}else if(Wp(t.dom)){return"caret"}else if(X(Dy,(e=>vn(t,e)))){return"valid-block"}else if(!Uh(e,o,n)||!Uh(e,Mo(s),o)){return"invalid-child"}else{return"valid"}}));const Ry=(e,t)=>{const o=Oy(e.dom,t,[{inline:"span"}]);t.setStart(o.startContainer,o.startOffset);t.setEnd(o.endContainer,o.endOffset);e.selection.setRng(t)};const By=(e,t,o,n,s,r)=>{const{uid:a=t,...c}=o;an(e,Xi());Uo(e,`${Qi()}`,a);Uo(e,`${Ji()}`,n);const{attributes:i={},classes:l=[]}=s(a,c);qo(e,i);gl(e,l);if(r){if(l.length>0){Uo(e,`${tl()}`,l.join(","))}const t=we(i);if(t.length>0){Uo(e,`${ol()}`,t.join(","))}}};const Ly=e=>{ln(e,Xi());Ko(e,`${Qi()}`);Ko(e,`${Ji()}`);Ko(e,`${el()}`);const t=$o(e,`${ol()}`).map((e=>e.split(","))).getOr([]);const o=$o(e,`${tl()}`).map((e=>e.split(","))).getOr([]);Q(t,(t=>Ko(e,t)));pl(e,o);Ko(e,`${tl()}`);Ko(e,`${ol()}`)};const Hy=(e,t,o,n,s)=>{const r=yn.fromTag("span",e);By(r,t,o,n,s,false);return r};const Iy=(e,t,o,n,s,r)=>{const a=[];const c=Hy(e.getDoc(),o,r,n,s);const i=ua();const l=()=>{i.clear()};const d=()=>i.get().getOrThunk((()=>{const e=yl(c);a.push(e);i.set(e);return e}));const u=e=>{Q(e,f)};const f=t=>{const a=My(e,t,"span",Mo(t));switch(a){case"invalid-child":{l();const e=Hn(t);u(e);l();break}case"valid-block":{l();By(t,o,r,n,s,true);break}case"valid":{const e=d();Ts(t,e);break}}};const m=e=>{const t=J(e,yn.fromDom);u(t)};Ay(e.dom,t,(e=>{l();m(e)}));return a};const Py=(e,t,o,n)=>{e.undoManager.transact((()=>{const s=e.selection;const r=s.getRng();const a=zh(e).length>0;const c=ml("mce-annotation");if(r.collapsed&&!a){Ry(e,r)}if(s.getRng().collapsed&&!a){const r=Hy(e.getDoc(),c,n,t,o.decorate);Ls(r,dr);s.getRng().insertNode(r.dom);s.select(r.dom)}else{Lh(s,false,(()=>{Bh(e,(s=>{Iy(e,s,c,t,o.decorate,n)}))}))}}))};const Fy=e=>{const t=ul();dl(e,t);const o=ll(e,t);const n=jo("span");const s=e=>{Q(e,(e=>{if(n(e)){Ns(e)}else{Ly(e)}}))};return{register:(e,o)=>{t.register(e,o)},annotate:(o,n)=>{t.lookup(o).each((t=>{Py(e,o,t,n)}))},annotationChanged:(e,t)=>{o.addListener(e,t)},remove:t=>{sl(e,U.some(t)).each((({elements:t})=>{const o=e.selection.getBookmark();s(t);e.selection.moveToBookmark(o)}))},removeAll:t=>{const o=e.selection.getBookmark();xe(il(e,t),((e,t)=>{s(e)}));e.selection.moveToBookmark(o)},getAll:t=>{const o=il(e,t);return Ce(o,(e=>J(e,(e=>e.dom))))}}};const Vy=e=>({getBookmark:H(mh,e),moveToBookmark:H(gh,e)});Vy.isBookmarkNode=ph;const jy=(e,t,o)=>{if(o.collapsed){return false}else{return X(o.getClientRects(),(o=>kd(o,e,t)))}};const Zy=(e,t)=>e.dispatch("PreProcess",t);const Uy=(e,t)=>e.dispatch("PostProcess",t);const qy=e=>{e.dispatch("remove")};const Wy=e=>{e.dispatch("detach")};const $y=(e,t)=>{e.dispatch("SwitchMode",{mode:t})};const Gy=(e,t,o,n,s)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:s})};const Ky=(e,t,o,n,s)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:s})};const Yy=e=>{e.dispatch("PreInit")};const Xy=e=>{e.dispatch("PostRender")};const Jy=e=>{e.dispatch("Init")};const Qy=(e,t)=>{e.dispatch("PlaceholderToggle",{state:t})};const eb=(e,t,o)=>{e.dispatch(t,o)};const tb=(e,t,o,n)=>{e.dispatch("FormatApply",{format:t,node:o,vars:n})};const ob=(e,t,o,n)=>{e.dispatch("FormatRemove",{format:t,node:o,vars:n})};const nb=(e,t)=>e.dispatch("BeforeSetContent",t);const sb=(e,t)=>e.dispatch("SetContent",t);const rb=(e,t)=>e.dispatch("BeforeGetContent",t);const ab=(e,t)=>e.dispatch("GetContent",t);const cb=(e,t)=>{e.dispatch("AutocompleterStart",t)};const ib=(e,t)=>{e.dispatch("AutocompleterUpdate",t)};const lb=(e,t)=>{e.dispatch("AutocompleterUpdateActiveRange",t)};const db=e=>{e.dispatch("AutocompleterEnd")};const ub=(e,t,o)=>e.dispatch("PastePreProcess",{content:t,internal:o});const fb=(e,t,o)=>e.dispatch("PastePostProcess",{node:t,internal:o});const mb=(e,t)=>e.dispatch("PastePlainTextToggle",{state:t});const gb=(e,t)=>e.dispatch("EditableRootStateChange",{state:t});const pb={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||pb.metaKeyPressed(e),metaKeyPressed:e=>to.os.isMacOS()||to.os.isiOS()?e.metaKey:e.ctrlKey&&!e.altKey};const hb="data-mce-selected";const yb="table,img,figure.image,hr,video,span.mce-preview-object,details";const bb=Math.abs;const vb=Math.round;const kb={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};const wb=e=>e.type==="longpress"||e.type.indexOf("touch")===0;const _b=(e,t)=>{const o=t.dom;const n=t.getDoc();const s=document;const r=t.getBody();let a,c,i,l,d;let u,f,m,g,p,h,y,b;let v;let k;let w;let _;const x=e=>T(e)&&(Vr(e)||o.is(e,"figure.image"));const C=e=>Wr(e)||o.hasClass(e,"mce-preview-object");const S=(e,t)=>{if(wb(e)){const o=e.touches[0];return x(e.target)&&!jy(o.clientX,o.clientY,t)}else{return x(e.target)&&!jy(e.clientX,e.clientY,t)}};const z=e=>{const o=e.target;if(S(e,t.selection.getRng())&&!e.isDefaultPrevented()){t.selection.select(o)}};const E=e=>{if(o.hasClass(e,"mce-preview-object")&&T(e.firstElementChild)){return[e,e.firstElementChild]}else if(o.is(e,"figure.image")){return[e.querySelector("img")]}else{return[e]}};const O=e=>{const n=tm(t);if(!n){return false}if(e.getAttribute("data-mce-resize")==="false"){return false}if(e===t.getBody()){return false}if(o.hasClass(e,"mce-preview-object")&&T(e.firstElementChild)){return vn(yn.fromDom(e.firstElementChild),n)}else{return vn(yn.fromDom(e),n)}};const A=(e,t)=>{if(C(t)){return e.create("img",{src:to.transparentSrc})}else if(Dr(t)){const o=lt(l.name,"n");const n=o?he:ye;const s=t.cloneNode(true);n(e.select("tr",s)).each((t=>{const o=e.select("td,th",t);e.setStyle(t,"height",null);Q(o,(t=>e.setStyle(t,"height",null)))}));return s}else{return t.cloneNode(true)}};const D=(e,n,s)=>{if(T(s)){const r=E(e);Q(r,(e=>{if(e.style[n]||!t.schema.isValid(e.nodeName.toLowerCase(),n)){o.setStyle(e,n,s)}else{o.setAttrib(e,n,""+s)}}))}};const N=(e,t,o)=>{D(e,"width",t);D(e,"height",o)};const M=e=>{let n,s,d;let S,z;n=e.screenX-u;s=e.screenY-f;v=n*l[2]+p;k=s*l[3]+h;v=v<5?5:v;k=k<5?5:k;if((x(a)||C(a))&&om(t)!==false){d=!pb.modifierPressed(e)}else{d=pb.modifierPressed(e)}if(d){if(bb(n)>bb(s)){k=vb(v*y);v=vb(k/y)}else{v=vb(k/y);k=vb(v*y)}}N(c,v,k);S=l.startPos.x+n;z=l.startPos.y+s;S=S>0?S:0;z=z>0?z:0;o.setStyles(i,{left:S,top:z,display:"block"});i.innerHTML=v+" × "+k;if(l[2]<0&&c.clientWidth<=v){o.setStyle(c,"left",m+(p-v))}if(l[3]<0&&c.clientHeight<=k){o.setStyle(c,"top",g+(h-k))}n=r.scrollWidth-w;s=r.scrollHeight-_;if(n+s!==0){o.setStyles(i,{left:S-n,top:z-s})}if(!b){Gy(t,a,p,h,"corner-"+l.name);b=true}};const R=()=>{const e=b;b=false;if(e){D(a,"width",v);D(a,"height",k)}o.unbind(n,"mousemove",M);o.unbind(n,"mouseup",R);if(s!==n){o.unbind(s,"mousemove",M);o.unbind(s,"mouseup",R)}o.remove(c);o.remove(i);o.remove(d);B(a);if(e){Ky(t,a,v,k,"corner-"+l.name);o.setAttrib(a,"style",o.getAttrib(a,"style"))}t.nodeChanged()};const B=e=>{F();const m=o.getPos(e,r);const g=m.x;const b=m.y;const x=e.getBoundingClientRect();const C=x.width||x.right-x.left;const S=x.height||x.bottom-x.top;if(a!==e){H();a=e;v=k=0}const z=t.dispatch("ObjectSelected",{target:e});if(O(e)&&!z.isDefaultPrevented()){xe(kb,((e,t)=>{const m=m=>{const v=E(a)[0];u=m.screenX;f=m.screenY;p=v.clientWidth;h=v.clientHeight;y=h/p;l=e;l.name=t;l.startPos={x:C*e[0]+g,y:S*e[1]+b};w=r.scrollWidth;_=r.scrollHeight;d=o.add(r,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"});o.setStyles(d,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"});c=A(o,a);o.addClass(c,"mce-clonedresizable");o.setAttrib(c,"data-mce-bogus","all");c.contentEditable="false";o.setStyles(c,{left:g,top:b,margin:0});N(c,C,S);c.removeAttribute(hb);r.appendChild(c);o.bind(n,"mousemove",M);o.bind(n,"mouseup",R);if(s!==n){o.bind(s,"mousemove",M);o.bind(s,"mouseup",R)}i=o.add(r,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},p+" × "+h)};let v=o.get("mceResizeHandle"+t);if(v){o.remove(v)}v=o.add(r,"div",{id:"mceResizeHandle"+t,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:true,style:"cursor:"+t+"-resize; margin:0; padding:0"});o.bind(v,"mousedown",(e=>{e.stopImmediatePropagation();e.preventDefault();m(e)}));e.elm=v;o.setStyles(v,{left:C*e[0]+g-v.offsetWidth/2,top:S*e[1]+b-v.offsetHeight/2})}))}else{H(false)}};const L=Gi(B,0);const H=(e=true)=>{L.cancel();F();if(a&&e){a.removeAttribute(hb)}xe(kb,((e,t)=>{const n=o.get("mceResizeHandle"+t);if(n){o.unbind(n);o.remove(n)}}))};const I=(e,t)=>o.isChildOf(e,t);const P=n=>{if(b||t.removed||t.composing){return}const s=n.type==="mousedown"?n.target:e.getNode();const a=is(yn.fromDom(s),yb).map((e=>e.dom)).filter((e=>o.isEditable(e.parentElement)||e.nodeName==="IMG"&&o.isEditable(e))).getOrUndefined();const c=T(a)?o.getAttrib(a,hb,"1"):"1";Q(o.select(`img[${hb}],hr[${hb}]`),(e=>{e.removeAttribute(hb)}));if(T(a)&&I(a,r)&&t.hasFocus()){V();const t=e.getStart(true);if(I(t,a)&&I(e.getEnd(true),a)){o.setAttrib(a,hb,c);L.throttle(a);return}}H()};const F=()=>{xe(kb,(e=>{if(e.elm){o.unbind(e.elm);delete e.elm}}))};const V=()=>{try{t.getDoc().execCommand("enableObjectResizing",false,"false")}catch(e){}};t.on("init",(()=>{V();t.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",P);t.on("keyup compositionend",(e=>{if(a&&a.nodeName==="TABLE"){P(e)}}));t.on("hide blur",H);t.on("contextmenu longpress",z,true)}));t.on("remove",F);const j=()=>{L.cancel();a=c=d=null};return{isResizable:O,showResizeRect:B,hideResizeRect:H,updateResizeRect:P,destroy:j}};const xb=(e,t)=>{t.fold((t=>{e.setStartBefore(t.dom)}),((t,o)=>{e.setStart(t.dom,o)}),(t=>{e.setStartAfter(t.dom)}))};const Cb=(e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))};const Sb=(e,t,o)=>{const n=e.document.createRange();xb(n,t);Cb(n,o);return n};const zb=(e,t,o,n,s)=>{const r=e.document.createRange();r.setStart(t.dom,o);r.setEnd(n.dom,s);return r};const Tb=Qu.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);const Eb=(e,t,o)=>t(yn.fromDom(o.startContainer),o.startOffset,yn.fromDom(o.endContainer),o.endOffset);const Ob=(e,t)=>t.match({domRange:e=>({ltr:R(e),rtl:U.none}),relative:(t,o)=>({ltr:$e((()=>Sb(e,t,o))),rtl:$e((()=>U.some(Sb(e,o,t))))}),exact:(t,o,n,s)=>({ltr:$e((()=>zb(e,t,o,n,s))),rtl:$e((()=>U.some(zb(e,n,s,t,o))))})});const Ab=(e,t)=>{const o=t.ltr();if(o.collapsed){const n=t.rtl().filter((e=>e.collapsed===false));return n.map((e=>Tb.rtl(yn.fromDom(e.endContainer),e.endOffset,yn.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>Eb(e,Tb.ltr,o)))}else{return Eb(e,Tb.ltr,o)}};const Db=(e,t)=>{const o=Ob(e,t);return Ab(e,o)};Tb.ltr;Tb.rtl;const Nb=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n});const Mb={create:Nb};const Rb=(e,t,o)=>{var n,s;return U.from((s=(n=e.dom).caretPositionFromPoint)===null||s===void 0?void 0:s.call(n,t,o)).bind((t=>{if(t.offsetNode===null){return U.none()}const o=e.dom.createRange();o.setStart(t.offsetNode,t.offset);o.collapse();return U.some(o)}))};const Bb=(e,t,o)=>{var n,s;return U.from((s=(n=e.dom).caretRangeFromPoint)===null||s===void 0?void 0:s.call(n,t,o))};const Lb=(()=>{if(document.caretPositionFromPoint){return Rb}else if(document.caretRangeFromPoint){return Bb}else{return U.none}})();const Hb=(e,t,o)=>{const n=yn.fromDom(e.document);return Lb(n,t,o).map((e=>Mb.create(yn.fromDom(e.startContainer),e.startOffset,yn.fromDom(e.endContainer),e.endOffset)))};const Ib=Qu.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]);const Pb=(e,t,o,n)=>e.fold(t,o,n);const Fb=e=>e.fold(B,B,B);const Vb=Ib.before;const jb=Ib.on;const Zb=Ib.after;const Ub={before:Vb,on:jb,after:Zb,cata:Pb,getStart:Fb};const qb=Qu.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]);const Wb=e=>qb.exact(e.start,e.soffset,e.finish,e.foffset);const $b=e=>e.match({domRange:e=>yn.fromDom(e.startContainer),relative:(e,t)=>Ub.getStart(e),exact:(e,t,o,n)=>e});const Gb=qb.domRange;const Kb=qb.relative;const Yb=qb.exact;const Xb=e=>{const t=$b(e);return En(t)};const Jb=Mb.create;const Qb={domRange:Gb,relative:Kb,exact:Yb,exactFromRange:Wb,getWin:Xb,range:Jb};const ev=(e,t)=>{const o=Mo(e);if("input"===o){return Ub.after(e)}else if(!Y(["br","img"],o)){return Ub.on(e,t)}else{return t===0?Ub.before(e):Ub.after(e)}};const tv=(e,t)=>{const o=e.fold(Ub.before,ev,Ub.after);const n=t.fold(Ub.before,ev,Ub.after);return Qb.relative(o,n)};const ov=(e,t,o,n)=>{const s=ev(e,t);const r=ev(o,n);return Qb.relative(s,r)};const nv=e=>e.match({domRange:e=>{const t=yn.fromDom(e.startContainer);const o=yn.fromDom(e.endContainer);return ov(t,e.startOffset,o,e.endOffset)},relative:tv,exact:ov});const sv=(e,t)=>{const o=t||document;const n=o.createDocumentFragment();Q(e,(e=>{n.appendChild(e.dom)}));return yn.fromDom(n)};const rv=e=>{const t=Qb.getWin(e).dom;const o=(e,o,n,s)=>zb(t,e,o,n,s);const n=nv(e);return Db(t,n).match({ltr:o,rtl:o})};const av=(e,t,o)=>Hb(e,t,o);const cv=(e,t,o)=>{const n=En(yn.fromDom(o));return av(n.dom,e,t).map((e=>{const t=o.createRange();t.setStart(e.start.dom,e.soffset);t.setEnd(e.finish.dom,e.foffset);return t})).getOrUndefined()};const iv=(e,t)=>T(e)&&T(t)&&(e.startContainer===t.startContainer&&e.startOffset===t.startOffset)&&(e.endContainer===t.endContainer&&e.endOffset===t.endOffset);const lv=(e,t,o)=>{let n=e;while(n&&n!==t){if(o(n)){return n}n=n.parentNode}return null};const dv=(e,t,o)=>lv(e,t,o)!==null;const uv=(e,t,o)=>dv(e,t,(e=>e.nodeName===o));const fv=(e,t)=>od(e)&&!dv(e,t,Wp);const mv=(e,t,o)=>{const n=t.parentNode;if(n){const s=new ir(t,e.getParent(n,e.isBlock)||e.getRoot());let r;while(r=s[o?"prev":"next"]()){if(Fr(r)){return true}}}return false};const gv=(e,t)=>{var o;return((o=e.previousSibling)===null||o===void 0?void 0:o.nodeName)===t};const pv=(e,t)=>{let o=t;while(o&&o!==e){if(Zr(o)){return true}o=o.parentNode}return false};const hv=(e,t,o,n,s)=>{const r=e.getRoot();const a=e.schema.getNonEmptyElements();const c=s.parentNode;let i;let l;if(!c){return U.none()}const d=e.getParent(c,e.isBlock)||r;if(n&&Fr(s)&&t&&e.isEmpty(d)){return U.some(mu(c,e.nodeIndex(s)))}const u=new ir(s,d);while(l=u[n?"prev":"next"]()){if(e.getContentEditableParent(l)==="false"||fv(l,r)){return U.none()}if(Rr(l)&&l.data.length>0){if(!uv(l,r,"A")){return U.some(mu(l,n?l.data.length:0))}return U.none()}if(e.isBlock(l)||a[l.nodeName.toLowerCase()]){return U.none()}i=l}if(Hr(i)){return U.none()}if(o&&i){return U.some(mu(i,0))}return U.none()};const yv=(e,t,o,n)=>{const s=e.getRoot();let r;let a=false;let c=o?n.startContainer:n.endContainer;let i=o?n.startOffset:n.endOffset;const l=_r(c)&&i===c.childNodes.length;const d=e.schema.getNonEmptyElements();let u=o;if(od(c)){return U.none()}if(_r(c)&&i>c.childNodes.length-1){u=false}if(Ir(c)){c=s;i=0}if(c===s){if(u){r=c.childNodes[i>0?i-1:0];if(r){if(od(r)){return U.none()}if(d[r.nodeName]||Dr(r)){return U.none()}}}if(c.hasChildNodes()){i=Math.min(!u&&i>0?i-1:i,c.childNodes.length-1);c=c.childNodes[i];i=Rr(c)&&l?c.data.length:0;if(!t&&c===s.lastChild&&Dr(c)){return U.none()}if(pv(s,c)||od(c)){return U.none()}if(Gr(c)){return U.none()}if(c.hasChildNodes()&&!Dr(c)){r=c;const t=new ir(c,s);do{if(Zr(r)||od(r)){a=false;break}if(Rr(r)&&r.data.length>0){i=u?0:r.data.length;c=r;a=true;break}if(d[r.nodeName.toLowerCase()]&&!qr(r)){i=e.nodeIndex(r);c=r.parentNode;if(!u){i++}a=true;break}}while(r=u?t.next():t.prev())}}}if(t){if(Rr(c)&&i===0){hv(e,l,t,true,c).each((e=>{c=e.container();i=e.offset();a=true}))}if(_r(c)){r=c.childNodes[i];if(!r){r=c.childNodes[i-1]}if(r&&Fr(r)&&!gv(r,"A")&&!mv(e,r,false)&&!mv(e,r,true)){hv(e,l,t,true,r).each((e=>{c=e.container();i=e.offset();a=true}))}}}if(u&&!t&&Rr(c)&&i===c.data.length){hv(e,l,t,false,c).each((e=>{c=e.container();i=e.offset();a=true}))}return a&&c?U.some(mu(c,i)):U.none()};const bv=(e,t)=>{const o=t.collapsed,n=t.cloneRange();const s=mu.fromRangeStart(t);yv(e,o,true,n).each((e=>{if(!o||!mu.isAbove(s,e)){n.setStart(e.container(),e.offset())}}));if(!o){yv(e,o,false,n).each((e=>{n.setEnd(e.container(),e.offset())}))}if(o){n.collapse(true)}return iv(t,n)?U.none():U.some(n)};const vv=(e,t)=>e.splitText(t);const kv=e=>{let t=e.startContainer,o=e.startOffset,n=e.endContainer,s=e.endOffset;if(t===n&&Rr(t)){if(o>0&&o<t.data.length){n=vv(t,o);t=n.previousSibling;if(s>o){s=s-o;const e=vv(n,s).previousSibling;t=n=e;s=e.data.length;o=0}else{s=0}}}else{if(Rr(t)&&o>0&&o<t.data.length){t=vv(t,o);o=0}if(Rr(n)&&s>0&&s<n.data.length){const e=vv(n,s).previousSibling;n=e;s=e.data.length}}return{startContainer:t,startOffset:o,endContainer:n,endOffset:s}};const wv=e=>{const t=(t,o)=>Ay(e,t,o);const o=kv;const n=t=>bv(e,t).fold(j,(e=>{t.setStart(e.startContainer,e.startOffset);t.setEnd(e.endContainer,e.endOffset);return true}));const s=(t,o={type:"word"})=>{if(o.type==="word"){const o=Oy(e,t,[{inline:"span"}]);const n=e.createRng();n.setStart(o.startContainer,o.startOffset);n.setEnd(o.endContainer,o.endOffset);return n}return t};return{walk:t,split:o,expand:s,normalize:n}};wv.compareRanges=iv;wv.getCaretRangeFromPoint=cv;wv.getSelectedNode=Sd;wv.getNode=zd;const _v=(e,t)=>{const o=(t,o)=>{if(!O(o)&&!o.match(/^[0-9]+$/)){throw new Error(e+".set accepts only positive integer values. Value was "+o)}const n=t.dom;if(fs(n)){n.style[e]=o+"px"}};const n=o=>{const n=t(o);if(n<=0||n===null){const t=ys(o,e);return parseFloat(t)||0}return n};const s=n;const r=(e,t)=>se(t,((t,o)=>{const n=ys(e,o);const s=n===undefined?0:parseInt(n,10);return isNaN(s)?t:t+s}),0);const a=(e,t,o)=>{const n=r(e,o);const s=t>n?t-n:0;return s};return{set:o,get:n,getOuter:s,aggregate:r,max:a}};const xv=_v("height",(e=>{const t=e.dom;return Qn(e)?t.getBoundingClientRect().height:t.offsetHeight}));const Cv=e=>xv.get(e);const Sv=()=>yn.fromDom(document);const zv=(e,t)=>{const o=e.view(t);return o.fold(R([]),(t=>{const o=e.owner(t);const n=zv(e,o);return[t].concat(n)}))};const Tv=(e,t)=>{const o=t.owner(e);return zv(t,o)};const Ev=e=>{var t;const o=e.dom===document?U.none():U.from((t=e.dom.defaultView)===null||t===void 0?void 0:t.frameElement);return o.map(yn.fromDom)};const Ov=e=>zn(e);var Av=Object.freeze({__proto__:null,view:Ev,owner:Ov});const Dv=e=>{const t=Sv();const o=Ys(t);const n=Tv(e,Av);const s=Ks(e);const r=ne(n,((e,t)=>{const o=Ks(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return qs(r.left+s.left+o.left,r.top+s.top+o.top)};const Nv=e=>Mo(e)==="textarea";const Mv=(e,t)=>{const o=e.dispatch("ScrollIntoView",t);return o.isDefaultPrevented()};const Rv=(e,t)=>{e.dispatch("AfterScrollIntoView",t)};const Bv=(e,t)=>{const o=Hn(e);if(o.length===0||Nv(e)){return{element:e,offset:t}}else if(t<o.length&&!Nv(o[t])){return{element:o[t],offset:0}}else{const n=o[o.length-1];if(Nv(n)){return{element:e,offset:t}}else{if(Mo(n)==="img"){return{element:n,offset:1}}else if(Po(n)){return{element:n,offset:Sl(n).length}}else{return{element:n,offset:Hn(n).length}}}}};const Lv=(e,t)=>{const o=Gs(e);const n=Cv(e);return{element:e,bottom:o.top+n,height:n,pos:o,cleanup:t}};const Hv=(e,t)=>{const o=Bv(e,t);const n=yn.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">'+Gl+"</span>");xs(o.element,n);return Lv(n,(()=>Ds(n)))};const Iv=e=>Lv(yn.fromDom(e),D);const Pv=(e,t,o,n)=>{Zv(e,((s,r)=>Vv(e,t,o,n)),o)};const Fv=(e,t,o,n,s)=>{const r={elm:n.element.dom,alignToTop:s};if(Mv(e,r)){return}const a=Ys(t).top;o(e,t,a,n,s);Rv(e,r)};const Vv=(e,t,o,n)=>{const s=yn.fromDom(e.getBody());const r=yn.fromDom(e.getDoc());_s(s);const a=Hv(yn.fromDom(o.startContainer),o.startOffset);Fv(e,r,t,a,n);a.cleanup()};const jv=(e,t,o,n)=>{const s=yn.fromDom(e.getDoc());Fv(e,s,o,Iv(t),n)};const Zv=(e,t,o)=>{const n=o.startContainer;const s=o.startOffset;const r=o.endContainer;const a=o.endOffset;t(yn.fromDom(n),yn.fromDom(r));const c=e.dom.createRng();c.setStart(n,s);c.setEnd(r,a);e.selection.setRng(o)};const Uv=(e,t,o,n,s)=>{const r=t.pos;if(n){Xs(r.left,r.top,s)}else{const n=r.top-o+t.height;Xs(-e.getBody().getBoundingClientRect().left,n,s)}};const qv=(e,t,o,n,s,r)=>{const a=n+o;const c=s.pos.top;const i=s.bottom;const l=i-c>=n;if(c<o){Uv(e,s,n,r!==false,t)}else if(c>a){const o=l?r!==false:r===true;Uv(e,s,n,o,t)}else if(i>a&&!l){Uv(e,s,n,r===true,t)}};const Wv=(e,t,o,n,s)=>{const r=En(t).dom.innerHeight;qv(e,t,o,r,n,s)};const $v=(e,t,o,n,s)=>{const r=En(t).dom.innerHeight;qv(e,t,o,r,n,s);const a=Dv(n.element);const c=tr(window);if(a.top<c.y){Js(n.element,s!==false)}else if(a.top>c.bottom){Js(n.element,s===true)}};const Gv=(e,t,o)=>Pv(e,Wv,t,o);const Kv=(e,t,o)=>jv(e,t,Wv,o);const Yv=(e,t,o)=>Pv(e,$v,t,o);const Xv=(e,t,o)=>jv(e,t,$v,o);const Jv=(e,t,o)=>{const n=e.inline?Kv:Xv;n(e,t,o)};const Qv=(e,t,o)=>{const n=e.inline?Gv:Yv;n(e,t,o)};const ek=(e,t=false)=>e.dom.focus({preventScroll:t});const tk=e=>{const t=Wn(e).dom;return e.dom===t.activeElement};const ok=(e=Sv())=>U.from(e.dom.activeElement).map(yn.fromDom);const nk=e=>ok(Wn(e)).filter((t=>e.dom.contains(t.dom)));const sk=(e,t)=>{const o=Po(t)?Sl(t).length:Hn(t).length+1;if(e>o){return o}else if(e<0){return 0}return e};const rk=e=>Qb.range(e.start,sk(e.soffset,e.start),e.finish,sk(e.foffset,e.finish));const ak=(e,t)=>!wr(t.dom)&&(Cn(e,t)||xn(e,t));const ck=e=>t=>ak(e,t.start)&&ak(e,t.finish);const ik=e=>e.inline||to.browser.isFirefox();const lk=e=>Qb.range(yn.fromDom(e.startContainer),e.startOffset,yn.fromDom(e.endContainer),e.endOffset);const dk=e=>{const t=e.getSelection();const o=!t||t.rangeCount===0?U.none():U.from(t.getRangeAt(0));return o.map(lk)};const uk=e=>{const t=En(e);return dk(t.dom).filter(ck(e))};const fk=(e,t)=>U.from(t).filter(ck(e)).map(rk);const mk=e=>{const t=document.createRange();try{t.setStart(e.start.dom,e.soffset);t.setEnd(e.finish.dom,e.foffset);return U.some(t)}catch(e){return U.none()}};const gk=e=>{const t=ik(e)?uk(yn.fromDom(e.getBody())):U.none();e.bookmark=t.isSome()?t:e.bookmark};const pk=e=>{const t=e.bookmark?e.bookmark:U.none();return t.bind((t=>fk(yn.fromDom(e.getBody()),t))).bind(mk)};const hk=e=>{pk(e).each((t=>e.selection.setRng(t)))};const yk=e=>{const t=e.className.toString();return t.indexOf("tox-")!==-1||t.indexOf("mce-")!==-1};const bk={isEditorUIElement:yk};const vk=(e,t)=>{if(!O(t)){t=0}return setTimeout(e,t)};const kk=(e,t)=>{if(!O(t)){t=0}return setInterval(e,t)};const wk={setEditorTimeout:(e,t,o)=>vk((()=>{if(!e.removed){t()}}),o),setEditorInterval:(e,t,o)=>{const n=kk((()=>{if(!e.removed){t()}else{clearInterval(n)}}),o);return n}};const _k=e=>e.type==="nodechange"&&e.selectionChange;const xk=(e,t)=>{const o=()=>{t.throttle()};zi.DOM.bind(document,"mouseup",o);e.on("remove",(()=>{zi.DOM.unbind(document,"mouseup",o)}))};const Ck=(e,t)=>{e.on("mouseup touchend",(e=>{t.throttle()}))};const Sk=(e,t)=>{Ck(e,t);e.on("keyup NodeChange AfterSetSelectionRange",(t=>{if(!_k(t)){gk(e)}}))};const zk=e=>{const t=Gi((()=>{gk(e)}),0);e.on("init",(()=>{if(e.inline){xk(e,t)}Sk(e,t)}));e.on("remove",(()=>{t.cancel()}))};let Tk;const Ek=zi.DOM;const Ok=e=>_r(e)&&bk.isEditorUIElement(e);const Ak=e=>{const t=e.classList;if(t!==undefined){return t.contains("tox-edit-area")||t.contains("tox-edit-area__iframe")||t.contains("mce-content-body")}else{return false}};const Dk=(e,t)=>{const o=pm(e);const n=Ek.getParent(t,(t=>Ok(t)||(o?e.dom.is(t,o):false)));return n!==null};const Nk=e=>{try{const t=Wn(yn.fromDom(e.getElement()));return ok(t).fold((()=>document.body),(e=>e.dom))}catch(e){return document.body}};const Mk=(e,t)=>{const o=t.editor;zk(o);const n=(e,t)=>{if(ng(e)&&e.inline!==true){const o=yn.fromDom(e.getContainer());t(o,"tox-edit-focus")}};o.on("focusin",(()=>{const t=e.focusedEditor;if(Ak(Nk(o))){n(o,an)}if(t!==o){if(t){t.dispatch("blur",{focusedEditor:o})}e.setActive(o);e.focusedEditor=o;o.dispatch("focus",{blurredEditor:t});o.focus(true)}}));o.on("focusout",(()=>{wk.setEditorTimeout(o,(()=>{const t=e.focusedEditor;if(!Ak(Nk(o))||t!==o){n(o,ln)}if(!Dk(o,Nk(o))&&t===o){o.dispatch("blur",{focusedEditor:null});e.focusedEditor=null}}))}));if(!Tk){Tk=t=>{const o=e.activeEditor;if(o){Xn(t).each((t=>{const n=t;if(n.ownerDocument===document){if(n!==document.body&&!Dk(o,n)&&e.focusedEditor===o){o.dispatch("blur",{focusedEditor:null});e.focusedEditor=null}}}))}};Ek.bind(document,"focusin",Tk)}};const Rk=(e,t)=>{if(e.focusedEditor===t.editor){e.focusedEditor=null}if(!e.activeEditor&&Tk){Ek.unbind(document,"focusin",Tk);Tk=null}};const Bk=e=>{e.on("AddEditor",H(Mk,e));e.on("RemoveEditor",H(Rk,e))};const Lk=(e,t)=>e.dom.getParent(t,(t=>e.dom.getContentEditable(t)==="true"));const Hk=e=>e.collapsed?U.from(zd(e.startContainer,e.startOffset)).map(yn.fromDom):U.none();const Ik=(e,t)=>Hk(t).bind((t=>{if(Fl(t)){return U.some(t)}else if(!Cn(e,t)){return U.some(e)}else{return U.none()}}));const Pk=(e,t)=>{Ik(yn.fromDom(e.getBody()),t).bind((e=>Zp(e.dom))).fold((()=>{e.selection.normalize()}),(t=>e.selection.setRng(t.toRange())))};const Fk=e=>{if(e.setActive){try{e.setActive()}catch(t){e.focus()}}else{e.focus()}};const Vk=e=>tk(e)||nk(e).isSome();const jk=e=>T(e.iframeElement)&&tk(yn.fromDom(e.iframeElement));const Zk=e=>{const t=e.getBody();return t&&Vk(yn.fromDom(t))};const Uk=e=>{const t=Wn(yn.fromDom(e.getElement()));return ok(t).filter((t=>!Ak(t.dom)&&Dk(e,t.dom))).isSome()};const qk=e=>e.inline?Zk(e):jk(e);const Wk=e=>qk(e)||Uk(e);const $k=e=>{const t=e.selection;const o=e.getBody();let n=t.getRng();e.quirks.refreshContentEditable();const s=e=>{pk(e).each((t=>{e.selection.setRng(t);n=t}))};if(!qk(e)&&e.hasEditableRoot()){s(e)}const r=Lk(e,t.getNode());if(r&&e.dom.isChildOf(r,o)){Fk(r);if(!e.hasEditableRoot()){s(e)}Pk(e,n);Gk(e);return}if(!e.inline){if(!to.browser.isOpera()){Fk(o)}e.getWin().focus()}if(to.browser.isFirefox()||e.inline){Fk(o);Pk(e,n)}Gk(e)};const Gk=e=>e.editorManager.setActive(e);const Kk=(e,t)=>{if(e.removed){return}if(t){Gk(e)}else{$k(e)}};const Yk=(e,t)=>{if(t.collapsed){return e.isEditable(t.startContainer)}else{return e.isEditable(t.startContainer)&&e.isEditable(t.endContainer)}};const Xk=(e,t,o,n,s)=>{const r=o?t.startContainer:t.endContainer;const a=o?t.startOffset:t.endOffset;return U.from(r).map(yn.fromDom).map((e=>!n||!t.collapsed?In(e,s(e,a)).getOr(e):e)).bind((e=>Io(e)?U.some(e):On(e).filter(Io))).map((e=>e.dom)).getOr(e)};const Jk=(e,t,o=false)=>Xk(e,t,true,o,((e,t)=>Math.min(Vn(e),t)));const Qk=(e,t,o=false)=>Xk(e,t,false,o,((e,t)=>t>0?t-1:t));const ew=(e,t)=>{const o=e;while(e&&Rr(e)&&e.length===0){e=t?e.nextSibling:e.previousSibling}return e||o};const tw=(e,t)=>{if(!t){return e}let o=t.startContainer;let n=t.endContainer;const s=t.startOffset;const r=t.endOffset;let a=t.commonAncestorContainer;if(!t.collapsed){if(o===n){if(r-s<2){if(o.hasChildNodes()){a=o.childNodes[s]}}}if(Rr(o)&&Rr(n)){if(o.length===s){o=ew(o.nextSibling,true)}else{o=o.parentNode}if(r===0){n=ew(n.previousSibling,false)}else{n=n.parentNode}if(o&&o===n){a=o}}}const c=Rr(a)?a.parentNode:a;return xr(c)?c:e};const ow=(e,t,o,n)=>{const s=[];const r=e.getRoot();const a=e.getParent(o||Jk(r,t,t.collapsed),e.isBlock);const c=e.getParent(n||Qk(r,t,t.collapsed),e.isBlock);if(a&&a!==r){s.push(a)}if(a&&c&&a!==c){let t;const o=new ir(a,r);while((t=o.next())&&t!==c){if(e.isBlock(t)){s.push(t)}}}if(c&&a!==c&&c!==r){s.push(c)}return s};const nw=(e,t,o)=>U.from(t).bind((t=>U.from(t.parentNode).map((n=>{const s=e.nodeIndex(t);const r=e.createRng();r.setStart(n,s);r.setEnd(n,s+1);if(o){Mh(e,r,t,true);Mh(e,r,t,false)}return r}))));const sw=(e,t)=>J(t,(t=>{const o=e.dispatch("GetSelectionRange",{range:t});return o.range!==t?o.range:t}));const rw={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};const aw=(e,t,o)=>{const n=o?"lastChild":"firstChild";const s=o?"prev":"next";if(e[n]){return e[n]}if(e!==t){let o=e[s];if(o){return o}for(let n=e.parent;n&&n!==t;n=n.parent){o=n[s];if(o){return o}}}return undefined};const cw=e=>{var t;const o=(t=e.value)!==null&&t!==void 0?t:"";if(!gr(o)){return false}const n=e.parent;if(n&&(n.name!=="span"||n.attr("style"))&&/^[ ]+$/.test(o)){return false}return true};const iw=e=>{const t=e.name==="a"&&!e.attr("href")&&e.attr("id");return e.attr("name")||e.attr("id")&&!e.firstChild||e.attr("data-mce-bookmark")||t};class lw{static create(e,t){const o=new lw(e,rw[e]||1);if(t){xe(t,((e,t)=>{o.attr(t,e)}))}return o}constructor(e,t){this.name=e;this.type=t;if(t===1){this.attributes=[];this.attributes.map={}}}replace(e){const t=this;if(e.parent){e.remove()}t.insert(e,t);t.remove();return t}attr(e,t){const o=this;if(!v(e)){if(T(e)){xe(e,((e,t)=>{o.attr(t,e)}))}return o}const n=o.attributes;if(n){if(t!==undefined){if(t===null){if(e in n.map){delete n.map[e];let t=n.length;while(t--){if(n[t].name===e){n.splice(t,1);return o}}}return o}if(e in n.map){let o=n.length;while(o--){if(n[o].name===e){n[o].value=t;break}}}else{n.push({name:e,value:t})}n.map[e]=t;return o}return n.map[e]}return undefined}clone(){const e=this;const t=new lw(e.name,e.type);const o=e.attributes;if(o){const e=[];e.map={};for(let t=0,n=o.length;t<n;t++){const n=o[t];if(n.name!=="id"){e[e.length]={name:n.name,value:n.value};e.map[n.name]=n.value}}t.attributes=e}t.value=e.value;return t}wrap(e){const t=this;if(t.parent){t.parent.insert(e,t);e.append(t)}return t}unwrap(){const e=this;for(let t=e.firstChild;t;){const o=t.next;e.insert(t,e,true);t=o}e.remove()}remove(){const e=this,t=e.parent,o=e.next,n=e.prev;if(t){if(t.firstChild===e){t.firstChild=o;if(o){o.prev=null}}else if(n){n.next=o}if(t.lastChild===e){t.lastChild=n;if(n){n.next=null}}else if(o){o.prev=n}e.parent=e.next=e.prev=null}return e}append(e){const t=this;if(e.parent){e.remove()}const o=t.lastChild;if(o){o.next=e;e.prev=o;t.lastChild=e}else{t.lastChild=t.firstChild=e}e.parent=t;return e}insert(e,t,o){if(e.parent){e.remove()}const n=t.parent||this;if(o){if(t===n.firstChild){n.firstChild=e}else if(t.prev){t.prev.next=e}e.prev=t.prev;e.next=t;t.prev=e}else{if(t===n.lastChild){n.lastChild=e}else if(t.next){t.next.prev=e}e.next=t.next;e.prev=t;t.next=e}e.parent=n;return e}getAll(e){const t=this;const o=[];for(let n=t.firstChild;n;n=aw(n,t)){if(n.name===e){o.push(n)}}return o}children(){const e=this;const t=[];for(let o=e.firstChild;o;o=o.next){t.push(o)}return t}empty(){const e=this;if(e.firstChild){const t=[];for(let o=e.firstChild;o;o=aw(o,e)){t.push(o)}let o=t.length;while(o--){const e=t[o];e.parent=e.firstChild=e.lastChild=e.next=e.prev=null}}e.firstChild=e.lastChild=null;return e}isEmpty(e,t={},o){var n;const s=this;let r=s.firstChild;if(iw(s)){return false}if(r){do{if(r.type===1){if(r.attr("data-mce-bogus")){continue}if(e[r.name]){return false}if(iw(r)){return false}}if(r.type===8){return false}if(r.type===3&&!cw(r)){return false}if(r.type===3&&r.parent&&t[r.parent.name]&&gr((n=r.value)!==null&&n!==void 0?n:"")){return false}if(o&&o(r)){return false}}while(r=aw(r,s))}return true}walk(e){return aw(this,null,e)}}const dw=mo.makeMap("NOSCRIPT STYLE SCRIPT XMP IFRAME NOEMBED NOFRAMES PLAINTEXT"," ");const uw=e=>v(e.nodeValue)&&e.nodeValue.includes(Gl);const fw=e=>`${e.length===0?"":`${J(e,(e=>`[${e}]`)).join(",")},`}[data-mce-bogus="all"]`;const mw=(e,t)=>t.querySelectorAll(fw(e));const gw=e=>document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,(e=>uw(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP));const pw=e=>document.createTreeWalker(e,NodeFilter.SHOW_TEXT,(e=>{if(uw(e)){const t=e.parentNode;return t&&Me(dw,t.nodeName)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}else{return NodeFilter.FILTER_SKIP}}));const hw=e=>gw(e).nextNode()!==null;const yw=e=>pw(e).nextNode()!==null;const bw=(e,t)=>t.querySelector(fw(e))!==null;const vw=(e,t)=>{Q(mw(e,t),(t=>{const o=yn.fromDom(t);if(Wo(o,"data-mce-bogus")==="all"){Ds(o)}else{Q(e,(e=>{if(Go(o,e)){Ko(o,e)}}))}}))};const kw=e=>{let t=e.nextNode();while(t!==null){t.nodeValue=null;t=e.nextNode()}};const ww=N(kw,gw);const _w=N(kw,pw);const xw=(e,t)=>{const o=[{condition:H(bw,t),action:H(vw,t)},{condition:hw,action:ww},{condition:yw,action:_w}];let n=e;let s=false;Q(o,(({condition:t,action:o})=>{if(t(n)){if(!s){n=e.cloneNode(true);s=true}o(n)}}));return n};const Cw=e=>{const t=sr(e,"[data-mce-bogus]");Q(t,(e=>{const t=Wo(e,"data-mce-bogus");if(t==="all"){Ds(e)}else if(Ll(e)){xs(e,yn.fromText(lr));Ds(e)}else{Ns(e)}}))};const Sw=e=>{const t=sr(e,"input");Q(t,(e=>{Ko(e,"name")}))};const zw=(e,t)=>{const o=Ef(e);const n=new RegExp(`^(<${o}[^>]*>( | |\\s| |<br \\/>|)<\\/${o}>[\r\n]*|<br \\/>[\r\n]*)$`);return t.replace(n,"")};const Tw=(e,t)=>{const o=e.getDoc();const n=Wn(yn.fromDom(e.getBody()));const s=yn.fromTag("div",o);Uo(s,"data-mce-bogus","all");hs(s,{position:"fixed",left:"-9999999px",top:"0"});Ls(s,t.innerHTML);Cw(s);Sw(s);const r=Gn(n);zs(r,s);const a=Yl(s.dom.innerText);Ds(s);return a};const Ew=(e,t,o)=>{let n;if(t.format==="raw"){n=mo.trim(Yl(xw(o,e.serializer.getTempAttrs()).innerHTML))}else if(t.format==="text"){n=Tw(e,o)}else if(t.format==="tree"){n=e.serializer.serialize(o,t)}else{n=zw(e,e.serializer.serialize(o,t))}const s=t.format!=="text"&&!jl(yn.fromDom(o));return s&&v(n)?mo.trim(n):n};const Ow=(e,t)=>U.from(e.getBody()).fold(R(t.format==="tree"?new lw("body",11):""),(o=>Ew(e,t,o)));const Aw=mo.makeMap;const Dw=e=>{const t=[];e=e||{};const o=e.indent;const n=Aw(e.indent_before||"");const s=Aw(e.indent_after||"");const r=pc.getEncodeFunc(e.entity_encoding||"raw",e.entities);const a=e.element_format!=="xhtml";return{start:(e,c,i)=>{if(o&&n[e]&&t.length>0){const e=t[t.length-1];if(e.length>0&&e!=="\n"){t.push("\n")}}t.push("<",e);if(c){for(let e=0,o=c.length;e<o;e++){const o=c[e];t.push(" ",o.name,'="',r(o.value,true),'"')}}if(!i||a){t[t.length]=">"}else{t[t.length]=" />"}if(i&&o&&s[e]&&t.length>0){const e=t[t.length-1];if(e.length>0&&e!=="\n"){t.push("\n")}}},end:e=>{let n;t.push("</",e,">");if(o&&s[e]&&t.length>0){n=t[t.length-1];if(n.length>0&&n!=="\n"){t.push("\n")}}},text:(e,o)=>{if(e.length>0){t[t.length]=o?e:r(e)}},cdata:e=>{t.push("<![CDATA[",e,"]]>")},comment:e=>{t.push("\x3c!--",e,"--\x3e")},pi:(e,n)=>{if(n){t.push("<?",e," ",r(n),"?>")}else{t.push("<?",e,"?>")}if(o){t.push("\n")}},doctype:e=>{t.push("<!DOCTYPE",e,">",o?"\n":"")},reset:()=>{t.length=0},getContent:()=>t.join("").replace(/\n$/,"")}};const Nw=(e={},t=Vc())=>{const o=Dw(e);e.validate="validate"in e?e.validate:true;const n=n=>{const s=e.validate;const r={3:e=>{var t;o.text((t=e.value)!==null&&t!==void 0?t:"",e.raw)},8:e=>{var t;o.comment((t=e.value)!==null&&t!==void 0?t:"")},7:e=>{o.pi(e.name,e.value)},10:e=>{var t;o.doctype((t=e.value)!==null&&t!==void 0?t:"")},4:e=>{var t;o.cdata((t=e.value)!==null&&t!==void 0?t:"")},11:e=>{let t=e;if(t=t.firstChild){do{a(t)}while(t=t.next)}}};o.reset();const a=e=>{var n;const c=r[e.type];if(!c){const r=e.name;const c=r in t.getVoidElements();let i=e.attributes;if(s&&i&&i.length>1){const o=[];o.map={};const n=t.getElementRule(e.name);if(n){for(let e=0,t=n.attributesOrder.length;e<t;e++){const t=n.attributesOrder[e];if(t in i.map){const e=i.map[t];o.map[t]=e;o.push({name:t,value:e})}}for(let e=0,t=i.length;e<t;e++){const t=i[e].name;if(!(t in o.map)){const e=i.map[t];o.map[t]=e;o.push({name:t,value:e})}}i=o}}o.start(r,i,c);if(ma(r)){if(v(e.value)){o.text(e.value,true)}o.end(r)}else{if(!c){let t=e.firstChild;if(t){if((r==="pre"||r==="textarea")&&t.type===3&&((n=t.value)===null||n===void 0?void 0:n[0])==="\n"){o.text("\n",true)}do{a(t)}while(t=t.next)}o.end(r)}}}else{c(e)}};if(n.type===1&&!e.inner){a(n)}else if(n.type===3){r[3](n)}else{r[11](n)}return o.getContent()};return{serialize:n}};const Mw=new Set;(()=>{const e=["margin","margin-left","margin-right","margin-top","margin-bottom","padding","padding-left","padding-right","padding-top","padding-bottom","border","border-width","border-style","border-color","background","background-attachment","background-clip","background-image","background-origin","background-position","background-repeat","background-size","float","position","left","right","top","bottom","z-index","display","transform","width","max-width","min-width","height","max-height","min-height","overflow","overflow-x","overflow-y","text-overflow","vertical-align","transition","transition-delay","transition-duration","transition-property","transition-timing-function"];Q(e,(e=>{Mw.add(e)}))})();const Rw=new Set;(()=>{const e=["background-color"];Q(e,(e=>{Rw.add(e)}))})();const Bw=["font","text-decoration","text-emphasis"];const Lw=(e,t)=>e.parseStyle(e.getAttrib(t,"style"));const Hw=(e,t)=>we(Lw(e,t));const Iw=e=>Mw.has(e);const Pw=e=>Rw.has(e);const Fw=(e,t)=>X(Hw(e,t),(e=>Iw(e)));const Vw=(e,t)=>Fw(e,t)&&X(Hw(e,t),(e=>Pw(e)));const jw=e=>oe(e,(e=>X(Bw,(t=>lt(e,t)))));const Zw=(e,t,o)=>{const n=Hw(e,t);const s=Hw(e,o);const r=n=>{var s,r;const a=(s=e.getStyle(t,n))!==null&&s!==void 0?s:"";const c=(r=e.getStyle(o,n))!==null&&r!==void 0?r:"";return pt(a)&&pt(c)&&a!==c};return X(n,(e=>{const t=t=>X(t,(t=>t===e));if(!t(s)&&t(Bw)){const e=jw(s);return X(e,r)}else{return r(e)}}))};const Uw=(e,t,o)=>U.from(o.container()).filter(Rr).exists((n=>{const s=e?0:-1;return t(n.data.charAt(o.offset()+s))}));const qw=H(Uw,true,bh);const Ww=H(Uw,false,bh);const $w=e=>{const t=e.container();return Rr(t)&&(t.data.length===0||Kl(t.data)&&Vy.isBookmarkNode(t.parentNode))};const Gw=(e,t)=>o=>np(e?0:-1,o).filter(t).isSome();const Kw=e=>Vr(e)&&ys(yn.fromDom(e),"display")==="block";const Yw=e=>Zr(e)&&!Ar(e);const Xw=Gw(true,Kw);const Jw=Gw(false,Kw);const Qw=Gw(true,Wr);const e_=Gw(false,Wr);const t_=Gw(true,Dr);const o_=Gw(false,Dr);const n_=Gw(true,Yw);const s_=Gw(false,Yw);const r_=e=>e.slice(0,-1);const a_=(e,t,o)=>{if(Cn(t,e)){return r_(Dn(e,(e=>o(e)||xn(e,t))))}else{return[]}};const c_=(e,t)=>a_(e,t,j);const i_=(e,t)=>[e].concat(c_(e,t));const l_=(e,t,o)=>Pp(e,t,o,$w);const d_=e=>t=>e.isBlock(Mo(t));const u_=(e,t,o)=>ae(i_(yn.fromDom(t.container()),e),d_(o));const f_=(e,t,o,n)=>l_(e,t.dom,o).forall((e=>u_(t,o,n).fold((()=>!op(e,o,t.dom)),(n=>!op(e,o,t.dom)&&Cn(n,yn.fromDom(e.container()))))));const m_=(e,t,o,n)=>u_(t,o,n).fold((()=>l_(e,t.dom,o).forall((e=>!op(e,o,t.dom)))),(t=>l_(e,t.dom,o).isNone()));const g_=H(m_,false);const p_=H(m_,true);const h_=H(f_,false);const y_=H(f_,true);const b_=e=>fp(e).exists(Ll);const v_=(e,t,o,n)=>{const s=oe(i_(yn.fromDom(o.container()),t),(e=>n.isBlock(Mo(e))));const r=he(s).getOr(t);return Hp(e,r.dom,o).filter(b_)};const k_=(e,t,o)=>fp(t).exists(Ll)||v_(true,e,t,o).isSome();const w_=(e,t,o)=>mp(t).exists(Ll)||v_(false,e,t,o).isSome();const __=H(v_,false);const x_=H(v_,true);const C_=e=>mu.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd();const S_=(e,t,o)=>{const n=oe(i_(yn.fromDom(t.container()),e),(e=>o.isBlock(Mo(e))));return he(n).getOr(e)};const z_=(e,t,o)=>{if(C_(t)){return Ww(t)}else{return Ww(t)||jp(S_(e,t,o).dom,t).exists(Ww)}};const T_=(e,t,o)=>{if(C_(t)){return qw(t)}else{return qw(t)||Vp(S_(e,t,o).dom,t).exists(qw)}};const E_=e=>Y(["pre","pre-wrap"],e);const O_=e=>fp(e).bind((e=>os(e,Io))).exists((e=>E_(ys(e,"white-space"))));const A_=(e,t)=>jp(e.dom,t).isNone();const D_=(e,t)=>Vp(e.dom,t).isNone();const N_=(e,t,o)=>A_(e,t)||D_(e,t)||g_(e,t,o)||p_(e,t,o)||w_(e,t,o)||k_(e,t,o);const M_=e=>T(e)&&Zr(e)&&Ug(e);const R_=(e,t)=>o=>M_(new ir(o,e)[t]());const B_=(e,t)=>{const o=Vp(e.dom,t).getOr(t);const n=R_(e.dom,"next");return t.isAtEnd()&&(n(t.container())||n(o.container()))};const L_=(e,t)=>{const o=jp(e.dom,t).getOr(t);const n=R_(e.dom,"prev");return t.isAtStart()&&(n(t.container())||n(o.container()))};const H_=(e,t,o)=>{if(O_(t)){return false}else{return N_(e,t,o)||z_(e,t,o)||T_(e,t,o)}};const I_=(e,t,o)=>{if(O_(t)){return false}else{return g_(e,t,o)||h_(e,t,o)||w_(e,t,o)||z_(e,t,o)||L_(e,t)}};const P_=e=>{const t=e.container();const o=e.offset();if(Rr(t)&&o<t.data.length){return mu(t,o+1)}else{return e}};const F_=(e,t,o)=>{if(O_(t)){return false}else{return p_(e,t,o)||y_(e,t,o)||k_(e,t,o)||T_(e,t,o)||B_(e,t)}};const V_=(e,t,o)=>I_(e,t,o)||F_(e,P_(t),o);const j_=(e,t)=>yh(e.charAt(t));const Z_=(e,t)=>bh(e.charAt(t));const U_=e=>{const t=e.container();return Rr(t)&&it(t.data,dr)};const q_=e=>{const t=e.split("");return J(t,((e,o)=>{if(yh(e)&&o>0&&o<t.length-1&&vh(t[o-1])&&vh(t[o+1])){return" "}else{return e}})).join("")};const W_=(e,t,o,n)=>{const s=t.data;const r=mu(t,0);if(!o&&j_(s,0)&&!V_(e,r,n)){t.data=" "+s.slice(1);return true}else if(o&&Z_(s,0)&&I_(e,r,n)){t.data=dr+s.slice(1);return true}else{return false}};const $_=e=>{const t=e.data;const o=q_(t);if(o!==t){e.data=o;return true}else{return false}};const G_=(e,t,o,n)=>{const s=t.data;const r=mu(t,s.length-1);if(!o&&j_(s,s.length-1)&&!V_(e,r,n)){t.data=s.slice(0,-1)+" ";return true}else if(o&&Z_(s,s.length-1)&&F_(e,r,n)){t.data=s.slice(0,-1)+dr;return true}else{return false}};const K_=(e,t,o)=>{const n=t.container();if(!Rr(n)){return U.none()}if(U_(t)){const s=W_(e,n,false,o)||$_(n)||G_(e,n,false,o);return vo(s,t)}else if(V_(e,t,o)){const s=W_(e,n,true,o)||G_(e,n,true,o);return vo(s,t)}else{return U.none()}};const Y_=e=>{const t=yn.fromDom(e.getBody());if(e.selection.isCollapsed()){K_(t,mu.fromRangeStart(e.selection.getRng()),e.schema).each((t=>{e.selection.setRng(t.toRange())}))}};const X_=(e,t,o,n)=>{if(o===0){return}const s=yn.fromDom(e);const r=ts(s,(e=>n.isBlock(Mo(e)))).getOr(s);const a=e.data.slice(t,t+o);const c=t+o>=e.data.length&&F_(r,mu(e,e.data.length),n);const i=t===0&&I_(r,mu(e,0),n);e.replaceData(t,o,vr(a,4,i,c))};const J_=(e,t,o)=>{const n=e.data.slice(t);const s=n.length-mt(n).length;X_(e,t,s,o)};const Q_=(e,t,o)=>{const n=e.data.slice(0,t);const s=n.length-gt(n).length;X_(e,t-s,s,o)};const ex=(e,t,o,n,s=true)=>{const r=gt(e.data).length;const a=s?e:t;const c=s?t:e;if(s){a.appendData(c.data)}else{a.insertData(0,c.data)}Ds(yn.fromDom(c));if(n){J_(a,r,o)}return a};const tx=(e,t)=>{const o=e.container();const n=e.offset();return!mu.isTextPosition(e)&&o===t.parentNode&&n>mu.before(t).offset()};const ox=(e,t)=>tx(t,e)?mu(t.container(),t.offset()-1):t;const nx=e=>Rr(e)?mu(e,0):mu.before(e);const sx=e=>Rr(e)?mu(e,e.data.length):mu.after(e);const rx=e=>{if(Fd(e.previousSibling)){return U.some(sx(e.previousSibling))}else{return e.previousSibling?Up(e.previousSibling):U.none()}};const ax=e=>{if(Fd(e.nextSibling)){return U.some(nx(e.nextSibling))}else{return e.nextSibling?Zp(e.nextSibling):U.none()}};const cx=(e,t)=>U.from(t.previousSibling?t.previousSibling:t.parentNode).bind((t=>jp(e,mu.before(t)))).orThunk((()=>Vp(e,mu.after(t))));const ix=(e,t)=>Vp(e,mu.after(t)).orThunk((()=>jp(e,mu.before(t))));const lx=(e,t)=>rx(t).orThunk((()=>ax(t))).orThunk((()=>cx(e,t)));const dx=(e,t)=>ax(t).orThunk((()=>rx(t))).orThunk((()=>ix(e,t)));const ux=(e,t,o)=>e?dx(t,o):lx(t,o);const fx=(e,t,o)=>ux(e,t,o).map(H(ox,o));const mx=(e,t,o)=>{o.fold((()=>{e.focus()}),(o=>{e.selection.setRng(o.toRange(),t)}))};const gx=e=>t=>t.dom===e;const px=(e,t)=>t&&Me(e.schema.getBlockElements(),Mo(t));const hx=(e,t,o)=>{if(aa(e,t)){const e=yn.fromHtml('<br data-mce-bogus="1">');if(o){Q(Hn(t),(e=>{if(!my(e)){Ds(e)}}))}else{As(t)}zs(t,e);return U.some(mu.before(e.dom))}else{return U.none()}};const yx=(e,t,o,n)=>{const s=Mn(e).filter(Po);const r=Rn(e).filter(Po);Ds(e);return bo(s,r,t,((e,t,s)=>{const r=e.dom,a=t.dom;const c=r.data.length;ex(r,a,o,n);return s.container()===a?mu(r,c):s})).orThunk((()=>{if(n){s.each((e=>Q_(e.dom,e.dom.length,o)));r.each((e=>J_(e.dom,0,o)))}return t}))};const bx=(e,t)=>Me(e.schema.getTextInlineElements(),Mo(t));const vx=(e,t,o,n=true,s=false)=>{const r=fx(t,e.getBody(),o.dom);const a=ts(o,H(px,e),gx(e.getBody()));const c=yx(o,r,e.schema,bx(e,o));if(e.dom.isEmpty(e.getBody())){e.setContent("");e.selection.setCursorLocation()}else{a.bind((t=>hx(e.schema,t,s))).fold((()=>{if(n){mx(e,t,c)}}),(o=>{if(n){mx(e,t,U.some(o))}}))}};const kx=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/;const wx=e=>kx.test(e);const _x=(e,t)=>vn(yn.fromDom(t),em(e))&&!Ma(e.schema,t)&&e.dom.isEditable(t);const xx=e=>{var t;return zi.DOM.getStyle(e,"direction",true)==="rtl"||wx((t=e.textContent)!==null&&t!==void 0?t:"")};const Cx=(e,t,o)=>oe(zi.DOM.getParents(o.container(),"*",t),e);const Sx=(e,t,o)=>{const n=Cx(e,t,o);return U.from(n[n.length-1])};const zx=(e,t,o)=>{const n=tp(t,e);const s=tp(o,e);return T(n)&&n===s};const Tx=e=>rd(e)||ad(e);const Ex=(e,t)=>{const o=t.container(),n=t.offset();if(e){if(td(o)){if(Rr(o.nextSibling)){return mu(o.nextSibling,0)}else{return mu.after(o)}}else{return rd(t)?mu(o,n+1):t}}else{if(td(o)){if(Rr(o.previousSibling)){return mu(o.previousSibling,o.previousSibling.data.length)}else{return mu.before(o)}}else{return ad(t)?mu(o,n-1):t}}};const Ox=H(Ex,true);const Ax=H(Ex,false);const Dx=(e,t)=>{const o=e=>e.stopImmediatePropagation();e.on("beforeinput input",o,true);e.getDoc().execCommand(t);e.off("beforeinput input",o)};const Nx=e=>{e.execCommand("delete")};const Mx=e=>Dx(e,"Delete");const Rx=e=>Dx(e,"ForwardDelete");const Bx=e=>t=>go(On(t),e,xn);const Lx=e=>Hl(e)||Pl(e);const Hx=(e,t)=>{if(Cn(e,t)){return os(t,Lx,Bx(e))}else{return U.none()}};const Ix=(e,t=true)=>{if(e.dom.isEmpty(e.getBody())){e.setContent("",{no_selection:!t})}};const Px=(e,t,o)=>yo(Zp(o),Up(o),((n,s)=>{const r=Ex(true,n);const a=Ex(false,s);const c=Ex(false,t);if(e){return Vp(o,c).exists((e=>e.isEqual(a)&&t.isEqual(r)))}else{return jp(o,c).exists((e=>e.isEqual(r)&&t.isEqual(a)))}})).getOr(true);const Fx=e=>{const t=Lo(e)?Mn(e):Fn(e);return t.bind(Fx).orThunk((()=>U.some(e)))};const Vx=(e,t,o,n=true)=>{var s;t.deleteContents();const r=Fx(o).getOr(o);const a=yn.fromDom((s=e.dom.getParent(r.dom,e.dom.isBlock))!==null&&s!==void 0?s:o.dom);if(a.dom===e.getBody()){Ix(e,n)}else if(aa(e.schema,a,{checkRootAsContent:false})){Wl(a);if(n){e.selection.setCursorLocation(a.dom,0)}}if(!xn(o,a)){const t=go(On(a),o)?[]:Nn(a);Q(t.concat(Hn(o)),(t=>{if(!xn(t,a)&&!Cn(t,a)&&aa(e.schema,t)){Ds(t)}}))}};const jx=e=>t=>xn(e,t);const Zx=e=>sr(e,"td,th");const Ux=(e,t)=>Th(yn.fromDom(e),t);const qx=e=>yo(e.startTable,e.endTable,((t,o)=>{const n=cr(t,(e=>xn(e,o)));const s=cr(o,(e=>xn(e,t)));return!n&&!s?e:{...e,startTable:n?U.none():e.startTable,endTable:s?U.none():e.endTable,isSameTable:false,isMultiTable:false}})).getOr(e);const Wx=e=>qx(e);const $x=(e,t)=>{const o=Ux(e.startContainer,t);const n=Ux(e.endContainer,t);const s=o.isSome();const r=n.isSome();const a=yo(o,n,xn).getOr(false);const c=!a&&s&&r;return Wx({startTable:o,endTable:n,isStartInTable:s,isEndInTable:r,isSameTable:a,isMultiTable:c})};const Gx=(e,t)=>({start:e,end:t});const Kx=(e,t,o)=>({rng:e,table:t,cells:o});const Yx=Qu.generate([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]);const Xx=(e,t)=>is(yn.fromDom(e),"td,th",t);const Jx=e=>!xn(e.start,e.end);const Qx=(e,t)=>Th(e.start,t).bind((o=>Th(e.end,t).bind((e=>vo(xn(o,e),o)))));const eC=(e,t)=>!Jx(e)&&Qx(e,t).exists((e=>{const t=e.dom.rows;return t.length===1&&t[0].cells.length===1}));const tC=(e,t)=>{const o=Xx(e.startContainer,t);const n=Xx(e.endContainer,t);return yo(o,n,Gx)};const oC=e=>t=>Th(t,e).bind((e=>ye(Zx(e)).map((e=>Gx(t,e)))));const nC=e=>t=>Th(t,e).bind((e=>he(Zx(e)).map((e=>Gx(e,t)))));const sC=e=>t=>Qx(t,e).map((e=>Kx(t,e,Zx(e))));const rC=(e,t,o,n)=>{if(o.collapsed||!e.forall(Jx)){return U.none()}else if(t.isSameTable){const t=e.bind(sC(n));return U.some({start:t,end:t})}else{const e=Xx(o.startContainer,n);const t=Xx(o.endContainer,n);const s=e.bind(oC(n)).bind(sC(n));const r=t.bind(nC(n)).bind(sC(n));return U.some({start:s,end:r})}};const aC=(e,t)=>ce(e,(e=>xn(e,t)));const cC=e=>yo(aC(e.cells,e.rng.start),aC(e.cells,e.rng.end),((t,o)=>e.cells.slice(t,o+1)));const iC=(e,t,o)=>e.exists((e=>eC(e,o)&&Nh(e.start,t)));const lC=(e,t)=>{const{startTable:o,endTable:n}=t;const s=e.cloneRange();o.each((e=>s.setStartAfter(e.dom)));n.each((e=>s.setEndBefore(e.dom)));return s};const dC=(e,t,o,n)=>rC(e,t,o,n).bind((({start:e,end:t})=>e.or(t))).bind((e=>{const{isSameTable:n}=t;const s=cC(e).getOr([]);if(n&&e.cells.length===s.length){return U.some(Yx.fullTable(e.table))}else if(s.length>0){if(n){return U.some(Yx.partialTable(s,U.none()))}else{const e=lC(o,t);return U.some(Yx.partialTable(s,U.some({...t,rng:e})))}}else{return U.none()}}));const uC=(e,t,o,n)=>rC(e,t,o,n).bind((({start:e,end:n})=>{const s=e.bind(cC).getOr([]);const r=n.bind(cC).getOr([]);if(s.length>0&&r.length>0){const e=lC(o,t);return U.some(Yx.multiTable(s,r,e))}else{return U.none()}}));const fC=(e,t)=>{const o=jx(e);const n=tC(t,o);const s=$x(t,o);if(iC(n,t,o)){return n.map((e=>Yx.singleCellTable(t,e.start)))}else if(s.isMultiTable){return uC(n,s,t,o)}else{return dC(n,s,t,o)}};const mC=e=>Q(e,(e=>{Ko(e,"contenteditable");Wl(e)}));const gC=(e,t)=>U.from(e.dom.getParent(t,e.dom.isBlock)).map(yn.fromDom);const pC=(e,t,o)=>{o.each((o=>{if(t){Ds(o)}else{Wl(o);e.selection.setCursorLocation(o.dom,0)}}))};const hC=(e,t,o,n)=>{const s=o.cloneRange();if(n){s.setStart(o.startContainer,o.startOffset);s.setEndAfter(t.dom.lastChild)}else{s.setStartBefore(t.dom.firstChild);s.setEnd(o.endContainer,o.endOffset)}kC(e,s,t,false).each((e=>e()))};const yC=e=>{const t=zh(e);const o=yn.fromDom(e.selection.getNode());if(Ur(o.dom)&&aa(e.schema,o)){e.selection.setCursorLocation(o.dom,0)}else{e.selection.collapse(true)}if(t.length>1&&X(t,(e=>xn(e,o)))){Uo(o,"data-mce-selected","1")}};const bC=(e,t,o)=>U.some((()=>{const n=e.selection.getRng();const s=o.bind((({rng:o,isStartInTable:s})=>{const r=gC(e,s?o.endContainer:o.startContainer);o.deleteContents();pC(e,s,r.filter(H(aa,e.schema)));const a=s?t[0]:t[t.length-1];hC(e,a,n,s);if(!aa(e.schema,a)){return U.some(s?t.slice(1):t.slice(0,-1))}else{return U.none()}})).getOr(t);mC(s);yC(e)}));const vC=(e,t,o,n)=>U.some((()=>{const s=e.selection.getRng();const r=t[0];const a=o[o.length-1];hC(e,r,s,true);hC(e,a,s,false);const c=aa(e.schema,r)?t:t.slice(1);const i=aa(e.schema,a)?o:o.slice(0,-1);mC(c.concat(i));n.deleteContents();yC(e)}));const kC=(e,t,o,n=true)=>U.some((()=>{Vx(e,t,o,n)}));const wC=(e,t)=>U.some((()=>vx(e,false,t)));const _C=(e,t,o)=>fC(t,o).bind((t=>t.fold(H(kC,e),H(wC,e),H(bC,e),H(vC,e))));const xC=(e,t)=>OC(e,t);const CC=(e,t,o,n)=>TC(t,n).fold((()=>_C(e,t,o)),(t=>xC(e,t)));const SC=(e,t,o)=>{const n=yn.fromDom(e.getBody());const s=e.selection.getRng();return o.length!==0?bC(e,o,U.none()):CC(e,n,s,t)};const zC=(e,t)=>ae(i_(t,e),Vl);const TC=(e,t)=>ae(i_(t,e),jo("caption"));const EC=(e,t,o,n,s)=>Ip(o,e.getBody(),s).bind((e=>zC(t,yn.fromDom(e.getNode())).bind((e=>xn(e,n)?U.none():U.some(D)))));const OC=(e,t)=>U.some((()=>{Wl(t);e.selection.setCursorLocation(t.dom,0)}));const AC=(e,t,o,n)=>Zp(e.dom).bind((s=>Up(e.dom).map((e=>t?o.isEqual(s)&&n.isEqual(e):o.isEqual(e)&&n.isEqual(s))))).getOr(true);const DC=(e,t)=>OC(e,t);const NC=(e,t,o)=>TC(e,yn.fromDom(o.getNode())).fold((()=>U.some(D)),(e=>vo(!xn(e,t),D)));const MC=(e,t,o,n,s)=>Ip(o,e.getBody(),s).fold((()=>U.some(D)),(r=>AC(n,o,s,r)?DC(e,n):NC(t,n,r)));const RC=(e,t,o,n)=>{const s=mu.fromRangeStart(e.selection.getRng());return zC(o,n).bind((n=>aa(e.schema,n,{checkRootAsContent:false})?OC(e,n):EC(e,o,t,n,s)))};const BC=(e,t,o,n)=>{const s=mu.fromRangeStart(e.selection.getRng());return aa(e.schema,n)?OC(e,n):MC(e,o,t,n,s)};const LC=(e,t)=>e?t_(t):o_(t);const HC=(e,t)=>{const o=mu.fromRangeStart(e.selection.getRng());return LC(t,o)||Hp(t,e.getBody(),o).exists((e=>LC(t,e)))};const IC=(e,t,o)=>{const n=yn.fromDom(e.getBody());return TC(n,o).fold((()=>RC(e,t,n,o).orThunk((()=>vo(HC(e,t),D)))),(o=>BC(e,t,n,o)))};const PC=(e,t)=>{const o=yn.fromDom(e.selection.getStart(true));const n=zh(e);return e.selection.isCollapsed()&&n.length===0?IC(e,t,o):SC(e,o,n)};const FC=(e,t)=>{let o=t;while(o&&o!==e){if(jr(o)||Zr(o)){return o}o=o.parentNode}return null};const VC=["data-ephox-","data-mce-","data-alloy-","data-snooker-","_"];const jC=mo.each;const ZC=e=>{const t=e.dom;const o=new Set(e.serializer.getTempAttrs());const n=(e,o)=>{if(e.nodeName!==o.nodeName||e.nodeType!==o.nodeType){return false}const n=e=>{const o={};jC(t.getAttribs(e),(n=>{const r=n.nodeName.toLowerCase();if(r!=="style"&&!s(r)){o[r]=t.getAttrib(e,r)}}));return o};const r=(e,t)=>{for(const o in e){if(Me(e,o)){const n=t[o];if(S(n)){return false}if(e[o]!==n){return false}delete t[o]}}for(const e in t){if(Me(t,e)){return false}}return true};if(_r(e)&&_r(o)){if(!r(n(e),n(o))){return false}if(!r(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(o,"style")))){return false}}return!ph(e)&&!ph(o)};const s=e=>X(VC,(t=>lt(e,t)))||o.has(e);return{compare:n,isAttributeInternal:s}};const UC=e=>["h1","h2","h3","h4","h5","h6"].includes(e.name);const qC=e=>e.name==="summary";const WC=(e,t)=>{let o=e;while(o=o.walk()){t(o)}};const $C=(e,t,o,n)=>{const s=o.name;for(let t=0,r=e.length;t<r;t++){const r=e[t];if(r.name===s){const e=n.nodes[s];if(e){e.nodes.push(o)}else{n.nodes[s]={filter:r,nodes:[o]}}}}if(o.attributes){for(let e=0,s=t.length;e<s;e++){const s=t[e];const r=s.name;if(r in o.attributes.map){const e=n.attributes[r];if(e){e.nodes.push(o)}else{n.attributes[r]={filter:s,nodes:[o]}}}}}};const GC=(e,t,o)=>{const n={nodes:{},attributes:{}};if(o.firstChild){WC(o,(o=>{$C(e,t,o,n)}))}return n};const KC=(e,t)=>{const o=(e,o)=>{xe(e,(e=>{const n=be(e.nodes);Q(e.filter.callbacks,(s=>{for(let t=n.length-1;t>=0;t--){const s=n[t];const r=o?s.attr(e.filter.name)!==undefined:s.name===e.filter.name;if(!r||z(s.parent)){n.splice(t,1)}}if(n.length>0){s(n,e.filter.name,t)}}))}))};o(e.nodes,false);o(e.attributes,true)};const YC=(e,t,o,n={})=>{const s=GC(e,t,o);KC(s,n)};const XC=(e,t,o,n)=>{const s=e.pad_empty_with_br||t.insert;if(s&&o(n)){const e=new lw("br",1);if(t.insert){e.attr("data-mce-bogus","1")}n.empty().append(e)}else{n.empty().append(new lw("#text",3)).value=dr}};const JC=e=>{var t;return QC(e,"#text")&&((t=e===null||e===void 0?void 0:e.firstChild)===null||t===void 0?void 0:t.value)===dr};const QC=(e,t)=>{const o=e===null||e===void 0?void 0:e.firstChild;return T(o)&&o===e.lastChild&&o.name===t};const eS=(e,t)=>{const o=e.getElementRule(t.name);return(o===null||o===void 0?void 0:o.paddEmpty)===true};const tS=(e,t,o,n)=>n.isEmpty(t,o,(t=>eS(e,t)));const oS=(e,t)=>T(e)&&(t(e)||e.name==="br");const nS=e=>{let t;for(let o=e;o;o=o.parent){const e=o.attr("contenteditable");if(e==="false"){break}else if(e==="true"){t=o}}return U.from(t)};const sS=(e,t,o=e.parent)=>{if(t.getSpecialElements()[e.name]){e.empty().remove()}else{const n=e.children();for(const e of n){if(o&&!t.isValidChild(o.name,e.name)){sS(e,t,o)}}e.unwrap()}};const rS=(e,t,o,n=D)=>{const s=t.getTextBlockElements();const r=t.getNonEmptyElements();const a=t.getWhitespaceElements();const c=mo.makeMap("tr,td,th,tbody,thead,tfoot,table,summary");const i=new Set;const l=e=>e!==o&&!c[e.name];for(let o=0;o<e.length;o++){const c=e[o];let d;let u;let f;if(!c.parent||i.has(c)){continue}if(s[c.name]&&c.parent.name==="li"){let e=c.next;while(e){if(s[e.name]){e.name="li";i.add(e);c.parent.insert(e,c.parent)}else{break}e=e.next}c.unwrap();continue}const m=[c];for(d=c.parent;d&&!t.isValidChild(d.name,c.name)&&l(d);d=d.parent){m.push(d)}if(d&&m.length>1){if(!cS(t,c,d)){m.reverse();u=m[0].clone();n(u);let e=u;for(let o=0;o<m.length-1;o++){if(t.isValidChild(e.name,m[o].name)&&o>0){f=m[o].clone();n(f);e.append(f)}else{f=e}for(let e=m[o].firstChild;e&&e!==m[o+1];){const t=e.next;f.append(e);e=t}e=f}if(!tS(t,r,a,u)){d.insert(u,m[0],true);d.insert(c,u)}else{d.insert(c,m[0],true)}d=m[0];if(tS(t,r,a,d)||QC(d,"br")){d.empty().remove()}}else{sS(c,t)}}else if(c.parent){if(c.name==="li"){let e=c.prev;if(e&&(e.name==="ul"||e.name==="ol")){e.append(c);continue}e=c.next;if(e&&(e.name==="ul"||e.name==="ol")&&e.firstChild){e.insert(c,e.firstChild,true);continue}const t=new lw("ul",1);n(t);c.wrap(t);continue}if(t.isValidChild(c.parent.name,"div")&&t.isValidChild("div",c.name)){const e=new lw("div",1);n(e);c.wrap(e)}else{sS(c,t)}}}};const aS=(e,t)=>{let o=e;while(o){if(o.name===t){return true}o=o.parent}return false};const cS=(e,t,o=t.parent)=>{if(!o){return false}if(e.children[t.name]&&!e.isValidChild(o.name,t.name)){return true}if(t.name==="a"&&aS(o,"a")){return true}if(qC(o)&&UC(t)){return!((o===null||o===void 0?void 0:o.firstChild)===t&&(o===null||o===void 0?void 0:o.lastChild)===t)}return false};const iS=(e,t,o,n)=>{const s=document.createRange();s.setStart(e,t);s.setEnd(o,n);return s};const lS=e=>{const t=mu.fromRangeStart(e);const o=mu.fromRangeEnd(e);const n=e.commonAncestorContainer;return Hp(false,n,o).map((s=>{if(!op(t,o,n)&&op(t,s,n)){return iS(t.container(),t.offset(),s.container(),s.offset())}else{return e}})).getOr(e)};const dS=e=>e.collapsed?e:lS(e);const uS=e=>T(e.firstChild)&&e.firstChild===e.lastChild;const fS=e=>e.name==="br"||e.value===dr;const mS=(e,t)=>{const o=e.getBlockElements();return o[t.name]&&uS(t)&&fS(t.firstChild)};const gS=(e,t)=>{const o=e.getNonEmptyElements();return T(t)&&(t.isEmpty(o)||mS(e,t))};const pS=(e,t)=>{let o=t.firstChild;let n=t.lastChild;if(o&&o.name==="meta"){o=o.next}if(n&&n.attr("id")==="mce_marker"){n=n.prev}if(gS(e,n)){n=n===null||n===void 0?void 0:n.prev}if(!o||o!==n){return false}return o.name==="ul"||o.name==="ol"};const hS=e=>{var t,o;const n=e.firstChild;const s=e.lastChild;if(n&&n.nodeName==="META"){(t=n.parentNode)===null||t===void 0?void 0:t.removeChild(n)}if(s&&s.id==="mce_marker"){(o=s.parentNode)===null||o===void 0?void 0:o.removeChild(s)}return e};const yS=(e,t,o)=>{const n=t.serialize(o);const s=e.createFragment(n);return hS(s)};const bS=e=>{var t;return oe((t=e===null||e===void 0?void 0:e.childNodes)!==null&&t!==void 0?t:[],(e=>e.nodeName==="LI"))};const vS=e=>e.data===dr||Fr(e);const kS=e=>T(e===null||e===void 0?void 0:e.firstChild)&&e.firstChild===e.lastChild&&vS(e.firstChild);const wS=e=>!e.firstChild||kS(e);const _S=e=>e.length>0&&wS(e[e.length-1])?e.slice(0,-1):e;const xS=(e,t)=>{const o=e.getParent(t,e.isBlock);return o&&o.nodeName==="LI"?o:null};const CS=(e,t)=>!!xS(e,t);const SS=(e,t)=>{const o=t.cloneRange();const n=t.cloneRange();o.setStartBefore(e);n.setEndAfter(e);return[o.cloneContents(),n.cloneContents()]};const zS=(e,t)=>{const o=mu.before(e);const n=Op(t);const s=n.next(o);return s?s.toRange():null};const TS=(e,t)=>{const o=mu.after(e);const n=Op(t);const s=n.prev(o);return s?s.toRange():null};const ES=(e,t,o,n)=>{const s=SS(e,n);const r=e.parentNode;if(r){r.insertBefore(s[0],e);mo.each(t,(t=>{r.insertBefore(t,e)}));r.insertBefore(s[1],e);r.removeChild(e)}return TS(t[t.length-1],o)};const OS=(e,t,o)=>{const n=e.parentNode;if(n){mo.each(t,(t=>{n.insertBefore(t,e)}))}return zS(e,o)};const AS=(e,t,o,n)=>{n.insertAfter(t.reverse(),e);return TS(t[0],o)};const DS=(e,t,o,n)=>{const s=yS(t,e,n);const r=xS(t,o.startContainer);const a=_S(bS(s.firstChild));const c=1,i=2;const l=t.getRoot();const d=e=>{const n=mu.fromRangeStart(o);const s=Op(t.getRoot());const a=e===c?s.prev(n):s.next(n);const i=a===null||a===void 0?void 0:a.getNode();return i?xS(t,i)!==r:true};if(!r){return null}else if(d(c)){return OS(r,a,l)}else if(d(i)){return AS(r,a,l,t)}else{return ES(r,a,l,o)}};const NS=["pre"];const MS=(e,t,o,n)=>{var s;const r=t.firstChild;const a=t.lastChild;const c=a.attr("data-mce-type")==="bookmark"?a.prev:a;const i=r===c;const l=Y(NS,r.name);if(i&&l){const t=r.attr("contenteditable")!=="false";const a=((s=e.getParent(o,e.isBlock))===null||s===void 0?void 0:s.nodeName.toLowerCase())===r.name;const c=U.from(FC(n,o)).forall(jr);return t&&a&&c}else{return false}};const RS=Ur;const BS=(e,t,o)=>{if(T(o)){const n=e.getParent(t.endContainer,RS);return o===n&&Nh(yn.fromDom(o),t)}else{return false}};const LS=(e,t,o)=>{var n;if(o.getAttribute("data-mce-bogus")==="all"){(n=o.parentNode)===null||n===void 0?void 0:n.insertBefore(e.dom.createFragment(t),o)}else{const n=o.firstChild;const s=o.lastChild;if(!n||n===s&&n.nodeName==="BR"){e.dom.setHTML(o,t)}else{e.selection.setContent(t,{no_events:true})}}};const HS=(e,t,o)=>{U.from(e.getParent(t,"td,th")).map(yn.fromDom).each((e=>$l(e,o)))};const IS=(e,t)=>{const o=e.schema.getTextInlineElements();const n=e.dom;if(t){const t=e.getBody();const s=ZC(e);const r="*[data-mce-fragment]";const a=n.select(r);mo.each(a,(e=>{const a=e=>T(o[e.nodeName.toLowerCase()]);const c=e=>e.childNodes.length===1;const i=e=>!(Fw(n,e)||Vw(n,e));if(i(e)&&a(e)&&c(e)){const o=Hw(n,e);const i=(e,t)=>de(e,(e=>Y(t,e)));const l=t=>c(e)&&n.is(t,r)&&a(t)&&(t.nodeName===e.nodeName&&i(o,Hw(n,t))||l(t.children[0]));const d=o=>T(o)&&o!==t&&(s.compare(e,o)||d(o.parentElement));const u=o=>T(o)&&o!==t&&n.is(o,r)&&(Zw(n,e,o)||u(o.parentElement));if(l(e.children[0])||d(e.parentElement)&&!u(e.parentElement)){n.remove(e,true)}}}))}};const PS=e=>{let t=e;while(t=t.walk()){if(t.type===1){t.attr("data-mce-fragment","1")}}};const FS=e=>{mo.each(e.getElementsByTagName("*"),(e=>{e.removeAttribute("data-mce-fragment")}))};const VS=e=>!!e.getAttribute("data-mce-fragment");const jS=(e,t)=>T(t)&&!e.schema.getVoidElements()[t.nodeName];const ZS=(e,t)=>{var o,n,s;let r;const a=e.dom;const c=e.selection;if(!t){return}c.scrollIntoView(t);const i=FC(e.getBody(),t);if(i&&a.getContentEditable(i)==="false"){a.remove(t);c.select(i);return}let l=a.createRng();const d=t.previousSibling;if(Rr(d)){l.setStart(d,(n=(o=d.nodeValue)===null||o===void 0?void 0:o.length)!==null&&n!==void 0?n:0);const e=t.nextSibling;if(Rr(e)){d.appendData(e.data);(s=e.parentNode)===null||s===void 0?void 0:s.removeChild(e)}}else{l.setStartBefore(t);l.setEndBefore(t)}const u=t=>{let o=mu.fromRangeStart(t);const n=Op(e.getBody());o=n.next(o);return o===null||o===void 0?void 0:o.toRange()};const f=a.getParent(t,a.isBlock);a.remove(t);if(f&&a.isEmpty(f)){const e=RS(f);As(yn.fromDom(f));l.setStart(f,0);l.setEnd(f,0);if(!e&&!VS(f)&&(r=u(l))){l=r;a.remove(f)}else{a.add(f,a.create("br",e?{}:{"data-mce-bogus":"1"}))}}c.setRng(l)};const US=e=>{const t=e.dom;const o=dS(e.selection.getRng());e.selection.setRng(o);const n=t.getParent(o.startContainer,RS);if(BS(t,o,n)){kC(e,o,yn.fromDom(n))}else if(o.startContainer===o.endContainer&&o.endOffset-o.startOffset===1&&Rr(o.startContainer.childNodes[o.startOffset])){o.deleteContents()}else{e.getDoc().execCommand("Delete",false)}};const qS=e=>{for(let t=e;t;t=t.walk()){if(t.attr("id")==="mce_marker"){return U.some(t)}}return U.none()};const WS=(e,t,o)=>{var n;return X(o.children(),UC)&&((n=e.getParent(t,e.isBlock))===null||n===void 0?void 0:n.nodeName)==="SUMMARY"};const $S=(e,t,o)=>{var n,s;const r=e.selection;const a=e.dom;const c=e.parser;const i=o.merge;const l=Nw({validate:true},e.schema);const d='<span id="mce_marker" data-mce-type="bookmark"></span>';if(!o.preserve_zwsp){t=Yl(t)}if(t.indexOf("{$caret}")===-1){t+="{$caret}"}t=t.replace(/\{\$caret\}/,d);let u=r.getRng();const f=u.startContainer;const m=e.getBody();if(f===m&&r.isCollapsed()){if(a.isBlock(m.firstChild)&&jS(e,m.firstChild)&&a.isEmpty(m.firstChild)){u=a.createRng();u.setStart(m.firstChild,0);u.setEnd(m.firstChild,0);r.setRng(u)}}if(!r.isCollapsed()){US(e)}const g=r.getNode();const p={context:g.nodeName.toLowerCase(),data:o.data,insert:true};const h=c.parse(t,p);if(o.paste===true&&pS(e.schema,h)&&CS(a,g)){u=DS(l,a,r.getRng(),h);if(u){r.setRng(u)}return t}if(o.paste===true&&MS(a,h,g,e.getBody())){(n=h.firstChild)===null||n===void 0?void 0:n.unwrap()}PS(h);let y=h.lastChild;if(y&&y.attr("id")==="mce_marker"){const t=y;for(y=y.prev;y;y=y.walk(true)){if(y.type===3||!a.isBlock(y.name)){if(y.parent&&e.schema.isValidChild(y.parent.name,"span")){y.parent.insert(t,y,y.name==="br")}break}}}e._selectionOverrides.showBlockCaretContainer(g);if(!p.invalid&&!WS(a,g,h)){t=l.serialize(h);LS(e,t,g)}else{e.selection.setContent(d);let o=r.getNode();let n;const i=e.getBody();if(Ir(o)){o=n=i}else{n=o}while(n&&n!==i){o=n;n=n.parentNode}t=o===i?i.innerHTML:a.getOuterHTML(o);const u=c.parse(t);const f=qS(u);const m=f.bind(nS).getOr(u);f.each((e=>e.replace(h)));const g=h.children();const p=(s=h.parent)!==null&&s!==void 0?s:u;h.unwrap();const y=oe(g,(t=>cS(e.schema,t,p)));rS(y,e.schema,m);YC(c.getNodeFilters(),c.getAttributeFilters(),u);t=l.serialize(u);if(o===i){a.setHTML(i,t)}else{a.setOuterHTML(o,t)}}IS(e,i);ZS(e,a.get("mce_marker"));FS(e.getBody());HS(a,r.getStart(),e.schema);Oa(e.schema,e.getBody(),r.getStart());return t};const GS=e=>e instanceof lw;const KS=e=>{if(qk(e)){Zp(e.getBody()).each((t=>{const o=t.getNode();const n=Dr(o)?Zp(o).getOr(t):t;e.selection.setRng(n.toRange())}))}};const YS=(e,t,o)=>{e.dom.setHTML(e.getBody(),t);if(o!==true){KS(e)}};const XS=(e,t,o,n)=>{o=Yl(o);if(o.length===0||/^\s+$/.test(o)){const s='<br data-mce-bogus="1">';if(t.nodeName==="TABLE"){o="<tr><td>"+s+"</td></tr>"}else if(/^(UL|OL)$/.test(t.nodeName)){o="<li>"+s+"</li>"}const r=Ef(e);if(e.schema.isValidChild(t.nodeName.toLowerCase(),r.toLowerCase())){o=s;o=e.dom.createHTML(r,Of(e),o)}else if(!o){o=s}YS(e,o,n.no_selection);return{content:o,html:o}}else{if(n.format!=="raw"){o=Nw({validate:false},e.schema).serialize(e.parser.parse(o,{isRootContent:true,insert:true}))}const s=jl(yn.fromDom(t))?o:mo.trim(o);YS(e,s,n.no_selection);return{content:s,html:s}}};const JS=(e,t,o,n)=>{YC(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),o);const s=Nw({validate:false},e.schema).serialize(o);const r=Yl(jl(yn.fromDom(t))?s:mo.trim(s));YS(e,r,n.no_selection);return{content:o,html:r}};const QS=(e,t,o)=>U.from(e.getBody()).map((n=>{if(GS(t)){return JS(e,n,t,o)}else{return XS(e,n,t,o)}})).getOr({content:t,html:GS(o.content)?"":o.content});const ez=e=>E(e)?e:j;const tz=(e,t,o)=>{let n=e.dom;const s=ez(o);while(n.parentNode){n=n.parentNode;const e=yn.fromDom(n);const o=t(e);if(o.isSome()){return o}else if(s(e)){break}}return U.none()};const oz=(e,t,o)=>{const n=t(e);const s=ez(o);return n.orThunk((()=>s(e)?U.none():tz(e,t,s)))};const nz=Yh;const sz=(e,t,o)=>{const n=e.formatter.get(o);if(n){for(let o=0;o<n.length;o++){const s=n[o];if(cy(s)&&s.inherit===false&&e.dom.is(t,s.selector)){return true}}}return false};const rz=(e,t,o,n,s)=>{const r=e.dom.getRoot();if(t===r){return false}const a=e.dom.getParent(t,(t=>{if(sz(e,t,o)){return true}return t.parentNode===r||!!iz(e,t,o,n,true)}));return!!iz(e,a,o,n,s)};const az=(e,t,o)=>{if(iy(o)&&nz(t,o.inline)){return true}if(sy(o)&&nz(t,o.block)){return true}if(cy(o)){return _r(t)&&e.is(t,o.selector)}return false};const cz=(e,t,o,n,s,r)=>{const a=o[n];const c=n==="attributes";if(E(o.onmatch)){return o.onmatch(t,o,n)}if(a){if(!He(a)){for(const n in a){if(Me(a,n)){const i=c?e.getAttrib(t,n):Jh(e,t,n);const l=Kh(a[n],r);const d=z(i)||ht(i);if(d&&z(l)){continue}if(s&&d&&!o.exact){return false}if((!s||o.exact)&&!nz(i,Xh(l,n))){return false}}}}else{for(let o=0;o<a.length;o++){if(c?e.getAttrib(t,a[o]):Jh(e,t,a[o])){return true}}}}return true};const iz=(e,t,o,n,s)=>{const r=e.formatter.get(o);const a=e.dom;if(r&&_r(t)){for(let o=0;o<r.length;o++){const c=r[o];if(az(e.dom,t,c)&&cz(a,t,c,"attributes",s,n)&&cz(a,t,c,"styles",s,n)){const o=c.classes;if(o){for(let s=0;s<o.length;s++){if(!e.dom.hasClass(t,Kh(o[s],n))){return}}}return c}}}return undefined};const lz=(e,t,o,n,s)=>{if(n){return rz(e,n,t,o,s)}n=e.selection.getNode();if(rz(e,n,t,o,s)){return true}const r=e.selection.getStart();if(r!==n){if(rz(e,r,t,o,s)){return true}}return false};const dz=(e,t,o)=>{const n=[];const s={};const r=e.selection.getStart();e.dom.getParent(r,(r=>{for(let a=0;a<t.length;a++){const c=t[a];if(!s[c]&&iz(e,r,c,o)){s[c]=true;n.push(c)}}}),e.dom.getRoot());return n};const uz=(e,t)=>{const o=t=>xn(t,yn.fromDom(e.getBody()));const n=(t,o)=>iz(e,t.dom,o)?U.some(o):U.none();return U.from(e.selection.getStart(true)).bind((e=>oz(yn.fromDom(e),(e=>ve(t,(t=>n(e,t)))),o))).getOrNull()};const fz=(e,t)=>{const o=e.formatter.get(t);const n=e.dom;if(o&&e.selection.isEditable()){const t=e.selection.getStart();const s=ey(n,t);for(let e=o.length-1;e>=0;e--){const t=o[e];if(!cy(t)){return true}for(let e=s.length-1;e>=0;e--){if(n.is(s[e],t.selector)){return true}}}}return false};const mz=(e,t,o)=>se(o,((o,n)=>{const s=oy(e,n);if(e.formatter.matchNode(t,n,{},s)){return o.concat([n])}else{return o}}),[]);const gz=Gl;const pz=(e,t)=>e.importNode(t,true);const hz=e=>{if(e){const t=new ir(e,e);for(let e=t.current();e;e=t.next()){if(Rr(e)){return e}}}return null};const yz=e=>{const t=yn.fromTag("span");qo(t,{id:qp,"data-mce-bogus":"1","data-mce-type":"format-caret"});if(e){zs(t,yn.fromText(gz))}return t};const bz=e=>{const t=hz(e);if(t&&t.data.charAt(0)===gz){t.deleteData(0,1)}return t};const vz=(e,t,o)=>{const n=e.dom,s=e.selection;if(fy(t)){vx(e,false,yn.fromDom(t),o,true)}else{const e=s.getRng();const o=n.getParent(t,n.isBlock);const r=e.startContainer;const a=e.startOffset;const c=e.endContainer;const i=e.endOffset;const l=bz(t);n.remove(t,true);if(r===l&&a>0){e.setStart(l,a-1)}if(c===l&&i>0){e.setEnd(l,i-1)}if(o&&n.isEmpty(o)){Wl(yn.fromDom(o))}s.setRng(e)}};const kz=(e,t,o)=>{const n=e.dom,s=e.selection;if(!t){t=$p(e.getBody(),s.getStart());if(!t){while(t=n.get(qp)){vz(e,t,o)}}}else{vz(e,t,o)}};const wz=(e,t,o)=>{var n,s;const r=e.dom;const a=r.getParent(o,H(Zh,e.schema));if(a&&r.isEmpty(a)){(n=o.parentNode)===null||n===void 0?void 0:n.replaceChild(t,o)}else{Ul(yn.fromDom(o));if(r.isEmpty(o)){(s=o.parentNode)===null||s===void 0?void 0:s.replaceChild(t,o)}else{r.insertAfter(t,o)}}};const _z=(e,t)=>{e.appendChild(t);return t};const xz=(e,t)=>{var o;const n=ne(e,((e,t)=>_z(e,t.cloneNode(false))),t);const s=(o=n.ownerDocument)!==null&&o!==void 0?o:document;return _z(n,s.createTextNode(gz))};const Cz=(e,t,o,n,s,r)=>{const a=e.formatter;const c=e.dom;const i=oe(we(a.get()),(e=>e!==n&&!it(e,"removeformat")));const l=mz(e,o,i);const d=oe(l,(t=>!ny(e,t,n)));if(d.length>0){const e=o.cloneNode(false);c.add(t,e);a.remove(n,s,e,r);c.remove(e);return U.some(e)}else{return U.none()}};const Sz=(e,t,o)=>{let n;const s=e.selection;const r=e.formatter.get(t);if(!r){return}const a=s.getRng();let c=a.startOffset;const i=a.startContainer;const l=i.nodeValue;n=$p(e.getBody(),s.getStart());const d=/[^\s\u00a0\u00ad\u200b\ufeff]/;if(l&&c>0&&c<l.length&&d.test(l.charAt(c))&&d.test(l.charAt(c-1))){const n=s.getBookmark();a.collapse(true);let c=Oy(e.dom,a,r);c=kv(c);e.formatter.apply(t,o,c);s.moveToBookmark(n)}else{let r=n?hz(n):null;if(!n||(r===null||r===void 0?void 0:r.data)!==gz){n=pz(e.getDoc(),yz(true).dom);r=n.firstChild;a.insertNode(n);c=1;e.formatter.apply(t,o,n)}else{e.formatter.apply(t,o,n)}s.setCursorLocation(r,c)}};const zz=(e,t,o,n)=>{const s=e.dom;const r=e.selection;let a=false;const c=e.formatter.get(t);if(!c){return}const i=r.getRng();const l=i.startContainer;const d=i.startOffset;let u=l;if(Rr(l)){if(d!==l.data.length){a=true}u=u.parentNode}const f=[];let m;while(u){if(iz(e,u,t,o,n)){m=u;break}if(u.nextSibling){a=true}f.push(u);u=u.parentNode}if(!m){return}if(a){const a=r.getBookmark();i.collapse(true);let l=Oy(s,i,c,true);l=kv(l);e.formatter.remove(t,o,l,n);r.moveToBookmark(a)}else{const a=$p(e.getBody(),m);const c=T(a)?s.getParents(m.parentNode,Z,a):[];const i=yz(false).dom;wz(e,i,a!==null&&a!==void 0?a:m);const l=Cz(e,i,m,t,o,n);const d=xz([...f,...l.toArray(),...c],i);if(a){vz(e,a,T(a))}r.setCursorLocation(d,1);if(s.isEmpty(m)){s.remove(m)}}};const Tz=(e,t,o)=>{const n=e.selection,s=e.getBody();kz(e,null,o);if((t===8||t===46)&&n.isCollapsed()&&n.getStart().innerHTML===gz){kz(e,$p(s,n.getStart()),true)}if(t===37||t===39){kz(e,$p(s,n.getStart()),true)}};const Ez=e=>Rr(e)&&dt(e.data,dr);const Oz=e=>{e.on("mouseup keydown",(t=>{Tz(e,t.keyCode,Ez(e.selection.getRng().endContainer))}))};const Az=e=>{const t=yz(false);const o=xz(e,t.dom);return{caretContainer:t,caretPosition:mu(o,0)}};const Dz=(e,t)=>{const{caretContainer:o,caretPosition:n}=Az(t);xs(yn.fromDom(e),o);Ds(yn.fromDom(e));return n};const Nz=(e,t)=>{const{caretContainer:o,caretPosition:n}=Az(t);e.insertNode(o.dom);return n};const Mz=(e,t)=>{if(Wp(t.dom)){return false}const o=e.schema.getTextInlineElements();return Me(o,Mo(t))&&!Wp(t.dom)&&!Or(t.dom)};const Rz={};const Bz=zr(["pre"]);const Lz=(e,t)=>{const o=Rz[e];if(!o){Rz[e]=[]}Rz[e].push(t)};const Hz=(e,t)=>{if(Me(Rz,e)){Q(Rz[e],(e=>{e(t)}))}};Lz("pre",(e=>{const t=e.selection.getRng();const o=e=>t=>{const o=t.previousSibling;return Bz(o)&&Y(e,o)};const n=(e,t)=>{const o=yn.fromDom(t);const n=zn(o).dom;Ds(o);Os(yn.fromDom(e),[yn.fromTag("br",n),yn.fromTag("br",n),...Hn(o)])};if(!t.collapsed){const t=e.selection.getSelectedBlocks();const s=oe(oe(t,Bz),o(t));Q(s,(e=>{n(e.previousSibling,e)}))}}));const Iz=["fontWeight","fontStyle","color","fontSize","fontFamily"];const Pz=e=>k(e.styles)&&X(we(e.styles),(e=>Y(Iz,e)));const Fz=e=>ae(e,(e=>iy(e)&&e.inline==="span"&&Pz(e)));const Vz=(e,t)=>{const o=e.get(t);return _(o)?Fz(o):U.none()};const jz=(e,t)=>jp(t,mu.fromRangeStart(e)).isNone();const Zz=(e,t)=>Vp(t,mu.fromRangeEnd(e)).exists((e=>!Fr(e.getNode())||Vp(t,e).isSome()))===false;const Uz=e=>t=>$r(t)&&e.isEditable(t);const qz=e=>{const t=e.getSelectedBlocks();const o=e.getRng();if(e.isCollapsed()){return[]}if(t.length===1){return jz(o,t[0])&&Zz(o,t[0])?t:[]}else{const e=he(t).filter((e=>jz(o,e))).toArray();const n=ye(t).filter((e=>Zz(o,e))).toArray();const s=t.slice(1,-1);return e.concat(s).concat(n)}};const Wz=e=>oe(qz(e),Uz(e.dom));const $z=e=>oe(e.getSelectedBlocks(),Uz(e.dom));const Gz=mo.each;const Kz=e=>_r(e)&&!ph(e)&&!Wp(e)&&!Or(e);const Yz=(e,t)=>{for(let o=e;o;o=o[t]){if(Rr(o)&&pt(o.data)){return e}if(_r(o)&&!ph(o)){return o}}return e};const Xz=(e,t,o)=>{const n=ZC(e);const s=xr(t)&&e.dom.isEditable(t);const r=xr(o)&&e.dom.isEditable(o);if(s&&r){const s=Yz(t,"previousSibling");const r=Yz(o,"nextSibling");if(n.compare(s,r)){for(let e=s.nextSibling;e&&e!==r;){const t=e;e=e.nextSibling;s.appendChild(t)}e.dom.remove(r);mo.each(mo.grep(r.childNodes),(e=>{s.appendChild(e)}));return s}}return o};const Jz=(e,t,o,n)=>{var s;if(n&&t.merge_siblings!==false){const t=(s=Xz(e,jh(n),n))!==null&&s!==void 0?s:n;Xz(e,t,jh(t,true))}};const Qz=(e,t,o)=>{if(t.clear_child_styles){const n=t.links?"*:not(a)":"*";Gz(e.select(n,o),(o=>{if(Kz(o)&&e.isEditable(o)){Gz(t.styles,((t,n)=>{e.setStyle(o,n,"")}))}}))}};const eT=(e,t,o)=>{Gz(e.childNodes,(e=>{if(Kz(e)){if(t(e)){o(e)}if(e.hasChildNodes()){eT(e,t,o)}}}))};const tT=(e,t)=>{if(t.nodeName==="SPAN"&&e.getAttribs(t).length===0){e.remove(t,true)}};const oT=(e,t)=>o=>!!(o&&Jh(e,o,t));const nT=(e,t,o)=>n=>{e.setStyle(n,t,o);if(n.getAttribute("style")===""){n.removeAttribute("style")}tT(e,n)};const sT=Qu.generate([{keep:[]},{rename:["name"]},{removed:[]}]);const rT=/^(src|href|style)$/;const aT=mo.each;const cT=Yh;const iT=e=>/^(TR|TH|TD)$/.test(e.nodeName);const lT=(e,t,o)=>e.isChildOf(t,o)&&t!==o&&!e.isBlock(o);const dT=(e,t,o)=>{let n=t[o?"startContainer":"endContainer"];let s=t[o?"startOffset":"endOffset"];if(_r(n)){const e=n.childNodes.length-1;if(!o&&s){s--}n=n.childNodes[s>e?e:s]}if(Rr(n)&&o&&s>=n.data.length){n=new ir(n,e.getBody()).next()||n}if(Rr(n)&&!o&&s===0){n=new ir(n,e.getBody()).prev()||n}return n};const uT=(e,t)=>{const o=t?"firstChild":"lastChild";const n=e[o];if(iT(e)&&n){if(e.nodeName==="TR"){return n[o]||n}else{return n}}return e};const fT=(e,t,o,n)=>{var s;const r=e.create(o,n);(s=t.parentNode)===null||s===void 0?void 0:s.insertBefore(r,t);r.appendChild(t);return r};const mT=(e,t,o,n,s)=>{const r=yn.fromDom(t);const a=yn.fromDom(e.create(n,s));const c=o?Ln(r):Bn(r);Os(a,c);if(o){xs(r,a);Ss(a,r)}else{Cs(r,a);zs(a,r)}return a.dom};const gT=(e,t)=>t.links&&e.nodeName==="A";const pT=(e,t,o)=>{const n=t.parentNode;let s;const r=e.dom;const a=Ef(e);if(sy(o)){if(n===r.getRoot()){if(!o.list_block||!cT(t,o.list_block)){Q(be(t.childNodes),(t=>{if(Uh(e,a,t.nodeName.toLowerCase())){if(!s){s=fT(r,t,a);r.setAttribs(s,Of(e))}else{s.appendChild(t)}}else{s=null}}))}}}if(ly(o)&&!cT(o.inline,t)){return}r.remove(t,true)};const hT=(e,t,o)=>{if(O(e)){return{name:t,value:null}}else{return{name:e,value:Kh(t,o)}}};const yT=(e,t)=>{if(e.getAttrib(t,"style")===""){t.removeAttribute("style");t.removeAttribute("data-mce-style")}};const bT=(e,t,o,n,s)=>{let r=false;aT(o.styles,((a,c)=>{const{name:i,value:l}=hT(c,a,n);const d=Xh(l,i);if(o.remove_similar||x(l)||!_r(s)||cT(Jh(e,s,i),d)){e.setStyle(t,i,"")}r=true}));if(r){yT(e,t)}};const vT=(e,t,o)=>{if(t==="removeformat"){Q($z(e.selection),(t=>{Q(Iz,(o=>e.dom.setStyle(t,o,"")));yT(e.dom,t)}))}else{Vz(e.formatter,t).each((t=>{Q($z(e.selection),(n=>bT(e.dom,n,t,o,null)))}))}};const kT=(e,t,o,n,s)=>{const r=e.dom;const a=ZC(e);const c=e.schema;if(iy(t)&&Da(c,t.inline)&&Ma(c,n)&&n.parentElement===e.getBody()){pT(e,n,t);return sT.removed()}if(!t.ceFalseOverride&&n&&r.getContentEditableParent(n)==="false"){return sT.keep()}if(n&&!az(r,n,t)&&!gT(n,t)){return sT.keep()}const i=n;const l=t.preserve_attributes;if(iy(t)&&t.remove==="all"&&_(l)){const e=oe(r.getAttribs(i),(e=>Y(l,e.name.toLowerCase())));r.removeAllAttribs(i);Q(e,(e=>r.setAttrib(i,e.name,e.value)));if(e.length>0){return sT.rename("span")}}if(t.remove!=="all"){bT(r,i,t,o,s);aT(t.attributes,((e,n)=>{const{name:a,value:c}=hT(n,e,o);if(t.remove_similar||x(c)||!_r(s)||cT(r.getAttrib(s,a),c)){if(a==="class"){const e=r.getAttrib(i,a);if(e){let t="";Q(e.split(/\s+/),(e=>{if(/mce\-\w+/.test(e)){t+=(t?" ":"")+e}}));if(t){r.setAttrib(i,a,t);return}}}if(rT.test(a)){i.removeAttribute("data-mce-"+a)}if(a==="style"&&zr(["li"])(i)&&r.getStyle(i,"list-style-type")==="none"){i.removeAttribute(a);r.setStyle(i,"list-style-type","none");return}if(a==="class"){i.removeAttribute("className")}i.removeAttribute(a)}}));aT(t.classes,(e=>{e=Kh(e,o);if(!_r(s)||r.hasClass(s,e)){r.removeClass(i,e)}}));const e=r.getAttribs(i);for(let t=0;t<e.length;t++){const o=e[t].nodeName;if(!a.isAttributeInternal(o)){return sT.keep()}}}if(t.remove!=="none"){pT(e,i,t);return sT.removed()}return sT.keep()};const wT=(e,t,o,n,s)=>{let r;if(t.parentNode){Q(ey(e.dom,t.parentNode).reverse(),(t=>{if(!r&&_r(t)&&t.id!=="_start"&&t.id!=="_end"){const a=iz(e,t,o,n,s);if(a&&a.split!==false){r=t}}}))}return r};const _T=(e,t,o,n)=>kT(e,t,o,n,n).fold(R(n),(t=>{const o=e.dom.createFragment();o.appendChild(n);return e.dom.rename(n,t)}),R(null));const xT=(e,t,o,n,s,r,a,c)=>{var i,l;let d;let u;const f=e.dom;if(o){const m=o.parentNode;for(let o=n.parentNode;o&&o!==m;o=o.parentNode){let n=f.clone(o,false);for(let o=0;o<t.length;o++){n=_T(e,t[o],c,n);if(n===null){break}}if(n){if(d){n.appendChild(d)}if(!u){u=n}d=n}}if(r&&(!a.mixed||!f.isBlock(o))){n=(i=f.split(o,n))!==null&&i!==void 0?i:n}if(d&&u){(l=s.parentNode)===null||l===void 0?void 0:l.insertBefore(d,s);u.appendChild(s);if(iy(a)){Jz(e,a,c,d)}}}return n};const CT=(e,t,o,n,s)=>{const r=e.formatter.get(t);const a=r[0];const c=e.dom;const i=e.selection;const l=n=>{const c=wT(e,n,t,o,s);return xT(e,r,c,n,n,true,a,o)};const d=e=>ph(e)&&_r(e)&&(e.id==="_start"||e.id==="_end");const u=t=>X(r,(n=>zT(e,n,o,t,t)));const f=t=>{const o=be(t.childNodes);const n=u(t);const s=n||X(r,(e=>az(c,t,e)));const i=t.parentNode;if(!s&&T(i)&&dy(a)){u(i)}if(a.deep){if(o.length){for(let e=0;e<o.length;e++){f(o[e])}}}const l=["underline","line-through","overline"];Q(l,(o=>{if(_r(t)&&e.dom.getStyle(t,"text-decoration")===o&&t.parentNode&&Qh(c,t.parentNode)===o){zT(e,{deep:false,exact:true,inline:"span",styles:{textDecoration:o}},undefined,t)}}))};const m=e=>{const t=c.get(e?"_start":"_end");if(t){let o=t[e?"firstChild":"lastChild"];if(d(o)){o=o[e?"firstChild":"lastChild"]}if(Rr(o)&&o.data.length===0){o=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling}c.remove(t,true);return o}else{return null}};const g=t=>{let o;let n;let s=Oy(c,t,r,t.collapsed);if(a.split){s=kv(s);o=dT(e,s,true);n=dT(e,s);if(o!==n){o=uT(o,true);n=uT(n,false);if(lT(c,o,n)){const e=U.from(o.firstChild).getOr(o);l(mT(c,e,true,"span",{id:"_start","data-mce-type":"bookmark"}));m(true);return}if(lT(c,n,o)){const e=U.from(n.lastChild).getOr(n);l(mT(c,e,false,"span",{id:"_end","data-mce-type":"bookmark"}));m(false);return}o=fT(c,o,"span",{id:"_start","data-mce-type":"bookmark"});n=fT(c,n,"span",{id:"_end","data-mce-type":"bookmark"});const e=c.createRng();e.setStartAfter(o);e.setEndBefore(n);Ay(c,e,(e=>{Q(e,(e=>{if(!ph(e)&&!ph(e.parentNode)){l(e)}}))}));l(o);l(n);o=m(true);n=m()}else{o=n=l(o)}s.startContainer=o.parentNode?o.parentNode:o;s.startOffset=c.nodeIndex(o);s.endContainer=n.parentNode?n.parentNode:n;s.endOffset=c.nodeIndex(n)+1}Ay(c,s,(e=>{Q(e,f)}))};if(n){if(Hh(n)){const e=c.createRng();e.setStartBefore(n);e.setEndAfter(n);g(e)}else{g(n)}ob(e,t,n,o);return}if(!i.isCollapsed()||!iy(a)||zh(e).length){Fh(e,(()=>Bh(e,g)),(n=>iy(a)&&lz(e,t,o,n)));e.nodeChanged()}else{zz(e,t,o,s)}vT(e,t,o);ob(e,t,n,o)};const ST=(e,t,o,n,s)=>{if(n||e.selection.isEditable()){CT(e,t,o,n,s)}};const zT=(e,t,o,n,s)=>kT(e,t,o,n,s).fold(j,(t=>{e.dom.rename(n,t);return true}),Z);const TT=mo.each;const ET=(e,t,o,n)=>{const s=t=>{if(xr(t)&&_r(t.parentNode)&&e.isEditable(t)){const o=Qh(e,t.parentNode);if(e.getStyle(t,"color")&&o){e.setStyle(t,"text-decoration",o)}else if(e.getStyle(t,"text-decoration")===o){e.setStyle(t,"text-decoration",null)}}};if(t.styles&&(t.styles.color||t.styles.textDecoration)){mo.walk(n,s,"childNodes");s(n)}};const OT=(e,t,o,n)=>{if(t.styles&&t.styles.backgroundColor){const s=oT(e,"fontSize");eT(n,(t=>s(t)&&e.isEditable(t)),nT(e,"backgroundColor",Kh(t.styles.backgroundColor,o)))}};const AT=(e,t,o,n)=>{if(iy(t)&&(t.inline==="sub"||t.inline==="sup")){const o=oT(e,"fontSize");eT(n,(t=>o(t)&&e.isEditable(t)),nT(e,"fontSize",""));const s=oe(e.select(t.inline==="sup"?"sub":"sup",n),e.isEditable);e.remove(s,true)}};const DT=(e,t,o,n)=>{TT(t,(t=>{if(iy(t)){TT(e.dom.select(t.inline,n),(n=>{if(Kz(n)){zT(e,t,o,n,t.exact?n:null)}}))}Qz(e.dom,t,n)}))};const NT=(e,t,o,n,s)=>{const r=s.parentNode;if(iz(e,r,o,n)){if(zT(e,t,n,s)){return}}if(t.merge_with_parents&&r){e.dom.getParent(r,(r=>{if(iz(e,r,o,n)){zT(e,t,n,s);return true}else{return false}}))}};const MT=mo.each;const RT=(e,t,o,n)=>{if(mm(e)&&iy(t)&&o.parentNode){const t=Pc(e.schema);const s=ar(yn.fromDom(o),(e=>Wp(e.dom)));return Re(t,n)&&ra(e.schema,o.parentNode,{skipBogus:false,includeZwsp:true})&&!s}else{return false}};const BT=(e,t,o,n)=>{MT(o.styles,((o,s)=>{e.setStyle(t,s,Kh(o,n))}));if(o.styles){const o=e.getAttrib(t,"style");if(o){e.setAttrib(t,"data-mce-style",o)}}};const LT=(e,t,o,n)=>{const s=e.formatter.get(t);const r=s[0];const a=!n&&e.selection.isCollapsed();const c=e.dom;const i=e.selection;const l=(e,t=r)=>{if(E(t.onformat)){t.onformat(e,t,o,n)}BT(c,e,t,o);MT(t.attributes,((t,n)=>{c.setAttrib(e,n,Kh(t,o))}));MT(t.classes,(t=>{const n=Kh(t,o);if(!c.hasClass(e,n)){c.addClass(e,n)}}))};const d=(e,t)=>{let o=false;MT(e,(e=>{if(!cy(e)){return false}if(c.getContentEditable(t)==="false"&&!e.ceFalseOverride){return true}if(T(e.collapsed)&&e.collapsed!==a){return true}if(c.is(t,e.selector)&&!Wp(t)){l(t,e);o=true;return false}return true}));return o};const u=e=>{if(v(e)){const t=c.create(e);l(t);return t}else{return null}};const f=(n,a,c)=>{const i=[];let f=true;const m=r.inline||r.block;const g=u(m);const p=n=>ry(r)&&iz(e,n,t,o);const h=(t,o,n)=>{const s=ay(r)&&Zh(e.schema,t)&&Uh(e,o,m);return n&&s};const y=(t,o,s,a)=>{const i=t.nodeName.toLowerCase();const l=Uh(e,m,i)&&Uh(e,o,m);const d=!c&&Rr(t)&&Kl(t.data);const u=Wp(t);const f=!iy(r)||!n.isBlock(t);return(s||a)&&l&&!d&&!u&&f};Ay(n,a,(t=>{let o;const a=t=>{let c=false;let u=f;let b=false;const v=t.parentNode;const k=v.nodeName.toLowerCase();const w=n.getContentEditable(t);if(T(w)){u=f;f=w==="true";c=true;b=Gh(e,t)}const _=f&&!c;if(Fr(t)&&!RT(e,r,t,k)){o=null;if(sy(r)){n.remove(t)}return}if(p(t)){o=null;return}if(h(t,k,_)){const e=n.rename(t,m);l(e);i.push(e);o=null;return}if(cy(r)){let e=d(s,t);if(!e&&T(v)&&dy(r)){e=d(s,v)}if(!iy(r)||e){o=null;return}}if(T(g)&&y(t,k,_,b)){if(!o){o=n.clone(g,false);v.insertBefore(o,t);i.push(o)}if(b&&c){f=u}o.appendChild(t)}else{o=null;Q(be(t.childNodes),a);if(c){f=u}o=null}};Q(t,a)}));if(r.links===true){Q(i,(e=>{const t=e=>{if(e.nodeName==="A"){l(e,r)}Q(be(e.childNodes),t)};t(e)}))}Q(i,(a=>{const c=e=>{let t=0;Q(e.childNodes,(e=>{if(!Wh(e)&&!ph(e)){t++}}));return t};const d=e=>{const t=ae(e.childNodes,Ih).filter((e=>n.getContentEditable(e)!=="false"&&az(n,e,r)));return t.map((t=>{const o=n.clone(t,false);l(o);n.replace(o,e,true);n.remove(t,true);return o})).getOr(e)};const u=c(a);if((i.length>1||!n.isBlock(a))&&u===0){n.remove(a,true);return}if(iy(r)||sy(r)&&r.wrapper){if(!r.exact&&u===1){a=d(a)}DT(e,s,o,a);NT(e,r,t,o,a);OT(n,r,o,a);ET(n,r,o,a);AT(n,r,o,a);Jz(e,r,o,a)}}))};const m=Hh(n)?n:i.getNode();if(c.getContentEditable(m)==="false"&&!Gh(e,m)){n=m;d(s,n);tb(e,t,n,o);return}if(r){if(n){if(Hh(n)){if(!d(s,n)){const e=c.createRng();e.setStartBefore(n);e.setEndAfter(n);f(c,Oy(c,e,s),true)}}else{f(c,n,true)}}else{if(!a||!iy(r)||zh(e).length){i.setRng(dS(i.getRng()));Fh(e,(()=>{Bh(e,((e,t)=>{const o=t?e:Oy(c,e,s);f(c,o,false)}))}),Z);e.nodeChanged()}else{Sz(e,t,o)}Vz(e.formatter,t).each((t=>{Q(Wz(e.selection),(e=>BT(c,e,t,o)))}))}Hz(t,e)}tb(e,t,n,o)};const HT=(e,t,o,n)=>{if(n||e.selection.isEditable()){LT(e,t,o,n)}};const IT=e=>Me(e,"vars");const PT=(e,t)=>{e.set({});t.on("NodeChange",(o=>{ZT(t,o.element,e.get())}));t.on("FormatApply FormatRemove",(o=>{const n=U.from(o.node).map((e=>Hh(e)?e:e.startContainer)).bind((e=>_r(e)?U.some(e):U.from(e.parentElement))).getOrThunk((()=>FT(t)));ZT(t,n,e.get())}))};const FT=e=>e.selection.getStart();const VT=(e,t,o,n,s)=>{const r=t=>{const r=e.formatter.matchNode(t,o,s!==null&&s!==void 0?s:{},n);return!S(r)};const a=t=>{if(sz(e,t,o)){return true}else{if(!n){return T(e.formatter.matchNode(t,o,s,true))}else{return false}}};return re(t,r,a)};const jT=(e,t)=>{const o=t!==null&&t!==void 0?t:FT(e);return oe(ey(e.dom,o),(e=>_r(e)&&!Or(e)))};const ZT=(e,t,o)=>{const n=jT(e,t);xe(o,((o,s)=>{const r=o=>{const r=VT(e,n,s,o.similar,IT(o)?o.vars:undefined);const a=r.isSome();if(o.state.get()!==a){o.state.set(a);const e=r.getOr(t);if(IT(o)){o.callback(a,{node:e,format:s,parents:n})}else{Q(o.callbacks,(t=>t(a,{node:e,format:s,parents:n})))}}};Q([o.withSimilar,o.withoutSimilar],r);Q(o.withVars,r)}))};const UT=(e,t,o,n,s,r)=>{const a=t.get();Q(o.split(","),(t=>{const o=Ne(a,t).getOrThunk((()=>{const e={withSimilar:{state:ia(false),similar:true,callbacks:[]},withoutSimilar:{state:ia(false),similar:false,callbacks:[]},withVars:[]};a[t]=e;return e}));const c=()=>{const o=jT(e);return VT(e,o,t,s,r).isSome()};if(S(r)){const e=s?o.withSimilar:o.withoutSimilar;e.callbacks.push(n);if(e.callbacks.length===1){e.state.set(c())}}else{o.withVars.push({state:ia(c()),similar:s,vars:r,callback:n})}}));t.set(a)};const qT=(e,t,o)=>{const n=e.get();Q(t.split(","),(e=>Ne(n,e).each((t=>{n[e]={withSimilar:{...t.withSimilar,callbacks:oe(t.withSimilar.callbacks,(e=>e!==o))},withoutSimilar:{...t.withoutSimilar,callbacks:oe(t.withoutSimilar.callbacks,(e=>e!==o))},withVars:oe(t.withVars,(e=>e.callback!==o))}}))));e.set(n)};const WT=(e,t,o,n,s,r)=>{UT(e,t,o,n,s,r);return{unbind:()=>qT(t,o,n)}};const $T=(e,t,o,n)=>{const s=e.formatter.get(t);if(s){if(lz(e,t,o,n)&&(!("toggle"in s[0])||s[0].toggle)){ST(e,t,o,n)}else{HT(e,t,o,n)}}};const GT=mo.explode;const KT=()=>{const e={};const t=(t,o)=>{Q(GT(t),(t=>{if(!Me(e,t)){e[t]={name:t,callbacks:[]}}e[t].callbacks.push(o)}))};const o=()=>De(e);const n=(t,o)=>{Q(GT(t),(t=>{if(Me(e,t)){if(T(o)){const n=e[t];const s=oe(n.callbacks,(e=>e!==o));if(s.length>0){n.callbacks=s}else{delete e[t]}}else{delete e[t]}}}))};return{addFilter:t,getFilters:o,removeFilter:n}};const YT=(e,t)=>{Q(t,(t=>{e.attr(t,null)}))};const XT=(e,t,o)=>{e.addNodeFilter("font",(e=>{Q(e,(e=>{const n=t.parse(e.attr("style"));const s=e.attr("color");const r=e.attr("face");const a=e.attr("size");if(s){n.color=s}if(r){n["font-family"]=r}if(a){bt(a).each((e=>{n["font-size"]=o[e-1]}))}e.name="span";e.attr("style",t.serialize(n));YT(e,["color","face","size"])}))}))};const JT=(e,t,o)=>{e.addNodeFilter("strike",(e=>{const n=t.type!=="html4";Q(e,(e=>{if(n){e.name="s"}else{const t=o.parse(e.attr("style"));t["text-decoration"]="line-through";e.name="span";e.attr("style",o.serialize(t))}}))}))};const QT=(e,t,o)=>{var n;const s=ei();if(t.convert_fonts_to_spans){XT(e,s,mo.explode((n=t.font_size_legacy_values)!==null&&n!==void 0?n:""))}JT(e,o,s)};const eE=(e,t,o)=>{if(t.inline_styles){QT(e,t,o)}};const tE=e=>fetch(e).then((e=>e.ok?e.blob():Promise.reject())).catch((()=>Promise.reject({message:`Cannot convert ${e} to Blob. Resource might not exist or is inaccessible.`,uriType:"blob"})));const oE=e=>{const t=/([a-z0-9+\/=\s]+)/i.exec(e);return t?t[1]:""};const nE=e=>{const[t,...o]=e.split(",");const n=o.join(",");const s=/data:([^/]+\/[^;]+)(;.+)?/.exec(t);if(s){const e=s[2]===";base64";const t=e?oE(n):decodeURIComponent(n);return U.some({type:s[1],data:t,base64Encoded:e})}else{return U.none()}};const sE=(e,t,o=true)=>{let n=t;if(o){try{n=atob(t)}catch(e){return U.none()}}const s=new Uint8Array(n.length);for(let e=0;e<s.length;e++){s[e]=n.charCodeAt(e)}return U.some(new Blob([s],{type:e}))};const rE=e=>new Promise(((t,o)=>{nE(e).bind((({type:e,data:t,base64Encoded:o})=>sE(e,t,o))).fold((()=>o("Invalid data URI")),t)}));const aE=e=>{if(lt(e,"blob:")){return tE(e)}else if(lt(e,"data:")){return rE(e)}else{return Promise.reject("Unknown URI format")}};const cE=e=>new Promise(((t,o)=>{const n=new FileReader;n.onloadend=()=>{t(n.result)};n.onerror=()=>{var e;o((e=n.error)===null||e===void 0?void 0:e.message)};n.readAsDataURL(e)}));let iE=0;const lE=e=>(e||"blobid")+iE++;const dE=(e,t,o)=>nE(e).bind((({data:e,type:n,base64Encoded:s})=>{if(t&&!s){return U.none()}else{const t=s?e:btoa(e);return o(t,n)}}));const uE=(e,t,o)=>{const n=e.create(lE(),t,o);e.add(n);return n};const fE=(e,t,o=false)=>dE(t,o,((t,o)=>U.from(e.getByData(t,o)).orThunk((()=>sE(o,t).map((o=>uE(e,o,t)))))));const mE=(e,t)=>{const o=()=>Promise.reject("Invalid data URI");if(lt(t,"blob:")){const n=e.getByUri(t);if(T(n)){return Promise.resolve(n)}else{return aE(t).then((t=>cE(t).then((n=>dE(n,false,(o=>U.some(uE(e,t,o)))).getOrThunk(o)))))}}else if(lt(t,"data:")){return fE(e,t).fold(o,(e=>Promise.resolve(e)))}else{return Promise.reject("Unknown image data format")}};const gE=/^(?:(?:(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)([A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*))(?::\d+)?(?:\/(?:[-.~*+=!;:'%@$(),\/\w]*[-~*+=%@$()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+)?)?)$/;const pE=e=>U.from(e.match(gE)).bind((e=>pe(e,1))).map((e=>lt(e,"www.")?e.substring(4):e));const hE=(e,t)=>{if(U.from(e.attr("src")).bind(pE).forall((e=>!Y(t,e)))){e.attr("sandbox","")}};const yE=(e,t)=>lt(e,`${t}/`);const bE=e=>{if(S(e)){return"iframe"}else if(yE(e,"image")){return"img"}else if(yE(e,"video")){return"video"}else if(yE(e,"audio")){return"audio"}else{return"iframe"}};const vE=({type:e,src:t,width:o,height:n}={},s,r)=>{const a=bE(e);const c=new lw(a,1);c.attr(a==="audio"?{src:t}:{src:t,width:o,height:n});if(a==="audio"||a==="video"){c.attr("controls","")}if(a==="iframe"&&s){hE(c,r)}return c};const kE=e=>T(e.attr("data-mce-bogus"));const wE=e=>e.attr("src")===to.transparentSrc||T(e.attr("data-mce-placeholder"));const _E=(e,t)=>{const{blob_cache:o}=t;if(o){const t=e=>{const t=e.attr("src");if(wE(e)||kE(e)||z(t)){return}fE(o,t,true).each((t=>{e.attr("src",t.blobUri())}))};e.addAttributeFilter("src",(e=>Q(e,t)))}};const xE=(e,t)=>{var o,n;const s=e.schema;e.addAttributeFilter("href",(e=>{let o=e.length;const n=e=>{const t=e.split(" ").filter((e=>e.length>0));return t.concat(["noopener"]).sort().join(" ")};const s=e=>{const t=e?mo.trim(e):"";if(!/\b(noopener)\b/g.test(t)){return n(t)}else{return t}};if(!t.allow_unsafe_link_target){while(o--){const t=e[o];if(t.name==="a"&&t.attr("target")==="_blank"){t.attr("rel",s(t.attr("rel")))}}}}));if(!t.allow_html_in_named_anchor){e.addAttributeFilter("id,name",(e=>{let t=e.length,o,n,s,r;while(t--){r=e[t];if(r.name==="a"&&r.firstChild&&!r.attr("href")){s=r.parent;o=r.lastChild;while(o&&s){n=o.prev;s.insert(o,r);o=n}}}}))}if(t.fix_list_elements){e.addNodeFilter("ul,ol",(e=>{let t=e.length,o,n;while(t--){o=e[t];n=o.parent;if(n&&(n.name==="ul"||n.name==="ol")){if(o.prev&&o.prev.name==="li"){o.prev.append(o)}else{const e=new lw("li",1);e.attr("style","list-style-type: none");o.wrap(e)}}}}))}const r=s.getValidClasses();if(t.validate&&r){e.addAttributeFilter("class",(e=>{var t;let o=e.length;while(o--){const n=e[o];const s=(t=n.attr("class"))!==null&&t!==void 0?t:"";const a=mo.explode(s," ");let c="";for(let e=0;e<a.length;e++){const t=a[e];let o=false;let s=r["*"];if(s&&s[t]){o=true}s=r[n.name];if(!o&&s&&s[t]){o=true}if(o){if(c){c+=" "}c+=t}}if(!c.length){c=null}n.attr("class",c)}}))}_E(e,t);const a=(o=t.sandbox_iframes)!==null&&o!==void 0?o:false;const c=ke((n=t.sandbox_iframes_exclusions)!==null&&n!==void 0?n:[]);if(t.convert_unsafe_embeds){e.addNodeFilter("object,embed",(e=>Q(e,(e=>{e.replace(vE({type:e.attr("type"),src:e.name==="object"?e.attr("data"):e.attr("src"),width:e.attr("width"),height:e.attr("height")},a,c))}))))}if(a){e.addNodeFilter("iframe",(e=>Q(e,(e=>hE(e,c)))))}};const{entries:CE,setPrototypeOf:SE,isFrozen:zE,getPrototypeOf:TE,getOwnPropertyDescriptor:EE}=Object;let{freeze:OE,seal:AE,create:DE}=Object;let{apply:NE,construct:ME}=typeof Reflect!=="undefined"&&Reflect;if(!NE){NE=function e(t,o,n){return t.apply(o,n)}}if(!OE){OE=function e(t){return t}}if(!AE){AE=function e(t){return t}}if(!ME){ME=function e(t,o){return new t(...o)}}const RE=qE(Array.prototype.forEach);const BE=qE(Array.prototype.pop);const LE=qE(Array.prototype.push);const HE=qE(String.prototype.toLowerCase);const IE=qE(String.prototype.toString);const PE=qE(String.prototype.match);const FE=qE(String.prototype.replace);const VE=qE(String.prototype.indexOf);const jE=qE(String.prototype.trim);const ZE=qE(RegExp.prototype.test);const UE=WE(TypeError);function qE(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),s=1;s<o;s++){n[s-1]=arguments[s]}return NE(e,t,n)}}function WE(e){return function(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++){o[n]=arguments[n]}return ME(e,o)}}function $E(e,t,o){var n;o=(n=o)!==null&&n!==void 0?n:HE;if(SE){SE(e,null)}let s=t.length;while(s--){let n=t[s];if(typeof n==="string"){const e=o(n);if(e!==n){if(!zE(t)){t[s]=e}n=e}}e[n]=true}return e}function GE(e){const t=DE(null);for(const[o,n]of CE(e)){t[o]=n}return t}function KE(e,t){while(e!==null){const o=EE(e,t);if(o){if(o.get){return qE(o.get)}if(typeof o.value==="function"){return qE(o.value)}}e=TE(e)}function o(e){console.warn("fallback value for",e);return null}return o}const YE=OE(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]);const XE=OE(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]);const JE=OE(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]);const QE=OE(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]);const eO=OE(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]);const tO=OE(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]);const oO=OE(["#text"]);const nO=OE(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]);const sO=OE(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]);const rO=OE(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]);const aO=OE(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);const cO=AE(/\{\{[\w\W]*|[\w\W]*\}\}/gm);const iO=AE(/<%[\w\W]*|[\w\W]*%>/gm);const lO=AE(/\${[\w\W]*}/gm);const dO=AE(/^data-[\-\w.\u00B7-\uFFFF]/);const uO=AE(/^aria-[\-\w]+$/);const fO=AE(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);const mO=AE(/^(?:\w+script|data):/i);const gO=AE(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);const pO=AE(/^html$/i);var hO=Object.freeze({__proto__:null,MUSTACHE_EXPR:cO,ERB_EXPR:iO,TMPLIT_EXPR:lO,DATA_ATTR:dO,ARIA_ATTR:uO,IS_ALLOWED_URI:fO,IS_SCRIPT_OR_DATA:mO,ATTR_WHITESPACE:gO,DOCTYPE_NAME:pO});const yO=()=>typeof window==="undefined"?null:window;const bO=function e(t,o){if(typeof t!=="object"||typeof t.createPolicy!=="function"){return null}let n=null;const s="data-tt-policy-suffix";if(o&&o.hasAttribute(s)){n=o.getAttribute(s)}const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){console.warn("TrustedTypes policy "+r+" could not be created.");return null}};function vO(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:yO();const t=e=>vO(e);t.version="3.0.5";t.removed=[];if(!e||!e.document||e.document.nodeType!==9){t.isSupported=false;return t}const o=e.document;const n=o.currentScript;let{document:s}=e;const{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:i,NodeFilter:l,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:m}=e;const g=i.prototype;const p=KE(g,"cloneNode");const h=KE(g,"nextSibling");const y=KE(g,"childNodes");const b=KE(g,"parentNode");if(typeof a==="function"){const e=s.createElement("template");if(e.content&&e.content.ownerDocument){s=e.content.ownerDocument}}let v;let k="";const{implementation:w,createNodeIterator:_,createDocumentFragment:x,getElementsByTagName:C}=s;const{importNode:S}=o;let z={};t.isSupported=typeof CE==="function"&&typeof b==="function"&&w&&w.createHTMLDocument!==undefined;const{MUSTACHE_EXPR:T,ERB_EXPR:E,TMPLIT_EXPR:O,DATA_ATTR:A,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:M}=hO;let{IS_ALLOWED_URI:R}=hO;let B=null;const L=$E({},[...YE,...XE,...JE,...eO,...oO]);let H=null;const I=$E({},[...nO,...sO,...rO,...aO]);let P=Object.seal(Object.create(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}}));let F=null;let V=null;let j=true;let Z=true;let U=false;let q=true;let W=false;let $=false;let G=false;let K=false;let Y=false;let X=false;let J=false;let Q=true;let ee=false;const te="user-content-";let oe=true;let ne=false;let se={};let re=null;const ae=$E({},["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"]);let ce=null;const ie=$E({},["audio","video","img","source","image","track"]);let le=null;const de=$E({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]);const ue="http://www.w3.org/1998/Math/MathML";const fe="http://www.w3.org/2000/svg";const me="http://www.w3.org/1999/xhtml";let ge=me;let pe=false;let he=null;const ye=$E({},[ue,fe,me],IE);let be;const ve=["application/xhtml+xml","text/html"];const ke="text/html";let we;let _e=null;const xe=s.createElement("form");const Ce=function e(t){return t instanceof RegExp||t instanceof Function};const Se=function e(t){if(_e&&_e===t){return}if(!t||typeof t!=="object"){t={}}t=GE(t);be=ve.indexOf(t.PARSER_MEDIA_TYPE)===-1?be=ke:be=t.PARSER_MEDIA_TYPE;we=be==="application/xhtml+xml"?IE:HE;B="ALLOWED_TAGS"in t?$E({},t.ALLOWED_TAGS,we):L;H="ALLOWED_ATTR"in t?$E({},t.ALLOWED_ATTR,we):I;he="ALLOWED_NAMESPACES"in t?$E({},t.ALLOWED_NAMESPACES,IE):ye;le="ADD_URI_SAFE_ATTR"in t?$E(GE(de),t.ADD_URI_SAFE_ATTR,we):de;ce="ADD_DATA_URI_TAGS"in t?$E(GE(ie),t.ADD_DATA_URI_TAGS,we):ie;re="FORBID_CONTENTS"in t?$E({},t.FORBID_CONTENTS,we):ae;F="FORBID_TAGS"in t?$E({},t.FORBID_TAGS,we):{};V="FORBID_ATTR"in t?$E({},t.FORBID_ATTR,we):{};se="USE_PROFILES"in t?t.USE_PROFILES:false;j=t.ALLOW_ARIA_ATTR!==false;Z=t.ALLOW_DATA_ATTR!==false;U=t.ALLOW_UNKNOWN_PROTOCOLS||false;q=t.ALLOW_SELF_CLOSE_IN_ATTR!==false;W=t.SAFE_FOR_TEMPLATES||false;$=t.WHOLE_DOCUMENT||false;Y=t.RETURN_DOM||false;X=t.RETURN_DOM_FRAGMENT||false;J=t.RETURN_TRUSTED_TYPE||false;K=t.FORCE_BODY||false;Q=t.SANITIZE_DOM!==false;ee=t.SANITIZE_NAMED_PROPS||false;oe=t.KEEP_CONTENT!==false;ne=t.IN_PLACE||false;R=t.ALLOWED_URI_REGEXP||fO;ge=t.NAMESPACE||me;P=t.CUSTOM_ELEMENT_HANDLING||{};if(t.CUSTOM_ELEMENT_HANDLING&&Ce(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)){P.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck}if(t.CUSTOM_ELEMENT_HANDLING&&Ce(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)){P.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck}if(t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==="boolean"){P.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements}if(W){Z=false}if(X){Y=true}if(se){B=$E({},[...oO]);H=[];if(se.html===true){$E(B,YE);$E(H,nO)}if(se.svg===true){$E(B,XE);$E(H,sO);$E(H,aO)}if(se.svgFilters===true){$E(B,JE);$E(H,sO);$E(H,aO)}if(se.mathMl===true){$E(B,eO);$E(H,rO);$E(H,aO)}}if(t.ADD_TAGS){if(B===L){B=GE(B)}$E(B,t.ADD_TAGS,we)}if(t.ADD_ATTR){if(H===I){H=GE(H)}$E(H,t.ADD_ATTR,we)}if(t.ADD_URI_SAFE_ATTR){$E(le,t.ADD_URI_SAFE_ATTR,we)}if(t.FORBID_CONTENTS){if(re===ae){re=GE(re)}$E(re,t.FORBID_CONTENTS,we)}if(oe){B["#text"]=true}if($){$E(B,["html","head","body"])}if(B.table){$E(B,["tbody"]);delete F.tbody}if(t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!=="function"){throw UE('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.')}if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!=="function"){throw UE('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.')}v=t.TRUSTED_TYPES_POLICY;k=v.createHTML("")}else{if(v===undefined){v=bO(m,n)}if(v!==null&&typeof k==="string"){k=v.createHTML("")}}if(OE){OE(t)}_e=t};const ze=$E({},["mi","mo","mn","ms","mtext"]);const Te=$E({},["foreignobject","desc","title","annotation-xml"]);const Ee=$E({},["title","style","font","a","script"]);const Oe=$E({},XE);$E(Oe,JE);$E(Oe,QE);const Ae=$E({},eO);$E(Ae,tO);const De=function e(t){let o=b(t);if(!o||!o.tagName){o={namespaceURI:ge,tagName:"template"}}const n=HE(t.tagName);const s=HE(o.tagName);if(!he[t.namespaceURI]){return false}if(t.namespaceURI===fe){if(o.namespaceURI===me){return n==="svg"}if(o.namespaceURI===ue){return n==="svg"&&(s==="annotation-xml"||ze[s])}return Boolean(Oe[n])}if(t.namespaceURI===ue){if(o.namespaceURI===me){return n==="math"}if(o.namespaceURI===fe){return n==="math"&&Te[s]}return Boolean(Ae[n])}if(t.namespaceURI===me){if(o.namespaceURI===fe&&!Te[s]){return false}if(o.namespaceURI===ue&&!ze[s]){return false}return!Ae[n]&&(Ee[n]||!Oe[n])}if(be==="application/xhtml+xml"&&he[t.namespaceURI]){return true}return false};const Ne=function e(o){LE(t.removed,{element:o});try{o.parentNode.removeChild(o)}catch(e){o.remove()}};const Me=function e(o,n){try{LE(t.removed,{attribute:n.getAttributeNode(o),from:n})}catch(e){LE(t.removed,{attribute:null,from:n})}n.removeAttribute(o);if(o==="is"&&!H[o]){if(Y||X){try{Ne(n)}catch(e){}}else{try{n.setAttribute(o,"")}catch(e){}}}};const Re=function e(t){let o;let n;if(K){t="<remove></remove>"+t}else{const e=PE(t,/^[\r\n\t ]+/);n=e&&e[0]}if(be==="application/xhtml+xml"&&ge===me){t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>"}const r=v?v.createHTML(t):t;if(ge===me){try{o=(new f).parseFromString(r,be)}catch(e){}}if(!o||!o.documentElement){o=w.createDocument(ge,"template",null);try{o.documentElement.innerHTML=pe?k:r}catch(e){}}const a=o.body||o.documentElement;if(t&&n){a.insertBefore(s.createTextNode(n),a.childNodes[0]||null)}if(ge===me){return C.call(o,$?"html":"body")[0]}return $?o.documentElement:a};const Be=function e(t){return _.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,false)};const Le=function e(t){return t instanceof u&&(typeof t.nodeName!=="string"||typeof t.textContent!=="string"||typeof t.removeChild!=="function"||!(t.attributes instanceof d)||typeof t.removeAttribute!=="function"||typeof t.setAttribute!=="function"||typeof t.namespaceURI!=="string"||typeof t.insertBefore!=="function"||typeof t.hasChildNodes!=="function")};const He=function e(t){return typeof c==="object"?t instanceof c:t&&typeof t==="object"&&typeof t.nodeType==="number"&&typeof t.nodeName==="string"};const Ie=function e(o,n,s){if(!z[o]){return}RE(z[o],(e=>{e.call(t,n,s,_e)}))};const Pe=function e(o){let n;Ie("beforeSanitizeElements",o,null);if(Le(o)){Ne(o);return true}const s=we(o.nodeName);Ie("uponSanitizeElement",o,{tagName:s,allowedTags:B});if(o.hasChildNodes()&&!He(o.firstElementChild)&&(!He(o.content)||!He(o.content.firstElementChild))&&ZE(/<[/\w]/g,o.innerHTML)&&ZE(/<[/\w]/g,o.textContent)){Ne(o);return true}if(!B[s]||F[s]){if(!F[s]&&Ve(s)){if(P.tagNameCheck instanceof RegExp&&ZE(P.tagNameCheck,s))return false;if(P.tagNameCheck instanceof Function&&P.tagNameCheck(s))return false}if(oe&&!re[s]){const e=b(o)||o.parentNode;const t=y(o)||o.childNodes;if(t&&e){const n=t.length;for(let s=n-1;s>=0;--s){e.insertBefore(p(t[s],true),h(o))}}}Ne(o);return true}if(o instanceof i&&!De(o)){Ne(o);return true}if((s==="noscript"||s==="noembed"||s==="noframes")&&ZE(/<\/no(script|embed|frames)/i,o.innerHTML)){Ne(o);return true}if(W&&o.nodeType===3){n=o.textContent;n=FE(n,T," ");n=FE(n,E," ");n=FE(n,O," ");if(o.textContent!==n){LE(t.removed,{element:o.cloneNode()});o.textContent=n}}Ie("afterSanitizeElements",o,null);return false};const Fe=function e(t,o,n){if(Q&&(o==="id"||o==="name")&&(n in s||n in xe)){return false}if(Z&&!V[o]&&ZE(A,o));else if(j&&ZE(D,o));else if(!H[o]||V[o]){if(Ve(t)&&(P.tagNameCheck instanceof RegExp&&ZE(P.tagNameCheck,t)||P.tagNameCheck instanceof Function&&P.tagNameCheck(t))&&(P.attributeNameCheck instanceof RegExp&&ZE(P.attributeNameCheck,o)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(o))||o==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&ZE(P.tagNameCheck,n)||P.tagNameCheck instanceof Function&&P.tagNameCheck(n)));else{return false}}else if(le[o]);else if(ZE(R,FE(n,M,"")));else if((o==="src"||o==="xlink:href"||o==="href")&&t!=="script"&&VE(n,"data:")===0&&ce[t]);else if(U&&!ZE(N,FE(n,M,"")));else if(n){return false}else;return true};const Ve=function e(t){return t.indexOf("-")>0};const je=function e(t){let o;let n;let s;let r;Ie("beforeSanitizeAttributes",t,null);const{attributes:a}=t;if(!a){return}const c={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:H};r=a.length;while(r--){o=a[r];const{name:e,namespaceURI:i}=o;n=e==="value"?o.value:jE(o.value);const l=n;s=we(e);c.attrName=s;c.attrValue=n;c.keepAttr=true;c.forceKeepAttr=undefined;Ie("uponSanitizeAttribute",t,c);n=c.attrValue;if(c.forceKeepAttr){continue}if(!c.keepAttr){Me(e,t);continue}if(!q&&ZE(/\/>/i,n)){Me(e,t);continue}if(W){n=FE(n,T," ");n=FE(n,E," ");n=FE(n,O," ")}const d=we(t.nodeName);if(!Fe(d,s,n)){Me(e,t);continue}if(ee&&(s==="id"||s==="name")){Me(e,t);n=te+n}if(v&&typeof m==="object"&&typeof m.getAttributeType==="function"){if(i);else{switch(m.getAttributeType(d,s)){case"TrustedHTML":{n=v.createHTML(n);break}case"TrustedScriptURL":{n=v.createScriptURL(n);break}}}}if(n!==l){try{if(i){t.setAttributeNS(i,e,n)}else{t.setAttribute(e,n)}}catch(o){Me(e,t)}}}Ie("afterSanitizeAttributes",t,null)};const Ze=function e(t){let o;const n=Be(t);Ie("beforeSanitizeShadowDOM",t,null);while(o=n.nextNode()){Ie("uponSanitizeShadowNode",o,null);if(Pe(o)){continue}if(o.content instanceof r){e(o.content)}je(o)}Ie("afterSanitizeShadowDOM",t,null)};t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let s;let a;let i;let l;pe=!e;if(pe){e="\x3c!--\x3e"}if(typeof e!=="string"&&!He(e)){if(typeof e.toString==="function"){e=e.toString();if(typeof e!=="string"){throw UE("dirty is not a string, aborting")}}else{throw UE("toString is not a function")}}if(!t.isSupported){return e}if(!G){Se(n)}t.removed=[];if(typeof e==="string"){ne=false}if(ne){if(e.nodeName){const t=we(e.nodeName);if(!B[t]||F[t]){throw UE("root node is forbidden and cannot be sanitized in-place")}}}else if(e instanceof c){s=Re("\x3c!----\x3e");a=s.ownerDocument.importNode(e,true);if(a.nodeType===1&&a.nodeName==="BODY"){s=a}else if(a.nodeName==="HTML"){s=a}else{s.appendChild(a)}}else{if(!Y&&!W&&!$&&e.indexOf("<")===-1){return v&&J?v.createHTML(e):e}s=Re(e);if(!s){return Y?null:J?k:""}}if(s&&K){Ne(s.firstChild)}const d=Be(ne?e:s);while(i=d.nextNode()){if(Pe(i)){continue}if(i.content instanceof r){Ze(i.content)}je(i)}if(ne){return e}if(Y){if(X){l=x.call(s.ownerDocument);while(s.firstChild){l.appendChild(s.firstChild)}}else{l=s}if(H.shadowroot||H.shadowrootmode){l=S.call(o,l,true)}return l}let u=$?s.outerHTML:s.innerHTML;if($&&B["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&ZE(pO,s.ownerDocument.doctype.name)){u="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+u}if(W){u=FE(u,T," ");u=FE(u,E," ");u=FE(u,O," ")}return v&&J?v.createHTML(u):u};t.setConfig=function(e){Se(e);G=true};t.clearConfig=function(){_e=null;G=false};t.isValidAttribute=function(e,t,o){if(!_e){Se({})}const n=we(e);const s=we(t);return Fe(n,s,o)};t.addHook=function(e,t){if(typeof t!=="function"){return}z[e]=z[e]||[];LE(z[e],t)};t.removeHook=function(e){if(z[e]){return BE(z[e])}};t.removeHooks=function(e){if(z[e]){z[e]=[]}};t.removeAllHooks=function(){z={}};return t}var kO=vO();const wO=mo.each,_O=mo.trim;const xO=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];const CO={ftp:21,http:80,https:443,mailto:25};const SO=["img","video"];const zO=(e,t)=>{if(T(e)){return!e}else{return T(t)?!Y(SO,t):true}};const TO=e=>{try{return decodeURIComponent(e)}catch(t){return unescape(e)}};const EO=(e,t,o)=>{const n=TO(t).replace(/\s/g,"");if(e.allow_script_urls){return false}else if(/((java|vb)script|mhtml):/i.test(n)){return true}else if(e.allow_html_data_urls){return false}else if(/^data:image\//i.test(n)){return zO(e.allow_svg_data_urls,o)&&/^data:image\/svg\+xml/i.test(n)}else{return/^data:/i.test(n)}};class OO{static parseDataUri(e){let t;const o=decodeURIComponent(e).split(",");const n=/data:([^;]+)/.exec(o[0]);if(n){t=n[1]}return{type:t,data:o[1]}}static isDomSafe(e,t,o={}){if(o.allow_script_urls){return true}else{const n=pc.decode(e).replace(/[\s\u0000-\u001F]+/g,"");return!EO(o,n,t)}}static getDocumentBaseUrl(e){var t;let o;if(e.protocol.indexOf("http")!==0&&e.protocol!=="file:"){o=(t=e.href)!==null&&t!==void 0?t:""}else{o=e.protocol+"//"+e.host+e.pathname}if(/^[^:]+:\/\/\/?[^\/]+\//.test(o)){o=o.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(o)){o+="/"}}return o}constructor(e,t={}){this.path="";this.directory="";e=_O(e);this.settings=t;const o=t.base_uri;const n=this;if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){n.source=e;return}const s=e.indexOf("//")===0;if(e.indexOf("/")===0&&!s){e=(o?o.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){const t=o?o.path:new OO(document.location.href).directory;if((o===null||o===void 0?void 0:o.protocol)===""){e="//mce_host"+n.toAbsPath(t,e)}else{const s=/([^#?]*)([#?]?.*)/.exec(e);if(s){e=(o&&o.protocol||"http")+"://mce_host"+n.toAbsPath(t,s[1])+s[2]}}}e=e.replace(/@@/g,"(mce_at)");const r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);if(r){wO(xO,((e,t)=>{let o=r[t];if(o){o=o.replace(/\(mce_at\)/g,"@@")}n[e]=o}))}if(o){if(!n.protocol){n.protocol=o.protocol}if(!n.userInfo){n.userInfo=o.userInfo}if(!n.port&&n.host==="mce_host"){n.port=o.port}if(!n.host||n.host==="mce_host"){n.host=o.host}n.source=""}if(s){n.protocol=""}}setPath(e){const t=/^(.*?)\/?(\w+)?$/.exec(e);if(t){this.path=t[0];this.directory=t[1];this.file=t[2]}this.source="";this.getURI()}toRelative(e){if(e==="./"){return e}const t=new OO(e,{base_uri:this});if(t.host!=="mce_host"&&this.host!==t.host&&t.host||this.port!==t.port||this.protocol!==t.protocol&&t.protocol!==""){return t.getURI()}const o=this.getURI(),n=t.getURI();if(o===n||o.charAt(o.length-1)==="/"&&o.substr(0,o.length-1)===n){return o}let s=this.toRelPath(this.path,t.path);if(t.query){s+="?"+t.query}if(t.anchor){s+="#"+t.anchor}return s}toAbsolute(e,t){const o=new OO(e,{base_uri:this});return o.getURI(t&&this.isSameOrigin(o))}isSameOrigin(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port){return true}const t=this.protocol?CO[this.protocol]:null;if(t&&(this.port||t)==(e.port||t)){return true}}return false}toRelPath(e,t){let o=0,n="",s,r;const a=e.substring(0,e.lastIndexOf("/")).split("/");const c=t.split("/");if(a.length>=c.length){for(s=0,r=a.length;s<r;s++){if(s>=c.length||a[s]!==c[s]){o=s+1;break}}}if(a.length<c.length){for(s=0,r=c.length;s<r;s++){if(s>=a.length||a[s]!==c[s]){o=s+1;break}}}if(o===1){return t}for(s=0,r=a.length-(o-1);s<r;s++){n+="../"}for(s=o-1,r=c.length;s<r;s++){if(s!==o-1){n+="/"+c[s]}else{n+=c[s]}}return n}toAbsPath(e,t){let o=0;const n=/\/$/.test(t)?"/":"";const s=e.split("/");const r=t.split("/");const a=[];wO(s,(e=>{if(e){a.push(e)}}));const c=[];for(let e=r.length-1;e>=0;e--){if(r[e].length===0||r[e]==="."){continue}if(r[e]===".."){o++;continue}if(o>0){o--;continue}c.push(r[e])}const i=a.length-o;let l;if(i<=0){l=ue(c).join("/")}else{l=a.slice(0,i).join("/")+"/"+ue(c).join("/")}if(l.indexOf("/")!==0){l="/"+l}if(n&&l.lastIndexOf("/")!==l.length-1){l+=n}return l}getURI(e=false){let t;if(!this.source||e){t="";if(!e){if(this.protocol){t+=this.protocol+"://"}else{t+="//"}if(this.userInfo){t+=this.userInfo+"@"}if(this.host){t+=this.host}if(this.port){t+=":"+this.port}}if(this.path){t+=this.path}if(this.query){t+="?"+this.query}if(this.anchor){t+="#"+this.anchor}this.source=t}return this.source}}const AO=mo.makeMap("src,href,data,background,action,formaction,poster,xlink:href");const DO="data-mce-type";let NO=0;const MO=(e,t,o,n,s)=>{var r,a,c,i;const l=t.validate;const d=o.getSpecialElements();if(e.nodeType===Eo&&!t.allow_conditional_comments&&/^\[if/i.test((r=e.nodeValue)!==null&&r!==void 0?r:"")){e.nodeValue=" "+e.nodeValue}const u=(a=s===null||s===void 0?void 0:s.tagName)!==null&&a!==void 0?a:e.nodeName.toLowerCase();if(n!=="html"&&o.isValid(n)){if(T(s)){s.allowedTags[u]=true}return}if(e.nodeType!==Do||u==="body"){return}const f=yn.fromDom(e);const m=Go(f,DO);const g=Wo(f,"data-mce-bogus");if(!m&&v(g)){if(g==="all"){Ds(f)}else{Ns(f)}return}const p=o.getElementRule(u);if(l&&!p){if(Me(d,u)){Ds(f)}else{Ns(f)}return}else{if(T(s)){s.allowedTags[u]=true}}if(l&&p&&!m){Q((c=p.attributesForced)!==null&&c!==void 0?c:[],(e=>{Uo(f,e.name,e.value==="{$uid}"?`mce_${NO++}`:e.value)}));Q((i=p.attributesDefault)!==null&&i!==void 0?i:[],(e=>{if(!Go(f,e.name)){Uo(f,e.name,e.value==="{$uid}"?`mce_${NO++}`:e.value)}}));if(p.attributesRequired&&!X(p.attributesRequired,(e=>Go(f,e)))){Ns(f);return}if(p.removeEmptyAttrs&&Yo(f)){Ns(f);return}if(p.outputName&&p.outputName!==u){kl(f,p.outputName)}}};const RO=(e,t,o,n,s)=>{const r=e.tagName.toLowerCase();const{attrName:a,attrValue:c}=s;s.keepAttr=BO(t,o,n,r,a,c);if(s.keepAttr){s.allowedAttributes[a]=true;if(HO(a,o)){s.attrValue=a}if(t.allow_svg_data_urls&<(c,"data:image/svg+xml")){s.forceKeepAttr=true}}else if(LO(e,a)){s.forceKeepAttr=true}};const BO=(e,t,o,n,s,r)=>{if(o!=="html"&&!ma(n)){return true}return!(s in AO&&EO(e,r,n))&&(!e.validate||t.isValid(n,s)||lt(s,"data-")||lt(s,"aria-"))};const LO=(e,t)=>e.hasAttribute(DO)&&(t==="id"||t==="class"||t==="style");const HO=(e,t)=>e in t.getBoolAttrs();const IO=(e,t,o,n)=>{const{attributes:s}=e;for(let r=s.length-1;r>=0;r--){const a=s[r];const c=a.name;const i=a.value;if(!BO(t,o,n,e.tagName.toLowerCase(),c,i)&&!LO(e,c)){e.removeAttribute(c)}else if(HO(c,o)){e.setAttribute(c,c)}}};const PO=(e,t,o)=>{const n=kO();n.addHook("uponSanitizeElement",((n,s)=>{MO(n,e,t,o.track(n),s)}));n.addHook("uponSanitizeAttribute",((n,s)=>{RO(n,e,t,o.current(),s)}));return n};const FO=(e,t)=>{const o={IN_PLACE:true,ALLOW_UNKNOWN_PROTOCOLS:true,ALLOWED_TAGS:["#comment","#cdata-section","body"],ALLOWED_ATTR:[]};const n={...o};n.PARSER_MEDIA_TYPE=t;if(e.allow_script_urls){n.ALLOWED_URI_REGEXP=/.*/}else if(e.allow_html_data_urls){n.ALLOWED_URI_REGEXP=/^(?!(\w+script|mhtml):)/i}return n};const VO=e=>{const t=pa(e);if(t==="svg"){const t=["type","href","role","arcrole","title","show","actuate","label","from","to"].map((e=>`xlink:${e}`));const o={IN_PLACE:true,USE_PROFILES:{html:true,svg:true,svgFilters:true},ALLOWED_ATTR:t};kO().sanitize(e,o)}else if(t==="math"){const t={IN_PLACE:true,USE_PROFILES:{mathMl:true}};kO().sanitize(e,t)}else{throw new Error("Not a namespace element")}};const jO=(e,t)=>{const o=ya();if(e.sanitize){const n=PO(e,t,o);const s=(t,s)=>{n.sanitize(t,FO(e,s));n.removed=[];o.reset()};return{sanitizeHtmlElement:s,sanitizeNamespaceElement:VO}}else{const n=(n,s)=>{const r=document.createNodeIterator(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT);let a;while(a=r.nextNode()){const n=o.track(a);MO(a,e,t,n);if(_r(a)){IO(a,e,t,n)}}o.reset()};const s=D;return{sanitizeHtmlElement:n,sanitizeNamespaceElement:s}}};const ZO=mo.makeMap,UO=mo.extend;const qO=(e,t,o,n)=>{const s=e.name;const r=s in o&&s!=="title"&&s!=="textarea"&&s!=="noscript";const a=t.childNodes;for(let t=0,s=a.length;t<s;t++){const s=a[t];const c=new lw(s.nodeName.toLowerCase(),s.nodeType);if(_r(s)){const e=s.attributes;for(let t=0,o=e.length;t<o;t++){const o=e[t];c.attr(o.name,o.value)}if(ma(c.name)){n(s);c.value=s.innerHTML}}else if(Rr(s)){c.value=s.data;if(r){c.raw=true}}else if(Hr(s)||Br(s)||Lr(s)){c.value=s.data}if(!ma(c.name)){qO(c,s,o,n)}e.append(c)}};const WO=(e,t,o)=>{const n=[];for(let o=e,s=o;o;s=o,o=o.walk()){const r=o;Q(t,(e=>e(r)));if(z(r.parent)&&r!==e){o=s}else{n.push(r)}}for(let e=n.length-1;e>=0;e--){const t=n[e];Q(o,(e=>e(t)))}};const $O=(e,t,o,n)=>{const s=o.validate;const r=t.getNonEmptyElements();const a=t.getWhitespaceElements();const c=UO(ZO("script,style,head,html,body,title,meta,param"),t.getBlockElements());const i=Pc(t);const l=/[ \t\r\n]+/g;const d=/^[ \t\r\n]+/;const u=/[ \t\r\n]+$/;const f=e=>{let t=e.parent;while(T(t)){if(t.name in a){return true}else{t=t.parent}}return false};const m=e=>{let o=e;while(T(o)){if(o.name in i){return tS(t,r,a,o)}else{o=o.parent}}return false};const g=o=>o.name in c||Ba(t,o)||ma(o.name)&&o.parent===e;const p=(t,o)=>{const s=o?t.prev:t.next;if(T(s)||z(t.parent)){return false}return g(t.parent)&&(t.parent!==e||n.isRootContent===true)};const h=e=>{var t;if(e.type===3){if(!f(e)){let o=(t=e.value)!==null&&t!==void 0?t:"";o=o.replace(l," ");if(oS(e.prev,g)||p(e,true)){o=o.replace(d,"")}if(o.length===0){e.remove()}else{e.value=o}}}};const y=e=>{var c;if(e.type===1){const c=t.getElementRule(e.name);if(s&&c){const s=tS(t,r,a,e);if(c.paddInEmptyBlock&&s&&m(e)){XC(o,n,g,e)}else if(c.removeEmpty&&s){if(g(e)){e.remove()}else{e.unwrap()}}else if(c.paddEmpty&&(s||JC(e))){XC(o,n,g,e)}}}else if(e.type===3){if(!f(e)){let t=(c=e.value)!==null&&c!==void 0?c:"";if(e.next&&g(e.next)||p(e,false)){t=t.replace(u,"")}if(t.length===0){e.remove()}else{e.value=t}}}};return[h,y]};const GO=(e,t)=>{var o;const n=(o=t.forced_root_block)!==null&&o!==void 0?o:e.forced_root_block;if(n===false){return""}else if(n===true){return"p"}else{return n}};const KO=(e={},t=Vc())=>{const o=KT();const n=KT();const s={validate:true,root_name:"body",sanitize:true,...e};const r=new DOMParser;const a=jO(s,t);const c=(e,o,n="html")=>{const s=n==="xhtml"?"application/xhtml+xml":"text/html";const c=Me(t.getSpecialElements(),o.toLowerCase());const i=c?`<${o}>${e}</${o}>`:e;const l=n==="xhtml"?`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>${i}</body></html>`:`<body>${i}</body>`;const d=r.parseFromString(l,s).body;a.sanitizeHtmlElement(d,s);return c?d.firstChild:d};const i=o.addFilter;const l=o.getFilters;const d=o.removeFilter;const u=n.addFilter;const f=n.getFilters;const m=n.removeFilter;const g=(e,o)=>{if(cS(t,e)){o.push(e)}};const p=(e,o)=>{const n=v(o.attr(DO));const s=o.type===1&&(!Me(e,o.name)&&!Ba(t,o))&&!ma(o.name);return o.type===3||s&&!n};const h=(e,o)=>{const n=UO(ZO("script,style,head,html,body,title,meta,param"),t.getBlockElements());const r=/^[ \t\r\n]+/;const a=/[ \t\r\n]+$/;let c=e.firstChild,i=null;const l=e=>{var t,o;if(e){c=e.firstChild;if(c&&c.type===3){c.value=(t=c.value)===null||t===void 0?void 0:t.replace(r,"")}c=e.lastChild;if(c&&c.type===3){c.value=(o=c.value)===null||o===void 0?void 0:o.replace(a,"")}}};if(!t.isValidChild(e.name,o.toLowerCase())){return}while(c){const t=c.next;if(p(n,c)){if(!i){i=new lw(o,1);i.attr(s.forced_root_block_attrs);e.insert(i,c);i.append(c)}else{i.append(c)}}else{l(i);i=null}c=t}l(i)};const y=(e,o={})=>{var n;const r=s.validate;const i=(n=o.context)!==null&&n!==void 0?n:s.root_name;const d=c(e,i,o.format);Ta(t,d);const u=new lw(i,11);qO(u,d,t.getSpecialElements(),a.sanitizeNamespaceElement);d.innerHTML="";const[m,p]=$O(u,t,s,o);const y=[];const b=r?e=>g(e,y):D;const v={nodes:{},attributes:{}};const k=e=>$C(l(),f(),e,v);WO(u,[m,k],[p,b]);y.reverse();if(r&&y.length>0){if(o.context){const{pass:e,fail:n}=te(y,(e=>e.parent===u));rS(n,t,u,k);o.invalid=e.length>0}else{rS(y,t,u,k)}}const w=GO(s,o);if(w&&(u.name==="body"||o.isRootContent)){h(u,w)}if(!o.invalid){KC(v,o)}return u};const b={schema:t,addAttributeFilter:u,getAttributeFilters:f,removeAttributeFilter:m,addNodeFilter:i,getNodeFilters:l,removeNodeFilter:d,parse:y};xE(b,s);eE(b,s,t);return b};const YO=e=>GS(e)?Nw({validate:false}).serialize(e):e;const XO=(e,t,o)=>{const n=YO(e);const s=t(n);if(s.isDefaultPrevented()){return s}else if(GS(e)){if(s.content!==n){const t=KO({validate:false,forced_root_block:false,...o}).parse(s.content,{context:e.name});return{...s,content:t}}else{return{...s,content:e}}}else{return s}};const JO=e=>({sanitize:sg(e),sandbox_iframes:gg(e),sandbox_iframes_exclusions:pg(e)});const QO=(e,t)=>{if(t.no_events){return Xu.value(t)}else{const o=rb(e,t);if(o.isDefaultPrevented()){return Xu.error(ab(e,{content:"",...o}).content)}else{return Xu.value(o)}}};const eA=(e,t,o)=>{if(o.no_events){return t}else{const n=XO(t,(t=>ab(e,{...o,content:t})),JO(e));return n.content}};const tA=(e,t)=>{if(t.no_events){return Xu.value(t)}else{const o=XO(t.content,(o=>nb(e,{...t,content:o})),JO(e));if(o.isDefaultPrevented()){sb(e,o);return Xu.error(undefined)}else{return Xu.value(o)}}};const oA=(e,t,o)=>{if(!o.no_events){sb(e,{...o,content:t})}};const nA=(e,t,o)=>({element:e,width:t,rows:o});const sA=(e,t)=>({element:e,cells:t});const rA=(e,t)=>({x:e,y:t});const aA=(e,t)=>$o(e,t).bind(bt).getOr(1);const cA=(e,t,o,n,s)=>{const r=aA(s,"rowspan");const a=aA(s,"colspan");const c=e.rows;for(let e=o;e<o+r;e++){if(!c[e]){c[e]=sA(bl(n),[])}for(let n=t;n<t+a;n++){const r=c[e].cells;r[n]=e===o&&n===t?s:yl(s)}}};const iA=(e,t,o)=>{const n=e.rows;const s=n[o]?n[o].cells:[];return!!s[t]};const lA=(e,t,o)=>{while(iA(e,t,o)){t++}return t};const dA=e=>se(e,((e,t)=>t.cells.length>e?t.cells.length:e),0);const uA=(e,t)=>{const o=e.rows;for(let e=0;e<o.length;e++){const n=o[e].cells;for(let o=0;o<n.length;o++){if(xn(n[o],t)){return U.some(rA(o,e))}}}return U.none()};const fA=(e,t,o,n,s)=>{const r=[];const a=e.rows;for(let e=o;e<=s;e++){const o=a[e].cells;const s=t<n?o.slice(t,n+1):o.slice(n,t+1);r.push(sA(a[e].element,s))}return r};const mA=(e,t,o)=>{const n=t.x,s=t.y;const r=o.x,a=o.y;const c=s<a?fA(e,n,s,r,a):fA(e,n,a,r,s);return nA(e.element,dA(c),c)};const gA=(e,t)=>{const o=yl(e.element);const n=yn.fromTag("tbody");Os(n,t);zs(o,n);return o};const pA=e=>J(e.rows,(e=>{const t=J(e.cells,(e=>{const t=bl(e);Ko(t,"colspan");Ko(t,"rowspan");return t}));const o=yl(e.element);Os(o,t);return o}));const hA=e=>{const t=nA(yl(e),0,[]);Q(sr(e,"tr"),((e,o)=>{Q(sr(e,"td,th"),((n,s)=>{cA(t,lA(t,s,o),o,e,n)}))}));return nA(t.element,dA(t.rows),t.rows)};const yA=e=>gA(e,pA(e));const bA=(e,t,o)=>uA(e,t).bind((t=>uA(e,o).map((o=>mA(e,t,o)))));const vA=e=>ae(e,(e=>Mo(e)==="ul"||Mo(e)==="ol"));const kA=(e,t)=>ae(e,(e=>Mo(e)==="li"&&Nh(e,t))).fold(R([]),(t=>vA(e).map((e=>{const t=yn.fromTag(Mo(e));const o=Oe(ks(e),((e,t)=>lt(t,"list-style")));hs(t,o);return[yn.fromTag("li"),t]})).getOr([])));const wA=(e,t)=>{const o=se(t,((e,t)=>{zs(t,e);return t}),e);return t.length>0?sv([o]):o};const _A=e=>{if(Pl(e)){return On(e).filter(Il).fold(R([]),(t=>[e,t]))}else{return Il(e)?[e]:[]}};const xA=(e,t,o)=>{const n=yn.fromDom(t.commonAncestorContainer);const s=i_(n,e);const r=oe(s,(e=>o.isWrapper(Mo(e))));const a=kA(s,t);const c=r.concat(a.length?a:_A(n));return J(c,yl)};const CA=()=>sv([]);const SA=(e,t,o)=>wA(yn.fromDom(t.cloneContents()),xA(e,t,o));const zA=(e,t)=>as(t,"table",H(xn,e));const TA=(e,t)=>zA(e,t[0]).bind((e=>{const o=t[0];const n=t[t.length-1];const s=hA(e);return bA(s,o,n).map((e=>sv([yA(e)])))})).getOrThunk(CA);const EA=(e,t,o)=>t.length>0&&t[0].collapsed?CA():SA(e,t[0],o);const OA=(e,t,o)=>{const n=Sh(t,e);return n.length>0?TA(e,n):EA(e,t,o)};const AA=(e,t)=>t>=0&&t<e.length&&bh(e.charAt(t));const DA=e=>Yl(e.innerText);const NA=e=>e.map((e=>e.nodeName)).getOr("div").toLowerCase();const MA=e=>U.from(e.selection.getRng()).map((t=>{var o;const n=U.from(e.dom.getParent(t.commonAncestorContainer,e.dom.isBlock));const s=e.getBody();const r=NA(n);const a=yn.fromDom(t.cloneContents());Cw(a);Sw(a);const c=e.dom.add(s,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},a.dom);const i=DA(c);const l=Yl((o=c.textContent)!==null&&o!==void 0?o:"");e.dom.remove(c);if(AA(l,0)||AA(l,l.length-1)){const e=n.getOr(s);const t=DA(e);const o=t.indexOf(i);if(o===-1){return i}else{const e=AA(t,o-1);const n=AA(t,o+i.length);return(e?" ":"")+i+(n?" ":"")}}else{return i}})).getOr("");const RA=(e,t)=>{const o=e.selection.getRng(),n=e.dom.create("body");const s=e.selection.getSel();const r=sw(e,kh(s));const a=t.contextual?OA(yn.fromDom(e.getBody()),r,e.schema).dom:o.cloneContents();if(a){n.appendChild(a)}return e.selection.serializer.serialize(n,t)};const BA=(e,t)=>{if(t.format==="text"){return MA(e)}else{const o=RA(e,t);if(t.format==="tree"){return o}else{return e.selection.isCollapsed()?"":o}}};const LA=(e,t)=>({...e,format:t,get:true,selection:true,getInner:true});const HA=(e,t,o={})=>{const n=LA(o,t);return QO(e,n).fold(B,(t=>{const o=BA(e,t);return eA(e,o,t)}))};const IA=0,PA=1,FA=2;const VA=(e,t)=>{const o=e.length+t.length+2;const n=new Array(o);const s=new Array(o);const r=(e,t,o)=>({start:e,end:t,diag:o});const a=(o,n,s,r,c)=>{const l=i(o,n,s,r);if(l===null||l.start===n&&l.diag===n-r||l.end===o&&l.diag===o-s){let a=o;let i=s;while(a<n||i<r){if(a<n&&i<r&&e[a]===t[i]){c.push([IA,e[a]]);++a;++i}else{if(n-o>r-s){c.push([FA,e[a]]);++a}else{c.push([PA,t[i]]);++i}}}}else{a(o,l.start,s,l.start-l.diag,c);for(let t=l.start;t<l.end;++t){c.push([IA,e[t]])}a(l.end,n,l.end-l.diag,r,c)}};const c=(o,n,s,a)=>{let c=o;while(c-n<a&&c<s&&e[c]===t[c-n]){++c}return r(o,c,n)};const i=(o,r,a,i)=>{const l=r-o;const d=i-a;if(l===0||d===0){return null}const u=l-d;const f=d+l;const m=(f%2===0?f:f+1)/2;n[1+m]=o;s[1+m]=r+1;let g,p,h,y,b;for(g=0;g<=m;++g){for(p=-g;p<=g;p+=2){h=p+m;if(p===-g||p!==g&&n[h-1]<n[h+1]){n[h]=n[h+1]}else{n[h]=n[h-1]+1}y=n[h];b=y-o+a-p;while(y<r&&b<i&&e[y]===t[b]){n[h]=++y;++b}if(u%2!==0&&u-g<=p&&p<=u+g){if(s[h-u]<=n[h]){return c(s[h-u],p+o-a,r,i)}}}for(p=u-g;p<=u+g;p+=2){h=p+m-u;if(p===u-g||p!==u+g&&s[h+1]<=s[h-1]){s[h]=s[h+1]-1}else{s[h]=s[h-1]}y=s[h]-1;b=y-o+a-p;while(y>=o&&b>=a&&e[y]===t[b]){s[h]=y--;b--}if(u%2===0&&-g<=p&&p<=g){if(s[h]<=n[h+u]){return c(s[h],p+o-a,r,i)}}}}return null};const l=[];a(0,e.length,0,t.length,l);return l};const jA=e=>{if(_r(e)){return e.outerHTML}else if(Rr(e)){return pc.encodeRaw(e.data,false)}else if(Hr(e)){return"\x3c!--"+e.data+"--\x3e"}return""};const ZA=e=>{let t;const o=document.createElement("div");const n=document.createDocumentFragment();if(e){o.innerHTML=e}while(t=o.firstChild){n.appendChild(t)}return n};const UA=(e,t,o)=>{const n=ZA(t);if(e.hasChildNodes()&&o<e.childNodes.length){const t=e.childNodes[o];e.insertBefore(n,t)}else{e.appendChild(n)}};const qA=(e,t)=>{if(e.hasChildNodes()&&t<e.childNodes.length){const o=e.childNodes[t];e.removeChild(o)}};const WA=(e,t)=>{let o=0;Q(e,(e=>{if(e[0]===IA){o++}else if(e[0]===PA){UA(t,e[1],o);o++}else if(e[0]===FA){qA(t,o)}}))};const $A=(e,t)=>oe(J(be(e.childNodes),t?N(Yl,jA):jA),(e=>e.length>0));const GA=(e,t)=>{const o=J(be(t.childNodes),jA);WA(VA(o,e),t);return t};const KA=$e((()=>document.implementation.createHTMLDocument("undo")));const YA=e=>e.querySelector("iframe")!==null;const XA=e=>({type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null});const JA=e=>({type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null});const QA=e=>{const t=e.serializer.getTempAttrs();const o=xw(e.getBody(),t);return YA(o)?XA($A(o,true)):JA(Yl(o.innerHTML))};const eD=(e,t,o)=>{const n=o?t.beforeBookmark:t.bookmark;if(t.type==="fragmented"){GA(t.fragments,e.getBody())}else{e.setContent(t.content,{format:"raw",no_selection:T(n)&&Jp(n)?!n.isFakeCaret:true})}if(n){e.selection.moveToBookmark(n);e.selection.scrollIntoView()}};const tD=e=>e.type==="fragmented"?e.fragments.join(""):e.content;const oD=e=>{const t=yn.fromTag("body",KA());Ls(t,tD(e));Q(sr(t,"*[data-mce-bogus]"),Ns);return Bs(t)};const nD=(e,t)=>tD(e)===tD(t);const sD=(e,t)=>oD(e)===oD(t);const rD=(e,t)=>{if(!e||!t){return false}else if(nD(e,t)){return true}else{return sD(e,t)}};const aD=e=>e.get()===0;const cD=(e,t,o)=>{if(aD(o)){e.typing=t}};const iD=(e,t)=>{if(e.typing){cD(e,false,t);e.add()}};const lD=e=>{if(e.typing){e.typing=false;e.add()}};const dD=(e,t,o)=>{if(aD(t)){o.set($u(e.selection))}};const uD=(e,t,o,n,s,r,a)=>{const c=QA(e);const i=mo.extend(r||{},c);if(!aD(n)||e.removed){return null}const l=t.data[o.get()];if(e.dispatch("BeforeAddUndo",{level:i,lastLevel:l,originalEvent:a}).isDefaultPrevented()){return null}if(l&&rD(l,i)){return null}if(t.data[o.get()]){s.get().each((e=>{t.data[o.get()].beforeBookmark=e}))}const d=wm(e);if(d){if(t.data.length>d){for(let e=0;e<t.data.length-1;e++){t.data[e]=t.data[e+1]}t.data.length--;o.set(t.data.length)}}i.bookmark=$u(e.selection);if(o.get()<t.data.length-1){t.data.length=o.get()+1}t.data.push(i);o.set(t.data.length-1);const u={level:i,lastLevel:l,originalEvent:a};if(o.get()>0){e.setDirty(true);e.dispatch("AddUndo",u);e.dispatch("change",u)}else{e.dispatch("AddUndo",u)}return i};const fD=(e,t,o)=>{t.data=[];o.set(0);t.typing=false;e.dispatch("ClearUndos")};const mD=(e,t,o,n,s)=>{if(t.transact(n)){const n=t.data[o.get()].bookmark;const r=t.data[o.get()-1];eD(e,r,true);if(t.transact(s)){t.data[o.get()-1].beforeBookmark=n}}};const gD=(e,t,o)=>{let n;if(t.get()<o.length-1){t.set(t.get()+1);n=o[t.get()];eD(e,n,false);e.setDirty(true);e.dispatch("Redo",{level:n})}return n};const pD=(e,t,o,n)=>{let s;if(t.typing){t.add();t.typing=false;cD(t,false,o)}if(n.get()>0){n.set(n.get()-1);s=t.data[n.get()];eD(e,s,true);e.setDirty(true);e.dispatch("Undo",{level:s})}return s};const hD=e=>{e.clear();e.add()};const yD=(e,t,o)=>o.get()>0||t.typing&&t.data[0]&&!rD(QA(e),t.data[0]);const bD=(e,t)=>t.get()<e.data.length-1&&!e.typing;const vD=(e,t,o)=>{iD(e,t);e.beforeChange();e.ignore(o);return e.add()};const kD=(e,t)=>{try{e.set(e.get()+1);t()}finally{e.set(e.get()-1)}};const wD=(e,t)=>{const o=e.dom;const n=T(t)?t:e.getBody();Q(o.select("table,a",n),(t=>{switch(t.nodeName){case"TABLE":const n=Am(e);const s=o.getAttrib(t,"border");if((!s||s==="0")&&e.hasVisual){o.addClass(t,n)}else{o.removeClass(t,n)}break;case"A":if(!o.getAttrib(t,"href")){const n=o.getAttrib(t,"name")||t.id;const s=Dm(e);if(n&&e.hasVisual){o.addClass(t,s)}else{o.removeClass(t,s)}}break}}));e.dispatch("VisualAid",{element:t,hasVisual:e.hasVisual})};const _D=e=>({init:{bindEvents:D},undoManager:{beforeChange:(t,o)=>dD(e,t,o),add:(t,o,n,s,r,a)=>uD(e,t,o,n,s,r,a),undo:(t,o,n)=>pD(e,t,o,n),redo:(t,o)=>gD(e,t,o),clear:(t,o)=>fD(e,t,o),reset:e=>hD(e),hasUndo:(t,o)=>yD(e,t,o),hasRedo:(e,t)=>bD(e,t),transact:(e,t,o)=>vD(e,t,o),ignore:(e,t)=>kD(e,t),extra:(t,o,n,s)=>mD(e,t,o,n,s)},formatter:{match:(t,o,n,s)=>lz(e,t,o,n,s),matchAll:(t,o)=>dz(e,t,o),matchNode:(t,o,n,s)=>iz(e,t,o,n,s),canApply:t=>fz(e,t),closest:t=>uz(e,t),apply:(t,o,n)=>HT(e,t,o,n),remove:(t,o,n,s)=>ST(e,t,o,n,s),toggle:(t,o,n)=>$T(e,t,o,n),formatChanged:(t,o,n,s,r)=>WT(e,t,o,n,s,r)},editor:{getContent:t=>Ow(e,t),setContent:(t,o)=>QS(e,t,o),insertContent:(t,o)=>$S(e,t,o),addVisual:t=>wD(e,t)},selection:{getContent:(t,o)=>HA(e,t,o)},autocompleter:{addDecoration:D,removeDecoration:D},raw:{getModel:()=>U.none()}});const xD=e=>{const t=e=>k(e)?e:{};const{init:o,undoManager:n,formatter:s,editor:r,selection:a,autocompleter:c,raw:i}=e;return{init:{bindEvents:o.bindEvents},undoManager:{beforeChange:n.beforeChange,add:n.add,undo:n.undo,redo:n.redo,clear:n.clear,reset:n.reset,hasUndo:n.hasUndo,hasRedo:n.hasRedo,transact:(e,t,o)=>n.transact(o),ignore:(e,t)=>n.ignore(t),extra:(e,t,o,s)=>n.extra(o,s)},formatter:{match:(e,o,n,r)=>s.match(e,t(o),r),matchAll:s.matchAll,matchNode:s.matchNode,canApply:e=>s.canApply(e),closest:e=>s.closest(e),apply:(e,o,n)=>s.apply(e,t(o)),remove:(e,o,n,r)=>s.remove(e,t(o)),toggle:(e,o,n)=>s.toggle(e,t(o)),formatChanged:(e,t,o,n,r)=>s.formatChanged(t,o,n,r)},editor:{getContent:e=>r.getContent(e),setContent:(e,t)=>({content:r.setContent(e,t),html:""}),insertContent:(e,t)=>{r.insertContent(e);return""},addVisual:r.addVisual},selection:{getContent:(e,t)=>a.getContent(t)},autocompleter:{addDecoration:c.addDecoration,removeDecoration:c.removeDecoration},raw:{getModel:()=>U.some(i.getRawModel())}}};const CD=()=>{const e=R(null);const t=R("");return{init:{bindEvents:D},undoManager:{beforeChange:D,add:e,undo:e,redo:e,clear:D,reset:D,hasUndo:j,hasRedo:j,transact:e,ignore:D,extra:D},formatter:{match:j,matchAll:R([]),matchNode:R(undefined),canApply:j,closest:t,apply:D,remove:D,toggle:D,formatChanged:R({unbind:D})},editor:{getContent:t,setContent:R({content:"",html:""}),insertContent:R(""),addVisual:D},selection:{getContent:t},autocompleter:{addDecoration:D,removeDecoration:D},raw:{getModel:R(U.none())}}};const SD=e=>Me(e.plugins,"rtc");const zD=e=>Ne(e.plugins,"rtc").bind((e=>U.from(e.setup)));const TD=e=>{const t=e;return zD(e).fold((()=>{t.rtcInstance=_D(e);return U.none()}),(e=>{t.rtcInstance=CD();return U.some((()=>e().then((e=>{t.rtcInstance=xD(e);return e.rtc.isRemote}))))}))};const ED=e=>e.rtcInstance?e.rtcInstance:_D(e);const OD=e=>{const t=e.rtcInstance;if(!t){throw new Error("Failed to get RTC instance not yet initialized.")}else{return t}};const AD=(e,t,o)=>{OD(e).undoManager.beforeChange(t,o)};const DD=(e,t,o,n,s,r,a)=>OD(e).undoManager.add(t,o,n,s,r,a);const ND=(e,t,o,n)=>OD(e).undoManager.undo(t,o,n);const MD=(e,t,o)=>OD(e).undoManager.redo(t,o);const RD=(e,t,o)=>{OD(e).undoManager.clear(t,o)};const BD=(e,t)=>{OD(e).undoManager.reset(t)};const LD=(e,t,o)=>OD(e).undoManager.hasUndo(t,o);const HD=(e,t,o)=>OD(e).undoManager.hasRedo(t,o);const ID=(e,t,o,n)=>OD(e).undoManager.transact(t,o,n);const PD=(e,t,o)=>{OD(e).undoManager.ignore(t,o)};const FD=(e,t,o,n,s)=>{OD(e).undoManager.extra(t,o,n,s)};const VD=(e,t,o,n,s)=>OD(e).formatter.match(t,o,n,s);const jD=(e,t,o)=>OD(e).formatter.matchAll(t,o);const ZD=(e,t,o,n,s)=>OD(e).formatter.matchNode(t,o,n,s);const UD=(e,t)=>OD(e).formatter.canApply(t);const qD=(e,t)=>OD(e).formatter.closest(t);const WD=(e,t,o,n)=>{OD(e).formatter.apply(t,o,n)};const $D=(e,t,o,n,s)=>{OD(e).formatter.remove(t,o,n,s)};const GD=(e,t,o,n)=>{OD(e).formatter.toggle(t,o,n)};const KD=(e,t,o,n,s,r)=>OD(e).formatter.formatChanged(t,o,n,s,r);const YD=(e,t)=>ED(e).editor.getContent(t);const XD=(e,t,o)=>ED(e).editor.setContent(t,o);const JD=(e,t,o)=>ED(e).editor.insertContent(t,o);const QD=(e,t,o)=>OD(e).selection.getContent(t,o);const eN=(e,t)=>OD(e).editor.addVisual(t);const tN=e=>OD(e).init.bindEvents();const oN=(e,t={})=>{const o=t.format?t.format:"html";return QD(e,o,t)};const nN=e=>{if(e.dom.length===0){Ds(e);return U.none()}else{return U.some(e)}};const sN=(e,t)=>e.filter((e=>Vy.isBookmarkNode(e.dom))).bind(t?Rn:Mn);const rN=(e,t,o,n,s)=>{const r=e.dom;const a=t.dom;const c=n?r.length:a.length;if(n){ex(r,a,s,false,!n);o.setStart(a,c)}else{ex(a,r,s,false,!n);o.setEnd(a,c)}};const aN=(e,t,o)=>{On(e).each((n=>{const s=e.dom;if(t&&I_(n,mu(s,0),o)){J_(s,0,o)}else if(!t&&F_(n,mu(s,s.length),o)){Q_(s,s.length,o)}}))};const cN=(e,t,o,n,s)=>{e.bind((e=>{const r=n?Q_:J_;r(e.dom,n?e.dom.length:0,s);return t.filter(Po).map((t=>rN(e,t,o,n,s)))})).orThunk((()=>{const e=sN(t,n).or(t).filter(Po);return e.map((e=>aN(e,n,s)))}))};const iN=(e,t,o)=>{const n=U.from(t.firstChild).map(yn.fromDom);const s=U.from(t.lastChild).map(yn.fromDom);e.deleteContents();e.insertNode(t);const r=n.bind(Mn).filter(Po).bind(nN);const a=s.bind(Rn).filter(Po).bind(nN);cN(r,n,e,true,o);cN(a,s,e,false,o);e.collapse(false)};const lN=(e,t)=>({format:"html",...e,set:true,selection:true,content:t});const dN=(e,t)=>{if(t.format!=="raw"){const o=e.selection.getRng();const n=e.dom.getParent(o.commonAncestorContainer,e.dom.isBlock);const s=n?{context:n.nodeName.toLowerCase()}:{};const r=e.parser.parse(t.content,{forced_root_block:false,...s,...t});return Nw({validate:false},e.schema).serialize(r)}else{return t.content}};const uN=(e,t,o={})=>{const n=lN(o,t);tA(e,n).each((t=>{const o=dN(e,t);const n=e.selection.getRng();iN(n,n.createContextualFragment(o),e.schema);e.selection.setRng(n);Qv(e,n);oA(e,o,t)}))};const fN=(e,t,o)=>{if(Me(e,t)){const n=oe(e[t],(e=>e!==o));if(n.length===0){delete e[t]}else{e[t]=n}}};var mN=(e,t)=>{let o;let n;const s=(t,o)=>ae(o,(o=>e.is(o,t)));const r=t=>e.getParents(t,undefined,e.getRoot());const a=()=>{o={};n={};t.on("NodeChange",(e=>{const t=e.element;const a=r(t);const c={};xe(o,((e,t)=>{s(t,a).each((o=>{if(!n[t]){Q(e,(e=>{e(true,{node:o,selector:t,parents:a})}));n[t]=e}c[t]=e}))}));xe(n,((e,o)=>{if(!c[o]){delete n[o];Q(e,(e=>{e(false,{node:t,selector:o,parents:a})}))}}))}))};return{selectorChangedWithUnbind:(e,c)=>{if(!o){a()}if(!o[e]){o[e]=[]}o[e].push(c);s(e,r(t.selection.getStart())).each((()=>{n[e]=o[e]}));return{unbind:()=>{fN(o,e,c);fN(n,e,c)}}}}};const gN=e=>!!(e&&e.ownerDocument)&&Cn(yn.fromDom(e.ownerDocument),yn.fromDom(e));const pN=e=>{if(!e){return false}else{return gN(e.startContainer)&&gN(e.endContainer)}};const hN=(e,t,o,n)=>{let s;let r;const{selectorChangedWithUnbind:a}=mN(e,n);const c=(t,o)=>{const s=e.createRng();if(T(t)&&T(o)){s.setStart(t,o);s.setEnd(t,o);k(s);y(false)}else{Mh(e,s,n.getBody(),true);k(s)}};const i=e=>oN(n,e);const l=(e,t)=>uN(n,e,t);const d=e=>Jk(n.getBody(),v(),e);const u=e=>Qk(n.getBody(),v(),e);const f=(e,t)=>B.getBookmark(e,t);const m=e=>B.moveToBookmark(e);const g=(t,o)=>{nw(e,t,o).each(k);return t};const p=()=>{const e=v(),t=b();if(!e||e.item){return false}if(e.compareEndPoints){return e.compareEndPoints("StartToEnd",e)===0}return!t||e.collapsed};const h=()=>{const t=v();const o=n.getBody().querySelectorAll('[data-mce-selected="1"]');if(o.length>0){return de(o,(t=>e.isEditable(t.parentElement)))}else{return Yk(e,t)}};const y=e=>{const t=v();t.collapse(!!e);k(t)};const b=()=>t.getSelection?t.getSelection():t.document.selection;const v=()=>{let o;const a=(e,t,o)=>{try{return t.compareBoundaryPoints(e,o)}catch(e){return-1}};const c=t.document;if(T(n.bookmark)&&!qk(n)){const e=pk(n);if(e.isSome()){return e.map((e=>sw(n,[e])[0])).getOr(c.createRange())}}try{const e=b();if(e&&!wr(e.anchorNode)){if(e.rangeCount>0){o=e.getRangeAt(0)}else{o=c.createRange()}o=sw(n,[o])[0]}}catch(e){}if(!o){o=c.createRange()}if(Ir(o.startContainer)&&o.collapsed){const t=e.getRoot();o.setStart(t,0);o.setEnd(t,0)}if(s&&r){if(a(o.START_TO_START,o,s)===0&&a(o.END_TO_END,o,s)===0){o=r}else{s=null;r=null}}return o};const k=(e,t)=>{if(!pN(e)){return}const o=b();const a=n.dispatch("SetSelectionRange",{range:e,forward:t});e=a.range;if(o){r=e;try{o.removeAllRanges();o.addRange(e)}catch(e){}if(t===false&&o.extend){o.collapse(e.endContainer,e.endOffset);o.extend(e.startContainer,e.startOffset)}s=o.rangeCount>0?o.getRangeAt(0):null}if(!e.collapsed&&e.startContainer===e.endContainer&&(o===null||o===void 0?void 0:o.setBaseAndExtent)){if(e.endOffset-e.startOffset<2){if(e.startContainer.hasChildNodes()){const t=e.startContainer.childNodes[e.startOffset];if(t&&t.nodeName==="IMG"){o.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset);if(o.anchorNode!==e.startContainer||o.focusNode!==e.endContainer){o.setBaseAndExtent(t,0,t,1)}}}}}n.dispatch("AfterSetSelectionRange",{range:e,forward:t})};const w=t=>{l(e.getOuterHTML(t));return t};const _=()=>tw(n.getBody(),v());const x=(t,o)=>ow(e,v(),t,o);const C=()=>{const t=b();const o=t===null||t===void 0?void 0:t.anchorNode;const n=t===null||t===void 0?void 0:t.focusNode;if(!t||!o||!n||wr(o)||wr(n)){return true}const s=e.createRng();const r=e.createRng();try{s.setStart(o,t.anchorOffset);s.collapse(true);r.setStart(n,t.focusOffset);r.collapse(true)}catch(e){return true}return s.compareBoundaryPoints(s.START_TO_START,r)<=0};const S=()=>{const t=v();const o=b();if(!_h(o)&&Rh(n)){const o=bv(e,t);o.each((e=>{k(e,C())}));return o.getOr(t)}return t};const z=(e,t)=>{a(e,t);return R};const E=()=>{let t;let o=e.getRoot();while(o&&o.nodeName!=="BODY"){if(o.scrollHeight>o.clientHeight){t=o;break}o=o.parentNode}return t};const O=(e,t)=>{if(T(e)){Jv(n,e,t)}else{Qv(n,v(),t)}};const A=(e,t)=>k(cv(e,t,n.getDoc()));const D=()=>{const e=v();return e.collapsed?mu.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()};const N=()=>{t=s=r=null;L.destroy()};const M=(t={type:"word"})=>k(wv(e).expand(v(),t));const R={dom:e,win:t,serializer:o,editor:n,expand:M,collapse:y,setCursorLocation:c,getContent:i,setContent:l,getBookmark:f,moveToBookmark:m,select:g,isCollapsed:p,isEditable:h,isForward:C,setNode:w,getNode:_,getSel:b,setRng:k,getRng:v,getStart:d,getEnd:u,getSelectedBlocks:x,normalize:S,selectorChanged:z,selectorChangedWithUnbind:a,getScrollContainer:E,scrollIntoView:O,placeCaretAt:A,getBoundingClientRect:D,destroy:N};const B=Vy(R);const L=_b(R,n);R.bookmarkManager=B;R.controlSelection=L;return R};const yN=(e,t,o)=>{t.addNodeFilter("br",((t,n,s)=>{const r=mo.extend({},o.getBlockElements());const a=o.getNonEmptyElements();const c=o.getWhitespaceElements();r.body=1;const i=e=>e.name in r||Ba(o,e);for(let n=0,l=t.length;n<l;n++){let l=t[n];let d=l.parent;if(d&&i(d)&&l===d.lastChild){let t=l.prev;while(t){const e=t.name;if(e!=="span"||t.attr("data-mce-type")!=="bookmark"){if(e==="br"){l=null}break}t=t.prev}if(l){l.remove();if(tS(o,a,c,d)){const t=o.getElementRule(d.name);if(t){if(t.removeEmpty){d.remove()}else if(t.paddEmpty){XC(e,s,i,d)}}}}}else{let e=l;while(d&&d.firstChild===e&&d.lastChild===e){e=d;if(r[d.name]){break}d=d.parent}if(e===d){const e=new lw("#text",3);e.value=dr;l.replace(e)}}}}))};const bN=(e,t,o)=>{e.addAttributeFilter("data-mce-tabindex",((e,t)=>{let o=e.length;while(o--){const n=e[o];n.attr("tabindex",n.attr("data-mce-tabindex"));n.attr(t,null)}}));e.addAttributeFilter("src,href,style",((e,n)=>{const s="data-mce-"+n;const r=t.url_converter;const a=t.url_converter_scope;let c=e.length;while(c--){const t=e[c];let i=t.attr(s);if(i!==undefined){t.attr(n,i.length>0?i:null);t.attr(s,null)}else{i=t.attr(n);if(n==="style"){i=o.serializeStyle(o.parseStyle(i),t.name)}else if(r){i=r.call(a,i,n,t.name)}t.attr(n,i.length>0?i:null)}}}));e.addAttributeFilter("class",(e=>{let t=e.length;while(t--){const o=e[t];let n=o.attr("class");if(n){n=n.replace(/(?:^|\s)mce-item-\w+(?!\S)/g,"");o.attr("class",n.length>0?n:null)}}}));e.addAttributeFilter("data-mce-type",((e,t,o)=>{let n=e.length;while(n--){const t=e[n];if(t.attr("data-mce-type")==="bookmark"&&!o.cleanup){const e=U.from(t.firstChild).exists((e=>{var t;return!Kl((t=e.value)!==null&&t!==void 0?t:"")}));if(e){t.unwrap()}else{t.remove()}}}}));e.addNodeFilter("script,style",((e,o)=>{var n;const s=e=>e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"");let r=e.length;while(r--){const a=e[r];const c=a.firstChild;const i=(n=c===null||c===void 0?void 0:c.value)!==null&&n!==void 0?n:"";if(o==="script"){const e=a.attr("type");if(e){a.attr("type",e==="mce-no/type"?null:e.replace(/^mce\-/,""))}if(t.element_format==="xhtml"&&c&&i.length>0){c.value="// <![CDATA[\n"+s(i)+"\n// ]]>"}}else{if(t.element_format==="xhtml"&&c&&i.length>0){c.value="\x3c!--\n"+s(i)+"\n--\x3e"}}}}));e.addNodeFilter("#comment",(e=>{let n=e.length;while(n--){const s=e[n];const r=s.value;if(t.preserve_cdata&&(r===null||r===void 0?void 0:r.indexOf("[CDATA["))===0){s.name="#cdata";s.type=4;s.value=o.decode(r.replace(/^\[CDATA\[|\]\]$/g,""))}else if((r===null||r===void 0?void 0:r.indexOf("mce:protected "))===0){s.name="#text";s.type=3;s.raw=true;s.value=unescape(r).substr(14)}}}));e.addNodeFilter("xml:namespace,input",((e,t)=>{let o=e.length;while(o--){const n=e[o];if(n.type===7){n.remove()}else if(n.type===1){if(t==="input"&&!n.attr("type")){n.attr("type","text")}}}}));e.addAttributeFilter("data-mce-type",(t=>{Q(t,(t=>{if(t.attr("data-mce-type")==="format-caret"){if(t.isEmpty(e.schema.getNonEmptyElements())){t.remove()}else{t.unwrap()}}}))}));e.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,"+"data-mce-selected,data-mce-expando,data-mce-block,"+"data-mce-type,data-mce-resize,data-mce-placeholder",((e,t)=>{let o=e.length;while(o--){e[o].attr(t,null)}}));if(t.remove_trailing_brs){yN(t,e,e.schema)}};const vN=e=>{const t=e=>(e===null||e===void 0?void 0:e.name)==="br";const o=e.lastChild;if(t(o)){const e=o.prev;if(t(e)){o.remove();e.remove()}}};const kN=(e,t,o)=>{let n;const s=e.dom;let r=t.cloneNode(true);const a=document.implementation;if(a.createHTMLDocument){const e=a.createHTMLDocument("");mo.each(r.nodeName==="BODY"?r.childNodes:[r],(t=>{e.body.appendChild(e.importNode(t,true))}));if(r.nodeName!=="BODY"){r=e.body.firstChild}else{r=e.body}n=s.doc;s.doc=e}Zy(e,{...o,node:r});if(n){s.doc=n}return r};const wN=(e,t)=>T(e)&&e.hasEventListeners("PreProcess")&&!t.no_events;const _N=(e,t,o)=>wN(e,o)?kN(e,t,o):t;const xN=(e,t,o)=>{if(mo.inArray(t,o)===-1){e.addAttributeFilter(o,((e,t)=>{let o=e.length;while(o--){e[o].attr(t,null)}}));t.push(o)}};const CN=(e,t,o)=>{if(!t.no_events&&e){const n=Uy(e,{...t,content:o});return n.content}else{return o}};const SN=(e,t,o)=>{const n=Yl(o.getInner?t.innerHTML:e.getOuterHTML(t));return o.selection||jl(yn.fromDom(t))?n:mo.trim(n)};const zN=(e,t,o)=>{const n=o.selection?{forced_root_block:false,...o}:o;const s=e.parse(t,n);vN(s);return s};const TN=(e,t,o)=>{const n=Nw(e,t);return n.serialize(o)};const EN=(e,t,o,n,s)=>{const r=TN(t,o,n);return CN(e,s,r)};const ON=(e,t)=>{const o=["data-mce-selected"];const n={entity_encoding:"named",remove_trailing_brs:true,pad_empty_with_br:false,...e};const s=t&&t.dom?t.dom:zi.DOM;const r=t&&t.schema?t.schema:Vc(n);const a=KO(n,r);bN(a,n,s);const c=(e,o={})=>{const c={format:"html",...o};const i=_N(t,e,c);const l=SN(s,i,c);const d=zN(a,l,c);return c.format==="tree"?d:EN(t,n,r,d,c)};return{schema:r,addNodeFilter:a.addNodeFilter,addAttributeFilter:a.addAttributeFilter,serialize:c,addRules:r.addValidElements,setRules:r.setValidElements,addTempAttr:H(xN,a,o),getTempAttrs:R(o),getNodeFilters:a.getNodeFilters,getAttributeFilters:a.getAttributeFilters,removeNodeFilter:a.removeNodeFilter,removeAttributeFilter:a.removeAttributeFilter}};const AN=(e,t)=>{const o=ON(e,t);return{schema:o.schema,addNodeFilter:o.addNodeFilter,addAttributeFilter:o.addAttributeFilter,serialize:o.serialize,addRules:o.addRules,setRules:o.setRules,addTempAttr:o.addTempAttr,getTempAttrs:o.getTempAttrs,getNodeFilters:o.getNodeFilters,getAttributeFilters:o.getAttributeFilters,removeNodeFilter:o.removeNodeFilter,removeAttributeFilter:o.removeAttributeFilter}};const DN="html";const NN=(e,t)=>({...e,format:t,get:true,getInner:true});const MN=(e,t={})=>{const o=t.format?t.format:DN;const n=NN(t,o);return QO(e,n).fold(B,(t=>{const o=YD(e,t);return eA(e,o,t)}))};const RN="html";const BN=(e,t)=>({format:RN,...e,set:true,content:t});const LN=(e,t,o={})=>{const n=BN(o,t);return tA(e,n).map((t=>{const o=XD(e,t.content,t);oA(e,o.html,t);return o.content})).getOr(t)};const HN=("autoresize_on_init,content_editable_state,padd_empty_with_br,block_elements,"+"boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,"+"force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,"+"non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,"+"tab_focus,tabfocus_elements,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,"+"paste_enable_default_filters,paste_filter_drop,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists,"+"template_cdate_classes,template_mdate_classes,template_selected_content_classes,template_preview_replace_values,template_replace_values,templates,template_cdate_format,template_mdate_format").split(",");const IN=[];const PN="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,template,textcolor,rtc".split(",");const FN=[];const VN=(e,t)=>{const o=oe(t,(t=>Me(e,t)));return ge(o)};const jN=e=>{const t=VN(e,HN);const o=e.forced_root_block;if(o===false||o===""){t.push("forced_root_block (false only)")}return ge(t)};const ZN=e=>VN(e,IN);const UN=(e,t)=>{const o=mo.makeMap(e.plugins," ");const n=e=>Me(o,e);const s=oe(t,n);return ge(s)};const qN=e=>UN(e,PN);const WN=e=>UN(e,FN.map((e=>e.name)));const $N=(e,t)=>{const o=jN(e);const n=qN(t);const s=n.length>0;const r=o.length>0;const a=t.theme==="mobile";if(s||r||a){const e="\n- ";const t=a?`\n\nThemes:${e}mobile`:"";const c=s?`\n\nPlugins:${e}${n.join(e)}`:"";const i=r?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled and have been removed in TinyMCE 7.0. These features will no longer work and should be removed from the TinyMCE configuration. "+"See https://www.tiny.cloud/docs/tinymce/7/migration-from-6x/ for more information."+t+c+i)}};const GN=e=>ae(FN,(t=>t.name===e)).fold((()=>e),(t=>{if(t.replacedWith){return`${e}, replaced by ${t.replacedWith}`}else{return e}}));const KN=(e,t)=>{const o=ZN(e);const n=WN(t);const s=n.length>0;const r=o.length>0;if(s||r){const e="\n- ";const t=s?`\n\nPlugins:${e}${n.map(GN).join(e)}`:"";const a=r?`\n\nOptions:${e}${o.join(e)}`:"";console.warn("The following deprecated features are currently enabled but will be removed soon."+t+a)}};const YN=(e,t)=>{$N(e,t);KN(e,t)};const XN=zi.DOM;const JN=e=>{XN.setStyle(e.id,"display",e.orgDisplay)};const QN=e=>U.from(e).each((e=>e.destroy()));const eM=e=>{const t=e;t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null;t.bodyElement=t.contentDocument=t.contentWindow=null;t.iframeElement=t.targetElm=null;const o=e.selection;if(o){const e=o.dom;t.selection=o.win=o.dom=e.doc=null}};const tM=e=>{const t=e.formElement;if(t){if(t._mceOldSubmit){t.submit=t._mceOldSubmit;delete t._mceOldSubmit}XN.unbind(t,"submit reset",e.formEventDelegate)}};const oM=e=>{if(!e.removed){const{_selectionOverrides:t,editorUpload:o}=e;const n=e.getBody();const s=e.getElement();if(n){e.save({is_removing:true})}e.removed=true;e.unbindAllNativeEvents();if(e.hasHiddenInput&&T(s===null||s===void 0?void 0:s.nextSibling)){XN.remove(s.nextSibling)}qy(e);e.editorManager.remove(e);if(!e.inline&&n){JN(e)}Wy(e);XN.remove(e.getContainer());QN(t);QN(o);e.destroy()}};const nM=(e,t)=>{const{selection:o,dom:n}=e;if(e.destroyed){return}if(!t&&!e.removed){e.remove();return}if(!t){e.editorManager.off("beforeunload",e._beforeUnload);if(e.theme&&e.theme.destroy){e.theme.destroy()}QN(o);QN(n)}tM(e);eM(e);e.destroyed=true};const sM=()=>{const e={};const t=(t,o)=>{e[t]=o};const o=t=>{if(e[t]){return e[t]}else{return{icons:{}}}};const n=t=>Me(e,t);return{add:t,get:o,has:n}};const rM=sM();const aM=$i.ModelManager;const cM=(e,t)=>{const o=t.dom;return o[e]};const iM=(e,t)=>parseInt(ys(t,e),10);const lM=H(cM,"clientWidth");const dM=H(cM,"clientHeight");const uM=H(iM,"margin-top");const fM=H(iM,"margin-left");const mM=e=>e.dom.getBoundingClientRect();const gM=(e,t,o)=>{const n=lM(e);const s=dM(e);return t>=0&&o>=0&&t<=n&&o<=s};const pM=(e,t,o,n)=>{const s=mM(t);const r=e?s.left+t.dom.clientLeft+fM(t):0;const a=e?s.top+t.dom.clientTop+uM(t):0;const c=o-r;const i=n-a;return{x:c,y:i}};const hM=(e,t,o)=>{const n=yn.fromDom(e.getBody());const s=e.inline?n:Tn(n);const r=pM(e.inline,s,t,o);return gM(s,r.x,r.y)};const yM=e=>U.from(e).map(yn.fromDom);const bM=e=>{const t=e.inline?e.getBody():e.getContentAreaContainer();return yM(t).map(Qn).getOr(false)};var vM=()=>{const e=()=>{throw new Error("Theme did not provide a NotificationManager implementation.")};return{open:e,close:e,getArgs:e}};const kM=e=>{const t=[];const o=()=>{const t=e.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():vM()};const n=()=>U.from(t[0]);const s=(e,t)=>e.type===t.type&&e.text===t.text&&!e.progressBar&&!e.timeout&&!t.progressBar&&!t.timeout;const r=()=>{n().each((e=>{e.reposition()}))};const a=e=>{t.push(e)};const c=e=>{ce(t,(t=>t===e)).each((e=>{t.splice(e,1)}))};const i=(n,i=true)=>{if(e.removed||!bM(e)){return{}}if(i){e.dispatch("BeforeOpenNotification",{notification:n})}return ae(t,(e=>s(o().getArgs(e),n))).getOrThunk((()=>{e.editorManager.setActive(e);const t=o().open(n,(()=>{c(t)}),(()=>Wk(e)));a(t);r();e.dispatch("OpenNotification",{notification:{...t}});return t}))};const l=()=>{n().each((e=>{o().close(e);c(e);r()}))};const d=R(t);const u=e=>{e.on("SkinLoaded",(()=>{const t=rm(e);if(t){i({text:t,type:"warning",timeout:0},false)}r()}));e.on("show ResizeEditor NodeChange",(()=>{requestAnimationFrame(r)}));e.on("remove",(()=>{Q(t.slice(),(e=>{o().close(e)}))}));e.addShortcut("alt+F12","Focus to notification",(()=>n().map((e=>yn.fromDom(e.getEl()))).each((e=>ek(e)))))};u(e);return{open:i,close:l,getNotifications:d}};const wM=$i.PluginManager;const _M=$i.ThemeManager;var xM=()=>{const e=()=>{throw new Error("Theme did not provide a WindowManager implementation.")};return{open:e,openUrl:e,alert:e,confirm:e,close:e}};const CM=e=>{let t=[];const o=()=>{const t=e.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():xM()};const n=(e,t)=>(...o)=>t?t.apply(e,o):undefined;const s=t=>{e.dispatch("OpenWindow",{dialog:t})};const r=t=>{e.dispatch("CloseWindow",{dialog:t})};const a=e=>{t.push(e);s(e)};const c=o=>{r(o);t=oe(t,(e=>e!==o));if(t.length===0){e.focus()}};const i=()=>U.from(t[t.length-1]);const l=t=>{e.editorManager.setActive(e);gk(e);e.ui.show();const o=t();a(o);return o};const d=(e,t)=>l((()=>o().open(e,t,c)));const u=e=>l((()=>o().openUrl(e,c)));const f=(e,t,s)=>{const r=o();r.alert(e,n(s?s:r,t))};const m=(e,t,s)=>{const r=o();r.confirm(e,n(s?s:r,t))};const g=()=>{i().each((e=>{o().close(e);c(e)}))};e.on("remove",(()=>{Q(t,(e=>{o().close(e)}))}));return{open:d,openUrl:u,alert:f,confirm:m,close:g}};const SM=(e,t)=>{e.notificationManager.open({type:"error",text:t})};const zM=(e,t)=>{if(e._skinLoaded){SM(e,t)}else{e.on("SkinLoaded",(()=>{SM(e,t)}))}};const TM=(e,t)=>{zM(e,Wi.translate(["Failed to upload image: {0}",t]))};const EM=(e,t,o)=>{eb(e,t,{message:o});console.error(o)};const OM=(e,t,o)=>o?`Failed to load ${e}: ${o} from url ${t}`:`Failed to load ${e} url: ${t}`;const AM=(e,t,o)=>{EM(e,"PluginLoadError",OM("plugin",t,o))};const DM=(e,t,o)=>{EM(e,"IconsLoadError",OM("icons",t,o))};const NM=(e,t,o)=>{EM(e,"LanguageLoadError",OM("language",t,o))};const MM=(e,t,o)=>{EM(e,"ThemeLoadError",OM("theme",t,o))};const RM=(e,t,o)=>{EM(e,"ModelLoadError",OM("model",t,o))};const BM=(e,t,o)=>{const n=Wi.translate(["Failed to initialize plugin: {0}",t]);eb(e,"PluginLoadError",{message:n});LM(n,o);zM(e,n)};const LM=(e,...t)=>{const o=window.console;if(o){if(o.error){o.error(e,...t)}else{o.log(e,...t)}}};const HM=e=>/^[a-z0-9\-]+$/i.test(e);const IM=e=>"content/"+e+"/content.css";const PM=e=>tinymce.Resource.has(IM(e));const FM=e=>jM(e,Yf(e));const VM=e=>jM(e,Jf(e));const jM=(e,t)=>{const o=e.editorManager.baseURL+"/skins/content";const n=e.editorManager.suffix;const s=`content${n}.css`;return J(t,(t=>{if(PM(t)){return t}else if(HM(t)&&!e.inline){return`${o}/${t}/${s}`}else{return e.documentBaseURI.toAbsolute(t)}}))};const ZM=e=>{e.contentCSS=e.contentCSS.concat(FM(e),VM(e))};const UM=e=>e?be(e.getElementsByTagName("img")):[];const qM=(e,t)=>{const o={};const n=(n,s=Z)=>{const r=oe(UM(n),(t=>{const o=t.src;if(t.hasAttribute("data-mce-bogus")){return false}if(t.hasAttribute("data-mce-placeholder")){return false}if(!o||o===to.transparentSrc){return false}if(lt(o,"blob:")){return!e.isUploaded(o)&&s(t)}if(lt(o,"data:")){return s(t)}return false}));const a=J(r,(e=>{const n=e.src;if(Me(o,n)){return o[n].then((t=>{if(v(t)){return t}else{return{image:e,blobInfo:t.blobInfo}}}))}else{const s=mE(t,n).then((t=>{delete o[n];return{image:e,blobInfo:t}})).catch((e=>{delete o[n];return e}));o[n]=s;return s}}));return Promise.all(a)};return{findAll:n}};const WM=()=>{const e=1,t=2;let o={};const n=(e,t)=>({status:e,resultUri:t});const s=e=>e in o;const r=e=>{const t=o[e];return t?t.resultUri:null};const a=t=>s(t)?o[t].status===e:false;const c=e=>s(e)?o[e].status===t:false;const i=t=>{o[t]=n(e,null)};const l=(e,s)=>{o[e]=n(t,s)};const d=e=>{delete o[e]};const u=()=>{o={}};return{hasBlobUri:s,getResultUri:r,isPending:a,isUploaded:c,markPending:i,markUploaded:l,removeFailed:d,destroy:u}};let $M=0;const GM=()=>{const e=()=>Math.round(Math.random()*4294967295).toString(36);const t=(new Date).getTime();return"s"+t.toString(36)+e()+e()+e()};const KM=e=>e+$M+++GM();const YM=()=>{let e=[];const t=e=>{const t={"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png","image/apng":"apng","image/avif":"avif","image/svg+xml":"svg","image/webp":"webp","image/bmp":"bmp","image/tiff":"tiff"};return t[e.toLowerCase()]||"dat"};const o=(e,t,o,s,r)=>{if(v(e)){const a=e;return n({id:a,name:s,filename:r,blob:t,base64:o})}else if(k(e)){return n(e)}else{throw new Error("Unknown input type")}};const n=e=>{if(!e.blob||!e.base64){throw new Error("blob and base64 representations of the image are required for BlobInfo to be created")}const o=e.id||KM("blobid");const n=e.name||o;const s=e.blob;return{id:R(o),name:R(n),filename:R(e.filename||n+"."+t(s.type)),blob:R(s),base64:R(e.base64),blobUri:R(e.blobUri||URL.createObjectURL(s)),uri:R(e.uri)}};const s=t=>{if(!a(t.id())){e.push(t)}};const r=t=>ae(e,t).getOrUndefined();const a=e=>r((t=>t.id()===e));const c=e=>r((t=>t.blobUri()===e));const i=(e,t)=>r((o=>o.base64()===e&&o.blob().type===t));const l=t=>{e=oe(e,(e=>{if(e.blobUri()===t){URL.revokeObjectURL(e.blobUri());return false}return true}))};const d=()=>{Q(e,(e=>{URL.revokeObjectURL(e.blobUri())}));e=[]};return{create:o,add:s,get:a,getByUri:c,getByData:i,findFirst:r,removeByUri:l,destroy:d}};const XM=(e,t)=>{const o={};const n=(e,t)=>{if(e){return e.replace(/\/$/,"")+"/"+t.replace(/^\//,"")}return t};const s=(e,o)=>new Promise(((s,r)=>{const a=new XMLHttpRequest;a.open("POST",t.url);a.withCredentials=t.credentials;a.upload.onprogress=e=>{o(e.loaded/e.total*100)};a.onerror=()=>{r("Image upload failed due to a XHR Transport error. Code: "+a.status)};a.onload=()=>{if(a.status<200||a.status>=300){r("HTTP Error: "+a.status);return}const e=JSON.parse(a.responseText);if(!e||!v(e.location)){r("Invalid JSON: "+a.responseText);return}s(n(t.basePath,e.location))};const c=new FormData;c.append("file",e.blob(),e.filename());a.send(c)}));const r=E(t.handler)?t.handler:s;const a=()=>new Promise((e=>{e([])}));const c=(e,t)=>({url:t,blobInfo:e,status:true});const i=(e,t)=>({url:"",blobInfo:e,status:false,error:t});const l=(e,t)=>{mo.each(o[e],(e=>{e(t)}));delete o[e]};const d=(t,o,n)=>{e.markPending(t.blobUri());return new Promise((s=>{let r;let a;try{const d=()=>{if(r){r.close();a=D}};const u=o=>{d();e.markUploaded(t.blobUri(),o);l(t.blobUri(),c(t,o));s(c(t,o))};const f=o=>{d();e.removeFailed(t.blobUri());l(t.blobUri(),i(t,o));s(i(t,o))};a=e=>{if(e<0||e>100){return}U.from(r).orThunk((()=>U.from(n).map(F))).each((t=>{r=t;t.progressBar.value(e)}))};o(t,a).then(u,(e=>{f(v(e)?{message:e}:e)}))}catch(e){s(i(t,e))}}))};const u=e=>e===s;const f=e=>{const t=e.blobUri();return new Promise((e=>{o[t]=o[t]||[];o[t].push(e)}))};const m=(t,o)=>{t=mo.grep(t,(t=>!e.isUploaded(t.blobUri())));return Promise.all(mo.map(t,(t=>e.isPending(t.blobUri())?f(t):d(t,r,o))))};const g=(e,o)=>!t.url&&u(r)?a():m(e,o);return{upload:g}};const JM=e=>()=>e.notificationManager.open({text:e.translate("Image uploading..."),type:"info",timeout:-1,progressBar:true});const QM=(e,t)=>XM(t,{url:Ff(e),basePath:Vf(e),credentials:jf(e),handler:Zf(e)});const eR=e=>{const t=WM();const o=QM(e,t);return{upload:(t,n=true)=>o.upload(t,n?JM(e):undefined)}};const tR=(e,t)=>e.dom.isEmpty(t.dom)&&T(e.schema.getTextBlockElements()[Mo(t)]);const oR=e=>t=>{if(tR(e,t)){zs(t,yn.fromHtml('<br data-mce-bogus="1" />'))}};const nR=e=>{const t=YM();let o,n;const s=WM();const r=[];const a=t=>o=>{if(e.selection){return t(o)}return[]};const c=e=>e+(e.indexOf("?")===-1?"?":"&")+(new Date).getTime();const i=(e,t,o)=>{let n=0;do{n=e.indexOf(t,n);if(n!==-1){e=e.substring(0,n)+o+e.substr(n+t.length);n+=o.length-t.length+1}}while(n!==-1);return e};const l=(e,t,o)=>{const n=`src="${o}"${o===to.transparentSrc?' data-mce-placeholder="1"':""}`;e=i(e,`src="${t}"`,n);e=i(e,'data-mce-src="'+t+'"','data-mce-src="'+o+'"');return e};const d=(t,o)=>{Q(e.undoManager.data,(e=>{if(e.type==="fragmented"){e.fragments=J(e.fragments,(e=>l(e,t,o)))}else{e.content=l(e.content,t,o)}}))};const u=(t,o)=>{const n=e.convertURL(o,"src");d(t.src,o);qo(yn.fromDom(t),{src:Lf(e)?c(o):o,"data-mce-src":n})};const f=()=>{if(!o){o=QM(e,s)}return h().then(a((n=>{const s=J(n,(e=>e.blobInfo));return o.upload(s,JM(e)).then(a((o=>{const s=[];let r=false;const a=J(o,((o,a)=>{const{blobInfo:c,image:i}=n[a];let l=false;if(o.status&&Hf(e)){if(o.url&&!it(i.src,o.url)){r=true}t.removeByUri(i.src);if(SD(e));else{u(i,o.url)}}else if(o.error){if(o.error.remove){d(i.src,to.transparentSrc);s.push(i);l=true}TM(e,o.error.message)}return{element:i,status:o.status,uploadUri:o.url,blobInfo:c,removed:l}}));if(s.length>0&&!SD(e)){e.undoManager.transact((()=>{Q(Rs(s),(o=>{const n=On(o);Ds(o);n.each(oR(e));t.removeByUri(o.dom.src)}))}))}else if(r){e.undoManager.dispatchChange()}return a})))})))};const m=()=>Bf(e)?f():Promise.resolve([]);const g=e=>de(r,(t=>t(e)));const p=e=>{r.push(e)};const h=()=>{if(!n){n=qM(s,t)}return n.findAll(e.getBody(),g).then(a((t=>{const o=oe(t,(t=>{if(v(t)){zM(e,t);return false}else if(t.uriType==="blob"){return false}else{return true}}));if(SD(e));else{Q(o,(e=>{d(e.image.src,e.blobInfo.blobUri());e.image.src=e.blobInfo.blobUri();e.image.removeAttribute("data-mce-src")}))}return o})))};const y=()=>{t.destroy();s.destroy();n=o=null};const b=o=>o.replace(/src="(blob:[^"]+)"/g,((o,n)=>{const r=s.getResultUri(n);if(r){return'src="'+r+'"'}let a=t.getByUri(n);if(!a){a=se(e.editorManager.get(),((e,t)=>e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)),undefined)}if(a){const e=a.blob();return'src="data:'+e.type+";base64,"+a.base64()+'"'}return o}));e.on("SetContent",(()=>{if(Bf(e)){m()}else{h()}}));e.on("RawSaveContent",(e=>{e.content=b(e.content)}));e.on("GetContent",(e=>{if(e.source_view||e.format==="raw"||e.format==="tree"){return}e.content=b(e.content)}));e.on("PostRender",(()=>{e.parser.addNodeFilter("img",(e=>{Q(e,(e=>{const o=e.attr("src");if(!o||t.getByUri(o)){return}const n=s.getResultUri(o);if(n){e.attr("src",n)}}))}))}));return{blobCache:t,addFilter:p,uploadImages:f,uploadImagesAuto:m,scanForImages:h,destroy:y}};const sR=e=>{const t=e.dom;const o=e.schema.type;const n={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:false,classes:"align-left",ceFalseOverride:true,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"left"},inherit:false,preview:false},{selector:"img,audio,video",collapsed:false,styles:{float:"left"},preview:"font-family font-size"},{selector:"table",collapsed:false,styles:{marginLeft:"0px",marginRight:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:true,styles:{float:"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"center"},inherit:false,preview:"font-family font-size"},{selector:"figure.image",collapsed:false,classes:"align-center",ceFalseOverride:true,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:false},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"},{selector:".mce-preview-object",ceFalseOverride:true,styles:{display:"table",marginLeft:"auto",marginRight:"auto"},preview:false},{selector:"[data-ephox-embed-iri]",ceFalseOverride:true,styles:{marginLeft:"auto",marginRight:"auto"},preview:false}],alignright:[{selector:"figure.image",collapsed:false,classes:"align-right",ceFalseOverride:true,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"right"},inherit:false,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:false,styles:{float:"right"},preview:"font-family font-size"},{selector:"table",collapsed:false,styles:{marginRight:"0px",marginLeft:"auto"},onformat:e=>{t.setStyle(e,"float",null)},preview:"font-family font-size"},{selector:".mce-preview-object,[data-ephox-embed-iri]",ceFalseOverride:true,styles:{float:"right"},preview:false}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li,pre",styles:{textAlign:"justify"},inherit:false,preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all",preserve_attributes:["class","style"]}],italic:[{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all",preserve_attributes:["class","style"]}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:(()=>{const e={inline:"span",styles:{textDecoration:"line-through"},exact:true};const t={inline:"strike",remove:"all",preserve_attributes:["class","style"]};const n={inline:"s",remove:"all",preserve_attributes:["class","style"]};return o!=="html4"?[n,e,t]:[e,n,t]})(),forecolor:{inline:"span",styles:{color:"%value"},links:true,remove_similar:true,clear_child_styles:true},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:true,remove_similar:true,clear_child_styles:true},fontname:{inline:"span",toggle:false,styles:{fontFamily:"%value"},clear_child_styles:true},fontsize:{inline:"span",toggle:false,styles:{fontSize:"%value"},clear_child_styles:true},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:true,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:(e,t,o)=>_r(e)&&e.hasAttribute("href"),onformat:(e,o,n)=>{mo.each(n,((o,n)=>{t.setAttrib(e,n,o)}))}},lang:{inline:"span",clear_child_styles:true,remove_similar:true,attributes:{lang:"%value","data-mce-lang":e=>{var t;return(t=e===null||e===void 0?void 0:e.customValue)!==null&&t!==void 0?t:null}}},removeformat:[{selector:"b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]};mo.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(e=>{n[e]={block:e,remove:"all"}}));return n};const rR={remove_similar:true,inherit:false};const aR={selector:"td,th",...rR};const cR={tablecellbackgroundcolor:{styles:{backgroundColor:"%value"},...aR},tablecellverticalalign:{styles:{"vertical-align":"%value"},...aR},tablecellbordercolor:{styles:{borderColor:"%value"},...aR},tablecellclass:{classes:["%value"],...aR},tableclass:{selector:"table",classes:["%value"],...rR},tablecellborderstyle:{styles:{borderStyle:"%value"},...aR},tablecellborderwidth:{styles:{borderWidth:"%value"},...aR}};const iR=R(cR);const lR=e=>{const t={};const o=e=>T(e)?t[e]:t;const n=e=>Me(t,e);const s=(e,o)=>{if(e){if(!v(e)){xe(e,((e,t)=>{s(t,e)}))}else{if(!_(o)){o=[o]}Q(o,(e=>{if(S(e.deep)){e.deep=!cy(e)}if(S(e.split)){e.split=!cy(e)||iy(e)}if(S(e.remove)&&cy(e)&&!iy(e)){e.remove="none"}if(cy(e)&&iy(e)){e.mixed=true;e.block_expand=true}if(v(e.classes)){e.classes=e.classes.split(/\s+/)}}));t[e]=o}}};const r=e=>{if(e&&t[e]){delete t[e]}return t};s(sR(e));s(iR());s(um(e));return{get:o,has:n,register:s,unregister:r}};const dR=mo.each;const uR=zi.DOM;const fR=e=>T(e)&&k(e);const mR=(e,t)=>{const o=t&&t.schema||Vc({});const n=(e,t)=>{if(t.classes.length>0){uR.addClass(e,t.classes.join(" "))}uR.setAttribs(e,t.attrs)};const s=e=>{const t=v(e)?{name:e,classes:[],attrs:{}}:e;const o=uR.create(t.name);n(o,t);return o};const r=(e,t)=>{const n=o.getElementRule(e.nodeName.toLowerCase());const s=n===null||n===void 0?void 0:n.parentsRequired;if(s&&s.length){return t&&Y(s,t)?t:s[0]}else{return false}};const a=(e,t,o)=>{let n;const c=t[0];const i=fR(c)?c.name:undefined;const l=r(e,i);if(l){if(i===l){n=c;t=t.slice(1)}else{n=l}}else if(c){n=c;t=t.slice(1)}else if(!o){return e}const d=n?s(n):uR.create("div");d.appendChild(e);if(o){mo.each(o,(t=>{const o=s(t);d.insertBefore(o,e)}))}const u=fR(n)?n.siblings:undefined;return a(d,t,u)};const c=uR.create("div");if(e.length>0){const t=e[0];const o=s(t);const n=fR(t)?t.siblings:undefined;c.appendChild(a(o,e.slice(1),n))}return c};const gR=e=>{e=mo.trim(e);let t="div";const o={name:t,classes:[],attrs:{},selector:e};if(e!=="*"){t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,((e,t,n,s,r)=>{switch(t){case"#":o.attrs.id=n;break;case".":o.classes.push(n);break;case":":if(mo.inArray("checked disabled enabled read-only required".split(" "),n)!==-1){o.attrs[n]=n}break}if(s==="["){const e=r.match(/([\w\-]+)(?:\=\"([^\"]+))?/);if(e){o.attrs[e[1]]=e[2]}}return""}))}o.name=t||"div";return o};const pR=e=>{if(!v(e)){return[]}e=e.split(/\s*,\s*/)[0];e=e.replace(/\s*(~\+|~|\+|>)\s*/g,"$1");return mo.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),(e=>{const t=mo.map(e.split(/(?:~\+|~|\+)/),gR);const o=t.pop();if(t.length){o.siblings=t}return o})).reverse()};const hR=(e,t)=>{let o="";let n=fm(e);if(n===""){return""}const s=e=>v(e)?e.replace(/%(\w+)/g,""):"";const r=(t,o)=>uR.getStyle(o!==null&&o!==void 0?o:e.getBody(),t,true);if(v(t)){const o=e.formatter.get(t);if(!o){return""}t=o[0]}if("preview"in t){const e=t.preview;if(e===false){return""}else{n=e||n}}let a=t.block||t.inline||"span";let c;const i=pR(t.selector);if(i.length>0){if(!i[0].name){i[0].name=a}a=t.selector;c=mR(i,e)}else{c=mR([a],e)}const l=uR.select(a,c)[0]||c.firstChild;dR(t.styles,((e,t)=>{const o=s(e);if(o){uR.setStyle(l,t,o)}}));dR(t.attributes,((e,t)=>{const o=s(e);if(o){uR.setAttrib(l,t,o)}}));dR(t.classes,(e=>{const t=s(e);if(!uR.hasClass(l,t)){uR.addClass(l,t)}}));e.dispatch("PreviewFormats");uR.setStyles(c,{position:"absolute",left:-65535});e.getBody().appendChild(c);const d=r("fontSize");const u=/px$/.test(d)?parseInt(d,10):0;dR(n.split(" "),(e=>{let t=r(e,l);if(e==="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)){t=r(e);if(Qc(t).toLowerCase()==="#ffffff"){return}}if(e==="color"){if(Qc(t).toLowerCase()==="#000000"){return}}if(e==="font-size"){if(/em|%$/.test(t)){if(u===0){return}const e=parseFloat(t)/(/%$/.test(t)?100:1);t=e*u+"px"}}if(e==="border"&&t){o+="padding:0 2px;"}o+=e+":"+t+";"}));e.dispatch("AfterPreviewFormats");uR.remove(c);return o};const yR=e=>{e.addShortcut("meta+b","","Bold");e.addShortcut("meta+i","","Italic");e.addShortcut("meta+u","","Underline");for(let t=1;t<=6;t++){e.addShortcut("access+"+t,"",["FormatBlock",false,"h"+t])}e.addShortcut("access+7","",["FormatBlock",false,"p"]);e.addShortcut("access+8","",["FormatBlock",false,"div"]);e.addShortcut("access+9","",["FormatBlock",false,"address"])};const bR=e=>{const t=lR(e);const o=ia({});yR(e);Oz(e);if(!SD(e)){PT(o,e)}return{get:t.get,has:t.has,register:t.register,unregister:t.unregister,apply:(t,o,n)=>{WD(e,t,o,n)},remove:(t,o,n,s)=>{$D(e,t,o,n,s)},toggle:(t,o,n)=>{GD(e,t,o,n)},match:(t,o,n,s)=>VD(e,t,o,n,s),closest:t=>qD(e,t),matchAll:(t,o)=>jD(e,t,o),matchNode:(t,o,n,s)=>ZD(e,t,o,n,s),canApply:t=>UD(e,t),formatChanged:(t,n,s,r)=>KD(e,o,t,n,s,r),getCssText:H(hR,e)}};const vR=e=>{switch(e.toLowerCase()){case"undo":case"redo":case"mcefocus":return true;default:return false}};const kR=(e,t,o)=>{const n=ia(false);const s=e=>{cD(t,false,o);t.add({},e)};e.on("init",(()=>{t.add()}));e.on("BeforeExecCommand",(e=>{const n=e.command;if(!vR(n)){iD(t,o);t.beforeChange()}}));e.on("ExecCommand",(e=>{const t=e.command;if(!vR(t)){s(e)}}));e.on("ObjectResizeStart cut",(()=>{t.beforeChange()}));e.on("SaveContent ObjectResized blur",s);e.on("dragend",s);e.on("keyup",(o=>{const r=o.keyCode;if(o.isDefaultPrevented()){return}const a=to.os.isMacOS()&&o.key==="Meta";if(r>=33&&r<=36||r>=37&&r<=40||r===45||o.ctrlKey||a){s();e.nodeChanged()}if(r===46||r===8){e.nodeChanged()}if(n.get()&&t.typing&&!rD(QA(e),t.data[0])){if(!e.isDirty()){e.setDirty(true)}e.dispatch("TypingUndo");n.set(false);e.nodeChanged()}}));e.on("keydown",(e=>{const r=e.keyCode;if(e.isDefaultPrevented()){return}if(r>=33&&r<=36||r>=37&&r<=40||r===45){if(t.typing){s(e)}return}const a=e.ctrlKey&&!e.altKey||e.metaKey;if((r<16||r>20)&&r!==224&&r!==91&&!t.typing&&!a){t.beforeChange();cD(t,true,o);t.add({},e);n.set(true);return}const c=to.os.isMacOS()?e.metaKey:e.ctrlKey&&!e.altKey;if(c){t.beforeChange()}}));e.on("mousedown",(e=>{if(t.typing){s(e)}}));const r=e=>e.inputType==="insertReplacementText";const a=e=>e.inputType==="insertText"&&e.data===null;const c=e=>e.inputType==="insertFromPaste"||e.inputType==="insertFromDrop";e.on("input",(e=>{if(e.inputType&&(r(e)||a(e)||c(e))){s(e)}}));e.on("AddUndo Undo Redo ClearUndos",(t=>{if(!t.isDefaultPrevented()){e.nodeChanged()}}))};const wR=e=>{e.addShortcut("meta+z","","Undo");e.addShortcut("meta+y,meta+shift+z","","Redo")};const _R=e=>{const t=ua();const o=ia(0);const n=ia(0);const s={data:[],typing:false,beforeChange:()=>{AD(e,o,t)},add:(r,a)=>DD(e,s,n,o,t,r,a),dispatchChange:()=>{e.setDirty(true);const t=QA(e);t.bookmark=$u(e.selection);e.dispatch("change",{level:t,lastLevel:pe(s.data,n.get()).getOrUndefined()})},undo:()=>ND(e,s,o,n),redo:()=>MD(e,n,s.data),clear:()=>{RD(e,s,n)},reset:()=>{BD(e,s)},hasUndo:()=>LD(e,s,n),hasRedo:()=>HD(e,s,n),transact:t=>ID(e,s,o,t),ignore:t=>{PD(e,o,t)},extra:(t,o)=>{FD(e,s,n,t,o)}};if(!SD(e)){kR(e,s,o)}wR(e);return s};const xR=[9,27,pb.HOME,pb.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,pb.DOWN,pb.UP,pb.LEFT,pb.RIGHT].concat(to.browser.isFirefox()?[224]:[]);const CR="data-mce-placeholder";const SR=e=>e.type==="keydown"||e.type==="keyup";const zR=e=>{const t=e.keyCode;return t===pb.BACKSPACE||t===pb.DELETE};const TR=e=>{if(SR(e)){const t=e.keyCode;return!zR(e)&&(pb.metaKeyPressed(e)||e.altKey||t>=112&&t<=123||Y(xR,t))}else{return false}};const ER=e=>SR(e)&&!(zR(e)||e.type==="keyup"&&e.keyCode===229);const OR=(e,t,o)=>{if(e.isEmpty(t,undefined,{skipBogus:false,includeZwsp:true})){const n=t.firstElementChild;if(!n){return true}else if(e.getStyle(t.firstElementChild,"padding-left")||e.getStyle(t.firstElementChild,"padding-right")){return false}else{return o===n.nodeName.toLowerCase()}}else{return false}};const AR=e=>{var t;const o=e.dom;const n=Ef(e);const s=(t=nm(e))!==null&&t!==void 0?t:"";const r=(t,a)=>{if(TR(t)){return}const c=e.getBody();const i=ER(t)?false:OR(o,c,n);const l=o.getAttrib(c,CR)!=="";if(l!==i||a){o.setAttrib(c,CR,i?s:null);Qy(e,i);e.on(i?"keydown":"keyup",r);e.off(i?"keyup":"keydown",r)}};if(pt(s)){e.on("init",(t=>{r(t,true);e.on("change SetContent ExecCommand",r);e.on("paste",(t=>wk.setEditorTimeout(e,(()=>r(t)))))}))}};const DR=(e,t)=>({block:e,position:t});const NR=(e,t)=>({from:e,to:t});const MR=(e,t)=>{const o=yn.fromDom(e);const n=yn.fromDom(t.container());return Hx(o,n).map((e=>DR(e,t)))};const RR=e=>!(Cn(e.to.block,e.from.block)||Cn(e.from.block,e.to.block));const BR=e=>!xn(e.from.block,e.to.block);const LR=(e,t)=>{const o=t=>xn(t,e);const n=e=>Vl(e)||jr(e.dom);return os(t,n,o).filter(Io).getOr(e)};const HR=(e,t)=>{const o=yn.fromDom(e);return xn(LR(o,t.from.block),LR(o,t.to.block))};const IR=e=>Zr(e.from.block.dom)===false&&Zr(e.to.block.dom)===false;const PR=e=>{const t=e=>Hl(e)||Aa(e.dom)||Pl(e);return t(e.from.block)&&t(e.to.block)};const FR=(e,t,o,n)=>{if(Fr(n.position.getNode())&&!aa(e,n.block)){return Fp(false,n.block.dom).bind((e=>{if(e.isEqual(n.position)){return Hp(o,t,e).bind((e=>MR(t,e)))}else{return U.some(n)}})).getOr(n)}else{return n}};const VR=(e,t,o,n)=>{const s=MR(t,mu.fromRangeStart(n));const r=s.bind((n=>Hp(o,t,n.position).bind((n=>MR(t,n).map((n=>FR(e,t,o,n)))))));return yo(s,r,NR).filter((e=>BR(e)&&HR(t,e)&&IR(e)&&PR(e)&&RR(e)))};const jR=(e,t,o,n)=>n.collapsed?VR(e,t,o,n):U.none();const ZR=(e,t)=>{const o=Hn(e);return ce(o,(e=>t.isBlock(Mo(e)))).fold(R(o),(e=>o.slice(0,e)))};const UR=(e,t)=>{const o=ZR(e,t);Q(o,Ds);return o};const qR=(e,t,o)=>{const n=i_(o,t);return ae(n.reverse(),(t=>aa(e,t))).each(Ds)};const WR=(e,t)=>oe(Bn(t),(t=>!aa(e,t))).length===0;const $R=(e,t,o,n,s)=>{if(aa(n,o)){Wl(o);return Zp(o.dom)}if(WR(n,s)&&aa(n,t)){xs(s,yn.fromTag("br"))}const r=jp(o.dom,mu.before(s.dom));Q(UR(t,n),(e=>{xs(s,e)}));qR(n,e,t);return r};const GR=(e,t)=>e.isInline(Mo(t));const KR=(e,t,o,n)=>{if(aa(n,o)){if(aa(n,t)){const e=e=>{const t=(e,o)=>Pn(e).fold((()=>o),(e=>GR(n,e)?t(e,o.concat(yl(e))):o));return t(e,[])};const s=ne(e(o),((e,t)=>{Ts(e,t);return t}),ql());As(t);zs(t,s)}Ds(o);return Zp(t.dom)}const s=Up(o.dom);Q(UR(t,n),(e=>{zs(o,e)}));qR(n,e,t);return s};const YR=(e,t)=>{const o=i_(t,e);return U.from(o[o.length-1])};const XR=(e,t)=>Cn(t,e)?YR(t,e):U.none();const JR=(e,t)=>{Fp(e,t.dom).bind((e=>U.from(e.getNode()))).map(yn.fromDom).filter(Ll).each(Ds)};const QR=(e,t,o,n)=>{JR(true,t);JR(false,o);return XR(t,o).fold(H(KR,e,t,o,n),H($R,e,t,o,n))};const eB=(e,t,o,n,s)=>t?QR(e,n,o,s):QR(e,o,n,s);const tB=(e,t)=>{const o=yn.fromDom(e.getBody());const n=jR(e.schema,o.dom,t,e.selection.getRng()).map((n=>()=>{eB(o,t,n.from.block,n.to.block,e.schema).each((t=>{e.selection.setRng(t.toRange())}))}));return n};const oB=(e,t,o)=>{const n=t.getRng();return yo(Hx(e,yn.fromDom(n.startContainer)),Hx(e,yn.fromDom(n.endContainer)),((s,r)=>{if(!xn(s,r)){return U.some((()=>{n.deleteContents();eB(e,true,s,r,o).each((e=>{t.setRng(e.toRange())}))}))}else{return U.none()}})).getOr(U.none())};const nB=(e,t)=>{const o=yn.fromDom(t);const n=H(xn,e);return ts(o,Vl,n).isSome()};const sB=(e,t)=>nB(e,t.startContainer)||nB(e,t.endContainer);const rB=(e,t)=>{const o=jp(e.dom,mu.fromRangeStart(t)).isNone();const n=Vp(e.dom,mu.fromRangeEnd(t)).isNone();return!sB(e,t)&&o&&n};const aB=e=>U.some((()=>{e.setContent("");e.selection.setCursorLocation()}));const cB=e=>{const t=yn.fromDom(e.getBody());const o=e.selection.getRng();return rB(t,o)?aB(e):oB(t,e.selection,e.schema)};const iB=(e,t)=>e.selection.isCollapsed()?U.none():cB(e);const lB=(e,t,o,n,s)=>U.from(t._selectionOverrides.showCaret(e,o,n,s));const dB=e=>{const t=e.ownerDocument.createRange();t.selectNode(e);return t};const uB=(e,t)=>{const o=e.dispatch("BeforeObjectSelected",{target:t});if(o.isDefaultPrevented()){return U.none()}return U.some(dB(t))};const fB=(e,t,o)=>{const n=lp(1,e.getBody(),t);const s=mu.fromRangeStart(n);const r=s.getNode();if(Pg(r)){return lB(1,e,r,!s.isAtEnd(),false)}const a=s.getNode(true);if(Pg(a)){return lB(1,e,a,false,false)}const c=FC(e.dom.getRoot(),s.getNode());if(Pg(c)){return lB(1,e,c,false,o)}return U.none()};const mB=(e,t,o)=>t.collapsed?fB(e,t,o).getOr(t):t;const gB=e=>n_(e)||Qw(e);const pB=e=>s_(e)||e_(e);const hB=(e,t)=>{if(Rr(t)&&t.data.length===0){e.remove(t)}};const yB=(e,t,o,n,s,r)=>{lB(n,e,r.getNode(!s),s,true).each((o=>{if(t.collapsed){const e=t.cloneRange();if(s){e.setEnd(o.startContainer,o.startOffset)}else{e.setStart(o.endContainer,o.endOffset)}e.deleteContents()}else{t.deleteContents()}e.selection.setRng(o)}));hB(e.dom,o)};const bB=(e,t)=>{const o=e.selection.getRng();if(!Rr(o.commonAncestorContainer)){return U.none()}const n=t?hp.Forwards:hp.Backwards;const s=Op(e.getBody());const r=H(gp,t?s.next:s.prev);const a=t?gB:pB;const c=up(n,e.getBody(),o);const i=r(c);const l=i?Ex(t,i):i;if(!l||!pp(c,l)){return U.none()}else if(a(l)){return U.some((()=>yB(e,o,c.getNode(),n,t,l)))}const d=r(l);if(d&&a(d)){if(pp(l,d)){return U.some((()=>yB(e,o,c.getNode(),n,t,d)))}}return U.none()};const vB=(e,t)=>bB(e,t);const kB=(e,t)=>{const o=e.getBody();return t?Zp(o).filter(n_):Up(o).filter(s_)};const wB=e=>{const t=e.selection.getRng();return!t.collapsed&&(kB(e,true).exists((e=>e.isEqual(mu.fromRangeStart(t))))||kB(e,false).exists((e=>e.isEqual(mu.fromRangeEnd(t)))))};const _B=e=>T(e)&&(Vl(yn.fromDom(e))||Pl(yn.fromDom(e)));const xB=Qu.generate([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]);const CB=(e,t)=>{const o=t.getNode(!e);const n=e?"after":"before";return _r(o)&&o.getAttribute("data-mce-caret")===n};const SB=(e,t,o,n,s)=>{const r=t=>s.isInline(t.nodeName.toLowerCase())&&!op(o,n,e);return dp(!t,o).fold((()=>dp(t,n).fold(j,r)),r)};const zB=(e,t,o,n,s)=>{const r=s.getNode(!o);return Hx(yn.fromDom(t),yn.fromDom(n.getNode())).map((t=>aa(e,t)?xB.remove(t.dom):xB.moveToElement(r))).orThunk((()=>U.some(xB.moveToElement(r))))};const TB=(e,t,o,n)=>Hp(t,e,o).bind((s=>{if(_B(s.getNode())){return U.none()}else if(SB(e,t,o,s,n)){return U.none()}else if(t&&Zr(s.getNode())){return zB(n,e,t,o,s)}else if(!t&&Zr(s.getNode(true))){return zB(n,e,t,o,s)}else if(t&&s_(o)){return U.some(xB.moveToPosition(s))}else if(!t&&n_(o)){return U.some(xB.moveToPosition(s))}else{return U.none()}}));const EB=(e,t)=>{if(z(t)){return U.none()}else if(e&&Zr(t.nextSibling)){return U.some(xB.moveToElement(t.nextSibling))}else if(!e&&Zr(t.previousSibling)){return U.some(xB.moveToElement(t.previousSibling))}else{return U.none()}};const OB=(e,t,o)=>o.fold((e=>U.some(xB.remove(e))),(e=>U.some(xB.moveToElement(e))),(o=>{if(op(t,o,e)){return U.none()}else{return U.some(xB.moveToPosition(o))}}));const AB=(e,t,o,n)=>{if(CB(t,o)){return EB(t,o.getNode(!t)).orThunk((()=>TB(e,t,o,n)))}else{return TB(e,t,o,n).bind((t=>OB(e,o,t)))}};const DB=(e,t,o,n)=>{const s=lp(t?1:-1,e,o);const r=mu.fromRangeStart(s);const a=yn.fromDom(e);if(!t&&s_(r)){return U.some(xB.remove(r.getNode(true)))}else if(t&&n_(r)){return U.some(xB.remove(r.getNode()))}else if(!t&&n_(r)&&w_(a,r,n)){return __(a,r,n).map((e=>xB.remove(e.getNode())))}else if(t&&s_(r)&&k_(a,r,n)){return x_(a,r,n).map((e=>xB.remove(e.getNode())))}else{return AB(e,t,r,n)}};const NB=(e,t)=>o=>{e._selectionOverrides.hideFakeCaret();vx(e,t,yn.fromDom(o));return true};const MB=(e,t)=>o=>{const n=t?mu.before(o):mu.after(o);e.selection.setRng(n.toRange());return true};const RB=e=>t=>{e.selection.setRng(t.toRange());return true};const BB=(e,t)=>U.from(FC(e.getBody(),t));const LB=(e,t)=>{const o=e.selection.getNode();return BB(e,o).filter(Zr).fold((()=>DB(e.getBody(),t,e.selection.getRng(),e.schema).map((o=>()=>o.fold(NB(e,t),MB(e,t),RB(e))))),(()=>U.some(D)))};const HB=e=>{Q(sr(e,".mce-offscreen-selection"),Ds)};const IB=(e,t)=>{const o=e.selection.getNode();if(Zr(o)&&!Ur(o)){const n=BB(e,o.parentNode).filter(Zr);return n.fold((()=>U.some((()=>{HB(yn.fromDom(e.getBody()));vx(e,t,yn.fromDom(e.selection.getNode()));Ix(e)}))),(()=>U.some(D)))}if(wB(e)){return U.some((()=>{Vx(e,e.selection.getRng(),yn.fromDom(e.getBody()))}))}return U.none()};const PB=e=>{const t=e.dom,o=e.selection;const n=FC(e.getBody(),o.getNode());if(jr(n)&&t.isBlock(n)&&t.isEmpty(n)){const e=t.create("br",{"data-mce-bogus":"1"});t.setHTML(n,"");n.appendChild(e);o.setRng(mu.before(e).toRange())}return true};const FB=(e,t)=>{if(e.selection.isCollapsed()){return LB(e,t)}else{return IB(e,t)}};const VB=e=>e.hasOwnProperty("text");const jB=e=>e.hasOwnProperty("marker");const ZB=(e,t)=>{const o=(e,o)=>{if(Rr(e)){return{text:e,offset:o}}else{const n=t();const s=e.childNodes;if(o<s.length){e.insertBefore(n,s[o]);return{marker:n,before:true}}else{e.appendChild(n);return{marker:n,before:false}}}};const n=o(e.endContainer,e.endOffset);const s=o(e.startContainer,e.startOffset);return{start:s,end:n}};const UB=e=>{var t,o;const{start:n,end:s}=e;const r=new window.Range;if(VB(n)){r.setStart(n.text,n.offset)}else{if(jB(n)){if(n.before){r.setStartBefore(n.marker)}else{r.setStartAfter(n.marker)}(t=n.marker.parentNode)===null||t===void 0?void 0:t.removeChild(n.marker)}}if(VB(s)){r.setEnd(s.text,s.offset)}else{if(jB(s)){if(s.before){r.setEndBefore(s.marker)}else{r.setEndAfter(s.marker)}(o=s.marker.parentNode)===null||o===void 0?void 0:o.removeChild(s.marker)}}return r};const qB=(e,t)=>{var o;const n=e.dom;const s=n.getParent(e.selection.getStart(),n.isBlock);const r=n.getParent(e.selection.getEnd(),n.isBlock);const a=e.getBody();const c=(o=s===null||s===void 0?void 0:s.nodeName)===null||o===void 0?void 0:o.toLowerCase();if(c==="div"&&s&&r&&s===a.firstChild&&r===a.lastChild&&!n.isEmpty(a)){const o=s.cloneNode(false);const n=()=>{if(t){Rx(e)}else{Mx(e)}if(a.firstChild!==s){const t=ZB(e.selection.getRng(),(()=>document.createElement("span")));Array.from(a.childNodes).forEach((e=>o.appendChild(e)));a.appendChild(o);e.selection.setRng(UB(t))}};return U.some(n)}return U.none()};const WB=(e,t)=>{const o=mu.fromRangeStart(e.selection.getRng());return Hp(t,e.getBody(),o).filter((e=>t?Xw(e):Jw(e))).bind((e=>np(t?0:-1,e))).map((t=>()=>e.selection.select(t)))};const $B=(e,t)=>e.selection.isCollapsed()?WB(e,t):U.none();const GB=Rr;const KB=e=>GB(e)&&e.data[0]===Gl;const YB=e=>GB(e)&&e.data[e.data.length-1]===Gl;const XB=e=>{var t;const o=(t=e.ownerDocument)!==null&&t!==void 0?t:document;return o.createTextNode(Gl)};const JB=e=>{var t;if(GB(e.previousSibling)){if(YB(e.previousSibling)){return e.previousSibling}else{e.previousSibling.appendData(Gl);return e.previousSibling}}else if(GB(e)){if(KB(e)){return e}else{e.insertData(0,Gl);return e}}else{const o=XB(e);(t=e.parentNode)===null||t===void 0?void 0:t.insertBefore(o,e);return o}};const QB=e=>{var t,o;if(GB(e.nextSibling)){if(KB(e.nextSibling)){return e.nextSibling}else{e.nextSibling.insertData(0,Gl);return e.nextSibling}}else if(GB(e)){if(YB(e)){return e}else{e.appendData(Gl);return e}}else{const n=XB(e);if(e.nextSibling){(t=e.parentNode)===null||t===void 0?void 0:t.insertBefore(n,e.nextSibling)}else{(o=e.parentNode)===null||o===void 0?void 0:o.appendChild(n)}return n}};const eL=(e,t)=>e?JB(t):QB(t);const tL=H(eL,true);const oL=H(eL,false);const nL=(e,t)=>{if(Rr(e.container())){return eL(t,e.container())}else{return eL(t,e.getNode())}};const sL=(e,t)=>{const o=t.get();return o&&e.container()===o&&td(o)};const rL=(e,t)=>t.fold((t=>{Ag(e.get());const o=tL(t);e.set(o);return U.some(mu(o,o.length-1))}),(t=>Zp(t).map((t=>{if(!sL(t,e)){Ag(e.get());const o=nL(t,true);e.set(o);return mu(o,1)}else{const t=e.get();return mu(t,1)}}))),(t=>Up(t).map((t=>{if(!sL(t,e)){Ag(e.get());const o=nL(t,false);e.set(o);return mu(o,o.length-1)}else{const t=e.get();return mu(t,t.length-1)}}))),(t=>{Ag(e.get());const o=oL(t);e.set(o);return U.some(mu(o,1))}));const aL=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o].apply(null,t);if(n.isSome()){return n}}return U.none()};const cL=Qu.generate([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]);const iL=(e,t)=>{const o=tp(t,e);return o?o:e};const lL=(e,t,o)=>{const n=Ox(o);const s=iL(t,n.container());return Sx(e,s,n).fold((()=>Vp(s,n).bind(H(Sx,e,s)).map((e=>cL.before(e)))),U.none)};const dL=(e,t)=>$p(e,t)===null;const uL=(e,t,o)=>Sx(e,t,o).filter(H(dL,t));const fL=(e,t,o)=>{const n=Ax(o);return uL(e,t,n).bind((e=>{const t=jp(e,n);return t.isNone()?U.some(cL.start(e)):U.none()}))};const mL=(e,t,o)=>{const n=Ox(o);return uL(e,t,n).bind((e=>{const t=Vp(e,n);return t.isNone()?U.some(cL.end(e)):U.none()}))};const gL=(e,t,o)=>{const n=Ax(o);const s=iL(t,n.container());return Sx(e,s,n).fold((()=>jp(s,n).bind(H(Sx,e,s)).map((e=>cL.after(e)))),U.none)};const pL=e=>!xx(yL(e));const hL=(e,t,o)=>{const n=aL([lL,fL,mL,gL],[e,t,o]);return n.filter(pL)};const yL=e=>e.fold(B,B,B,B);const bL=e=>e.fold(R("before"),R("start"),R("end"),R("after"));const vL=e=>e.fold(cL.before,cL.before,cL.after,cL.after);const kL=e=>e.fold(cL.start,cL.start,cL.end,cL.end);const wL=(e,t)=>bL(e)===bL(t)&&yL(e)===yL(t);const _L=(e,t,o,n,s,r)=>yo(Sx(t,o,n),Sx(t,o,s),((t,n)=>{if(t!==n&&zx(o,t,n)){return cL.after(e?t:n)}else{return r}})).getOr(r);const xL=(e,t)=>e.fold(Z,(e=>!wL(e,t)));const CL=(e,t,o,n,s)=>{const r=Ex(e,s);const a=Hp(e,o,r).map(H(Ex,e));const c=a.fold((()=>n.map(vL)),(s=>hL(t,o,s).map(H(_L,e,t,o,r,s)).filter(H(xL,n))));return c.filter(pL)};const SL=(e,t)=>{if(e){return t.fold(N(U.some,cL.start),U.none,N(U.some,cL.after),U.none)}else{return t.fold(U.none,N(U.some,cL.before),U.none,N(U.some,cL.end))}};const zL=(e,t,o,n)=>{const s=Ex(e,n);const r=hL(t,o,s);return hL(t,o,s).bind(H(SL,e)).orThunk((()=>CL(e,t,o,r,n)))};const TL=e=>E(e.selection.getSel().modify);const EL=(e,t,o)=>{const n=e?1:-1;t.setRng(mu(o.container(),o.offset()+n).toRange());t.getSel().modify("move",e?"forward":"backward","word");return true};const OL=(e,t)=>{const o=t.selection.getRng();const n=e?mu.fromRangeEnd(o):mu.fromRangeStart(o);if(!TL(t)){return false}else if(e&&rd(n)){return EL(true,t.selection,n)}else if(!e&&ad(n)){return EL(false,t.selection,n)}else{return false}};var AL;(function(e){e[e["Br"]=0]="Br";e[e["Block"]=1]="Block";e[e["Wrap"]=2]="Wrap";e[e["Eol"]=3]="Eol"})(AL||(AL={}));const DL=(e,t)=>e===hp.Backwards?ue(t):t;const NL=(e,t,o)=>e===hp.Forwards?t.next(o):t.prev(o);const ML=(e,t,o,n)=>{if(Fr(n.getNode(t===hp.Forwards))){return AL.Br}else if(op(o,n)===false){return AL.Block}else{return AL.Wrap}};const RL=(e,t,o,n)=>{const s=Op(o);let r=n;const a=[];while(r){const n=NL(t,s,r);if(!n){break}if(Fr(n.getNode(false))){if(t===hp.Forwards){return{positions:DL(t,a).concat([n]),breakType:AL.Br,breakAt:U.some(n)}}else{return{positions:DL(t,a),breakType:AL.Br,breakAt:U.some(n)}}}if(!n.isVisible()){r=n;continue}if(e(r,n)){const e=ML(o,t,r,n);return{positions:DL(t,a),breakType:e,breakAt:U.some(n)}}a.push(n);r=n}return{positions:DL(t,a),breakType:AL.Eol,breakAt:U.none()}};const BL=(e,t,o,n)=>t(o,n).breakAt.map((n=>{const s=t(o,n).positions;return e===hp.Backwards?s.concat(n):[n].concat(s)})).getOr([]);const LL=(e,t)=>se(e,((e,o)=>e.fold((()=>U.some(o)),(n=>yo(he(n.getClientRects()),he(o.getClientRects()),((e,s)=>{const r=Math.abs(t-e.left);const a=Math.abs(t-s.left);return a<=r?o:n})).or(e)))),U.none());const HL=(e,t)=>he(t.getClientRects()).bind((t=>LL(e,t.left)));const IL=H(RL,mu.isAbove,-1);const PL=H(RL,mu.isBelow,1);const FL=H(BL,-1,IL);const VL=H(BL,1,PL);const jL=(e,t)=>IL(e,t).breakAt.isNone();const ZL=(e,t)=>PL(e,t).breakAt.isNone();const UL=e=>Zp(e).map((t=>[t].concat(PL(e,t).positions))).getOr([]);const qL=e=>Up(e).map((t=>IL(e,t).positions.concat(t))).getOr([]);const WL=(e,t)=>HL(FL(e,t),t);const $L=(e,t)=>HL(VL(e,t),t);const GL=Zr;const KL=(e,t)=>Math.abs(e.left-t);const YL=(e,t)=>Math.abs(e.right-t);const XL=e=>Re(e,"node");const JL=(e,t)=>Ue(e,((e,o)=>{const n=Math.min(KL(e,t),YL(e,t));const s=Math.min(KL(o,t),YL(o,t));if(s===n&&XL(o)&&GL(o.node)){return o}if(s<n){return o}return e}));const QL=e=>{const t=t=>J(t,(t=>{const o=gd(t);o.node=e;return o}));if(_r(e)){return t(e.getClientRects())}else if(Rr(e)){const o=e.ownerDocument.createRange();o.setStart(e,0);o.setEnd(e,e.data.length);return t(o.getClientRects())}else{return[]}};const eH=e=>le(e,QL);var tH;(function(e){e[e["Up"]=-1]="Up";e[e["Down"]=1]="Down"})(tH||(tH={}));const oH=(e,t,o,n)=>{let s=n;while(s=Qg(s,e,Wd,t)){if(o(s)){return}}};const nH=(e,t,o,n,s,r)=>{let a=0;const c=[];const i=n=>{let r=eH([n]);if(e===-1){r=r.reverse()}for(let e=0;e<r.length;e++){const n=r[e];if(o(n,l)){continue}if(c.length>0&&t(n,We(c))){a++}n.line=a;if(s(n)){return true}c.push(n)}return false};const l=We(r.getClientRects());if(!l){return c}const d=r.getNode();if(d){i(d);oH(e,n,i,d)}return c};const sH=(e,t)=>t.line>e;const rH=(e,t)=>t.line===e;const aH=H(nH,tH.Up,bd,vd);const cH=H(nH,tH.Down,vd,bd);const iH=e=>We(e.getClientRects());const lH=(e,t,o,n)=>{const s=Op(t);let r;let a;let c;let i;const l=[];let d=0;if(e===1){r=s.next;a=vd;c=bd;i=mu.after(n)}else{r=s.prev;a=bd;c=vd;i=mu.before(n)}const u=iH(i);do{if(!i.isVisible()){continue}const e=iH(i);if(c(e,u)){continue}if(l.length>0&&a(e,We(l))){d++}const t=gd(e);t.position=i;t.line=d;if(o(t)){return l}l.push(t)}while(i=r(i));return l};const dH=e=>t=>sH(e,t);const uH=e=>t=>rH(e,t);const fH=(e,t)=>{e.selection.setRng(t);Qv(e,e.selection.getRng())};const mH=(e,t,o)=>U.some(mB(e,t,o));const gH=(e,t,o,n,s,r)=>{const a=t===hp.Forwards;const c=Op(e.getBody());const i=H(gp,a?c.next:c.prev);const l=a?n:s;if(!o.collapsed){const n=Sd(o);if(r(n)){return lB(t,e,n,t===hp.Backwards,false)}else if(wB(e)){const e=o.cloneRange();e.collapse(t===hp.Backwards);return U.from(e)}}const d=up(t,e.getBody(),o);if(l(d)){return uB(e,d.getNode(!a))}let u=i(d);const f=fd(o);if(!u){return f?U.some(o):U.none()}else{u=Ex(a,u)}if(l(u)){return lB(t,e,u.getNode(!a),a,false)}const m=i(u);if(m&&l(m)){if(pp(u,m)){return lB(t,e,m.getNode(!a),a,false)}}if(f){return mH(e,u.toRange(),false)}return U.none()};const pH=(e,t,o,n,s,r)=>{const a=up(t,e.getBody(),o);const c=We(a.getClientRects());const i=t===tH.Down;const l=e.getBody();if(!c){return U.none()}if(wB(e)){const e=i?mu.fromRangeEnd(o):mu.fromRangeStart(o);const t=!i?WL:$L;return t(l,e).orThunk((()=>U.from(e))).map((e=>e.toRange()))}const d=i?cH:aH;const u=d(l,dH(1),a);const f=oe(u,uH(1));const m=c.left;const g=JL(f,m);if(g&&r(g.node)){const o=Math.abs(m-g.left);const n=Math.abs(m-g.right);return lB(t,e,g.node,o<n,false)}let p;if(n(a)){p=a.getNode()}else if(s(a)){p=a.getNode(true)}else{p=Sd(o)}if(p){const o=lH(t,l,dH(1),p);let n=JL(oe(o,uH(1)),m);if(n){return mH(e,n.position.toRange(),false)}n=We(oe(o,uH(0)));if(n){return mH(e,n.position.toRange(),false)}}if(f.length===0){return hH(e,i).filter(i?s:n).map((t=>mB(e,t.toRange(),false)))}return U.none()};const hH=(e,t)=>{const o=e.selection.getRng();const n=t?mu.fromRangeEnd(o):mu.fromRangeStart(o);const s=ep(n.container(),e.getBody());if(t){const e=PL(s,n);return ye(e.positions)}else{const e=IL(s,n);return he(e.positions)}};const yH=(e,t,o)=>hH(e,t).filter(o).exists((t=>{e.selection.setRng(t.toRange());return true}));const bH=(e,t)=>{const o=e.dom.createRng();o.setStart(t.container(),t.offset());o.setEnd(t.container(),t.offset());e.selection.setRng(o)};const vH=(e,t)=>{if(e){t.setAttribute("data-mce-selected","inline-boundary")}else{t.removeAttribute("data-mce-selected")}};const kH=(e,t,o)=>rL(t,o).map((t=>{bH(e,t);return o}));const wH=(e,t,o)=>{const n=mu.fromRangeStart(e);if(e.collapsed){return n}else{const s=mu.fromRangeEnd(e);return o?jp(t,s).getOr(s):Vp(t,n).getOr(n)}};const _H=(e,t,o)=>{const n=e.getBody();const s=wH(e.selection.getRng(),n,o);const r=H(_x,e);const a=zL(o,r,n,s);return a.bind((o=>kH(e,t,o)))};const xH=(e,t,o)=>{const n=J(sr(yn.fromDom(t.getRoot()),'*[data-mce-selected="inline-boundary"]'),(e=>e.dom));const s=oe(n,e);const r=oe(o,e);Q(fe(s,r),H(vH,false));Q(fe(r,s),H(vH,true))};const CH=(e,t)=>{const o=t.get();if(e.selection.isCollapsed()&&!e.composing&&o){const n=mu.fromRangeStart(e.selection.getRng());if(mu.isTextPosition(n)&&!Tx(n)){bH(e,Og(o,n));t.set(null)}}};const SH=(e,t,o,n)=>{if(t.selection.isCollapsed()){const s=oe(n,e);Q(s,(n=>{const s=mu.fromRangeStart(t.selection.getRng());hL(e,t.getBody(),s).bind((e=>kH(t,o,e)))}))}};const zH=(e,t,o)=>dm(e)?_H(e,t,o).isSome():false;const TH=(e,t,o)=>dm(t)?OL(e,t):false;const EH=e=>{const t=ia(null);const o=H(_x,e);e.on("NodeChange",(n=>{if(dm(e)){xH(o,e.dom,n.parents);CH(e,t);SH(o,e,t,n.parents)}}));return t};const OH=H(TH,true);const AH=H(TH,false);const DH=(e,t,o)=>{if(dm(e)){const n=hH(e,t).getOrThunk((()=>{const o=e.selection.getRng();return t?mu.fromRangeEnd(o):mu.fromRangeStart(o)}));return hL(H(_x,e),e.getBody(),n).exists((t=>{const n=vL(t);return rL(o,n).exists((t=>{bH(e,t);return true}))}))}else{return false}};const NH=(e,t)=>{const o=document.createRange();o.setStart(e.container(),e.offset());o.setEnd(t.container(),t.offset());return o};const MH=e=>yo(Zp(e),Up(e),((t,o)=>{const n=Ex(true,t);const s=Ex(false,o);return Vp(e,n).forall((e=>e.isEqual(s)))})).getOr(true);const RH=(e,t)=>o=>rL(t,o).map((t=>()=>bH(e,t)));const BH=(e,t,o,n)=>{const s=e.getBody();const r=H(_x,e);e.undoManager.ignore((()=>{e.selection.setRng(NH(o,n));Mx(e);hL(r,s,mu.fromRangeStart(e.selection.getRng())).map(kL).bind(RH(e,t)).each(V)}));e.nodeChanged()};const LH=(e,t)=>{const o=tp(t,e);return o?o:e};const HH=(e,t,o,n)=>{const s=LH(e.getBody(),n.container());const r=H(_x,e);const a=hL(r,s,n);const c=a.bind((e=>{if(o){return e.fold(R(U.some(kL(e))),U.none,R(U.some(vL(e))),U.none)}else{return e.fold(U.none,R(U.some(vL(e))),U.none,R(U.some(kL(e))))}}));return c.map(RH(e,t)).getOrThunk((()=>{const c=Ip(o,s,n);const i=c.bind((e=>hL(r,s,e)));return yo(a,i,(()=>Sx(r,s,n).bind((t=>{if(MH(t)){return U.some((()=>{vx(e,o,yn.fromDom(t))}))}else{return U.none()}})))).getOrThunk((()=>i.bind((()=>c.map((s=>()=>{if(o){BH(e,t,n,s)}else{BH(e,t,s,n)}}))))))}))};const IH=(e,t,o)=>{if(e.selection.isCollapsed()&&dm(e)){const n=mu.fromRangeStart(e.selection.getRng());return HH(e,t,o,n)}return U.none()};const PH=e=>Vn(e)>1;const FH=(e,t)=>{const o=yn.fromDom(e.getBody());const n=yn.fromDom(e.selection.getStart());const s=i_(n,o);return ce(s,t).fold(R(s),(e=>s.slice(0,e)))};const VH=e=>Vn(e)===1;const jH=e=>FH(e,(t=>e.schema.isBlock(Mo(t))||PH(t)));const ZH=e=>FH(e,(t=>e.schema.isBlock(Mo(t))));const UH=(e,t)=>{const o=H(Mz,e);return le(t,(e=>o(e)?[e.dom]:[]))};const qH=e=>{const t=ZH(e);return UH(e,t)};const WH=(e,t,o,n)=>{const s=UH(t,n);if(s.length===0){vx(t,e,o)}else{const e=Dz(o.dom,s);t.selection.setRng(e.toRange())}};const $H=(e,t)=>{const o=oe(jH(e),VH);return ye(o).bind((n=>{const s=mu.fromRangeStart(e.selection.getRng());if(Px(t,s,n.dom)&&!my(n)){return U.some((()=>WH(t,e,n,o)))}else{return U.none()}}))};const GH=(e,t)=>{const o=t.parentElement;return Fr(t)&&!x(o)&&e.dom.isEmpty(o)};const KH=e=>my(yn.fromDom(e));const YH=(e,t)=>{const o=e.selection.getStart();const n=GH(e,o)||KH(o)?Dz(o,t):Nz(e.selection.getRng(),t);e.selection.setRng(n.toRange())};const XH=(e,t)=>{const o=fe(t,qH(e));if(o.length>0){YH(e,o)}};const JH=e=>Rr(e.startContainer);const QH=e=>e.startOffset===0&&JH(e);const eI=(e,t)=>{const o=t.startContainer.parentElement;return!x(o)&&Mz(e,yn.fromDom(o))};const tI=e=>{const t=e.startContainer.parentNode;const o=e.endContainer.parentNode;return!x(t)&&!x(o)&&t.isEqualNode(o)};const oI=e=>{const t=e.endContainer;return e.endOffset===(Rr(t)?t.length:t.childNodes.length)};const nI=e=>tI(e)&&oI(e);const sI=e=>!e.endContainer.isEqualNode(e.commonAncestorContainer);const rI=e=>nI(e)||sI(e);const aI=e=>{const t=e.selection.getRng();return QH(t)&&eI(e,t)&&rI(t)};const cI=e=>{if(aI(e)){const t=qH(e);return U.some((()=>{Mx(e);XH(e,t)}))}else{return U.none()}};const iI=(e,t)=>e.selection.isCollapsed()?$H(e,t):cI(e);const lI=(e,t)=>rr(e,(e=>Wp(e.dom)),(e=>t.isBlock(Mo(e))));const dI=e=>lI(yn.fromDom(e.selection.getStart()),e.schema);const uI=e=>{const t=e.selection.getRng();return t.collapsed&&(JH(t)||e.dom.isEmpty(t.startContainer))&&!dI(e)};const fI=e=>{if(uI(e)){YH(e,[])}return true};const mI=(e,t,o)=>{if(T(o)){return U.some((()=>{e._selectionOverrides.hideFakeCaret();vx(e,t,yn.fromDom(o))}))}else{return U.none()}};const gI=(e,t)=>{const o=t?Qw:e_;const n=t?hp.Forwards:hp.Backwards;const s=up(n,e.getBody(),e.selection.getRng());if(o(s)){return mI(e,t,s.getNode(!t))}else{return U.from(Ex(t,s)).filter((e=>o(e)&&pp(s,e))).bind((o=>mI(e,t,o.getNode(!t))))}};const pI=(e,t)=>{const o=e.selection.getNode();return Wr(o)?mI(e,t,o):U.none()};const hI=(e,t)=>e.selection.isCollapsed()?gI(e,t):pI(e,t);const yI=e=>os(e,(e=>jr(e.dom)||Zr(e.dom))).exists((e=>jr(e.dom)));const bI=e=>bt(e!==null&&e!==void 0?e:"").getOr(0);const vI=(e,t)=>{const o=e||Bl(t)?"margin":"padding";const n=ys(t,"direction")==="rtl"?"-right":"-left";return o+n};const kI=(e,t,o,n,s,r)=>{const a=vI(o,yn.fromDom(r));const c=bI(e.getStyle(r,a));if(t==="outdent"){const t=Math.max(0,c-n);e.setStyle(r,a,t?t+s:"")}else{const t=c+n+s;e.setStyle(r,a,t)}};const wI=(e,t)=>de(t,(t=>{const o=vI(Gf(e),t);const n=vs(t,o).map(bI).getOr(0);const s=e.dom.getContentEditable(t.dom);return s!=="false"&&n>0}));const _I=e=>{const t=SI(e);return!e.mode.isReadOnly()&&(t.length>1||wI(e,t))};const xI=e=>Il(e)||Pl(e);const CI=e=>On(e).exists(xI);const SI=e=>oe(Rs(e.selection.getSelectedBlocks()),(e=>!xI(e)&&!CI(e)&&yI(e)));const zI=(e,t)=>{var o,n;const{dom:s}=e;const r=Kf(e);const a=(n=(o=/[a-z%]+$/i.exec(r))===null||o===void 0?void 0:o[0])!==null&&n!==void 0?n:"px";const c=bI(r);const i=Gf(e);Q(SI(e),(e=>{kI(s,t,i,c,a,e.dom)}))};const TI=e=>zI(e,"indent");const EI=e=>zI(e,"outdent");const OI=e=>{if(e.selection.isCollapsed()&&_I(e)){const t=e.dom;const o=e.selection.getRng();const n=mu.fromRangeStart(o);const s=t.getParent(o.startContainer,t.isBlock);if(s!==null&&g_(yn.fromDom(s),n,e.schema)){return U.some((()=>EI(e)))}}return U.none()};const AI=(e,t,o)=>ve([OI,FB,vB,(e,o)=>IH(e,t,o),tB,PC,$B,hI,iB,iI,qB],(t=>t(e,o))).filter((t=>e.selection.isEditable()));const DI=(e,t)=>{const o=AI(e,t,false);o.fold((()=>{if(e.selection.isEditable()){Mx(e);Ix(e)}}),V)};const NI=(e,t)=>{const o=AI(e,t,true);o.fold((()=>{if(e.selection.isEditable()){Rx(e)}}),V)};const MI=(e,t)=>{e.addCommand("delete",(()=>{DI(e,t)}));e.addCommand("forwardDelete",(()=>{NI(e,t)}))};const RI=5;const BI=400;const LI=e=>{if(e.touches===undefined||e.touches.length!==1){return U.none()}return U.some(e.touches[0])};const HI=(e,t)=>{const o=Math.abs(e.clientX-t.x);const n=Math.abs(e.clientY-t.y);return o>RI||n>RI};const II=e=>{const t=ua();const o=ia(false);const n=Ki((t=>{e.dispatch("longpress",{...t,type:"longpress"});o.set(true)}),BI);e.on("touchstart",(e=>{LI(e).each((s=>{n.cancel();const r={x:s.clientX,y:s.clientY,target:e.target};n.throttle(e);o.set(false);t.set(r)}))}),true);e.on("touchmove",(s=>{n.cancel();LI(s).each((n=>{t.on((s=>{if(HI(n,s)){t.clear();o.set(false);e.dispatch("longpresscancel")}}))}))}),true);e.on("touchend touchcancel",(s=>{n.cancel();if(s.type==="touchcancel"){return}t.get().filter((e=>e.target.isEqualNode(s.target))).each((()=>{if(o.get()){s.preventDefault()}else{e.dispatch("tap",{...s,type:"tap"})}}))}),true)};const PI=(e,t)=>Me(e,t.nodeName);const FI=(e,t)=>{if(Rr(t)){return true}else if(_r(t)){return!PI(e.getBlockElements(),t)&&!ph(t)&&!Ma(e,t)&&!ga(t)}else{return false}};const VI=(e,t,o)=>X(c_(yn.fromDom(o),yn.fromDom(t)),(t=>PI(e,t.dom)));const jI=(e,t)=>{if(Rr(t)){if(t.data.length===0){return true}else if(/^\s+$/.test(t.data)){return!t.nextSibling||PI(e,t.nextSibling)||ga(t.nextSibling)}}return false};const ZI=e=>e.dom.create(Ef(e),Of(e));const UI=e=>{const t=e.dom,o=e.selection;const n=e.schema;const s=n.getBlockElements();const r=o.getStart();const a=e.getBody();let c;let i;let l=null;const d=Ef(e);if(!r||!_r(r)){return}const u=a.nodeName.toLowerCase();if(!n.isValidChild(u,d.toLowerCase())||VI(s,a,r)){return}if(a.firstChild===a.lastChild&&Fr(a.firstChild)){c=ZI(e);c.appendChild(ql().dom);a.replaceChild(c,a.firstChild);e.selection.setCursorLocation(c,0);e.nodeChanged();return}let f=a.firstChild;while(f){if(_r(f)){Ea(n,f)}if(FI(n,f)){if(jI(s,f)){i=f;f=f.nextSibling;t.remove(i);continue}if(!c){if(!l&&e.hasFocus()){l=ZB(e.selection.getRng(),(()=>document.createElement("span")))}if(!f.parentNode){f=null;break}c=ZI(e);a.insertBefore(c,f)}i=f;f=f.nextSibling;c.appendChild(i)}else{c=null;f=f.nextSibling}}if(l){e.selection.setRng(UB(l));e.nodeChanged()}};const qI=(e,t,o)=>{const n=yn.fromDom(ZI(e));const s=ql();zs(n,s);o(t,n);const r=document.createRange();r.setStartBefore(s.dom);r.setEndBefore(s.dom);return r};const WI=e=>{e.on("NodeChange",(()=>UI(e)))};const $I=e=>t=>(" "+t.attr("class")+" ").indexOf(e)!==-1;const GI=(e,t,o)=>function(n){const s=arguments,r=s[s.length-2];const a=r>0?t.charAt(r-1):"";if(a==='"'){return n}if(a===">"){const e=t.lastIndexOf("<",r);if(e!==-1){const o=t.substring(e,r);if(o.indexOf('contenteditable="false"')!==-1){return n}}}return'<span class="'+o+'" data-mce-content="'+e.dom.encode(s[0])+'">'+e.dom.encode(typeof s[1]==="string"?s[1]:s[0])+"</span>"};const KI=(e,t,o)=>{let n=t.length,s=o.content;if(o.format==="raw"){return}while(n--){s=s.replace(t[n],GI(e,s,Qm(e)))}o.content=s};const YI=(e,t)=>de(e,(e=>{const o=t.match(e);return o!==null&&o[0].length===t.length}));const XI=e=>{const t="contenteditable";const o=" "+mo.trim(eg(e))+" ";const n=" "+mo.trim(Qm(e))+" ";const s=$I(o);const r=$I(n);const a=tg(e);if(a.length>0){e.on("BeforeSetContent",(t=>{KI(e,a,t)}))}e.parser.addAttributeFilter("class",(e=>{let o=e.length;while(o--){const n=e[o];if(s(n)){n.attr(t,"true")}else if(r(n)){n.attr(t,"false")}}}));e.serializer.addAttributeFilter(t,(e=>{let o=e.length;while(o--){const n=e[o];if(!s(n)&&!r(n)){continue}const c=n.attr("data-mce-content");if(a.length>0&&c){if(YI(a,c)){n.name="#text";n.type=3;n.raw=true;n.value=c}else{n.remove()}}else{n.attr(t,null)}}}))};const JI=e=>cs(yn.fromDom(e.getBody()),"*[data-mce-caret]").map((e=>e.dom)).getOrNull();const QI=(e,t)=>{if(t.hasAttribute("data-mce-caret")){ud(t);e.selection.setRng(e.selection.getRng());e.selection.scrollIntoView(t)}};const eP=(e,t)=>{const o=JI(e);if(!o){return}if(t.type==="compositionstart"){t.preventDefault();t.stopPropagation();QI(e,o);return}if(nd(o)){QI(e,o);e.undoManager.add()}};const tP=e=>{e.on("keyup compositionstart",H(eP,e))};const oP=Zr;const nP=(e,t,o)=>gH(t,e,o,n_,s_,oP);const sP=(e,t,o)=>{const n=e=>n_(e)||t_(e);const s=e=>s_(e)||o_(e);return pH(t,e,o,n,s,oP)};const rP=e=>{const t=e.dom.create(Ef(e));t.innerHTML='<br data-mce-bogus="1">';return t};const aP=(e,t,o)=>{const n=Op(e.getBody());const s=H(gp,t===1?n.next:n.prev);if(o.collapsed){const n=e.dom.getParent(o.startContainer,"PRE");if(!n){return}const r=s(mu.fromRangeStart(o));if(!r){const o=yn.fromDom(rP(e));if(t===1){Cs(yn.fromDom(n),o)}else{xs(yn.fromDom(n),o)}e.selection.select(o.dom,true);e.selection.collapse()}}};const cP=(e,t)=>{const o=t?hp.Forwards:hp.Backwards;const n=e.selection.getRng();return nP(o,e,n).orThunk((()=>{aP(e,o,n);return U.none()}))};const iP=(e,t)=>{const o=t?1:-1;const n=e.selection.getRng();return sP(o,e,n).orThunk((()=>{aP(e,o,n);return U.none()}))};const lP=(e,t)=>{const o=t?e.getEnd(true):e.getStart(true);return xx(o)?!t:t};const dP=(e,t)=>cP(e,lP(e.selection,t)).exists((t=>{fH(e,t);return true}));const uP=(e,t)=>iP(e,t).exists((t=>{fH(e,t);return true}));const fP=(e,t)=>{const o=t?s_:n_;return yH(e,t,o)};const mP=(e,t)=>kB(e,!t).map((o=>{const n=o.toRange();const s=e.selection.getRng();if(t){n.setStart(s.startContainer,s.startOffset)}else{n.setEnd(s.endContainer,s.endOffset)}return n})).exists((t=>{fH(e,t);return true}));const gP=e=>Y(["figcaption"],Mo(e));const pP=(e,t,o)=>{const n=H(xn,t);return os(yn.fromDom(e.container()),(e=>o.isBlock(Mo(e))),n).filter(gP)};const hP=(e,t,o)=>t?ZL(e.dom,o):jL(e.dom,o);const yP=(e,t)=>{const o=yn.fromDom(e.getBody());const n=mu.fromRangeStart(e.selection.getRng());return pP(n,o,e.schema).exists((()=>{if(hP(o,t,n)){const n=t?zs:Ss;const s=qI(e,o,n);e.selection.setRng(s);return true}else{return false}}))};const bP=(e,t)=>{if(e.selection.isCollapsed()){return yP(e,t)}else{return false}};const vP=(e,t,o)=>{const n=e.selection.getRng();const s=mu.fromRangeStart(n);const r=e.getBody();if(r.firstChild===t&&jL(o,s)){e.execCommand("InsertNewBlockBefore");return true}else{return false}};const kP=(e,t)=>{const o=e.selection.getRng();const n=mu.fromRangeStart(o);const s=e.getBody();if(s.lastChild===t&&ZL(t,n)){e.execCommand("InsertNewBlockAfter");return true}else{return false}};const wP=(e,t)=>{if(t){return U.from(e.dom.getParent(e.selection.getNode(),"details")).map((t=>kP(e,t))).getOr(false)}else{return U.from(e.dom.getParent(e.selection.getNode(),"summary")).bind((t=>U.from(e.dom.getParent(t,"details")).map((o=>vP(e,o,t))))).getOr(false)}};const _P=(e,t)=>wP(e,t);const xP={shiftKey:false,altKey:false,ctrlKey:false,metaKey:false,keyCode:0};const CP=e=>J(e,(e=>({...xP,...e})));const SP=e=>J(e,(e=>({...xP,...e})));const zP=(e,t)=>t.keyCode===e.keyCode&&t.shiftKey===e.shiftKey&&t.altKey===e.altKey&&t.ctrlKey===e.ctrlKey&&t.metaKey===e.metaKey;const TP=(e,t)=>le(CP(e),(e=>zP(e,t)?[e]:[]));const EP=(e,t)=>le(SP(e),(e=>zP(e,t)?[e]:[]));const OP=(e,...t)=>()=>e.apply(null,t);const AP=(e,t)=>ae(TP(e,t),(e=>e.action()));const DP=(e,t)=>ve(EP(e,t),(e=>e.action()));const NP=(e,t)=>{const o=t?hp.Forwards:hp.Backwards;const n=e.selection.getRng();return gH(e,o,n,Qw,e_,Wr).exists((t=>{fH(e,t);return true}))};const MP=(e,t)=>{const o=t?1:-1;const n=e.selection.getRng();return pH(e,o,n,Qw,e_,Wr).exists((t=>{fH(e,t);return true}))};const RP=(e,t)=>{const o=t?e_:Qw;return yH(e,t,o)};const BP=Qu.generate([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]);const LP=e=>BP.none(e);const HP={...BP,none:LP};const IP=(e,t)=>PP(e,t,Z);const PP=(e,t,o)=>le(Hn(e),(e=>{if(vn(e,t)){return o(e)?[e]:[]}else{return PP(e,t,o)}}));const FP=(e,t,o=j)=>{if(o(t)){return U.none()}if(Y(e,Mo(t))){return U.some(t)}const n=e=>vn(e,"table")||o(e);return as(t,e.join(","),n)};const VP=(e,t)=>FP(["td","th"],e,t);const jP=e=>IP(e,"th,td");const ZP=(e,t)=>is(e,"table",t);const UP=(e,t,o,n,s=Z)=>{const r=n===1;if(!r&&o<=0){return HP.first(e[0])}else if(r&&o>=e.length-1){return HP.last(e[e.length-1])}else{const r=o+n;const a=e[r];return s(a)?HP.middle(t,a):UP(e,t,r,n,s)}};const qP=(e,t)=>ZP(e,t).bind((t=>{const o=jP(t);const n=ce(o,(t=>xn(e,t)));return n.map((e=>({index:e,all:o})))}));const WP=(e,t,o)=>{const n=qP(e,o);return n.fold((()=>HP.none(e)),(o=>UP(o.all,e,o.index,1,t)))};const $P=(e,t,o)=>{const n=qP(e,o);return n.fold((()=>HP.none()),(o=>UP(o.all,e,o.index,-1,t)))};const GP=e=>zl(e).filter((e=>e.trim().length!==0||e.indexOf(dr)>-1)).isSome();const KP=e=>Ho(e)&&Wo(e,"contenteditable")==="false";const YP=["img","br"];const XP=e=>{const t=GP(e);return t||Y(YP,Mo(e))||KP(e)};const JP=e=>rs(e,XP);const QP=(e,t)=>({left:e.left-t,top:e.top-t,right:e.right+t*2,bottom:e.bottom+t*2,width:e.width+t,height:e.height+t});const eF=(e,t)=>le(t,(t=>{const o=QP(gd(t.getBoundingClientRect()),-1);return[{x:o.left,y:e(o),cell:t},{x:o.right,y:e(o),cell:t}]}));const tF=(e,t,o)=>se(e,((e,n)=>e.fold((()=>U.some(n)),(e=>{const s=Math.sqrt(Math.abs(e.x-t)+Math.abs(e.y-o));const r=Math.sqrt(Math.abs(n.x-t)+Math.abs(n.y-o));return U.some(r<s?n:e)}))),U.none());const oF=(e,t,o,n,s)=>{const r=sr(yn.fromDom(o),"td,th,caption").map((e=>e.dom));const a=oe(eF(e,r),(e=>t(e,s)));return tF(a,n,s).map((e=>e.cell))};const nF=e=>e.bottom;const sF=e=>e.top;const rF=(e,t)=>e.y<t;const aF=(e,t)=>e.y>t;const cF=H(oF,nF,rF);const iF=H(oF,sF,aF);const lF=(e,t)=>he(t.getClientRects()).bind((t=>cF(e,t.left,t.top))).bind((e=>HL(qL(e),t)));const dF=(e,t)=>ye(t.getClientRects()).bind((t=>iF(e,t.left,t.top))).bind((e=>HL(UL(e),t)));const uF=(e,t,o)=>o.breakAt.exists((o=>e(t,o).breakAt.isSome()));const fF=e=>e.breakType===AL.Wrap&&e.positions.length===0;const mF=e=>e.breakType===AL.Br&&e.positions.length===1;const gF=(e,t,o)=>{const n=e(t,o);if(fF(n)||!Fr(o.getNode())&&mF(n)){return!uF(e,t,n)}else{return n.breakAt.isNone()}};const pF=H(gF,IL);const hF=H(gF,PL);const yF=(e,t,o)=>{const n=mu.fromRangeStart(t);return Fp(!e,o).exists((e=>e.isEqual(n)))};const bF=(e,t,o,n)=>{const s=e.selection.getRng();const r=t?1:-1;if(Ig()&&yF(t,s,o)){lB(r,e,o,!t,false).each((t=>{fH(e,t)}));return true}return false};const vF=(e,t,o)=>lF(t,o).orThunk((()=>he(o.getClientRects()).bind((o=>LL(FL(e,mu.before(t)),o.left))))).getOr(mu.before(t));const kF=(e,t,o)=>dF(t,o).orThunk((()=>he(o.getClientRects()).bind((o=>LL(VL(e,mu.after(t)),o.left))))).getOr(mu.after(t));const wF=(e,t)=>{const o=t.getNode(e);return Dr(o)?U.some(o):U.none()};const _F=(e,t,o)=>{t.undoManager.transact((()=>{const n=e?Cs:xs;const s=qI(t,yn.fromDom(o),n);fH(t,s)}))};const xF=(e,t,o)=>{const n=t?wF(true,o):wF(false,o);const s=t===false;n.fold((()=>fH(e,o.toRange())),(n=>Fp(s,e.getBody()).filter((e=>e.isEqual(o))).fold((()=>fH(e,o.toRange())),(o=>_F(t,e,n)))))};const CF=(e,t,o,n)=>{const s=e.selection.getRng();const r=mu.fromRangeStart(s);const a=e.getBody();if(!t&&pF(n,r)){const n=vF(a,o,r);xF(e,t,n);return true}else if(t&&hF(n,r)){const n=kF(a,o,r);xF(e,t,n);return true}else{return false}};const SF=(e,t,o)=>U.from(e.dom.getParent(e.selection.getNode(),"td,th")).bind((n=>U.from(e.dom.getParent(n,"table")).map((s=>o(e,t,s,n))))).getOr(false);const zF=(e,t)=>SF(e,t,bF);const TF=(e,t)=>SF(e,t,CF);const EF=e=>{const t=Qb.exact(e,0,e,0);return rv(t)};const OF=(e,t,o)=>o.fold(U.none,U.none,((e,t)=>JP(t).map((e=>EF(e)))),(o=>{e.execCommand("mceTableInsertRowAfter");return AF(e,t,o)}));const AF=(e,t,o)=>OF(e,t,WP(o,ds));const DF=(e,t,o)=>OF(e,t,$P(o,ds));const NF=(e,t)=>{const o=["table","li","dl"];const n=yn.fromDom(e.getBody());const s=e=>{const t=Mo(e);return xn(e,n)||Y(o,t)};const r=e.selection.getRng();const a=yn.fromDom(!t?r.startContainer:r.endContainer);return VP(a,s).map((o=>{ZP(o,s).each((t=>{e.model.table.clearSelectedCells(t.dom)}));e.selection.collapse(!t);const n=!t?DF:AF;const r=n(e,s,o);r.each((t=>{e.selection.setRng(t)}));return true})).getOr(false)};const MF=(e,t,o)=>{const n=to.os.isMacOS()||to.os.isiOS();AP([{keyCode:pb.RIGHT,action:OP(dP,e,true)},{keyCode:pb.LEFT,action:OP(dP,e,false)},{keyCode:pb.UP,action:OP(uP,e,false)},{keyCode:pb.DOWN,action:OP(uP,e,true)},...n?[{keyCode:pb.UP,action:OP(mP,e,false),metaKey:true,shiftKey:true},{keyCode:pb.DOWN,action:OP(mP,e,true),metaKey:true,shiftKey:true}]:[],{keyCode:pb.RIGHT,action:OP(zF,e,true)},{keyCode:pb.LEFT,action:OP(zF,e,false)},{keyCode:pb.UP,action:OP(TF,e,false)},{keyCode:pb.DOWN,action:OP(TF,e,true)},{keyCode:pb.UP,action:OP(TF,e,false)},{keyCode:pb.UP,action:OP(_P,e,false)},{keyCode:pb.DOWN,action:OP(_P,e,true)},{keyCode:pb.RIGHT,action:OP(NP,e,true)},{keyCode:pb.LEFT,action:OP(NP,e,false)},{keyCode:pb.UP,action:OP(MP,e,false)},{keyCode:pb.DOWN,action:OP(MP,e,true)},{keyCode:pb.RIGHT,action:OP(zH,e,t,true)},{keyCode:pb.LEFT,action:OP(zH,e,t,false)},{keyCode:pb.RIGHT,ctrlKey:!n,altKey:n,action:OP(OH,e,t)},{keyCode:pb.LEFT,ctrlKey:!n,altKey:n,action:OP(AH,e,t)},{keyCode:pb.UP,action:OP(bP,e,false)},{keyCode:pb.DOWN,action:OP(bP,e,true)}],o).each((e=>{o.preventDefault()}))};const RF=(e,t)=>{e.on("keydown",(o=>{if(!o.isDefaultPrevented()){MF(e,t,o)}}))};const BF=(e,t)=>({container:e,offset:t});const LF=zi.DOM;const HF=e=>t=>e===t?-1:0;const IF=e=>t=>e.isBlock(t)||Y(["BR","IMG","HR","INPUT"],t.nodeName)||e.getContentEditable(t)==="false";const PF=(e,t,o)=>{if(Rr(e)&&t>=0){return U.some(BF(e,t))}else{const n=_l(LF);return U.from(n.backwards(e,t,HF(e),o)).map((e=>BF(e.container,e.container.data.length)))}};const FF=(e,t,o)=>{if(Rr(e)&&t>=e.length){return U.some(BF(e,t))}else{const n=_l(LF);return U.from(n.forwards(e,t,HF(e),o)).map((e=>BF(e.container,0)))}};const VF=(e,t,o)=>{if(!Rr(e)){return U.none()}const n=e.data;if(t>=0&&t<=n.length){return U.some(BF(e,t))}else{const n=_l(LF);return U.from(n.backwards(e,t,HF(e),o)).bind((e=>{const n=e.container.data;return VF(e.container,t+n.length,o)}))}};const jF=(e,t,o)=>{if(!Rr(e)){return U.none()}const n=e.data;if(t<=n.length){return U.some(BF(e,t))}else{const s=_l(LF);return U.from(s.forwards(e,t,HF(e),o)).bind((e=>jF(e.container,t-n.length,o)))}};const ZF=(e,t,o,n,s)=>{const r=_l(e,IF(e));return U.from(r.backwards(t,o,n,s))};const UF=e=>e.collapsed&&Rr(e.startContainer);const qF=e=>Yl(e.toString().replace(/\u00A0/g," "));const WF=e=>e!==""&&" \f\n\r\t\v".indexOf(e)!==-1;const $F=(e,t)=>e.substring(t.length);const GF=(e,t,o,n=false)=>{let s;const r=o.charAt(0);for(s=t-1;s>=0;s--){const a=e.charAt(s);if(!n&&WF(a)){return U.none()}if(r===a&&it(e,o,s,t)){break}}return U.some(s)};const KF=(e,t,o,n=false)=>{if(!UF(t)){return U.none()}const s={text:"",offset:0};const r=(e,t,r)=>{s.text=r+s.text;s.offset+=t;return GF(s.text,s.offset,o,n).getOr(t)};const a=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return ZF(e,t.startContainer,t.startOffset,r,a).bind((e=>{const n=t.cloneRange();n.setStart(e.container,e.offset);n.setEnd(t.endContainer,t.endOffset);if(n.collapsed){return U.none()}const s=qF(n);const r=s.lastIndexOf(o);if(r!==0){return U.none()}else{return U.some({text:$F(s,o),range:n,trigger:o})}}))};const YF=e=>e.nodeType===No;const XF=e=>e.nodeType===Do;const JF=e=>{if(YF(e)){return BF(e,e.data.length)}else{const t=e.childNodes;return t.length>0?JF(t[t.length-1]):BF(e,t.length)}};const QF=(e,t)=>{const o=e.childNodes;if(o.length>0&&t<o.length){return QF(o[t],0)}else if(o.length>0&&XF(e)&&o.length===t){return JF(o[o.length-1])}else{return BF(e,t)}};const eV=(e,t)=>{var o;const n=(o=e.getParent(t.container,e.isBlock))!==null&&o!==void 0?o:e.getRoot();return ZF(e,t.container,t.offset,((e,t)=>t===0?-1:t),n).filter((e=>{const t=e.container.data.charAt(e.offset-1);return!WF(t)})).isSome()};const tV=e=>t=>{const o=QF(t.startContainer,t.startOffset);return!eV(e,o)};const oV=(e,t,o)=>ve(o.triggers,(o=>KF(e,t,o)));const nV=(e,t)=>{const o=t();const n=e.selection.getRng();return oV(e.dom,n,o).bind((o=>sV(e,t,o)))};const sV=(e,t,o,n={})=>{var s;const r=t();const a=e.selection.getRng();const c=(s=a.startContainer.nodeValue)!==null&&s!==void 0?s:"";const i=oe(r.lookupByTrigger(o.trigger),(t=>o.text.length>=t.minChars&&t.matches.getOrThunk((()=>tV(e.dom)))(o.range,c,o.text)));if(i.length===0){return U.none()}const l=Promise.all(J(i,(e=>{const t=e.fetch(o.text,e.maxResults,n);return t.then((t=>({matchText:o.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn})))})));return U.some({lookupData:l,context:o})};var rV;(function(e){e[e["Error"]=0]="Error";e[e["Value"]=1]="Value"})(rV||(rV={}));const aV=(e,t,o)=>e.stype===rV.Error?t(e.serror):o(e.svalue);const cV=e=>{const t=[];const o=[];Q(e,(e=>{aV(e,(e=>o.push(e)),(e=>t.push(e)))}));return{values:t,errors:o}};const iV=(e,t)=>{if(e.stype===rV.Error){return{stype:rV.Error,serror:t(e.serror)}}else{return e}};const lV=(e,t)=>{if(e.stype===rV.Value){return{stype:rV.Value,svalue:t(e.svalue)}}else{return e}};const dV=(e,t)=>{if(e.stype===rV.Value){return t(e.svalue)}else{return e}};const uV=(e,t)=>{if(e.stype===rV.Error){return t(e.serror)}else{return e}};const fV=e=>({stype:rV.Value,svalue:e});const mV=e=>({stype:rV.Error,serror:e});const gV=e=>aV(e,Xu.error,Xu.value);const pV=e=>e.fold(mV,fV);const hV={fromResult:pV,toResult:gV,svalue:fV,partition:cV,serror:mV,bind:dV,bindError:uV,map:lV,mapError:iV,fold:aV};const yV=e=>k(e)&&we(e).length>100?" removed due to size":JSON.stringify(e,null,2);const bV=e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:R("... (only showing first ten failures)")}]):e;return J(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))};const vV=(e,t)=>hV.serror([{path:e,getErrorInfo:t}]);const kV=(e,t,o)=>vV(e,(()=>'Could not find valid *required* value for "'+t+'" in '+yV(o)));const wV=(e,t)=>vV(e,(()=>'Choice schema did not contain choice key: "'+t+'"'));const _V=(e,t,o)=>vV(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+yV(t)));const xV=(e,t)=>vV(e,R(t));const CV=(e,t,o,n)=>{const s=Ne(o,n);return s.fold((()=>_V(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t)))};const SV=(e,t)=>{const o=(o,n)=>{const s=Ne(n,e);return s.fold((()=>wV(o,e)),(e=>CV(o,n,t,e)))};const n=()=>"chooseOn("+e+"). Possible values: "+we(t);return{extract:o,toString:n}};const zV=(e,t)=>t;const TV=(e,t)=>{const o=w(e)&&w(t);return o?OV(e,t):t};const EV=e=>(...t)=>{if(t.length===0){throw new Error(`Can't merge zero objects`)}const o={};for(let n=0;n<t.length;n++){const s=t[n];for(const t in s){if(Me(s,t)){o[t]=e(o[t],s[t])}}}return o};const OV=EV(TV);const AV=EV(zV);const DV=()=>({tag:"required",process:{}});const NV=e=>({tag:"defaultedThunk",process:e});const MV=e=>NV(R(e));const RV=()=>({tag:"option",process:{}});const BV=(e,t)=>e.length>0?hV.svalue(OV(t,AV.apply(undefined,e))):hV.svalue(t);const LV=e=>N(hV.serror,ie)(e);const HV=(e,t)=>{const o=hV.partition(e);return o.errors.length>0?LV(o.errors):BV(o.values,t)};const IV=e=>{const t=hV.partition(e);return t.errors.length>0?LV(t.errors):hV.svalue(t.values)};const PV={consolidateObj:HV,consolidateArr:IV};const FV=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n});const VV=(e,t)=>({tag:"custom",newKey:e,instantiator:t});const jV=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}};const ZV=e=>{const t=(t,o)=>hV.bindError(e(o),(e=>xV(t,e)));const o=R("val");return{extract:t,toString:o}};const UV=ZV(hV.svalue);const qV=(e,t,o,n)=>Ne(t,o).fold((()=>kV(e,o,t)),n);const WV=(e,t,o,n)=>{const s=Ne(e,t).getOrThunk((()=>o(e)));return n(s)};const $V=(e,t,o)=>o(Ne(e,t));const GV=(e,t,o,n)=>{const s=Ne(e,t).map((t=>t===true?o(e):t));return n(s)};const KV=(e,t,o,n,s)=>{const r=e=>s.extract(t.concat([n]),e);const a=e=>e.fold((()=>hV.svalue(U.none())),(e=>{const o=s.extract(t.concat([n]),e);return hV.map(o,U.some)}));switch(e.tag){case"required":return qV(t,o,n,r);case"defaultedThunk":return WV(o,n,e.process,r);case"option":return $V(o,n,a);case"defaultedOptionThunk":return GV(o,n,e.process,a);case"mergeWithThunk":{return WV(o,n,R({}),(t=>{const n=OV(e.process(o),t);return r(n)}))}}};const YV=(e,t,o)=>{const n={};const s=[];for(const r of o){jV(r,((o,r,a,c)=>{const i=KV(a,e,t,o,c);hV.fold(i,(e=>{s.push(...e)}),(e=>{n[r]=e}))}),((e,o)=>{n[e]=o(t)}))}return s.length>0?hV.serror(s):hV.svalue(n)};const XV=e=>{const t=(t,o)=>YV(t,o,e);const o=()=>{const t=J(e,(e=>jV(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:o}};const JV=e=>{const t=(t,o)=>{const n=J(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return PV.consolidateArr(n)};const o=()=>"array("+e.toString()+")";return{extract:t,toString:o}};const QV=e=>ZV((t=>e(t).fold(hV.serror,hV.svalue)));const ej=(e,t,o)=>{const n=t.extract([e],o);return hV.mapError(n,(e=>({input:o,errors:e})))};const tj=(e,t,o)=>hV.toResult(ej(e,t,o));const oj=e=>"Errors: \n"+bV(e.errors).join("\n")+"\n\nInput object: "+yV(e.input);const nj=(e,t)=>SV(e,Ce(t,XV));const sj=R(UV);const rj=(e,t)=>ZV((o=>{const n=typeof o;return e(o)?hV.svalue(o):hV.serror(`Expected type: ${t} but got: ${n}`)}));const aj=rj(O,"number");const cj=rj(v,"string");const ij=rj(C,"boolean");const lj=rj(E,"function");const dj=FV;const uj=VV;const fj=e=>QV((t=>Y(e,t)?Xu.value(t):Xu.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`)));const mj=(e,t)=>dj(e,e,DV(),t);const gj=e=>mj(e,cj);const pj=e=>mj(e,lj);const hj=(e,t)=>dj(e,e,DV(),JV(t));const yj=(e,t)=>dj(e,e,RV(),t);const bj=e=>yj(e,cj);const vj=e=>yj(e,lj);const kj=(e,t)=>dj(e,e,MV(t),sj());const wj=(e,t,o)=>dj(e,e,MV(t),o);const _j=(e,t)=>wj(e,t,aj);const xj=(e,t)=>wj(e,t,cj);const Cj=(e,t,o)=>wj(e,t,fj(o));const Sj=(e,t)=>wj(e,t,ij);const zj=(e,t)=>wj(e,t,lj);const Tj=(e,t,o)=>wj(e,t,JV(o));const Ej=gj("type");const Oj=pj("fetch");const Aj=pj("onAction");const Dj=zj("onSetup",(()=>D));const Nj=bj("text");const Mj=bj("icon");const Rj=bj("tooltip");const Bj=bj("label");const Lj=Sj("active",false);const Hj=Sj("enabled",true);const Ij=Sj("primary",false);const Pj=e=>kj("columns",e);const Fj=e=>xj("type",e);const Vj=XV([Ej,gj("trigger"),_j("minChars",1),Pj(1),_j("maxResults",10),vj("matches"),Oj,Aj,Tj("highlightOn",[],cj)]);const jj=e=>tj("Autocompleter",Vj,e);const Zj=[Hj,Rj,Mj,Nj,Dj];const Uj=[Lj].concat(Zj);const qj=[zj("predicate",j),Cj("scope","node",["node","editor"]),Cj("position","selection",["node","selection","line"])];const Wj=Zj.concat([Fj("contextformbutton"),Ij,Aj,uj("original",B)]);const $j=Uj.concat([Fj("contextformbutton"),Ij,Aj,uj("original",B)]);const Gj=Zj.concat([Fj("contextformbutton")]);const Kj=Uj.concat([Fj("contextformtogglebutton")]);const Yj=nj("type",{contextformbutton:Wj,contextformtogglebutton:$j});XV([Fj("contextform"),zj("initValue",R("")),Bj,hj("commands",Yj),yj("launch",nj("type",{contextformbutton:Gj,contextformtogglebutton:Kj}))].concat(qj));const Xj=e=>{const t=e.ui.registry.getAll().popups;const o=Ce(t,(e=>jj(e).fold((e=>{throw new Error(oj(e))}),B)));const n=Le(Ae(o,(e=>e.trigger)));const s=De(o);const r=e=>oe(s,(t=>t.trigger===e));return{dataset:o,triggers:n,lookupByTrigger:r}};const Jj=(e,t)=>{const o=Ki(t.load,50);e.on("input",(t=>{if(t.inputType==="insertCompositionText"&&!e.composing){return}o.throttle()}));e.on("keydown",(e=>{const n=e.which;if(n===8){o.throttle()}else if(n===27){o.cancel();t.cancelIfNecessary()}else if(n===38||n===40){o.cancel()}}),true);e.on("remove",o.cancel)};const Qj=e=>{const t=ua();const o=ia(false);const n=t.isSet;const s=()=>{if(n()){db(e);o.set(false);t.clear()}};const r=e=>{if(!n()){t.set({trigger:e.trigger,matchLength:e.text.length})}};const a=$e((()=>Xj(e)));const c=o=>t.get().map((t=>KF(e.dom,e.selection.getRng(),t.trigger,true).bind((t=>sV(e,a,t,o))))).getOrThunk((()=>nV(e,a)));const i=n=>{c(n).fold(s,(n=>{r(n.context);n.lookupData.then((s=>{t.get().map((r=>{const a=n.context;if(r.trigger!==a.trigger){return}t.set({...r,matchLength:a.text.length});if(o.get()){lb(e,{range:a.range});ib(e,{lookupData:s})}else{o.set(true);lb(e,{range:a.range});cb(e,{lookupData:s})}}))}))}))};const l=(e,t)=>{const o=e.compareBoundaryPoints(window.Range.START_TO_START,t);const n=e.compareBoundaryPoints(window.Range.END_TO_END,t);return o>=0&&n<=0};const d=()=>t.get().bind((({trigger:t})=>{const n=e.selection.getRng();return KF(e.dom,n,t,o.get()).filter((({range:e})=>l(n,e))).map((({range:e})=>e))}));e.addCommand("mceAutocompleterReload",((e,t)=>{const o=k(t)?t.fetchOptions:{};i(o)}));e.addCommand("mceAutocompleterClose",s);e.addCommand("mceAutocompleterRefreshActiveRange",(()=>{d().each((t=>{lb(e,{range:t})}))}));e.editorCommands.addQueryStateHandler("mceAutoCompleterInRange",(()=>d().isSome()));Jj(e,{cancelIfNecessary:s,load:i})};const eZ=Gt().browser;const tZ=eZ.isSafari();const oZ=e=>Wl(yn.fromDom(e));const nZ=(e,t)=>{var o;return e.startOffset===0&&e.endOffset===((o=t.textContent)===null||o===void 0?void 0:o.length)};const sZ=(e,t)=>U.from(e.getParent(t.container(),"details"));const rZ=(e,t)=>sZ(e,t).isSome();const aZ=(e,t)=>{const o=U.from(e.getParent(t.startContainer,"details"));const n=U.from(e.getParent(t.endContainer,"details"));if(o.isSome()||n.isSome()){const t=o.bind((t=>U.from(e.select("summary",t)[0])));return U.some({startSummary:t,startDetails:o,endDetails:n})}else{return U.none()}};const cZ=(e,t)=>Zp(t).exists((t=>t.isEqual(e)));const iZ=(e,t)=>Up(t).exists((o=>{if(Fr(o.getNode())){return jp(t,o).exists((t=>t.isEqual(e)))||o.isEqual(e)}else{return o.isEqual(e)}}));const lZ=(e,t)=>t.startSummary.exists((t=>cZ(e,t)));const dZ=(e,t)=>t.startSummary.exists((t=>iZ(e,t)));const uZ=(e,t)=>t.startDetails.exists((o=>jp(o,e).forall((o=>t.startSummary.exists((t=>!t.contains(e.container())&&t.contains(o.container())))))));const fZ=(e,t,o)=>o.startDetails.exists((o=>Vp(e,t).forall((e=>!o.contains(e.container())))));const mZ=(e,t)=>{const o=t.getNode();if(!S(o)){e.selection.setCursorLocation(o,t.offset())}};const gZ=(e,t,o)=>{const n=e.dom.getParent(t.container(),"details");if(n&&!n.open){const t=e.dom.select("summary",n)[0];if(t){const n=o?Zp(t):Up(t);n.each((t=>mZ(e,t)))}}else{mZ(e,t)}};const pZ=(e,t)=>{const o=t=>t.contains(e.startContainer);const n=t=>t.contains(e.endContainer);const s=t.startSummary.exists(o);const r=t.startSummary.exists(n);const a=t.startDetails.forall((e=>t.endDetails.forall((t=>e!==t))));const c=(s||r)&&!(s&&r);return c||a};const hZ=(e,t,o)=>{const{dom:n,selection:s}=e;const r=e.getBody();if(o==="character"){const o=mu.fromRangeStart(s.getRng());const a=n.getParent(o.container(),n.isBlock);const c=sZ(n,o);const i=a&&n.isEmpty(a);const l=x(a===null||a===void 0?void 0:a.previousSibling);const d=x(a===null||a===void 0?void 0:a.nextSibling);if(i){const e=t?d:l;if(e){const e=Ip(!t,r,o).exists((e=>rZ(n,e)&&!po(c,sZ(n,e))));if(e){return true}}}return Ip(t,r,o).fold(j,(o=>{const s=sZ(n,o);if(rZ(n,o)&&!po(c,s)){if(!t){gZ(e,o,false)}if(a&&i){if(t&&l){return true}else if(!t&&d){return true}gZ(e,o,t);e.dom.remove(a)}return true}else{return false}}))}else{return false}};const yZ=(e,t,o,n)=>{const s=e.selection;const r=s.getRng();const a=mu.fromRangeStart(r);const c=e.getBody();if(n==="selection"){return pZ(r,t)}else if(o){return dZ(a,t)||fZ(c,a,t)}else{return lZ(a,t)||uZ(a,t)}};const bZ=(e,t,o)=>aZ(e.dom,e.selection.getRng()).fold((()=>hZ(e,t,o)),(n=>yZ(e,n,t,o)||hZ(e,t,o)));const vZ=(e,t,o)=>{const n=e.selection;const s=n.getNode();const r=n.getRng();const a=mu.fromRangeStart(r);if(Kr(s)){if(o==="selection"&&nZ(r,s)||Px(t,a,s)){oZ(s)}else{e.undoManager.transact((()=>{const r=n.getSel();let{anchorNode:a,anchorOffset:c,focusNode:i,focusOffset:l}=r!==null&&r!==void 0?r:{};const d=()=>{if(T(a)&&T(c)&&T(i)&&T(l)){r===null||r===void 0?void 0:r.setBaseAndExtent(a,c,i,l)}};const u=()=>{a=r===null||r===void 0?void 0:r.anchorNode;c=r===null||r===void 0?void 0:r.anchorOffset;i=r===null||r===void 0?void 0:r.focusNode;l=r===null||r===void 0?void 0:r.focusOffset};const f=(e,t)=>{Q(e.childNodes,(e=>{if(Hh(e)){t.appendChild(e)}}))};const m=e.dom.create("span",{"data-mce-bogus":"1"});f(s,m);s.appendChild(m);d();if(o==="word"||o==="line"){r===null||r===void 0?void 0:r.modify("extend",t?"right":"left",o)}if(!n.isCollapsed()&&nZ(n.getRng(),m)){oZ(s)}else{e.execCommand(t?"ForwardDelete":"Delete");u();f(m,s);d()}e.dom.remove(m)}))}return true}else{return false}};const kZ=(e,t,o)=>bZ(e,t,o)||tZ&&vZ(e,t,o)?U.some(D):U.none();const wZ=e=>(t,o,n={})=>{const s=t.getBody();const r={bubbles:true,composed:true,data:null,isComposing:false,detail:0,view:null,target:s,currentTarget:s,eventPhase:Event.AT_TARGET,originalTarget:s,explicitOriginalTarget:s,isTrusted:false,srcElement:s,cancelable:false,preventDefault:D,inputType:o};const a=ri(new InputEvent(e));return t.dispatch(e,{...a,...r,...n})};const _Z=wZ("input");const xZ=wZ("beforeinput");const CZ=Gt();const SZ=CZ.os;const zZ=SZ.isMacOS()||SZ.isiOS();const TZ=CZ.browser;const EZ=TZ.isFirefox();const OZ=(e,t,o)=>{const n=o.keyCode===pb.BACKSPACE?"deleteContentBackward":"deleteContentForward";const s=e.selection.isCollapsed();const r=s?"character":"selection";const a=e=>{if(s){return e?"word":"line"}else{return"selection"}};DP([{keyCode:pb.BACKSPACE,action:OP(OI,e)},{keyCode:pb.BACKSPACE,action:OP(FB,e,false)},{keyCode:pb.DELETE,action:OP(FB,e,true)},{keyCode:pb.BACKSPACE,action:OP(vB,e,false)},{keyCode:pb.DELETE,action:OP(vB,e,true)},{keyCode:pb.BACKSPACE,action:OP(IH,e,t,false)},{keyCode:pb.DELETE,action:OP(IH,e,t,true)},{keyCode:pb.BACKSPACE,action:OP(PC,e,false)},{keyCode:pb.DELETE,action:OP(PC,e,true)},{keyCode:pb.BACKSPACE,action:OP(kZ,e,false,r)},{keyCode:pb.DELETE,action:OP(kZ,e,true,r)},...zZ?[{keyCode:pb.BACKSPACE,altKey:true,action:OP(kZ,e,false,a(true))},{keyCode:pb.DELETE,altKey:true,action:OP(kZ,e,true,a(true))},{keyCode:pb.BACKSPACE,metaKey:true,action:OP(kZ,e,false,a(false))}]:[{keyCode:pb.BACKSPACE,ctrlKey:true,action:OP(kZ,e,false,a(true))},{keyCode:pb.DELETE,ctrlKey:true,action:OP(kZ,e,true,a(true))}],{keyCode:pb.BACKSPACE,action:OP($B,e,false)},{keyCode:pb.DELETE,action:OP($B,e,true)},{keyCode:pb.BACKSPACE,action:OP(hI,e,false)},{keyCode:pb.DELETE,action:OP(hI,e,true)},{keyCode:pb.BACKSPACE,action:OP(iB,e,false)},{keyCode:pb.DELETE,action:OP(iB,e,true)},{keyCode:pb.BACKSPACE,action:OP(tB,e,false)},{keyCode:pb.DELETE,action:OP(tB,e,true)},{keyCode:pb.BACKSPACE,action:OP(iI,e,false)},{keyCode:pb.DELETE,action:OP(iI,e,true)},{keyCode:pb.BACKSPACE,action:OP(qB,e,false)},{keyCode:pb.DELETE,action:OP(qB,e,true)}],o).filter((t=>e.selection.isEditable())).each((t=>{o.preventDefault();const s=xZ(e,n);if(!s.isDefaultPrevented()){t();_Z(e,n)}}))};const AZ=(e,t,o)=>AP([{keyCode:pb.BACKSPACE,action:OP(PB,e)},{keyCode:pb.DELETE,action:OP(PB,e)},...zZ?[{keyCode:pb.BACKSPACE,altKey:true,action:OP(fI,e)},{keyCode:pb.DELETE,altKey:true,action:OP(fI,e)},...o?[{keyCode:EZ?224:91,action:OP(fI,e)}]:[]]:[{keyCode:pb.BACKSPACE,ctrlKey:true,action:OP(fI,e)},{keyCode:pb.DELETE,ctrlKey:true,action:OP(fI,e)}]],t);const DZ=(e,t)=>{let o=false;e.on("keydown",(n=>{o=n.keyCode===pb.BACKSPACE;if(!n.isDefaultPrevented()){OZ(e,t,n)}}));e.on("keyup",(t=>{if(!t.isDefaultPrevented()){AZ(e,t,o)}o=false}))};const NZ=e=>{while(e){if(_r(e)||Rr(e)&&e.data&&/[\r\n\s]/.test(e.data)){return e}e=e.nextSibling}return null};const MZ=(e,t)=>{const o=e.dom;const n=e.schema.getMoveCaretBeforeOnEnterElements();if(!t){return}if(/^(LI|DT|DD)$/.test(t.nodeName)){const e=NZ(t.firstChild);if(e&&/^(UL|OL|DL)$/.test(e.nodeName)){t.insertBefore(o.doc.createTextNode(dr),t.firstChild)}}const s=o.createRng();t.normalize();if(t.hasChildNodes()){const e=new ir(t,t);let o=t;let r;while(r=e.current()){if(Rr(r)){s.setStart(r,0);s.setEnd(r,0);break}if(n[r.nodeName.toLowerCase()]){s.setStartBefore(r);s.setEndBefore(r);break}o=r;r=e.next()}if(!r){s.setStart(o,0);s.setEnd(o,0)}}else{if(Fr(t)){if(t.nextSibling&&o.isBlock(t.nextSibling)){s.setStartBefore(t);s.setEndBefore(t)}else{s.setStartAfter(t);s.setEndAfter(t)}}else{s.setStart(t,0);s.setEnd(t,0)}}e.selection.setRng(s);Qv(e,s)};const RZ=(e,t)=>{const o=e.getRoot();let n;let s=t;while(s!==o&&s&&e.getContentEditable(s)!=="false"){if(e.getContentEditable(s)==="true"){n=s;break}s=s.parentNode}return s!==o?n:o};const BZ=e=>U.from(e.dom.getParent(e.selection.getStart(true),e.dom.isBlock));const LZ=e=>BZ(e).fold(R(""),(e=>e.nodeName.toUpperCase()));const HZ=e=>BZ(e).filter((e=>Pl(yn.fromDom(e)))).isSome();const IZ=e=>{e.innerHTML='<br data-mce-bogus="1">'};const PZ=(e,t,o)=>{const n=e.dom;U.from(o.style).map(n.parseStyle).each((e=>{const o=ks(yn.fromDom(t));const s={...o,...e};n.setStyles(t,s)}));const s=U.from(o.class).map((e=>e.split(/\s+/)));const r=U.from(t.className).map((e=>oe(e.split(/\s+/),(e=>e!==""))));yo(s,r,((e,o)=>{const s=oe(o,(t=>!Y(e,t)));const r=[...e,...s];n.setAttrib(t,"class",r.join(" "))}));const a=["style","class"];const c=Oe(o,((e,t)=>!Y(a,t)));n.setAttribs(t,c)};const FZ=(e,t)=>{const o=Ef(e);if(o.toLowerCase()===t.tagName.toLowerCase()){const o=Of(e);PZ(e,t,o)}};const VZ=(e,t,o,n,s=true,r,a)=>{const c=e.dom;const i=e.schema;const l=Ef(e);const d=o?o.nodeName.toUpperCase():"";let u=t;const f=i.getTextInlineElements();let m;if(r||d==="TABLE"||d==="HR"){m=c.create(r||l,a||{})}else{m=o.cloneNode(false)}let g=m;if(!s){c.setAttrib(m,"style",null);c.setAttrib(m,"class",null)}else{do{if(f[u.nodeName]){if(Wp(u)||ph(u)){continue}const e=u.cloneNode(false);c.setAttrib(e,"id","");if(m.hasChildNodes()){e.appendChild(m.firstChild);m.appendChild(e)}else{g=e;m.appendChild(e)}}}while((u=u.parentNode)&&u!==n)}FZ(e,m);IZ(g);return m};const jZ=(e,t)=>e.dom.getParent(t,Gr);const ZZ=(e,t,o)=>{let n=t;while(n&&n!==e&&x(n.nextSibling)){const e=n.parentElement;if(!e||!o(e)){return Gr(e)}n=e}return false};const UZ=(e,t,o)=>!t&&o.nodeName.toLowerCase()===Ef(e)&&e.dom.isEmpty(o)&&ZZ(e.getBody(),o,(t=>Me(e.schema.getTextBlockElements(),t.nodeName.toLowerCase())));const qZ=(e,t,o)=>{var n,s,r;const a=t(Ef(e));const c=jZ(e,o);if(!c){return}e.dom.insertAfter(a,c);MZ(e,a);if(((r=(s=(n=o.parentElement)===null||n===void 0?void 0:n.childNodes)===null||s===void 0?void 0:s.length)!==null&&r!==void 0?r:0)>1){e.dom.remove(o)}};const WZ=(e,t)=>e.firstChild&&e.firstChild.nodeName===t;const $Z=e=>{var t;return((t=e.parentNode)===null||t===void 0?void 0:t.firstChild)===e};const GZ=(e,t)=>{const o=e===null||e===void 0?void 0:e.parentNode;return T(o)&&o.nodeName===t};const KZ=e=>T(e)&&/^(OL|UL|LI)$/.test(e.nodeName);const YZ=e=>T(e)&&/^(LI|DT|DD)$/.test(e.nodeName);const XZ=e=>KZ(e)&&KZ(e.parentNode);const JZ=e=>{const t=e.parentNode;return YZ(t)?t:e};const QZ=(e,t,o)=>{let n=e[o?"firstChild":"lastChild"];while(n){if(_r(n)){break}n=n[o?"nextSibling":"previousSibling"]}return n===t};const eU=e=>se(Ae(ks(yn.fromDom(e)),((e,t)=>`${t}: ${e};`)),((e,t)=>e+t),"");const tU=(e,t,o,n,s)=>{const r=e.dom;const a=e.selection.getRng();const c=o.parentNode;if(o===e.getBody()||!c){return}if(XZ(o)){s="LI"}const i=YZ(n)?eU(n):undefined;let l=YZ(n)&&i?t(s,{style:eU(n)}):t(s);if(QZ(o,n,true)&&QZ(o,n,false)){if(GZ(o,"LI")){const e=JZ(o);r.insertAfter(l,e);if($Z(o)){r.remove(e)}else{r.remove(o)}}else{r.replace(l,o)}}else if(QZ(o,n,true)){if(GZ(o,"LI")){r.insertAfter(l,JZ(o));l.appendChild(r.doc.createTextNode(" "));l.appendChild(o)}else{c.insertBefore(l,o)}r.remove(n)}else if(QZ(o,n,false)){r.insertAfter(l,JZ(o));r.remove(n)}else{o=JZ(o);const e=a.cloneRange();e.setStartAfter(n);e.setEndAfter(o);const t=e.extractContents();if(s==="LI"&&WZ(t,"LI")){const e=oe(J(l.children,yn.fromDom),I(jo("br")));l=t.firstChild;r.insertAfter(t,o);Q(e,(e=>Ss(yn.fromDom(l),e)));if(i){l.setAttribute("style",i)}}else{r.insertAfter(t,o);r.insertAfter(l,o)}r.remove(n)}MZ(e,l)};const oU=e=>{Q(nr(yn.fromDom(e),Po),(e=>{const t=e.dom;t.nodeValue=Yl(t.data)}))};const nU=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return o!==null&&e.dom.getContentEditableParent(o)==="false"};const sU=(e,t)=>t&&t.nodeName==="A"&&e.isEmpty(t);const rU=(e,t)=>e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t;const aU=(e,t)=>T(t)&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&e.isEditable(t.parentNode)&&e.getContentEditable(t)!=="false";const cU=(e,t,o)=>{var n;const s=[];if(!o){return}let r=o;while(r=r.firstChild){if(e.isBlock(r)){return}if(_r(r)&&!t[r.nodeName.toLowerCase()]){s.push(r)}}let a=s.length;while(a--){r=s[a];if(!r.hasChildNodes()||r.firstChild===r.lastChild&&((n=r.firstChild)===null||n===void 0?void 0:n.nodeValue)===""){e.remove(r)}else{if(sU(e,r)){e.remove(r)}}}};const iU=(e,t,o)=>{if(!Rr(t)){return o}else if(e){return o===1&&t.data.charAt(o-1)===Gl?0:o}else{return o===t.data.length-1&&t.data.charAt(o)===Gl?t.data.length:o}};const lU=e=>{const t=e.cloneRange();t.setStart(e.startContainer,iU(true,e.startContainer,e.startOffset));t.setEnd(e.endContainer,iU(false,e.endContainer,e.endOffset));return t};const dU=e=>{let t=e;do{if(Rr(t)){t.data=t.data.replace(/^[\r\n]+/,"")}t=t.firstChild}while(t)};const uU=(e,t,o,n,s)=>{var r,a;const c=e.dom;const i=(r=RZ(c,n))!==null&&r!==void 0?r:c.getRoot();let l=c.getParent(n,c.isBlock);if(!l||!aU(c,l)){l=l||i;if(!l.hasChildNodes()){const n=c.create(t);FZ(e,n);l.appendChild(n);o.setStart(n,0);o.setEnd(n,0);return n}let r=n;while(r&&r.parentNode!==l){r=r.parentNode}let d;while(r&&!c.isBlock(r)){d=r;r=r.previousSibling}const u=(a=d===null||d===void 0?void 0:d.parentElement)===null||a===void 0?void 0:a.nodeName;if(d&&u&&e.schema.isValidChild(u,t.toLowerCase())){const a=d.parentNode;const i=c.create(t);FZ(e,i);a.insertBefore(i,d);r=d;while(r&&!c.isBlock(r)){const e=r.nextSibling;i.appendChild(r);r=e}o.setStart(n,s);o.setEnd(n,s)}}return n};const fU=(e,t)=>{t.normalize();const o=t.lastChild;if(!o||_r(o)&&/^(left|right)$/gi.test(e.getStyle(o,"float",true))){e.add(t,"br")}};const mU=(e,t)=>{const o=Rf(e);if(z(t)){return false}else if(v(o)){return Y(mo.explode(o),t.nodeName.toLowerCase())}else{return o}};const gU=(e,t)=>{let o;let n;let s;let r;let a=false;const c=e.dom;const i=e.schema,l=i.getNonEmptyElements();const d=e.selection.getRng();const u=Ef(e);const f=yn.fromDom(d.startContainer);const m=In(f,d.startOffset);const g=m.exists((e=>Ho(e)&&!ds(e)));const p=d.collapsed&&g;const h=(t,n)=>VZ(e,o,_,w,Mf(e),t,n);const y=e=>{const t=iU(e,o,n);if(Rr(o)&&(e?t>0:t<o.data.length)){return false}if((o.parentNode===_||o===_)&&a&&!e){return true}if(e&&_r(o)&&o===_.firstChild){return true}if(rU(o,"TABLE")||rU(o,"HR")){return a&&!e||!a&&e}const s=new ir(o,_);if(Rr(o)){if(e&&t===0){s.prev()}else if(!e&&t===o.data.length){s.next()}}let r;while(r=s.current()){if(_r(r)){if(!r.getAttribute("data-mce-bogus")){const e=r.nodeName.toLowerCase();if(l[e]&&e!=="br"){return false}}}else if(Rr(r)&&!gr(r.data)){return false}if(e){s.prev()}else{s.next()}}return true};const b=()=>{let t;if(/^(H[1-6]|PRE|FIGURE)$/.test(s)&&x!=="HGROUP"){t=h(u)}else{t=h()}if(mU(e,r)&&aU(c,r)&&c.isEmpty(_,undefined,{includeZwsp:true})){t=c.split(r,_)}else{c.insertAfter(t,_)}MZ(e,t);return t};bv(c,d).each((e=>{d.setStart(e.startContainer,e.startOffset);d.setEnd(e.endContainer,e.endOffset)}));o=d.startContainer;n=d.startOffset;const v=!!(t&&t.shiftKey);const k=!!(t&&t.ctrlKey);if(_r(o)&&o.hasChildNodes()&&!p){a=n>o.childNodes.length-1;o=o.childNodes[Math.min(n,o.childNodes.length-1)]||o;if(a&&Rr(o)){n=o.data.length}else{n=0}}const w=RZ(c,o);if(!w||nU(e,o)){return}if(!v){o=uU(e,u,d,o,n)}let _=c.getParent(o,c.isBlock)||c.getRoot();r=T(_===null||_===void 0?void 0:_.parentNode)?c.getParent(_.parentNode,c.isBlock):null;s=_?_.nodeName.toUpperCase():"";const x=r?r.nodeName.toUpperCase():"";if(x==="LI"&&!k){const e=r;_=e;r=e.parentNode;s=x}if(_r(r)&&UZ(e,v,_)){return qZ(e,h,_)}if(/^(LI|DT|DD)$/.test(s)&&_r(r)){if(c.isEmpty(_)){tU(e,h,r,_,u);return}}if(!p&&(_===e.getBody()||!aU(c,_))){return}const C=_.parentNode;let S;if(p){S=h(u);m.fold((()=>{zs(f,yn.fromDom(S))}),(e=>{xs(e,yn.fromDom(S))}));e.selection.setCursorLocation(S,0)}else if(ed(_)){S=ud(_);if(c.isEmpty(_)){IZ(_)}FZ(e,S);MZ(e,S)}else if(y(false)){S=b()}else if(y(true)&&C){const t=mu.fromRangeStart(d);const o=o_(t);const n=yn.fromDom(_);const s=w_(n,t,e.schema);const r=s?__(n,t,e.schema).bind((e=>U.from(e.getNode()))):U.none();S=C.insertBefore(h(),_);const a=rU(_,"HR")||o?S:r.getOr(_);MZ(e,a)}else{const t=lU(d).cloneRange();t.setEndAfter(_);const o=t.extractContents();oU(o);dU(o);S=o.firstChild;c.insertAfter(o,_);cU(c,l,S);fU(c,_);if(c.isEmpty(_)){IZ(_)}S.normalize();if(c.isEmpty(S)){c.remove(S);b()}else{FZ(e,S);MZ(e,S)}}c.setAttrib(S,"id","");e.dispatch("NewBlock",{newBlock:S})};const pU="insertParagraph";const hU={insert:gU,fakeEventName:pU};const yU=(e,t,o)=>{const n=new ir(t,o);let s;const r=e.getNonEmptyElements();while(s=n.next()){if(r[s.nodeName.toLowerCase()]||Rr(s)&&s.length>0){return true}}return false};const bU=(e,t,o)=>{const n=e.dom.createRng();if(!o){n.setStartAfter(t);n.setEndAfter(t)}else{n.setStartBefore(t);n.setEndBefore(t)}e.selection.setRng(n);Qv(e,n)};const vU=(e,t)=>{const o=e.selection;const n=e.dom;const s=o.getRng();let r;let a=false;bv(n,s).each((e=>{s.setStart(e.startContainer,e.startOffset);s.setEnd(e.endContainer,e.endOffset)}));let c=s.startOffset;let i=s.startContainer;if(_r(i)&&i.hasChildNodes()){const e=c>i.childNodes.length-1;i=i.childNodes[Math.min(c,i.childNodes.length-1)]||i;if(e&&Rr(i)){c=i.data.length}else{c=0}}let l=n.getParent(i,n.isBlock);const d=l&&l.parentNode?n.getParent(l.parentNode,n.isBlock):null;const u=d?d.nodeName.toUpperCase():"";const f=!!(t&&t.ctrlKey);if(u==="LI"&&!f){l=d}if(Rr(i)&&c>=i.data.length){if(!yU(e.schema,i,l||n.getRoot())){r=n.create("br");s.insertNode(r);s.setStartAfter(r);s.setEndAfter(r);a=true}}r=n.create("br");yu(n,s,r);bU(e,r,a);e.undoManager.add()};const kU=(e,t)=>{const o=yn.fromTag("br");xs(yn.fromDom(t),o);e.undoManager.add()};const wU=(e,t)=>{if(!xU(e.getBody(),t)){Cs(yn.fromDom(t),yn.fromTag("br"))}const o=yn.fromTag("br");Cs(yn.fromDom(t),o);bU(e,o.dom,false);e.undoManager.add()};const _U=e=>Fr(e.getNode());const xU=(e,t)=>{if(_U(mu.after(t))){return true}else{return Vp(e,mu.after(t)).map((e=>Fr(e.getNode()))).getOr(false)}};const CU=e=>e&&e.nodeName==="A"&&"href"in e;const SU=e=>e.fold(j,CU,CU,j);const zU=e=>{const t=H(_x,e);const o=mu.fromRangeStart(e.selection.getRng());return hL(t,e.getBody(),o).filter(SU)};const TU=(e,t)=>{t.fold(D,H(kU,e),H(wU,e),D)};const EU=(e,t)=>{const o=zU(e);if(o.isSome()){o.each(H(TU,e))}else{vU(e,t)}};const OU="insertLineBreak";const AU={insert:EU,fakeEventName:OU};const DU=(e,t)=>BZ(e).filter((e=>t.length>0&&vn(yn.fromDom(e),t))).isSome();const NU=e=>DU(e,Df(e));const MU=e=>DU(e,Nf(e));const RU=Qu.generate([{br:[]},{block:[]},{none:[]}]);const BU=(e,t)=>MU(e);const LU=e=>(t,o)=>HZ(t)===e;const HU=(e,t)=>(o,n)=>{const s=LZ(o)===e.toUpperCase();return s===t};const IU=e=>{const t=RZ(e.dom,e.selection.getStart());return z(t)};const PU=e=>HU("pre",e);const FU=()=>HU("summary",true);const VU=e=>(t,o)=>Tf(t)===e;const jU=(e,t)=>NU(e);const ZU=(e,t)=>t;const UU=e=>{const t=Ef(e);const o=RZ(e.dom,e.selection.getStart());return T(o)&&e.schema.isValidChild(o.nodeName,t)};const qU=e=>{const t=e.selection.getRng();const o=yn.fromDom(t.startContainer);const n=In(o,t.startOffset);const s=n.map((e=>Ho(e)&&!ds(e)));return t.collapsed&&s.getOr(true)};const WU=(e,t)=>(o,n)=>{const s=se(e,((e,t)=>e&&t(o,n)),true);return s?U.some(t):U.none()};const $U=(e,t)=>aL([WU([BU],RU.none()),WU([PU(true),IU],RU.none()),WU([FU()],RU.br()),WU([PU(true),VU(false),ZU],RU.br()),WU([PU(true),VU(false)],RU.block()),WU([PU(true),VU(true),ZU],RU.block()),WU([PU(true),VU(true)],RU.br()),WU([LU(true),ZU],RU.br()),WU([LU(true)],RU.block()),WU([jU],RU.br()),WU([ZU],RU.br()),WU([UU],RU.block()),WU([qU],RU.block())],[e,!!(t&&t.shiftKey)]).getOr(RU.none());const GU=(e,t,o)=>{if(!t.selection.isCollapsed()){Nx(t)}if(T(o)){const o=xZ(t,e.fakeEventName);if(o.isDefaultPrevented()){return}}e.insert(t,o);if(T(o)){_Z(t,e.fakeEventName)}};const KU=(e,t)=>{const o=()=>GU(AU,e,t);const n=()=>GU(hU,e,t);const s=$U(e,t);switch(Af(e)){case"linebreak":s.fold(o,o,D);break;case"block":s.fold(n,n,D);break;case"invert":s.fold(n,o,D);break;default:s.fold(o,n,D);break}};const YU=Gt();const XU=YU.os.isiOS()&&YU.browser.isSafari();const JU=(e,t)=>{if(t.isDefaultPrevented()){return}t.preventDefault();lD(e.undoManager);e.undoManager.transact((()=>{KU(e,t)}))};const QU=e=>{if(!e.collapsed){return false}const t=e.startContainer;if(Rr(t)){const o=/^[\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uD7B0-\uD7FF]$/;const n=t.data.charAt(e.startOffset-1);return o.test(n)}else{return false}};const eq=e=>{let t=U.none();const o=e=>{t=U.some(e.selection.getBookmark());e.undoManager.add()};const n=(e,o)=>{e.undoManager.undo();t.fold(D,(t=>e.selection.moveToBookmark(t)));JU(e,o);t=U.none()};e.on("keydown",(t=>{if(t.keyCode===pb.ENTER){if(XU&&QU(e.selection.getRng())){o(e)}else{JU(e,t)}}}));e.on("keyup",(o=>{if(o.keyCode===pb.ENTER){t.each((()=>n(e,o)))}}))};const tq=(e,t,o)=>{const n=to.os.isMacOS()||to.os.isiOS();AP([{keyCode:pb.END,action:OP(fP,e,true)},{keyCode:pb.HOME,action:OP(fP,e,false)},...!n?[{keyCode:pb.HOME,action:OP(mP,e,false),ctrlKey:true,shiftKey:true},{keyCode:pb.END,action:OP(mP,e,true),ctrlKey:true,shiftKey:true}]:[],{keyCode:pb.END,action:OP(RP,e,true)},{keyCode:pb.HOME,action:OP(RP,e,false)},{keyCode:pb.END,action:OP(DH,e,true,t)},{keyCode:pb.HOME,action:OP(DH,e,false,t)}],o).each((e=>{o.preventDefault()}))};const oq=(e,t)=>{e.on("keydown",(o=>{if(!o.isDefaultPrevented()){tq(e,t,o)}}))};const nq=e=>{e.on("input",(t=>{if(!t.isComposing){Y_(e)}}))};const sq=Gt();const rq=(e,t,o)=>{AP([{keyCode:pb.PAGE_UP,action:OP(DH,e,false,t)},{keyCode:pb.PAGE_DOWN,action:OP(DH,e,true,t)}],o)};const aq=e=>e.stopImmediatePropagation();const cq=e=>e.keyCode===pb.PAGE_UP||e.keyCode===pb.PAGE_DOWN;const iq=(e,t,o)=>{if(o&&!e.get()){t.on("NodeChange",aq,true)}else if(!o&&e.get()){t.off("NodeChange",aq)}e.set(o)};const lq=(e,t)=>{if(sq.os.isMacOS()){return}const o=ia(false);e.on("keydown",(t=>{if(cq(t)){iq(o,e,true)}}));e.on("keyup",(n=>{if(!n.isDefaultPrevented()){rq(e,t,n)}if(cq(n)&&o.get()){iq(o,e,false);e.nodeChanged()}}))};const dq=e=>{e.on("beforeinput",(t=>{if(!e.selection.isEditable()||X(t.getTargetRanges(),(t=>!Yk(e.dom,t)))){t.preventDefault()}}))};const uq=(e,t)=>{const o=t.container();const n=t.offset();if(Rr(o)){o.insertData(n,e);return U.some(mu(o,n+e.length))}else{return fp(t).map((o=>{const n=yn.fromText(e);if(t.isAtEnd()){Cs(o,n)}else{xs(o,n)}return mu(n.dom,e.length)}))}};const fq=H(uq,dr);const mq=H(uq," ");const gq=(e,t,o)=>H_(e,t,o)?fq(t):mq(t);const pq=e=>t=>t.fold((t=>jp(e.dom,mu.before(t))),(e=>Zp(e)),(e=>Up(e)),(t=>Vp(e.dom,mu.after(t))));const hq=(e,t,o)=>n=>H_(e,n,o)?fq(t):mq(t);const yq=e=>t=>{e.selection.setRng(t.toRange());e.nodeChanged()};const bq=(e,t)=>e.isEditable(e.getParent(t,"summary"));const vq=e=>{const t=mu.fromRangeStart(e.selection.getRng());const o=yn.fromDom(e.getBody());if(e.selection.isCollapsed()){const n=H(_x,e);const s=mu.fromRangeStart(e.selection.getRng());return hL(n,e.getBody(),s).bind(pq(o)).map((n=>()=>hq(o,t,e.schema)(n).each(yq(e))))}else{return U.none()}};const kq=e=>{const t=()=>{const t=yn.fromDom(e.getBody());if(!e.selection.isCollapsed()){e.getDoc().execCommand("Delete")}const o=mu.fromRangeStart(e.selection.getRng());gq(t,o,e.schema).each(yq(e))};return vo(to.browser.isFirefox()&&e.selection.isEditable()&&bq(e.dom,e.selection.getRng().startContainer),t)};const wq=(e,t)=>{DP([{keyCode:pb.SPACEBAR,action:OP(vq,e)},{keyCode:pb.SPACEBAR,action:OP(kq,e)}],t).each((o=>{t.preventDefault();const n=xZ(e,"insertText",{data:" "});if(!n.isDefaultPrevented()){o();_Z(e,"insertText",{data:" "})}}))};const _q=e=>{e.on("keydown",(t=>{if(!t.isDefaultPrevented()){wq(e,t)}}))};const xq=e=>{if(ug(e)){return[{keyCode:pb.TAB,action:OP(NF,e,true)},{keyCode:pb.TAB,shiftKey:true,action:OP(NF,e,false)}]}else{return[]}};const Cq=(e,t)=>{AP([...xq(e)],t).each((e=>{t.preventDefault()}))};const Sq=e=>{e.on("keydown",(t=>{if(!t.isDefaultPrevented()){Cq(e,t)}}))};const zq=e=>{e.addShortcut("Meta+P","","mcePrint");Qj(e);if(SD(e)){return ia(null)}else{const t=EH(e);dq(e);tP(e);RF(e,t);DZ(e,t);eq(e);_q(e);nq(e);Sq(e);oq(e,t);lq(e,t);return t}};class Tq{constructor(e){this.lastPath=[];this.editor=e;let t;const o=this;if(!("onselectionchange"in e.getDoc())){e.on("NodeChange click mouseup keyup focus",(o=>{const n=e.selection.getRng();const s={startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset};if(o.type==="nodechange"||!iv(s,t)){e.dispatch("SelectionChange")}t=s}))}e.on("contextmenu",(()=>{gk(e);e.dispatch("SelectionChange")}));e.on("SelectionChange",(()=>{const t=e.selection.getStart(true);if(!t){return}if(Rh(e)&&!o.isSameElementPath(t)&&e.dom.isChildOf(t,e.getBody())){e.nodeChanged({selectionChange:true})}}));e.on("mouseup",(t=>{if(!t.isDefaultPrevented()&&Rh(e)){if(e.selection.getNode().nodeName==="IMG"){wk.setEditorTimeout(e,(()=>{e.nodeChanged()}))}else{e.nodeChanged()}}}))}nodeChanged(e={}){const t=this.editor.selection;let o;if(this.editor.initialized&&t&&!_m(this.editor)&&!this.editor.mode.isReadOnly()){const n=this.editor.getBody();o=t.getStart(true)||n;if(o.ownerDocument!==this.editor.getDoc()||!this.editor.dom.isChildOf(o,n)){o=n}const s=[];this.editor.dom.getParent(o,(e=>{if(e===n){return true}else{s.push(e);return false}}));this.editor.dispatch("NodeChange",{...e,element:o,parents:s})}}isSameElementPath(e){let t;const o=this.editor;const n=ue(o.dom.getParents(e,Z,o.getBody()));if(n.length===this.lastPath.length){for(t=n.length;t>=0;t--){if(n[t]!==this.lastPath[t]){break}}if(t===-1){this.lastPath=n;return true}}this.lastPath=n;return false}}const Eq=ml("image");const Oq=e=>{const t=e;return U.from(t[Eq])};const Aq=(e,t)=>{const o=e;o[Eq]=t};const Dq=ml("event");const Nq=e=>{const t=e;return U.from(t[Dq])};const Mq=e=>t=>{const o=t;o[Dq]=e};const Rq=(e,t)=>Mq(t)(e);const Bq=Mq(0);const Lq=Mq(2);const Hq=Mq(1);const Iq=e=>t=>{const o=t;return U.from(o[Dq]).exists((t=>t===e))};const Pq=Iq(0);const Fq=()=>Object.freeze({length:0,item:e=>null});const Vq=ml("mode");const jq=e=>{const t=e;return U.from(t[Vq])};const Zq=e=>t=>{const o=t;o[Vq]=e};const Uq=(e,t)=>Zq(t)(e);const qq=Zq(0);const Wq=Zq(2);const $q=Zq(1);const Gq=e=>t=>{const o=t;return U.from(o[Vq]).exists((t=>t===e))};const Kq=Gq(0);const Yq=Gq(1);const Xq=(e,t)=>({...t,get length(){return t.length},add:(o,n)=>{if(Kq(e)){if(v(o)){if(!S(n)){return t.add(o,n)}}else{return t.add(o)}}return null},remove:o=>{if(Kq(e)){t.remove(o)}},clear:()=>{if(Kq(e)){t.clear()}}});const Jq=["none","copy","link","move"];const Qq=["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"];const eW=()=>{const e=new window.DataTransfer;let t="move";let o="all";const n={get dropEffect(){return t},set dropEffect(e){if(Y(Jq,e)){t=e}},get effectAllowed(){return o},set effectAllowed(e){if(Pq(n)&&Y(Qq,e)){o=e}},get items(){return Xq(n,e.items)},get files(){if(Yq(n)){return Fq()}else{return e.files}},get types(){return e.types},setDragImage:(t,o,s)=>{if(Kq(n)){Aq(n,{image:t,x:o,y:s});e.setDragImage(t,o,s)}},getData:t=>{if(Yq(n)){return""}else{return e.getData(t)}},setData:(t,o)=>{if(Kq(n)){e.setData(t,o)}},clearData:t=>{if(Kq(n)){e.clearData(t)}}};qq(n);return n};const tW=e=>{const t=eW();const o=jq(e);Wq(e);Bq(t);t.dropEffect=e.dropEffect;t.effectAllowed=e.effectAllowed;Oq(e).each((e=>t.setDragImage(e.image,e.x,e.y)));Q(e.types,(o=>{if(o!=="Files"){t.setData(o,e.getData(o))}}));Q(e.files,(e=>t.items.add(e)));Nq(e).each((e=>{Rq(t,e)}));o.each((o=>{Uq(e,o);Uq(t,o)}));return t};const oW=e=>{const t=e.getData("text/html");return t===""?U.none():U.some(t)};const nW=(e,t)=>e.setData("text/html",t);const sW="x-tinymce/html";const rW=R(sW);const aW="\x3c!-- "+sW+" --\x3e";const cW=e=>aW+e;const iW=e=>e.replace(aW,"");const lW=e=>e.indexOf(aW)!==-1;const dW=e=>!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e);const uW=(e,t)=>{let o="<"+e;const n=Ae(t,((e,t)=>t+'="'+pc.encodeAllRaw(e)+'"'));if(n.length){o+=" "+n.join(" ")}return o+">"};const fW=(e,t,o)=>{const n=e.split(/\n\n/);const s=uW(t,o);const r="</"+t+">";const a=J(n,(e=>e.split(/\n/).join("<br />")));const c=e=>s+e+r;return a.length===1?a[0]:J(a,c).join("")};const mW="%MCEPASTEBIN%";const gW=(e,t)=>{const{dom:o,selection:n}=e;const s=e.getBody();t.set(n.getRng());const r=o.add(e.getBody(),"div",{id:"mcepastebin",class:"mce-pastebin",contentEditable:true,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},mW);if(to.browser.isFirefox()){o.setStyle(r,"left",o.getStyle(s,"direction",true)==="rtl"?65535:-65535)}o.bind(r,"beforedeactivate focusin focusout",(e=>{e.stopPropagation()}));r.focus();n.select(r,true)};const pW=(e,t)=>{const o=e.dom;if(hW(e)){let n;const s=t.get();while(n=hW(e)){o.remove(n);o.unbind(n)}if(s){e.selection.setRng(s)}}t.set(null)};const hW=e=>e.dom.get("mcepastebin");const yW=e=>T(e)&&e.id==="mcepastebin";const bW=e=>{const t=e.dom;const o=(e,o)=>{e.appendChild(o);t.remove(o,true)};const[n,...s]=oe(e.getBody().childNodes,yW);Q(s,(e=>{o(n,e)}));const r=t.select("div[id=mcepastebin]",n);for(let e=r.length-1;e>=0;e--){const s=t.create("div");n.insertBefore(s,r[e]);o(s,r[e])}return n?n.innerHTML:""};const vW=e=>e===mW;const kW=e=>{const t=ia(null);return{create:()=>gW(e,t),remove:()=>pW(e,t),getEl:()=>hW(e),getHtml:()=>bW(e),getLastRng:t.get}};const wW=(e,t)=>{mo.each(t,(t=>{if(b(t,RegExp)){e=e.replace(t,"")}else{e=e.replace(t[0],t[1])}}));return e};const _W=e=>{const t=Vc();const o=KO({},t);let n="";const s=t.getVoidElements();const r=mo.makeMap("script noscript style textarea video audio iframe object"," ");const a=t.getBlockElements();const c=e=>{const o=e.name,i=e;if(o==="br"){n+="\n";return}if(o==="wbr"){return}if(s[o]){n+=" "}if(r[o]){n+=" ";return}if(e.type===3){n+=e.value}if(!(e.name in t.getVoidElements())){let t=e.firstChild;if(t){do{c(t)}while(t=t.next)}}if(a[o]&&i.next){n+="\n";if(o==="p"){n+="\n"}}};e=wW(e,[/<!\[[^\]]+\]>/g]);c(o.parse(e));return n};const xW=e=>{const t=(e,t,o)=>{if(!t&&!o){return" "}return dr};e=wW(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,t],/<br class="Apple-interchange-newline">/g,/<br>$/i]);return e};const CW=e=>{let t=0;return()=>e+t++};const SW=e=>{const t=e.toLowerCase();const o={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"};return mo.hasOwn(o,t)?"image/"+o[t]:"image/"+t};const zW=(e,t)=>{const o=KO({sanitize:sg(e),sandbox_iframes:gg(e),sandbox_iframes_exclusions:pg(e),convert_unsafe_embeds:hg(e)},e.schema);o.addNodeFilter("meta",(e=>{mo.each(e,(e=>{e.remove()}))}));const n=o.parse(t,{forced_root_block:false,isRootContent:true});return Nw({validate:true},e.schema).serialize(n)};const TW=(e,t)=>({content:e,cancelled:t});const EW=(e,t,o)=>{const n=e.dom.create("div",{style:"display:none"},t);const s=fb(e,n,o);return TW(s.node.innerHTML,s.isDefaultPrevented())};const OW=(e,t,o)=>{const n=ub(e,t,o);const s=zW(e,n.content);if(e.hasEventListeners("PastePostProcess")&&!n.isDefaultPrevented()){return EW(e,s,o)}else{return TW(s,n.isDefaultPrevented())}};const AW=(e,t,o)=>OW(e,t,o);const DW=(e,t)=>{e.insertContent(t,{merge:Wm(e),paste:true});return true};const NW=e=>/^https?:\/\/[\w\-\/+=.,!;:&%@^~(){}?#]+$/i.test(e);const MW=(e,t)=>NW(t)&&X(dg(e),(e=>dt(t.toLowerCase(),`.${e.toLowerCase()}`)));const RW=(e,t,o)=>{e.undoManager.extra((()=>{o(e,t)}),(()=>{e.insertContent('<img src="'+t+'">')}));return true};const BW=(e,t,o)=>{e.undoManager.extra((()=>{o(e,t)}),(()=>{e.execCommand("mceInsertLink",false,t)}));return true};const LW=(e,t,o)=>!e.selection.isCollapsed()&&NW(t)?BW(e,t,o):false;const HW=(e,t,o)=>MW(e,t)?RW(e,t,o):false;const IW=(e,t)=>{mo.each([LW,HW,DW],(o=>!o(e,t,DW)))};const PW=(e,t,o)=>{if(o||!$m(e)){DW(e,t)}else{IW(e,t)}};const FW=CW("mceclip");const VW=e=>{const t=eW();nW(t,e);Wq(t);return t};const jW=(e,t,o,n,s)=>{const r=AW(e,t,o);if(!r.cancelled){const t=r.content;const o=()=>PW(e,t,n);if(s){const n=xZ(e,"insertFromPaste",{dataTransfer:VW(t)});if(!n.isDefaultPrevented()){o();_Z(e,"insertFromPaste")}}else{o()}}};const ZW=(e,t,o,n)=>{const s=o?o:lW(t);jW(e,iW(t),s,false,n)};const UW=(e,t,o)=>{const n=e.dom.encode(t).replace(/\r\n/g,"\n");const s=vr(n,Km(e));const r=fW(s,Ef(e),Of(e));jW(e,r,false,true,o)};const qW=e=>{const t={};if(e&&e.types){for(let o=0;o<e.types.length;o++){const n=e.types[o];try{t[n]=e.getData(n)}catch(e){t[n]=""}}}return t};const WW=(e,t)=>t in e&&e[t].length>0;const $W=e=>WW(e,"text/html")||WW(e,"text/plain");const GW=(e,t)=>{const o=t.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i);return T(o)?e.dom.encode(o[1]):undefined};const KW=(e,t,o,n)=>{const s=FW();const r=Lf(e)&&T(o.name);const a=r?GW(e,o.name):s;const c=r?o.name:undefined;const i=t.create(s,o,n,a,c);t.add(i);return i};const YW=(e,t)=>{nE(t.uri).each((({data:o,type:n,base64Encoded:s})=>{const r=s?o:btoa(o);const a=t.file;const c=e.editorUpload.blobCache;const i=c.getByData(r,n);const l=i!==null&&i!==void 0?i:KW(e,c,a,r);ZW(e,`<img src="${l.blobUri()}">`,false,true)}))};const XW=e=>e.type==="paste";const JW=e=>Promise.all(J(e,(e=>cE(e).then((t=>({file:e,uri:t}))))));const QW=e=>{const t=dg(e);return e=>lt(e.type,"image/")&&X(t,(t=>SW(t)===e.type))};const e$=(e,t)=>{const o=t.items?le(be(t.items),(e=>e.kind==="file"?[e.getAsFile()]:[])):[];const n=t.files?be(t.files):[];return oe(o.length>0?o:n,QW(e))};const t$=(e,t,o)=>{const n=XW(t)?t.clipboardData:t.dataTransfer;if(Fm(e)&&n){const s=e$(e,n);if(s.length>0){t.preventDefault();JW(s).then((t=>{if(o){e.selection.setRng(o)}Q(t,(t=>{YW(e,t)}))}));return true}}return false};const o$=e=>{var t,o;return to.os.isAndroid()&&((o=(t=e.clipboardData)===null||t===void 0?void 0:t.items)===null||o===void 0?void 0:o.length)===0};const n$=e=>pb.metaKeyPressed(e)&&e.keyCode===86||e.shiftKey&&e.keyCode===45;const s$=(e,t,o,n,s)=>{let r=xW(o);const a=WW(t,rW())||lW(o);const c=!a&&dW(r);const i=NW(r);if(vW(r)||!r.length||c&&!i){n=true}if(n||i){if(WW(t,"text/plain")&&c){r=t["text/plain"]}else{r=_W(r)}}if(vW(r)){return}if(n){UW(e,r,s)}else{ZW(e,r,a,s)}};const r$=(e,t,o)=>{let n;const s=()=>t.getLastRng()||e.selection.getRng();e.on("keydown",(e=>{if(n$(e)&&!e.isDefaultPrevented()){n=e.shiftKey&&e.keyCode===86}}));e.on("paste",(r=>{if(r.isDefaultPrevented()||o$(r)){return}const a=o.get()==="text"||n;n=false;const c=qW(r.clipboardData);if(!$W(c)&&t$(e,r,s())){return}if(WW(c,"text/html")){r.preventDefault();s$(e,c,c["text/html"],a,true)}else if(WW(c,"text/plain")&&WW(c,"text/uri-list")){r.preventDefault();s$(e,c,c["text/plain"],a,true)}else{t.create();wk.setEditorTimeout(e,(()=>{const o=t.getHtml();t.remove();s$(e,c,o,a,false)}),0)}}))};const a$=e=>{const t=e=>lt(e,"webkit-fake-url");const o=e=>lt(e,"data:");const n=e=>{var t;return((t=e.data)===null||t===void 0?void 0:t.paste)===true};e.parser.addNodeFilter("img",((s,r,a)=>{if(!Fm(e)&&n(a)){for(const n of s){const s=n.attr("src");if(v(s)&&!n.attr("data-mce-object")&&s!==to.transparentSrc){if(t(s)){n.remove()}else if(!Ym(e)&&o(s)){n.remove()}}}}}))};const c$=(e,t,o)=>{r$(e,t,o);a$(e)};const i$=(e,t)=>{if(t.get()==="text"){t.set("html");mb(e,false)}else{t.set("text");mb(e,true)}e.focus()};const l$=(e,t)=>{e.addCommand("mceTogglePlainTextPaste",(()=>{i$(e,t)}));e.addCommand("mceInsertClipboardContent",((t,o)=>{if(o.html){ZW(e,o.html,o.internal,false)}if(o.text){UW(e,o.text,false)}}))};const d$=(e,t,o)=>{if(e){try{e.clearData();e.setData("text/html",t);e.setData("text/plain",o);e.setData(rW(),t);return true}catch(e){return false}}else{return false}};const u$=(e,t,o,n)=>{if(d$(e.clipboardData,t.html,t.text)){e.preventDefault();n()}else{o(t.html,n)}};const f$=e=>(t,o)=>{const{dom:n,selection:s}=e;const r=n.create("div",{contenteditable:"false","data-mce-bogus":"all"});const a=n.create("div",{contenteditable:"true"},t);n.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"});r.appendChild(a);n.add(e.getBody(),r);const c=s.getRng();a.focus();const i=n.createRng();i.selectNodeContents(a);s.setRng(i);wk.setEditorTimeout(e,(()=>{s.setRng(c);n.remove(r);o()}),0)};const m$=e=>({html:cW(e.selection.getContent({contextual:true})),text:e.selection.getContent({format:"text"})});const g$=e=>!!e.dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());const p$=e=>!e.selection.isCollapsed()||g$(e);const h$=e=>t=>{if(!t.isDefaultPrevented()&&p$(e)&&e.selection.isEditable()){u$(t,m$(e),f$(e),(()=>{if(to.browser.isChromium()||to.browser.isFirefox()){const t=e.selection.getRng();wk.setEditorTimeout(e,(()=>{e.selection.setRng(t);e.execCommand("Delete")}),0)}else{e.execCommand("Delete")}}))}};const y$=e=>t=>{if(!t.isDefaultPrevented()&&p$(e)){u$(t,m$(e),f$(e),D)}};const b$=e=>{e.on("cut",h$(e));e.on("copy",y$(e))};const v$=(e,t)=>{var o,n;return wv.getCaretRangeFromPoint((o=t.clientX)!==null&&o!==void 0?o:0,(n=t.clientY)!==null&&n!==void 0?n:0,e.getDoc())};const k$=e=>{const t=e["text/plain"];return t?t.indexOf("file://")===0:false};const w$=(e,t)=>{e.focus();if(t){e.selection.setRng(t)}};const _$=e=>X(e.files,(e=>/^image\//.test(e.type)));const x$=(e,t,o,n)=>{const s=e.getParent(o,(e=>Ma(t,e)));const r=!x(e.getParent(o,"summary"));if(r){return true}else if(s&&Me(n,"text/html")){const e=(new DOMParser).parseFromString(n["text/html"],"text/html").body;return!x(e.querySelector(s.nodeName.toLowerCase()))}else{return false}};const C$=e=>{e.on("input",(t=>{const o=e=>x(e.querySelector("summary"));if(t.inputType==="deleteByDrag"){const t=oe(e.dom.select("details"),o);Q(t,(t=>{if(Fr(t.firstChild)){t.firstChild.remove()}const o=e.dom.create("summary");o.appendChild(ql().dom);t.prepend(o)}))}}))};const S$=(e,t)=>{if(Pm(e)){e.on("dragend dragover draggesture dragdrop drop drag",(e=>{e.preventDefault();e.stopPropagation()}))}if(!Fm(e)){e.on("drop",(e=>{const t=e.dataTransfer;if(t&&_$(t)){e.preventDefault()}}))}e.on("drop",(o=>{if(o.isDefaultPrevented()){return}const n=v$(e,o);if(z(n)){return}const s=qW(o.dataTransfer);const r=WW(s,rW());if((!$W(s)||k$(s))&&t$(e,o,n)){return}const a=s[rW()];const c=a||s["text/html"]||s["text/plain"];const i=x$(e.dom,e.schema,n.startContainer,s);const l=t.get();if(l&&!i){return}if(c){o.preventDefault();wk.setEditorTimeout(e,(()=>{e.undoManager.transact((()=>{if(a||l&&i){e.execCommand("Delete")}w$(e,n);const t=xW(c);if(s["text/html"]){ZW(e,t,r,true)}else{UW(e,t,true)}}))}))}}));e.on("dragstart",(e=>{t.set(true)}));e.on("dragover dragend",(o=>{if(Fm(e)&&!t.get()){o.preventDefault();w$(e,v$(e,o))}if(o.type==="dragend"){t.set(false)}}));C$(e)};const z$=e=>{const t=t=>o=>{t(e,o)};const o=Vm(e);if(E(o)){e.on("PastePreProcess",t(o))}const n=jm(e);if(E(n)){e.on("PastePostProcess",t(n))}};const T$=(e,t)=>{e.on("PastePreProcess",(o=>{o.content=t(e,o.content,o.internal)}))};const E$=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi;const O$=e=>mo.trim(e).replace(E$,Qc).toLowerCase();const A$=(e,t,o)=>{const n=Um(e);if(o||n==="all"||!qm(e)){return t}const s=n?n.split(/[, ]/):[];if(s&&n!=="none"){const o=e.dom,n=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,((e,t,r,a)=>{const c=o.parseStyle(o.decode(r));const i={};for(let e=0;e<s.length;e++){const t=c[s[e]];let r=t;let a=o.getStyle(n,s[e],true);if(/color/.test(s[e])){r=O$(r);a=O$(a)}if(a!==r){i[s[e]]=t}}const l=o.serializeStyle(i,"span");if(l){return t+' style="'+l+'"'+a}return t+a}))}else{t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3")}t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,((e,t,o,n)=>t+' style="'+o+'"'+n));return t};const D$=e=>{if(to.browser.isChromium()||to.browser.isSafari()){T$(e,A$)}};const N$=e=>{const t=ia(false);const o=ia(Gm(e)?"text":"html");const n=kW(e);D$(e);l$(e,o);z$(e);e.addQueryStateHandler("mceTogglePlainTextPaste",(()=>o.get()==="text"));e.on("PreInit",(()=>{b$(e);S$(e,t);c$(e,n,o)}))};const M$=e=>{e.on("click",(t=>{if(e.dom.getParent(t.target,"details")){t.preventDefault()}}))};const R$=e=>{e.parser.addNodeFilter("details",(t=>{const o=fg(e);Q(t,(e=>{if(o==="expanded"){e.attr("open","open")}else if(o==="collapsed"){e.attr("open",null)}}))}));e.serializer.addNodeFilter("details",(t=>{const o=mg(e);Q(t,(e=>{if(o==="expanded"){e.attr("open","open")}else if(o==="collapsed"){e.attr("open",null)}}))}))};const B$=e=>{M$(e);R$(e)};const L$=Fr;const H$=Rr;const I$=e=>Zr(e.dom);const P$=e=>jr(e.dom);const F$=e=>t=>xn(yn.fromDom(e),t);const V$=(e,t,o)=>os(yn.fromDom(e),(e=>P$(e)||o.isBlock(Mo(e))),F$(t)).getOr(yn.fromDom(t)).dom;const j$=(e,t)=>os(yn.fromDom(e),I$,F$(t));const Z$=(e,t,o)=>{const n=new ir(e,t);const s=o?n.next.bind(n):n.prev.bind(n);let r=e;for(let t=o?e:s();t&&!L$(t);t=s()){if(Fd(t)){r=t}}return r};const U$=(e,t,o)=>{const n=mu.fromRangeStart(e);const s=n.getNode();const r=V$(s,t,o);const a=Z$(s,r,false);const c=Z$(s,r,true);const i=document.createRange();j$(a,r).fold((()=>{if(H$(a)){i.setStart(a,0)}else{i.setStartBefore(a)}}),(e=>i.setStartBefore(e.dom)));j$(c,r).fold((()=>{if(H$(c)){i.setEnd(c,c.data.length)}else{i.setEndAfter(c)}}),(e=>i.setEndAfter(e.dom)));return i};const q$=e=>{const t=U$(e.selection.getRng(),e.getBody(),e.schema);e.selection.setRng(dS(t))};const W$=e=>{e.on("mousedown",(t=>{if(t.detail>=3){t.preventDefault();q$(e)}}))};var $$;(function(e){e["Before"]="before";e["After"]="after"})($$||($$={}));const G$=(e,t)=>Math.abs(e.left-t);const K$=(e,t)=>Math.abs(e.right-t);const Y$=(e,t)=>e>=t.top&&e<=t.bottom;const X$=(e,t)=>e.top<t.bottom&&e.bottom>t.top;const J$=(e,t)=>{const o=xd(e,t)/Math.min(e.height,t.height);return X$(e,t)&&o>.5};const Q$=(e,t)=>{const o=oe(e,(e=>Y$(t,e)));return wd(o).fold((()=>[[],e]),(t=>{const{pass:o,fail:n}=te(e,(e=>J$(e,t)));return[o,n]}))};const eG=(e,t)=>({node:e.node,position:G$(e,t)<K$(e,t)?$$.Before:$$.After});const tG=(e,t,o)=>t>e.left&&t<e.right?0:Math.min(Math.abs(e.left-t),Math.abs(e.right-t));const oG=(e,t,o,n)=>{const s=e=>{if(Fd(e.node)){return U.some(e)}else if(_r(e.node)){return oG(be(e.node.childNodes),t,o,false)}else{return U.none()}};const r=(e,n,r)=>s(n).filter((n=>{const s=Math.abs(r(e,t,o)-r(n,t,o));return s<2&&Rr(n.node)}));const a=(e,a)=>{const c=ge(e,((e,n)=>a(e,t,o)-a(n,t,o)));return ve(c,s).map((e=>{if(n&&!Rr(e.node)&&c.length>1){return r(e,c[1],a).getOr(e)}else{return e}}))};const[c,i]=Q$(eH(e),o);const{pass:l,fail:d}=te(i,(e=>e.top<o));return a(c,tG).orThunk((()=>a(d,_d))).orThunk((()=>a(l,_d)))};const nG=(e,t,o,n)=>{const s=(t,r)=>{const a=e=>_r(e)&&e.classList.contains("mce-drag-container");const c=oe(t.dom.childNodes,I(a));return r.fold((()=>oG(c,o,n,true)),(e=>{const t=oe(c,(t=>t!==e.dom));return oG(t,o,n,true)})).orThunk((()=>{const o=xn(t,e)?U.none():An(t);return o.bind((e=>s(e,U.some(t))))}))};return s(t,U.none())};const sG=(e,t,o)=>{const n=yn.fromDom(e);const s=zn(n);const r=yn.fromPoint(s,t,o).filter((e=>Cn(n,e)));const a=r.getOr(n);return nG(n,a,t,o)};const rG=(e,t,o)=>sG(e,t,o).filter((e=>Fg(e.node))).map((e=>eG(e,t)));const aG=e=>{var t,o;const n=e.getBoundingClientRect();const s=e.ownerDocument;const r=s.documentElement;const a=s.defaultView;return{top:n.top+((t=a===null||a===void 0?void 0:a.scrollY)!==null&&t!==void 0?t:0)-r.clientTop,left:n.left+((o=a===null||a===void 0?void 0:a.scrollX)!==null&&o!==void 0?o:0)-r.clientLeft}};const cG=e=>e.inline?aG(e.getBody()):{left:0,top:0};const iG=e=>{const t=e.getBody();return e.inline?{left:t.scrollLeft,top:t.scrollTop}:{left:0,top:0}};const lG=e=>{const t=e.getBody(),o=e.getDoc().documentElement;const n={left:t.scrollLeft,top:t.scrollTop};const s={left:t.scrollLeft||o.scrollLeft,top:t.scrollTop||o.scrollTop};return e.inline?n:s};const dG=(e,t)=>{if(t.target.ownerDocument!==e.getDoc()){const o=aG(e.getContentAreaContainer());const n=lG(e);return{left:t.pageX-o.left+n.left,top:t.pageY-o.top+n.top}}return{left:t.pageX,top:t.pageY}};const uG=(e,t,o)=>({pageX:o.left-e.left+t.left,pageY:o.top-e.top+t.top});const fG=(e,t)=>uG(cG(e),iG(e),dG(e,t));const mG=e=>({target:e,srcElement:e});const gG=(e,t,o,n)=>({...t,dataTransfer:n,type:e,...mG(o)});const pG=(e,t,o)=>{const n=P("Function not supported on simulated event.");const s={bubbles:true,cancelBubble:false,cancelable:true,composed:false,currentTarget:null,defaultPrevented:false,eventPhase:0,isTrusted:true,returnValue:false,timeStamp:0,type:e,composedPath:n,initEvent:n,preventDefault:D,stopImmediatePropagation:D,stopPropagation:D,AT_TARGET:window.Event.AT_TARGET,BUBBLING_PHASE:window.Event.BUBBLING_PHASE,CAPTURING_PHASE:window.Event.CAPTURING_PHASE,NONE:window.Event.NONE,altKey:false,button:0,buttons:0,clientX:0,clientY:0,ctrlKey:false,metaKey:false,movementX:0,movementY:0,offsetX:0,offsetY:0,pageX:0,pageY:0,relatedTarget:null,screenX:0,screenY:0,shiftKey:false,x:0,y:0,detail:0,view:null,which:0,initUIEvent:n,initMouseEvent:n,getModifierState:n,dataTransfer:o,...mG(t)};return s};const hG=(e,t)=>{const o=tW(e);if(t==="dragstart"){Bq(o);qq(o)}else if(t==="drop"){Lq(o);Wq(o)}else{Hq(o);$q(o)}return o};const yG=(e,t,o,n)=>{const s=hG(o,e);return S(n)?pG(e,t,s):gG(e,n,t,s)};const bG=32;const vG=100;const kG=8;const wG=16;const _G=Zr;const xG=Ad(_G,jr);const CG=(e,t,o)=>_G(o)&&o!==t&&e.isEditable(o.parentElement);const SG=(e,t,o)=>{if(z(t)){return false}else if(t===o||e.dom.isChildOf(t,o)){return false}else{return e.dom.isEditable(t)}};const zG=(e,t,o,n)=>{const s=e.dom;const r=t.cloneNode(true);s.setStyles(r,{width:o,height:n});s.setAttrib(r,"data-mce-selected",null);const a=s.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});s.setStyles(a,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:o,height:n});s.setStyles(r,{margin:0,boxSizing:"border-box"});a.appendChild(r);return a};const TG=(e,t)=>{if(e.parentNode!==t){t.appendChild(e)}};const EG=(e,t)=>o=>()=>{const n=e==="left"?o.scrollX:o.scrollY;o.scroll({[e]:n+t,behavior:"smooth"})};const OG=EG("left",-bG);const AG=EG("left",bG);const DG=EG("top",-bG);const NG=EG("top",bG);const MG=(e,t,o,n,s,r,a,c,i,l,d,u)=>{let f=0,m=0;e.style.left=t.pageX+"px";e.style.top=t.pageY+"px";if(t.pageX+o>s){f=t.pageX+o-s}if(t.pageY+n>r){m=t.pageY+n-r}e.style.width=o-f+"px";e.style.height=n-m+"px";const g=i.clientHeight;const p=i.clientWidth;const h=a+i.getBoundingClientRect().top;const y=c+i.getBoundingClientRect().left;d.on((e=>{e.intervalId.clear();if(e.dragging&&u){if(a+kG>=g){e.intervalId.set(NG(l))}else if(a-kG<=0){e.intervalId.set(DG(l))}else if(c+kG>=p){e.intervalId.set(AG(l))}else if(c-kG<=0){e.intervalId.set(OG(l))}else if(h+wG>=window.innerHeight){e.intervalId.set(NG(window))}else if(h-wG<=0){e.intervalId.set(DG(window))}else if(y+wG>=window.innerWidth){e.intervalId.set(AG(window))}else if(y-wG<=0){e.intervalId.set(OG(window))}}}))};const RG=e=>{if(e&&e.parentNode){e.parentNode.removeChild(e)}};const BG=(e,t)=>{const o=e.getParent(t.parentNode,e.isBlock);RG(t);if(o&&o!==e.getRoot()&&e.isEmpty(o)){Wl(yn.fromDom(o))}};const LG=e=>e.button===0;const HG=(e,t)=>({pageX:t.pageX-e.relX,pageY:t.pageY+5});const IG=(e,t)=>o=>{if(LG(o)){const n=ae(t.dom.getParents(o.target),xG).getOr(null);if(T(n)&&CG(t.dom,t.getBody(),n)){const s=t.dom.getPos(n);const r=t.getBody();const a=t.getDoc().documentElement;e.set({element:n,dataTransfer:eW(),dragging:false,screenX:o.screenX,screenY:o.screenY,maxX:(t.inline?r.scrollWidth:a.offsetWidth)-2,maxY:(t.inline?r.scrollHeight:a.offsetHeight)-2,relX:o.pageX-s.x,relY:o.pageY-s.y,width:n.offsetWidth,height:n.offsetHeight,ghost:zG(t,n,n.offsetWidth,n.offsetHeight),intervalId:da(vG)})}}};const PG=(e,t,o)=>{e._selectionOverrides.hideFakeCaret();rG(e.getBody(),t,o).fold((()=>e.selection.placeCaretAt(t,o)),(n=>{const s=e._selectionOverrides.showCaret(1,n.node,n.position===$$.Before,false);if(s){e.selection.setRng(s)}else{e.selection.placeCaretAt(t,o)}}))};const FG=(e,t,o,n,s)=>{if(t==="dragstart"){nW(n,e.dom.getOuterHTML(o))}const r=yG(t,o,n,s);const a=e.dispatch(t,r);return a};const VG=(e,t)=>{const o=Gi(((e,o)=>PG(t,e,o)),0);t.on("remove",o.cancel);const n=e;return s=>e.on((e=>{const r=Math.max(Math.abs(s.screenX-e.screenX),Math.abs(s.screenY-e.screenY));if(!e.dragging&&r>10){const o=FG(t,"dragstart",e.element,e.dataTransfer,s);if(T(o.dataTransfer)){e.dataTransfer=o.dataTransfer}if(o.isDefaultPrevented()){return}e.dragging=true;t.focus()}if(e.dragging){const r=s.currentTarget===t.getDoc().documentElement;const a=HG(e,fG(t,s));TG(e.ghost,t.getBody());MG(e.ghost,a,e.width,e.height,e.maxX,e.maxY,s.clientY,s.clientX,t.getContentAreaContainer(),t.getWin(),n,r);o.throttle(s.clientX,s.clientY)}}))};const jG=e=>{const t=e.getSel();if(T(t)){const e=t.getRangeAt(0);const o=e.startContainer;return Rr(o)?o.parentNode:o}else{return null}};const ZG=(e,t)=>o=>{e.on((e=>{var n;e.intervalId.clear();if(e.dragging){if(SG(t,jG(t.selection),e.element)){const s=(n=t.getDoc().elementFromPoint(o.clientX,o.clientY))!==null&&n!==void 0?n:t.getBody();const r=FG(t,"drop",s,e.dataTransfer,o);if(!r.isDefaultPrevented()){t.undoManager.transact((()=>{BG(t.dom,e.element);oW(e.dataTransfer).each((e=>t.insertContent(e)));t._selectionOverrides.hideFakeCaret()}))}}FG(t,"dragend",t.getBody(),e.dataTransfer,o)}}));WG(e)};const UG=(e,t,o)=>{e.on((e=>{e.intervalId.clear();if(e.dragging){o.fold((()=>FG(t,"dragend",e.element,e.dataTransfer)),(o=>FG(t,"dragend",e.element,e.dataTransfer,o)))}}));WG(e)};const qG=(e,t)=>o=>UG(e,t,U.some(o));const WG=e=>{e.on((e=>{e.intervalId.clear();RG(e.ghost)}));e.clear()};const $G=e=>{const t=ua();const o=zi.DOM;const n=document;const s=IG(t,e);const r=VG(t,e);const a=ZG(t,e);const c=qG(t,e);e.on("mousedown",s);e.on("mousemove",r);e.on("mouseup",a);o.bind(n,"mousemove",r);o.bind(n,"mouseup",c);e.on("remove",(()=>{o.unbind(n,"mousemove",r);o.unbind(n,"mouseup",c)}));e.on("keydown",(o=>{if(o.keyCode===pb.ESC){UG(t,e,U.none())}}))};const GG=e=>{const t=t=>{if(!t.isDefaultPrevented()){const o=t.dataTransfer;if(o&&(Y(o.types,"Files")||o.files.length>0)){t.preventDefault();if(t.type==="drop"){zM(e,"Dropped file type is not supported")}}}};const o=o=>{if(Dk(e,o.target)){t(o)}};const n=()=>{const n=zi.DOM;const s=e.dom;const r=document;const a=e.inline?e.getBody():e.getDoc();const c=["drop","dragover"];Q(c,(e=>{n.bind(r,e,o);s.bind(a,e,t)}));e.on("remove",(()=>{Q(c,(e=>{n.unbind(r,e,o);s.unbind(a,e,t)}))}))};e.on("init",(()=>{wk.setEditorTimeout(e,n,0)}))};const KG=e=>{$G(e);if(Em(e)){GG(e)}};const YG=e=>{const t=Gi((()=>{if(!e.removed&&e.getBody().contains(document.activeElement)){const t=e.selection.getRng();if(t.collapsed){const o=mB(e,t,false);e.selection.setRng(o)}}}),0);e.on("focus",(()=>{t.throttle()}));e.on("blur",(()=>{t.cancel()}))};const XG=e=>{e.on("init",(()=>{e.on("focusin",(t=>{const o=t.target;if(Wr(o)){const t=FC(e.getBody(),o);const n=Zr(t)?t:o;if(e.selection.getNode()!==n){uB(e,n).each((t=>e.selection.setRng(t)))}}}))}))};const JG=Zr;const QG=(e,t)=>FC(e.getBody(),t);const eK=e=>{const t=e.selection,o=e.dom;const n=e.getBody();const s=Hg(e,n,o.isBlock,(()=>qk(e)));const r="sel-"+o.uniqueId();const a="data-mce-selected";let c;const i=e=>T(e)&&o.hasClass(e,"mce-offscreen-selection");const l=e=>e!==n&&(JG(e)||Wr(e))&&o.isChildOf(e,n)&&o.isEditable(e.parentNode);const d=e=>{if(e){t.setRng(e)}};const u=(o,n,r,a=true)=>{const c=e.dispatch("ShowCaret",{target:n,direction:o,before:r});if(c.isDefaultPrevented()){return null}if(a){t.scrollIntoView(n,o===-1)}return s.show(r,n)};const f=e=>{if(e.hasAttribute("data-mce-caret")){ud(e);t.scrollIntoView(e)}};const m=()=>{e.on("click",(t=>{if(!o.isEditable(t.target)){t.preventDefault();e.focus()}}));e.on("blur NewBlock",k);e.on("ResizeWindow FullscreenStateChanged",s.reposition);e.on("tap",(t=>{const o=t.target;const n=QG(e,o);if(JG(n)){t.preventDefault();uB(e,n).each(v)}else if(l(o)){uB(e,o).each(v)}}),true);e.on("mousedown",(t=>{const s=t.target;if(s!==n&&s.nodeName!=="HTML"&&!o.isChildOf(s,n)){return}if(!hM(e,t.clientX,t.clientY)){return}k();_();const r=QG(e,s);if(JG(r)){t.preventDefault();uB(e,r).each(v)}else{rG(n,t.clientX,t.clientY).each((o=>{t.preventDefault();const n=u(1,o.node,o.position===$$.Before,false);d(n);if(xr(r)){r.focus()}else{e.getBody().focus()}}))}}));e.on("keypress",(e=>{if(pb.modifierPressed(e)){return}if(JG(t.getNode())){e.preventDefault()}}));e.on("GetSelectionRange",(e=>{let t=e.range;if(c){if(!c.parentNode){c=null;return}t=t.cloneRange();t.selectNode(c);e.range=t}}));e.on("SetSelectionRange",(e=>{e.range=h(e.range);const t=v(e.range,e.forward);if(t){e.range=t}}));const r=e=>_r(e)&&e.id==="mcepastebin";e.on("AfterSetSelectionRange",(e=>{const t=e.range;const o=t.startContainer.parentElement;if(!p(t)&&!r(o)){_()}if(!i(o)){k()}}));KG(e);YG(e);XG(e)};const g=e=>od(e)||id(e)||ld(e);const p=e=>g(e.startContainer)||g(e.endContainer);const h=t=>{const n=e.schema.getVoidElements();const s=o.createRng();const r=t.startContainer;const a=t.startOffset;const c=t.endContainer;const i=t.endOffset;if(Me(n,r.nodeName.toLowerCase())){if(a===0){s.setStartBefore(r)}else{s.setStartAfter(r)}}else{s.setStart(r,a)}if(Me(n,c.nodeName.toLowerCase())){if(i===0){s.setEndBefore(c)}else{s.setEndAfter(c)}}else{s.setEnd(c,i)}return s};const y=(n,s)=>{const a=yn.fromDom(e.getBody());const c=e.getDoc();const i=cs(a,"#"+r).getOrThunk((()=>{const e=yn.fromHtml('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>',c);Uo(e,"id",r);zs(a,e);return e}));const l=o.createRng();As(i);Os(i,[yn.fromText(dr,c),yn.fromDom(s),yn.fromText(dr,c)]);l.setStart(i.dom.firstChild,1);l.setEnd(i.dom.lastChild,0);hs(i,{top:o.getPos(n,e.getBody()).y+"px"});ek(i);const d=t.getSel();if(d){d.removeAllRanges();d.addRange(l)}return l};const b=t=>{const n=t.cloneNode(true);const s=e.dispatch("ObjectSelected",{target:t,targetClone:n});if(s.isDefaultPrevented()){return null}const r=y(t,s.targetClone);const i=yn.fromDom(t);Q(sr(yn.fromDom(e.getBody()),`*[${a}]`),(e=>{if(!xn(i,e)){Ko(e,a)}}));if(!o.getAttrib(t,a)){t.setAttribute(a,"1")}c=t;_();return r};const v=(e,t)=>{if(!e){return null}if(e.collapsed){if(!p(e)){const s=t?1:-1;const r=up(s,n,e);const a=r.getNode(!t);if(T(a)){if(Fg(a)){return u(s,a,t?!r.isAtEnd():false,false)}if(td(a)&&Zr(a.nextSibling)){const e=o.createRng();e.setStart(a,0);e.setEnd(a,0);return e}}const c=r.getNode(t);if(T(c)){if(Fg(c)){return u(s,c,t?false:!r.isAtEnd(),false)}if(td(c)&&Zr(c.previousSibling)){const e=o.createRng();e.setStart(c,1);e.setEnd(c,1);return e}}}return null}let s=e.startContainer;let r=e.startOffset;const a=e.endOffset;if(Rr(s)&&r===0&&JG(s.parentNode)){s=s.parentNode;r=o.nodeIndex(s);s=s.parentNode}if(!_r(s)){return null}if(a===r+1&&s===e.endContainer){const e=s.childNodes[r];if(l(e)){return b(e)}}return null};const k=()=>{if(c){c.removeAttribute(a)}cs(yn.fromDom(e.getBody()),"#"+r).each(Ds);c=null};const w=()=>{s.destroy();c=null};const _=()=>{s.hide()};if(!SD(e)){m()}return{showCaret:u,showBlockCaretContainer:f,hideFakeCaret:_,destroy:w}};const tK=(e,t)=>{let o=t;for(let t=e.previousSibling;Rr(t);t=t.previousSibling){o+=t.data.length}return o};const oK=(e,t,o,n,s)=>{if(Rr(o)&&(n<0||n>o.data.length)){return[]}const r=s&&Rr(o)?[tK(o,n)]:[n];let a=o;while(a!==t&&a.parentNode){r.push(e.nodeIndex(a,s));a=a.parentNode}return a===t?r.reverse():[]};const nK=(e,t,o,n,s,r,a=false)=>{const c=oK(e,t,o,n,a);const i=oK(e,t,s,r,a);return{start:c,end:i}};const sK=(e,t)=>{const o=t.slice();const n=o.pop();if(!O(n)){return U.none()}else{const t=se(o,((e,t)=>e.bind((e=>U.from(e.childNodes[t])))),U.some(e));return t.bind((e=>{if(Rr(e)&&(n<0||n>e.data.length)){return U.none()}else{return U.some({node:e,offset:n})}}))}};const rK=(e,t)=>sK(e,t.start).bind((({node:o,offset:n})=>sK(e,t.end).map((({node:e,offset:t})=>{const s=document.createRange();s.setStart(o,n);s.setEnd(e,t);return s}))));const aK=(e,t,o,n=false)=>nK(e,t,o.startContainer,o.startOffset,o.endContainer,o.endOffset,n);const cK=(e,t,o)=>{if(t&&e.isEmpty(t)&&!o(t)){const n=t.parentNode;e.remove(t,Rr(t.firstChild)&&gr(t.firstChild.data));cK(e,n,o)}};const iK=(e,t,o,n=true)=>{const s=t.startContainer.parentNode;const r=t.endContainer.parentNode;t.deleteContents();if(n&&!o(t.startContainer)){if(Rr(t.startContainer)&&t.startContainer.data.length===0){e.remove(t.startContainer)}if(Rr(t.endContainer)&&t.endContainer.data.length===0){e.remove(t.endContainer)}cK(e,s,o);if(s!==r){cK(e,r,o)}}};const lK=(e,t)=>U.from(e.dom.getParent(t.startContainer,e.dom.isBlock));const dK=(e,t,o)=>{const n=e.dynamicPatternsLookup({text:o,block:t});return{...e,blockPatterns:rf(n).concat(e.blockPatterns),inlinePatterns:af(n).concat(e.inlinePatterns)}};const uK=(e,t,o,n)=>{const s=e.createRng();s.setStart(t,0);s.setEnd(o,n);return s.toString()};const fK=(e,t)=>e.create("span",{"data-mce-type":"bookmark",id:t});const mK=(e,t)=>{const o=e.createRng();o.setStartAfter(t.start);o.setEndBefore(t.end);return o};const gK=(e,t,o)=>{const n=rK(e.getRoot(),o).getOrDie("Unable to resolve path range");const s=n.startContainer;const r=n.endContainer;const a=n.endOffset===0?r:r.splitText(n.endOffset);const c=n.startOffset===0?s:s.splitText(n.startOffset);const i=c.parentNode;const l=a.parentNode;return{prefix:t,end:l.insertBefore(fK(e,t+"-end"),a),start:i.insertBefore(fK(e,t+"-start"),c)}};const pK=(e,t,o)=>{cK(e,e.get(t.prefix+"-end"),o);cK(e,e.get(t.prefix+"-start"),o)};const hK=e=>e.start.length===0;const yK=e=>(t,o)=>{const n=t.data;const s=n.substring(0,o);const r=s.lastIndexOf(e.charAt(e.length-1));const a=s.lastIndexOf(e);if(a!==-1){return a+e.length}else if(r!==-1){return r+1}else{return-1}};const bK=(e,t,o,n)=>{const s=t.start;const r=ZF(e,n.container,n.offset,yK(s),o);return r.bind((n=>{var r,a;const c=(a=(r=o.textContent)===null||r===void 0?void 0:r.indexOf(s))!==null&&a!==void 0?a:-1;const i=c!==-1&&n.offset>=c+s.length;if(i){const t=e.createRng();t.setStart(n.container,n.offset-s.length);t.setEnd(n.container,n.offset);return U.some(t)}else{const r=n.offset-s.length;return VF(n.container,r,o).map((t=>{const o=e.createRng();o.setStart(t.container,t.offset);o.setEnd(n.container,n.offset);return o})).filter((e=>e.toString()===s)).orThunk((()=>bK(e,t,o,BF(n.container,0))))}}))};const vK=(e,t,o,n,s,r=false)=>{if(t.start.length===0&&!r){const t=e.createRng();t.setStart(o,n);t.setEnd(o,n);return U.some(t)}return PF(o,n,s).bind((o=>{const n=bK(e,t,s,o);return n.bind((e=>{var t;if(r){if(e.endContainer===o.container&&e.endOffset===o.offset){return U.none()}else if(o.offset===0&&((t=e.endContainer.textContent)===null||t===void 0?void 0:t.length)===e.endOffset){return U.none()}}return U.some(e)}))}))};const kK=(e,t,o,n)=>{const s=e.dom;const r=s.getRoot();const a=o.pattern;const c=o.position.container;const i=o.position.offset;return VF(c,i-o.pattern.end.length,t).bind((l=>{const d=nK(s,r,l.container,l.offset,c,i,n);if(hK(a)){return U.some({matches:[{pattern:a,startRng:d,endRng:d}],position:l})}else{const c=wK(e,o.remainingPatterns,l.container,l.offset,t,n);const i=c.getOr({matches:[],position:l});const u=i.position;const f=vK(s,a,u.container,u.offset,t,c.isNone());return f.map((e=>{const t=aK(s,r,e,n);return{matches:i.matches.concat([{pattern:a,startRng:t,endRng:d}]),position:BF(e.startContainer,e.startOffset)}}))}}))};const wK=(e,t,o,n,s,r)=>{const a=e.dom;return PF(o,n,a.getRoot()).bind((c=>{const i=uK(a,s,o,n);for(let a=0;a<t.length;a++){const l=t[a];if(!dt(i,l.end)){continue}const d=t.slice();d.splice(a,1);const u=kK(e,s,{pattern:l,remainingPatterns:d,position:c},r);if(u.isNone()&&n>0){return wK(e,t,o,n-1,s,r)}if(u.isSome()){return u}}return U.none()}))};const _K=(e,t,o)=>{e.selection.setRng(o);if(t.type==="inline-format"){Q(t.format,(t=>{e.formatter.apply(t)}))}else{e.execCommand(t.cmd,false,t.value)}};const xK=(e,t,o,n)=>{const s=mK(e.dom,o);iK(e.dom,s,n);_K(e,t,s)};const CK=(e,t,o,n,s)=>{const r=e.dom;const a=mK(r,n);const c=mK(r,o);iK(r,c,s);iK(r,a,s);const i={prefix:o.prefix,start:o.end,end:n.start};const l=mK(r,i);_K(e,t,l)};const SK=(e,t)=>{const o=ml("mce_textpattern");const n=ne(t,((t,n)=>{const s=gK(e,o+`_end${t.length}`,n.endRng);return t.concat([{...n,endMarker:s}])}),[]);return ne(n,((t,s)=>{const r=n.length-t.length-1;const a=hK(s.pattern)?s.endMarker:gK(e,o+`_start${r}`,s.startRng);return t.concat([{...s,startMarker:a}])}),[])};const zK=e=>ge(e,((e,t)=>t.end.length-e.end.length));const TK=(e,t)=>{const o=de(e,(e=>X(t,(t=>e.pattern.start===t.pattern.start&&e.pattern.end===t.pattern.end))));if(e.length===t.length){if(o){return e}else{return t}}return e.length>t.length?e:t};const EK=(e,t,o,n,s,r)=>{const a=wK(e,s.inlinePatterns,o,n,t,r).fold((()=>[]),(e=>e.matches));const c=wK(e,zK(s.inlinePatterns),o,n,t,r).fold((()=>[]),(e=>e.matches));return TK(a,c)};const OK=(e,t)=>{if(t.length===0){return}const o=e.dom;const n=e.selection.getBookmark();const s=SK(o,t);Q(s,(t=>{const n=o.getParent(t.startMarker.start,o.isBlock);const s=e=>e===n;if(hK(t.pattern)){xK(e,t.pattern,t.endMarker,s)}else{CK(e,t.pattern,t.startMarker,t.endMarker,s)}pK(o,t.endMarker,s);pK(o,t.startMarker,s)}));e.selection.moveToBookmark(n)};const AK=(e,t,o)=>FF(t,0,t).map((n=>{const s=n.container;jF(s,o.start.length,t).each((o=>{const n=e.createRng();n.setStart(s,0);n.setEnd(o.container,o.offset);iK(e,n,(e=>e===t))}));return s}));const DK=e=>(t,o)=>{const n=t.dom;const s=o.pattern;const r=rK(n.getRoot(),o.range).getOrDie("Unable to resolve path range");const a=(e,t)=>{const o=t.get(e);return _(o)&&he(o).exists((e=>Me(e,"block")))};lK(t,r).each((o=>{if(s.type==="block-format"){if(a(s.format,t.formatter)){t.undoManager.transact((()=>{e(t.dom,o,s);t.formatter.apply(s.format)}))}}else if(s.type==="block-command"){t.undoManager.transact((()=>{e(t.dom,o,s);t.execCommand(s.cmd,false,s.value)}))}}));return true};const NK=e=>ge(e,((e,t)=>t.start.length-e.start.length));const MK=e=>(t,o)=>{const n=NK(t);const s=o.replace(dr," ");return ae(n,(t=>e(t,o,s)))};const RK=(e,t)=>(o,n,s,r,a)=>{var c;if(a===void 0){a=(c=n.textContent)!==null&&c!==void 0?c:""}const i=o.dom;const l=Ef(o);if(!i.is(n,l)){return[]}return e(s.blockPatterns,a).map((e=>{if(t&&mo.trim(a).length===e.start.length){return[]}return[{pattern:e,range:nK(i,i.getRoot(),n,0,n,0,r)}]})).getOr([])};const BK=e=>/^\s[^\s]/.test(e);const LK=(e,t,o)=>{AK(e,t,o).each((e=>{const t=yn.fromDom(e);const o=Sl(t);if(BK(o)){Tl(t,o.slice(1))}}))};const HK=DK(LK);const IK=MK(((e,t,o)=>t.indexOf(e.start)===0||o.indexOf(e.start)===0));const PK=RK(IK,true);const FK=(e,t)=>{const o=e.selection.getRng();return lK(e,o).map((n=>{var s;const r=Math.max(0,o.startOffset);const a=dK(t,n,(s=n.textContent)!==null&&s!==void 0?s:"");const c=EK(e,n,o.startContainer,r,a,true);const i=PK(e,n,a,true);return{inlineMatches:c,blockMatches:i}})).filter((({inlineMatches:e,blockMatches:t})=>t.length>0||e.length>0))};const VK=(e,t)=>{if(t.length===0){return}const o=e.selection.getBookmark();Q(t,(t=>HK(e,t)));e.selection.moveToBookmark(o)};const jK=DK(AK);const ZK=MK(((e,t,o)=>t===e.start||o===e.start));const UK=RK(ZK,false);const qK=(e,t)=>{const o=e.selection.getRng();return lK(e,o).map((n=>{const s=Math.max(0,o.startOffset);const r=uK(e.dom,n,o.startContainer,s);const a=dK(t,n,r);return UK(e,n,a,false,r)})).filter((e=>e.length>0))};const WK=(e,t)=>{Q(t,(t=>jK(e,t)))};const $K=(e,t)=>FK(e,t).fold(j,(({inlineMatches:t,blockMatches:o})=>{e.undoManager.add();e.undoManager.extra((()=>{e.execCommand("mceInsertNewLine")}),(()=>{Xl(e);OK(e,t);VK(e,o);const n=e.selection.getRng();const s=PF(n.startContainer,n.startOffset,e.dom.getRoot());e.execCommand("mceInsertNewLine");s.each((t=>{const o=t.container;if(o.data.charAt(t.offset-1)===lr){o.deleteData(t.offset-1,1);cK(e.dom,o.parentNode,(t=>t===e.dom.getRoot()))}}))}));return true}));const GK=(e,t)=>{const o=e.selection.getRng();lK(e,o).map((n=>{const s=Math.max(0,o.startOffset-1);const r=uK(e.dom,n,o.startContainer,s);const a=dK(t,n,r);const c=EK(e,n,o.startContainer,s,a,false);if(c.length>0){e.undoManager.transact((()=>{OK(e,c)}))}}))};const KK=(e,t)=>qK(e,t).fold(j,(t=>{e.undoManager.transact((()=>{WK(e,t)}));return true}));const YK=(e,t,o)=>{for(let n=0;n<e.length;n++){if(o(e[n],t)){return true}}return false};const XK=(e,t)=>YK(e,t,((e,t)=>e===t.keyCode&&!pb.modifierPressed(t)));const JK=(e,t)=>YK(e,t,((e,t)=>e.charCodeAt(0)===t.charCode));const QK=e=>{const t=[",",".",";",":","!","?"];const o=[32];const n=()=>cf(Xm(e),Jm(e));const s=()=>ag(e);e.on("keydown",(t=>{if(t.keyCode===13&&!pb.modifierPressed(t)&&e.selection.isCollapsed()){const o=lf(n(),"enter");const r=o.inlinePatterns.length>0||o.blockPatterns.length>0||s();if(r&&$K(e,o)){t.preventDefault()}}}),true);e.on("keydown",(t=>{if(t.keyCode===32&&e.selection.isCollapsed()){const o=lf(n(),"space");const r=o.blockPatterns.length>0||s();if(r&&KK(e,o)){t.preventDefault()}}}),true);const r=()=>{if(e.selection.isCollapsed()){const t=lf(n(),"space");const o=t.inlinePatterns.length>0||s();if(o){GK(e,t)}}};e.on("keyup",(e=>{if(XK(o,e)){r()}}));e.on("keypress",(o=>{if(JK(t,o)){wk.setEditorTimeout(e,r)}}))};const eY=e=>{QK(e)};const tY=e=>{const t=mo.each;const o=pb.BACKSPACE,n=pb.DELETE,s=e.dom,r=e.selection,a=e.parser;const c=to.browser;const i=c.isFirefox();const l=c.isChromium()||c.isSafari();const d=to.deviceType.isiPhone()||to.deviceType.isiPad();const u=to.os.isMacOS()||to.os.isiOS();const f=(t,o)=>{try{e.getDoc().execCommand(t,false,String(o))}catch(e){}};const m=e=>e.isDefaultPrevented();const g=()=>{const t=e=>{const t=s.create("body");const o=e.cloneContents();t.appendChild(o);return r.serializer.serialize(t,{format:"html"})};const a=o=>{const n=t(o);const r=s.createRng();r.selectNode(e.getBody());const a=t(r);return n===a};e.on("keydown",(t=>{const r=t.keyCode;if(!m(t)&&(r===n||r===o)&&e.selection.isEditable()){const o=e.selection.isCollapsed();const n=e.getBody();if(o&&!ra(e.schema,n)){return}if(!o&&!a(e.selection.getRng())){return}t.preventDefault();e.setContent("");if(n.firstChild&&s.isBlock(n.firstChild)){e.selection.setCursorLocation(n.firstChild,0)}else{e.selection.setCursorLocation(n,0)}e.nodeChanged()}}))};const p=()=>{e.shortcuts.add("meta+a",null,"SelectAll")};const h=()=>{if(!e.inline){s.bind(e.getDoc(),"mousedown mouseup",(t=>{let o;if(t.target===e.getDoc().documentElement){o=r.getRng();e.getBody().focus();if(t.type==="mousedown"){if(od(o.startContainer)){return}r.placeCaretAt(t.clientX,t.clientY)}else{r.setRng(o)}}}))}};const y=()=>{e.on("keydown",(t=>{if(!m(t)&&t.keyCode===o){if(!e.getBody().getElementsByTagName("hr").length){return}if(r.isCollapsed()&&r.getRng().startOffset===0){const e=r.getNode();const o=e.previousSibling;if(e.nodeName==="HR"){s.remove(e);t.preventDefault();return}if(o&&o.nodeName&&o.nodeName.toLowerCase()==="hr"){s.remove(o);t.preventDefault()}}}}))};const b=()=>{if(!Range.prototype.getClientRects){e.on("mousedown",(t=>{if(!m(t)&&t.target.nodeName==="HTML"){const t=e.getBody();t.blur();wk.setEditorTimeout(e,(()=>{t.focus()}))}}))}};const v=()=>{const t=Dm(e);e.on("click",(o=>{const n=o.target;if(/^(IMG|HR)$/.test(n.nodeName)&&s.isEditable(n)){o.preventDefault();e.selection.select(n);e.nodeChanged()}if(n.nodeName==="A"&&s.hasClass(n,t)&&n.childNodes.length===0&&s.isEditable(n.parentNode)){o.preventDefault();r.select(n)}}))};const k=()=>{const o=()=>{const o=s.getAttribs(r.getStart().cloneNode(false));return()=>{const n=r.getStart();if(n!==e.getBody()){s.setAttrib(n,"style",null);t(o,(e=>{n.setAttributeNode(e.cloneNode(true))}))}}};const n=()=>!r.isCollapsed()&&s.getParent(r.getStart(),s.isBlock)!==s.getParent(r.getEnd(),s.isBlock);e.on("keypress",(t=>{let s;if(!m(t)&&(t.keyCode===8||t.keyCode===46)&&n()){s=o();e.getDoc().execCommand("delete",false);s();t.preventDefault();return false}else{return true}}));s.bind(e.getDoc(),"cut",(t=>{if(!m(t)&&n()){const t=o();wk.setEditorTimeout(e,(()=>{t()}))}}))};const w=()=>{e.on("keydown",(e=>{if(!m(e)&&e.keyCode===o){if(r.isCollapsed()&&r.getRng().startOffset===0){const t=r.getNode().previousSibling;if(t&&t.nodeName&&t.nodeName.toLowerCase()==="table"){e.preventDefault();return false}}}return true}))};const _=()=>{e.on("keydown",(t=>{if(m(t)||t.keyCode!==pb.BACKSPACE){return}let o=r.getRng();const n=o.startContainer;const a=o.startOffset;const c=s.getRoot();let i=n;if(!o.collapsed||a!==0){return}while(i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==c){i=i.parentNode}if(i.nodeName==="BLOCKQUOTE"){e.formatter.toggle("blockquote",undefined,i);o=s.createRng();o.setStart(n,0);o.setEnd(n,0);r.setRng(o)}}))};const x=()=>{const t=()=>{f("StyleWithCSS",false);f("enableInlineTableEditing",false);if(!tm(e)){f("enableObjectResizing",false)}};if(!xm(e)){e.on("BeforeExecCommand mousedown",t)}};const C=()=>{const o=()=>{t(s.select("a:not([data-mce-block])"),(e=>{var t;let o=e.parentNode;const n=s.getRoot();if((o===null||o===void 0?void 0:o.lastChild)===e){while(o&&!s.isBlock(o)){if(((t=o.parentNode)===null||t===void 0?void 0:t.lastChild)!==o||o===n){return}o=o.parentNode}s.add(o,"br",{"data-mce-bogus":1})}}))};e.on("SetContent ExecCommand",(e=>{if(e.type==="setcontent"||e.command==="mceInsertLink"){o()}}))};const S=()=>{e.on("init",(()=>{f("DefaultParagraphSeparator",Ef(e))}))};const z=e=>{const t=e.getBody();const o=e.selection.getRng();return o.startContainer===o.endContainer&&o.startContainer===t&&o.startOffset===0&&o.endOffset===t.childNodes.length};const T=()=>{e.on("keyup focusin mouseup",(t=>{if(!pb.modifierPressed(t)&&!z(e)){r.normalize()}}),true)};const E=()=>{e.contentStyles.push("img:-moz-broken {"+"-moz-force-broken-image-icon:1;"+"min-width:24px;"+"min-height:24px"+"}")};const O=()=>{if(!e.inline){e.on("keydown",(()=>{if(document.activeElement===document.body){e.getWin().focus()}}))}};const A=()=>{if(!e.inline){e.contentStyles.push("body {min-height: 150px}");e.on("click",(t=>{let o;if(t.target.nodeName==="HTML"){o=e.selection.getRng();e.getBody().focus();e.selection.setRng(o);e.selection.normalize();e.nodeChanged()}}))}};const N=()=>{if(u){e.on("keydown",(t=>{if(pb.metaKeyPressed(t)&&!t.shiftKey&&(t.keyCode===37||t.keyCode===39)){t.preventDefault();const o=e.selection.getSel();o.modify("move",t.keyCode===37?"backward":"forward","lineboundary")}}))}};const M=()=>{e.on("click",(e=>{let t=e.target;do{if(t.tagName==="A"){e.preventDefault();return}}while(t=t.parentNode)}));e.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")};const R=()=>{e.on("init",(()=>{e.dom.bind(e.getBody(),"submit",(e=>{e.preventDefault()}))}))};const B=()=>{a.addNodeFilter("br",(e=>{let t=e.length;while(t--){if(e[t].attr("class")==="Apple-interchange-newline"){e[t].remove()}}}))};const L=D;const H=()=>{if(!i||e.removed){return false}const t=e.selection.getSel();return!t||!t.rangeCount||t.rangeCount===0};const I=()=>{if(l){h();v();R();p();if(d){O();A();M()}}if(i){b();x();E();N()}};const P=()=>{_();g();if(!to.windowsPhone){T()}if(l){h();v();S();R();w();B();if(d){O();A();M()}else{p()}}if(i){y();b();k();x();C();E();N();w()}};if(SD(e)){I()}else{P()}return{refreshContentEditable:L,isHidden:H}};const oY=e=>e.toLowerCase()==="gpl";const nY=e=>e.length>=64&&e.length<=255;const sY=e=>oY(e)||nY(e)?"VALID":"INVALID";const rY=e=>{const t=yg(e);const o=v(bg(e));if(!o&&(S(t)||sY(t)==="INVALID")){console.warn(`TinyMCE is running in evaluation mode. Provide a valid license key or add license_key: 'gpl' to the init config to agree to the open source license terms. Read more at https://www.tiny.cloud/license-key/`)}};const aY=zi.DOM;const cY=(e,t)=>{const o=yn.fromDom(e.getBody());const n=$n(Wn(o));const s=yn.fromTag("style");Uo(s,"type","text/css");zs(s,yn.fromText(t));zs(n,s);e.on("remove",(()=>{Ds(s)}))};const iY=e=>e.inline?e.getElement().nodeName.toLowerCase():undefined;const lY=e=>Oe(e,(e=>S(e)===false));const dY=e=>{const t=e.options.get;const o=e.editorUpload.blobCache;return lY({allow_conditional_comments:t("allow_conditional_comments"),allow_html_data_urls:t("allow_html_data_urls"),allow_svg_data_urls:t("allow_svg_data_urls"),allow_html_in_named_anchor:t("allow_html_in_named_anchor"),allow_script_urls:t("allow_script_urls"),allow_unsafe_link_target:t("allow_unsafe_link_target"),convert_unsafe_embeds:t("convert_unsafe_embeds"),convert_fonts_to_spans:t("convert_fonts_to_spans"),fix_list_elements:t("fix_list_elements"),font_size_legacy_values:t("font_size_legacy_values"),forced_root_block:t("forced_root_block"),forced_root_block_attrs:t("forced_root_block_attrs"),preserve_cdata:t("preserve_cdata"),inline_styles:t("inline_styles"),root_name:iY(e),sandbox_iframes:t("sandbox_iframes"),sandbox_iframes_exclusions:pg(e),sanitize:t("xss_sanitization"),validate:true,blob_cache:o,document:e.getDoc()})};const uY=e=>{const t=e.options.get;return lY({custom_elements:t("custom_elements"),extended_valid_elements:t("extended_valid_elements"),invalid_elements:t("invalid_elements"),invalid_styles:t("invalid_styles"),schema:t("schema"),valid_children:t("valid_children"),valid_classes:t("valid_classes"),valid_elements:t("valid_elements"),valid_styles:t("valid_styles"),verify_html:t("verify_html"),padd_empty_block_inline_children:t("format_empty_lines")})};const fY=e=>{const t=e.options.get;return{...dY(e),...uY(e),...lY({remove_trailing_brs:t("remove_trailing_brs"),pad_empty_with_br:t("pad_empty_with_br"),url_converter:t("url_converter"),url_converter_scope:t("url_converter_scope"),element_format:t("element_format"),entities:t("entities"),entity_encoding:t("entity_encoding"),indent:t("indent"),indent_after:t("indent_after"),indent_before:t("indent_before")})}};const mY=e=>{const t=KO(dY(e),e.schema);t.addAttributeFilter("src,href,style,tabindex",((t,o)=>{const n=e.dom;const s="data-mce-"+o;let r=t.length;while(r--){const a=t[r];let c=a.attr(o);if(c&&!a.attr(s)){if(c.indexOf("data:")===0||c.indexOf("blob:")===0){continue}if(o==="style"){c=n.serializeStyle(n.parseStyle(c),a.name);if(!c.length){c=null}a.attr(s,c);a.attr(o,c)}else if(o==="tabindex"){a.attr(s,c);a.attr(o,null)}else{a.attr(s,e.convertURL(c,o,a.name))}}}}));t.addNodeFilter("script",(e=>{let t=e.length;while(t--){const o=e[t];const n=o.attr("type")||"no/type";if(n.indexOf("mce-")!==0){o.attr("type","mce-"+n)}}}));if(og(e)){t.addNodeFilter("#cdata",(t=>{var o;let n=t.length;while(n--){const s=t[n];s.type=8;s.name="#comment";s.value="[CDATA["+e.dom.encode((o=s.value)!==null&&o!==void 0?o:"")+"]]"}}))}t.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(t=>{let o=t.length;const n=e.schema.getNonEmptyElements();while(o--){const e=t[o];if(e.isEmpty(n)&&e.getAll("br").length===0){e.append(new lw("br",1))}}}));return t};const gY=e=>{const t=Lm(e);if(t){wk.setEditorTimeout(e,(()=>{let o;if(t===true){o=e}else{o=e.editorManager.get(t)}if(o&&!o.destroyed){o.focus();o.selection.scrollIntoView()}}),100)}};const pY=e=>{const t=e.dom.getRoot();if(!e.inline&&(!Rh(e)||e.selection.getStart(true)===t)){Zp(t).each((t=>{const o=t.getNode();const n=Dr(o)?Zp(o).getOr(t):t;e.selection.setRng(n.toRange())}))}};const hY=e=>{e.bindPendingEventDelegates();e.initialized=true;Jy(e);e.focus(true);pY(e);e.nodeChanged({initial:true});const t=Rm(e);if(E(t)){t.call(e,e)}gY(e)};const yY=e=>e.inline?e.ui.styleSheetLoader:e.dom.styleSheetLoader;const bY=(e,t,o)=>{const{pass:n,fail:s}=te(t,(e=>tinymce.Resource.has(IM(e))));const r=n.map((t=>{const o=tinymce.Resource.get(IM(t));if(v(o)){return Promise.resolve(yY(e).loadRawCss(t,o))}return Promise.resolve()}));const a=[...r,yY(e).loadAll(s)];if(e.inline){return a}else{return a.concat([e.ui.styleSheetLoader.loadAll(o)])}};const vY=e=>{const t=yY(e);const o=Jf(e);const n=e.contentCSS;const s=()=>{t.unloadAll(n);if(!e.inline){e.ui.styleSheetLoader.unloadAll(o)}};const r=()=>{if(e.removed){s()}else{e.on("remove",s)}};if(e.contentStyles.length>0){let t="";mo.each(e.contentStyles,(e=>{t+=e+"\r\n"}));e.dom.addStyle(t)}const a=Promise.all(bY(e,n,o)).then(r).catch(r);const c=Xf(e);if(c){cY(e,c)}return a};const kY=e=>{const t=e.getDoc(),o=e.getBody();Yy(e);if(!Hm(e)){t.body.spellcheck=false;aY.setAttrib(o,"spellcheck","false")}e.quirks=tY(e);Xy(e);const n=Qf(e);if(n!==undefined){o.dir=n}const s=Im(e);if(s){e.on("BeforeSetContent",(e=>{mo.each(s,(t=>{e.content=e.content.replace(t,(e=>"\x3c!--mce:protected "+escape(e)+"--\x3e"))}))}))}e.on("SetContent",(()=>{e.addVisual(e.getBody())}));e.on("compositionstart compositionend",(t=>{e.composing=t.type==="compositionstart"}))};const wY=e=>{if(!SD(e)){e.load({initial:true,format:"html"})}e.startContent=e.getContent({format:"raw"})};const _Y=e=>{if(e.removed!==true){wY(e);hY(e)}};const xY=e=>{let t=false;const o=setTimeout((()=>{if(!t){e.setProgressState(true)}}),500);return()=>{clearTimeout(o);t=true;e.setProgressState(false)}};const CY=e=>{const t=e.getElement();let o=e.getDoc();if(e.inline){aY.addClass(t,"mce-content-body");e.contentDocument=o=document;e.contentWindow=window;e.bodyElement=t;e.contentAreaContainer=t}const n=e.getBody();n.disabled=true;e.readonly=xm(e);e._editableRoot=Cm(e);if(!e.readonly&&e.hasEditableRoot()){if(e.inline&&aY.getStyle(n,"position",true)==="static"){n.style.position="relative"}n.contentEditable="true"}n.disabled=false;e.editorUpload=nR(e);e.schema=Vc(uY(e));e.dom=zi(o,{keep_values:true,url_converter:e.convertURL,url_converter_scope:e,update_styles:true,root_element:e.inline?e.getBody():null,collect:e.inline,schema:e.schema,contentCssCors:Uf(e),referrerPolicy:qf(e),onSetAttrib:t=>{e.dispatch("SetAttrib",t)}});e.parser=mY(e);e.serializer=AN(fY(e),e);e.selection=hN(e.dom,e.getWin(),e.serializer,e);e.annotator=Fy(e);e.formatter=bR(e);e.undoManager=_R(e);e._nodeChangeDispatcher=new Tq(e);e._selectionOverrides=eK(e);II(e);B$(e);XI(e);if(!SD(e)){W$(e);eY(e)}const s=zq(e);MI(e,s);WI(e);AR(e);N$(e);const r=TD(e);kY(e);rY(e);r.fold((()=>{const t=xY(e);vY(e).then((()=>{_Y(e);t()}))}),(t=>{e.setProgressState(true);vY(e).then((()=>{t().then((t=>{e.setProgressState(false);_Y(e);tN(e)}),(t=>{e.notificationManager.open({type:"error",text:String(t)});_Y(e);tN(e)}))}))}))};const SY=Z;const zY=(e,t,o)=>js(e,t,SY,o);const TY=zi.DOM;const EY=(e,t,o,n)=>{const s=yn.fromTag("iframe");n.each((e=>Uo(s,"tabindex",e)));qo(s,o);qo(s,{id:e+"_ifr",frameBorder:"0",allowTransparency:"true",title:t});an(s,"tox-edit-area__iframe");return s};const OY=e=>{let t=_f(e)+"<html><head>";if(xf(e)!==e.documentBaseUrl){t+='<base href="'+e.documentBaseURI.getURI()+'" />'}t+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';const o=Cf(e);const n=Sf(e);const s=e.translate(Nm(e));if(zf(e)){t+='<meta http-equiv="Content-Security-Policy" content="'+zf(e)+'" />'}t+="</head>"+`<body id="${o}" class="mce-content-body ${n}" data-id="${e.id}" aria-label="${s}">`+"<br>"+"</body></html>";return t};const AY=(e,t)=>{const o=to.browser.isFirefox()?Nm(e):"Rich Text Area";const n=e.translate(o);const s=$o(yn.fromDom(e.getElement()),"tabindex").bind(bt);const r=EY(e.id,n,wf(e),s).dom;r.onload=()=>{r.onload=null;e.dispatch("load")};e.contentAreaContainer=t.iframeContainer;e.iframeElement=r;e.iframeHTML=OY(e);TY.add(t.iframeContainer,r)};const DY=e=>{const t=e.iframeElement;const o=()=>{e.contentDocument=t.contentDocument;CY(e)};if(rg(e)||to.browser.isFirefox()){const t=e.getDoc();t.open();t.write(e.iframeHTML);t.close();o()}else{const n=zY(yn.fromDom(t),"load",(()=>{n.unbind();o()}));t.srcdoc=e.iframeHTML}};const NY=(e,t)=>{AY(e,t);if(t.editorContainer){t.editorContainer.style.display=e.orgDisplay;e.hidden=TY.isHidden(t.editorContainer)}e.getElement().style.display="none";TY.setAttrib(e.id,"aria-hidden","true");e.getElement().style.visibility=e.orgVisibility;DY(e)};const MY=zi.DOM;const RY=(e,t,o)=>{const n=wM.get(o);const s=wM.urls[o]||e.documentBaseUrl.replace(/\/$/,"");o=mo.trim(o);if(n&&mo.inArray(t,o)===-1){if(e.plugins[o]){return}try{const r=n(e,s)||{};e.plugins[o]=r;if(E(r.init)){r.init(e,s);t.push(o)}}catch(t){BM(e,o,t)}}};const BY=e=>e.replace(/^\-/,"");const LY=e=>{const t=[];Q(zm(e),(o=>{RY(e,t,BY(o))}))};const HY=e=>{const t=mo.trim(If(e));const o=e.ui.registry.getAll().icons;const n={...rM.get("default").icons,...rM.get(t).icons};xe(n,((t,n)=>{if(!Me(o,n)){e.ui.registry.addIcon(n,t)}}))};const IY=e=>{const t=am(e);if(v(t)){const o=_M.get(t);e.theme=o(e,_M.urls[t])||{};if(E(e.theme.init)){e.theme.init(e,_M.urls[t]||e.documentBaseUrl.replace(/\/$/,""))}}else{e.theme={}}};const PY=e=>{const t=im(e);const o=aM.get(t);e.model=o(e,aM.urls[t])};const FY=e=>{const t=e.theme.renderUI;return t?t():UY(e)};const VY=e=>{const t=e.getElement();const o=am(e);const n=o(e,t);if(n.editorContainer.nodeType){n.editorContainer.id=n.editorContainer.id||e.id+"_parent"}if(n.iframeContainer&&n.iframeContainer.nodeType){n.iframeContainer.id=n.iframeContainer.id||e.id+"_iframecontainer"}n.height=n.iframeHeight?n.iframeHeight:t.offsetHeight;return n};const jY=(e,t)=>({editorContainer:e,iframeContainer:t,api:{}});const ZY=e=>{const t=MY.create("div");MY.insertAfter(t,e);return jY(t,t)};const UY=e=>{const t=e.getElement();return e.inline?jY(null):ZY(t)};const qY=e=>{const t=e.getElement();e.orgDisplay=t.style.display;if(v(am(e))){return FY(e)}else if(E(am(e))){return VY(e)}else{return UY(e)}};const WY=(e,t)=>{const o={show:U.from(t.show).getOr(D),hide:U.from(t.hide).getOr(D),isEnabled:U.from(t.isEnabled).getOr(Z),setEnabled:o=>{if(!e.mode.isReadOnly()){U.from(t.setEnabled).each((e=>e(o)))}}};e.ui={...e.ui,...o}};const $Y=async e=>{e.dispatch("ScriptsLoaded");HY(e);IY(e);PY(e);LY(e);const t=await qY(e);WY(e,U.from(t.api).getOr({}));e.editorContainer=t.editorContainer;ZM(e);if(e.inline){CY(e)}else{NY(e,{editorContainer:t.editorContainer,iframeContainer:t.iframeContainer})}};const GY=zi.DOM;const KY=e=>e.charAt(0)==="-";const YY=(e,t)=>{const o=Wf(t);const n=$f(t);if(!Wi.hasCode(o)&&o!=="en"){const s=pt(n)?n:`${t.editorManager.baseURL}/langs/${o}.js`;e.add(s).catch((()=>{NM(t,s,o)}))}};const XY=(e,t)=>{const o=am(e);if(v(o)&&!KY(o)&&!Me(_M.urls,o)){const n=cm(e);const s=n?e.documentBaseURI.toAbsolute(n):`themes/${o}/theme${t}.js`;_M.load(o,s).catch((()=>{MM(e,s,o)}))}};const JY=(e,t)=>{const o=im(e);if(o!=="plugin"&&!Me(aM.urls,o)){const n=lm(e);const s=v(n)?e.documentBaseURI.toAbsolute(n):`models/${o}/model${t}.js`;aM.load(o,s).catch((()=>{RM(e,s,o)}))}};const QY=e=>U.from(Pf(e)).filter(pt).map((e=>({url:e,name:U.none()})));const eX=(e,t,o)=>U.from(t).filter((e=>pt(e)&&!rM.has(e))).map((t=>({url:`${e.editorManager.baseURL}/icons/${t}/icons${o}.js`,name:U.some(t)})));const tX=(e,t,o)=>{const n=eX(t,"default",o);const s=QY(t).orThunk((()=>eX(t,If(t),"")));Q(ho([n,s]),(o=>{e.add(o.url).catch((()=>{DM(t,o.url,o.name.getOrUndefined())}))}))};const oX=(e,t)=>{const o=(t,o)=>{wM.load(t,o).catch((()=>{AM(e,o,t)}))};xe(Tm(e),((t,n)=>{o(n,t);e.options.set("plugins",zm(e).concat(n))}));Q(zm(e),(e=>{e=mo.trim(e);if(e&&!wM.urls[e]&&!KY(e)){o(e,`plugins/${e}/plugin${t}.js`)}}))};const nX=e=>{const t=am(e);return!v(t)||T(_M.get(t))};const sX=e=>{const t=im(e);return T(aM.get(t))};const rX=(e,t)=>{const o=Ni.ScriptLoader;const n=()=>{if(!e.removed&&nX(e)&&sX(e)){$Y(e)}};XY(e,t);JY(e,t);YY(o,e);tX(o,e,t);oX(e,t);o.loadQueue().then(n,n)};const aX=(e,t)=>Za.forElement(e,{contentCssCors:Sm(t),referrerPolicy:qf(t)});const cX=e=>{const t=e.id;Wi.setCode(Wf(e));const o=()=>{GY.unbind(window,"ready",o);e.render()};if(!gi.Event.domLoaded){GY.bind(window,"ready",o);return}if(!e.getElement()){return}const n=yn.fromDom(e.getElement());const s=Xo(n);e.on("remove",(()=>{ee(n.dom.attributes,(e=>Ko(n,e.name)));qo(n,s)}));e.ui.styleSheetLoader=aX(n,e);if(!hm(e)){e.orgVisibility=e.getElement().style.visibility;e.getElement().style.visibility="hidden"}else{e.inline=true}const r=e.getElement().form||GY.getParent(t,"form");if(r){e.formElement=r;if(ym(e)&&!Mr(e.getElement())){GY.insertAfter(GY.create("input",{type:"hidden",name:t}),t);e.hasHiddenInput=true}e.formEventDelegate=t=>{e.dispatch(t.type,t)};GY.bind(r,"submit reset",e.formEventDelegate);e.on("reset",(()=>{e.resetContent()}));if(bm(e)&&!r.submit.nodeType&&!r.submit.length&&!r._mceOldSubmit){r._mceOldSubmit=r.submit;r.submit=()=>{e.editorManager.triggerSave();e.setDirty(false);return r._mceOldSubmit(r)}}}e.windowManager=CM(e);e.notificationManager=kM(e);if(lg(e)){e.on("GetContent",(e=>{if(e.save){e.content=GY.encode(e.content)}}))}if(vm(e)){e.on("submit",(()=>{if(e.initialized){e.save()}}))}if(km(e)){e._beforeUnload=()=>{if(e.initialized&&!e.destroyed&&!e.isHidden()){e.save({format:"raw",no_events:true,set_dirty:false})}};e.editorManager.on("BeforeUnload",e._beforeUnload)}e.editorManager.add(e);rX(e,e.suffix)};const iX=(e,t)=>{if(e._editableRoot!==t){e._editableRoot=t;if(!e.readonly){e.getBody().contentEditable=String(e.hasEditableRoot());e.nodeChanged()}gb(e,t)}};const lX=e=>e._editableRoot;const dX=(e,t)=>({sections:R(e),options:R(t)});const uX=Gt().deviceType;const fX=uX.isPhone();const mX=uX.isTablet();const gX=e=>{if(z(e)){return[]}else{const t=_(e)?e:e.split(/[ ,]/);const o=J(t,ft);return oe(o,pt)}};const pX=(e,t)=>{const o=Ee(t,((t,o)=>Y(e,o)));return dX(o.t,o.f)};const hX=(e,t,o={})=>{const n=e.sections();const s=Ne(n,t).getOr({});return mo.extend({},o,s)};const yX=(e,t)=>Me(e.sections(),t);const bX=(e,t)=>yX(e,t)?e.sections()[t]:{};const vX=(e,t)=>{const o={table_grid:false,object_resizing:false,resize:false,toolbar_mode:Ne(e,"toolbar_mode").getOr("scrolling"),toolbar_sticky:false};const n={menubar:false};return{...o,...t?n:{}}};const kX=(e,t)=>{var o;const n=(o=t.external_plugins)!==null&&o!==void 0?o:{};if(e&&e.external_plugins){return mo.extend({},e.external_plugins,n)}else{return n}};const wX=(e,t)=>[...gX(e),...gX(t)];const _X=(e,t,o,n)=>{if(e&&yX(t,"mobile")){return n}else{return o}};const xX=(e,t,o,n)=>{const s=gX(o.forced_plugins);const r=gX(n.plugins);const a=bX(t,"mobile");const c=a.plugins?gX(a.plugins):r;const i=_X(e,t,r,c);const l=wX(s,i);return mo.extend(n,{forced_plugins:s,plugins:l})};const CX=(e,t)=>e&&yX(t,"mobile");const SX=(e,t,o,n,s)=>{var r;const a=e?{mobile:vX((r=s.mobile)!==null&&r!==void 0?r:{},t)}:{};const c=pX(["mobile"],OV(a,s));const i=mo.extend(o,n,c.options(),CX(e,c)?hX(c,"mobile"):{},{external_plugins:kX(n,c.options())});return xX(e,c,n,i)};const zX=(e,t)=>{const o=AV(t);return SX(fX||mX,fX,o,e,o)};const TX=(e,t)=>eN(e,t);const EX=e=>{const t=(t,o)=>{e.formatter.toggle(t,o);e.nodeChanged()};const o=o=>()=>{Q("left,center,right,justify".split(","),(t=>{if(o!==t){e.formatter.remove("align"+t)}}));if(o!=="none"){t("align"+o)}};e.editorCommands.addCommands({JustifyLeft:o("left"),JustifyCenter:o("center"),JustifyRight:o("right"),JustifyFull:o("justify"),JustifyNone:o("none")})};const OX=e=>{const t=t=>()=>{const o=e.selection;const n=o.isCollapsed()?[e.dom.getParent(o.getNode(),e.dom.isBlock)]:o.getSelectedBlocks();return X(n,(o=>T(e.formatter.matchNode(o,t))))};e.editorCommands.addCommands({JustifyLeft:t("alignleft"),JustifyCenter:t("aligncenter"),JustifyRight:t("alignright"),JustifyFull:t("alignjustify")},"state")};const AX=e=>{EX(e);OX(e)};const DX=e=>{e.editorCommands.addCommands({"Cut,Copy,Paste":t=>{const o=e.getDoc();let n;try{o.execCommand(t)}catch(e){n=true}if(t==="paste"&&!o.queryCommandEnabled(t)){n=true}if(n||!o.queryCommandSupported(t)){let t=e.translate(`Your browser doesn't support direct access to the clipboard. `+"Please use the Ctrl+X/C/V keyboard shortcuts instead.");if(to.os.isMacOS()||to.os.isiOS()){t=t.replace(/Ctrl\+/g,"⌘+")}e.notificationManager.open({text:t,type:"error"})}}})};const NX=(e,t,o,n)=>{const s=yn.fromDom(e.getRoot());if(I_(s,mu.fromRangeStart(t),n)){o=o.replace(/^ /," ")}else{o=o.replace(/^ /," ")}if(F_(s,mu.fromRangeEnd(t),n)){o=o.replace(/( | )(<br( \/)>)?$/," ")}else{o=o.replace(/ (<br( \/)?>)?$/," ")}return o};const MX=e=>{if(typeof e!=="string"){const t=mo.extend({paste:e.paste,data:{paste:e.paste}},e);return{content:e.content,details:t}}return{content:e,details:{}}};const RX=(e,t)=>{const o=e.selection;const n=e.dom;if(/^ | $/.test(t)){return NX(n,o.getRng(),t,e.schema)}else{return t}};const BX=(e,t)=>{if(e.selection.isEditable()){const{content:o,details:n}=MX(t);tA(e,{...n,content:RX(e,o),format:"html",set:false,selection:true}).each((t=>{const o=JD(e,t.content,n);oA(e,o,t);e.addVisual()}))}};const LX=e=>{e.editorCommands.addCommands({mceCleanup:()=>{const t=e.selection.getBookmark();e.setContent(e.getContent());e.selection.moveToBookmark(t)},insertImage:(t,o,n)=>{BX(e,e.dom.createHTML("img",{src:n}))},insertHorizontalRule:()=>{e.execCommand("mceInsertContent",false,"<hr>")},insertText:(t,o,n)=>{BX(e,e.dom.encode(n))},insertHTML:(t,o,n)=>{BX(e,n)},mceInsertContent:(t,o,n)=>{BX(e,n)},mceSetContent:(t,o,n)=>{e.setContent(n)},mceReplaceContent:(t,o,n)=>{e.execCommand("mceInsertContent",false,n.replace(/\{\$selection\}/g,e.selection.getContent({format:"text"})))},mceNewDocument:()=>{e.setContent(Zm(e))}})};const HX={"font-size":"size","font-family":"face"};const IX=jo("font");const PX=(e,t,o)=>{const n=t=>vs(t,e).orThunk((()=>{if(IX(t)){return Ne(HX,e).bind((e=>$o(t,e)))}else{return U.none()}}));const s=e=>xn(yn.fromDom(t),e);return oz(yn.fromDom(o),(e=>n(e)),s)};const FX=e=>e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",");const VX=(e,t)=>U.from(zi.DOM.getStyle(t,e,true));const jX=e=>(t,o)=>U.from(o).map(yn.fromDom).filter(Io).bind((o=>PX(e,t,o.dom).or(VX(e,o.dom)))).getOr("");const ZX=jX("font-size");const UX=N(FX,jX("font-family"));const qX=e=>Zp(e.getBody()).bind((e=>{const t=e.container();return U.from(Rr(t)?t.parentNode:t)}));const WX=e=>U.from(e.selection.getRng()).bind((t=>{const o=e.getBody();const n=t.startContainer===o&&t.startOffset===0;return n?U.none():U.from(e.selection.getStart(true))}));const $X=(e,t)=>WX(e).orThunk(H(qX,e)).map(yn.fromDom).filter(Io).bind(t);const GX=(e,t)=>$X(e,M(U.some,t));const KX=(e,t)=>{if(/^[0-9.]+$/.test(t)){const o=parseInt(t,10);if(o>=1&&o<=7){const n=cg(e);const s=ig(e);if(s.length>0){return s[o-1]||t}else{return n[o-1]||t}}else{return t}}else{return t}};const YX=e=>{const t=e.split(/\s*,\s*/);return J(t,(e=>{if(e.indexOf(" ")!==-1&&!(lt(e,'"')||lt(e,`'`))){return`'${e}'`}else{return e}})).join(",")};const XX=(e,t)=>{const o=KX(e,t);e.formatter.toggle("fontname",{value:YX(o)});e.nodeChanged()};const JX=e=>GX(e,(t=>UX(e.getBody(),t.dom))).getOr("");const QX=(e,t)=>{e.formatter.toggle("fontsize",{value:KX(e,t)});e.nodeChanged()};const eJ=e=>GX(e,(t=>ZX(e.getBody(),t.dom))).getOr("");const tJ=e=>GX(e,(t=>{const o=yn.fromDom(e.getBody());const n=oz(t,(e=>vs(e,"line-height")),H(xn,o));const s=()=>{const e=parseFloat(ys(t,"line-height"));const o=parseFloat(ys(t,"font-size"));return String(e/o)};return n.getOrThunk(s)})).getOr("");const oJ=(e,t)=>{e.formatter.toggle("lineheight",{value:String(t)});e.nodeChanged()};const nJ=e=>{const t=(t,o)=>{e.formatter.toggle(t,o);e.nodeChanged()};e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>{t(e)},"ForeColor,HiliteColor":(e,o,n)=>{t(e,{value:n})},BackColor:(e,o,n)=>{t("hilitecolor",{value:n})},FontName:(t,o,n)=>{XX(e,n)},FontSize:(t,o,n)=>{QX(e,n)},LineHeight:(t,o,n)=>{oJ(e,n)},Lang:(e,o,n)=>{var s;t(e,{value:n.code,customValue:(s=n.customCode)!==null&&s!==void 0?s:null})},RemoveFormat:t=>{e.formatter.remove(t)},mceBlockQuote:()=>{t("blockquote")},FormatBlock:(e,o,n)=>{t(v(n)?n:"p")},mceToggleFormat:(e,o,n)=>{t(n)}})};const sJ=e=>{const t=t=>e.formatter.match(t);e.editorCommands.addCommands({"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":e=>t(e),mceBlockQuote:()=>t("blockquote")},"state");e.editorCommands.addQueryValueHandler("FontName",(()=>JX(e)));e.editorCommands.addQueryValueHandler("FontSize",(()=>eJ(e)));e.editorCommands.addQueryValueHandler("LineHeight",(()=>tJ(e)))};const rJ=e=>{nJ(e);sJ(e)};const aJ=e=>{e.editorCommands.addCommands({mceAddUndoLevel:()=>{e.undoManager.add()},mceEndUndoLevel:()=>{e.undoManager.add()},Undo:()=>{e.undoManager.undo()},Redo:()=>{e.undoManager.redo()}})};const cJ=e=>{e.editorCommands.addCommands({Indent:()=>{TI(e)},Outdent:()=>{EI(e)}});e.editorCommands.addCommands({Outdent:()=>_I(e)},"state")};const iJ=e=>{const t=(t,o,n)=>{const s=v(n)?{href:n}:n;const r=e.dom.getParent(e.selection.getNode(),"a");if(k(s)&&v(s.href)){s.href=s.href.replace(/ /g,"%20");if(!r||!s.href){e.formatter.remove("link")}if(s.href){e.formatter.apply("link",s,r)}}};e.editorCommands.addCommands({unlink:()=>{if(e.selection.isEditable()){if(e.selection.isCollapsed()){const t=e.dom.getParent(e.selection.getStart(),"a");if(t){e.dom.remove(t,true)}return}e.formatter.remove("link")}},mceInsertLink:t,createLink:t})};const lJ=(e,t,o,n)=>{const s=e.dom;const r=e=>s.isBlock(e)&&e.parentElement===o;const a=r(t)?t:s.getParent(n,r,o);return U.from(a).map(yn.fromDom)};const dJ=(e,t)=>{const o=e.dom;const n=e.selection.getRng();const s=t?e.selection.getStart():e.selection.getEnd();const r=t?n.startContainer:n.endContainer;const a=RZ(o,r);if(!a||!a.isContentEditable){return}const c=t?xs:Cs;const i=Ef(e);lJ(e,s,a,r).each((t=>{const o=VZ(e,r,t.dom,a,false,i);c(t,yn.fromDom(o));e.selection.setCursorLocation(o,0);e.dispatch("NewBlock",{newBlock:o});_Z(e,"insertParagraph")}))};const uJ=e=>dJ(e,true);const fJ=e=>dJ(e,false);const mJ=e=>{e.editorCommands.addCommands({InsertNewBlockBefore:()=>{uJ(e)},InsertNewBlockAfter:()=>{fJ(e)}})};const gJ=e=>{e.editorCommands.addCommands({insertParagraph:()=>{GU(hU,e)},mceInsertNewLine:(t,o,n)=>{KU(e,n)},InsertLineBreak:(t,o,n)=>{GU(AU,e)}})};const pJ=e=>{e.editorCommands.addCommands({mceSelectNodeDepth:(t,o,n)=>{let s=0;e.dom.getParent(e.selection.getNode(),(t=>{if(_r(t)&&s++===n){e.selection.select(t);return false}else{return true}}),e.getBody())},mceSelectNode:(t,o,n)=>{e.selection.select(n)},selectAll:()=>{const t=e.dom.getParent(e.selection.getStart(),jr);if(t){const o=e.dom.createRng();o.selectNodeContents(t);e.selection.setRng(o)}}})};const hJ=e=>{e.editorCommands.addCommands({mceRemoveNode:(t,o,n)=>{const s=n!==null&&n!==void 0?n:e.selection.getNode();if(s!==e.getBody()){const t=e.selection.getBookmark();e.dom.remove(s,true);e.selection.moveToBookmark(t)}},mcePrint:()=>{e.getWin().print()},mceFocus:(t,o,n)=>{Kk(e,n===true)},mceToggleVisualAid:()=>{e.hasVisual=!e.hasVisual;e.addVisual()}})};const yJ=e=>{AX(e);DX(e);aJ(e);pJ(e);LX(e);iJ(e);cJ(e);mJ(e);gJ(e);rJ(e);hJ(e)};const bJ=["toggleview"];const vJ=e=>Y(bJ,e.toLowerCase());class kJ{constructor(e){this.commands={state:{},exec:{},value:{}};this.editor=e}execCommand(e,t=false,o,n){const s=this.editor;const r=e.toLowerCase();const a=n===null||n===void 0?void 0:n.skip_focus;if(s.removed){return false}if(r!=="mcefocus"){if(!/^(mceAddUndoLevel|mceEndUndoLevel)$/i.test(r)&&!a){s.focus()}else{hk(s)}}const c=s.dispatch("BeforeExecCommand",{command:e,ui:t,value:o});if(c.isDefaultPrevented()){return false}const i=this.commands.exec[r];if(E(i)){i(r,t,o);s.dispatch("ExecCommand",{command:e,ui:t,value:o});return true}return false}queryCommandState(e){if(!vJ(e)&&this.editor.quirks.isHidden()||this.editor.removed){return false}const t=e.toLowerCase();const o=this.commands.state[t];if(E(o)){return o(t)}return false}queryCommandValue(e){if(!vJ(e)&&this.editor.quirks.isHidden()||this.editor.removed){return""}const t=e.toLowerCase();const o=this.commands.value[t];if(E(o)){return o(t)}return""}addCommands(e,t="exec"){const o=this.commands;xe(e,((e,n)=>{Q(n.toLowerCase().split(","),(n=>{o[t][n]=e}))}))}addCommand(e,t,o){const n=e.toLowerCase();this.commands.exec[n]=(e,n,s)=>t.call(o!==null&&o!==void 0?o:this.editor,n,s)}queryCommandSupported(e){const t=e.toLowerCase();if(this.commands.exec[t]){return true}else{return false}}addQueryStateHandler(e,t,o){this.commands.state[e.toLowerCase()]=()=>t.call(o!==null&&o!==void 0?o:this.editor)}addQueryValueHandler(e,t,o){this.commands.value[e.toLowerCase()]=()=>t.call(o!==null&&o!==void 0?o:this.editor)}}const wJ="data-mce-contenteditable";const _J=(e,t,o)=>{if(un(e,t)&&!o){ln(e,t)}else if(o){an(e,t)}};const xJ=(e,t,o)=>{try{e.getDoc().execCommand(t,false,String(o))}catch(e){}};const CJ=(e,t)=>{e.dom.contentEditable=t?"true":"false"};const SJ=e=>{Q(sr(e,'*[contenteditable="true"]'),(e=>{Uo(e,wJ,"true");CJ(e,false)}))};const zJ=e=>{Q(sr(e,`*[${wJ}="true"]`),(e=>{Ko(e,wJ);CJ(e,true)}))};const TJ=e=>{U.from(e.selection.getNode()).each((e=>{e.removeAttribute("data-mce-selected")}))};const EJ=e=>{e.selection.setRng(e.selection.getRng())};const OJ=(e,t)=>{const o=yn.fromDom(e.getBody());_J(o,"mce-content-readonly",t);if(t){e.selection.controlSelection.hideResizeRect();e._selectionOverrides.hideFakeCaret();TJ(e);e.readonly=true;CJ(o,false);SJ(o)}else{e.readonly=false;if(e.hasEditableRoot()){CJ(o,true)}zJ(o);xJ(e,"StyleWithCSS",false);xJ(e,"enableInlineTableEditing",false);xJ(e,"enableObjectResizing",false);if(Wk(e)){e.focus()}EJ(e);e.nodeChanged()}};const AJ=e=>e.readonly;const DJ=e=>{e.parser.addAttributeFilter("contenteditable",(t=>{if(AJ(e)){Q(t,(e=>{e.attr(wJ,e.attr("contenteditable"));e.attr("contenteditable","false")}))}}));e.serializer.addAttributeFilter(wJ,(t=>{if(AJ(e)){Q(t,(e=>{e.attr("contenteditable",e.attr(wJ))}))}}));e.serializer.addTempAttr(wJ)};const NJ=e=>{if(e.serializer){DJ(e)}else{e.on("PreInit",(()=>{DJ(e)}))}};const MJ=e=>e.type==="click";const RJ=["copy"];const BJ=e=>Y(RJ,e.type);const LJ=(e,t)=>{const o=t=>xn(t,yn.fromDom(e.getBody()));return is(t,"a",o).bind((e=>$o(e,"href")))};const HJ=(e,t)=>{if(MJ(t)&&!pb.metaKeyPressed(t)){const o=yn.fromDom(t.target);LJ(e,o).each((o=>{t.preventDefault();if(/^#/.test(o)){const t=e.dom.select(`${o},[name="${ct(o,"#")}"]`);if(t.length){e.selection.scrollIntoView(t[0],true)}}else{window.open(o,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")}}))}else if(BJ(t)){e.dispatch(t.type,t)}};const IJ=e=>{e.on("ShowCaret",(t=>{if(AJ(e)){t.preventDefault()}}));e.on("ObjectSelected",(t=>{if(AJ(e)){t.preventDefault()}}))};const PJ=mo.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange "+"mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover "+"draggesture dragdrop drop drag submit "+"compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," ");class FJ{static isNative(e){return!!PJ[e.toLowerCase()]}constructor(e){this.bindings={};this.settings=e||{};this.scope=this.settings.scope||this;this.toggleEvent=this.settings.toggleEvent||j}fire(e,t){return this.dispatch(e,t)}dispatch(e,t){const o=e.toLowerCase();const n=ai(o,t!==null&&t!==void 0?t:{},this.scope);if(this.settings.beforeFire){this.settings.beforeFire(n)}const s=this.bindings[o];if(s){for(let e=0,t=s.length;e<t;e++){const t=s[e];if(t.removed){continue}if(t.once){this.off(o,t.func)}if(n.isImmediatePropagationStopped()){return n}if(t.func.call(this.scope,n)===false){n.preventDefault();return n}}}return n}on(e,t,o,n){if(t===false){t=j}if(t){const s={func:t,removed:false};if(n){mo.extend(s,n)}const r=e.toLowerCase().split(" ");let a=r.length;while(a--){const e=r[a];let t=this.bindings[e];if(!t){t=[];this.toggleEvent(e,true)}if(o){t=[s,...t]}else{t=[...t,s]}this.bindings[e]=t}}return this}off(e,t){if(e){const o=e.toLowerCase().split(" ");let n=o.length;while(n--){const s=o[n];let r=this.bindings[s];if(!s){xe(this.bindings,((e,t)=>{this.toggleEvent(t,false);delete this.bindings[t]}));return this}if(r){if(!t){r.length=0}else{const e=te(r,(e=>e.func===t));r=e.fail;this.bindings[s]=r;Q(e.pass,(e=>{e.removed=true}))}if(!r.length){this.toggleEvent(e,false);delete this.bindings[s]}}}}else{xe(this.bindings,((e,t)=>{this.toggleEvent(t,false)}));this.bindings={}}return this}once(e,t,o){return this.on(e,t,o,{once:true})}has(e){e=e.toLowerCase();const t=this.bindings[e];return!(!t||t.length===0)}}const VJ=e=>{if(!e._eventDispatcher){e._eventDispatcher=new FJ({scope:e,toggleEvent:(t,o)=>{if(FJ.isNative(t)&&e.toggleNativeEvent){e.toggleNativeEvent(t,o)}}})}return e._eventDispatcher};const jJ={fire(e,t,o){return this.dispatch(e,t,o)},dispatch(e,t,o){const n=this;if(n.removed&&e!=="remove"&&e!=="detach"){return ai(e.toLowerCase(),t!==null&&t!==void 0?t:{},n)}const s=VJ(n).dispatch(e,t);if(o!==false&&n.parent){let t=n.parent();while(t&&!s.isPropagationStopped()){t.dispatch(e,s,false);t=t.parent?t.parent():undefined}}return s},on(e,t,o){return VJ(this).on(e,t,o)},off(e,t){return VJ(this).off(e,t)},once(e,t){return VJ(this).once(e,t)},hasEventListeners(e){return VJ(this).has(e)}};const ZJ=zi.DOM;let UJ;const qJ=(e,t)=>{if(t==="selectionchange"){return e.getDoc()}if(!e.inline&&/^(?:mouse|touch|click|contextmenu|drop|dragover|dragend)/.test(t)){return e.getDoc().documentElement}const o=sm(e);if(o){if(!e.eventRoot){e.eventRoot=ZJ.select(o)[0]}return e.eventRoot}return e.getBody()};const WJ=e=>!e.hidden&&!AJ(e);const $J=(e,t,o)=>{if(WJ(e)){e.dispatch(t,o)}else if(AJ(e)){HJ(e,o)}};const GJ=(e,t)=>{if(!e.delegates){e.delegates={}}if(e.delegates[t]||e.removed){return}const o=qJ(e,t);if(sm(e)){if(!UJ){UJ={};e.editorManager.on("removeEditor",(()=>{if(!e.editorManager.activeEditor){if(UJ){xe(UJ,((t,o)=>{e.dom.unbind(qJ(e,o))}));UJ=null}}}))}if(UJ[t]){return}const n=o=>{const n=o.target;const s=e.editorManager.get();let r=s.length;while(r--){const e=s[r].getBody();if(e===n||ZJ.isChildOf(n,e)){$J(s[r],t,o)}}};UJ[t]=n;ZJ.bind(o,t,n)}else{const n=o=>{$J(e,t,o)};ZJ.bind(o,t,n);e.delegates[t]=n}};const KJ={...jJ,bindPendingEventDelegates(){const e=this;mo.each(e._pendingNativeEvents,(t=>{GJ(e,t)}))},toggleNativeEvent(e,t){const o=this;if(e==="focus"||e==="blur"){return}if(o.removed){return}if(t){if(o.initialized){GJ(o,e)}else{if(!o._pendingNativeEvents){o._pendingNativeEvents=[e]}else{o._pendingNativeEvents.push(e)}}}else if(o.initialized&&o.delegates){o.dom.unbind(qJ(o,e),e,o.delegates[e]);delete o.delegates[e]}},unbindAllNativeEvents(){const e=this;const t=e.getBody();const o=e.dom;if(e.delegates){xe(e.delegates,((t,o)=>{e.dom.unbind(qJ(e,o),o,t)}));delete e.delegates}if(!e.inline&&t&&o){t.onload=null;o.unbind(e.getWin());o.unbind(e.getDoc())}if(o){o.unbind(t);o.unbind(e.getContainer())}}};const YJ=e=>{if(v(e)){return{value:e.split(/[ ,]/),valid:true}}else if(A(e,v)){return{value:e,valid:true}}else{return{valid:false,message:`The value must be a string[] or a comma/space separated string.`}}};const XJ=e=>{const t=(()=>{switch(e){case"array":return _;case"boolean":return C;case"function":return E;case"number":return O;case"object":return k;case"string":return v;case"string[]":return YJ;case"object[]":return e=>A(e,k);case"regexp":return e=>b(e,RegExp);default:return Z}})();return o=>tQ(o,t,`The value must be a ${e}.`)};const JJ=e=>v(e.processor);const QJ=(e,t)=>{const o=ht(t.message)?"":`. ${t.message}`;return e+o};const eQ=e=>e.valid;const tQ=(e,t,o="")=>{const n=t(e);if(C(n)){return n?{value:e,valid:true}:{valid:false,message:o}}else{return n}};const oQ=(e,t,o)=>{if(!S(t)){const n=tQ(t,o);if(eQ(n)){return n.value}else{console.error(QJ(`Invalid default value passed for the "${e}" option`,n))}}return undefined};const nQ=(e,t,o=t)=>{const n={};const s={};const r=(e,t,o)=>{const n=tQ(t,o);if(eQ(n)){s[e]=n.value;return true}else{console.warn(QJ(`Invalid value passed for the ${e} option`,n));return false}};const a=(e,o)=>{const a=JJ(o)?XJ(o.processor):o.processor;const c=oQ(e,o.default,a);n[e]={...o,default:c,processor:a};const i=Ne(s,e).orThunk((()=>Ne(t,e)));i.each((t=>r(e,t,a)))};const c=e=>Me(n,e);const i=e=>Ne(s,e).orThunk((()=>Ne(n,e).map((e=>e.default)))).getOrUndefined();const l=(e,t)=>{if(!c(e)){console.warn(`"${e}" is not a registered option. Ensure the option has been registered before setting a value.`);return false}else{const o=n[e];if(o.immutable){console.error(`"${e}" is an immutable option and cannot be updated`);return false}else{return r(e,t,o.processor)}}};const d=e=>{const t=c(e);if(t){delete s[e]}return t};const u=e=>Me(s,e);const f=()=>{try{console.log(JSON.parse(JSON.stringify(o,((e,t)=>{if(C(t)||O(t)||v(t)||x(t)||_(t)||w(t)){return t}return Object.prototype.toString.call(t)}))))}catch(e){console.error(e)}};return{register:a,isRegistered:c,get:i,set:l,unset:d,isSet:u,debug:f}};const sQ=["design","readonly"];const rQ=(e,t,o,n)=>{const s=o[t.get()];const r=o[n];try{r.activate()}catch(e){console.error(`problem while activating editor mode ${n}:`,e);return}s.deactivate();if(s.editorReadOnly!==r.editorReadOnly){OJ(e,r.editorReadOnly)}t.set(n);$y(e,n)};const aQ=(e,t,o,n)=>{if(n===o.get()){return}else if(!Me(t,n)){throw new Error(`Editor mode '${n}' is invalid`)}if(e.initialized){rQ(e,o,t,n)}else{e.on("init",(()=>rQ(e,o,t,n)))}};const cQ=(e,t,o)=>{if(Y(sQ,t)){throw new Error(`Cannot override default mode ${t}`)}return{...e,[t]:{...o,deactivate:()=>{try{o.deactivate()}catch(e){console.error(`problem while deactivating editor mode ${t}:`,e)}}}}};const iQ=e=>{const t=ia("design");const o=ia({design:{activate:D,deactivate:D,editorReadOnly:false},readonly:{activate:D,deactivate:D,editorReadOnly:true}});NJ(e);IJ(e);return{isReadOnly:()=>AJ(e),set:n=>aQ(e,o.get(),t,n),get:()=>t.get(),register:(e,t)=>{o.set(cQ(o.get(),e,t))}}};const lQ=mo.each,dQ=mo.explode;const uQ={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123};const fQ=mo.makeMap("alt,ctrl,shift,meta,access");const mQ=e=>e in fQ;const gQ=e=>{const t={};const o=to.os.isMacOS()||to.os.isiOS();lQ(dQ(e.toLowerCase(),"+"),(e=>{if(mQ(e)){t[e]=true}else{if(/^[0-9]{2,}$/.test(e)){t.keyCode=parseInt(e,10)}else{t.charCode=e.charCodeAt(0);t.keyCode=uQ[e]||e.toUpperCase().charCodeAt(0)}}}));const n=[t.keyCode];let s;for(s in fQ){if(t[s]){n.push(s)}else{t[s]=false}}t.id=n.join(",");if(t.access){t.alt=true;if(o){t.ctrl=true}else{t.shift=true}}if(t.meta){if(o){t.meta=true}else{t.ctrl=true;t.meta=false}}return t};class pQ{constructor(e){this.shortcuts={};this.pendingPatterns=[];this.editor=e;const t=this;e.on("keyup keypress keydown",(e=>{if((t.hasModifier(e)||t.isFunctionKey(e))&&!e.isDefaultPrevented()){lQ(t.shortcuts,(o=>{if(t.matchShortcut(e,o)){t.pendingPatterns=o.subpatterns.slice(0);if(e.type==="keydown"){t.executeShortcutAction(o)}}}));if(t.matchShortcut(e,t.pendingPatterns[0])){if(t.pendingPatterns.length===1){if(e.type==="keydown"){t.executeShortcutAction(t.pendingPatterns[0])}}t.pendingPatterns.shift()}}}))}add(e,t,o,n){const s=this;const r=s.normalizeCommandFunc(o);lQ(dQ(mo.trim(e)),(e=>{const o=s.createShortcut(e,t,r,n);s.shortcuts[o.id]=o}));return true}remove(e){const t=this.createShortcut(e);if(this.shortcuts[t.id]){delete this.shortcuts[t.id];return true}return false}normalizeCommandFunc(e){const t=this;const o=e;if(typeof o==="string"){return()=>{t.editor.execCommand(o,false,null)}}else if(mo.isArray(o)){return()=>{t.editor.execCommand(o[0],o[1],o[2])}}else{return o}}createShortcut(e,t,o,n){const s=mo.map(dQ(e,">"),gQ);s[s.length-1]=mo.extend(s[s.length-1],{func:o,scope:n||this.editor});return mo.extend(s[0],{desc:this.editor.translate(t),subpatterns:s.slice(1)})}hasModifier(e){return e.altKey||e.ctrlKey||e.metaKey}isFunctionKey(e){return e.type==="keydown"&&e.keyCode>=112&&e.keyCode<=123}matchShortcut(e,t){if(!t){return false}if(t.ctrl!==e.ctrlKey||t.meta!==e.metaKey){return false}if(t.alt!==e.altKey||t.shift!==e.shiftKey){return false}if(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode){e.preventDefault();return true}return false}executeShortcutAction(e){return e.func?e.func.call(e.scope):null}}const hQ=()=>{const e={};const t={};const o={};const n={};const s={};const r={};const a={};const c={};const i=(e,t)=>(o,n)=>{e[o.toLowerCase()]={...n,type:t}};const l=(e,t)=>n[e.toLowerCase()]=t;return{addButton:i(e,"button"),addGroupToolbarButton:i(e,"grouptoolbarbutton"),addToggleButton:i(e,"togglebutton"),addMenuButton:i(e,"menubutton"),addSplitButton:i(e,"splitbutton"),addMenuItem:i(t,"menuitem"),addNestedMenuItem:i(t,"nestedmenuitem"),addToggleMenuItem:i(t,"togglemenuitem"),addAutocompleter:i(o,"autocompleter"),addContextMenu:i(s,"contextmenu"),addContextToolbar:i(r,"contexttoolbar"),addContextForm:i(r,"contextform"),addSidebar:i(a,"sidebar"),addView:i(c,"views"),addIcon:l,getAll:()=>({buttons:e,menuItems:t,icons:n,popups:o,contextMenus:s,contextToolbars:r,sidebars:a,views:c})}};const yQ=()=>{const e=hQ();return{addAutocompleter:e.addAutocompleter,addButton:e.addButton,addContextForm:e.addContextForm,addContextMenu:e.addContextMenu,addContextToolbar:e.addContextToolbar,addIcon:e.addIcon,addMenuButton:e.addMenuButton,addMenuItem:e.addMenuItem,addNestedMenuItem:e.addNestedMenuItem,addSidebar:e.addSidebar,addSplitButton:e.addSplitButton,addToggleButton:e.addToggleButton,addGroupToolbarButton:e.addGroupToolbarButton,addToggleMenuItem:e.addToggleMenuItem,addView:e.addView,getAll:e.getAll}};const bQ=zi.DOM;const vQ=mo.extend,kQ=mo.each;class wQ{constructor(e,t,o){this.plugins={};this.contentCSS=[];this.contentStyles=[];this.loadedCSS={};this.isNotDirty=false;this.composing=false;this.destroyed=false;this.hasHiddenInput=false;this.iframeElement=null;this.initialized=false;this.readonly=false;this.removed=false;this.startContent="";this._pendingNativeEvents=[];this._skinLoaded=false;this._editableRoot=true;this.editorManager=o;this.documentBaseUrl=o.documentBaseURL;vQ(this,KJ);const n=this;this.id=e;this.hidden=false;const s=zX(o.defaultOptions,t);this.options=nQ(n,s,t);kf(n);const r=this.options.get;if(r("deprecation_warnings")){YN(t,s)}const a=r("suffix");if(a){o.suffix=a}this.suffix=o.suffix;const c=r("base_url");if(c){o._setBaseUrl(c)}this.baseUri=o.baseURI;const i=qf(n);if(i){Ni.ScriptLoader._setReferrerPolicy(i);zi.DOM.styleSheetLoader._setReferrerPolicy(i)}const l=Sm(n);if(T(l)){zi.DOM.styleSheetLoader._setContentCssCors(l)}$i.languageLoad=r("language_load");$i.baseURL=o.baseURL;this.setDirty(false);this.documentBaseURI=new OO(xf(n),{base_uri:this.baseUri});this.baseURI=this.baseUri;this.inline=hm(n);this.hasVisual=Om(n);this.shortcuts=new pQ(this);this.editorCommands=new kJ(this);yJ(this);const d=r("cache_suffix");if(d){to.cacheSuffix=d.replace(/^[\?\&]+/,"")}this.ui={registry:yQ(),styleSheetLoader:undefined,show:D,hide:D,setEnabled:D,isEnabled:Z};this.mode=iQ(n);o.dispatch("SetupEditor",{editor:this});const u=Mm(n);if(E(u)){u.call(n,n)}}render(){cX(this)}focus(e){this.execCommand("mceFocus",false,e)}hasFocus(){return qk(this)}translate(e){return Wi.translate(e)}getParam(e,t,o){const n=this.options;if(!n.isRegistered(e)){if(T(o)){n.register(e,{processor:o,default:t})}else{n.register(e,{processor:Z,default:t})}}return!n.isSet(e)&&!S(t)?t:n.get(e)}hasPlugin(e,t){const o=Y(zm(this),e);if(o){return t?wM.get(e)!==undefined:true}else{return false}}nodeChanged(e){this._nodeChangeDispatcher.nodeChanged(e)}addCommand(e,t,o){this.editorCommands.addCommand(e,t,o)}addQueryStateHandler(e,t,o){this.editorCommands.addQueryStateHandler(e,t,o)}addQueryValueHandler(e,t,o){this.editorCommands.addQueryValueHandler(e,t,o)}addShortcut(e,t,o,n){this.shortcuts.add(e,t,o,n)}execCommand(e,t,o,n){return this.editorCommands.execCommand(e,t,o,n)}queryCommandState(e){return this.editorCommands.queryCommandState(e)}queryCommandValue(e){return this.editorCommands.queryCommandValue(e)}queryCommandSupported(e){return this.editorCommands.queryCommandSupported(e)}show(){const e=this;if(e.hidden){e.hidden=false;if(e.inline){e.getBody().contentEditable="true"}else{bQ.show(e.getContainer());bQ.hide(e.id)}e.load();e.dispatch("show")}}hide(){const e=this;if(!e.hidden){e.save();if(e.inline){e.getBody().contentEditable="false";if(e===e.editorManager.focusedEditor){e.editorManager.focusedEditor=null}}else{bQ.hide(e.getContainer());bQ.setStyle(e.id,"display",e.orgDisplay)}e.hidden=true;e.dispatch("hide")}}isHidden(){return this.hidden}setProgressState(e,t){this.dispatch("ProgressState",{state:e,time:t})}load(e={}){const t=this;const o=t.getElement();if(t.removed){return""}if(o){const n={...e,load:true};const s=Mr(o)?o.value:o.innerHTML;const r=t.setContent(s,n);if(!n.no_events){t.dispatch("LoadContent",{...n,element:o})}return r}else{return""}}save(e={}){const t=this;let o=t.getElement();if(!o||!t.initialized||t.removed){return""}const n={...e,save:true,element:o};let s=t.getContent(n);const r={...n,content:s};if(!r.no_events){t.dispatch("SaveContent",r)}if(r.format==="raw"){t.dispatch("RawSaveContent",r)}s=r.content;if(!Mr(o)){if(e.is_removing||!t.inline){o.innerHTML=s}const n=bQ.getParent(t.id,"form");if(n){kQ(n.elements,(e=>{if(e.name===t.id){e.value=s;return false}else{return true}}))}}else{o.value=s}r.element=n.element=o=null;if(r.set_dirty!==false){t.setDirty(false)}return s}setContent(e,t){return LN(this,e,t)}getContent(e){return MN(this,e)}insertContent(e,t){if(t){e=vQ({content:e},t)}this.execCommand("mceInsertContent",false,e)}resetContent(e){if(e===undefined){LN(this,this.startContent,{format:"raw"})}else{LN(this,e)}this.undoManager.reset();this.setDirty(false);this.nodeChanged()}isDirty(){return!this.isNotDirty}setDirty(e){const t=!this.isNotDirty;this.isNotDirty=!e;if(e&&e!==t){this.dispatch("dirty")}}getContainer(){const e=this;if(!e.container){e.container=e.editorContainer||bQ.get(e.id+"_parent")}return e.container}getContentAreaContainer(){return this.contentAreaContainer}getElement(){if(!this.targetElm){this.targetElm=bQ.get(this.id)}return this.targetElm}getWin(){const e=this;if(!e.contentWindow){const t=e.iframeElement;if(t){e.contentWindow=t.contentWindow}}return e.contentWindow}getDoc(){const e=this;if(!e.contentDocument){const t=e.getWin();if(t){e.contentDocument=t.document}}return e.contentDocument}getBody(){var e,t;const o=this.getDoc();return(t=(e=this.bodyElement)!==null&&e!==void 0?e:o===null||o===void 0?void 0:o.body)!==null&&t!==void 0?t:null}convertURL(e,t,o){const n=this,s=n.options.get;const r=Bm(n);if(E(r)){return r.call(n,e,o,true,t)}if(!s("convert_urls")||o==="link"||k(o)&&o.nodeName==="LINK"||e.indexOf("file:")===0||e.length===0){return e}const a=new OO(e);if(a.protocol!=="http"&&a.protocol!=="https"&&a.protocol!==""){return e}if(s("relative_urls")){return n.documentBaseURI.toRelative(e)}e=n.documentBaseURI.toAbsolute(e,s("remove_script_host"));return e}addVisual(e){TX(this,e)}setEditableRoot(e){iX(this,e)}hasEditableRoot(){return lX(this)}remove(){oM(this)}destroy(e){nM(this,e)}uploadImages(){return this.editorUpload.uploadImages()}_scanForImages(){return this.editorUpload.scanForImages()}}const _Q=zi.DOM;const xQ=mo.each;let CQ=false;let SQ;let zQ=[];const TQ=e=>{const t=e.type;xQ(NQ.get(),(o=>{switch(t){case"scroll":o.dispatch("ScrollWindow",e);break;case"resize":o.dispatch("ResizeWindow",e);break}}))};const EQ=e=>{if(e!==CQ){const t=zi.DOM;if(e){t.bind(window,"resize",TQ);t.bind(window,"scroll",TQ)}else{t.unbind(window,"resize",TQ);t.unbind(window,"scroll",TQ)}CQ=e}};const OQ=e=>{const t=zQ;zQ=oe(zQ,(t=>e!==t));if(NQ.activeEditor===e){NQ.activeEditor=zQ.length>0?zQ[0]:null}if(NQ.focusedEditor===e){NQ.focusedEditor=null}return t.length!==zQ.length};const AQ=e=>{if(e&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode){OQ(e);e.unbindAllNativeEvents();e.destroy(true);e.removed=true}};const DQ=document.compatMode!=="CSS1Compat";const NQ={...jJ,baseURI:null,baseURL:null,defaultOptions:{},documentBaseURL:null,suffix:null,majorVersion:"7",minorVersion:"2.0",releaseDate:"2024-06-19",i18n:Wi,activeEditor:null,focusedEditor:null,setup(){const e=this;let t="";let o="";let n=OO.getDocumentBaseUrl(document.location);if(/^[^:]+:\/\/\/?[^\/]+\//.test(n)){n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(n)){n+="/"}}const s=window.tinymce||window.tinyMCEPreInit;if(s){t=s.base||s.baseURL;o=s.suffix}else{const e=document.getElementsByTagName("script");for(let n=0;n<e.length;n++){const s=e[n].src||"";if(s===""){continue}const r=s.substring(s.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(s)){if(r.indexOf(".min")!==-1){o=".min"}t=s.substring(0,s.lastIndexOf("/"));break}}if(!t&&document.currentScript){const e=document.currentScript.src;if(e.indexOf(".min")!==-1){o=".min"}t=e.substring(0,e.lastIndexOf("/"))}}e.baseURL=new OO(n).toAbsolute(t);e.documentBaseURL=n;e.baseURI=new OO(e.baseURL);e.suffix=o;Bk(e)},overrideDefaults(e){const t=e.base_url;if(t){this._setBaseUrl(t)}const o=e.suffix;if(o){this.suffix=o}this.defaultOptions=e;const n=e.plugin_base_urls;if(n!==undefined){xe(n,((e,t)=>{$i.PluginManager.urls[t]=e}))}},init(e){const t=this;let o;const n=mo.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track "+"colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu"," ");const s=(e,t)=>e.inline&&t.tagName.toLowerCase()in n;const r=e=>{let t=e.id;if(!t){t=Ne(e,"name").filter((e=>!_Q.get(e))).getOrThunk(_Q.uniqueId);e.setAttribute("id",t)}return t};const a=o=>{const n=e[o];if(!n){return}return n.apply(t,[])};const c=e=>{if(to.browser.isIE()||to.browser.isEdge()){LM("TinyMCE does not support the browser you are using. For a list of supported"+" browsers please see: https://www.tiny.cloud/docs/tinymce/7/support/#supportedwebbrowsers");return[]}else if(DQ){LM("Failed to initialize the editor as the document is not in standards mode. "+"TinyMCE requires standards mode.");return[]}else if(v(e.selector)){return _Q.select(e.selector)}else if(T(e.target)){return[e.target]}else{return[]}};let i=e=>{o=e};const l=()=>{let o=0;const n=[];let d;const u=(e,s,r)=>{const a=new wQ(e,s,t);n.push(a);a.on("init",(()=>{if(++o===d.length){i(n)}}));a.targetElm=a.targetElm||r;a.render()};_Q.unbind(window,"ready",l);a("onpageload");d=ke(c(e));mo.each(d,(e=>{AQ(t.get(e.id))}));d=mo.grep(d,(e=>!t.get(e.id)));if(d.length===0){i([])}else{xQ(d,(t=>{if(s(e,t)){LM("Could not initialize inline editor on invalid inline target element",t)}else{u(r(t),e,t)}}))}};_Q.bind(window,"ready",l);return new Promise((e=>{if(o){e(o)}else{i=t=>{e(t)}}}))},get(e){if(arguments.length===0){return zQ.slice(0)}else if(v(e)){return ae(zQ,(t=>t.id===e)).getOr(null)}else if(O(e)){return zQ[e]?zQ[e]:null}else{return null}},add(e){const t=this;const o=t.get(e.id);if(o===e){return e}if(o===null){zQ.push(e)}EQ(true);t.activeEditor=e;t.dispatch("AddEditor",{editor:e});if(!SQ){SQ=e=>{const o=t.dispatch("BeforeUnload");if(o.returnValue){e.preventDefault();e.returnValue=o.returnValue;return o.returnValue}};window.addEventListener("beforeunload",SQ)}return e},createEditor(e,t){return this.add(new wQ(e,t,this))},remove(e){const t=this;let o;if(!e){for(let e=zQ.length-1;e>=0;e--){t.remove(zQ[e])}return}if(v(e)){xQ(_Q.select(e),(e=>{o=t.get(e.id);if(o){t.remove(o)}}));return}o=e;if(x(t.get(o.id))){return null}if(OQ(o)){t.dispatch("RemoveEditor",{editor:o})}if(zQ.length===0){window.removeEventListener("beforeunload",SQ)}o.remove();EQ(zQ.length>0);return o},execCommand(e,t,o){var n;const s=this;const r=k(o)?(n=o.id)!==null&&n!==void 0?n:o.index:o;switch(e){case"mceAddEditor":{if(!s.get(r)){const e=o.options;new wQ(r,e,s).render()}return true}case"mceRemoveEditor":{const e=s.get(r);if(e){e.remove()}return true}case"mceToggleEditor":{const e=s.get(r);if(!e){s.execCommand("mceAddEditor",false,o);return true}if(e.isHidden()){e.show()}else{e.hide()}return true}}if(s.activeEditor){return s.activeEditor.execCommand(e,t,o)}return false},triggerSave:()=>{xQ(zQ,(e=>{e.save()}))},addI18n:(e,t)=>{Wi.add(e,t)},translate:e=>Wi.translate(e),setActive(e){const t=this.activeEditor;if(this.activeEditor!==e){if(t){t.dispatch("deactivate",{relatedTarget:e})}e.dispatch("activate",{relatedTarget:t})}this.activeEditor=e},_setBaseUrl(e){this.baseURL=new OO(this.documentBaseURL).toAbsolute(e.replace(/\/+$/,""));this.baseURI=new OO(this.baseURL)}};NQ.setup();const MQ=()=>{const e=ua();const t=e=>({items:e,types:we(e),getType:t=>Ne(e,t).getOrUndefined()});const o=t=>{e.set(t)};const n=()=>e.get().getOrUndefined();const s=e.clear;return{FakeClipboardItem:t,write:o,read:n,clear:s}};const RQ=MQ();const BQ=Math.min,LQ=Math.max,HQ=Math.round;const IQ=(e,t,o)=>{let n=t.x;let s=t.y;const r=e.w;const a=e.h;const c=t.w;const i=t.h;const l=(o||"").split("");if(l[0]==="b"){s+=i}if(l[1]==="r"){n+=c}if(l[0]==="c"){s+=HQ(i/2)}if(l[1]==="c"){n+=HQ(c/2)}if(l[3]==="b"){s-=a}if(l[4]==="r"){n-=r}if(l[3]==="c"){s-=HQ(a/2)}if(l[4]==="c"){n-=HQ(r/2)}return ZQ(n,s,r,a)};const PQ=(e,t,o,n)=>{for(let s=0;s<n.length;s++){const r=IQ(e,t,n[s]);if(r.x>=o.x&&r.x+r.w<=o.w+o.x&&r.y>=o.y&&r.y+r.h<=o.h+o.y){return n[s]}}return null};const FQ=(e,t,o)=>ZQ(e.x-t,e.y-o,e.w+t*2,e.h+o*2);const VQ=(e,t)=>{const o=LQ(e.x,t.x);const n=LQ(e.y,t.y);const s=BQ(e.x+e.w,t.x+t.w);const r=BQ(e.y+e.h,t.y+t.h);if(s-o<0||r-n<0){return null}return ZQ(o,n,s-o,r-n)};const jQ=(e,t,o)=>{let n=e.x;let s=e.y;let r=e.x+e.w;let a=e.y+e.h;const c=t.x+t.w;const i=t.y+t.h;const l=LQ(0,t.x-n);const d=LQ(0,t.y-s);const u=LQ(0,r-c);const f=LQ(0,a-i);n+=l;s+=d;if(o){r+=l;a+=d;n-=u;s-=f}r-=u;a-=f;return ZQ(n,s,r-n,a-s)};const ZQ=(e,t,o,n)=>({x:e,y:t,w:o,h:n});const UQ=e=>ZQ(e.left,e.top,e.width,e.height);const qQ={inflate:FQ,relativePosition:IQ,findBestRelativePosition:PQ,intersect:VQ,clamp:jQ,create:ZQ,fromClientRect:UQ};const WQ=(e,t,o=1e3)=>{let n=false;let s=null;const r=e=>(...t)=>{if(!n){n=true;if(s!==null){clearTimeout(s);s=null}e.apply(null,t)}};const a=r(e);const c=r(t);const i=(...e)=>{if(!n&&s===null){s=setTimeout((()=>c.apply(null,e)),o)}};return{start:i,resolve:a,reject:c}};const $Q=()=>{const e={};const t={};const o={};const n=(o,n)=>{const s=`Script at URL "${n}" failed to load`;const r=`Script at URL "${n}" did not call \`tinymce.Resource.add('${o}', data)\` within 1 second`;if(e[o]!==undefined){return e[o]}else{const a=new Promise(((e,a)=>{const c=WQ(e,a);t[o]=c.resolve;Ni.ScriptLoader.loadScript(n).then((()=>c.start(r)),(()=>c.reject(s)))}));e[o]=a;return a}};const s=(n,s)=>{if(t[n]!==undefined){t[n](s);delete t[n]}e[n]=Promise.resolve(s);o[n]=s};const r=e=>e in o;const a=t=>{delete e[t];delete o[t]};const c=e=>o[e];return{load:n,add:s,has:r,get:c,unload:a}};const GQ=$Q();const KQ=()=>(()=>{let e={};let t=[];const o={getItem:t=>{const o=e[t];return o?o:null},setItem:(o,n)=>{t.push(o);e[o]=String(n)},key:e=>t[e],removeItem:o=>{t=t.filter((e=>e===o));delete e[o]},clear:()=>{t=[];e={}},length:0};Object.defineProperty(o,"length",{get:()=>t.length,configurable:false,enumerable:false});return o})();let YQ;try{const e="__storage_test__";YQ=window.localStorage;YQ.setItem(e,e);YQ.removeItem(e)}catch(e){YQ=KQ()}var XQ=YQ;const JQ={geom:{Rect:qQ},util:{Delay:wk,Tools:mo,VK:pb,URI:OO,EventDispatcher:FJ,Observable:jJ,I18n:Wi,LocalStorage:XQ,ImageUploader:eR},dom:{EventUtils:gi,TreeWalker:ir,TextSeeker:_l,DOMUtils:zi,ScriptLoader:Ni,RangeUtils:wv,Serializer:AN,StyleSheetLoader:Va,ControlSelection:_b,BookmarkManager:Vy,Selection:hN,Event:gi.Event},html:{Styles:ei,Entities:pc,Node:lw,Schema:Vc,DomParser:KO,Writer:Dw,Serializer:Nw},Env:to,AddOnManager:$i,Annotator:Fy,Formatter:bR,UndoManager:_R,EditorCommands:kJ,WindowManager:CM,NotificationManager:kM,EditorObservable:KJ,Shortcuts:pQ,Editor:wQ,FocusManager:bk,EditorManager:NQ,DOM:zi.DOM,ScriptLoader:Ni.ScriptLoader,PluginManager:wM,ThemeManager:_M,ModelManager:aM,IconManager:rM,Resource:GQ,FakeClipboard:RQ,trim:mo.trim,isArray:mo.isArray,is:mo.is,toArray:mo.toArray,makeMap:mo.makeMap,each:mo.each,map:mo.map,grep:mo.grep,inArray:mo.inArray,extend:mo.extend,walk:mo.walk,resolve:mo.resolve,explode:mo.explode,_addCacheSuffix:mo._addCacheSuffix};const QQ=mo.extend(NQ,JQ);const e1=t=>{if(true){try{e.exports=t}catch(e){}}};const t1=e=>{window.tinymce=e;window.tinyMCE=e};t1(QQ);e1(QQ)})()},()=>{tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2c0-1.1.9-2 2-2Zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5c0-.6-.4-1-1-1a1 1 0 0 0-1 1v5c0 .6-.4 1-1 1a1 1 0 0 1-1-1V9H4a1 1 0 1 1 0-2h16c.6 0 1 .4 1 1s-.4 1-1 1Z" fill-rule="nonzero"/></svg>',"accordion-toggle":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 15c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1h-6a1 1 0 0 1-1-1Z"/><path opacity=".2" fill-rule="evenodd" clip-rule="evenodd" d="M4 19c0-.6.4-1 1-1h6c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1-1-1Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.3 7.3a1 1 0 0 1 1.4 0L16 9.6l2.3-2.3a1 1 0 1 1 1.4 1.4L16 12.4l-3.7-3.7a1 1 0 0 1 0-1.4ZM4.3 11.7a1 1 0 0 1 0-1.4L6.6 8 4.3 5.7a1 1 0 0 1 1.4-1.4L9.4 8l-3.7 3.7a1 1 0 0 1-1.4 0Z"/></svg>',accordion:'<svg width="24" height="24"><rect x="12" y="7" width="10" height="2" rx="1"/><rect x="12" y="11" width="10" height="2" rx="1"/><rect x="12" y="15" width="6" height="2" rx="1"/><path fill-rule="evenodd" clip-rule="evenodd" d="M2.3 7.3a1 1 0 0 1 1.4 0L6 9.6l2.3-2.3a1 1 0 0 1 1.4 1.4L6 12.4 2.3 8.7a1 1 0 0 1 0-1.4Z"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 0 0-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 1 0-1.4-1.4L12 13.6 5.7 7.3Z"/></svg>',"action-prev":'<svg width="24" height="24"><path fill-rule="nonzero" d="M18.3 15.7a1 1 0 0 0 1.4-1.4L12 6.6l-7.7 7.7a1 1 0 0 0 1.4 1.4L12 9.4l6.3 6.3Z"/></svg>',addtag:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 5a2 2 0 0 1 1.6.8L21 12l-4.4 6.2a2 2 0 0 1-1.6.8h-3v-2h3l3.5-5L15 7H5v3H3V7c0-1.1.9-2 2-2h10Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M6 12a1 1 0 0 0-1 1v2H3a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2H7v-2c0-.6-.4-1-1-1Z"/></svg>',"ai-prompt":'<svg width="24" height="24"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.7a1 1 0 0 0-1.4 0l-9.9 10a1 1 0 0 0 0 1.3l2.1 2.1c.4.4 1 .4 1.4 0l10-9.9c.3-.3.3-1 0-1.4l-2.2-2Zm1.4 2.8-2-2-3 2.7 2.2 2.2 2.8-2.9Z"/><path d="m18.5 7.3-.7-1.5-1.5-.8 1.5-.7.7-1.5.7 1.5 1.5.7-1.5.8-.7 1.5ZM18.5 16.5l-.7-1.6-1.5-.7 1.5-.7.7-1.6.7 1.6 1.5.7-1.5.7-.7 1.6ZM9.7 7.3 9 5.8 7.5 5 9 4.3l.7-1.5.7 1.5L12 5l-1.5.8-.7 1.5Z"/></g><defs><clipPath id="a"><path d="M0 0h24v24H0z"/></clipPath></defs></svg>',ai:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H5Zm6.8 11.5.5 1.2a68.3 68.3 0 0 0 .7 1.1l.4.1c.3 0 .5 0 .7-.3.2-.1.3-.3.3-.6l-.3-1-2.6-6.2a20.4 20.4 0 0 0-.5-1.3l-.5-.4-.7-.2c-.2 0-.5 0-.6.2-.2 0-.4.2-.5.4l-.3.6-.3.7L5.7 15l-.2.6-.1.4c0 .3 0 .5.3.7l.6.2c.3 0 .5 0 .7-.2l.4-1 .5-1.2h3.9ZM9.8 9l1.5 4h-3l1.5-4Zm5.6-.9v7.6c0 .4 0 .7.2 1l.7.2c.3 0 .6 0 .8-.3l.2-.9V8.1c0-.4 0-.7-.2-.9a1 1 0 0 0-.8-.3c-.2 0-.5.1-.7.3l-.2 1Z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-justify":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-left":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5 13 7H5a1 1 0 1 1 0-2h9.2Zm4 0h.8a1 1 0 0 1 0 2h-2l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h6.8Zm4 0H19a1 1 0 0 1 0 2h-4.4l1.2-2Zm-6.4 4-1.2 2H5a1 1 0 0 1 0-2h4.4Zm4 0H19a1 1 0 0 1 0 2h-6.8l1.2-2ZM7 17l-1.2 2H5a1 1 0 0 1 0-2h2Zm4 0h8a1 1 0 0 1 0 2H9.8l1.2-2Zm5.2-13.5 1.3.7-9.7 16.3-1.3-.7 9.7-16.3Z" fill-rule="evenodd"/></svg>',"align-right":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2Zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="m5.6 13 12 6a1 1 0 0 0 1.4-1V6a1 1 0 0 0-1.4-.9l-12 6a1 1 0 0 0 0 1.8Z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="m18.5 13-12 6A1 1 0 0 1 5 18V6a1 1 0 0 1 1.4-.9l12 6a1 1 0 0 1 0 1.8Z" fill-rule="evenodd"/></svg>',bold:'<svg width="24" height="24"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"/></svg>',bookmark:'<svg width="24" height="24"><path d="M6 4v17l6-4 6 4V4c0-.6-.4-1-1-1H7a1 1 0 0 0-1 1Z" fill-rule="nonzero"/></svg>',"border-style":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="2" x="3" y="6" rx="1"/><rect width="2.8" height="2" x="3" y="16" rx="1"/><rect width="2.8" height="2" x="6.8" y="16" rx="1"/><rect width="2.8" height="2" x="10.6" y="16" rx="1"/><rect width="2.8" height="2" x="14.4" y="16" rx="1"/><rect width="2.8" height="2" x="18.2" y="16" rx="1"/><rect width="8" height="2" x="3" y="11" rx="1"/><rect width="8" height="2" x="13" y="11" rx="1"/></g></svg>',"border-width":'<svg width="24" height="24"><g fill-rule="evenodd"><rect width="18" height="5" x="3" y="5" rx="1"/><rect width="18" height="3.5" x="3" y="11.5" rx="1"/><rect width="18" height="2" x="3" y="17" rx="1"/></g></svg>',brightness:'<svg width="24" height="24"><path d="M12 17c.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3Zm0-10a1 1 0 0 1-.7-.3A1 1 0 0 1 11 6V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v1c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3Zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-1a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1ZM7 12c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H5a1 1 0 0 1-.7-.3A1 1 0 0 1 4 12c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1c.3 0 .5.1.7.3.2.2.3.4.3.7Zm10 3.5.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 0 1-.8.3 1 1 0 0 1-.6-.3l-.8-.7a1 1 0 0 1-.3-.8c0-.2.1-.5.3-.7a1 1 0 0 1 1.4 0Zm-10-7-.7-.8a1 1 0 0 1-.3-.6c0-.3.1-.6.3-.8.2-.2.5-.3.8-.3.2 0 .5.1.7.3l.7.7c.2.2.3.5.3.8 0 .2-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.8-.3Zm10 0a1 1 0 0 1-.8.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.6.3-.8l.8-.7c.1-.2.4-.3.6-.3.3 0 .6.1.8.3.2.2.3.5.3.8 0 .2-.1.5-.3.7l-.7.7Zm-10 7c.2-.2.5-.3.8-.3.2 0 .5.1.7.3a1 1 0 0 1 0 1.4l-.8.8a1 1 0 0 1-.6.3 1 1 0 0 1-.8-.3 1 1 0 0 1-.3-.8c0-.2.1-.5.3-.6l.7-.8ZM12 8a4 4 0 0 1 3.7 2.4 4 4 0 0 1 0 3.2A4 4 0 0 1 12 16a4 4 0 0 1-3.7-2.4 4 4 0 0 1 0-3.2A4 4 0 0 1 12 8Zm0 6.5c.7 0 1.3-.2 1.8-.7.5-.5.7-1.1.7-1.8s-.2-1.3-.7-1.8c-.5-.5-1.1-.7-1.8-.7s-1.3.2-1.8.7c-.5.5-.7 1.1-.7 1.8s.2 1.3.7 1.8c.5.5 1.1.7 1.8.7Z" fill-rule="evenodd"/></svg>',browse:'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9.4-2.3 2.3a1 1 0 1 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 0 1-1.4 1.4L13 13.4V20a1 1 0 0 1-2 0v-6.6Z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 1 1 0 14.8 7.4 7.4 0 0 1 0-14.8ZM12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm0 8L14.8 8l1 1.1-2.7 2.8 2.7 2.7-1.1 1.1-2.7-2.7-2.7 2.7-1-1.1 2.6-2.7-2.7-2.7 1-1.1 2.8 2.7Z" fill-rule="nonzero"/></svg>',"cell-background-color":'<svg width="24" height="24"><path d="m15.7 2 1.6 1.6-2.7 2.6 5.9 5.8c.7.7.7 1.7 0 2.4l-6.3 6.1a1.7 1.7 0 0 1-2.4 0l-6.3-6.1c-.7-.7-.7-1.7 0-2.4L15.7 2ZM18 12l-4.5-4L9 12h9ZM4 16s2 2.4 2 3.8C6 21 5.1 22 4 22s-2-1-2-2.2C2 18.4 4 16 4 16Z"/></svg>',"cell-border-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M5 13v5h2v2H5a2 2 0 0 1-2-2v-5h2zm8-7V4h6a2 2 0 0 1 2 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1.1-.1.1.1.2.3.2.2.2.2c.4.6.8 1.2.8 1.7 0 .8-.7 1.5-1.5 1.5S9 21.3 9 20.5c0-.5.4-1.1.8-1.7l.2-.2.2-.2.2-.3z"/><path d="m13 11-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="m18.4 8 1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 0 1-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8Zm1.6 7-3-3-3 3h6Z"/></g></svg>',"change-case":'<svg width="24" height="24"><path d="M18.4 18.2v-.6c-.5.8-1.3 1.2-2.4 1.2-2.2 0-3.3-1.6-3.3-4.8 0-3.1 1-4.7 3.3-4.7 1.1 0 1.8.3 2.4 1.1v-.6c0-.5.4-.8.8-.8s.8.3.8.8v8.4c0 .5-.4.8-.8.8a.8.8 0 0 1-.8-.8zm-2-7.4c-1.3 0-1.8.9-1.8 3.2 0 2.4.5 3.3 1.7 3.3 1.3 0 1.8-.9 1.8-3.2 0-2.4-.5-3.3-1.7-3.3zM10 15.7H5.5l-.8 2.6a1 1 0 0 1-1 .7h-.2a.7.7 0 0 1-.7-1l4-12a1 1 0 0 1 2 0l4 12a.7.7 0 0 1-.8 1h-.2a1 1 0 0 1-1-.7l-.8-2.6zm-.3-1.5-2-6.5-1.9 6.5h3.9z" fill-rule="evenodd"/></svg>',"character-count":'<svg width="24" height="24"><path d="M4 11.5h16v1H4v-1Zm4.8-6.8V10H7.7V5.8h-1v-1h2ZM11 8.3V9h2v1h-3V7.7l2-1v-.9h-2v-1h3v2.4l-2 1Zm6.3-3.4V10h-3.1V9h2.1V8h-2.1V6.8h2.1v-1h-2.1v-1h3.1ZM5.8 16.4c0-.5.2-.8.5-1 .2-.2.6-.3 1.2-.3l.8.1c.2 0 .4.2.5.3l.4.4v2.8l.2.3H8.2V18.7l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 0 1-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 0 0-.5-.1 1 1 0 0 0-.4 0l-.3.4h-1Zm2.3.8h-.2l-.2.1-.4.1a1 1 0 0 0-.4.2l-.2.2.1.3.5.1h.4l.4-.4v-.6Zm2-3.4h1.2v1.7l.5-.3h.5c.5 0 .9.1 1.2.5.3.4.5.8.5 1.4 0 .6-.2 1.1-.5 1.5-.3.4-.7.6-1.3.6l-.6-.1-.4-.4v.4h-1.1v-5.4Zm1.1 3.3c0 .3 0 .6.2.8a.7.7 0 0 0 1.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 0 0-.6-.3l-.6.3-.2.8Zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 0 0-.5-.2c-.3 0-.5.1-.6.3l-.2.9c0 .3 0 .6.2.8.1.2.3.3.6.3.2 0 .4 0 .5-.2l.2-.4h1.1c0 .5-.3.8-.6 1.1a2 2 0 0 1-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 0 1-.5-1.4c0-.6.1-1.1.5-1.5.3-.4.8-.5 1.4-.5.5 0 1 0 1.2.3.4.3.5.7.5 1.2h-1v-.1Z" fill-rule="evenodd"/></svg>',"checklist-rtl":'<svg width="24" height="24"><path d="M5 17h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2zm14.2 11c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L18 8c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8z" fill-rule="evenodd"/></svg>',checklist:'<svg width="24" height="24"><path d="M11 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2h-8a1 1 0 0 1 0-2ZM7.2 16c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 20c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 14c-.2.3-.7.4-1 0l-1.3-1.3a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Zm0-6c.2-.4.6-.5.9-.3.3.2.4.6.2 1L6 8c-.2.3-.7.4-1 0L3.8 6.9a.7.7 0 0 1 0-1c.3-.2.7-.2 1 0l.7.9 1.7-2.8Z" fill-rule="evenodd"/></svg>',checkmark:'<svg width="24" height="24"><path d="M18.2 5.4a1 1 0 0 1 1.6 1.2l-8 12a1 1 0 0 1-1.5.1l-5-5a1 1 0 1 1 1.4-1.4l4.1 4.1 7.4-11Z" fill-rule="nonzero"/></svg>',"chevron-down":'<svg width="10" height="10"><path d="M8.7 2.2c.3-.3.8-.3 1 0 .4.4.4.9 0 1.2L5.7 7.8c-.3.3-.9.3-1.2 0L.2 3.4a.8.8 0 0 1 0-1.2c.3-.3.8-.3 1.1 0L5 6l3.7-3.8Z" fill-rule="nonzero"/></svg>',"chevron-left":'<svg width="10" height="10"><path d="M7.8 1.3 4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 0 1 0-1.2L6.6.2C7 0 7.4 0 7.8.2c.3.3.3.8 0 1.1Z" fill-rule="nonzero"/></svg>',"chevron-right":'<svg width="10" height="10"><path d="M2.2 1.3a.8.8 0 0 1 0-1c.4-.4.9-.4 1.2 0l4.4 4.1c.3.4.3.9 0 1.2L3.4 9.8c-.3.3-.8.3-1.2 0a.8.8 0 0 1 0-1.1L6 5 2.2 1.3Z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8 5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 0 1 0-1.2l4.1-4.4c.3-.3.9-.3 1.2 0l4.2 4.4c.3.3.3.9 0 1.2-.3.3-.8.3-1.1 0Z" fill-rule="nonzero"/></svg>',close:'<svg width="24" height="24"><path d="M17.3 8.2 13.4 12l3.9 3.8a1 1 0 0 1-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 0 1-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 0 1 1.5-1.5l3.8 3.9 3.8-3.9a1 1 0 0 1 1.5 1.5Z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 0 1-.8 2 2.8 2.8 0 0 1 .8 2v1.7c0 .3.1.6.4.8.2.3.5.4.8.4.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.7 0-1.4-.3-2-.8-.5-.6-.8-1.3-.8-2V15c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4v-.8c0-.2.2-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V9.3c0-.7.3-1.4.8-2 .6-.5 1.3-.8 2-.8.3 0 .4.2.4.4v.8c0 .2-.1.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8V11Zm9.8 0V9.3c0-.3-.1-.6-.4-.8-.2-.3-.5-.4-.8-.4a.4.4 0 0 1-.4-.4V7c0-.2.1-.4.4-.4.7 0 1.4.3 2 .8.5.6.8 1.3.8 2V11c0 .3.1.6.4.8.2.3.5.4.8.4.2 0 .4.2.4.4v.8c0 .2-.2.4-.4.4-.3 0-.6.1-.8.4-.3.2-.4.5-.4.8v1.7c0 .7-.3 1.4-.8 2-.6.5-1.3.8-2 .8a.4.4 0 0 1-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 0 1 .8-2 2.8 2.8 0 0 1-.8-2Zm-3.3-.4c0 .4-.1.8-.5 1.1-.3.3-.7.5-1.1.5-.4 0-.8-.2-1.1-.5-.4-.3-.5-.7-.5-1.1 0-.5.1-.9.5-1.2.3-.3.7-.4 1.1-.4.4 0 .8.1 1.1.4.4.3.5.7.5 1.2ZM12 13c.4 0 .8.1 1.1.5.4.3.5.7.5 1.1 0 1-.1 1.6-.5 2a3 3 0 0 1-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 0 1-.5-.5V17a3 3 0 0 0 1-.2l.6-.6c-.6 0-1-.2-1.3-.5-.2-.3-.3-.7-.3-1 0-.5.1-1 .5-1.2.3-.4.7-.5 1.1-.5Z" fill-rule="evenodd"/></svg>',"color-levels":'<svg width="24" height="24"><path d="M17.5 11.4A9 9 0 0 1 18 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 0 1-3.7 3 5.7 5.7 0 0 1-3.2 0A5.9 5.9 0 0 1 7.6 18a6.2 6.2 0 0 1-1.4-2.6 6.7 6.7 0 0 1 0-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 0 1 2.3-4A20 20 0 0 1 12 4a26.4 26.4 0 0 1 3.2 3.4 18.2 18.2 0 0 1 2.3 4Zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 0 0-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 0 1-1.3 3 5.3 5.3 0 0 1-2.3 1.5 4.9 4.9 0 0 1-2 .1 4.3 4.3 0 0 0 2.4.8 4 4 0 0 0 2-.6 4 4 0 0 0 1.5-1.5Z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 0 0 0 18 1.5 1.5 0 0 0 1.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-8-9-8Zm-5.5 9a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3 3 21" fill-rule="evenodd"/></svg>',"color-swatch":'<svg width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="1" fill-rule="evenodd"/></svg>',"comment-add":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/><path d="M13 10h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 0v-2H9a1 1 0 0 1 0-2h2V8a1 1 0 0 1 2 0v2Z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="m9 19 3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 0 0-1 1v10c0 .6.4 1 1 1h4v2Zm-2 4v-4H5a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3h-6.4L7 23Z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-6 8a6 6 0 0 0 6 6V6a6 6 0 0 0-6 6Z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 0 0-2 2v11h2V5h10V3Zm1 4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7Zm0 12V9h-7v10h7Z" fill-rule="nonzero"/></svg>',crop:'<svg width="24" height="24"><path d="M17 8v7h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v2c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-2H7V9H5a1 1 0 1 1 0-2h2V5c0-.6.4-1 1-1s1 .4 1 1v2h7l3-3 1 1-3 3ZM9 9v5l5-5H9Zm1 6h5v-5l-5 5Z" fill-rule="evenodd"/></svg>',"cut-column":'<svg width="24" height="24"><path fill-rule="evenodd" d="M7.2 4.5c.9 0 1.6.4 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7Zm12.3 5h-3v10h3v-10ZM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8Zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4ZM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8A2.5 2.5 0 0 0 7.7 6l-.4-.1H7Z"/></svg>',"cut-row":'<svg width="24" height="24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14ZM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18V18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5Zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3ZM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4Zm8.5-7.1h-11v2h11v-2Z"/></svg>',cut:'<svg width="24" height="24"><path d="M18 15c.6.7 1 1.4 1 2.3 0 .8-.2 1.5-.7 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2 0-.9.4-1.6 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 0 1 0 2c0 .4-.3.7-.5 1l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8Zm-8.5 2.2.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2 1.6 1.6 0 0 0-.8 0 2.6 2.6 0 0 0-.8.3 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3 2.8 2.8 0 0 0 1-1Zm2.5-2.8c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4s-.7.1-1 .4c-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4Zm5.4 4 .2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3 1.5 1.5 0 0 0-.8 0 1 1 0 0 0-.4.2 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4l.3.4.3.4a2.8 2.8 0 0 0 .8.5l.4.1h.7l.5-.2Z" fill-rule="evenodd"/></svg>',"document-properties":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',drag:'<svg width="24" height="24"><path d="M13 5h2v2h-2V5Zm0 4h2v2h-2V9ZM9 9h2v2H9V9Zm4 4h2v2h-2v-2Zm-4 0h2v2H9v-2Zm0 4h2v2H9v-2Zm4 0h2v2h-2v-2ZM9 5h2v2H9V5Z" fill-rule="evenodd"/></svg>',"duplicate-column":'<svg width="24" height="24"><path d="M17 6v16h-7V6h7Zm-2 2h-3v12h3V8Zm-2-6v2H8v15H6V2h7Z"/></svg>',"duplicate-row":'<svg width="24" height="24"><path d="M22 11v7H6v-7h16Zm-2 2H8v3h12v-3Zm-1-6v2H4v5H2V7h17Z"/></svg>',duplicate:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M16 3v2H6v11H4V5c0-1.1.9-2 2-2h10Zm3 8h-2V9h-7v10h9a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V9c0-1.2.9-2 2-2h7a2 2 0 0 1 2 2v2Z"/><path d="M17 14h1a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1h-1a1 1 0 0 1 0-2h1v-1a1 1 0 0 1 2 0v1Z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="m19.8 8.8-9.4 9.4c-.2.2-.5.4-.9.4l-5.4 1.2 1.2-5.4.5-.8 9.4-9.4c.7-.7 1.8-.7 2.5 0l2.1 2.1c.7.7.7 1.8 0 2.5Zm-2-.2 1-.9v-.3l-2.2-2.2a.3.3 0 0 0-.3 0l-1 1L18 8.5Zm-1 1-2.5-2.4-6 6 2.5 2.5 6-6Zm-7 7.1-2.6-2.4-.3.3-.1.2-.7 3 3.1-.6h.1l.4-.5Z"/></svg>',"edit-image":'<svg width="24" height="24"><path d="M18 16h2V7a2 2 0 0 0-2-2H7v2h11v9ZM6 17h15a1 1 0 0 1 0 2h-1v1a1 1 0 0 1-2 0v-1H6a2 2 0 0 1-2-2V7H3a1 1 0 1 1 0-2h1V4a1 1 0 1 1 2 0v13Zm3-5.3 1.3 2 3-4.7 3.7 6H7l2-3.3Z" fill-rule="nonzero"/></svg>',"embed-page":'<svg width="24" height="24"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"/></svg>',embed:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm4.8 2.6 5.6 4a.5.5 0 0 1 0 .8l-5.6 4A.5.5 0 0 1 9 16V8a.5.5 0 0 1 .8-.4Z" fill-rule="nonzero"/></svg>',emoji:'<svg width="24" height="24"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3 18 7v1h-5V5H7v14h9a1 1 0 0 1 2 0c0 1-.8 2-1.9 2H7c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h7.5Z"/><path d="M18.1 12c.5 0 .9.4.9 1 0 .5-.3 1-.8 1h-7.3c-.5 0-.9-.4-.9-1 0-.5.3-1 .8-1h7.3Z"/><path d="M16.4 9.2a1 1 0 0 1 1.4.2l2.4 3.6-2.4 3.6a1 1 0 0 1-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 0 1 .2-1.4Z"/></g></svg>',fill:'<svg width="24" height="26"><path d="m16.6 12-9-9-1.4 1.4 2.4 2.4-5.2 5.1c-.5.6-.5 1.6 0 2.2L9 19.6a1.5 1.5 0 0 0 2.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2ZM5.2 13 10 8.2l4.8 4.8H5.2ZM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.3-2-3.5-2-3.5Z" fill-rule="nonzero"/></svg>',"flip-horizontally":'<svg width="24" height="24"><path d="M14 19h2v-2h-2v2Zm4-8h2V9h-2v2ZM4 7v10c0 1.1.9 2 2 2h3v-2H6V7h3V5H6a2 2 0 0 0-2 2Zm14-2v2h2a2 2 0 0 0-2-2Zm-7 16h2V3h-2v18Zm7-6h2v-2h-2v2Zm-4-8h2V5h-2v2Zm4 12a2 2 0 0 0 2-2h-2v2Z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5Zm8 4v2h2v-2h-2Zm4-14H7a2 2 0 0 0-2 2v3h2V6h10v3h2V6a2 2 0 0 0-2-2Zm2 14h-2v2a2 2 0 0 0 2-2ZM3 11v2h18v-2H3Zm6 7v2h2v-2H9Zm8-4v2h2v-2h-2ZM5 18c0 1.1.9 2 2 2v-2H5Z" fill-rule="nonzero"/></svg>',footnote:'<svg width="24" height="24"><path d="M19 13c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h14Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19 4v6h-1V5h-1.5V4h2.6Z"/><path d="M12 18c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 1 1 0-2h7ZM14 8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 0 1 0-2h9Z"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 0 0-1 1v4c0 .6.5 1 1 1h12c.6 0 1-.4 1-1V7h1v4H9v9c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7h8V5h-3Z" fill-rule="nonzero"/></svg>',format:'<svg width="24" height="24"><path fill-rule="evenodd" d="M17 5a1 1 0 0 1 0 2h-4v11a1 1 0 0 1-2 0V7H7a1 1 0 1 1 0-2h10Z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="m15.3 10-1.2-1.3 2.9-3h-2.3a.9.9 0 1 1 0-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 1 1-1.8 0V7l-2.9 3Zm0 4 3 3v-2.3a.9.9 0 1 1 1.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 1 1 0-1.8H17l-3-2.9 1.3-1.2ZM10 15.4l-2.9 3h2.3a.9.9 0 1 1 0 1.7H5a.9.9 0 0 1-.9-.9v-4.4a.9.9 0 1 1 1.8 0V17l2.9-3 1.2 1.3ZM8.7 10 5.7 7v2.3a.9.9 0 0 1-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 0 1 0 1.8H7l3 2.9-1.3 1.2Z" fill-rule="nonzero"/></svg>',gallery:'<svg width="24" height="24"><path fill-rule="nonzero" d="m5 15.7 2.3-2.2c.3-.3.7-.3 1 0L11 16l5.1-5c.3-.4.8-.4 1 0l2 1.9V8H5v7.7ZM5 18V19h3l1.8-1.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V7c0-.6.4-1 1-1Zm6 7a2 2 0 1 1 0-4 2 2 0 0 1 0 4ZM4.5 4h15a.5.5 0 1 1 0 1h-15a.5.5 0 0 1 0-1Zm2-2h11a.5.5 0 1 1 0 1h-11a.5.5 0 0 1 0-1Z"/></svg>',gamma:'<svg width="24" height="24"><path d="M4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm1 2v14h14V5H5Zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 0 0-.4-.8l-.1-.2H8v-1l.3-.1.3-.1h.7a1 1 0 0 1 .6.5l.1.3a8.5 8.5 0 0 1 .3.6l1.9 4.6 2-5.2a1 1 0 0 1 1-.6.5.5 0 0 1 .5.6L13 14v2.8a.7.7 0 0 1-1.4 0Z" fill-rule="nonzero"/></svg>',help:'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M12 5.5a6.5 6.5 0 0 0-6 9 6.3 6.3 0 0 0 1.4 2l1 1a6.3 6.3 0 0 0 3.6 1 6.5 6.5 0 0 0 6-9 6.3 6.3 0 0 0-1.4-2l-1-1a6.3 6.3 0 0 0-3.6-1ZM12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Z"/><path d="M9.6 9.7a.7.7 0 0 1-.7-.8c0-1.1 1.5-1.8 3.2-1.8 1.8 0 3.2.8 3.2 2.4 0 1.4-.4 2.1-1.5 2.8-.2 0-.3.1-.3.2a2 2 0 0 0-.8.8.8.8 0 0 1-1.4-.6c.3-.7.8-1 1.3-1.5l.4-.2c.7-.4.8-.6.8-1.5 0-.5-.6-.9-1.7-.9-.5 0-1 .1-1.4.3-.2 0-.3.1-.3.2v-.2c0 .4-.4.8-.8.8Z" fill-rule="nonzero"/><circle cx="12" cy="16" r="1"/></g></svg>',"highlight-bg-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-highlight-bg-color__color" d="M3 18h18v3H3z"/><path fill-rule="nonzero" d="M7.7 16.7H3l3.3-3.3-.7-.8L10.2 8l4 4.1-4 4.2c-.2.2-.6.2-.8 0l-.6-.7-1.1 1.1zm5-7.5L11 7.4l3-2.9a2 2 0 0 1 2.6 0L18 6c.7.7.7 2 0 2.7l-2.9 2.9-1.8-1.8-.5-.6"/></g></svg>',home:'<svg width="24" height="24"><path fill-rule="nonzero" d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>',"horizontal-rule":'<svg width="24" height="24"><path d="M4 11h16v2H4z" fill-rule="evenodd"/></svg>',"image-options":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="m5 15.7 3.3-3.2c.3-.3.7-.3 1 0L12 15l4.1-4c.3-.4.8-.4 1 0l2 1.9V5H5v10.7ZM5 18V19h3l2.8-2.9-2-2L5 17.9Zm14-3-2.5-2.4-6.4 6.5H19v-4ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill-rule="nonzero"/></svg>',indent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 0 1 5.7 2.3A8 8 0 1 1 12 4Zm-1 3v2h2V7h-2Zm3 10v-1h-1v-5h-3v1h1v4h-1v1h4Z" fill-rule="evenodd"/></svg>',"insert-character":'<svg width="24" height="24"><path d="M15 18h4l1-2v4h-6v-3.3l1.4-1a6 6 0 0 0 1.8-2.9 6.3 6.3 0 0 0-.1-4.1 5.8 5.8 0 0 0-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 0 0-3.9 1.8 6.3 6.3 0 0 0-1.3 6 6.2 6.2 0 0 0 1.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 0 1 4 11c0-1 .2-1.9.6-2.7A7 7 0 0 1 6.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 0 1 5.7 2 7 7 0 0 1 1.7 2.3 6 6 0 0 1 .2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 0 1-3.6 2.5v.5Z" fill-rule="evenodd"/></svg>',"insert-time":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0 2a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 0 0-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1Z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3 16.5 18a5.8 5.8 0 0 1-3.1 1.9 6.1 6.1 0 0 1-5.5-1.6A5.8 5.8 0 0 1 6 14v-.3l.1-1.2A13.9 13.9 0 0 1 7.7 9l-3-3 .7-.8 2.8 2.9 9 8.9 1.5 1.6-.7.6Zm0-5.5v.3l-.1 1.1-.4 1-1.2-1.2a4.3 4.3 0 0 0 .2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 0 0-3-4.2L12 6a26.1 26.1 0 0 0-2.2 2.5l-1-1a20.9 20.9 0 0 1 2.9-3.3L12 4l1 .8a22.2 22.2 0 0 1 4 5.4c.6 1.2 1 2.4 1 3.6Z" fill-rule="evenodd"/></svg>',italic:'<svg width="24" height="24"><path d="m16.7 4.7-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"/></svg>',language:'<svg width="24" height="24"><path d="M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18Zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 0 0 3.2-2.1l-.2-.2a6 6 0 0 0-1-.6Zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 0 1-2-2.8Zm3.6-.8c-.8 0-1.6.1-2.2.3.5 1 1.2 1.9 2.1 2.7Zm1.5 0v3c.9-.8 1.6-1.7 2.1-2.7-.6-.2-1.4-.3-2.1-.3Zm-6-2.7H4.5c.2 1 .5 2.1 1 3h.3l1.3-1a10 10 0 0 1-.3-2Zm12.7 0h-2.3c0 .7-.1 1.4-.3 2l1.6 1.1c.5-1 .9-2 1-3.1Zm-3.8 0h-3V14c1 0 2 .1 2.7.4.2-.5.3-1 .3-1.6Zm-4.4 0h-3l.3 1.6c.8-.3 1.7-.4 2.7-.4v-1.3Zm-5.5-5c-.7 1-1.1 2.2-1.3 3.5h2.3c0-1 .2-1.8.5-2.6l-1.5-1Zm2.9 1.4v.1c-.2.6-.4 1.3-.4 2h3V9.4c-1 0-1.8-.1-2.6-.3Zm6.6 0h-.1l-2.4.3v1.8h3l-.5-2.1Zm3-1.4-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 0 0-1.3-3.5Zm-9 0 2 .2V5.5a9 9 0 0 0-2 2.2Zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 0 0-2-2.3Zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 0 1 1.9-2.5Zm4.4 0 .1.1a10 10 0 0 1 1.8 2.4l1.1-.7a7.5 7.5 0 0 0-3-1.8Z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="m15 9-8 8H4v-3l8-8 3 3Zm1-1-3-3 1-1h1c-.2 0 0 0 0 0l2 2s0 .2 0 0v1l-1 1ZM4 18h16v2H4v-2Z" fill-rule="evenodd"/></svg>',link:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"/></svg>',"list-bull-circle":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M11 16a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 26a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6ZM11 36a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 1a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z" fill-rule="nonzero"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-default":'<svg width="48" height="48"><g fill-rule="evenodd"><circle cx="11" cy="14" r="3"/><circle cx="11" cy="24" r="3"/><circle cx="11" cy="34" r="3"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-bull-square":'<svg width="48" height="48"><g fill-rule="evenodd"><path d="M8 11h6v6H8zM8 21h6v6H8zM8 31h6v6H8z"/><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/></g></svg>',"list-num-default-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 17v-4.8h-.1l-1.5 1v-1.1l1.6-1.1h1.2v6zM33.3 17.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm1.7 5.7c0-1.2 1-2 2.2-2 1.3 0 2.1.8 2.1 1.8 0 .7-.3 1.2-1.3 2.2l-1.2 1v.2h2.6v1h-4.3v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H35zm-1.7 4.3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7zm3.2 7.3v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H35c0-1.1 1-1.8 2.2-1.8 1.2 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.7.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .6 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7zm-3.3 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7z"/></g></svg>',"list-num-default":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10 17v-4.8l-1.5 1v-1.1l1.6-1h1.2V17h-1.2Zm3.6.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-5 5.7c0-1.2.8-2 2.1-2s2.1.8 2.1 1.8c0 .7-.3 1.2-1.4 2.2l-1.1 1v.2h2.6v1H8.6v-.9l2-1.9c.8-.8 1-1.1 1-1.5 0-.5-.4-.8-1-.8-.5 0-.9.3-.9.9H8.5Zm6.3 4.3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM10 34.4v-1h.7c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7s-1 .3-1 .8H8.6c0-1.1 1-1.8 2.2-1.8 1.3 0 2.1.6 2.1 1.6 0 .7-.4 1.2-1 1.3v.1c.8.1 1.3.7 1.3 1.4 0 1-1 1.9-2.4 1.9-1.3 0-2.2-.8-2.3-2h1.2c0 .6.5 1 1.1 1 .7 0 1-.4 1-1 0-.5-.3-.8-1-.8h-.7Zm4.7 2.7c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Z"/></g></svg>',"list-num-lower-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M36.5 16c-.9 0-1.5-.5-1.5-1.3s.6-1.3 1.8-1.4h1v-.4c0-.4-.2-.6-.7-.6-.4 0-.7.1-.8.4h-1.1c0-.8.8-1.4 2-1.4S39 12 39 13V16h-1.2v-.6c-.3.4-.8.7-1.4.7Zm.4-.8c.6 0 1-.4 1-.9V14h-1c-.5.1-.7.3-.7.6 0 .4.3.6.7.6ZM33.1 16.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7ZM37.7 26c-.7 0-1.2-.2-1.5-.7v.7H35v-6.3h1.2v2.5c.3-.5.8-.9 1.5-.9 1.1 0 1.8 1 1.8 2.4 0 1.5-.7 2.4-1.8 2.4Zm-.5-3.6c-.6 0-1 .5-1 1.3s.4 1.4 1 1.4c.7 0 1-.6 1-1.4 0-.8-.3-1.3-1-1.3ZM33.2 26.1c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7zm6 7h-1c-.1-.5-.4-.8-1-.8s-1 .5-1 1.4c0 1 .4 1.4 1 1.4.5 0 .9-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7zm-6.1 3c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7z"/></g></svg>',"list-num-lower-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.3 15.2c.5 0 1-.4 1-.9V14h-1c-.5.1-.8.3-.8.6 0 .4.3.6.8.6Zm-.4.9c-1 0-1.5-.6-1.5-1.4 0-.8.6-1.3 1.7-1.4h1.1v-.4c0-.4-.2-.6-.7-.6-.5 0-.8.1-.9.4h-1c0-.8.8-1.4 2-1.4 1.1 0 1.8.6 1.8 1.6V16h-1.1v-.6h-.1c-.2.4-.7.7-1.3.7Zm4.6 0c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-3.2 10c-.6 0-1.2-.3-1.4-.8v.7H8.5v-6.3H10v2.5c.3-.5.8-.9 1.4-.9 1.2 0 1.9 1 1.9 2.4 0 1.5-.7 2.4-1.9 2.4Zm-.4-3.7c-.7 0-1 .5-1 1.3s.3 1.4 1 1.4c.6 0 1-.6 1-1.4 0-.8-.4-1.3-1-1.3Zm4 3.7c-.5 0-.7-.3-.7-.7 0-.4.2-.7.7-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-2.2 7h-1.2c0-.5-.4-.8-.9-.8-.6 0-1 .5-1 1.4 0 1 .4 1.4 1 1.4.5 0 .8-.2 1-.7h1c0 1-.8 1.7-2 1.7-1.4 0-2.2-.9-2.2-2.4s.8-2.4 2.2-2.4c1.2 0 2 .7 2 1.7Zm1.8 3c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M37.4 16c-1.2 0-2-.8-2-2.3 0-1.5.8-2.4 2-2.4.6 0 1 .4 1.3 1v-.9H40v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1-.7h-.2c-.2.4-.7.8-1.3.8Zm.3-1c.6 0 1-.5 1-1.3s-.4-1.3-1-1.3-1 .5-1 1.3.4 1.4 1 1.4ZM33.3 16.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM36 21.9c0-1.5.8-2.3 2.1-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.9 1.3.9.3 1.3.8 1.3 1.7 0 1.2-.7 1.9-1.8 1.9-.6 0-1.1-.3-1.4-.8v2.2H36V22Zm1.8 1.2v-1h.3c.5 0 .9-.2.9-.7 0-.5-.3-.8-.9-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1 1.3s1-.4 1-1-.4-1-1.2-1h-.3ZM33.3 26.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7ZM37.1 34.6 34.8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.2.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1ZM33.3 36.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-greek":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M10.5 15c.7 0 1-.5 1-1.3s-.3-1.3-1-1.3c-.5 0-.9.5-.9 1.3s.4 1.4 1 1.4Zm-.3 1c-1.1 0-1.8-.8-1.8-2.3 0-1.5.7-2.4 1.8-2.4.7 0 1.1.4 1.3 1h.1v-.9h1.2v3.2c0 .4.1.5.4.5h.2v.9h-.6c-.6 0-1-.2-1.1-.7h-.1c-.2.4-.7.8-1.4.8Zm5 .1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.7-.7.5 0 .8.3.8.7 0 .4-.3.7-.8.7Zm-4.9 7v-1h.3c.6 0 1-.2 1-.7 0-.5-.4-.8-1-.8-.5 0-.8.3-.8 1v2.2c0 .8.4 1.3 1.1 1.3.6 0 1-.4 1-1s-.5-1-1.3-1h-.3ZM8.6 22c0-1.5.7-2.3 2-2.3 1.2 0 2 .6 2 1.6 0 .6-.3 1-.8 1.3.8.3 1.3.8 1.3 1.7 0 1.2-.8 1.9-1.9 1.9-.6 0-1.1-.3-1.3-.8v2.2H8.5V22Zm6.2 4.2c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm-4.5 8.5L8 30h1.4l1.7 3.5 1.7-3.5h1.1l-2.2 4.6v.1c.5.8.7 1.4.7 1.8 0 .4-.1.8-.4 1-.2.2-.6.3-1 .3-.9 0-1.3-.4-1.3-1.2 0-.5.2-1 .5-1.7l.1-.2Zm.7 1a2 2 0 0 0-.4.9c0 .3.1.4.4.4.3 0 .4-.1.4-.4 0-.2-.1-.6-.4-1Zm4.5.5c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-lower-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M32.9 16v-1.2h-1.3V16H33Zm0 10v-1.2h-1.3V26H33Zm0 10v-1.2h-1.3V36H33Z"/><path fill-rule="nonzero" d="M36 21h-1.5v5H36zM36 31h-1.5v5H36zM39 21h-1.5v5H39zM39 31h-1.5v5H39zM42 31h-1.5v5H42zM36 11h-1.5v5H36zM36 19h-1.5v1H36zM36 29h-1.5v1H36zM39 19h-1.5v1H39zM39 29h-1.5v1H39zM42 29h-1.5v1H42zM36 9h-1.5v1H36z"/></g></svg>',"list-num-lower-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 16v-1.2h1.3V16H15Zm0 10v-1.2h1.3V26H15Zm0 10v-1.2h1.3V36H15Z"/><path fill-rule="nonzero" d="M12 21h1.5v5H12zM12 31h1.5v5H12zM9 21h1.5v5H9zM9 31h1.5v5H9zM6 31h1.5v5H6zM12 11h1.5v5H12zM12 19h1.5v1H12zM12 29h1.5v1H12zM9 19h1.5v1H9zM9 29h1.5v1H9zM6 29h1.5v1H6zM12 9h1.5v1H12z"/></g></svg>',"list-num-upper-alpha-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="m39.3 17-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3Zm-1.6-4.7-.7 2.3h1.6l-.8-2.3ZM33.4 17c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7Zm4.7 9.9h-2.7v-6H38c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7Zm-1.4-5v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4h1.1c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9h-1.1V26ZM33 27.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm4.9 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm-4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-alpha":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="m12.6 17-.5-1.4h-2L9.5 17H8.3l2-6H12l2 6h-1.3ZM11 12.3l-.7 2.3h1.6l-.8-2.3Zm4.7 4.8c-.4 0-.7-.3-.7-.7 0-.4.3-.7.7-.7.5 0 .7.3.7.7 0 .4-.2.7-.7.7ZM11.4 27H8.7v-6h2.6c1.2 0 1.9.6 1.9 1.5 0 .6-.5 1.2-1 1.3.7.1 1.3.7 1.3 1.5 0 1-.8 1.7-2 1.7ZM10 22v1.5h1c.6 0 1-.3 1-.8 0-.4-.4-.7-1-.7h-1Zm0 4H11c.7 0 1.1-.3 1.1-.8 0-.6-.4-.9-1.1-.9H10V26Zm5.4 1.1c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Zm-4.1 10c-1.8 0-2.8-1.1-2.8-3.1s1-3.1 2.8-3.1c1.4 0 2.5.9 2.6 2.2h-1.3c0-.7-.6-1.1-1.3-1.1-1 0-1.6.7-1.6 2s.6 2 1.6 2c.7 0 1.2-.4 1.4-1h1.2c-.1 1.3-1.2 2.2-2.6 2.2Zm4.5 0c-.5 0-.8-.3-.8-.7 0-.4.3-.7.8-.7.4 0 .7.3.7.7 0 .4-.3.7-.7.7Z"/></g></svg>',"list-num-upper-roman-rtl":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M8 12h22v4H8zM8 22h22v4H8zM8 32h22v4H8z"/><path d="M31.6 17v-1.2H33V17h-1.3Zm0 10v-1.2H33V27h-1.3Zm0 10v-1.2H33V37h-1.3Z"/><path fill-rule="nonzero" d="M34.5 20H36v7h-1.5zM34.5 30H36v7h-1.5zM37.5 20H39v7h-1.5zM37.5 30H39v7h-1.5zM40.5 30H42v7h-1.5zM34.5 10H36v7h-1.5z"/></g></svg>',"list-num-upper-roman":'<svg width="48" height="48"><g fill-rule="evenodd"><path opacity=".2" d="M18 12h22v4H18zM18 22h22v4H18zM18 32h22v4H18z"/><path d="M15.1 17v-1.2h1.3V17H15Zm0 10v-1.2h1.3V27H15Zm0 10v-1.2h1.3V37H15Z"/><path fill-rule="nonzero" d="M12 20h1.5v7H12zM12 30h1.5v7H12zM9 20h1.5v7H9zM9 30h1.5v7H9zM6 30h1.5v7H6zM12 10h1.5v7H12z"/></g></svg>',lock:'<svg width="24" height="24"><path d="M16.3 11c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H8V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h.3ZM10 8v3h4V8a1 1 0 0 0-.3-.7A1 1 0 0 0 13 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7Z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 7.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L11 5ZM4.4 16.2 6.2 15l-1.8-1.2a1 1 0 0 1 1.2-1.6l3 2a1 1 0 0 1 0 1.6l-3 2a1 1 0 1 1-1.2-1.6Z" fill-rule="evenodd"/></svg>',"math-equation":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 4.8c.1-.5.5-.8 1-.8h10a1 1 0 1 1 0 2h-9.2L8.3 19.2a1 1 0 0 1-1.7.4l-3.4-4.2a1 1 0 0 1 1.6-1.2l2 2.5L9 4.8Zm9.7 5.5c.4.4.4 1 0 1.4L17 13.5l1.8 1.8a1 1 0 1 1-1.4 1.4L15.5 15l-1.8 1.8a1 1 0 0 1-1.4-1.4l1.8-1.8-1.8-1.8a1 1 0 0 1 1.4-1.4l1.8 1.8 1.8-1.8a1 1 0 0 1 1.4 0Z"/></svg>',minus:'<svg width="24" height="24"><path d="M19 11a1 1 0 0 1 .1 2H5a1 1 0 0 1-.1-2H19Z"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm12 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Zm-6 0a2 2 0 0 0-2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2 2 2 0 0 0-2-2Z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h10a2 2 0 0 0 2-2V7.6L14.4 3ZM17 19H7V5h6v4h4v10Z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="m15 13 2-2v8H5V7h8l-2 2H7v8h8v-4Zm4-8v5.5l-2-2-5.6 5.5H10v-1.4L15.5 7l-2-2H19Z" fill-rule="evenodd"/></svg>',"non-breaking":'<svg width="24" height="24"><path d="M11 11H8a1 1 0 1 1 0-2h3V6c0-.6.4-1 1-1s1 .4 1 1v3h3c.6 0 1 .4 1 1s-.4 1-1 1h-3v3c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-3Zm10 4v5H3v-5c0-.6.4-1 1-1s1 .4 1 1v3h14v-3c0-.6.4-1 1-1s1 .4 1 1Z" fill-rule="evenodd"/></svg>',notice:'<svg width="24" height="24"><path d="M15.5 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7ZM13 17v-2h-2v2h2Zm0-4V7h-2v6h2Z" fill-rule="evenodd" clip-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 0 1 0-2Zm0-6h8a1 1 0 0 1 0 2H6a1 1 0 1 1 0-2Zm13-1v3.5a.5.5 0 1 1-1 0V5h-.5a.5.5 0 1 1 0-1H19Zm-1 8.8.2.2h1.3a.5.5 0 1 1 0 1h-1.6a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2h-1.3a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3Zm2 4.2v2c0 .6-.4 1-1 1h-1.5a.5.5 0 0 1 0-1h1.2a.3.3 0 1 0 0-.6h-1.3a.4.4 0 1 1 0-.8h1.3a.3.3 0 0 0 0-.6h-1.2a.5.5 0 1 1 0-1H19c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',"ordered-list":'<svg width="24" height="24"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0-.2-.2H4.5a.5.5 0 0 1-.5-.5c0-.3.2-.5.5-.5h1.6c.5 0 .9.4.9 1v.1c0 .4-.3.8-.6 1l-1.2.4-.2.3ZM7 17v2c0 .6-.4 1-1 1H4.5a.5.5 0 0 1 0-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 1 1 0-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 1 1 0-1H6c.6 0 1 .4 1 1Z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4 1 13l6.4 6.5 6.5-6.5-6.5-6.5ZM3.7 13l3.6-3.7L11 13l-3.7 3.7-3.6-3.7ZM12 6l2.8 2.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0L9.2 5.7a.8.8 0 0 1 0-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 1 1-4.3 16.9l1.5-1.5A7 7 0 1 0 13 6h-1Z" fill-rule="nonzero"/></svg>',outdent:'<svg width="24" height="24"><path d="M7 5h12c.6 0 1 .4 1 1s-.4 1-1 1H7a1 1 0 1 1 0-2Zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 0 1 0-2Zm-5 4h12a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2Zm1.6-3.8a1 1 0 0 1-1.2 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 0 1 1.2 1.6L6.8 12l1.8 1.2Z" fill-rule="evenodd"/></svg>',"page-break":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M5 11c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 0 1 0-2Zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2ZM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1ZM6 22a1 1 0 0 1-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 0 1-1-1v-5H7v5c0 .6-.4 1-1 1Z"/></g></svg>',paragraph:'<svg width="24" height="24"><path fill-rule="evenodd" d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm8 7v12h-6V8h6Zm-1.5 1.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm-2 7v12H4V8h6ZM8.5 9.5h-3v9h3v-9ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 11v5H8v-5h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0 1 12 1Zm10 7v5H8V8h14Zm-1.5 1.5h-11v2h11v-2ZM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Zm0 9h6v2h-.5l-.5-1h-1v4h.8v1h-3.6v-1h.8v-4h-1l-.5 1H12v-2Z" fill-rule="nonzero"/></svg>',paste:'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h3V9h9ZM9 20H6a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0 1 12 1a3 3 0 0 1 2.8 2H18a2 2 0 0 1 2 2v4h1v12H9v-1Zm1.5-9.5v9h9v-9h-9ZM12 3a1 1 0 0 0-1 1c0 .5.4 1 1 1s1-.5 1-1-.4-1-1-1Z" fill-rule="nonzero"/></svg>',"permanent-pen":'<svg width="24" height="24"><path d="M10.5 17.5 8 20H3v-3l3.5-3.5a2 2 0 0 1 0-3L14 3l1 1-7.3 7.3a1 1 0 0 0 0 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 0 1-2.8 0l-.1-.1Z" fill-rule="nonzero"/></svg>',plus:'<svg width="24" height="24"><path d="M12 4c.5 0 1 .4 1 .9V11h6a1 1 0 0 1 .1 2H13v6a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H11V5c0-.6.4-1 1-1Z"/></svg>',preferences:'<svg width="24" height="24"><path d="m20.1 13.5-1.9.2a5.8 5.8 0 0 1-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 0 1-1.4 0l-1.5-1.2a6.2 6.2 0 0 1-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 0 1-1-.9l-.2-1.9a5.8 5.8 0 0 1-1.5-.6l-1.5 1.2a1 1 0 0 1-1.4 0l-.7-.7a1 1 0 0 1 0-1.4l1.2-1.5a6.2 6.2 0 0 1-.6-1.5l-1.9-.2a1 1 0 0 1-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 0 1 .6-1.5L5.2 7.3a1 1 0 0 1 0-1.4l.7-.7a1 1 0 0 1 1.4 0l1.5 1.2a6.2 6.2 0 0 1 1.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 0 1 1.5.6l1.5-1.2a1 1 0 0 1 1.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 0 1 .6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1ZM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" fill-rule="evenodd"/></svg>',preview:'<svg width="24" height="24"><path d="M3.5 12.5c.5.8 1.1 1.6 1.8 2.3 2 2 4.2 3.2 6.7 3.2s4.7-1.2 6.7-3.2a16.2 16.2 0 0 0 2.1-2.8 15.7 15.7 0 0 0-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 0 0-6.7 3.2A16.2 16.2 0 0 0 3.2 12c0 .2.2.3.3.5Zm-2.4-1 .7-1.2L4 7.8C6.2 5.4 8.9 4 12 4c3 0 5.8 1.4 8.1 3.8a18.2 18.2 0 0 1 2.8 3.7v1l-.7 1.2-2.1 2.5c-2.3 2.4-5 3.8-8.1 3.8-3 0-5.8-1.4-8.1-3.8a18.2 18.2 0 0 1-2.8-3.7 1 1 0 0 1 0-1Zm12-3.3a2 2 0 1 0 2.7 2.6 4 4 0 1 1-2.6-2.6Z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 0 0-3 3v6h2v3h14v-3h2v-6a3 3 0 0 0-3-3Zm-1 10H7v-4h10v4Zm.5-5c-.8 0-1.5-.7-1.5-1.5s.7-1.5 1.5-1.5 1.5.7 1.5 1.5-.7 1.5-1.5 1.5Zm.5-8H6v2h12V5Z" fill-rule="nonzero"/></svg>',quote:'<svg width="24" height="24"><path d="M7.5 17h.9c.4 0 .7-.2.9-.6L11 13V8c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 0 0-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 0 0 .8 1.3Z" fill-rule="nonzero"/></svg>',redo:'<svg width="24" height="24"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"/></svg>',reload:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="m5 22.1-1.2-4.7v-.2a1 1 0 0 1 1-1l5 .4a1 1 0 1 1-.2 2l-2.2-.2a7.8 7.8 0 0 0 8.4.2 7.5 7.5 0 0 0 3.5-6.4 1 1 0 1 1 2 0 9.5 9.5 0 0 1-4.5 8 9.9 9.9 0 0 1-10.2 0l.4 1.4a1 1 0 1 1-2 .5ZM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 0 0-9.5-1 7.5 7.5 0 0 0-3.6 7 1 1 0 0 1-2 0 9.5 9.5 0 0 1 4.5-8.6 10 10 0 0 1 10.9.3l-.3-1a1 1 0 0 1 2-.5l1.1 4.8a1 1 0 0 1-1 1.2l-5-.4a1 1 0 0 1-.9-1Z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 0 1 0 2h-1v9a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V9H5a1 1 0 1 1 0-2h3V6a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1Zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 0 0-1 1v1h4Zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9Zm-7 3a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Zm4 0a1 1 0 0 1 2 0v4a1 1 0 0 1-2 0v-4Z" fill-rule="nonzero"/></svg>',"resize-handle":'<svg width="10" height="10"><g fill-rule="nonzero"><path d="M8.1 1.1A.5.5 0 1 1 9 2l-7 7A.5.5 0 1 1 1 8l7-7ZM8.1 5.1A.5.5 0 1 1 9 6l-3 3A.5.5 0 1 1 5 8l3-3Z"/></g></svg>',resize:'<svg width="24" height="24"><path d="M4 5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h6c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 0 1-.7.3H7.4L18 16.6V13c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3.3 0 .5.1.7.3.2.2.3.4.3.7v6c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-6a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3A1 1 0 0 1 4 11V5Z" fill-rule="evenodd"/></svg>',"restore-draft":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"revision-history":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M17 13c0 .6-.4 1-1 1h-4V8c0-.6.4-1 1-1s1 .4 1 1v4h2c.6 0 1 .4 1 1Z"/><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 0 1 0 2H3a1 1 0 0 1-1-1V5a1 1 0 1 1 2 0v3l2.5-2.4a9.2 9.2 0 0 1 10.8-1.5A9 9 0 0 1 13.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 1 1 1.3-1.5 7.2 7.2 0 0 0 11.6-3.7 7 7 0 0 0-3.5-7.7A7.2 7.2 0 0 0 8 7L4.7 10Z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 0 1 2 0v6c0 .6-.4 1-1 1h-6a1 1 0 0 1 0-2h4.3L16 7A7.2 7.2 0 0 0 7.7 6a7 7 0 0 0 3 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 0 1 1.4 1.5A9.2 9.2 0 0 1 2.2 14c-.9-3.9 1-8 4.5-9.9 3.5-1.9 8-1.3 10.8 1.5L20 8Z" fill-rule="nonzero"/></svg>',rtl:'<svg width="24" height="24"><path d="M8 5h8v2h-2v12h-2V7h-2v12H8v-7c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 4.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L8 5Zm12 11.2a1 1 0 1 1-1 1.6l-3-2a1 1 0 0 1 0-1.6l3-2a1 1 0 1 1 1 1.6L18.4 15l1.8 1.2Z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2Zm0 2v2h14v-2H5Zm10 0h2v2h-2v-2Zm-4-6.4L8.7 9.3a1 1 0 1 0-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 1 0-1.4-1.4L13 11.6V4a1 1 0 0 0-2 0v7.6Z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 0 0-2 2Zm0 8h2v-2H3v2Zm4 8h2v-2H7v2ZM3 9h2V7H3v2Zm10-6h-2v2h2V3Zm6 0v2h2a2 2 0 0 0-2-2ZM5 21v-2H3c0 1.1.9 2 2 2Zm-2-4h2v-2H3v2ZM9 3H7v2h2V3Zm2 18h2v-2h-2v2Zm8-8h2v-2h-2v2Zm0 8a2 2 0 0 0 2-2h-2v2Zm0-12h2V7h-2v2Zm0 8h2v-2h-2v2Zm-4 4h2v-2h-2v2Zm0-16h2V3h-2v2ZM7 17h10V7H7v10Zm2-8h6v6H9V9Z" fill-rule="nonzero"/></svg>',selected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm3.6 10.9L7 12.3a.7.7 0 0 0-1 1L9.6 17 18 8.6a.7.7 0 0 0 0-1 .7.7 0 0 0-1 0l-7.4 7.3Z"/></svg>',send:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="m13.3 22 7-18.3-18.3 7L9 15l4.3 7ZM18 6.8l-.7-.7L9.4 14l.7.7L18 6.8Z"/></svg>',settings:'<svg width="24" height="24"><path d="M11 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V8H5a1 1 0 1 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.5V6ZM8 8h2V6H8v2Zm9 2.8v.2h2c.6 0 1 .4 1 1s-.4 1-1 1h-2v.3c0 .2 0 .3-.2.5l-.6.2h-2.4c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V13H5a1 1 0 0 1 0-2h8v-.3c0-.2 0-.3.2-.5l.6-.2h2.4c.3 0 .4 0 .6.2l.2.6ZM14 13h2v-2h-2v2Zm-3 2.8v.2h8c.6 0 1 .4 1 1s-.4 1-1 1h-8v.3c0 .2 0 .3-.2.5l-.6.2H7.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6V18H5a1 1 0 0 1 0-2h2v-.3c0-.2 0-.3.2-.5l.5-.2h2.5c.3 0 .4 0 .6.2l.2.6ZM8 18h2v-2H8v2Z" fill-rule="evenodd"/></svg>',sharpen:'<svg width="24" height="24"><path d="m16 6 4 4-8 9-8-9 4-4h8Zm-4 10.2 5.5-6.2-.1-.1H12v-.3h5.1l-.2-.2H12V9h4.6l-.2-.2H12v-.3h4.1l-.2-.2H12V8h3.6l-.2-.2H8.7L6.5 10l.1.1H12v.3H6.9l.2.2H12v.3H7.3l.2.2H12v.3H7.7l.3.2h4v.3H8.2l.2.2H12v.3H8.6l.3.2H12v.3H9l.3.2H12v.3H9.5l.2.2H12v.3h-2l.2.2H12v.3h-1.6l.2.2H12v.3h-1.1l.2.2h.9v.3h-.7l.2.2h.5v.3h-.3l.3.2Z" fill-rule="evenodd"/></svg>',sourcecode:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M9.8 15.7c.3.3.3.8 0 1-.3.4-.9.4-1.2 0l-4.4-4.1a.8.8 0 0 1 0-1.2l4.4-4.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L6 12l3.8 3.7ZM14.2 15.7c-.3.3-.3.8 0 1 .4.4.9.4 1.2 0l4.4-4.1c.3-.3.3-.9 0-1.2l-4.4-4.2a.8.8 0 0 0-1.2 0c-.3.3-.3.8 0 1.1L18 12l-3.8 3.7Z"/></g></svg>',"spell-check":'<svg width="24" height="24"><path d="M6 8v3H5V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h2c.3 0 .5.1.7.3.2.2.3.4.3.7v6H8V8H6Zm0-3v2h2V5H6Zm13 0h-3v5h3v1h-3a1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1Zm-5 1.5-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 0 1-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5ZM13 10V8h-2v2h2Zm0-3V5h-2v2h2Zm3 5 1 1-6.5 7L7 15.5l1.3-1 2.2 2.2L16 12Z" fill-rule="evenodd"/></svg>',"strike-through":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"/><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="m10.4 10 4.6 4.6-1.4 1.4L9 11.4 4.4 16 3 14.6 7.6 10 3 5.4 4.4 4 9 8.6 13.6 4 15 5.4 10.4 10ZM21 19h-5v-1l1-.8 1.7-1.6c.3-.4.5-.8.5-1.2 0-.3 0-.6-.2-.7-.2-.2-.5-.3-.9-.3a2 2 0 0 0-.8.2l-.7.3-.4-1.1 1-.6 1.2-.2c.8 0 1.4.3 1.8.7.4.4.6.9.6 1.5s-.2 1.1-.5 1.6a8 8 0 0 1-1.3 1.3l-.6.6h2.6V19Z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4 10.4 14l4.6 4.6-1.4 1.4L9 15.4 4.4 20 3 18.6 7.6 14 3 9.4 4.4 8 9 12.6 13.6 8 15 9.4Zm5.9 1.6h-5v-1l1-.8 1.7-1.6c.3-.5.5-.9.5-1.3 0-.3 0-.5-.2-.7-.2-.2-.5-.3-.9-.3l-.8.2-.7.4-.4-1.2c.2-.2.5-.4 1-.5.3-.2.8-.2 1.2-.2.8 0 1.4.2 1.8.6.4.4.6 1 .6 1.6 0 .5-.2 1-.5 1.5l-1.3 1.4-.6.5h2.6V11Z" fill-rule="nonzero"/></svg>',"table-caption":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="12" height="2" x="3" y="4" rx="1"/><path d="M19 8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></g></svg>',"table-cell-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M13 4v9H3V6c0-1.1.9-2 2-2h8Zm-2 2H5v5h6V6Z"/><path fill-rule="nonzero" d="M13 4h6a2 2 0 0 1 2 2v7h-8v-2h6V6h-6V4Z" opacity=".2"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/><path fill-rule="nonzero" d="M3 13v5c0 1.1.9 2 2 2h8v-7h-2v5H5v-5H3Z" opacity=".2"/></g></svg>',"table-cell-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8 0h-6v5h6v-5Zm-8-7H5v5h6V6Z"/></svg>',"table-cell-select-all":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z" opacity=".2"/></g></svg>',"table-cell-select-inner":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v12h14V6Z" opacity=".2"/><path d="M13 6v5h6v2h-6v5h-2v-5H5v-2h6V6h2Z"/></g></svg>',"table-classes":'<svg width="24" height="24"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v7h-8v7H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 9H5v5h6v-5Zm8-7h-6v5h6V6Zm-8 0H5v5h6V6Z"/><path d="m18 20-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3.1.2-2.4 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2Zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5Z"/></svg>',"table-delete-row":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6Zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3Z"/></svg>',"table-delete-table":'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 6v12h14V6H5Z"/><path d="m14.4 8.6 1.1 1-2.4 2.4 2.4 2.4-1.1 1.1-2.4-2.4-2.4 2.4-1-1.1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></g></svg>',"table-insert-column-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15ZM9 13H5v5h4v-5Zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1ZM9 6H5v5h4V6Z"/></svg>',"table-insert-column-before":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15Zm0 9h-4v5h4v-5ZM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1Zm11-2h-4v5h4V6Z"/></svg>',"table-insert-row-above":'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2Zm5 10H5v4h6v-4Zm8 0h-6v4h6v-4ZM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1Z"/></svg>',"table-insert-row-after":'<svg width="24" height="24"><path fill-rule="nonzero" d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1Zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18ZM11 6H5v4h6V6Zm8 0h-6v4h6V6Z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',"table-merge-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15.5V18h3v-2.5H5Zm14-5h-9V18h9v-7.5ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Zm-8 7.5h3v-3H5v3Z"/></svg>',"table-row-numbering-rtl":'<svg width="24" height="24"><path d="M6 4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H6Zm0 12h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 11h8v3H6v-3Zm11 0c.6 0 1 .4 1 1v1a1 1 0 0 1-2 0v-1c0-.6.4-1 1-1ZM6 6h8v3H6V6Zm11 0c.6 0 1 .4 1 1v1a1 1 0 1 1-2 0V7c0-.6.4-1 1-1Z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h12Zm0 12h-8v3h8v-3ZM7 16a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8v-3ZM7 11a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1c0-.6-.4-1-1-1Zm11-5h-8v3h8V6ZM7 6a1 1 0 0 0-1 1v1a1 1 0 1 0 2 0V7c0-.6-.4-1-1-1Z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 15v3h6v-3H5Zm14 0h-6v3h6v-3Zm0-9h-6v3h6V6ZM5 9h6V6H5v3Z"/></svg>',"table-split-cells":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM8 15.5H5V18h3v-2.5Zm11-5h-9V18h9v-7.5Zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2Zm-8.5-1H5v3h3v-3ZM19 6h-4v2.5h4V6ZM8 6H5v2.5h3V6Zm5 0h-3v2.5h3V6Z"/></svg>',"table-top-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',table:'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14ZM5 14v4h6v-4H5Zm14 0h-6v4h6v-4Zm0-6h-6v4h6V8ZM5 12h6V8H5v4Z"/></svg>',"template-add":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M9 12v4H5a2 2 0 0 0-2 2v3h9.3a6 6 0 0 1-.3-2H5v-1h7a6 6 0 0 1 .8-2H11v-5l-.8-.6a3 3 0 1 1 3.6 0l-.8.6v4.7a6 6 0 0 1 2-1.9V12a5 5 0 1 0-6 0Z"/><path d="M18 15c.5 0 1 .4 1 .9V18h2a1 1 0 0 1 .1 2H19v2a1 1 0 0 1-2 .1V20h-2a1 1 0 0 1-.1-2H17v-2c0-.6.4-1 1-1Z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14ZM9 16v-4a5 5 0 1 1 6 0v4h4a2 2 0 0 1 2 2v3H3v-3c0-1.1.9-2 2-2h4Zm4 0v-5l.8-.6a3 3 0 1 0-3.6 0l.8.6v5h2Z" fill-rule="nonzero"/></svg>',"temporary-placeholder":'<svg width="24" height="24"><g fill-rule="evenodd"><path d="M9 7.6V6h2.5V4.5a.5.5 0 1 1 1 0V6H15v1.6a8 8 0 1 1-6 0Zm-2.6 5.3a.5.5 0 0 0 .3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 0 1 3.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 0 0-4.1 3.7Z"/><circle cx="14" cy="4" r="1"/><circle cx="12" cy="2" r="1"/><circle cx="10" cy="4" r="1"/></g></svg>',"text-color":'<svg width="24" height="24"><g fill-rule="evenodd"><path class="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 0 1-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 0 1-.5.6h-.8a.5.5 0 0 1-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4Zm2.6-7.6-.6 2a.5.5 0 0 0 .5.6h1.6a.5.5 0 0 0 .5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4Z"/></g></svg>',"text-size-decrease":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM14 12a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z"/></svg>',"text-size-increase":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M14 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H4a1 1 0 0 1 0-2h10ZM17 9a1 1 0 0 0-1 1v2h-2a1 1 0 1 0 0 2h2v2a1 1 0 1 0 2 0v-2h2a1 1 0 1 0 0-2h-2v-2c0-.6-.4-1-1-1Z"/></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 1 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 1 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 0 1 0-2Zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="m12.7 14.3-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 0 1 0-1l3.1-3A12.4 12.4 0 0 1 6.7 9H8a10.1 10.1 0 0 0 1.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 1 1 0-1.5h4.4v-.7c0-.4.3-.8.7-.8.4 0 .7.4.7.8v.7H15c.4 0 .8.3.8.7 0 .4-.4.8-.8.8h-1.4a12.3 12.3 0 0 1-1 2.4 13.5 13.5 0 0 1-1.7 2.3l1.9 1.8Zm4.3-3 2.7 7.3a.5.5 0 0 1-.4.7 1 1 0 0 1-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 0 1-1 .7.5.5 0 0 1-.4-.7l2.7-7.4a1 1 0 0 1 2 0Zm-2.2 4.4h2.4L16 12.5l-1.2 3.2Z" fill-rule="evenodd"/></svg>',typography:'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M17 5a1 1 0 1 1 0 2h-4v11a1 1 0 1 1-2 0V7H7a1 1 0 0 1 0-2h10Z"/><path d="m17.5 14 .8-1.7 1.7-.8-1.7-.8-.8-1.7-.8 1.7-1.7.8 1.7.8.8 1.7ZM7 14l1 2 2 1-2 1-1 2-1-2-2-1 2-1 1-2Z"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 0 1-.4 1.8l-1 1.4a5.3 5.3 0 0 1-5.5 1 5 5 0 0 1-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 0 1-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 0 0 2.2.8 3.4 3.4 0 0 0 2.2-.8c.3-.2.4-.5.6-.8l.2-.9V6c0-.6.4-1 1-1ZM8 17h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 0 1 0-2Z" fill-rule="evenodd"/></svg>',undo:'<svg width="24" height="24"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2.1-2a2 2 0 1 0-2.7-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2ZM7.6 6.3a.8.8 0 0 1-1 1.1L3.3 4.2a.7.7 0 1 1 1-1l3.2 3.1ZM5.1 8.6a.8.8 0 0 1 0 1.5H3a.8.8 0 0 1 0-1.5H5Zm5-3.5a.8.8 0 0 1-1.5 0V3a.8.8 0 0 1 1.5 0V5Zm6 11.8a.8.8 0 0 1 1-1l3.2 3.2a.8.8 0 0 1-1 1L16 17Zm-2.2 2a.8.8 0 0 1 1.5 0V21a.8.8 0 0 1-1.5 0V19Zm5-3.5a.7.7 0 1 1 0-1.5H21a.8.8 0 0 1 0 1.5H19Z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 0 0-.3-.7A1 1 0 0 0 16 7h-2a1 1 0 0 0-.7.3 1 1 0 0 0-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 0 1-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2Z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1Z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2Zm0 1a1 1 0 0 0-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6Z"/></svg>',upload:'<svg width="24" height="24"><path d="M18 19v-2a1 1 0 0 1 2 0v3c0 .6-.4 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 2 0v2h12ZM11 6.4 8.7 8.7a1 1 0 0 1-1.4-1.4l4-4a1 1 0 0 1 1.4 0l4 4a1 1 0 1 1-1.4 1.4L13 6.4V16a1 1 0 0 1-2 0V6.4Z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 1 1 0-24 12 12 0 0 1 0 24Zm-8.7-5.3a11 11 0 0 0 17.4 0C19.4 16.3 14.6 15 12 15c-2.6 0-7.4 1.3-8.7 3.7ZM12 13c2.2 0 4-2 4-4.5S14.2 4 12 4 8 6 8 8.5 9.8 13 12 13Z" fill-rule="nonzero"/></svg>',"vertical-align":'<svg width="24" height="24"><g fill-rule="nonzero"><rect width="18" height="2" x="3" y="11" rx="1"/><path d="M12 2c.6 0 1 .4 1 1v4l2-1.3a1 1 0 0 1 1.2 1.5l-.1.1-4.1 3-4-3a1 1 0 0 1 1-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8 4 2.9a1 1 0 0 1-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 0 1-1-1v-4l-2 1.3a1 1 0 0 1-1.2-.1l-.1-.1a1 1 0 0 1 .1-1.3l.1-.1 4.1-3z"/></g></svg>',visualblocks:'<svg width="24" height="24"><path d="M9 19v2H7v-2h2Zm-4 0v2a2 2 0 0 1-2-2h2Zm8 0v2h-2v-2h2Zm8 0a2 2 0 0 1-2 2v-2h2Zm-4 0v2h-2v-2h2ZM15 7a1 1 0 0 1 0 2v7a1 1 0 0 1-2 0V9h-1v7a1 1 0 0 1-2 0v-4a2.5 2.5 0 0 1-.2-5H15ZM5 15v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 11v2H3v-2h2Zm16 0v2h-2v-2h2ZM5 7v2H3V7h2Zm16 0v2h-2V7h2ZM5 3v2H3c0-1.1.9-2 2-2Zm8 0v2h-2V3h2Zm6 0a2 2 0 0 1 2 2h-2V3ZM9 3v2H7V3h2Zm8 0v2h-2V3h2Z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 0 1 0 2h-1v11a1 1 0 0 1-2 0V7h-2v11a1 1 0 0 1-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 0 1 6.8 10a3.3 3.3 0 0 1 0-2.8 3.4 3.4 0 0 1 1.8-1.8L10 5Z" fill-rule="evenodd"/></svg>',warning:'<svg width="24" height="24"><path d="M19.8 18.3c.2.5.3.9 0 1.2-.1.3-.5.5-1 .5H5.2c-.5 0-.9-.2-1-.5-.3-.3-.2-.7 0-1.2L11 4.7l.5-.5.5-.2c.2 0 .3 0 .5.2.2 0 .3.3.5.5l6.8 13.6ZM12 18c.3 0 .5-.1.7-.3.2-.2.3-.4.3-.7a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3Zm.7-3 .3-4a1 1 0 0 0-.3-.7 1 1 0 0 0-.7-.3 1 1 0 0 0-.7.3 1 1 0 0 0-.3.7l.3 4h1.4Z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-1-9a1 1 0 0 1 2 0v6a1 1 0 0 1-2 0V8Zm-2 4a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 1 1 1.4-1.4l4.3 4.4a1 1 0 0 1-1.4 1.4l-4.4-4.3Zm-5-.3a6 6 0 1 0 0-12 6 6 0 0 0 0 12Zm-3-5a1 1 0 0 1 0-2h6a1 1 0 0 1 0 2H8Z" fill-rule="nonzero"/></svg>',"export-pdf":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V17h-2V9h-4V5H7v3H5V5c0-1.1.9-2 2-2Z"/><path d="M2.6 15.2v-1.9h1c.6 0 1-.2 1.4-.5.3-.3.5-.7.5-1.2s-.2-.9-.5-1.2a2 2 0 0 0-1.3-.4H1v5.2h1.6Zm.4-3h-.4v-1.1h.5l.6.1.2.5c0 .1 0 .3-.2.4l-.7.1Zm5.7 3 1-.1c.3 0 .5-.2.7-.4l.5-.8c.2-.3.2-.7.2-1.3v-1l-.5-.8c-.2-.3-.4-.5-.7-.6L8.7 10H6.3v5.2h2.4Zm-.4-1.1H8v-3h.4c.5 0 .8.2 1 .4l.2 1.1-.1 1-.3.3-.8.2Zm5.3 1.2V13h2v-1h-2v-1H16V10h-4v5.2h1.6Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15 17a1 1 0 1 0-2 0v3.1l-1.4-1a1 1 0 1 0-1.2 1.7l3.6 2.4 3.6-2.4a1 1 0 0 0-1.2-1.6l-1.4 1V17Z"/></svg>',"export-word":'<svg width="24" height="24"><path d="M9.5 7A1.5 1.5 0 0 1 11 8.4v7.1A1.5 1.5 0 0 1 9.6 17H2.5A1.5 1.5 0 0 1 1 15.6V8.5A1.5 1.5 0 0 1 2.4 7h7.1Zm-1 2.8-1 2.6-1-2.5v-.1a.6.6 0 0 0-1 0l-.1.1-.9 2.5-1-2.5v-.1a.6.6 0 0 0-1 .4v.1l1.5 4v.1a.6.6 0 0 0 1 0v-.1l1-2.5.9 2.5v.1a.6.6 0 0 0 1 0H8l1.6-4v-.2a.6.6 0 0 0-1.1-.4Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V17h-2V9h-4V5H5c0-1.1.9-2 2-2ZM15 17a1 1 0 1 0-2 0v3.1l-1.4-1a1 1 0 1 0-1.2 1.7l3.6 2.4 3.6-2.4a1 1 0 0 0-1.2-1.6l-1.4 1V17Z"/></svg>',"import-word":'<svg width="24" height="24"><path fill-rule="evenodd" clip-rule="evenodd" d="M7 3h7.4L19 7.6V15h-2V9h-4V5H5c0-1.1.9-2 2-2Z"/><path d="M9.5 7A1.5 1.5 0 0 1 11 8.4v7.1A1.5 1.5 0 0 1 9.6 17H2.5A1.5 1.5 0 0 1 1 15.6V8.5A1.5 1.5 0 0 1 2.4 7h7.1Zm-1 2.8-1 2.6-1-2.5v-.1a.6.6 0 0 0-1 0l-.1.1-.9 2.5-1-2.5v-.1a.6.6 0 0 0-1 .4v.1l1.5 4v.1a.6.6 0 0 0 1 0v-.1l1-2.5.9 2.5v.1a.6.6 0 0 0 1 0H8l1.6-4v-.2a.6.6 0 0 0-1.1-.4Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M11.4 18.2a1 1 0 0 0 1.2 1.6l1.4-1V22a1 1 0 1 0 2 0v-3.1l1.4 1a1 1 0 0 0 1.2-1.7L15 15.8l-3.6 2.4Z"/></svg>'}})},(e,t,o)=>{o(4)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.ModelManager");const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=e=>t=>e===t;const a=n("string");const c=n("object");const i=n("array");const l=r(null);const d=s("boolean");const u=r(undefined);const f=e=>e===null||e===undefined;const m=e=>!f(e);const g=s("function");const p=s("number");const h=()=>{};const y=(e,t)=>(...o)=>e(t.apply(null,o));const b=(e,t)=>o=>e(t(o));const v=e=>()=>e;const k=e=>e;const w=(e,t)=>e===t;function _(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const x=e=>t=>!e(t);const C=e=>()=>{throw new Error(e)};const S=e=>e();const z=v(false);const T=v(true);class E{constructor(e,t){this.tag=e;this.value=t}static some(e){return new E(true,e)}static none(){return E.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return E.some(e(this.value))}else{return E.none()}}bind(e){if(this.tag){return e(this.value)}else{return E.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return E.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return m(e)?E.some(e):E.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}E.singletonNone=new E(false);const O=Array.prototype.slice;const A=Array.prototype.indexOf;const D=Array.prototype.push;const N=(e,t)=>A.call(e,t);const M=(e,t)=>N(e,t)>-1;const R=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return true}}return false};const B=(e,t)=>{const o=[];for(let n=0;n<e;n++){o.push(t(n))}return o};const L=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const H=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const I=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}};const P=(e,t)=>{const o=[];const n=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];const a=t(r,s)?o:n;a.push(r)}return{pass:o,fail:n}};const F=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const V=(e,t,o)=>{I(e,((e,n)=>{o=t(o,e,n)}));return o};const j=(e,t,o)=>{H(e,((e,n)=>{o=t(o,e,n)}));return o};const Z=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){return E.some(s)}else if(o(s,n)){break}}return E.none()};const U=(e,t)=>Z(e,t,z);const q=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return E.some(o)}}return E.none()};const W=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!i(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}D.apply(t,e[o])}return t};const $=(e,t)=>W(L(e,t));const G=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(t(n,o)!==true){return false}}return true};const K=e=>{const t=O.call(e,0);t.reverse();return t};const Y=(e,t)=>{const o={};for(let n=0,s=e.length;n<s;n++){const s=e[n];o[String(s)]=t(s,n)}return o};const X=(e,t)=>{const o=O.call(e,0);o.sort(t);return o};const J=(e,t)=>t>=0&&t<e.length?E.some(e[t]):E.none();const Q=e=>J(e,0);const ee=e=>J(e,e.length-1);const te=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return E.none()};const oe=Object.keys;const ne=Object.hasOwnProperty;const se=(e,t)=>{const o=oe(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const re=(e,t)=>ae(e,((e,o)=>({k:o,v:t(e,o)})));const ae=(e,t)=>{const o={};se(e,((e,n)=>{const s=t(e,n);o[s.k]=s.v}));return o};const ce=e=>(t,o)=>{e[o]=t};const ie=(e,t,o,n)=>{se(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const le=(e,t)=>{const o={};ie(e,t,ce(o),h);return o};const de=(e,t)=>{const o=[];se(e,((e,n)=>{o.push(t(e,n))}));return o};const ue=e=>de(e,k);const fe=(e,t)=>me(e,t)?E.from(e[t]):E.none();const me=(e,t)=>ne.call(e,t);const ge=(e,t)=>me(e,t)&&e[t]!==undefined&&e[t]!==null;const pe=e=>{for(const t in e){if(ne.call(e,t)){return false}}return true};const he=typeof window!=="undefined"?window:Function("return this;")();const ye=(e,t)=>{let o=t!==undefined&&t!==null?t:he;for(let t=0;t<e.length&&o!==undefined&&o!==null;++t){o=o[e[t]]}return o};const be=(e,t)=>{const o=e.split(".");return ye(o,t)};const ve=(e,t)=>be(e,t);const ke=(e,t)=>{const o=ve(e,t);if(o===undefined||o===null){throw new Error(e+" not available on this browser")}return o};const we=Object.getPrototypeOf;const _e=e=>ke("HTMLElement",e);const xe=e=>{const t=be("ownerDocument.defaultView",e);return c(e)&&(_e(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(we(e).constructor.name))};const Ce=8;const Se=9;const ze=11;const Te=1;const Ee=3;const Oe=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const Ae=e=>e.dom.nodeType;const De=e=>t=>Ae(t)===e;const Ne=e=>Ae(e)===Ce||Oe(e)==="#comment";const Me=e=>Re(e)&&xe(e.dom);const Re=De(Te);const Be=De(Ee);const Le=De(Se);const He=De(ze);const Ie=e=>t=>Re(t)&&Oe(t)===e;const Pe=(e,t,o)=>{if(a(o)||d(o)||p(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const Fe=(e,t,o)=>{Pe(e.dom,t,o)};const Ve=(e,t)=>{const o=e.dom;se(t,((e,t)=>{Pe(o,t,e)}))};const je=(e,t)=>{se(t,((t,o)=>{t.fold((()=>{qe(e,o)}),(t=>{Pe(e.dom,o,t)}))}))};const Ze=(e,t)=>{const o=e.dom.getAttribute(t);return o===null?undefined:o};const Ue=(e,t)=>E.from(Ze(e,t));const qe=(e,t)=>{e.dom.removeAttribute(t)};const We=e=>j(e.dom.attributes,((e,t)=>{e[t.name]=t.value;return e}),{});const $e=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return Ye(n.childNodes[0])};const Ge=(e,t)=>{const o=t||document;const n=o.createElement(e);return Ye(n)};const Ke=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return Ye(n)};const Ye=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const Xe=(e,t,o)=>E.from(e.dom.elementFromPoint(t,o)).map(Ye);const Je={fromHtml:$e,fromTag:Ge,fromText:Ke,fromDom:Ye,fromPoint:Xe};const Qe=(e,t)=>{const o=e.dom;if(o.nodeType!==Te){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const et=e=>e.nodeType!==Te&&e.nodeType!==Se&&e.nodeType!==ze||e.childElementCount===0;const tt=(e,t)=>{const o=t===undefined?document:t.dom;return et(o)?[]:L(o.querySelectorAll(e),Je.fromDom)};const ot=(e,t)=>{const o=t===undefined?document:t.dom;return et(o)?E.none():E.from(o.querySelector(e)).map(Je.fromDom)};const nt=(e,t)=>e.dom===t.dom;const st=(e,t)=>{const o=e.dom;const n=t.dom;return o===n?false:o.contains(n)};const rt=Qe;const at=e=>Je.fromDom(e.dom.ownerDocument);const ct=e=>Le(e)?e:at(e);const it=e=>Je.fromDom(ct(e).dom.documentElement);const lt=e=>Je.fromDom(ct(e).dom.defaultView);const dt=e=>E.from(e.dom.parentNode).map(Je.fromDom);const ut=e=>E.from(e.dom.parentElement).map(Je.fromDom);const ft=(e,t)=>{const o=g(t)?t:z;let n=e.dom;const s=[];while(n.parentNode!==null&&n.parentNode!==undefined){const e=n.parentNode;const t=Je.fromDom(e);s.push(t);if(o(t)===true){break}else{n=e}}return s};const mt=e=>E.from(e.dom.previousSibling).map(Je.fromDom);const gt=e=>E.from(e.dom.nextSibling).map(Je.fromDom);const pt=e=>L(e.dom.childNodes,Je.fromDom);const ht=(e,t)=>{const o=e.dom.childNodes;return E.from(o[t]).map(Je.fromDom)};const yt=e=>ht(e,0);const bt=(e,t)=>{const o=dt(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))};const vt=(e,t)=>{const o=gt(e);o.fold((()=>{const o=dt(e);o.each((e=>{wt(e,t)}))}),(e=>{bt(e,t)}))};const kt=(e,t)=>{const o=yt(e);o.fold((()=>{wt(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))};const wt=(e,t)=>{e.dom.appendChild(t.dom)};const _t=(e,t,o)=>{ht(e,o).fold((()=>{wt(e,t)}),(e=>{bt(e,t)}))};const xt=(e,t)=>{bt(e,t);wt(t,e)};const Ct=(e,t)=>{H(t,((o,n)=>{const s=n===0?e:t[n-1];vt(s,o)}))};const St=(e,t)=>{H(t,(t=>{wt(e,t)}))};const zt=e=>{e.dom.textContent="";H(pt(e),(e=>{Tt(e)}))};const Tt=e=>{const t=e.dom;if(t.parentNode!==null){t.parentNode.removeChild(t)}};const Et=e=>{const t=pt(e);if(t.length>0){Ct(e,t)}Tt(e)};const Ot=(e,t)=>Je.fromDom(e.dom.cloneNode(t));const At=e=>Ot(e,false);const Dt=e=>Ot(e,true);const Nt=(e,t)=>{const o=Je.fromTag(t);const n=We(e);Ve(o,n);return o};const Mt=(e,t)=>{const o=Nt(e,t);const n=pt(Dt(e));St(o,n);return o};const Rt=(e,t)=>{const o=Nt(e,t);vt(e,o);const n=pt(e);St(o,n);Tt(e);return o};const Bt=["tfoot","thead","tbody","colgroup"];const Lt=e=>M(Bt,e);const Ht=(e,t)=>({rows:e,columns:t});const It=(e,t)=>({row:e,column:t});const Pt=(e,t,o)=>({element:e,rowspan:t,colspan:o});const Ft=(e,t,o,n)=>({element:e,rowspan:t,colspan:o,isNew:n});const Vt=(e,t,o,n,s,r)=>({element:e,rowspan:t,colspan:o,row:n,column:s,isLocked:r});const jt=(e,t,o)=>({element:e,cells:t,section:o});const Zt=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n});const Ut=(e,t,o)=>({element:e,isNew:t,isLocked:o});const qt=(e,t,o,n)=>({element:e,cells:t,section:o,isNew:n});const Wt=(e,t,o,n)=>({startRow:e,startCol:t,finishRow:o,finishCol:n});const $t=(e,t,o)=>({element:e,colspan:t,column:o});const Gt=(e,t)=>({element:e,columns:t});const Kt=e=>He(e)&&m(e.dom.host);const Yt=g(Element.prototype.attachShadow)&&g(Node.prototype.getRootNode);const Xt=v(Yt);const Jt=Yt?e=>Je.fromDom(e.dom.getRootNode()):ct;const Qt=e=>{const t=Jt(e);return Kt(t)?E.some(t):E.none()};const eo=e=>Je.fromDom(e.dom.host);const to=e=>{if(Xt()&&m(e.target)){const t=Je.fromDom(e.target);if(Re(t)&&oo(t)){if(e.composed&&e.composedPath){const t=e.composedPath();if(t){return Q(t)}}}}return E.from(e.target)};const oo=e=>m(e.dom.shadowRoot);const no=e=>{const t=Be(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return Qt(Je.fromDom(t)).fold((()=>o.body.contains(t)),b(no,eo))};const so=()=>ro(Je.fromDom(document));const ro=e=>{const t=e.dom.body;if(t===null||t===undefined){throw new Error("Body is not available yet")}return Je.fromDom(t)};const ao=(e,t,o)=>F(ft(e,o),t);const co=(e,t)=>F(pt(e),t);const io=(e,t)=>{let o=[];H(pt(e),(e=>{if(t(e)){o=o.concat([e])}o=o.concat(io(e,t))}));return o};const lo=(e,t,o)=>ao(e,(e=>Qe(e,t)),o);const uo=(e,t)=>co(e,(e=>Qe(e,t)));const fo=(e,t)=>tt(t,e);var mo=(e,t,o,n,s)=>{if(e(o,n)){return E.some(o)}else if(g(s)&&s(o)){return E.none()}else{return t(o,n,s)}};const go=(e,t,o)=>{let n=e.dom;const s=g(o)?o:z;while(n.parentNode){n=n.parentNode;const e=Je.fromDom(n);if(t(e)){return E.some(e)}else if(s(e)){break}}return E.none()};const po=(e,t,o)=>{const n=(e,t)=>t(e);return mo(n,go,e,t,o)};const ho=(e,t)=>{const o=e=>t(Je.fromDom(e));const n=U(e.dom.childNodes,o);return n.map(Je.fromDom)};const yo=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const s=Je.fromDom(e.childNodes[n]);if(t(s)){return E.some(s)}const r=o(e.childNodes[n]);if(r.isSome()){return r}}return E.none()};return o(e.dom)};const bo=(e,t,o)=>go(e,(e=>Qe(e,t)),o);const vo=(e,t)=>ho(e,(e=>Qe(e,t)));const ko=(e,t)=>ot(t,e);const wo=(e,t,o)=>{const n=(e,t)=>Qe(e,t);return mo(n,bo,e,t,o)};const _o=(e,t,o=w)=>e.exists((e=>o(e,t)));const xo=e=>{const t=[];const o=e=>{t.push(e)};for(let t=0;t<e.length;t++){e[t].each(o)}return t};const Co=(e,t)=>e!==undefined&&e!==null?t(e):E.none();const So=(e,t)=>e?E.some(t):E.none();const zo=(e,t)=>e.substring(t);const To=(e,t,o)=>t===""||e.length>=t.length&&e.substr(o,o+t.length)===t;const Eo=(e,t)=>Ao(e,t)?zo(e,t.length):e;const Oo=(e,t,o=0,n)=>{const s=e.indexOf(t,o);if(s!==-1){return u(n)?true:s+t.length<=n}else{return false}};const Ao=(e,t)=>To(e,t,0);const Do=(e,t)=>To(e,t,e.length-t.length);const No=e=>t=>t.replace(e,"");const Mo=No(/^\s+|\s+$/g);const Ro=e=>e.length>0;const Bo=e=>{const t=parseFloat(e);return isNaN(t)?E.none():E.some(t)};const Lo=e=>e.style!==undefined&&g(e.style.getPropertyValue);const Ho=(e,t,o)=>{if(!a(o)){console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e);throw new Error("CSS value must be a string: "+o)}if(Lo(e)){e.style.setProperty(t,o)}};const Io=(e,t)=>{if(Lo(e)){e.style.removeProperty(t)}};const Po=(e,t,o)=>{const n=e.dom;Ho(n,t,o)};const Fo=(e,t)=>{const o=e.dom;se(t,((e,t)=>{Ho(o,t,e)}))};const Vo=(e,t)=>{const o=e.dom;const n=window.getComputedStyle(o);const s=n.getPropertyValue(t);return s===""&&!no(e)?jo(o,t):s};const jo=(e,t)=>Lo(e)?e.style.getPropertyValue(t):"";const Zo=(e,t)=>{const o=e.dom;const n=jo(o,t);return E.from(n).filter((e=>e.length>0))};const Uo=(e,t)=>{const o=e.dom;Io(o,t);if(_o(Ue(e,"style").map(Mo),"")){qe(e,"style")}};const qo=(e,t)=>{const o=e.dom;const n=t.dom;if(Lo(o)&&Lo(n)){n.style.cssText=o.style.cssText}};const Wo=(e,t,o=0)=>Ue(e,t).map((e=>parseInt(e,10))).getOr(o);const $o=(e,t)=>Wo(e,t,1);const Go=e=>{if(Ie("col")(e)){return Wo(e,"span",1)>1}else{return $o(e,"colspan")>1}};const Ko=e=>$o(e,"rowspan")>1;const Yo=(e,t)=>parseInt(Vo(e,t),10);const Xo=v(10);const Jo=v(10);const Qo=(e,t)=>en(e,t,T);const en=(e,t,o)=>$(pt(e),(e=>{if(Qe(e,t)){return o(e)?[e]:[]}else{return en(e,t,o)}}));const tn=(e,t,o=z)=>{if(o(t)){return E.none()}if(M(e,Oe(t))){return E.some(t)}const n=e=>Qe(e,"table")||o(e);return bo(t,e.join(","),n)};const on=(e,t)=>tn(["td","th"],e,t);const nn=e=>Qo(e,"th,td");const sn=e=>{if(Qe(e,"colgroup")){return uo(e,"col")}else{return $(cn(e),(e=>uo(e,"col")))}};const rn=(e,t)=>wo(e,"table",t);const an=e=>Qo(e,"tr");const cn=e=>rn(e).fold(v([]),(e=>uo(e,"colgroup")));const ln=(e,t)=>L(e,(e=>{if(Oe(e)==="colgroup"){const t=L(sn(e),(e=>{const t=Wo(e,"span",1);return Pt(e,1,t)}));return jt(e,t,"colgroup")}else{const o=L(nn(e),(e=>{const t=Wo(e,"rowspan",1);const o=Wo(e,"colspan",1);return Pt(e,t,o)}));return jt(e,o,t(e))}}));const dn=e=>dt(e).map((e=>{const t=Oe(e);return Lt(t)?t:"tbody"})).getOr("tbody");const un=e=>{const t=an(e);const o=cn(e);const n=[...o,...t];return ln(n,dn)};const fn=(e,t)=>ln(e,(()=>t));const mn=e=>{let t=false;let o;return(...n)=>{if(!t){t=true;o=e.apply(null,n)}return o}};const gn=(e,t,o,n)=>{const s=e.isiOS()&&/ipad/i.test(o)===true;const r=e.isiOS()&&!s;const a=e.isiOS()||e.isAndroid();const c=a||n("(pointer:coarse)");const i=s||!r&&a&&n("(min-device-width:768px)");const l=r||a&&!i;const d=t.isSafari()&&e.isiOS()&&/safari/i.test(o)===false;const u=!l&&!i&&!d;return{isiPad:v(s),isiPhone:v(r),isTablet:v(i),isPhone:v(l),isTouch:v(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:v(d),isDesktop:v(u)}};const pn=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t)){return n}}return undefined};const hn=(e,t)=>{const o=pn(e,t);if(!o){return{major:0,minor:0}}const n=e=>Number(t.replace(o,"$"+e));return vn(n(1),n(2))};const yn=(e,t)=>{const o=String(t).toLowerCase();if(e.length===0){return bn()}return hn(e,o)};const bn=()=>vn(0,0);const vn=(e,t)=>({major:e,minor:t});const kn={nu:vn,detect:yn,unknown:bn};const wn=(e,t)=>te(t.brands,(t=>{const o=t.brand.toLowerCase();return U(e,(e=>{var t;return o===((t=e.brand)===null||t===void 0?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:kn.nu(parseInt(t.version,10),0)})))}));const _n=(e,t)=>{const o=String(t).toLowerCase();return U(e,(e=>e.search(o)))};const xn=(e,t)=>_n(e,t).map((e=>{const o=kn.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const Cn=(e,t)=>_n(e,t).map((e=>{const o=kn.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const Sn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/;const zn=e=>t=>Oo(t,e);const Tn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Oo(e,"edge/")&&Oo(e,"chrome")&&Oo(e,"safari")&&Oo(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Sn],search:e=>Oo(e,"chrome")&&!Oo(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Oo(e,"msie")||Oo(e,"trident")},{name:"Opera",versionRegexes:[Sn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:zn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:zn("firefox")},{name:"Safari",versionRegexes:[Sn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Oo(e,"safari")||Oo(e,"mobile/"))&&Oo(e,"applewebkit")}];const En=[{name:"Windows",search:zn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Oo(e,"iphone")||Oo(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:zn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:zn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:zn("linux"),versionRegexes:[]},{name:"Solaris",search:zn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:zn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:zn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}];const On={browsers:v(Tn),oses:v(En)};const An="Edge";const Dn="Chromium";const Nn="IE";const Mn="Opera";const Rn="Firefox";const Bn="Safari";const Ln=()=>Hn({current:undefined,version:kn.unknown()});const Hn=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isEdge:n(An),isChromium:n(Dn),isIE:n(Nn),isOpera:n(Mn),isFirefox:n(Rn),isSafari:n(Bn)}};const In={unknown:Ln,nu:Hn,edge:v(An),chromium:v(Dn),ie:v(Nn),opera:v(Mn),firefox:v(Rn),safari:v(Bn)};const Pn="Windows";const Fn="iOS";const Vn="Android";const jn="Linux";const Zn="macOS";const Un="Solaris";const qn="FreeBSD";const Wn="ChromeOS";const $n=()=>Gn({current:undefined,version:kn.unknown()});const Gn=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Pn),isiOS:n(Fn),isAndroid:n(Vn),isMacOS:n(Zn),isLinux:n(jn),isSolaris:n(Un),isFreeBSD:n(qn),isChromeOS:n(Wn)}};const Kn={unknown:$n,nu:Gn,windows:v(Pn),ios:v(Fn),android:v(Vn),linux:v(jn),macos:v(Zn),solaris:v(Un),freebsd:v(qn),chromeos:v(Wn)};const Yn=(e,t,o)=>{const n=On.browsers();const s=On.oses();const r=t.bind((e=>wn(n,e))).orThunk((()=>xn(n,e))).fold(In.unknown,In.nu);const a=Cn(s,e).fold(Kn.unknown,Kn.nu);const c=gn(a,r,e,o);return{browser:r,os:a,deviceType:c}};const Xn={detect:Yn};const Jn=e=>window.matchMedia(e).matches;let Qn=mn((()=>Xn.detect(navigator.userAgent,E.from(navigator.userAgentData),Jn)));const es=()=>Qn();const ts=(e,t)=>{const o=(t,o)=>{if(!p(o)&&!o.match(/^[0-9]+$/)){throw new Error(e+".set accepts only positive integer values. Value was "+o)}const n=t.dom;if(Lo(n)){n.style[e]=o+"px"}};const n=o=>{const n=t(o);if(n<=0||n===null){const t=Vo(o,e);return parseFloat(t)||0}return n};const s=n;const r=(e,t)=>j(t,((t,o)=>{const n=Vo(e,o);const s=n===undefined?0:parseInt(n,10);return isNaN(s)?t:t+s}),0);const a=(e,t,o)=>{const n=r(e,o);const s=t>n?t-n:0;return s};return{set:o,get:n,getOuter:s,aggregate:r,max:a}};const os=(e,t)=>Bo(e).getOr(t);const ns=(e,t,o)=>os(Vo(e,t),o);const ss=(e,t,o,n)=>{const s=ns(e,`padding-${o}`,0);const r=ns(e,`padding-${n}`,0);const a=ns(e,`border-${o}-width`,0);const c=ns(e,`border-${n}-width`,0);return t-s-r-a-c};const rs=(e,t)=>{const o=e.dom;const n=o.getBoundingClientRect().width||o.offsetWidth;return t==="border-box"?n:ss(e,n,"left","right")};const as=e=>ns(e,"height",e.dom.offsetHeight);const cs=e=>ns(e,"width",e.dom.offsetWidth);const is=e=>rs(e,"content-box");const ls=ts("width",(e=>e.dom.offsetWidth));const ds=e=>ls.get(e);const us=e=>ls.getOuter(e);const fs=is;const ms=cs;const gs=(e,t,o)=>{const n=e.cells;const s=n.slice(0,t);const r=n.slice(t);const a=s.concat(o).concat(r);return ys(e,a)};const ps=(e,t,o)=>gs(e,t,[o]);const hs=(e,t,o)=>{const n=e.cells;n[t]=o};const ys=(e,t)=>qt(e.element,t,e.section,e.isNew);const bs=(e,t)=>{const o=e.cells;const n=L(o,t);return qt(e.element,n,e.section,e.isNew)};const vs=(e,t)=>e.cells[t];const ks=(e,t)=>vs(e,t).element;const ws=e=>e.cells.length;const _s=e=>{const t=P(e,(e=>e.section==="colgroup"));return{rows:t.fail,cols:t.pass}};const xs=(e,t,o)=>{const n=L(e.cells,o);return qt(t(e.element),n,e.section,true)};const Cs="data-snooker-locked-cols";const Ss=e=>Ue(e,Cs).bind((e=>E.from(e.match(/\d+/g)))).map((e=>Y(e,T)));const zs=e=>{const t=j(_s(e).rows,((e,t)=>{H(t.cells,((t,o)=>{if(t.isLocked){e[o]=true}}));return e}),{});const o=de(t,((e,t)=>parseInt(t,10)));return X(o)};const Ts=(e,t)=>e+","+t;const Es=(e,t,o)=>E.from(e.access[Ts(t,o)]);const Os=(e,t,o)=>{const n=As(e,(e=>o(t,e.element)));return n.length>0?E.some(n[0]):E.none()};const As=(e,t)=>{const o=$(e.all,(e=>e.cells));return F(o,t)};const Ds=e=>{const t={};let o=0;H(e.cells,(e=>{const n=e.colspan;B(n,(s=>{const r=o+s;t[r]=$t(e.element,n,r)}));o+=n}));return t};const Ns=e=>{const t={};const o=[];const n=Q(e).map((e=>e.element)).bind(rn);const s=n.bind(Ss).getOr({});let r=0;let a=0;let c=0;const{pass:i,fail:l}=P(e,(e=>e.section==="colgroup"));H(l,(e=>{const n=[];H(e.cells,(e=>{let o=0;while(t[Ts(c,o)]!==undefined){o++}const r=ge(s,o.toString());const i=Vt(e.element,e.rowspan,e.colspan,c,o,r);for(let n=0;n<e.colspan;n++){for(let s=0;s<e.rowspan;s++){const e=c+s;const r=o+n;const l=Ts(e,r);t[l]=i;a=Math.max(a,r+1)}}n.push(i)}));r++;o.push(jt(e.element,n,e.section));c++}));const{columns:d,colgroups:u}=ee(i).map((e=>{const t=Ds(e);const o=Gt(e.element,ue(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}})));const f=Ht(r,a);return{grid:f,access:t,all:o,columns:d,colgroups:u}};const Ms=e=>{const t=un(e);return Ns(t)};const Rs=e=>$(e.all,(e=>e.cells));const Bs=e=>ue(e.columns);const Ls=e=>oe(e.columns).length>0;const Hs=(e,t)=>E.from(e.columns[t]);const Is={fromTable:Ms,generate:Ns,getAt:Es,findItem:Os,filterItems:As,justCells:Rs,justColumns:Bs,hasColumns:Ls,getColumnAt:Hs};const Ps=(e,t=T)=>{const o=e.grid;const n=B(o.columns,k);const s=B(o.rows,k);return L(n,(o=>{const n=()=>$(s,(t=>Is.getAt(e,t,o).filter((e=>e.column===o)).toArray()));const r=e=>e.colspan===1&&t(e.element);const a=()=>Is.getAt(e,0,o);return Fs(n,r,a)}))};const Fs=(e,t,o)=>{const n=e();const s=U(n,t);const r=s.orThunk((()=>E.from(n[0]).orThunk(o)));return r.map((e=>e.element))};const Vs=e=>{const t=e.grid;const o=B(t.rows,k);const n=B(t.columns,k);return L(o,(t=>{const o=()=>$(n,(o=>Is.getAt(e,t,o).filter((e=>e.row===t)).fold(v([]),(e=>[e]))));const s=e=>e.rowspan===1;const r=()=>Is.getAt(e,t,0);return Fs(o,s,r)}))};const js=(e,t)=>{if(t<0||t>=e.length-1){return E.none()}const o=e[t].fold((()=>{const o=K(e.slice(0,t));return te(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>E.some({value:e,delta:0})));const n=e[t+1].fold((()=>{const o=e.slice(t+1);return te(o,((e,t)=>e.map((e=>({value:e,delta:t+1})))))}),(e=>E.some({value:e,delta:1})));return o.bind((e=>n.map((t=>{const o=t.delta+e.delta;return Math.abs(t.value-e.value)/o}))))};const Zs=(e,t)=>o=>Us(o)==="rtl"?t:e;const Us=e=>Vo(e,"direction")==="rtl"?"rtl":"ltr";const qs=ts("height",(e=>{const t=e.dom;return no(e)?t.getBoundingClientRect().height:t.offsetHeight}));const Ws=e=>qs.get(e);const $s=e=>qs.getOuter(e);const Gs=as;const Ks=(e,t)=>{const o=(o,n)=>Ks(e+o,t+n);return{left:e,top:t,translate:o}};const Ys=Ks;const Xs=e=>{const t=e.getBoundingClientRect();return Ys(t.left,t.top)};const Js=(e,t)=>{if(e!==undefined){return e}else{return t!==undefined?t:0}};const Qs=e=>{const t=e.dom.ownerDocument;const o=t.body;const n=t.defaultView;const s=t.documentElement;if(o===e.dom){return Ys(o.offsetLeft,o.offsetTop)}const r=Js(n===null||n===void 0?void 0:n.pageYOffset,s.scrollTop);const a=Js(n===null||n===void 0?void 0:n.pageXOffset,s.scrollLeft);const c=Js(s.clientTop,o.clientTop);const i=Js(s.clientLeft,o.clientLeft);return er(e).translate(a-i,r-c)};const er=e=>{const t=e.dom;const o=t.ownerDocument;const n=o.body;if(n===t){return Ys(n.offsetLeft,n.offsetTop)}if(!no(e)){return Ys(0,0)}return Xs(t)};const tr=(e,t)=>({row:e,y:t});const or=(e,t)=>({col:e,x:t});const nr=e=>{const t=Qs(e);return t.left+us(e)};const sr=e=>Qs(e).left;const rr=(e,t)=>or(e,sr(t));const ar=(e,t)=>or(e,nr(t));const cr=e=>Qs(e).top;const ir=(e,t)=>tr(e,cr(t));const lr=(e,t)=>tr(e,cr(t)+$s(t));const dr=(e,t,o)=>{if(o.length===0){return[]}const n=L(o.slice(1),((t,o)=>t.map((t=>e(o,t)))));const s=o[o.length-1].map((e=>t(o.length-1,e)));return n.concat([s])};const ur=e=>-e;const fr={delta:k,positions:e=>dr(ir,lr,e),edge:cr};const mr={delta:k,edge:sr,positions:e=>dr(rr,ar,e)};const gr={delta:ur,edge:nr,positions:e=>dr(ar,rr,e)};const pr=Zs(mr,gr);const hr={delta:(e,t)=>pr(t).delta(e,t),positions:(e,t)=>pr(t).positions(e,t),edge:e=>pr(e).edge(e)};const yr={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]};const br=(()=>{const e="[0-9]+";const t="[+-]?"+e;const o="[eE]"+t;const n="\\.";const s=e=>`(?:${e})?`;const r=["Infinity",e+n+s(e)+s(o),n+e+s(o),e+s(o)].join("|");const a=`[+-]?(?:${r})`;return new RegExp(`^(${a})(.*)$`)})();const vr=(e,t)=>R(t,(t=>R(yr[t],(t=>e===t))));const kr=(e,t)=>{const o=E.from(br.exec(e));return o.bind((e=>{const o=Number(e[1]);const n=e[2];if(vr(n,t)){return E.some({value:o,unit:n})}else{return E.none()}}))};const wr=/(\d+(\.\d+)?)%/;const _r=/(\d+(\.\d+)?)px|em/;const xr=Ie("col");const Cr=Ie("tr");const Sr=(e,t,o)=>{const n=ut(e).getOrThunk((()=>ro(at(e))));return t(e)/o(n)*100};const zr=(e,t)=>{Po(e,"width",t+"px")};const Tr=(e,t)=>{Po(e,"width",t+"%")};const Er=(e,t)=>{Po(e,"height",t+"px")};const Or=e=>{Uo(e,"height")};const Ar=e=>Gs(e)+"px";const Dr=(e,t,o,n)=>{const s=rn(e).map((e=>{const n=o(e);return Math.floor(t/100*n)})).getOr(t);n(e,s);return s};const Nr=(e,t,o,n)=>{const s=parseFloat(e);return Do(e,"%")&&Oe(t)!=="table"?Dr(t,s,o,n):s};const Mr=e=>{const t=Ar(e);if(!t){return Ws(e)}return Nr(t,e,Ws,Er)};const Rr=(e,t,o)=>{const n=o(e);const s=$o(e,t);return n/s};const Br=(e,t)=>Zo(e,t).orThunk((()=>Ue(e,t).map((e=>e+"px"))));const Lr=e=>Br(e,"width");const Hr=e=>Br(e,"height");const Ir=e=>Sr(e,ds,fs);const Pr=e=>xr(e)?ds(e):ms(e);const Fr=e=>Cr(e)?Ws(e):Rr(e,"rowspan",Mr);const Vr=e=>{const t=Lr(e);return t.bind((e=>kr(e,["fixed","relative","empty"])))};const jr=(e,t,o)=>{Po(e,"width",t+o)};const Zr=e=>ds(e)+"px";const Ur=e=>Ws(e)+"px";const qr=e=>Sr(e,ds,fs)+"%";const Wr=e=>Lr(e).exists((e=>wr.test(e)));const $r=e=>Lr(e).exists((e=>_r.test(e)));const Gr=e=>Lr(e).isNone();const Kr=v(wr);const Yr=Ie("col");const Xr=e=>Lr(e).getOrThunk((()=>Pr(e)+"px"));const Jr=e=>Hr(e).getOrThunk((()=>Fr(e)+"px"));const Qr=e=>L(Is.justColumns(e),(e=>E.from(e.element)));const ea=e=>{const t=es().browser;const o=t.isChromium()||t.isFirefox();return Yr(e)?o:true};const ta=(e,t,o,n,s,r)=>e.filter(n).fold((()=>r(js(o,t))),(e=>s(e)));const oa=(e,t,o,n)=>{const s=Ps(e);const r=Is.hasColumns(e)?Qr(e):s;const a=[E.some(hr.edge(t))].concat(L(hr.positions(s,t),(e=>e.map((e=>e.x)))));const c=x(Go);return L(r,((e,t)=>ta(e,t,a,c,(e=>{if(ea(e)){return o(e)}else{const e=Co(s[t],k);return ta(e,t,a,c,(e=>n(E.some(ds(e)))),n)}}),n)))};const na=e=>e.map((e=>e+"px")).getOr("");const sa=(e,t)=>oa(e,t,Xr,na);const ra=(e,t,o)=>oa(e,t,Ir,(e=>e.fold((()=>o.minCellWidth()),(e=>e/o.pixelWidth()*100))));const aa=(e,t,o)=>oa(e,t,Pr,(e=>e.getOrThunk(o.minCellWidth)));const ca=(e,t,o,n)=>{const s=Vs(e);const r=L(e.all,(e=>E.some(e.element)));const a=[E.some(fr.edge(t))].concat(L(fr.positions(s,t),(e=>e.map((e=>e.y)))));return L(r,((e,t)=>ta(e,t,a,T,o,n)))};const ia=(e,t)=>ca(e,t,Fr,(e=>e.getOrThunk(Jo)));const la=(e,t)=>ca(e,t,Jr,na);const da=(e,t)=>()=>{if(no(e)){return t(e)}else{return parseFloat(Zo(e,"width").getOr("0"))}};const ua=e=>{const t=da(e,ds);const o=v(0);const n=(t,o)=>aa(t,e,o);return{width:t,pixelWidth:t,getWidths:n,getCellDelta:o,singleColumnWidth:v([0]),minCellWidth:o,setElementWidth:h,adjustTableWidth:h,isRelative:true,label:"none"}};const fa=e=>{const t=da(e,(e=>parseFloat(qr(e))));const o=da(e,ds);const n=e=>e/o()*100;const s=(e,t)=>[100-e];const r=()=>Xo()/o()*100;const a=o=>{const n=t();const s=o/100*n;const r=n+s;Tr(e,r)};const c=(t,o)=>ra(t,e,o);return{width:t,pixelWidth:o,getWidths:c,getCellDelta:n,singleColumnWidth:s,minCellWidth:r,setElementWidth:Tr,adjustTableWidth:a,isRelative:true,label:"percent"}};const ma=e=>{const t=da(e,ds);const o=k;const n=(e,t)=>{const o=Math.max(Xo(),e+t);return[o-e]};const s=o=>{const n=t()+o;zr(e,n)};const r=(t,o)=>aa(t,e,o);return{width:t,pixelWidth:t,getWidths:r,getCellDelta:o,singleColumnWidth:n,minCellWidth:Xo,setElementWidth:zr,adjustTableWidth:s,isRelative:false,label:"pixel"}};const ga=(e,t)=>{const o=Kr().exec(t);if(o!==null){return fa(e)}else{return ma(e)}};const pa=e=>{const t=Lr(e);return t.fold((()=>ua(e)),(t=>ga(e,t)))};const ha={getTableSize:pa,pixelSize:ma,percentageSize:fa,noneSize:ua};const ya=(e,t,o,n,s,r)=>({minRow:e,minCol:t,maxRow:o,maxCol:n,allCells:s,selectedCells:r});const ba=(e,t)=>{const o=e.grid.columns;const n=e.grid.rows;let s=n;let r=o;let a=0;let c=0;const i=[];const l=[];se(e.access,(e=>{i.push(e);if(t(e)){l.push(e);const t=e.row;const o=t+e.rowspan-1;const n=e.column;const i=n+e.colspan-1;if(t<s){s=t}else if(o>a){a=o}if(n<r){r=n}else if(i>c){c=i}}}));return ya(s,r,a,c,i,l)};const va=(e,t,o)=>{const n=e[o].element;const s=Je.fromTag("td");wt(s,Je.fromTag("br"));const r=t?wt:kt;r(n,s)};const ka=(e,t,o,n)=>{const s=F(e,(e=>e.section!=="colgroup"));const r=t.grid.columns;const a=t.grid.rows;for(let e=0;e<a;e++){let a=false;for(let c=0;c<r;c++){if(!(e<o.minRow||e>o.maxRow||c<o.minCol||c>o.maxCol)){const o=Is.getAt(t,e,c).filter(n).isNone();if(o){va(s,a,e)}else{a=true}}}}};const wa=(e,t,o,n)=>{se(o.columns,(e=>{if(e.column<t.minCol||e.column>t.maxCol){Tt(e.element)}}));const s=F(Qo(e,"tr"),(e=>e.dom.childElementCount===0));H(s,Tt);if(t.minCol===t.maxCol||t.minRow===t.maxRow){H(Qo(e,"th,td"),(e=>{qe(e,"rowspan");qe(e,"colspan")}))}qe(e,Cs);qe(e,"data-snooker-col-series");const r=ha.getTableSize(e);r.adjustTableWidth(n)};const _a=(e,t,o,n)=>{if(n.minCol===0&&t.grid.columns===n.maxCol+1){return 0}const s=aa(t,e,o);const r=j(s,((e,t)=>e+t),0);const a=j(s.slice(n.minCol,n.maxCol+1),((e,t)=>e+t),0);const c=a/r*o.pixelWidth();const i=c-o.pixelWidth();return o.getCellDelta(i)};const xa=(e,t)=>{const o=e=>Qe(e.element,t);const n=Dt(e);const s=un(n);const r=ha.getTableSize(e);const a=Is.generate(s);const c=ba(a,o);const i="th:not("+t+")"+",td:not("+t+")";const l=en(n,"th,td",(e=>Qe(e,i)));H(l,Tt);ka(s,a,c,o);const d=Is.fromTable(e);const u=_a(e,d,r,c);wa(n,c,a,u);return n};const Ca=" ";const Sa=(e,t)=>{const o=o=>{if(!e(o)){throw new Error("Can only get "+t+" value of a "+t+" node")}return n(o).getOr("")};const n=t=>e(t)?E.from(t.dom.nodeValue):E.none();const s=(o,n)=>{if(!e(o)){throw new Error("Can only set raw "+t+" value of a "+t+" node")}o.dom.nodeValue=n};return{get:o,getOption:n,set:s}};const za=Sa(Be,"text");const Ta=e=>za.get(e);const Ea=e=>za.getOption(e);const Oa=(e,t)=>za.set(e,t);const Aa=e=>Oe(e)==="img"?1:Ea(e).fold((()=>pt(e).length),(e=>e.length));const Da=e=>Ea(e).filter((e=>e.trim().length!==0||e.indexOf(Ca)>-1)).isSome();const Na=e=>Me(e)&&Ze(e,"contenteditable")==="false";const Ma=["img","br"];const Ra=e=>{const t=Da(e);return t||M(Ma,Oe(e))||Na(e)};const Ba=e=>yo(e,Ra);const La=e=>Ha(e,Ra);const Ha=(e,t)=>{const o=e=>{const n=pt(e);for(let e=n.length-1;e>=0;e--){const s=n[e];if(t(s)){return E.some(s)}const r=o(s);if(r.isSome()){return r}}return E.none()};return o(e)};const Ia={scope:["row","col"]};const Pa=e=>()=>{const t=Je.fromTag("td",e.dom);wt(t,Je.fromTag("br",e.dom));return t};const Fa=e=>()=>Je.fromTag("col",e.dom);const Va=e=>()=>Je.fromTag("colgroup",e.dom);const ja=e=>()=>Je.fromTag("tr",e.dom);const Za=(e,t,o)=>{const n=Mt(e,t);se(o,((e,t)=>{if(e===null){qe(n,t)}else{Fe(n,t,e)}}));return n};const Ua=e=>e;const qa=(e,t,o)=>{const n=Ba(e);return n.map((n=>{const s=o.join(",");const r=lo(n,s,(t=>nt(t,e)));return V(r,((e,t)=>{const o=At(t);wt(e,o);return o}),t)})).getOr(t)};const Wa=(e,t)=>{se(Ia,((o,n)=>Ue(e,n).filter((e=>M(o,e))).each((e=>Fe(t,n,e)))))};const $a=(e,t,o)=>{const n=(e,t)=>{qo(e.element,t);Uo(t,"height");if(e.colspan!==1){Uo(t,"width")}};const s=s=>{const r=Je.fromTag(Oe(s.element),t.dom);const a=o.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]);const c=a.length>0?qa(s.element,r,a):r;wt(c,Je.fromTag("br"));n(s,r);Wa(s.element,r);e(s.element,r);return r};const r=o=>{const s=Je.fromTag(Oe(o.element),t.dom);n(o,s);e(o.element,s);return s};return{col:r,colgroup:Va(t),row:ja(t),cell:s,replace:Za,colGap:Fa(t),gap:Pa(t)}};const Ga=e=>({col:Fa(e),colgroup:Va(e),row:ja(e),cell:Pa(e),replace:Ua,colGap:Fa(e),gap:Pa(e)});const Ka=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;return pt(Je.fromDom(n))};const Ya=e=>L(e,Je.fromDom);const Xa=e=>t=>t.options.get(e);const Ja="100%";const Qa=e=>{var t;const o=e.dom;const n=(t=o.getParent(e.selection.getStart(),o.isBlock))!==null&&t!==void 0?t:e.getBody();return fs(Je.fromDom(n))+"px"};const ec=(e,t)=>{if(fc(e)||!gc(e)){return t}else if(uc(e)){return{...t,width:Qa(e)}}else{return{...t,width:Ja}}};const tc=(e,t)=>{if(fc(e)||gc(e)){return t}else if(uc(e)){return{...t,width:Qa(e)}}else{return{...t,width:Ja}}};const oc=e=>{const t=e.options.register;t("table_clone_elements",{processor:"string[]"});t("table_use_colgroups",{processor:"boolean",default:true});t("table_header_type",{processor:e=>{const t=M(["section","cells","sectionCells","auto"],e);return t?{value:e,valid:t}:{valid:false,message:"Must be one of: section, cells, sectionCells or auto."}},default:"section"});t("table_sizing_mode",{processor:"string",default:"auto"});t("table_default_attributes",{processor:"object",default:{border:"1"}});t("table_default_styles",{processor:"object",default:{"border-collapse":"collapse"}});t("table_column_resizing",{processor:e=>{const t=M(["preservetable","resizetable"],e);return t?{value:e,valid:t}:{valid:false,message:"Must be preservetable, or resizetable."}},default:"preservetable"});t("table_resize_bars",{processor:"boolean",default:true});t("table_style_by_css",{processor:"boolean",default:true});t("table_merge_content_on_paste",{processor:"boolean",default:true})};const nc=e=>E.from(e.options.get("table_clone_elements"));const sc=e=>{const t=e.options.get("object_resizing");return M(t.split(","),"table")};const rc=Xa("table_header_type");const ac=Xa("table_column_resizing");const cc=e=>ac(e)==="preservetable";const ic=e=>ac(e)==="resizetable";const lc=Xa("table_sizing_mode");const dc=e=>lc(e)==="relative";const uc=e=>lc(e)==="fixed";const fc=e=>lc(e)==="responsive";const mc=Xa("table_resize_bars");const gc=Xa("table_style_by_css");const pc=Xa("table_merge_content_on_paste");const hc=e=>{const t=e.options;const o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:tc(e,o)};const yc=e=>{const t=e.options;const o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:ec(e,o)};const bc=Xa("table_use_colgroups");const vc=e=>wo(e,"[contenteditable]");const kc=(e,t=false)=>{if(no(e)){return e.dom.isContentEditable}else{return vc(e).fold(v(t),(e=>wc(e)==="true"))}};const wc=e=>e.dom.contentEditable;const _c=e=>Je.fromDom(e.getBody());const xc=e=>t=>nt(t,_c(e));const Cc=e=>{qe(e,"data-mce-style");const t=e=>qe(e,"data-mce-style");H(nn(e),t);H(sn(e),t);H(an(e),t)};const Sc=e=>Je.fromDom(e.selection.getStart());const zc=e=>e.getBoundingClientRect().width;const Tc=e=>e.getBoundingClientRect().height;const Ec=e=>(t,o)=>{const n=t.dom.getStyle(o,e)||t.dom.getAttrib(o,e);return E.from(n).filter(Ro)};const Oc=Ec("width");const Ac=Ec("height");const Dc=e=>/^(\d+(\.\d+)?)%$/.test(e);const Nc=e=>/^(\d+(\.\d+)?)px$/.test(e);const Mc=e=>po(e,Ie("table")).exists(kc);const Rc=(e,t)=>{const o=t.column;const n=t.column+t.colspan-1;const s=t.row;const r=t.row+t.rowspan-1;return o<=e.finishCol&&n>=e.startCol&&(s<=e.finishRow&&r>=e.startRow)};const Bc=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow;const Lc=(e,t)=>{let o=true;const n=_(Bc,t);for(let s=t.startRow;s<=t.finishRow;s++){for(let r=t.startCol;r<=t.finishCol;r++){o=o&&Is.getAt(e,s,r).exists(n)}}return o?E.some(t):E.none()};const Hc=(e,t)=>Wt(Math.min(e.row,t.row),Math.min(e.column,t.column),Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),Math.max(e.column+e.colspan-1,t.column+t.colspan-1));const Ic=(e,t,o)=>{const n=Is.findItem(e,t,nt);const s=Is.findItem(e,o,nt);return n.bind((e=>s.map((t=>Hc(e,t)))))};const Pc=(e,t,o)=>Ic(e,t,o).bind((t=>Lc(e,t)));const Fc=(e,t,o,n)=>Is.findItem(e,t,nt).bind((t=>{const s=o>0?t.row+t.rowspan-1:t.row;const r=n>0?t.column+t.colspan-1:t.column;const a=Is.getAt(e,s+o,r+n);return a.map((e=>e.element))}));const Vc=(e,t,o)=>Ic(e,t,o).map((t=>{const o=Is.filterItems(e,_(Rc,t));return L(o,(e=>e.element))}));const jc=(e,t)=>{const o=(e,t)=>st(t,e);return Is.findItem(e,t,o).map((e=>e.element))};const Zc=(e,t,o)=>rn(e).bind((n=>{const s=$c(n);return Fc(s,e,t,o)}));const Uc=(e,t,o)=>{const n=$c(e);return Vc(n,t,o)};const qc=(e,t,o,n,s)=>{const r=$c(e);const a=nt(e,o)?E.some(t):jc(r,t);const c=nt(e,s)?E.some(n):jc(r,n);return a.bind((e=>c.bind((t=>Vc(r,e,t)))))};const Wc=(e,t,o)=>{const n=$c(e);return Pc(n,t,o)};const $c=Is.fromTable;var Gc=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];var Kc=()=>{const e=e=>Je.fromDom(e.dom.cloneNode(false));const t=e=>ct(e).dom;const o=e=>{if(!Re(e)){return false}if(Oe(e)==="body"){return true}return M(Gc,Oe(e))};const n=e=>{if(!Re(e)){return false}return M(["br","img","hr","input"],Oe(e))};const s=e=>Re(e)&&Ze(e,"contenteditable")==="false";const r=(e,t)=>e.dom.compareDocumentPosition(t.dom);const a=(e,t)=>{const o=We(e);Ve(t,o)};const c=e=>{const t=Oe(e);return M(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)};const i=e=>Re(e)?Ue(e,"lang"):E.none();return{up:v({selector:bo,closest:wo,predicate:go,all:ft}),down:v({selector:fo,predicate:io}),styles:v({get:Vo,getRaw:Zo,set:Po,remove:Uo}),attrs:v({get:Ze,set:Fe,remove:qe,copyTo:a}),insert:v({before:bt,after:vt,afterAll:Ct,append:wt,appendAll:St,prepend:kt,wrap:xt}),remove:v({unwrap:Et,remove:Tt}),create:v({nu:Je.fromTag,clone:e,text:Je.fromText}),query:v({comparePosition:r,prevSibling:mt,nextSibling:gt}),property:v({children:pt,name:Oe,parent:dt,document:t,isText:Be,isComment:Ne,isElement:Re,isSpecial:c,getLanguage:i,getText:Ta,setText:Oa,isBoundary:o,isEmptyTag:n,isNonEditable:s}),eq:nt,is:rt}};const Yc=(e,t,o,n)=>{const s=o[0];const r=o.slice(1);return n(e,t,s,r)};const Xc=(e,t,o)=>o.length>0?Yc(e,t,o,Jc):E.none();const Jc=(e,t,o,n)=>{const s=t(e,o);return V(n,((o,n)=>{const s=t(e,n);return Qc(e,o,s)}),s)};const Qc=(e,t,o)=>t.bind((t=>o.filter(_(e.eq,t))));const ei=(e,t)=>_(e.eq,t);const ti=(e,t,o,n=z)=>{const s=[t].concat(e.up().all(t));const r=[o].concat(e.up().all(o));const a=e=>{const t=q(e,n);return t.fold((()=>e),(t=>e.slice(0,t+1)))};const c=a(s);const i=a(r);const l=U(c,(t=>R(i,ei(e,t))));return{firstpath:c,secondpath:i,shared:l}};const oi=Xc;const ni=ti;const si=Kc();const ri=(e,t)=>oi(si,((t,o)=>e(o)),t);const ai=(e,t,o)=>ni(si,e,t,o);const ci=e=>bo(e,"table");const ii=(e,t,o)=>{const n=e=>t=>o!==undefined&&o(t)||nt(t,e);if(nt(e,t)){return E.some({boxes:E.some([e]),start:e,finish:t})}else{return ci(e).bind((s=>ci(t).bind((r=>{if(nt(s,r)){return E.some({boxes:Uc(s,e,t),start:e,finish:t})}else if(st(s,r)){const o=lo(t,"td,th",n(s));const a=o.length>0?o[o.length-1]:t;return E.some({boxes:qc(s,e,s,t,r),start:e,finish:a})}else if(st(r,s)){const o=lo(e,"td,th",n(r));const a=o.length>0?o[o.length-1]:e;return E.some({boxes:qc(r,e,s,t,r),start:e,finish:a})}else{return ai(e,t).shared.bind((a=>wo(a,"table",o).bind((o=>{const a=lo(t,"td,th",n(o));const c=a.length>0?a[a.length-1]:t;const i=lo(e,"td,th",n(o));const l=i.length>0?i[i.length-1]:e;return E.some({boxes:qc(o,e,s,t,r),start:l,finish:c})}))))}}))))}};const li=(e,t)=>{const o=fo(e,t);return o.length>0?E.some(o):E.none()};const di=(e,t)=>U(e,(e=>Qe(e,t)));const ui=(e,t,o)=>ko(e,t).bind((t=>ko(e,o).bind((e=>ri(ci,[t,e]).map((o=>({first:t,last:e,table:o})))))));const fi=(e,t)=>bo(e,"table").bind((o=>ko(o,t).bind((t=>ii(t,e).bind((e=>e.boxes.map((t=>({boxes:t,start:e.start,finish:e.finish})))))))));const mi=(e,t,o,n,s)=>di(e,s).bind((e=>Zc(e,t,o).bind((e=>fi(e,n)))));const gi=(e,t)=>li(e,t);const pi=(e,t,o)=>ui(e,t,o).bind((t=>{const o=t=>nt(e,t);const n="thead,tfoot,tbody,table";const s=bo(t.first,n,o);const r=bo(t.last,n,o);return s.bind((e=>r.bind((o=>nt(e,o)?Wc(t.table,t.first,t.last):E.none()))))}));const hi=k;const yi=e=>{const t=(e,t)=>Ue(e,t).exists((e=>parseInt(e,10)>1));const o=e=>t(e,"rowspan")||t(e,"colspan");return e.length>0&&G(e,o)?E.some(e):E.none()};const bi=(e,t,o)=>{if(t.length<=1){return E.none()}else{return pi(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t})))}};const vi="data-mce-selected";const ki="td["+vi+"],th["+vi+"]";const wi="["+vi+"]";const _i="data-mce-first-selected";const xi="td["+_i+"],th["+_i+"]";const Ci="data-mce-last-selected";const Si="td["+Ci+"],th["+Ci+"]";const zi=wi;const Ti={selected:vi,selectedSelector:ki,firstSelected:_i,firstSelectedSelector:xi,lastSelected:Ci,lastSelectedSelector:Si};const Ei=(e,t,o)=>({element:o,mergable:bi(t,e,Ti),unmergable:yi(e),selection:hi(e)});const Oi=(e,t,o)=>({element:e,clipboard:t,generators:o});const Ai=(e,t,o,n)=>({selection:hi(e),clipboard:o,generators:n});const Di=e=>rn(e).bind((e=>gi(e,Ti.firstSelectedSelector))).fold(v(e),(e=>e[0]));const Ni=e=>(t,o)=>{const n=Oe(t);const s=n==="col"||n==="colgroup"?Di(t):t;return wo(s,e,o)};const Mi=Ni("th,td,caption");const Ri=Ni("th,td");const Bi=e=>Ya(e.model.table.getSelectedCells());const Li=e=>F(Bi(e),(e=>Qe(e,Ti.selectedSelector)));const Hi=e=>rn(e[0]).map((e=>{const t=xa(e,zi);Cc(t);return[t]}));const Ii=(e,t)=>L(t,(t=>e.selection.serializer.serialize(t.dom,{}))).join("");const Pi=e=>L(e,(e=>e.dom.innerText)).join("");const Fi=(e,t)=>{e.on("BeforeGetContent",(t=>{const o=o=>{t.preventDefault();Hi(o).each((o=>{t.content=t.format==="text"?Pi(o):Ii(e,o)}))};if(t.selection===true){const t=Li(e);if(t.length>=1){o(t)}}}));e.on("BeforeSetContent",(o=>{if(o.selection===true&&o.paste===true){const n=Bi(e);Q(n).each((n=>{rn(n).each((s=>{const r=F(Ka(o.content),(e=>Oe(e)!=="meta"));const a=Ie("table");if(pc(e)&&r.length===1&&a(r[0])){o.preventDefault();const a=Je.fromDom(e.getDoc());const c=Ga(a);const i=Oi(n,r[0],c);t.pasteCells(s,i).each((()=>{e.focus()}))}}))}))}}))};const Vi=(e,t)=>({element:e,offset:t});const ji=(e,t,o)=>{if(e.property().isText(t)&&e.property().getText(t).trim().length===0||e.property().isComment(t)){return o(t).bind((t=>ji(e,t,o).orThunk((()=>E.some(t)))))}else{return E.none()}};const Zi=(e,t)=>{if(e.property().isText(t)){return e.property().getText(t).length}const o=e.property().children(t);return o.length};const Ui=(e,t)=>{const o=ji(e,t,e.query().prevSibling).getOr(t);if(e.property().isText(o)){return Vi(o,Zi(e,o))}const n=e.property().children(o);return n.length>0?Ui(e,n[n.length-1]):Vi(o,Zi(e,o))};const qi=Ui;const Wi=Kc();const $i=e=>qi(Wi,e);const Gi=(e,t)=>{if(!Go(e)){const o=Vr(e);o.each((o=>{const n=o.value/2;jr(e,n,o.unit);jr(t,n,o.unit)}))}};const Ki=e=>L(e,v(0));const Yi=(e,t,o,n,s)=>s(e.slice(0,t)).concat(n).concat(s(e.slice(o)));const Xi=e=>(t,o,n,s)=>{if(!e(n)){return n}else{const e=Math.max(s,t[o]-Math.abs(n));const r=Math.abs(e-t[o]);return n>=0?r:-r}};const Ji=Xi((e=>e<0));const Qi=Xi(T);const el=()=>{const e=(e,t,o,n,s)=>{const r=Ji(e,t,n,s);return Yi(e,t,o+1,[r,0],Ki)};const t=(e,t,o,n)=>{const s=(100+o)/100;const r=Math.max(n,(e[t]+o)/s);return L(e,((e,o)=>{const n=o===t?r:e/s;return n-e}))};const o=(o,n,s,r,a,c)=>{if(c){return t(o,n,r,a)}else{return e(o,n,s,r,a)}};const n=(e,t,n,s,r,a,c)=>o(e,n,s,r,a,c);const s=(e,t)=>e(t);const r=(e,o,n,s,r,a)=>{if(a){return t(e,n,s,r)}else{const t=Ji(e,n,s,r);return Ki(e.slice(0,n)).concat([t])}};const a=(e,t,o,n)=>{if(n){const n=t+o;const s=n/t;const r=L(e,(e=>e/s));return{delta:s*100-100,newSizes:r}}else{return{delta:o,newSizes:e}}};return{resizeTable:s,clampTableDelta:Ji,calcLeftEdgeDeltas:o,calcMiddleDeltas:n,calcRightEdgeDeltas:r,calcRedestributedWidths:a}};const tl=()=>{const e=(e,t,o,n,s)=>{const r=n>=0?o:t;const a=Qi(e,r,n,s);return Yi(e,t,o+1,[a,-a],Ki)};const t=(t,o,n,s,r,a)=>e(t,n,s,r,a);const o=(e,t,o)=>{if(o){e(t)}};const n=(e,t,o,n,s,r)=>{if(r){return Ki(e)}else{const t=n/e.length;return L(e,v(t))}};const s=(e,t,o,n,s)=>{if(s){if(o>=0){return o}else{const t=j(e,((e,t)=>e+t-n),0);return Math.max(-t,o)}}else{return Ji(e,t,o,n)}};const r=(e,t,o,n)=>({delta:0,newSizes:e});return{resizeTable:o,clampTableDelta:s,calcLeftEdgeDeltas:e,calcMiddleDeltas:t,calcRightEdgeDeltas:n,calcRedestributedWidths:r}};const ol=e=>{const t=Is.fromTable(e);return t.grid};const nl=Ie("th");const sl=e=>G(e,(e=>nl(e.element)));const rl=(e,t)=>{if(e&&t){return"sectionCells"}else if(e){return"section"}else{return"cells"}};const al=e=>{const t=e.section==="thead";const o=_o(cl(e.cells),"th");if(e.section==="tfoot"){return{type:"footer"}}else if(t||o){return{type:"header",subType:rl(t,o)}}else{return{type:"body"}}};const cl=e=>{const t=F(e,(e=>nl(e.element)));if(t.length===0){return E.some("td")}else if(t.length===e.length){return E.some("th")}else{return E.none()}};const il=e=>{const t=L(e,(e=>al(e).type));const o=M(t,"header");const n=M(t,"footer");if(!o&&!n){return E.some("body")}else{const e=M(t,"body");if(o&&!e&&!n){return E.some("header")}else if(!o&&!e&&n){return E.some("footer")}else{return E.none()}}};const ll=e=>te(e.all,(e=>{const t=al(e);return t.type==="header"?E.from(t.subType):E.none()}));const dl=(e,t,o)=>Ut(o(e.element,t),true,e.isLocked);const ul=(e,t)=>e.section!==t?qt(e.element,e.cells,t,e.isNew):e;const fl=()=>({transformRow:ul,transformCell:(e,t,o)=>{const n=o(e.element,t);const s=Oe(n)!=="td"?Rt(n,"td"):n;return Ut(s,e.isNew,e.isLocked)}});const ml=()=>({transformRow:ul,transformCell:dl});const gl=()=>({transformRow:(e,t)=>{const o=t==="thead"?"tbody":t;return ul(e,o)},transformCell:dl});const pl=()=>({transformRow:k,transformCell:dl});const hl=(e,t)=>{const o=Is.fromTable(e);const n=ll(o).getOr(t);switch(n){case"section":return fl();case"sectionCells":return ml();case"cells":return gl()}};const yl={getTableSectionType:hl,section:fl,sectionCells:ml,cells:gl,fallback:pl};const bl=(e,t,o,n)=>{if(o===n){qe(e,t)}else{Fe(e,t,o)}};const vl=(e,t,o)=>{ee(uo(e,t)).fold((()=>kt(e,o)),(e=>vt(e,o)))};const kl=(e,t)=>{const o=vo(e,t).getOrThunk((()=>{const o=Je.fromTag(t,at(e).dom);if(t==="thead"){vl(e,"caption,colgroup",o)}else if(t==="colgroup"){vl(e,"caption",o)}else{wt(e,o)}return o}));zt(o);return o};const wl=(e,t)=>{const o=[];const n=[];const s=e=>L(e,(e=>{if(e.isNew){o.push(e.element)}const t=e.element;zt(t);H(e.cells,(e=>{if(e.isNew){n.push(e.element)}bl(e.element,"colspan",e.colspan,1);bl(e.element,"rowspan",e.rowspan,1);wt(t,e.element)}));return t}));const r=e=>$(e,(e=>L(e.cells,(e=>{bl(e.element,"span",e.colspan,1);return e.element}))));const a=(t,o)=>{const n=kl(e,o);const a=o==="colgroup"?r:s;const c=a(t);St(n,c)};const c=t=>{vo(e,t).each(Tt)};const i=(e,t)=>{if(e.length>0){a(e,t)}else{c(t)}};const l=[];const d=[];const u=[];const f=[];H(t,(e=>{switch(e.section){case"thead":l.push(e);break;case"tbody":d.push(e);break;case"tfoot":u.push(e);break;case"colgroup":f.push(e);break}}));i(f,"colgroup");i(l,"thead");i(d,"tbody");i(u,"tfoot");return{newRows:o,newCells:n}};const _l=e=>L(e,(e=>{const t=At(e.element);H(e.cells,(e=>{const o=Dt(e.element);bl(o,"colspan",e.colspan,1);bl(o,"rowspan",e.rowspan,1);wt(t,o)}));return t}));const xl=(e,t)=>L(e,(e=>vs(e,t)));const Cl=(e,t)=>e[t];const Sl=(e,t)=>{if(e.length===0){return 0}const o=e[0];const n=q(e,(e=>!t(o.element,e.element)));return n.getOr(e.length)};const zl=(e,t,o,n)=>{const s=Cl(e,t);const r=s.section==="colgroup";const a=Sl(s.cells.slice(o),n);const c=r?1:Sl(xl(e.slice(t),o),n);return{colspan:a,rowspan:c}};const Tl=(e,t)=>{const o=L(e,(e=>L(e.cells,z)));const n=(e,t,n,s)=>{for(let r=e;r<e+n;r++){for(let e=t;e<t+s;e++){o[r][e]=true}}};return L(e,((s,r)=>{const a=$(s.cells,((s,a)=>{if(o[r][a]===false){const o=zl(e,r,a,t);n(r,a,o.rowspan,o.colspan);return[Ft(s.element,o.rowspan,o.colspan,s.isNew)]}else{return[]}}));return Zt(s.element,a,s.section,s.isNew)}))};const El=(e,t,o)=>{const n=[];H(e.colgroups,(s=>{const r=[];for(let n=0;n<e.grid.columns;n++){const s=Is.getColumnAt(e,n).map((e=>Ut(e.element,o,false))).getOrThunk((()=>Ut(t.colGap(),true,false)));r.push(s)}n.push(qt(s.element,r,"colgroup",o))}));for(let s=0;s<e.grid.rows;s++){const r=[];for(let n=0;n<e.grid.columns;n++){const a=Is.getAt(e,s,n).map((e=>Ut(e.element,o,e.isLocked))).getOrThunk((()=>Ut(t.gap(),true,false)));r.push(a)}const a=e.all[s];const c=qt(a.element,r,a.section,o);n.push(c)}return n};const Ol=(e,t)=>El(e,t,false);const Al=e=>Tl(e,nt);const Dl=(e,t)=>te(e.all,(e=>U(e.cells,(e=>nt(t,e.element)))));const Nl=(e,t,o)=>{const n=L(t.selection,(t=>on(t).bind((t=>Dl(e,t))).filter(o)));const s=xo(n);return So(s.length>0,s)};const Ml=(e,t,o,n,s)=>(r,a,c,i)=>{const l=Is.fromTable(r);const d=E.from(i===null||i===void 0?void 0:i.section).getOrThunk(yl.fallback);const u=t(l,a).map((t=>{const o=Ol(l,c);const n=e(o,t,nt,s(c),d);const r=zs(n.grid);const a=Al(n.grid);return{info:t,grid:a,cursor:n.cursor,lockedColumns:r}}));return u.bind((e=>{const t=wl(r,e.grid);const s=E.from(i===null||i===void 0?void 0:i.sizing).getOrThunk((()=>ha.getTableSize(r)));const a=E.from(i===null||i===void 0?void 0:i.resize).getOrThunk(tl);o(r,e.grid,e.info,{sizing:s,resize:a,section:d});n(r);qe(r,Cs);if(e.lockedColumns.length>0){Fe(r,Cs,e.lockedColumns.join(","))}return E.some({cursor:e.cursor,newRows:t.newRows,newCells:t.newCells})}))};const Rl=(e,t)=>on(t.element).bind((o=>Dl(e,o).map((e=>{const o={...e,generators:t.generators,clipboard:t.clipboard};return o}))));const Bl=(e,t)=>Nl(e,t,T).map((e=>({cells:e,generators:t.generators,clipboard:t.clipboard})));const Ll=(e,t)=>t.mergable;const Hl=(e,t)=>t.unmergable;const Il=(e,t)=>Nl(e,t,T);const Pl=(e,t)=>Nl(e,t,(e=>!e.isLocked));const Fl=(e,t)=>Dl(e,t).exists((e=>!e.isLocked));const Vl=(e,t)=>G(t,(t=>Fl(e,t)));const jl=(e,t)=>Ll(e,t).filter((t=>Vl(e,t.cells)));const Zl=(e,t)=>Hl(e,t).filter((t=>Vl(e,t)));const Ul=(e,t,o,n)=>{const s=_s(e).rows;if(s.length===0){return e}for(let e=t.startRow;e<=t.finishRow;e++){for(let o=t.startCol;o<=t.finishCol;o++){const t=s[e];const r=vs(t,o).isLocked;hs(t,o,Ut(n(),false,r))}}return e};const ql=(e,t,o,n)=>{const s=_s(e).rows;let r=true;for(let e=0;e<s.length;e++){for(let a=0;a<ws(s[0]);a++){const c=s[e];const i=vs(c,a);const l=i.element;const d=o(l,t);if(d&&!r){hs(c,a,Ut(n(),true,i.isLocked))}else if(d){r=false}}}return e};const Wl=(e,t)=>j(e,((e,o)=>R(e,(e=>t(e.element,o.element)))?e:e.concat([o])),[]);const $l=(e,t,o,n)=>{if(t>0&&t<e[0].cells.length){H(e,(e=>{const s=e.cells[t-1];let r=0;const a=n();while(e.cells.length>t+r&&o(s.element,e.cells[t+r].element)){hs(e,t+r,Ut(a,true,e.cells[t+r].isLocked));r++}}))}return e};const Gl=(e,t,o,n)=>{const s=_s(e).rows;if(t>0&&t<s.length){const e=s[t-1].cells;const r=Wl(e,o);H(r,(e=>{let r=E.none();for(let a=t;a<s.length;a++){for(let t=0;t<ws(s[0]);t++){const c=s[a];const i=vs(c,t);const l=o(i.element,e.element);if(l){if(r.isNone()){r=E.some(n())}r.each((e=>{hs(c,t,Ut(e,true,i.isLocked))}))}}}}))}return e};const Kl=e=>{const t=t=>t(e);const o=v(e);const n=()=>s;const s={tag:true,inner:e,fold:(t,o)=>o(e),isValue:T,isError:z,map:t=>Jl.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>E.some(e)};return s};const Yl=e=>{const t=()=>o;const o={tag:false,inner:e,fold:(t,o)=>t(e),isValue:z,isError:T,map:t,mapError:t=>Jl.error(t(e)),bind:t,exists:z,forall:T,getOr:k,or:k,getOrThunk:S,orThunk:S,getOrDie:C(String(e)),each:h,toOptional:E.none};return o};const Xl=(e,t)=>e.fold((()=>Yl(t)),Kl);const Jl={value:Kl,error:Yl,fromOption:Xl};const Ql=(e,t,o)=>{if(e.row>=t.length||e.column>ws(t[0])){return Jl.error("invalid start address out of table bounds, row: "+e.row+", column: "+e.column)}const n=t.slice(e.row);const s=n[0].cells.slice(e.column);const r=ws(o[0]);const a=o.length;return Jl.value({rowDelta:n.length-a,colDelta:s.length-r})};const ed=(e,t)=>{const o=ws(e[0]);const n=ws(t[0]);return{rowDelta:0,colDelta:o-n}};const td=(e,t)=>{const o=e.length;const n=t.length;return{rowDelta:o-n,colDelta:0}};const od=(e,t,o,n)=>{const s=t.section==="colgroup"?o.col:o.cell;return B(e,(e=>Ut(s(),true,n(e))))};const nd=(e,t,o,n)=>{const s=e[e.length-1];return e.concat(B(t,(()=>{const e=s.section==="colgroup"?o.colgroup:o.row;const t=xs(s,e,k);const r=od(t.cells.length,t,o,(e=>me(n,e.toString())));return ys(t,r)})))};const sd=(e,t,o,n)=>L(e,(e=>{const s=od(t,e,o,z);return gs(e,n,s)}));const rd=(e,t,o)=>L(e,(e=>j(o,((o,n)=>{const s=od(1,e,t,T)[0];return ps(o,n,s)}),e)));const ad=(e,t,o)=>{const n=t.colDelta<0?sd:k;const s=t.rowDelta<0?nd:k;const r=zs(e);const a=ws(e[0]);const c=R(r,(e=>e===a-1));const i=n(e,Math.abs(t.colDelta),o,c?a-1:a);const l=zs(i);return s(i,Math.abs(t.rowDelta),o,Y(l,T))};const cd=(e,t,o,n)=>{const s=vs(e[t],o);const r=_(n,s.element);const a=e[t];return e.length>1&&ws(a)>1&&(o>0&&r(ks(a,o-1))||o<a.cells.length-1&&r(ks(a,o+1))||t>0&&r(ks(e[t-1],o))||t<e.length-1&&r(ks(e[t+1],o)))};const id=(e,t,o,n,s,r)=>{const a=e.row;const c=e.column;const i=o.length;const l=ws(o[0]);const d=a+i;const u=c+l+r.length;const f=Y(r,T);for(let e=a;e<d;e++){let r=0;for(let i=c;i<u;i++){if(f[i]){r++;continue}if(cd(t,e,i,s)){ql(t,ks(t[e],i),s,n.cell)}const l=i-c-r;const d=vs(o[e-a],l);const u=d.element;const m=n.replace(u);hs(t[e],i,Ut(m,true,d.isLocked))}}return t};const ld=(e,t,o)=>{const n=ws(t[0]);const s=_s(t).cols.length+e.row;const r=B(n-e.column,(t=>t+e.column));const a=U(r,(e=>G(o,(t=>t!==e)))).getOr(n-1);return{row:s,column:a}};const dd=(e,t,o)=>F(o,(o=>o>=e.column&&o<=ws(t[0])+e.column));const ud=(e,t,o,n,s)=>{const r=zs(t);const a=ld(e,t,r);const c=_s(o).rows;const i=dd(a,c,r);const l=Ql(a,t,c);return l.map((e=>{const o={...e,colDelta:e.colDelta-i.length};const r=ad(t,o,n);const l=zs(r);const d=dd(a,c,l);return id(a,r,c,n,s,d)}))};const fd=(e,t,o,n,s)=>{$l(t,e,s,n.cell);const r=td(o,t);const a=ad(o,r,n);const c=td(t,a);const i=ad(t,c,n);return L(i,((t,o)=>gs(t,e,a[o].cells)))};const md=(e,t,o,n,s)=>{Gl(t,e,s,n.cell);const r=zs(t);const a=ed(t,o);const c={...a,colDelta:a.colDelta-r.length};const i=ad(t,c,n);const{cols:l,rows:d}=_s(i);const u=zs(i);const f=ed(o,t);const m={...f,colDelta:f.colDelta+u.length};const g=rd(o,n,u);const p=ad(g,m,n);return[...l,...d.slice(0,e),...p,...d.slice(e,d.length)]};const gd=(e,t,o,n)=>xs(e,(e=>n(e,o)),t);const pd=(e,t,o,n,s)=>{const{rows:r,cols:a}=_s(e);const c=r.slice(0,t);const i=r.slice(t);const l=gd(r[o],((e,o)=>{const a=t>0&&t<r.length&&n(ks(r[t-1],o),ks(r[t],o));const c=a?vs(r[t],o):Ut(s(e.element,n),true,e.isLocked);return c}),n,s);return[...a,...c,l,...i]};const hd=(e,t,o,n,s,r,a)=>{if(o==="colgroup"||!n){const t=vs(e,s);return Ut(a(t.element,r),true,false)}else{return vs(e,t)}};const yd=(e,t,o,n,s)=>L(e,(e=>{const r=t>0&&t<ws(e)&&n(ks(e,t-1),ks(e,t));const a=hd(e,t,e.section,r,o,n,s);return ps(e,t,a)}));const bd=(e,t)=>$(e,(e=>{const o=e.cells;const n=V(t,((e,t)=>t>=0&&t<e.length?e.slice(0,t).concat(e.slice(t+1)):e),o);return n.length>0?[qt(e.element,n,e.section,e.isNew)]:[]}));const vd=(e,t,o)=>{const{rows:n,cols:s}=_s(e);return[...s,...n.slice(0,t),...n.slice(o+1)]};const kd=(e,t,o,n)=>ks(e[t],o)!==undefined&&(t>0&&n(ks(e[t-1],o),ks(e[t],o)));const wd=(e,t,o)=>t>0&&o(ks(e,t-1),ks(e,t));const _d=(e,t,o,n)=>kd(e,t,o,n)||wd(e[t],o,n);const xd=(e,t)=>{const o=G(t,k)&&sl(e.cells);return o?T:(e,o,n)=>{const s=Oe(e.element);return!(s==="th"&&t[n])}};const Cd=(e,t)=>{const o=G(t,k)&&sl(e);return o?T:(e,o,n)=>{const s=Oe(e.element);return!(s==="th"&&t[o])}};const Sd=(e,t,o,n)=>{const s=e=>e==="row"?Ko(t):Go(t);const r=e=>s(e)?`${e}group`:e;if(e){return nl(t)?r(o):null}else if(n&&nl(t)){const e=o==="row"?"col":"row";return r(e)}else{return null}};const zd=(e,t)=>(o,n,s)=>E.some(Sd(e,o.element,"col",t[s]));const Td=(e,t)=>(o,n)=>E.some(Sd(e,o.element,"row",t[n]));const Ed=(e,t,o)=>Ut(o(e.element,t),true,e.isLocked);const Od=(e,t,o,n,s,r,a)=>{const c=e=>R(t,(t=>o(e.element,t.element)));return L(e,((e,t)=>bs(e,((e,i)=>{if(c(e)){const c=a(e,t,i)?s(e,o,n):e;r(c,t,i).each((e=>{je(c.element,{scope:E.from(e)})}));return c}else{return e}}))))};const Ad=(e,t,o)=>$(e,((n,s)=>_d(e,s,t,o)?[]:[vs(n,t)]));const Dd=(e,t,o)=>{const n=e[t];return $(n.cells,((n,s)=>_d(e,t,s,o)?[]:[n]))};const Nd=(e,t,o,n,s)=>{const r=_s(e).rows;const a=$(t,(e=>Ad(r,e,n)));const c=L(r,(e=>sl(e.cells)));const i=Cd(a,c);const l=Td(o,c);return Od(e,a,n,s,Ed,l,i)};const Md=(e,t,o,n,s,r,a)=>{const{cols:c,rows:i}=_s(e);const l=i[t[0]];const d=$(t,(e=>Dd(i,e,s)));const u=L(l.cells,((e,t)=>sl(Ad(i,t,s))));const f=[...i];H(t,(e=>{f[e]=a.transformRow(i[e],o)}));const m=[...c,...f];const g=xd(l,u);const p=zd(n,u);return Od(m,d,s,r,a.transformCell,p,g)};const Rd=(e,t,o,n)=>{const s=_s(e).rows;const r=L(t,(e=>vs(s[e.row],e.column)));return Od(e,r,o,n,Ed,E.none,T)};const Bd=e=>{if(!i(e)){throw new Error("cases must be an array")}if(e.length===0){throw new Error("there must be at least one case")}const t=[];const o={};H(e,((n,s)=>{const r=oe(n);if(r.length!==1){throw new Error("one and only one name per case")}const a=r[0];const c=n[a];if(o[a]!==undefined){throw new Error("duplicate key detected:"+a)}else if(a==="cata"){throw new Error("cannot have a case named cata (sorry)")}else if(!i(c)){throw new Error("case arguments must be an array")}t.push(a);o[a]=(...o)=>{const n=o.length;if(n!==c.length){throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+n)}const r=e=>{const n=oe(e);if(t.length!==n.length){throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","))}const s=G(t,(e=>M(n,e)));if(!s){throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "))}return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length){throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length)}const n=t[s];return n.apply(null,o)},match:r,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}}));return o};const Ld={generate:Bd};const Hd=Ld.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]);const Id={...Hd};const Pd=(e,t)=>{if(e.length===0){return Id.none()}if(e.length===1){return Id.only(0)}if(t===0){return Id.left(0,1)}if(t===e.length-1){return Id.right(t-1,t)}if(t>0&&t<e.length-1){return Id.middle(t-1,t,t+1)}return Id.none()};const Fd=(e,t,o,n,s)=>{const r=e.slice(0);const a=Pd(e,t);const c=v(L(r,v(0)));const i=e=>n.singleColumnWidth(r[e],o);const l=(e,t)=>s.calcLeftEdgeDeltas(r,e,t,o,n.minCellWidth(),n.isRelative);const d=(e,t,a)=>s.calcMiddleDeltas(r,e,t,a,o,n.minCellWidth(),n.isRelative);const u=(e,t)=>s.calcRightEdgeDeltas(r,e,t,o,n.minCellWidth(),n.isRelative);return a.fold(c,i,l,d,u)};const Vd=(e,t,o)=>{let n=0;for(let s=e;s<t;s++){n+=o[s]!==undefined?o[s]:0}return n};const jd=(e,t)=>{const o=Is.justCells(e);return L(o,(e=>{const o=Vd(e.column,e.column+e.colspan,t);return{element:e.element,width:o,colspan:e.colspan}}))};const Zd=(e,t)=>{const o=Is.justColumns(e);return L(o,((e,o)=>({element:e.element,width:t[o],colspan:e.colspan})))};const Ud=(e,t)=>L(e.all,((e,o)=>({element:e.element,height:t[o]})));const qd=e=>V(e,((e,t)=>e+t),0);const Wd=(e,t)=>{if(Is.hasColumns(e)){return Zd(e,t)}else{return jd(e,t)}};const $d=(e,t,o)=>{const n=Wd(e,t);H(n,(e=>{o.setElementWidth(e.element,e.width)}))};const Gd=(e,t,o,n,s)=>{const r=Is.fromTable(e);const a=s.getCellDelta(t);const c=s.getWidths(r,s);const i=o===r.grid.columns-1;const l=n.clampTableDelta(c,o,a,s.minCellWidth(),i);const d=Fd(c,o,l,s,n);const u=L(d,((e,t)=>e+c[t]));$d(r,u,s);n.resizeTable(s.adjustTableWidth,l,i)};const Kd=(e,t,o)=>{const n=Is.fromTable(e);const s=ia(n,e);const r=L(s,((e,n)=>o===n?Math.max(t+e,Jo()):e));const a=Ud(n,r);H(a,(e=>{Er(e.element,e.height)}));H(Is.justCells(n),(e=>{Or(e.element)}));const c=qd(r);Er(e,c)};const Yd=(e,t,o,n,s)=>{const r=Is.generate(t);const a=n.getWidths(r,n);const c=n.pixelWidth();const{newSizes:i,delta:l}=s.calcRedestributedWidths(a,c,o.pixelDelta,n.isRelative);$d(r,i,n);n.adjustTableWidth(l)};const Xd=(e,t,o,n)=>{const s=Is.generate(t);const r=n.getWidths(s,n);$d(s,r,n)};const Jd=e=>{const t=(e,t)=>{const o=R(e,(e=>e.column===t.column));return o?e:e.concat([t])};return j(e,t,[]).sort(((e,t)=>e.column-t.column))};const Qd=Ie("col");const eu=Ie("colgroup");const tu=e=>Oe(e)==="tr"||eu(e);const ou=e=>{const t=Wo(e,"colspan",1);const o=Wo(e,"rowspan",1);return{element:e,colspan:t,rowspan:o}};const nu=(e,t=ou)=>{const o=t=>Qd(t.element)?e.col(t):e.cell(t);const n=t=>eu(t.element)?e.colgroup(t):e.row(t);const s=e=>{if(tu(e)){return n({element:e})}else{const n=e;const s=o(t(n));r=E.some({item:n,replacement:s});return s}};let r=E.none();const a=(e,t)=>r.fold((()=>s(e)),(o=>t(e,o.item)?o.replacement:s(e)));return{getOrInit:a}};const su=e=>t=>{const o=[];const n=(e,t)=>U(o,(o=>t(o.item,e)));const s=n=>{const s=e==="td"?{scope:null}:{};const r=t.replace(n,e,s);o.push({item:n,sub:r});return r};const r=(e,t)=>{if(tu(e)||Qd(e)){return e}else{const o=e;return n(o,t).fold((()=>s(o)),(n=>t(e,n.item)?n.sub:s(o)))}};return{replaceOrInit:r}};const ru=e=>Ue(e,"scope").map((e=>e.substr(0,3)));const au=e=>{const t=t=>{const o=ru(t);o.each((e=>Fe(t,"scope",e)));return()=>{const n=e.cell({element:t,colspan:1,rowspan:1});Uo(n,"width");Uo(t,"width");o.each((e=>Fe(n,"scope",e)));return n}};const o=e=>{const t=()=>{const t=xo(L(e,ru));if(t.length===0){return E.none()}else{const e=t[0];const o=["row","col"];const n=R(t,(t=>t!==e&&M(o,t)));return n?E.none():E.from(e)}};Uo(e[0],"width");t().fold((()=>qe(e[0],"scope")),(t=>Fe(e[0],"scope",t+"group")));return v(e[0])};return{unmerge:t,merge:o}};const cu={modification:nu,transform:su,merging:au};const iu=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];const lu=(e,t)=>{const o=e.property().name(t);return M(["ol","ul"],o)};const du=(e,t)=>{const o=e.property().name(t);return M(iu,o)};const uu=(e,t)=>M(["br","img","hr","input"],e.property().name(t));const fu=Kc();const mu=e=>du(fu,e);const gu=e=>lu(fu,e);const pu=e=>uu(fu,e);const hu=e=>{const t=Ie("br");const o=e=>G(e,(e=>t(e)||Be(e)&&Ta(e).trim().length===0));const n=e=>Oe(e)==="li"||go(e,gu).isSome();const s=e=>gt(e).map((e=>{if(mu(e)){return true}if(pu(e)){return Oe(e)==="img"?false:true}return false})).getOr(false);const r=e=>La(e).bind((o=>{const r=s(o);return dt(o).map((s=>r===true||n(s)||t(o)||mu(s)&&!nt(e,s)?[]:[Je.fromTag("br")]))})).getOr([]);const a=()=>{const t=$(e,(e=>{const t=pt(e);return o(t)?[]:t.concat(r(e))}));return t.length===0?[Je.fromTag("br")]:t};const c=a();zt(e[0]);St(e[0],c)};const yu=e=>kc(e,true);const bu=e=>{const t=nn(e);if(t.length===0){Tt(e)}};const vu=(e,t)=>({grid:e,cursor:t});const ku=e=>te(e,(e=>te(e.cells,(e=>{const t=e.element;return So(yu(t),t)}))));const wu=(e,t,o)=>{var n,s;const r=_s(e).rows;return E.from((s=(n=r[t])===null||n===void 0?void 0:n.cells[o])===null||s===void 0?void 0:s.element).filter(yu).orThunk((()=>ku(r)))};const _u=(e,t,o)=>{const n=wu(e,t,o);return vu(e,n)};const xu=e=>{const t=(e,t)=>{const o=R(e,(e=>e.row===t.row));return o?e:e.concat([t])};return j(e,t,[]).sort(((e,t)=>e.row-t.row))};const Cu=(e,t,o,n)=>{const s=t[0].row;const r=xu(t);const a=V(r,((e,t)=>{const r=pd(e.grid,s,t.row+e.delta,o,n.getOrInit);return{grid:r,delta:e.delta+1}}),{grid:e,delta:0}).grid;return _u(a,s,t[0].column)};const Su=(e,t,o,n)=>{const s=xu(t);const r=s[s.length-1];const a=r.row+r.rowspan;const c=V(s,((e,t)=>pd(e,a,t.row,o,n.getOrInit)),e);return _u(c,a,t[0].column)};const zu=(e,t,o,n)=>{const s=t.details;const r=Jd(s);const a=r[0].column;const c=V(r,((e,t)=>{const s=yd(e.grid,a,t.column+e.delta,o,n.getOrInit);return{grid:s,delta:e.delta+1}}),{grid:e,delta:0}).grid;return _u(c,s[0].row,a)};const Tu=(e,t,o,n)=>{const s=t.details;const r=s[s.length-1];const a=r.column+r.colspan;const c=Jd(s);const i=V(c,((e,t)=>yd(e,a,t.column,o,n.getOrInit)),e);return _u(i,s[0].row,a)};const Eu=(e,t,o,n)=>{const s=Jd(t);const r=L(s,(e=>e.column));const a=Nd(e,r,true,o,n.replaceOrInit);return _u(a,t[0].row,t[0].column)};const Ou=(e,t,o,n)=>{const s=Rd(e,t,o,n.replaceOrInit);return _u(s,t[0].row,t[0].column)};const Au=(e,t,o,n)=>{const s=Jd(t);const r=L(s,(e=>e.column));const a=Nd(e,r,false,o,n.replaceOrInit);return _u(a,t[0].row,t[0].column)};const Du=(e,t,o,n)=>{const s=Rd(e,t,o,n.replaceOrInit);return _u(s,t[0].row,t[0].column)};const Nu=(e,t)=>(o,n,s,r,a)=>{const c=xu(n);const i=L(c,(e=>e.row));const l=Md(o,i,e,t,s,r.replaceOrInit,a);return _u(l,n[0].row,n[0].column)};const Mu=Nu("thead",true);const Ru=Nu("tbody",false);const Bu=Nu("tfoot",false);const Lu=(e,t,o,n)=>{const s=Jd(t.details);const r=bd(e,L(s,(e=>e.column)));const a=r.length>0?r[0].cells.length-1:0;return _u(r,s[0].row,Math.min(s[0].column,a))};const Hu=(e,t,o,n)=>{const s=xu(t);const r=vd(e,s[0].row,s[s.length-1].row);const a=Math.max(_s(r).rows.length-1,0);return _u(r,Math.min(t[0].row,a),t[0].column)};const Iu=(e,t,o,n)=>{const s=t.cells;hu(s);const r=Ul(e,t.bounds,o,n.merge(s));return vu(r,E.from(s[0]))};const Pu=(e,t,o,n)=>{const s=(e,t)=>ql(e,t,o,n.unmerge(t));const r=V(t,s,e);return vu(r,E.from(t[0]))};const Fu=(e,t,o,n)=>{const s=(e,t)=>{const o=Is.fromTable(e);return El(o,t,true)};const r=s(t.clipboard,t.generators);const a=It(t.row,t.column);const c=ud(a,e,r,t.generators,o);return c.fold((()=>vu(e,E.some(t.element))),(e=>_u(e,t.row,t.column)))};const Vu=(e,t,o)=>{const n=fn(e,o.section);const s=Is.generate(n);return El(s,t,true)};const ju=(e,t,o,n)=>{const s=_s(e).rows;const r=t.cells[0].column;const a=s[t.cells[0].row];const c=Vu(t.clipboard,t.generators,a);const i=fd(r,e,c,t.generators,o);return _u(i,t.cells[0].row,t.cells[0].column)};const Zu=(e,t,o,n)=>{const s=_s(e).rows;const r=t.cells[t.cells.length-1].column+t.cells[t.cells.length-1].colspan;const a=s[t.cells[0].row];const c=Vu(t.clipboard,t.generators,a);const i=fd(r,e,c,t.generators,o);return _u(i,t.cells[0].row,r)};const Uu=(e,t,o,n)=>{const s=_s(e).rows;const r=t.cells[0].row;const a=s[r];const c=Vu(t.clipboard,t.generators,a);const i=md(r,e,c,t.generators,o);return _u(i,t.cells[0].row,t.cells[0].column)};const qu=(e,t,o,n)=>{const s=_s(e).rows;const r=t.cells[t.cells.length-1].row+t.cells[t.cells.length-1].rowspan;const a=s[t.cells[0].row];const c=Vu(t.clipboard,t.generators,a);const i=md(r,e,c,t.generators,o);return _u(i,r,t.cells[0].column)};const Wu=(e,t)=>{const o=Is.fromTable(e);const n=Il(o,t);return n.bind((e=>{const t=e[e.length-1];const n=e[0].column;const s=t.column+t.colspan;const r=W(L(o.all,(e=>F(e.cells,(e=>e.column>=n&&e.column<s)))));return cl(r)})).getOr("")};const $u=(e,t)=>{const o=Is.fromTable(e);const n=Il(o,t);return n.bind(cl).getOr("")};const Gu=(e,t)=>{const o=Is.fromTable(e);const n=Il(o,t);return n.bind((e=>{const t=e[e.length-1];const n=e[0].row;const s=t.row+t.rowspan;const r=o.all.slice(n,s);return il(r)})).getOr("")};const Ku=(e,t,o,n)=>Xd(e,t,o,n.sizing);const Yu=(e,t,o,n)=>Yd(e,t,o,n.sizing,n.resize);const Xu=(e,t)=>R(t,(e=>e.column===0&&e.isLocked));const Ju=(e,t)=>R(t,(t=>t.column+t.colspan>=e.grid.columns&&t.isLocked));const Qu=(e,t)=>{const o=Ps(e);const n=Jd(t);return j(n,((e,t)=>{const n=o[t.column];const s=n.map(us).getOr(0);return e+s}),0)};const ef=e=>(t,o)=>Il(t,o).filter((o=>{const n=e?Xu:Ju;return!n(t,o)})).map((e=>({details:e,pixelDelta:Qu(t,e)})));const tf=(e,t)=>Pl(e,t).map((t=>({details:t,pixelDelta:-Qu(e,t)})));const of=e=>(t,o)=>Bl(t,o).filter((o=>{const n=e?Xu:Ju;return!n(t,o.cells)}));const nf=cu.transform("th");const sf=cu.transform("td");const rf=Ml(Cu,Il,h,h,cu.modification);const af=Ml(Su,Il,h,h,cu.modification);const cf=Ml(zu,ef(true),Yu,h,cu.modification);const lf=Ml(Tu,ef(false),Yu,h,cu.modification);const df=Ml(Lu,tf,Yu,bu,cu.modification);const uf=Ml(Hu,Il,h,bu,cu.modification);const ff=Ml(Eu,Pl,h,h,nf);const mf=Ml(Au,Pl,h,h,sf);const gf=Ml(Mu,Pl,h,h,nf);const pf=Ml(Ru,Pl,h,h,sf);const hf=Ml(Bu,Pl,h,h,sf);const yf=Ml(Ou,Pl,h,h,nf);const bf=Ml(Du,Pl,h,h,sf);const vf=Ml(Iu,jl,Ku,h,cu.merging);const kf=Ml(Pu,Zl,Ku,h,cu.merging);const wf=Ml(Fu,Rl,Ku,h,cu.modification);const _f=Ml(ju,of(true),h,h,cu.modification);const xf=Ml(Zu,of(false),h,h,cu.modification);const Cf=Ml(Uu,Bl,h,h,cu.modification);const Sf=Ml(qu,Bl,h,h,cu.modification);const zf=Wu;const Tf=$u;const Ef=Gu;const Of=(e,t)=>e.dispatch("NewRow",{node:t});const Af=(e,t)=>e.dispatch("NewCell",{node:t});const Df=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})};const Nf=(e,t,o,n,s)=>{e.dispatch("TableSelectionChange",{cells:t,start:o,finish:n,otherCells:s})};const Mf=e=>{e.dispatch("TableSelectionClear")};const Rf=(e,t,o,n,s)=>{e.dispatch("ObjectResizeStart",{target:t,width:o,height:n,origin:s})};const Bf=(e,t,o,n,s)=>{e.dispatch("ObjectResized",{target:t,width:o,height:n,origin:s})};const Lf={structure:false,style:true};const Hf={structure:true,style:false};const If={structure:true,style:true};const Pf=(e,t)=>{if(dc(e)){return ha.percentageSize(t)}else if(uc(e)){return ha.pixelSize(t)}else{return ha.getTableSize(t)}};const Ff=(e,t,o)=>{const n=e=>Oe(_c(e))==="table";const s=t=>!n(e)||ol(t).rows>1;const r=t=>!n(e)||ol(t).columns>1;const a=nc(e);const c=ic(e)?h:Gi;const i=t=>{switch(rc(e)){case"section":return yl.section();case"sectionCells":return yl.sectionCells();case"cells":return yl.cells();default:return yl.getTableSectionType(t,"section")}};const l=(t,n)=>n.cursor.fold((()=>{const n=nn(t);return Q(n).filter(no).map((n=>{o.clearSelectedCells(t.dom);const s=e.dom.createRng();s.selectNode(n.dom);e.selection.setRng(s);Fe(n,"data-mce-selected","1");return s}))}),(n=>{const s=$i(n);const r=e.dom.createRng();r.setStart(s.element.dom,s.offset);r.setEnd(s.element.dom,s.offset);e.selection.setRng(r);o.clearSelectedCells(t.dom);return E.some(r)}));const d=(o,n,s,r)=>(c,d,u=false)=>{Cc(c);const f=Je.fromDom(e.getDoc());const m=$a(s,f,a);const g={sizing:Pf(e,c),resize:ic(e)?el():tl(),section:i(c)};return n(c)?o(c,d,m,g).bind((o=>{t.refresh(c.dom);H(o.newRows,(t=>{Of(e,t.dom)}));H(o.newCells,(t=>{Af(e,t.dom)}));const n=l(c,o);if(no(c)){Cc(c);if(!u){Df(e,c.dom,r)}}return n.map((e=>({rng:e,effect:r})))})):E.none()};const u=d(uf,s,h,Hf);const f=d(df,r,h,Hf);const m=d(rf,T,h,Hf);const g=d(af,T,h,Hf);const p=d(cf,T,c,Hf);const y=d(lf,T,c,Hf);const b=d(vf,T,h,Hf);const v=d(kf,T,h,Hf);const k=d(_f,T,h,Hf);const w=d(xf,T,h,Hf);const _=d(Cf,T,h,Hf);const x=d(Sf,T,h,Hf);const C=d(wf,T,h,If);const S=d(yf,T,h,Hf);const z=d(bf,T,h,Hf);const O=d(ff,T,h,Hf);const A=d(mf,T,h,Hf);const D=d(gf,T,h,Hf);const N=d(pf,T,h,Hf);const M=d(hf,T,h,Hf);const R=Tf;const B=zf;const L=Ef;return{deleteRow:u,deleteColumn:f,insertRowsBefore:m,insertRowsAfter:g,insertColumnsBefore:p,insertColumnsAfter:y,mergeCells:b,unmergeCells:v,pasteColsBefore:k,pasteColsAfter:w,pasteRowsBefore:_,pasteRowsAfter:x,pasteCells:C,makeCellsHeader:S,unmakeCellsHeader:z,makeColumnsHeader:O,unmakeColumnsHeader:A,makeRowsHeader:D,makeRowsBody:N,makeRowsFooter:M,getTableRowType:L,getTableCellType:R,getTableColType:B}};const Vf=(e,t,o)=>{const n=Wo(e,t,1);if(o===1||n<=1){qe(e,t)}else{Fe(e,t,Math.min(o,n))}};const jf=(e,t)=>o=>{const n=o.column+o.colspan-1;const s=o.column;return n>=e&&s<t};const Zf=(e,t,o)=>{if(Is.hasColumns(e)){const n=F(Is.justColumns(e),jf(t,o));const s=L(n,(e=>{const n=Dt(e.element);Vf(n,"span",o-t);return n}));const r=Je.fromTag("colgroup");St(r,s);return[r]}else{return[]}};const Uf=(e,t,o)=>L(e.all,(e=>{const n=F(e.cells,jf(t,o));const s=L(n,(e=>{const n=Dt(e.element);Vf(n,"colspan",o-t);return n}));const r=Je.fromTag("tr");St(r,s);return r}));const qf=(e,t)=>{const o=Is.fromTable(e);const n=Pl(o,t);return n.map((e=>{const t=e[e.length-1];const n=e[0].column;const s=t.column+t.colspan;const r=Zf(o,n,s);const a=Uf(o,n,s);return[...r,...a]}))};const Wf=(e,t,o)=>{const n=Is.fromTable(e);const s=Il(n,t);return s.bind((e=>{const t=El(n,o,false);const s=_s(t).rows;const r=s.slice(e[0].row,e[e.length-1].row+e[e.length-1].rowspan);const a=$(r,(e=>{const t=F(e.cells,(e=>!e.isLocked));return t.length>0?[{...e,cells:t}]:[]}));const c=Al(a);return So(c.length>0,c)})).map((e=>_l(e)))};const $f=Ld.generate([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]);const Gf=(e,t,o)=>{const n=o.substring(0,o.length-e.length);const s=parseFloat(n);return n===s.toString()?t(s):$f.invalid(o)};const Kf=e=>{if(Do(e,"%")){return Gf("%",$f.percent,e)}if(Do(e,"px")){return Gf("px",$f.pixels,e)}return $f.invalid(e)};const Yf={...$f,from:Kf};const Xf=(e,t)=>L(e,(e=>{const o=Yf.from(e);return o.fold((()=>e),(e=>{const o=e/t*100;return o+"%"}),(e=>e+"%"))}));const Jf=(e,t,o)=>{const n=o/t;return L(e,(e=>{const t=Yf.from(e);return t.fold((()=>e),(e=>e*n+"px"),(e=>e/100*o+"px"))}))};const Qf=(e,t)=>{const o=e.fold((()=>v("")),(e=>{const o=e/t;return v(o+"px")}),(()=>{const e=100/t;return v(e+"%")}));return B(t,o)};const em=(e,t,o)=>e.fold((()=>t),(e=>Jf(t,o,e)),(e=>Xf(t,o)));const tm=(e,t,o)=>{const n=Yf.from(o);const s=G(e,(e=>e==="0px"))?Qf(n,e.length):em(n,e,t);return rm(s)};const om=(e,t)=>{if(e.length===0){return t}return V(e,((e,t)=>Yf.from(t).fold(v(0),k,k)+e),0)};const nm=(e,t)=>{const o=Math.floor(e);return{value:o+t,remainder:e-o}};const sm=(e,t)=>Yf.from(e).fold(v(e),(e=>e+t+"px"),(e=>e+t+"%"));const rm=e=>{if(e.length===0){return e}const t=V(e,((e,t)=>{const o=Yf.from(t).fold((()=>({value:t,remainder:0})),(e=>nm(e,"px")),(e=>({value:e+"%",remainder:0})));return{output:[o.value].concat(e.output),remainder:e.remainder+o.remainder}}),{output:[],remainder:0});const o=t.output;return o.slice(0,o.length-1).concat([sm(o[o.length-1],Math.round(t.remainder))])};const am=Yf.from;const cm=(e,t,o)=>{H(t,(t=>{const n=e.slice(t.column,t.colspan+t.column);const s=om(n,Xo());Po(t.element,"width",s+o)}))};const im=(e,t,o)=>{H(t,((t,n)=>{const s=om([e[n]],Xo());Po(t.element,"width",s+o)}))};const lm=(e,t,o)=>{H(o,(e=>{Uo(e.element,"height")}));H(t,((t,o)=>{Po(t.element,"height",e[o])}))};const dm=e=>am(e).fold(v("px"),v("px"),v("%"));const um=(e,t,o)=>{const n=Is.fromTable(e);const s=n.all;const r=Is.justCells(n);const a=Is.justColumns(n);t.each((t=>{const o=dm(t);const s=ds(e);const c=sa(n,e);const i=tm(c,s,t);if(Is.hasColumns(n)){im(i,a,o)}else{cm(i,r,o)}Po(e,"width",t)}));o.each((t=>{const o=Ws(e);const a=la(n,e);const c=tm(a,o,t);lm(c,s,r);Po(e,"height",t)}))};const fm=Wr;const mm=$r;const gm=Gr;const pm=e=>{qe(e,"width");qe(e,"height")};const hm=e=>{const t=qr(e);um(e,E.some(t),E.none());pm(e)};const ym=e=>{const t=Zr(e);um(e,E.some(t),E.none());pm(e)};const bm=e=>{const t=Ur(e);um(e,E.none(),E.some(t));pm(e)};const vm=e=>{Uo(e,"width");const t=sn(e);const o=t.length>0?t:nn(e);H(o,(e=>{Uo(e,"width");pm(e)}));pm(e)};const km={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:false};const wm=()=>Je.fromTag("th");const _m=()=>Je.fromTag("td");const xm=()=>Je.fromTag("col");const Cm=(e,t,o,n)=>{const s=Je.fromTag("tr");for(let r=0;r<e;r++){const e=n<t||r<o?wm():_m();if(r<o){Fe(e,"scope","row")}if(n<t){Fe(e,"scope","col")}wt(e,Je.fromTag("br"));wt(s,e)}return s};const Sm=e=>{const t=Je.fromTag("colgroup");B(e,(()=>wt(t,xm())));return t};const zm=(e,t,o,n)=>B(e,(e=>Cm(t,o,n,e)));const Tm=(e,t,o,n,s,r=km)=>{const a=Je.fromTag("table");const c=s!=="cells";Fo(a,r.styles);Ve(a,r.attributes);if(r.colGroups){wt(a,Sm(t))}const i=Math.min(e,o);if(c&&o>0){const e=Je.fromTag("thead");wt(a,e);const r=s==="sectionCells"?i:0;const c=zm(o,t,r,n);St(e,c)}const l=Je.fromTag("tbody");wt(a,l);const d=c?e-i:e;const u=c?0:o;const f=zm(d,t,u,n);St(l,f);return a};const Em=e=>e.dom.innerHTML;const Om=e=>{const t=Je.fromTag("div");const o=Je.fromDom(e.dom.cloneNode(true));wt(t,o);return Em(t)};const Am=(e,t)=>{e.selection.select(t.dom,true);e.selection.collapse(true)};const Dm=(e,t)=>{ko(t,"td,th").each(_(Am,e))};const Nm=(e,t)=>{H(fo(t,"tr"),(t=>{Of(e,t.dom);H(fo(t,"th,td"),(t=>{Af(e,t.dom)}))}))};const Mm=e=>a(e)&&e.indexOf("%")!==-1;const Rm=(e,t,o,n,s)=>{const r=yc(e);const a={styles:r,attributes:hc(e),colGroups:bc(e)};e.undoManager.ignore((()=>{const r=Tm(o,t,s,n,rc(e),a);Fe(r,"data-mce-id","__mce");const c=Om(r);e.insertContent(c);e.addVisual()}));return ko(_c(e),'table[data-mce-id="__mce"]').map((t=>{if(uc(e)){ym(t)}else if(fc(e)){vm(t)}else if(dc(e)||Mm(r.width)){hm(t)}Cc(t);qe(t,"data-mce-id");Nm(e,t);Dm(e,t);return t.dom})).getOrNull()};const Bm=(e,t,o,n={})=>{const s=e=>p(e)&&e>0;if(s(t)&&s(o)){const s=n.headerRows||0;const r=n.headerColumns||0;return Rm(e,o,t,r,s)}else{console.error("Invalid values for mceInsertTable - rows and columns values are required to insert a table.");return null}};var Lm=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const Hm="x-tinymce/dom-table-";const Im=Hm+"rows";const Pm=Hm+"columns";const Fm=e=>{const t=Lm.FakeClipboardItem(e);Lm.write([t])};const Vm=e=>{var t;const o=(t=Lm.read())!==null&&t!==void 0?t:[];return te(o,(t=>E.from(t.getType(e))))};const jm=e=>{if(Vm(e).isSome()){Lm.clear()}};const Zm=e=>{e.fold(qm,(e=>Fm({[Im]:e})))};const Um=()=>Vm(Im);const qm=()=>jm(Im);const Wm=e=>{e.fold(Gm,(e=>Fm({[Pm]:e})))};const $m=()=>Vm(Pm);const Gm=()=>jm(Pm);const Km=e=>Mi(Sc(e),xc(e)).filter(Mc);const Ym=e=>Ri(Sc(e),xc(e)).filter(Mc);const Xm=(e,t)=>{const o=xc(e);const n=()=>Km(e).each((t=>{rn(t,o).filter(x(o)).each((t=>{const o=Je.fromText("");vt(t,o);Tt(t);if(e.dom.isEmpty(e.getBody())){e.setContent("");e.selection.setCursorLocation()}else{const t=e.dom.createRng();t.setStart(o.dom,0);t.setEnd(o.dom,0);e.selection.setRng(t);e.nodeChanged()}}))}));const s=t=>Km(e).each((n=>{const s=fc(e)||uc(e)||dc(e);if(!s){rn(n,o).each((o=>{if(t==="relative"&&!fm(o)){hm(o)}else if(t==="fixed"&&!mm(o)){ym(o)}else if(t==="responsive"&&!gm(o)){vm(o)}Cc(o);Df(e,o.dom,Hf)}))}}));const r=e=>rn(e,o);const i=t=>Ym(e).bind((e=>r(e).map((o=>t(o,e)))));const l=(t,o)=>{i((t=>{e.formatter.toggle("tableclass",{value:o},t.dom);Df(e,t.dom,Lf)}))};const d=(t,o)=>{i((t=>{const n=Bi(e);const s=G(n,(t=>e.formatter.match("tablecellclass",{value:o},t.dom)));const r=s?e.formatter.remove:e.formatter.apply;H(n,(e=>r("tablecellclass",{value:o},e.dom)));Df(e,t.dom,Lf)}))};const u=()=>{Km(e).each((t=>{rn(t,o).each((o=>{vo(o,"caption").fold((()=>{const t=Je.fromTag("caption");wt(t,Je.fromText("Caption"));_t(o,t,0);e.selection.setCursorLocation(t.dom,0)}),(n=>{if(Ie("caption")(t)){ot("td",o).each((t=>e.selection.setCursorLocation(t.dom,0)))}Tt(n)}));Df(e,o.dom,Hf)}))}))};const f=t=>{e.focus()};const m=(t,o=false)=>i(((n,s)=>{const r=Ei(Bi(e),n,s);t(n,r,o).each(f)}));const g=()=>i(((t,o)=>{const n=Ei(Bi(e),t,o);const s=$a(h,Je.fromDom(e.getDoc()),E.none());return Wf(t,n,s)}));const p=()=>i(((t,o)=>{const n=Ei(Bi(e),t,o);return qf(t,n)}));const y=(t,o)=>o().each((o=>{const n=L(o,(e=>Dt(e)));i(((o,s)=>{const r=Ga(Je.fromDom(e.getDoc()));const a=Ai(Bi(e),s,n,r);t(o,a).each(f)}))}));const b=e=>(t,o)=>fe(o,"type").each((t=>{m(e(t),o.no_events)}));se({mceTableSplitCells:()=>m(t.unmergeCells),mceTableMergeCells:()=>m(t.mergeCells),mceTableInsertRowBefore:()=>m(t.insertRowsBefore),mceTableInsertRowAfter:()=>m(t.insertRowsAfter),mceTableInsertColBefore:()=>m(t.insertColumnsBefore),mceTableInsertColAfter:()=>m(t.insertColumnsAfter),mceTableDeleteCol:()=>m(t.deleteColumn),mceTableDeleteRow:()=>m(t.deleteRow),mceTableCutCol:()=>p().each((e=>{Wm(e);m(t.deleteColumn)})),mceTableCutRow:()=>g().each((e=>{Zm(e);m(t.deleteRow)})),mceTableCopyCol:()=>p().each((e=>Wm(e))),mceTableCopyRow:()=>g().each((e=>Zm(e))),mceTablePasteColBefore:()=>y(t.pasteColsBefore,$m),mceTablePasteColAfter:()=>y(t.pasteColsAfter,$m),mceTablePasteRowBefore:()=>y(t.pasteRowsBefore,Um),mceTablePasteRowAfter:()=>y(t.pasteRowsAfter,Um),mceTableDelete:n,mceTableCellToggleClass:d,mceTableToggleClass:l,mceTableToggleCaption:u,mceTableSizingMode:(e,t)=>s(t),mceTableCellType:b((e=>e==="th"?t.makeCellsHeader:t.unmakeCellsHeader)),mceTableColType:b((e=>e==="th"?t.makeColumnsHeader:t.unmakeColumnsHeader)),mceTableRowType:b((e=>{switch(e){case"header":return t.makeRowsHeader;case"footer":return t.makeRowsFooter;default:return t.makeRowsBody}}))},((t,o)=>e.addCommand(o,t)));e.addCommand("mceInsertTable",((t,o)=>{Bm(e,o.rows,o.columns,o.options)}));e.addCommand("mceTableApplyCellStyle",((t,o)=>{const n=e=>"tablecell"+e.toLowerCase().replace("-","");if(!c(o)){return}const s=F(Bi(e),Mc);if(s.length===0){return}const i=le(o,((t,o)=>e.formatter.has(n(o))&&a(t)));if(pe(i)){return}se(i,((t,o)=>{const r=n(o);H(s,(o=>{if(t===""){e.formatter.remove(r,{value:null},o.dom,true)}else{e.formatter.apply(r,{value:t},o.dom)}}))}));r(s[0]).each((t=>Df(e,t.dom,Lf)))}))};const Jm=(e,t)=>{const o=xc(e);const n=t=>Ri(Sc(e)).bind((n=>rn(n,o).map((o=>{const s=Ei(Bi(e),o,n);return t(o,s)})))).getOr("");se({mceTableRowType:()=>n(t.getTableRowType),mceTableCellType:()=>n(t.getTableCellType),mceTableColType:()=>n(t.getTableColType)},((t,o)=>e.addQueryValueHandler(o,t)))};const Qm=Ld.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]);const eg=(e,t,o,n)=>e.fold(t,o,n);const tg=e=>e.fold(k,k,k);const og=Qm.before;const ng=Qm.on;const sg=Qm.after;const rg={before:og,on:ng,after:sg,cata:eg,getStart:tg};const ag=(e,t)=>({selection:e,kill:t});const cg={create:ag};const ig=(e,t)=>{const o=e.document.createRange();o.selectNode(t.dom);return o};const lg=(e,t)=>{const o=e.document.createRange();dg(o,t);return o};const dg=(e,t)=>e.selectNodeContents(t.dom);const ug=(e,t)=>{t.fold((t=>{e.setStartBefore(t.dom)}),((t,o)=>{e.setStart(t.dom,o)}),(t=>{e.setStartAfter(t.dom)}))};const fg=(e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))};const mg=(e,t,o)=>{const n=e.document.createRange();ug(n,t);fg(n,o);return n};const gg=(e,t,o,n,s)=>{const r=e.document.createRange();r.setStart(t.dom,o);r.setEnd(n.dom,s);return r};const pg=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height});const hg=e=>{const t=e.getClientRects();const o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?E.some(o).map(pg):E.none()};const yg=Ld.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);const bg=(e,t,o)=>t(Je.fromDom(o.startContainer),o.startOffset,Je.fromDom(o.endContainer),o.endOffset);const vg=(e,t)=>t.match({domRange:e=>({ltr:v(e),rtl:E.none}),relative:(t,o)=>({ltr:mn((()=>mg(e,t,o))),rtl:mn((()=>E.some(mg(e,o,t))))}),exact:(t,o,n,s)=>({ltr:mn((()=>gg(e,t,o,n,s))),rtl:mn((()=>E.some(gg(e,n,s,t,o))))})});const kg=(e,t)=>{const o=t.ltr();if(o.collapsed){const n=t.rtl().filter((e=>e.collapsed===false));return n.map((e=>yg.rtl(Je.fromDom(e.endContainer),e.endOffset,Je.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>bg(e,yg.ltr,o)))}else{return bg(e,yg.ltr,o)}};const wg=(e,t)=>{const o=vg(e,t);return kg(e,o)};const _g=(e,t)=>{const o=wg(e,t);return o.match({ltr:(t,o,n,s)=>{const r=e.document.createRange();r.setStart(t.dom,o);r.setEnd(n.dom,s);return r},rtl:(t,o,n,s)=>{const r=e.document.createRange();r.setStart(n.dom,s);r.setEnd(t.dom,o);return r}})};yg.ltr;yg.rtl;const xg=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n});const Cg={create:xg};const Sg=(e,t,o,n)=>({start:rg.on(e,t),finish:rg.on(o,n)});const zg={create:Sg};const Tg=(e,t)=>{const o=_g(e,t);return Cg.create(Je.fromDom(o.startContainer),o.startOffset,Je.fromDom(o.endContainer),o.endOffset)};const Eg=zg.create;const Og=(e,t,o,n,s,r,a)=>{if(!(nt(o,s)&&n===r)){return wo(o,"td,th",t).bind((o=>wo(s,"td,th",t).bind((n=>Ag(e,t,o,n,a)))))}else{return E.none()}};const Ag=(e,t,o,n,s)=>{if(!nt(o,n)){return ii(o,n,t).bind((t=>{const n=t.boxes.getOr([]);if(n.length>1){s(e,n,t.start,t.finish);return E.some(cg.create(E.some(Eg(o,0,o,Aa(o))),true))}else{return E.none()}}))}else{return E.none()}};const Dg=(e,t,o,n,s)=>{const r=e=>{s.clearBeforeUpdate(o);s.selectRange(o,e.boxes,e.start,e.finish);return e.boxes};return mi(n,e,t,s.firstSelectedSelector,s.lastSelectedSelector).map(r)};const Ng=(e,t)=>({item:e,mode:t});const Mg=(e,t,o,n=Rg)=>e.property().parent(t).map((e=>Ng(e,n)));const Rg=(e,t,o,n=Bg)=>o.sibling(e,t).map((e=>Ng(e,n)));const Bg=(e,t,o,n=Bg)=>{const s=e.property().children(t);const r=o.first(s);return r.map((e=>Ng(e,n)))};const Lg=[{current:Mg,next:Rg,fallback:E.none()},{current:Rg,next:Bg,fallback:E.some(Mg)},{current:Bg,next:Bg,fallback:E.some(Rg)}];const Hg=(e,t,o,n,s=Lg)=>{const r=U(s,(e=>e.current===o));return r.bind((o=>o.current(e,t,n,o.next).orThunk((()=>o.fallback.bind((o=>Hg(e,t,o,n)))))))};const Ig=()=>{const e=(e,t)=>e.query().prevSibling(t);const t=e=>e.length>0?E.some(e[e.length-1]):E.none();return{sibling:e,first:t}};const Pg=()=>{const e=(e,t)=>e.query().nextSibling(t);const t=e=>e.length>0?E.some(e[0]):E.none();return{sibling:e,first:t}};const Fg={left:Ig,right:Pg};const Vg=(e,t,o,n,s,r)=>{const a=Hg(e,t,n,s);return a.bind((t=>{if(r(t.item)){return E.none()}else{return o(t.item)?E.some(t.item):Vg(e,t.item,o,t.mode,s,r)}}))};const jg=(e,t,o,n)=>Vg(e,t,o,Rg,Fg.left(),n);const Zg=(e,t,o,n)=>Vg(e,t,o,Rg,Fg.right(),n);const Ug=e=>t=>e.property().children(t).length===0;const qg=(e,t,o)=>$g(e,t,Ug(e),o);const Wg=(e,t,o)=>Gg(e,t,Ug(e),o);const $g=jg;const Gg=Zg;const Kg=Kc();const Yg=(e,t)=>qg(Kg,e,t);const Xg=(e,t)=>Wg(Kg,e,t);const Jg=(e,t,o)=>$g(Kg,e,t,o);const Qg=(e,t,o)=>Gg(Kg,e,t,o);const ep=(e,t,o)=>go(e,t,o).isSome();const tp=Ld.generate([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]);const op=(e,t,o)=>{const n=e.getRect(t);const s=e.getRect(o);return s.right>n.left&&s.left<n.right};const np=e=>wo(e,"tr");const sp=(e,t,o,n,s,r,a)=>wo(n,"td,th",a).bind((o=>wo(t,"td,th",a).map((t=>{if(!nt(o,t)){return ri(np,[o,t]).fold((()=>op(e,t,o)?tp.success():r(t)),(e=>r(t)))}else{return nt(n,o)&&Aa(o)===s?r(t):tp.none("in same cell")}})))).getOr(tp.none("default"));const rp=(e,t,o,n,s)=>e.fold(t,o,n,s);const ap={...tp,verify:sp,cata:rp};const cp=(e,t,o,n)=>({parent:e,children:t,element:o,index:n});const ip=e=>dt(e).bind((t=>{const o=pt(t);return lp(o,e).map((n=>cp(t,o,e,n)))}));const lp=(e,t)=>q(e,_(nt,t));const dp=Ie("br");const up=(e,t,o)=>t(e,o).bind((e=>Be(e)&&Ta(e).trim().length===0?up(e,t,o):E.some(e)));const fp=(e,t,o)=>o.traverse(t).orThunk((()=>up(t,o.gather,e))).map(o.relative);const mp=(e,t)=>ht(e,t).filter(dp).orThunk((()=>ht(e,t-1).filter(dp)));const gp=(e,t,o,n)=>mp(t,o).bind((t=>n.traverse(t).fold((()=>up(t,n.gather,e).map(n.relative)),(e=>ip(e).map((e=>rg.on(e.parent,e.index)))))));const pp=(e,t,o,n)=>{const s=dp(t)?fp(e,t,n):gp(e,t,o,n);return s.map((e=>({start:e,finish:e})))};const hp=e=>ap.cata(e,(e=>E.none()),(()=>E.none()),(e=>E.some(Vi(e,0))),(e=>E.some(Vi(e,Aa(e)))));const yp=(e,t)=>({left:e.left,top:e.top+t,right:e.right,bottom:e.bottom+t});const bp=(e,t)=>({left:e.left,top:e.top-t,right:e.right,bottom:e.bottom-t});const vp=(e,t,o)=>({left:e.left+t,top:e.top+o,right:e.right+t,bottom:e.bottom+o});const kp=e=>e.top;const wp=e=>e.bottom;const _p=(e,t,o)=>{if(o>=0&&o<Aa(t)){return e.getRangedRect(t,o,t,o+1)}else if(o>0){return e.getRangedRect(t,o-1,t,o)}return E.none()};const xp=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom});const Cp=(e,t)=>E.some(e.getRect(t));const Sp=(e,t,o)=>{if(Re(t)){return Cp(e,t).map(xp)}else if(Be(t)){return _p(e,t,o).map(xp)}else{return E.none()}};const zp=(e,t)=>{if(Re(t)){return Cp(e,t).map(xp)}else if(Be(t)){return e.getRangedRect(t,0,t,Aa(t)).map(xp)}else{return E.none()}};const Tp=5;const Ep=100;const Op=Ld.generate([{none:[]},{retry:["caret"]}]);const Ap=(e,t)=>e.left<t.left||Math.abs(t.right-e.left)<1||e.left>t.right;const Dp=(e,t,o)=>po(t,mu).fold(z,(t=>zp(e,t).exists((e=>Ap(o,e)))));const Np=(e,t,o,n,s)=>{const r=yp(s,Tp);if(Math.abs(o.bottom-n.bottom)<1){return Op.retry(r)}else if(o.top>s.bottom){return Op.retry(r)}else if(o.top===s.bottom){return Op.retry(yp(s,1))}else{return Dp(e,t,s)?Op.retry(vp(r,Tp,0)):Op.none()}};const Mp=(e,t,o,n,s)=>{const r=bp(s,Tp);if(Math.abs(o.top-n.top)<1){return Op.retry(r)}else if(o.bottom<s.top){return Op.retry(r)}else if(o.bottom===s.top){return Op.retry(bp(s,1))}else{return Dp(e,t,s)?Op.retry(vp(r,Tp,0)):Op.none()}};const Rp={point:kp,adjuster:Mp,move:bp,gather:Yg};const Bp={point:wp,adjuster:Np,move:yp,gather:Xg};const Lp=(e,t,o)=>e.elementFromPoint(t,o).filter((e=>Oe(e)==="table")).isSome();const Hp=(e,t,o,n,s)=>Ip(e,t,o,t.move(n,Tp),s);const Ip=(e,t,o,n,s)=>{if(s===0){return E.some(n)}if(Lp(e,n.left,t.point(n))){return Hp(e,t,o,n,s-1)}return e.situsFromPoint(n.left,t.point(n)).bind((r=>r.start.fold(E.none,(r=>zp(e,r).bind((a=>t.adjuster(e,r,a,o,n).fold(E.none,(n=>Ip(e,t,o,n,s-1))))).orThunk((()=>E.some(n)))),E.none)))};const Pp=(e,t,o)=>{if(e.point(t)>o.getInnerHeight()){return E.some(e.point(t)-o.getInnerHeight())}else if(e.point(t)<0){return E.some(-e.point(t))}else{return E.none()}};const Fp=(e,t,o)=>{const n=e.move(o,Tp);const s=Ip(t,e,o,n,Ep).getOr(n);return Pp(e,s,t).fold((()=>t.situsFromPoint(s.left,e.point(s))),(o=>{t.scrollBy(0,o);return t.situsFromPoint(s.left,e.point(s)-o)}))};const Vp={tryUp:_(Fp,Rp),tryDown:_(Fp,Bp),getJumpSize:v(Tp)};const jp=20;const Zp=(e,t,o)=>e.getSelection().bind((n=>pp(t,n.finish,n.foffset,o).fold((()=>E.some(Vi(n.finish,n.foffset))),(s=>{const r=e.fromSitus(s);const a=ap.verify(e,n.finish,n.foffset,r.finish,r.foffset,o.failure,t);return hp(a)}))));const Up=(e,t,o,n,s,r)=>{if(r===0){return E.none()}return $p(e,t,o,n,s).bind((a=>{const c=e.fromSitus(a);const i=ap.verify(e,o,n,c.finish,c.foffset,s.failure,t);return ap.cata(i,(()=>E.none()),(()=>E.some(a)),(a=>{if(nt(o,a)&&n===0){return qp(e,o,n,bp,s)}else{return Up(e,t,a,0,s,r-1)}}),(a=>{if(nt(o,a)&&n===Aa(a)){return qp(e,o,n,yp,s)}else{return Up(e,t,a,Aa(a),s,r-1)}}))}))};const qp=(e,t,o,n,s)=>Sp(e,t,o).bind((t=>Wp(e,s,n(t,Vp.getJumpSize()))));const Wp=(e,t,o)=>{const n=es().browser;if(n.isChromium()||n.isSafari()||n.isFirefox()){return t.retry(e,o)}else{return E.none()}};const $p=(e,t,o,n,s)=>Sp(e,o,n).bind((t=>Wp(e,s,t)));const Gp=(e,t,o)=>Zp(e,t,o).bind((n=>Up(e,t,n.element,n.offset,o,jp).map(e.fromSitus)));const Kp=(e,t)=>ep(e,(e=>dt(e).exists((e=>nt(e,t)))));const Yp=(e,t,o,n,s)=>wo(n,"td,th",t).bind((n=>wo(n,"table",t).bind((r=>{if(!Kp(s,r)){return E.none()}return Gp(e,t,o).bind((e=>wo(e.finish,"td,th",t).map((t=>({start:n,finish:t,range:e})))))}))));const Xp=(e,t,o,n,s,r)=>r(n,t).orThunk((()=>Yp(e,t,o,n,s).map((e=>{const t=e.range;return cg.create(E.some(Eg(t.start,t.soffset,t.finish,t.foffset)),true)}))));const Jp=(e,t)=>wo(e,"tr",t).bind((e=>wo(e,"table",t).bind((o=>{const n=fo(o,"tr");if(nt(e,n[0])){return Jg(o,(e=>La(e).isSome()),t).map((e=>{const t=Aa(e);return cg.create(E.some(Eg(e,t,e,t)),true)}))}else{return E.none()}}))));const Qp=(e,t)=>wo(e,"tr",t).bind((e=>wo(e,"table",t).bind((o=>{const n=fo(o,"tr");if(nt(e,n[n.length-1])){return Qg(o,(e=>Ba(e).isSome()),t).map((e=>cg.create(E.some(Eg(e,0,e,0)),true)))}else{return E.none()}}))));const eh=(e,t,o,n,s,r,a)=>Yp(e,o,n,s,r).bind((e=>Ag(t,o,e.start,e.finish,a)));const th=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};const oh=e=>{const t=th(E.none());const o=()=>t.get().each(e);const n=()=>{o();t.set(E.none())};const s=()=>t.get().isSome();const r=()=>t.get();const a=e=>{o();t.set(E.some(e))};return{clear:n,isSet:s,get:r,set:a}};const nh=()=>{const e=oh(h);const t=t=>e.get().each(t);return{...e,on:t}};const sh=(e,t)=>wo(e,"td,th",t);const rh=e=>ut(e).exists(kc);const ah=(e,t,o,n)=>{const s=nh();const r=s.clear;const a=r=>{s.on((s=>{n.clearBeforeUpdate(t);sh(r.target,o).each((a=>{ii(s,a,o).each((o=>{const s=o.boxes.getOr([]);if(s.length===1){const o=s[0];const a=wc(o)==="false";const c=_o(vc(r.target),o,nt);if(a&&c){n.selectRange(t,s,o,o);e.selectContents(o)}}else if(s.length>1){n.selectRange(t,s,o.start,o.finish);e.selectContents(a)}}))}))}))};const c=e=>{n.clear(t);sh(e.target,o).filter(rh).each(s.set)};const i=e=>{a(e)};const l=e=>{a(e);r()};return{clearstate:r,mousedown:c,mouseover:i,mouseup:l}};const ch={traverse:gt,gather:Xg,relative:rg.before,retry:Vp.tryDown,failure:ap.failedDown};const ih={traverse:mt,gather:Yg,relative:rg.before,retry:Vp.tryUp,failure:ap.failedUp};const lh=e=>t=>t===e;const dh=lh(38);const uh=lh(40);const fh=e=>e>=37&&e<=40;const mh={isBackward:lh(37),isForward:lh(39)};const gh={isBackward:lh(39),isForward:lh(37)};const ph=e=>{const t=e!==undefined?e.dom:document;const o=t.body.scrollLeft||t.documentElement.scrollLeft;const n=t.body.scrollTop||t.documentElement.scrollTop;return Ys(o,n)};const hh=(e,t,o)=>{const n=o!==undefined?o.dom:document;const s=n.defaultView;if(s){s.scrollBy(e,t)}};const yh=Ld.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]);const bh=e=>yh.exact(e.start,e.soffset,e.finish,e.foffset);const vh=e=>e.match({domRange:e=>Je.fromDom(e.startContainer),relative:(e,t)=>rg.getStart(e),exact:(e,t,o,n)=>e});const kh=yh.domRange;const wh=yh.relative;const _h=yh.exact;const xh=e=>{const t=vh(e);return lt(t)};const Ch=Cg.create;const Sh={domRange:kh,relative:wh,exact:_h,exactFromRange:bh,getWin:xh,range:Ch};const zh=(e,t,o)=>{var n,s;return E.from((s=(n=e.dom).caretPositionFromPoint)===null||s===void 0?void 0:s.call(n,t,o)).bind((t=>{if(t.offsetNode===null){return E.none()}const o=e.dom.createRange();o.setStart(t.offsetNode,t.offset);o.collapse();return E.some(o)}))};const Th=(e,t,o)=>{var n,s;return E.from((s=(n=e.dom).caretRangeFromPoint)===null||s===void 0?void 0:s.call(n,t,o))};const Eh=(()=>{if(document.caretPositionFromPoint){return zh}else if(document.caretRangeFromPoint){return Th}else{return E.none}})();const Oh=(e,t,o)=>{const n=Je.fromDom(e.document);return Eh(n,t,o).map((e=>Cg.create(Je.fromDom(e.startContainer),e.startOffset,Je.fromDom(e.endContainer),e.endOffset)))};const Ah=(e,t)=>{const o=Oe(e);if("input"===o){return rg.after(e)}else if(!M(["br","img"],o)){return rg.on(e,t)}else{return t===0?rg.before(e):rg.after(e)}};const Dh=(e,t)=>{const o=e.fold(rg.before,Ah,rg.after);const n=t.fold(rg.before,Ah,rg.after);return Sh.relative(o,n)};const Nh=(e,t,o,n)=>{const s=Ah(e,t);const r=Ah(o,n);return Sh.relative(s,r)};const Mh=(e,t,o,n)=>{const s=at(e);const r=s.dom.createRange();r.setStart(e.dom,t);r.setEnd(o.dom,n);return r};const Rh=(e,t,o,n)=>{const s=Mh(e,t,o,n);const r=nt(e,o)&&t===n;return s.collapsed&&!r};const Bh=e=>E.from(e.getSelection());const Lh=(e,t)=>{Bh(e).each((e=>{e.removeAllRanges();e.addRange(t)}))};const Hh=(e,t,o,n,s)=>{const r=gg(e,t,o,n,s);Lh(e,r)};const Ih=(e,t,o,n,s,r)=>{t.collapse(o.dom,n);t.extend(s.dom,r)};const Ph=(e,t)=>wg(e,t).match({ltr:(t,o,n,s)=>{Hh(e,t,o,n,s)},rtl:(t,o,n,s)=>{Bh(e).each((r=>{if(r.setBaseAndExtent){r.setBaseAndExtent(t.dom,o,n.dom,s)}else if(r.extend){try{Ih(e,r,t,o,n,s)}catch(r){Hh(e,n,s,t,o)}}else{Hh(e,n,s,t,o)}}))}});const Fh=(e,t,o,n,s)=>{const r=Nh(t,o,n,s);Ph(e,r)};const Vh=(e,t,o)=>{const n=Dh(t,o);Ph(e,n)};const jh=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0);const o=e.getRangeAt(e.rangeCount-1);return E.some(Cg.create(Je.fromDom(t.startContainer),t.startOffset,Je.fromDom(o.endContainer),o.endOffset))}else{return E.none()}};const Zh=e=>{if(e.anchorNode===null||e.focusNode===null){return jh(e)}else{const t=Je.fromDom(e.anchorNode);const o=Je.fromDom(e.focusNode);return Rh(t,e.anchorOffset,o,e.focusOffset)?E.some(Cg.create(t,e.anchorOffset,o,e.focusOffset)):jh(e)}};const Uh=(e,t,o=true)=>{const n=o?lg:ig;const s=n(e,t);Lh(e,s)};const qh=e=>Bh(e).filter((e=>e.rangeCount>0)).bind(Zh);const Wh=e=>qh(e).map((e=>Sh.exact(e.start,e.soffset,e.finish,e.foffset)));const $h=(e,t)=>{const o=_g(e,t);return hg(o)};const Gh=(e,t,o)=>Oh(e,t,o);const Kh=e=>{Bh(e).each((e=>e.removeAllRanges()))};const Yh=e=>{const t=(t,o)=>Je.fromPoint(Je.fromDom(e.document),t,o);const o=e=>e.dom.getBoundingClientRect();const n=(t,o,n,s)=>{const r=Sh.exact(t,o,n,s);return $h(e,r)};const s=()=>Wh(e).map((t=>Tg(e,t)));const r=t=>{const o=Sh.relative(t.start,t.finish);return Tg(e,o)};const a=(t,o)=>Gh(e,t,o).map((e=>zg.create(e.start,e.soffset,e.finish,e.foffset)));const c=()=>{Kh(e)};const i=(t=false)=>{Wh(e).each((o=>o.fold((e=>e.collapse(t)),((o,n)=>{const s=t?o:n;Vh(e,s,s)}),((o,n,s,r)=>{const a=t?o:s;const c=t?n:r;Fh(e,a,c,a,c)}))))};const l=t=>{Uh(e,t,false)};const d=t=>{Uh(e,t)};const u=t=>{Fh(e,t.start,t.soffset,t.finish,t.foffset)};const f=(t,o)=>{Vh(e,t,o)};const m=()=>e.innerHeight;const g=()=>{const t=ph(Je.fromDom(e.document));return t.top};const p=(t,o)=>{hh(t,o,Je.fromDom(e.document))};return{elementFromPoint:t,getRect:o,getRangedRect:n,getSelection:s,fromSitus:r,situsFromPoint:a,clearSelection:c,collapseSelection:i,setSelection:u,setRelativeSelection:f,selectNode:l,selectContents:d,getInnerHeight:m,getScrollY:g,scrollBy:p}};const Xh=(e,t)=>({rows:e,cols:t});const Jh=(e,t,o,n)=>{const s=Yh(e);const r=ah(s,t,o,n);return{clearstate:r.clearstate,mousedown:r.mousedown,mouseover:r.mouseover,mouseup:r.mouseup}};const Qh=e=>po(e,Me).exists(kc);const ey=(e,t)=>Qh(e)||Qh(t);const ty=(e,t,o,n)=>{const s=Yh(e);const r=()=>{n.clear(t);return E.none()};const a=(e,a,c,i,l,d)=>{const u=e.raw;const f=u.which;const m=u.shiftKey===true;const g=li(t,n.selectedSelector).fold((()=>{if(fh(f)&&!m){n.clearBeforeUpdate(t)}if(fh(f)&&m&&!ey(a,i)){return E.none}else if(uh(f)&&m){return _(eh,s,t,o,ch,i,a,n.selectRange)}else if(dh(f)&&m){return _(eh,s,t,o,ih,i,a,n.selectRange)}else if(uh(f)){return _(Xp,s,o,ch,i,a,Qp)}else if(dh(f)){return _(Xp,s,o,ih,i,a,Jp)}else{return E.none}}),(e=>{const o=o=>()=>{const r=te(o,(o=>Dg(o.rows,o.cols,t,e,n)));return r.fold((()=>ui(t,n.firstSelectedSelector,n.lastSelectedSelector).map((e=>{const o=uh(f)||d.isForward(f)?rg.after:rg.before;s.setRelativeSelection(rg.on(e.first,0),o(e.table));n.clear(t);return cg.create(E.none(),true)}))),(e=>E.some(cg.create(E.none(),true))))};if(fh(f)&&m&&!ey(a,i)){return E.none}else if(uh(f)&&m){return o([Xh(+1,0)])}else if(dh(f)&&m){return o([Xh(-1,0)])}else if(d.isBackward(f)&&m){return o([Xh(0,-1),Xh(-1,0)])}else if(d.isForward(f)&&m){return o([Xh(0,+1),Xh(+1,0)])}else if(fh(f)&&!m){return r}else{return E.none}}));return g()};const c=(e,s,r,a,c)=>li(t,n.selectedSelector).fold((()=>{const i=e.raw;const l=i.which;const d=i.shiftKey===true;if(!d){return E.none()}if(fh(l)&&ey(s,a)){return Og(t,o,s,r,a,c,n.selectRange)}else{return E.none()}}),E.none);return{keydown:a,keyup:c}};const oy=(e,t,o,n)=>{const s=Yh(e);return(e,r)=>{n.clearBeforeUpdate(t);ii(e,r,o).each((e=>{const o=e.boxes.getOr([]);n.selectRange(t,o,e.start,e.finish);s.selectContents(r);s.collapseSelection()}))}};const ny=(e,t)=>{const o=Ze(e,t);return o===undefined||o===""?[]:o.split(" ")};const sy=(e,t,o)=>{const n=ny(e,t);const s=n.concat([o]);Fe(e,t,s.join(" "));return true};const ry=(e,t,o)=>{const n=F(ny(e,t),(e=>e!==o));if(n.length>0){Fe(e,t,n.join(" "))}else{qe(e,t)}return false};const ay=e=>e.dom.classList!==undefined;const cy=e=>ny(e,"class");const iy=(e,t)=>sy(e,"class",t);const ly=(e,t)=>ry(e,"class",t);const dy=(e,t)=>{if(ay(e)){e.dom.classList.add(t)}else{iy(e,t)}};const uy=e=>{const t=ay(e)?e.dom.classList:cy(e);if(t.length===0){qe(e,"class")}};const fy=(e,t)=>{if(ay(e)){const o=e.dom.classList;o.remove(t)}else{ly(e,t)}uy(e)};const my=(e,t)=>ay(e)&&e.dom.classList.contains(t);const gy=(e,t)=>{H(t,(t=>{fy(e,t)}))};const py=e=>t=>{dy(t,e)};const hy=e=>t=>{gy(t,e)};const yy=e=>{const t=py(e.selected);const o=hy([e.selected,e.lastSelected,e.firstSelected]);const n=t=>{const n=fo(t,e.selectedSelector);H(n,o)};const s=(o,s,r,a)=>{n(o);H(s,t);dy(r,e.firstSelected);dy(a,e.lastSelected)};return{clearBeforeUpdate:n,clear:n,selectRange:s,selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}};const by=(e,t,o)=>{const n=t=>{qe(t,e.selected);qe(t,e.firstSelected);qe(t,e.lastSelected)};const s=t=>{Fe(t,e.selected,"1")};const r=e=>{a(e);o()};const a=t=>{const o=fo(t,`${e.selectedSelector},${e.firstSelectedSelector},${e.lastSelectedSelector}`);H(o,n)};const c=(o,n,a,c)=>{r(o);H(n,s);Fe(a,e.firstSelected,"1");Fe(c,e.lastSelected,"1");t(n,a,c)};return{clearBeforeUpdate:a,clear:r,selectRange:c,selectedSelector:e.selectedSelector,firstSelectedSelector:e.firstSelectedSelector,lastSelectedSelector:e.lastSelectedSelector}};const vy={byClass:yy,byAttr:by};const ky=(e,t,o,n)=>{switch(e.tag){case"none":return t();case"single":return n(e.element);case"multiple":return o(e.elements)}};const wy=()=>({tag:"none"});const _y=e=>({tag:"multiple",elements:e});const xy=e=>({tag:"single",element:e});const Cy=(e,t,o)=>{const n=()=>gi(e(),o).fold((()=>t().fold(wy,xy)),_y);return{get:n}};const Sy=(e,t)=>{const o=e.slice(0,t[t.length-1].row+1);const n=Al(o);return $(n,(e=>{const o=e.cells.slice(0,t[t.length-1].column+1);return L(o,(e=>e.element))}))};const zy=(e,t)=>{const o=e.slice(t[0].row+t[0].rowspan-1,e.length);const n=Al(o);return $(n,(e=>{const o=e.cells.slice(t[0].column+t[0].colspan-1,e.cells.length);return L(o,(e=>e.element))}))};const Ty=(e,t,o)=>{const n=Is.fromTable(e);const s=Il(n,t);return s.map((e=>{const t=El(n,o,false);const{rows:s}=_s(t);const r=Sy(s,e);const a=zy(s,e);return{upOrLeftCells:r,downOrRightCells:a}}))};const Ey=(e,t,o,n,s,r,a)=>({target:e,x:t,y:o,stop:n,prevent:s,kill:r,raw:a});const Oy=e=>{const t=Je.fromDom(to(e).getOr(e.target));const o=()=>e.stopPropagation();const n=()=>e.preventDefault();const s=y(n,o);return Ey(t,e.clientX,e.clientY,o,n,s,e)};const Ay=(e,t)=>o=>{if(e(o)){t(Oy(o))}};const Dy=(e,t,o,n,s)=>{const r=Ay(o,n);e.dom.addEventListener(t,r,s);return{unbind:_(My,e,t,r,s)}};const Ny=(e,t,o,n)=>Dy(e,t,o,n,false);const My=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)};const Ry=T;const By=(e,t,o)=>Ny(e,t,Ry,o);const Ly=Oy;const Hy=e=>!my(Je.fromDom(e.target),"ephox-snooker-resizer-bar");const Iy=(e,t)=>{const o=Cy((()=>Je.fromDom(e.getBody())),(()=>Ri(Sc(e),xc(e))),Ti.selectedSelector);const n=(t,o,n)=>{const s=rn(o);s.each((s=>{const r=L(t,(e=>e.dom));const a=nc(e);const c=$a(h,Je.fromDom(e.getDoc()),a);const i=Bi(e);const l=Ty(s,{selection:i},c).map((e=>re(e,(e=>L(e,(e=>e.dom)))))).getOrUndefined();Nf(e,r,o.dom,n.dom,l)}))};const s=()=>Mf(e);const r=vy.byAttr(Ti,n,s);e.on("init",(o=>{const n=e.getWin();const s=_c(e);const a=xc(e);const c=()=>{const t=e.selection;const o=Je.fromDom(t.getStart());const n=Je.fromDom(t.getEnd());const a=ri(rn,[o,n]);a.fold((()=>r.clear(s)),h)};const i=Jh(n,s,a,r);const l=ty(n,s,a,r);const d=oy(n,s,a,r);const u=e=>e.raw.shiftKey===true;e.on("TableSelectorChange",(e=>d(e.start,e.finish)));const f=(t,o)=>{if(!u(t)){return}if(o.kill){t.kill()}o.selection.each((t=>{const o=Sh.relative(t.start,t.finish);const s=_g(n,o);e.selection.setRng(s)}))};const m=t=>{const o=Ly(t);if(o.raw.shiftKey&&fh(o.raw.which)){const t=e.selection.getRng();const n=Je.fromDom(t.startContainer);const s=Je.fromDom(t.endContainer);l.keyup(o,n,t.startOffset,s,t.endOffset).each((e=>{f(o,e)}))}};const g=o=>{const n=Ly(o);t.hide();const s=e.selection.getRng();const r=Je.fromDom(s.startContainer);const a=Je.fromDom(s.endContainer);const c=Zs(mh,gh)(Je.fromDom(e.selection.getStart()));l.keydown(n,r,s.startOffset,a,s.endOffset,c).each((e=>{f(n,e)}));t.show()};const p=e=>e.button===0;const y=e=>{if(e.buttons===undefined){return true}return(e.buttons&1)!==0};const b=e=>{i.clearstate()};const v=e=>{if(p(e)&&Hy(e)){i.mousedown(Ly(e))}};const k=e=>{if(y(e)&&Hy(e)){i.mouseover(Ly(e))}};const w=e=>{if(p(e)&&Hy(e)){i.mouseup(Ly(e))}};const _=()=>{const e=th(Je.fromDom(s));const t=th(0);const o=o=>{const n=Je.fromDom(o.target);if(Ie("td")(n)||Ie("th")(n)){const s=e.get();const r=t.get();if(nt(s,n)&&o.timeStamp-r<300){o.preventDefault();d(n,n)}}e.set(n);t.set(o.timeStamp)};return{touchEnd:o}};const x=_();e.on("dragstart",b);e.on("mousedown",v);e.on("mouseover",k);e.on("mouseup",w);e.on("touchend",x.touchEnd);e.on("keyup",m);e.on("keydown",g);e.on("NodeChange",c)}));e.on("PreInit",(()=>{e.serializer.addTempAttr(Ti.firstSelected);e.serializer.addTempAttr(Ti.lastSelected)}));const a=e=>r.clear(Je.fromDom(e));const c=()=>ky(o.get(),v([]),(e=>L(e,(e=>e.dom))),(e=>[e.dom]));return{getSelectedCells:c,clearSelectedCells:a}};const Py=e=>{let t=[];const o=e=>{if(e===undefined){throw new Error("Event bind error: undefined handler")}t.push(e)};const n=e=>{t=F(t,(t=>t!==e))};const s=(...o)=>{const n={};H(e,((e,t)=>{n[e]=o[t]}));H(t,(e=>{e(n)}))};return{bind:o,unbind:n,trigger:s}};const Fy=e=>{const t=re(e,(e=>({bind:e.bind,unbind:e.unbind})));const o=re(e,(e=>e.trigger));return{registry:t,trigger:o}};const Vy=(e,t)=>{let o=null;const n=()=>{if(!l(o)){clearTimeout(o);o=null}};const s=(...s)=>{n();o=setTimeout((()=>{o=null;e.apply(null,s)}),t)};return{cancel:n,throttle:s}};const jy=e=>e.slice(0).sort();const Zy=(e,t)=>{throw new Error("All required keys ("+jy(e).join(", ")+") were not specified. Specified keys were: "+jy(t).join(", ")+".")};const Uy=e=>{throw new Error("Unsupported keys for object: "+jy(e).join(", "))};const qy=(e,t)=>{if(!i(t)){throw new Error("The "+e+" fields must be an array. Was: "+t+".")}H(t,(t=>{if(!a(t)){throw new Error("The value "+t+" in the "+e+" fields was not a string.")}}))};const Wy=(e,t)=>{throw new Error("All values need to be of type: "+t+". Keys ("+jy(e).join(", ")+") were not.")};const $y=e=>{const t=jy(e);const o=U(t,((e,o)=>o<t.length-1&&e===t[o+1]));o.each((e=>{throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}))};const Gy=(e,t)=>Ky(e,t,{validate:g,label:"function"});const Ky=(e,t,o)=>{if(t.length===0){throw new Error("You must specify at least one required field.")}qy("required",t);$y(t);return n=>{const s=oe(n);const r=G(t,(e=>M(s,e)));if(!r){Zy(t,s)}e(t,s);const a=F(t,(e=>!o.validate(n[e],e)));if(a.length>0){Wy(a,o.label)}return n}};const Yy=(e,t)=>{const o=F(t,(t=>!M(e,t)));if(o.length>0){Uy(o)}};const Xy=e=>Gy(Yy,e);const Jy=Xy(["compare","extract","mutate","sink"]);const Qy=Xy(["element","start","stop","destroy"]);const eb=Xy(["forceDrop","drop","move","delayDrop"]);const tb=()=>{let e=E.none();const t=()=>{e=E.none()};const o=(t,o)=>{const n=e.map((e=>t.compare(e,o)));e=E.some(o);return n};const n=(e,t)=>{const n=t.extract(e);n.each((e=>{const n=o(t,e);n.each((e=>{s.trigger.move(e)}))}))};const s=Fy({move:Py(["info"])});return{onEvent:n,reset:t,events:s.registry}};const ob=()=>{const e=Fy({move:Py(["info"])});return{onEvent:h,reset:h,events:e.registry}};const nb=()=>{const e=ob();const t=tb();let o=e;const n=()=>{o.reset();o=t};const s=()=>{o.reset();o=e};const r=(e,t)=>{o.onEvent(e,t)};const a=()=>o===t;return{on:n,off:s,isOn:a,onEvent:r,events:t.events}};const sb=(e,t,o)=>{let n=false;const s=Fy({start:Py([]),stop:Py([])});const r=nb();const a=()=>{g.stop();if(r.isOn()){r.off();s.trigger.stop()}};const c=Vy(a,200);const i=e=>{g.start(e);r.on();s.trigger.start()};const l=e=>{c.cancel();r.onEvent(e,t)};r.events.move.bind((o=>{t.mutate(e,o.info)}));const d=()=>{n=true};const u=()=>{n=false};const f=()=>n;const m=e=>(...t)=>{if(n){e.apply(null,t)}};const g=t.sink(eb({forceDrop:a,drop:m(a),move:m(l),delayDrop:m(c.throttle)}),o);const p=()=>{g.destroy()};return{element:g.element,go:i,on:d,off:u,isActive:f,destroy:p,events:s.registry}};const rb=e=>{const t=e.replace(/\./g,"-");const o=e=>t+"-"+e;return{resolve:o}};const ab=rb("ephox-dragster");const cb=ab.resolve;const ib=e=>{const t={layerClass:cb("blocker"),...e};const o=Je.fromTag("div");Fe(o,"role","presentation");Fo(o,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"});dy(o,cb("blocker"));dy(o,t.layerClass);const n=v(o);const s=()=>{Tt(o)};return{element:n,destroy:s}};const lb=(e,t)=>Ys(t.left-e.left,t.top-e.top);const db=e=>E.some(Ys(e.x,e.y));const ub=(e,t)=>{e.mutate(t.left,t.top)};const fb=(e,t)=>{const o=ib(t);const n=By(o.element(),"mousedown",e.forceDrop);const s=By(o.element(),"mouseup",e.drop);const r=By(o.element(),"mousemove",e.move);const a=By(o.element(),"mouseout",e.delayDrop);const c=()=>{o.destroy();s.unbind();r.unbind();a.unbind();n.unbind()};const i=e=>{wt(e,o.element())};const l=()=>{Tt(o.element())};return Qy({element:o.element,start:i,stop:l,destroy:c})};var mb=Jy({compare:lb,extract:db,sink:fb,mutate:ub});const gb=(e,t={})=>{var o;const n=(o=t.mode)!==null&&o!==void 0?o:mb;return sb(e,n,t)};const pb=rb("ephox-snooker");const hb=pb.resolve;const yb=()=>{const e=Fy({drag:Py(["xDelta","yDelta"])});const t=(t,o)=>{e.trigger.drag(t,o)};return{mutate:t,events:e.registry}};const bb=()=>{const e=Fy({drag:Py(["xDelta","yDelta","target"])});let t=E.none();const o=yb();o.events.drag.bind((o=>{t.each((t=>{e.trigger.drag(o.xDelta,o.yDelta,t)}))}));const n=e=>{t=E.some(e)};const s=()=>t;return{assign:n,get:s,mutate:o.mutate,events:e.registry}};const vb=(e,t,o,n,s)=>{const r=Je.fromTag("div");Fo(r,{position:"absolute",left:t-n/2+"px",top:o+"px",height:s+"px",width:n+"px"});Ve(r,{"data-column":e,role:"presentation"});return r};const kb=(e,t,o,n,s)=>{const r=Je.fromTag("div");Fo(r,{position:"absolute",left:t+"px",top:o-s/2+"px",height:s+"px",width:n+"px"});Ve(r,{"data-row":e,role:"presentation"});return r};const wb=hb("resizer-bar");const _b=hb("resizer-rows");const xb=hb("resizer-cols");const Cb=7;const Sb=(e,t)=>$(e.all,((e,o)=>t(e.element)?[o]:[]));const zb=(e,t)=>{const o=[];B(e.grid.columns,(n=>{const s=Is.getColumnAt(e,n).map((e=>e.element));if(s.forall(t)){o.push(n)}}));return F(o,(o=>{const n=Is.filterItems(e,(e=>e.column===o));return G(n,(e=>t(e.element)))}))};const Tb=e=>{const t=fo(e.parent(),"."+wb);H(t,Tt)};const Eb=(e,t,o)=>{const n=e.origin();H(t,(t=>{t.each((t=>{const s=o(n,t);dy(s,wb);wt(e.parent(),s)}))}))};const Ob=(e,t,o,n)=>{Eb(e,t,((e,t)=>{const s=vb(t.col,t.x-e.left,o.top-e.top,Cb,n);dy(s,xb);return s}))};const Ab=(e,t,o,n)=>{Eb(e,t,((e,t)=>{const s=kb(t.row,o.left-e.left,t.y-e.top,n,Cb);dy(s,_b);return s}))};const Db=(e,t,o,n,s)=>{const r=Qs(o);const a=t.isResizable;const c=n.length>0?fr.positions(n,o):[];const i=c.length>0?Sb(e,a):[];const l=F(c,((e,t)=>R(i,(e=>t===e))));Ab(t,l,r,us(o));const d=s.length>0?hr.positions(s,o):[];const u=d.length>0?zb(e,a):[];const f=F(d,((e,t)=>R(u,(e=>t===e))));Ob(t,f,r,$s(o))};const Nb=(e,t)=>{Tb(e);if(e.isResizable(t)){const o=Is.fromTable(t);const n=Vs(o);const s=Ps(o);Db(o,e,t,n,s)}};const Mb=(e,t)=>{const o=fo(e.parent(),"."+wb);H(o,t)};const Rb=e=>{Mb(e,(e=>{Po(e,"display","none")}))};const Bb=e=>{Mb(e,(e=>{Po(e,"display","block")}))};const Lb=e=>my(e,_b);const Hb=e=>my(e,xb);const Ib=hb("resizer-bar-dragging");const Pb=e=>{const t=bb();const o=gb(t,{});let n=E.none();const s=(e,t)=>E.from(Ze(e,t));t.events.drag.bind((e=>{s(e.target,"data-row").each((t=>{const o=Yo(e.target,"top");Po(e.target,"top",o+e.yDelta+"px")}));s(e.target,"data-column").each((t=>{const o=Yo(e.target,"left");Po(e.target,"left",o+e.xDelta+"px")}))}));const r=(e,t)=>{const o=Yo(e,t);const n=Wo(e,"data-initial-"+t,0);return o-n};o.events.stop.bind((()=>{t.get().each((t=>{n.each((o=>{s(t,"data-row").each((e=>{const n=r(t,"top");qe(t,"data-initial-top");m.trigger.adjustHeight(o,n,parseInt(e,10))}));s(t,"data-column").each((e=>{const n=r(t,"left");qe(t,"data-initial-left");m.trigger.adjustWidth(o,n,parseInt(e,10))}));Nb(e,o)}))}))}));const a=(n,s)=>{m.trigger.startAdjust();t.assign(n);Fe(n,"data-initial-"+s,Yo(n,s));dy(n,Ib);Po(n,"opacity","0.2");o.go(e.parent())};const c=By(e.parent(),"mousedown",(e=>{if(Lb(e.target)){a(e.target,"top")}if(Hb(e.target)){a(e.target,"left")}}));const i=t=>nt(t,e.view());const l=e=>wo(e,"table",i).filter(kc);const d=By(e.view(),"mouseover",(t=>{l(t.target).fold((()=>{if(no(t.target)){Tb(e)}}),(t=>{if(o.isActive()){n=E.some(t);Nb(e,t)}}))}));const u=()=>{c.unbind();d.unbind();o.destroy();Tb(e)};const f=t=>{Nb(e,t)};const m=Fy({adjustHeight:Py(["table","delta","row"]),adjustWidth:Py(["table","delta","column"]),startAdjust:Py([])});return{destroy:u,refresh:f,on:o.on,off:o.off,hideBars:_(Rb,e),showBars:_(Bb,e),events:m.registry}};const Fb=(e,t,o)=>{const n=fr;const s=hr;const r=Pb(e);const a=Fy({beforeResize:Py(["table","type"]),afterResize:Py(["table","type"]),startDrag:Py([])});r.events.adjustHeight.bind((e=>{const t=e.table;a.trigger.beforeResize(t,"row");const o=n.delta(e.delta,t);Kd(t,o,e.row);a.trigger.afterResize(t,"row")}));r.events.startAdjust.bind((e=>{a.trigger.startDrag()}));r.events.adjustWidth.bind((e=>{const n=e.table;a.trigger.beforeResize(n,"col");const r=s.delta(e.delta,n);const c=o(n);Gd(n,r,e.column,t,c);a.trigger.afterResize(n,"col")}));return{on:r.on,off:r.off,refreshBars:r.refresh,hideBars:r.hideBars,showBars:r.showBars,destroy:r.destroy,events:a.registry}};const Vb={create:Fb};const jb=(e,t)=>{const o=Le(e)?it(e):e;return{parent:v(o),view:v(e),origin:v(Ys(0,0)),isResizable:t}};const Zb=(e,t,o)=>{const n=()=>Qs(t);return{parent:v(t),view:v(e),origin:n,isResizable:o}};const Ub=(e,t,o)=>({parent:v(t),view:v(e),origin:v(Ys(0,0)),isResizable:o});const qb={only:jb,detached:Zb,body:Ub};const Wb=()=>{const e=Je.fromTag("div");Fo(e,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"});wt(so(),e);return e};const $b=(e,t)=>e.inline?qb.body(Je.fromDom(e.getBody()),Wb(),t):qb.only(Je.fromDom(e.getDoc()),t);const Gb=(e,t)=>{if(e.inline){Tt(t.parent())}};const Kb=e=>m(e)&&e.nodeName==="TABLE";const Yb="bar-";const Xb=e=>Ze(e,"data-mce-resize")!=="false";const Jb=e=>{const t=Is.fromTable(e);if(!Is.hasColumns(t)){H(nn(e),(e=>{const t=Vo(e,"width");Po(e,"width",t);qe(e,"width")}))}};const Qb=e=>Ao(e,"corner-");const ev=e=>Eo(e,"corner-");const tv=e=>{const t=nh();const o=nh();const n=nh();let s;let r;let a;let c;const i=t=>Pf(e,t);const l=()=>cc(e)?tl():el();const d=e=>ol(e).columns;const u=e=>ol(e).rows;const f=(t,o,n,f)=>{const m=ev(o);const g=Do(m,"e");const p=Ao(m,"n");if(r===""){hm(t)}if(c===""){bm(t)}if(n!==s&&r!==""){Po(t,"width",r);const o=l();const a=i(t);const c=cc(e)||g?d(t)-1:0;Gd(t,n-s,c,o,a)}else if(Dc(r)){const e=parseFloat(r.replace("%",""));const o=n*e/s;Po(t,"width",o+"%")}if(Nc(r)){Jb(t)}if(f!==a&&c!==""){Po(t,"height",c);const e=p?0:u(t)-1;Kd(t,f-a,e)}};const m=()=>{o.on((e=>{e.destroy()}));n.on((t=>{Gb(e,t)}))};e.on("init",(()=>{const s=$b(e,Xb);n.set(s);if(sc(e)&&mc(e)){const n=l();const r=Vb.create(s,n,i);r.on();r.events.startDrag.bind((o=>{t.set(e.selection.getRng())}));r.events.beforeResize.bind((t=>{const o=t.table.dom;Rf(e,o,zc(o),Tc(o),Yb+t.type)}));r.events.afterResize.bind((o=>{const n=o.table;const s=n.dom;Cc(n);t.on((t=>{e.selection.setRng(t);e.focus()}));Bf(e,s,zc(s),Tc(s),Yb+o.type);e.undoManager.add()}));o.set(r)}}));e.on("ObjectResizeStart",(t=>{const o=t.target;if(Kb(o)){const n=Je.fromDom(o);H(e.dom.select(".mce-clonedresizable"),(t=>{e.dom.addClass(t,"mce-"+ac(e)+"-columns")}));if(!mm(n)&&uc(e)){ym(n)}else if(!fm(n)&&dc(e)){hm(n)}if(gm(n)&&Ao(t.origin,Yb)){hm(n)}s=t.width;r=fc(e)?"":Oc(e,o).getOr("");a=t.height;c=Ac(e,o).getOr("")}}));e.on("ObjectResized",(t=>{const o=t.target;if(Kb(o)){const n=Je.fromDom(o);const s=t.origin;if(Qb(s)){f(n,s,t.width,t.height)}Cc(n);Df(e,n.dom,Lf)}}));e.on("SwitchMode",(()=>{o.on((t=>{if(e.mode.isReadOnly()){t.hideBars()}else{t.showBars()}}))}));e.on("dragstart dragend",(e=>{o.on((t=>{if(e.type==="dragstart"){t.hideBars();t.off()}else{t.on();t.showBars()}}))}));e.on("remove",(()=>{m()}));const g=e=>{o.on((t=>t.refreshBars(Je.fromDom(e))))};const p=()=>{o.on((e=>e.hideBars()))};const h=()=>{o.on((e=>e.showBars()))};return{refresh:g,hide:p,show:h}};const ov=e=>{oc(e);const t=tv(e);const o=Iy(e,t);const n=Ff(e,t,o);Xm(e,n);Jm(e,n);Fi(e,n);return{getSelectedCells:o.getSelectedCells,clearSelectedCells:o.clearSelectedCells}};const nv=e=>{const t=ov(e);return{table:t}};var sv=()=>{e.add("dom",nv)};sv()})()},()=>{(function(){"use strict";const e=Object.getPrototypeOf;const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=e=>t=>e===t;const a=(o,n)=>i(o)&&t(o,n,((t,o)=>e(t)===o));const c=n("string");const i=n("object");const l=e=>a(e,Object);const d=n("array");const u=r(null);const f=s("boolean");const m=r(undefined);const g=e=>e===null||e===undefined;const p=e=>!g(e);const h=s("function");const y=s("number");const b=(e,t)=>{if(d(e)){for(let o=0,n=e.length;o<n;++o){if(!t(e[o])){return false}}return true}return false};const v=()=>{};const k=e=>()=>e();const w=(e,t)=>(...o)=>e(t.apply(null,o));const _=(e,t)=>o=>e(t(o));const x=e=>()=>e;const C=e=>e;const S=(e,t)=>e===t;function z(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const T=e=>t=>!e(t);const E=e=>()=>{throw new Error(e)};const O=e=>e();const A=x(false);const D=x(true);class N{constructor(e,t){this.tag=e;this.value=t}static some(e){return new N(true,e)}static none(){return N.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return N.some(e(this.value))}else{return N.none()}}bind(e){if(this.tag){return e(this.value)}else{return N.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return N.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return p(e)?N.some(e):N.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}N.singletonNone=new N(false);const M=Array.prototype.slice;const R=Array.prototype.indexOf;const B=Array.prototype.push;const L=(e,t)=>R.call(e,t);const H=(e,t)=>{const o=L(e,t);return o===-1?N.none():N.some(o)};const I=(e,t)=>L(e,t)>-1;const P=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return true}}return false};const F=(e,t)=>{const o=[];for(let n=0;n<e;n++){o.push(t(n))}return o};const V=(e,t)=>{const o=[];for(let n=0;n<e.length;n+=t){const s=M.call(e,n,n+t);o.push(s)}return o};const j=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const Z=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const U=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}};const q=(e,t)=>{const o=[];const n=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];const a=t(r,s)?o:n;a.push(r)}return{pass:o,fail:n}};const W=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const $=(e,t,o)=>{U(e,((e,n)=>{o=t(o,e,n)}));return o};const G=(e,t,o)=>{Z(e,((e,n)=>{o=t(o,e,n)}));return o};const K=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){return N.some(s)}else if(o(s,n)){break}}return N.none()};const Y=(e,t)=>K(e,t,A);const X=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return N.some(o)}}return N.none()};const J=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!d(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}B.apply(t,e[o])}return t};const Q=(e,t)=>J(j(e,t));const ee=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(t(n,o)!==true){return false}}return true};const te=e=>{const t=M.call(e,0);t.reverse();return t};const oe=(e,t)=>W(e,(e=>!I(t,e)));const ne=(e,t)=>{const o={};for(let n=0,s=e.length;n<s;n++){const s=e[n];o[String(s)]=t(s,n)}return o};const se=e=>[e];const re=(e,t)=>{const o=M.call(e,0);o.sort(t);return o};const ae=(e,t)=>t>=0&&t<e.length?N.some(e[t]):N.none();const ce=e=>ae(e,0);const ie=e=>ae(e,e.length-1);const le=h(Array.from)?Array.from:e=>M.call(e);const de=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return N.none()};const ue=Object.keys;const fe=Object.hasOwnProperty;const me=(e,t)=>{const o=ue(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const ge=(e,t)=>pe(e,((e,o)=>({k:o,v:t(e,o)})));const pe=(e,t)=>{const o={};me(e,((e,n)=>{const s=t(e,n);o[s.k]=s.v}));return o};const he=e=>(t,o)=>{e[o]=t};const ye=(e,t,o,n)=>{me(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const be=(e,t)=>{const o={};const n={};ye(e,t,he(o),he(n));return{t:o,f:n}};const ve=(e,t)=>{const o={};ye(e,t,he(o),v);return o};const ke=(e,t)=>{const o=[];me(e,((e,n)=>{o.push(t(e,n))}));return o};const we=(e,t)=>{const o=ue(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];if(t(r,s,e)){return N.some(r)}}return N.none()};const _e=e=>ke(e,C);const xe=(e,t)=>Ce(e,t)?N.from(e[t]):N.none();const Ce=(e,t)=>fe.call(e,t);const Se=(e,t)=>Ce(e,t)&&e[t]!==undefined&&e[t]!==null;const ze=(e,t,o=S)=>e.exists((e=>o(e,t)));const Te=(e,t,o=S)=>Ae(e,t,o).getOr(e.isNone()&&t.isNone());const Ee=e=>{const t=[];const o=e=>{t.push(e)};for(let t=0;t<e.length;t++){e[t].each(o)}return t};const Oe=e=>{const t=[];for(let o=0;o<e.length;o++){const n=e[o];if(n.isSome()){t.push(n.getOrDie())}else{return N.none()}}return N.some(t)};const Ae=(e,t,o)=>e.isSome()&&t.isSome()?N.some(o(e.getOrDie(),t.getOrDie())):N.none();const De=(e,t,o,n)=>e.isSome()&&t.isSome()&&o.isSome()?N.some(n(e.getOrDie(),t.getOrDie(),o.getOrDie())):N.none();const Ne=(e,t)=>e!==undefined&&e!==null?N.some(t(e)):N.none();const Me=(e,t)=>e?N.some(t):N.none();const Re=(e,t)=>e+t;const Be=(e,t)=>e.substring(t);const Le=(e,t,o)=>t===""||e.length>=t.length&&e.substr(o,o+t.length)===t;const He=(e,t)=>Fe(e,t)?Be(e,t.length):e;const Ie=(e,t)=>Ve(e,t)?e:Re(e,t);const Pe=(e,t,o=0,n)=>{const s=e.indexOf(t,o);if(s!==-1){return m(n)?true:s+t.length<=n}else{return false}};const Fe=(e,t)=>Le(e,t,0);const Ve=(e,t)=>Le(e,t,e.length-t.length);const je=e=>t=>t.replace(e,"");const Ze=je(/^\s+|\s+$/g);const Ue=e=>e.length>0;const qe=e=>!Ue(e);const We=e=>e.style!==undefined&&h(e.style.getPropertyValue);const $e=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return Ye(n.childNodes[0])};const Ge=(e,t)=>{const o=t||document;const n=o.createElement(e);return Ye(n)};const Ke=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return Ye(n)};const Ye=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const Xe=(e,t,o)=>N.from(e.dom.elementFromPoint(t,o)).map(Ye);const Je={fromHtml:$e,fromTag:Ge,fromText:Ke,fromDom:Ye,fromPoint:Xe};const Qe=typeof window!=="undefined"?window:Function("return this;")();const et=(e,t)=>{let o=t!==undefined&&t!==null?t:Qe;for(let t=0;t<e.length&&o!==undefined&&o!==null;++t){o=o[e[t]]}return o};const tt=(e,t)=>{const o=e.split(".");return et(o,t)};const ot=(e,t)=>tt(e,t);const nt=(e,t)=>{const o=ot(e,t);if(o===undefined||o===null){throw new Error(e+" not available on this browser")}return o};const st=Object.getPrototypeOf;const rt=e=>nt("HTMLElement",e);const at=e=>{const t=tt("ownerDocument.defaultView",e);return i(e)&&(rt(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(st(e).constructor.name))};const ct=9;const it=11;const lt=1;const dt=3;const ut=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const ft=e=>e.dom.nodeType;const mt=e=>t=>ft(t)===e;const gt=e=>pt(e)&&at(e.dom);const pt=mt(lt);const ht=mt(dt);const yt=mt(ct);const bt=mt(it);const vt=e=>t=>pt(t)&&ut(t)===e;const kt=(e,t)=>{const o=e.dom;if(o.nodeType!==lt){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const wt=e=>e.nodeType!==lt&&e.nodeType!==ct&&e.nodeType!==it||e.childElementCount===0;const _t=(e,t)=>{const o=t===undefined?document:t.dom;return wt(o)?[]:j(o.querySelectorAll(e),Je.fromDom)};const xt=(e,t)=>{const o=t===undefined?document:t.dom;return wt(o)?N.none():N.from(o.querySelector(e)).map(Je.fromDom)};const Ct=(e,t)=>e.dom===t.dom;const St=(e,t)=>{const o=e.dom;const n=t.dom;return o===n?false:o.contains(n)};const zt=e=>Je.fromDom(e.dom.ownerDocument);const Tt=e=>yt(e)?e:zt(e);const Et=e=>Je.fromDom(Tt(e).dom.documentElement);const Ot=e=>Je.fromDom(Tt(e).dom.defaultView);const At=e=>N.from(e.dom.parentNode).map(Je.fromDom);const Dt=e=>At(e);const Nt=e=>N.from(e.dom.parentElement).map(Je.fromDom);const Mt=(e,t)=>{const o=h(t)?t:A;let n=e.dom;const s=[];while(n.parentNode!==null&&n.parentNode!==undefined){const e=n.parentNode;const t=Je.fromDom(e);s.push(t);if(o(t)===true){break}else{n=e}}return s};const Rt=e=>N.from(e.dom.offsetParent).map(Je.fromDom);const Bt=e=>N.from(e.dom.nextSibling).map(Je.fromDom);const Lt=e=>j(e.dom.childNodes,Je.fromDom);const Ht=(e,t)=>{const o=e.dom.childNodes;return N.from(o[t]).map(Je.fromDom)};const It=e=>Ht(e,0);const Pt=(e,t)=>({element:e,offset:t});const Ft=(e,t)=>{const o=Lt(e);return o.length>0&&t<o.length?Pt(o[t],0):Pt(e,t)};const Vt=e=>bt(e)&&p(e.dom.host);const jt=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode);const Zt=x(jt);const Ut=jt?e=>Je.fromDom(e.dom.getRootNode()):Tt;const qt=e=>Vt(e)?e:Je.fromDom(Tt(e).dom.body);const Wt=e=>$t(e).isSome();const $t=e=>{const t=Ut(e);return Vt(t)?N.some(t):N.none()};const Gt=e=>Je.fromDom(e.dom.host);const Kt=e=>{if(Zt()&&p(e.target)){const t=Je.fromDom(e.target);if(pt(t)&&Yt(t)){if(e.composed&&e.composedPath){const t=e.composedPath();if(t){return ce(t)}}}}return N.from(e.target)};const Yt=e=>p(e.dom.shadowRoot);const Xt=e=>{const t=ht(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return $t(Je.fromDom(t)).fold((()=>o.body.contains(t)),_(Xt,Gt))};const Jt=()=>Qt(Je.fromDom(document));const Qt=e=>{const t=e.dom.body;if(t===null||t===undefined){throw new Error("Body is not available yet")}return Je.fromDom(t)};const eo=(e,t,o)=>{if(c(o)||f(o)||y(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const to=(e,t,o)=>{eo(e.dom,t,o)};const oo=(e,t)=>{const o=e.dom;me(t,((e,t)=>{eo(o,t,e)}))};const no=(e,t)=>{const o=e.dom.getAttribute(t);return o===null?undefined:o};const so=(e,t)=>N.from(no(e,t));const ro=(e,t)=>{const o=e.dom;return o&&o.hasAttribute?o.hasAttribute(t):false};const ao=(e,t)=>{e.dom.removeAttribute(t)};const co=e=>G(e.dom.attributes,((e,t)=>{e[t.name]=t.value;return e}),{});const io=(e,t,o)=>{if(!c(o)){console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e);throw new Error("CSS value must be a string: "+o)}if(We(e)){e.style.setProperty(t,o)}};const lo=(e,t)=>{if(We(e)){e.style.removeProperty(t)}};const uo=(e,t,o)=>{const n=e.dom;io(n,t,o)};const fo=(e,t)=>{const o=e.dom;me(t,((e,t)=>{io(o,t,e)}))};const mo=(e,t)=>{const o=e.dom;me(t,((e,t)=>{e.fold((()=>{lo(o,t)}),(e=>{io(o,t,e)}))}))};const go=(e,t)=>{const o=e.dom;const n=window.getComputedStyle(o);const s=n.getPropertyValue(t);return s===""&&!Xt(e)?po(o,t):s};const po=(e,t)=>We(e)?e.style.getPropertyValue(t):"";const ho=(e,t)=>{const o=e.dom;const n=po(o,t);return N.from(n).filter((e=>e.length>0))};const yo=e=>{const t={};const o=e.dom;if(We(o)){for(let e=0;e<o.style.length;e++){const n=o.style.item(e);t[n]=o.style[n]}}return t};const bo=(e,t,o)=>{const n=Je.fromTag(e);uo(n,t,o);const s=ho(n,t);return s.isSome()};const vo=(e,t)=>{const o=e.dom;lo(o,t);if(ze(so(e,"style").map(Ze),"")){ao(e,"style")}};const ko=e=>e.dom.offsetWidth;const wo=(e,t)=>{const o=(t,o)=>{if(!y(o)&&!o.match(/^[0-9]+$/)){throw new Error(e+".set accepts only positive integer values. Value was "+o)}const n=t.dom;if(We(n)){n.style[e]=o+"px"}};const n=o=>{const n=t(o);if(n<=0||n===null){const t=go(o,e);return parseFloat(t)||0}return n};const s=n;const r=(e,t)=>G(t,((t,o)=>{const n=go(e,o);const s=n===undefined?0:parseInt(n,10);return isNaN(s)?t:t+s}),0);const a=(e,t,o)=>{const n=r(e,o);const s=t>n?t-n:0;return s};return{set:o,get:n,getOuter:s,aggregate:r,max:a}};const _o=wo("height",(e=>{const t=e.dom;return Xt(e)?t.getBoundingClientRect().height:t.offsetHeight}));const xo=e=>_o.get(e);const Co=e=>_o.getOuter(e);const So=(e,t)=>{const o=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"];const n=_o.max(e,t,o);uo(e,"max-height",n+"px")};const zo=(e,t)=>{const o=(o,n)=>zo(e+o,t+n);return{left:e,top:t,translate:o}};const To=zo;const Eo=e=>{const t=e.getBoundingClientRect();return To(t.left,t.top)};const Oo=(e,t)=>{if(e!==undefined){return e}else{return t!==undefined?t:0}};const Ao=e=>{const t=e.dom.ownerDocument;const o=t.body;const n=t.defaultView;const s=t.documentElement;if(o===e.dom){return To(o.offsetLeft,o.offsetTop)}const r=Oo(n===null||n===void 0?void 0:n.pageYOffset,s.scrollTop);const a=Oo(n===null||n===void 0?void 0:n.pageXOffset,s.scrollLeft);const c=Oo(s.clientTop,o.clientTop);const i=Oo(s.clientLeft,o.clientLeft);return Do(e).translate(a-i,r-c)};const Do=e=>{const t=e.dom;const o=t.ownerDocument;const n=o.body;if(n===t){return To(n.offsetLeft,n.offsetTop)}if(!Xt(e)){return To(0,0)}return Eo(t)};const No=wo("width",(e=>e.dom.offsetWidth));const Mo=(e,t)=>No.set(e,t);const Ro=e=>No.get(e);const Bo=e=>No.getOuter(e);const Lo=(e,t)=>{const o=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"];const n=No.max(e,t,o);uo(e,"max-width",n+"px")};const Ho=e=>{let t=false;let o;return(...n)=>{if(!t){t=true;o=e.apply(null,n)}return o}};const Io=(e,t,o,n)=>{const s=e.isiOS()&&/ipad/i.test(o)===true;const r=e.isiOS()&&!s;const a=e.isiOS()||e.isAndroid();const c=a||n("(pointer:coarse)");const i=s||!r&&a&&n("(min-device-width:768px)");const l=r||a&&!i;const d=t.isSafari()&&e.isiOS()&&/safari/i.test(o)===false;const u=!l&&!i&&!d;return{isiPad:x(s),isiPhone:x(r),isTablet:x(i),isPhone:x(l),isTouch:x(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:x(d),isDesktop:x(u)}};const Po=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t)){return n}}return undefined};const Fo=(e,t)=>{const o=Po(e,t);if(!o){return{major:0,minor:0}}const n=e=>Number(t.replace(o,"$"+e));return Zo(n(1),n(2))};const Vo=(e,t)=>{const o=String(t).toLowerCase();if(e.length===0){return jo()}return Fo(e,o)};const jo=()=>Zo(0,0);const Zo=(e,t)=>({major:e,minor:t});const Uo={nu:Zo,detect:Vo,unknown:jo};const qo=(e,t)=>de(t.brands,(t=>{const o=t.brand.toLowerCase();return Y(e,(e=>{var t;return o===((t=e.brand)===null||t===void 0?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Uo.nu(parseInt(t.version,10),0)})))}));const Wo=(e,t)=>{const o=String(t).toLowerCase();return Y(e,(e=>e.search(o)))};const $o=(e,t)=>Wo(e,t).map((e=>{const o=Uo.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const Go=(e,t)=>Wo(e,t).map((e=>{const o=Uo.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const Ko=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/;const Yo=e=>t=>Pe(t,e);const Xo=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Pe(e,"edge/")&&Pe(e,"chrome")&&Pe(e,"safari")&&Pe(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ko],search:e=>Pe(e,"chrome")&&!Pe(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Pe(e,"msie")||Pe(e,"trident")},{name:"Opera",versionRegexes:[Ko,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Yo("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Yo("firefox")},{name:"Safari",versionRegexes:[Ko,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Pe(e,"safari")||Pe(e,"mobile/"))&&Pe(e,"applewebkit")}];const Jo=[{name:"Windows",search:Yo("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Pe(e,"iphone")||Pe(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Yo("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Yo("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Yo("linux"),versionRegexes:[]},{name:"Solaris",search:Yo("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Yo("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Yo("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}];const Qo={browsers:x(Xo),oses:x(Jo)};const en="Edge";const tn="Chromium";const on="IE";const nn="Opera";const sn="Firefox";const rn="Safari";const an=()=>cn({current:undefined,version:Uo.unknown()});const cn=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isEdge:n(en),isChromium:n(tn),isIE:n(on),isOpera:n(nn),isFirefox:n(sn),isSafari:n(rn)}};const ln={unknown:an,nu:cn,edge:x(en),chromium:x(tn),ie:x(on),opera:x(nn),firefox:x(sn),safari:x(rn)};const dn="Windows";const un="iOS";const fn="Android";const mn="Linux";const gn="macOS";const pn="Solaris";const hn="FreeBSD";const yn="ChromeOS";const bn=()=>vn({current:undefined,version:Uo.unknown()});const vn=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isWindows:n(dn),isiOS:n(un),isAndroid:n(fn),isMacOS:n(gn),isLinux:n(mn),isSolaris:n(pn),isFreeBSD:n(hn),isChromeOS:n(yn)}};const kn={unknown:bn,nu:vn,windows:x(dn),ios:x(un),android:x(fn),linux:x(mn),macos:x(gn),solaris:x(pn),freebsd:x(hn),chromeos:x(yn)};const wn=(e,t,o)=>{const n=Qo.browsers();const s=Qo.oses();const r=t.bind((e=>qo(n,e))).orThunk((()=>$o(n,e))).fold(ln.unknown,ln.nu);const a=Go(s,e).fold(kn.unknown,kn.nu);const c=Io(a,r,e,o);return{browser:r,os:a,deviceType:c}};const _n={detect:wn};const xn=e=>window.matchMedia(e).matches;let Cn=Ho((()=>_n.detect(navigator.userAgent,N.from(navigator.userAgentData),xn)));const Sn=()=>Cn();const zn=(e,t,o,n,s,r,a)=>({target:e,x:t,y:o,stop:n,prevent:s,kill:r,raw:a});const Tn=e=>{const t=Je.fromDom(Kt(e).getOr(e.target));const o=()=>e.stopPropagation();const n=()=>e.preventDefault();const s=w(n,o);return zn(t,e.clientX,e.clientY,o,n,s,e)};const En=(e,t)=>o=>{if(e(o)){t(Tn(o))}};const On=(e,t,o,n,s)=>{const r=En(o,n);e.dom.addEventListener(t,r,s);return{unbind:z(Nn,e,t,r,s)}};const An=(e,t,o,n)=>On(e,t,o,n,false);const Dn=(e,t,o,n)=>On(e,t,o,n,true);const Nn=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)};const Mn=(e,t)=>{const o=At(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))};const Rn=(e,t)=>{const o=Bt(e);o.fold((()=>{const o=At(e);o.each((e=>{Ln(e,t)}))}),(e=>{Mn(e,t)}))};const Bn=(e,t)=>{const o=It(e);o.fold((()=>{Ln(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))};const Ln=(e,t)=>{e.dom.appendChild(t.dom)};const Hn=(e,t,o)=>{Ht(e,o).fold((()=>{Ln(e,t)}),(e=>{Mn(e,t)}))};const In=(e,t)=>{Z(t,(t=>{Ln(e,t)}))};const Pn=e=>{e.dom.textContent="";Z(Lt(e),(e=>{Fn(e)}))};const Fn=e=>{const t=e.dom;if(t.parentNode!==null){t.parentNode.removeChild(t)}};const Vn=e=>{const t=e!==undefined?e.dom:document;const o=t.body.scrollLeft||t.documentElement.scrollLeft;const n=t.body.scrollTop||t.documentElement.scrollTop;return To(o,n)};const jn=(e,t,o)=>{const n=o!==undefined?o.dom:document;const s=n.defaultView;if(s){s.scrollTo(e,t)}};const Zn=e=>{const t=e===undefined?window:e;if(Sn().browser.isFirefox()){return N.none()}else{return N.from(t.visualViewport)}};const Un=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n});const qn=e=>{const t=e===undefined?window:e;const o=t.document;const n=Vn(Je.fromDom(o));return Zn(t).fold((()=>{const e=t.document.documentElement;const o=e.clientWidth;const s=e.clientHeight;return Un(n.left,n.top,o,s)}),(e=>Un(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))};const Wn=()=>Je.fromDom(document);const $n=(e,t)=>{const o=e.view(t);return o.fold(x([]),(t=>{const o=e.owner(t);const n=$n(e,o);return[t].concat(n)}))};const Gn=(e,t)=>{const o=t.owner(e);const n=$n(t,o);return N.some(n)};const Kn=e=>{var t;const o=e.dom===document?N.none():N.from((t=e.dom.defaultView)===null||t===void 0?void 0:t.frameElement);return o.map(Je.fromDom)};const Yn=e=>zt(e);var Xn=Object.freeze({__proto__:null,view:Kn,owner:Yn});const Jn=e=>{const t=Wn();const o=Vn(t);const n=Gn(e,Xn);return n.fold(z(Ao,e),(t=>{const n=Do(e);const s=$(t,((e,t)=>{const o=Do(t);return{left:e.left+o.left,top:e.top+o.top}}),{left:0,top:0});return To(s.left+n.left+o.left,s.top+n.top+o.top)}))};const Qn=(e,t,o)=>({point:e,width:t,height:o});const es=(e,t,o,n)=>({x:e,y:t,width:o,height:n});const ts=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n});const os=e=>{const t=Ao(e);const o=Bo(e);const n=Co(e);return ts(t.left,t.top,o,n)};const ns=e=>{const t=Jn(e);const o=Bo(e);const n=Co(e);return ts(t.left,t.top,o,n)};const ss=(e,t)=>{const o=Math.max(e.x,t.x);const n=Math.max(e.y,t.y);const s=Math.min(e.right,t.right);const r=Math.min(e.bottom,t.bottom);const a=s-o;const c=r-n;return ts(o,n,a,c)};const rs=(e,t)=>G(t,((e,t)=>ss(e,t)),e);const as=()=>qn(window);const cs=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};const is=e=>{const t=cs(N.none());const o=()=>t.get().each(e);const n=()=>{o();t.set(N.none())};const s=()=>t.get().isSome();const r=()=>t.get();const a=e=>{o();t.set(N.some(e))};return{clear:n,isSet:s,get:r,set:a}};const ls=()=>is((e=>e.destroy()));const ds=()=>is((e=>e.unbind()));const us=()=>{const e=is(v);const t=t=>e.get().each(t);return{...e,on:t}};var fs=tinymce.util.Tools.resolve("tinymce.ThemeManager");const ms=e=>{const t=t=>t(e);const o=x(e);const n=()=>s;const s={tag:true,inner:e,fold:(t,o)=>o(e),isValue:D,isError:A,map:t=>hs.value(t(e)),mapError:n,bind:t,exists:t,forall:t,getOr:o,or:n,getOrThunk:o,orThunk:n,getOrDie:o,each:t=>{t(e)},toOptional:()=>N.some(e)};return s};const gs=e=>{const t=()=>o;const o={tag:false,inner:e,fold:(t,o)=>t(e),isValue:A,isError:D,map:t,mapError:t=>hs.error(t(e)),bind:t,exists:A,forall:D,getOr:C,or:C,getOrThunk:O,orThunk:O,getOrDie:E(String(e)),each:v,toOptional:N.none};return o};const ps=(e,t)=>e.fold((()=>gs(t)),ms);const hs={value:ms,error:gs,fromOption:ps};var ys;(function(e){e[e["Error"]=0]="Error";e[e["Value"]=1]="Value"})(ys||(ys={}));const bs=(e,t,o)=>e.stype===ys.Error?t(e.serror):o(e.svalue);const vs=e=>{const t=[];const o=[];Z(e,(e=>{bs(e,(e=>o.push(e)),(e=>t.push(e)))}));return{values:t,errors:o}};const ks=(e,t)=>{if(e.stype===ys.Error){return{stype:ys.Error,serror:t(e.serror)}}else{return e}};const ws=(e,t)=>{if(e.stype===ys.Value){return{stype:ys.Value,svalue:t(e.svalue)}}else{return e}};const _s=(e,t)=>{if(e.stype===ys.Value){return t(e.svalue)}else{return e}};const xs=(e,t)=>{if(e.stype===ys.Error){return t(e.serror)}else{return e}};const Cs=e=>({stype:ys.Value,svalue:e});const Ss=e=>({stype:ys.Error,serror:e});const zs=e=>bs(e,hs.error,hs.value);const Ts=e=>e.fold(Ss,Cs);const Es={fromResult:Ts,toResult:zs,svalue:Cs,partition:vs,serror:Ss,bind:_s,bindError:xs,map:ws,mapError:ks,fold:bs};const Os=(e,t,o,n)=>({tag:"field",key:e,newKey:t,presence:o,prop:n});const As=(e,t)=>({tag:"custom",newKey:e,instantiator:t});const Ds=(e,t,o)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return o(e.newKey,e.instantiator)}};const Ns=(e,t)=>t;const Ms=(e,t)=>{const o=l(e)&&l(t);return o?Bs(e,t):t};const Rs=e=>(...t)=>{if(t.length===0){throw new Error(`Can't merge zero objects`)}const o={};for(let n=0;n<t.length;n++){const s=t[n];for(const t in s){if(Ce(s,t)){o[t]=e(o[t],s[t])}}}return o};const Bs=Rs(Ms);const Ls=Rs(Ns);const Hs=()=>({tag:"required",process:{}});const Is=e=>({tag:"defaultedThunk",process:e});const Ps=e=>Is(x(e));const Fs=()=>({tag:"option",process:{}});const Vs=e=>({tag:"mergeWithThunk",process:e});const js=e=>Vs(x(e));const Zs=(e,t)=>e.length>0?Es.svalue(Bs(t,Ls.apply(undefined,e))):Es.svalue(t);const Us=e=>w(Es.serror,J)(e);const qs=(e,t)=>{const o=Es.partition(e);return o.errors.length>0?Us(o.errors):Zs(o.values,t)};const Ws=e=>{const t=Es.partition(e);return t.errors.length>0?Us(t.errors):Es.svalue(t.values)};const $s={consolidateObj:qs,consolidateArr:Ws};const Gs=e=>i(e)&&ue(e).length>100?" removed due to size":JSON.stringify(e,null,2);const Ks=e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:x("... (only showing first ten failures)")}]):e;return j(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))};const Ys=(e,t)=>Es.serror([{path:e,getErrorInfo:t}]);const Xs=(e,t,o)=>Ys(e,(()=>'Could not find valid *required* value for "'+t+'" in '+Gs(o)));const Js=(e,t)=>Ys(e,(()=>'Choice schema did not contain choice key: "'+t+'"'));const Qs=(e,t,o)=>Ys(e,(()=>'The chosen schema: "'+o+'" did not exist in branches: '+Gs(t)));const er=(e,t)=>Ys(e,(()=>"There are unsupported fields: ["+t.join(", ")+"] specified"));const tr=(e,t)=>Ys(e,x(t));const or=e=>{const t=(t,o)=>Es.bindError(e(o),(e=>tr(t,e)));const o=x("val");return{extract:t,toString:o}};const nr=or(Es.svalue);const sr=(e,t,o,n)=>xe(t,o).fold((()=>Xs(e,o,t)),n);const rr=(e,t,o,n)=>{const s=xe(e,t).getOrThunk((()=>o(e)));return n(s)};const ar=(e,t,o)=>o(xe(e,t));const cr=(e,t,o,n)=>{const s=xe(e,t).map((t=>t===true?o(e):t));return n(s)};const ir=(e,t,o,n,s)=>{const r=e=>s.extract(t.concat([n]),e);const a=e=>e.fold((()=>Es.svalue(N.none())),(e=>{const o=s.extract(t.concat([n]),e);return Es.map(o,N.some)}));switch(e.tag){case"required":return sr(t,o,n,r);case"defaultedThunk":return rr(o,n,e.process,r);case"option":return ar(o,n,a);case"defaultedOptionThunk":return cr(o,n,e.process,a);case"mergeWithThunk":{return rr(o,n,x({}),(t=>{const n=Bs(e.process(o),t);return r(n)}))}}};const lr=(e,t,o)=>{const n={};const s=[];for(const r of o){Ds(r,((o,r,a,c)=>{const i=ir(a,e,t,o,c);Es.fold(i,(e=>{s.push(...e)}),(e=>{n[r]=e}))}),((e,o)=>{n[e]=o(t)}))}return s.length>0?Es.serror(s):Es.svalue(n)};const dr=e=>{const t=(t,o)=>e().extract(t,o);const o=()=>e().toString();return{extract:t,toString:o}};const ur=e=>ue(ve(e,p));const fr=e=>{const t=mr(e);const o=$(e,((e,t)=>Ds(t,(t=>Bs(e,{[t]:true})),x(e))),{});const n=(e,n)=>{const s=f(n)?[]:ur(n);const r=W(s,(e=>!Se(o,e)));return r.length===0?t.extract(e,n):er(e,r)};return{extract:n,toString:t.toString}};const mr=e=>{const t=(t,o)=>lr(t,o,e);const o=()=>{const t=j(e,(e=>Ds(e,((e,t,o,n)=>e+" -> "+n.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:o}};const gr=e=>{const t=(t,o)=>{const n=j(o,((o,n)=>e.extract(t.concat(["["+n+"]"]),o)));return $s.consolidateArr(n)};const o=()=>"array("+e.toString()+")";return{extract:t,toString:o}};const pr=(e,t)=>{const o=t!==undefined?t:C;const n=(t,n)=>{const s=[];for(const r of e){const e=r.extract(t,n);if(e.stype===ys.Value){return{stype:ys.Value,svalue:o(e.svalue)}}s.push(e)}return $s.consolidateArr(s)};const s=()=>"oneOf("+j(e,(e=>e.toString())).join(", ")+")";return{extract:n,toString:s}};const hr=(e,t)=>{const o=(t,o)=>gr(or(e)).extract(t,o);const n=(e,n)=>{const s=ue(n);const r=o(e,s);return Es.bind(r,(o=>{const s=j(o,(e=>Os(e,e,Hs(),t)));return mr(s).extract(e,n)}))};const s=()=>"setOf("+t.toString()+")";return{extract:n,toString:s}};const yr=(e,t)=>{const o=Ho(t);const n=(e,t)=>o().extract(e,t);const s=()=>o().toString();return{extract:n,toString:s}};const br=w(gr,mr);const vr=x(nr);const kr=(e,t)=>or((o=>{const n=typeof o;return e(o)?Es.svalue(o):Es.serror(`Expected type: ${t} but got: ${n}`)}));const wr=kr(y,"number");const _r=kr(c,"string");const xr=kr(f,"boolean");const Cr=kr(h,"function");const Sr=e=>{if(Object(e)!==e){return true}switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return true;case"Array":case"Object":return Object.keys(e).every((t=>Sr(e[t])));default:return false}};const zr=or((e=>{if(Sr(e)){return Es.svalue(e)}else{return Es.serror("Expected value to be acceptable for sending via postMessage")}}));const Tr=(e,t,o,n)=>{const s=xe(o,n);return s.fold((()=>Qs(e,o,n)),(o=>o.extract(e.concat(["branch: "+n]),t)))};const Er=(e,t)=>{const o=(o,n)=>{const s=xe(n,e);return s.fold((()=>Js(o,e)),(e=>Tr(o,n,t,e)))};const n=()=>"chooseOn("+e+"). Possible values: "+ue(t);return{extract:o,toString:n}};const Or=()=>gr(nr);const Ar=e=>or((t=>e(t).fold(Es.serror,Es.svalue)));const Dr=(e,t)=>hr((t=>Es.fromResult(e(t))),t);const Nr=(e,t,o)=>{const n=t.extract([e],o);return Es.mapError(n,(e=>({input:o,errors:e})))};const Mr=(e,t,o)=>Es.toResult(Nr(e,t,o));const Rr=e=>e.fold((e=>{throw new Error(Lr(e))}),C);const Br=(e,t,o)=>Rr(Mr(e,t,o));const Lr=e=>"Errors: \n"+Ks(e.errors).join("\n")+"\n\nInput object: "+Gs(e.input);const Hr=(e,t)=>Er(e,ge(t,mr));const Ir=(e,t)=>yr(e,t);const Pr=Os;const Fr=As;const Vr=e=>Ar((t=>I(e,t)?hs.value(t):hs.error(`Unsupported value: "${t}", choose one of "${e.join(", ")}".`)));const jr=e=>Pr(e,e,Hs(),vr());const Zr=(e,t)=>Pr(e,e,Hs(),t);const Ur=e=>Zr(e,wr);const qr=e=>Zr(e,_r);const Wr=(e,t)=>Pr(e,e,Hs(),Vr(t));const $r=e=>Zr(e,xr);const Gr=e=>Zr(e,Cr);const Kr=(e,t)=>Pr(e,e,Fs(),or((o=>Es.serror("The field: "+e+" is forbidden. "+t))));const Yr=(e,t)=>Pr(e,e,Hs(),mr(t));const Xr=(e,t)=>Pr(e,e,Hs(),br(t));const Jr=(e,t)=>Pr(e,e,Hs(),gr(t));const Qr=e=>Pr(e,e,Fs(),vr());const ea=(e,t)=>Pr(e,e,Fs(),t);const ta=e=>ea(e,wr);const oa=e=>ea(e,_r);const na=(e,t)=>ea(e,Vr(t));const sa=e=>ea(e,Cr);const ra=(e,t)=>ea(e,gr(t));const aa=(e,t)=>ea(e,mr(t));const ca=(e,t)=>ea(e,fr(t));const ia=(e,t)=>Pr(e,e,Ps(t),vr());const la=(e,t,o)=>Pr(e,e,Ps(t),o);const da=(e,t)=>la(e,t,wr);const ua=(e,t)=>la(e,t,_r);const fa=(e,t,o)=>la(e,t,Vr(o));const ma=(e,t)=>la(e,t,xr);const ga=(e,t)=>la(e,t,Cr);const pa=(e,t)=>la(e,t,zr);const ha=(e,t,o)=>la(e,t,gr(o));const ya=(e,t,o)=>la(e,t,mr(o));const ba=e=>{if(!d(e)){throw new Error("cases must be an array")}if(e.length===0){throw new Error("there must be at least one case")}const t=[];const o={};Z(e,((n,s)=>{const r=ue(n);if(r.length!==1){throw new Error("one and only one name per case")}const a=r[0];const c=n[a];if(o[a]!==undefined){throw new Error("duplicate key detected:"+a)}else if(a==="cata"){throw new Error("cannot have a case named cata (sorry)")}else if(!d(c)){throw new Error("case arguments must be an array")}t.push(a);o[a]=(...o)=>{const n=o.length;if(n!==c.length){throw new Error("Wrong number of arguments to case "+a+". Expected "+c.length+" ("+c+"), got "+n)}const r=e=>{const n=ue(e);if(t.length!==n.length){throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","))}const s=ee(t,(e=>I(n,e)));if(!s){throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "))}return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length){throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length)}const n=t[s];return n.apply(null,o)},match:r,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}}));return o};const va={generate:ba};va.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ka=e=>{const t=[];const o=[];Z(e,(e=>{e.fold((e=>{t.push(e)}),(e=>{o.push(e)}))}));return{errors:t,values:o}};const wa=(e,t)=>{const o={};me(e,((e,n)=>{if(!I(t,n)){o[n]=e}}));return o};const _a=(e,t)=>({[e]:t});const xa=e=>{const t={};Z(e,(e=>{t[e.key]=e.value}));return t};const Ca=(e,t)=>wa(e,t);const Sa=(e,t)=>_a(e,t);const za=e=>xa(e);const Ta=(e,t)=>e.length===0?hs.value(t):hs.value(Bs(t,Ls.apply(undefined,e)));const Ea=e=>hs.error(J(e));const Oa=(e,t)=>{const o=ka(e);return o.errors.length>0?Ea(o.errors):Ta(o.values,t)};const Aa=e=>h(e)?e:A;const Da=(e,t,o)=>{let n=e.dom;const s=Aa(o);while(n.parentNode){n=n.parentNode;const e=Je.fromDom(n);const o=t(e);if(o.isSome()){return o}else if(s(e)){break}}return N.none()};const Na=(e,t,o)=>{const n=t(e);const s=Aa(o);return n.orThunk((()=>s(e)?N.none():Da(e,t,s)))};const Ma=(e,t)=>Ct(e.element,t.event.target);const Ra={can:D,abort:A,run:v};const Ba=e=>{if(!Se(e,"can")&&!Se(e,"abort")&&!Se(e,"run")){throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!")}return{...Ra,...e}};const La=(e,t)=>(...o)=>G(e,((e,n)=>e&&t(n).apply(undefined,o)),true);const Ha=(e,t)=>(...o)=>G(e,((e,n)=>e||t(n).apply(undefined,o)),false);const Ia=e=>h(e)?{can:D,abort:A,run:e}:e;const Pa=e=>{const t=La(e,(e=>e.can));const o=Ha(e,(e=>e.abort));const n=(...t)=>{Z(e,(e=>{e.run.apply(undefined,t)}))};return{can:t,abort:o,run:n}};const Fa=x;const Va=Fa("touchstart");const ja=Fa("touchmove");const Za=Fa("touchend");const Ua=Fa("touchcancel");const qa=Fa("mousedown");const Wa=Fa("mousemove");const $a=Fa("mouseout");const Ga=Fa("mouseup");const Ka=Fa("mouseover");const Ya=Fa("focusin");const Xa=Fa("focusout");const Ja=Fa("keydown");const Qa=Fa("keyup");const ec=Fa("input");const tc=Fa("change");const oc=Fa("click");const nc=Fa("transitioncancel");const sc=Fa("transitionend");const rc=Fa("transitionstart");const ac=Fa("selectstart");const cc=e=>x("alloy."+e);const ic={tap:cc("tap")};const lc=cc("focus");const dc=cc("blur.post");const uc=cc("paste.post");const fc=cc("receive");const mc=cc("execute");const gc=cc("focus.item");const pc=ic.tap;const hc=cc("longpress");const yc=cc("sandbox.close");const bc=cc("typeahead.cancel");const vc=cc("system.init");const kc=cc("system.touchmove");const wc=cc("system.touchend");const _c=cc("system.scroll");const xc=cc("system.resize");const Cc=cc("system.attached");const Sc=cc("system.detached");const zc=cc("system.dismissRequested");const Tc=cc("system.repositionRequested");const Ec=cc("focusmanager.shifted");const Oc=cc("slotcontainer.visibility");const Ac=cc("system.external.element.scroll");const Dc=cc("change.tab");const Nc=cc("dismiss.tab");const Mc=cc("highlight");const Rc=cc("dehighlight");const Bc=(e,t)=>{Pc(e,e.element,t,{})};const Lc=(e,t,o)=>{Pc(e,e.element,t,o)};const Hc=e=>{Bc(e,mc())};const Ic=(e,t,o)=>{Pc(e,t,o,{})};const Pc=(e,t,o,n)=>{const s={target:t,...n};e.getSystem().triggerEvent(o,t,s)};const Fc=(e,t,o,n)=>{const s={...n,target:t};e.getSystem().triggerEvent(o,t,s)};const Vc=(e,t,o,n)=>{e.getSystem().triggerEvent(o,t,n.event)};const jc=e=>za(e);const Zc=(e,t)=>({key:e,value:Ba({abort:t})});const Uc=(e,t)=>({key:e,value:Ba({can:t})});const qc=e=>({key:e,value:Ba({run:(e,t)=>{t.event.prevent()}})});const Wc=(e,t)=>({key:e,value:Ba({run:t})});const $c=(e,t,o)=>({key:e,value:Ba({run:(e,n)=>{t.apply(undefined,[e,n].concat(o))}})});const Gc=e=>t=>Wc(e,t);const Kc=e=>t=>({key:e,value:Ba({run:(e,o)=>{if(Ma(e,o)){t(e,o)}}})});const Yc=(e,t)=>Wc(e,((o,n)=>{o.getSystem().getByUid(t).each((t=>{Vc(t,t.element,e,n)}))}));const Xc=(e,t,o)=>{const n=t.partUids[o];return Yc(e,n)};const Jc=(e,t)=>Wc(e,((e,o)=>{const n=o.event;const s=e.getSystem().getByDom(n.target).getOrThunk((()=>{const t=Na(n.target,(t=>e.getSystem().getByDom(t).toOptional()),A);return t.getOr(e)}));t(e,s,o)}));const Qc=e=>Wc(e,((e,t)=>{t.cut()}));const ei=e=>Wc(e,((e,t)=>{t.stop()}));const ti=(e,t)=>Kc(e)(t);const oi=Kc(Cc());const ni=Kc(Sc());const si=Kc(vc());const ri=Gc(mc());const ai=(e,t,o)=>{const n=o.toString();const s=n.indexOf(")")+1;const r=n.indexOf("(");const a=n.substring(r+1,s-1).split(/,\s*/);e.toFunctionAnnotation=()=>({name:t,parameters:ci(a.slice(0,1).concat(a.slice(3)))});return e};const ci=e=>j(e,(e=>Ve(e,"/*")?e.substring(0,e.length-"/*".length):e));const ii=(e,t)=>{const o=e.toString();const n=o.indexOf(")")+1;const s=o.indexOf("(");const r=o.substring(s+1,n-1).split(/,\s*/);e.toFunctionAnnotation=()=>({name:t,parameters:ci(r)});return e};const li=(e,t)=>{const o=t.toString();const n=o.indexOf(")")+1;const s=o.indexOf("(");const r=o.substring(s+1,n-1).split(/,\s*/);e.toFunctionAnnotation=()=>({name:"OVERRIDE",parameters:ci(r.slice(1))});return e};const di=e=>({classes:m(e.classes)?[]:e.classes,attributes:m(e.attributes)?{}:e.attributes,styles:m(e.styles)?{}:e.styles});const ui=(e,t)=>({...e,attributes:{...e.attributes,...t.attributes},styles:{...e.styles,...t.styles},classes:e.classes.concat(t.classes)});const fi=(e,t,o)=>ri((n=>{o(n,e,t)}));const mi=(e,t,o)=>si(((n,s)=>{o(n,e,t)}));const gi=(e,t,o,n,s,r)=>{const a=fr(e);const c=aa(t,[ca("config",e)]);return bi(a,c,t,o,n,s,r)};const pi=(e,t,o,n,s,r)=>{const a=e;const c=aa(t,[ea("config",e)]);return bi(a,c,t,o,n,s,r)};const hi=(e,t,o)=>{const n=(n,...s)=>{const r=[n].concat(s);return n.config({name:x(e)}).fold((()=>{throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+o)}),(e=>{const o=Array.prototype.slice.call(r,1);return t.apply(undefined,[n,e.config,e.state].concat(o))}))};return ai(n,o,t)};const yi=e=>({key:e,value:undefined});const bi=(e,t,o,n,s,r,a)=>{const c=e=>Se(e,o)?e[o]():N.none();const i=ge(s,((e,t)=>hi(o,e,t)));const l=ge(r,((e,t)=>ii(e,t)));const d={...l,...i,revoke:z(yi,o),config:t=>{const n=Br(o+"-config",e,t);return{key:o,value:{config:n,me:d,configAsRaw:Ho((()=>Br(o+"-config",e,t))),initialConfig:t,state:a}}},schema:x(t),exhibit:(e,t)=>Ae(c(e),xe(n,"exhibit"),((e,o)=>o(t,e.config,e.state))).getOrThunk((()=>di({}))),name:x(o),handlers:e=>c(e).map((e=>{const t=xe(n,"events").getOr((()=>({})));return t(e.config,e.state)})).getOr({})};return d};const vi={init:()=>ki({readState:x("No State required")})};const ki=e=>e;const wi=e=>za(e);const _i=fr([jr("fields"),jr("name"),ia("active",{}),ia("apis",{}),ia("state",vi),ia("extra",{})]);const xi=e=>{const t=Br("Creating behaviour: "+e.name,_i,e);return gi(t.fields,t.name,t.active,t.apis,t.extra,t.state)};const Ci=fr([jr("branchKey"),jr("branches"),jr("name"),ia("active",{}),ia("apis",{}),ia("state",vi),ia("extra",{})]);const Si=e=>{const t=Br("Creating behaviour: "+e.name,Ci,e);return pi(Hr(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)};const zi=x(undefined);const Ti=(e,t)=>{const o=no(e,t);return o===undefined||o===""?[]:o.split(" ")};const Ei=(e,t,o)=>{const n=Ti(e,t);const s=n.concat([o]);to(e,t,s.join(" "));return true};const Oi=(e,t,o)=>{const n=W(Ti(e,t),(e=>e!==o));if(n.length>0){to(e,t,n.join(" "))}else{ao(e,t)}return false};const Ai=e=>e.dom.classList!==undefined;const Di=e=>Ti(e,"class");const Ni=(e,t)=>Ei(e,"class",t);const Mi=(e,t)=>Oi(e,"class",t);const Ri=(e,t)=>{if(I(Di(e),t)){return Mi(e,t)}else{return Ni(e,t)}};const Bi=(e,t)=>{if(Ai(e)){e.dom.classList.add(t)}else{Ni(e,t)}};const Li=e=>{const t=Ai(e)?e.dom.classList:Di(e);if(t.length===0){ao(e,"class")}};const Hi=(e,t)=>{if(Ai(e)){const o=e.dom.classList;o.remove(t)}else{Mi(e,t)}Li(e)};const Ii=(e,t)=>{const o=Ai(e)?e.dom.classList.toggle(t):Ri(e,t);Li(e);return o};const Pi=(e,t)=>Ai(e)&&e.dom.classList.contains(t);const Fi=(e,t)=>{Z(t,(t=>{Bi(e,t)}))};const Vi=(e,t)=>{Z(t,(t=>{Hi(e,t)}))};const ji=(e,t)=>{Z(t,(t=>{Ii(e,t)}))};const Zi=(e,t)=>ee(t,(t=>Pi(e,t)));const Ui=e=>{const t=e.dom.classList;const o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t.item(e);if(n!==null){o[e]=n}}return o};const qi=e=>Ai(e)?Ui(e):Di(e);const Wi=(e,t,o,n,s)=>{const r=e=>e+"px";return{position:e,left:t.map(r),top:o.map(r),right:n.map(r),bottom:s.map(r)}};const $i=e=>({...e,position:N.some(e.position)});const Gi=(e,t)=>{mo(e,$i(t))};const Ki=e=>{const t=ze(ho(e,"position"),"fixed");const o=t?N.none():Rt(e);return o.orThunk((()=>{const t=Je.fromTag("span");return At(e).bind((e=>{Ln(e,t);const o=Rt(t);Fn(t);return o}))}))};const Yi=e=>Ki(e).map(Ao).getOrThunk((()=>To(0,0)));const Xi=(e,t)=>{const o=e.element;Bi(o,t.transitionClass);Hi(o,t.fadeOutClass);Bi(o,t.fadeInClass);t.onShow(e)};const Ji=(e,t)=>{const o=e.element;Bi(o,t.transitionClass);Hi(o,t.fadeInClass);Bi(o,t.fadeOutClass);t.onHide(e)};const Qi=(e,t)=>e.y<t.bottom&&e.bottom>t.y;const el=(e,t)=>e.y>=t.y;const tl=(e,t)=>e.bottom<=t.bottom;const ol=(e,t,o)=>({location:"top",leftX:t,topY:o.bounds.y-e.y});const nl=(e,t,o)=>({location:"bottom",leftX:t,bottomY:e.bottom-o.bounds.bottom});const sl=e=>e.box.x-e.win.x;const rl=(e,t,o)=>{const n=t.win;const s=t.box;const r=sl(t);return de(e,(e=>{switch(e){case"bottom":return!tl(s,o.bounds)?N.some(nl(n,r,o)):N.none();case"top":return!el(s,o.bounds)?N.some(ol(n,r,o)):N.none();default:return N.none()}})).getOr({location:"no-dock"})};const al=(e,t,o)=>ee(e,(e=>{switch(e){case"bottom":return tl(t,o.bounds);case"top":return el(t,o.bounds)}}));const cl=(e,t)=>{const o=t.optScrollEnv.fold(x(e.bounds.y),(t=>t.scrollElmTop+(e.bounds.y-t.currentScrollTop)));return To(e.bounds.x,o)};const il=(e,t)=>{const o=t.optScrollEnv.fold(x(e.y),(t=>e.y+t.currentScrollTop-t.scrollElmTop));return To(e.x,o)};const ll=(e,t,o)=>o.getInitialPos().map((o=>{const n=cl(o,t);return{box:ts(n.left,n.top,Ro(e),xo(e)),location:o.location}}));const dl=(e,t,o,n,s)=>{const r=il(t,o);const a=ts(r.left,r.top,t.width,t.height);n.setInitialPos({style:yo(e),position:go(e,"position")||"static",bounds:a,location:s.location})};const ul=(e,t,o,n,s)=>{n.getInitialPos().fold((()=>dl(e,t,o,n,s)),(()=>v))};const fl=(e,t,o)=>o.getInitialPos().bind((n=>{var s;o.clearInitialPos();switch(n.position){case"static":return N.some({morph:"static"});case"absolute":const o=Ki(e).getOr(Jt());const r=os(o);const a=(s=o.dom.scrollTop)!==null&&s!==void 0?s:0;return N.some({morph:"absolute",positionCss:Wi("absolute",xe(n.style,"left").map((e=>t.x-r.x)),xe(n.style,"top").map((e=>t.y-r.y+a)),xe(n.style,"right").map((e=>r.right-t.right)),xe(n.style,"bottom").map((e=>r.bottom-t.bottom)))});default:return N.none()}}));const ml=(e,t,o)=>ll(e,t,o).filter((({box:e})=>al(o.getModes(),e,t))).bind((({box:t})=>fl(e,t,o)));const gl=e=>{switch(e.location){case"top":{return N.some({morph:"fixed",positionCss:Wi("fixed",N.some(e.leftX),N.some(e.topY),N.none(),N.none())})}case"bottom":{return N.some({morph:"fixed",positionCss:Wi("fixed",N.some(e.leftX),N.none(),N.none(),N.some(e.bottomY))})}default:return N.none()}};const pl=(e,t,o)=>{const n=os(e);const s=as();const r=rl(o.getModes(),{win:s,box:n},t);if(r.location==="top"||r.location==="bottom"){dl(e,n,t,o,r);return gl(r)}else{return N.none()}};const hl=(e,t,o)=>ml(e,t,o).orThunk((()=>t.optScrollEnv.bind((n=>ll(e,t,o))).bind((({box:e,location:o})=>{const n=as();const s=sl({win:n,box:e});const r=o==="top"?ol(n,s,t):nl(n,s,t);return gl(r)}))));const yl=(e,t,o)=>{const n=e.element;const s=ze(ho(n,"position"),"fixed");return s?hl(n,t,o):pl(n,t,o)};const bl=(e,t,o)=>{const n=e.element;return ll(n,t,o).bind((({box:e})=>fl(n,e,o)))};const vl=(e,t,o,n)=>{const s=os(e);const r=as();const a=sl({win:r,box:s});const c=n(r,a,t);if(c.location==="bottom"||c.location==="top"){ul(e,s,t,o,c);return gl(c)}else{return N.none()}};const kl=(e,t,o)=>{o.setDocked(false);Z(["left","right","top","bottom","position"],(t=>vo(e.element,t)));t.onUndocked(e)};const wl=(e,t,o,n)=>{const s=n.position==="fixed";o.setDocked(s);Gi(e.element,n);const r=s?t.onDocked:t.onUndocked;r(e)};const _l=(e,t,o,n,s=false)=>{t.contextual.each((t=>{t.lazyContext(e).each((r=>{const a=Qi(r,n.bounds);if(a!==o.isVisible()){o.setVisible(a);if(s&&!a){Fi(e.element,[t.fadeOutClass]);t.onHide(e)}else{const o=a?Xi:Ji;o(e,t)}}}))}))};const xl=(e,t,o,n,s)=>{_l(e,t,o,n,true);wl(e,t,o,s.positionCss)};const Cl=(e,t,o,n,s)=>{switch(s.morph){case"static":{return kl(e,t,o)}case"absolute":{return wl(e,t,o,s.positionCss)}case"fixed":{return xl(e,t,o,n,s)}}};const Sl=(e,t,o)=>{const n=t.lazyViewport(e);_l(e,t,o,n);yl(e,n,o).each((s=>{Cl(e,t,o,n,s)}))};const zl=(e,t,o)=>{const n=e.element;o.setDocked(false);const s=t.lazyViewport(e);bl(e,s,o).each((n=>{switch(n.morph){case"static":{kl(e,t,o);break}case"absolute":{wl(e,t,o,n.positionCss);break}}}));o.setVisible(true);t.contextual.each((t=>{Vi(n,[t.fadeInClass,t.fadeOutClass,t.transitionClass]);t.onShow(e)}));Tl(e,t,o)};const Tl=(e,t,o)=>{if(e.getSystem().isConnected()){Sl(e,t,o)}};const El=(e,t,o)=>{if(o.isDocked()){zl(e,t,o)}};const Ol=e=>(t,o,n)=>{const s=o.lazyViewport(t);const r=vl(t.element,s,n,e);r.each((e=>{xl(t,o,n,s,e)}))};const Al=Ol(ol);const Dl=Ol(nl);const Nl=(e,t,o)=>o.isDocked();const Ml=(e,t,o,n)=>o.setModes(n);const Rl=(e,t,o)=>o.getModes();var Bl=Object.freeze({__proto__:null,refresh:Tl,reset:El,isDocked:Nl,getModes:Rl,setModes:Ml,forceDockToTop:Al,forceDockToBottom:Dl});const Ll=(e,t)=>jc([ti(sc(),((o,n)=>{e.contextual.each((e=>{if(Pi(o.element,e.transitionClass)){Vi(o.element,[e.transitionClass,e.fadeInClass]);const n=t.isVisible()?e.onShown:e.onHidden;n(o)}n.stop()}))})),Wc(_c(),((o,n)=>{Tl(o,e,t)})),Wc(Ac(),((o,n)=>{Tl(o,e,t)})),Wc(xc(),((o,n)=>{El(o,e,t)}))]);var Hl=Object.freeze({__proto__:null,events:Ll});const Il=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;return Lt(Je.fromDom(n))};const Pl=e=>e.dom.innerHTML;const Fl=(e,t)=>{const o=zt(e);const n=o.dom;const s=Je.fromDom(n.createDocumentFragment());const r=Il(t,n);In(s,r);Pn(e);Ln(e,s)};const Vl=e=>{const t=Je.fromTag("div");const o=Je.fromDom(e.dom.cloneNode(true));Ln(t,o);return Pl(t)};const jl=(e,t)=>Je.fromDom(e.dom.cloneNode(t));const Zl=e=>jl(e,false);const Ul=e=>jl(e,true);const ql=e=>{if(Vt(e)){return"#shadow-root"}else{const t=Zl(e);return Vl(t)}};const Wl=e=>ql(e);const $l="unknown";var Gl;(function(e){e[e["STOP"]=0]="STOP";e[e["NORMAL"]=1]="NORMAL";e[e["LOGGING"]=2]="LOGGING"})(Gl||(Gl={}));const Kl=cs({});const Yl=(e,t)=>{const o=[];const n=(new Date).getTime();return{logEventCut:(e,t,n)=>{o.push({outcome:"cut",target:t,purpose:n})},logEventStopped:(e,t,n)=>{o.push({outcome:"stopped",target:t,purpose:n})},logNoParent:(e,t,n)=>{o.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:(e,t)=>{o.push({outcome:"no-handlers-left",target:t})},logEventResponse:(e,t,n)=>{o.push({outcome:"response",purpose:n,target:t})},write:()=>{const s=(new Date).getTime();if(I(["mousemove","mouseover","mouseout",vc()],e)){return}console.log(e,{event:e,time:s-n,target:t.dom,sequence:j(o,(e=>{if(!I(["cut","stopped","response"],e.outcome)){return e.outcome}else{return"{"+e.purpose+"} "+e.outcome+" at ("+Wl(e.target)+")"}}))})}}};const Xl=(e,t,o)=>{const n=xe(Kl.get(),e).orThunk((()=>{const t=ue(Kl.get());return de(t,(t=>e.indexOf(t)>-1?N.some(Kl.get()[t]):N.none()))})).getOr(Gl.NORMAL);switch(n){case Gl.NORMAL:return o(od());case Gl.LOGGING:{const n=Yl(e,t);const s=o(n);n.write();return s}case Gl.STOP:return true}};const Jl=["alloy/data/Fields","alloy/debugging/Debugging"];const Ql=()=>{const e=new Error;if(e.stack!==undefined){const t=e.stack.split("\n");return Y(t,(e=>e.indexOf("alloy")>0&&!P(Jl,(t=>e.indexOf(t)>-1)))).getOr($l)}else{return $l}};const ed={logEventCut:v,logEventStopped:v,logNoParent:v,logEventNoHandlers:v,logEventResponse:v,write:v};const td=(e,t,o)=>Xl(e,t,o);const od=x(ed);const nd=x([jr("menu"),jr("selectedMenu")]);const sd=x([jr("item"),jr("selectedItem")]);x(mr(sd().concat(nd())));const rd=x(mr(sd()));const ad=Yr("initSize",[jr("numColumns"),jr("numRows")]);const cd=()=>Zr("markers",rd());const id=()=>Yr("markers",[jr("backgroundMenu")].concat(nd()).concat(sd()));const ld=e=>Yr("markers",j(e,jr));const dd=(e,t,o)=>{Ql();return Pr(t,t,o,Ar((e=>hs.value(((...t)=>e.apply(undefined,t))))))};const ud=e=>dd("onHandler",e,Ps(v));const fd=e=>dd("onKeyboardHandler",e,Ps(N.none));const md=e=>dd("onHandler",e,Hs());const gd=e=>dd("onKeyboardHandler",e,Hs());const pd=(e,t)=>Fr(e,x(t));const hd=e=>Fr(e,C);const yd=x(ad);var bd=[aa("contextual",[qr("fadeInClass"),qr("fadeOutClass"),qr("transitionClass"),Gr("lazyContext"),ud("onShow"),ud("onShown"),ud("onHide"),ud("onHidden")]),ga("lazyViewport",(()=>({bounds:as(),optScrollEnv:N.none()}))),ha("modes",["top","bottom"],_r),ud("onDocked"),ud("onUndocked")];const vd=e=>{const t=cs(false);const o=cs(true);const n=us();const s=cs(e.modes);const r=()=>`docked: ${t.get()}, visible: ${o.get()}, modes: ${s.get().join(",")}`;return ki({isDocked:t.get,setDocked:t.set,getInitialPos:n.get,setInitialPos:n.set,clearInitialPos:n.clear,isVisible:o.get,setVisible:o.set,getModes:s.get,setModes:s.set,readState:r})};var kd=Object.freeze({__proto__:null,init:vd});const wd=xi({fields:bd,name:"docking",active:Hl,apis:Bl,state:kd});const _d=(e,t,o)=>Ct(t,e.element)&&!Ct(t,o);const xd=jc([Uc(lc(),((e,t)=>{const o=t.event;const n=o.originator;const s=o.target;if(_d(e,n,s)){console.warn(lc()+" did not get interpreted by the desired target. "+"\nOriginator: "+Wl(n)+"\nTarget: "+Wl(s)+"\nCheck the "+lc()+" event handlers");return false}else{return true}}))]);var Cd=Object.freeze({__proto__:null,events:xd});let Sd=0;const zd=e=>{const t=new Date;const o=t.getTime();const n=Math.floor(Math.random()*1e9);Sd++;return e+"_"+n+Sd+String(o)};const Td=x("alloy-id-");const Ed=x("data-alloy-id");const Od=Td();const Ad=Ed();const Dd=(e,t)=>{const o=zd(Od+e);Nd(t,o);return o};const Nd=(e,t)=>{Object.defineProperty(e.dom,Ad,{value:t,writable:true})};const Md=e=>{const t=pt(e)?e.dom[Ad]:null;return N.from(t)};const Rd=e=>zd(e);const Bd=C;const Ld=e=>{const t=t=>`The component must be in a context to execute: ${t}`+(e?"\n"+Wl(e().element)+" is not in context.":"");const o=e=>()=>{throw new Error(t(e))};const n=e=>()=>{console.warn(t(e))};return{debugInfo:x("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),build:o("build"),buildOrPatch:o("buildOrPatch"),addToWorld:o("addToWorld"),removeFromWorld:o("removeFromWorld"),addToGui:o("addToGui"),removeFromGui:o("removeFromGui"),getByUid:o("getByUid"),getByDom:o("getByDom"),isConnected:A}};const Hd=Ld();const Id=zd("alloy-premade");const Pd=e=>{Object.defineProperty(e.element.dom,Id,{value:e.uid,writable:true});return Sa(Id,e)};const Fd=e=>Ce(e.dom,Id);const Vd=e=>xe(e,Id);const jd=e=>li(((t,...o)=>e(t.getApis(),t,...o)),e);const Zd=(e,t)=>{const o=j(t,(e=>aa(e.name(),[jr("config"),ia("state",vi)])));const n=Mr("component.behaviours",mr(o),e.behaviours).fold((t=>{throw new Error(Lr(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))}),C);return{list:t,data:ge(n,(e=>{const t=e.map((e=>({config:e.config,state:e.state.init(e.config)})));return x(t)}))}};const Ud=e=>e.list;const qd=e=>e.data;const Wd=(e,t)=>{const o={};me(e,((e,n)=>{me(e,((e,s)=>{const r=xe(o,s).getOr([]);o[s]=r.concat([t(n,e)])}))}));return o};const $d=(e,t,o,n)=>{const s={...t};Z(o,(t=>{s[t.name()]=t.exhibit(e,n)}));const r=Wd(s,((e,t)=>({name:e,modification:t})));const a=e=>$(e,((e,t)=>({...t.modification,...e})),{});const c=$(r.classes,((e,t)=>t.modification.concat(e)),[]);const i=a(r.attributes);const l=a(r.styles);return di({classes:c,attributes:i,styles:l})};const Gd=(e,t,o,n)=>{try{const s=re(o,((o,s)=>{const r=o[t];const a=s[t];const c=n.indexOf(r);const i=n.indexOf(a);if(c===-1){throw new Error("The ordering for "+e+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(n,null,2))}if(i===-1){throw new Error("The ordering for "+e+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(n,null,2))}if(c<i){return-1}else if(i<c){return 1}else{return 0}}));return hs.value(s)}catch(e){return hs.error([e])}};const Kd=(e,t)=>({handler:e,purpose:t});const Yd=(e,t)=>({cHandler:e,purpose:t});const Xd=(e,t)=>Yd(z.apply(undefined,[e.handler].concat(t)),e.purpose);const Jd=e=>e.cHandler;const Qd=(e,t)=>({name:e,handler:t});const eu=(e,t)=>{const o={};Z(e,(e=>{o[e.name()]=e.handlers(t)}));return o};const tu=(e,t,o)=>{const n={...o,...eu(t,e)};return Wd(n,Qd)};const ou=(e,t,o,n)=>{const s=tu(e,o,n);return au(s,t)};const nu=e=>{const t=Ia(e);return(e,o,...n)=>{const s=[e,o].concat(n);if(t.abort.apply(undefined,s)){o.stop()}else if(t.can.apply(undefined,s)){t.run.apply(undefined,s)}}};const su=(e,t)=>hs.error(["The event ("+e+") has more than one behaviour that listens to it.\nWhen this occurs, you must "+'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that '+"can trigger it are: "+JSON.stringify(j(t,(e=>e.name)),null,2)]);const ru=(e,t,o)=>{const n=t[o];if(!n){return su(o,e)}else{return Gd("Event: "+o,"name",e,n).map((e=>{const t=j(e,(e=>e.handler));return Pa(t)}))}};const au=(e,t)=>{const o=ke(e,((e,o)=>{const n=e.length===1?hs.value(e[0].handler):ru(e,t,o);return n.map((n=>{const s=nu(n);const r=e.length>1?W(t[o],(t=>P(e,(e=>e.name===t)))).join(" > "):e[0].name;return Sa(o,Kd(s,r))}))}));return Oa(o,{})};const cu="alloy.base.behaviour";const iu=mr([Pr("dom","dom",Hs(),mr([jr("tag"),ia("styles",{}),ia("classes",[]),ia("attributes",{}),Qr("value"),Qr("innerHtml")])),jr("components"),jr("uid"),ia("events",{}),ia("apis",{}),Pr("eventOrder","eventOrder",js({[mc()]:["disabling",cu,"toggling","typeaheadevents"],[lc()]:[cu,"focusing","keying"],[vc()]:[cu,"disabling","toggling","representing"],[ec()]:[cu,"representing","streaming","invalidating"],[Sc()]:[cu,"representing","item-events","toolbar-button-events","tooltipping"],[qa()]:["focusing",cu,"item-type-events"],[Va()]:["focusing",cu,"item-type-events"],[Ka()]:["item-type-events","tooltipping"],[fc()]:["receiving","reflecting","tooltipping"]}),vr()),Qr("domModification")]);const lu=e=>Mr("custom.definition",iu,e);const du=e=>({...e.dom,uid:e.uid,domChildren:j(e.components,(e=>e.element))});const uu=e=>e.domModification.fold((()=>di({})),di);const fu=e=>e.events;const mu=e=>e.dom.value;const gu=(e,t)=>{if(t===undefined){throw new Error("Value.set was undefined")}e.dom.value=t};const pu=(e,t,o)=>{const n=Ht(e,t);return n.map((e=>{const t=o.exists((t=>!Ct(t,e)));if(t){const t=o.map(ut).getOr("span");const n=Je.fromTag(t);Mn(e,n);return n}else{return e}}))};const hu=(e,t,o)=>{o.fold((()=>Ln(e,t)),(e=>{if(!Ct(e,t)){Mn(e,t);Fn(e)}}))};const yu=(e,t,o)=>{const n=j(t,o);const s=Lt(e);Z(s.slice(n.length),Fn);return n};const bu=(e,t,o,n)=>{const s=Ht(e,t);const r=n(o,s);const a=pu(e,t,s);hu(e,r.element,a);return r};const vu=(e,t,o)=>yu(e,t,((t,n)=>bu(e,n,t,o)));const ku=(e,t)=>yu(e,t,((t,o)=>{const n=Ht(e,o);hu(e,t,n);return t}));const wu=(e,t)=>{const o=ue(e);const n=ue(t);const s=oe(n,o);const r=be(e,((e,o)=>!Ce(t,o)||e!==t[o])).t;return{toRemove:s,toSet:r}};const _u=(e,t)=>{const{class:o,style:n,...s}=co(t);const{toSet:r,toRemove:a}=wu(e.attributes,s);const c=()=>{Z(a,(e=>ao(t,e)));oo(t,r)};const i=yo(t);const{toSet:l,toRemove:d}=wu(e.styles,i);const u=()=>{Z(d,(e=>vo(t,e)));fo(t,l)};const f=qi(t);const m=oe(f,e.classes);const g=oe(e.classes,f);const p=()=>{Fi(t,g);Vi(t,m)};const h=e=>{Fl(t,e)};const y=()=>{const o=e.domChildren;ku(t,o)};const b=()=>{const o=t;const n=e.value.getOrUndefined();if(n!==mu(o)){gu(o,n!==null&&n!==void 0?n:"")}};c();p();u();e.innerHtml.fold(y,h);b();return t};const xu=e=>{const t=Je.fromTag(e.tag);oo(t,e.attributes);Fi(t,e.classes);fo(t,e.styles);e.innerHtml.each((e=>Fl(t,e)));const o=e.domChildren;In(t,o);e.value.each((e=>{gu(t,e)}));return t};const Cu=(e,t)=>{try{const o=_u(e,t);return N.some(o)}catch(e){return N.none()}};const Su=e=>e.innerHtml.isSome()&&e.domChildren.length>0;const zu=(e,t)=>{const o=t=>ut(t)===e.tag&&!Su(e)&&!Fd(t);const n=t.filter(o).bind((t=>Cu(e,t))).getOrThunk((()=>xu(e)));Nd(n,e.uid);return n};const Tu=e=>{const t=xe(e,"behaviours").getOr({});return Q(ue(t),(e=>{const o=t[e];return p(o)?[o.me]:[]}))};const Eu=(e,t)=>Zd(e,t);const Ou=e=>{const t=Tu(e);return Eu(e,t)};const Au=(e,t,o)=>{const n=du(e);const s=uu(e);const r={"alloy.base.modification":s};const a=t.length>0?$d(o,r,t,n):s;return ui(n,a)};const Du=(e,t,o)=>{const n={"alloy.base.behaviour":fu(e)};return ou(o,e.eventOrder,t,n).getOrDie()};const Nu=(e,t)=>{const o=()=>k;const n=cs(Hd);const s=Rr(lu(e));const r=Ou(e);const a=Ud(r);const c=qd(r);const i=Au(s,a,c);const l=zu(i,t);const d=Du(s,a,c);const u=cs(s.components);const f=e=>{n.set(e)};const m=()=>{n.set(Ld(o))};const g=()=>{const e=Lt(l);const t=Q(e,(e=>n.get().getByDom(e).fold((()=>[]),se)));u.set(t)};const p=t=>{const o=c;const n=h(o[t.name()])?o[t.name()]:()=>{throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))};return n()};const y=e=>h(c[e.name()]);const b=()=>s.apis;const v=e=>c[e]().map((e=>e.state.readState())).getOr("not enabled");const k={uid:e.uid,getSystem:n.get,config:p,hasConfigured:y,spec:e,readState:v,getApis:b,connect:f,disconnect:m,element:l,syncComponents:g,components:u.get,events:d};return k};const Mu=(e,t)=>{const o=xe(e,"components").getOr([]);return t.fold((()=>j(o,Fu)),(e=>j(o,((t,o)=>Pu(t,Ht(e,o))))))};const Ru=(e,t)=>{const{events:o,...n}=Bd(e);const s=Mu(n,t);const r={...n,events:{...Cd,...o},components:s};return hs.value(Nu(r,t))};const Bu=e=>{const t=Je.fromText(e);return Lu({element:t})};const Lu=e=>{const t=Br("external.component",fr([jr("element"),Qr("uid")]),e);const o=cs(Ld());const n=e=>{o.set(e)};const s=()=>{o.set(Ld((()=>a)))};const r=t.uid.getOrThunk((()=>Rd("external")));Nd(t.element,r);const a={uid:r,getSystem:o.get,config:N.none,hasConfigured:A,connect:n,disconnect:s,getApis:()=>({}),element:t.element,spec:e,readState:x("No state"),syncComponents:v,components:x([]),events:{}};return Pd(a)};const Hu=Rd;const Iu=e=>Ce(e,"uid");const Pu=(e,t)=>Vd(e).getOrThunk((()=>{const o=Iu(e)?e:{uid:Hu(""),...e};return Ru(o,t).getOrDie()}));const Fu=e=>Pu(e,N.none());const Vu=Pd;var ju=(e,t,o,n,s)=>{if(e(o,n)){return N.some(o)}else if(h(s)&&s(o)){return N.none()}else{return t(o,n,s)}};const Zu=(e,t,o)=>{let n=e.dom;const s=h(o)?o:A;while(n.parentNode){n=n.parentNode;const e=Je.fromDom(n);if(t(e)){return N.some(e)}else if(s(e)){break}}return N.none()};const Uu=(e,t,o)=>{const n=(e,t)=>t(e);return ju(n,Zu,e,t,o)};const qu=(e,t)=>{const o=e.dom;if(!o.parentNode){return N.none()}return Wu(Je.fromDom(o.parentNode),(o=>!Ct(e,o)&&t(o)))};const Wu=(e,t)=>{const o=e=>t(Je.fromDom(e));const n=Y(e.dom.childNodes,o);return n.map(Je.fromDom)};const $u=(e,t)=>{const o=e=>{for(let n=0;n<e.childNodes.length;n++){const s=Je.fromDom(e.childNodes[n]);if(t(s)){return N.some(s)}const r=o(e.childNodes[n]);if(r.isSome()){return r}}return N.none()};return o(e.dom)};const Gu=(e,t,o)=>Uu(e,t,o).isSome();const Ku=e=>xt(e);const Yu=(e,t,o)=>Zu(e,(e=>kt(e,t)),o);const Xu=(e,t)=>qu(e,(e=>kt(e,t)));const Ju=(e,t)=>Wu(e,(e=>kt(e,t)));const Qu=(e,t)=>xt(t,e);const ef=(e,t,o)=>{const n=(e,t)=>kt(e,t);return ju(n,Yu,e,t,o)};const tf="aria-controls";const of=e=>{const t=Uu(e,(e=>{if(!pt(e)){return false}const t=no(e,"id");return t!==undefined&&t.indexOf(tf)>-1}));return t.bind((e=>{const t=no(e,"id");const o=Ut(e);return Qu(o,`[${tf}="${t}"]`)}))};const nf=()=>{const e=zd(tf);const t=t=>{to(t,tf,e)};const o=e=>{ao(e,tf)};return{id:e,link:t,unlink:o}};const sf=(e,t)=>of(t).exists((t=>rf(e,t)));const rf=(e,t)=>Gu(t,(t=>Ct(t,e.element)),A)||sf(e,t);const af=(e,t,o,n,s,r,a,c=false)=>({x:e,y:t,bubble:o,direction:n,placement:s,restriction:r,label:`${a}-${s}`,alwaysFit:c});const cf=va.generate([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]);const lf=(e,t,o,n,s,r,a,c,i)=>e.fold(t,o,n,s,r,a,c,i);const df=(e,t,o,n)=>e.fold(t,t,n,n,t,n,o,o);const uf=(e,t,o,n)=>e.fold(t,n,t,n,o,o,t,n);const ff=cf.southeast;const mf=cf.southwest;const gf=cf.northeast;const pf=cf.northwest;const hf=cf.south;const yf=cf.north;const bf=cf.east;const vf=cf.west;const kf=(e,t,o,n)=>{const s=e+t;if(s>n){return o}else if(s<o){return n}else{return s}};const wf=(e,t,o)=>Math.min(Math.max(e,t),o);const _f=(e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}};const xf=(e,t)=>ne(["left","right","top","bottom"],(o=>xe(t,o).map((t=>_f(e,t)))));const Cf=(e,t,o)=>{const n=(n,s)=>t[n].map((t=>{const r=n==="top"||n==="bottom";const a=r?o.top:o.left;const c=n==="left"||n==="top"?Math.max:Math.min;const i=c(t,s)+a;return r?wf(i,e.y,e.bottom):wf(i,e.x,e.right)})).getOr(s);const s=n("left",e.x);const r=n("top",e.y);const a=n("right",e.right);const c=n("bottom",e.bottom);return ts(s,r,a-s,c-r)};const Sf="layout";const zf=e=>e.x;const Tf=(e,t)=>e.x+e.width/2-t.width/2;const Ef=(e,t)=>e.x+e.width-t.width;const Of=(e,t)=>e.y-t.height;const Af=e=>e.y+e.height;const Df=(e,t)=>e.y+e.height/2-t.height/2;const Nf=e=>e.x+e.width;const Mf=(e,t)=>e.x-t.width;const Rf=(e,t,o)=>af(zf(e),Af(e),o.southeast(),ff(),"southeast",xf(e,{left:1,top:3}),Sf);const Bf=(e,t,o)=>af(Ef(e,t),Af(e),o.southwest(),mf(),"southwest",xf(e,{right:0,top:3}),Sf);const Lf=(e,t,o)=>af(zf(e),Of(e,t),o.northeast(),gf(),"northeast",xf(e,{left:1,bottom:2}),Sf);const Hf=(e,t,o)=>af(Ef(e,t),Of(e,t),o.northwest(),pf(),"northwest",xf(e,{right:0,bottom:2}),Sf);const If=(e,t,o)=>af(Tf(e,t),Of(e,t),o.north(),yf(),"north",xf(e,{bottom:2}),Sf);const Pf=(e,t,o)=>af(Tf(e,t),Af(e),o.south(),hf(),"south",xf(e,{top:3}),Sf);const Ff=(e,t,o)=>af(Nf(e),Df(e,t),o.east(),bf(),"east",xf(e,{left:0}),Sf);const Vf=(e,t,o)=>af(Mf(e,t),Df(e,t),o.west(),vf(),"west",xf(e,{right:1}),Sf);const jf=()=>[Rf,Bf,Lf,Hf,Pf,If,Ff,Vf];const Zf=()=>[Bf,Rf,Hf,Lf,Pf,If,Ff,Vf];const Uf=()=>[Lf,Hf,Rf,Bf,If,Pf];const qf=()=>[Hf,Lf,Bf,Rf,If,Pf];const Wf=()=>[Rf,Bf,Lf,Hf,Pf,If];const $f=()=>[Bf,Rf,Hf,Lf,Pf,If];const Gf=(e,t)=>t.universal?e:W(e,(e=>I(t.channels,e)));const Kf=e=>jc([Wc(fc(),((t,o)=>{const n=e.channels;const s=ue(n);const r=o;const a=Gf(s,r);Z(a,(e=>{const o=n[e];const s=o.schema;const a=Br("channel["+e+"] data\nReceiver: "+Wl(t.element),s,r.data);o.onReceive(t,a)}))}))]);var Yf=Object.freeze({__proto__:null,events:Kf});var Xf=[Zr("channels",Dr(hs.value,fr([md("onReceive"),ia("schema",vr())])))];const Jf=xi({fields:Xf,name:"receiving",active:Yf});const Qf=(e,t)=>di({classes:[],styles:t.useFixed()?{}:{position:"relative"}});var em=Object.freeze({__proto__:null,exhibit:Qf});const tm=(e,t=false)=>e.dom.focus({preventScroll:t});const om=e=>e.dom.blur();const nm=e=>{const t=Ut(e).dom;return e.dom===t.activeElement};const sm=(e=Wn())=>N.from(e.dom.activeElement).map(Je.fromDom);const rm=e=>sm(Ut(e)).filter((t=>e.dom.contains(t.dom)));const am=(e,t)=>{const o=Ut(t);const n=sm(o).bind((e=>{const o=t=>Ct(e,t);return o(t)?N.some(t):$u(t,o)}));const s=e(t);n.each((e=>{sm(o).filter((t=>Ct(t,e))).fold((()=>{tm(e)}),v)}));return s};const cm=va.generate([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]);const im=(e,t,o,n,s,r)=>{const a=t.rect;const c=a.x-o;const i=a.y-n;const l=a.width;const d=a.height;const u=s-(c+l);const f=r-(i+d);const m=N.some(c);const g=N.some(i);const p=N.some(u);const h=N.some(f);const y=N.none();return lf(t.direction,(()=>Wi(e,m,g,y,y)),(()=>Wi(e,y,g,p,y)),(()=>Wi(e,m,y,y,h)),(()=>Wi(e,y,y,p,h)),(()=>Wi(e,m,g,y,y)),(()=>Wi(e,m,y,y,h)),(()=>Wi(e,m,g,y,y)),(()=>Wi(e,y,g,p,y)))};const lm=(e,t)=>e.fold((()=>{const e=t.rect;return Wi("absolute",N.some(e.x),N.some(e.y),N.none(),N.none())}),((e,o,n,s)=>im("absolute",t,e,o,n,s)),((e,o,n,s)=>im("fixed",t,e,o,n,s)));const dm=(e,t)=>{const o=z(Jn,t);const n=e.fold(o,o,(()=>{const e=Vn();return Jn(t).translate(-e.left,-e.top)}));const s=Bo(t);const r=Co(t);return ts(n.left,n.top,s,r)};const um=(e,t)=>t.fold((()=>e.fold(as,as,ts)),(t=>e.fold(x(t),x(t),(()=>{const o=fm(e,t.x,t.y);return ts(o.left,o.top,t.width,t.height)}))));const fm=(e,t,o)=>{const n=To(t,o);const s=()=>{const e=Vn();return n.translate(-e.left,-e.top)};return e.fold(x(n),x(n),s)};const mm=(e,t,o,n)=>e.fold(t,o,n);cm.none;const gm=cm.relative;const pm=cm.fixed;const hm=(e,t)=>({anchorBox:e,origin:t});const ym=(e,t)=>hm(e,t);const bm="data-alloy-placement";const vm=(e,t)=>{to(e,bm,t)};const km=e=>so(e,bm);const wm=e=>ao(e,bm);const _m=va.generate([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]);const xm=(e,t)=>{const{x:o,y:n,right:s,bottom:r}=t;const{x:a,y:c,right:i,bottom:l,width:d,height:u}=e;const f=a>=o&&a<=s;const m=c>=n&&c<=r;const g=f&&m;const p=i<=s&&i>=o;const h=l<=r&&l>=n;const y=p&&h;const b=Math.min(d,a>=o?s-a:i-o);const v=Math.min(u,c>=n?r-c:l-n);return{originInBounds:g,sizeInBounds:y,visibleW:b,visibleH:v}};const Cm=(e,t)=>{const{x:o,y:n,right:s,bottom:r}=t;const{x:a,y:c,width:i,height:l}=e;const d=Math.max(o,s-i);const u=Math.max(n,r-l);const f=wf(a,o,d);const m=wf(c,n,u);const g=Math.min(f+i,s)-f;const p=Math.min(m+l,r)-m;return ts(f,m,g,p)};const Sm=(e,t,o)=>{const n=x(t.bottom-o.y);const s=x(o.bottom-t.y);const r=df(e,s,s,n);const a=x(t.right-o.x);const c=x(o.right-t.x);const i=uf(e,c,c,a);return{maxWidth:i,maxHeight:r}};const zm=(e,t,o,n)=>{const s=e.bubble;const r=s.offset;const a=Cf(n,e.restriction,r);const c=e.x+r.left;const i=e.y+r.top;const l=ts(c,i,t,o);const{originInBounds:d,sizeInBounds:u,visibleW:f,visibleH:m}=xm(l,a);const g=d&&u;const p=g?l:Cm(l,a);const h=p.width>0&&p.height>0;const{maxWidth:y,maxHeight:b}=Sm(e.direction,p,n);const v={rect:p,maxHeight:b,maxWidth:y,direction:e.direction,placement:e.placement,classes:{on:s.classesOn,off:s.classesOff},layout:e.label,testY:i};return g||e.alwaysFit?_m.fit(v):_m.nofit(v,f,m,h)};const Tm=(e,t,o,n,s,r)=>{const a=n.width;const c=n.height;const i=(t,i,l,d,u)=>{const f=t(o,n,s,e,r);const m=zm(f,a,c,r);return m.fold(x(m),((e,t,o,n)=>{const s=u===n?o>d||t>l:!u&&n;return s?m:_m.nofit(i,l,d,u)}))};const l=G(t,((e,t)=>{const o=z(i,t);return e.fold(x(e),o)}),_m.nofit({rect:o,maxHeight:n.height,maxWidth:n.width,direction:ff(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:o.y},-1,-1,false));return l.fold(C,C)};const Em=D;const Om=(e,t,o)=>An(e,t,Em,o);const Am=(e,t,o)=>Dn(e,t,Em,o);const Dm=Tn;const Nm=["top","bottom","right","left"];const Mm="data-alloy-transition-timer";const Rm=(e,t)=>Zi(e,t.classes);const Bm=(e,t,o)=>o.exists((o=>{const n=e.mode;return n==="all"?true:o[n]!==t[n]}));const Lm=(e,t)=>{const o=e=>parseFloat(e).toFixed(3);return we(t,((t,n)=>{const s=e[n].map(o);const r=t.map(o);return!Te(s,r)})).isSome()};const Hm=e=>{const t=t=>{const o=go(e,t);const n=o.split(/\s*,\s*/);return W(n,Ue)};const o=e=>{if(c(e)&&/^[\d.]+/.test(e)){const t=parseFloat(e);return Ve(e,"ms")?t:t*1e3}else{return 0}};const n=t("transition-delay");const s=t("transition-duration");return G(s,((e,t,s)=>{const r=o(n[s])+o(t);return Math.max(e,r)}),0)};const Im=(e,t)=>{const o=ds();const n=ds();let s;const r=t=>{var o;const n=(o=t.raw.pseudoElement)!==null&&o!==void 0?o:"";return Ct(t.target,e)&&qe(n)&&I(Nm,t.raw.propertyName)};const a=a=>{if(g(a)||r(a)){o.clear();n.clear();const r=a===null||a===void 0?void 0:a.raw.type;if(g(r)||r===sc()){clearTimeout(s);ao(e,Mm);Vi(e,t.classes)}}};const c=Om(e,rc(),(t=>{if(r(t)){c.unbind();o.set(Om(e,sc(),a));n.set(Om(e,nc(),a))}}));const i=Hm(e);requestAnimationFrame((()=>{s=setTimeout(a,i+17);to(e,Mm,s)}))};const Pm=(e,t)=>{Fi(e,t.classes);so(e,Mm).each((t=>{clearTimeout(parseInt(t,10));ao(e,Mm)}));Im(e,t)};const Fm=(e,t,o,n,s,r)=>{const a=Bm(n,s,r);if(a||Rm(e,n)){uo(e,"position",o.position);const r=dm(t,e);const c=lm(t,{...s,rect:r});const i=ne(Nm,(e=>c[e]));if(Lm(o,i)){mo(e,i);if(a){Pm(e,n)}ko(e)}}else{Vi(e,n.classes)}};const Vm=e=>({width:Bo(e),height:Co(e)});const jm=(e,t,o,n)=>{vo(t,"max-height");vo(t,"max-width");const s=Vm(t);return Tm(t,n.preference,e,s,o,n.bounds)};const Zm=(e,t)=>{const o=t.classes;Vi(e,o.off);Fi(e,o.on)};const Um=(e,t,o)=>{const n=o.maxHeightFunction;n(e,t.maxHeight)};const qm=(e,t,o)=>{const n=o.maxWidthFunction;n(e,t.maxWidth)};const Wm=(e,t,o)=>{const n=lm(o.origin,t);o.transition.each((s=>{Fm(e,o.origin,n,s,t,o.lastPlacement)}));Gi(e,n)};const $m=(e,t)=>{vm(e,t.placement)};const Gm=(e,t)=>{So(e,Math.floor(t))};const Km=x(((e,t)=>{Gm(e,t);fo(e,{"overflow-x":"hidden","overflow-y":"auto"})}));const Ym=x(((e,t)=>{Gm(e,t)}));const Xm=(e,t,o)=>e[t]===undefined?o:e[t];const Jm=(e,t,o,n,s,r,a,c)=>{const i=Xm(a,"maxHeightFunction",Km());const l=Xm(a,"maxWidthFunction",v);const d=e.anchorBox;const u=e.origin;const f={bounds:um(u,r),origin:u,preference:n,maxHeightFunction:i,maxWidthFunction:l,lastPlacement:s,transition:c};return Qm(d,t,o,f)};const Qm=(e,t,o,n)=>{const s=jm(e,t,o,n);Wm(t,s,n);$m(t,s);Zm(t,s);Um(t,s,n);qm(t,s,n);return{layout:s.layout,placement:s.placement}};const eg=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"];const tg=(e,t,o,n=1)=>{const s=e*n;const r=t*n;const a=e=>xe(o,e).getOr([]);const c=(e,t,o)=>{const n=oe(eg,o);return{offset:To(e,t),classesOn:Q(o,a),classesOff:Q(n,a)}};return{southeast:()=>c(-e,t,["top","alignLeft"]),southwest:()=>c(e,t,["top","alignRight"]),south:()=>c(-e/2,t,["top","alignCentre"]),northeast:()=>c(-e,-t,["bottom","alignLeft"]),northwest:()=>c(e,-t,["bottom","alignRight"]),north:()=>c(-e/2,-t,["bottom","alignCentre"]),east:()=>c(e,-t/2,["valignCentre","left"]),west:()=>c(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>c(s,r,["top","alignLeft","inset"]),insetNorthwest:()=>c(-s,r,["top","alignRight","inset"]),insetNorth:()=>c(-s/2,r,["top","alignCentre","inset"]),insetSoutheast:()=>c(s,-r,["bottom","alignLeft","inset"]),insetSouthwest:()=>c(-s,-r,["bottom","alignRight","inset"]),insetSouth:()=>c(-s/2,-r,["bottom","alignCentre","inset"]),insetEast:()=>c(-s,-r/2,["valignCentre","right","inset"]),insetWest:()=>c(s,-r/2,["valignCentre","left","inset"])}};const og=()=>tg(0,0,{});const ng=C;const sg=(e,t)=>o=>rg(o)==="rtl"?t:e;const rg=e=>go(e,"direction")==="rtl"?"rtl":"ltr";var ag;(function(e){e["TopToBottom"]="toptobottom";e["BottomToTop"]="bottomtotop"})(ag||(ag={}));const cg="data-alloy-vertical-dir";const ig=e=>Gu(e,(e=>pt(e)&&no(e,"data-alloy-vertical-dir")===ag.BottomToTop));const lg=()=>aa("layouts",[jr("onLtr"),jr("onRtl"),Qr("onBottomLtr"),Qr("onBottomRtl")]);const dg=(e,t,o,n,s,r,a)=>{const c=a.map(ig).getOr(false);const i=t.layouts.map((t=>t.onLtr(e)));const l=t.layouts.map((t=>t.onRtl(e)));const d=c?t.layouts.bind((t=>t.onBottomLtr.map((t=>t(e))))).or(i).getOr(s):i.getOr(o);const u=c?t.layouts.bind((t=>t.onBottomRtl.map((t=>t(e))))).or(l).getOr(r):l.getOr(n);const f=sg(d,u);return f(e)};const ug=(e,t,o)=>{const n=t.hotspot;const s=dm(o,n.element);const r=dg(e.element,t,Wf(),$f(),Uf(),qf(),N.some(t.hotspot.element));return N.some(ng({anchorBox:s,bubble:t.bubble.getOr(og()),overrides:t.overrides,layouts:r}))};var fg=[jr("hotspot"),Qr("bubble"),ia("overrides",{}),lg(),pd("placement",ug)];const mg=(e,t,o)=>{const n=fm(o,t.x,t.y);const s=ts(n.left,n.top,t.width,t.height);const r=dg(e.element,t,jf(),Zf(),jf(),Zf(),N.none());return N.some(ng({anchorBox:s,bubble:t.bubble,overrides:t.overrides,layouts:r}))};var gg=[jr("x"),jr("y"),ia("height",0),ia("width",0),ia("bubble",og()),ia("overrides",{}),lg(),pd("placement",mg)];const pg=va.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]);const hg=e=>e.fold(C,((e,t,o)=>e.translate(-t,-o)));const yg=e=>e.fold(C,C);const bg=e=>G(e,((e,t)=>e.translate(t.left,t.top)),To(0,0));const vg=e=>{const t=j(e,hg);return bg(t)};const kg=e=>{const t=j(e,yg);return bg(t)};const wg=pg.screen;const _g=pg.absolute;const xg=(e,t,o)=>{const n=Ot(o.root).dom;const s=t=>{const o=zt(t);const n=zt(e.element);return Ct(o,n)};return N.from(n.frameElement).map(Je.fromDom).filter(s).map(Ao)};const Cg=(e,t,o)=>{const n=zt(e.element);const s=Vn(n);const r=xg(e,t,o).getOr(s);return _g(r,s.left,s.top)};const Sg=(e,t,o,n)=>{const s=wg(To(e,t));return N.some(Qn(s,o,n))};const zg=(e,t,o,n,s)=>e.map((e=>{const r=[t,e.point];const a=mm(n,(()=>kg(r)),(()=>kg(r)),(()=>vg(r)));const c=es(a.left,a.top,e.width,e.height);const i=o.showAbove?Uf():Wf();const l=o.showAbove?qf():$f();const d=dg(s,o,i,l,i,l,N.none());return ng({anchorBox:c,bubble:o.bubble.getOr(og()),overrides:o.overrides,layouts:d})}));const Tg=(e,t,o)=>{const n=Cg(e,o,t);return t.node.filter(Xt).bind((s=>{const r=s.dom.getBoundingClientRect();const a=Sg(r.left,r.top,r.width,r.height);const c=t.node.getOr(e.element);return zg(a,n,t,o,c)}))};var Eg=[jr("node"),jr("root"),Qr("bubble"),lg(),ia("overrides",{}),ia("showAbove",false),pd("placement",Tg)];const Og="\ufeff";const Ag=" ";const Dg=(e,t,o,n)=>({start:e,soffset:t,finish:o,foffset:n});const Ng={create:Dg};const Mg=va.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]);const Rg=(e,t,o,n)=>e.fold(t,o,n);const Bg=e=>e.fold(C,C,C);const Lg=Mg.before;const Hg=Mg.on;const Ig=Mg.after;const Pg={before:Lg,on:Hg,after:Ig,cata:Rg,getStart:Bg};const Fg=va.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]);const Vg=e=>Fg.exact(e.start,e.soffset,e.finish,e.foffset);const jg=e=>e.match({domRange:e=>Je.fromDom(e.startContainer),relative:(e,t)=>Pg.getStart(e),exact:(e,t,o,n)=>e});const Zg=Fg.domRange;const Ug=Fg.relative;const qg=Fg.exact;const Wg=e=>{const t=jg(e);return Ot(t)};const $g=Ng.create;const Gg={domRange:Zg,relative:Ug,exact:qg,exactFromRange:Vg,getWin:Wg,range:$g};const Kg=(e,t)=>{t.fold((t=>{e.setStartBefore(t.dom)}),((t,o)=>{e.setStart(t.dom,o)}),(t=>{e.setStartAfter(t.dom)}))};const Yg=(e,t)=>{t.fold((t=>{e.setEndBefore(t.dom)}),((t,o)=>{e.setEnd(t.dom,o)}),(t=>{e.setEndAfter(t.dom)}))};const Xg=(e,t,o)=>{const n=e.document.createRange();Kg(n,t);Yg(n,o);return n};const Jg=(e,t,o,n,s)=>{const r=e.document.createRange();r.setStart(t.dom,o);r.setEnd(n.dom,s);return r};const Qg=e=>({left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height});const ep=e=>{const t=e.getClientRects();const o=t.length>0?t[0]:e.getBoundingClientRect();return o.width>0||o.height>0?N.some(o).map(Qg):N.none()};const tp=e=>{const t=e.getBoundingClientRect();return t.width>0||t.height>0?N.some(t).map(Qg):N.none()};const op=va.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);const np=(e,t,o)=>t(Je.fromDom(o.startContainer),o.startOffset,Je.fromDom(o.endContainer),o.endOffset);const sp=(e,t)=>t.match({domRange:e=>({ltr:x(e),rtl:N.none}),relative:(t,o)=>({ltr:Ho((()=>Xg(e,t,o))),rtl:Ho((()=>N.some(Xg(e,o,t))))}),exact:(t,o,n,s)=>({ltr:Ho((()=>Jg(e,t,o,n,s))),rtl:Ho((()=>N.some(Jg(e,n,s,t,o))))})});const rp=(e,t)=>{const o=t.ltr();if(o.collapsed){const n=t.rtl().filter((e=>e.collapsed===false));return n.map((e=>op.rtl(Je.fromDom(e.endContainer),e.endOffset,Je.fromDom(e.startContainer),e.startOffset))).getOrThunk((()=>np(e,op.ltr,o)))}else{return np(e,op.ltr,o)}};const ap=(e,t)=>{const o=sp(e,t);return rp(e,o)};const cp=(e,t)=>{const o=ap(e,t);return o.match({ltr:(t,o,n,s)=>{const r=e.document.createRange();r.setStart(t.dom,o);r.setEnd(n.dom,s);return r},rtl:(t,o,n,s)=>{const r=e.document.createRange();r.setStart(n.dom,s);r.setEnd(t.dom,o);return r}})};op.ltr;op.rtl;const ip=(e,t,o)=>W(Mt(e,o),t);const lp=(e,t)=>_t(t,e);const dp=(e,t,o,n)=>{const s=zt(e);const r=s.dom.createRange();r.setStart(e.dom,t);r.setEnd(o.dom,n);return r};const up=(e,t,o,n)=>{const s=dp(e,t,o,n);const r=Ct(e,o)&&t===n;return s.collapsed&&!r};const fp=e=>N.from(e.getSelection());const mp=e=>{if(e.rangeCount>0){const t=e.getRangeAt(0);const o=e.getRangeAt(e.rangeCount-1);return N.some(Ng.create(Je.fromDom(t.startContainer),t.startOffset,Je.fromDom(o.endContainer),o.endOffset))}else{return N.none()}};const gp=e=>{if(e.anchorNode===null||e.focusNode===null){return mp(e)}else{const t=Je.fromDom(e.anchorNode);const o=Je.fromDom(e.focusNode);return up(t,e.anchorOffset,o,e.focusOffset)?N.some(Ng.create(t,e.anchorOffset,o,e.focusOffset)):mp(e)}};const pp=e=>fp(e).filter((e=>e.rangeCount>0)).bind(gp);const hp=(e,t)=>{const o=cp(e,t);return ep(o)};const yp=(e,t)=>{const o=cp(e,t);return tp(o)};const bp=(e,t)=>{const o=o=>{if(!e(o)){throw new Error("Can only get "+t+" value of a "+t+" node")}return n(o).getOr("")};const n=t=>e(t)?N.from(t.dom.nodeValue):N.none();const s=(o,n)=>{if(!e(o)){throw new Error("Can only set raw "+t+" value of a "+t+" node")}o.dom.nodeValue=n};return{get:o,getOption:n,set:s}};const vp=bp(ht,"text");const kp=e=>vp.get(e);const wp=(e,t)=>({element:e,offset:t});const _p=(e,t)=>{const o=Lt(e);if(o.length===0){return wp(e,t)}else if(t<o.length){return wp(o[t],0)}else{const e=o[o.length-1];const t=ht(e)?kp(e).length:Lt(e).length;return wp(e,t)}};const xp=(e,t)=>ht(e)?wp(e,t):_p(e,t);const Cp=e=>e.foffset!==undefined;const Sp=(e,t)=>{const o=t.getSelection.getOrThunk((()=>()=>pp(e)));return o().map((e=>{if(Cp(e)){const t=xp(e.start,e.soffset);const o=xp(e.finish,e.foffset);return Gg.range(t.element,t.offset,o.element,o.offset)}else{return e}}))};const zp=(e,t,o)=>{const n=Ot(t.root).dom;const s=Cg(e,o,t);const r=Sp(n,t).bind((e=>{if(Cp(e)){const t=yp(n,Gg.exactFromRange(e)).orThunk((()=>{const t=Je.fromText(Og);Mn(e.start,t);const o=hp(n,Gg.exact(t,0,t,1));Fn(t);return o}));return t.bind((e=>Sg(e.left,e.top,e.width,e.height)))}else{const t=ge(e,(e=>e.dom.getBoundingClientRect()));const o={left:Math.min(t.firstCell.left,t.lastCell.left),right:Math.max(t.firstCell.right,t.lastCell.right),top:Math.min(t.firstCell.top,t.lastCell.top),bottom:Math.max(t.firstCell.bottom,t.lastCell.bottom)};return Sg(o.left,o.top,o.right-o.left,o.bottom-o.top)}}));const a=Sp(n,t).bind((e=>{if(Cp(e)){return pt(e.start)?N.some(e.start):Nt(e.start)}else{return N.some(e.firstCell)}}));const c=a.getOr(e.element);return zg(r,s,t,o,c)};var Tp=[Qr("getSelection"),jr("root"),Qr("bubble"),lg(),ia("overrides",{}),ia("showAbove",false),pd("placement",zp)];const Ep="link-layout";const Op=e=>e.x+e.width;const Ap=(e,t)=>e.x-t.width;const Dp=(e,t)=>e.y-t.height+e.height;const Np=e=>e.y;const Mp=(e,t,o)=>af(Op(e),Np(e),o.southeast(),ff(),"southeast",xf(e,{left:0,top:2}),Ep);const Rp=(e,t,o)=>af(Ap(e,t),Np(e),o.southwest(),mf(),"southwest",xf(e,{right:1,top:2}),Ep);const Bp=(e,t,o)=>af(Op(e),Dp(e,t),o.northeast(),gf(),"northeast",xf(e,{left:0,bottom:3}),Ep);const Lp=(e,t,o)=>af(Ap(e,t),Dp(e,t),o.northwest(),pf(),"northwest",xf(e,{right:1,bottom:3}),Ep);const Hp=()=>[Mp,Rp,Bp,Lp];const Ip=()=>[Rp,Mp,Lp,Bp];const Pp=(e,t,o)=>{const n=dm(o,t.item.element);const s=dg(e.element,t,Hp(),Ip(),Hp(),Ip(),N.none());return N.some(ng({anchorBox:n,bubble:og(),overrides:t.overrides,layouts:s}))};var Fp=[jr("item"),lg(),ia("overrides",{}),pd("placement",Pp)];var Vp=Hr("type",{selection:Tp,node:Eg,hotspot:fg,submenu:Fp,makeshift:gg});const jp=[Jr("classes",_r),fa("mode","all",["all","layout","placement"])];const Zp=[ia("useFixed",A),Qr("getBounds")];const Up=[Zr("anchor",Vp),aa("transition",jp)];const qp=()=>{const e=document.documentElement;return pm(0,0,e.clientWidth,e.clientHeight)};const Wp=e=>{const t=Ao(e.element);const o=e.element.dom.getBoundingClientRect();return gm(t.left,t.top,o.width,o.height)};const $p=(e,t,o,n,s,r)=>{const a=ym(t.anchorBox,e);return Jm(a,n.element,t.bubble,t.layouts,s,o,t.overrides,r)};const Gp=(e,t,o,n,s)=>{const r=N.none();Kp(e,t,o,n,s,r)};const Kp=(e,t,o,n,s,r)=>{const a=Br("placement.info",mr(Up),s);const c=a.anchor;const i=n.element;const l=o.get(n.uid);am((()=>{uo(i,"position","fixed");const s=ho(i,"visibility");uo(i,"visibility","hidden");const d=t.useFixed()?qp():Wp(e);c.placement(e,c,d).each((e=>{const s=r.orThunk((()=>t.getBounds.map(O)));const c=$p(d,e,s,n,l,a.transition);o.set(n.uid,c)}));s.fold((()=>{vo(i,"visibility")}),(e=>{uo(i,"visibility",e)}));if(ho(i,"left").isNone()&&ho(i,"top").isNone()&&ho(i,"right").isNone()&&ho(i,"bottom").isNone()&&ze(ho(i,"position"),"fixed")){vo(i,"position")}}),i)};const Yp=(e,t,o)=>t.useFixed()?"fixed":"absolute";const Xp=(e,t,o,n)=>{const s=n.element;Z(["position","left","right","top","bottom"],(e=>vo(s,e)));wm(s);o.clear(n.uid)};var Jp=Object.freeze({__proto__:null,position:Gp,positionWithinBounds:Kp,getMode:Yp,reset:Xp});const Qp=()=>{let e={};const t=(t,o)=>{e[t]=o};const o=t=>xe(e,t);const n=t=>{if(p(t)){delete e[t]}else{e={}}};return ki({readState:()=>e,clear:n,set:t,get:o})};var eh=Object.freeze({__proto__:null,init:Qp});const th=xi({fields:Zp,name:"positioning",active:em,apis:Jp,state:eh});const oh=e=>e.getSystem().isConnected();const nh=e=>{Bc(e,Sc());const t=e.components();Z(t,nh)};const sh=e=>{const t=e.components();Z(t,sh);Bc(e,Cc())};const rh=(e,t)=>{e.getSystem().addToWorld(t);if(Xt(e.element)){sh(t)}};const ah=e=>{nh(e);e.getSystem().removeFromWorld(e)};const ch=(e,t)=>{Ln(e.element,t.element)};const ih=e=>{Z(e.components(),(e=>Fn(e.element)));Pn(e.element);e.syncComponents()};const lh=(e,t,o)=>{const n=e.components();ih(e);const s=o(t);const r=oe(n,s);Z(r,(t=>{nh(t);e.getSystem().removeFromWorld(t)}));Z(s,(t=>{if(!oh(t)){e.getSystem().addToWorld(t);ch(e,t);if(Xt(e.element)){sh(t)}}else{ch(e,t)}}));e.syncComponents()};const dh=(e,t,o)=>{const n=e.components();const s=Q(t,(e=>Vd(e).toArray()));Z(n,(e=>{if(!I(s,e)){ah(e)}}));const r=o(t);const a=oe(n,r);Z(a,(e=>{if(oh(e)){ah(e)}}));Z(r,(t=>{if(!oh(t)){rh(e,t)}}));e.syncComponents()};const uh=(e,t)=>{fh(e,t,Ln)};const fh=(e,t,o)=>{e.getSystem().addToWorld(t);o(e.element,t.element);if(Xt(e.element)){sh(t)}e.syncComponents()};const mh=e=>{nh(e);Fn(e.element);e.getSystem().removeFromWorld(e)};const gh=e=>{const t=At(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()));mh(e);t.each((e=>{e.syncComponents()}))};const ph=e=>{const t=e.components();Z(t,mh);Pn(e.element);e.syncComponents()};const hh=(e,t)=>{bh(e,t,Ln)};const yh=(e,t)=>{bh(e,t,Rn)};const bh=(e,t,o)=>{o(e,t.element);const n=Lt(t.element);Z(n,(e=>{t.getByDom(e).each(sh)}))};const vh=e=>{const t=Lt(e.element);Z(t,(t=>{e.getByDom(t).each(nh)}));Fn(e.element)};const kh=(e,t,o,n)=>{o.get().each((t=>{ph(e)}));const s=t.getAttachPoint(e);uh(s,e);const r=e.getSystem().build(n);uh(e,r);o.set(r);return r};const wh=(e,t,o,n)=>{const s=kh(e,t,o,n);t.onOpen(e,s);return s};const _h=(e,t,o,n)=>o.get().map((()=>kh(e,t,o,n)));const xh=(e,t,o,n,s)=>{Ah(e,t);wh(e,t,o,n);s();Nh(e,t)};const Ch=(e,t,o)=>{o.get().each((n=>{ph(e);gh(e);t.onClose(e,n);o.clear()}))};const Sh=(e,t,o)=>o.isOpen();const zh=(e,t,o,n)=>Sh(e,t,o)&&o.get().exists((o=>t.isPartOf(e,o,n)));const Th=(e,t,o)=>o.get();const Eh=(e,t,o,n)=>{ho(e.element,t).fold((()=>{ao(e.element,o)}),(t=>{to(e.element,o,t)}));uo(e.element,t,n)};const Oh=(e,t,o)=>{so(e.element,o).fold((()=>vo(e.element,t)),(o=>uo(e.element,t,o)))};const Ah=(e,t,o)=>{const n=t.getAttachPoint(e);uo(e.element,"position",th.getMode(n));Eh(e,"visibility",t.cloakVisibilityAttr,"hidden")};const Dh=e=>P(["top","left","right","bottom"],(t=>ho(e,t).isSome()));const Nh=(e,t,o)=>{if(!Dh(e.element)){vo(e.element,"position")}Oh(e,"visibility",t.cloakVisibilityAttr)};var Mh=Object.freeze({__proto__:null,cloak:Ah,decloak:Nh,open:wh,openWhileCloaked:xh,close:Ch,isOpen:Sh,isPartOf:zh,getState:Th,setContent:_h});const Rh=(e,t)=>jc([Wc(yc(),((o,n)=>{Ch(o,e,t)}))]);var Bh=Object.freeze({__proto__:null,events:Rh});var Lh=[ud("onOpen"),ud("onClose"),jr("isPartOf"),jr("getAttachPoint"),ia("cloakVisibilityAttr","data-precloak-visibility")];const Hh=()=>{const e=us();const t=x("not-implemented");return ki({readState:t,isOpen:e.isSet,clear:e.clear,set:e.set,get:e.get})};var Ih=Object.freeze({__proto__:null,init:Hh});const Ph=xi({fields:Lh,name:"sandboxing",active:Bh,apis:Mh,state:Ih});const Fh=x("dismiss.popups");const Vh=x("reposition.popups");const jh=x("mouse.released");const Zh=fr([ia("isExtraPart",A),aa("fireEventInstead",[ia("event",zc())])]);const Uh=e=>{const t=Br("Dismissal",Zh,e);return{[Fh()]:{schema:fr([jr("target")]),onReceive:(e,o)=>{if(Ph.isOpen(e)){const n=Ph.isPartOf(e,o.target)||t.isExtraPart(e,o.target);if(!n){t.fireEventInstead.fold((()=>Ph.close(e)),(t=>Bc(e,t.event)))}}}}}};const qh=fr([aa("fireEventInstead",[ia("event",Tc())]),Gr("doReposition")]);const Wh=e=>{const t=Br("Reposition",qh,e);return{[Vh()]:{onReceive:e=>{if(Ph.isOpen(e)){t.fireEventInstead.fold((()=>t.doReposition(e)),(t=>Bc(e,t.event)))}}}}};const $h=(e,t,o)=>{t.store.manager.onLoad(e,t,o)};const Gh=(e,t,o)=>{t.store.manager.onUnload(e,t,o)};const Kh=(e,t,o,n)=>{t.store.manager.setValue(e,t,o,n)};const Yh=(e,t,o)=>t.store.manager.getValue(e,t,o);const Xh=(e,t,o)=>o;var Jh=Object.freeze({__proto__:null,onLoad:$h,onUnload:Gh,setValue:Kh,getValue:Yh,getState:Xh});const Qh=(e,t)=>{const o=e.resetOnDom?[oi(((o,n)=>{$h(o,e,t)})),ni(((o,n)=>{Gh(o,e,t)}))]:[mi(e,t,$h)];return jc(o)};var ey=Object.freeze({__proto__:null,events:Qh});const ty=()=>{const e=cs(null);const t=()=>({mode:"memory",value:e.get()});const o=()=>e.get()===null;const n=()=>{e.set(null)};return ki({set:e.set,get:e.get,isNotSet:o,clear:n,readState:t})};const oy=()=>{const e=v;return ki({readState:e})};const ny=()=>{const e=cs({});const t=cs({});const o=()=>({mode:"dataset",dataByValue:e.get(),dataByText:t.get()});const n=()=>{e.set({});t.set({})};const s=o=>xe(e.get(),o).orThunk((()=>xe(t.get(),o)));const r=o=>{const n=e.get();const s=t.get();const r={};const a={};Z(o,(e=>{r[e.value]=e;xe(e,"meta").each((t=>{xe(t,"text").each((t=>{a[t]=e}))}))}));e.set({...n,...r});t.set({...s,...a})};return ki({readState:o,lookup:s,update:r,clear:n})};const sy=e=>e.store.manager.state(e);var ry=Object.freeze({__proto__:null,memory:ty,dataset:ny,manual:oy,init:sy});const ay=(e,t,o,n)=>{const s=t.store;o.update([n]);s.setValue(e,n);t.onSetValue(e,n)};const cy=(e,t,o)=>{const n=t.store;const s=n.getDataKey(e);return o.lookup(s).getOrThunk((()=>n.getFallbackEntry(s)))};const iy=(e,t,o)=>{const n=t.store;n.initialValue.each((n=>{ay(e,t,o,n)}))};const ly=(e,t,o)=>{o.clear()};var dy=[Qr("initialValue"),jr("getFallbackEntry"),jr("getDataKey"),jr("setValue"),pd("manager",{setValue:ay,getValue:cy,onLoad:iy,onUnload:ly,state:ny})];const uy=(e,t,o)=>t.store.getValue(e);const fy=(e,t,o,n)=>{t.store.setValue(e,n);t.onSetValue(e,n)};const my=(e,t,o)=>{t.store.initialValue.each((o=>{t.store.setValue(e,o)}))};var gy=[jr("getValue"),ia("setValue",v),Qr("initialValue"),pd("manager",{setValue:fy,getValue:uy,onLoad:my,onUnload:v,state:vi.init})];const py=(e,t,o,n)=>{o.set(n);t.onSetValue(e,n)};const hy=(e,t,o)=>o.get();const yy=(e,t,o)=>{t.store.initialValue.each((e=>{if(o.isNotSet()){o.set(e)}}))};const by=(e,t,o)=>{o.clear()};var vy=[Qr("initialValue"),pd("manager",{setValue:py,getValue:hy,onLoad:yy,onUnload:by,state:ty})];var ky=[la("store",{mode:"memory"},Hr("mode",{memory:vy,manual:gy,dataset:dy})),ud("onSetValue"),ia("resetOnDom",false)];const wy=xi({fields:ky,name:"representing",active:ey,apis:Jh,extra:{setValueFrom:(e,t)=>{const o=wy.getValue(t);wy.setValue(e,o)}},state:ry});const _y=(e,t)=>ya(e,{},j(t,(t=>Kr(t.name(),"Cannot configure "+t.name()+" for "+e))).concat([Fr("dump",C)]));const xy=e=>e.dump;const Cy=(e,t)=>({...wi(t),...e.dump});const Sy={field:_y,augment:Cy,get:xy};const zy="placeholder";const Ty=va.generate([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]);const Ey=e=>Ce(e,"uiType");const Oy=(e,t,o,n)=>{if(e.exists((e=>e!==o.owner))){return Ty.single(true,x(o))}return xe(n,o.name).fold((()=>{throw new Error("Unknown placeholder component: "+o.name+"\nKnown: ["+ue(n)+"]\nNamespace: "+e.getOr("none")+"\nSpec: "+JSON.stringify(o,null,2))}),(e=>e.replace()))};const Ay=(e,t,o,n)=>{if(Ey(o)&&o.uiType===zy){return Oy(e,t,o,n)}else{return Ty.single(false,x(o))}};const Dy=(e,t,o,n)=>{const s=Ay(e,t,o,n);return s.fold(((s,r)=>{const a=Ey(o)?r(t,o.config,o.validated):r(t);const c=xe(a,"components").getOr([]);const i=Q(c,(o=>Dy(e,t,o,n)));return[{...a,components:i}]}),((e,n)=>{if(Ey(o)){const e=n(t,o.config,o.validated);const s=o.validated.preprocess.getOr(C);return s(e)}else{return n(t)}}))};const Ny=(e,t,o,n)=>Q(o,(o=>Dy(e,t,o,n)));const My=(e,t)=>{let o=false;const n=()=>o;const s=()=>{if(o){throw new Error("Trying to use the same placeholder more than once: "+e)}o=true;return t};const r=()=>t.fold(((e,t)=>e),((e,t)=>e));return{name:x(e),required:r,used:n,replace:s}};const Ry=(e,t,o,n)=>{const s=ge(n,((e,t)=>My(t,e)));const r=Ny(e,t,o,s);me(s,(o=>{if(o.used()===false&&o.required()){throw new Error("Placeholder: "+o.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))}}));return r};const By=Ty.single;const Ly=Ty.multiple;const Hy=x(zy);const Iy=va.generate([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]);const Py=ia("factory",{sketch:C});const Fy=ia("schema",[]);const Vy=jr("name");const jy=Pr("pname","pname",Is((e=>"<alloy."+zd(e.name)+">")),vr());const Zy=Fr("schema",(()=>[Qr("preprocess")]));const Uy=ia("defaults",x({}));const qy=ia("overrides",x({}));const Wy=mr([Py,Fy,Vy,jy,Uy,qy]);const $y=mr([Py,Fy,Vy,Uy,qy]);const Gy=mr([Py,Fy,Vy,jy,Uy,qy]);const Ky=mr([Py,Zy,Vy,jr("unit"),jy,Uy,qy]);const Yy=e=>e.fold(N.some,N.none,N.some,N.some);const Xy=e=>{const t=e=>e.name;return e.fold(t,t,t,t)};const Jy=e=>e.fold(C,C,C,C);const Qy=(e,t)=>o=>{const n=Br("Converting part type",t,o);return e(n)};const eb=Qy(Iy.required,Wy);const tb=Qy(Iy.external,$y);const ob=Qy(Iy.optional,Gy);const nb=Qy(Iy.group,Ky);const sb=x("entirety");var rb=Object.freeze({__proto__:null,required:eb,external:tb,optional:ob,group:nb,asNamedPart:Yy,name:Xy,asCommon:Jy,original:sb});const ab=(e,t,o,n)=>Bs(t.defaults(e,o,n),o,{uid:e.partUids[t.name]},t.overrides(e,o,n));const cb=(e,t,o)=>{const n={};const s={};Z(o,(e=>{e.fold((e=>{n[e.pname]=By(true,((t,o,n)=>e.factory.sketch(ab(t,e,o,n))))}),(e=>{const o=t.parts[e.name];s[e.name]=x(e.factory.sketch(ab(t,e,o[sb()]),o))}),(e=>{n[e.pname]=By(false,((t,o,n)=>e.factory.sketch(ab(t,e,o,n))))}),(e=>{n[e.pname]=Ly(true,((t,o,n)=>{const s=t[e.name];return j(s,(o=>e.factory.sketch(Bs(e.defaults(t,o,n),o,e.overrides(t,o)))))}))}))}));return{internals:x(n),externals:x(s)}};const ib=(e,t)=>{const o={};Z(t,(t=>{Yy(t).each((t=>{const n=lb(e,t.pname);o[t.name]=o=>{const s=Br("Part: "+t.name+" in "+e,mr(t.schema),o);return{...n,config:o,validated:s}}}))}));return o};const lb=(e,t)=>({uiType:Hy(),owner:e,name:t});const db=(e,t,o)=>({uiType:Hy(),owner:e,name:t,config:o,validated:{}});const ub=e=>Q(e,(e=>e.fold(N.none,N.some,N.none,N.none).map((e=>Yr(e.name,e.schema.concat([hd(sb())])))).toArray()));const fb=e=>j(e,Xy);const mb=(e,t,o)=>cb(e,t,o);const gb=(e,t,o)=>Ry(N.some(e),t,t.components,o);const pb=(e,t,o)=>{const n=t.partUids[o];return e.getSystem().getByUid(n).toOptional()};const hb=(e,t,o)=>pb(e,t,o).getOrDie("Could not find part: "+o);const yb=(e,t,o)=>{const n={};const s=t.partUids;const r=e.getSystem();Z(o,(e=>{n[e]=x(r.getByUid(s[e]))}));return n};const bb=(e,t)=>{const o=e.getSystem();return ge(t.partUids,((e,t)=>x(o.getByUid(e))))};const vb=e=>ue(e.partUids);const kb=(e,t,o)=>{const n={};const s=t.partUids;const r=e.getSystem();Z(o,(e=>{n[e]=x(r.getByUid(s[e]).getOrDie())}));return n};const wb=(e,t)=>{const o=fb(t);return za(j(o,(t=>({key:t,value:e+"-"+t}))))};const _b=e=>Pr("partUids","partUids",Vs((t=>wb(t.uid,e))),vr());var xb=Object.freeze({__proto__:null,generate:ib,generateOne:db,schemas:ub,names:fb,substitutes:mb,components:gb,defaultUids:wb,defaultUidsSchema:_b,getAllParts:bb,getAllPartNames:vb,getPart:pb,getPartOrDie:hb,getParts:yb,getPartsOrDie:kb});const Cb=(e,t)=>{const o=e.length>0?[Yr("parts",e)]:[];return o.concat([jr("uid"),ia("dom",{}),ia("components",[]),hd("originalSpec"),ia("debug.sketcher",{})]).concat(t)};const Sb=(e,t,o,n,s)=>{const r=Cb(n,s);return Br(e+" [SpecSchema]",fr(r.concat(t)),o)};const zb=(e,t,o,n)=>{const s=Ob(n);const r=Sb(e,t,s,[],[]);return o(r,s)};const Tb=(e,t,o,n,s)=>{const r=Ob(s);const a=ub(o);const c=_b(o);const i=Sb(e,t,r,a,[c]);const l=mb(e,i,o);const d=gb(e,i,l.internals());return n(i,d,r,l.externals())};const Eb=e=>Ce(e,"uid");const Ob=e=>Eb(e)?e:{...e,uid:Rd("uid")};const Ab=e=>e.uid!==undefined;const Db=fr([jr("name"),jr("factory"),jr("configFields"),ia("apis",{}),ia("extraApis",{})]);const Nb=fr([jr("name"),jr("factory"),jr("configFields"),jr("partFields"),ia("apis",{}),ia("extraApis",{})]);const Mb=e=>{const t=Br("Sketcher for "+e.name,Db,e);const o=e=>zb(t.name,t.configFields,t.factory,e);const n=ge(t.apis,jd);const s=ge(t.extraApis,((e,t)=>ii(e,t)));return{name:t.name,configFields:t.configFields,sketch:o,...n,...s}};const Rb=e=>{const t=Br("Sketcher for "+e.name,Nb,e);const o=e=>Tb(t.name,t.configFields,t.partFields,t.factory,e);const n=ib(t.name,t.partFields);const s=ge(t.apis,jd);const r=ge(t.extraApis,((e,t)=>ii(e,t)));return{name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:o,parts:n,...s,...r}};const Bb=e=>vt("input")(e)&&no(e,"type")!=="radio"||vt("textarea")(e);const Lb=(e,t,o)=>t.find(e);var Hb=Object.freeze({__proto__:null,getCurrent:Lb});const Ib=[jr("find")];const Pb=xi({fields:Ib,name:"composing",apis:Hb});const Fb=["input","button","textarea","select"];const Vb=(e,t,o)=>{const n=t.disabled()?Kb:Yb;n(e,t)};const jb=(e,t)=>t.useNative===true&&I(Fb,ut(e.element));const Zb=e=>ro(e.element,"disabled");const Ub=e=>{to(e.element,"disabled","disabled")};const qb=e=>{ao(e.element,"disabled")};const Wb=e=>no(e.element,"aria-disabled")==="true";const $b=e=>{to(e.element,"aria-disabled","true")};const Gb=e=>{to(e.element,"aria-disabled","false")};const Kb=(e,t,o)=>{t.disableClass.each((t=>{Bi(e.element,t)}));const n=jb(e,t)?Ub:$b;n(e);t.onDisabled(e)};const Yb=(e,t,o)=>{t.disableClass.each((t=>{Hi(e.element,t)}));const n=jb(e,t)?qb:Gb;n(e);t.onEnabled(e)};const Xb=(e,t)=>jb(e,t)?Zb(e):Wb(e);const Jb=(e,t,o,n)=>{const s=n?Kb:Yb;s(e,t)};var Qb=Object.freeze({__proto__:null,enable:Yb,disable:Kb,isDisabled:Xb,onLoad:Vb,set:Jb});const ev=(e,t)=>di({classes:t.disabled()?t.disableClass.toArray():[]});const tv=(e,t)=>jc([Zc(mc(),((t,o)=>Xb(t,e))),mi(e,t,Vb)]);var ov=Object.freeze({__proto__:null,exhibit:ev,events:tv});var nv=[ga("disabled",A),ia("useNative",true),Qr("disableClass"),ud("onDisabled"),ud("onEnabled")];const sv=xi({fields:nv,name:"disabling",active:ov,apis:Qb});const rv=(e,t,o,n)=>{const s=lp(e.element,"."+t.highlightClass);Z(s,(o=>{const s=P(n,(e=>Ct(e.element,o)));if(!s){Hi(o,t.highlightClass);e.getSystem().getByDom(o).each((o=>{t.onDehighlight(e,o);Bc(o,Rc())}))}}))};const av=(e,t,o)=>rv(e,t,o,[]);const cv=(e,t,o,n)=>{if(mv(e,t,o,n)){Hi(n.element,t.highlightClass);t.onDehighlight(e,n);Bc(n,Rc())}};const iv=(e,t,o,n)=>{rv(e,t,o,[n]);if(!mv(e,t,o,n)){Bi(n.element,t.highlightClass);t.onHighlight(e,n);Bc(n,Mc())}};const lv=(e,t,o)=>{hv(e,t).each((n=>{iv(e,t,o,n)}))};const dv=(e,t,o)=>{yv(e,t).each((n=>{iv(e,t,o,n)}))};const uv=(e,t,o,n)=>{pv(e,t,o,n).fold((e=>{throw e}),(n=>{iv(e,t,o,n)}))};const fv=(e,t,o,n)=>{const s=wv(e,t);const r=Y(s,n);r.each((n=>{iv(e,t,o,n)}))};const mv=(e,t,o,n)=>Pi(n.element,t.highlightClass);const gv=(e,t,o)=>Qu(e.element,"."+t.highlightClass).bind((t=>e.getSystem().getByDom(t).toOptional()));const pv=(e,t,o,n)=>{const s=lp(e.element,"."+t.itemClass);return N.from(s[n]).fold((()=>hs.error(new Error("No element found with index "+n))),e.getSystem().getByDom)};const hv=(e,t,o)=>Qu(e.element,"."+t.itemClass).bind((t=>e.getSystem().getByDom(t).toOptional()));const yv=(e,t,o)=>{const n=lp(e.element,"."+t.itemClass);const s=n.length>0?N.some(n[n.length-1]):N.none();return s.bind((t=>e.getSystem().getByDom(t).toOptional()))};const bv=(e,t,o,n)=>{const s=lp(e.element,"."+t.itemClass);const r=X(s,(e=>Pi(e,t.highlightClass)));return r.bind((t=>{const o=kf(t,n,0,s.length-1);return e.getSystem().getByDom(s[o]).toOptional()}))};const vv=(e,t,o)=>bv(e,t,o,-1);const kv=(e,t,o)=>bv(e,t,o,+1);const wv=(e,t,o)=>{const n=lp(e.element,"."+t.itemClass);return Ee(j(n,(t=>e.getSystem().getByDom(t).toOptional())))};var _v=Object.freeze({__proto__:null,dehighlightAll:av,dehighlight:cv,highlight:iv,highlightFirst:lv,highlightLast:dv,highlightAt:uv,highlightBy:fv,isHighlighted:mv,getHighlighted:gv,getFirst:hv,getLast:yv,getPrevious:vv,getNext:kv,getCandidates:wv});var xv=[jr("highlightClass"),jr("itemClass"),ud("onHighlight"),ud("onDehighlight")];const Cv=xi({fields:xv,name:"highlighting",apis:_v});const Sv=[8];const zv=[9];const Tv=[13];const Ev=[27];const Ov=[32];const Av=[37];const Dv=[38];const Nv=[39];const Mv=[40];const Rv=(e,t,o)=>{const n=te(e.slice(0,t));const s=te(e.slice(t+1));return Y(n.concat(s),o)};const Bv=(e,t,o)=>{const n=te(e.slice(0,t));return Y(n,o)};const Lv=(e,t,o)=>{const n=e.slice(0,t);const s=e.slice(t+1);return Y(s.concat(n),o)};const Hv=(e,t,o)=>{const n=e.slice(t+1);return Y(n,o)};const Iv=e=>t=>{const o=t.raw;return I(e,o.which)};const Pv=e=>t=>ee(e,(e=>e(t)));const Fv=e=>{const t=e.raw;return t.shiftKey===true};const Vv=e=>{const t=e.raw;return t.ctrlKey===true};const jv=T(Fv);const Zv=(e,t)=>({matches:e,classification:t});const Uv=(e,t)=>{const o=Y(e,(e=>e.matches(t)));return o.map((e=>e.classification))};const qv=(e,t,o)=>{const n=t.exists((e=>o.exists((t=>Ct(t,e)))));if(!n){Lc(e,Ec(),{prevFocus:t,newFocus:o})}};const Wv=()=>{const e=e=>rm(e.element);const t=(t,o)=>{const n=e(t);t.getSystem().triggerFocus(o,t.element);const s=e(t);qv(t,n,s)};return{get:e,set:t}};const $v=()=>{const e=e=>Cv.getHighlighted(e).map((e=>e.element));const t=(t,o)=>{const n=e(t);t.getSystem().getByDom(o).fold(v,(e=>{Cv.highlight(t,e)}));const s=e(t);qv(t,n,s)};return{get:e,set:t}};var Gv;(function(e){e["OnFocusMode"]="onFocus";e["OnEnterOrSpaceMode"]="onEnterOrSpace";e["OnApiMode"]="onApi"})(Gv||(Gv={}));const Kv=(e,t,o,n,s)=>{const r=()=>e.concat([ia("focusManager",Wv()),la("focusInside","onFocus",Ar((e=>I(["onFocus","onEnterOrSpace","onApi"],e)?hs.value(e):hs.error("Invalid value for focusInside")))),pd("handler",i),pd("state",t),pd("sendFocusIn",s)]);const a=(e,t,o,n,s)=>{const r=o(e,t,n,s);return Uv(r,t.event).bind((o=>o(e,t,n,s)))};const c=(e,t)=>{const r=e.focusInside!==Gv.OnFocusMode?N.none():s(e).map((o=>Wc(lc(),((n,s)=>{o(n,e,t);s.stop()}))));const c=(o,n)=>{const r=Iv(Ov.concat(Tv))(n.event);if(e.focusInside===Gv.OnEnterOrSpaceMode&&r&&Ma(o,n)){s(e).each((s=>{s(o,e,t);n.stop()}))}};const i=[Wc(Ja(),((n,s)=>{a(n,s,o,e,t).fold((()=>{c(n,s)}),(e=>{s.stop()}))})),Wc(Qa(),((o,s)=>{a(o,s,n,e,t).each((e=>{s.stop()}))}))];return jc(r.toArray().concat(i))};const i={schema:r,processKey:a,toEvents:c};return i};const Yv=e=>{const t=[Qr("onEscape"),Qr("onEnter"),ia("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),ia("firstTabstop",0),ia("useTabstopAt",D),Qr("visibilitySelector")].concat([e]);const o=(e,t)=>{const o=e.visibilitySelector.bind((e=>ef(t,e))).getOr(t);return xo(o)>0};const n=(e,t)=>{const n=lp(e.element,t.selector);const s=W(n,(e=>o(t,e)));return N.from(s[t.firstTabstop])};const s=(e,t)=>t.focusManager.get(e).bind((e=>ef(e,t.selector)));const r=(e,t)=>o(e,t)&&e.useTabstopAt(t);const a=(e,t,o)=>{n(e,t).each((o=>{t.focusManager.set(e,o)}))};const c=(e,t,o,n,s)=>s(t,o,(e=>r(n,e))).fold((()=>n.cyclic?N.some(true):N.none()),(t=>{n.focusManager.set(e,t);return N.some(true)}));const i=(e,t,o,n)=>{const r=lp(e.element,o.selector);return s(e,o).bind((t=>{const s=X(r,z(Ct,t));return s.bind((t=>c(e,r,t,o,n)))}))};const l=(e,t,o)=>{const n=o.cyclic?Rv:Bv;return i(e,t,o,n)};const d=(e,t,o)=>{const n=o.cyclic?Lv:Hv;return i(e,t,o,n)};const u=e=>Dt(e).bind(It).exists((t=>Ct(t,e)));const f=(e,t,o)=>s(e,o).filter((e=>!o.useTabstopAt(e))).bind((n=>(u(n)?l:d)(e,t,o)));const m=(e,t,o)=>o.onEnter.bind((o=>o(e,t)));const g=(e,t,o)=>o.onEscape.bind((o=>o(e,t)));const p=x([Zv(Pv([Fv,Iv(zv)]),l),Zv(Iv(zv),d),Zv(Pv([jv,Iv(Tv)]),m)]);const h=x([Zv(Iv(Ev),g),Zv(Iv(zv),f)]);return Kv(t,vi.init,p,h,(()=>N.some(a)))};var Xv=Yv(Fr("cyclic",A));var Jv=Yv(Fr("cyclic",D));const Qv=(e,t,o)=>{Ic(e,o,mc());return N.some(true)};const ek=(e,t,o)=>{const n=Bb(o)&&Iv(Ov)(t.event);return n?N.none():Qv(e,t,o)};const tk=(e,t)=>N.some(true);const ok=[ia("execute",ek),ia("useSpace",false),ia("useEnter",true),ia("useControlEnter",false),ia("useDown",false)];const nk=(e,t,o)=>o.execute(e,t,e.element);const sk=(e,t,o,n)=>{const s=o.useSpace&&!Bb(e.element)?Ov:[];const r=o.useEnter?Tv:[];const a=o.useDown?Mv:[];const c=s.concat(r).concat(a);return[Zv(Iv(c),nk)].concat(o.useControlEnter?[Zv(Pv([Vv,Iv(Tv)]),nk)]:[])};const rk=(e,t,o,n)=>o.useSpace&&!Bb(e.element)?[Zv(Iv(Ov),tk)]:[];var ak=Kv(ok,vi.init,sk,rk,(()=>N.none()));const ck=()=>{const e=us();const t=(t,o)=>{e.set({numRows:t,numColumns:o})};const o=()=>e.get().map((e=>e.numRows));const n=()=>e.get().map((e=>e.numColumns));return ki({readState:()=>e.get().map((e=>({numRows:String(e.numRows),numColumns:String(e.numColumns)}))).getOr({numRows:"?",numColumns:"?"}),setGridSize:t,getNumRows:o,getNumColumns:n})};const ik=e=>e.state(e);var lk=Object.freeze({__proto__:null,flatgrid:ck,init:ik});const dk=e=>(t,o,n,s)=>{const r=e(t.element);return gk(r,t,o,n,s)};const uk=(e,t)=>{const o=sg(e,t);return dk(o)};const fk=(e,t)=>{const o=sg(t,e);return dk(o)};const mk=e=>(t,o,n,s)=>gk(e,t,o,n,s);const gk=(e,t,o,n,s)=>{const r=n.focusManager.get(t).bind((o=>e(t.element,o,n,s)));return r.map((e=>{n.focusManager.set(t,e);return true}))};const pk=mk;const hk=mk;const yk=mk;const bk=e=>e.offsetWidth<=0&&e.offsetHeight<=0;const vk=e=>!bk(e.dom);const kk=(e,t)=>X(e,t).map((t=>({index:t,candidates:e})));const wk=(e,t,o)=>{const n=e=>Ct(e,t);const s=lp(e,o);const r=W(s,vk);return kk(r,n)};const _k=(e,t)=>X(e,(e=>Ct(t,e)));const xk=(e,t,o,n)=>{const s=Math.floor(t/o);const r=t%o;return n(s,r).bind((t=>{const n=t.row*o+t.column;return n>=0&&n<e.length?N.some(e[n]):N.none()}))};const Ck=(e,t,o,n,s)=>xk(e,t,n,((t,r)=>{const a=t===o-1;const c=a?e.length-t*n:n;const i=kf(r,s,0,c-1);return N.some({row:t,column:i})}));const Sk=(e,t,o,n,s)=>xk(e,t,n,((t,r)=>{const a=kf(t,s,0,o-1);const c=a===o-1;const i=c?e.length-a*n:n;const l=wf(r,0,i-1);return N.some({row:a,column:l})}));const zk=(e,t,o,n)=>Ck(e,t,o,n,+1);const Tk=(e,t,o,n)=>Ck(e,t,o,n,-1);const Ek=(e,t,o,n)=>Sk(e,t,o,n,-1);const Ok=(e,t,o,n)=>Sk(e,t,o,n,+1);const Ak=[jr("selector"),ia("execute",ek),fd("onEscape"),ia("captureTab",false),yd()];const Dk=(e,t,o)=>{Qu(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))};const Nk=(e,t)=>t.focusManager.get(e).bind((e=>ef(e,t.selector)));const Mk=(e,t,o,n)=>Nk(e,o).bind((n=>o.execute(e,t,n)));const Rk=e=>(t,o,n,s)=>wk(t,o,n.selector).bind((t=>e(t.candidates,t.index,s.getNumRows().getOr(n.initSize.numRows),s.getNumColumns().getOr(n.initSize.numColumns))));const Bk=(e,t,o)=>o.captureTab?N.some(true):N.none();const Lk=(e,t,o)=>o.onEscape(e,t);const Hk=Rk(Tk);const Ik=Rk(zk);const Pk=Rk(Ek);const Fk=Rk(Ok);const Vk=x([Zv(Iv(Av),uk(Hk,Ik)),Zv(Iv(Nv),fk(Hk,Ik)),Zv(Iv(Dv),pk(Pk)),Zv(Iv(Mv),hk(Fk)),Zv(Pv([Fv,Iv(zv)]),Bk),Zv(Pv([jv,Iv(zv)]),Bk),Zv(Iv(Ov.concat(Tv)),Mk)]);const jk=x([Zv(Iv(Ev),Lk),Zv(Iv(Ov),tk)]);var Zk=Kv(Ak,ck,Vk,jk,(()=>N.some(Dk)));const Uk=(e,t,o,n,s)=>{const r=e=>ut(e)==="button"&&no(e,"disabled")==="disabled";const a=(e,t,o)=>s(e,t,n,0,o.length-1,o[t],(t=>r(o[t])?a(e,t,o):N.from(o[t])));return wk(e,o,t).bind((e=>{const t=e.index;const o=e.candidates;return a(t,t,o)}))};const qk=(e,t,o,n)=>Uk(e,t,o,n,((e,t,o,n,s,r,a)=>{const c=wf(t+o,n,s);return c===e?N.from(r):a(c)}));const Wk=(e,t,o,n)=>Uk(e,t,o,n,((e,t,o,n,s,r,a)=>{const c=kf(t,o,n,s);return c===e?N.none():a(c)}));const $k=[jr("selector"),ia("getInitial",N.none),ia("execute",ek),fd("onEscape"),ia("executeOnMove",false),ia("allowVertical",true),ia("allowHorizontal",true),ia("cycles",true)];const Gk=(e,t)=>t.focusManager.get(e).bind((e=>ef(e,t.selector)));const Kk=(e,t,o)=>Gk(e,o).bind((n=>o.execute(e,t,n)));const Yk=(e,t,o)=>{t.getInitial(e).orThunk((()=>Qu(e.element,t.selector))).each((o=>{t.focusManager.set(e,o)}))};const Xk=(e,t,o)=>(o.cycles?Wk:qk)(e,o.selector,t,-1);const Jk=(e,t,o)=>(o.cycles?Wk:qk)(e,o.selector,t,+1);const Qk=e=>(t,o,n,s)=>e(t,o,n,s).bind((()=>n.executeOnMove?Kk(t,o,n):N.some(true)));const ew=(e,t,o)=>o.onEscape(e,t);const tw=(e,t,o,n)=>{const s=[...o.allowHorizontal?Av:[]].concat(o.allowVertical?Dv:[]);const r=[...o.allowHorizontal?Nv:[]].concat(o.allowVertical?Mv:[]);return[Zv(Iv(s),Qk(uk(Xk,Jk))),Zv(Iv(r),Qk(fk(Xk,Jk))),Zv(Iv(Tv),Kk),Zv(Iv(Ov),Kk)]};const ow=x([Zv(Iv(Ov),tk),Zv(Iv(Ev),ew)]);var nw=Kv($k,vi.init,tw,ow,(()=>N.some(Yk)));const sw=(e,t,o)=>N.from(e[t]).bind((e=>N.from(e[o]).map((e=>({rowIndex:t,columnIndex:o,cell:e})))));const rw=(e,t,o,n)=>{const s=e[t];const r=s.length;const a=kf(o,n,0,r-1);return sw(e,t,a)};const aw=(e,t,o,n)=>{const s=kf(o,n,0,e.length-1);const r=e[s].length;const a=wf(t,0,r-1);return sw(e,s,a)};const cw=(e,t,o,n)=>{const s=e[t];const r=s.length;const a=wf(o+n,0,r-1);return sw(e,t,a)};const iw=(e,t,o,n)=>{const s=wf(o+n,0,e.length-1);const r=e[s].length;const a=wf(t,0,r-1);return sw(e,s,a)};const lw=(e,t,o)=>rw(e,t,o,+1);const dw=(e,t,o)=>rw(e,t,o,-1);const uw=(e,t,o)=>aw(e,o,t,-1);const fw=(e,t,o)=>aw(e,o,t,+1);const mw=(e,t,o)=>cw(e,t,o,-1);const gw=(e,t,o)=>cw(e,t,o,+1);const pw=(e,t,o)=>iw(e,o,t,-1);const hw=(e,t,o)=>iw(e,o,t,+1);const yw=[Yr("selectors",[jr("row"),jr("cell")]),ia("cycles",true),ia("previousSelector",N.none),ia("execute",ek)];const bw=(e,t,o)=>{const n=t.previousSelector(e).orThunk((()=>{const o=t.selectors;return Qu(e.element,o.cell)}));n.each((o=>{t.focusManager.set(e,o)}))};const vw=(e,t,o)=>rm(e.element).bind((n=>o.execute(e,t,n)));const kw=(e,t)=>j(e,(e=>lp(e,t.selectors.cell)));const ww=(e,t)=>(o,n,s)=>{const r=s.cycles?e:t;return ef(n,s.selectors.row).bind((e=>{const t=lp(e,s.selectors.cell);return _k(t,n).bind((t=>{const n=lp(o,s.selectors.row);return _k(n,e).bind((e=>{const o=kw(n,s);return r(o,e,t).map((e=>e.cell))}))}))}))};const _w=ww(dw,mw);const xw=ww(lw,gw);const Cw=ww(uw,pw);const Sw=ww(fw,hw);const zw=x([Zv(Iv(Av),uk(_w,xw)),Zv(Iv(Nv),fk(_w,xw)),Zv(Iv(Dv),pk(Cw)),Zv(Iv(Mv),hk(Sw)),Zv(Iv(Ov.concat(Tv)),vw)]);const Tw=x([Zv(Iv(Ov),tk)]);var Ew=Kv(yw,vi.init,zw,Tw,(()=>N.some(bw)));const Ow=[jr("selector"),ia("execute",ek),ia("moveOnTab",false)];const Aw=(e,t,o)=>o.focusManager.get(e).bind((n=>o.execute(e,t,n)));const Dw=(e,t,o)=>{Qu(e.element,t.selector).each((o=>{t.focusManager.set(e,o)}))};const Nw=(e,t,o)=>Wk(e,o.selector,t,-1);const Mw=(e,t,o)=>Wk(e,o.selector,t,+1);const Rw=(e,t,o,n)=>o.moveOnTab?yk(Nw)(e,t,o,n):N.none();const Bw=(e,t,o,n)=>o.moveOnTab?yk(Mw)(e,t,o,n):N.none();const Lw=x([Zv(Iv(Dv),yk(Nw)),Zv(Iv(Mv),yk(Mw)),Zv(Pv([Fv,Iv(zv)]),Rw),Zv(Pv([jv,Iv(zv)]),Bw),Zv(Iv(Tv),Aw),Zv(Iv(Ov),Aw)]);const Hw=x([Zv(Iv(Ov),tk)]);var Iw=Kv(Ow,vi.init,Lw,Hw,(()=>N.some(Dw)));const Pw=[fd("onSpace"),fd("onEnter"),fd("onShiftEnter"),fd("onLeft"),fd("onRight"),fd("onTab"),fd("onShiftTab"),fd("onUp"),fd("onDown"),fd("onEscape"),ia("stopSpaceKeyup",false),Qr("focusIn")];const Fw=(e,t,o)=>[Zv(Iv(Ov),o.onSpace),Zv(Pv([jv,Iv(Tv)]),o.onEnter),Zv(Pv([Fv,Iv(Tv)]),o.onShiftEnter),Zv(Pv([Fv,Iv(zv)]),o.onShiftTab),Zv(Pv([jv,Iv(zv)]),o.onTab),Zv(Iv(Dv),o.onUp),Zv(Iv(Mv),o.onDown),Zv(Iv(Av),o.onLeft),Zv(Iv(Nv),o.onRight),Zv(Iv(Ov),o.onSpace)];const Vw=(e,t,o)=>[...o.stopSpaceKeyup?[Zv(Iv(Ov),tk)]:[],Zv(Iv(Ev),o.onEscape)];var jw=Kv(Pw,vi.init,Fw,Vw,(e=>e.focusIn));const Zw=Xv.schema();const Uw=Jv.schema();const qw=nw.schema();const Ww=Zk.schema();const $w=Ew.schema();const Gw=ak.schema();const Kw=Iw.schema();const Yw=jw.schema();var Xw=Object.freeze({__proto__:null,acyclic:Zw,cyclic:Uw,flow:qw,flatgrid:Ww,matrix:$w,execution:Gw,menu:Kw,special:Yw});const Jw=e=>Se(e,"setGridSize");const Qw=Si({branchKey:"mode",branches:Xw,name:"keying",active:{events:(e,t)=>{const o=e.handler;return o.toEvents(e,t)}},apis:{focusIn:(e,t,o)=>{t.sendFocusIn(t).fold((()=>{e.getSystem().triggerFocus(e.element,e.element)}),(n=>{n(e,t,o)}))},setGridSize:(e,t,o,n,s)=>{if(!Jw(o)){console.error("Layout does not support setGridSize")}else{o.setGridSize(n,s)}}},state:lk});const e_=(e,t)=>{am((()=>{lh(e,t,(()=>j(t,e.getSystem().build)))}),e.element)};const t_=(e,t)=>{am((()=>{dh(e,t,(()=>vu(e.element,t,e.getSystem().buildOrPatch)))}),e.element)};const o_=(e,t,o,n)=>{ah(t);const s=bu(e.element,o,n,e.getSystem().buildOrPatch);rh(e,s);e.syncComponents()};const n_=(e,t,o)=>{const n=e.getSystem().build(o);fh(e,n,t)};const s_=(e,t,o,n)=>{gh(t);n_(e,((e,t)=>Hn(e,t,o)),n)};const r_=(e,t,o,n)=>{const s=t.reuseDom?t_:e_;return s(e,n)};const a_=(e,t,o,n)=>{n_(e,Ln,n)};const c_=(e,t,o,n)=>{n_(e,Bn,n)};const i_=(e,t,o,n)=>{const s=l_(e);const r=Y(s,(e=>Ct(n.element,e.element)));r.each(gh)};const l_=(e,t)=>e.components();const d_=(e,t,o,n,s)=>{const r=l_(e);return N.from(r[n]).map((o=>{s.fold((()=>gh(o)),(s=>{const r=t.reuseDom?o_:s_;r(e,o,n,s)}));return o}))};const u_=(e,t,o,n,s)=>{const r=l_(e);return X(r,n).bind((n=>d_(e,t,o,n,s)))};var f_=Object.freeze({__proto__:null,append:a_,prepend:c_,remove:i_,replaceAt:d_,replaceBy:u_,set:r_,contents:l_});const m_=xi({fields:[ma("reuseDom",true)],name:"replacing",apis:f_});const g_=(e,t)=>{const o=jc(t);return xi({fields:[jr("enabled")],name:e,active:{events:x(o)}})};const p_=(e,t)=>{const o=g_(e,t);return{key:e,value:{config:{},me:o,configAsRaw:x({}),initialConfig:{},state:vi}}};const h_=(e,t)=>{if(!t.ignore){tm(e.element);t.onFocus(e)}};const y_=(e,t)=>{if(!t.ignore){om(e.element)}};const b_=e=>nm(e.element);var v_=Object.freeze({__proto__:null,focus:h_,blur:y_,isFocused:b_});const k_=(e,t)=>{const o=t.ignore?{}:{attributes:{tabindex:"-1"}};return di(o)};const w_=e=>jc([Wc(lc(),((t,o)=>{h_(t,e);o.stop()}))].concat(e.stopMousedown?[Wc(qa(),((e,t)=>{t.event.prevent()}))]:[]));var __=Object.freeze({__proto__:null,exhibit:k_,events:w_});var x_=[ud("onFocus"),ia("stopMousedown",false),ia("ignore",false)];const C_=xi({fields:x_,name:"focusing",active:__,apis:v_});const S_=e=>{const t=()=>{const t=cs(e);const o=()=>t.get();const n=e=>t.set(e);const s=()=>t.set(e);const r=()=>t.get();return{get:o,set:n,clear:s,readState:r}};return{init:t}};const z_=(e,t,o)=>{const n=t.aria;n.update(e,n,o.get())};const T_=(e,t,o)=>{t.toggleClass.each((t=>{if(o.get()){Bi(e.element,t)}else{Hi(e.element,t)}}))};const E_=(e,t,o,n)=>{const s=o.get();o.set(n);T_(e,t,o);z_(e,t,o);if(s!==n){t.onToggled(e,n)}};const O_=(e,t,o)=>{E_(e,t,o,!o.get())};const A_=(e,t,o)=>{E_(e,t,o,true)};const D_=(e,t,o)=>{E_(e,t,o,false)};const N_=(e,t,o)=>o.get();const M_=(e,t,o)=>{E_(e,t,o,t.selected)};var R_=Object.freeze({__proto__:null,onLoad:M_,toggle:O_,isOn:N_,on:A_,off:D_,set:E_});const B_=()=>di({});const L_=(e,t)=>{const o=fi(e,t,O_);const n=mi(e,t,M_);return jc(J([e.toggleOnExecute?[o]:[],[n]]))};var H_=Object.freeze({__proto__:null,exhibit:B_,events:L_});const I_=(e,t,o)=>{to(e.element,"aria-pressed",o);if(t.syncWithExpanded){V_(e,t,o)}};const P_=(e,t,o)=>{to(e.element,"aria-selected",o)};const F_=(e,t,o)=>{to(e.element,"aria-checked",o)};const V_=(e,t,o)=>{to(e.element,"aria-expanded",o)};var j_=[ia("selected",false),Qr("toggleClass"),ia("toggleOnExecute",true),ud("onToggled"),la("aria",{mode:"none"},Hr("mode",{pressed:[ia("syncWithExpanded",false),pd("update",I_)],checked:[pd("update",F_)],expanded:[pd("update",V_)],selected:[pd("update",P_)],none:[pd("update",v)]}))];const Z_=xi({fields:j_,name:"toggling",active:H_,apis:R_,state:S_(false)});const U_=()=>{const e=(e,t)=>{t.stop();Hc(e)};return[Wc(oc(),e),Wc(pc(),e),Qc(Va()),Qc(qa())]};const q_=e=>{const t=e=>ri(((t,o)=>{e(t);o.stop()}));return jc(J([e.map(t).toArray(),U_()]))};const W_="alloy.item-hover";const $_="alloy.item-focus";const G_="alloy.item-toggled";const K_=e=>{if(rm(e.element).isNone()||C_.isFocused(e)){if(!C_.isFocused(e)){C_.focus(e)}Lc(e,W_,{item:e})}};const Y_=e=>{Lc(e,$_,{item:e})};const X_=(e,t)=>{Lc(e,G_,{item:e,state:t})};const J_=x(W_);const Q_=x($_);const ex=x(G_);const tx=e=>e.role.fold((()=>e.toggling.map((e=>e.exclusive?"menuitemradio":"menuitemcheckbox")).getOr("menuitem")),C);const ox=(e,t)=>({aria:{mode:t?"selected":"checked"},...ve(e,((e,t)=>t!=="exclusive")),onToggled:(t,o)=>{if(h(e.onToggled)){e.onToggled(t,o)}X_(t,o)}});const nx=e=>({dom:e.dom,domModification:{...e.domModification,attributes:{role:tx(e),...e.domModification.attributes,"aria-haspopup":e.hasSubmenu,...e.hasSubmenu?{"aria-expanded":false}:{}}},behaviours:Sy.augment(e.itemBehaviours,[e.toggling.fold(Z_.revoke,(t=>Z_.config(ox(t,e.role.exists((e=>e==="option")))))),C_.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:e=>{Y_(e)}}),Qw.config({mode:"execution"}),wy.config({store:{mode:"memory",initialValue:e.data}}),p_("item-type-events",[...U_(),Wc(Ka(),K_),Wc(gc(),C_.focus)])]),components:e.components,eventOrder:e.eventOrder});const sx=[jr("data"),jr("components"),jr("dom"),ia("hasSubmenu",false),Qr("toggling"),Qr("role"),Sy.field("itemBehaviours",[Z_,C_,Qw,wy]),ia("ignoreFocus",false),ia("domModification",{}),pd("builder",nx),ia("eventOrder",{})];const rx=e=>({dom:e.dom,components:e.components,events:jc([ei(gc())])});const ax=[jr("dom"),jr("components"),pd("builder",rx)];const cx=x("item-widget");const ix=x([eb({name:"widget",overrides:e=>({behaviours:wi([wy.config({store:{mode:"manual",getValue:t=>e.data,setValue:v}})])})})]);const lx=e=>{const t=mb(cx(),e,ix());const o=gb(cx(),e,t.internals());const n=t=>pb(t,e,"widget").map((e=>{Qw.focusIn(e);return e}));const s=(t,o)=>Bb(o.event.target)?N.none():(()=>{if(e.autofocus){o.setSource(t.element);return N.none()}else{return N.none()}})();return{dom:e.dom,components:o,domModification:e.domModification,events:jc([ri(((e,t)=>{n(e).each((e=>{t.stop()}))})),Wc(Ka(),K_),Wc(gc(),((t,o)=>{if(e.autofocus){n(t)}else{C_.focus(t)}}))]),behaviours:Sy.augment(e.widgetBehaviours,[wy.config({store:{mode:"memory",initialValue:e.data}}),C_.config({ignore:e.ignoreFocus,onFocus:e=>{Y_(e)}}),Qw.config({mode:"special",focusIn:e.autofocus?e=>{n(e)}:zi(),onLeft:s,onRight:s,onEscape:(t,o)=>{if(!C_.isFocused(t)&&!e.autofocus){C_.focus(t);return N.some(true)}else if(e.autofocus){o.setSource(t.element);return N.none()}else{return N.none()}}})])}};const dx=[jr("uid"),jr("data"),jr("components"),jr("dom"),ia("autofocus",false),ia("ignoreFocus",false),Sy.field("widgetBehaviours",[wy,C_,Qw]),ia("domModification",{}),_b(ix()),pd("builder",lx)];const ux=Hr("type",{widget:dx,item:sx,separator:ax});const fx=(e,t)=>({mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager});const mx=(e,t)=>({mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},previousSelector:t.previousSelector,focusManager:e.focusManager});const gx=(e,t)=>({mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager});const px=x([nb({factory:{sketch:e=>{const t=Br("menu.spec item",ux,e);return t.builder(t)}},name:"items",unit:"item",defaults:(e,t)=>Ce(t,"uid")?t:{...t,uid:Rd("item")},overrides:(e,t)=>({type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}})})]);const hx=x([oa("role"),jr("value"),jr("items"),jr("dom"),jr("components"),ia("eventOrder",{}),_y("menuBehaviours",[Cv,wy,Pb,Qw]),la("movement",{mode:"menu",moveOnTab:true},Hr("mode",{grid:[yd(),pd("config",fx)],matrix:[pd("config",mx),jr("rowSelector"),ia("previousSelector",N.none)],menu:[ia("moveOnTab",true),pd("config",gx)]})),cd(),ia("fakeFocus",false),ia("focusManager",Wv()),ud("onHighlight"),ud("onDehighlight"),ia("showMenuRole",true)]);const yx=x("alloy.menu-focus");const bx=(e,t)=>{const o=lp(e.element,'[role="menuitemradio"][aria-checked="true"]');Z(o,(o=>{if(!Ct(o,t.element)){e.getSystem().getByDom(o).each((e=>{Z_.off(e)}))}}))};const vx=(e,t,o,n)=>({uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Cy(e.menuBehaviours,[Cv.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight,onDehighlight:e.onDehighlight}),wy.config({store:{mode:"memory",initialValue:e.value}}),Pb.config({find:N.some}),Qw.config(e.movement.config(e,e.movement))]),events:jc([Wc(Q_(),((e,t)=>{const o=t.event;e.getSystem().getByDom(o.target).each((o=>{Cv.highlight(e,o);t.stop();Lc(e,yx(),{menu:e,item:o})}))})),Wc(J_(),((e,t)=>{const o=t.event.item;Cv.highlight(e,o)})),Wc(ex(),((e,t)=>{const{item:o,state:n}=t.event;if(n&&no(o.element,"role")==="menuitemradio"){bx(e,o)}}))]),components:t,eventOrder:e.eventOrder,...e.showMenuRole?{domModification:{attributes:{role:e.role.getOr("menu")}}}:{}});const kx=Rb({name:"Menu",configFields:hx(),partFields:px(),factory:vx});const wx=e=>pe(e,((e,t)=>({k:e,v:t})));const _x=(e,t,o,n)=>xe(o,n).bind((n=>xe(e,n).bind((n=>{const s=_x(e,t,o,n);return N.some([n].concat(s))})))).getOr([]);const xx=(e,t)=>{const o={};me(e,((e,t)=>{Z(e,(e=>{o[e]=t}))}));const n=t;const s=wx(t);const r=ge(s,((e,t)=>[t].concat(_x(o,n,s,t))));return ge(o,(e=>xe(r,e).getOr([e])))};const Cx=()=>{const e=cs({});const t=cs({});const o=cs({});const n=us();const s=cs({});const r=()=>{e.set({});t.set({});o.set({});n.clear()};const a=()=>n.get().isNone();const c=(e,o)=>{t.set({...t.get(),[e]:{type:"prepared",menu:o}})};const i=(r,a,c,i)=>{n.set(r);e.set(c);t.set(a);s.set(i);const l=xx(i,c);o.set(l)};const l=t=>we(e.get(),((e,o)=>e===t));const d=(e,t,o)=>p(e).bind((n=>l(e).bind((e=>t(e).map((e=>({triggeredMenu:n,triggeringItem:e,triggeringPath:o})))))));const u=(e,t)=>{const s=W(y(e).toArray(),(e=>p(e).isSome()));return xe(o.get(),e).bind((e=>{const o=te(s.concat(e));const r=Q(o,((e,s)=>d(e,t,o.slice(0,s+1)).fold((()=>ze(n.get(),e)?[]:[N.none()]),(e=>[N.some(e)]))));return Oe(r)}))};const f=t=>xe(e.get(),t).map((e=>{const n=xe(o.get(),t).getOr([]);return[e].concat(n)}));const m=e=>xe(o.get(),e).bind((e=>e.length>1?N.some(e.slice(1)):N.none()));const g=e=>xe(o.get(),e);const p=e=>h(e).bind(Sx);const h=e=>xe(t.get(),e);const y=t=>xe(e.get(),t);const b=e=>{const t=s.get();return oe(ue(t),e)};const v=()=>n.get().bind(p);const k=()=>t.get();return{setMenuBuilt:c,setContents:i,expand:f,refresh:g,collapse:m,lookupMenu:h,lookupItem:y,otherMenus:b,getPrimary:v,getMenus:k,clear:r,isClear:a,getTriggeringPath:u}};const Sx=e=>e.type==="prepared"?N.some(e.menu):N.none();const zx={init:Cx,extractPreparedMenu:Sx};const Tx=zd("tiered-menu-item-highlight");const Ex=zd("tiered-menu-item-dehighlight");var Ox;(function(e){e[e["HighlightMenuAndItem"]=0]="HighlightMenuAndItem";e[e["HighlightJustMenu"]=1]="HighlightJustMenu";e[e["HighlightNone"]=2]="HighlightNone"})(Ox||(Ox={}));const Ax=(e,t)=>{const o=us();const n=(t,o,n)=>ge(n,((n,s)=>{const r=()=>kx.sketch({...n,value:s,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:(e,t)=>{const o={menuComp:e,itemComp:t};Lc(e,Tx,o)},onDehighlight:(e,t)=>{const o={menuComp:e,itemComp:t};Lc(e,Ex,o)},focusManager:e.fakeFocus?$v():Wv()});return s===o?{type:"prepared",menu:t.getSystem().build(r())}:{type:"notbuilt",nbMenu:r}}));const s=zx.init();const r=t=>{const o=n(t,e.data.primary,e.data.menus);const r=i();s.setContents(e.data.primary,o,e.data.expansions,r);return s.getPrimary()};const a=e=>wy.getValue(e).value;const c=(e,t,o)=>de(t,(e=>{if(!e.getSystem().isConnected()){return N.none()}const t=Cv.getCandidates(e);return Y(t,(e=>a(e)===o))}));const i=t=>ge(e.data.menus,((e,t)=>Q(e.items,(e=>e.type==="separator"?[]:[e.data.value]))));const l=Cv.highlight;const d=(t,o)=>{l(t,o);Cv.getHighlighted(o).orThunk((()=>Cv.getFirst(o))).each((n=>{if(e.fakeFocus){Cv.highlight(o,n)}else{Ic(t,n.element,gc())}}))};const u=(e,t)=>Ee(j(t,(t=>e.lookupMenu(t).bind((e=>e.type==="prepared"?N.some(e.menu):N.none())))));const f=(t,o,n)=>{const s=u(o,o.otherMenus(n));Z(s,(o=>{Vi(o.element,[e.markers.backgroundMenu]);if(!e.stayInDom){m_.remove(t,o)}}))};const m=t=>o.get().getOrThunk((()=>{const n={};const s=lp(t.element,`.${e.markers.item}`);const r=W(s,(e=>no(e,"aria-haspopup")==="true"));Z(r,(e=>{t.getSystem().getByDom(e).each((e=>{const t=a(e);n[t]=e}))}));o.set(n);return n}));const g=(e,t)=>{const o=m(e);me(o,((e,o)=>{const n=I(t,o);to(e.element,"aria-expanded",n)}))};const p=(t,o,n)=>N.from(n[0]).bind((s=>o.lookupMenu(s).bind((s=>{if(s.type==="notbuilt"){return N.none()}else{const r=s.menu;const a=u(o,n.slice(1));Z(a,(t=>{Bi(t.element,e.markers.backgroundMenu)}));if(!Xt(r.element)){m_.append(t,Vu(r))}Vi(r.element,[e.markers.backgroundMenu]);d(t,r);f(t,o,n);return N.some(r)}}))));let h;(function(e){e[e["HighlightSubmenu"]=0]="HighlightSubmenu";e[e["HighlightParent"]=1]="HighlightParent"})(h||(h={}));const y=(e,t,o)=>{if(o.type==="notbuilt"){const n=e.getSystem().build(o.nbMenu());s.setMenuBuilt(t,n);return n}else{return o.menu}};const b=(t,o,n=h.HighlightSubmenu)=>{if(o.hasConfigured(sv)&&sv.isDisabled(o)){return N.some(o)}else{const r=a(o);return s.expand(r).bind((r=>{g(t,r);return N.from(r[0]).bind((a=>s.lookupMenu(a).bind((c=>{const i=y(t,a,c);if(!Xt(i.element)){m_.append(t,Vu(i))}e.onOpenSubmenu(t,o,i,te(r));if(n===h.HighlightSubmenu){Cv.highlightFirst(i);return p(t,s,r)}else{Cv.dehighlightAll(i);return N.some(o)}}))))}))}};const k=(t,o)=>{const n=a(o);return s.collapse(n).bind((n=>{g(t,n);return p(t,s,n).map((n=>{e.onCollapseMenu(t,o,n);return n}))}))};const w=(e,t)=>{const o=a(t);return s.refresh(o).bind((t=>{g(e,t);return p(e,s,t)}))};const _=(e,t)=>Bb(t.element)?N.none():b(e,t,h.HighlightSubmenu);const x=(e,t)=>Bb(t.element)?N.none():k(e,t);const C=(t,o)=>k(t,o).orThunk((()=>e.onEscape(t,o).map((()=>t))));const S=t=>(o,n)=>ef(n.getSource(),`.${e.markers.item}`).bind((e=>o.getSystem().getByDom(e).toOptional().bind((e=>t(o,e).map(D)))));const z=jc([Wc(yx(),((e,t)=>{const o=t.event.item;s.lookupItem(a(o)).each((()=>{const o=t.event.menu;Cv.highlight(e,o);const n=a(t.event.item);s.refresh(n).each((t=>f(e,s,t)))}))})),ri(((t,o)=>{const n=o.event.target;t.getSystem().getByDom(n).each((o=>{const n=a(o);if(n.indexOf("collapse-item")===0){k(t,o)}b(t,o,h.HighlightSubmenu).fold((()=>{e.onExecute(t,o)}),v)}))})),oi(((t,o)=>{r(t).each((o=>{m_.append(t,Vu(o));e.onOpenMenu(t,o);if(e.highlightOnOpen===Ox.HighlightMenuAndItem){d(t,o)}else if(e.highlightOnOpen===Ox.HighlightJustMenu){l(t,o)}}))})),Wc(Tx,((t,o)=>{e.onHighlightItem(t,o.event.menuComp,o.event.itemComp)})),Wc(Ex,((t,o)=>{e.onDehighlightItem(t,o.event.menuComp,o.event.itemComp)})),...e.navigateOnHover?[Wc(J_(),((t,o)=>{const n=o.event.item;w(t,n);b(t,n,h.HighlightParent);e.onHover(t,n)}))]:[]]);const T=e=>Cv.getHighlighted(e).bind(Cv.getHighlighted);const E=e=>{T(e).each((t=>{k(e,t)}))};const O=e=>{s.getPrimary().each((t=>{d(e,t)}))};const A=e=>N.from(e.components()[0]).filter((e=>no(e.element,"role")==="menu"));const M=t=>{const o=s.getPrimary().bind((e=>T(t).bind((e=>{const o=a(e);const n=_e(s.getMenus());const r=Ee(j(n,zx.extractPreparedMenu));return s.getTriggeringPath(o,(e=>c(t,r,e)))})).map((t=>({primary:e,triggeringPath:t})))));o.fold((()=>{A(t).each((o=>{e.onRepositionMenu(t,o,[])}))}),(({primary:o,triggeringPath:n})=>{e.onRepositionMenu(t,o,n)}))};const R={collapseMenu:E,highlightPrimary:O,repositionMenus:M};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Cy(e.tmenuBehaviours,[Qw.config({mode:"special",onRight:S(_),onLeft:S(x),onEscape:S(C),focusIn:(e,t)=>{s.getPrimary().each((t=>{Ic(e,t.element,gc())}))}}),Cv.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),Pb.config({find:e=>Cv.getHighlighted(e)}),m_.config({})]),eventOrder:e.eventOrder,apis:R,events:z}};const Dx=x("collapse-item");const Nx=(e,t,o)=>({primary:e,menus:t,expansions:o});const Mx=(e,t)=>({primary:e,menus:Sa(e,t),expansions:{}});const Rx=e=>({value:zd(Dx()),meta:{text:e}});const Bx=Mb({name:"TieredMenu",configFields:[gd("onExecute"),gd("onEscape"),md("onOpenMenu"),md("onOpenSubmenu"),ud("onRepositionMenu"),ud("onCollapseMenu"),ia("highlightOnOpen",Ox.HighlightMenuAndItem),Yr("data",[jr("primary"),jr("menus"),jr("expansions")]),ia("fakeFocus",false),ud("onHighlightItem"),ud("onDehighlightItem"),ud("onHover"),id(),jr("dom"),ia("navigateOnHover",true),ia("stayInDom",false),_y("tmenuBehaviours",[Qw,Cv,Pb,m_]),ia("eventOrder",{})],apis:{collapseMenu:(e,t)=>{e.collapseMenu(t)},highlightPrimary:(e,t)=>{e.highlightPrimary(t)},repositionMenus:(e,t)=>{e.repositionMenus(t)}},factory:Ax,extraApis:{tieredData:Nx,singleData:Mx,collapseItem:Rx}});const Lx=(e,t,o,n,s)=>{const r=()=>e.lazySink(t);const a=n.type==="horizontal"?{layouts:{onLtr:()=>Wf(),onRtl:()=>$f()}}:{};const c=e=>e.length===2;const i=e=>c(e)?a:{};return Bx.sketch({dom:{tag:"div"},data:n.data,markers:n.menu.markers,highlightOnOpen:n.menu.highlightOnOpen,fakeFocus:n.menu.fakeFocus,onEscape:()=>{Ph.close(t);e.onEscape.map((e=>e(t)));return N.some(true)},onExecute:()=>N.some(true),onOpenMenu:(e,t)=>{th.positionWithinBounds(r().getOrDie(),t,o,s())},onOpenSubmenu:(e,t,o,n)=>{const s=r().getOrDie();th.position(s,o,{anchor:{type:"submenu",item:t,...i(n)}})},onRepositionMenu:(e,t,n)=>{const a=r().getOrDie();th.positionWithinBounds(a,t,o,s());Z(n,(e=>{const t=i(e.triggeringPath);th.position(a,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem,...t}})}))}})};const Hx=(e,t)=>{const o=(t,o)=>{const n=e.getRelated(t);return n.exists((e=>rf(e,o)))};const n=(e,t)=>{Ph.setContent(e,t)};const s=(e,t,o)=>{const n=N.none;r(e,t,o,n)};const r=(t,o,n,s)=>{const r=e.lazySink(t).getOrDie();Ph.openWhileCloaked(t,o,(()=>th.positionWithinBounds(r,t,n,s())));wy.setValue(t,N.some({mode:"position",config:n,getBounds:s}))};const a=(e,t,o)=>{c(e,t,o,N.none)};const c=(t,o,n,s)=>{const r=Lx(e,t,o,n,s);Ph.open(t,r);wy.setValue(t,N.some({mode:"menu",menu:r}))};const i=e=>{if(Ph.isOpen(e)){wy.setValue(e,N.none());Ph.close(e)}};const l=e=>Ph.getState(e);const d=t=>{if(Ph.isOpen(t)){wy.getValue(t).each((o=>{switch(o.mode){case"menu":Ph.getState(t).each(Bx.repositionMenus);break;case"position":const n=e.lazySink(t).getOrDie();th.positionWithinBounds(n,t,o.config,o.getBounds());break}}))}};const u={setContent:n,showAt:s,showWithinBounds:r,showMenuAt:a,showMenuWithinBounds:c,hide:i,getContent:l,reposition:d,isOpen:Ph.isOpen};return{uid:e.uid,dom:e.dom,behaviours:Cy(e.inlineBehaviours,[Ph.config({isPartOf:(e,t,n)=>rf(t,n)||o(e,n),getAttachPoint:t=>e.lazySink(t).getOrDie(),onOpen:t=>{e.onShow(t)},onClose:t=>{e.onHide(t)}}),wy.config({store:{mode:"memory",initialValue:N.none()}}),Jf.config({channels:{...Uh({isExtraPart:t.isExtraPart,...e.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...Wh({...e.fireRepositionEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({}),doReposition:d})}})]),eventOrder:e.eventOrder,apis:u}};const Ix=Mb({name:"InlineView",configFields:[jr("lazySink"),ud("onShow"),ud("onHide"),sa("onEscape"),_y("inlineBehaviours",[Ph,wy,Jf]),aa("fireDismissalEventInstead",[ia("event",zc())]),aa("fireRepositionEventInstead",[ia("event",Tc())]),ia("getRelated",N.none),ia("isExtraPart",A),ia("eventOrder",N.none)],factory:Hx,apis:{showAt:(e,t,o,n)=>{e.showAt(t,o,n)},showWithinBounds:(e,t,o,n,s)=>{e.showWithinBounds(t,o,n,s)},showMenuAt:(e,t,o,n)=>{e.showMenuAt(t,o,n)},showMenuWithinBounds:(e,t,o,n,s)=>{e.showMenuWithinBounds(t,o,n,s)},hide:(e,t)=>{e.hide(t)},isOpen:(e,t)=>e.isOpen(t),getContent:(e,t)=>e.getContent(t),setContent:(e,t,o)=>{e.setContent(t,o)},reposition:(e,t)=>{e.reposition(t)}}});var Px=tinymce.util.Tools.resolve("tinymce.util.Delay");var Fx=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");var Vx=tinymce.util.Tools.resolve("tinymce.EditorManager");var jx=tinymce.util.Tools.resolve("tinymce.Env");var Zx;(function(e){e["default"]="wrap";e["floating"]="floating";e["sliding"]="sliding";e["scrolling"]="scrolling"})(Zx||(Zx={}));var Ux;(function(e){e["auto"]="auto";e["top"]="top";e["bottom"]="bottom"})(Ux||(Ux={}));const qx=e=>t=>t.options.get(e);const Wx=e=>t=>N.from(e(t));const $x=e=>{const t=jx.deviceType.isPhone();const o=jx.deviceType.isTablet()||t;const n=e.options.register;const s=e=>c(e)||e===false;const r=e=>c(e)||y(e);n("skin",{processor:e=>c(e)||e===false,default:"oxide"});n("skin_url",{processor:"string"});n("height",{processor:r,default:Math.max(e.getElement().offsetHeight,400)});n("width",{processor:r,default:Fx.DOM.getStyle(e.getElement(),"width")});n("min_height",{processor:"number",default:100});n("min_width",{processor:"number"});n("max_height",{processor:"number"});n("max_width",{processor:"number"});n("style_formats",{processor:"object[]"});n("style_formats_merge",{processor:"boolean",default:false});n("style_formats_autohide",{processor:"boolean",default:false});n("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"});n("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;"+"Arial=arial,helvetica,sans-serif;"+"Arial Black=arial black,sans-serif;"+"Book Antiqua=book antiqua,palatino,serif;"+"Comic Sans MS=comic sans ms,sans-serif;"+"Courier New=courier new,courier,monospace;"+"Georgia=georgia,palatino,serif;"+"Helvetica=helvetica,arial,sans-serif;"+"Impact=impact,sans-serif;"+"Symbol=symbol;"+"Tahoma=tahoma,arial,helvetica,sans-serif;"+"Terminal=terminal,monaco,monospace;"+"Times New Roman=times new roman,times,serif;"+"Trebuchet MS=trebuchet ms,geneva,sans-serif;"+"Verdana=verdana,geneva,sans-serif;"+"Webdings=webdings;"+"Wingdings=wingdings,zapf dingbats"});n("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"});n("font_size_input_default_unit",{processor:"string",default:"pt"});n("block_formats",{processor:"string",default:"Paragraph=p;"+"Heading 1=h1;"+"Heading 2=h2;"+"Heading 3=h3;"+"Heading 4=h4;"+"Heading 5=h5;"+"Heading 6=h6;"+"Preformatted=pre"});n("content_langs",{processor:"object[]"});n("removed_menuitems",{processor:"string",default:""});n("menubar",{processor:e=>c(e)||f(e),default:!t});n("menu",{processor:"object",default:{}});n("toolbar",{processor:e=>{if(f(e)||c(e)||d(e)){return{value:e,valid:true}}else{return{valid:false,message:"Must be a boolean, string or array."}}},default:true});F(9,(e=>{n("toolbar"+(e+1),{processor:"string"})}));n("toolbar_mode",{processor:"string",default:o?"scrolling":"floating"});n("toolbar_groups",{processor:"object",default:{}});n("toolbar_location",{processor:"string",default:Ux.auto});n("toolbar_persist",{processor:"boolean",default:false});n("toolbar_sticky",{processor:"boolean",default:e.inline});n("toolbar_sticky_offset",{processor:"number",default:0});n("fixed_toolbar_container",{processor:"string",default:""});n("fixed_toolbar_container_target",{processor:"object"});n("ui_mode",{processor:"string",default:"combined"});n("file_picker_callback",{processor:"function"});n("file_picker_validator_handler",{processor:"function"});n("file_picker_types",{processor:"string"});n("typeahead_urls",{processor:"boolean",default:true});n("anchor_top",{processor:s,default:"#top"});n("anchor_bottom",{processor:s,default:"#bottom"});n("draggable_modal",{processor:"boolean",default:false});n("statusbar",{processor:"boolean",default:true});n("elementpath",{processor:"boolean",default:true});n("branding",{processor:"boolean",default:true});n("promotion",{processor:"boolean",default:true});n("resize",{processor:e=>e==="both"||f(e),default:!jx.deviceType.isTouch()});n("sidebar_show",{processor:"string"});n("help_accessibility",{processor:"boolean",default:e.hasPlugin("help")});n("default_font_stack",{processor:"string[]",default:[]})};const Gx=qx("readonly");const Kx=qx("height");const Yx=qx("width");const Xx=Wx(qx("min_width"));const Jx=Wx(qx("min_height"));const Qx=Wx(qx("max_width"));const eC=Wx(qx("max_height"));const tC=Wx(qx("style_formats"));const oC=qx("style_formats_merge");const nC=qx("style_formats_autohide");const sC=qx("content_langs");const rC=qx("removed_menuitems");const aC=qx("toolbar_mode");const cC=qx("toolbar_groups");const iC=qx("toolbar_location");const lC=qx("fixed_toolbar_container");const dC=qx("fixed_toolbar_container_target");const uC=qx("toolbar_persist");const fC=qx("toolbar_sticky_offset");const mC=qx("menubar");const gC=qx("toolbar");const pC=qx("file_picker_callback");const hC=qx("file_picker_validator_handler");const yC=qx("font_size_input_default_unit");const bC=qx("file_picker_types");const vC=qx("typeahead_urls");const kC=qx("anchor_top");const wC=qx("anchor_bottom");const _C=qx("draggable_modal");const xC=qx("statusbar");const CC=qx("elementpath");const SC=qx("branding");const zC=qx("resize");const TC=qx("paste_as_text");const EC=qx("sidebar_show");const OC=qx("promotion");const AC=qx("help_accessibility");const DC=qx("default_font_stack");const NC=e=>e.options.get("skin")===false;const MC=e=>e.options.get("menubar")!==false;const RC=e=>{const t=e.options.get("skin_url");if(NC(e)){return t}else{if(t){return e.documentBaseURI.toAbsolute(t)}else{const t=e.options.get("skin");return Vx.baseURL+"/skins/ui/"+t}}};const BC=e=>N.from(e.options.get("skin_url"));const LC=e=>e.options.get("line_height_formats").split(" ");const HC=e=>{const t=gC(e);const o=c(t);const n=d(t)&&t.length>0;return!PC(e)&&(n||o||t===true)};const IC=e=>{const t=F(9,(t=>e.options.get("toolbar"+(t+1))));const o=W(t,c);return Me(o.length>0,o)};const PC=e=>IC(e).fold((()=>{const t=gC(e);return b(t,c)&&t.length>0}),D);const FC=e=>iC(e)===Ux.bottom;const VC=e=>{var t;if(!e.inline){return N.none()}const o=(t=lC(e))!==null&&t!==void 0?t:"";if(o.length>0){return Qu(Jt(),o)}const n=dC(e);if(p(n)){return N.some(Je.fromDom(n))}return N.none()};const jC=e=>e.inline&&VC(e).isSome();const ZC=e=>{const t=VC(e);return t.getOrThunk((()=>qt(Ut(Je.fromDom(e.getElement())))))};const UC=e=>e.inline&&!MC(e)&&!HC(e)&&!PC(e);const qC=e=>{const t=e.options.get("toolbar_sticky");return(t||e.inline)&&!jC(e)&&!UC(e)};const WC=e=>!jC(e)&&e.options.get("ui_mode")==="split";const $C=e=>{const t=e.options.get("menu");return ge(t,(e=>({...e,items:e.items})))};var GC=Object.freeze({__proto__:null,get ToolbarMode(){return Zx},get ToolbarLocation(){return Ux},register:$x,getSkinUrl:RC,getSkinUrlOption:BC,isReadOnly:Gx,isSkinDisabled:NC,getHeightOption:Kx,getWidthOption:Yx,getMinWidthOption:Xx,getMinHeightOption:Jx,getMaxWidthOption:Qx,getMaxHeightOption:eC,getUserStyleFormats:tC,shouldMergeStyleFormats:oC,shouldAutoHideStyleFormats:nC,getLineHeightFormats:LC,getContentLanguages:sC,getRemovedMenuItems:rC,isMenubarEnabled:MC,isMultipleToolbars:PC,isToolbarEnabled:HC,isToolbarPersist:uC,getMultipleToolbarsOption:IC,getUiContainer:ZC,useFixedContainer:jC,isSplitUiMode:WC,getToolbarMode:aC,isDraggableModal:_C,isDistractionFree:UC,isStickyToolbar:qC,getStickyToolbarOffset:fC,getToolbarLocation:iC,isToolbarLocationBottom:FC,getToolbarGroups:cC,getMenus:$C,getMenubar:mC,getToolbar:gC,getFilePickerCallback:pC,getFilePickerTypes:bC,useTypeaheadUrls:vC,getAnchorTop:kC,getAnchorBottom:wC,getFilePickerValidatorHandler:hC,getFontSizeInputDefaultUnit:yC,useStatusBar:xC,useElementPath:CC,promotionEnabled:OC,useBranding:SC,getResize:zC,getPasteAsText:TC,getSidebarShow:EC,useHelpAccessibility:AC,getDefaultFontStack:DC});const KC=["visible","hidden","clip"];const YC=e=>Ze(e).length>0&&!I(KC,e);const XC=e=>{if(gt(e)){const t=go(e,"overflow-x");const o=go(e,"overflow-y");return YC(t)||YC(o)}else{return false}};const JC=e=>{const t=ip(e,XC);const o=t.length===0?$t(e).map(Gt).map((e=>ip(e,XC))).getOr([]):t;return ce(o).map((e=>({element:e,others:o.slice(1)})))};const QC=(e,t)=>WC(e)?JC(t):N.none();const eS=e=>{const t=[...j(e.others,os),as()];return rs(os(e.element),t)};const tS=e=>{const t=q_(e.action);const o=e.dom.tag;const n=t=>xe(e.dom,"attributes").bind((e=>xe(e,t)));const s=()=>{if(o==="button"){const e=n("type").getOr("button");const t=n("role").map((e=>({role:e}))).getOr({});return{type:e,...t}}else{const t=e.role.getOr(n("role").getOr("button"));return{role:t}}};return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:Sy.augment(e.buttonBehaviours,[C_.config({}),Qw.config({mode:"execution",useSpace:true,useEnter:true})]),domModification:{attributes:s()},eventOrder:e.eventOrder}};const oS=Mb({name:"Button",factory:tS,configFields:[ia("uid",undefined),jr("dom"),ia("components",[]),Sy.field("buttonBehaviours",[C_,Qw]),Qr("action"),Qr("role"),ia("eventOrder",{})]});const nS=e=>{const t=e.dom.attributes!==undefined?e.dom.attributes:[];return G(t,((e,t)=>{if(t.name==="class"){return e}else{return{...e,[t.name]:t.value}}}),{})};const sS=e=>Array.prototype.slice.call(e.dom.classList,0);const rS=e=>{const t=Je.fromHtml(e);const o=Lt(t);const n=nS(t);const s=sS(t);const r=o.length===0?{}:{innerHtml:Pl(t)};return{tag:ut(t),classes:s,attributes:n,...r}};const aS=e=>{const t=Ab(e)&&Se(e,"uid")?e.uid:Rd("memento");const o=e=>e.getSystem().getByUid(t).getOrDie();const n=e=>e.getSystem().getByUid(t).toOptional();const s=()=>({...e,uid:t});return{get:o,getOpt:n,asSpec:s}};const cS=(e,t)=>di({attributes:za([{key:t.tabAttr,value:"true"}])});var iS=Object.freeze({__proto__:null,exhibit:cS});var lS=[ia("tabAttr","data-alloy-tabstop")];const dS=xi({fields:lS,name:"tabstopping",active:iS});const uS=zd("tooltip.exclusive");const fS=zd("tooltip.show");const mS=zd("tooltip.hide");const gS=zd("tooltip.immediateHide");const pS=zd("tooltip.immediateShow");const hS=(e,t,o)=>{e.getSystem().broadcastOn([uS],{})};const yS=(e,t,o,n)=>{o.getTooltip().each((e=>{if(e.getSystem().isConnected()){m_.set(e,n)}}))};var bS=Object.freeze({__proto__:null,hideAllExclusive:hS,setComponents:yS});const vS=(e,t)=>{const o=o=>{t.getTooltip().each((n=>{if(n.getSystem().isConnected()){gh(n);e.onHide(o,n);t.clearTooltip()}}));t.clearTimer()};const n=o=>{if(!t.isShowing()){hS(o);const n=e.lazySink(o).getOrDie();const s=o.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:jc(e.mode==="normal"?[Wc(Ka(),(e=>{Bc(o,fS)})),Wc($a(),(e=>{Bc(o,mS)}))]:[]),behaviours:wi([m_.config({})])});t.setTooltip(s);uh(n,s);e.onShow(o,s);th.position(n,s,{anchor:e.anchor(o)})}};const s=o=>{t.getTooltip().each((t=>{const n=e.lazySink(o).getOrDie();th.position(n,t,{anchor:e.anchor(o)})}))};const r=()=>{switch(e.mode){case"normal":return[Wc(Ya(),(e=>{Bc(e,pS)})),Wc(dc(),(e=>{Bc(e,gS)})),Wc(Ka(),(e=>{Bc(e,fS)})),Wc($a(),(e=>{Bc(e,mS)}))];case"follow-highlight":return[Wc(Mc(),((e,t)=>{Bc(e,fS)})),Wc(Rc(),(e=>{Bc(e,mS)}))];case"children-normal":return[Wc(Ya(),((o,n)=>{rm(o.element).each((r=>{if(kt(n.event.target,"[data-mce-tooltip]")){t.getTooltip().fold((()=>{Bc(o,pS)}),(n=>{if(t.isShowing()){e.onShow(o,n);s(o)}}))}}))})),Wc(dc(),(e=>{rm(e.element).fold((()=>{Bc(e,gS)}),v)})),Wc(Ka(),(o=>{Qu(o.element,"[data-mce-tooltip]:hover").each((n=>{t.getTooltip().fold((()=>{Bc(o,fS)}),(n=>{if(t.isShowing()){e.onShow(o,n);s(o)}}))}))})),Wc($a(),(e=>{Qu(e.element,"[data-mce-tooltip]:hover").fold((()=>{Bc(e,mS)}),v)}))];default:return[Wc(Ya(),((o,n)=>{rm(o.element).each((r=>{if(kt(n.event.target,"[data-mce-tooltip]")){t.getTooltip().fold((()=>{Bc(o,pS)}),(n=>{if(t.isShowing()){e.onShow(o,n);s(o)}}))}}))})),Wc(dc(),(e=>{rm(e.element).fold((()=>{Bc(e,gS)}),v)}))]}};return jc(J([[Wc(fS,(o=>{t.resetTimer((()=>{n(o)}),e.delayForShow())})),Wc(mS,(n=>{t.resetTimer((()=>{o(n)}),e.delayForHide())})),Wc(pS,(e=>{t.resetTimer((()=>{n(e)}),0)})),Wc(gS,(e=>{t.resetTimer((()=>{o(e)}),0)})),Wc(fc(),((e,t)=>{const n=t;if(!n.universal){if(I(n.channels,uS)){o(e)}}})),ni((e=>{o(e)}))],r()]))};var kS=Object.freeze({__proto__:null,events:vS});var wS=[jr("lazySink"),jr("tooltipDom"),ia("exclusive",true),ia("tooltipComponents",[]),ga("delayForShow",x(300)),ga("delayForHide",x(300)),fa("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),ia("anchor",(e=>({type:"hotspot",hotspot:e,layouts:{onLtr:x([Pf,If,Rf,Lf,Bf,Hf]),onRtl:x([Pf,If,Rf,Lf,Bf,Hf])},bubble:tg(0,-2,{})}))),ud("onHide"),ud("onShow")];const _S=()=>{const e=us();const t=us();const o=()=>{e.on(clearTimeout)};const n=(t,n)=>{o();e.set(setTimeout(t,n))};const s=x("not-implemented");return ki({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:o,resetTimer:n,readState:s})};var xS=Object.freeze({__proto__:null,init:_S});const CS=xi({fields:wS,name:"tooltipping",active:kS,state:xS,apis:bS});const{entries:SS,setPrototypeOf:zS,isFrozen:TS,getPrototypeOf:ES,getOwnPropertyDescriptor:OS}=Object;let{freeze:AS,seal:DS,create:NS}=Object;let{apply:MS,construct:RS}=typeof Reflect!=="undefined"&&Reflect;if(!MS){MS=function e(t,o,n){return t.apply(o,n)}}if(!AS){AS=function e(t){return t}}if(!DS){DS=function e(t){return t}}if(!RS){RS=function e(t,o){return new t(...o)}}const BS=WS(Array.prototype.forEach);const LS=WS(Array.prototype.pop);const HS=WS(Array.prototype.push);const IS=WS(String.prototype.toLowerCase);const PS=WS(String.prototype.toString);const FS=WS(String.prototype.match);const VS=WS(String.prototype.replace);const jS=WS(String.prototype.indexOf);const ZS=WS(String.prototype.trim);const US=WS(RegExp.prototype.test);const qS=$S(TypeError);function WS(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),s=1;s<o;s++){n[s-1]=arguments[s]}return MS(e,t,n)}}function $S(e){return function(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++){o[n]=arguments[n]}return RS(e,o)}}function GS(e,t,o){var n;o=(n=o)!==null&&n!==void 0?n:IS;if(zS){zS(e,null)}let s=t.length;while(s--){let n=t[s];if(typeof n==="string"){const e=o(n);if(e!==n){if(!TS(t)){t[s]=e}n=e}}e[n]=true}return e}function KS(e){const t=NS(null);for(const[o,n]of SS(e)){t[o]=n}return t}function YS(e,t){while(e!==null){const o=OS(e,t);if(o){if(o.get){return WS(o.get)}if(typeof o.value==="function"){return WS(o.value)}}e=ES(e)}function o(e){console.warn("fallback value for",e);return null}return o}const XS=AS(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]);const JS=AS(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]);const QS=AS(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]);const ez=AS(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]);const tz=AS(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]);const oz=AS(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]);const nz=AS(["#text"]);const sz=AS(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]);const rz=AS(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]);const az=AS(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]);const cz=AS(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);const iz=DS(/\{\{[\w\W]*|[\w\W]*\}\}/gm);const lz=DS(/<%[\w\W]*|[\w\W]*%>/gm);const dz=DS(/\${[\w\W]*}/gm);const uz=DS(/^data-[\-\w.\u00B7-\uFFFF]/);const fz=DS(/^aria-[\-\w]+$/);const mz=DS(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);const gz=DS(/^(?:\w+script|data):/i);const pz=DS(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);const hz=DS(/^html$/i);var yz=Object.freeze({__proto__:null,MUSTACHE_EXPR:iz,ERB_EXPR:lz,TMPLIT_EXPR:dz,DATA_ATTR:uz,ARIA_ATTR:fz,IS_ALLOWED_URI:mz,IS_SCRIPT_OR_DATA:gz,ATTR_WHITESPACE:pz,DOCTYPE_NAME:hz});const bz=()=>typeof window==="undefined"?null:window;const vz=function e(t,o){if(typeof t!=="object"||typeof t.createPolicy!=="function"){return null}let n=null;const s="data-tt-policy-suffix";if(o&&o.hasAttribute(s)){n=o.getAttribute(s)}const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){console.warn("TrustedTypes policy "+r+" could not be created.");return null}};function kz(){let e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:bz();const t=e=>kz(e);t.version="3.0.5";t.removed=[];if(!e||!e.document||e.document.nodeType!==9){t.isSupported=false;return t}const o=e.document;const n=o.currentScript;let{document:s}=e;const{DocumentFragment:r,HTMLTemplateElement:a,Node:c,Element:i,NodeFilter:l,NamedNodeMap:d=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:m}=e;const g=i.prototype;const p=YS(g,"cloneNode");const h=YS(g,"nextSibling");const y=YS(g,"childNodes");const b=YS(g,"parentNode");if(typeof a==="function"){const e=s.createElement("template");if(e.content&&e.content.ownerDocument){s=e.content.ownerDocument}}let v;let k="";const{implementation:w,createNodeIterator:_,createDocumentFragment:x,getElementsByTagName:C}=s;const{importNode:S}=o;let z={};t.isSupported=typeof SS==="function"&&typeof b==="function"&&w&&w.createHTMLDocument!==undefined;const{MUSTACHE_EXPR:T,ERB_EXPR:E,TMPLIT_EXPR:O,DATA_ATTR:A,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:N,ATTR_WHITESPACE:M}=yz;let{IS_ALLOWED_URI:R}=yz;let B=null;const L=GS({},[...XS,...JS,...QS,...tz,...nz]);let H=null;const I=GS({},[...sz,...rz,...az,...cz]);let P=Object.seal(Object.create(null,{tagNameCheck:{writable:true,configurable:false,enumerable:true,value:null},attributeNameCheck:{writable:true,configurable:false,enumerable:true,value:null},allowCustomizedBuiltInElements:{writable:true,configurable:false,enumerable:true,value:false}}));let F=null;let V=null;let j=true;let Z=true;let U=false;let q=true;let W=false;let $=false;let G=false;let K=false;let Y=false;let X=false;let J=false;let Q=true;let ee=false;const te="user-content-";let oe=true;let ne=false;let se={};let re=null;const ae=GS({},["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"]);let ce=null;const ie=GS({},["audio","video","img","source","image","track"]);let le=null;const de=GS({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]);const ue="http://www.w3.org/1998/Math/MathML";const fe="http://www.w3.org/2000/svg";const me="http://www.w3.org/1999/xhtml";let ge=me;let pe=false;let he=null;const ye=GS({},[ue,fe,me],PS);let be;const ve=["application/xhtml+xml","text/html"];const ke="text/html";let we;let _e=null;const xe=s.createElement("form");const Ce=function e(t){return t instanceof RegExp||t instanceof Function};const Se=function e(t){if(_e&&_e===t){return}if(!t||typeof t!=="object"){t={}}t=KS(t);be=ve.indexOf(t.PARSER_MEDIA_TYPE)===-1?be=ke:be=t.PARSER_MEDIA_TYPE;we=be==="application/xhtml+xml"?PS:IS;B="ALLOWED_TAGS"in t?GS({},t.ALLOWED_TAGS,we):L;H="ALLOWED_ATTR"in t?GS({},t.ALLOWED_ATTR,we):I;he="ALLOWED_NAMESPACES"in t?GS({},t.ALLOWED_NAMESPACES,PS):ye;le="ADD_URI_SAFE_ATTR"in t?GS(KS(de),t.ADD_URI_SAFE_ATTR,we):de;ce="ADD_DATA_URI_TAGS"in t?GS(KS(ie),t.ADD_DATA_URI_TAGS,we):ie;re="FORBID_CONTENTS"in t?GS({},t.FORBID_CONTENTS,we):ae;F="FORBID_TAGS"in t?GS({},t.FORBID_TAGS,we):{};V="FORBID_ATTR"in t?GS({},t.FORBID_ATTR,we):{};se="USE_PROFILES"in t?t.USE_PROFILES:false;j=t.ALLOW_ARIA_ATTR!==false;Z=t.ALLOW_DATA_ATTR!==false;U=t.ALLOW_UNKNOWN_PROTOCOLS||false;q=t.ALLOW_SELF_CLOSE_IN_ATTR!==false;W=t.SAFE_FOR_TEMPLATES||false;$=t.WHOLE_DOCUMENT||false;Y=t.RETURN_DOM||false;X=t.RETURN_DOM_FRAGMENT||false;J=t.RETURN_TRUSTED_TYPE||false;K=t.FORCE_BODY||false;Q=t.SANITIZE_DOM!==false;ee=t.SANITIZE_NAMED_PROPS||false;oe=t.KEEP_CONTENT!==false;ne=t.IN_PLACE||false;R=t.ALLOWED_URI_REGEXP||mz;ge=t.NAMESPACE||me;P=t.CUSTOM_ELEMENT_HANDLING||{};if(t.CUSTOM_ELEMENT_HANDLING&&Ce(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)){P.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck}if(t.CUSTOM_ELEMENT_HANDLING&&Ce(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)){P.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck}if(t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==="boolean"){P.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements}if(W){Z=false}if(X){Y=true}if(se){B=GS({},[...nz]);H=[];if(se.html===true){GS(B,XS);GS(H,sz)}if(se.svg===true){GS(B,JS);GS(H,rz);GS(H,cz)}if(se.svgFilters===true){GS(B,QS);GS(H,rz);GS(H,cz)}if(se.mathMl===true){GS(B,tz);GS(H,az);GS(H,cz)}}if(t.ADD_TAGS){if(B===L){B=KS(B)}GS(B,t.ADD_TAGS,we)}if(t.ADD_ATTR){if(H===I){H=KS(H)}GS(H,t.ADD_ATTR,we)}if(t.ADD_URI_SAFE_ATTR){GS(le,t.ADD_URI_SAFE_ATTR,we)}if(t.FORBID_CONTENTS){if(re===ae){re=KS(re)}GS(re,t.FORBID_CONTENTS,we)}if(oe){B["#text"]=true}if($){GS(B,["html","head","body"])}if(B.table){GS(B,["tbody"]);delete F.tbody}if(t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!=="function"){throw qS('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.')}if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!=="function"){throw qS('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.')}v=t.TRUSTED_TYPES_POLICY;k=v.createHTML("")}else{if(v===undefined){v=vz(m,n)}if(v!==null&&typeof k==="string"){k=v.createHTML("")}}if(AS){AS(t)}_e=t};const ze=GS({},["mi","mo","mn","ms","mtext"]);const Te=GS({},["foreignobject","desc","title","annotation-xml"]);const Ee=GS({},["title","style","font","a","script"]);const Oe=GS({},JS);GS(Oe,QS);GS(Oe,ez);const Ae=GS({},tz);GS(Ae,oz);const De=function e(t){let o=b(t);if(!o||!o.tagName){o={namespaceURI:ge,tagName:"template"}}const n=IS(t.tagName);const s=IS(o.tagName);if(!he[t.namespaceURI]){return false}if(t.namespaceURI===fe){if(o.namespaceURI===me){return n==="svg"}if(o.namespaceURI===ue){return n==="svg"&&(s==="annotation-xml"||ze[s])}return Boolean(Oe[n])}if(t.namespaceURI===ue){if(o.namespaceURI===me){return n==="math"}if(o.namespaceURI===fe){return n==="math"&&Te[s]}return Boolean(Ae[n])}if(t.namespaceURI===me){if(o.namespaceURI===fe&&!Te[s]){return false}if(o.namespaceURI===ue&&!ze[s]){return false}return!Ae[n]&&(Ee[n]||!Oe[n])}if(be==="application/xhtml+xml"&&he[t.namespaceURI]){return true}return false};const Ne=function e(o){HS(t.removed,{element:o});try{o.parentNode.removeChild(o)}catch(e){o.remove()}};const Me=function e(o,n){try{HS(t.removed,{attribute:n.getAttributeNode(o),from:n})}catch(e){HS(t.removed,{attribute:null,from:n})}n.removeAttribute(o);if(o==="is"&&!H[o]){if(Y||X){try{Ne(n)}catch(e){}}else{try{n.setAttribute(o,"")}catch(e){}}}};const Re=function e(t){let o;let n;if(K){t="<remove></remove>"+t}else{const e=FS(t,/^[\r\n\t ]+/);n=e&&e[0]}if(be==="application/xhtml+xml"&&ge===me){t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>"}const r=v?v.createHTML(t):t;if(ge===me){try{o=(new f).parseFromString(r,be)}catch(e){}}if(!o||!o.documentElement){o=w.createDocument(ge,"template",null);try{o.documentElement.innerHTML=pe?k:r}catch(e){}}const a=o.body||o.documentElement;if(t&&n){a.insertBefore(s.createTextNode(n),a.childNodes[0]||null)}if(ge===me){return C.call(o,$?"html":"body")[0]}return $?o.documentElement:a};const Be=function e(t){return _.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,false)};const Le=function e(t){return t instanceof u&&(typeof t.nodeName!=="string"||typeof t.textContent!=="string"||typeof t.removeChild!=="function"||!(t.attributes instanceof d)||typeof t.removeAttribute!=="function"||typeof t.setAttribute!=="function"||typeof t.namespaceURI!=="string"||typeof t.insertBefore!=="function"||typeof t.hasChildNodes!=="function")};const He=function e(t){return typeof c==="object"?t instanceof c:t&&typeof t==="object"&&typeof t.nodeType==="number"&&typeof t.nodeName==="string"};const Ie=function e(o,n,s){if(!z[o]){return}BS(z[o],(e=>{e.call(t,n,s,_e)}))};const Pe=function e(o){let n;Ie("beforeSanitizeElements",o,null);if(Le(o)){Ne(o);return true}const s=we(o.nodeName);Ie("uponSanitizeElement",o,{tagName:s,allowedTags:B});if(o.hasChildNodes()&&!He(o.firstElementChild)&&(!He(o.content)||!He(o.content.firstElementChild))&&US(/<[/\w]/g,o.innerHTML)&&US(/<[/\w]/g,o.textContent)){Ne(o);return true}if(!B[s]||F[s]){if(!F[s]&&Ve(s)){if(P.tagNameCheck instanceof RegExp&&US(P.tagNameCheck,s))return false;if(P.tagNameCheck instanceof Function&&P.tagNameCheck(s))return false}if(oe&&!re[s]){const e=b(o)||o.parentNode;const t=y(o)||o.childNodes;if(t&&e){const n=t.length;for(let s=n-1;s>=0;--s){e.insertBefore(p(t[s],true),h(o))}}}Ne(o);return true}if(o instanceof i&&!De(o)){Ne(o);return true}if((s==="noscript"||s==="noembed"||s==="noframes")&&US(/<\/no(script|embed|frames)/i,o.innerHTML)){Ne(o);return true}if(W&&o.nodeType===3){n=o.textContent;n=VS(n,T," ");n=VS(n,E," ");n=VS(n,O," ");if(o.textContent!==n){HS(t.removed,{element:o.cloneNode()});o.textContent=n}}Ie("afterSanitizeElements",o,null);return false};const Fe=function e(t,o,n){if(Q&&(o==="id"||o==="name")&&(n in s||n in xe)){return false}if(Z&&!V[o]&&US(A,o));else if(j&&US(D,o));else if(!H[o]||V[o]){if(Ve(t)&&(P.tagNameCheck instanceof RegExp&&US(P.tagNameCheck,t)||P.tagNameCheck instanceof Function&&P.tagNameCheck(t))&&(P.attributeNameCheck instanceof RegExp&&US(P.attributeNameCheck,o)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(o))||o==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&US(P.tagNameCheck,n)||P.tagNameCheck instanceof Function&&P.tagNameCheck(n)));else{return false}}else if(le[o]);else if(US(R,VS(n,M,"")));else if((o==="src"||o==="xlink:href"||o==="href")&&t!=="script"&&jS(n,"data:")===0&&ce[t]);else if(U&&!US(N,VS(n,M,"")));else if(n){return false}else;return true};const Ve=function e(t){return t.indexOf("-")>0};const je=function e(t){let o;let n;let s;let r;Ie("beforeSanitizeAttributes",t,null);const{attributes:a}=t;if(!a){return}const c={attrName:"",attrValue:"",keepAttr:true,allowedAttributes:H};r=a.length;while(r--){o=a[r];const{name:e,namespaceURI:i}=o;n=e==="value"?o.value:ZS(o.value);const l=n;s=we(e);c.attrName=s;c.attrValue=n;c.keepAttr=true;c.forceKeepAttr=undefined;Ie("uponSanitizeAttribute",t,c);n=c.attrValue;if(c.forceKeepAttr){continue}if(!c.keepAttr){Me(e,t);continue}if(!q&&US(/\/>/i,n)){Me(e,t);continue}if(W){n=VS(n,T," ");n=VS(n,E," ");n=VS(n,O," ")}const d=we(t.nodeName);if(!Fe(d,s,n)){Me(e,t);continue}if(ee&&(s==="id"||s==="name")){Me(e,t);n=te+n}if(v&&typeof m==="object"&&typeof m.getAttributeType==="function"){if(i);else{switch(m.getAttributeType(d,s)){case"TrustedHTML":{n=v.createHTML(n);break}case"TrustedScriptURL":{n=v.createScriptURL(n);break}}}}if(n!==l){try{if(i){t.setAttributeNS(i,e,n)}else{t.setAttribute(e,n)}}catch(o){Me(e,t)}}}Ie("afterSanitizeAttributes",t,null)};const Ze=function e(t){let o;const n=Be(t);Ie("beforeSanitizeShadowDOM",t,null);while(o=n.nextNode()){Ie("uponSanitizeShadowNode",o,null);if(Pe(o)){continue}if(o.content instanceof r){e(o.content)}je(o)}Ie("afterSanitizeShadowDOM",t,null)};t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let s;let a;let i;let l;pe=!e;if(pe){e="\x3c!--\x3e"}if(typeof e!=="string"&&!He(e)){if(typeof e.toString==="function"){e=e.toString();if(typeof e!=="string"){throw qS("dirty is not a string, aborting")}}else{throw qS("toString is not a function")}}if(!t.isSupported){return e}if(!G){Se(n)}t.removed=[];if(typeof e==="string"){ne=false}if(ne){if(e.nodeName){const t=we(e.nodeName);if(!B[t]||F[t]){throw qS("root node is forbidden and cannot be sanitized in-place")}}}else if(e instanceof c){s=Re("\x3c!----\x3e");a=s.ownerDocument.importNode(e,true);if(a.nodeType===1&&a.nodeName==="BODY"){s=a}else if(a.nodeName==="HTML"){s=a}else{s.appendChild(a)}}else{if(!Y&&!W&&!$&&e.indexOf("<")===-1){return v&&J?v.createHTML(e):e}s=Re(e);if(!s){return Y?null:J?k:""}}if(s&&K){Ne(s.firstChild)}const d=Be(ne?e:s);while(i=d.nextNode()){if(Pe(i)){continue}if(i.content instanceof r){Ze(i.content)}je(i)}if(ne){return e}if(Y){if(X){l=x.call(s.ownerDocument);while(s.firstChild){l.appendChild(s.firstChild)}}else{l=s}if(H.shadowroot||H.shadowrootmode){l=S.call(o,l,true)}return l}let u=$?s.outerHTML:s.innerHTML;if($&&B["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&US(hz,s.ownerDocument.doctype.name)){u="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+u}if(W){u=VS(u,T," ");u=VS(u,E," ");u=VS(u,O," ")}return v&&J?v.createHTML(u):u};t.setConfig=function(e){Se(e);G=true};t.clearConfig=function(){_e=null;G=false};t.isValidAttribute=function(e,t,o){if(!_e){Se({})}const n=we(e);const s=we(t);return Fe(n,s,o)};t.addHook=function(e,t){if(typeof t!=="function"){return}z[e]=z[e]||[];HS(z[e],t)};t.removeHook=function(e){if(z[e]){return LS(z[e])}};t.removeHooks=function(e){if(z[e]){z[e]=[]}};t.removeAllHooks=function(){z={}};return t}var wz=kz();const _z=e=>wz().sanitize(e);var xz=tinymce.util.Tools.resolve("tinymce.util.I18n");const Cz={indent:true,outdent:true,"table-insert-column-after":true,"table-insert-column-before":true,"paste-column-after":true,"paste-column-before":true,"unordered-list":true,"list-bull-circle":true,"list-bull-default":true,"list-bull-square":true};const Sz="temporary-placeholder";const zz=e=>()=>xe(e,Sz).getOr("!not found!");const Tz=(e,t)=>{const o=e.toLowerCase();if(xz.isRtl()){const e=Ie(o,"-rtl");return Ce(t,e)?e:o}else{return o}};const Ez=(e,t)=>xe(t,Tz(e,t));const Oz=(e,t)=>{const o=t();return Ez(e,o).getOrThunk(zz(o))};const Az=(e,t,o)=>{const n=t();return Ez(e,n).or(o).getOrThunk(zz(n))};const Dz=e=>xz.isRtl()?Ce(Cz,e):false;const Nz=()=>p_("add-focusable",[oi((e=>{Ju(e.element,"svg").each((e=>to(e,"focusable","false")))}))]);const Mz=(e,t,o,n)=>{var s,r;const a=Dz(t)?["tox-icon--flip"]:[];const c=xe(o,Tz(t,o)).or(n).getOrThunk(zz(o));return{dom:{tag:e.tag,attributes:(s=e.attributes)!==null&&s!==void 0?s:{},classes:e.classes.concat(a),innerHtml:c},behaviours:wi([...(r=e.behaviours)!==null&&r!==void 0?r:[],Nz()])}};const Rz=(e,t,o,n=N.none())=>Mz(t,e,o(),n);const Bz=(e,t,o)=>{const n=o();const s=Y(e,(e=>Ce(n,Tz(e,n))));return Mz(t,s.getOr(Sz),n,N.none())};const Lz={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"};const Hz=e=>{const t=zd("notification-text");const o=aS({dom:rS(`<p id=${t}>${_z(e.backstageProvider.translate(e.text))}</p>`),behaviours:wi([m_.config({})])});const n=e=>({dom:{tag:"div",classes:["tox-bar"],styles:{width:`${e}%`}}});const s=e=>({dom:{tag:"div",classes:["tox-text"],innerHtml:`${e}%`}});const r=aS({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},s(0)],behaviours:wi([m_.config({})])});const a=(e,t)=>{if(e.getSystem().isConnected()){r.getOpt(e).each((e=>{m_.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(t)]},s(t)])}))}};const c=(e,t)=>{if(e.getSystem().isConnected()){const n=o.get(e);m_.set(n,[Bu(t)])}};const i={updateProgress:a,updateText:c};const l=J([e.icon.toArray(),e.level.toArray(),e.level.bind((e=>N.from(Lz[e]))).toArray()]);const d=aS(oS.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":e.backstageProvider.translate("Close")}},components:[Rz("close",{tag:"span",classes:["tox-icon"]},e.iconProvider)],buttonBehaviours:wi([dS.config({}),CS.config({...e.backstageProvider.tooltips.getConfig({tooltipText:e.backstageProvider.translate("Close")})})]),action:t=>{e.onAction(t)}}));const u=Bz(l,{tag:"div",classes:["tox-notification__icon"]},e.iconProvider);const f={dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:wi([m_.config({})])};const m=[u,f];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":t},classes:e.level.map((e=>["tox-notification","tox-notification--in",`tox-notification--${e}`])).getOr(["tox-notification","tox-notification--in"])},behaviours:wi([dS.config({}),C_.config({}),Qw.config({mode:"special",onEscape:t=>{e.onAction(t);return N.some(true)}})]),components:m.concat(e.progress?[r.asSpec()]:[]).concat([d.asSpec()]),apis:i}};const Iz=Mb({name:"Notification",factory:Hz,configFields:[Qr("level"),jr("progress"),Qr("icon"),jr("onAction"),jr("text"),jr("iconProvider"),jr("backstageProvider")],apis:{updateProgress:(e,t,o)=>{e.updateProgress(t,o)},updateText:(e,t,o)=>{e.updateText(t,o)}}});var Pz=(e,t,o,n)=>{const s=t.backstage.shared;const r=()=>{const t=os(Je.fromDom(e.getContentAreaContainer()));return N.some(t)};const a=e=>{r().each((t=>{Z(e,(e=>{if(Ro(e.element)>t.width){uo(e.element,"width",t.width+"px")}}))}))};const c=(t,c,i)=>{const l=()=>{const t=e=>{m_.remove(e,d);u()};const o=(e,t)=>{if(Lt(e.element).length===0){s(e,t)}else{r(e,t)}};const s=(t,o)=>{Ix.hide(t);n.clear();if(o){e.focus()}};const r=(e,t)=>{if(t){Qw.focusIn(e)}};n.on((e=>{c();const n=i();t(e);o(e,n)}))};const d=Fu(Iz.sketch({text:t.text,level:I(["success","error","warning","warn","info"],t.type)?t.type:undefined,progress:t.progressBar===true,icon:t.icon,onAction:l,iconProvider:s.providers.icons,backstageProvider:s.providers}));if(!n.isSet()){const t=Fu(Ix.sketch({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:s.getSink,fireDismissalEventInstead:{},...s.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}},inlineBehaviours:wi([Qw.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),m_.config({}),...qC(e)&&!s.header.isPositionedAtTop()?[]:[wd.config({contextual:{lazyContext:()=>N.some(os(Je.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:t=>{const o=QC(e,t.element);return o.map((e=>{const t=eS(e);return{bounds:t,optScrollEnv:N.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Ao(e.element).top})}})).getOrThunk((()=>({bounds:as(),optScrollEnv:N.none()})))}})]])}));const a=Vu(d);const c={maxHeightFunction:Ym()};const i={...s.anchors.banner(),overrides:c};n.set(t);o.add(t);Ix.showWithinBounds(t,a,{anchor:i},r)}else{const e=Vu(d);n.on((t=>{m_.append(t,e);Ix.reposition(t);wd.refresh(t);a(t.components())}))}if(y(t.timeout)&&t.timeout>0){Px.setEditorTimeout(e,(()=>{l()}),t.timeout)}const u=()=>{n.on((e=>{Ix.reposition(e);wd.refresh(e);a(e.components())}))};const f={close:l,reposition:u,text:e=>{Iz.updateText(d,e)},settings:t,getEl:()=>d.element.dom,progressBar:{value:e=>{Iz.updateProgress(d,e)}}};return f};const i=e=>{e.close()};const l=e=>e.settings;return{open:c,close:i,getArgs:l}};const Fz=(e,t)=>{const o=(e,t)=>{Lc(e,Ja(),{raw:t})};const n=()=>e.getMenu().bind(Cv.getHighlighted);t.on("keydown",(t=>{const s=t.which;if(!e.isActive()){return}if(e.isMenuOpen()){if(s===13){n().each(Hc);t.preventDefault()}else if(s===40){n().fold((()=>{e.getMenu().each(Cv.highlightFirst)}),(e=>{o(e,t)}));t.preventDefault();t.stopImmediatePropagation()}else if(s===37||s===38||s===39){n().each((e=>{o(e,t);t.preventDefault();t.stopImmediatePropagation()}))}}else{if(s===13||s===38||s===40){e.cancelIfNecessary()}}}));t.on("NodeChange",(()=>{if(e.isActive()&&!e.isProcessingAction()&&!t.queryCommandState("mceAutoCompleterInRange")){e.cancelIfNecessary()}}))};const Vz={setup:Fz};var jz;(function(e){e[e["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE";e[e["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(jz||(jz={}));var Zz=jz;const Uz="tox-menu-nav__js";const qz="tox-collection__item";const Wz="tox-swatch";const $z={normal:Uz,color:Wz};const Gz="tox-collection__item--enabled";const Kz="tox-collection__group-heading";const Yz="tox-collection__item-icon";const Xz="tox-collection__item-label";const Jz="tox-collection__item-accessory";const Qz="tox-collection__item-caret";const eT="tox-collection__item-checkmark";const tT="tox-collection__item--active";const oT="tox-collection__item-container";const nT="tox-collection__item-container--column";const sT="tox-collection__item-container--row";const rT="tox-collection__item-container--align-right";const aT="tox-collection__item-container--align-left";const cT="tox-collection__item-container--valign-top";const iT="tox-collection__item-container--valign-middle";const lT="tox-collection__item-container--valign-bottom";const dT=e=>xe($z,e).getOr(Uz);const uT=e=>{if(e==="color"){return"tox-swatches"}else{return"tox-menu"}};const fT=e=>({backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:uT(e),tieredMenu:"tox-tiered-menu"});const mT=e=>{const t=fT(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:dT(e)}};const gT=(e,t,o)=>{const n=fT(o);return{tag:"div",classes:J([[n.menu,`tox-menu-${t}-column`],e?[n.hasIcons]:[]])}};const pT=[kx.parts.items({})];const hT=(e,t,o)=>{const n=fT(o);const s={tag:"div",classes:J([[n.tieredMenu]])};return{dom:s,markers:mT(o)}};const yT=x([Qr("data"),ia("inputAttributes",{}),ia("inputStyles",{}),ia("tag","input"),ia("inputClasses",[]),ud("onSetValue"),ia("styles",{}),ia("eventOrder",{}),_y("inputBehaviours",[wy,C_]),ia("selectOnFocus",true)]);const bT=e=>wi([C_.config({onFocus:!e.selectOnFocus?v:e=>{const t=e.element;const o=mu(t);t.dom.setSelectionRange(0,o.length)}})]);const vT=e=>({...bT(e),...Cy(e.inputBehaviours,[wy.config({store:{mode:"manual",...e.data.map((e=>({initialValue:e}))).getOr({}),getValue:e=>mu(e.element),setValue:(e,t)=>{const o=mu(e.element);if(o!==t){gu(e.element,t)}}},onSetValue:e.onSetValue})])});const kT=e=>({tag:e.tag,attributes:{type:"text",...e.inputAttributes},styles:e.inputStyles,classes:e.inputClasses});const wT=(e,t)=>({uid:e.uid,dom:kT(e),components:[],behaviours:vT(e),eventOrder:e.eventOrder});const _T=Mb({name:"Input",configFields:yT(),factory:wT});const xT=zd("refetch-trigger-event");const CT=zd("redirect-menu-item-interaction");const ST="tox-menu__searcher";const zT=e=>Qu(e.element,`.${ST}`).bind((t=>e.getSystem().getByDom(t).toOptional()));const TT=zT;const ET=(e,t)=>{wy.setValue(e,t.fetchPattern);e.element.dom.selectionStart=t.selectionStart;e.element.dom.selectionEnd=t.selectionEnd};const OT=e=>{const t=wy.getValue(e);const o=e.element.dom.selectionStart;const n=e.element.dom.selectionEnd;return{fetchPattern:t,selectionStart:o,selectionEnd:n}};const AT=(e,t)=>{so(t.element,"id").each((t=>to(e.element,"aria-activedescendant",t)))};const DT=e=>{const t=(e,t)=>{t.cut();return N.none()};const o=(e,t)=>{const o={interactionEvent:t.event,eventType:t.event.raw.type};Lc(e,CT,o);return N.some(true)};const n="searcher-events";return{dom:{tag:"div",classes:[qz]},components:[_T.sketch({inputClasses:[ST,"tox-textfield"],inputAttributes:{...e.placeholder.map((t=>({placeholder:e.i18n(t)}))).getOr({}),type:"search","aria-autocomplete":"list"},inputBehaviours:wi([p_(n,[Wc(ec(),(e=>{Bc(e,xT)})),Wc(Ja(),((e,t)=>{if(t.event.raw.key==="Escape"){t.stop()}}))]),Qw.config({mode:"special",onLeft:t,onRight:t,onSpace:t,onEnter:o,onEscape:o,onUp:o,onDown:o})]),eventOrder:{keydown:[n,Qw.name()]}})]}};const NT="tox-collection--results__js";const MT=e=>{var t;if(e.dom){return{...e,dom:{...e.dom,attributes:{...(t=e.dom.attributes)!==null&&t!==void 0?t:{},id:zd("aria-item-search-result-id"),"aria-selected":"false"}}}}else{return e}};const RT=(e,t)=>o=>{const n=V(o,t);return j(n,(t=>({dom:e,components:t})))};const BT=e=>({dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[kx.parts.items({preprocess:e!=="auto"?RT({tag:"div",classes:["tox-swatches__row"]},e):C})]}]});const LT=e=>({dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[kx.parts.items({preprocess:RT({tag:"div",classes:["tox-collection__group"]},e)})]});const HT=(e,t)=>{const o=[];let n=[];Z(e,((e,s)=>{if(t(e,s)){if(n.length>0){o.push(n)}n=[];if(Ce(e.dom,"innerHtml")||e.components&&e.components.length>0){n.push(e)}}else{n.push(e)}}));if(n.length>0){o.push(n)}return j(o,(e=>({dom:{tag:"div",classes:["tox-collection__group"]},components:e})))};const IT=(e,t,o)=>kx.parts.items({preprocess:n=>{const s=j(n,o);if(e!=="auto"&&e>1){return RT({tag:"div",classes:["tox-collection__group"]},e)(s)}else{return HT(s,((e,o)=>t[o].type==="separator"))}}});const PT=(e,t,o=true)=>({dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(e===1?["tox-collection--list"]:["tox-collection--grid"])},components:[IT(e,t,C)]});const FT=(e,t,o=true)=>{const n=zd("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",NT].concat(e===1?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:n}},components:[IT(e,t,MT)]}};const VT=(e,t,o)=>{const n=zd("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(e===1?["tox-collection--list"]:["tox-collection--grid"])},components:[DT({i18n:xz.translate,placeholder:o.placeholder}),{dom:{tag:"div",classes:[...e===1?["tox-collection--list"]:["tox-collection--grid"],NT],attributes:{id:n}},components:[IT(e,t,MT)]}]}};const jT=(e,t=true)=>({dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[kx.parts.items({preprocess:t=>HT(t,((t,o)=>e[o].type==="separator"))})]});const ZT=e=>P(e,(e=>"icon"in e&&e.icon!==undefined));const UT=e=>{console.error(Lr(e));console.log(e);return N.none()};const qT=(e,t,o,n,s)=>{const r=jT(o);return{value:e,dom:r.dom,components:r.components,items:o}};const WT=(e,t,o,n,s)=>{const r=()=>{if(s.menuType!=="searchable"){return PT(n,o)}else{return s.searchMode.searchMode==="search-with-field"?VT(n,o,s.searchMode):FT(n,o)}};if(s.menuType==="color"){const t=BT(n);return{value:e,dom:t.dom,components:t.components,items:o}}else if(s.menuType==="normal"&&n==="auto"){const t=PT(n,o);return{value:e,dom:t.dom,components:t.components,items:o}}else if(s.menuType==="normal"||s.menuType==="searchable"){const t=r();return{value:e,dom:t.dom,components:t.components,items:o}}else if(s.menuType==="listpreview"&&n!=="auto"){const t=LT(n);return{value:e,dom:t.dom,components:t.components,items:o}}else{return{value:e,dom:gT(t,n,s.menuType),components:pT,items:o}}};const $T=qr("type");const GT=qr("name");const KT=qr("label");const YT=qr("text");const XT=qr("title");const JT=qr("icon");const QT=qr("value");const eE=Gr("fetch");const tE=Gr("getSubmenuItems");const oE=Gr("onAction");const nE=Gr("onItemAction");const sE=ga("onSetup",(()=>v));const rE=oa("name");const aE=oa("text");const cE=oa("role");const iE=oa("icon");const lE=oa("tooltip");const dE=oa("label");const uE=oa("shortcut");const fE=sa("select");const mE=ma("active",false);const gE=ma("borderless",false);const pE=ma("enabled",true);const hE=ma("primary",false);const yE=e=>ia("columns",e);const bE=ia("meta",{});const vE=ga("onAction",v);const kE=e=>ua("type",e);const wE=e=>Pr("name","name",Is((()=>zd(`${e}-name`))),_r);const _E=e=>Pr("value","value",Is((()=>zd(`${e}-value`))),vr());const xE=mr([$T,aE]);const CE=e=>Mr("separatormenuitem",xE,e);const SE=mr([kE("autocompleteitem"),mE,pE,bE,QT,aE,iE]);const zE=e=>Mr("Autocompleter.Separator",xE,e);const TE=e=>Mr("Autocompleter.Item",SE,e);const EE=[pE,lE,iE,aE,sE];const OE=mr([$T,oE,uE].concat(EE));const AE=e=>Mr("toolbarbutton",OE,e);const DE=[mE].concat(EE);const NE=mr(DE.concat([$T,oE,uE]));const ME=e=>Mr("ToggleButton",NE,e);const RE=[ga("predicate",A),fa("scope","node",["node","editor"]),fa("position","selection",["node","selection","line"])];const BE=EE.concat([kE("contextformbutton"),hE,oE,Fr("original",C)]);const LE=DE.concat([kE("contextformbutton"),hE,oE,Fr("original",C)]);const HE=EE.concat([kE("contextformbutton")]);const IE=DE.concat([kE("contextformtogglebutton")]);const PE=Hr("type",{contextformbutton:BE,contextformtogglebutton:LE});const FE=mr([kE("contextform"),ga("initValue",x("")),dE,Jr("commands",PE),ea("launch",Hr("type",{contextformbutton:HE,contextformtogglebutton:IE}))].concat(RE));const VE=e=>Mr("ContextForm",FE,e);const jE=mr([kE("contexttoolbar"),qr("items")].concat(RE));const ZE=e=>Mr("ContextToolbar",jE,e);const UE=[$T,qr("src"),oa("alt"),ha("classes",[],_r)];const qE=mr(UE);const WE=[$T,YT,rE,ha("classes",["tox-collection__item-label"],_r)];const $E=mr(WE);const GE=dr((()=>Er("type",{cardimage:qE,cardtext:$E,cardcontainer:KE})));const KE=mr([$T,ua("direction","horizontal"),ua("align","left"),ua("valign","middle"),Jr("items",GE)]);const YE=[pE,aE,cE,uE,_E("menuitem"),bE];const XE=mr([$T,dE,Jr("items",GE),sE,vE].concat(YE));const JE=e=>Mr("cardmenuitem",XE,e);const QE=mr([$T,mE,iE].concat(YE));const eO=e=>Mr("choicemenuitem",QE,e);const tO=[$T,qr("fancytype"),vE];const oO=[ia("initData",{})].concat(tO);const nO=[sa("select"),ya("initData",{},[ma("allowCustomColors",true),ua("storageKey","default"),ra("colors",vr())])].concat(tO);const sO=Hr("fancytype",{inserttable:oO,colorswatch:nO});const rO=e=>Mr("fancymenuitem",sO,e);const aO=mr([$T,sE,vE,iE].concat(YE));const cO=e=>Mr("menuitem",aO,e);const iO=mr([$T,tE,sE,iE].concat(YE));const lO=e=>Mr("nestedmenuitem",iO,e);const dO=mr([$T,iE,mE,sE,oE].concat(YE));const uO=e=>Mr("togglemenuitem",dO,e);const fO=(e,t,o)=>{const n=lp(e.element,"."+o);if(n.length>0){const e=X(n,(e=>{const o=e.dom.getBoundingClientRect().top;const s=n[0].dom.getBoundingClientRect().top;return Math.abs(o-s)>t})).getOr(n.length);return N.some({numColumns:e,numRows:Math.ceil(n.length/e)})}else{return N.none()}};const mO=(e,t)=>wi([p_(e,t)]);const gO=e=>mO(zd("unnamed-events"),e);const pO={namedEvents:mO,unnamedEvents:gO};const hO=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");const yO="silver.readonly";const bO=mr([$r("readonly")]);const vO=(e,t)=>{const o=e.mainUi.outerContainer;const n=o.element;const s=[e.mainUi.mothership,...e.uiMotherships];if(t){Z(s,(e=>{e.broadcastOn([Fh()],{target:n})}))}Z(s,(e=>{e.broadcastOn([yO],{readonly:t})}))};const kO=(e,t)=>{e.on("init",(()=>{if(e.mode.isReadOnly()){vO(t,true)}}));e.on("SwitchMode",(()=>vO(t,e.mode.isReadOnly())));if(Gx(e)){e.mode.set("readonly")}};const wO=()=>Jf.config({channels:{[yO]:{schema:bO,onReceive:(e,t)=>{sv.set(e,t.readonly)}}}});const _O=e=>sv.config({disabled:e,disableClass:"tox-collection__item--state-disabled"});const xO=e=>sv.config({disabled:e});const CO=e=>sv.config({disabled:e,disableClass:"tox-tbtn--disabled"});const SO=e=>sv.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:false});const zO={item:_O,button:xO,splitButton:CO,toolbarButton:SO};const TO=(e,t)=>{const o=e.getApi(t);return e=>{e(o)}};const EO=(e,t)=>oi((o=>{const n=TO(e,o);n((o=>{const n=e.onSetup(o);if(h(n)){t.set(n)}}))}));const OO=(e,t)=>ni((o=>TO(e,o)(t.get())));const AO=(e,t)=>ri(((o,n)=>{TO(e,o)(e.onAction);if(!e.triggersSubmenu&&t===Zz.CLOSE_ON_EXECUTE){if(o.getSystem().isConnected()){Bc(o,yc())}n.stop()}}));const DO={[mc()]:["disabling","alloy.base.behaviour","toggling","item-events"]};const NO=Ee;const MO=(e,t,o,n)=>{const s=cs(v);return{type:"item",dom:t.dom,components:NO(t.optComponents),data:e.data,eventOrder:DO,hasSubmenu:e.triggersSubmenu,itemBehaviours:wi([p_("item-events",[AO(e,o),EO(e,s),OO(e,s)]),zO.item((()=>!e.enabled||n.isDisabled())),wO(),m_.config({})].concat(e.itemBehaviours))}};const RO=e=>({value:e.value,meta:{text:e.text.getOr(""),...e.meta}});const BO=e=>{const t=jx.os.isMacOS()||jx.os.isiOS();const o={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"};const n={meta:"Ctrl",access:"Shift+Alt"};const s=t?o:n;const r=e.split("+");const a=j(r,(e=>{const t=e.toLowerCase().trim();return Ce(s,t)?s[t]:e}));return t?a.join(""):a.join("+")};const LO=(e,t,o=[Yz])=>Rz(e,{tag:"div",classes:o},t);const HO=e=>({dom:{tag:"div",classes:[Xz]},components:[Bu(xz.translate(e))]});const IO=(e,t)=>({dom:{tag:"div",classes:t,innerHtml:e}});const PO=(e,t)=>({dom:{tag:"div",classes:[Xz]},components:[{dom:{tag:e.tag,styles:e.styles},components:[Bu(xz.translate(t))]}]});const FO=e=>({dom:{tag:"div",classes:[Jz]},components:[Bu(BO(e))]});const VO=e=>LO("checkmark",e,[eT]);const jO=e=>LO("chevron-right",e,[Qz]);const ZO=e=>LO("chevron-down",e,[Qz]);const UO=(e,t)=>{const o=e.direction==="vertical"?nT:sT;const n=e.align==="left"?aT:rT;const s=()=>{switch(e.valign){case"top":return cT;case"middle":return iT;case"bottom":return lT}};return{dom:{tag:"div",classes:[oT,o,n,s()]},components:t}};const qO=(e,t,o)=>({dom:{tag:"img",classes:t,attributes:{src:e,alt:o.getOr("")}}});const WO=(e,t,o)=>{const n="custom";const s="remove";const r=e.value;const a=e.iconContent.map((e=>Az(e,t.icons,o)));const c=e.ariaLabel.map((e=>({"aria-label":t.translate(e),"data-mce-name":e}))).getOr({});const i=()=>{const e=Wz;const t=a.getOr("");const o={tag:"div",attributes:c,classes:[e]};if(r===n){return{...o,tag:"button",classes:[...o.classes,"tox-swatches__picker-btn"],innerHtml:t}}else if(r===s){return{...o,classes:[...o.classes,"tox-swatch--remove"],innerHtml:t}}else if(p(r)){return{...o,attributes:{...o.attributes,"data-mce-color":r},styles:{"background-color":r},innerHtml:t}}else{return o}};return{dom:i(),optComponents:[]}};const $O=e=>{const t=e.map((e=>({attributes:{id:zd("menu-item"),"aria-label":xz.translate(e)}}))).getOr({});return{tag:"div",classes:[Uz,qz],...t}};const GO=(e,t,o,n)=>{const s={tag:"div",classes:[Yz]};const r=e=>Rz(e,s,t.icons,n);const a=()=>N.some({dom:s});const c=o?e.iconContent.map(r).orThunk(a):N.none();const i=e.checkMark;const l=N.from(e.meta).fold((()=>HO),(e=>Ce(e,"style")?z(PO,e.style):HO));const d=e.htmlContent.fold((()=>e.textContent.map(l)),(e=>N.some(IO(e,[Xz]))));const u={dom:$O(e.ariaLabel),optComponents:[c,d,e.shortcutContent.map(FO),i,e.caret]};return u};const KO=(e,t,o,n=N.none())=>{if(e.presets==="color"){return WO(e,t,n)}else{return GO(e,t,o,n)}};const YO=(e,t,o)=>xe(e,"tooltipWorker").map((e=>[CS.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:e=>({type:"submenu",item:e,overrides:{maxHeightFunction:Ym}}),mode:"follow-highlight",onShow:(t,o)=>{e((e=>{CS.setComponents(t,[Lu({element:Je.fromDom(e)})])}))}})])).getOrThunk((()=>o.map((e=>[CS.config({...t.providers.tooltips.getConfig({tooltipText:e}),mode:"follow-highlight"})])).getOr([])));const XO=e=>Fx.DOM.encode(e);const JO=(e,t)=>{const o=xz.translate(e);const n=XO(o);if(t.length>0){const e=new RegExp(hO(t),"gi");return n.replace(e,(e=>`<span class="tox-autocompleter-highlight">${e}</span>`))}else{return n}};const QO=(e,t,o,n,s,r,a,c=true)=>{const i=KO({presets:n,textContent:N.none(),htmlContent:o?e.text.map((e=>JO(e,t))):N.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:N.none(),checkMark:N.none(),caret:N.none(),value:e.value},a.providers,c,e.icon);const l=e.text.filter((e=>!o&&e!==""));return MO({data:RO(e),enabled:e.enabled,getApi:x({}),onAction:t=>s(e.value,e.meta),onSetup:x(v),triggersSubmenu:false,itemBehaviours:YO(e,a,l)},i,r,a.providers)};const eA=(e,t)=>j(e,(e=>{switch(e.type){case"cardcontainer":return UO(e,eA(e.items,t));case"cardimage":return qO(e.src,e.classes,e.alt);case"cardtext":const o=e.name.exists((e=>I(t.cardText.highlightOn,e)));const n=o?N.from(t.cardText.matchText).getOr(""):"";return IO(JO(e.text,n),e.classes)}}));const tA=(e,t,o,n)=>{const s=e=>({isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>{sv.set(e,!t);Z(lp(e.element,"*"),(o=>{e.getSystem().getByDom(o).each((e=>{if(e.hasConfigured(sv)){sv.set(e,!t)}}))}))}});const r={dom:$O(e.label),optComponents:[N.some({dom:{tag:"div",classes:[oT,sT]},components:eA(e.items,n)})]};return MO({data:RO({text:N.none(),...e}),enabled:e.enabled,getApi:s,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:false,itemBehaviours:N.from(n.itemBehaviours).getOr([])},r,t,o.providers)};const oA=(e,t,o,n,s,r,a,c=true)=>{const i=e=>({setActive:t=>{Z_.set(e,t)},isActive:()=>Z_.isOn(e),isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t)});const l=KO({presets:o,textContent:t?e.text:N.none(),htmlContent:N.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:N.none(),checkMark:t?N.some(VO(a.icons)):N.none(),caret:N.none(),value:e.value},a,c);const d=e.text.filter(x(!t)).map((e=>CS.config(a.tooltips.getConfig({tooltipText:a.translate(e)}))));return Bs(MO({data:RO(e),enabled:e.enabled,getApi:i,onAction:t=>n(e.value),onSetup:e=>{e.setActive(s);return v},triggersSubmenu:false,itemBehaviours:[...d.toArray()]},l,r,a),{toggling:{toggleClass:Gz,toggleOnExecute:false,selected:e.active,exclusive:true}})};const nA=ib(cx(),ix());const sA=e=>({value:iA(e)});const rA=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;const aA=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;const cA=e=>rA.test(e)||aA.test(e);const iA=e=>He(e,"#").toUpperCase();const lA=e=>cA(e)?N.some({value:iA(e)}):N.none();const dA=e=>{const t=e.value.replace(rA,((e,t,o,n)=>t+t+o+o+n+n));return{value:t}};const uA=e=>{const t=dA(e);const o=aA.exec(t.value);return o===null?["FFFFFF","FF","FF","FF"]:o};const fA=e=>{const t=e.toString(16);return(t.length===1?"0"+t:t).toUpperCase()};const mA=e=>{const t=fA(e.red)+fA(e.green)+fA(e.blue);return sA(t)};const gA=Math.min;const pA=Math.max;const hA=Math.round;const yA=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i;const bA=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i;const vA=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n});const kA=e=>{const t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255};const wA=e=>{let t;let o;let n;const s=(e.hue||0)%360;let r=e.saturation/100;let a=e.value/100;r=pA(0,gA(r,1));a=pA(0,gA(a,1));if(r===0){t=o=n=hA(255*a);return vA(t,o,n,1)}const c=s/60;const i=a*r;const l=i*(1-Math.abs(c%2-1));const d=a-i;switch(Math.floor(c)){case 0:t=i;o=l;n=0;break;case 1:t=l;o=i;n=0;break;case 2:t=0;o=i;n=l;break;case 3:t=0;o=l;n=i;break;case 4:t=l;o=0;n=i;break;case 5:t=i;o=0;n=l;break;default:t=o=n=0}t=hA(255*(t+d));o=hA(255*(o+d));n=hA(255*(n+d));return vA(t,o,n,1)};const _A=e=>{const t=uA(e);const o=parseInt(t[1],16);const n=parseInt(t[2],16);const s=parseInt(t[3],16);return vA(o,n,s,1)};const xA=(e,t,o,n)=>{const s=parseInt(e,10);const r=parseInt(t,10);const a=parseInt(o,10);const c=parseFloat(n);return vA(s,r,a,c)};const CA=e=>{const t=yA.exec(e);if(t!==null){return N.some(xA(t[1],t[2],t[3],"1"))}const o=bA.exec(e);if(o!==null){return N.some(xA(o[1],o[2],o[3],o[4]))}return N.none()};const SA=e=>`rgba(${e.red},${e.green},${e.blue},${e.alpha})`;const zA=vA(255,0,0,1);const TA=e=>{e.dispatch("SkinLoaded")};const EA=(e,t)=>{e.dispatch("SkinLoadError",t)};const OA=e=>{e.dispatch("ResizeEditor")};const AA=(e,t)=>{e.dispatch("ResizeContent",t)};const DA=(e,t)=>{e.dispatch("ScrollContent",t)};const NA=(e,t)=>{e.dispatch("TextColorChange",t)};const MA=(e,t)=>{e.dispatch("AfterProgressState",{state:t})};const RA=(e,t)=>e.dispatch("ResolveName",{name:t.nodeName.toLowerCase(),target:t});const BA=(e,t)=>{e.dispatch("ToggleToolbarDrawer",{state:t})};const LA=(e,t)=>{e.dispatch("StylesTextUpdate",t)};const HA=(e,t)=>{e.dispatch("AlignTextUpdate",t)};const IA=(e,t)=>{e.dispatch("FontSizeTextUpdate",t)};const PA=(e,t)=>{e.dispatch("FontSizeInputTextUpdate",t)};const FA=(e,t)=>{e.dispatch("BlocksTextUpdate",t)};const VA=(e,t)=>{e.dispatch("FontFamilyTextUpdate",t)};const jA=(e,t)=>()=>{e();t()};const ZA=e=>WA(e,"NodeChange",(t=>{t.setEnabled(e.selection.isEditable())}));const UA=(e,t)=>o=>{const n=ds();const s=()=>{o.setActive(e.formatter.match(t));const s=e.formatter.formatChanged(t,o.setActive);n.set(s)};e.initialized?s():e.once("init",s);return()=>{e.off("init",s);n.clear()}};const qA=(e,t)=>o=>{const n=ZA(e)(o);const s=UA(e,t)(o);return()=>{n();s()}};const WA=(e,t,o)=>n=>{const s=()=>o(n);const r=()=>{o(n);e.on(t,s)};e.initialized?r():e.once("init",r);return()=>{e.off("init",r);e.off(t,s)}};const $A=e=>t=>()=>{e.undoManager.transact((()=>{e.focus();e.execCommand("mceToggleFormat",false,t.format)}))};const GA=(e,t)=>()=>e.execCommand(t);var KA=tinymce.util.Tools.resolve("tinymce.util.LocalStorage");const YA={};const XA=(e,t=10)=>{const o=KA.getItem(e);const n=c(o)?JSON.parse(o):[];const s=e=>{const o=t-e.length;return o<0?e.slice(0,t):e};const r=s(n);const a=o=>{H(r,o).each(i);r.unshift(o);if(r.length>t){r.pop()}KA.setItem(e,JSON.stringify(r))};const i=e=>{r.splice(e,1)};const l=()=>r.slice(0);return{add:a,state:l}};const JA=e=>xe(YA,e).getOrThunk((()=>{const t=`tinymce-custom-colors-${e}`;const o=KA.getItem(t);if(g(o)){const e=KA.getItem("tinymce-custom-colors");KA.setItem(t,p(e)?e:"[]")}const n=XA(t,10);YA[e]=n;return n}));const QA=e=>j(JA(e).state(),(e=>({type:"choiceitem",text:e,icon:"checkmark",value:e})));const eD=(e,t)=>{JA(e).add(t)};const tD=(e,t,o)=>({hue:e,saturation:t,value:o});const oD=e=>{let t=0;let o=0;let n=0;const s=e.red/255;const r=e.green/255;const a=e.blue/255;const c=Math.min(s,Math.min(r,a));const i=Math.max(s,Math.max(r,a));if(c===i){n=c;return tD(0,0,n*100)}const l=s===c?r-a:a===c?s-r:a-s;t=s===c?3:a===c?1:5;t=60*(t-l/(i-c));o=(i-c)/i;n=i;return tD(Math.round(t),Math.round(o*100),Math.round(n*100))};const nD=e=>oD(_A(e));const sD=e=>mA(wA(e));const rD=e=>lA(e).orThunk((()=>CA(e).map(mA))).getOrThunk((()=>{const t=document.createElement("canvas");t.height=1;t.width=1;const o=t.getContext("2d");o.clearRect(0,0,t.width,t.height);o.fillStyle="#FFFFFF";o.fillStyle=e;o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data;const s=n[0];const r=n[1];const a=n[2];const c=n[3];return mA(vA(s,r,a,c))}));const aD="forecolor";const cD="hilitecolor";const iD=5;const lD=e=>{const t=[];for(let o=0;o<e.length;o+=2){t.push({text:e[o+1],value:"#"+rD(e[o]).value,icon:"checkmark",type:"choiceitem"})}return t};const dD=e=>t=>t.options.get(e);const uD="#000000";const fD=e=>{const t=e.options.register;const o=e=>{if(b(e,c)){return{value:lD(e),valid:true}}else{return{valid:false,message:"Must be an array of strings."}}};const n=e=>{if(y(e)&&e>0){return{value:e,valid:true}}else{return{valid:false,message:"Must be a positive number."}}};t("color_map",{processor:o,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]});t("color_map_background",{processor:o});t("color_map_foreground",{processor:o});t("color_cols",{processor:n,default:gD(e)});t("color_cols_foreground",{processor:n,default:pD(e,aD)});t("color_cols_background",{processor:n,default:pD(e,cD)});t("custom_colors",{processor:"boolean",default:true});t("color_default_foreground",{processor:"string",default:uD});t("color_default_background",{processor:"string",default:uD})};const mD=(e,t)=>{if(t===aD&&e.options.isSet("color_map_foreground")){return dD("color_map_foreground")(e)}else if(t===cD&&e.options.isSet("color_map_background")){return dD("color_map_background")(e)}else{return dD("color_map")(e)}};const gD=(e,t="default")=>Math.max(iD,Math.ceil(Math.sqrt(mD(e,t).length)));const pD=(e,t)=>{const o=dD("color_cols")(e);const n=gD(e,t);if(o===gD(e)){return n}else{return o}};const hD=(e,t="default")=>{const o=()=>{if(t===aD){return dD("color_cols_foreground")(e)}else if(t===cD){return dD("color_cols_background")(e)}else{return dD("color_cols")(e)}};return Math.round(o())};const yD=dD("custom_colors");const bD=dD("color_default_foreground");const vD=dD("color_default_background");const kD="rgba(0, 0, 0, 0)";const wD=e=>CA(e).exists((e=>e.alpha!==0));const _D=e=>Na(e,(e=>{if(pt(e)){const t=go(e,"background-color");return Me(wD(t),t)}else{return N.none()}})).getOr(kD);const xD=(e,t)=>{const o=Je.fromDom(e.selection.getStart());const n=t==="hilitecolor"?_D(o):go(o,"color");return CA(n).map((e=>"#"+mA(e).value))};const CD=(e,t,o)=>{e.undoManager.transact((()=>{e.focus();e.formatter.apply(t,{value:o});e.nodeChanged()}))};const SD=(e,t)=>{e.undoManager.transact((()=>{e.focus();e.formatter.remove(t,{value:null},undefined,true);e.nodeChanged()}))};const zD=e=>{e.addCommand("mceApplyTextcolor",((t,o)=>{CD(e,t,o)}));e.addCommand("mceRemoveTextcolor",(t=>{SD(e,t)}))};const TD=e=>{const t="choiceitem";const o={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};const n={type:t,text:"Custom color",icon:"color-picker",value:"custom"};return e?[o,n]:[o]};const ED=(e,t,o,n)=>{if(o==="custom"){const o=HD(e);o((o=>{o.each((o=>{eD(t,o);e.execCommand("mceApplyTextcolor",t,o);n(o)}))}),xD(e,t).getOr(uD))}else if(o==="remove"){n("");e.execCommand("mceRemoveTextcolor",t)}else{n(o);e.execCommand("mceApplyTextcolor",t,o)}};const OD=(e,t,o)=>e.concat(QA(t).concat(TD(o)));const AD=(e,t,o)=>n=>{n(OD(e,t,o))};const DD=(e,t,o)=>{const n=t==="forecolor"?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";e.setIconFill(n,o)};const ND=(e,t)=>{e.setTooltip(t)};const MD=(e,t)=>o=>{const n=xD(e,t);return ze(n,o.toUpperCase())};const RD=(e,t,o)=>{if(qe(o)){return t==="forecolor"?"Text color":"Background color"}const n=t==="forecolor"?"Text color {0}":"Background color {0}";const s=OD(mD(e,t),t,false);const r=Y(s,(e=>e.value===o)).getOr({text:""}).text;return e.translate([n,e.translate(r)])};const BD=(e,t,o,n)=>{e.ui.registry.addSplitButton(t,{tooltip:RD(e,o,n.get()),presets:"color",icon:t==="forecolor"?"text-color":"highlight-bg-color",select:MD(e,o),columns:hD(e,o),fetch:AD(mD(e,o),o,yD(e)),onAction:t=>{ED(e,o,n.get(),v)},onItemAction:(s,r)=>{ED(e,o,r,(o=>{n.set(o);NA(e,{name:t,color:o})}))},onSetup:s=>{DD(s,t,n.get());const r=n=>{if(n.name===t){DD(s,n.name,n.color);ND(s,RD(e,o,n.color))}};e.on("TextColorChange",r);return jA(ZA(e)(s),(()=>{e.off("TextColorChange",r)}))}})};const LD=(e,t,o,n,s)=>{e.ui.registry.addNestedMenuItem(t,{text:n,icon:t==="forecolor"?"text-color":"highlight-bg-color",onSetup:n=>{ND(n,RD(e,o,s.get()));DD(n,t,s.get());return ZA(e)(n)},getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"colorswatch",select:MD(e,o),initData:{storageKey:o},onAction:n=>{ED(e,o,n.value,(o=>{s.set(o);NA(e,{name:t,color:o})}))}}]})};const HD=e=>(t,o)=>{let n=false;const s=o=>{const s=o.getData();const r=s.colorpicker;if(n){t(N.from(r));o.close()}else{e.windowManager.alert(e.translate(["Invalid hex color code: {0}",r]))}};const r=(e,t)=>{if(t.name==="hex-valid"){n=t.value}};const a={colorpicker:o};e.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:a,onAction:r,onSubmit:s,onClose:v,onCancel:()=>{t(N.none())}})};const ID=e=>{zD(e);const t=bD(e);const o=vD(e);const n=cs(t);const s=cs(o);BD(e,"forecolor","forecolor",n);BD(e,"backcolor","hilitecolor",s);LD(e,"forecolor","forecolor","Text color",n);LD(e,"backcolor","hilitecolor","Background color",s)};const PD=(e,t,o,n,s,r,a,c)=>{const i=ZT(t);const l=s!=="color"?"normal":"color";const d=FD(t,o,n,l,r,a,c);const u={menuType:s};return WT(e,i,d,n,u)};const FD=(e,t,o,n,s,r,a)=>Ee(j(e,(c=>{if(c.type==="choiceitem"){return eO(c).fold(UT,(c=>N.some(oA(c,o===1,n,t,r(c.value),s,a,ZT(e)))))}else{return N.none()}})));const VD=(e,t)=>{const o=mT(t);if(e===1){return{mode:"menu",moveOnTab:true}}else if(e==="auto"){return{mode:"grid",selector:"."+o.item,initSize:{numColumns:1,numRows:1}}}else{const e=t==="color"?"tox-swatches__row":"tox-collection__group";return{mode:"matrix",rowSelector:"."+e,previousSelector:e=>t==="color"?Qu(e.element,"[aria-checked=true]"):N.none()}}};const jD=(e,t)=>{if(e===1){return{mode:"menu",moveOnTab:false,selector:".tox-collection__item"}}else if(e==="auto"){return{mode:"flatgrid",selector:"."+"tox-collection__item",initSize:{numColumns:1,numRows:1}}}else{return{mode:"matrix",selectors:{row:t==="color"?".tox-swatches__row":".tox-collection__group",cell:t==="color"?`.${Wz}`:`.${qz}`}}}};const ZD=(e,t)=>{const o=UD(e,t);const n=t.colorinput.getColorCols(e.initData.storageKey);const s="color";const r=PD(zd("menu-value"),o,(t=>{e.onAction({value:t})}),n,s,Zz.CLOSE_ON_EXECUTE,e.select.getOr(A),t.shared.providers);const a={...r,markers:mT(s),movement:VD(n,s),showMenuRole:false};return{type:"widget",data:{value:zd("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:true,components:[nA.widget(kx.sketch(a))]}};const UD=(e,t)=>{const o=e.initData.allowCustomColors&&t.colorinput.hasCustomColors();return e.initData.colors.fold((()=>OD(t.colorinput.getColors(e.initData.storageKey),e.initData.storageKey,o)),(e=>e.concat(TD(o))))};const qD=zd("cell-over");const WD=zd("cell-execute");const $D=e=>(t,o)=>e.shared.providers.translate(["{0} columns, {1} rows",o,t]);const GD=(e,t,o)=>{const n=o=>Lc(o,qD,{row:e,col:t});const s=o=>Lc(o,WD,{row:e,col:t});const r=(e,t)=>{t.stop();s(e)};return Fu({dom:{tag:"div",attributes:{role:"button",["aria-label"]:o}},behaviours:wi([p_("insert-table-picker-cell",[Wc(Ka(),C_.focus),Wc(mc(),s),Wc(oc(),r),Wc(pc(),r)]),Z_.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:false}),C_.config({onFocus:n})])})};const KD=(e,t,o)=>{const n=[];for(let s=0;s<t;s++){const t=[];for(let n=0;n<o;n++){const o=e(s+1,n+1);t.push(GD(s,n,o))}n.push(t)}return n};const YD=(e,t,o,n,s)=>{for(let r=0;r<n;r++){for(let n=0;n<s;n++){Z_.set(e[r][n],r<=t&&n<=o)}}};const XD=e=>Q(e,(e=>j(e,Vu)));const JD=(e,t)=>Bu(`${t}x${e}`);const QD=(e,t)=>{const o=10;const n=10;const s=$D(t);const r=KD(s,o,n);const a=JD(0,0);const c=aS({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[a],behaviours:wi([m_.config({})])});return{type:"widget",data:{value:zd("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:true,components:[nA.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:XD(r).concat(c.asSpec()),behaviours:wi([p_("insert-table-picker",[oi((e=>{m_.set(c.get(e),[a])})),Jc(qD,((e,t,s)=>{const{row:a,col:i}=s.event;YD(r,a,i,o,n);m_.set(c.get(e),[JD(a+1,i+1)])})),Jc(WD,((t,o,n)=>{const{row:s,col:r}=n.event;e.onAction({numRows:s+1,numColumns:r+1});Bc(t,yc())}))]),Qw.config({initSize:{numRows:o,numColumns:n},mode:"flatgrid",selector:'[role="button"]'})])})]}};const eN={inserttable:QD,colorswatch:ZD};const tN=(e,t)=>xe(eN,e.fancytype).map((o=>o(e,t)));const oN=(e,t,o,n=true,s=false)=>{const r=s?ZO(o.icons):jO(o.icons);const a=e=>({isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t),setIconFill:(t,o)=>{Qu(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each((e=>{to(e,"fill",o)}))},setTooltip:t=>{const n=o.translate(t);to(e.element,"aria-label",n)}});const c=KO({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:N.none(),ariaLabel:e.text,caret:N.some(r),checkMark:N.none(),shortcutContent:e.shortcut},o,n);return MO({data:RO(e),getApi:a,enabled:e.enabled,onAction:v,onSetup:e.onSetup,triggersSubmenu:true,itemBehaviours:[]},c,t,o)};const nN=(e,t,o,n=true)=>{const s=e=>({isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t)});const r=KO({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:N.none(),ariaLabel:e.text,caret:N.none(),checkMark:N.none(),shortcutContent:e.shortcut},o,n);return MO({data:RO(e),getApi:s,enabled:e.enabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:false,itemBehaviours:[]},r,t,o)};const sN=e=>({type:"separator",dom:{tag:"div",classes:[qz,Kz]},components:e.text.map(Bu).toArray()});const rN=(e,t,o,n=true)=>{const s=e=>({setActive:t=>{Z_.set(e,t)},isActive:()=>Z_.isOn(e),isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t)});const r=KO({iconContent:e.icon,textContent:e.text,htmlContent:N.none(),ariaLabel:e.text,checkMark:N.some(VO(o.icons)),caret:N.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},o,n);return Bs(MO({data:RO(e),enabled:e.enabled,getApi:s,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:false,itemBehaviours:[]},r,t,o),{toggling:{toggleClass:Gz,toggleOnExecute:false,selected:e.active},role:e.role.getOrUndefined()})};const aN=QO;const cN=sN;const iN=nN;const lN=oN;const dN=rN;const uN=tN;const fN=tA;const mN=(e,t,o,n)=>o.getOrCreate(e,t,n);const gN=(e,t,o,n)=>o.getExisting(e,t,n);var pN=Object.freeze({__proto__:null,getCoupled:mN,getExistingCoupled:gN});var hN=[Zr("others",Dr(hs.value,vr()))];const yN=()=>{const e={};const t=(t,o)=>{const n=ue(t.others);if(n.length===0){throw new Error("Cannot find any known coupled components")}else{return xe(e,o)}};const o=(o,n,s)=>t(n,s).getOrThunk((()=>{const t=xe(n.others,s).getOrDie("No information found for coupled component: "+s);const r=t(o);const a=o.getSystem().build(r);e[s]=a;return a}));const n=(e,o,n)=>t(o,n).orThunk((()=>{xe(o.others,n).getOrDie("No information found for coupled component: "+n);return N.none()}));const s=x({});return ki({readState:s,getExisting:n,getOrCreate:o})};var bN=Object.freeze({__proto__:null,init:yN});const vN=xi({fields:hN,name:"coupling",apis:pN,state:bN});const kN=e=>{let t=N.none();let o=[];const n=e=>kN((t=>{s((o=>{t(e(o))}))}));const s=e=>{if(a()){i(e)}else{o.push(e)}};const r=e=>{if(!a()){t=N.some(e);c(o);o=[]}};const a=()=>t.isSome();const c=e=>{Z(e,i)};const i=e=>{t.each((t=>{setTimeout((()=>{e(t)}),0)}))};e(r);return{get:s,map:n,isReady:a}};const wN=e=>kN((t=>{t(e)}));const _N={nu:kN,pure:wN};const xN=e=>{setTimeout((()=>{throw e}),0)};const CN=e=>{const t=t=>{e().then(t,xN)};const o=t=>CN((()=>e().then(t)));const n=t=>CN((()=>e().then((e=>t(e).toPromise()))));const s=t=>CN((()=>e().then((()=>t.toPromise()))));const r=()=>_N.nu(t);const a=()=>{let t=null;return CN((()=>{if(t===null){t=e()}return t}))};const c=e;return{map:o,bind:n,anonBind:s,toLazy:r,toCached:a,toPromise:c,get:t}};const SN=e=>CN((()=>new Promise(e)));const zN=e=>CN((()=>Promise.resolve(e)));const TN={nu:SN,pure:zN};const EN=x("sink");const ON=x(ob({name:EN(),overrides:x({dom:{tag:"div"},behaviours:wi([th.config({useFixed:D})]),events:jc([Qc(Ja()),Qc(qa()),Qc(oc())])})}));const AN=(e,t)=>{const o=e.getHotspot(t).getOr(t);const n="hotspot";const s=e.getAnchorOverrides();return e.layouts.fold((()=>({type:n,hotspot:o,overrides:s})),(e=>({type:n,hotspot:o,overrides:s,layouts:e})))};const DN=(e,t,o)=>{const n=e.fetch;return n(o).map(t)};const NN=(e,t,o,n,s,r,a)=>{const c=DN(e,t,n);const i=HN(n,e);return c.map((t=>t.bind((t=>{const c=t.menus[t.primary];N.from(c).each((t=>{e.listRole.each((e=>{t.role=e}))}));return N.from(Bx.sketch({...r.menu(),uid:Rd(""),data:t,highlightOnOpen:a,onOpenMenu:(e,t)=>{const n=i().getOrDie();th.position(n,t,{anchor:o});Ph.decloak(s)},onOpenSubmenu:(e,t,o)=>{const n=i().getOrDie();th.position(n,o,{anchor:{type:"submenu",item:t}});Ph.decloak(s)},onRepositionMenu:(e,t,n)=>{const s=i().getOrDie();th.position(s,t,{anchor:o});Z(n,(e=>{th.position(s,e.triggeredMenu,{anchor:{type:"submenu",item:e.triggeringItem}})}))},onEscape:()=>{C_.focus(n);Ph.close(s);return N.some(true)}}))}))))};const MN=(e,t,o,n,s,r,a)=>{const c=AN(e,o);const i=NN(e,t,c,o,n,s,a);return i.map((e=>{e.fold((()=>{if(Ph.isOpen(n)){Ph.close(n)}}),(e=>{Ph.cloak(n);Ph.open(n,e);r(n)}));return n}))};const RN=(e,t,o,n,s,r,a)=>{Ph.close(n);return TN.pure(n)};const BN=(e,t,o,n,s,r)=>{const a=vN.getCoupled(o,"sandbox");const c=Ph.isOpen(a);const i=c?RN:MN;return i(e,t,o,a,n,s,r)};const LN=(e,t,o)=>{const n=Pb.getCurrent(t).getOr(t);const s=Ro(e.element);if(o){uo(n.element,"min-width",s+"px")}else{Mo(n.element,s)}};const HN=(e,t)=>e.getSystem().getByUid(t.uid+"-"+EN()).map((e=>()=>hs.value(e))).getOrThunk((()=>t.lazySink.fold((()=>()=>hs.error(new Error("No internal sink is specified, nor could an external sink be found"))),(t=>()=>t(e)))));const IN=e=>{Ph.getState(e).each((e=>{Bx.repositionMenus(e)}))};const PN=(e,t,o)=>{const n=nf();const s=(s,r)=>{const a=AN(e,t);n.link(t.element);if(e.matchWidth){LN(a.hotspot,r,e.useMinWidth)}e.onOpen(a,s,r);if(o!==undefined&&o.onOpen!==undefined){o.onOpen(s,r)}};const r=(e,s)=>{n.unlink(t.element);a().getOr(s).element.dom.dispatchEvent(new window.FocusEvent("focusout"));if(o!==undefined&&o.onClose!==undefined){o.onClose(e,s)}};const a=HN(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:n.id}},behaviours:Sy.augment(e.sandboxBehaviours,[wy.config({store:{mode:"memory",initialValue:t}}),Ph.config({onOpen:s,onClose:r,isPartOf:(e,o,n)=>rf(o,n)||rf(t,n),getAttachPoint:()=>a().getOrDie()}),Pb.config({find:e=>Ph.getState(e).bind((e=>Pb.getCurrent(e)))}),Jf.config({channels:{...Uh({isExtraPart:A}),...Wh({doReposition:IN})}})])}};const FN=e=>{const t=vN.getCoupled(e,"sandbox");IN(t)};const VN=()=>[ia("sandboxClasses",[]),Sy.field("sandboxBehaviours",[Pb,Jf,Ph,wy])];const jN=x([jr("dom"),jr("fetch"),ud("onOpen"),fd("onExecute"),ia("getHotspot",N.some),ia("getAnchorOverrides",x({})),lg(),_y("dropdownBehaviours",[Z_,vN,Qw,C_]),jr("toggleClass"),ia("eventOrder",{}),Qr("lazySink"),ia("matchWidth",false),ia("useMinWidth",false),Qr("role"),Qr("listRole")].concat(VN()));const ZN=x([tb({schema:[id(),ia("fakeFocus",false)],name:"menu",defaults:e=>({onExecute:e.onExecute})}),ON()]);const UN=(e,t,o,n)=>{const s=t=>xe(e.dom,"attributes").bind((e=>xe(e,t)));const r=e=>{Ph.getState(e).each((e=>{Bx.highlightPrimary(e)}))};const a=(t,o,s)=>BN(e,C,t,n,o,s);const c=e=>{const t=r;a(e,t,Ox.HighlightMenuAndItem).get(v)};const i={expand:e=>{if(!Z_.isOn(e)){a(e,v,Ox.HighlightNone).get(v)}},open:e=>{if(!Z_.isOn(e)){a(e,v,Ox.HighlightMenuAndItem).get(v)}},refetch:t=>{const o=vN.getExistingCoupled(t,"sandbox");return o.fold((()=>a(t,v,Ox.HighlightMenuAndItem).map(v)),(o=>MN(e,C,t,o,n,v,Ox.HighlightMenuAndItem).map(v)))},isOpen:Z_.isOn,close:e=>{if(Z_.isOn(e)){a(e,v,Ox.HighlightMenuAndItem).get(v)}},repositionMenus:e=>{if(Z_.isOn(e)){FN(e)}}};const l=(e,t)=>{Hc(e);return N.some(true)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Cy(e.dropdownBehaviours,[Z_.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),vN.config({others:{sandbox:t=>PN(e,t,{onOpen:()=>Z_.on(t),onClose:()=>Z_.off(t)})}}),Qw.config({mode:"special",onSpace:l,onEnter:l,onDown:(e,t)=>{if(qN.isOpen(e)){const t=vN.getCoupled(e,"sandbox");r(t)}else{qN.open(e)}return N.some(true)},onEscape:(e,t)=>{if(qN.isOpen(e)){qN.close(e);return N.some(true)}else{return N.none()}}}),C_.config({})]),events:q_(N.some(c)),eventOrder:{...e.eventOrder,[mc()]:["disabling","toggling","alloy.base.behaviour"]},apis:i,domModification:{attributes:{"aria-haspopup":e.listRole.getOr("true"),...e.role.fold((()=>({})),(e=>({role:e}))),...e.dom.tag==="button"?{type:s("type").getOr("button")}:{}}}}};const qN=Rb({name:"Dropdown",configFields:jN(),partFields:ZN(),factory:UN,apis:{open:(e,t)=>e.open(t),refetch:(e,t)=>e.refetch(t),expand:(e,t)=>e.expand(t),close:(e,t)=>e.close(t),isOpen:(e,t)=>e.isOpen(t),repositionMenus:(e,t)=>e.repositionMenus(t)}});const WN=e=>{switch(e.searchMode){case"no-search":{return{menuType:"normal"}}default:{return{menuType:"searchable",searchMode:e}}}};const $N=e=>{const t=wy.getValue(e);const o=zT(e).map(OT);qN.refetch(t).get((()=>{const e=vN.getCoupled(t,"sandbox");o.each((t=>zT(e).each((e=>ET(e,t)))))}))};const GN=(e,t)=>{KN(e).each((o=>{Fc(e,o.element,t.event.eventType,t.event.interactionEvent)}))};const KN=e=>Ph.getState(e).bind(Cv.getHighlighted).bind(Cv.getHighlighted);const YN=e=>Pi(e.element,NT)?N.some(e.element):Qu(e.element,"."+NT);const XN=(e,t,o)=>{TT(e).each((e=>{AT(e,o);const n=YN(t);n.each((t=>{so(t,"id").each((t=>to(e.element,"aria-controls",t)))}))}));to(o.element,"aria-selected","true")};const JN=(e,t,o)=>{to(o.element,"aria-selected","false")};const QN=e=>{TT(e).each((e=>C_.focus(e)))};const eM=e=>{const t=vN.getExistingCoupled(e,"sandbox");return t.bind(zT).map(OT).map((e=>e.fetchPattern)).getOr("")};var tM;(function(e){e[e["ContentFocus"]=0]="ContentFocus";e[e["UiFocus"]=1]="UiFocus"})(tM||(tM={}));const oM=(e,t,o,n,s)=>{const r=o.shared.providers;const a=e=>!s?e:{...e,shortcut:N.none(),icon:e.text.isSome()?N.none():e.icon};switch(e.type){case"menuitem":return cO(e).fold(UT,(e=>N.some(iN(a(e),t,r,n))));case"nestedmenuitem":return lO(e).fold(UT,(e=>N.some(lN(a(e),t,r,n,s))));case"togglemenuitem":return uO(e).fold(UT,(e=>N.some(dN(a(e),t,r,n))));case"separator":return CE(e).fold(UT,(e=>N.some(cN(e))));case"fancymenuitem":return rO(e).fold(UT,(e=>uN(e,o)));default:{console.error("Unknown item in general menu",e);return N.none()}}};const nM=(e,t,o,n,s,r,a)=>{const c=n===1;const i=!c||ZT(e);return Ee(j(e,(e=>{switch(e.type){case"separator":return zE(e).fold(UT,(e=>N.some(cN(e))));case"cardmenuitem":return JE(e).fold(UT,(e=>N.some(fN({...e,onAction:t=>{e.onAction(t);o(e.value,e.meta)}},s,r,{itemBehaviours:YO(e.meta,r,N.none()),cardText:{matchText:t,highlightOn:a}}))));case"autocompleteitem":default:return TE(e).fold(UT,(e=>N.some(aN(e,t,c,"normal",o,s,r,i))))}})))};const sM=(e,t,o,n,s,r)=>{const a=ZT(t);const c=Ee(j(t,(e=>{const t=e=>s?!Ce(e,"text"):a;const r=e=>oM(e,o,n,t(e),s);if(e.type==="nestedmenuitem"&&e.getSubmenuItems().length<=0){return r({...e,enabled:false})}else{return r(e)}})));const i=WN(r);const l=s?qT:WT;return l(e,a,c,1,i)};const rM=e=>Bx.singleData(e.value,e);const aM=(e,t,o,n)=>{const s=VD(t,n);const r=mT(n);return{data:rM({...e,movement:s,menuBehaviours:pO.unnamedEvents(t!=="auto"?[]:[oi(((e,t)=>{fO(e,4,r.item).each((({numColumns:t,numRows:o})=>{Qw.setGridSize(e,o,t)}))}))])}),menu:{markers:mT(n),fakeFocus:o===tM.ContentFocus}}};const cM=e=>Ng.create(Je.fromDom(e.startContainer),e.startOffset,Je.fromDom(e.endContainer),e.endOffset);const iM=(e,t)=>{const o=zd("autocompleter");const n=cs(false);const s=cs(false);const r=us();const a=Fu(Ix.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:o}},components:[],fireDismissalEventInstead:{},inlineBehaviours:wi([p_("dismissAutocompleter",[Wc(zc(),(()=>u())),Wc(Mc(),((t,o)=>{so(o.event.target,"id").each((t=>to(Je.fromDom(e.getBody()),"aria-activedescendant",t)))}))])]),lazySink:t.getSink}));const c=()=>Ix.isOpen(a);const i=s.get;const l=()=>{if(c()){Ix.hide(a);e.dom.remove(o,false);const t=Je.fromDom(e.getBody());so(t,"aria-owns").filter((e=>e===o)).each((()=>{ao(t,"aria-owns");ao(t,"aria-activedescendant")}))}};const d=()=>Ix.getContent(a).bind((e=>ae(e.components(),0)));const u=()=>e.execCommand("mceAutocompleterClose");const f=o=>{const s=de(o,(e=>N.from(e.columns))).getOr(1);return Q(o,(o=>{const a=o.items;return nM(a,o.matchText,((t,s)=>{const a={hide:()=>u(),reload:t=>{l();e.execCommand("mceAutocompleterReload",false,{fetchOptions:t})}};e.execCommand("mceAutocompleterRefreshActiveRange");r.get().each((e=>{n.set(true);o.onAction(a,e,t,s);n.set(false)}))}),s,Zz.BUBBLE_TO_SANDBOX,t,o.highlightOn)}))};const m=(t,o)=>{const n=de(t,(e=>N.from(e.columns))).getOr(1);Ix.showMenuAt(a,{anchor:{type:"selection",getSelection:()=>r.get().map(cM),root:Je.fromDom(e.getBody())}},aM(WT("autocompleter-value",true,o,n,{menuType:"normal"}),n,tM.ContentFocus,"normal"));d().each(Cv.highlightFirst)};const g=t=>{const n=f(t);if(n.length>0){m(t,n);to(Je.fromDom(e.getBody()),"aria-owns",o);if(!e.inline){p()}}else{l()}};const p=()=>{if(e.dom.get(o)){e.dom.remove(o,false)}const t=e.getDoc().documentElement;const n=e.selection.getNode();const s=Ul(a.element);fo(s,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:`${n.offsetTop}px`,left:`${n.offsetLeft}px`});e.dom.add(t,s.dom);Qu(s,'[role="menu"]').each((e=>{vo(e,"position");vo(e,"max-height")}))};e.on("AutocompleterStart",(({lookupData:e})=>{s.set(true);n.set(false);g(e)}));e.on("AutocompleterUpdate",(({lookupData:e})=>g(e)));e.on("AutocompleterUpdateActiveRange",(({range:e})=>r.set(e)));e.on("AutocompleterEnd",(()=>{l();s.set(false);n.set(false);r.clear()}));const h={cancelIfNecessary:u,isMenuOpen:c,isActive:i,isProcessingAction:n.get,getMenu:d};Vz.setup(h,e)};const lM={register:iM};const dM=(e,t,o)=>ef(e,t,o).isSome();const uM=(e,t)=>{let o=null;const n=(...n)=>{o=setTimeout((()=>{e.apply(null,n);o=null}),t)};const s=()=>{if(o!==null){clearTimeout(o);o=null}};return{cancel:s,schedule:n}};const fM=5;const mM=400;const gM=e=>{const t=e.raw;if(t.touches===undefined||t.touches.length!==1){return N.none()}return N.some(t.touches[0])};const pM=(e,t)=>{const o=Math.abs(e.clientX-t.x);const n=Math.abs(e.clientY-t.y);return o>fM||n>fM};const hM=e=>{const t=us();const o=cs(false);const n=uM((t=>{e.triggerEvent(hc(),t);o.set(true)}),mM);const s=e=>{gM(e).each((s=>{n.cancel();const r={x:s.clientX,y:s.clientY,target:e.target};n.schedule(e);o.set(false);t.set(r)}));return N.none()};const r=e=>{n.cancel();gM(e).each((e=>{t.on((o=>{if(pM(e,o)){t.clear()}}))}));return N.none()};const a=s=>{n.cancel();const r=e=>Ct(e.target,s.target);return t.get().filter(r).map((t=>{if(o.get()){s.prevent();return false}else{return e.triggerEvent(pc(),s)}}))};const c=za([{key:Va(),value:s},{key:ja(),value:r},{key:Za(),value:a}]);const i=(e,t)=>xe(c,t).bind((t=>t(e)));return{fireIfReady:i}};const yM=e=>{const t=e.raw;return t.which===Sv[0]&&!I(["input","textarea"],ut(e.target))&&!dM(e.target,'[contenteditable="true"]')};const bM=(e,t)=>{const o={stopBackspace:true,...t};const n=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"];const s=hM(o);const r=j(n.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(t=>Om(e,t,(e=>{s.fireIfReady(e,t).each((t=>{if(t){e.kill()}}));const n=o.triggerEvent(t,e);if(n){e.kill()}}))));const a=us();const c=Om(e,"paste",(e=>{s.fireIfReady(e,"paste").each((t=>{if(t){e.kill()}}));const t=o.triggerEvent("paste",e);if(t){e.kill()}a.set(setTimeout((()=>{o.triggerEvent(uc(),e)}),0))}));const i=Om(e,"keydown",(e=>{const t=o.triggerEvent("keydown",e);if(t){e.kill()}else if(o.stopBackspace&&yM(e)){e.prevent()}}));const l=Om(e,"focusin",(e=>{const t=o.triggerEvent("focusin",e);if(t){e.kill()}}));const d=us();const u=Om(e,"focusout",(e=>{const t=o.triggerEvent("focusout",e);if(t){e.kill()}d.set(setTimeout((()=>{o.triggerEvent(dc(),e)}),0))}));const f=()=>{Z(r,(e=>{e.unbind()}));i.unbind();l.unbind();u.unbind();c.unbind();a.on(clearTimeout);d.on(clearTimeout)};return{unbind:f}};const vM=(e,t)=>{const o=xe(e,"target").getOr(t);return cs(o)};const kM=(e,t)=>{const o=cs(false);const n=cs(false);const s=()=>{o.set(true)};const r=()=>{n.set(true)};return{stop:s,cut:r,isStopped:o.get,isCut:n.get,event:e,setSource:t.set,getSource:t.get}};const wM=e=>{const t=cs(false);const o=()=>{t.set(true)};return{stop:o,cut:v,isStopped:t.get,isCut:A,event:e,setSource:E("Cannot set source of a broadcasted event"),getSource:E("Cannot get source of a broadcasted event")}};const _M=va.generate([{stopped:[]},{resume:["element"]},{complete:[]}]);const xM=(e,t,o,n,s,r)=>{const a=e(t,n);const c=kM(o,s);return a.fold((()=>{r.logEventNoHandlers(t,n);return _M.complete()}),(e=>{const o=e.descHandler;const n=Jd(o);n(c);if(c.isStopped()){r.logEventStopped(t,e.element,o.purpose);return _M.stopped()}else if(c.isCut()){r.logEventCut(t,e.element,o.purpose);return _M.complete()}else{return At(e.element).fold((()=>{r.logNoParent(t,e.element,o.purpose);return _M.complete()}),(n=>{r.logEventResponse(t,e.element,o.purpose);return _M.resume(n)}))}}))};const CM=(e,t,o,n,s,r)=>xM(e,t,o,n,s,r).fold(D,(n=>CM(e,t,o,n,s,r)),A);const SM=(e,t,o,n,s)=>{const r=vM(o,n);return xM(e,t,o,n,r,s)};const zM=(e,t,o)=>{const n=wM(t);Z(e,(e=>{const t=e.descHandler;const o=Jd(t);o(n)}));return n.isStopped()};const TM=(e,t,o,n)=>EM(e,t,o,o.target,n);const EM=(e,t,o,n,s)=>{const r=vM(o,n);return CM(e,t,o,n,r,s)};const OM=(e,t)=>({element:e,descHandler:t});const AM=(e,t)=>({id:e,descHandler:t});const DM=()=>{const e={};const t=(t,o,n)=>{me(n,((n,s)=>{const r=e[s]!==undefined?e[s]:{};r[o]=Xd(n,t);e[s]=r}))};const o=(e,t)=>Md(t).bind((t=>xe(e,t))).map((e=>OM(t,e)));const n=t=>xe(e,t).map((e=>ke(e,((e,t)=>AM(t,e))))).getOr([]);const s=(t,n,s)=>xe(e,n).bind((e=>Na(s,(t=>o(e,t)),t)));const r=t=>{me(e,((e,o)=>{if(Ce(e,t)){delete e[t]}}))};return{registerId:t,unregisterId:r,filterByType:n,find:s}};const NM=()=>{const e=DM();const t={};const o=e=>{const t=e.element;return Md(t).getOrThunk((()=>Dd("uid-",e.element)))};const n=(e,o)=>{const n=t[o];if(n===e){r(e)}else{throw new Error('The tagId "'+o+'" is already used by: '+Wl(n.element)+"\nCannot use it for: "+Wl(e.element)+"\n"+"The conflicting element is"+(Xt(n.element)?" ":" not ")+"already in the DOM")}};const s=s=>{const r=o(s);if(Se(t,r)){n(s,r)}const a=[s];e.registerId(a,r,s.events);t[r]=s};const r=o=>{Md(o.element).each((o=>{delete t[o];e.unregisterId(o)}))};const a=t=>e.filterByType(t);const c=(t,o,n)=>e.find(t,o,n);const i=e=>xe(t,e);return{find:c,filter:a,register:s,unregister:r,getById:i}};const MM=e=>{const{attributes:t,...o}=e.dom;return{uid:e.uid,dom:{tag:"div",attributes:{role:"presentation",...t},...o},components:e.components,behaviours:xy(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}};const RM=Mb({name:"Container",factory:MM,configFields:[ia("components",[]),_y("containerBehaviours",[]),ia("events",{}),ia("domModification",{}),ia("eventOrder",{})]});const BM=e=>{const t=t=>At(e.element).fold(D,(e=>Ct(t,e)));const o=NM();const n=(e,n)=>o.find(t,e,n);const s=bM(e.element,{triggerEvent:(e,t)=>td(e,t.target,(o=>TM(n,e,t,o)))});const r={debugInfo:x("real"),triggerEvent:(e,t,o)=>{td(e,t,(s=>EM(n,e,o,t,s)))},triggerFocus:(e,t)=>{Md(e).fold((()=>{tm(e)}),(o=>{td(lc(),e,(o=>{SM(n,lc(),{originator:t,kill:v,prevent:v,target:e},e,o);return false}))}))},triggerEscape:(e,t)=>{r.triggerEvent("keydown",e.element,t.event)},getByUid:e=>p(e),getByDom:e=>h(e),build:Fu,buildOrPatch:Pu,addToGui:e=>{i(e)},removeFromGui:e=>{l(e)},addToWorld:e=>{a(e)},removeFromWorld:e=>{c(e)},broadcast:e=>{f(e)},broadcastOn:(e,t)=>{m(e,t)},broadcastEvent:(e,t)=>{g(e,t)},isConnected:D};const a=e=>{e.connect(r);if(!ht(e.element)){o.register(e);Z(e.components(),a);r.triggerEvent(vc(),e.element,{target:e.element})}};const c=e=>{if(!ht(e.element)){Z(e.components(),c);o.unregister(e)}e.disconnect()};const i=t=>{uh(e,t)};const l=e=>{gh(e)};const d=()=>{s.unbind();Fn(e.element)};const u=e=>{const t=o.filter(fc());Z(t,(t=>{const o=t.descHandler;const n=Jd(o);n(e)}))};const f=e=>{u({universal:true,data:e})};const m=(e,t)=>{u({universal:false,channels:e,data:t})};const g=(e,t)=>{const n=o.filter(e);return zM(n,t)};const p=e=>o.getById(e).fold((()=>hs.error(new Error('Could not find component with uid: "'+e+'" in system.'))),hs.value);const h=e=>{const t=Md(e).getOr("not found");return p(t)};a(e);return{root:e,element:e.element,destroy:d,add:i,remove:l,getByUid:p,getByDom:h,addToWorld:a,removeFromWorld:c,broadcast:f,broadcastOn:m,broadcastEvent:g}};const LM=(e,t)=>({dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:j(e.items,t.interpreter)});const HM=x([ia("prefix","form-field"),_y("fieldBehaviours",[Pb,wy])]);const IM=x([ob({schema:[jr("dom")],name:"label"}),ob({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[jr("text")],name:"aria-descriptor"}),eb({factory:{sketch:e=>{const t=Ca(e,["factory"]);return e.factory.sketch(t)}},schema:[jr("factory")],name:"field"})]);const PM=(e,t,o,n)=>{const s=Cy(e.fieldBehaviours,[Pb.config({find:t=>pb(t,e,"field")}),wy.config({store:{mode:"manual",getValue:e=>Pb.getCurrent(e).bind(wy.getValue),setValue:(e,t)=>{Pb.getCurrent(e).each((e=>{wy.setValue(e,t)}))}}})]);const r=jc([oi(((t,o)=>{const n=yb(t,e,["label","field","aria-descriptor"]);n.field().each((t=>{const o=zd(e.prefix);n.label().each((e=>{to(e.element,"for",o);to(t.element,"id",o)}));n["aria-descriptor"]().each((o=>{const n=zd(e.prefix);to(o.element,"id",n);to(t.element,"aria-describedby",n)}))}))}))]);const a={getField:t=>pb(t,e,"field"),getLabel:t=>pb(t,e,"label")};return{uid:e.uid,dom:e.dom,components:t,behaviours:s,events:r,apis:a}};const FM=Rb({name:"FormField",configFields:HM(),partFields:IM(),factory:PM,apis:{getField:(e,t)=>e.getField(t),getLabel:(e,t)=>e.getLabel(t)}});var VM=tinymce.util.Tools.resolve("tinymce.html.Entities");const jM=(e,t,o,n)=>{const s=UM(e,t,o,n);return FM.sketch(s)};const ZM=(e,t)=>jM(e,t,[],[]);const UM=(e,t,o,n)=>({dom:WM(o),components:e.toArray().concat([t]),fieldBehaviours:wi(n)});const qM=()=>WM([]);const WM=e=>({tag:"div",classes:["tox-form__group"].concat(e)});const $M=(e,t)=>FM.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Bu(t.translate(e))]});const GM=zd("form-component-change");const KM=zd("form-close");const YM=zd("form-cancel");const XM=zd("form-action");const JM=zd("form-submit");const QM=zd("form-block");const eR=zd("form-unblock");const tR=zd("form-tabchange");const oR=zd("form-resize");const nR=(e,t,o)=>{const n=e.label.map((e=>$M(e,t)));const s=t.icons();const r=e=>{var t;return(t=s[e])!==null&&t!==void 0?t:e};const a=e=>(t,o)=>{ef(o.event.target,"[data-collection-item-value]").each((n=>{e(t,o,n,no(n,"data-collection-item-value"))}))};const c=(o,n)=>{const s=j(n,(o=>{const n=xz.translate(o.text);const s=e.columns===1?`<div class="tox-collection__item-label">${n}</div>`:"";const a=`<div class="tox-collection__item-icon">${r(o.icon)}</div>`;const c={_:" "," - ":" ","-":" "};const i=n.replace(/\_| \- |\-/g,(e=>c[e]));const l=t.isDisabled()?" tox-collection__item--state-disabled":"";return`<div data-mce-tooltip="${i}" class="tox-collection__item${l}" tabindex="-1" data-collection-item-value="${VM.encodeAllRaw(o.value)}" aria-label="${i}">${a}${s}</div>`}));const a=e.columns!=="auto"&&e.columns>1?V(s,e.columns):[s];const c=j(a,(e=>`<div class="tox-collection__group">${e.join("")}</div>`));Fl(o.element,c.join(""))};const i=a(((o,n,s,r)=>{n.stop();if(!t.isDisabled()){Lc(o,XM,{name:e.name,value:r})}}));const l=[Wc(Ka(),a(((e,t,o)=>{tm(o)}))),Wc(oc(),i),Wc(pc(),i),Wc(Ya(),a(((e,t,o)=>{Qu(e.element,"."+tT).each((e=>{Hi(e,tT)}));Bi(o,tT)}))),Wc(Xa(),a((e=>{Qu(e.element,"."+tT).each((e=>{Hi(e,tT);om(e)}))}))),ri(a(((t,o,n,s)=>{Lc(t,XM,{name:e.name,value:s})})))];const d=(e,t)=>j(lp(e.element,".tox-collection__item"),t);const u=FM.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(e.columns!==1?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:C},behaviours:wi([sv.config({disabled:t.isDisabled,onDisabled:e=>{d(e,(e=>{Bi(e,"tox-collection__item--state-disabled");to(e,"aria-disabled",true)}))},onEnabled:e=>{d(e,(e=>{Hi(e,"tox-collection__item--state-disabled");ao(e,"aria-disabled")}))}}),wO(),m_.config({}),CS.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Qu(e.element,"."+tT+"[data-mce-tooltip]").each((o=>{so(o,"data-mce-tooltip").each((o=>{CS.setComponents(e,t.tooltips.getComponents({tooltipText:o}))}))}))}}),mode:"children-keyboard-focus",anchor:e=>({type:"node",node:Qu(e.element,"."+tT).orThunk((()=>Ku(".tox-collection__item"))),root:e.element,layouts:{onLtr:x([Pf,If,Rf,Lf,Bf,Hf]),onRtl:x([Pf,If,Rf,Lf,Bf,Hf])},bubble:tg(0,-2,{})})}),wy.config({store:{mode:"memory",initialValue:o.getOr([])},onSetValue:(t,o)=>{c(t,o);if(e.columns==="auto"){fO(t,5,"tox-collection__item").each((({numRows:e,numColumns:o})=>{Qw.setGridSize(t,e,o)}))}Bc(t,oR)}}),dS.config({}),Qw.config(jD(e.columns,"normal")),p_("collection-events",l)]),eventOrder:{[mc()]:["disabling","alloy.base.behaviour","collection-events"],[Ya()]:["collection-events","tooltipping"]}});const f=["tox-form__group--collection"];return jM(n,u,f,[])};const sR=["input","textarea"];const rR=e=>{const t=ut(e);return I(sR,t)};const aR=(e,t)=>{const o=t.getRoot(e).getOr(e.element);Hi(o,t.invalidClass);t.notify.each((t=>{if(rR(e.element)){to(e.element,"aria-invalid",false)}t.getContainer(e).each((e=>{Fl(e,t.validHtml)}));t.onValid(e)}))};const cR=(e,t,o,n)=>{const s=t.getRoot(e).getOr(e.element);Bi(s,t.invalidClass);t.notify.each((t=>{if(rR(e.element)){to(e.element,"aria-invalid",true)}t.getContainer(e).each((e=>{Fl(e,n)}));t.onInvalid(e,n)}))};const iR=(e,t,o)=>t.validator.fold((()=>TN.pure(hs.value(true))),(t=>t.validate(e)));const lR=(e,t,o)=>{t.notify.each((t=>{t.onValidate(e)}));return iR(e,t).map((n=>{if(e.getSystem().isConnected()){return n.fold((n=>{cR(e,t,o,n);return hs.error(n)}),(o=>{aR(e,t);return hs.value(o)}))}else{return hs.error("No longer in system")}}))};const dR=(e,t)=>{const o=t.getRoot(e).getOr(e.element);return Pi(o,t.invalidClass)};var uR=Object.freeze({__proto__:null,markValid:aR,markInvalid:cR,query:iR,run:lR,isInvalid:dR});const fR=(e,t)=>e.validator.map((o=>jc([Wc(o.onEvent,(o=>{lR(o,e,t).get(C)}))].concat(o.validateOnLoad?[oi((o=>{lR(o,e,t).get(v)}))]:[])))).getOr({});var mR=Object.freeze({__proto__:null,events:fR});var gR=[jr("invalidClass"),ia("getRoot",N.none),aa("notify",[ia("aria","alert"),ia("getContainer",N.none),ia("validHtml",""),ud("onValid"),ud("onInvalid"),ud("onValidate")]),aa("validator",[jr("validate"),ia("onEvent","input"),ia("validateOnLoad",true)])];const pR=xi({fields:gR,name:"invalidating",active:mR,apis:uR,extra:{validation:e=>t=>{const o=wy.getValue(t);return TN.pure(e(o))}}});const hR=()=>di({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}});const yR=()=>jc([Zc(ac(),D)]);var bR=Object.freeze({__proto__:null,events:yR,exhibit:hR});const vR=xi({fields:[],name:"unselecting",active:bR});const kR=(e,t)=>qN.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:wi([zO.button(t.providers.isDisabled),wO(),vR.config({}),dS.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:t.getSink,fetch:o=>TN.nu((t=>e.fetch(t))).map((n=>N.from(rM(Bs(PD(zd("menu-value"),n,(t=>{e.onItemAction(o,t)}),e.columns,e.presets,Zz.CLOSE_ON_EXECUTE,A,t.providers),{movement:VD(e.columns,e.presets)}))))),parts:{menu:hT(false,1,e.presets)}});const wR=zd("color-input-change");const _R=zd("color-swatch-change");const xR=zd("color-picker-cancel");const CR=(e,t,o,n)=>{const s=FM.parts.field({factory:_T,inputClasses:["tox-textfield"],data:n,onSetValue:e=>pR.run(e).get(v),inputBehaviours:wi([sv.config({disabled:t.providers.isDisabled}),wO(),dS.config({}),pR.config({invalidClass:"tox-textbox-field-invalid",getRoot:e=>Nt(e.element),notify:{onValid:e=>{const t=wy.getValue(e);Lc(e,wR,{color:t})}},validator:{validateOnLoad:false,validate:e=>{const t=wy.getValue(e);if(t.length===0){return TN.pure(hs.value(true))}else{const e=Je.fromTag("span");uo(e,"background-color",t);const o=ho(e,"background-color").fold((()=>hs.error("blah")),(e=>hs.value(t)));return TN.pure(o)}}}})]),selectOnFocus:false});const r=e.label.map((e=>$M(e,t.providers)));const a=(e,t)=>{Lc(e,_R,{value:t})};const c=(t,n)=>{i.getOpt(t).each((t=>{if(n==="custom"){o.colorPicker((o=>{o.fold((()=>Bc(t,xR)),(o=>{a(t,o);eD(e.storageKey,o)}))}),"#ffffff")}else if(n==="remove"){a(t,"")}else{a(t,n)}}))};const i=aS(kR({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:{onRtl:()=>[Bf,Rf,Pf],onLtr:()=>[Rf,Bf,Pf]},components:[],fetch:AD(o.getColors(e.storageKey),e.storageKey,o.hasCustomColors()),columns:o.getColorCols(e.storageKey),presets:"color",onItemAction:c},t));return FM.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:r.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[s,i.asSpec()]}]),fieldBehaviours:wi([p_("form-field-events",[Wc(wR,((t,o)=>{i.getOpt(t).each((e=>{uo(e.element,"background-color",o.event.color)}));Lc(t,GM,{name:e.name})})),Wc(_R,((e,t)=>{FM.getField(e).each((o=>{wy.setValue(o,t.event.value);Pb.getCurrent(e).each(C_.focus)}))})),Wc(xR,((e,t)=>{FM.getField(e).each((t=>{Pb.getCurrent(e).each(C_.focus)}))}))])])})};const SR=ob({schema:[jr("dom")],name:"label"});const zR=e=>ob({name:""+e+"-edge",overrides:t=>{const o=t.model.manager.edgeActions[e];return o.fold((()=>({})),(e=>({events:jc([$c(Va(),((t,o,n)=>e(t,n)),[t]),$c(qa(),((t,o,n)=>e(t,n)),[t]),$c(Wa(),((t,o,n)=>{if(n.mouseIsDown.get()){e(t,n)}}),[t])])})))}});const TR=zR("top-left");const ER=zR("top");const OR=zR("top-right");const AR=zR("right");const DR=zR("bottom-right");const NR=zR("bottom");const MR=zR("bottom-left");const RR=zR("left");const BR=eb({name:"thumb",defaults:x({dom:{styles:{position:"absolute"}}}),overrides:e=>({events:jc([Xc(Va(),e,"spectrum"),Xc(ja(),e,"spectrum"),Xc(Za(),e,"spectrum"),Xc(qa(),e,"spectrum"),Xc(Wa(),e,"spectrum"),Xc(Ga(),e,"spectrum")])})});const LR=e=>Fv(e.event);const HR=eb({schema:[Fr("mouseIsDown",(()=>cs(false)))],name:"spectrum",overrides:e=>{const t=e.model;const o=t.manager;const n=(t,n)=>o.getValueFromEvent(n).map((n=>o.setValueFrom(t,e,n)));return{behaviours:wi([Qw.config({mode:"special",onLeft:(t,n)=>o.onLeft(t,e,LR(n)),onRight:(t,n)=>o.onRight(t,e,LR(n)),onUp:(t,n)=>o.onUp(t,e,LR(n)),onDown:(t,n)=>o.onDown(t,e,LR(n))}),dS.config({}),C_.config({})]),events:jc([Wc(Va(),n),Wc(ja(),n),Wc(qa(),n),Wc(Wa(),((t,o)=>{if(e.mouseIsDown.get()){n(t,o)}}))])}}});var IR=[SR,RR,AR,ER,NR,TR,OR,MR,DR,BR,HR];const PR="slider.change.value";const FR=x(PR);const VR=e=>e.type.indexOf("touch")!==-1;const jR=e=>{const t=e.event.raw;if(VR(t)){const e=t;return e.touches!==undefined&&e.touches.length===1?N.some(e.touches[0]).map((e=>To(e.clientX,e.clientY))):N.none()}else{const e=t;return e.clientX!==undefined?N.some(e).map((e=>To(e.clientX,e.clientY))):N.none()}};const ZR="top",UR="right",qR="bottom",WR="left";const $R=e=>e.model.minX;const GR=e=>e.model.minY;const KR=e=>e.model.minX-1;const YR=e=>e.model.minY-1;const XR=e=>e.model.maxX;const JR=e=>e.model.maxY;const QR=e=>e.model.maxX+1;const eB=e=>e.model.maxY+1;const tB=(e,t,o)=>t(e)-o(e);const oB=e=>tB(e,XR,$R);const nB=e=>tB(e,JR,GR);const sB=e=>oB(e)/2;const rB=e=>nB(e)/2;const aB=(e,t)=>t?e.stepSize*e.speedMultiplier:e.stepSize;const cB=e=>e.snapToGrid;const iB=e=>e.snapStart;const lB=e=>e.rounded;const dB=(e,t)=>e[t+"-edge"]!==undefined;const uB=e=>dB(e,WR);const fB=e=>dB(e,UR);const mB=e=>dB(e,ZR);const gB=e=>dB(e,qR);const pB=e=>e.model.value.get();const hB=(e,t)=>({x:e,y:t});const yB=(e,t)=>{Lc(e,FR(),{value:t})};const bB=(e,t)=>{yB(e,hB(KR(t),YR(t)))};const vB=(e,t)=>{yB(e,YR(t))};const kB=(e,t)=>{yB(e,hB(sB(t),YR(t)))};const wB=(e,t)=>{yB(e,hB(QR(t),YR(t)))};const _B=(e,t)=>{yB(e,QR(t))};const xB=(e,t)=>{yB(e,hB(QR(t),rB(t)))};const CB=(e,t)=>{yB(e,hB(QR(t),eB(t)))};const SB=(e,t)=>{yB(e,eB(t))};const zB=(e,t)=>{yB(e,hB(sB(t),eB(t)))};const TB=(e,t)=>{yB(e,hB(KR(t),eB(t)))};const EB=(e,t)=>{yB(e,KR(t))};const OB=(e,t)=>{yB(e,hB(KR(t),rB(t)))};const AB=(e,t,o,n)=>{if(e<t){return e}else if(e>o){return o}else if(e===t){return t-1}else{return Math.max(t,e-n)}};const DB=(e,t,o,n)=>{if(e>o){return e}else if(e<t){return t}else if(e===o){return o+1}else{return Math.min(o,e+n)}};const NB=(e,t,o)=>Math.max(t,Math.min(o,e));const MB=(e,t,o,n,s)=>s.fold((()=>{const s=e-t;const r=Math.round(s/n)*n;return NB(t+r,t-1,o+1)}),(t=>{const s=(e-t)%n;const r=Math.round(s/n);const a=Math.floor((e-t)/n);const c=Math.floor((o-t)/n);const i=Math.min(c,a+r);const l=t+i*n;return Math.max(t,l)}));const RB=(e,t,o)=>Math.min(o,Math.max(e,t))-t;const BB=e=>{const{min:t,max:o,range:n,value:s,step:r,snap:a,snapStart:c,rounded:i,hasMinEdge:l,hasMaxEdge:d,minBound:u,maxBound:f,screenRange:m}=e;const g=l?t-1:t;const p=d?o+1:o;if(s<u){return g}else if(s>f){return p}else{const e=RB(s,u,f);const l=NB(e/m*n+t,g,p);if(a&&l>=t&&l<=o){return MB(l,t,o,r,c)}else if(i){return Math.round(l)}else{return l}}};const LB=e=>{const{min:t,max:o,range:n,value:s,hasMinEdge:r,hasMaxEdge:a,maxBound:c,maxOffset:i,centerMinEdge:l,centerMaxEdge:d}=e;if(s<t){return r?0:l}else if(s>o){return a?c:d}else{return(s-t)/n*i}};const HB="top",IB="right",PB="bottom",FB="left",VB="width",jB="height";const ZB=e=>e.element.dom.getBoundingClientRect();const UB=(e,t)=>e[t];const qB=e=>{const t=ZB(e);return UB(t,FB)};const WB=e=>{const t=ZB(e);return UB(t,IB)};const $B=e=>{const t=ZB(e);return UB(t,HB)};const GB=e=>{const t=ZB(e);return UB(t,PB)};const KB=e=>{const t=ZB(e);return UB(t,VB)};const YB=e=>{const t=ZB(e);return UB(t,jB)};const XB=(e,t,o)=>(e+t)/2-o;const JB=(e,t)=>{const o=ZB(e);const n=ZB(t);const s=UB(o,FB);const r=UB(o,IB);const a=UB(n,FB);return XB(s,r,a)};const QB=(e,t)=>{const o=ZB(e);const n=ZB(t);const s=UB(o,HB);const r=UB(o,PB);const a=UB(n,HB);return XB(s,r,a)};const eL=(e,t)=>{Lc(e,FR(),{value:t})};const tL=(e,t,o)=>{const n={min:$R(t),max:XR(t),range:oB(t),value:o,step:aB(t),snap:cB(t),snapStart:iB(t),rounded:lB(t),hasMinEdge:uB(t),hasMaxEdge:fB(t),minBound:qB(e),maxBound:WB(e),screenRange:KB(e)};return BB(n)};const oL=(e,t,o)=>{const n=tL(e,t,o);const s=n;eL(e,s);return n};const nL=(e,t)=>{const o=$R(t);eL(e,o)};const sL=(e,t)=>{const o=XR(t);eL(e,o)};const rL=(e,t,o,n)=>{const s=e>0?DB:AB;const r=s(pB(o),$R(o),XR(o),aB(o,n));eL(t,r);return N.some(r)};const aL=e=>(t,o,n)=>rL(e,t,o,n).map(D);const cL=e=>{const t=jR(e);return t.map((e=>e.left))};const iL=(e,t,o,n,s)=>{const r=0;const a=KB(e);const c=n.bind((t=>N.some(JB(t,e)))).getOr(r);const i=s.bind((t=>N.some(JB(t,e)))).getOr(a);const l={min:$R(t),max:XR(t),range:oB(t),value:o,hasMinEdge:uB(t),hasMaxEdge:fB(t),minBound:qB(e),minOffset:r,maxBound:WB(e),maxOffset:a,centerMinEdge:c,centerMaxEdge:i};return LB(l)};const lL=(e,t,o,n,s,r)=>{const a=iL(t,r,o,n,s);return qB(t)-qB(e)+a};const dL=(e,t,o,n)=>{const s=pB(o);const r=lL(e,n.getSpectrum(e),s,n.getLeftEdge(e),n.getRightEdge(e),o);const a=Ro(t.element)/2;uo(t.element,"left",r-a+"px")};const uL=aL(-1);const fL=aL(1);const mL=N.none;const gL=N.none;const pL={"top-left":N.none(),top:N.none(),"top-right":N.none(),right:N.some(_B),"bottom-right":N.none(),bottom:N.none(),"bottom-left":N.none(),left:N.some(EB)};var hL=Object.freeze({__proto__:null,setValueFrom:oL,setToMin:nL,setToMax:sL,findValueOfOffset:tL,getValueFromEvent:cL,findPositionOfValue:lL,setPositionFromValue:dL,onLeft:uL,onRight:fL,onUp:mL,onDown:gL,edgeActions:pL});const yL=(e,t)=>{Lc(e,FR(),{value:t})};const bL=(e,t,o)=>{const n={min:GR(t),max:JR(t),range:nB(t),value:o,step:aB(t),snap:cB(t),snapStart:iB(t),rounded:lB(t),hasMinEdge:mB(t),hasMaxEdge:gB(t),minBound:$B(e),maxBound:GB(e),screenRange:YB(e)};return BB(n)};const vL=(e,t,o)=>{const n=bL(e,t,o);const s=n;yL(e,s);return n};const kL=(e,t)=>{const o=GR(t);yL(e,o)};const wL=(e,t)=>{const o=JR(t);yL(e,o)};const _L=(e,t,o,n)=>{const s=e>0?DB:AB;const r=s(pB(o),GR(o),JR(o),aB(o,n));yL(t,r);return N.some(r)};const xL=e=>(t,o,n)=>_L(e,t,o,n).map(D);const CL=e=>{const t=jR(e);return t.map((e=>e.top))};const SL=(e,t,o,n,s)=>{const r=0;const a=YB(e);const c=n.bind((t=>N.some(QB(t,e)))).getOr(r);const i=s.bind((t=>N.some(QB(t,e)))).getOr(a);const l={min:GR(t),max:JR(t),range:nB(t),value:o,hasMinEdge:mB(t),hasMaxEdge:gB(t),minBound:$B(e),minOffset:r,maxBound:GB(e),maxOffset:a,centerMinEdge:c,centerMaxEdge:i};return LB(l)};const zL=(e,t,o,n,s,r)=>{const a=SL(t,r,o,n,s);return $B(t)-$B(e)+a};const TL=(e,t,o,n)=>{const s=pB(o);const r=zL(e,n.getSpectrum(e),s,n.getTopEdge(e),n.getBottomEdge(e),o);const a=xo(t.element)/2;uo(t.element,"top",r-a+"px")};const EL=N.none;const OL=N.none;const AL=xL(-1);const DL=xL(1);const NL={"top-left":N.none(),top:N.some(vB),"top-right":N.none(),right:N.none(),"bottom-right":N.none(),bottom:N.some(SB),"bottom-left":N.none(),left:N.none()};var ML=Object.freeze({__proto__:null,setValueFrom:vL,setToMin:kL,setToMax:wL,findValueOfOffset:bL,getValueFromEvent:CL,findPositionOfValue:zL,setPositionFromValue:TL,onLeft:EL,onRight:OL,onUp:AL,onDown:DL,edgeActions:NL});const RL=(e,t)=>{Lc(e,FR(),{value:t})};const BL=(e,t)=>({x:e,y:t});const LL=(e,t,o)=>{const n=tL(e,t,o.left);const s=bL(e,t,o.top);const r=BL(n,s);RL(e,r);return r};const HL=(e,t,o,n,s)=>{const r=e>0?DB:AB;const a=t?pB(n).x:r(pB(n).x,$R(n),XR(n),aB(n,s));const c=!t?pB(n).y:r(pB(n).y,GR(n),JR(n),aB(n,s));RL(o,BL(a,c));return N.some(a)};const IL=(e,t)=>(o,n,s)=>HL(e,t,o,n,s).map(D);const PL=(e,t)=>{const o=$R(t);const n=GR(t);RL(e,BL(o,n))};const FL=(e,t)=>{const o=XR(t);const n=JR(t);RL(e,BL(o,n))};const VL=e=>jR(e);const jL=(e,t,o,n)=>{const s=pB(o);const r=lL(e,n.getSpectrum(e),s.x,n.getLeftEdge(e),n.getRightEdge(e),o);const a=zL(e,n.getSpectrum(e),s.y,n.getTopEdge(e),n.getBottomEdge(e),o);const c=Ro(t.element)/2;const i=xo(t.element)/2;uo(t.element,"left",r-c+"px");uo(t.element,"top",a-i+"px")};const ZL=IL(-1,false);const UL=IL(1,false);const qL=IL(-1,true);const WL=IL(1,true);const $L={"top-left":N.some(bB),top:N.some(kB),"top-right":N.some(wB),right:N.some(xB),"bottom-right":N.some(CB),bottom:N.some(zB),"bottom-left":N.some(TB),left:N.some(OB)};var GL=Object.freeze({__proto__:null,setValueFrom:LL,setToMin:PL,setToMax:FL,getValueFromEvent:VL,setPositionFromValue:jL,onLeft:ZL,onRight:UL,onUp:qL,onDown:WL,edgeActions:$L});const KL=[ia("stepSize",1),ia("speedMultiplier",10),ia("onChange",v),ia("onChoose",v),ia("onInit",v),ia("onDragStart",v),ia("onDragEnd",v),ia("snapToGrid",false),ia("rounded",true),Qr("snapStart"),Zr("model",Hr("mode",{x:[ia("minX",0),ia("maxX",100),Fr("value",(e=>cs(e.mode.minX))),jr("getInitialValue"),pd("manager",hL)],y:[ia("minY",0),ia("maxY",100),Fr("value",(e=>cs(e.mode.minY))),jr("getInitialValue"),pd("manager",ML)],xy:[ia("minX",0),ia("maxX",100),ia("minY",0),ia("maxY",100),Fr("value",(e=>cs({x:e.mode.minX,y:e.mode.minY}))),jr("getInitialValue"),pd("manager",GL)]})),_y("sliderBehaviours",[Qw,wy]),Fr("mouseIsDown",(()=>cs(false)))];const YL=(e,t,o,n)=>{const s=t=>hb(t,e,"thumb");const r=t=>hb(t,e,"spectrum");const a=t=>pb(t,e,"left-edge");const c=t=>pb(t,e,"right-edge");const i=t=>pb(t,e,"top-edge");const l=t=>pb(t,e,"bottom-edge");const d=e.model;const u=d.manager;const f=(t,o)=>{u.setPositionFromValue(t,o,e,{getLeftEdge:a,getRightEdge:c,getTopEdge:i,getBottomEdge:l,getSpectrum:r})};const m=(e,t)=>{d.value.set(t);const o=s(e);f(e,o)};const g=(t,o)=>{m(t,o);const n=s(t);e.onChange(t,n,o);return N.some(true)};const p=t=>{u.setToMin(t,e)};const h=t=>{u.setToMax(t,e)};const y=t=>{const o=()=>{pb(t,e,"thumb").each((o=>{const n=d.value.get();e.onChoose(t,o,n)}))};const n=e.mouseIsDown.get();e.mouseIsDown.set(false);if(n){o()}};const b=(t,o)=>{o.stop();e.mouseIsDown.set(true);e.onDragStart(t,s(t))};const v=(t,o)=>{o.stop();e.onDragEnd(t,s(t));y(t)};const k=t=>{pb(t,e,"spectrum").map(Qw.focusIn)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Cy(e.sliderBehaviours,[Qw.config({mode:"special",focusIn:k}),wy.config({store:{mode:"manual",getValue:e=>d.value.get(),setValue:m}}),Jf.config({channels:{[jh()]:{onReceive:y}}})]),events:jc([Wc(FR(),((e,t)=>{g(e,t.event.value)})),oi(((t,o)=>{const n=d.getInitialValue();d.value.set(n);const a=s(t);f(t,a);const c=r(t);e.onInit(t,a,c,d.value.get())})),Wc(Va(),b),Wc(Za(),v),Wc(qa(),((e,t)=>{k(e);b(e,t)})),Wc(Ga(),v)]),apis:{resetToMin:p,resetToMax:h,setValue:m,refresh:f},domModification:{styles:{position:"relative"}}}};const XL=Rb({name:"Slider",configFields:KL,partFields:IR,factory:YL,apis:{setValue:(e,t,o)=>{e.setValue(t,o)},resetToMin:(e,t)=>{e.resetToMin(t)},resetToMax:(e,t)=>{e.resetToMax(t)},refresh:(e,t)=>{e.refresh(t)}}});const JL=zd("rgb-hex-update");const QL=zd("slider-update");const eH=zd("palette-update");const tH=(e,t)=>{const o=XL.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}});const n=XL.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return XL.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:false,model:{mode:"y",getInitialValue:x(0)},components:[o,n],sliderBehaviours:wi([C_.config({})]),onChange:(e,t,o)=>{to(e.element,"aria-valuenow",Math.floor(360-o*3.6));Lc(e,QL,{value:o})}})};const oH="form";const nH=[_y("formBehaviours",[wy])];const sH=e=>"<alloy.field."+e+">";const rH=e=>{const t=(()=>{const e=[];const t=(t,o)=>{e.push(t);return db(oH,sH(t),o)};return{field:t,record:x(e)}})();const o=e(t);const n=t.record();const s=j(n,(e=>eb({name:e,pname:sH(e)})));return Tb(oH,nH,s,cH,o)};const aH=(e,t)=>e.fold((()=>hs.error(t)),hs.value);const cH=(e,t)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Cy(e.formBehaviours,[wy.config({store:{mode:"manual",getValue:t=>{const o=bb(t,e);return ge(o,((e,t)=>e().bind((e=>{const o=Pb.getCurrent(e);return aH(o,new Error(`Cannot find a current component to extract the value from for form part '${t}': `+Wl(e.element)))})).map(wy.getValue)))},setValue:(t,o)=>{me(o,((o,n)=>{pb(t,e,n).each((e=>{Pb.getCurrent(e).each((e=>{wy.setValue(e,o)}))}))}))}}})]),apis:{getField:(t,o)=>pb(t,e,o).bind(Pb.getCurrent)}});const iH={getField:jd(((e,t,o)=>e.getField(t,o))),sketch:rH};const lH=zd("valid-input");const dH=zd("invalid-input");const uH=zd("validating-input");const fH="colorcustom.rgb.";const mH=(e,t,o,n)=>{const s=(o,n)=>pR.config({invalidClass:t("invalid"),notify:{onValidate:e=>{Lc(e,uH,{type:o})},onValid:e=>{Lc(e,lH,{type:o,value:wy.getValue(e)})},onInvalid:e=>{Lc(e,dH,{type:o,value:wy.getValue(e)})}},validator:{validate:t=>{const o=wy.getValue(t);const s=n(o)?hs.value(true):hs.error(e("aria.input.invalid"));return TN.pure(s)},validateOnLoad:false}});const r=(o,n,r,a,c)=>{const i=e(fH+"range");const l=FM.parts.label({dom:{tag:"label",attributes:{"aria-label":a}},components:[Bu(r)]});const d=FM.parts.field({data:c,factory:_T,inputAttributes:{type:"text",...n==="hex"?{"aria-live":"polite"}:{}},inputClasses:[t("textfield")],inputBehaviours:wi([s(n,o),dS.config({})]),onSetValue:e=>{if(pR.isInvalid(e)){const t=pR.run(e);t.get(v)}}});const u=[l,d];const f=n!=="hex"?[FM.parts["aria-descriptor"]({text:i})]:[];const m=u.concat(f);return{dom:{tag:"div",attributes:{role:"presentation"}},components:m}};const a=(e,t)=>{const o=mA(t);iH.getField(e,"hex").each((t=>{if(!C_.isFocused(t)){wy.setValue(e,{hex:o.value})}}));return o};const c=(e,t)=>{const o=t.red;const n=t.green;const s=t.blue;wy.setValue(e,{red:o,green:n,blue:s})};const i=aS({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});const l=(e,t)=>{i.getOpt(e).each((e=>{uo(e.element,"background-color","#"+t.value)}))};const d=()=>{const s={red:cs(N.some(255)),green:cs(N.some(255)),blue:cs(N.some(255)),hex:cs(N.some("ffffff"))};const d=(e,t)=>{const o=_A(t);c(e,o);g(o)};const u=e=>s[e].get();const f=(e,t)=>{s[e].set(t)};const m=()=>u("red").bind((e=>u("green").bind((t=>u("blue").map((o=>vA(e,t,o,1)))))));const g=e=>{const t=e.red;const o=e.green;const n=e.blue;f("red",N.some(t));f("green",N.some(o));f("blue",N.some(n))};const p=(e,t)=>{const o=t.event;if(o.type!=="hex"){f(o.type,N.none())}else{n(e)}};const h=(e,t)=>{o(e);const n=sA(t);f("hex",N.some(n.value));const s=_A(n);c(e,s);g(s);Lc(e,JL,{hex:n});l(e,n)};const y=(e,t,o)=>{const n=parseInt(o,10);f(t,N.some(n));m().each((t=>{const o=a(e,t);Lc(e,JL,{hex:o});l(e,o)}))};const b=e=>e.type==="hex";const v=(e,t)=>{const o=t.event;if(b(o)){h(e,o.value)}else{y(e,o.type,o.value)}};const k=t=>({label:e(fH+t+".label"),description:e(fH+t+".description")});const w=k("red");const _=k("green");const x=k("blue");const C=k("hex");return Bs(iH.sketch((o=>({dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[o.field("red",FM.sketch(r(kA,"red",w.label,w.description,255))),o.field("green",FM.sketch(r(kA,"green",_.label,_.description,255))),o.field("blue",FM.sketch(r(kA,"blue",x.label,x.description,255))),o.field("hex",FM.sketch(r(cA,"hex",C.label,C.description,"ffffff"))),i.asSpec()],formBehaviours:wi([pR.config({invalidClass:t("form-invalid")}),p_("rgb-form-events",[Wc(lH,v),Wc(dH,p),Wc(uH,p)])])}))),{apis:{updateHex:(e,t)=>{wy.setValue(e,{hex:t.value});d(e,t);l(e,t)}}})};const u=Mb({factory:d,name:"RgbForm",configFields:[],apis:{updateHex:(e,t,o)=>{e.updateHex(t,o)}},extraApis:{}});return u};const gH=(e,t)=>{const o=XL.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}});const n=XL.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:`<div class=${t("sv-palette-inner-thumb")} role="presentation"></div>`}});const s=(e,t)=>{const{width:o,height:n}=e;const s=e.getContext("2d");if(s===null){return}s.fillStyle=t;s.fillRect(0,0,o,n);const r=s.createLinearGradient(0,0,o,0);r.addColorStop(0,"rgba(255,255,255,1)");r.addColorStop(1,"rgba(255,255,255,0)");s.fillStyle=r;s.fillRect(0,0,o,n);const a=s.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)");a.addColorStop(1,"rgba(0,0,0,1)");s.fillStyle=a;s.fillRect(0,0,o,n)};const r=(e,t)=>{const o=e.components()[0].element.dom;const n=tD(t,100,100);const r=wA(n);s(o,SA(r))};const a=(t,o)=>{const n=oD(_A(o));XL.setValue(t,{x:n.saturation,y:100-n.value});to(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",n.saturation,n.value]))};const c=r=>{const a=x({x:0,y:0});const c=(t,o,n)=>{if(!y(n)){to(t.element,"aria-valuetext",e(["Saturation {0}%, Brightness {1}%",Math.floor(n.x),Math.floor(100-n.y)]))}Lc(t,eH,{value:n})};const i=(e,t,o,n)=>{s(o.element.dom,SA(zA))};const l=wi([Pb.config({find:N.some}),C_.config({})]);return XL.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":e(["Saturation {0}%, Brightness {1}%",0,0])},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:a},rounded:false,components:[o,n],onChange:c,onInit:i,sliderBehaviours:l})};const i=Mb({factory:c,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:(e,t,o)=>{r(t,o)},setThumb:(e,t,o)=>{a(t,o)}},extraApis:{}});return i};const pH=(e,t)=>{const o=o=>{const n=mH(e,t,o.onValidHex,o.onInvalidHex);const s=gH(e,t);const r=e=>(100-e)/100*360;const a=e=>100-e/360*100;const c={paletteRgba:cs(zA),paletteHue:cs(0)};const i=aS(tH(e,t));const l=aS(s.sketch({}));const d=aS(n.sketch({}));const u=(e,t,o)=>{l.getOpt(e).each((e=>{s.setHue(e,o)}))};const f=(e,t)=>{d.getOpt(e).each((e=>{n.updateHex(e,t)}))};const m=(e,t,o)=>{i.getOpt(e).each((e=>{XL.setValue(e,a(o))}))};const g=(e,t)=>{l.getOpt(e).each((e=>{s.setThumb(e,t)}))};const p=(e,t)=>{const o=_A(e);c.paletteRgba.set(o);c.paletteHue.set(t)};const h=(e,t,o,n)=>{p(t,o);Z(n,(n=>{n(e,t,o)}))};const y=()=>{const e=[f];return(t,o)=>{const n=o.event.value;const s=c.paletteHue.get();const r=tD(s,n.x,100-n.y);const a=sD(r);h(t,a,s,e)}};const b=()=>{const e=[u,f];return(t,o)=>{const n=r(o.event.value);const s=c.paletteRgba.get();const a=oD(s);const i=tD(n,a.saturation,a.value);const l=sD(i);h(t,l,n,e)}};const v=()=>{const e=[u,m,g];return(t,o)=>{const n=o.event.hex;const s=nD(n);h(t,n,s.hue,e)}};return{uid:o.uid,dom:o.dom,components:[l.asSpec(),i.asSpec(),d.asSpec()],behaviours:wi([p_("colour-picker-events",[Wc(JL,v()),Wc(eH,y()),Wc(QL,b())]),Pb.config({find:e=>d.getOpt(e)}),Qw.config({mode:"acyclic"})])}};const n=Mb({name:"ColourPicker",configFields:[jr("dom"),ia("onValidHex",v),ia("onInvalidHex",v)],factory:o});return n};const hH=()=>Pb.config({find:N.some});const yH=e=>Pb.config({find:e.getOpt});const bH=e=>Pb.config({find:t=>Ht(t.element,e).bind((e=>t.getSystem().getByDom(e).toOptional()))});const vH={self:hH,memento:yH,childAt:bH};const kH=mr([ia("preprocess",C),ia("postprocess",C)]);const wH=(e,t)=>{const o=Br("RepresentingConfigs.memento processors",kH,t);return wy.config({store:{mode:"manual",getValue:t=>{const n=e.get(t);const s=wy.getValue(n);return o.postprocess(s)},setValue:(t,n)=>{const s=o.preprocess(n);const r=e.get(t);wy.setValue(r,s)}}})};const _H=(e,t,o)=>wy.config({store:{mode:"manual",...e.map((e=>({initialValue:e}))).getOr({}),getValue:t,setValue:o}});const xH=(e,t,o)=>_H(e,(e=>t(e.element)),((e,t)=>o(e.element,t)));const CH=e=>xH(e,Pl,Fl);const SH=e=>wy.config({store:{mode:"memory",initialValue:e}});const zH={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"};const TH=e=>t=>{if(c(t)){return e.translate(zH[t])}else{return e.translate(t)}};const EH=(e,t,o)=>{const n=e=>"tox-"+e;const s=pH(TH(t),n);const r=e=>{Lc(e,XM,{name:"hex-valid",value:true})};const a=e=>{Lc(e,XM,{name:"hex-valid",value:false})};const c=aS(s.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:r,onInvalidHex:a}));return{dom:{tag:"div"},components:[c.asSpec()],behaviours:wi([_H(o,(e=>{const t=c.get(e);const o=Pb.getCurrent(t);const n=o.bind((e=>{const t=wy.getValue(e);return t.hex}));return n.map((e=>"#"+He(e,"#"))).getOr("")}),((e,t)=>{const o=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/;const n=N.from(o.exec(t)).bind((e=>ae(e,1)));const s=c.get(e);const r=Pb.getCurrent(s);r.fold((()=>{console.log("Can not find form")}),(e=>{wy.setValue(e,{hex:n.getOr("")});iH.getField(e,"hex").each((e=>{Bc(e,ec())}))}))})),vH.self()])}};var OH=tinymce.util.Tools.resolve("tinymce.Resource");const AH=e=>Ce(e,"init");const DH=e=>{const t=us();const o=aS({dom:{tag:e.tag}});const n=us();const s=!AH(e)&&e.onFocus.isSome()?[C_.config({onFocus:t=>{e.onFocus.each((e=>{e(t.element.dom)}))}}),dS.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:wi([p_("custom-editor-events",[oi((s=>{o.getOpt(s).each((o=>{(AH(e)?e.init(o.element.dom):OH.load(e.scriptId,e.scriptUrl).then((t=>t(o.element.dom,e.settings)))).then((e=>{n.on((t=>{e.setValue(t)}));n.clear();t.set(e)}))}))}))]),_H(N.none(),(()=>t.get().fold((()=>n.get().getOr("")),(e=>e.getValue()))),((e,o)=>{t.get().fold((()=>n.set(o)),(e=>e.setValue(o)))})),vH.self()].concat(s)),components:[o.asSpec()]}};var NH=tinymce.util.Tools.resolve("tinymce.util.Tools");const MH=(e,t)=>{const o=NH.explode(t.getOption("images_file_types"));const n=e=>P(o,(t=>Ve(e.name.toLowerCase(),`.${t.toLowerCase()}`)));return W(le(e),n)};const RH=(e,t,o)=>{const n=(e,t)=>{t.stop()};const s=e=>(t,o)=>{Z(e,(e=>{e(t,o)}))};const r=(e,t)=>{var o;if(!sv.isDisabled(e)){const n=t.event.raw;c(e,(o=n.dataTransfer)===null||o===void 0?void 0:o.files)}};const a=(e,t)=>{const o=t.event.raw.target;c(e,o.files)};const c=(o,n)=>{if(n){wy.setValue(o,MH(n,t));Lc(o,GM,{name:e.name})}};const i=aS({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:wi([p_("input-file-events",[Qc(oc()),Qc(pc())])])});const l=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:wi([SH(o.getOr([])),vH.self(),sv.config({}),Z_.config({toggleClass:"dragenter",toggleOnExecute:false}),p_("dropzone-events",[Wc("dragenter",s([n,Z_.toggle])),Wc("dragleave",s([n,Z_.toggle])),Wc("dragover",n),Wc("drop",s([n,r])),Wc(tc(),a)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Bu(t.translate("Drop an image here"))]},oS.sketch({dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Bu(t.translate("Browse for an image")),i.asSpec()],action:e=>{const t=i.get(e);t.element.dom.click()},buttonBehaviours:wi([dS.config({}),zO.button(t.isDisabled),wO()])})]}]});const d=e.label.map((e=>$M(e,t)));const u=FM.parts.field({factory:{sketch:l}});return jM(d,u,["tox-form__group--stretched"],[])};const BH=(e,t)=>({dom:{tag:"div",classes:["tox-form__grid",`tox-form__grid--${e.columns}col`]},components:j(e.items,t.interpreter)});const LH=(e,t)=>{let o=null;let n=null;const s=()=>{if(!u(o)){clearTimeout(o);o=null;n=null}};const r=(...s)=>{n=s;if(u(o)){o=setTimeout((()=>{const t=n;o=null;n=null;e.apply(null,t)}),t)}};return{cancel:s,throttle:r}};const HH=(e,t)=>{let o=null;const n=()=>{if(!u(o)){clearTimeout(o);o=null}};const s=(...n)=>{if(u(o)){o=setTimeout((()=>{o=null;e.apply(null,n)}),t)}};return{cancel:n,throttle:s}};const IH=(e,t)=>{let o=null;const n=()=>{if(!u(o)){clearTimeout(o);o=null}};const s=(...s)=>{n();o=setTimeout((()=>{o=null;e.apply(null,s)}),t)};return{cancel:n,throttle:s}};const PH=zd("alloy-fake-before-tabstop");const FH=zd("alloy-fake-after-tabstop");const VH=e=>({dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:wi([C_.config({ignore:true}),dS.config({})])});const jH=(e,t)=>({dom:{tag:"div",classes:["tox-navobj",...e.getOr([])]},components:[VH([PH]),t,VH([FH])],behaviours:wi([vH.childAt(1)])});const ZH=(e,t)=>{Lc(e,Ja(),{raw:{which:9,shiftKey:t}})};const UH=(e,t)=>{const o=t.element;if(Pi(o,PH)){ZH(e,true)}else if(Pi(o,FH)){ZH(e,false)}};const qH=e=>dM(e,["."+PH,"."+FH].join(","),A);const WH=zd("update-dialog");const $H=zd("update-title");const GH=zd("update-body");const KH=zd("update-footer");const YH=zd("body-send-message");const XH=zd("dialog-focus-shifted");const JH=Sn().browser;const QH=JH.isSafari();const eI=JH.isFirefox();const tI=QH||eI;const oI=JH.isChromium();const nI=({scrollTop:e,scrollHeight:t,clientHeight:o})=>Math.ceil(e)+o>=t;const sI=(e,t)=>e.scrollTo(0,t==="bottom"?99999999:t);const rI=(e,t)=>{const o=e.body;return N.from(!/^<!DOCTYPE (html|HTML)/.test(t)&&(!oI&&!QH||p(o)&&(o.scrollTop!==0||Math.abs(o.scrollHeight-o.clientHeight)>1))?o:e.documentElement)};const aI=(e,t,o)=>{const n=e.dom;N.from(n.contentDocument).fold(o,(e=>{let o=0;const s=rI(e,t).map((e=>{o=e.scrollTop;return e})).forall(nI);const r=()=>{const e=n.contentWindow;if(p(e)){if(s){sI(e,"bottom")}else if(!s&&tI&&o!==0){sI(e,o)}}};if(QH){n.addEventListener("load",r,{once:true})}e.open();e.write(t);e.close();if(!QH){r()}}))};const cI=Me(tI,QH?500:200);const iI=cI.map((e=>LH(aI,e)));const lI=(e,t)=>{const o=cs(e.getOr(""));return{getValue:e=>o.get(),setValue:(e,n)=>{if(o.get()!==n){const o=e.element;const s=()=>to(o,"srcdoc",n);if(t){iI.fold(x(aI),(e=>e.throttle))(o,n,s)}else{s()}}o.set(n)}}};const dI=(e,t,o)=>{const n="tox-dialog__iframe";const s=e.transparent?[]:[`${n}--opaque`];const r=e.border?[`tox-navobj-bordered`]:[];const a={...e.label.map((e=>({title:e}))).getOr({}),...o.map((e=>({srcdoc:e}))).getOr({}),...e.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}};const c=lI(o,e.streamContent);const i=e.label.map((e=>$M(e,t)));const l=e=>jH(N.from(r),{uid:e.uid,dom:{tag:"iframe",attributes:a,classes:[n,...s]},behaviours:wi([dS.config({}),C_.config({}),_H(o,c.getValue,c.setValue),Jf.config({channels:{[XH]:{onReceive:(e,t)=>{t.newFocus.each((t=>{Nt(e.element).each((o=>{const n=Ct(e.element,t)?Bi:Hi;n(o,"tox-navobj-bordered-focus")}))}))}}}})])});const d=FM.parts.field({factory:{sketch:l}});return jM(i,d,["tox-form__group--stretched"],[])};const uI=e=>new Promise(((t,o)=>{const n=()=>{r();t(e)};const s=[Om(e,"load",n),Om(e,"error",(()=>{r();o("Unable to load data from image: "+e.dom.src)}))];const r=()=>Z(s,(e=>e.unbind()));if(e.dom.complete){n()}}));const fI=(e,t,o,n,s)=>{const r=o*s;const a=n*s;const c=Math.max(0,e/2-r/2);const i=Math.max(0,t/2-a/2);return{left:c.toString()+"px",top:i.toString()+"px",width:r.toString()+"px",height:a.toString()+"px"}};const mI=(e,t,o)=>{const n=Ro(e);const s=xo(e);return Math.min(n/t,s/o,1)};const gI=(e,t)=>{const o=cs(t.getOr({url:""}));const n=aS({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:t.map((e=>({src:e.url}))).getOr({})}});const s=aS({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[n.asSpec()]});const r=(e,t)=>{const r={url:t.url};t.zoom.each((e=>r.zoom=e));t.cachedWidth.each((e=>r.cachedWidth=e));t.cachedHeight.each((e=>r.cachedHeight=e));o.set(r);const a=()=>{const{cachedWidth:t,cachedHeight:o,zoom:n}=r;if(!m(t)&&!m(o)){if(m(n)){const n=mI(e.element,t,o);r.zoom=n}const a=fI(Ro(e.element),xo(e.element),t,o,r.zoom);s.getOpt(e).each((e=>{fo(e.element,a)}))}};n.getOpt(e).each((o=>{const n=o.element;if(t.url!==no(n,"src")){to(n,"src",t.url);Hi(e.element,"tox-imagepreview__loaded")}a();uI(n).then((t=>{if(e.getSystem().isConnected()){Bi(e.element,"tox-imagepreview__loaded");r.cachedWidth=t.dom.naturalWidth;r.cachedHeight=t.dom.naturalHeight;a()}}))}))};const a={};e.height.each((e=>a.height=e));const c=t.map((e=>({url:e.url,zoom:N.from(e.zoom),cachedWidth:N.from(e.cachedWidth),cachedHeight:N.from(e.cachedHeight)})));return{dom:{tag:"div",classes:["tox-imagepreview"],styles:a,attributes:{role:"presentation"}},components:[s.asSpec()],behaviours:wi([vH.self(),_H(c,(()=>o.get()),r)])}};const pI=(e,t,o)=>{const n="tox-label";const s=e.align==="center"?[`${n}--center`]:[];const r=e.align==="end"?[`${n}--end`]:[];const a=aS({dom:{tag:"label",classes:[n,...s,...r]},components:[Bu(t.providers.translate(e.label))]});const c=j(e.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[a.asSpec(),...c],behaviours:wi([vH.self(),m_.config({}),CH(N.none()),Qw.config({mode:"acyclic"}),p_("label",[oi((t=>{e.for.each((e=>{o(e).each((e=>{a.getOpt(t).each((t=>{var o;const n=(o=no(e.element,"id"))!==null&&o!==void 0?o:zd("form-field");to(e.element,"id",n);to(t.element,"for",n)}))}))}))}))])])}};const hI=zd("toolbar.button.execute");const yI=e=>ri(((t,o)=>{TO(e,t)((o=>{Lc(t,hI,{buttonApi:o});e.onAction(o)}))}));const bI=zd("common-button-display-events");const vI={[mc()]:["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"],[Cc()]:["toolbar-button-events",bI],[Sc()]:["toolbar-button-events","dropdown-events","tooltipping"],[qa()]:["focusing","alloy.base.behaviour",bI]};const kI=e=>uo(e.element,"width",go(e.element,"width"));const wI=(e,t,o)=>Rz(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:o},t);const _I=(e,t)=>wI(e,t,[]);const xI=(e,t)=>wI(e,t,[m_.config({})]);const CI=(e,t,o)=>({dom:{tag:"span",classes:[`${t}__select-label`]},components:[Bu(o.translate(e))],behaviours:wi([m_.config({})])});const SI=zd("update-menu-text");const zI=zd("update-menu-icon");const TI=(e,t,o,n)=>{const s=cs(v);const r=e.text.map((e=>aS(CI(e,t,o.providers))));const a=e.icon.map((e=>aS(xI(e,o.providers.icons))));const c=(e,t)=>{const o=wy.getValue(e);C_.focus(o);Lc(o,"keydown",{raw:t.event.raw});qN.close(o);return N.some(true)};const i=e.role.fold((()=>({})),(e=>({role:e})));const l=N.from(e.listRole).map((e=>({listRole:e}))).getOr({});const d=e.ariaLabel.fold((()=>({})),(e=>{const t=o.providers.translate(e);return{"aria-label":t}}));const u=Rz("chevron-down",{tag:"div",classes:[`${t}__select-chevron`]},o.providers.icons);const f=zd("common-button-display-events");const m="dropdown-events";const g=aS(qN.sketch({...e.uid?{uid:e.uid}:{},...i,...l,dom:{tag:"button",classes:[t,`${t}--select`].concat(j(e.classes,(e=>`${t}--${e}`))),attributes:{...d,...p(n)?{"data-mce-name":n}:{}}},components:NO([a.map((e=>e.asSpec())),r.map((e=>e.asSpec())),N.some(u)]),matchWidth:true,useMinWidth:true,onOpen:(t,o,n)=>{if(e.searchable){QN(n)}},dropdownBehaviours:wi([...e.dropdownBehaviours,zO.button((()=>e.disabled||o.providers.isDisabled())),wO(),vR.config({}),m_.config({}),...e.tooltip.map((e=>CS.config(o.providers.tooltips.getConfig({tooltipText:o.providers.translate(e)})))).toArray(),p_(m,[EO(e,s),OO(e,s)]),p_(f,[oi(((e,t)=>kI(e)))]),p_("menubutton-update-display-text",[Wc(SI,((e,t)=>{r.bind((t=>t.getOpt(e))).each((e=>{m_.set(e,[Bu(o.providers.translate(t.event.text))])}))})),Wc(zI,((e,t)=>{a.bind((t=>t.getOpt(e))).each((e=>{m_.set(e,[xI(t.event.icon,o.providers.icons)])}))}))])]),eventOrder:Bs(vI,{[qa()]:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"],[Cc()]:["toolbar-button-events",CS.name(),m,f]}),sandboxBehaviours:wi([Qw.config({mode:"special",onLeft:c,onRight:c}),p_("dropdown-sandbox-events",[Wc(xT,((e,t)=>{$N(e);t.stop()})),Wc(CT,((e,t)=>{GN(e,t);t.stop()}))])]),lazySink:o.getSink,toggleClass:`${t}--active`,parts:{menu:{...hT(false,e.columns,e.presets),fakeFocus:e.searchable,...e.listRole==="listbox"?{}:{onHighlightItem:XN,onCollapseMenu:(e,t,o)=>{Cv.getHighlighted(o).each((t=>{XN(e,o,t)}))},onDehighlightItem:JN}}},getAnchorOverrides:()=>({maxHeightFunction:(e,t)=>{Km()(e,t-10)}}),fetch:t=>TN.nu(z(e.fetch,t))}));return g.asSpec()};const EI=e=>c(e);const OI=e=>e.type==="separator";const AI=e=>Ce(e,"getSubmenuItems");const DI={type:"separator"};const NI=(e,t)=>{const o=G(e,((e,o)=>{if(EI(o)){if(o===""){return e}else if(o==="|"){return e.length>0&&!OI(e[e.length-1])?e.concat([DI]):e}else if(Ce(t,o.toLowerCase())){return e.concat([t[o.toLowerCase()]])}else{return e}}else{return e.concat([o])}}),[]);if(o.length>0&&OI(o[o.length-1])){o.pop()}return o};const MI=(e,t)=>{const o=e.getSubmenuItems();const n=BI(o,t);const s=Bs(n.menus,{[e.value]:n.items});const r=Bs(n.expansions,{[e.value]:e.value});return{item:e,menus:s,expansions:r}};const RI=e=>{const t=xe(e,"value").getOrThunk((()=>zd("generated-menu-item")));return Bs({value:t},e)};const BI=(e,t)=>{const o=NI(c(e)?e.split(" "):e,t);return $(o,((e,o)=>{if(AI(o)){const n=RI(o);const s=MI(n,t);return{menus:Bs(e.menus,s.menus),items:[s.item,...e.items],expansions:Bs(e.expansions,s.expansions)}}else{return{...e,items:[o,...e.items]}}}),{menus:{},expansions:{},items:[]})};const LI=e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-field",placeholder:e.placeholder})));const HI=e=>e.search.fold((()=>({searchMode:"no-search"})),(e=>({searchMode:"search-with-results"})));const II=(e,t,o,n)=>{const s=zd("primary-menu");const r=BI(e,o.shared.providers.menuItems());if(r.items.length===0){return N.none()}const a=LI(n);const c=sM(s,r.items,t,o,n.isHorizontalMenu,a);const i=HI(n);const l=ge(r.menus,((e,n)=>sM(n,e,t,o,false,i)));const d=Bs(l,Sa(s,c));return N.from(Bx.tieredData(s,d,r.expansions))};const PI=e=>!Ce(e,"items");const FI="data-value";const VI=(e,t,o,n,s)=>j(o,(o=>{if(!PI(o)){return{type:"nestedmenuitem",text:o.text,getSubmenuItems:()=>VI(e,t,o.items,n,s)}}else{return{type:"togglemenuitem",...s?{}:{role:"option"},text:o.text,value:o.value,active:o.value===n,onAction:()=>{wy.setValue(e,o.value);Lc(e,GM,{name:t});C_.focus(e)}}}}));const jI=(e,t)=>de(e,(e=>{if(!PI(e)){return jI(e.items,t)}else{return Me(e.value===t,e)}}));const ZI=(e,t,o)=>{const n=P(e.items,(e=>!PI(e)));const s=t.shared.providers;const r=o.bind((t=>jI(e.items,t))).orThunk((()=>ce(e.items).filter(PI)));const a=e.label.map((e=>$M(e,s)));const c=FM.parts.field({dom:{},factory:{sketch:o=>TI({uid:o.uid,text:r.map((e=>e.text)),icon:N.none(),tooltip:N.none(),role:Me(!n,"combobox"),...n?{}:{listRole:"listbox"},ariaLabel:e.label,fetch:(o,s)=>{const r=VI(o,e.name,e.items,wy.getValue(o),n);s(II(r,Zz.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:false,search:N.none()}))},onSetup:x(v),getApi:x({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[dS.config({}),_H(r.map((e=>e.value)),(e=>no(e.element,FI)),((t,o)=>{jI(e.items,o).each((e=>{to(t.element,FI,e.value);Lc(t,SI,{text:e.text})}))}))]},"tox-listbox",t.shared)}});const i={dom:{tag:"div",classes:["tox-listboxfield"]},components:[c]};return FM.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([a.toArray(),[i]]),fieldBehaviours:wi([sv.config({disabled:x(!e.enabled),onDisabled:e=>{FM.getField(e).each(sv.disable)},onEnabled:e=>{FM.getField(e).each(sv.enable)}})])})};const UI=(e,t)=>({dom:{tag:"div",classes:e.classes},components:j(e.items,t.shared.interpreter)});const qI=(e,t)=>{const o=j(e.options,(e=>({dom:{tag:"option",value:e.value,innerHtml:e.text}})));const n=e.data.map((e=>Sa("initialValue",e))).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:o,behaviours:Cy(e.selectBehaviours,[C_.config({}),wy.config({store:{mode:"manual",getValue:e=>mu(e.element),setValue:(t,o)=>{const n=ce(e.options);const s=Y(e.options,(e=>e.value===o));if(s.isSome()){gu(t.element,o)}else if(t.element.dom.selectedIndex===-1&&o===""){n.each((e=>gu(t.element,e.value)))}},...n}})])}};const WI=Mb({name:"HtmlSelect",configFields:[jr("options"),_y("selectBehaviours",[C_,wy]),ia("selectClasses",[]),ia("selectAttributes",{}),Qr("data")],factory:qI});const $I=(e,t,o)=>{const n=j(e.items,(e=>({text:t.translate(e.text),value:e.value})));const s=e.label.map((e=>$M(e,t)));const r=FM.parts.field({dom:{},...o.map((e=>({data:e}))).getOr({}),selectAttributes:{size:e.size},options:n,factory:WI,selectBehaviours:wi([sv.config({disabled:()=>!e.enabled||t.isDisabled()}),dS.config({}),p_("selectbox-change",[Wc(tc(),((t,o)=>{Lc(t,GM,{name:e.name})}))])])});const a=e.size>1?N.none():N.some(Rz("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons));const c={dom:{tag:"div",classes:["tox-selectfield"]},components:J([[r],a.toArray()])};return FM.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:J([s.toArray(),[c]]),fieldBehaviours:wi([sv.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{FM.getField(e).each(sv.disable)},onEnabled:e=>{FM.getField(e).each(sv.enable)}}),wO()])})};const GI=x([ia("field1Name","field1"),ia("field2Name","field2"),md("onLockedChange"),ld(["lockClass"]),ia("locked",false),Sy.field("coupledFieldBehaviours",[Pb,wy])]);const KI=(e,t,o)=>pb(e,t,o).bind(Pb.getCurrent);const YI=(e,t)=>eb({factory:FM,name:e,overrides:e=>({fieldBehaviours:wi([p_("coupled-input-behaviour",[Wc(ec(),(o=>{KI(o,e,t).each((t=>{pb(o,e,"lock").each((n=>{if(Z_.isOn(n)){e.onLockedChange(o,t,n)}}))}))}))])])})});const XI=x([YI("field1","field2"),YI("field2","field1"),eb({factory:oS,schema:[jr("dom")],name:"lock",overrides:e=>({buttonBehaviours:wi([Z_.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])})})]);const JI=(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Sy.augment(e.coupledFieldBehaviours,[Pb.config({find:N.some}),wy.config({store:{mode:"manual",getValue:t=>{const o=kb(t,e,["field1","field2"]);return{[e.field1Name]:wy.getValue(o.field1()),[e.field2Name]:wy.getValue(o.field2())}},setValue:(t,o)=>{const n=kb(t,e,["field1","field2"]);if(Se(o,e.field1Name)){wy.setValue(n.field1(),o[e.field1Name])}if(Se(o,e.field2Name)){wy.setValue(n.field2(),o[e.field2Name])}}}})]),apis:{getField1:t=>pb(t,e,"field1"),getField2:t=>pb(t,e,"field2"),getLock:t=>pb(t,e,"lock")}});const QI=Rb({name:"FormCoupledInputs",configFields:GI(),partFields:XI(),factory:JI,apis:{getField1:(e,t)=>e.getField1(t),getField2:(e,t)=>e.getField2(t),getLock:(e,t)=>e.getLock(t)}});const eP=e=>{const t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4};const o=e=>e in t?t[e]:1;let n=e.value.toFixed(o(e.unit));if(n.indexOf(".")!==-1){n=n.replace(/\.?0*$/,"")}return n+e.unit};const tP=e=>{const t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/;const o=t.exec(e);if(o!==null){const e=parseFloat(o[1]);const t=o[2];return hs.value({value:e,unit:t})}else{return hs.error(e)}};const oP=(e,t)=>{const o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1};const n=e=>Ce(o,e);if(e.unit===t){return N.some(e.value)}else if(n(e.unit)&&n(t)){if(o[e.unit]===o[t]){return N.some(e.value)}else{return N.some(e.value/o[e.unit]*o[t])}}else{return N.none()}};const nP=e=>N.none();const sP=(e,t)=>o=>oP(o,t).map((o=>({value:o*e,unit:t})));const rP=(e,t)=>{const o=tP(e).toOptional();const n=tP(t).toOptional();return Ae(o,n,((e,t)=>oP(e,t.unit).map((e=>t.value/e)).map((e=>sP(e,t.unit))).getOr(nP))).getOr(nP)};const aP=(e,t)=>{let o=nP;const n=zd("ratio-event");const s=e=>Rz(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons);const r=e.label.getOr("Constrain proportions");const a=t.translate(r);const c=QI.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":a,"data-mce-name":r}},components:[s("lock"),s("unlock")],buttonBehaviours:wi([sv.config({disabled:()=>!e.enabled||t.isDisabled()}),wO(),dS.config({}),CS.config(t.tooltips.getConfig({tooltipText:a}))])});const i=e=>({dom:{tag:"div",classes:["tox-form__group"]},components:e});const l=o=>FM.parts.field({factory:_T,inputClasses:["tox-textfield"],inputBehaviours:wi([sv.config({disabled:()=>!e.enabled||t.isDisabled()}),wO(),dS.config({}),p_("size-input-events",[Wc(Ya(),((e,t)=>{Lc(e,n,{isField1:o})})),Wc(tc(),((t,o)=>{Lc(t,GM,{name:e.name})}))])]),selectOnFocus:false});const d=e=>({dom:{tag:"label",classes:["tox-label"]},components:[Bu(t.translate(e))]});const u=QI.parts.field1(i([FM.parts.label(d("Width")),l(true)]));const f=QI.parts.field2(i([FM.parts.label(d("Height")),l(false)]));return QI.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[u,f,i([d(Ag),c])]}],field1Name:"width",field2Name:"height",locked:true,markers:{lockClass:"tox-locked"},onLockedChange:(e,t,n)=>{tP(wy.getValue(e)).each((e=>{o(e).each((e=>{wy.setValue(t,eP(e))}))}))},coupledFieldBehaviours:wi([sv.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{QI.getField1(e).bind(FM.getField).each(sv.disable);QI.getField2(e).bind(FM.getField).each(sv.disable);QI.getLock(e).each(sv.disable)},onEnabled:e=>{QI.getField1(e).bind(FM.getField).each(sv.enable);QI.getField2(e).bind(FM.getField).each(sv.enable);QI.getLock(e).each(sv.enable)}}),wO(),p_("size-input-events2",[Wc(n,((e,t)=>{const n=t.event.isField1;const s=n?QI.getField1(e):QI.getField2(e);const r=n?QI.getField2(e):QI.getField1(e);const a=s.map(wy.getValue).getOr("");const c=r.map(wy.getValue).getOr("");o=rP(a,c)}))])])})};const cP=(e,t,o)=>{const n=XL.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Bu(t.translate(e.label))]});const s=XL.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}});const r=XL.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return XL.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e.min,maxX:e.max,getInitialValue:x(o.getOrThunk((()=>(Math.abs(e.max)-Math.abs(e.min))/2)))},components:[n,s,r],sliderBehaviours:wi([vH.self(),C_.config({})]),onChoose:(t,o,n)=>{Lc(t,GM,{name:e.name,value:n})},onChange:(t,o,n)=>{Lc(t,GM,{name:e.name,value:n})}})};const iP=(e,t)=>{const o=e=>({dom:{tag:"th",innerHtml:t.translate(e)}});const n=e=>({dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:j(e,o)}]});const s=e=>({dom:{tag:"td",innerHtml:t.translate(e)}});const r=e=>({dom:{tag:"tr"},components:j(e,s)});const a=e=>({dom:{tag:"tbody"},components:j(e,r)});return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[n(e.header),a(e.cells)],behaviours:wi([dS.config({}),C_.config({})])}};const lP=(e,t)=>{const o=e.label.map((e=>$M(e,t)));const n=[sv.config({disabled:()=>e.disabled||t.isDisabled()}),wO(),Qw.config({mode:"execution",useEnter:e.multiline!==true,useControlEnter:e.multiline===true,execute:e=>{Bc(e,JM);return N.some(true)}}),p_("textfield-change",[Wc(ec(),((t,o)=>{Lc(t,GM,{name:e.name})})),Wc(uc(),((t,o)=>{Lc(t,GM,{name:e.name})}))]),dS.config({})];const s=e.validation.map((e=>pR.config({getRoot:e=>Nt(e.element),invalidClass:"tox-invalid",validator:{validate:t=>{const o=wy.getValue(t);const n=e.validator(o);return TN.pure(n===true?hs.value(o):hs.error(n))},validateOnLoad:e.validateOnLoad}}))).toArray();const r=e.placeholder.fold(x({}),(e=>({placeholder:t.translate(e)})));const a=e.inputMode.fold(x({}),(e=>({inputmode:e})));const c={...r,...a};const i=FM.parts.field({tag:e.multiline===true?"textarea":"input",...e.data.map((e=>({data:e}))).getOr({}),inputAttributes:c,inputClasses:[e.classname],inputBehaviours:wi(J([n,s])),selectOnFocus:false,factory:_T});const l=e.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[i]}:i;const d=e.flex?["tox-form__group--stretched"]:[];const u=d.concat(e.maximized?["tox-form-group--maximize"]:[]);const f=[sv.config({disabled:()=>e.disabled||t.isDisabled(),onDisabled:e=>{FM.getField(e).each(sv.disable)},onEnabled:e=>{FM.getField(e).each(sv.enable)}}),wO()];return jM(o,l,u,f)};const dP=(e,t,o)=>lP({name:e.name,multiline:false,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:false,disabled:!e.enabled,classname:"tox-textfield",validation:N.none(),maximized:e.maximized,data:o},t);const uP=(e,t,o)=>lP({name:e.name,multiline:true,label:e.label,inputMode:N.none(),placeholder:e.placeholder,flex:true,disabled:!e.enabled,classname:"tox-textarea",validation:N.none(),maximized:e.maximized,data:o},t);const fP=(e,t)=>t.getAnimationRoot.fold((()=>e.element),(t=>t(e)));const mP=e=>e.dimension.property;const gP=(e,t)=>e.dimension.getDimension(t);const pP=(e,t)=>{const o=fP(e,t);Vi(o,[t.shrinkingClass,t.growingClass])};const hP=(e,t)=>{Hi(e.element,t.openClass);Bi(e.element,t.closedClass);uo(e.element,mP(t),"0px");ko(e.element)};const yP=(e,t)=>{Hi(e.element,t.closedClass);Bi(e.element,t.openClass);vo(e.element,mP(t))};const bP=(e,t,o,n)=>{o.setCollapsed();uo(e.element,mP(t),gP(t,e.element));pP(e,t);hP(e,t);t.onStartShrink(e);t.onShrunk(e)};const vP=(e,t,o,n)=>{const s=n.getOrThunk((()=>gP(t,e.element)));o.setCollapsed();uo(e.element,mP(t),s);ko(e.element);const r=fP(e,t);Hi(r,t.growingClass);Bi(r,t.shrinkingClass);hP(e,t);t.onStartShrink(e)};const kP=(e,t,o)=>{const n=gP(t,e.element);const s=n==="0px"?bP:vP;s(e,t,o,N.some(n))};const wP=(e,t,o)=>{const n=fP(e,t);const s=Pi(n,t.shrinkingClass);const r=gP(t,e.element);yP(e,t);const a=gP(t,e.element);const c=()=>{uo(e.element,mP(t),r);ko(e.element)};const i=()=>{hP(e,t)};const l=s?c:i;l();Hi(n,t.shrinkingClass);Bi(n,t.growingClass);yP(e,t);uo(e.element,mP(t),a);o.setExpanded();t.onStartGrow(e)};const _P=(e,t,o)=>{if(o.isExpanded()){vo(e.element,mP(t));const o=gP(t,e.element);uo(e.element,mP(t),o)}};const xP=(e,t,o)=>{if(!o.isExpanded()){wP(e,t,o)}};const CP=(e,t,o)=>{if(o.isExpanded()){kP(e,t,o)}};const SP=(e,t,o)=>{if(o.isExpanded()){bP(e,t,o)}};const zP=(e,t,o)=>o.isExpanded();const TP=(e,t,o)=>o.isCollapsed();const EP=(e,t,o)=>{const n=fP(e,t);return Pi(n,t.growingClass)===true};const OP=(e,t,o)=>{const n=fP(e,t);return Pi(n,t.shrinkingClass)===true};const AP=(e,t,o)=>EP(e,t)||OP(e,t);const DP=(e,t,o)=>{const n=o.isExpanded()?kP:wP;n(e,t,o)};const NP=(e,t,o)=>{if(!o.isExpanded()){yP(e,t);uo(e.element,mP(t),gP(t,e.element));pP(e,t);o.setExpanded();t.onStartGrow(e);t.onGrown(e)}};var MP=Object.freeze({__proto__:null,refresh:_P,grow:xP,shrink:CP,immediateShrink:SP,hasGrown:zP,hasShrunk:TP,isGrowing:EP,isShrinking:OP,isTransitioning:AP,toggleGrow:DP,disableTransitions:pP,immediateGrow:NP});const RP=(e,t,o)=>{const n=t.expanded;return n?di({classes:[t.openClass],styles:{}}):di({classes:[t.closedClass],styles:Sa(t.dimension.property,"0px")})};const BP=(e,t)=>jc([ti(sc(),((o,n)=>{const s=n.event.raw;if(s.propertyName===e.dimension.property){pP(o,e);if(t.isExpanded()){vo(o.element,e.dimension.property)}const n=t.isExpanded()?e.onGrown:e.onShrunk;n(o)}}))]);var LP=Object.freeze({__proto__:null,exhibit:RP,events:BP});var HP=[jr("closedClass"),jr("openClass"),jr("shrinkingClass"),jr("growingClass"),Qr("getAnimationRoot"),ud("onShrunk"),ud("onStartShrink"),ud("onGrown"),ud("onStartGrow"),ia("expanded",false),Zr("dimension",Hr("property",{width:[pd("property","width"),pd("getDimension",(e=>Ro(e)+"px"))],height:[pd("property","height"),pd("getDimension",(e=>xo(e)+"px"))]}))];const IP=e=>{const t=cs(e.expanded);const o=()=>"expanded: "+t.get();return ki({isExpanded:()=>t.get()===true,isCollapsed:()=>t.get()===false,setCollapsed:z(t.set,false),setExpanded:z(t.set,true),readState:o})};var PP=Object.freeze({__proto__:null,init:IP});const FP=xi({fields:HP,name:"sliding",active:LP,apis:MP,state:PP});const VP=e=>({isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t),setActive:t=>{const o=e.element;if(t){Bi(o,"tox-tbtn--enabled");to(o,"aria-pressed",true)}else{Hi(o,"tox-tbtn--enabled");ao(o,"aria-pressed")}},isActive:()=>Pi(e.element,"tox-tbtn--enabled"),setText:t=>{Lc(e,SI,{text:t})},setIcon:t=>Lc(e,zI,{icon:t})});const jP=(e,t,o,n,s=true,r)=>TI({text:e.text,icon:e.icon,tooltip:e.tooltip,ariaLabel:e.tooltip,searchable:e.search.isSome(),role:n,fetch:(t,n)=>{const s={pattern:e.search.isSome()?eM(t):""};e.fetch((t=>{n(II(t,Zz.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:false,search:e.search}))}),s,VP(t))},onSetup:e.onSetup,getApi:VP,columns:1,presets:"normal",classes:[],dropdownBehaviours:[...s?[dS.config({})]:[]]},t,o.shared,r);const ZP=(e,t,o)=>{const n=e=>n=>{const s=!n.isActive();n.setActive(s);e.storage.set(s);o.shared.getSink().each((o=>{t().getOpt(o).each((t=>{tm(t.element);Lc(t,XM,{name:e.name,value:e.storage.get()})}))}))};const s=e=>t=>{t.setActive(e.storage.get())};return t=>{t(j(e,(e=>{const t=e.text.fold((()=>({})),(e=>({text:e})));return{type:e.type,active:false,...t,onAction:n(e),onSetup:s(e)}})))}};const UP=e=>({dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":e}},components:[Bu(e)]});const qP=zd("leaf-label-event-id");const WP=({leaf:e,onLeafAction:t,visible:o,treeId:n,selectedId:s,backstage:r})=>{const a=e.menu.map((e=>jP(e,"tox-mbtn",r,N.none(),o)));const c=[UP(e.title)];a.each((e=>c.push(e)));return oS.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:c,role:"treeitem",action:o=>{t(e.id);o.getSystem().broadcastOn([`update-active-item-${n}`],{value:e.id})},eventOrder:{[Ja()]:[qP,"keying"]},buttonBehaviours:wi([...o?[dS.config({})]:[],Z_.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:false,aria:{mode:"selected"}}),Jf.config({channels:{[`update-active-item-${n}`]:{onReceive:(t,o)=>{(o.value===e.id?Z_.on:Z_.off)(t)}}}}),p_(qP,[oi(((t,o)=>{s.each((o=>{const n=o===e.id?Z_.on:Z_.off;n(t)}))})),Wc(Ja(),((e,t)=>{const o=t.event.raw.code==="ArrowLeft";const n=t.event.raw.code==="ArrowRight";if(o){Yu(e.element,".tox-tree--directory").each((t=>{e.getSystem().getByDom(t).each((e=>{Ju(t,".tox-tree--directory__label").each((t=>{e.getSystem().getByDom(t).each(C_.focus)}))}))}));t.stop()}else if(n){t.stop()}}))])])})};const $P=(e,t,o)=>Rz(e,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"],behaviours:o},t);const GP=(e,t)=>$P(e,t,[]);const KP=zd("directory-label-event-id");const YP=({directory:e,visible:t,noChildren:o,backstage:n})=>{const s=e.menu.map((e=>jP(e,"tox-mbtn",n,N.none())));const r=[{dom:{tag:"div",classes:["tox-chevron"]},components:[GP("chevron-right",n.shared.providers.icons)]},UP(e.title)];s.each((e=>{r.push(e)}));const a=t=>{Yu(t.element,".tox-tree--directory").each((o=>{t.getSystem().getByDom(o).each((o=>{const n=!Z_.isOn(o);Z_.toggle(o);Lc(t,"expand-tree-node",{expanded:n,node:e.id})}))}))};return oS.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(t?["tox-tree--directory__label--visible"]:[])},components:r,action:a,eventOrder:{[Ja()]:[KP,"keying"]},buttonBehaviours:wi([...t?[dS.config({})]:[],p_(KP,[Wc(Ja(),((e,t)=>{const n=t.event.raw.code==="ArrowRight";const s=t.event.raw.code==="ArrowLeft";if(n&&o){t.stop()}if(n||s){Yu(e.element,".tox-tree--directory").each((o=>{e.getSystem().getByDom(o).each((o=>{if(!Z_.isOn(o)&&n||Z_.isOn(o)&&s){a(e);t.stop()}else if(s&&!Z_.isOn(o)){Yu(o.element,".tox-tree--directory").each((e=>{Ju(e,".tox-tree--directory__label").each((e=>{o.getSystem().getByDom(e).each(C_.focus)}))}));t.stop()}}))}))}}))])])})};const XP=({children:e,onLeafAction:t,visible:o,treeId:n,expandedIds:s,selectedId:r,backstage:a})=>({dom:{tag:"div",classes:["tox-tree--directory__children"]},components:e.map((e=>e.type==="leaf"?WP({leaf:e,selectedId:r,onLeafAction:t,visible:o,treeId:n,backstage:a}):QP({directory:e,expandedIds:s,selectedId:r,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:a}))),behaviours:wi([FP.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),m_.config({})])});const JP=zd("directory-event-id");const QP=({directory:e,onLeafAction:t,labelTabstopping:o,treeId:n,backstage:s,expandedIds:r,selectedId:a})=>{const{children:c}=e;const i=cs(r);const l=e=>c.map((o=>o.type==="leaf"?WP({leaf:o,selectedId:a,onLeafAction:t,visible:e,treeId:n,backstage:s}):QP({directory:o,expandedIds:i.get(),selectedId:a,onLeafAction:t,labelTabstopping:e,treeId:n,backstage:s})));const d=r.includes(e.id);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[YP({directory:e,visible:o,noChildren:e.children.length===0,backstage:s}),XP({children:c,expandedIds:r,selectedId:a,onLeafAction:t,visible:d,treeId:n,backstage:s})],behaviours:wi([p_(JP,[oi(((e,t)=>{Z_.set(e,d)})),Wc("expand-tree-node",((e,t)=>{const{expanded:o,node:n}=t.event;i.set(o?[...i.get(),n]:i.get().filter((e=>e!==n)))}))]),Z_.config({...e.children.length>0?{aria:{mode:"expanded"}}:{},toggleClass:"tox-tree--directory--expanded",onToggled:(e,t)=>{const o=e.components()[1];const n=l(t);if(t){FP.grow(o)}else{FP.shrink(o)}m_.set(o,n)}})])}};const eF=zd("tree-event-id");const tF=(e,t)=>{const o=e.onLeafAction.getOr(v);const n=e.onToggleExpand.getOr(v);const s=e.defaultExpandedIds;const r=cs(s);const a=cs(e.defaultSelectedId);const c=zd("tree-id");const i=(n,s)=>e.items.map((e=>e.type==="leaf"?WP({leaf:e,selectedId:n,onLeafAction:o,visible:true,treeId:c,backstage:t}):QP({directory:e,selectedId:n,onLeafAction:o,expandedIds:s,labelTabstopping:true,treeId:c,backstage:t})));return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:i(a.get(),r.get()),behaviours:wi([Qw.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:false}),p_(eF,[Wc("expand-tree-node",((e,t)=>{const{expanded:o,node:s}=t.event;r.set(o?[...r.get(),s]:r.get().filter((e=>e!==s)));n(r.get(),{expanded:o,node:s})}))]),Jf.config({channels:{[`update-active-item-${c}`]:{onReceive:(e,t)=>{a.set(N.some(t.value));m_.set(e,i(N.some(t.value),r.get()))}}}}),m_.config({})])}};const oF=(e,t)=>{const o=e.stream.streams;const n=o.setup(e,t);return jc([Wc(e.event,n),ni((()=>t.cancel()))].concat(e.cancelEvent.map((e=>[Wc(e,(()=>t.cancel()))])).getOr([])))};var nF=Object.freeze({__proto__:null,events:oF});const sF=e=>{const t=cs(null);const o=()=>({timer:t.get()!==null?"set":"unset"});const n=e=>{t.set(e)};const s=()=>{const e=t.get();if(e!==null){e.cancel()}};return ki({readState:o,setTimer:n,cancel:s})};const rF=e=>e.stream.streams.state(e);var aF=Object.freeze({__proto__:null,throttle:sF,init:rF});const cF=(e,t)=>{const o=e.stream;const n=IH(e.onStream,o.delay);t.setTimer(n);return(e,t)=>{n.throttle(e,t);if(o.stopEvent){t.stop()}}};var iF=[Zr("stream",Hr("mode",{throttle:[jr("delay"),ia("stopEvent",true),pd("streams",{setup:cF,state:sF})]})),ia("event","input"),Qr("cancelEvent"),md("onStream")];const lF=xi({fields:iF,name:"streaming",active:nF,state:aF});const dF=(e,t,o)=>{const n=wy.getValue(o);wy.setValue(t,n);fF(t)};const uF=(e,t)=>{const o=e.element;const n=mu(o);const s=o.dom;if(no(o,"type")!=="number"){t(s,n)}};const fF=e=>{uF(e,((e,t)=>e.setSelectionRange(t.length,t.length)))};const mF=(e,t)=>{uF(e,((e,o)=>e.setSelectionRange(t,o.length)))};const gF=(e,t,o)=>{if(!e.selectsOver){return N.none()}else{const n=wy.getValue(t);const s=e.getDisplayText(n);const r=wy.getValue(o);const a=e.getDisplayText(r);return a.indexOf(s)===0?N.some((()=>{dF(e,t,o);mF(t,s.length)})):N.none()}};const pF=x("alloy.typeahead.itemexecute");const hF=(e,t,o,n)=>{const s=(t,o,s)=>{e.previewing.set(false);const r=vN.getCoupled(t,"sandbox");if(Ph.isOpen(r)){Pb.getCurrent(r).each((e=>{Cv.getHighlighted(e).fold((()=>{s(e)}),(()=>{Vc(r,e.element,"keydown",o)}))}))}else{const o=e=>{Pb.getCurrent(e).each(s)};MN(e,a(t),t,r,n,o,Ox.HighlightMenuAndItem).get(v)}};const r=bT(e);const a=e=>t=>t.map((t=>{const o=_e(t.menus);const n=Q(o,(e=>W(e.items,(e=>e.type==="item"))));const s=wy.getState(e);s.update(j(n,(e=>e.data)));return t}));const c=e=>Pb.getCurrent(e);const i="typeaheadevents";const l=[C_.config({}),wy.config({onSetValue:e.onSetValue,store:{mode:"dataset",getDataKey:e=>mu(e.element),getFallbackEntry:e=>({value:e,meta:{}}),setValue:(t,o)=>{gu(t.element,e.model.getDisplayText(o))},...e.initialData.map((e=>Sa("initialValue",e))).getOr({})}}),lF.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:false},onStream:(t,o)=>{const s=vN.getCoupled(t,"sandbox");const r=C_.isFocused(t);if(r){if(mu(t.element).length>=e.minChars){const o=c(s).bind((e=>Cv.getHighlighted(e).map(wy.getValue)));e.previewing.set(true);const r=t=>{c(s).each((t=>{o.fold((()=>{if(e.model.selectsOver){Cv.highlightFirst(t)}}),(e=>{Cv.highlightBy(t,(t=>{const o=wy.getValue(t);return o.value===e.value}));Cv.getHighlighted(t).orThunk((()=>{Cv.highlightFirst(t);return N.none()}))}))}))};MN(e,a(t),t,s,n,r,Ox.HighlightJustMenu).get(v)}}},cancelEvent:bc()}),Qw.config({mode:"special",onDown:(e,t)=>{s(e,t,Cv.highlightFirst);return N.some(true)},onEscape:e=>{const t=vN.getCoupled(e,"sandbox");if(Ph.isOpen(t)){Ph.close(t);return N.some(true)}return N.none()},onUp:(e,t)=>{s(e,t,Cv.highlightLast);return N.some(true)},onEnter:t=>{const o=vN.getCoupled(t,"sandbox");const n=Ph.isOpen(o);if(n&&!e.previewing.get()){return c(o).bind((e=>Cv.getHighlighted(e))).map((e=>{Lc(t,pF(),{item:e});return true}))}else{const s=wy.getValue(t);Bc(t,bc());e.onExecute(o,t,s);if(n){Ph.close(o)}return N.some(true)}}}),Z_.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),vN.config({others:{sandbox:t=>PN(e,t,{onOpen:()=>Z_.on(t),onClose:()=>{e.lazyTypeaheadComp.get().each((e=>ao(e.element,"aria-activedescendant")));Z_.off(t)}})}}),p_(i,[oi((t=>{e.lazyTypeaheadComp.set(N.some(t))})),ni((t=>{e.lazyTypeaheadComp.set(N.none())})),ri((t=>{const o=v;BN(e,a(t),t,n,o,Ox.HighlightMenuAndItem).get(v)})),Wc(pF(),((t,o)=>{const n=vN.getCoupled(t,"sandbox");dF(e.model,t,o.event.item);Bc(t,bc());e.onItemExecute(t,n,o.event.item,wy.getValue(t));Ph.close(n);fF(t)}))].concat(e.dismissOnBlur?[Wc(dc(),(e=>{const t=vN.getCoupled(e,"sandbox");if(rm(t.element).isNone()){Ph.close(t)}}))]:[]))];const d={[Sc()]:[wy.name(),lF.name(),i],...e.eventOrder};return{uid:e.uid,dom:kT(Bs(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:{...r,...Cy(e.typeaheadBehaviours,l)},eventOrder:d}};const yF=x([Qr("lazySink"),jr("fetch"),ia("minChars",5),ia("responseTime",1e3),ud("onOpen"),ia("getHotspot",N.some),ia("getAnchorOverrides",x({})),ia("layouts",N.none()),ia("eventOrder",{}),ya("model",{},[ia("getDisplayText",(e=>e.meta!==undefined&&e.meta.text!==undefined?e.meta.text:e.value)),ia("selectsOver",true),ia("populateFromBrowse",true)]),ud("onSetValue"),fd("onExecute"),ud("onItemExecute"),ia("inputClasses",[]),ia("inputAttributes",{}),ia("inputStyles",{}),ia("matchWidth",true),ia("useMinWidth",false),ia("dismissOnBlur",true),ld(["openClass"]),Qr("initialData"),Qr("listRole"),_y("typeaheadBehaviours",[C_,wy,lF,Qw,Z_,vN]),Fr("lazyTypeaheadComp",(()=>cs(N.none))),Fr("previewing",(()=>cs(true)))].concat(yT()).concat(VN()));const bF=x([tb({schema:[id()],name:"menu",overrides:e=>({fakeFocus:true,onHighlightItem:(t,o,n)=>{if(!e.previewing.get()){e.lazyTypeaheadComp.get().each((t=>{if(e.model.populateFromBrowse){dF(e.model,t,n)}so(n.element,"id").each((e=>to(t.element,"aria-activedescendant",e)))}))}else{e.lazyTypeaheadComp.get().each((t=>{gF(e.model,t,n).fold((()=>{if(e.model.selectsOver){Cv.dehighlight(o,n);e.previewing.set(true)}else{e.previewing.set(false)}}),(t=>{t();e.previewing.set(false)}))}))}},onExecute:(t,o)=>e.lazyTypeaheadComp.get().map((e=>{Lc(e,pF(),{item:o});return true})),onHover:(t,o)=>{e.previewing.set(false);e.lazyTypeaheadComp.get().each((t=>{if(e.model.populateFromBrowse){dF(e.model,t,o)}}))}})})]);const vF=Rb({name:"Typeahead",configFields:yF(),partFields:bF(),factory:hF});const kF=e=>{const t=()=>kF(e.toCached());const o=t=>kF(e.bind((e=>e.fold((e=>TN.pure(hs.error(e))),(e=>t(e))))));const n=t=>kF(e.map((e=>e.bind(t))));const s=t=>kF(e.map((e=>e.map(t))));const r=t=>kF(e.map((e=>e.mapError(t))));const a=(t,o)=>e.map((e=>e.fold(t,o)));const c=(t,o)=>kF(TN.nu((n=>{let s=false;const r=setTimeout((()=>{s=true;n(hs.error(o()))}),t);e.get((e=>{if(!s){clearTimeout(r);n(e)}}))})));return{...e,toCached:t,bindFuture:o,bindResult:n,mapResult:s,mapError:r,foldResult:a,withTimeout:c}};const wF=e=>kF(TN.nu(e));const _F=e=>kF(TN.pure(hs.value(e)));const xF=e=>kF(TN.pure(hs.error(e)));const CF=e=>kF(TN.pure(e));const SF=e=>kF(e.map(hs.value));const zF=e=>wF((t=>{e.then((e=>{t(hs.value(e))}),(e=>{t(hs.error(e))}))}));const TF={nu:wF,wrap:kF,pure:_F,value:_F,error:xF,fromResult:CF,fromFuture:SF,fromPromise:zF};const EF=(e,t,o=[],n,s,r,a)=>{const c=t.fold((()=>({})),(e=>({action:e})));const i={buttonBehaviours:wi([zO.button((()=>!e.enabled||a.isDisabled())),wO(),dS.config({}),...r.map((e=>CS.config(a.tooltips.getConfig({tooltipText:a.translate(e)})))).toArray(),p_("button press",[qc("click"),qc("mousedown")])].concat(o)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]},...c};const l=Bs(i,{dom:n});return Bs(l,{components:s})};const OF=(e,t,o,n=[],s)=>{const r=e.tooltip.map((e=>({"aria-label":o.translate(e)}))).getOr({});const a={tag:"button",classes:["tox-tbtn"],attributes:{...r,"data-mce-name":s}};const c=e.icon.map((e=>_I(e,o.icons)));const i=NO([c]);return EF(e,t,n,a,i,e.tooltip,o)};const AF=e=>{switch(e){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];case"secondary":default:return["tox-button","tox-button--secondary"]}};const DF=(e,t,o,n=[],s=[])=>{const r=o.translate(e.text);const a=e.icon.map((e=>_I(e,o.icons)));const c=[a.getOrThunk((()=>Bu(r)))];const i=e.buttonType.getOr(!e.primary&&!e.borderless?"secondary":"primary");const l=AF(i);const d=[...l,...a.isSome()?["tox-button--icon"]:[],...e.borderless?["tox-button--naked"]:[],...s];const u={tag:"button",classes:d,attributes:{"aria-label":r,"data-mce-name":e.text}};const f=e.icon.map(x(r));return EF(e,t,n,u,c,f,o)};const NF=(e,t,o,n=[],s=[])=>{const r=DF(e,N.some(t),o,n,s);return oS.sketch(r)};const MF=(e,t)=>o=>{if(t==="custom"){Lc(o,XM,{name:e,value:{}})}else if(t==="submit"){Bc(o,JM)}else if(t==="cancel"){Bc(o,YM)}else{console.error("Unknown button type: ",t)}};const RF=(e,t)=>t==="menu";const BF=(e,t)=>t==="custom"||t==="cancel"||t==="submit";const LF=(e,t)=>t==="togglebutton";const HF=(e,t,o)=>{var n,s;const r=e.icon.map((e=>xI(e,t.icons))).map(aS);const a=o=>{Lc(o,XM,{name:e.name,value:{setIcon:e=>{r.map((n=>n.getOpt(o).each((o=>{m_.set(o,[xI(e,t.icons)])}))))}}})};const c=e.buttonType.getOr(!e.primary?"secondary":"primary");const i={...e,name:(n=e.name)!==null&&n!==void 0?n:"",primary:c==="primary",tooltip:e.tooltip,enabled:(s=e.enabled)!==null&&s!==void 0?s:false,borderless:false};const l=i.tooltip.or(e.text).map((e=>({"aria-label":t.translate(e)}))).getOr({});const d=AF(c!==null&&c!==void 0?c:"secondary");const u=e.icon.isSome()&&e.text.isSome();const f={tag:"button",classes:[...d.concat(e.icon.isSome()?["tox-button--icon"]:[]),...e.active?["tox-button--enabled"]:[],...u?["tox-button--icon-and-text"]:[]],attributes:{...l,...p(o)?{"data-mce-name":o}:{}}};const m=[];const g=t.translate(e.text.getOr(""));const h=Bu(g);const y=NO([r.map((e=>e.asSpec()))]);const b=[...y,...e.text.isSome()?[h]:[]];const v=EF(i,N.some(a),m,f,b,e.tooltip,t);return oS.sketch(v)};const IF=(e,t,o)=>{if(RF(e,t)){const t=()=>r;const n=e;const s={...e,type:"menubutton",search:N.none(),onSetup:t=>{t.setEnabled(e.enabled);return v},fetch:ZP(n.items,t,o)};const r=aS(jP(s,"tox-tbtn",o,N.none(),true,e.text.or(e.tooltip).getOrUndefined()));return r.asSpec()}else if(BF(e,t)){const n=MF(e.name,t);const s={...e,borderless:false};return NF(s,n,o.shared.providers,[])}else if(LF(e,t)){return HF(e,o.shared.providers,e.text.or(e.tooltip).getOrUndefined())}else{console.error("Unknown footer button type: ",t);throw new Error("Unknown footer button type")}};const PF=(e,t)=>{const o=MF(e.name,"custom");return ZM(N.none(),FM.parts.field({factory:oS,...DF(e,N.some(o),t,[SH(""),vH.self()])}))};const FF={type:"separator"};const VF=e=>({type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:v});const jF=(e,t)=>({type:"menuitem",value:t,text:e,meta:{attach:undefined},onAction:v});const ZF=e=>j(e,VF);const UF=(e,t)=>W(t,(t=>t.type===e));const qF=(e,t)=>ZF(UF(e,t));const WF=e=>qF("header",e.targets);const $F=e=>qF("anchor",e.targets);const GF=e=>N.from(e.anchorTop).map((e=>jF("<top>",e))).toArray();const KF=e=>N.from(e.anchorBottom).map((e=>jF("<bottom>",e))).toArray();const YF=e=>j(e,(e=>jF(e,e)));const XF=e=>G(e,((e,t)=>{const o=e.length===0||t.length===0;return o?e.concat(t):e.concat(FF,t)}),[]);const JF=(e,t)=>{const o=e.toLowerCase();return W(t,(e=>{var t;const n=e.meta!==undefined&&e.meta.text!==undefined?e.meta.text:e.text;const s=(t=e.value)!==null&&t!==void 0?t:"";return Pe(n.toLowerCase(),o)||Pe(s.toLowerCase(),o)}))};const QF=(e,t,o)=>{var n,s;const r=wy.getValue(t);const a=(s=(n=r===null||r===void 0?void 0:r.meta)===null||n===void 0?void 0:n.text)!==null&&s!==void 0?s:r.value;const c=o.getLinkInformation();return c.fold((()=>[]),(t=>{const n=JF(a,YF(o.getHistory(e)));return e==="file"?XF([n,JF(a,WF(t)),JF(a,J([GF(t),$F(t),KF(t)]))]):n}))};const eV=zd("aria-invalid");const tV=(e,t,o,n)=>{const s=t.shared.providers;const r=t=>{const n=wy.getValue(t);o.addToHistory(n.value,e.filetype)};const a={...n.map((e=>({initialData:e}))).getOr({}),dismissOnBlur:true,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":eV,type:"url"},minChars:0,responseTime:0,fetch:n=>{const s=QF(e.filetype,n,o);const r=II(s,Zz.BUBBLE_TO_SANDBOX,t,{isHorizontalMenu:false,search:N.none()});return TN.pure(r)},getHotspot:e=>g.getOpt(e),onSetValue:(e,t)=>{if(e.hasConfigured(pR)){pR.run(e).get(v)}},typeaheadBehaviours:wi([...o.getValidationHandler().map((t=>pR.config({getRoot:e=>Nt(e.element),invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:(e,t)=>{d.getOpt(e).each((e=>{to(e.element,"title",s.translate(t))}))}},validator:{validate:o=>{const n=wy.getValue(o);return TF.nu((o=>{t({type:e.filetype,url:n.value},(e=>{if(e.status==="invalid"){const t=hs.error(e.message);o(t)}else{const t=hs.value(e.message);o(t)}}))}))},validateOnLoad:false}}))).toArray(),sv.config({disabled:()=>!e.enabled||s.isDisabled()}),dS.config({}),p_("urlinput-events",[Wc(ec(),(t=>{const o=mu(t.element);const n=o.trim();if(n!==o){gu(t.element,n)}if(e.filetype==="file"){Lc(t,GM,{name:e.name})}})),Wc(tc(),(t=>{Lc(t,GM,{name:e.name});r(t)})),Wc(uc(),(t=>{Lc(t,GM,{name:e.name});r(t)}))])]),eventOrder:{[ec()]:["streaming","urlinput-events","invalidating"]},model:{getDisplayText:e=>e.value,selectsOver:false,populateFromBrowse:false},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:hT(false,1,"normal")},onExecute:(e,t,o)=>{Lc(t,JM,{})},onItemExecute:(t,o,n,s)=>{r(t);Lc(t,GM,{name:e.name})}};const c=FM.parts.field({...a,factory:vF});const i=e.label.map((e=>$M(e,s)));const l=(e,t,o=e,n=e)=>Rz(o,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:{title:s.translate(n),"aria-live":"polite",...t.fold((()=>({})),(e=>({id:e})))}},s.icons);const d=aS(l("invalid",N.some(eV),"warning"));const u=aS({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]});const f=o.getUrlPicker(e.filetype);const m=zd("browser.url.event");const g=aS({dom:{tag:"div",classes:["tox-control-wrap"]},components:[c,u.asSpec()],behaviours:wi([sv.config({disabled:()=>!e.enabled||s.isDisabled()})])});const p=aS(NF({name:e.name,icon:N.some("browse"),text:e.picker_text.or(e.label).getOr(""),enabled:e.enabled,primary:false,buttonType:N.none(),borderless:true},(e=>Bc(e,m)),s,[],["tox-browse-url"]));const h=()=>({dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:J([[g.asSpec()],f.map((()=>p.asSpec())).toArray()])});const y=t=>{Pb.getCurrent(t).each((o=>{const n=wy.getValue(o);const s={fieldname:e.name,...n};f.each((n=>{n(s).get((n=>{wy.setValue(o,n);Lc(t,GM,{name:e.name})}))}))}))};return FM.sketch({dom:qM(),components:i.toArray().concat([h()]),fieldBehaviours:wi([sv.config({disabled:()=>!e.enabled||s.isDisabled(),onDisabled:e=>{FM.getField(e).each(sv.disable);p.getOpt(e).each(sv.disable)},onEnabled:e=>{FM.getField(e).each(sv.enable);p.getOpt(e).each(sv.enable)}}),wO(),p_("url-input-events",[Wc(m,y)])])})};const oV=(e,t)=>{const o=Oz(e.icon,t.icons);return RM.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in",`tox-notification--${e.level}`]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:!e.url?o:undefined},components:e.url?[oS.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:o,attributes:{title:t.translate(e.iconTooltip)}},action:t=>Lc(t,XM,{name:"alert-banner",value:e.url}),buttonBehaviours:wi([Nz()])})]:undefined},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]})};const nV=(e,t)=>{e.dom.checked=t};const sV=e=>e.dom.checked;const rV=(e,t,o)=>{const n=e=>{e.element.dom.click();return N.some(true)};const s=FM.parts.field({factory:{sketch:C},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:wi([vH.self(),sv.config({disabled:()=>!e.enabled||t.isDisabled(),onDisabled:e=>{Nt(e.element).each((e=>Bi(e,"tox-checkbox--disabled")))},onEnabled:e=>{Nt(e.element).each((e=>Hi(e,"tox-checkbox--disabled")))}}),dS.config({}),C_.config({}),xH(o,sV,nV),Qw.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:true}),p_("checkbox-events",[Wc(tc(),((t,o)=>{Lc(t,GM,{name:e.name})}))])])});const r=FM.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Bu(t.translate(e.label))],behaviours:wi([vR.config({})])});const a=e=>{const o=e==="checked"?"selected":"unselected";return Rz(o,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons)};const c=aS({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return FM.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[s,c.asSpec(),r],fieldBehaviours:wi([sv.config({disabled:()=>!e.enabled||t.isDisabled()}),wO()])})};const aV=(e,t)=>{const o=["tox-form__group",...e.stretched?["tox-form__group--stretched"]:[]];const n=p_("htmlpanel",[oi((t=>{e.onInit(t.element.dom)}))]);if(e.presets==="presentation"){return RM.sketch({dom:{tag:"div",classes:o,innerHtml:e.html},containerBehaviours:wi([CS.config({...t.tooltips.getConfig({tooltipText:"",onShow:e=>{Qu(e.element,"[data-mce-tooltip]:hover").orThunk((()=>rm(e.element))).each((o=>{so(o,"data-mce-tooltip").each((o=>{CS.setComponents(e,t.tooltips.getComponents({tooltipText:o}))}))}))}}),mode:"children-normal",anchor:e=>({type:"node",node:Qu(e.element,"[data-mce-tooltip]:hover").orThunk((()=>rm(e.element).filter((e=>so(e,"data-mce-tooltip").isSome())))),root:e.element,layouts:{onLtr:x([Pf,If,Rf,Lf,Bf,Hf]),onRtl:x([Pf,If,Rf,Lf,Bf,Hf])},bubble:tg(0,-2,{})})}),n])})}else{return RM.sketch({dom:{tag:"div",classes:o,innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:wi([dS.config({}),C_.config({}),n])})}};const cV=e=>(t,o,n,s,r)=>xe(o,"name").fold((()=>e(o,s,N.none(),r)),(a=>t.field(a,e(o,s,xe(n,a),r))));const iV=e=>(t,o,n,s,r)=>{const a=Bs(o,{source:"dynamic"});return cV(e)(t,a,n,s,r)};const lV={bar:cV(((e,t)=>LM(e,t.shared))),collection:cV(((e,t,o)=>nR(e,t.shared.providers,o))),alertbanner:cV(((e,t)=>oV(e,t.shared.providers))),input:cV(((e,t,o)=>dP(e,t.shared.providers,o))),textarea:cV(((e,t,o)=>uP(e,t.shared.providers,o))),label:cV(((e,t,o,n)=>pI(e,t.shared,n))),iframe:iV(((e,t,o)=>dI(e,t.shared.providers,o))),button:cV(((e,t)=>PF(e,t.shared.providers))),checkbox:cV(((e,t,o)=>rV(e,t.shared.providers,o))),colorinput:cV(((e,t,o)=>CR(e,t.shared,t.colorinput,o))),colorpicker:cV(((e,t,o)=>EH(e,t.shared.providers,o))),dropzone:cV(((e,t,o)=>RH(e,t.shared.providers,o))),grid:cV(((e,t)=>BH(e,t.shared))),listbox:cV(((e,t,o)=>ZI(e,t,o))),selectbox:cV(((e,t,o)=>$I(e,t.shared.providers,o))),sizeinput:cV(((e,t)=>aP(e,t.shared.providers))),slider:cV(((e,t,o)=>cP(e,t.shared.providers,o))),urlinput:cV(((e,t,o)=>tV(e,t,t.urlinput,o))),customeditor:cV(DH),htmlpanel:cV(((e,t)=>aV(e,t.shared.providers))),imagepreview:cV(((e,t,o)=>gI(e,o))),table:cV(((e,t)=>iP(e,t.shared.providers))),tree:cV(((e,t)=>tF(e,t))),panel:cV(((e,t)=>UI(e,t)))};const dV={field:(e,t)=>t,record:x([])};const uV=(e,t,o,n,s)=>{const r=Bs(n,{shared:{interpreter:t=>fV(e,t,o,r,s)}});return fV(e,t,o,r,s)};const fV=(e,t,o,n,s)=>xe(lV,t.type).fold((()=>{console.error(`Unknown factory type "${t.type}", defaulting to container: `,t);return t}),(r=>r(e,t,o,n,s)));const mV=(e,t,o,n)=>fV(dV,e,t,o,n);const gV="layout-inset";const pV=e=>e.x;const hV=(e,t)=>e.x+e.width/2-t.width/2;const yV=(e,t)=>e.x+e.width-t.width;const bV=e=>e.y;const vV=(e,t)=>e.y+e.height-t.height;const kV=(e,t)=>e.y+e.height/2-t.height/2;const wV=(e,t,o)=>af(yV(e,t),vV(e,t),o.insetSouthwest(),pf(),"southwest",xf(e,{right:0,bottom:3}),gV);const _V=(e,t,o)=>af(pV(e),vV(e,t),o.insetSoutheast(),gf(),"southeast",xf(e,{left:1,bottom:3}),gV);const xV=(e,t,o)=>af(yV(e,t),bV(e),o.insetNorthwest(),mf(),"northwest",xf(e,{right:0,top:2}),gV);const CV=(e,t,o)=>af(pV(e),bV(e),o.insetNortheast(),ff(),"northeast",xf(e,{left:1,top:2}),gV);const SV=(e,t,o)=>af(hV(e,t),bV(e),o.insetNorth(),hf(),"north",xf(e,{top:2}),gV);const zV=(e,t,o)=>af(hV(e,t),vV(e,t),o.insetSouth(),yf(),"south",xf(e,{bottom:3}),gV);const TV=(e,t,o)=>af(yV(e,t),kV(e,t),o.insetEast(),vf(),"east",xf(e,{right:0}),gV);const EV=(e,t,o)=>af(pV(e),kV(e,t),o.insetWest(),bf(),"west",xf(e,{left:1}),gV);const OV=e=>{switch(e){case"north":return SV;case"northeast":return CV;case"northwest":return xV;case"south":return zV;case"southeast":return _V;case"southwest":return wV;case"east":return TV;case"west":return EV}};const AV=(e,t,o,n,s)=>{const r=km(n).map(OV).getOr(SV);return r(e,t,o,n,s)};const DV=e=>{switch(e){case"north":return zV;case"northeast":return _V;case"northwest":return wV;case"south":return SV;case"southeast":return CV;case"southwest":return xV;case"east":return EV;case"west":return TV}};const NV=(e,t,o,n,s)=>{const r=km(n).map(DV).getOr(SV);return r(e,t,o,n,s)};const MV={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]};const RV=(e,t,o)=>{const n=12;const s={maxHeightFunction:Ym()};const r=()=>({type:"node",root:qt(Ut(e())),node:N.from(e()),bubble:tg(n,n,MV),layouts:{onRtl:()=>[CV],onLtr:()=>[xV]},overrides:s});const a=()=>({type:"hotspot",hotspot:t(),bubble:tg(-n,n,MV),layouts:{onRtl:()=>[Rf,Bf,Pf],onLtr:()=>[Bf,Rf,Pf]},overrides:s});return()=>o()?r():a()};const BV=(e,t,o,n)=>{const s=12;const r={maxHeightFunction:Ym()};const a=()=>({type:"node",root:qt(Ut(t())),node:N.from(t()),bubble:tg(s,s,MV),layouts:{onRtl:()=>[SV],onLtr:()=>[SV]},overrides:r});const c=()=>e?{type:"node",root:qt(Ut(t())),node:N.from(t()),bubble:tg(0,-Co(t()),MV),layouts:{onRtl:()=>[If],onLtr:()=>[If]},overrides:r}:{type:"hotspot",hotspot:o(),bubble:tg(0,0,MV),layouts:{onRtl:()=>[If],onLtr:()=>[If]},overrides:r};return()=>n()?a():c()};const LV=(e,t,o)=>{const n=()=>({type:"node",root:qt(Ut(e())),node:N.from(e()),layouts:{onRtl:()=>[SV],onLtr:()=>[SV]}});const s=()=>({type:"hotspot",hotspot:t(),layouts:{onRtl:()=>[Pf],onLtr:()=>[Pf]}});return()=>o()?n():s()};const HV=(e,t)=>()=>({type:"selection",root:t(),getSelection:()=>{const t=e.selection.getRng();const o=e.model.table.getSelectedCells();if(o.length>1){const e=o[0];const t=o[o.length-1];const n={firstCell:Je.fromDom(e),lastCell:Je.fromDom(t)};return N.some(n)}return N.some(Gg.range(Je.fromDom(t.startContainer),t.startOffset,Je.fromDom(t.endContainer),t.endOffset))}});const IV=e=>t=>({type:"node",root:e(),node:t});const PV=(e,t,o,n)=>{const s=jC(e);const r=()=>Je.fromDom(e.getBody());const a=()=>Je.fromDom(e.getContentAreaContainer());const c=()=>s||!n();return{inlineDialog:RV(a,t,c),inlineBottomDialog:BV(e.inline,a,o,c),banner:LV(a,t,c),cursor:HV(e,r),node:IV(r)}};const FV=e=>(t,o)=>{const n=HD(e);n(t,o)};const VV=e=>()=>yD(e);const jV=e=>t=>mD(e,t);const ZV=e=>t=>hD(e,t);const UV=e=>({colorPicker:FV(e),hasCustomColors:VV(e),getColors:jV(e),getColorCols:ZV(e)});const qV=e=>()=>_C(e);const WV=e=>({isDraggableModal:qV(e)});const $V=e=>{const t=cs(FC(e)?"bottom":"top");return{isPositionedAtTop:()=>t.get()==="top",getDockingMode:t.get,setDockingMode:t.set}};const GV=e=>Se(e,"items");const KV=e=>Se(e,"format");const YV=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}];const XV=e=>Ce(e,"items");const JV=e=>Ce(e,"block");const QV=e=>Ce(e,"inline");const ej=e=>Ce(e,"selector");const tj=e=>G(e,((e,t)=>{if(XV(t)){const o=tj(t.items);return{customFormats:e.customFormats.concat(o.customFormats),formats:e.formats.concat([{title:t.title,items:o.formats}])}}else if(QV(t)||JV(t)||ej(t)){const o=c(t.name)?t.name:t.title.toLowerCase();const n=`custom-${o}`;return{customFormats:e.customFormats.concat([{name:n,format:t}]),formats:e.formats.concat([{title:t.title,format:n,icon:t.icon}])}}else{return{...e,formats:e.formats.concat(t)}}}),{customFormats:[],formats:[]});const oj=(e,t)=>{const o=tj(t);const n=t=>{Z(t,(t=>{if(!e.formatter.has(t.name)){e.formatter.register(t.name,t.format)}}))};if(e.formatter){n(o.customFormats)}else{e.on("init",(()=>{n(o.customFormats)}))}return o.formats};const nj=e=>tC(e).map((t=>{const o=oj(e,t);return oC(e)?YV.concat(o):o})).getOr(YV);const sj=e=>{const t=ue(e);return t.length===1&&I(t,"title")};const rj=(e,t,o)=>({...e,type:"formatter",isSelected:t(e.format),getStylePreview:o(e.format)});const aj=(e,t,o,n)=>{const s=e=>rj(e,o,n);const r=e=>{const t=i(e.items);return{...e,type:"submenu",getStyleItems:x(t)}};const a=t=>{const s=c(t.name)?t.name:zd(t.title);const r=`custom-${s}`;const a={...t,type:"formatter",format:r,isSelected:o(r),getStylePreview:n(r)};e.formatter.register(s,a);return a};const i=e=>j(e,(e=>{if(GV(e)){return r(e)}else if(KV(e)){return s(e)}else if(sj(e)){return{...e,type:"separator"}}else{return a(e)}}));return i(t)};const cj=e=>{const t=t=>()=>e.formatter.match(t);const o=t=>()=>{const o=e.formatter.get(t);return o!==undefined?N.some({tag:o.length>0?o[0].inline||o[0].block||"div":"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):N.none()};const n=cs([]);const s=cs([]);const r=cs(false);e.on("PreInit",(s=>{const r=nj(e);const a=aj(e,r,t,o);n.set(a)}));e.on("addStyleModifications",(n=>{const a=aj(e,n.items,t,o);s.set(a);r.set(n.replace)}));const a=()=>{const e=r.get()?[]:n.get();const t=s.get();return e.concat(t)};return{getData:a}};const ij=e=>{const t=300;const o=t*.2;let n=0;const s=()=>n>0;const r=e=>[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[Bu(e.tooltipText)]}];const a=a=>({delayForShow:()=>s()?o:t,delayForHide:x(t),exclusive:true,lazySink:e,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]},tooltipComponents:r(a),onShow:(e,t)=>{n++;if(a.onShow){a.onShow(e,t)}},onHide:(e,t)=>{n--;if(a.onHide){a.onHide(e,t)}}});return{getConfig:a,getComponents:r}};const lj=e=>p(e)&&e.nodeType===1;const dj=NH.trim;const uj=e=>t=>{if(lj(t)){if(t.contentEditable===e){return true}if(t.getAttribute("data-mce-contenteditable")===e){return true}}return false};const fj=uj("true");const mj=uj("false");const gj=(e,t,o,n,s)=>({type:e,title:t,url:o,level:n,attach:s});const pj=e=>{let t=e;while(t=t.parentNode){const e=t.contentEditable;if(e&&e!=="inherit"){return fj(t)}}return false};const hj=(e,t)=>j(lp(Je.fromDom(t),e),(e=>e.dom));const yj=e=>e.innerText||e.textContent;const bj=e=>e.id?e.id:zd("h");const vj=e=>e&&e.nodeName==="A"&&(e.id||e.name)!==undefined;const kj=e=>vj(e)&&_j(e);const wj=e=>e&&/^(H[1-6])$/.test(e.nodeName);const _j=e=>pj(e)&&!mj(e);const xj=e=>wj(e)&&_j(e);const Cj=e=>wj(e)?parseInt(e.nodeName.substr(1),10):0;const Sj=e=>{var t;const o=bj(e);const n=()=>{e.id=o};return gj("header",(t=yj(e))!==null&&t!==void 0?t:"","#"+o,Cj(e),n)};const zj=e=>{const t=e.id||e.name;const o=yj(e);return gj("anchor",o?o:"#"+t,"#"+t,0,v)};const Tj=e=>j(W(e,xj),Sj);const Ej=e=>j(W(e,kj),zj);const Oj=e=>{const t=hj("h1,h2,h3,h4,h5,h6,a:not([href])",e);return t};const Aj=e=>dj(e.title).length>0;const Dj=e=>{const t=Oj(e);return W(Tj(t).concat(Ej(t)),Aj)};const Nj={find:Dj};const Mj="tinymce-url-history";const Rj=5;const Bj=e=>c(e)&&/^https?/.test(e);const Lj=e=>d(e)&&e.length<=Rj&&ee(e,Bj);const Hj=e=>i(e)&&we(e,(e=>!Lj(e))).isNone();const Ij=()=>{const e=KA.getItem(Mj);if(e===null){return{}}let t;try{t=JSON.parse(e)}catch(e){if(e instanceof SyntaxError){console.log("Local storage "+Mj+" was not valid JSON",e);return{}}throw e}if(!Hj(t)){console.log("Local storage "+Mj+" was not valid format",t);return{}}return t};const Pj=e=>{if(!Hj(e)){throw new Error("Bad format for history:\n"+JSON.stringify(e))}KA.setItem(Mj,JSON.stringify(e))};const Fj=e=>{const t=Ij();return xe(t,e).getOr([])};const Vj=(e,t)=>{if(!Bj(e)){return}const o=Ij();const n=xe(o,t).getOr([]);const s=W(n,(t=>t!==e));o[t]=[e].concat(s).slice(0,Rj);Pj(o)};const jj=e=>!!e;const Zj=e=>ge(NH.makeMap(e,/[, ]/),jj);const Uj=e=>N.from(pC(e));const qj=e=>{const t=N.from(bC(e)).filter(jj).map(Zj);return Uj(e).fold(A,(e=>t.fold(D,(e=>ue(e).length>0?e:false))))};const Wj=(e,t)=>{const o=qj(e);if(f(o)){return o?Uj(e):N.none()}else{return o[t]?Uj(e):N.none()}};const $j=(e,t)=>Wj(e,t).map((o=>n=>TN.nu((s=>{const r=(e,t)=>{if(!c(e)){throw new Error("Expected value to be string")}if(t!==undefined&&!i(t)){throw new Error("Expected meta to be a object")}const o={value:e,meta:t};s(o)};const a={filetype:t,fieldname:n.fieldname,...N.from(n.meta).getOr({})};o.call(e,r,n.value,a)}))));const Gj=e=>N.from(e).filter(c).getOrUndefined();const Kj=e=>{if(!vC(e)){return N.none()}return N.some({targets:Nj.find(e.getBody()),anchorTop:Gj(kC(e)),anchorBottom:Gj(wC(e))})};const Yj=e=>N.from(hC(e));const Xj=e=>({getHistory:Fj,addToHistory:Vj,getLinkInformation:()=>Kj(e),getValidationHandler:()=>Yj(e),getUrlPicker:t=>$j(e,t)});const Jj=(e,t,o,n)=>{const s=cs(false);const r=$V(t);const a={icons:()=>t.ui.registry.getAll().icons,menuItems:()=>t.ui.registry.getAll().menuItems,translate:xz.translate,isDisabled:()=>t.mode.isReadOnly()||!t.ui.isEnabled(),getOption:t.options.get,tooltips:ij(e.dialog)};const c=Xj(t);const i=cj(t);const l=UV(t);const d=WV(t);const u=()=>s.get();const f=e=>s.set(e);const m={shared:{providers:a,anchors:PV(t,o,n,r.isPositionedAtTop),header:r},urlinput:c,styles:i,colorinput:l,dialog:d,isContextMenuOpen:u,setContextMenuState:f};const g=e=>N.none();const p={...m,shared:{...m.shared,interpreter:e=>mV(e,{},p,g),getSink:e.popup}};const h={...m,shared:{...m.shared,interpreter:e=>mV(e,{},h,g),getSink:e.dialog}};return{popup:p,dialog:h}};const Qj=(e,t,o)=>{const n=(e,n)=>{Z([t,...o],(t=>{t.broadcastEvent(e,n)}))};const s=(e,n)=>{Z([t,...o],(t=>{t.broadcastOn([e],n)}))};const r=e=>s(Fh(),{target:e.target});const a=Wn();const c=Om(a,"touchstart",r);const i=Om(a,"touchmove",(e=>n(kc(),e)));const l=Om(a,"touchend",(e=>n(wc(),e)));const d=Om(a,"mousedown",r);const u=Om(a,"mouseup",(e=>{if(e.raw.button===0){s(jh(),{target:e.target})}}));const f=e=>s(Fh(),{target:Je.fromDom(e.target)});const m=e=>{if(e.button===0){s(jh(),{target:Je.fromDom(e.target)})}};const g=()=>{Z(e.editorManager.get(),(t=>{if(e!==t){t.dispatch("DismissPopups",{relatedTarget:e})}}))};const p=e=>n(_c(),Dm(e));const h=e=>{s(Vh(),{});n(xc(),Dm(e))};const y=Ut(Je.fromDom(e.getElement()));const b=Am(y,"scroll",(o=>{requestAnimationFrame((()=>{const s=e.getContainer();if(s!==undefined&&s!==null){const s=QC(e,t.element);const r=s.map((e=>[e.element,...e.others])).getOr([]);if(P(r,(e=>Ct(e,o.target)))){e.dispatch("ElementScroll",{target:o.target.dom});n(Ac(),o)}}}))}));const v=()=>s(Vh(),{});const k=t=>{if(t.state){s(Fh(),{target:Je.fromDom(e.getContainer())})}};const w=e=>{s(Fh(),{target:Je.fromDom(e.relatedTarget.getContainer())})};const _=t=>e.dispatch("focusin",t);const x=t=>e.dispatch("focusout",t);e.on("PostRender",(()=>{e.on("click",f);e.on("tap",f);e.on("mouseup",m);e.on("mousedown",g);e.on("ScrollWindow",p);e.on("ResizeWindow",h);e.on("ResizeEditor",v);e.on("AfterProgressState",k);e.on("DismissPopups",w);Z([t,...o],(e=>{e.element.dom.addEventListener("focusin",_);e.element.dom.addEventListener("focusout",x)}))}));e.on("remove",(()=>{e.off("click",f);e.off("tap",f);e.off("mouseup",m);e.off("mousedown",g);e.off("ScrollWindow",p);e.off("ResizeWindow",h);e.off("ResizeEditor",v);e.off("AfterProgressState",k);e.off("DismissPopups",w);Z([t,...o],(e=>{e.element.dom.removeEventListener("focusin",_);e.element.dom.removeEventListener("focusout",x)}));d.unbind();c.unbind();i.unbind();l.unbind();u.unbind();b.unbind()}));e.on("detach",(()=>{Z([t,...o],vh);Z([t,...o],(e=>e.destroy()))}))};const eZ=xb;const tZ=rb;const oZ=x([ia("shell",false),jr("makeItem"),ia("setupItem",v),Sy.field("listBehaviours",[m_])]);const nZ=()=>({behaviours:wi([m_.config({})])});const sZ=ob({name:"items",overrides:nZ});const rZ=x([sZ]);const aZ=x("CustomList");const cZ=(e,t,o,n)=>{const s=(t,o)=>{a(t).fold((()=>{console.error("Custom List was defined to not be a shell, but no item container was specified in components");throw new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(n=>{const s=m_.contents(n);const r=o.length;const a=r-s.length;const c=a>0?F(a,(()=>e.makeItem())):[];const i=s.slice(r);Z(i,(e=>m_.remove(n,e)));Z(c,(e=>m_.append(n,e)));const l=m_.contents(n);Z(l,((n,s)=>{e.setupItem(t,n,o[s],s)}))}))};const r=e.shell?{behaviours:[m_.config({})],components:[]}:{behaviours:[],components:t};const a=t=>e.shell?N.some(t):pb(t,e,"items");return{uid:e.uid,dom:e.dom,components:r.components,behaviours:Cy(e.listBehaviours,r.behaviours),apis:{setItems:s}}};const iZ=Rb({name:aZ(),configFields:oZ(),partFields:rZ(),factory:cZ,apis:{setItems:(e,t,o)=>{e.setItems(t,o)}}});const lZ=x([jr("dom"),ia("shell",true),_y("toolbarBehaviours",[m_])]);const dZ=()=>({behaviours:wi([m_.config({})])});const uZ=x([ob({name:"groups",overrides:dZ})]);const fZ=(e,t,o,n)=>{const s=(e,t)=>{r(e).fold((()=>{console.error("Toolbar was defined to not be a shell, but no groups container was specified in components");throw new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(e=>{m_.set(e,t)}))};const r=t=>e.shell?N.some(t):pb(t,e,"groups");const a=e.shell?{behaviours:[m_.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:a.components,behaviours:Cy(e.toolbarBehaviours,a.behaviours),apis:{setGroups:s,refresh:v},domModification:{attributes:{role:"group"}}}};const mZ=Rb({name:"Toolbar",configFields:lZ(),partFields:uZ(),factory:fZ,apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)}}});const gZ=v;const pZ=A;const hZ=x([]);var yZ=Object.freeze({__proto__:null,setup:gZ,isDocked:pZ,getBehaviours:hZ});const bZ=x(zd("toolbar-height-change"));const vZ={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"};const kZ="tox-tinymce--toolbar-sticky-on";const wZ="tox-tinymce--toolbar-sticky-off";const _Z=(e,t)=>{const o=zt(t);const n=Ot(t);const s=n.dom.innerHeight;const r=Vn(o);const a=Je.fromDom(e.elm);const c=ns(a);const i=xo(a);const l=c.y;const d=l+i;const u=Ao(t);const f=xo(t);const m=u.top;const g=m+f;const p=Math.abs(m-r.top)<2;const h=Math.abs(g-(r.top+s))<2;if(p&&l<g){jn(r.left,l-f,o)}else if(h&&d>m){const e=l-s+i+f;jn(r.left,e,o)}};const xZ=(e,t)=>I(wd.getModes(e),t);const CZ=e=>{const t=e=>Co(e)+(parseInt(go(e,"margin-top"),10)||0)+(parseInt(go(e,"margin-bottom"),10)||0);const o=e.element;Nt(o).each((n=>{const s="padding-"+wd.getModes(e)[0];if(wd.isDocked(e)){const e=Ro(n);uo(o,"width",e+"px");uo(n,s,t(o)+"px")}else{vo(o,"width");vo(n,s)}}))};const SZ=(e,t)=>{if(t){Hi(e,vZ.fadeOutClass);Fi(e,[vZ.transitionClass,vZ.fadeInClass])}else{Hi(e,vZ.fadeInClass);Fi(e,[vZ.fadeOutClass,vZ.transitionClass])}};const zZ=(e,t)=>{const o=Je.fromDom(e.getContainer());if(t){Bi(o,kZ);Hi(o,wZ)}else{Bi(o,wZ);Hi(o,kZ)}};const TZ=(e,t)=>{const o=zt(t);sm(o).filter((e=>!Ct(t,e))).filter((t=>Ct(t,Je.fromDom(o.dom.body))||St(e,t))).each((()=>tm(t)))};const EZ=(e,t)=>rm(e).orThunk((()=>t().toOptional().bind((e=>rm(e.element)))));const OZ=(e,t,o)=>{if(!e.inline){if(!t.header.isPositionedAtTop()){e.on("ResizeEditor",(()=>{o().each(wd.reset)}))}e.on("ResizeWindow ResizeEditor",(()=>{o().each(CZ)}));e.on("SkinLoaded",(()=>{o().each((e=>{wd.isDocked(e)?wd.reset(e):wd.refresh(e)}))}));e.on("FullscreenStateChanged",(()=>{o().each(wd.reset)}))}e.on("AfterScrollIntoView",(e=>{o().each((t=>{wd.refresh(t);const o=t.element;if(vk(o)){_Z(e,o)}}))}));e.on("PostRender",(()=>{zZ(e,false)}))};const AZ=e=>e().map(wd.isDocked).getOr(false);const DZ=()=>[Jf.config({channels:{[bZ()]:{onReceive:CZ}}})];const NZ=(e,t)=>{const o=us();const n=t.getSink;const s=e=>{n().each((t=>e(t.element)))};const r=t=>{if(!e.inline){CZ(t)}zZ(e,wd.isDocked(t));t.getSystem().broadcastOn([Vh()],{});n().each((e=>e.getSystem().broadcastOn([Vh()],{})))};const a=e.inline?[]:DZ();return[C_.config({}),wd.config({contextual:{lazyContext:t=>{const o=Co(t.element);const n=e.inline?e.getContentAreaContainer():e.getContainer();return N.from(n).map((n=>{const s=os(Je.fromDom(n));const r=QC(e,t.element);return r.fold((()=>{const e=s.height-o;const n=s.y+(xZ(t,"top")?0:o);return ts(s.x,n,s.width,e)}),(e=>{const n=ss(s,eS(e));const r=xZ(t,"top")?n.y:n.y+o;return ts(n.x,r,n.width,n.height-o)}))}))},onShow:()=>{s((e=>SZ(e,true)))},onShown:e=>{s((e=>Vi(e,[vZ.transitionClass,vZ.fadeInClass])));o.get().each((t=>{TZ(e.element,t);o.clear()}))},onHide:e=>{EZ(e.element,n).fold(o.clear,o.set);s((e=>SZ(e,false)))},onHidden:()=>{s((e=>Vi(e,[vZ.transitionClass])))},...vZ},lazyViewport:t=>{const o=QC(e,t.element);return o.fold((()=>{const o=as();const n=fC(e);const s=o.y+(xZ(t,"top")?n:0);const r=o.height-(xZ(t,"bottom")?n:0);return{bounds:ts(o.x,s,o.width,r),optScrollEnv:N.none()}}),(e=>{const t=eS(e);return{bounds:t,optScrollEnv:N.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Ao(e.element).top})}}))},modes:[t.header.getDockingMode()],onDocked:r,onUndocked:r}),...a]};var MZ=Object.freeze({__proto__:null,setup:OZ,isDocked:AZ,getBehaviours:NZ});const RZ=e=>{const t=e.editor;const o=e.sticky?NZ:hZ;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:wi(o(t,e.sharedBackstage))}};const BZ=mr([$T,Zr("items",pr([br([GT,Jr("items",_r)]),_r]))].concat(EE));const LZ=e=>Mr("GroupToolbarButton",BZ,e);const HZ=[oa("text"),oa("tooltip"),oa("icon"),la("search",false,pr([xr,mr([oa("placeholder")])],(e=>{if(f(e)){return e?N.some({placeholder:N.none()}):N.none()}else{return N.some(e)}}))),Gr("fetch"),ga("onSetup",(()=>v))];const IZ=mr([$T,...HZ]);const PZ=e=>Mr("menubutton",IZ,e);const FZ=mr([$T,lE,iE,aE,fE,eE,sE,fa("presets","normal",["normal","color","listpreview"]),yE(1),oE,nE]);const VZ=e=>Mr("SplitButton",FZ,e);const jZ=(e,t)=>{const o=(e,o)=>{const n=j(o,(e=>{const o={type:"menubutton",text:e.text,fetch:t=>{t(e.getItems())}};const n=PZ(o).mapError((e=>Lr(e))).getOrDie();return jP(n,"tox-mbtn",t.backstage,N.some("menuitem"))}));m_.set(e,n)};const n={focus:Qw.focusIn,setMenus:o};return{uid:e.uid,dom:e.dom,components:[],behaviours:wi([m_.config({}),p_("menubar-events",[oi((t=>{e.onSetup(t)})),Wc(Ka(),((e,t)=>{Qu(e.element,"."+"tox-mbtn--active").each((o=>{ef(t.event.target,"."+"tox-mbtn").each((t=>{if(!Ct(o,t)){e.getSystem().getByDom(o).each((o=>{e.getSystem().getByDom(t).each((e=>{qN.expand(e);qN.close(o);C_.focus(e)}))}))}}))}))})),Wc(Ec(),((e,t)=>{t.event.prevFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((o=>{t.event.newFocus.bind((t=>e.getSystem().getByDom(t).toOptional())).each((e=>{if(qN.isOpen(o)){qN.expand(e);qN.close(o)}}))}))}))]),Qw.config({mode:"flow",selector:"."+"tox-mbtn",onEscape:t=>{e.onEscape(t);return N.some(true)}}),dS.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}};var ZZ=Mb({factory:jZ,name:"silver.Menubar",configFields:[jr("dom"),jr("uid"),jr("onEscape"),jr("backstage"),ia("onSetup",v)],apis:{focus:(e,t)=>{e.focus(t)},setMenus:(e,t,o)=>{e.setMenus(t,o)}}});const UZ="⚡️Upgrade";const qZ="https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral";const WZ=e=>({uid:e.uid,dom:e.dom,components:[{dom:{tag:"a",attributes:{href:qZ,rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:UZ}}]});const $Z="container";const GZ=[_y("slotBehaviours",[])];const KZ=e=>"<alloy.field."+e+">";const YZ=e=>{const t=(()=>{const e=[];const t=(t,o)=>{e.push(t);return db($Z,KZ(t),o)};return{slot:t,record:x(e)}})();const o=e(t);const n=t.record();const s=j(n,(e=>eb({name:e,pname:KZ(e)})));return Tb($Z,GZ,s,XZ,o)};const XZ=(e,t)=>{const o=t=>vb(e);const n=(t,o)=>pb(t,e,o);const s=(t,o)=>(n,s)=>pb(n,e,s).map((e=>t(e,s))).getOr(o);const r=e=>(t,o)=>{Z(o,(o=>e(t,o)))};const a=(e,t)=>no(e.element,"aria-hidden")!=="true";const c=(e,t)=>{if(!a(e)){const o=e.element;vo(o,"display");ao(o,"aria-hidden");Lc(e,Oc(),{name:t,visible:true})}};const i=(e,t)=>{if(a(e)){const o=e.element;uo(o,"display","none");to(o,"aria-hidden","true");Lc(e,Oc(),{name:t,visible:false})}};const l=s(a,false);const d=s(i);const u=r(d);const f=e=>u(e,o());const m=s(c);const g={getSlotNames:o,getSlot:n,isShowing:l,hideSlot:d,hideAllSlots:f,showSlot:m};return{uid:e.uid,dom:e.dom,components:t,behaviours:xy(e.slotBehaviours),apis:g}};const JZ=ge({getSlotNames:(e,t)=>e.getSlotNames(t),getSlot:(e,t,o)=>e.getSlot(t,o),isShowing:(e,t,o)=>e.isShowing(t,o),hideSlot:(e,t,o)=>e.hideSlot(t,o),hideAllSlots:(e,t)=>e.hideAllSlots(t),showSlot:(e,t,o)=>e.showSlot(t,o)},(e=>jd(e)));const QZ={...JZ,...{sketch:YZ}};const eU=mr([iE,lE,ga("onShow",v),ga("onHide",v),sE]);const tU=e=>Mr("sidebar",eU,e);const oU=e=>{const{sidebars:t}=e.ui.registry.getAll();Z(ue(t),(o=>{const n=t[o];const s=()=>ze(N.from(e.queryCommandValue("ToggleSidebar")),o);e.ui.registry.addToggleButton(o,{icon:n.icon,tooltip:n.tooltip,onAction:t=>{e.execCommand("ToggleSidebar",false,o);t.setActive(s())},onSetup:t=>{t.setActive(s());const o=()=>t.setActive(s());e.on("ToggleSidebar",o);return()=>{e.off("ToggleSidebar",o)}}})}))};const nU=e=>({element:()=>e.element.dom});const sU=(e,t)=>{const o=j(ue(t),(e=>{const o=t[e];const n=Rr(tU(o));return{name:e,getApi:nU,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}));return j(o,(t=>{const n=cs(v);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:pO.unnamedEvents([EO(t,n),OO(t,n),Wc(Oc(),((e,t)=>{const n=t.event;const s=Y(o,(e=>e.name===n.name));s.each((t=>{const o=n.visible?t.onShow:t.onHide;o(t.getApi(e))}))}))])})}))};const rU=e=>QZ.sketch((t=>({dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:sU(t,e),slotBehaviours:pO.unnamedEvents([oi((e=>QZ.hideAllSlots(e)))])})));const aU=(e,t,o)=>{const n=Pb.getCurrent(e);n.each((n=>{m_.set(n,[rU(t)]);const s=o===null||o===void 0?void 0:o.toLowerCase();if(c(s)&&Ce(t,s)){Pb.getCurrent(n).each((t=>{QZ.showSlot(t,s);FP.immediateGrow(n);vo(n.element,"width");cU(e.element,"region")}))}}))};const cU=(e,t)=>{to(e,"role",t)};const iU=(e,t)=>{const o=Pb.getCurrent(e);o.each((o=>{const n=Pb.getCurrent(o);n.each((n=>{if(FP.hasGrown(o)){if(QZ.isShowing(n,t)){FP.shrink(o);cU(e.element,"presentation")}else{QZ.hideAllSlots(n);QZ.showSlot(n,t);cU(e.element,"region")}}else{QZ.hideAllSlots(n);QZ.showSlot(n,t);FP.grow(o);cU(e.element,"region")}}))}))};const lU=e=>{const t=Pb.getCurrent(e);return t.bind((e=>{const t=FP.isGrowing(e)||FP.hasGrown(e);if(t){const t=Pb.getCurrent(e);return t.bind((e=>Y(QZ.getSlotNames(e),(t=>QZ.isShowing(e,t)))))}else{return N.none()}}))};const dU=zd("FixSizeEvent");const uU=zd("AutoSizeEvent");const fU=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:wi([dS.config({}),C_.config({}),FP.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:e=>{const t=Pb.getCurrent(e);t.each(QZ.hideAllSlots);Bc(e,uU)},onGrown:e=>{Bc(e,uU)},onStartGrow:e=>{Lc(e,dU,{width:ho(e.element,"width").getOr("")})},onStartShrink:e=>{Lc(e,dU,{width:Ro(e.element)+"px"})}}),m_.config({}),Pb.config({find:e=>{const t=m_.contents(e);return ce(t)}})])}],behaviours:wi([vH.childAt(0),p_("sidebar-sliding-events",[Wc(dU,((e,t)=>{uo(e.element,"width",t.event.width)})),Wc(uU,((e,t)=>{vo(e.element,"width")}))])])});const mU=(e,t,o,n)=>{to(e.element,"aria-busy",true);const s=t.getRoot(e).getOr(e);const r=wi([Qw.config({mode:"special",onTab:()=>N.some(true),onShiftTab:()=>N.some(true)}),C_.config({})]);const a=n(s,r);const c=s.getSystem().build(a);m_.append(s,Vu(c));if(c.hasConfigured(Qw)&&t.focus){Qw.focusIn(c)}if(!o.isBlocked()){t.onBlock(e)}o.blockWith((()=>m_.remove(s,c)))};const gU=(e,t,o)=>{ao(e.element,"aria-busy");if(o.isBlocked()){t.onUnblock(e)}o.clear()};const pU=(e,t,o)=>o.isBlocked();var hU=Object.freeze({__proto__:null,block:mU,unblock:gU,isBlocked:pU});var yU=[ga("getRoot",N.none),ma("focus",true),ud("onBlock"),ud("onUnblock")];const bU=()=>{const e=ls();const t=t=>{e.set({destroy:t})};return ki({readState:e.isSet,blockWith:t,clear:e.clear,isBlocked:e.isSet})};var vU=Object.freeze({__proto__:null,init:bU});const kU=xi({fields:yU,name:"blocking",apis:hU,state:vU});const wU=e=>(t,o)=>({dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:rS('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]});const _U=e=>Pb.getCurrent(e).each((e=>tm(e.element,true)));const xU=(e,t)=>{const o="tabindex";const n=`data-mce-${o}`;N.from(e.iframeElement).map(Je.fromDom).each((e=>{if(t){so(e,o).each((t=>to(e,n,t)));to(e,o,-1)}else{ao(e,o);so(e,n).each((t=>{to(e,o,t);ao(e,n)}))}}))};const CU=(e,t,o,n)=>{const s=t.element;xU(e,o);if(o){kU.block(t,wU(n));vo(s,"display");ao(s,"aria-hidden");if(e.hasFocus()){_U(t)}}else{const o=Pb.getCurrent(t).exists((e=>nm(e.element)));kU.unblock(t);uo(s,"display","none");to(s,"aria-hidden","true");if(o){e.focus()}}};const SU=e=>({uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:wi([m_.config({}),kU.config({focus:false}),Pb.config({find:e=>ce(e.components())})]),components:[]});const zU=e=>e.type==="focusin";const TU=e=>{if(zU(e)){const t=e.composed?ce(e.composedPath()):N.from(e.target);return t.map(Je.fromDom).filter(pt).exists((e=>Pi(e,"mce-pastebin")))}else{return false}};const EU=(e,t,o)=>{const n=cs(false);const s=us();const r=o=>{if(n.get()&&!TU(o)){o.preventDefault();_U(t());e.editorManager.setActive(e)}};if(!e.inline){e.on("PreInit",(()=>{e.dom.bind(e.getWin(),"focusin",r);e.on("BeforeExecCommand",(e=>{if(e.command.toLowerCase()==="mcefocus"&&e.value!==true){r(e)}}))}))}const a=s=>{if(s!==n.get()){n.set(s);CU(e,t(),s,o.providers);MA(e,s)}};e.on("ProgressState",(t=>{s.on(clearTimeout);if(y(t.time)){const o=Px.setEditorTimeout(e,(()=>a(t.state)),t.time);s.set(o)}else{a(t.state);s.clear()}}))};const OU=(e,t)=>{const o={len:0,list:[]};const n=G(e,((e,o)=>{const n=t(o,e.len);return n.fold(x(e),(t=>({len:t.finish,list:e.list.concat([t])})))}),o);return n.list};const AU=(e,t,o)=>({within:e,extra:t,withinWidth:o});const DU=(e,t,o)=>{const n=OU(e,((e,t)=>{const n=o(e);return N.some({element:e,start:t,finish:t+n,width:n})}));const s=W(n,(e=>e.finish<=t));const r=$(s,((e,t)=>e+t.width),0);const a=n.slice(s.length);return{within:s,extra:a,withinWidth:r}};const NU=e=>j(e,(e=>e.element));const MU=(e,t,o)=>{const n=NU(e.concat(t));return AU(n,[],o)};const RU=(e,t,o,n)=>{const s=NU(e).concat([o]);return AU(s,NU(t),n)};const BU=(e,t,o)=>AU(NU(e),[],o);const LU=(e,t,o)=>{const n=DU(t,e,o);return n.extra.length===0?N.some(n):N.none()};const HU=(e,t,o,n)=>{const s=LU(e,t,o).getOrThunk((()=>DU(t,e-o(n),o)));const r=s.within;const a=s.extra;const c=s.withinWidth;if(a.length===1&&a[0].width<=o(n)){return MU(r,a,c)}else if(a.length>=1){return RU(r,a,n,c)}else{return BU(r,a,c)}};const IU=(e,t)=>{const o=j(t,(e=>Vu(e)));mZ.setGroups(e,o)};const PU=e=>de(e,(e=>rm(e.element).bind((t=>e.getSystem().getByDom(t).toOptional()))));const FU=(e,t,o)=>{const n=t.builtGroups.get();if(n.length===0){return}const s=hb(e,t,"primary");const r=vN.getCoupled(e,"overflowGroup");uo(s.element,"visibility","hidden");const a=n.concat([r]);const c=PU(a);o([]);IU(s,a);const i=Ro(s.element);const l=HU(i,t.builtGroups.get(),(e=>Math.ceil(e.element.dom.getBoundingClientRect().width)),r);if(l.extra.length===0){m_.remove(s,r);o([])}else{IU(s,l.within);o(l.extra)}vo(s.element,"visibility");ko(s.element);c.each(C_.focus)};const VU=x([_y("splitToolbarBehaviours",[vN]),Fr("builtGroups",(()=>cs([])))]);const jU=x([ld(["overflowToggledClass"]),sa("getOverflowBounds"),jr("lazySink"),Fr("overflowGroups",(()=>cs([]))),ud("onOpened"),ud("onClosed")].concat(VU()));const ZU=x([eb({factory:mZ,schema:lZ(),name:"primary"}),tb({schema:lZ(),name:"overflow"}),tb({name:"overflow-button"}),tb({name:"overflow-group"})]);const UU=x(((e,t)=>{Lo(e,Math.floor(t))}));const qU=x([ld(["toggledClass"]),jr("lazySink"),Gr("fetch"),sa("getBounds"),aa("fireDismissalEventInstead",[ia("event",zc())]),lg(),ud("onToggled")]);const WU=x([tb({name:"button",overrides:e=>({dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:wi([Z_.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:false,onToggled:e.onToggled})])})}),tb({factory:mZ,schema:lZ(),name:"toolbar",overrides:e=>({toolbarBehaviours:wi([Qw.config({mode:"cyclic",onEscape:t=>{pb(t,e,"button").each(C_.focus);return N.none()}})])})})]);const $U=us();const GU=(e,t)=>{$U.set(true);KU(e,t);$U.clear()};const KU=(e,t)=>{const o=vN.getCoupled(e,"toolbarSandbox");if(Ph.isOpen(o)){Ph.close(o)}else{Ph.open(o,t.toolbar())}};const YU=(e,t,o,n)=>{const s=o.getBounds.map((e=>e()));const r=o.lazySink(e).getOrDie();th.positionWithinBounds(r,t,{anchor:{type:"hotspot",hotspot:e,layouts:n,overrides:{maxWidthFunction:UU()}}},s)};const XU=(e,t,o,n,s)=>{mZ.setGroups(t,s);YU(e,t,o,n);Z_.on(e)};const JU=(e,t,o)=>{const n=nf();const s=(s,r)=>{const a=$U.get().getOr(false);o.fetch().get((s=>{XU(e,r,o,t.layouts,s);n.link(e.element);if(!a){Qw.focusIn(r)}}))};const r=()=>{Z_.off(e);if(!$U.get().getOr(false)){C_.focus(e)}n.unlink(e.element)};return{dom:{tag:"div",attributes:{id:n.id}},behaviours:wi([Qw.config({mode:"special",onEscape:e=>{Ph.close(e);return N.some(true)}}),Ph.config({onOpen:s,onClose:r,isPartOf:(t,o,n)=>rf(o,n)||rf(e,n),getAttachPoint:()=>o.lazySink(e).getOrDie()}),Jf.config({channels:{...Uh({isExtraPart:A,...o.fireDismissalEventInstead.map((e=>({fireEventInstead:{event:e.event}}))).getOr({})}),...Wh({doReposition:()=>{Ph.getState(vN.getCoupled(e,"toolbarSandbox")).each((n=>{YU(e,n,o,t.layouts)}))}})}})])}};const QU=(e,t,o,n)=>({...oS.sketch({...n.button(),action:e=>{KU(e,n)},buttonBehaviours:Sy.augment({dump:n.button().buttonBehaviours},[vN.config({others:{toolbarSandbox:t=>JU(t,o,e)}})])}),apis:{setGroups:(t,n)=>{Ph.getState(vN.getCoupled(t,"toolbarSandbox")).each((s=>{XU(t,s,e,o.layouts,n)}))},reposition:t=>{Ph.getState(vN.getCoupled(t,"toolbarSandbox")).each((n=>{YU(t,n,e,o.layouts)}))},toggle:e=>{KU(e,n)},toggleWithoutFocusing:e=>{GU(e,n)},getToolbar:e=>Ph.getState(vN.getCoupled(e,"toolbarSandbox")),isOpen:e=>Ph.isOpen(vN.getCoupled(e,"toolbarSandbox"))}});const eq=Rb({name:"FloatingToolbarButton",factory:QU,configFields:qU(),partFields:WU(),apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggleWithoutFocusing(t)},getToolbar:(e,t)=>e.getToolbar(t),isOpen:(e,t)=>e.isOpen(t)}});const tq=x([jr("items"),ld(["itemSelector"]),_y("tgroupBehaviours",[Qw])]);const oq=x([nb({name:"items",unit:"item"})]);const nq=(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,behaviours:Cy(e.tgroupBehaviours,[Qw.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}});const sq=Rb({name:"ToolbarGroup",configFields:tq(),partFields:oq(),factory:nq});const rq=e=>j(e,(e=>Vu(e)));const aq=(e,t,o)=>{FU(e,o,(n=>{o.overflowGroups.set(n);t.getOpt(e).each((e=>{eq.setGroups(e,rq(n))}))}))};const cq=(e,t,o,n)=>{const s=aS(eq.sketch({fetch:()=>TN.nu((t=>{t(rq(e.overflowGroups.get()))})),layouts:{onLtr:()=>[Bf,Rf],onRtl:()=>[Rf,Bf],onBottomLtr:()=>[Hf,Lf],onBottomRtl:()=>[Lf,Hf]},getBounds:o.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:n["overflow-button"](),toolbar:n.overflow()},onToggled:(t,o)=>e[o?"onOpened":"onClosed"](t)}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Cy(e.splitToolbarBehaviours,[vN.config({others:{overflowGroup:()=>sq.sketch({...n["overflow-group"](),items:[s.asSpec()]})}})]),apis:{setGroups:(t,o)=>{e.builtGroups.set(j(o,t.getSystem().build));aq(t,s,e)},refresh:t=>aq(t,s,e),toggle:e=>{s.getOpt(e).each((e=>{eq.toggle(e)}))},toggleWithoutFocusing:e=>{s.getOpt(e).each(eq.toggleWithoutFocusing)},isOpen:e=>s.getOpt(e).map(eq.isOpen).getOr(false),reposition:e=>{s.getOpt(e).each((e=>{eq.reposition(e)}))},getOverflow:e=>s.getOpt(e).bind(eq.getToolbar)},domModification:{attributes:{role:"group"}}}};const iq=Rb({name:"SplitFloatingToolbar",configFields:jU(),partFields:ZU(),factory:cq,apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},reposition:(e,t)=>{e.reposition(t)},toggle:(e,t)=>{e.toggle(t)},toggleWithoutFocusing:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t),getOverflow:(e,t)=>e.getOverflow(t)}});const lq=x([ld(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),ud("onOpened"),ud("onClosed")].concat(VU()));const dq=x([eb({factory:mZ,schema:lZ(),name:"primary"}),eb({factory:mZ,schema:lZ(),name:"overflow",overrides:e=>({toolbarBehaviours:wi([FP.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:t=>{pb(t,e,"overflow-button").each((e=>{Z_.off(e)}));e.onClosed(t)},onGrown:t=>{e.onOpened(t)},onStartGrow:t=>{pb(t,e,"overflow-button").each(Z_.on)}}),Qw.config({mode:"acyclic",onEscape:t=>{pb(t,e,"overflow-button").each(C_.focus);return N.some(true)}})])})}),tb({name:"overflow-button",overrides:e=>({buttonBehaviours:wi([Z_.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:false})])})}),tb({name:"overflow-group"})]);const uq=(e,t)=>pb(e,t,"overflow").map(FP.hasGrown).getOr(false);const fq=(e,t,o)=>{pb(e,t,"overflow-button").each((n=>{pb(e,t,"overflow").each((s=>{mq(e,t);if(FP.hasShrunk(s)){const e=t.onOpened;t.onOpened=n=>{if(!o){Qw.focusIn(s)}e(n);t.onOpened=e}}else{const e=t.onClosed;t.onClosed=s=>{if(!o){C_.focus(n)}e(s);t.onClosed=e}}FP.toggleGrow(s)}))}))};const mq=(e,t)=>{pb(e,t,"overflow").each((o=>{FU(e,t,(e=>{const t=j(e,(e=>Vu(e)));mZ.setGroups(o,t)}));pb(e,t,"overflow-button").each((e=>{if(FP.hasGrown(o)){Z_.on(e)}}));FP.refresh(o)}))};const gq=(e,t,o,n)=>{const s="alloy.toolbar.toggle";const r=(t,o)=>{const n=j(o,t.getSystem().build);e.builtGroups.set(n)};return{uid:e.uid,dom:e.dom,components:t,behaviours:Cy(e.splitToolbarBehaviours,[vN.config({others:{overflowGroup:e=>sq.sketch({...n["overflow-group"](),items:[oS.sketch({...n["overflow-button"](),action:t=>{Bc(e,s)}})]})}}),p_("toolbar-toggle-events",[Wc(s,(t=>{fq(t,e,false)}))])]),apis:{setGroups:(t,o)=>{r(t,o);mq(t,e)},refresh:t=>mq(t,e),toggle:t=>{fq(t,e,false)},toggleWithoutFocusing:t=>{fq(t,e,true)},isOpen:t=>uq(t,e)},domModification:{attributes:{role:"group"}}}};const pq=Rb({name:"SplitSlidingToolbar",configFields:lq(),partFields:dq(),factory:gq,apis:{setGroups:(e,t,o)=>{e.setGroups(t,o)},refresh:(e,t)=>{e.refresh(t)},toggle:(e,t)=>{e.toggle(t)},isOpen:(e,t)=>e.isOpen(t)}});const hq=e=>{const t=e.title.fold((()=>({})),(e=>({attributes:{title:e}})));return{dom:{tag:"div",classes:["tox-toolbar__group"],...t},components:[sq.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), "+".tox-split-button:not([disabled]), "+".tox-toolbar-nav-js:not([disabled]), "+".tox-number-input:not([disabled])"},tgroupBehaviours:wi([dS.config({}),C_.config({})])}};const yq=e=>sq.sketch(hq(e));const bq=(e,t)=>{const o=oi((t=>{const o=j(e.initGroups,yq);mZ.setGroups(t,o)}));return wi([zO.toolbarButton(e.providers.isDisabled),wO(),Qw.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),p_("toolbar-events",[o])])};const vq=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":hq({title:N.none(),items:[]}),"overflow-button":OF({name:"more",icon:N.some("more-drawer"),enabled:true,tooltip:N.some("Reveal or hide additional toolbar items"),primary:false,buttonType:N.none(),borderless:false},N.none(),e.providers,[],"overflow-button")},splitToolbarBehaviours:bq(e,t)}};const kq=e=>{const t=vq(e);const o=4;const n=iq.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return iq.sketch({...t,lazySink:e.getSink,getOverflowBounds:()=>{const t=e.moreDrawerData.lazyHeader().element;const n=ns(t);const s=Et(t);const r=ns(s);const a=Math.max(s.dom.scrollHeight,r.height);return ts(n.x+o,r.y,n.width-o*2,a)},parts:{...t.parts,overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}},components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>e.onToggled(t,true),onClosed:t=>e.onToggled(t,false)})};const wq=e=>{const t=pq.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});const o=pq.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}});const n=vq(e);return pq.sketch({...n,components:[t,o],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:t=>{t.getSystem().broadcastOn([bZ()],{type:"opened"});e.onToggled(t,true)},onClosed:t=>{t.getSystem().broadcastOn([bZ()],{type:"closed"});e.onToggled(t,false)}})};const _q=e=>{const t=e.cyclicKeying?"cyclic":"acyclic";return mZ.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===Zx.scrolling?["tox-toolbar--scrolling"]:[])},components:[mZ.parts.groups({})],toolbarBehaviours:bq(e,t)})};const xq=[aE,iE,oa("tooltip"),fa("buttonType","secondary",["primary","secondary"]),ma("borderless",false),Gr("onAction")];const Cq=[...xq,YT,Wr("type",["button"])];const Sq=[...xq,ma("active",false),Wr("type",["togglebutton"])];const zq={button:Cq,togglebutton:Sq};const Tq=[Wr("type",["group"]),ha("buttons",[],Hr("type",zq))];const Eq=Hr("type",{...zq,group:Tq});const Oq=mr([ha("buttons",[],Eq),Gr("onShow"),Gr("onHide")]);const Aq=e=>Mr("view",Oq,e);const Dq=(e,t)=>{var o,n;const s=e.type==="togglebutton";const r=e.icon.map((e=>xI(e,t.icons))).map(aS);const a=()=>o=>{const n=e=>{r.map((n=>n.getOpt(o).each((o=>{m_.set(o,[xI(e,t.icons)])}))))};const a=e=>{const t=o.element;if(e){Bi(t,"tox-button--enabled");to(t,"aria-pressed",true)}else{Hi(t,"tox-button--enabled");ao(t,"aria-pressed")}};const c=()=>Pi(o.element,"tox-button--enabled");if(s){return e.onAction({setIcon:n,setActive:a,isActive:c})}if(e.type==="button"){return e.onAction({setIcon:n})}};const c=a();const i={...e,name:s?e.text.getOr(e.icon.getOr("")):(o=e.text)!==null&&o!==void 0?o:e.icon.getOr(""),primary:e.buttonType==="primary",buttonType:N.from(e.buttonType),tooltip:e.tooltip,icon:e.icon,enabled:true,borderless:e.borderless};const l=AF((n=e.buttonType)!==null&&n!==void 0?n:"secondary");const d=s?e.text.map(t.translate):N.some(t.translate(e.text));const u=d.map(Bu);const f=i.tooltip.or(d).map((e=>({"aria-label":t.translate(e)}))).getOr({});const m=r.map((e=>e.asSpec()));const g=NO([m,u]);const p=e.icon.isSome()&&u.isSome();const h={tag:"button",classes:l.concat(...e.icon.isSome()&&!p?["tox-button--icon"]:[]).concat(...p?["tox-button--icon-and-text"]:[]).concat(...e.borderless?["tox-button--naked"]:[]).concat(...e.type==="togglebutton"&&e.active?["tox-button--enabled"]:[]),attributes:f};const y=[];const b=EF(i,N.some(c),y,h,g,e.tooltip,t);return oS.sketch(b)};const Nq=(e,t)=>Dq(e,t);const Mq=(e,t)=>({dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:j(e.buttons,(e=>Nq(e,t)))});const Rq=Sn().deviceType;const Bq=Rq.isPhone();const Lq=Rq.isTablet();const Hq=e=>{let t=false;const o=j(e.buttons,(o=>{if(o.type==="group"){t=true;return Mq(o,e.providers)}else{return Nq(o,e.providers)}}));return{uid:e.uid,dom:{tag:"div",classes:[!t?"tox-view__header":"tox-view__toolbar",...Bq||Lq?["tox-view--mobile","tox-view--scrolling"]:[]]},behaviours:wi([C_.config({}),Qw.config({mode:"flow",selector:"button, .tox-button",focusInside:Gv.OnEnterOrSpaceMode})]),components:t?o:[RM.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),RM.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:o})]}};const Iq=e=>({uid:e.uid,behaviours:wi([C_.config({}),dS.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}});const Pq=(e,t,o,n)=>{const s={getPane:t=>eZ.getPart(t,e,"pane"),getOnShow:t=>e.viewConfig.onShow,getOnHide:t=>e.viewConfig.onHide};return{uid:e.uid,dom:e.dom,components:t,behaviours:wi([C_.config({}),Qw.config({mode:"cyclic",focusInside:Gv.OnEnterOrSpaceMode})]),apis:s}};var Fq=Rb({name:"silver.View",configFields:[jr("viewConfig")],partFields:[ob({factory:{sketch:Hq},schema:[jr("buttons"),jr("providers")],name:"header"}),ob({factory:{sketch:Iq},schema:[],name:"pane"})],factory:Pq,apis:{getPane:(e,t)=>e.getPane(t),getOnShow:(e,t)=>e.getOnShow(t),getOnHide:(e,t)=>e.getOnHide(t)}});const Vq=(e,t,o)=>ke(t,((t,n)=>{const s=Rr(Aq(t));return e.slot(n,Fq.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:s,components:[...s.buttons.length>0?[Fq.parts.header({buttons:s.buttons,providers:o})]:[],Fq.parts.pane({})]}))}));const jq=(e,t)=>QZ.sketch((o=>({dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:Vq(o,e,t),slotBehaviours:pO.unnamedEvents([oi((e=>QZ.hideAllSlots(e)))])})));const Zq=e=>Y(QZ.getSlotNames(e),(t=>QZ.isShowing(e,t)));const Uq=e=>{const t=e.element;uo(t,"display","none");to(t,"aria-hidden","true")};const qq=e=>{const t=e.element;vo(t,"display");ao(t,"aria-hidden")};const Wq=e=>({getContainer:x(e)});const $q=(e,t,o)=>{QZ.getSlot(e,t).each((e=>{Fq.getPane(e).each((t=>{const n=o(e);n(Wq(t.element.dom))}))}))};const Gq=(e,t)=>$q(e,t,Fq.getOnShow);const Kq=(e,t)=>$q(e,t,Fq.getOnHide);const Yq=(e,t)=>{const o=(e,o)=>{m_.set(e,[jq(o,t.backstage.shared.providers)])};const n=e=>Pb.getCurrent(e).bind(Zq);const s=(e,t,o,n)=>Pb.getCurrent(e).exists((s=>{const r=Zq(s);const a=r.exists((e=>n===e));const c=QZ.getSlot(s,n).isSome();if(c){QZ.hideAllSlots(s);if(!a){o();qq(e);QZ.showSlot(s,n);Gq(s,n)}else{Uq(e);t()}r.each((e=>Kq(s,e)))}return c}));const r={setViews:o,whichView:n,toggleView:s};return{uid:e.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:wi([m_.config({}),Pb.config({find:e=>{const t=m_.contents(e);return ce(t)}})]),apis:r}};var Xq=Mb({factory:Yq,name:"silver.ViewWrapper",configFields:[jr("backstage")],apis:{setViews:(e,t,o)=>e.setViews(t,o),toggleView:(e,t,o,n,s)=>e.toggleView(t,o,n,s),whichView:(e,t)=>e.whichView(t)}});const Jq=(e,t,o)=>{let n=false;const s=e=>{Xu(e,".tox-statusbar").each((e=>{if(go(e,"display")==="none"&&no(e,"aria-hidden")==="true"){vo(e,"display");ao(e,"aria-hidden")}else{uo(e,"display","none");to(e,"aria-hidden","true")}}))};const r={getSocket:t=>eZ.getPart(t,e,"socket"),setSidebar:(t,o,n)=>{eZ.getPart(t,e,"sidebar").each((e=>aU(e,o,n)))},toggleSidebar:(t,o)=>{eZ.getPart(t,e,"sidebar").each((e=>iU(e,o)))},whichSidebar:t=>eZ.getPart(t,e,"sidebar").bind(lU).getOrNull(),getHeader:t=>eZ.getPart(t,e,"header"),getToolbar:t=>eZ.getPart(t,e,"toolbar"),setToolbar:(t,o)=>{eZ.getPart(t,e,"toolbar").each((e=>{const t=j(o,yq);e.getApis().setGroups(e,t)}))},setToolbars:(t,o)=>{eZ.getPart(t,e,"multiple-toolbar").each((e=>{const t=j(o,(e=>j(e,yq)));iZ.setItems(e,t)}))},refreshToolbar:t=>{const o=eZ.getPart(t,e,"toolbar");o.each((e=>e.getApis().refresh(e)))},toggleToolbarDrawer:t=>{eZ.getPart(t,e,"toolbar").each((e=>{Ne(e.getApis().toggle,(t=>t(e)))}))},toggleToolbarDrawerWithoutFocusing:t=>{eZ.getPart(t,e,"toolbar").each((e=>{Ne(e.getApis().toggleWithoutFocusing,(t=>t(e)))}))},isToolbarDrawerToggled:t=>eZ.getPart(t,e,"toolbar").bind((e=>N.from(e.getApis().isOpen).map((t=>t(e))))).getOr(false),getThrobber:t=>eZ.getPart(t,e,"throbber"),focusToolbar:t=>{const o=eZ.getPart(t,e,"toolbar").orThunk((()=>eZ.getPart(t,e,"multiple-toolbar")));o.each((e=>{Qw.focusIn(e)}))},setMenubar:(t,o)=>{eZ.getPart(t,e,"menubar").each((e=>{ZZ.setMenus(e,o)}))},focusMenubar:t=>{eZ.getPart(t,e,"menubar").each((e=>{ZZ.focus(e)}))},setViews:(t,o)=>{eZ.getPart(t,e,"viewWrapper").each((e=>{Xq.setViews(e,o)}))},toggleView:(t,o)=>eZ.getPart(t,e,"viewWrapper").exists((e=>Xq.toggleView(e,(()=>r.showMainView(t)),(()=>r.hideMainView(t)),o))),whichView:t=>eZ.getPart(t,e,"viewWrapper").bind(Xq.whichView).getOrNull(),hideMainView:t=>{n=r.isToolbarDrawerToggled(t);if(n){r.toggleToolbarDrawer(t)}eZ.getPart(t,e,"editorContainer").each((e=>{const t=e.element;s(t);uo(t,"display","none");to(t,"aria-hidden","true")}))},showMainView:t=>{if(n){r.toggleToolbarDrawer(t)}eZ.getPart(t,e,"editorContainer").each((e=>{const t=e.element;s(t);vo(t,"display");ao(t,"aria-hidden")}))}};return{uid:e.uid,dom:e.dom,components:t,apis:r,behaviours:e.behaviours}};const Qq=tZ.optional({factory:ZZ,name:"menubar",schema:[jr("backstage")]});const eW=e=>{if(e.type===Zx.sliding){return wq}else if(e.type===Zx.floating){return kq}else{return _q}};const tW=tZ.optional({factory:{sketch:e=>iZ.sketch({uid:e.uid,dom:e.dom,listBehaviours:wi([Qw.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:()=>_q({type:e.type,uid:zd("multiple-toolbar-item"),cyclicKeying:false,initGroups:[],providers:e.providers,onEscape:()=>{e.onEscape();return N.some(true)}}),setupItem:(e,t,o,n)=>{mZ.setGroups(t,o)},shell:true})},name:"multiple-toolbar",schema:[jr("dom"),jr("onEscape")]});const oW=tZ.optional({factory:{sketch:e=>{const t=eW(e);const o={type:e.type,uid:e.uid,onEscape:()=>{e.onEscape();return N.some(true)},onToggled:(t,o)=>e.onToolbarToggled(o),cyclicKeying:false,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes};return t(o)}},name:"toolbar",schema:[jr("dom"),jr("onEscape"),jr("getSink")]});const nW=tZ.optional({factory:{sketch:RZ},name:"header",schema:[jr("dom")]});const sW=tZ.optional({factory:{sketch:WZ},name:"promotion",schema:[jr("dom")]});const rW=tZ.optional({name:"socket",schema:[jr("dom")]});const aW=tZ.optional({factory:{sketch:fU},name:"sidebar",schema:[jr("dom")]});const cW=tZ.optional({factory:{sketch:SU},name:"throbber",schema:[jr("dom")]});const iW=tZ.optional({factory:Xq,name:"viewWrapper",schema:[jr("backstage")]});const lW=e=>({uid:e.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:e.components});const dW=tZ.optional({factory:{sketch:lW},name:"editorContainer",schema:[]});var uW=Rb({name:"OuterContainer",factory:Jq,configFields:[jr("dom"),jr("behaviours")],partFields:[nW,Qq,oW,tW,rW,aW,sW,cW,iW,dW],apis:{getSocket:(e,t)=>e.getSocket(t),setSidebar:(e,t,o,n)=>{e.setSidebar(t,o,n)},toggleSidebar:(e,t,o)=>{e.toggleSidebar(t,o)},whichSidebar:(e,t)=>e.whichSidebar(t),getHeader:(e,t)=>e.getHeader(t),getToolbar:(e,t)=>e.getToolbar(t),setToolbar:(e,t,o)=>{e.setToolbar(t,o)},setToolbars:(e,t,o)=>{e.setToolbars(t,o)},refreshToolbar:(e,t)=>e.refreshToolbar(t),toggleToolbarDrawer:(e,t)=>{e.toggleToolbarDrawer(t)},toggleToolbarDrawerWithoutFocusing:(e,t)=>{e.toggleToolbarDrawerWithoutFocusing(t)},isToolbarDrawerToggled:(e,t)=>e.isToolbarDrawerToggled(t),getThrobber:(e,t)=>e.getThrobber(t),setMenubar:(e,t,o)=>{e.setMenubar(t,o)},focusMenubar:(e,t)=>{e.focusMenubar(t)},focusToolbar:(e,t)=>{e.focusToolbar(t)},setViews:(e,t,o)=>{e.setViews(t,o)},toggleView:(e,t,o)=>e.toggleView(t,o),whichView:(e,t)=>e.whichView(t)}});const fW="file edit view insert format tools table help";const mW={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}};const gW=(e,t,o)=>{const n=rC(o).split(/[ ,]/);return{text:e.title,getItems:()=>Q(e.items,(e=>{const o=e.toLowerCase();if(o.trim().length===0){return[]}else if(P(n,(e=>e===o))){return[]}else if(o==="separator"||o==="|"){return[{type:"separator"}]}else if(t.menuItems[o]){return[t.menuItems[o]]}else{return[]}}))}};const pW=e=>e.split(" ");const hW=(e,t)=>{const o={...mW,...t.menus};const n=ue(t.menus).length>0;const s=t.menubar===undefined||t.menubar===true?pW(fW):pW(t.menubar===false?"":t.menubar);const r=W(s,(e=>{const o=Ce(mW,e);if(n){return o||xe(t.menus,e).exists((e=>Ce(e,"items")))}else{return o}}));const a=j(r,(n=>{const s=o[n];return gW({title:s.title,items:pW(s.items)},t,e)}));return W(a,(e=>{const t=e=>c(e)||e.type!=="separator";return e.getItems().length>0&&P(e.getItems(),t)}))};const yW=e=>{const t=()=>{e._skinLoaded=true;TA(e)};return()=>{if(e.initialized){t()}else{e.on("init",t)}}};const bW=(e,t)=>()=>EA(e,{message:t});const vW=(e,t,o)=>{e.on("remove",(()=>o.unload(t)));return o.load(t)};const kW=(e,t,o,n)=>{e.on("remove",(()=>n.unloadRawCss(t)));return n.loadRawCss(t,o)};const wW=async(e,t)=>{const o=BC(e).getOr("default");const n="ui/"+o+"/skin.css";const s=tinymce.Resource.get(n);if(c(s)){kW(e,n,s,e.ui.styleSheetLoader)}else{const o=e.editorManager.suffix;const n=t+`/skin${o}.css`;return vW(e,n,e.ui.styleSheetLoader)}};const _W=async(e,t)=>{const o=Wt(Je.fromDom(e.getElement()));if(o){const o=BC(e).getOr("default");const n="ui/"+o+"/skin.shadowdom.css";const s=tinymce.Resource.get(n);if(c(s)){kW(e,n,s,Fx.DOM.styleSheetLoader)}else{const o=e.editorManager.suffix;const n=t+`/skin.shadowdom${o}.css`;return vW(e,n,Fx.DOM.styleSheetLoader)}}};const xW=async(e,t)=>{const o=()=>{const o=RC(t);const n=t.editorManager.suffix;if(o){t.contentCSS.push(o+(e?"/content.inline":"/content")+`${n}.css`)}};BC(t).fold(o,(n=>{const s="ui/"+n+(e?"/content.inline":"/content")+".css";const r=tinymce.Resource.get(s);if(c(r)){kW(t,s,r,t.ui.styleSheetLoader)}else{o()}}));const n=RC(t);if(!NC(t)&&c(n)){return Promise.all([wW(t,n),_W(t,n)]).then()}};const CW=(e,t)=>xW(e,t).then(yW(t),bW(t,"Skin could not be loaded"));const SW=z(CW,false);const zW=z(CW,true);const TW=(e,t,o)=>qe(o)?e.translate(t):e.translate([t,e.translate(o)]);const EW=(e,t)=>{const o=(o,s,r,a)=>{const c=e.shared.providers.translate(o.title);if(o.type==="separator"){return N.some({type:"separator",text:c})}else if(o.type==="submenu"){const e=Q(o.getStyleItems(),(e=>n(e,s,a)));if(s===0&&e.length<=0){return N.none()}else{return N.some({type:"nestedmenuitem",text:c,enabled:e.length>0,getSubmenuItems:()=>Q(o.getStyleItems(),(e=>n(e,s,a)))})}}else{return N.some({type:"togglemenuitem",text:c,icon:o.icon,active:o.isSelected(a),enabled:!r,onAction:t.onAction(o),...o.getStylePreview().fold((()=>({})),(e=>({meta:{style:e}})))})}};const n=(e,n,s)=>{const r=e.type==="formatter"&&t.isInvalid(e);if(n===0){return r?[]:o(e,n,false,s).toArray()}else{return o(e,n,r,s).toArray()}};const s=e=>{const o=t.getCurrentValue();const s=t.shouldHide?0:1;return Q(e,(e=>n(e,s,o)))};const r=(e,t)=>(o,n)=>{const r=t();const a=s(r);const c=II(a,Zz.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:false,search:N.none()});n(c)};return{validateItems:s,getFetch:r}};const OW=(e,t)=>{const o=t.dataset;const n=o.type==="basic"?()=>j(o.data,(e=>rj(e,t.isSelectedFor,t.getPreviewFor))):o.getData;return{items:EW(e,t),getStyleItems:n}};const AW=(e,t,o,n,s,r)=>{const{items:a,getStyleItems:c}=OW(t,o);const i=cs(o.tooltip);const l=e=>({getComponent:x(e),setTooltip:o=>{const n=t.shared.providers.translate(o);to(e.element,"aria-label",n);i.set(o)}});const d=t=>{const r=o=>t.setTooltip(TW(e,n(o.value),o.value));e.on(s,r);return jA(WA(e,"NodeChange",(t=>{const n=t.getComponent();o.updateText(n);sv.set(t.getComponent(),!e.selection.isEditable())}))(t),(()=>e.off(s,r)))};return TI({text:o.icon.isSome()?N.none():o.text,icon:o.icon,ariaLabel:N.some(o.tooltip),tooltip:N.none(),role:N.none(),fetch:a.getFetch(t,c),onSetup:d,getApi:l,columns:1,presets:"normal",classes:o.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[CS.config({...t.shared.providers.tooltips.getConfig({tooltipText:t.shared.providers.translate(o.tooltip),onShow:e=>{if(o.tooltip!==i.get()){const o=t.shared.providers.translate(i.get());CS.setComponents(e,t.shared.providers.tooltips.getComponents({tooltipText:o}))}}})})]},"tox-tbtn",t.shared,r)};const DW=e=>j(e,(e=>{let t=e,o=e;const n=e.split("=");if(n.length>1){t=n[0];o=n[1]}return{title:t,format:o}}));const NW=e=>({type:"basic",data:e});var MW;(function(e){e[e["SemiColon"]=0]="SemiColon";e[e["Space"]=1]="Space"})(MW||(MW={}));const RW=(e,t)=>{if(t===MW.SemiColon){return e.replace(/;$/,"").split(";")}else{return e.split(" ")}};const BW=(e,t,o)=>{const n=e.options.get(t);const s=DW(RW(n,o));return{type:"basic",data:s}};const LW="Align";const HW=x("Alignment {0}");const IW="left";const PW=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}];const FW=e=>{const t=()=>Y(PW,(t=>e.formatter.match(t.format)));const o=t=>()=>e.formatter.match(t);const n=e=>N.none;const s=o=>{const n=t();const s=n.fold(x(IW),(e=>e.title.toLowerCase()));Lc(o,zI,{icon:`align-${s}`});HA(e,{value:s})};const r=NW(PW);const a=t=>()=>Y(PW,(e=>e.format===t.format)).each((t=>e.execCommand(t.command)));return{tooltip:TW(e,HW(),IW),text:N.none(),icon:N.some("align-left"),isSelectedFor:o,getCurrentValue:N.none,getPreviewFor:n,onAction:a,updateText:s,dataset:r,shouldHide:false,isInvalid:t=>!e.formatter.canApply(t.format)}};const VW=(e,t)=>AW(e,t,FW(e),HW,"AlignTextUpdate","align");const jW=(e,t)=>{const o=OW(t,FW(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate(LW),onSetup:ZA(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})};const ZW=(e,t)=>{const o=t();const n=j(o,(e=>e.format));return N.from(e.formatter.closest(n)).bind((e=>Y(o,(t=>t.format===e))))};const UW="Blocks";const qW=x("Block {0}");const WW="Paragraph";const $W=e=>{const t=t=>()=>e.formatter.match(t);const o=t=>()=>{const o=e.formatter.get(t);if(o){return N.some({tag:o.length>0?o[0].inline||o[0].block||"div":"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))})}else{return N.none()}};const n=t=>{const o=ZW(e,(()=>s.data));const n=o.fold(x(WW),(e=>e.title));Lc(t,SI,{text:n});FA(e,{value:n})};const s=BW(e,"block_formats",MW.SemiColon);return{tooltip:TW(e,qW(),WW),text:N.some(WW),icon:N.none(),isSelectedFor:t,getCurrentValue:N.none,getPreviewFor:o,onAction:$A(e),updateText:n,dataset:s,shouldHide:false,isInvalid:t=>!e.formatter.canApply(t.format)}};const GW=(e,t)=>AW(e,t,$W(e),qW,"BlocksTextUpdate","blocks");const KW=(e,t)=>{const o=OW(t,$W(e));e.ui.registry.addNestedMenuItem("blocks",{text:UW,onSetup:ZA(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})};const YW="Fonts";const XW=x("Font {0}");const JW="System Font";const QW=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"];const e$=e=>{const t=e.split(/\s*,\s*/);return j(t,(e=>e.replace(/^['"]+|['"]+$/g,"")))};const t$=(e,t)=>t.length>0&&ee(t,(t=>e.indexOf(t.toLowerCase())>-1));const o$=(e,t)=>{if(e.indexOf("-apple-system")===0||t.length>0){const o=e$(e.toLowerCase());return t$(o,QW)||t$(o,t)}else{return false}};const n$=e=>{const t=()=>{const t=e=>e?e$(e)[0]:"";const o=e.queryCommandValue("FontName");const n=c.data;const s=o?o.toLowerCase():"";const r=DC(e);const a=Y(n,(e=>{const o=e.format;return o.toLowerCase()===s||t(o).toLowerCase()===t(s).toLowerCase()})).orThunk((()=>Me(o$(s,r),{title:JW,format:s})));return{matchOpt:a,font:o}};const o=e=>t=>t.exists((t=>t.format===e));const n=()=>{const{matchOpt:e}=t();return e};const s=e=>()=>N.some({tag:"div",styles:e.indexOf("dings")===-1?{"font-family":e}:{}});const r=t=>()=>{e.undoManager.transact((()=>{e.focus();e.execCommand("FontName",false,t.format)}))};const a=o=>{const{matchOpt:n,font:s}=t();const r=n.fold(x(s),(e=>e.title));Lc(o,SI,{text:r});VA(e,{value:r})};const c=BW(e,"font_family_formats",MW.SemiColon);return{tooltip:TW(e,XW(),JW),text:N.some(JW),icon:N.none(),isSelectedFor:o,getCurrentValue:n,getPreviewFor:s,onAction:r,updateText:a,dataset:c,shouldHide:false,isInvalid:A}};const s$=(e,t)=>AW(e,t,n$(e),XW,"FontFamilyTextUpdate","fontfamily");const r$=(e,t)=>{const o=OW(t,n$(e));e.ui.registry.addNestedMenuItem("fontfamily",{text:t.shared.providers.translate(YW),onSetup:ZA(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})};const a$={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]};const c$=(()=>{const e="[0-9]+";const t="[+-]?"+e;const o="[eE]"+t;const n="\\.";const s=e=>`(?:${e})?`;const r=["Infinity",e+n+s(e)+s(o),n+e+s(o),e+s(o)].join("|");const a=`[+-]?(?:${r})`;return new RegExp(`^(${a})(.*)$`)})();const i$=(e,t)=>P(t,(t=>P(a$[t],(t=>e===t))));const l$=(e,t)=>{const o=N.from(c$.exec(e));return o.bind((e=>{const o=Number(e[1]);const n=e[2];if(i$(n,t)){return N.some({value:o,unit:n})}else{return N.none()}}))};const d$=(e,t)=>l$(e,t).map((({value:e,unit:t})=>e+t));const u$={tab:x(9),escape:x(27),enter:x(13),backspace:x(8),delete:x(46),left:x(37),up:x(38),right:x(39),down:x(40),space:x(32),home:x(36),end:x(35),pageUp:x(33),pageDown:x(34)};const f$=(e,t,o,n)=>{let s=N.none();const r=e=>e.map((e=>wy.getValue(e))).getOr("");const a=WA(e,"NodeChange SwitchMode",(t=>{const n=t.getComponent();s=N.some(n);o.updateInputValue(n);sv.set(n,!e.selection.isEditable())}));const c=e=>({getComponent:x(e)});const i=cs(v);const l=zd("custom-number-input-events");const d=(e,t,n)=>{const a=r(s);const c=o.getNewValue(a,e);const i=a.length-`${c}`.length;const l=s.map((e=>e.element.dom.selectionStart-i));const d=s.map((e=>e.element.dom.selectionEnd-i));o.onAction(c,n);s.each((e=>{wy.setValue(e,c);if(t){l.each((t=>e.element.dom.selectionStart=t));d.each((t=>e.element.dom.selectionEnd=t))}}))};const u=(e,t)=>d(((e,t)=>e-t),e,t);const f=(e,t)=>d(((e,t)=>e+t),e,t);const m=e=>Nt(e.element).fold(N.none,(e=>{tm(e);return N.some(true)}));const g=e=>{if(nm(e.element)){It(e.element).each((e=>tm(e)));return N.some(true)}else{return N.none()}};const h=(o,n,s,r)=>{const a=cs(v);const i=t.shared.providers.translate(s);const l=zd("altExecuting");const d=WA(e,"NodeChange SwitchMode",(t=>{sv.set(t.getComponent(),!e.selection.isEditable())}));const u=e=>{if(!sv.isDisabled(e)){o(true)}};return oS.sketch({dom:{tag:"button",attributes:{"aria-label":i,"data-mce-name":n},classes:r.concat(n)},components:[_I(n,t.shared.providers.icons)],buttonBehaviours:wi([sv.config({}),CS.config(t.shared.providers.tooltips.getConfig({tooltipText:i})),p_(l,[EO({onSetup:d,getApi:c},a),OO({getApi:c},a),Wc(Ja(),((e,t)=>{if(t.event.raw.keyCode===u$.space()||t.event.raw.keyCode===u$.enter()){if(!sv.isDisabled(e)){o(false)}}})),Wc(oc(),u),Wc(Za(),u)])]),eventOrder:{[Ja()]:[l,"keying"],[oc()]:[l,"alloy.base.behaviour"],[Za()]:[l,"alloy.base.behaviour"],[Cc()]:["alloy.base.behaviour",l,"tooltipping"],[Sc()]:[l,"tooltipping"]}})};const y=aS(h((e=>u(false,e)),"minus","Decrease font size",[]));const b=aS(h((e=>f(false,e)),"plus","Increase font size",[]));const k=aS({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[_T.sketch({inputBehaviours:wi([sv.config({}),p_(l,[EO({onSetup:a,getApi:c},i),OO({getApi:c},i)]),p_("input-update-display-text",[Wc(SI,((e,t)=>{wy.setValue(e,t.event.text)})),Wc(Xa(),(e=>{o.onAction(wy.getValue(e))})),Wc(tc(),(e=>{o.onAction(wy.getValue(e))}))]),Qw.config({mode:"special",onEnter:e=>{d(C,true,true);return N.some(true)},onEscape:m,onUp:e=>{f(true,false);return N.some(true)},onDown:e=>{u(true,false);return N.some(true)},onLeft:(e,t)=>{t.cut();return N.none()},onRight:(e,t)=>{t.cut();return N.none()}})])})],behaviours:wi([C_.config({}),Qw.config({mode:"special",onEnter:g,onSpace:g,onEscape:m}),p_("input-wrapper-events",[Wc(Ka(),(e=>{Z([y,b],(t=>{const o=Je.fromDom(t.get(e).element.dom);if(nm(o)){om(o)}}))}))])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:{...p(n)?{"data-mce-name":n}:{}}},components:[y.asSpec(),k.asSpec(),b.asSpec()],behaviours:wi([C_.config({}),Qw.config({mode:"flow",focusInside:Gv.OnEnterOrSpaceMode,cycles:false,selector:"button, .tox-input-wrapper",onEscape:e=>{if(nm(e.element)){return N.none()}else{tm(e.element);return N.some(true)}}})])}};const m$="Font sizes";const g$=x("Font size {0}");const p$="12pt";const h$={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"};const y$={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"};const b$=(e,t)=>{const o=Math.pow(10,t);return Math.round(e*o)/o};const v$=(e,t)=>{if(/[0-9.]+px$/.test(e)){return b$(parseInt(e,10)*72/96,t||0)+"pt"}else{return xe(y$,e).getOr(e)}};const k$=e=>xe(h$,e).getOr("");const w$=e=>{const t=()=>{let t=N.none();const o=c.data;const n=e.queryCommandValue("FontSize");if(n){for(let e=3;t.isNone()&&e>=0;e--){const s=v$(n,e);const r=k$(s);t=Y(o,(e=>e.format===n||e.format===s||e.format===r))}}return{matchOpt:t,size:n}};const o=e=>t=>t.exists((t=>t.format===e));const n=()=>{const{matchOpt:e}=t();return e};const s=x(N.none);const r=t=>()=>{e.undoManager.transact((()=>{e.focus();e.execCommand("FontSize",false,t.format)}))};const a=o=>{const{matchOpt:n,size:s}=t();const r=n.fold(x(s),(e=>e.title));Lc(o,SI,{text:r});IA(e,{value:r})};const c=BW(e,"font_size_formats",MW.Space);return{tooltip:TW(e,g$(),p$),text:N.some(p$),icon:N.none(),isSelectedFor:o,getPreviewFor:s,getCurrentValue:n,onAction:r,updateText:a,dataset:c,shouldHide:false,isInvalid:A}};const _$=(e,t)=>AW(e,t,w$(e),g$,"FontSizeTextUpdate","fontsize");const x$=e=>{var t;const o={step:1};const n={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}};return(t=n[e])!==null&&t!==void 0?t:o};const C$=16;const S$=e=>e>=0;const z$=e=>{const t=()=>e.queryCommandValue("FontSize");const o=e=>Lc(e,SI,{text:t()});return{updateInputValue:o,onAction:(t,o)=>e.execCommand("FontSize",false,t,{skip_focus:!o}),getNewValue:(o,n)=>{l$(o,["unsupportedLength","empty"]);const s=t();const r=l$(o,["unsupportedLength","empty"]).or(l$(s,["unsupportedLength","empty"]));const a=r.map((e=>e.value)).getOr(C$);const c=yC(e);const i=r.map((e=>e.unit)).filter((e=>e!=="")).getOr(c);const l=n(a,x$(i).step);const d=`${S$(l)?l:a}${i}`;if(d!==s){PA(e,{value:d})}return d}}};const T$=(e,t)=>f$(e,t,z$(e),"fontsizeinput");const E$=(e,t)=>{const o=OW(t,w$(e));e.ui.registry.addNestedMenuItem("fontsize",{text:m$,onSetup:ZA(e),getSubmenuItems:()=>o.items.validateItems(o.getStyleItems())})};const O$="Formats";const A$=e=>qe(e)?"Formats":"Format {0}";const D$=(e,t)=>{const o="Formats";const n=t=>()=>e.formatter.match(t);const s=t=>()=>{const o=e.formatter.get(t);return o!==undefined?N.some({tag:o.length>0?o[0].inline||o[0].block||"div":"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):N.none()};const r=t=>{const n=e=>{if(GV(e)){return Q(e.items,n)}else if(KV(e)){return[{title:e.title,format:e.format}]}else{return[]}};const s=Q(nj(e),n);const r=ZW(e,x(s));const a=r.fold(x({title:o,tooltipLabel:""}),(e=>({title:e.title,tooltipLabel:e.title})));Lc(t,SI,{text:a.title});LA(e,{value:a.tooltipLabel})};return{tooltip:TW(e,A$(""),""),text:N.some(o),icon:N.none(),isSelectedFor:n,getCurrentValue:N.none,getPreviewFor:s,onAction:$A(e),updateText:r,shouldHide:nC(e),isInvalid:t=>!e.formatter.canApply(t.format),dataset:t}};const N$=(e,t)=>{const o={type:"advanced",...t.styles};return AW(e,t,D$(e,o),A$,"StylesTextUpdate","styles")};const M$=(e,t)=>{const o={type:"advanced",...t.styles};const n=OW(t,D$(e,o));e.ui.registry.addNestedMenuItem("styles",{text:O$,onSetup:ZA(e),getSubmenuItems:()=>n.items.validateItems(n.getStyleItems())})};const R$=x([jr("toggleClass"),jr("fetch"),md("onExecute"),ia("getHotspot",N.some),ia("getAnchorOverrides",x({})),lg(),md("onItemExecute"),Qr("lazySink"),jr("dom"),ud("onOpen"),_y("splitDropdownBehaviours",[vN,Qw,C_]),ia("matchWidth",false),ia("useMinWidth",false),ia("eventOrder",{}),Qr("role"),Qr("listRole")].concat(VN()));const B$=eb({factory:oS,schema:[jr("dom")],name:"arrow",defaults:()=>({buttonBehaviours:wi([C_.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each(Hc)},buttonBehaviours:wi([Z_.config({toggleOnExecute:false,toggleClass:e.toggleClass})])})});const L$=eb({factory:oS,schema:[jr("dom")],name:"button",defaults:()=>({buttonBehaviours:wi([C_.revoke()])}),overrides:e=>({dom:{tag:"span",attributes:{role:"presentation"}},action:t=>{t.getSystem().getByUid(e.uid).each((o=>{e.onExecute(o,t)}))}})});const H$=x([B$,L$,ob({factory:{sketch:e=>({uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}})},schema:[jr("text")],name:"aria-descriptor"}),tb({schema:[id()],name:"menu",defaults:e=>({onExecute:(t,o)=>{t.getSystem().getByUid(e.uid).each((n=>{e.onItemExecute(n,t,o)}))}})}),ON()]);const I$=(e,t,o,n)=>{const s=e=>{Pb.getCurrent(e).each((e=>{Cv.highlightFirst(e);Qw.focusIn(e)}))};const r=t=>{const o=s;BN(e,C,t,n,o,Ox.HighlightMenuAndItem).get(v)};const a=e=>{r(e);return N.some(true)};const c=t=>{const o=hb(t,e,"button");Hc(o);return N.some(true)};const i={...jc([oi(((t,o)=>{const n=pb(t,e,"aria-descriptor");n.each((e=>{const o=zd("aria");to(e.element,"id",o);to(t.element,"aria-describedby",o)}))}))]),...q_(N.some(r))};const l={repositionMenus:e=>{if(Z_.isOn(e)){FN(e)}}};return{uid:e.uid,dom:e.dom,components:t,apis:l,eventOrder:{...e.eventOrder,[mc()]:["disabling","toggling","alloy.base.behaviour"]},events:i,behaviours:Cy(e.splitDropdownBehaviours,[vN.config({others:{sandbox:t=>{const o=hb(t,e,"arrow");const n={onOpen:()=>{Z_.on(o);Z_.on(t)},onClose:()=>{Z_.off(o);Z_.off(t)}};return PN(e,t,n)}}}),Qw.config({mode:"special",onSpace:c,onEnter:c,onDown:a}),C_.config({}),Z_.config({toggleOnExecute:false,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":true}}}};const P$=Rb({name:"SplitDropdown",configFields:R$(),partFields:H$(),factory:I$,apis:{repositionMenus:(e,t)=>e.repositionMenus(t)}});const F$=e=>({isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t),setText:t=>Lc(e,SI,{text:t}),setIcon:t=>Lc(e,zI,{icon:t})});const V$=e=>({setActive:t=>{Z_.set(e,t)},isActive:()=>Z_.isOn(e),isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t),setText:t=>Lc(e,SI,{text:t}),setIcon:t=>Lc(e,zI,{icon:t})});const j$=(e,t)=>e.map((e=>({"aria-label":t.translate(e)}))).getOr({});const Z$=zd("focus-button");const U$=(e,t,o,n,s,r)=>{const a=t.map((e=>aS(CI(e,"tox-tbtn",s))));const c=e.map((e=>aS(xI(e,s.icons))));return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:{...j$(o,s),...p(r)?{"data-mce-name":r}:{}}},components:NO([c.map((e=>e.asSpec())),a.map((e=>e.asSpec()))]),eventOrder:{[qa()]:["focusing","alloy.base.behaviour",bI],[Cc()]:[bI,"toolbar-group-button-events"]},buttonBehaviours:wi([zO.toolbarButton(s.isDisabled),wO(),p_(bI,[oi(((e,t)=>kI(e))),Wc(SI,((e,t)=>{a.bind((t=>t.getOpt(e))).each((e=>{m_.set(e,[Bu(s.translate(t.event.text))])}))})),Wc(zI,((e,t)=>{c.bind((t=>t.getOpt(e))).each((e=>{m_.set(e,[xI(t.event.icon,s.icons)])}))})),Wc(qa(),((e,t)=>{t.event.prevent();Bc(e,Z$)}))])].concat(n.getOr([])))}};const q$=(e,t,o,n,s)=>{const r=t.shared;const a=cs(v);const c={toolbarButtonBehaviours:[],getApi:F$,onSetup:e.onSetup};const i=[p_("toolbar-group-button-events",[EO(c,a),OO(c,a)])];return eq.sketch({lazySink:r.getSink,fetch:()=>TN.nu((t=>{t(j(o(e.items),yq))})),markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:U$(e.icon,e.text,e.tooltip,N.some(i),r.providers,s),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:n}}}})};const W$=(e,t,o,n)=>{var s;const r=cs(v);const a=U$(e.icon,e.text,e.tooltip,N.none(),o,n);return oS.sketch({dom:a.dom,components:a.components,eventOrder:vI,buttonBehaviours:{...wi([p_("toolbar-button-events",[yI({onAction:e.onAction,getApi:t.getApi}),EO(t,r),OO(t,r)]),...e.tooltip.map((t=>CS.config(o.tooltips.getConfig({tooltipText:o.translate(t)+e.shortcut.map((e=>` (${BO(e)})`)).getOr("")})))).toArray(),zO.toolbarButton((()=>!e.enabled||o.isDisabled())),wO()].concat(t.toolbarButtonBehaviours)),[bI]:(s=a.buttonBehaviours)===null||s===void 0?void 0:s[bI]}})};const $$=(e,t,o)=>G$(e,t,[],o);const G$=(e,t,o,n)=>W$(e,{toolbarButtonBehaviours:o.length>0?[p_("toolbarButtonWith",o)]:[],getApi:F$,onSetup:e.onSetup},t,n);const K$=(e,t,o)=>Y$(e,t,[],o);const Y$=(e,t,o,n)=>W$(e,{toolbarButtonBehaviours:[m_.config({}),Z_.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:false})].concat(o.length>0?[p_("toolbarToggleButtonWith",o)]:[]),getApi:V$,onSetup:e.onSetup},t,n);const X$=(e,t,o)=>n=>TN.nu((e=>t.fetch(e))).map((s=>N.from(rM(Bs(PD(zd("menu-value"),s,(o=>{t.onItemAction(e(n),o)}),t.columns,t.presets,Zz.CLOSE_ON_EXECUTE,t.select.getOr(A),o),{movement:VD(t.columns,t.presets),menuBehaviours:pO.unnamedEvents(t.columns!=="auto"?[]:[oi(((e,o)=>{fO(e,4,dT(t.presets)).each((({numRows:t,numColumns:o})=>{Qw.setGridSize(e,t,o)}))}))])})))));const J$=(e,t,o)=>{const n=cs(e.tooltip.getOr(""));const s=e=>({isEnabled:()=>!sv.isDisabled(e),setEnabled:t=>sv.set(e,!t),setIconFill:(t,o)=>{Qu(e.element,`svg path[class="${t}"], rect[class="${t}"]`).each((e=>{to(e,"fill",o)}))},setActive:t=>{to(e.element,"aria-pressed",t);Qu(e.element,"span").each((o=>{e.getSystem().getByDom(o).each((e=>Z_.set(e,t)))}))},isActive:()=>Qu(e.element,"span").exists((t=>e.getSystem().getByDom(t).exists(Z_.isOn))),setText:t=>Qu(e.element,"span").each((o=>e.getSystem().getByDom(o).each((e=>Lc(e,SI,{text:t}))))),setIcon:t=>Qu(e.element,"span").each((o=>e.getSystem().getByDom(o).each((e=>Lc(e,zI,{icon:t}))))),setTooltip:o=>{const s=t.providers.translate(o);to(e.element,"aria-label",s);n.set(o)}});const r=cs(v);const a={getApi:s,onSetup:e.onSetup};return P$.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:{"aria-pressed":false,...j$(e.tooltip,t.providers),...p(o)?{"data-mce-name":o}:{}}},onExecute:t=>{const o=s(t);if(o.isEnabled()){e.onAction(o)}},onItemExecute:(e,t,o)=>{},splitDropdownBehaviours:wi([zO.splitButton(t.providers.isDisabled),wO(),p_("split-dropdown-events",[oi(((e,t)=>kI(e))),Wc(Z$,C_.focus),EO(a,r),OO(a,r)]),vR.config({}),...e.tooltip.map((e=>CS.config({...t.providers.tooltips.getConfig({tooltipText:t.providers.translate(e),onShow:o=>{if(n.get()!==e){const e=t.providers.translate(n.get());CS.setComponents(o,t.providers.tooltips.getComponents({tooltipText:e}))}}})}))).toArray()]),eventOrder:{[Cc()]:["alloy.base.behaviour","split-dropdown-events","tooltipping"],[Sc()]:["split-dropdown-events","tooltipping"]},toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:X$(s,e,t.providers),parts:{menu:hT(false,e.columns,e.presets)},components:[P$.parts.button(U$(e.icon,e.text,N.none(),N.some([Z_.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:false})]),t.providers)),P$.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Oz("chevron-down",t.providers.icons)},buttonBehaviours:wi([zO.splitButton(t.providers.isDisabled),wO(),Nz()])}),P$.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})};const Q$=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}];const eG=(e,t)=>(o,n,s,r)=>{const a=e(o).mapError((e=>Lr(e))).getOrDie();return t(a,n,s,r)};const tG={button:eG(AE,((e,t,o,n)=>$$(e,t.shared.providers,n))),togglebutton:eG(ME,((e,t,o,n)=>K$(e,t.shared.providers,n))),menubutton:eG(PZ,((e,t,o,n)=>jP(e,"tox-tbtn",t,N.none(),false,n))),splitbutton:eG(VZ,((e,t,o,n)=>J$(e,t.shared,n))),grouptoolbarbutton:eG(LZ,((e,t,o,n)=>{const s=o.ui.registry.getAll().buttons;const r=e=>lG(o,{buttons:s,toolbar:e,allowToolbarGroups:false},t,N.none());const a={[cg]:t.shared.header.isPositionedAtTop()?ag.TopToBottom:ag.BottomToTop};switch(aC(o)){case Zx.floating:return q$(e,t,r,a,n);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}))};const oG=(e,t,o,n)=>xe(tG,e.type).fold((()=>{console.error("skipping button defined by",e);return N.none()}),(s=>N.some(s(e,t,o,n))));const nG={styles:N$,fontsize:_$,fontsizeinput:T$,fontfamily:s$,blocks:GW,align:VW};const sG=e=>{const t=j(Q$,(t=>{const o=W(t.items,(t=>Ce(e,t)||Ce(nG,t)));return{name:t.name,items:o}}));return W(t,(e=>e.items.length>0))};const rG=e=>{const t=e.split("|");return j(t,(e=>({items:e.trim().split(" ")})))};const aG=e=>b(e,(e=>Ce(e,"name")&&Ce(e,"items")));const cG=e=>{const t=e.toolbar;const o=e.buttons;if(t===false){return[]}else if(t===undefined||t===true){return sG(o)}else if(c(t)){return rG(t)}else if(aG(t)){return t}else{console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]");return[]}};const iG=(e,t,o,n,s,r)=>xe(t,o.toLowerCase()).orThunk((()=>r.bind((e=>de(e,(e=>xe(t,e+o.toLowerCase()))))))).fold((()=>xe(nG,o.toLowerCase()).map((t=>t(e,s)))),(t=>{if(t.type==="grouptoolbarbutton"&&!n){console.warn(`Ignoring the '${o}' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.`);return N.none()}else{return oG(t,s,e,o.toLowerCase())}}));const lG=(e,t,o,n)=>{const s=cG(t);const r=j(s,(s=>{const r=Q(s.items,(s=>s.trim().length===0?[]:iG(e,t.buttons,s,t.allowToolbarGroups,o,n).toArray()));return{title:N.from(e.translate(s.name)),items:r}}));return W(r,(e=>e.items.length>0))};const dG=(e,t,o,n)=>{const s=t.mainUi.outerContainer;const r=o.toolbar;const a=o.buttons;if(b(r,c)){const t=r.map((t=>{const s={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return lG(e,s,n,N.none())}));uW.setToolbars(s,t)}else{uW.setToolbar(s,lG(e,o,n,N.none()))}};const uG=Sn();const fG=uG.os.isiOS()&&uG.os.version.major<=12;const mG=(e,t)=>{const{uiMotherships:o}=t;const n=e.dom;let s=e.getWin();const r=e.getDoc().documentElement;const a=cs(To(s.innerWidth,s.innerHeight));const c=cs(To(r.offsetWidth,r.offsetHeight));const i=()=>{const t=a.get();if(t.left!==s.innerWidth||t.top!==s.innerHeight){a.set(To(s.innerWidth,s.innerHeight));AA(e)}};const l=()=>{const t=e.getDoc().documentElement;const o=c.get();if(o.left!==t.offsetWidth||o.top!==t.offsetHeight){c.set(To(t.offsetWidth,t.offsetHeight));AA(e)}};const d=t=>{DA(e,t)};n.bind(s,"resize",i);n.bind(s,"scroll",d);const u=Am(Je.fromDom(e.getBody()),"load",l);e.on("hide",(()=>{Z(o,(e=>{uo(e.element,"display","none")}))}));e.on("show",(()=>{Z(o,(e=>{vo(e.element,"display")}))}));e.on("NodeChange",l);e.on("remove",(()=>{u.unbind();n.unbind(s,"resize",i);n.unbind(s,"scroll",d);s=null}))};const gG=(e,t,o)=>{if(WC(e)){yh(o.mainUi.mothership.element,o.popupUi.mothership)}hh(t,o.dialogUi.mothership)};const pG=(e,t,o,n,s)=>{const{mainUi:r,uiMotherships:a}=t;const c=cs(0);const i=r.outerContainer;SW(e);const l=Je.fromDom(s.targetNode);const d=qt(Ut(l));yh(l,r.mothership);gG(e,d,t);e.on("SkinLoaded",(()=>{uW.setSidebar(i,o.sidebar,EC(e));dG(e,t,o,n);c.set(e.getWin().innerWidth);uW.setMenubar(i,hW(e,o));uW.setViews(i,o.views);mG(e,t)}));const f=uW.getSocket(i).getOrDie("Could not find expected socket element");if(fG){fo(f.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});const t=HH((()=>{e.dispatch("ScrollContent")}),20);const o=Om(f.element,"scroll",t.throttle);e.on("remove",o.unbind)}kO(e,t);e.addCommand("ToggleSidebar",((t,o)=>{uW.toggleSidebar(i,o);e.dispatch("ToggleSidebar")}));e.addQueryValueHandler("ToggleSidebar",(()=>{var e;return(e=uW.whichSidebar(i))!==null&&e!==void 0?e:""}));e.addCommand("ToggleView",((t,o)=>{if(uW.toggleView(i,o)){const t=i.element;r.mothership.broadcastOn([Fh()],{target:t});Z(a,(e=>{e.broadcastOn([Fh()],{target:t})}));if(u(uW.whichView(i))){e.focus();e.nodeChanged();uW.refreshToolbar(i)}}}));e.addQueryValueHandler("ToggleView",(()=>{var e;return(e=uW.whichView(i))!==null&&e!==void 0?e:""}));const m=aC(e);const g=()=>{uW.refreshToolbar(t.mainUi.outerContainer)};if(m===Zx.sliding||m===Zx.floating){e.on("ResizeWindow ResizeEditor ResizeContent",(()=>{const t=e.getWin().innerWidth;if(t!==c.get()){g();c.set(t)}}))}const p={setEnabled:e=>{vO(t,!e)},isEnabled:()=>!sv.isDisabled(i)};return{iframeContainer:f.element.dom,editorContainer:i.element.dom,api:p}};var hG=Object.freeze({__proto__:null,render:pG});const yG=e=>{const t=/^[0-9\.]+(|px)$/i;if(t.test(""+e)){return N.some(parseInt(""+e,10))}return N.none()};const bG=e=>y(e)?e+"px":e;const vG=(e,t,o)=>{const n=t.filter((t=>e<t));const s=o.filter((t=>e>t));return n.or(s).getOr(e)};const kG=e=>{const t=Kx(e);const o=Jx(e);const n=eC(e);return yG(t).map((e=>vG(e,o,n)))};const wG=e=>{const t=kG(e);return t.getOr(Kx(e))};const _G=e=>{const t=Yx(e);const o=Xx(e);const n=Qx(e);return yG(t).map((e=>vG(e,o,n)))};const xG=e=>{const t=_G(e);return t.getOr(Yx(e))};const{ToolbarLocation:CG,ToolbarMode:SG}=GC;const zG=40;const TG=(e,t,o,n,s)=>{const{mainUi:r,uiMotherships:a}=o;const c=Fx.DOM;const i=jC(e);const l=qC(e);const d=Qx(e).or(_G(e));const u=n.shared.header;const f=u.isPositionedAtTop;const m=150;const g=aC(e);const p=g===SG.sliding||g===SG.floating;const h=cs(false);const y=()=>h.get()&&!e.removed;const b=e=>p?e.fold(x(0),(e=>e.components().length>1?xo(e.components()[1].element):0)):0;const v=o=>{switch(iC(e)){case CG.auto:const e=uW.getToolbar(r.outerContainer);const n=b(e);const s=xo(o.element)-n;const a=os(t);const c=a.y>s;if(c){return"top"}else{const e=Et(t);const o=Math.max(e.dom.scrollHeight,xo(e));const n=a.bottom<o-s;if(n){return"bottom"}else{const e=as();const t=e.bottom<a.bottom-s;return t?"bottom":"top"}}case CG.bottom:return"bottom";case CG.top:default:return"top"}};const k=e=>{s.on((t=>{wd.setModes(t,[e]);u.setDockingMode(e);const o=f()?ag.TopToBottom:ag.BottomToTop;to(t.element,cg,o)}))};const w=()=>{s.on((e=>{const o=d.getOrThunk((()=>qn().width-Do(t).left-10));uo(e.element,"max-width",o+"px")}))};const _=(o,n)=>{s.on((s=>{const a=uW.getToolbar(r.outerContainer);const c=b(a);const i=os(t);const l=C(e,r.outerContainer.element);const d=()=>l.fold((()=>i.x),(e=>{const t=os(e);const o=Ct(e,Jt());return o?i.x:i.x-t.x}));const u=()=>l.fold((()=>f()?Math.max(i.y-xo(s.element)+c,0):i.bottom),(e=>{var t;const o=os(e);const n=(t=e.dom.scrollTop)!==null&&t!==void 0?t:0;const r=Ct(e,Jt());const a=r?Math.max(i.y-xo(s.element)+c,0):i.y-o.y+n-xo(s.element)+c;return f()?a:i.bottom}));const g=d();const p=Me(o,Math.ceil(r.outerContainer.element.dom.getBoundingClientRect().width)).filter((e=>e>m)).map((e=>{const t=n.getOr(Vn());const o=window.innerWidth-(g-t.left);const s=Math.max(Math.min(e,o),m);if(o<e){uo(r.outerContainer.element,"width",s+"px")}return{width:s+"px"}})).getOr({width:"max-content"});const h={position:"absolute",left:Math.round(g)+"px",top:u()+"px"};fo(r.outerContainer.element,{...h,...p})}))};const C=(e,t)=>WC(e)?Ki(t):N.none();const S=()=>{Z(a,(e=>{e.broadcastOn([Vh()],{})}))};const z=()=>{if(!i){const e=Ao(r.outerContainer.element).left+Bo(r.outerContainer.element);if(e>=window.innerWidth-zG||ho(r.outerContainer.element,"width").isSome()){uo(r.outerContainer.element,"position","absolute");uo(r.outerContainer.element,"left","0px");vo(r.outerContainer.element,"width");return true}}return false};const T=e=>{if(!y()){return}if(!i){w()}const t=Vn();const o=i?false:z();if(p){uW.refreshToolbar(r.outerContainer)}if(!i){const e=Vn();const n=Me(t.left!==e.left,t);_(o,n);n.each((t=>{jn(t.left,e.top)}))}if(l){s.on(e)}S()};const E=()=>{if(i||!l||!y()){return false}return s.get().exists((e=>{const t=u.getDockingMode();const o=v(e);if(o!==t){k(o);return true}else{return false}}))};const O=()=>{h.set(true);uo(r.outerContainer.element,"display","flex");c.addClass(e.getBody(),"mce-edit-focus");Z(a,(e=>{vo(e.element,"display")}));E();if(WC(e)){T((e=>wd.isDocked(e)?wd.reset(e):wd.refresh(e)))}else{T(wd.refresh)}};const A=()=>{h.set(false);uo(r.outerContainer.element,"display","none");c.removeClass(e.getBody(),"mce-edit-focus");Z(a,(e=>{uo(e.element,"display","none")}))};const D=()=>{const e=E();if(e){T(wd.reset)}};return{isVisible:y,isPositionedAtTop:f,show:O,hide:A,update:T,updateMode:D,repositionPopups:S}};const EG=(e,t)=>{const o=os(e);return{pos:t?o.y:o.bottom,bounds:o}};const OG=(e,t,o,n)=>{const s=cs(EG(t,o.isPositionedAtTop()));const r=n=>{const{pos:r,bounds:a}=EG(t,o.isPositionedAtTop());const{pos:c,bounds:i}=s.get();const l=a.height!==i.height||a.width!==i.width;s.set({pos:r,bounds:a});if(l){AA(e,n)}if(o.isVisible()){if(c!==r){o.update(wd.reset)}else if(l){o.updateMode();o.repositionPopups()}}};if(!n){e.on("activate",o.show);e.on("deactivate",o.hide)}e.on("SkinLoaded ResizeWindow",(()=>o.update(wd.reset)));e.on("NodeChange keydown",(e=>{requestAnimationFrame((()=>r(e)))}));let a=0;const c=IH((()=>o.update(wd.refresh)),33);e.on("ScrollWindow",(()=>{const e=Vn().left;if(e!==a){a=e;c.throttle()}o.updateMode()}));if(WC(e)){e.on("ElementScroll",(e=>{o.update(wd.refresh)}))}const i=ds();i.set(Am(Je.fromDom(e.getBody()),"load",(e=>r(e.raw))));e.on("remove",(()=>{i.clear()}))};const AG=(e,t,o,n,s)=>{const{mainUi:r}=t;const a=us();const c=Je.fromDom(s.targetNode);const i=TG(e,c,t,n,a);const l=uC(e);zW(e);const d=()=>{if(a.isSet()){i.show();return}a.set(uW.getHeader(r.outerContainer).getOrDie());const s=ZC(e);if(WC(e)){yh(c,r.mothership);yh(c,t.popupUi.mothership)}else{hh(s,r.mothership)}hh(s,t.dialogUi.mothership);const d=()=>{dG(e,t,o,n);uW.setMenubar(r.outerContainer,hW(e,o));i.show();OG(e,c,i,l);e.nodeChanged()};if(l){e.once("SkinLoaded",d)}else{d()}};e.on("show",d);e.on("hide",i.hide);if(!l){e.on("focus",d);e.on("blur",i.hide)}e.on("init",(()=>{if(e.hasFocus()||l){d()}}));kO(e,t);const u={show:d,hide:i.hide,setEnabled:e=>{vO(t,!e)},isEnabled:()=>!sv.isDisabled(r.outerContainer)};return{editorContainer:r.outerContainer.element.dom,api:u}};var DG=Object.freeze({__proto__:null,render:AG});const NG=()=>{const e=us();const t=us();const o=us();const n=(e,t)=>()=>o.get().bind((e=>t(e.outerContainer))).getOrDie(`Could not find ${e} element in OuterContainer`);const s=()=>{const o=e.get().map((e=>e.mothership));const n=t.get().map((e=>e.mothership));return o.fold((()=>n.toArray()),(e=>n.fold((()=>[e]),(t=>Ct(e.element,t.element)?[e]:[e,t]))))};return{dialogUi:e,popupUi:t,mainUi:o,getUiMotherships:s,lazyGetInOuterOrDie:n}};const MG="contexttoolbar-show";const RG="contexttoolbar-hide";const BG=e=>({hide:()=>Bc(e,yc()),getValue:()=>wy.getValue(e)});const LG=(e,t)=>Wc(hI,((o,n)=>{const s=e.get(o);const r=BG(s);t.onAction(r,n.event.buttonApi)}));const HG=(e,t,o)=>{const{primary:n,...s}=t.original;const r=Rr(AE({...s,type:"button",onAction:v}));return G$(r,o,[LG(e,t)])};const IG=(e,t,o)=>{const{primary:n,...s}=t.original;const r=Rr(ME({...s,type:"togglebutton",onAction:v}));return Y$(r,o,[LG(e,t)])};const PG=e=>e.type==="contextformtogglebutton";const FG=(e,t,o)=>{if(PG(t)){return IG(e,t,o)}else{return HG(e,t,o)}};const VG=(e,t,o)=>{const n=j(t,(t=>aS(FG(e,t,o))));const s=()=>j(n,(e=>e.asSpec()));const r=e=>de(t,((t,o)=>{if(t.primary){return N.from(n[o]).bind((t=>t.getOpt(e))).filter(T(sv.isDisabled))}else{return N.none()}}));return{asSpecs:s,findPrimary:r}};const jG=(e,t)=>{const o=e.label.fold((()=>({})),(e=>({"aria-label":e})));const n=aS(_T.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:o,selectOnFocus:true,inputBehaviours:wi([Qw.config({mode:"special",onEnter:e=>s.findPrimary(e).map((e=>{Hc(e);return true})),onLeft:(e,t)=>{t.cut();return N.none()},onRight:(e,t)=>{t.cut();return N.none()}})])}));const s=VG(n,e.commands,t);return[{title:N.none(),items:[n.asSpec()]},{title:N.none(),items:s.asSpecs()}]};const ZG=(e,t,o)=>_q({type:e,uid:zd("context-toolbar"),initGroups:jG(t,o),onEscape:N.none,cyclicKeying:true,providers:o});const UG={renderContextForm:ZG,buildInitGroups:jG};const qG=(e,t,o)=>t.bottom-e.y>=o&&e.bottom-t.y>=o;const WG=e=>{const t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){const o=Ft(Je.fromDom(e.startContainer),e.startOffset).element;const n=ht(o)?At(o):N.some(o);return n.filter(pt).map((e=>e.dom.getBoundingClientRect())).getOr(t)}else{return t}};const $G=e=>{const t=e.selection.getRng();const o=WG(t);if(e.inline){const e=Vn();return ts(e.left+o.left,e.top+o.top,o.width,o.height)}else{const t=ns(Je.fromDom(e.getBody()));return ts(t.x+o.left,t.y+o.top,o.width,o.height)}};const GG=(e,t)=>t.filter((e=>Xt(e)&>(e))).map(ns).getOrThunk((()=>$G(e)));const KG=(e,t,o)=>{const n=Math.max(e.x+o,t.x);const s=Math.min(e.right-o,t.right);return{x:n,width:s-n}};const YG=(e,t,o,n,s,r)=>{const a=Je.fromDom(e.getContainer());const c=Qu(a,".tox-editor-header").getOr(a);const i=os(c);const l=i.y>=t.bottom;const d=n&&!l;if(e.inline&&d){return{y:Math.max(i.bottom+r,o.y),bottom:o.bottom}}if(e.inline&&!d){return{y:o.y,bottom:Math.min(i.y-r,o.bottom)}}const u=s==="line"?os(a):t;if(d){return{y:Math.max(i.bottom+r,o.y),bottom:Math.min(u.bottom-r,o.bottom)}}return{y:Math.max(u.y+r,o.y),bottom:Math.min(i.y-r,o.bottom)}};const XG=(e,t,o,n=0)=>{const s=qn(window);const r=os(Je.fromDom(e.getContentAreaContainer()));const a=MC(e)||HC(e)||PC(e);const{x:c,width:i}=KG(r,s,n);if(e.inline&&!a){return ts(c,s.y,i,s.height)}else{const a=t.header.isPositionedAtTop();const{y:l,bottom:d}=YG(e,r,s,a,o,n);return ts(c,l,i,d-l)}};const JG=12;const QG={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]};const eK={maxHeightFunction:Ym(),maxWidthFunction:UU()};const tK=(e,t)=>{const o=e.selection.getRng();const n=Ft(Je.fromDom(o.startContainer),o.startOffset);return o.startContainer===o.endContainer&&o.startOffset===o.endOffset-1&&Ct(n.element,t)};const oK=(e,t,o)=>{const n=ho(e,"position");uo(e,"position",t);const s=o(e);n.each((t=>uo(e,"position",t)));return s};const nK=e=>e==="node";const sK=(e,t,o,n,s)=>{const r=$G(e);const a=n.lastElement().exists((e=>Ct(o,e)));if(tK(e,o)){return a?AV:SV}else if(a){return oK(t,n.getMode(),(()=>{const e=qG(r,os(t),-20);return e&&!n.isReposition()?NV:AV}))}else{const e=n.getMode()==="fixed"?s.y+Vn().top:s.y;const o=xo(t)+JG;return e+o<=r.y?SV:zV}};const rK=(e,t,o,n)=>{const s=t=>(n,s,r,a,c)=>{const i=sK(e,a,t,o,c);const l={...n,y:c.y,height:c.height};return{...i(l,s,r,a,c),alwaysFit:true}};const r=e=>nK(n)?[s(e)]:[];const a={onLtr:e=>[If,Pf,Lf,Rf,Hf,Bf].concat(r(e)),onRtl:e=>[If,Pf,Hf,Bf,Lf,Rf].concat(r(e))};const c={onLtr:e=>[Pf,Rf,Bf,Lf,Hf,If].concat(r(e)),onRtl:e=>[Pf,Bf,Rf,Hf,Lf,If].concat(r(e))};return t?c:a};const aK=(e,t,o,n)=>{if(t==="line"){return{bubble:tg(JG,0,QG),layouts:{onLtr:()=>[Ff],onRtl:()=>[Vf]},overrides:eK}}else{return{bubble:tg(0,JG,QG,1/JG),layouts:rK(e,o,n,t),overrides:eK}}};const cK=(e,t)=>{const o=W(t,(t=>t.predicate(e.dom)));const{pass:n,fail:s}=q(o,(e=>e.type==="contexttoolbar"));return{contextToolbars:n,contextForms:s}};const iK=e=>{if(e.length<=1){return e}else{const t=t=>P(e,(e=>e.position===t));const o=t=>W(e,(e=>e.position===t));const n=t("selection");const s=t("node");if(n||s){if(s&&n){const e=o("node");const t=j(o("selection"),(e=>({...e,position:"node"})));return e.concat(t)}else{return n?o("selection"):o("node")}}else{return o("line")}}};const lK=e=>{if(e.length<=1){return e}else{const t=t=>Y(e,(e=>e.position===t));const o=t("selection").orThunk((()=>t("node"))).orThunk((()=>t("line"))).map((e=>e.position));return o.fold((()=>[]),(t=>W(e,(e=>e.position===t))))}};const dK=(e,t,o)=>{const n=cK(e,t);if(n.contextForms.length>0){return N.some({elem:e,toolbars:[n.contextForms[0]]})}else{const t=cK(e,o);if(t.contextForms.length>0){return N.some({elem:e,toolbars:[t.contextForms[0]]})}else if(n.contextToolbars.length>0||t.contextToolbars.length>0){const o=iK(n.contextToolbars.concat(t.contextToolbars));return N.some({elem:e,toolbars:o})}else{return N.none()}}};const uK=(e,t,o)=>{if(e(t)){return N.none()}else{return Da(t,(e=>{if(pt(e)){const{contextToolbars:t,contextForms:n}=cK(e,o.inNodeScope);const s=n.length>0?n:lK(t);return s.length>0?N.some({elem:e,toolbars:s}):N.none()}else{return N.none()}}),e)}};const fK=(e,t)=>{const o=Je.fromDom(t.getBody());const n=e=>Ct(e,o);const s=e=>!n(e)&&!St(o,e);const r=Je.fromDom(t.selection.getNode());if(s(r)){return N.none()}return dK(r,e.inNodeScope,e.inEditorScope).orThunk((()=>uK(n,r,e)))};const mK=(e,t)=>{const o={};const n=[];const s=[];const r={};const a={};const c=(e,c)=>{const i=Rr(VE(c));o[e]=i;i.launch.map((o=>{r["form:"+e+""]={...c.launch,type:o.type==="contextformtogglebutton"?"togglebutton":"button",onAction:()=>{t(i)}}}));if(i.scope==="editor"){s.push(i)}else{n.push(i)}a[e]=i};const i=(e,t)=>{ZE(t).each((o=>{if(t.scope==="editor"){s.push(o)}else{n.push(o)}a[e]=o}))};const l=ue(e);Z(l,(t=>{const o=e[t];if(o.type==="contextform"){c(t,o)}else if(o.type==="contexttoolbar"){i(t,o)}}));return{forms:o,inNodeScope:n,inEditorScope:s,lookupTable:a,formNavigators:r}};const gK=zd("forward-slide");const pK=zd("backward-slide");const hK=zd("change-slide-event");const yK="tox-pop--resizing";const bK=e=>{const t=cs([]);return Ix.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:e=>{t.set([]);Ix.getContent(e).each((e=>{vo(e.element,"visibility")}));Hi(e.element,yK);vo(e.element,"width")},inlineBehaviours:wi([p_("context-toolbar-events",[ti(sc(),((e,t)=>{if(t.event.raw.propertyName==="width"){Hi(e.element,yK);vo(e.element,"width")}})),Wc(hK,((e,t)=>{const o=e.element;vo(o,"width");const n=Ro(o);Ix.setContent(e,t.event.contents);Bi(o,yK);const s=Ro(o);uo(o,"width",n+"px");Ix.getContent(e).each((e=>{t.event.focus.bind((e=>{tm(e);return rm(o)})).orThunk((()=>{Qw.focusIn(e);return sm(Ut(o))}))}));setTimeout((()=>{uo(e.element,"width",s+"px")}),0)})),Wc(gK,((e,o)=>{Ix.getContent(e).each((o=>{t.set(t.get().concat([{bar:o,focus:sm(Ut(e.element))}]))}));Lc(e,hK,{contents:o.event.forwardContents,focus:N.none()})})),Wc(pK,((e,o)=>{ie(t.get()).each((o=>{t.set(t.get().slice(0,t.get().length-1));Lc(e,hK,{contents:Vu(o.bar),focus:o.focus})}))}))]),Qw.config({mode:"special",onEscape:o=>ie(t.get()).fold((()=>e.onEscape()),(e=>{Bc(o,pK);return N.some(true)}))})]),lazySink:()=>hs.value(e.sink)})};const vK="tox-pop--transition";const kK=(e,t,o,n)=>{const s=n.backstage;const r=s.shared;const a=Sn().deviceType.isTouch;const c=us();const i=us();const l=us();const d=Fu(bK({sink:o,onEscape:()=>{e.focus();return N.some(true)}}));const u=()=>{const t=l.get().getOr("node");const o=nK(t)?1:0;return XG(e,r,t,o)};const f=()=>!e.removed&&!(a()&&s.isContextMenuOpen());const m=e=>ze(Ae(e,c.get(),Ct),true);const g=()=>{if(!f()){return true}else{const t=u();const o=ze(l.get(),"node")?GG(e,c.get()):$G(e);return t.height<=0||!qG(o,t,.01)}};const p=()=>{c.clear();i.clear();l.clear();Ix.hide(d)};const h=()=>{if(Ix.isOpen(d)){const e=d.element;vo(e,"display");if(g()){uo(e,"display","none")}else{i.set(0);Ix.reposition(d)}}};const y=t=>({dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:wi([Qw.config({mode:"acyclic"}),p_("pop-dialog-wrap-events",[oi((t=>{e.shortcuts.add("ctrl+F9","focus statusbar",(()=>Qw.focusIn(t)))})),ni((t=>{e.shortcuts.remove("ctrl+F9")}))])])});const b=Ho((()=>mK(t,(e=>{const t=_([e]);Lc(d,gK,{forwardContents:y(t)})}))));const k=(t,o)=>lG(e,{buttons:t,toolbar:o.items,allowToolbarGroups:false},n.backstage,N.some(["form:"]));const w=(e,t)=>UG.buildInitGroups(e,t);const _=t=>{const{buttons:o}=e.ui.registry.getAll();const n=b();const s={...o,...n.formNavigators};const a=aC(e)===Zx.scrolling?Zx.scrolling:Zx.default;const c=J(j(t,(e=>e.type==="contexttoolbar"?k(s,e):w(e,r.providers))));return _q({type:a,uid:zd("context-toolbar"),initGroups:c,onEscape:N.none,cyclicKeying:true,providers:r.providers})};const x=(t,n)=>{const s=t==="node"?r.anchors.node(n):r.anchors.cursor();const l=aK(e,t,a(),{lastElement:c.get,isReposition:()=>ze(i.get(),0),getMode:()=>th.getMode(o)});return Bs(s,l)};const C=(e,t)=>{z.cancel();if(!f()){return}const n=_(e);const s=e[0].position;const r=x(s,t);l.set(s);i.set(1);const a=d.element;vo(a,"display");if(!m(t)){Hi(a,vK);th.reset(o,d)}Ix.showWithinBounds(d,y(n),{anchor:r,transition:{classes:[vK],mode:"placement"}},(()=>N.some(u())));t.fold(c.clear,c.set);if(g()){uo(a,"display","none")}};let S=false;const z=IH((()=>{if(!e.hasFocus()||e.removed||S){return}if(Pi(d.element,vK)){z.throttle()}else{const t=b();fK(t,e).fold(p,(e=>{C(e.toolbars,N.some(e.elem))}))}}),17);e.on("init",(()=>{e.on("remove",p);e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",h);e.on("click keyup focus SetContent",z.throttle);e.on(RG,p);e.on(MG,(t=>{const o=b();xe(o.lookupTable,t.toolbarKey).each((o=>{C([o],Me(t.target!==e,t.target));Ix.getContent(d).each(Qw.focusIn)}))}));e.on("focusout",(t=>{Px.setEditorTimeout(e,(()=>{if(rm(o.element).isNone()&&rm(d.element).isNone()){p()}}),0)}));e.on("SwitchMode",(()=>{if(e.mode.isReadOnly()){p()}}));e.on("ExecCommand",(({command:e})=>{if(e.toLowerCase()==="toggleview"){p()}}));e.on("AfterProgressState",(t=>{if(t.state){p()}else if(e.hasFocus()){z.throttle()}}));e.on("dragstart",(()=>{S=true}));e.on("dragend drop",(()=>{S=false}));e.on("NodeChange",(e=>{rm(d.element).fold(z.throttle,v)}))}))};const wK=e=>{const t=[{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}];Z(t,(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:GA(e,t.cmd),onSetup:qA(e,t.name)})}));e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:ZA(e),onAction:GA(e,"JustifyNone")})};const _K=(e,t)=>{const o=()=>{const o=t.getOptions(e);const n=t.getCurrent(e).map(t.hash);const s=us();return j(o,(o=>({type:"togglemenuitem",text:t.display(o),onSetup:r=>{const a=e=>{if(e){s.on((e=>e.setActive(false)));s.set(r)}r.setActive(e)};a(ze(n,t.hash(o)));const c=t.watcher(e,o,a);return()=>{s.clear();c()}},onAction:()=>t.setCurrent(e,o)})))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:e=>e(o()),onSetup:t.onToolbarSetup});e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:o,onSetup:t.onMenuSetup})};const xK=e=>({name:"lineheight",text:"Line height",icon:"line-height",getOptions:LC,hash:e=>d$(e,["fixed","relative","empty"]).getOr(e),display:C,watcher:(e,t,o)=>e.formatter.formatChanged("lineheight",o,false,{value:t}).unbind,getCurrent:e=>N.from(e.queryCommandValue("LineHeight")),setCurrent:(e,t)=>e.execCommand("LineHeight",false,t),onToolbarSetup:ZA(e),onMenuSetup:ZA(e)});const CK=e=>{const t=N.from(sC(e));return t.map((t=>({name:"language",text:"Language",icon:"language",getOptions:x(t),hash:e=>m(e.customCode)?e.code:`${e.code}/${e.customCode}`,display:e=>e.title,watcher:(e,t,o)=>{var n;return e.formatter.formatChanged("lang",o,false,{value:t.code,customValue:(n=t.customCode)!==null&&n!==void 0?n:null}).unbind},getCurrent:e=>{const t=Je.fromDom(e.selection.getNode());return Na(t,(e=>N.some(e).filter(pt).bind((e=>{const t=so(e,"lang");return t.map((t=>{const o=so(e,"data-mce-lang").getOrUndefined();return{code:t,customCode:o,title:""}}))}))))},setCurrent:(e,t)=>e.execCommand("Lang",false,t),onToolbarSetup:t=>{const o=ds();t.setActive(e.formatter.match("lang",{},undefined,true));o.set(e.formatter.formatChanged("lang",t.setActive,true));return jA(o.clear,ZA(e)(t))},onMenuSetup:ZA(e)})))};const SK=e=>{_K(e,xK(e));CK(e).each((t=>_K(e,t)))};const zK=(e,t)=>{jW(e,t);r$(e,t);M$(e,t);KW(e,t);E$(e,t)};const TK=e=>WA(e,"NodeChange",(t=>{t.setEnabled(e.queryCommandState("outdent")&&e.selection.isEditable())}));const EK=e=>{e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:TK(e),onAction:GA(e,"outdent")});e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:ZA(e),onAction:GA(e,"indent")})};const OK=e=>{EK(e)};const AK=(e,t)=>o=>{o.setActive(t.get());const n=e=>{t.set(e.state);o.setActive(e.state)};e.on("PastePlainTextToggle",n);return jA((()=>e.off("PastePlainTextToggle",n)),ZA(e)(o))};const DK=e=>{const t=cs(TC(e));const o=()=>e.execCommand("mceTogglePlainTextPaste");e.ui.registry.addToggleButton("pastetext",{active:false,icon:"paste-text",tooltip:"Paste as text",onAction:o,onSetup:AK(e,t)});e.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:o,onSetup:AK(e,t)})};const NK=(e,t)=>()=>{e.execCommand("mceToggleFormat",false,t)};const MK=e=>{NH.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],((t,o)=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:qA(e,t.name),onAction:NK(e,t.name),shortcut:t.shortcut})}));for(let t=1;t<=6;t++){const o="h"+t;const n=`Access+${t}`;e.ui.registry.addToggleButton(o,{text:o.toUpperCase(),tooltip:"Heading "+t,onSetup:qA(e,o),onAction:NK(e,o),shortcut:n})}};const RK=e=>{NH.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:GA(e,t.action),shortcut:t.shortcut})}));NH.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:ZA(e),onAction:GA(e,t.action)})}))};const BK=e=>{NH.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(t=>{e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:GA(e,t.action),onSetup:qA(e,t.name)})}))};const LK=e=>{MK(e);RK(e);BK(e)};const HK=e=>{NH.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:GA(e,t.action)})}));NH.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],(t=>{e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onSetup:ZA(e),onAction:GA(e,t.action)})}));e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:ZA(e),onAction:NK(e,"code")})};const IK=e=>{LK(e);HK(e)};const PK=(e,t)=>WA(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(o=>{o.setEnabled(!e.mode.isReadOnly()&&e.undoManager[t]())}));const FK=e=>{e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:PK(e,"hasUndo"),onAction:GA(e,"undo")});e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:PK(e,"hasRedo"),onAction:GA(e,"redo")})};const VK=e=>{e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:false,onSetup:PK(e,"hasUndo"),onAction:GA(e,"undo"),shortcut:"Meta+Z"});e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:false,onSetup:PK(e,"hasRedo"),onAction:GA(e,"redo"),shortcut:"Meta+Y"})};const jK=e=>{FK(e);VK(e)};const ZK=e=>WA(e,"VisualAid",(t=>{t.setActive(e.hasVisual)}));const UK=e=>{e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:ZK(e),onAction:GA(e,"mceToggleVisualAid")})};const qK=e=>{e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:GA(e,"mceToggleVisualAid")})};const WK=e=>{qK(e);UK(e)};const $K=(e,t)=>{wK(e);IK(e);zK(e,t);jK(e);ID(e);WK(e);OK(e);SK(e);DK(e)};const GK=e=>c(e)?e.split(/[ ,]/):e;const KK=e=>t=>t.options.get(e);const YK=e=>{const t=e.options.register;t("contextmenu_avoid_overlap",{processor:"string",default:""});t("contextmenu_never_use_native",{processor:"boolean",default:false});t("contextmenu",{processor:e=>{if(e===false){return{value:[],valid:true}}else if(c(e)||b(e,c)){return{value:GK(e),valid:true}}else{return{valid:false,message:"Must be false or a string."}}},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})};const XK=KK("contextmenu_never_use_native");const JK=KK("contextmenu_avoid_overlap");const QK=e=>eY(e).length===0;const eY=e=>{const t=e.ui.registry.getAll().contextMenus;const o=e.options.get("contextmenu");if(e.options.isSet("contextmenu")){return o}else{return W(o,(e=>Ce(t,e)))}};const tY=(e,t)=>({type:"makeshift",x:e,y:t});const oY=(e,t,o)=>tY(e.x+t,e.y+o);const nY=e=>e.type==="longpress"||e.type.indexOf("touch")===0;const sY=e=>{if(nY(e)){const t=e.touches[0];return tY(t.pageX,t.pageY)}else{return tY(e.pageX,e.pageY)}};const rY=e=>{if(nY(e)){const t=e.touches[0];return tY(t.clientX,t.clientY)}else{return tY(e.clientX,e.clientY)}};const aY=(e,t)=>{const o=Fx.DOM.getPos(e);return oY(t,o.x,o.y)};const cY=(e,t)=>{if(t.type==="contextmenu"||t.type==="longpress"){if(e.inline){return sY(t)}else{return aY(e.getContentAreaContainer(),rY(t))}}else{return iY(e)}};const iY=e=>({type:"selection",root:Je.fromDom(e.selection.getNode())});const lY=e=>({type:"node",node:N.some(Je.fromDom(e.selection.getNode())),root:Je.fromDom(e.getBody())});const dY=(e,t,o)=>{switch(o){case"node":return lY(e);case"point":return cY(e,t);case"selection":return iY(e)}};const uY=(e,t,o,n,s,r)=>{const a=o();const c=dY(e,t,r);II(a,Zz.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:false,search:N.none()}).map((e=>{t.preventDefault();Ix.showMenuAt(s,{anchor:c},{menu:{markers:mT("normal")},data:e})}))};const fY={onLtr:()=>[Pf,Rf,Bf,Lf,Hf,If,SV,zV,CV,_V,xV,wV],onRtl:()=>[Pf,Bf,Rf,Hf,Lf,If,SV,zV,xV,wV,CV,_V]};const mY=12;const gY={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]};const pY=(e,t)=>{const o=e.selection;if(o.isCollapsed()||t.touches.length<1){return false}else{const n=t.touches[0];const s=o.getRng();const r=hp(e.getWin(),Gg.domRange(s));return r.exists((e=>e.left<=n.clientX&&e.right>=n.clientX&&e.top<=n.clientY&&e.bottom>=n.clientY))}};const hY=e=>{const t=e.selection.getRng();const o=()=>{Px.setEditorTimeout(e,(()=>{e.selection.setRng(t)}),10);r()};e.once("touchend",o);const n=e=>{e.preventDefault();e.stopImmediatePropagation()};e.on("mousedown",n,true);const s=()=>r();e.once("longpresscancel",s);const r=()=>{e.off("touchend",o);e.off("longpresscancel",s);e.off("mousedown",n)}};const yY=(e,t,o)=>{const n=dY(e,t,o);const s=o==="point"?mY:0;return{bubble:tg(0,s,gY),layouts:fY,overrides:{maxWidthFunction:UU(),maxHeightFunction:Ym()},...n}};const bY=(e,t,o,n,s,r,a)=>{const c=yY(e,t,r);II(o,Zz.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:true,search:N.none()}).map((o=>{t.preventDefault();const i=a?Ox.HighlightMenuAndItem:Ox.HighlightNone;Ix.showMenuWithinBounds(s,{anchor:c},{menu:{markers:mT("normal"),highlightOnOpen:i},data:o,type:"horizontal"},(()=>N.some(XG(e,n.shared,r==="node"?"node":"selection"))));e.dispatch(RG)}))};const vY=(e,t,o,n,s,r)=>{const a=Sn();const c=a.os.isiOS();const i=a.os.isMacOS();const l=a.os.isAndroid();const d=a.deviceType.isTouch();const u=()=>!(l||c||i&&d);const f=()=>{const a=o();bY(e,t,a,n,s,r,u())};if((i||c)&&r!=="node"){const o=()=>{hY(e);f()};if(pY(e,t)){o()}else{e.once("selectionchange",o);e.once("touchend",(()=>e.off("selectionchange",o)))}}else{f()}};const kY=e=>c(e)?e==="|":e.type==="separator";const wY={type:"separator"};const _Y=e=>{const t=e=>({text:e.text,icon:e.icon,enabled:e.enabled,shortcut:e.shortcut});if(c(e)){return e}else{switch(e.type){case"separator":return wY;case"submenu":return{type:"nestedmenuitem",...t(e),getSubmenuItems:()=>{const t=e.getSubmenuItems();if(c(t)){return t}else{return j(t,_Y)}}};default:const o=e;return{type:"menuitem",...t(o),onAction:k(o.onAction)}}}};const xY=(e,t)=>{if(t.length===0){return e}const o=ie(e).filter((e=>!kY(e)));const n=o.fold((()=>[]),(e=>[wY]));return e.concat(n).concat(t).concat([wY])};const CY=(e,t,o)=>{const n=G(t,((t,n)=>xe(e,n.toLowerCase()).map((e=>{const n=e.update(o);if(c(n)&&Ue(Ze(n))){return xY(t,n.split(" "))}else if(d(n)&&n.length>0){const e=j(n,_Y);return xY(t,e)}else{return t}})).getOrThunk((()=>t.concat([n])))),[]);if(n.length>0&&kY(n[n.length-1])){n.pop()}return n};const SY=(e,t)=>t.ctrlKey&&!XK(e);const zY=e=>e.type==="longpress"||Ce(e,"touches");const TY=(e,t)=>!zY(t)&&(t.button!==2||t.target===e.getBody()&&t.pointerType==="");const EY=(e,t)=>TY(e,t)?e.selection.getStart(true):t.target;const OY=(e,t)=>{const o=JK(e);const n=TY(e,t)?"selection":"point";if(Ue(o)){const s=EY(e,t);const r=dM(Je.fromDom(s),o);return r?"node":n}else{return n}};const AY=(e,t,o)=>{const n=Sn();const s=n.deviceType.isTouch;const r=Fu(Ix.sketch({dom:{tag:"div"},lazySink:t,onEscape:()=>e.focus(),onShow:()=>o.setContextMenuState(true),onHide:()=>o.setContextMenuState(false),fireDismissalEventInstead:{},inlineBehaviours:wi([p_("dismissContextMenu",[Wc(zc(),((t,o)=>{Ph.close(t);e.focus()}))])])}));const a=()=>Ix.hide(r);const c=t=>{if(XK(e)){t.preventDefault()}if(SY(e,t)||QK(e)){return}const n=OY(e,t);const a=()=>{const o=EY(e,t);const n=e.ui.registry.getAll();const s=eY(e);return CY(n.contextMenus,s,o)};const c=s()?vY:uY;c(e,t,a,o,r,n)};e.on("init",(()=>{const t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(s()?"":" ResizeWindow");e.on(t,a);e.on("longpress contextmenu",c)}))};const DY=va.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]);const NY=e=>t=>t.translate(-e.left,-e.top);const MY=e=>t=>t.translate(e.left,e.top);const RY=e=>(t,o)=>G(e,((e,t)=>t(e)),To(t,o));const BY=(e,t,o)=>e.fold(RY([MY(o),NY(t)]),RY([NY(t)]),RY([]));const LY=(e,t,o)=>e.fold(RY([MY(o)]),RY([]),RY([MY(t)]));const HY=(e,t,o)=>e.fold(RY([]),RY([NY(o)]),RY([MY(t),NY(o)]));const IY=(e,t,o,n,s,r)=>{const a=LY(e,s,r);const c=LY(t,s,r);return Math.abs(a.left-c.left)<=o&&Math.abs(a.top-c.top)<=n};const PY=(e,t,o,n,s,r)=>{const a=LY(e,s,r);const c=LY(t,s,r);const i=Math.abs(a.left-c.left);const l=Math.abs(a.top-c.top);return To(i,l)};const FY=(e,t,o)=>{const n=e.fold(((e,t)=>({position:N.some("absolute"),left:N.some(e+"px"),top:N.some(t+"px")})),((e,t)=>({position:N.some("absolute"),left:N.some(e-o.left+"px"),top:N.some(t-o.top+"px")})),((e,t)=>({position:N.some("fixed"),left:N.some(e+"px"),top:N.some(t+"px")})));return{right:N.none(),bottom:N.none(),...n}};const VY=(e,t,o)=>e.fold(((e,n)=>ZY(e+t,n+o)),((e,n)=>UY(e+t,n+o)),((e,n)=>qY(e+t,n+o)));const jY=(e,t,o,n)=>{const s=(e,s)=>(r,a)=>{const c=e(t,o,n);return s(r.getOr(c.left),a.getOr(c.top))};return e.fold(s(HY,ZY),s(LY,UY),s(BY,qY))};const ZY=DY.offset;const UY=DY.absolute;const qY=DY.fixed;const WY=(e,t)=>{const o=no(e,t);return m(o)?NaN:parseInt(o,10)};const $Y=(e,t)=>{const o=e.element;const n=WY(o,t.leftAttr);const s=WY(o,t.topAttr);return isNaN(n)||isNaN(s)?N.none():N.some(To(n,s))};const GY=(e,t,o)=>{const n=e.element;to(n,t.leftAttr,o.left+"px");to(n,t.topAttr,o.top+"px")};const KY=(e,t)=>{const o=e.element;ao(o,t.leftAttr);ao(o,t.topAttr)};const YY=(e,t,o,n)=>$Y(e,t).fold((()=>o),(e=>qY(e.left+n.left,e.top+n.top)));const XY=(e,t,o,n,s,r)=>{const a=YY(e,t,o,n);const c=t.mustSnap?eX(e,t,a,s,r):tX(e,t,a,s,r);const i=BY(a,s,r);GY(e,t,i);return c.fold((()=>({coord:qY(i.left,i.top),extra:N.none()})),(e=>({coord:e.output,extra:e.extra})))};const JY=(e,t)=>{KY(e,t)};const QY=(e,t,o,n)=>de(e,(e=>{const s=e.sensor;const r=IY(t,s,e.range.left,e.range.top,o,n);return r?N.some({output:jY(e.output,t,o,n),extra:e.extra}):N.none()}));const eX=(e,t,o,n,s)=>{const r=t.getSnapPoints(e);const a=QY(r,o,n,s);return a.orThunk((()=>{const e=G(r,((e,t)=>{const r=t.sensor;const a=PY(o,r,t.range.left,t.range.top,n,s);return e.deltas.fold((()=>({deltas:N.some(a),snap:N.some(t)})),(o=>{const n=(a.left+a.top)/2;const s=(o.left+o.top)/2;if(n<=s){return{deltas:N.some(a),snap:N.some(t)}}else{return e}}))}),{deltas:N.none(),snap:N.none()});return e.snap.map((e=>({output:jY(e.output,o,n,s),extra:e.extra})))}))};const tX=(e,t,o,n,s)=>{const r=t.getSnapPoints(e);return QY(r,o,n,s)};const oX=(e,t,o)=>({coord:jY(e.output,e.output,t,o),extra:e.extra});const nX=(e,t,o,n)=>{const s=t.getTarget(e.element);if(t.repositionTarget){const t=zt(e.element);const o=Vn(t);const r=Yi(s);const a=oX(n,o,r);const c=FY(a.coord,o,r);mo(s,c)}};var sX=Object.freeze({__proto__:null,snapTo:nX});const rX="data-initial-z-index";const aX=e=>{At(e.element).filter(pt).each((e=>{so(e,rX).fold((()=>vo(e,"z-index")),(t=>uo(e,"z-index",t)));ao(e,rX)}))};const cX=e=>{At(e.element).filter(pt).each((t=>{ho(t,"z-index").each((e=>{to(t,rX,e)}));uo(t,"z-index",go(e.element,"z-index"))}))};const iX=(e,t)=>{e.getSystem().addToGui(t);cX(t)};const lX=e=>{aX(e);e.getSystem().removeFromGui(e)};const dX=(e,t,o)=>e.getSystem().build(RM.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:o}));var uX=aa("snaps",[jr("getSnapPoints"),ud("onSensor"),jr("leftAttr"),jr("topAttr"),ia("lazyViewport",as),ia("mustSnap",false)]);const fX=[ia("useFixed",A),jr("blockerClass"),ia("getTarget",C),ia("onDrag",v),ia("repositionTarget",true),ia("onDrop",v),ga("getBounds",as),uX];const mX=e=>De(ho(e,"left"),ho(e,"top"),ho(e,"position"),((e,t,o)=>{const n=o==="fixed"?qY:ZY;return n(parseInt(e,10),parseInt(t,10))})).getOrThunk((()=>{const t=Ao(e);return UY(t.left,t.top)}));const gX=(e,t,o,n,s)=>{const r=s.bounds;const a=LY(t,o,n);const c=wf(a.left,r.x,r.x+r.width-s.width);const i=wf(a.top,r.y,r.y+r.height-s.height);const l=UY(c,i);return t.fold((()=>{const e=HY(l,o,n);return ZY(e.left,e.top)}),x(l),(()=>{const e=BY(l,o,n);return qY(e.left,e.top)}))};const pX=(e,t,o,n,s,r,a)=>{const c=t.fold((()=>{const e=VY(o,r.left,r.top);const t=BY(e,n,s);return qY(t.left,t.top)}),(t=>{const a=XY(e,t,o,r,n,s);a.extra.each((o=>{t.onSensor(e,o)}));return a.coord}));return gX(e,c,n,s,a)};const hX=(e,t,o,n)=>{const s=t.getTarget(e.element);if(t.repositionTarget){const r=zt(e.element);const a=Vn(r);const c=Yi(s);const i=mX(s);const l=pX(e,t.snaps,i,a,c,n,o);const d=FY(l,a,c);mo(s,d)}t.onDrag(e,s,n)};const yX=(e,t)=>({bounds:e.getBounds(),height:Co(t.element),width:Bo(t.element)});const bX=(e,t,o,n,s)=>{const r=o.update(n,s);const a=o.getStartData().getOrThunk((()=>yX(t,e)));r.each((o=>{hX(e,t,a,o)}))};const vX=(e,t,o,n)=>{t.each(lX);o.snaps.each((t=>{JY(e,t)}));const s=o.getTarget(e.element);n.reset();o.onDrop(e,s)};const kX=e=>(t,o)=>{const n=e=>{o.setStartData(yX(t,e))};return jc([Wc(_c(),(e=>{o.getStartData().each((()=>n(e)))})),...e(t,o,n)])};const wX=e=>jc([Wc(qa(),e.forceDrop),Wc(Ga(),e.drop),Wc(Wa(),((t,o)=>{e.move(o.event)})),Wc($a(),e.delayDrop)]);const _X=e=>N.from(To(e.x,e.y));const xX=(e,t)=>To(t.left-e.left,t.top-e.top);var CX=Object.freeze({__proto__:null,getData:_X,getDelta:xX});const SX=(e,t,o)=>[Wc(qa(),((n,s)=>{const r=s.event.raw;if(r.button!==0){return}s.stop();const a=()=>vX(n,N.some(l),e,t);const c=uM(a,200);const i={drop:a,delayDrop:c.schedule,forceDrop:a,move:o=>{c.cancel();bX(n,e,t,CX,o)}};const l=dX(n,e.blockerClass,wX(i));const d=()=>{o(n);iX(n,l)};d()}))];const zX=[...fX,pd("dragger",{handlers:kX(SX)})];const TX=e=>jc([Wc(Va(),e.forceDrop),Wc(Za(),e.drop),Wc(Ua(),e.drop),Wc(ja(),((t,o)=>{e.move(o.event)}))]);const EX=e=>{const t=e[0];return N.some(To(t.clientX,t.clientY))};const OX=e=>{const t=e.raw;const o=t.touches;return o.length===1?EX(o):N.none()};const AX=(e,t)=>To(t.left-e.left,t.top-e.top);var DX=Object.freeze({__proto__:null,getData:OX,getDelta:AX});const NX=(e,t,o)=>{const n=us();const s=o=>{vX(o,n.get(),e,t);n.clear()};return[Wc(Va(),((r,a)=>{a.stop();const c=()=>s(r);const i={drop:c,delayDrop:v,forceDrop:c,move:o=>{bX(r,e,t,DX,o)}};const l=dX(r,e.blockerClass,TX(i));n.set(l);const d=()=>{o(r);iX(r,l)};d()})),Wc(ja(),((o,n)=>{n.stop();bX(o,e,t,DX,n.event)})),Wc(Za(),((e,t)=>{t.stop();s(e)})),Wc(Ua(),s)]};const MX=[...fX,pd("dragger",{handlers:kX(NX)})];const RX=(e,t,o)=>[...SX(e,t,o),...NX(e,t,o)];const BX=[...fX,pd("dragger",{handlers:kX(RX)})];const LX=zX;const HX=MX;const IX=BX;var PX=Object.freeze({__proto__:null,mouse:LX,touch:HX,mouseOrTouch:IX});const FX=()=>{let e=N.none();let t=N.none();const o=()=>{e=N.none();t=N.none()};const n=(t,o)=>{const n=e.map((e=>t.getDelta(e,o)));e=N.some(o);return n};const s=(e,t)=>e.getData(t).bind((t=>n(e,t)));const r=e=>{t=N.some(e)};const a=()=>t;const c=x({});return ki({readState:c,reset:o,update:s,getStartData:a,setStartData:r})};var VX=Object.freeze({__proto__:null,init:FX});const jX=Si({branchKey:"mode",branches:PX,name:"dragging",active:{events:(e,t)=>{const o=e.dragger;return o.handlers(e,t)}},extra:{snap:e=>({sensor:e.sensor,range:e.range,output:e.output,extra:N.from(e.extra)})},state:VX,apis:sX});const ZX=40;const UX=ZX/2;const qX=(e,t,o,n,s,r)=>e.fold((()=>jX.snap({sensor:UY(o-UX,n-UX),range:To(s,r),output:UY(N.some(o),N.some(n)),extra:{td:t}})),(e=>{const s=o-UX;const r=n-UX;const a=ZX;const c=ZX;const i=e.element.dom.getBoundingClientRect();return jX.snap({sensor:UY(s,r),range:To(a,c),output:UY(N.some(o-i.width/2),N.some(n-i.height/2)),extra:{td:t}})}));const WX=(e,t,o)=>{const n=(e,t)=>e.exists((e=>Ct(e,t)));return{getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:(e,s)=>{const r=s.td;if(!n(t.get(),r)){t.set(r);o(r)}},mustSnap:true}};const $X=e=>aS(oS.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:wi([jX.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),vR.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}));const GX=(e,t)=>{const o=cs([]);const n=cs([]);const s=cs(false);const r=us();const a=us();const c=e=>{const o=ns(e);return qX(m.getOpt(t),e,o.x,o.y,o.width,o.height)};const i=()=>j(o.get(),(e=>c(e)));const l=e=>{const o=ns(e);return qX(g.getOpt(t),e,o.right,o.bottom,o.width,o.height)};const d=()=>j(n.get(),(e=>l(e)));const u=WX(i,r,(t=>{a.get().each((o=>{e.dispatch("TableSelectorChange",{start:t,finish:o})}))}));const f=WX(d,a,(t=>{r.get().each((o=>{e.dispatch("TableSelectorChange",{start:o,finish:t})}))}));const m=$X(u);const g=$X(f);const p=Fu(m.asSpec());const h=Fu(g.asSpec());const y=(t,o,n,s)=>{const r=o.dom.getBoundingClientRect();vo(t.element,"display");const a=Ot(Je.fromDom(e.getBody())).dom.innerHeight;const c=n(r);const i=s(r,a);if(c||i){uo(t.element,"display","none")}};const b=(e,t,o,n)=>{const s=o(t);jX.snapTo(e,s);const r=e=>e[n]<0;const a=(e,t)=>e[n]>t;y(e,t,r,a)};const v=e=>b(p,e,c,"top");const k=()=>r.get().each(v);const w=e=>b(h,e,l,"bottom");const _=()=>a.get().each(w);if(Sn().deviceType.isTouch()){const c=e=>j(e,Je.fromDom);e.on("TableSelectionChange",(e=>{if(!s.get()){uh(t,p);uh(t,h);s.set(true)}const i=Je.fromDom(e.start);const l=Je.fromDom(e.finish);r.set(i);a.set(l);N.from(e.otherCells).each((e=>{o.set(c(e.upOrLeftCells));n.set(c(e.downOrRightCells));v(i);w(l)}))}));e.on("ResizeEditor ResizeWindow ScrollContent",(()=>{k();_()}));e.on("TableSelectionClear",(()=>{if(s.get()){gh(p);gh(h);s.set(false)}r.clear();a.clear()}))}};var KX='<svg height="16" viewBox="0 0 80 16" width="80" xmlns="http://www.w3.org/2000/svg"><g opacity=".8"><path d="m80 3.537v-2.202h-7.976v11.585h7.976v-2.25h-5.474v-2.621h4.812v-2.069h-4.812v-2.443zm-10.647 6.929c-.493.217-1.13.337-1.864.337s-1.276-.156-1.805-.47a3.732 3.732 0 0 1 -1.3-1.298c-.324-.554-.48-1.191-.48-1.877s.156-1.335.48-1.877a3.635 3.635 0 0 1 1.3-1.299 3.466 3.466 0 0 1 1.805-.481c.65 0 .914.06 1.263.18.36.12.698.277.986.47.289.192.578.384.842.6l.12.085v-2.586l-.023-.024c-.385-.35-.855-.614-1.384-.818-.53-.205-1.155-.313-1.877-.313-.721 0-1.6.144-2.333.445a5.773 5.773 0 0 0 -1.937 1.251 5.929 5.929 0 0 0 -1.324 1.9c-.324.735-.48 1.565-.48 2.455s.156 1.72.48 2.454c.325.734.758 1.383 1.324 1.913.553.53 1.215.938 1.937 1.25a6.286 6.286 0 0 0 2.333.434c.819 0 1.384-.108 1.961-.313.59-.216 1.083-.505 1.468-.866l.024-.024v-2.49l-.12.096c-.41.337-.878.626-1.396.866zm-14.869-4.15-4.8-5.04-.024-.025h-.902v11.67h2.502v-6.847l2.827 3.08.385.409.397-.41 2.791-3.067v6.845h2.502v-11.679h-.902l-4.788 5.052z"/><path clip-rule="evenodd" d="m15.543 5.137c0-3.032-2.466-5.113-4.957-5.137-.36 0-.745.024-1.094.096-.157.024-3.85.758-3.85.758-3.032.602-4.62 2.466-4.704 4.788-.024.89-.024 4.27-.024 4.27.036 3.165 2.406 5.138 5.017 5.126.337 0 1.119-.109 1.287-.145.144-.024.385-.084.746-.144.661-.12 1.684-.325 3.067-.602 2.37-.409 4.103-2.009 4.44-4.33.156-1.023.084-4.692.084-4.692zm-3.213 3.308-2.346.457v2.31l-5.859 1.143v-5.75l2.346-.458v3.441l3.513-.686v-3.44l-3.513.685v-2.297l5.859-1.143v5.75zm20.09-3.296-.083-1.023h-2.13v8.794h2.346v-4.884c0-1.107.95-1.985 2.057-1.997 1.095 0 1.901.89 1.901 1.997v4.884h2.346v-5.245c-.012-2.105-1.588-3.777-3.67-3.765a3.764 3.764 0 0 0 -2.778 1.25l.012-.011zm-6.014-4.102 2.346-.458v2.298l-2.346.457z" fill-rule="evenodd"/><path d="m28.752 4.126h-2.346v8.794h2.346z"/><path clip-rule="evenodd" d="m43.777 15.483 4.043-11.357h-2.418l-1.54 4.355-.445 1.324-.36-1.324-1.54-4.355h-2.418l3.151 8.794-1.083 3.08zm-21.028-5.51c0 .722.541 1.034.878 1.034s.638-.048.95-.144l.518 1.708c-.217.145-.879.518-2.13.518a2.565 2.565 0 0 1 -2.562-2.587c-.024-1.082-.024-2.49 0-4.21h-1.54v-2.142h1.54v-1.912l2.346-.458v2.37h2.201v2.142h-2.2v3.693-.012z" fill-rule="evenodd"/></g></svg>\n';const YX=(e,t)=>{const o=N.from(no(e,"id")).getOrThunk((()=>{const e=zd("aria");to(t,"id",e);return e}));to(e,"aria-describedby",o)};const XX=e=>{ao(e,"aria-describedby")};const JX=e=>e.nodeName==="BR"||!!e.getAttribute("data-mce-bogus")||e.getAttribute("data-mce-type")==="bookmark";const QX=(e,t,o)=>{var n;const s=(n=t.delimiter)!==null&&n!==void 0?n:"›";const r=(t,n,s)=>oS.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":s}},components:[Bu(t)],action:t=>{e.focus();e.selection.select(n);e.nodeChanged()},buttonBehaviours:wi([CS.config({...o.tooltips.getConfig({tooltipText:o.translate(["Select the {0} element",n.nodeName.toLowerCase()]),onShow:(e,t)=>{YX(e.element,t.element)},onHide:e=>{XX(e.element)}})}),zO.button(o.isDisabled),wO()])});const a=()=>({dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":true}},components:[Bu(` ${s} `)]});const c=e=>G(e,((e,t,o)=>{const n=r(t.name,t.element,o);if(o===0){return e.concat([n])}else{return e.concat([a(),n])}}),[]);const i=t=>{const o=[];let n=t.length;while(n-- >0){const s=t[n];if(s.nodeType===1&&!JX(s)){const t=RA(e,s);if(!t.isDefaultPrevented()){o.push({name:t.name,element:s})}if(t.isPropagationStopped()){break}}}return o};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:wi([Qw.config({mode:"flow",selector:"div[role=button]"}),sv.config({disabled:o.isDisabled}),wO(),dS.config({}),m_.config({}),p_("elementPathEvents",[oi(((t,o)=>{e.shortcuts.add("alt+F11","focus statusbar elementpath",(()=>Qw.focusIn(t)));e.on("NodeChange",(e=>{const o=i(e.parents);const n=o.length>0?c(o):[];m_.set(t,n)}))}))])]),components:[]}};var eJ;(function(e){e[e["None"]=0]="None";e[e["Both"]=1]="Both";e[e["Vertical"]=2]="Vertical"})(eJ||(eJ={}));const tJ=(e,t,o,n,s)=>{const r={height:vG(n+t.top,Jx(e),eC(e))};if(o===eJ.Both){r.width=vG(s+t.left,Xx(e),Qx(e))}return r};const oJ=(e,t,o)=>{const n=Je.fromDom(e.getContainer());const s=tJ(e,t,o,xo(n),Ro(n));me(s,((e,t)=>{if(y(e)){uo(n,t,bG(e))}}));OA(e)};const nJ=e=>{const t=zC(e);if(t===false){return eJ.None}else if(t==="both"){return eJ.Both}else{return eJ.Vertical}};const sJ=(e,t,o,n)=>{const s=20;const r=To(o*s,n*s);oJ(e,r,t);return N.some(true)};const rJ=(e,t)=>{const o=nJ(e);if(o===eJ.None){return N.none()}const n=o===eJ.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return N.some(Rz("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{"aria-label":t.translate(n),"data-mce-name":"resize-handle"},behaviours:[jX.config({mode:"mouse",repositionTarget:false,onDrag:(t,n,s)=>oJ(e,s,o),blockerClass:"tox-blocker"}),Qw.config({mode:"special",onLeft:()=>sJ(e,o,-1,0),onRight:()=>sJ(e,o,1,0),onUp:()=>sJ(e,o,0,-1),onDown:()=>sJ(e,o,0,1)}),dS.config({}),C_.config({}),CS.config(t.tooltips.getConfig({tooltipText:t.translate("Resize")}))]},t.icons))};const aJ=(e,t)=>{const o=(e,o,n)=>m_.set(e,[Bu(t.translate(["{0} "+n,o[n]]))]);return oS.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:wi([zO.button(t.isDisabled),wO(),dS.config({}),m_.config({}),wy.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),p_("wordcount-events",[ri((e=>{const t=wy.getValue(e);const n=t.mode==="words"?"characters":"words";wy.setValue(e,{mode:n,count:t.count});o(e,t.count,n)})),oi((t=>{e.on("wordCountUpdate",(e=>{const{mode:n}=wy.getValue(t);wy.setValue(t,{mode:n,count:e.wordCount});o(t,e.wordCount,n)}))}))])]),eventOrder:{[mc()]:["disabling","alloy.base.behaviour","wordcount-events"]}})};const cJ=(e,t)=>{const o=()=>({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":e.translate(["Build with {0}","TinyMCE"])},innerHtml:e.translate(["Build with {0}",KX.trim()])},behaviours:wi([C_.config({})])}]});const n=()=>{const e=BO("Alt+0");const t=`Press {0} for help`;return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Bu(xz.translate([t,e]))]}};const s=()=>{const n=[];if(e.hasPlugin("wordcount")){n.push(aJ(e,t))}if(SC(e)){n.push(o())}return{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:n}};const r=()=>{const o=[];const r=AC(e);const a=CC(e);const c=SC(e)||e.hasPlugin("wordcount");const i=()=>{const e="tox-statusbar__text-container--flex-start";const t="tox-statusbar__text-container--flex-end";const o="tox-statusbar__text-container--space-around";if(r){const n="tox-statusbar__text-container-3-cols";if(!c&&!a){return[n,o]}if(c&&!a){return[n,t]}return[n,e]}return[c&&!a?t:e]};if(a){o.push(QX(e,{},t))}if(r){o.push(n())}if(c){o.push(s())}if(o.length>0){return[{dom:{tag:"div",classes:["tox-statusbar__text-container",...i()]},components:o}]}return[]};const a=()=>{const o=r();const n=rJ(e,t);return o.concat(n.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:a()}};const iJ=(e,t)=>t.get().getOrDie(`UI for ${e} has not been rendered`);const lJ=(e,t)=>{const o=e.inline;const n=o?DG:hG;const s=qC(e)?MZ:yZ;const r=NG();const a=us();const c=us();const i=us();const l=Sn();const d=l.deviceType.isTouch();const u="tox-platform-touch";const f=d?[u]:[];const m=FC(e);const g=aC(e);const p=aS({dom:{tag:"div",classes:["tox-anchorbar"]}});const h=aS({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}});const y=()=>r.mainUi.get().map((e=>e.outerContainer)).bind(uW.getHeader);const b=()=>hs.fromOption(r.dialogUi.get().map((e=>e.sink)),"UI has not been rendered");const v=()=>hs.fromOption(r.popupUi.get().map((e=>e.sink)),"(popup) UI has not been rendered");const k=r.lazyGetInOuterOrDie("anchor bar",p.getOpt);const w=r.lazyGetInOuterOrDie("bottom anchor bar",h.getOpt);const _=r.lazyGetInOuterOrDie("toolbar",uW.getToolbar);const x=r.lazyGetInOuterOrDie("throbber",uW.getThrobber);const C=Jj({popup:v,dialog:b},e,k,w);const S=()=>{const t={attributes:{[cg]:m?ag.BottomToTop:ag.TopToBottom}};const o=uW.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:C.popup,onEscape:()=>{e.focus()}});const n=uW.parts.toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:C.popup.shared.getSink,providers:C.popup.shared.providers,onEscape:()=>{e.focus()},onToolbarToggled:t=>{BA(e,t)},type:g,lazyToolbar:_,lazyHeader:()=>y().getOrDie("Could not find header element"),...t});const s=uW.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:C.popup.shared.providers,onEscape:()=>{e.focus()},type:g});const r=PC(e);const a=HC(e);const c=MC(e);const i=OC(e);const l=z();const d=r||a||c;const u=()=>{if(r){return[s]}else if(a){return[n]}else{return[]}};const f=i?[l,o]:[o];return uW.parts.header({dom:{tag:"div",classes:["tox-editor-header"].concat(d?[]:["tox-editor-header--empty"]),...t},components:J([c?f:[],u(),jC(e)?[]:[p.asSpec()]]),sticky:qC(e),editor:e,sharedBackstage:C.popup.shared})};const z=()=>uW.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}});const T=()=>{const e=uW.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}});const t=uW.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}});return{dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[e,t]}};const E=()=>{const t=ZC(e);const o=Ct(Jt(),t)&&go(t,"display")==="grid";const n={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(f),attributes:{...xz.isRtl()?{dir:"rtl"}:{}}},behaviours:wi([th.config({useFixed:()=>s.isDocked(y)})])};const r={dom:{styles:{width:document.body.clientWidth+"px"}},events:jc([Wc(xc(),(e=>{uo(e.element,"width",document.body.clientWidth+"px")}))])};const a=Fu(Bs(n,o?r:{}));const i=BM(a);c.set(i);return{sink:a,mothership:i}};const O=()=>{const e={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(f),attributes:{...xz.isRtl()?{dir:"rtl"}:{}}},behaviours:wi([th.config({useFixed:()=>s.isDocked(y),getBounds:()=>t.getPopupSinkBounds()})])};const o=Fu(e);const n=BM(o);i.set(n);return{sink:o,mothership:n}};const A=()=>{const t=S();const n=T();const s=uW.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:C.popup});const r=uW.parts.viewWrapper({backstage:C.popup});const c=xC(e)&&!o?N.some(cJ(e,C.popup.shared.providers)):N.none();const i=J([m?[]:[t],o?[]:[n],m?[t]:[]]);const l=uW.parts.editorContainer({components:J([i,o?[]:[h.asSpec()]])});const d=UC(e);const u={role:"application",...xz.isRtl()?{dir:"rtl"}:{},...d?{"aria-hidden":"true"}:{}};const g=Fu(uW.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(f),styles:{visibility:"hidden",...d?{opacity:"0",border:"0"}:{}},attributes:u},components:[l,...o?[]:[r,...c.toArray()],s],behaviours:wi([wO(),sv.config({disableClass:"tox-tinymce--disabled"}),Qw.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));const p=BM(g);a.set(p);return{mothership:p,outerContainer:g}};const D=t=>{const o=bG(wG(e));const n=bG(xG(e));if(!e.inline){if(bo("div","width",n)){uo(t.element,"width",n)}if(bo("div","height",o)){uo(t.element,"height",o)}else{uo(t.element,"height","400px")}}return o};const M=t=>{e.addShortcut("alt+F9","focus menubar",(()=>{uW.focusMenubar(t)}));e.addShortcut("alt+F10","focus toolbar",(()=>{uW.focusToolbar(t)}));e.addCommand("ToggleToolbarDrawer",((e,o)=>{if(o===null||o===void 0?void 0:o.skipFocus){uW.toggleToolbarDrawerWithoutFocusing(t)}else{uW.toggleToolbarDrawer(t)}}));e.addQueryStateHandler("ToggleToolbarDrawer",(()=>uW.isToolbarDrawerToggled(t)))};const R=t=>{const{mainUi:o,popupUi:r,uiMotherships:a}=t;ge(cC(e),((t,o)=>{e.ui.registry.addGroupToolbarButton(o,t)}));const{buttons:c,menuItems:i,contextToolbars:l,sidebars:d,views:u}=e.ui.registry.getAll();const f=IC(e);const m={menuItems:i,menus:$C(e),menubar:mC(e),toolbar:f.getOrThunk((()=>gC(e))),allowToolbarGroups:g===Zx.floating,buttons:c,sidebar:d,views:u};M(o.outerContainer);Qj(e,o.mothership,a);s.setup(e,C.popup.shared,y);$K(e,C.popup);AY(e,C.popup.shared.getSink,C.popup);oU(e);EU(e,x,C.popup.shared);kK(e,l,r.sink,{backstage:C.popup});GX(e,r.sink);const p=e.getElement();const h=D(o.outerContainer);const b={targetNode:p,height:h};return n.render(e,t,m,C.popup,b)};const B=e=>{i.set(e.mothership);return e};const L=()=>{const t=A();const o=E();const n=WC(e)?O():B(o);r.dialogUi.set(o);r.popupUi.set(n);r.mainUi.set(t);const s={popupUi:n,dialogUi:o,mainUi:t,uiMotherships:r.getUiMotherships()};return R(s)};return{popups:{backstage:C.popup,getMothership:()=>iJ("popups",i)},dialogs:{backstage:C.dialog,getMothership:()=>iJ("dialogs",c)},renderUI:L}};const dJ=e=>e.dom.textContent;const uJ=(e,t)=>{const o=so(e,"id").fold((()=>{const e=zd("dialog-label");to(t,"id",e);return e}),C);to(e,"aria-labelledby",o)};const fJ=x([jr("lazySink"),Qr("dragBlockClass"),ga("getBounds",as),ia("useTabstopAt",D),ia("firstTabstop",0),ia("eventOrder",{}),_y("modalBehaviours",[Qw]),fd("onExecute"),gd("onEscape")]);const mJ={sketch:C};const gJ=x([ob({name:"draghandle",overrides:(e,t)=>({behaviours:wi([jX.config({mode:"mouse",getTarget:e=>Yu(e,'[role="dialog"]').getOr(e),blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])})}),eb({schema:[jr("dom")],name:"title"}),eb({factory:mJ,schema:[jr("dom")],name:"close"}),eb({factory:mJ,schema:[jr("dom")],name:"body"}),ob({factory:mJ,schema:[jr("dom")],name:"footer"}),tb({factory:{sketch:(e,t)=>({...e,dom:t.dom,components:t.components})},schema:[ia("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),ia("components",[])],name:"blocker"})]);const pJ=(e,t,o,n)=>{const s=us();const r=t=>{s.set(t);const o=e.lazySink(t).getOrDie();const r=n.blocker();const a=o.getSystem().build({...r,components:r.components.concat([Vu(t)]),behaviours:wi([C_.config({}),p_("dialog-blocker-events",[ti(Ya(),(()=>{kU.isBlocked(t)?v():Qw.focusIn(t)}))])])});uh(o,a);Qw.focusIn(t)};const a=e=>{s.clear();At(e.element).each((t=>{e.getSystem().getByDom(t).each((e=>{gh(e)}))}))};const c=t=>hb(t,e,"body");const i=t=>pb(t,e,"footer");const l=(e,t)=>{kU.block(e,t)};const d=e=>{kU.unblock(e)};const u=zd("modal-events");const f={...e.eventOrder,[Cc()]:[u].concat(e.eventOrder["alloy.system.attached"]||[])};const m=Sn();return{uid:e.uid,dom:e.dom,components:t,apis:{show:r,hide:a,getBody:c,getFooter:i,setIdle:d,setBusy:l},eventOrder:f,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Cy(e.modalBehaviours,[m_.config({}),Qw.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt,firstTabstop:e.firstTabstop}),kU.config({getRoot:s.get}),p_(u,[oi((t=>{const o=hb(t,e,"title").element;const n=dJ(o);if(m.os.isMacOS()&&p(n)){to(t.element,"aria-label",n)}else{uJ(t.element,o)}}))])])}};const hJ=Rb({name:"ModalDialog",configFields:fJ(),partFields:gJ(),factory:pJ,apis:{show:(e,t)=>{e.show(t)},hide:(e,t)=>{e.hide(t)},getBody:(e,t)=>e.getBody(t),getFooter:(e,t)=>e.getFooter(t),setBusy:(e,t,o)=>{e.setBusy(t,o)},setIdle:(e,t)=>{e.setIdle(t)}}});const yJ=mr([$T,GT].concat(YE));const bJ=xr;const vJ=[wE("button"),iE,fa("align","end",["start","end"]),hE,pE,na("buttonType",["primary","secondary"])];const kJ=[...vJ,YT];const wJ=[Wr("type",["submit","cancel","custom"]),...kJ];const _J=[Wr("type",["menu"]),aE,lE,iE,Jr("items",yJ),...vJ];const xJ=[...vJ,Wr("type",["togglebutton"]),lE,iE,aE,ma("active",false)];const CJ=Hr("type",{submit:wJ,cancel:wJ,custom:wJ,menu:_J,togglebutton:xJ});const SJ=[$T,YT,Wr("level",["info","warn","error","success"]),JT,ia("url","")];const zJ=mr(SJ);const TJ=e=>[$T,e];const EJ=[$T,YT,pE,wE("button"),iE,gE,na("buttonType",["primary","secondary","toolbar"]),hE];const OJ=mr(EJ);const AJ=[$T,GT];const DJ=AJ.concat([dE]);const NJ=AJ.concat([KT,pE]);const MJ=mr(NJ);const RJ=xr;const BJ=DJ.concat([yE("auto")]);const LJ=mr(BJ);const HJ=br([QT,YT,JT]);const IJ=DJ.concat([ua("storageKey","default")]);const PJ=mr(IJ);const FJ=_r;const VJ=DJ;const jJ=mr(VJ);const ZJ=_r;const UJ=AJ.concat([ua("tag","textarea"),qr("scriptId"),qr("scriptUrl"),sa("onFocus"),pa("settings",undefined)]);const qJ=AJ.concat([ua("tag","textarea"),Gr("init")]);const WJ=Ar((e=>Mr("customeditor.old",fr(qJ),e).orThunk((()=>Mr("customeditor.new",fr(UJ),e)))));const $J=_r;const GJ=DJ;const KJ=mr(GJ);const YJ=Or();const XJ=e=>[$T,Ur("columns"),e];const JJ=[$T,qr("html"),fa("presets","presentation",["presentation","document"]),ga("onInit",v),ma("stretched",false)];const QJ=mr(JJ);const eQ=DJ.concat([ma("border",false),ma("sandboxed",true),ma("streamContent",false),ma("transparent",true)]);const tQ=mr(eQ);const oQ=_r;const nQ=mr(AJ.concat([oa("height")]));const sQ=mr([qr("url"),ta("zoom"),ta("cachedWidth"),ta("cachedHeight")]);const rQ=DJ.concat([oa("inputMode"),oa("placeholder"),ma("maximized",false),pE]);const aQ=mr(rQ);const cQ=_r;const iQ=e=>[$T,KT,e,fa("align","start",["start","center","end"]),oa("for")];const lQ=[YT,QT];const dQ=[YT,Jr("items",Ir("items",(()=>uQ)))];const uQ=pr([mr(lQ),mr(dQ)]);const fQ=DJ.concat([Jr("items",uQ),pE]);const mQ=mr(fQ);const gQ=_r;const pQ=DJ.concat([Xr("items",[YT,QT]),da("size",1),pE]);const hQ=mr(pQ);const yQ=_r;const bQ=DJ.concat([ma("constrain",true),pE]);const vQ=mr(bQ);const kQ=mr([qr("width"),qr("height")]);const wQ=AJ.concat([KT,da("min",0),da("max",0)]);const _Q=mr(wQ);const xQ=wr;const CQ=[$T,Jr("header",_r),Jr("cells",gr(_r))];const SQ=mr(CQ);const zQ=DJ.concat([oa("placeholder"),ma("maximized",false),pE]);const TQ=mr(zQ);const EQ=_r;const OQ=[Wr("type",["directory","leaf"]),XT,qr("id"),ea("menu",IZ)];const AQ=OQ;const DQ=mr(AQ);const NQ=OQ.concat([Jr("children",Ir("children",(()=>Er("type",{directory:MQ,leaf:DQ}))))]);const MQ=mr(NQ);const RQ=Er("type",{directory:MQ,leaf:DQ});const BQ=[$T,Jr("items",RQ),sa("onLeafAction"),sa("onToggleExpand"),ha("defaultExpandedIds",[],_r),oa("defaultSelectedId")];const LQ=mr(BQ);const HQ=DJ.concat([fa("filetype","file",["image","media","file"]),pE,oa("picker_text")]);const IQ=mr(HQ);const PQ=mr([QT,bE]);const FQ=e=>Pr("items","items",Hs(),gr(Ar((t=>Mr(`Checking item of ${e}`,VQ,t).fold((e=>hs.error(Lr(e))),(e=>hs.value(e)))))));const VQ=dr((()=>Er("type",{alertbanner:zJ,bar:mr(TJ(FQ("bar"))),button:OJ,checkbox:MJ,colorinput:PJ,colorpicker:jJ,dropzone:KJ,grid:mr(XJ(FQ("grid"))),iframe:tQ,input:aQ,listbox:mQ,selectbox:hQ,sizeinput:vQ,slider:_Q,textarea:TQ,urlinput:IQ,customeditor:WJ,htmlpanel:QJ,imagepreview:nQ,collection:LJ,label:mr(iQ(FQ("label"))),table:SQ,tree:LQ,panel:ZQ})));const jQ=[$T,ia("classes",[]),Jr("items",VQ)];const ZQ=mr(jQ);const UQ=[wE("tab"),XT,Jr("items",VQ)];const qQ=[$T,Xr("tabs",UQ)];const WQ=mr(qQ);const $Q=kJ;const GQ=CJ;const KQ=mr([qr("title"),Zr("body",Er("type",{panel:ZQ,tabpanel:WQ})),ua("size","normal"),ha("buttons",[],GQ),ia("initialData",{}),ga("onAction",v),ga("onChange",v),ga("onSubmit",v),ga("onClose",v),ga("onCancel",v),ga("onTabChange",v)]);const YQ=e=>Mr("dialog",KQ,e);const XQ=mr([Wr("type",["cancel","custom"]),...$Q]);const JQ=mr([qr("title"),qr("url"),ta("height"),ta("width"),ra("buttons",XQ),ga("onAction",v),ga("onCancel",v),ga("onClose",v),ga("onMessage",v)]);const QQ=e=>Mr("dialog",JQ,e);const e1=e=>{if(i(e)){return[e].concat(Q(_e(e),e1))}else if(d(e)){return Q(e,e1)}else{return[]}};const t1=e=>c(e.type)&&c(e.name);const o1={checkbox:RJ,colorinput:FJ,colorpicker:ZJ,dropzone:YJ,input:cQ,iframe:oQ,imagepreview:sQ,selectbox:yQ,sizeinput:kQ,slider:xQ,listbox:gQ,size:kQ,textarea:EQ,urlinput:PQ,customeditor:$J,collection:HJ,togglemenuitem:bJ};const n1=e=>N.from(o1[e.type]);const s1=e=>W(e1(e),t1);const r1=e=>{const t=s1(e);const o=Q(t,(e=>n1(e).fold((()=>[]),(t=>[Zr(e.name,t)]))));return mr(o)};const a1=e=>{var t;const o=Rr(YQ(e));const n=r1(e);const s=(t=e.initialData)!==null&&t!==void 0?t:{};return{internalDialog:o,dataValidator:n,initialData:s}};const c1={open:(e,t)=>{const o=a1(t);return e(o.internalDialog,o.initialData,o.dataValidator)},openUrl:(e,t)=>{const o=Rr(QQ(t));return e(o)},redial:e=>a1(e)};const i1=(e,t)=>{const o=(o,n)=>{e.updateState.each((e=>{const s=e(o,n);t.set(s)}));e.renderComponents.each((s=>{const r=s(n,t.get());const a=e.reuseDom?t_:e_;a(o,r)}))};return jc([Wc(fc(),((t,n)=>{const s=n;if(!s.universal){const n=e.channel;if(I(s.channels,n)){o(t,s.data)}}})),oi(((t,n)=>{e.initialData.each((e=>{o(t,e)}))}))])};var l1=Object.freeze({__proto__:null,events:i1});const d1=(e,t,o)=>o;var u1=Object.freeze({__proto__:null,getState:d1});var f1=[jr("channel"),Qr("renderComponents"),Qr("updateState"),Qr("initialData"),ma("reuseDom",true)];const m1=()=>{const e=cs(N.none());const t=()=>e.set(N.none());const o=()=>e.get().getOr("none");return{readState:o,get:e.get,set:e.set,clear:t}};var g1=Object.freeze({__proto__:null,init:m1});const p1=xi({fields:f1,name:"reflecting",active:l1,apis:u1,state:g1});const h1=e=>{const t=[];const o={};me(e,((e,n)=>{e.fold((()=>{t.push(n)}),(e=>{o[n]=e}))}));return t.length>0?hs.error(t):hs.value(o)};const y1=(e,t,o,n)=>{const s=aS(iH.sketch((s=>({dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:j(e.items,(e=>uV(s,e,t,o,n)))}))));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[s.asSpec()]}],behaviours:wi([Qw.config({mode:"acyclic",useTabstopAt:T(qH)}),vH.memento(s),wH(s,{postprocess:e=>h1(e).fold((e=>{console.error(e);return{}}),C)}),p_("dialog-body-panel",[Wc(Ya(),((e,t)=>{e.getSystem().broadcastOn([XH],{newFocus:N.some(t.event.target)})}))])])}};const b1=(e,t)=>({uid:e.uid,dom:e.dom,components:e.components,events:q_(e.action),behaviours:Cy(e.tabButtonBehaviours,[C_.config({}),Qw.config({mode:"execution",useSpace:true,useEnter:true}),wy.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification});const v1=Mb({name:"TabButton",configFields:[ia("uid",undefined),jr("value"),Pr("dom","dom",Vs((()=>({attributes:{role:"tab",id:zd("aria"),"aria-selected":"false"}}))),vr()),Qr("action"),ia("domModification",{}),_y("tabButtonBehaviours",[C_,Qw,wy]),jr("view")],factory:b1});const k1=x([jr("tabs"),jr("dom"),ia("clickToDismiss",false),_y("tabbarBehaviours",[Cv,Qw]),ld(["tabClass","selectedClass"])]);const w1=nb({factory:v1,name:"tabs",unit:"tab",overrides:e=>{const t=(e,t)=>{Cv.dehighlight(e,t);Lc(e,Nc(),{tabbar:e,button:t})};const o=(e,t)=>{Cv.highlight(e,t);Lc(e,Dc(),{tabbar:e,button:t})};return{action:n=>{const s=n.getSystem().getByUid(e.uid).getOrDie();const r=Cv.isHighlighted(s,n);const a=(()=>{if(r&&e.clickToDismiss){return t}else if(!r){return o}else{return v}})();a(s,n)},domModification:{classes:[e.markers.tabClass]}}}});const _1=x([w1]);const x1=(e,t,o,n)=>({uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Cy(e.tabbarBehaviours,[Cv.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:(e,t)=>{to(t.element,"aria-selected","true")},onDehighlight:(e,t)=>{to(t.element,"aria-selected","false")}}),Qw.config({mode:"flow",getInitial:e=>Cv.getHighlighted(e).map((e=>e.element)),selector:"."+e.markers.tabClass,executeOnMove:true})])});const C1=Rb({name:"Tabbar",configFields:k1(),partFields:_1(),factory:x1});const S1=(e,t)=>({uid:e.uid,dom:e.dom,behaviours:Cy(e.tabviewBehaviours,[m_.config({})]),domModification:{attributes:{role:"tabpanel"}}});const z1=Mb({name:"Tabview",configFields:[_y("tabviewBehaviours",[m_])],factory:S1});const T1=x([ia("selectFirst",true),ud("onChangeTab"),ud("onDismissTab"),ia("tabs",[]),_y("tabSectionBehaviours",[])]);const E1=eb({factory:C1,schema:[jr("dom"),Yr("markers",[jr("tabClass"),jr("selectedClass")])],name:"tabbar",defaults:e=>({tabs:e.tabs})});const O1=eb({factory:z1,name:"tabview"});const A1=x([E1,O1]);const D1=(e,t,o,n)=>{const s=t=>{const o=wy.getValue(t);pb(t,e,"tabview").each((n=>{const s=Y(e.tabs,(e=>e.value===o));s.each((o=>{const s=o.view();so(t.element,"id").each((e=>{to(n.element,"aria-labelledby",e)}));m_.set(n,s);e.onChangeTab(n,t,s)}))}))};const r=(t,o)=>{pb(t,e,"tabbar").each((e=>{o(e).each(Hc)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:xy(e.tabSectionBehaviours),events:jc(J([e.selectFirst?[oi(((e,t)=>{r(e,Cv.getFirst)}))]:[],[Wc(Dc(),((e,t)=>{const o=t.event.button;s(o)})),Wc(Nc(),((t,o)=>{const n=o.event.button;e.onDismissTab(t,n)}))]])),apis:{getViewItems:t=>pb(t,e,"tabview").map((e=>m_.contents(e))).getOr([]),showTab:(e,t)=>{const o=e=>{const o=Cv.getCandidates(e);const n=Y(o,(e=>wy.getValue(e)===t));return n.filter((t=>!Cv.isHighlighted(e,t)))};r(e,o)}}}};const N1=Rb({name:"TabSection",configFields:T1(),partFields:A1(),factory:D1,apis:{getViewItems:(e,t)=>e.getViewItems(t),showTab:(e,t,o)=>{e.showTab(t,o)}}});const M1=(e,t,o)=>j(e,((n,s)=>{m_.set(o,e[s].view());const r=t.dom.getBoundingClientRect();m_.set(o,[]);return r.height}));const R1=e=>ce(re(e,((e,t)=>{if(e>t){return-1}else if(e<t){return+1}else{return 0}})));const B1=(e,t,o)=>{const n=Et(e).dom;const s=Yu(e,".tox-dialog-wrap").getOr(e);const r=go(s,"position")==="fixed";let a;if(r){a=Math.max(n.clientHeight,window.innerHeight)}else{a=Math.max(n.offsetHeight,n.scrollHeight)}const c=xo(t);const i=t.dom.offsetLeft>=o.dom.offsetLeft+Ro(o);const l=i?Math.max(xo(o),c):c;const d=parseInt(go(e,"margin-top"),10)||0;const u=parseInt(go(e,"margin-bottom"),10)||0;const f=xo(e)+d+u;const m=f-l;return a-m};const L1=(e,t)=>{ce(e).each((e=>N1.showTab(t,e.value)))};const H1=(e,t)=>{uo(e,"height",t+"px");uo(e,"flex-basis",t+"px")};const I1=(e,t,o)=>{Yu(e,'[role="dialog"]').each((e=>{Qu(e,'[role="tablist"]').each((n=>{o.get().map((o=>{uo(t,"height","0");uo(t,"flex-basis","0");return Math.min(o,B1(e,t,n))})).each((e=>{H1(t,e)}))}))}))};const P1=e=>Qu(e,'[role="tabpanel"]');const F1=e=>{const t=us();const o=[oi((o=>{const n=o.element;P1(n).each((s=>{uo(s,"visibility","hidden");o.getSystem().getByDom(s).toOptional().each((o=>{const n=M1(e,s,o);const r=R1(n);r.fold(t.clear,t.set)}));I1(n,s,t);vo(s,"visibility");L1(e,o);requestAnimationFrame((()=>{I1(n,s,t)}))}))})),Wc(xc(),(e=>{const o=e.element;P1(o).each((e=>{I1(o,e,t)}))})),Wc(oR,((e,o)=>{const n=e.element;P1(n).each((e=>{const o=sm(Ut(e));uo(e,"visibility","hidden");const s=ho(e,"height").map((e=>parseInt(e,10)));vo(e,"height");vo(e,"flex-basis");const r=e.dom.getBoundingClientRect().height;const a=s.forall((e=>r>e));if(a){t.set(r);I1(n,e,t)}else{s.each((t=>{H1(e,t)}))}vo(e,"visibility");o.each(tm)}))}))];const n=false;return{extraEvents:o,selectFirst:n}};const V1="send-data-to-section";const j1="send-data-to-view";const Z1=(e,t,o,n)=>{const s=cs({});const r=e=>{const t=wy.getValue(e);const o=h1(t).getOr({});const n=s.get();const r=Bs(n,o);s.set(r)};const a=e=>{const t=s.get();wy.setValue(e,t)};const c=cs(null);const i=j(e.tabs,(e=>({value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Bu(o.shared.providers.translate(e.title))],view:()=>[iH.sketch((s=>({dom:{tag:"div",classes:["tox-form"]},components:j(e.items,(e=>uV(s,e,t,o,n))),formBehaviours:wi([Qw.config({mode:"acyclic",useTabstopAt:T(qH)}),p_("TabView.form.events",[oi(a),ni(r)]),Jf.config({channels:za([{key:V1,value:{onReceive:r}},{key:j1,value:{onReceive:a}}])})])})))]})));const l=F1(i);return N1.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:(e,t,o)=>{const n=wy.getValue(t);Lc(e,tR,{name:n,oldName:c.get()});c.set(n)},tabs:i,components:[N1.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[C1.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:wi([dS.config({})])}),N1.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:wi([p_("tabpanel",l.extraEvents),Qw.config({mode:"acyclic"}),Pb.config({find:e=>ce(N1.getViewItems(e))}),_H(N.none(),(e=>{e.getSystem().broadcastOn([V1],{});return s.get()}),((e,t)=>{s.set(t);e.getSystem().broadcastOn([j1],{})}))])})};const U1=(e,t,o,n,s,r)=>{const a=e=>{const t=e.body;switch(t.type){case"tabpanel":{return[Z1(t,e.initialData,n,r)]}default:{return[y1(t,e.initialData,n,r)]}}};const c=(e,t)=>N.some({isTabPanel:()=>t.body.type==="tabpanel"});const i={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:{...o.map((e=>({id:e}))).getOr({}),...s?i:{}}},components:[],behaviours:wi([vH.childAt(0),p1.config({channel:`${GH}-${t}`,updateState:c,renderComponents:a,initialData:e})])}};const q1=(e,t,o,n,s,r)=>U1(e,t,N.some(o),n,s,r);const W1=(e,t,o,n)=>{const s=U1(e,t,N.none(),o,false,n);return hJ.parts.body(s)};const $1=e=>{const t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[jH(N.none(),{dom:{tag:"iframe",attributes:{src:e.url}},behaviours:wi([dS.config({}),C_.config({})])})]}],behaviours:wi([Qw.config({mode:"acyclic",useTabstopAt:T(qH)})])};return hJ.parts.body(t)};const G1=jx.deviceType.isTouch();const K1=(e,t)=>({dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]});const Y1=(e,t)=>hJ.parts.close(oS.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:wi([dS.config({})])}));const X1=()=>hJ.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}});const J1=(e,t)=>hJ.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:rS(`<p>${_z(t.translate(e))}</p>`)}]}]});const Q1=e=>hJ.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e});const e0=(e,t)=>[RM.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),RM.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})];const t0=e=>{const t="tox-dialog";const o=t+"-wrap";const n=o+"__backdrop";const s=t+"__disable-scroll";return hJ.sketch({lazySink:e.lazySink,onEscape:t=>{e.onEscape(t);return N.some(true)},useTabstopAt:e=>!qH(e),firstTabstop:e.firstTabstop,dom:{tag:"div",classes:[t].concat(e.extraClasses),styles:{position:"relative",...e.extraStyles}},components:[e.header,e.body,...e.footer.toArray()],parts:{blocker:{dom:rS(`<div class="${o}"></div>`),components:[{dom:{tag:"div",classes:G1?[n,n+"--opaque"]:[n]}}]}},dragBlockClass:o,modalBehaviours:wi([C_.config({}),p_("dialog-events",e.dialogEvents.concat([ti(Ya(),((e,t)=>{kU.isBlocked(e)?v():Qw.focusIn(e)})),Wc(Ec(),((e,t)=>{e.getSystem().broadcastOn([XH],{newFocus:t.event.newFocus})}))])),p_("scroll-lock",[oi((()=>{Bi(Jt(),s)})),ni((()=>{Hi(Jt(),s)}))]),...e.extraBehaviours]),eventOrder:{[mc()]:["dialog-events"],[Cc()]:["scroll-lock","dialog-events","alloy.base.behaviour"],[Sc()]:["alloy.base.behaviour","dialog-events","scroll-lock"],...e.eventOrder}})};const o0=e=>oS.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:wi([dS.config({}),CS.config(e.tooltips.getConfig({tooltipText:e.translate("Close")}))]),components:[Rz("close",{tag:"span",classes:["tox-icon"]},e.icons)],action:e=>{Bc(e,YM)}});const n0=(e,t,o,n)=>{const s=e=>[Bu(n.translate(e.title))];return{dom:{tag:"h1",classes:["tox-dialog__title"],attributes:{...o.map((e=>({id:e}))).getOr({})}},components:[],behaviours:wi([p1.config({channel:`${$H}-${t}`,initialData:e,renderComponents:s})])}};const s0=()=>({dom:rS('<div class="tox-dialog__draghandle"></div>')});const r0=(e,t,o,n)=>RM.sketch({dom:rS('<div class="tox-dialog__header"></div>'),components:[n0(e,t,N.some(o),n),s0(),o0(n)],containerBehaviours:wi([jX.config({mode:"mouse",blockerClass:"blocker",getTarget:e=>ef(e,'[role="dialog"]').getOrDie(),snaps:{getSnapPoints:()=>[],leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])});const a0=(e,t,o)=>{const n=hJ.parts.title(n0(e,t,N.none(),o));const s=hJ.parts.draghandle(s0());const r=hJ.parts.close(o0(o));const a=[n].concat(e.draggable?[s]:[]).concat([r]);return RM.sketch({dom:rS('<div class="tox-dialog__header"></div>'),components:a})};const c0=(e,t,o)=>a0({title:o.shared.providers.translate(e),draggable:o.dialog.isDraggableModal()},t,o.shared.providers);const i0=(e,t,o,n)=>({dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":o.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:`${n.getOr(0)}px`,position:"absolute"}},behaviours:t,components:[{dom:rS('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]});const l0=(e,t,o)=>({onClose:()=>o.closeWindow(),onBlock:o=>{const n=Qu(e().element,".tox-dialog__header").map((e=>xo(e)));hJ.setBusy(e(),((e,s)=>i0(o.message,s,t,n)))},onUnblock:()=>{hJ.setIdle(e())}});const d0="tox-dialog--fullscreen";const u0="tox-dialog--width-lg";const f0="tox-dialog--width-md";const m0=e=>{switch(e){case"large":return N.some(u0);case"medium":return N.some(f0);default:return N.none()}};const g0=(e,t)=>{const o=Je.fromDom(t.element.dom);if(!Pi(o,d0)){Vi(o,[u0,f0]);m0(e).each((e=>Bi(o,e)))}};const p0=(e,t)=>{const o=Je.fromDom(e.element.dom);const n=qi(o);const s=Y(n,(e=>e===u0||e===f0)).or(m0(t));ji(o,[d0,...s.toArray()])};const h0=(e,t,o)=>Fu(t0({...e,firstTabstop:1,lazySink:o.shared.getSink,extraBehaviours:[SH({}),...e.extraBehaviours],onEscape:e=>{Bc(e,YM)},dialogEvents:t,eventOrder:{[fc()]:[p1.name(),Jf.name()],[Cc()]:["scroll-lock",p1.name(),"messages","dialog-events","alloy.base.behaviour"],[Sc()]:["alloy.base.behaviour","dialog-events","messages",p1.name(),"scroll-lock"]}}));const y0=(e,t={})=>{const o=e=>{const o=j(e.items,(e=>{const o=xe(t,e.name).getOr(cs(false));return{...e,storage:o}}));return{...e,items:o}};return j(e,(e=>e.type==="menu"?o(e):e))};const b0=e=>G(e,((e,t)=>{if(t.type==="menu"){const o=t;return G(o.items,((e,t)=>{e[t.name]=t.storage;return e}),e)}return e}),{});const v0=(e,t)=>[Jc(Ya(),UH),e(KM,((e,o,n,s)=>{sm(Ut(s.element)).fold(v,om);t.onClose();o.onClose()})),e(YM,((e,t,o,n)=>{t.onCancel(e);Bc(n,KM)})),Wc(eR,((e,o)=>t.onUnblock())),Wc(QM,((e,o)=>t.onBlock(o.event)))];const k0=(e,t)=>{const o=(t,o)=>Wc(t,((t,s)=>{n(t,((n,r)=>{o(e(),n,s.event,t)}))}));const n=(e,t)=>{p1.getState(e).get().each((o=>{t(o,e)}))};return[...v0(o,t),o(XM,((e,t,o)=>{t.onAction(e,{name:o.name})}))]};const w0=(e,t,o)=>{const n=(t,o)=>Wc(t,((t,n)=>{s(t,((s,r)=>{o(e(),s,n.event,t)}))}));const s=(e,t)=>{p1.getState(e).get().each((o=>{t(o.internalDialog,e)}))};return[...v0(n,t),n(JM,((e,t)=>t.onSubmit(e))),n(GM,((e,t,o)=>{t.onChange(e,{name:o.name})})),n(XM,((e,t,n,s)=>{const r=()=>s.getSystem().isConnected()?Qw.focusIn(s):undefined;const a=e=>ro(e,"disabled")||so(e,"aria-disabled").exists((e=>e==="true"));const c=Ut(s.element);const i=sm(c);t.onAction(e,{name:n.name,value:n.value});sm(c).fold(r,(e=>{if(a(e)){r()}else if(i.exists((t=>St(e,t)&&a(t)))){r()}else{o().toOptional().filter((t=>!St(t.element,e))).each(r)}}))})),n(tR,((e,t,o)=>{t.onTabChange(e,{newTabName:o.name,oldTabName:o.oldName})})),ni((t=>{const o=e();wy.setValue(t,o.getData())}))]};const _0=(e,t)=>IF(e,e.type,t);const x0=(e,t,o)=>Y(t,(e=>e.name===o)).bind((t=>t.memento.getOpt(e)));const C0=(e,t)=>{const o=t.map((e=>e.footerButtons)).getOr([]);const n=q(o,(e=>e.align==="start"));const s=(e,t)=>RM.sketch({dom:{tag:"div",classes:[`tox-dialog__footer-${e}`]},components:j(t,(e=>e.memento.asSpec()))});const r=s("start",n.pass);const a=s("end",n.fail);return[r,a]};const S0=(e,t,o)=>{const n=(e,t)=>{const n=j(t.buttons,(e=>{const t=aS(_0(e,o));return{name:e.name,align:e.align,memento:t}}));const s=t=>x0(e,n,t);return N.some({lookupByName:s,footerButtons:n})};return{dom:rS('<div class="tox-dialog__footer"></div>'),components:[],behaviours:wi([p1.config({channel:`${KH}-${t}`,initialData:e,updateState:n,renderComponents:C0})])}};const z0=(e,t,o)=>S0(e,t,o);const T0=(e,t,o)=>hJ.parts.footer(S0(e,t,o));const E0=(e,t)=>{const o=e.getRoot();if(o.getSystem().isConnected()){const o=Pb.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return iH.getField(o,t).orThunk((()=>{const o=e.getFooter();const n=o.bind((e=>p1.getState(e).get()));return n.bind((e=>e.lookupByName(t)))}))}else{return N.none()}};const O0=(e,t)=>{const o=e.getRoot();return p1.getState(o).get().map((e=>Rr(Mr("data",e.dataValidator,t)))).getOr(t)};const A0=(e,t,o)=>{const n=t=>{const o=e.getRoot();if(o.getSystem().isConnected()){t(o)}};const s=()=>{const t=e.getRoot();const n=t.getSystem().isConnected()?e.getFormWrapper():t;const s=wy.getValue(n);const r=ge(o,(e=>e.get()));return{...s,...r}};const r=t=>{n((n=>{const s=g.getData();const r=Bs(s,t);const a=O0(e,r);const c=e.getFormWrapper();wy.setValue(c,a);me(o,((e,t)=>{if(Ce(r,t)){e.set(r[t])}}))}))};const a=(t,o)=>{E0(e,t).each(o?sv.enable:sv.disable)};const i=t=>{E0(e,t).each(C_.focus)};const l=e=>{if(!c(e)){throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument")}n((t=>{Lc(t,QM,{message:e})}))};const d=()=>{n((e=>{Bc(e,eR)}))};const u=t=>{n((o=>{const n=e.getBody();const s=p1.getState(n);if(s.get().exists((e=>e.isTabPanel()))){Pb.getCurrent(n).each((e=>{N1.showTab(e,t)}))}}))};const f=s=>{n((n=>{const r=e.getId();const a=t(s);const c=y0(a.internalDialog.buttons,o);n.getSystem().broadcastOn([`${WH}-${r}`],a);n.getSystem().broadcastOn([`${$H}-${r}`],a.internalDialog);n.getSystem().broadcastOn([`${GH}-${r}`],a.internalDialog);n.getSystem().broadcastOn([`${KH}-${r}`],{...a.internalDialog,buttons:c});g.setData(a.initialData)}))};const m=()=>{n((e=>{Bc(e,KM)}))};const g={getData:s,setData:r,setEnabled:a,focus:i,block:l,unblock:d,showTab:u,redial:f,close:m,toggleFullscreen:e.toggleFullscreen};return g};const D0=(e,t,o)=>{const n=zd("dialog");const s=e.internalDialog;const r=c0(s.title,n,o);const a=cs(s.size);const c=e=>E0(y,e);const i=m0(a.get()).toArray();const l=(e,t)=>{a.set(t.internalDialog.size);g0(t.internalDialog.size,e);return N.some(t)};const d=W1({body:s.body,initialData:s.initialData},n,o,c);const u=y0(s.buttons);const f=b0(u);const m=Me(u.length!==0,T0({buttons:u},n,o));const g=w0((()=>b),l0((()=>h),o.shared.providers,t),o.shared.getSink);const p={id:n,header:r,body:d,footer:m,extraClasses:i,extraBehaviours:[p1.config({channel:`${WH}-${n}`,updateState:l,initialData:e})],extraStyles:{}};const h=h0(p,g,o);const y=(()=>{const e=()=>{const e=hJ.getBody(h);return Pb.getCurrent(e).getOr(e)};const t=()=>{p0(h,a.get())};return{getId:x(n),getRoot:x(h),getBody:()=>hJ.getBody(h),getFooter:()=>hJ.getFooter(h),getFormWrapper:e,toggleFullscreen:t}})();const b=A0(y,t.redial,f);return{dialog:h,instanceApi:b}};const N0=(e,t,o,n=false,s)=>{const r=zd("dialog");const a=zd("dialog-label");const c=zd("dialog-content");const i=e.internalDialog;const l=e=>E0(C,e);const d=cs(i.size);const u=m0(d.get()).toArray();const f=(e,t)=>{d.set(t.internalDialog.size);g0(t.internalDialog.size,e);s();return N.some(t)};const m=aS(r0({title:i.title,draggable:true},r,a,o.shared.providers));const g=aS(q1({body:i.body,initialData:i.initialData},r,c,o,n,l));const p=y0(i.buttons);const h=b0(p);const y=Me(p.length!==0,aS(z0({buttons:p},r,o)));const b=w0((()=>S),{onBlock:e=>{kU.block(w,((t,n)=>{const s=m.getOpt(w).map((e=>xo(e.element)));return i0(e.message,n,o.shared.providers,s)}))},onUnblock:()=>{kU.unblock(w)},onClose:()=>t.closeWindow()},o.shared.getSink);const v="tox-dialog-inline";const k=Sn().os;const w=Fu({dom:{tag:"div",classes:["tox-dialog",v,...u],attributes:{role:"dialog",...k.isMacOS()?{"aria-label":i.title}:{"aria-labelledby":a}}},eventOrder:{[fc()]:[p1.name(),Jf.name()],[mc()]:["execute-on-form"],[Cc()]:["reflecting","execute-on-form"]},behaviours:wi([Qw.config({mode:"cyclic",onEscape:e=>{Bc(e,KM);return N.some(true)},useTabstopAt:e=>!qH(e)&&(ut(e)!=="button"||no(e,"disabled")!=="disabled"),firstTabstop:1}),p1.config({channel:`${WH}-${r}`,updateState:f,initialData:e}),C_.config({}),p_("execute-on-form",b.concat([ti(Ya(),((e,t)=>{Qw.focusIn(e)})),Wc(Ec(),((e,t)=>{e.getSystem().broadcastOn([XH],{newFocus:t.event.newFocus})}))])),kU.config({getRoot:()=>N.some(w)}),m_.config({}),SH({})]),components:[m.asSpec(),g.asSpec(),...y.map((e=>e.asSpec())).toArray()]});const _=()=>{p0(w,d.get())};const C={getId:x(r),getRoot:x(w),getFooter:()=>y.map((e=>e.get(w))),getBody:()=>g.get(w),getFormWrapper:()=>{const e=g.get(w);return Pb.getCurrent(e).getOr(e)},toggleFullscreen:_};const S=A0(C,t.redial,h);return{dialog:w,instanceApi:S}};var M0=tinymce.util.Tools.resolve("tinymce.util.URI");const R0=e=>{const t=t=>{if(e.getSystem().isConnected()){t(e)}};const o=e=>{if(!c(e)){throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument")}t((t=>{Lc(t,QM,{message:e})}))};const n=()=>{t((e=>{Bc(e,eR)}))};const s=()=>{t((e=>{Bc(e,KM)}))};const r=e=>{t((t=>{t.getSystem().broadcastOn([YH],e)}))};return{block:o,unblock:n,close:s,sendMessage:r}};const B0=["insertContent","setContent","execCommand","close","block","unblock"];const L0=e=>i(e)&&B0.indexOf(e.mceAction)!==-1;const H0=e=>!L0(e)&&i(e)&&Ce(e,"mceAction");const I0=(e,t,o)=>{switch(o.mceAction){case"insertContent":e.insertContent(o.content);break;case"setContent":e.setContent(o.content);break;case"execCommand":const n=f(o.ui)?o.ui:false;e.execCommand(o.cmd,n,o.value);break;case"close":t.close();break;case"block":t.block(o.message);break;case"unblock":t.unblock();break}};const P0=(e,t,o,n)=>{const s=zd("dialog");const r=c0(e.title,s,n);const a=$1(e);const c=e.buttons.bind((e=>{if(e.length===0){return N.none()}else{return N.some(T0({buttons:e},s,n))}}));const i=k0((()=>v),l0((()=>b),n.shared.providers,t));const l={...e.height.fold((()=>({})),(e=>({height:e+"px","max-height":e+"px"}))),...e.width.fold((()=>({})),(e=>({width:e+"px","max-width":e+"px"})))};const d=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[];const u=new M0(e.url,{base_uri:new M0(window.location.href)});const f=`${u.protocol}://${u.host}${u.port?":"+u.port:""}`;const m=ds();const g=(e,t)=>N.some(t);const h=[p1.config({channel:`${WH}-${s}`,updateState:g,initialData:e}),p_("messages",[oi((()=>{const t=Om(Je.fromDom(window),"message",(t=>{if(u.isSameOrigin(new M0(t.raw.origin))){const n=t.raw.data;if(L0(n)){I0(o,v,n)}else if(H0(n)){e.onMessage(v,n)}}}));m.set(t)})),ni(m.clear)]),Jf.config({channels:{[YH]:{onReceive:(e,t)=>{Qu(e.element,"iframe").each((e=>{const o=e.dom.contentWindow;if(p(o)){o.postMessage(t,f)}}))}}}})];const y={id:s,header:r,body:a,footer:c,extraClasses:d,extraBehaviours:h,extraStyles:l};const b=h0(y,i,n);const v=R0(b);return{dialog:b,instanceApi:v}};const F0=e=>{const t=e.shared;const o=(o,n)=>{const s=()=>{hJ.hide(i);n()};const r=aS(IF({name:"close-alert",text:"OK",primary:true,buttonType:N.some("primary"),align:"end",enabled:true,icon:N.none()},"cancel",e));const a=X1();const c=Y1(s,t.providers);const i=Fu(t0({lazySink:()=>t.getSink(),header:K1(a,c),body:J1(o,t.providers),footer:N.some(Q1(e0([],[r.asSpec()]))),onEscape:s,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Wc(YM,s)],eventOrder:{}}));hJ.show(i);const l=r.get(i);C_.focus(l)};return{open:o}};const V0=e=>{const t=e.shared;const o=(o,n)=>{const s=e=>{hJ.hide(l);n(e)};const r=aS(IF({name:"yes",text:"Yes",primary:true,buttonType:N.some("primary"),align:"end",enabled:true,icon:N.none()},"submit",e));const a=IF({name:"no",text:"No",primary:false,buttonType:N.some("secondary"),align:"end",enabled:true,icon:N.none()},"cancel",e);const c=X1();const i=Y1((()=>s(false)),t.providers);const l=Fu(t0({lazySink:()=>t.getSink(),header:K1(c,i),body:J1(o,t.providers),footer:N.some(Q1(e0([],[a,r.asSpec()]))),onEscape:()=>s(false),extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Wc(YM,(()=>s(false))),Wc(JM,(()=>s(true)))],eventOrder:{}}));hJ.show(l);const d=r.get(l);C_.focus(d)};return{open:o}};const j0=(e,t)=>Rr(Mr("data",t,e));const Z0=e=>dM(e,".tox-alert-dialog")||dM(e,".tox-confirm-dialog");const U0=(e,t,o)=>{if(t&&o){return[]}else{return[wd.config({contextual:{lazyContext:()=>N.some(os(Je.fromDom(e.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:t=>{const o=QC(e,t.element);return o.map((e=>{const t=eS(e);return{bounds:t,optScrollEnv:N.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Ao(e.element).top})}})).getOrThunk((()=>({bounds:as(),optScrollEnv:N.none()})))}})]}};const q0=e=>{const t=e.editor;const o=qC(t);const n=F0(e.backstages.dialog);const s=V0(e.backstages.dialog);const r=(t,o,n)=>{if(!m(o)){if(o.inline==="toolbar"){return l(t,e.backstages.popup.shared.anchors.inlineDialog(),n,o)}else if(o.inline==="bottom"){return d(t,e.backstages.popup.shared.anchors.inlineBottomDialog(),n,o)}else if(o.inline==="cursor"){return l(t,e.backstages.popup.shared.anchors.cursor(),n,o)}}return i(t,n)};const a=(e,t)=>c(e,t);const c=(o,n)=>{const s=o=>{const s=P0(o,{closeWindow:()=>{hJ.hide(s.dialog);n(s.instanceApi)}},t,e.backstages.dialog);hJ.show(s.dialog);return s.instanceApi};return c1.openUrl(s,o)};const i=(t,o)=>{const n=(t,n,s)=>{const r=n;const a={dataValidator:s,initialData:r,internalDialog:t};const c=D0(a,{redial:c1.redial,closeWindow:()=>{hJ.hide(c.dialog);o(c.instanceApi)}},e.backstages.dialog);hJ.show(c.dialog);c.instanceApi.setData(r);return c.instanceApi};return c1.open(n,t)};const l=(n,s,r,a)=>{const c=(n,c,i)=>{const l=j0(c,i);const d=us();const u=e.backstages.popup.shared.header.isPositionedAtTop();const f={dataValidator:i,initialData:l,internalDialog:n};const m=()=>d.on((e=>{Ix.reposition(e);if(!o||!u){wd.refresh(e)}}));const g=N0(f,{redial:c1.redial,closeWindow:()=>{d.on(Ix.hide);t.off("ResizeEditor",m);d.clear();r(g.instanceApi)}},e.backstages.popup,a.ariaAttrs,m);const p=Fu(Ix.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:a.persistent?{event:"doNotDismissYet"}:{},...u?{}:{fireRepositionEventInstead:{}},inlineBehaviours:wi([p_("window-manager-inline-events",[Wc(zc(),((e,t)=>{Bc(g.dialog,YM)}))]),...U0(t,o,u)]),isExtraPart:(e,t)=>Z0(t)}));d.set(p);const h=()=>{const e=t.inline?Jt():Je.fromDom(t.getContainer());const o=os(e);return N.some(o)};Ix.showWithinBounds(p,Vu(g.dialog),{anchor:s},h);if(!o||!u){wd.refresh(p);t.on("ResizeEditor",m)}g.instanceApi.setData(l);Qw.focusIn(g.dialog);return g.instanceApi};return c1.open(c,n)};const d=(o,n,s,r)=>{const a=(o,a,c)=>{const i=j0(a,c);const l=us();const d=e.backstages.popup.shared.header.isPositionedAtTop();const u={dataValidator:c,initialData:i,internalDialog:o};const f=()=>l.on((e=>{Ix.reposition(e);wd.refresh(e)}));const m=N0(u,{redial:c1.redial,closeWindow:()=>{l.on(Ix.hide);t.off("ResizeEditor ScrollWindow ElementScroll",f);l.clear();s(m.instanceApi)}},e.backstages.popup,r.ariaAttrs,f);const g=Fu(Ix.sketch({lazySink:e.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:r.persistent?{event:"doNotDismissYet"}:{},...d?{}:{fireRepositionEventInstead:{}},inlineBehaviours:wi([p_("window-manager-inline-events",[Wc(zc(),((e,t)=>{Bc(m.dialog,YM)}))]),wd.config({contextual:{lazyContext:()=>N.some(os(Je.fromDom(t.getContentAreaContainer()))),fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:e=>{const o=QC(t,e.element);return o.map((e=>{const t=eS(e);return{bounds:t,optScrollEnv:N.some({currentScrollTop:e.element.dom.scrollTop,scrollElmTop:Ao(e.element).top})}})).getOrThunk((()=>({bounds:as(),optScrollEnv:N.none()})))}})]),isExtraPart:(e,t)=>Z0(t)}));l.set(g);const p=()=>e.backstages.popup.shared.getSink().toOptional().bind((e=>{const o=QC(t,e.element);const n=15;const s=o.map((e=>eS(e))).getOr(as());const r=os(Je.fromDom(t.getContentAreaContainer()));const a=ss(r,s);return N.some(ts(a.x,a.y,a.width,a.height-n))}));Ix.showWithinBounds(g,Vu(m.dialog),{anchor:n},p);wd.refresh(g);t.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",f);m.instanceApi.setData(i);Qw.focusIn(m.dialog);return m.instanceApi};return c1.open(a,o)};const u=(e,t)=>{s.open(e,t)};const f=(e,t)=>{n.open(e,t)};const g=e=>{e.close()};return{open:r,openUrl:a,alert:f,close:g,confirm:u}};const W0=e=>{$x(e);fD(e);YK(e)};var $0=()=>{fs.add("silver",(e=>{W0(e);let t=()=>as();const{dialogs:o,popups:n,renderUI:s}=lJ(e,{getPopupSinkBounds:()=>t()});const r=()=>{const o=s();const r=QC(e,n.getMothership().element);r.each((e=>{t=()=>eS(e)}));return o};lM.register(e,n.backstage.shared);const a=q0({editor:e,backstages:{popup:n.backstage,dialog:o.backstage}});const c=us();const i=()=>Pz(e,{backstage:n.backstage},n.getMothership(),c);return{renderUI:r,getWindowManagerImpl:x(a),getNotificationManagerImpl:i}}))};$0()})()},(e,t,o)=>{o(7)},()=>{(function(){"use strict";const e=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");var o=tinymce.util.Tools.resolve("tinymce.Env");const n=e=>e.dispatch("ResizeEditor");const s=e=>t=>t.options.get(e);const r=e=>{const t=e.options.register;t("autoresize_overflow_padding",{processor:"number",default:1});t("autoresize_bottom_margin",{processor:"number",default:50})};const a=s("min_height");const c=s("max_height");const i=s("autoresize_overflow_padding");const l=s("autoresize_bottom_margin");const d=e=>e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen();const u=(e,t)=>{const o=e.getBody();if(o){o.style.overflowY=t?"":"hidden";if(!t){o.scrollTop=0}}};const f=(e,t,o,n)=>{var s;const r=parseInt((s=e.getStyle(t,o,n))!==null&&s!==void 0?s:"",10);return isNaN(r)?0:r};const m=e=>{if((e===null||e===void 0?void 0:e.type.toLowerCase())==="setcontent"){const t=e;return t.selection===true||t.paste===true}else{return false}};const g=(e,t,s,r)=>{var l;const p=e.dom;const h=e.getDoc();if(!h){return}if(d(e)){u(e,true);return}const y=h.documentElement;const b=r?r():i(e);const v=(l=a(e))!==null&&l!==void 0?l:e.getElement().offsetHeight;let k=v;const w=f(p,y,"margin-top",true);const _=f(p,y,"margin-bottom",true);let x=y.offsetHeight+w+_+b;if(x<0){x=0}const C=e.getContainer().offsetHeight;const S=e.getContentAreaContainer().offsetHeight;const z=C-S;if(x+z>v){k=x+z}const T=c(e);if(T&&k>T){k=T;u(e,true)}else{u(e,false)}const E=t.get();if(E.set){e.dom.setStyles(e.getDoc().documentElement,{"min-height":0});e.dom.setStyles(e.getBody(),{"min-height":"inherit"})}if(k!==E.totalHeight&&(x-b!==E.contentHeight||!E.set)){const a=k-E.totalHeight;p.setStyle(e.getContainer(),"height",k+"px");t.set({totalHeight:k,contentHeight:x,set:true});n(e);if(o.browser.isSafari()&&(o.os.isMacOS()||o.os.isiOS())){const t=e.getWin();t.scrollTo(t.pageXOffset,t.pageYOffset)}if(e.hasFocus()&&m(s)){e.selection.scrollIntoView()}if((o.browser.isSafari()||o.browser.isChromium())&&a<0){g(e,t,s,r)}}};const p=(e,t)=>{const n=()=>l(e);e.on("init",(s=>{const r=i(e);const a=e.dom;a.setStyles(e.getDoc().documentElement,{height:"auto"});if(o.browser.isEdge()||o.browser.isIE()){a.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r,"min-height":0})}else{a.setStyles(e.getBody(),{paddingLeft:r,paddingRight:r})}g(e,t,s,n)}));e.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",(o=>{g(e,t,o,n)}))};const h=(e,t)=>{e.addCommand("mceAutoResize",(()=>{g(e,t)}))};var y=()=>{t.add("autoresize",(t=>{r(t);if(!t.options.isSet("resize")){t.options.set("resize",false)}if(!t.inline){const o=e({totalHeight:0,contentHeight:0,set:false});h(t,o);p(t,o)}}))};y()})()},(e,t,o)=>{o(9)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t)=>{e.focus();e.undoManager.transact((()=>{e.setContent(t)}));e.selection.setCursorLocation();e.nodeChanged()};const o=e=>e.getContent({source_view:true});const n=e=>{const n=o(e);e.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:{code:n},onSubmit:o=>{t(e,o.getData().code);o.close()}})};const s=e=>{e.addCommand("mceCodeEditor",(()=>{n(e)}))};const r=e=>{const t=()=>e.execCommand("mceCodeEditor");e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:t});e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:t})};var a=()=>{e.add("code",(e=>{s(e);r(e);return{}}))};a()})()},(e,t,o)=>{o(11)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=n("string");const a=s("boolean");const c=e=>e===null||e===undefined;const i=e=>!c(e);const l=s("function");const d=s("number");const u=(e,t)=>o=>e(t(o));const f=e=>()=>e;const m=f(false);class g{constructor(e,t){this.tag=e;this.value=t}static some(e){return new g(true,e)}static none(){return g.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return g.some(e(this.value))}else{return g.none()}}bind(e){if(this.tag){return e(this.value)}else{return g.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return g.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return i(e)?g.some(e):g.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}g.singletonNone=new g(false);const p=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const h=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const y=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const b=9;const v=11;const k=1;const w=3;const _=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return S(n.childNodes[0])};const x=(e,t)=>{const o=t||document;const n=o.createElement(e);return S(n)};const C=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return S(n)};const S=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const z=(e,t,o)=>g.from(e.dom.elementFromPoint(t,o)).map(S);const T={fromHtml:_,fromTag:x,fromText:C,fromDom:S,fromPoint:z};const E=(e,t)=>{const o=e.dom;if(o.nodeType!==k){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};typeof window!=="undefined"?window:Function("return this;")();const O=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const A=e=>e.dom.nodeType;const D=e=>t=>A(t)===e;const N=D(k);const M=D(w);const R=D(b);const B=D(v);const L=e=>t=>N(t)&&O(t)===e;const H=e=>T.fromDom(e.dom.ownerDocument);const I=e=>R(e)?e:H(e);const P=e=>g.from(e.dom.parentNode).map(T.fromDom);const F=e=>p(e.dom.childNodes,T.fromDom);const V=(e,t,o)=>{if(r(o)||a(o)||d(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const j=(e,t,o)=>{V(e.dom,t,o)};const Z=(e,t)=>{e.dom.removeAttribute(t)};const U=e=>B(e)&&i(e.dom.host);const q=l(Element.prototype.attachShadow)&&l(Node.prototype.getRootNode);const W=q?e=>T.fromDom(e.dom.getRootNode()):I;const $=e=>{const t=W(e);return U(t)?g.some(t):g.none()};const G=e=>T.fromDom(e.dom.host);const K=e=>{const t=M(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return $(T.fromDom(t)).fold((()=>o.body.contains(t)),u(K,G))};const Y=(e,t,o)=>{let n=e.dom;const s=l(o)?o:m;while(n.parentNode){n=n.parentNode;const e=T.fromDom(n);if(t(e)){return g.some(e)}else if(s(e)){break}}return g.none()};const X=(e,t,o)=>Y(e,(e=>E(e,t)),o);const J=e=>e.style!==undefined&&l(e.style.getPropertyValue);const Q=(e,t)=>{const o=e.dom;const n=window.getComputedStyle(o);const s=n.getPropertyValue(t);return s===""&&!K(e)?ee(o,t):s};const ee=(e,t)=>J(e)?e.style.getPropertyValue(t):"";const te=e=>Q(e,"direction")==="rtl"?"rtl":"ltr";const oe=(e,t)=>y(F(e),t);const ne=(e,t)=>oe(e,(e=>E(e,t)));const se=e=>P(e).filter(N);const re=(e,t)=>{const o=t?X(e,"ol,ul"):g.some(e);return o.getOr(e)};const ae=L("li");const ce=(e,t,o)=>{h(t,(t=>{const n=T.fromDom(t);const s=ae(n);const r=re(n,s);const a=se(r);a.each((t=>{e.setStyle(r.dom,"direction",null);const n=te(t);if(n===o){Z(r,"dir")}else{j(r,"dir",o)}if(te(r)!==o){e.setStyle(r.dom,"direction",o)}if(s){const t=ne(r,"li[dir],li[style]");h(t,(t=>{Z(t,"dir");e.setStyle(t.dom,"direction",null)}))}}))}))};const ie=(e,t)=>{if(e.selection.isEditable()){ce(e.dom,e.selection.getSelectedBlocks(),t);e.nodeChanged()}};const le=e=>{e.addCommand("mceDirectionLTR",(()=>{ie(e,"ltr")}));e.addCommand("mceDirectionRTL",(()=>{ie(e,"rtl")}))};const de=(e,t)=>o=>{const n=n=>{const s=T.fromDom(n.element);o.setActive(te(s)===t);o.setEnabled(e.selection.isEditable())};e.on("NodeChange",n);o.setEnabled(e.selection.isEditable());return()=>e.off("NodeChange",n)};const ue=e=>{e.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:()=>e.execCommand("mceDirectionLTR"),onSetup:de(e,"ltr")});e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:()=>e.execCommand("mceDirectionRTL"),onSetup:de(e,"rtl")})};var fe=()=>{e.add("directionality",(e=>{le(e);ue(e)}))};fe()})()},(e,t,o)=>{o(13)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>e===t;const o=t(null);const n=t(undefined);const s=e=>e===null||e===undefined;const r=e=>!s(e);const a=()=>{};const c=e=>()=>e;const i=c(false);class l{constructor(e,t){this.tag=e;this.value=t}static some(e){return new l(true,e)}static none(){return l.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return l.some(e(this.value))}else{return l.none()}}bind(e){if(this.tag){return e(this.value)}else{return l.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return l.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return r(e)?l.some(e):l.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}l.singletonNone=new l(false);const d=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return true}}return false};const u=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const f=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const m=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};const g=(e,t)=>{let n=null;const s=()=>{if(!o(n)){clearTimeout(n);n=null}};const r=(...o)=>{s();n=setTimeout((()=>{n=null;e.apply(null,o)}),t)};return{cancel:s,throttle:r}};const p=(e,t)=>{e.insertContent(t)};const h=Object.keys;const y=Object.hasOwnProperty;const b=(e,t)=>{const o=h(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const v=(e,t)=>k(e,((e,o)=>({k:o,v:t(e,o)})));const k=(e,t)=>{const o={};b(e,((e,n)=>{const s=t(e,n);o[s.k]=s.v}));return o};const w=(e,t)=>y.call(e,t);const _=(e,t)=>t;const x=e=>(...t)=>{if(t.length===0){throw new Error(`Can't merge zero objects`)}const o={};for(let n=0;n<t.length;n++){const s=t[n];for(const t in s){if(w(s,t)){o[t]=e(o[t],s[t])}}}return o};const C=x(_);const S=e=>{const t=m(l.none());const o=()=>t.get().each(e);const n=()=>{o();t.set(l.none())};const s=()=>t.get().isSome();const r=()=>t.get();const a=e=>{o();t.set(l.some(e))};return{clear:n,isSet:s,get:r,set:a}};const z=()=>{const e=S(a);const t=t=>e.get().each(t);return{...e,on:t}};const T=(e,t,o)=>t===""||e.length>=t.length&&e.substr(o,o+t.length)===t;const E=(e,t,o=0,s)=>{const r=e.indexOf(t,o);if(r!==-1){return n(s)?true:r+t.length<=s}else{return false}};const O=(e,t)=>T(e,t,0);var A=tinymce.util.Tools.resolve("tinymce.Resource");const D="tinymce.plugins.emoticons";const N=e=>t=>t.options.get(e);const M=(e,t)=>{const o=e.options.register;o("emoticons_database",{processor:"string",default:"emojis"});o("emoticons_database_url",{processor:"string",default:`${t}/js/${R(e)}${e.suffix}.js`});o("emoticons_database_id",{processor:"string",default:D});o("emoticons_append",{processor:"object",default:{}});o("emoticons_images_url",{processor:"string",default:"https://cdnjs.cloudflare.com/ajax/libs/twemoji/15.1.0/72x72/"})};const R=N("emoticons_database");const B=N("emoticons_database_url");const L=N("emoticons_database_id");const H=N("emoticons_append");const I=N("emoticons_images_url");const P="All";const F={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"};const V=(e,t)=>w(e,t)?e[t]:t;const j=e=>{const t=H(e);return v(t,(e=>({keywords:[],category:"user",...e})))};const Z=(e,t,o)=>{const n=z();const s=z();const r=I(e);const a=e=>{if(O(e.char,"<img")){return e.char.replace(/src="([^"]+)"/,((e,t)=>`src="${r}${t}"`))}else{return e.char}};const c=e=>{const t={};const o=[];b(e,((e,n)=>{const s={title:n,keywords:e.keywords,char:a(e),category:V(F,e.category)};const r=t[s.category]!==undefined?t[s.category]:[];t[s.category]=r.concat([s]);o.push(s)}));n.set(t);s.set(o)};e.on("init",(()=>{A.load(o,t).then((t=>{const o=j(e);c(C(t,o))}),(e=>{console.log(`Failed to load emojis: ${e}`);n.set({});s.set([])}))}));const i=e=>{if(e===P){return d()}return n.get().bind((t=>l.from(t[e]))).getOr([])};const d=()=>s.get().getOr([]);const u=()=>[P].concat(h(n.get().getOr({})));const f=()=>{if(m()){return Promise.resolve(true)}else{return new Promise(((e,o)=>{let n=15;const s=setInterval((()=>{if(m()){clearInterval(s);e(true)}else{n--;if(n<0){console.log("Could not load emojis from url: "+t);clearInterval(s);o(false)}}}),100)}))}};const m=()=>n.isSet()&&s.isSet();return{listCategories:u,hasLoaded:m,waitForLoad:f,listAll:d,listCategory:i}};const U=(e,t)=>E(e.title.toLowerCase(),t)||d(e.keywords,(e=>E(e.toLowerCase(),t)));const q=(e,t,o)=>{const n=[];const s=t.toLowerCase();const r=o.fold((()=>i),(e=>t=>t>=e));for(let o=0;o<e.length;o++){if(t.length===0||U(e[o],s)){n.push({value:e[o].char,text:e[o].title,icon:e[o].char});if(r(n.length)){break}}}return n};const W="pattern";const $=(e,t)=>{const o={pattern:"",results:q(t.listAll(),"",l.some(300))};const n=m(P);const s=e=>{const o=e.getData();const s=n.get();const r=t.listCategory(s);const a=q(r,o[W],s===P?l.some(300):l.none());e.setData({results:a})};const r=g((e=>{s(e)}),200);const a={label:"Search",type:"input",name:W};const c={type:"collection",name:"results"};const i=()=>{const s={type:"tabpanel",tabs:u(t.listCategories(),(e=>({title:e,name:e,items:[a,c]})))};return{title:"Emojis",size:"normal",body:s,initialData:o,onTabChange:(e,t)=>{n.set(t.newTabName);r.throttle(e)},onChange:r.throttle,onAction:(t,o)=>{if(o.name==="results"){p(e,o.value);t.close()}},buttons:[{type:"cancel",text:"Close",primary:true}]}};const d=e.windowManager.open(i());d.focus(W);if(!t.hasLoaded()){d.block("Loading emojis...");t.waitForLoad().then((()=>{d.redial(i());r.throttle(d);d.focus(W);d.unblock()})).catch((e=>{d.redial({title:"Emojis",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"Could not load emojis"}]},buttons:[{type:"cancel",text:"Close",primary:true}],initialData:{pattern:"",results:[]}});d.focus(W);d.unblock()}))}};const G=(e,t)=>{e.addCommand("mceEmoticons",(()=>$(e,t)))};const K=e=>{e.on("PreInit",(()=>{e.parser.addAttributeFilter("data-emoticon",(e=>{f(e,(e=>{e.attr("data-mce-resize","false");e.attr("data-mce-placeholder","1")}))}))}))};const Y=(e,t)=>{e.ui.registry.addAutocompleter("emoticons",{trigger:":",columns:"auto",minChars:2,fetch:(e,o)=>t.waitForLoad().then((()=>{const n=t.listAll();return q(n,e,l.some(o))})),onAction:(t,o,n)=>{e.selection.setRng(o);e.insertContent(n);t.hide()}})};const X=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};e.on("NodeChange",o);o();return()=>{e.off("NodeChange",o)}};const J=e=>{const t=()=>e.execCommand("mceEmoticons");e.ui.registry.addButton("emoticons",{tooltip:"Emojis",icon:"emoji",onAction:t,onSetup:X(e)});e.ui.registry.addMenuItem("emoticons",{text:"Emojis...",icon:"emoji",onAction:t,onSetup:X(e)})};var Q=()=>{e.add("emoticons",((e,t)=>{M(e,t);const o=B(e);const n=L(e);const s=Z(e,o,n);G(e,s);J(e);Y(e,s);K(e);return{getAllEmojis:()=>s.waitForLoad().then((()=>s.listAll()))}}))};Q()})()},()=>{window.tinymce.Resource.add("tinymce.plugins.emoticons",{grinning:{keywords:["face","smile","happy","joy",":D","grin"],char:"😀",fitzpatrick_scale:false,category:"people"},grimacing:{keywords:["face","grimace","teeth"],char:"😬",fitzpatrick_scale:false,category:"people"},grin:{keywords:["face","happy","smile","joy","kawaii"],char:"😁",fitzpatrick_scale:false,category:"people"},joy:{keywords:["face","cry","tears","weep","happy","happytears","haha"],char:"😂",fitzpatrick_scale:false,category:"people"},rofl:{keywords:["face","rolling","floor","laughing","lol","haha"],char:"🤣",fitzpatrick_scale:false,category:"people"},partying:{keywords:["face","celebration","woohoo"],char:"🥳",fitzpatrick_scale:false,category:"people"},smiley:{keywords:["face","happy","joy","haha",":D",":)","smile","funny"],char:"😃",fitzpatrick_scale:false,category:"people"},smile:{keywords:["face","happy","joy","funny","haha","laugh","like",":D",":)"],char:"😄",fitzpatrick_scale:false,category:"people"},sweat_smile:{keywords:["face","hot","happy","laugh","sweat","smile","relief"],char:"😅",fitzpatrick_scale:false,category:"people"},laughing:{keywords:["happy","joy","lol","satisfied","haha","face","glad","XD","laugh"],char:"😆",fitzpatrick_scale:false,category:"people"},innocent:{keywords:["face","angel","heaven","halo"],char:"😇",fitzpatrick_scale:false,category:"people"},wink:{keywords:["face","happy","mischievous","secret",";)","smile","eye"],char:"😉",fitzpatrick_scale:false,category:"people"},blush:{keywords:["face","smile","happy","flushed","crush","embarrassed","shy","joy"],char:"😊",fitzpatrick_scale:false,category:"people"},slightly_smiling_face:{keywords:["face","smile"],char:"🙂",fitzpatrick_scale:false,category:"people"},upside_down_face:{keywords:["face","flipped","silly","smile"],char:"🙃",fitzpatrick_scale:false,category:"people"},relaxed:{keywords:["face","blush","massage","happiness"],char:"☺️",fitzpatrick_scale:false,category:"people"},yum:{keywords:["happy","joy","tongue","smile","face","silly","yummy","nom","delicious","savouring"],char:"😋",fitzpatrick_scale:false,category:"people"},relieved:{keywords:["face","relaxed","phew","massage","happiness"],char:"😌",fitzpatrick_scale:false,category:"people"},heart_eyes:{keywords:["face","love","like","affection","valentines","infatuation","crush","heart"],char:"😍",fitzpatrick_scale:false,category:"people"},smiling_face_with_three_hearts:{keywords:["face","love","like","affection","valentines","infatuation","crush","hearts","adore"],char:"🥰",fitzpatrick_scale:false,category:"people"},kissing_heart:{keywords:["face","love","like","affection","valentines","infatuation","kiss"],char:"😘",fitzpatrick_scale:false,category:"people"},kissing:{keywords:["love","like","face","3","valentines","infatuation","kiss"],char:"😗",fitzpatrick_scale:false,category:"people"},kissing_smiling_eyes:{keywords:["face","affection","valentines","infatuation","kiss"],char:"😙",fitzpatrick_scale:false,category:"people"},kissing_closed_eyes:{keywords:["face","love","like","affection","valentines","infatuation","kiss"],char:"😚",fitzpatrick_scale:false,category:"people"},stuck_out_tongue_winking_eye:{keywords:["face","prank","childish","playful","mischievous","smile","wink","tongue"],char:"😜",fitzpatrick_scale:false,category:"people"},zany:{keywords:["face","goofy","crazy"],char:"🤪",fitzpatrick_scale:false,category:"people"},raised_eyebrow:{keywords:["face","distrust","scepticism","disapproval","disbelief","surprise"],char:"🤨",fitzpatrick_scale:false,category:"people"},monocle:{keywords:["face","stuffy","wealthy"],char:"🧐",fitzpatrick_scale:false,category:"people"},stuck_out_tongue_closed_eyes:{keywords:["face","prank","playful","mischievous","smile","tongue"],char:"😝",fitzpatrick_scale:false,category:"people"},stuck_out_tongue:{keywords:["face","prank","childish","playful","mischievous","smile","tongue"],char:"😛",fitzpatrick_scale:false,category:"people"},money_mouth_face:{keywords:["face","rich","dollar","money"],char:"🤑",fitzpatrick_scale:false,category:"people"},nerd_face:{keywords:["face","nerdy","geek","dork"],char:"🤓",fitzpatrick_scale:false,category:"people"},sunglasses:{keywords:["face","cool","smile","summer","beach","sunglass"],char:"😎",fitzpatrick_scale:false,category:"people"},star_struck:{keywords:["face","smile","starry","eyes","grinning"],char:"🤩",fitzpatrick_scale:false,category:"people"},clown_face:{keywords:["face"],char:"🤡",fitzpatrick_scale:false,category:"people"},cowboy_hat_face:{keywords:["face","cowgirl","hat"],char:"🤠",fitzpatrick_scale:false,category:"people"},hugs:{keywords:["face","smile","hug"],char:"🤗",fitzpatrick_scale:false,category:"people"},smirk:{keywords:["face","smile","mean","prank","smug","sarcasm"],char:"😏",fitzpatrick_scale:false,category:"people"},no_mouth:{keywords:["face","hellokitty"],char:"😶",fitzpatrick_scale:false,category:"people"},neutral_face:{keywords:["indifference","meh",":|","neutral"],char:"😐",fitzpatrick_scale:false,category:"people"},expressionless:{keywords:["face","indifferent","-_-","meh","deadpan"],char:"😑",fitzpatrick_scale:false,category:"people"},unamused:{keywords:["indifference","bored","straight face","serious","sarcasm","unimpressed","skeptical","dubious","side_eye"],char:"😒",fitzpatrick_scale:false,category:"people"},roll_eyes:{keywords:["face","eyeroll","frustrated"],char:"🙄",fitzpatrick_scale:false,category:"people"},thinking:{keywords:["face","hmmm","think","consider"],char:"🤔",fitzpatrick_scale:false,category:"people"},lying_face:{keywords:["face","lie","pinocchio"],char:"🤥",fitzpatrick_scale:false,category:"people"},hand_over_mouth:{keywords:["face","whoops","shock","surprise"],char:"🤭",fitzpatrick_scale:false,category:"people"},shushing:{keywords:["face","quiet","shhh"],char:"🤫",fitzpatrick_scale:false,category:"people"},symbols_over_mouth:{keywords:["face","swearing","cursing","cussing","profanity","expletive"],char:"🤬",fitzpatrick_scale:false,category:"people"},exploding_head:{keywords:["face","shocked","mind","blown"],char:"🤯",fitzpatrick_scale:false,category:"people"},flushed:{keywords:["face","blush","shy","flattered"],char:"😳",fitzpatrick_scale:false,category:"people"},disappointed:{keywords:["face","sad","upset","depressed",":("],char:"😞",fitzpatrick_scale:false,category:"people"},worried:{keywords:["face","concern","nervous",":("],char:"😟",fitzpatrick_scale:false,category:"people"},angry:{keywords:["mad","face","annoyed","frustrated"],char:"😠",fitzpatrick_scale:false,category:"people"},rage:{keywords:["angry","mad","hate","despise"],char:"😡",fitzpatrick_scale:false,category:"people"},pensive:{keywords:["face","sad","depressed","upset"],char:"😔",fitzpatrick_scale:false,category:"people"},confused:{keywords:["face","indifference","huh","weird","hmmm",":/"],char:"😕",fitzpatrick_scale:false,category:"people"},slightly_frowning_face:{keywords:["face","frowning","disappointed","sad","upset"],char:"🙁",fitzpatrick_scale:false,category:"people"},frowning_face:{keywords:["face","sad","upset","frown"],char:"☹",fitzpatrick_scale:false,category:"people"},persevere:{keywords:["face","sick","no","upset","oops"],char:"😣",fitzpatrick_scale:false,category:"people"},confounded:{keywords:["face","confused","sick","unwell","oops",":S"],char:"😖",fitzpatrick_scale:false,category:"people"},tired_face:{keywords:["sick","whine","upset","frustrated"],char:"😫",fitzpatrick_scale:false,category:"people"},weary:{keywords:["face","tired","sleepy","sad","frustrated","upset"],char:"😩",fitzpatrick_scale:false,category:"people"},pleading:{keywords:["face","begging","mercy"],char:"🥺",fitzpatrick_scale:false,category:"people"},triumph:{keywords:["face","gas","phew","proud","pride"],char:"😤",fitzpatrick_scale:false,category:"people"},open_mouth:{keywords:["face","surprise","impressed","wow","whoa",":O"],char:"😮",fitzpatrick_scale:false,category:"people"},scream:{keywords:["face","munch","scared","omg"],char:"😱",fitzpatrick_scale:false,category:"people"},fearful:{keywords:["face","scared","terrified","nervous","oops","huh"],char:"😨",fitzpatrick_scale:false,category:"people"},cold_sweat:{keywords:["face","nervous","sweat"],char:"😰",fitzpatrick_scale:false,category:"people"},hushed:{keywords:["face","woo","shh"],char:"😯",fitzpatrick_scale:false,category:"people"},frowning:{keywords:["face","aw","what"],char:"😦",fitzpatrick_scale:false,category:"people"},anguished:{keywords:["face","stunned","nervous"],char:"😧",fitzpatrick_scale:false,category:"people"},cry:{keywords:["face","tears","sad","depressed","upset",":'("],char:"😢",fitzpatrick_scale:false,category:"people"},disappointed_relieved:{keywords:["face","phew","sweat","nervous"],char:"😥",fitzpatrick_scale:false,category:"people"},drooling_face:{keywords:["face"],char:"🤤",fitzpatrick_scale:false,category:"people"},sleepy:{keywords:["face","tired","rest","nap"],char:"😪",fitzpatrick_scale:false,category:"people"},sweat:{keywords:["face","hot","sad","tired","exercise"],char:"😓",fitzpatrick_scale:false,category:"people"},hot:{keywords:["face","feverish","heat","red","sweating"],char:"🥵",fitzpatrick_scale:false,category:"people"},cold:{keywords:["face","blue","freezing","frozen","frostbite","icicles"],char:"🥶",fitzpatrick_scale:false,category:"people"},sob:{keywords:["face","cry","tears","sad","upset","depressed"],char:"😭",fitzpatrick_scale:false,category:"people"},dizzy_face:{keywords:["spent","unconscious","xox","dizzy"],char:"😵",fitzpatrick_scale:false,category:"people"},astonished:{keywords:["face","xox","surprised","poisoned"],char:"😲",fitzpatrick_scale:false,category:"people"},zipper_mouth_face:{keywords:["face","sealed","zipper","secret"],char:"🤐",fitzpatrick_scale:false,category:"people"},nauseated_face:{keywords:["face","vomit","gross","green","sick","throw up","ill"],char:"🤢",fitzpatrick_scale:false,category:"people"},sneezing_face:{keywords:["face","gesundheit","sneeze","sick","allergy"],char:"🤧",fitzpatrick_scale:false,category:"people"},vomiting:{keywords:["face","sick"],char:"🤮",fitzpatrick_scale:false,category:"people"},mask:{keywords:["face","sick","ill","disease"],char:"😷",fitzpatrick_scale:false,category:"people"},face_with_thermometer:{keywords:["sick","temperature","thermometer","cold","fever"],char:"🤒",fitzpatrick_scale:false,category:"people"},face_with_head_bandage:{keywords:["injured","clumsy","bandage","hurt"],char:"🤕",fitzpatrick_scale:false,category:"people"},woozy:{keywords:["face","dizzy","intoxicated","tipsy","wavy"],char:"🥴",fitzpatrick_scale:false,category:"people"},sleeping:{keywords:["face","tired","sleepy","night","zzz"],char:"😴",fitzpatrick_scale:false,category:"people"},zzz:{keywords:["sleepy","tired","dream"],char:"💤",fitzpatrick_scale:false,category:"people"},poop:{keywords:["hankey","shitface","fail","turd","shit"],char:"💩",fitzpatrick_scale:false,category:"people"},smiling_imp:{keywords:["devil","horns"],char:"😈",fitzpatrick_scale:false,category:"people"},imp:{keywords:["devil","angry","horns"],char:"👿",fitzpatrick_scale:false,category:"people"},japanese_ogre:{keywords:["monster","red","mask","halloween","scary","creepy","devil","demon","japanese","ogre"],char:"👹",fitzpatrick_scale:false,category:"people"},japanese_goblin:{keywords:["red","evil","mask","monster","scary","creepy","japanese","goblin"],char:"👺",fitzpatrick_scale:false,category:"people"},skull:{keywords:["dead","skeleton","creepy","death"],char:"💀",fitzpatrick_scale:false,category:"people"},ghost:{keywords:["halloween","spooky","scary"],char:"👻",fitzpatrick_scale:false,category:"people"},alien:{keywords:["UFO","paul","weird","outer_space"],char:"👽",fitzpatrick_scale:false,category:"people"},robot:{keywords:["computer","machine","bot"],char:"🤖",fitzpatrick_scale:false,category:"people"},smiley_cat:{keywords:["animal","cats","happy","smile"],char:"😺",fitzpatrick_scale:false,category:"people"},smile_cat:{keywords:["animal","cats","smile"],char:"😸",fitzpatrick_scale:false,category:"people"},joy_cat:{keywords:["animal","cats","haha","happy","tears"],char:"😹",fitzpatrick_scale:false,category:"people"},heart_eyes_cat:{keywords:["animal","love","like","affection","cats","valentines","heart"],char:"😻",fitzpatrick_scale:false,category:"people"},smirk_cat:{keywords:["animal","cats","smirk"],char:"😼",fitzpatrick_scale:false,category:"people"},kissing_cat:{keywords:["animal","cats","kiss"],char:"😽",fitzpatrick_scale:false,category:"people"},scream_cat:{keywords:["animal","cats","munch","scared","scream"],char:"🙀",fitzpatrick_scale:false,category:"people"},crying_cat_face:{keywords:["animal","tears","weep","sad","cats","upset","cry"],char:"😿",fitzpatrick_scale:false,category:"people"},pouting_cat:{keywords:["animal","cats"],char:"😾",fitzpatrick_scale:false,category:"people"},palms_up:{keywords:["hands","gesture","cupped","prayer"],char:"🤲",fitzpatrick_scale:true,category:"people"},raised_hands:{keywords:["gesture","hooray","yea","celebration","hands"],char:"🙌",fitzpatrick_scale:true,category:"people"},clap:{keywords:["hands","praise","applause","congrats","yay"],char:"👏",fitzpatrick_scale:true,category:"people"},wave:{keywords:["hands","gesture","goodbye","solong","farewell","hello","hi","palm"],char:"👋",fitzpatrick_scale:true,category:"people"},call_me_hand:{keywords:["hands","gesture"],char:"🤙",fitzpatrick_scale:true,category:"people"},"+1":{keywords:["thumbsup","yes","awesome","good","agree","accept","cool","hand","like"],char:"👍",fitzpatrick_scale:true,category:"people"},"-1":{keywords:["thumbsdown","no","dislike","hand"],char:"👎",fitzpatrick_scale:true,category:"people"},facepunch:{keywords:["angry","violence","fist","hit","attack","hand"],char:"👊",fitzpatrick_scale:true,category:"people"},fist:{keywords:["fingers","hand","grasp"],char:"✊",fitzpatrick_scale:true,category:"people"},fist_left:{keywords:["hand","fistbump"],char:"🤛",fitzpatrick_scale:true,category:"people"},fist_right:{keywords:["hand","fistbump"],char:"🤜",fitzpatrick_scale:true,category:"people"},v:{keywords:["fingers","ohyeah","hand","peace","victory","two"],char:"✌",fitzpatrick_scale:true,category:"people"},ok_hand:{keywords:["fingers","limbs","perfect","ok","okay"],char:"👌",fitzpatrick_scale:true,category:"people"},raised_hand:{keywords:["fingers","stop","highfive","palm","ban"],char:"✋",fitzpatrick_scale:true,category:"people"},raised_back_of_hand:{keywords:["fingers","raised","backhand"],char:"🤚",fitzpatrick_scale:true,category:"people"},open_hands:{keywords:["fingers","butterfly","hands","open"],char:"👐",fitzpatrick_scale:true,category:"people"},muscle:{keywords:["arm","flex","hand","summer","strong","biceps"],char:"💪",fitzpatrick_scale:true,category:"people"},pray:{keywords:["please","hope","wish","namaste","highfive"],char:"🙏",fitzpatrick_scale:true,category:"people"},foot:{keywords:["kick","stomp"],char:"🦶",fitzpatrick_scale:true,category:"people"},leg:{keywords:["kick","limb"],char:"🦵",fitzpatrick_scale:true,category:"people"},handshake:{keywords:["agreement","shake"],char:"🤝",fitzpatrick_scale:false,category:"people"},point_up:{keywords:["hand","fingers","direction","up"],char:"☝",fitzpatrick_scale:true,category:"people"},point_up_2:{keywords:["fingers","hand","direction","up"],char:"👆",fitzpatrick_scale:true,category:"people"},point_down:{keywords:["fingers","hand","direction","down"],char:"👇",fitzpatrick_scale:true,category:"people"},point_left:{keywords:["direction","fingers","hand","left"],char:"👈",fitzpatrick_scale:true,category:"people"},point_right:{keywords:["fingers","hand","direction","right"],char:"👉",fitzpatrick_scale:true,category:"people"},fu:{keywords:["hand","fingers","rude","middle","flipping"],char:"🖕",fitzpatrick_scale:true,category:"people"},raised_hand_with_fingers_splayed:{keywords:["hand","fingers","palm"],char:"🖐",fitzpatrick_scale:true,category:"people"},love_you:{keywords:["hand","fingers","gesture"],char:"🤟",fitzpatrick_scale:true,category:"people"},metal:{keywords:["hand","fingers","evil_eye","sign_of_horns","rock_on"],char:"🤘",fitzpatrick_scale:true,category:"people"},crossed_fingers:{keywords:["good","lucky"],char:"🤞",fitzpatrick_scale:true,category:"people"},vulcan_salute:{keywords:["hand","fingers","spock","star trek"],char:"🖖",fitzpatrick_scale:true,category:"people"},writing_hand:{keywords:["lower_left_ballpoint_pen","stationery","write","compose"],char:"✍",fitzpatrick_scale:true,category:"people"},selfie:{keywords:["camera","phone"],char:"🤳",fitzpatrick_scale:true,category:"people"},nail_care:{keywords:["beauty","manicure","finger","fashion","nail"],char:"💅",fitzpatrick_scale:true,category:"people"},lips:{keywords:["mouth","kiss"],char:"👄",fitzpatrick_scale:false,category:"people"},tooth:{keywords:["teeth","dentist"],char:"🦷",fitzpatrick_scale:false,category:"people"},tongue:{keywords:["mouth","playful"],char:"👅",fitzpatrick_scale:false,category:"people"},ear:{keywords:["face","hear","sound","listen"],char:"👂",fitzpatrick_scale:true,category:"people"},nose:{keywords:["smell","sniff"],char:"👃",fitzpatrick_scale:true,category:"people"},eye:{keywords:["face","look","see","watch","stare"],char:"👁",fitzpatrick_scale:false,category:"people"},eyes:{keywords:["look","watch","stalk","peek","see"],char:"👀",fitzpatrick_scale:false,category:"people"},brain:{keywords:["smart","intelligent"],char:"🧠",fitzpatrick_scale:false,category:"people"},bust_in_silhouette:{keywords:["user","person","human"],char:"👤",fitzpatrick_scale:false,category:"people"},busts_in_silhouette:{keywords:["user","person","human","group","team"],char:"👥",fitzpatrick_scale:false,category:"people"},speaking_head:{keywords:["user","person","human","sing","say","talk"],char:"🗣",fitzpatrick_scale:false,category:"people"},baby:{keywords:["child","boy","girl","toddler"],char:"👶",fitzpatrick_scale:true,category:"people"},child:{keywords:["gender-neutral","young"],char:"🧒",fitzpatrick_scale:true,category:"people"},boy:{keywords:["man","male","guy","teenager"],char:"👦",fitzpatrick_scale:true,category:"people"},girl:{keywords:["female","woman","teenager"],char:"👧",fitzpatrick_scale:true,category:"people"},adult:{keywords:["gender-neutral","person"],char:"🧑",fitzpatrick_scale:true,category:"people"},man:{keywords:["mustache","father","dad","guy","classy","sir","moustache"],char:"👨",fitzpatrick_scale:true,category:"people"},woman:{keywords:["female","girls","lady"],char:"👩",fitzpatrick_scale:true,category:"people"},blonde_woman:{keywords:["woman","female","girl","blonde","person"],char:"👱♀️",fitzpatrick_scale:true,category:"people"},blonde_man:{keywords:["man","male","boy","blonde","guy","person"],char:"👱",fitzpatrick_scale:true,category:"people"},bearded_person:{keywords:["person","bewhiskered"],char:"🧔",fitzpatrick_scale:true,category:"people"},older_adult:{keywords:["human","elder","senior","gender-neutral"],char:"🧓",fitzpatrick_scale:true,category:"people"},older_man:{keywords:["human","male","men","old","elder","senior"],char:"👴",fitzpatrick_scale:true,category:"people"},older_woman:{keywords:["human","female","women","lady","old","elder","senior"],char:"👵",fitzpatrick_scale:true,category:"people"},man_with_gua_pi_mao:{keywords:["male","boy","chinese"],char:"👲",fitzpatrick_scale:true,category:"people"},woman_with_headscarf:{keywords:["female","hijab","mantilla","tichel"],char:"🧕",fitzpatrick_scale:true,category:"people"},woman_with_turban:{keywords:["female","indian","hinduism","arabs","woman"],char:"👳♀️",fitzpatrick_scale:true,category:"people"},man_with_turban:{keywords:["male","indian","hinduism","arabs"],char:"👳",fitzpatrick_scale:true,category:"people"},policewoman:{keywords:["woman","police","law","legal","enforcement","arrest","911","female"],char:"👮♀️",fitzpatrick_scale:true,category:"people"},policeman:{keywords:["man","police","law","legal","enforcement","arrest","911"],char:"👮",fitzpatrick_scale:true,category:"people"},construction_worker_woman:{keywords:["female","human","wip","build","construction","worker","labor","woman"],char:"👷♀️",fitzpatrick_scale:true,category:"people"},construction_worker_man:{keywords:["male","human","wip","guy","build","construction","worker","labor"],char:"👷",fitzpatrick_scale:true,category:"people"},guardswoman:{keywords:["uk","gb","british","female","royal","woman"],char:"💂♀️",fitzpatrick_scale:true,category:"people"},guardsman:{keywords:["uk","gb","british","male","guy","royal"],char:"💂",fitzpatrick_scale:true,category:"people"},female_detective:{keywords:["human","spy","detective","female","woman"],char:"🕵️♀️",fitzpatrick_scale:true,category:"people"},male_detective:{keywords:["human","spy","detective"],char:"🕵",fitzpatrick_scale:true,category:"people"},woman_health_worker:{keywords:["doctor","nurse","therapist","healthcare","woman","human"],char:"👩⚕️",fitzpatrick_scale:true,category:"people"},man_health_worker:{keywords:["doctor","nurse","therapist","healthcare","man","human"],char:"👨⚕️",fitzpatrick_scale:true,category:"people"},woman_farmer:{keywords:["rancher","gardener","woman","human"],char:"👩🌾",fitzpatrick_scale:true,category:"people"},man_farmer:{keywords:["rancher","gardener","man","human"],char:"👨🌾",fitzpatrick_scale:true,category:"people"},woman_cook:{keywords:["chef","woman","human"],char:"👩🍳",fitzpatrick_scale:true,category:"people"},man_cook:{keywords:["chef","man","human"],char:"👨🍳",fitzpatrick_scale:true,category:"people"},woman_student:{keywords:["graduate","woman","human"],char:"👩🎓",fitzpatrick_scale:true,category:"people"},man_student:{keywords:["graduate","man","human"],char:"👨🎓",fitzpatrick_scale:true,category:"people"},woman_singer:{keywords:["rockstar","entertainer","woman","human"],char:"👩🎤",fitzpatrick_scale:true,category:"people"},man_singer:{keywords:["rockstar","entertainer","man","human"],char:"👨🎤",fitzpatrick_scale:true,category:"people"},woman_teacher:{keywords:["instructor","professor","woman","human"],char:"👩🏫",fitzpatrick_scale:true,category:"people"},man_teacher:{keywords:["instructor","professor","man","human"],char:"👨🏫",fitzpatrick_scale:true,category:"people"},woman_factory_worker:{keywords:["assembly","industrial","woman","human"],char:"👩🏭",fitzpatrick_scale:true,category:"people"},man_factory_worker:{keywords:["assembly","industrial","man","human"],char:"👨🏭",fitzpatrick_scale:true,category:"people"},woman_technologist:{keywords:["coder","developer","engineer","programmer","software","woman","human","laptop","computer"],char:"👩💻",fitzpatrick_scale:true,category:"people"},man_technologist:{keywords:["coder","developer","engineer","programmer","software","man","human","laptop","computer"],char:"👨💻",fitzpatrick_scale:true,category:"people"},woman_office_worker:{keywords:["business","manager","woman","human"],char:"👩💼",fitzpatrick_scale:true,category:"people"},man_office_worker:{keywords:["business","manager","man","human"],char:"👨💼",fitzpatrick_scale:true,category:"people"},woman_mechanic:{keywords:["plumber","woman","human","wrench"],char:"👩🔧",fitzpatrick_scale:true,category:"people"},man_mechanic:{keywords:["plumber","man","human","wrench"],char:"👨🔧",fitzpatrick_scale:true,category:"people"},woman_scientist:{keywords:["biologist","chemist","engineer","physicist","woman","human"],char:"👩🔬",fitzpatrick_scale:true,category:"people"},man_scientist:{keywords:["biologist","chemist","engineer","physicist","man","human"],char:"👨🔬",fitzpatrick_scale:true,category:"people"},woman_artist:{keywords:["painter","woman","human"],char:"👩🎨",fitzpatrick_scale:true,category:"people"},man_artist:{keywords:["painter","man","human"],char:"👨🎨",fitzpatrick_scale:true,category:"people"},woman_firefighter:{keywords:["fireman","woman","human"],char:"👩🚒",fitzpatrick_scale:true,category:"people"},man_firefighter:{keywords:["fireman","man","human"],char:"👨🚒",fitzpatrick_scale:true,category:"people"},woman_pilot:{keywords:["aviator","plane","woman","human"],char:"👩✈️",fitzpatrick_scale:true,category:"people"},man_pilot:{keywords:["aviator","plane","man","human"],char:"👨✈️",fitzpatrick_scale:true,category:"people"},woman_astronaut:{keywords:["space","rocket","woman","human"],char:"👩🚀",fitzpatrick_scale:true,category:"people"},man_astronaut:{keywords:["space","rocket","man","human"],char:"👨🚀",fitzpatrick_scale:true,category:"people"},woman_judge:{keywords:["justice","court","woman","human"],char:"👩⚖️",fitzpatrick_scale:true,category:"people"},man_judge:{keywords:["justice","court","man","human"],char:"👨⚖️",fitzpatrick_scale:true,category:"people"},woman_superhero:{keywords:["woman","female","good","heroine","superpowers"],char:"🦸♀️",fitzpatrick_scale:true,category:"people"},man_superhero:{keywords:["man","male","good","hero","superpowers"],char:"🦸♂️",fitzpatrick_scale:true,category:"people"},woman_supervillain:{keywords:["woman","female","evil","bad","criminal","heroine","superpowers"],char:"🦹♀️",fitzpatrick_scale:true,category:"people"},man_supervillain:{keywords:["man","male","evil","bad","criminal","hero","superpowers"],char:"🦹♂️",fitzpatrick_scale:true,category:"people"},mrs_claus:{keywords:["woman","female","xmas","mother christmas"],char:"🤶",fitzpatrick_scale:true,category:"people"},santa:{keywords:["festival","man","male","xmas","father christmas"],char:"🎅",fitzpatrick_scale:true,category:"people"},sorceress:{keywords:["woman","female","mage","witch"],char:"🧙♀️",fitzpatrick_scale:true,category:"people"},wizard:{keywords:["man","male","mage","sorcerer"],char:"🧙♂️",fitzpatrick_scale:true,category:"people"},woman_elf:{keywords:["woman","female"],char:"🧝♀️",fitzpatrick_scale:true,category:"people"},man_elf:{keywords:["man","male"],char:"🧝♂️",fitzpatrick_scale:true,category:"people"},woman_vampire:{keywords:["woman","female"],char:"🧛♀️",fitzpatrick_scale:true,category:"people"},man_vampire:{keywords:["man","male","dracula"],char:"🧛♂️",fitzpatrick_scale:true,category:"people"},woman_zombie:{keywords:["woman","female","undead","walking dead"],char:"🧟♀️",fitzpatrick_scale:false,category:"people"},man_zombie:{keywords:["man","male","dracula","undead","walking dead"],char:"🧟♂️",fitzpatrick_scale:false,category:"people"},woman_genie:{keywords:["woman","female"],char:"🧞♀️",fitzpatrick_scale:false,category:"people"},man_genie:{keywords:["man","male"],char:"🧞♂️",fitzpatrick_scale:false,category:"people"},mermaid:{keywords:["woman","female","merwoman","ariel"],char:"🧜♀️",fitzpatrick_scale:true,category:"people"},merman:{keywords:["man","male","triton"],char:"🧜♂️",fitzpatrick_scale:true,category:"people"},woman_fairy:{keywords:["woman","female"],char:"🧚♀️",fitzpatrick_scale:true,category:"people"},man_fairy:{keywords:["man","male"],char:"🧚♂️",fitzpatrick_scale:true,category:"people"},angel:{keywords:["heaven","wings","halo"],char:"👼",fitzpatrick_scale:true,category:"people"},pregnant_woman:{keywords:["baby"],char:"🤰",fitzpatrick_scale:true,category:"people"},breastfeeding:{keywords:["nursing","baby"],char:"🤱",fitzpatrick_scale:true,category:"people"},princess:{keywords:["girl","woman","female","blond","crown","royal","queen"],char:"👸",fitzpatrick_scale:true,category:"people"},prince:{keywords:["boy","man","male","crown","royal","king"],char:"🤴",fitzpatrick_scale:true,category:"people"},bride_with_veil:{keywords:["couple","marriage","wedding","woman","bride"],char:"👰",fitzpatrick_scale:true,category:"people"},man_in_tuxedo:{keywords:["couple","marriage","wedding","groom"],char:"🤵",fitzpatrick_scale:true,category:"people"},running_woman:{keywords:["woman","walking","exercise","race","running","female"],char:"🏃♀️",fitzpatrick_scale:true,category:"people"},running_man:{keywords:["man","walking","exercise","race","running"],char:"🏃",fitzpatrick_scale:true,category:"people"},walking_woman:{keywords:["human","feet","steps","woman","female"],char:"🚶♀️",fitzpatrick_scale:true,category:"people"},walking_man:{keywords:["human","feet","steps"],char:"🚶",fitzpatrick_scale:true,category:"people"},dancer:{keywords:["female","girl","woman","fun"],char:"💃",fitzpatrick_scale:true,category:"people"},man_dancing:{keywords:["male","boy","fun","dancer"],char:"🕺",fitzpatrick_scale:true,category:"people"},dancing_women:{keywords:["female","bunny","women","girls"],char:"👯",fitzpatrick_scale:false,category:"people"},dancing_men:{keywords:["male","bunny","men","boys"],char:"👯♂️",fitzpatrick_scale:false,category:"people"},couple:{keywords:["pair","people","human","love","date","dating","like","affection","valentines","marriage"],char:"👫",fitzpatrick_scale:false,category:"people"},two_men_holding_hands:{keywords:["pair","couple","love","like","bromance","friendship","people","human"],char:"👬",fitzpatrick_scale:false,category:"people"},two_women_holding_hands:{keywords:["pair","friendship","couple","love","like","female","people","human"],char:"👭",fitzpatrick_scale:false,category:"people"},bowing_woman:{keywords:["woman","female","girl"],char:"🙇♀️",fitzpatrick_scale:true,category:"people"},bowing_man:{keywords:["man","male","boy"],char:"🙇",fitzpatrick_scale:true,category:"people"},man_facepalming:{keywords:["man","male","boy","disbelief"],char:"🤦♂️",fitzpatrick_scale:true,category:"people"},woman_facepalming:{keywords:["woman","female","girl","disbelief"],char:"🤦♀️",fitzpatrick_scale:true,category:"people"},woman_shrugging:{keywords:["woman","female","girl","confused","indifferent","doubt"],char:"🤷",fitzpatrick_scale:true,category:"people"},man_shrugging:{keywords:["man","male","boy","confused","indifferent","doubt"],char:"🤷♂️",fitzpatrick_scale:true,category:"people"},tipping_hand_woman:{keywords:["female","girl","woman","human","information"],char:"💁",fitzpatrick_scale:true,category:"people"},tipping_hand_man:{keywords:["male","boy","man","human","information"],char:"💁♂️",fitzpatrick_scale:true,category:"people"},no_good_woman:{keywords:["female","girl","woman","nope"],char:"🙅",fitzpatrick_scale:true,category:"people"},no_good_man:{keywords:["male","boy","man","nope"],char:"🙅♂️",fitzpatrick_scale:true,category:"people"},ok_woman:{keywords:["women","girl","female","pink","human","woman"],char:"🙆",fitzpatrick_scale:true,category:"people"},ok_man:{keywords:["men","boy","male","blue","human","man"],char:"🙆♂️",fitzpatrick_scale:true,category:"people"},raising_hand_woman:{keywords:["female","girl","woman"],char:"🙋",fitzpatrick_scale:true,category:"people"},raising_hand_man:{keywords:["male","boy","man"],char:"🙋♂️",fitzpatrick_scale:true,category:"people"},pouting_woman:{keywords:["female","girl","woman"],char:"🙎",fitzpatrick_scale:true,category:"people"},pouting_man:{keywords:["male","boy","man"],char:"🙎♂️",fitzpatrick_scale:true,category:"people"},frowning_woman:{keywords:["female","girl","woman","sad","depressed","discouraged","unhappy"],char:"🙍",fitzpatrick_scale:true,category:"people"},frowning_man:{keywords:["male","boy","man","sad","depressed","discouraged","unhappy"],char:"🙍♂️",fitzpatrick_scale:true,category:"people"},haircut_woman:{keywords:["female","girl","woman"],char:"💇",fitzpatrick_scale:true,category:"people"},haircut_man:{keywords:["male","boy","man"],char:"💇♂️",fitzpatrick_scale:true,category:"people"},massage_woman:{keywords:["female","girl","woman","head"],char:"💆",fitzpatrick_scale:true,category:"people"},massage_man:{keywords:["male","boy","man","head"],char:"💆♂️",fitzpatrick_scale:true,category:"people"},woman_in_steamy_room:{keywords:["female","woman","spa","steamroom","sauna"],char:"🧖♀️",fitzpatrick_scale:true,category:"people"},man_in_steamy_room:{keywords:["male","man","spa","steamroom","sauna"],char:"🧖♂️",fitzpatrick_scale:true,category:"people"},couple_with_heart_woman_man:{keywords:["pair","love","like","affection","human","dating","valentines","marriage"],char:"💑",fitzpatrick_scale:false,category:"people"},couple_with_heart_woman_woman:{keywords:["pair","love","like","affection","human","dating","valentines","marriage"],char:"👩❤️👩",fitzpatrick_scale:false,category:"people"},couple_with_heart_man_man:{keywords:["pair","love","like","affection","human","dating","valentines","marriage"],char:"👨❤️👨",fitzpatrick_scale:false,category:"people"},couplekiss_man_woman:{keywords:["pair","valentines","love","like","dating","marriage"],char:"💏",fitzpatrick_scale:false,category:"people"},couplekiss_woman_woman:{keywords:["pair","valentines","love","like","dating","marriage"],char:"👩❤️💋👩",fitzpatrick_scale:false,category:"people"},couplekiss_man_man:{keywords:["pair","valentines","love","like","dating","marriage"],char:"👨❤️💋👨",fitzpatrick_scale:false,category:"people"},family_man_woman_boy:{keywords:["home","parents","child","mom","dad","father","mother","people","human"],char:"👪",fitzpatrick_scale:false,category:"people"},family_man_woman_girl:{keywords:["home","parents","people","human","child"],char:"👨👩👧",fitzpatrick_scale:false,category:"people"},family_man_woman_girl_boy:{keywords:["home","parents","people","human","children"],char:"👨👩👧👦",fitzpatrick_scale:false,category:"people"},family_man_woman_boy_boy:{keywords:["home","parents","people","human","children"],char:"👨👩👦👦",fitzpatrick_scale:false,category:"people"},family_man_woman_girl_girl:{keywords:["home","parents","people","human","children"],char:"👨👩👧👧",fitzpatrick_scale:false,category:"people"},family_woman_woman_boy:{keywords:["home","parents","people","human","children"],char:"👩👩👦",fitzpatrick_scale:false,category:"people"},family_woman_woman_girl:{keywords:["home","parents","people","human","children"],char:"👩👩👧",fitzpatrick_scale:false,category:"people"},family_woman_woman_girl_boy:{keywords:["home","parents","people","human","children"],char:"👩👩👧👦",fitzpatrick_scale:false,category:"people"},family_woman_woman_boy_boy:{keywords:["home","parents","people","human","children"],char:"👩👩👦👦",fitzpatrick_scale:false,category:"people"},family_woman_woman_girl_girl:{keywords:["home","parents","people","human","children"],char:"👩👩👧👧",fitzpatrick_scale:false,category:"people"},family_man_man_boy:{keywords:["home","parents","people","human","children"],char:"👨👨👦",fitzpatrick_scale:false,category:"people"},family_man_man_girl:{keywords:["home","parents","people","human","children"],char:"👨👨👧",fitzpatrick_scale:false,category:"people"},family_man_man_girl_boy:{keywords:["home","parents","people","human","children"],char:"👨👨👧👦",fitzpatrick_scale:false,category:"people"},family_man_man_boy_boy:{keywords:["home","parents","people","human","children"],char:"👨👨👦👦",fitzpatrick_scale:false,category:"people"},family_man_man_girl_girl:{keywords:["home","parents","people","human","children"],char:"👨👨👧👧",fitzpatrick_scale:false,category:"people"},family_woman_boy:{keywords:["home","parent","people","human","child"],char:"👩👦",fitzpatrick_scale:false,category:"people"},family_woman_girl:{keywords:["home","parent","people","human","child"],char:"👩👧",fitzpatrick_scale:false,category:"people"},family_woman_girl_boy:{keywords:["home","parent","people","human","children"],char:"👩👧👦",fitzpatrick_scale:false,category:"people"},family_woman_boy_boy:{keywords:["home","parent","people","human","children"],char:"👩👦👦",fitzpatrick_scale:false,category:"people"},family_woman_girl_girl:{keywords:["home","parent","people","human","children"],char:"👩👧👧",fitzpatrick_scale:false,category:"people"},family_man_boy:{keywords:["home","parent","people","human","child"],char:"👨👦",fitzpatrick_scale:false,category:"people"},family_man_girl:{keywords:["home","parent","people","human","child"],char:"👨👧",fitzpatrick_scale:false,category:"people"},family_man_girl_boy:{keywords:["home","parent","people","human","children"],char:"👨👧👦",fitzpatrick_scale:false,category:"people"},family_man_boy_boy:{keywords:["home","parent","people","human","children"],char:"👨👦👦",fitzpatrick_scale:false,category:"people"},family_man_girl_girl:{keywords:["home","parent","people","human","children"],char:"👨👧👧",fitzpatrick_scale:false,category:"people"},yarn:{keywords:["ball","crochet","knit"],char:"🧶",fitzpatrick_scale:false,category:"people"},thread:{keywords:["needle","sewing","spool","string"],char:"🧵",fitzpatrick_scale:false,category:"people"},coat:{keywords:["jacket"],char:"🧥",fitzpatrick_scale:false,category:"people"},labcoat:{keywords:["doctor","experiment","scientist","chemist"],char:"🥼",fitzpatrick_scale:false,category:"people"},womans_clothes:{keywords:["fashion","shopping_bags","female"],char:"👚",fitzpatrick_scale:false,category:"people"},tshirt:{keywords:["fashion","cloth","casual","shirt","tee"],char:"👕",fitzpatrick_scale:false,category:"people"},jeans:{keywords:["fashion","shopping"],char:"👖",fitzpatrick_scale:false,category:"people"},necktie:{keywords:["shirt","suitup","formal","fashion","cloth","business"],char:"👔",fitzpatrick_scale:false,category:"people"},dress:{keywords:["clothes","fashion","shopping"],char:"👗",fitzpatrick_scale:false,category:"people"},bikini:{keywords:["swimming","female","woman","girl","fashion","beach","summer"],char:"👙",fitzpatrick_scale:false,category:"people"},kimono:{keywords:["dress","fashion","women","female","japanese"],char:"👘",fitzpatrick_scale:false,category:"people"},lipstick:{keywords:["female","girl","fashion","woman"],char:"💄",fitzpatrick_scale:false,category:"people"},kiss:{keywords:["face","lips","love","like","affection","valentines"],char:"💋",fitzpatrick_scale:false,category:"people"},footprints:{keywords:["feet","tracking","walking","beach"],char:"👣",fitzpatrick_scale:false,category:"people"},flat_shoe:{keywords:["ballet","slip-on","slipper"],char:"🥿",fitzpatrick_scale:false,category:"people"},high_heel:{keywords:["fashion","shoes","female","pumps","stiletto"],char:"👠",fitzpatrick_scale:false,category:"people"},sandal:{keywords:["shoes","fashion","flip flops"],char:"👡",fitzpatrick_scale:false,category:"people"},boot:{keywords:["shoes","fashion"],char:"👢",fitzpatrick_scale:false,category:"people"},mans_shoe:{keywords:["fashion","male"],char:"👞",fitzpatrick_scale:false,category:"people"},athletic_shoe:{keywords:["shoes","sports","sneakers"],char:"👟",fitzpatrick_scale:false,category:"people"},hiking_boot:{keywords:["backpacking","camping","hiking"],char:"🥾",fitzpatrick_scale:false,category:"people"},socks:{keywords:["stockings","clothes"],char:"🧦",fitzpatrick_scale:false,category:"people"},gloves:{keywords:["hands","winter","clothes"],char:"🧤",fitzpatrick_scale:false,category:"people"},scarf:{keywords:["neck","winter","clothes"],char:"🧣",fitzpatrick_scale:false,category:"people"},womans_hat:{keywords:["fashion","accessories","female","lady","spring"],char:"👒",fitzpatrick_scale:false,category:"people"},tophat:{keywords:["magic","gentleman","classy","circus"],char:"🎩",fitzpatrick_scale:false,category:"people"},billed_hat:{keywords:["cap","baseball"],char:"🧢",fitzpatrick_scale:false,category:"people"},rescue_worker_helmet:{keywords:["construction","build"],char:"⛑",fitzpatrick_scale:false,category:"people"},mortar_board:{keywords:["school","college","degree","university","graduation","cap","hat","legal","learn","education"],char:"🎓",fitzpatrick_scale:false,category:"people"},crown:{keywords:["king","kod","leader","royalty","lord"],char:"👑",fitzpatrick_scale:false,category:"people"},school_satchel:{keywords:["student","education","bag","backpack"],char:"🎒",fitzpatrick_scale:false,category:"people"},luggage:{keywords:["packing","travel"],char:"🧳",fitzpatrick_scale:false,category:"people"},pouch:{keywords:["bag","accessories","shopping"],char:"👝",fitzpatrick_scale:false,category:"people"},purse:{keywords:["fashion","accessories","money","sales","shopping"],char:"👛",fitzpatrick_scale:false,category:"people"},handbag:{keywords:["fashion","accessory","accessories","shopping"],char:"👜",fitzpatrick_scale:false,category:"people"},briefcase:{keywords:["business","documents","work","law","legal","job","career"],char:"💼",fitzpatrick_scale:false,category:"people"},eyeglasses:{keywords:["fashion","accessories","eyesight","nerdy","dork","geek"],char:"👓",fitzpatrick_scale:false,category:"people"},dark_sunglasses:{keywords:["face","cool","accessories"],char:"🕶",fitzpatrick_scale:false,category:"people"},goggles:{keywords:["eyes","protection","safety"],char:"🥽",fitzpatrick_scale:false,category:"people"},ring:{keywords:["wedding","propose","marriage","valentines","diamond","fashion","jewelry","gem","engagement"],char:"💍",fitzpatrick_scale:false,category:"people"},closed_umbrella:{keywords:["weather","rain","drizzle"],char:"🌂",fitzpatrick_scale:false,category:"people"},dog:{keywords:["animal","friend","nature","woof","puppy","pet","faithful"],char:"🐶",fitzpatrick_scale:false,category:"animals_and_nature"},cat:{keywords:["animal","meow","nature","pet","kitten"],char:"🐱",fitzpatrick_scale:false,category:"animals_and_nature"},mouse:{keywords:["animal","nature","cheese_wedge","rodent"],char:"🐭",fitzpatrick_scale:false,category:"animals_and_nature"},hamster:{keywords:["animal","nature"],char:"🐹",fitzpatrick_scale:false,category:"animals_and_nature"},rabbit:{keywords:["animal","nature","pet","spring","magic","bunny"],char:"🐰",fitzpatrick_scale:false,category:"animals_and_nature"},fox_face:{keywords:["animal","nature","face"],char:"🦊",fitzpatrick_scale:false,category:"animals_and_nature"},bear:{keywords:["animal","nature","wild"],char:"🐻",fitzpatrick_scale:false,category:"animals_and_nature"},panda_face:{keywords:["animal","nature","panda"],char:"🐼",fitzpatrick_scale:false,category:"animals_and_nature"},koala:{keywords:["animal","nature"],char:"🐨",fitzpatrick_scale:false,category:"animals_and_nature"},tiger:{keywords:["animal","cat","danger","wild","nature","roar"],char:"🐯",fitzpatrick_scale:false,category:"animals_and_nature"},lion:{keywords:["animal","nature"],char:"🦁",fitzpatrick_scale:false,category:"animals_and_nature"},cow:{keywords:["beef","ox","animal","nature","moo","milk"],char:"🐮",fitzpatrick_scale:false,category:"animals_and_nature"},pig:{keywords:["animal","oink","nature"],char:"🐷",fitzpatrick_scale:false,category:"animals_and_nature"},pig_nose:{keywords:["animal","oink"],char:"🐽",fitzpatrick_scale:false,category:"animals_and_nature"},frog:{keywords:["animal","nature","croak","toad"],char:"🐸",fitzpatrick_scale:false,category:"animals_and_nature"},squid:{keywords:["animal","nature","ocean","sea"],char:"🦑",fitzpatrick_scale:false,category:"animals_and_nature"},octopus:{keywords:["animal","creature","ocean","sea","nature","beach"],char:"🐙",fitzpatrick_scale:false,category:"animals_and_nature"},shrimp:{keywords:["animal","ocean","nature","seafood"],char:"🦐",fitzpatrick_scale:false,category:"animals_and_nature"},monkey_face:{keywords:["animal","nature","circus"],char:"🐵",fitzpatrick_scale:false,category:"animals_and_nature"},gorilla:{keywords:["animal","nature","circus"],char:"🦍",fitzpatrick_scale:false,category:"animals_and_nature"},see_no_evil:{keywords:["monkey","animal","nature","haha"],char:"🙈",fitzpatrick_scale:false,category:"animals_and_nature"},hear_no_evil:{keywords:["animal","monkey","nature"],char:"🙉",fitzpatrick_scale:false,category:"animals_and_nature"},speak_no_evil:{keywords:["monkey","animal","nature","omg"],char:"🙊",fitzpatrick_scale:false,category:"animals_and_nature"},monkey:{keywords:["animal","nature","banana","circus"],char:"🐒",fitzpatrick_scale:false,category:"animals_and_nature"},chicken:{keywords:["animal","cluck","nature","bird"],char:"🐔",fitzpatrick_scale:false,category:"animals_and_nature"},penguin:{keywords:["animal","nature"],char:"🐧",fitzpatrick_scale:false,category:"animals_and_nature"},bird:{keywords:["animal","nature","fly","tweet","spring"],char:"🐦",fitzpatrick_scale:false,category:"animals_and_nature"},baby_chick:{keywords:["animal","chicken","bird"],char:"🐤",fitzpatrick_scale:false,category:"animals_and_nature"},hatching_chick:{keywords:["animal","chicken","egg","born","baby","bird"],char:"🐣",fitzpatrick_scale:false,category:"animals_and_nature"},hatched_chick:{keywords:["animal","chicken","baby","bird"],char:"🐥",fitzpatrick_scale:false,category:"animals_and_nature"},duck:{keywords:["animal","nature","bird","mallard"],char:"🦆",fitzpatrick_scale:false,category:"animals_and_nature"},eagle:{keywords:["animal","nature","bird"],char:"🦅",fitzpatrick_scale:false,category:"animals_and_nature"},owl:{keywords:["animal","nature","bird","hoot"],char:"🦉",fitzpatrick_scale:false,category:"animals_and_nature"},bat:{keywords:["animal","nature","blind","vampire"],char:"🦇",fitzpatrick_scale:false,category:"animals_and_nature"},wolf:{keywords:["animal","nature","wild"],char:"🐺",fitzpatrick_scale:false,category:"animals_and_nature"},boar:{keywords:["animal","nature"],char:"🐗",fitzpatrick_scale:false,category:"animals_and_nature"},horse:{keywords:["animal","brown","nature"],char:"🐴",fitzpatrick_scale:false,category:"animals_and_nature"},unicorn:{keywords:["animal","nature","mystical"],char:"🦄",fitzpatrick_scale:false,category:"animals_and_nature"},honeybee:{keywords:["animal","insect","nature","bug","spring","honey"],char:"🐝",fitzpatrick_scale:false,category:"animals_and_nature"},bug:{keywords:["animal","insect","nature","worm"],char:"🐛",fitzpatrick_scale:false,category:"animals_and_nature"},butterfly:{keywords:["animal","insect","nature","caterpillar"],char:"🦋",fitzpatrick_scale:false,category:"animals_and_nature"},snail:{keywords:["slow","animal","shell"],char:"🐌",fitzpatrick_scale:false,category:"animals_and_nature"},beetle:{keywords:["animal","insect","nature","ladybug"],char:"🐞",fitzpatrick_scale:false,category:"animals_and_nature"},ant:{keywords:["animal","insect","nature","bug"],char:"🐜",fitzpatrick_scale:false,category:"animals_and_nature"},grasshopper:{keywords:["animal","cricket","chirp"],char:"🦗",fitzpatrick_scale:false,category:"animals_and_nature"},spider:{keywords:["animal","arachnid"],char:"🕷",fitzpatrick_scale:false,category:"animals_and_nature"},scorpion:{keywords:["animal","arachnid"],char:"🦂",fitzpatrick_scale:false,category:"animals_and_nature"},crab:{keywords:["animal","crustacean"],char:"🦀",fitzpatrick_scale:false,category:"animals_and_nature"},snake:{keywords:["animal","evil","nature","hiss","python"],char:"🐍",fitzpatrick_scale:false,category:"animals_and_nature"},lizard:{keywords:["animal","nature","reptile"],char:"🦎",fitzpatrick_scale:false,category:"animals_and_nature"},"t-rex":{keywords:["animal","nature","dinosaur","tyrannosaurus","extinct"],char:"🦖",fitzpatrick_scale:false,category:"animals_and_nature"},sauropod:{keywords:["animal","nature","dinosaur","brachiosaurus","brontosaurus","diplodocus","extinct"],char:"🦕",fitzpatrick_scale:false,category:"animals_and_nature"},turtle:{keywords:["animal","slow","nature","tortoise"],char:"🐢",fitzpatrick_scale:false,category:"animals_and_nature"},tropical_fish:{keywords:["animal","swim","ocean","beach","nemo"],char:"🐠",fitzpatrick_scale:false,category:"animals_and_nature"},fish:{keywords:["animal","food","nature"],char:"🐟",fitzpatrick_scale:false,category:"animals_and_nature"},blowfish:{keywords:["animal","nature","food","sea","ocean"],char:"🐡",fitzpatrick_scale:false,category:"animals_and_nature"},dolphin:{keywords:["animal","nature","fish","sea","ocean","flipper","fins","beach"],char:"🐬",fitzpatrick_scale:false,category:"animals_and_nature"},shark:{keywords:["animal","nature","fish","sea","ocean","jaws","fins","beach"],char:"🦈",fitzpatrick_scale:false,category:"animals_and_nature"},whale:{keywords:["animal","nature","sea","ocean"],char:"🐳",fitzpatrick_scale:false,category:"animals_and_nature"},whale2:{keywords:["animal","nature","sea","ocean"],char:"🐋",fitzpatrick_scale:false,category:"animals_and_nature"},crocodile:{keywords:["animal","nature","reptile","lizard","alligator"],char:"🐊",fitzpatrick_scale:false,category:"animals_and_nature"},leopard:{keywords:["animal","nature"],char:"🐆",fitzpatrick_scale:false,category:"animals_and_nature"},zebra:{keywords:["animal","nature","stripes","safari"],char:"🦓",fitzpatrick_scale:false,category:"animals_and_nature"},tiger2:{keywords:["animal","nature","roar"],char:"🐅",fitzpatrick_scale:false,category:"animals_and_nature"},water_buffalo:{keywords:["animal","nature","ox","cow"],char:"🐃",fitzpatrick_scale:false,category:"animals_and_nature"},ox:{keywords:["animal","cow","beef"],char:"🐂",fitzpatrick_scale:false,category:"animals_and_nature"},cow2:{keywords:["beef","ox","animal","nature","moo","milk"],char:"🐄",fitzpatrick_scale:false,category:"animals_and_nature"},deer:{keywords:["animal","nature","horns","venison"],char:"🦌",fitzpatrick_scale:false,category:"animals_and_nature"},dromedary_camel:{keywords:["animal","hot","desert","hump"],char:"🐪",fitzpatrick_scale:false,category:"animals_and_nature"},camel:{keywords:["animal","nature","hot","desert","hump"],char:"🐫",fitzpatrick_scale:false,category:"animals_and_nature"},giraffe:{keywords:["animal","nature","spots","safari"],char:"🦒",fitzpatrick_scale:false,category:"animals_and_nature"},elephant:{keywords:["animal","nature","nose","th","circus"],char:"🐘",fitzpatrick_scale:false,category:"animals_and_nature"},rhinoceros:{keywords:["animal","nature","horn"],char:"🦏",fitzpatrick_scale:false,category:"animals_and_nature"},goat:{keywords:["animal","nature"],char:"🐐",fitzpatrick_scale:false,category:"animals_and_nature"},ram:{keywords:["animal","sheep","nature"],char:"🐏",fitzpatrick_scale:false,category:"animals_and_nature"},sheep:{keywords:["animal","nature","wool","shipit"],char:"🐑",fitzpatrick_scale:false,category:"animals_and_nature"},racehorse:{keywords:["animal","gamble","luck"],char:"🐎",fitzpatrick_scale:false,category:"animals_and_nature"},pig2:{keywords:["animal","nature"],char:"🐖",fitzpatrick_scale:false,category:"animals_and_nature"},rat:{keywords:["animal","mouse","rodent"],char:"🐀",fitzpatrick_scale:false,category:"animals_and_nature"},mouse2:{keywords:["animal","nature","rodent"],char:"🐁",fitzpatrick_scale:false,category:"animals_and_nature"},rooster:{keywords:["animal","nature","chicken"],char:"🐓",fitzpatrick_scale:false,category:"animals_and_nature"},turkey:{keywords:["animal","bird"],char:"🦃",fitzpatrick_scale:false,category:"animals_and_nature"},dove:{keywords:["animal","bird"],char:"🕊",fitzpatrick_scale:false,category:"animals_and_nature"},dog2:{keywords:["animal","nature","friend","doge","pet","faithful"],char:"🐕",fitzpatrick_scale:false,category:"animals_and_nature"},poodle:{keywords:["dog","animal","101","nature","pet"],char:"🐩",fitzpatrick_scale:false,category:"animals_and_nature"},cat2:{keywords:["animal","meow","pet","cats"],char:"🐈",fitzpatrick_scale:false,category:"animals_and_nature"},rabbit2:{keywords:["animal","nature","pet","magic","spring"],char:"🐇",fitzpatrick_scale:false,category:"animals_and_nature"},chipmunk:{keywords:["animal","nature","rodent","squirrel"],char:"🐿",fitzpatrick_scale:false,category:"animals_and_nature"},hedgehog:{keywords:["animal","nature","spiny"],char:"🦔",fitzpatrick_scale:false,category:"animals_and_nature"},raccoon:{keywords:["animal","nature"],char:"🦝",fitzpatrick_scale:false,category:"animals_and_nature"},llama:{keywords:["animal","nature","alpaca"],char:"🦙",fitzpatrick_scale:false,category:"animals_and_nature"},hippopotamus:{keywords:["animal","nature"],char:"🦛",fitzpatrick_scale:false,category:"animals_and_nature"},kangaroo:{keywords:["animal","nature","australia","joey","hop","marsupial"],char:"🦘",fitzpatrick_scale:false,category:"animals_and_nature"},badger:{keywords:["animal","nature","honey"],char:"🦡",fitzpatrick_scale:false,category:"animals_and_nature"},swan:{keywords:["animal","nature","bird"],char:"🦢",fitzpatrick_scale:false,category:"animals_and_nature"},peacock:{keywords:["animal","nature","peahen","bird"],char:"🦚",fitzpatrick_scale:false,category:"animals_and_nature"},parrot:{keywords:["animal","nature","bird","pirate","talk"],char:"🦜",fitzpatrick_scale:false,category:"animals_and_nature"},lobster:{keywords:["animal","nature","bisque","claws","seafood"],char:"🦞",fitzpatrick_scale:false,category:"animals_and_nature"},mosquito:{keywords:["animal","nature","insect","malaria"],char:"🦟",fitzpatrick_scale:false,category:"animals_and_nature"},paw_prints:{keywords:["animal","tracking","footprints","dog","cat","pet","feet"],char:"🐾",fitzpatrick_scale:false,category:"animals_and_nature"},dragon:{keywords:["animal","myth","nature","chinese","green"],char:"🐉",fitzpatrick_scale:false,category:"animals_and_nature"},dragon_face:{keywords:["animal","myth","nature","chinese","green"],char:"🐲",fitzpatrick_scale:false,category:"animals_and_nature"},cactus:{keywords:["vegetable","plant","nature"],char:"🌵",fitzpatrick_scale:false,category:"animals_and_nature"},christmas_tree:{keywords:["festival","vacation","december","xmas","celebration"],char:"🎄",fitzpatrick_scale:false,category:"animals_and_nature"},evergreen_tree:{keywords:["plant","nature"],char:"🌲",fitzpatrick_scale:false,category:"animals_and_nature"},deciduous_tree:{keywords:["plant","nature"],char:"🌳",fitzpatrick_scale:false,category:"animals_and_nature"},palm_tree:{keywords:["plant","vegetable","nature","summer","beach","mojito","tropical"],char:"🌴",fitzpatrick_scale:false,category:"animals_and_nature"},seedling:{keywords:["plant","nature","grass","lawn","spring"],char:"🌱",fitzpatrick_scale:false,category:"animals_and_nature"},herb:{keywords:["vegetable","plant","medicine","weed","grass","lawn"],char:"🌿",fitzpatrick_scale:false,category:"animals_and_nature"},shamrock:{keywords:["vegetable","plant","nature","irish","clover"],char:"☘",fitzpatrick_scale:false,category:"animals_and_nature"},four_leaf_clover:{keywords:["vegetable","plant","nature","lucky","irish"],char:"🍀",fitzpatrick_scale:false,category:"animals_and_nature"},bamboo:{keywords:["plant","nature","vegetable","panda","pine_decoration"],char:"🎍",fitzpatrick_scale:false,category:"animals_and_nature"},tanabata_tree:{keywords:["plant","nature","branch","summer"],char:"🎋",fitzpatrick_scale:false,category:"animals_and_nature"},leaves:{keywords:["nature","plant","tree","vegetable","grass","lawn","spring"],char:"🍃",fitzpatrick_scale:false,category:"animals_and_nature"},fallen_leaf:{keywords:["nature","plant","vegetable","leaves"],char:"🍂",fitzpatrick_scale:false,category:"animals_and_nature"},maple_leaf:{keywords:["nature","plant","vegetable","ca","fall"],char:"🍁",fitzpatrick_scale:false,category:"animals_and_nature"},ear_of_rice:{keywords:["nature","plant"],char:"🌾",fitzpatrick_scale:false,category:"animals_and_nature"},hibiscus:{keywords:["plant","vegetable","flowers","beach"],char:"🌺",fitzpatrick_scale:false,category:"animals_and_nature"},sunflower:{keywords:["nature","plant","fall"],char:"🌻",fitzpatrick_scale:false,category:"animals_and_nature"},rose:{keywords:["flowers","valentines","love","spring"],char:"🌹",fitzpatrick_scale:false,category:"animals_and_nature"},wilted_flower:{keywords:["plant","nature","flower"],char:"🥀",fitzpatrick_scale:false,category:"animals_and_nature"},tulip:{keywords:["flowers","plant","nature","summer","spring"],char:"🌷",fitzpatrick_scale:false,category:"animals_and_nature"},blossom:{keywords:["nature","flowers","yellow"],char:"🌼",fitzpatrick_scale:false,category:"animals_and_nature"},cherry_blossom:{keywords:["nature","plant","spring","flower"],char:"🌸",fitzpatrick_scale:false,category:"animals_and_nature"},bouquet:{keywords:["flowers","nature","spring"],char:"💐",fitzpatrick_scale:false,category:"animals_and_nature"},mushroom:{keywords:["plant","vegetable"],char:"🍄",fitzpatrick_scale:false,category:"animals_and_nature"},chestnut:{keywords:["food","squirrel"],char:"🌰",fitzpatrick_scale:false,category:"animals_and_nature"},jack_o_lantern:{keywords:["halloween","light","pumpkin","creepy","fall"],char:"🎃",fitzpatrick_scale:false,category:"animals_and_nature"},shell:{keywords:["nature","sea","beach"],char:"🐚",fitzpatrick_scale:false,category:"animals_and_nature"},spider_web:{keywords:["animal","insect","arachnid","silk"],char:"🕸",fitzpatrick_scale:false,category:"animals_and_nature"},earth_americas:{keywords:["globe","world","USA","international"],char:"🌎",fitzpatrick_scale:false,category:"animals_and_nature"},earth_africa:{keywords:["globe","world","international"],char:"🌍",fitzpatrick_scale:false,category:"animals_and_nature"},earth_asia:{keywords:["globe","world","east","international"],char:"🌏",fitzpatrick_scale:false,category:"animals_and_nature"},full_moon:{keywords:["nature","yellow","twilight","planet","space","night","evening","sleep"],char:"🌕",fitzpatrick_scale:false,category:"animals_and_nature"},waning_gibbous_moon:{keywords:["nature","twilight","planet","space","night","evening","sleep","waxing_gibbous_moon"],char:"🌖",fitzpatrick_scale:false,category:"animals_and_nature"},last_quarter_moon:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌗",fitzpatrick_scale:false,category:"animals_and_nature"},waning_crescent_moon:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌘",fitzpatrick_scale:false,category:"animals_and_nature"},new_moon:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌑",fitzpatrick_scale:false,category:"animals_and_nature"},waxing_crescent_moon:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌒",fitzpatrick_scale:false,category:"animals_and_nature"},first_quarter_moon:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌓",fitzpatrick_scale:false,category:"animals_and_nature"},waxing_gibbous_moon:{keywords:["nature","night","sky","gray","twilight","planet","space","evening","sleep"],char:"🌔",fitzpatrick_scale:false,category:"animals_and_nature"},new_moon_with_face:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌚",fitzpatrick_scale:false,category:"animals_and_nature"},full_moon_with_face:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌝",fitzpatrick_scale:false,category:"animals_and_nature"},first_quarter_moon_with_face:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌛",fitzpatrick_scale:false,category:"animals_and_nature"},last_quarter_moon_with_face:{keywords:["nature","twilight","planet","space","night","evening","sleep"],char:"🌜",fitzpatrick_scale:false,category:"animals_and_nature"},sun_with_face:{keywords:["nature","morning","sky"],char:"🌞",fitzpatrick_scale:false,category:"animals_and_nature"},crescent_moon:{keywords:["night","sleep","sky","evening","magic"],char:"🌙",fitzpatrick_scale:false,category:"animals_and_nature"},star:{keywords:["night","yellow"],char:"⭐",fitzpatrick_scale:false,category:"animals_and_nature"},star2:{keywords:["night","sparkle","awesome","good","magic"],char:"🌟",fitzpatrick_scale:false,category:"animals_and_nature"},dizzy:{keywords:["star","sparkle","shoot","magic"],char:"💫",fitzpatrick_scale:false,category:"animals_and_nature"},sparkles:{keywords:["stars","shine","shiny","cool","awesome","good","magic"],char:"✨",fitzpatrick_scale:false,category:"animals_and_nature"},comet:{keywords:["space"],char:"☄",fitzpatrick_scale:false,category:"animals_and_nature"},sunny:{keywords:["weather","nature","brightness","summer","beach","spring"],char:"☀️",fitzpatrick_scale:false,category:"animals_and_nature"},sun_behind_small_cloud:{keywords:["weather"],char:"🌤",fitzpatrick_scale:false,category:"animals_and_nature"},partly_sunny:{keywords:["weather","nature","cloudy","morning","fall","spring"],char:"⛅",fitzpatrick_scale:false,category:"animals_and_nature"},sun_behind_large_cloud:{keywords:["weather"],char:"🌥",fitzpatrick_scale:false,category:"animals_and_nature"},sun_behind_rain_cloud:{keywords:["weather"],char:"🌦",fitzpatrick_scale:false,category:"animals_and_nature"},cloud:{keywords:["weather","sky"],char:"☁️",fitzpatrick_scale:false,category:"animals_and_nature"},cloud_with_rain:{keywords:["weather"],char:"🌧",fitzpatrick_scale:false,category:"animals_and_nature"},cloud_with_lightning_and_rain:{keywords:["weather","lightning"],char:"⛈",fitzpatrick_scale:false,category:"animals_and_nature"},cloud_with_lightning:{keywords:["weather","thunder"],char:"🌩",fitzpatrick_scale:false,category:"animals_and_nature"},zap:{keywords:["thunder","weather","lightning bolt","fast"],char:"⚡",fitzpatrick_scale:false,category:"animals_and_nature"},fire:{keywords:["hot","cook","flame"],char:"🔥",fitzpatrick_scale:false,category:"animals_and_nature"},boom:{keywords:["bomb","explode","explosion","collision","blown"],char:"💥",fitzpatrick_scale:false,category:"animals_and_nature"},snowflake:{keywords:["winter","season","cold","weather","christmas","xmas"],char:"❄️",fitzpatrick_scale:false,category:"animals_and_nature"},cloud_with_snow:{keywords:["weather"],char:"🌨",fitzpatrick_scale:false,category:"animals_and_nature"},snowman:{keywords:["winter","season","cold","weather","christmas","xmas","frozen","without_snow"],char:"⛄",fitzpatrick_scale:false,category:"animals_and_nature"},snowman_with_snow:{keywords:["winter","season","cold","weather","christmas","xmas","frozen"],char:"☃",fitzpatrick_scale:false,category:"animals_and_nature"},wind_face:{keywords:["gust","air"],char:"🌬",fitzpatrick_scale:false,category:"animals_and_nature"},dash:{keywords:["wind","air","fast","shoo","fart","smoke","puff"],char:"💨",fitzpatrick_scale:false,category:"animals_and_nature"},tornado:{keywords:["weather","cyclone","twister"],char:"🌪",fitzpatrick_scale:false,category:"animals_and_nature"},fog:{keywords:["weather"],char:"🌫",fitzpatrick_scale:false,category:"animals_and_nature"},open_umbrella:{keywords:["weather","spring"],char:"☂",fitzpatrick_scale:false,category:"animals_and_nature"},umbrella:{keywords:["rainy","weather","spring"],char:"☔",fitzpatrick_scale:false,category:"animals_and_nature"},droplet:{keywords:["water","drip","faucet","spring"],char:"💧",fitzpatrick_scale:false,category:"animals_and_nature"},sweat_drops:{keywords:["water","drip","oops"],char:"💦",fitzpatrick_scale:false,category:"animals_and_nature"},ocean:{keywords:["sea","water","wave","nature","tsunami","disaster"],char:"🌊",fitzpatrick_scale:false,category:"animals_and_nature"},green_apple:{keywords:["fruit","nature"],char:"🍏",fitzpatrick_scale:false,category:"food_and_drink"},apple:{keywords:["fruit","mac","school"],char:"🍎",fitzpatrick_scale:false,category:"food_and_drink"},pear:{keywords:["fruit","nature","food"],char:"🍐",fitzpatrick_scale:false,category:"food_and_drink"},tangerine:{keywords:["food","fruit","nature","orange"],char:"🍊",fitzpatrick_scale:false,category:"food_and_drink"},lemon:{keywords:["fruit","nature"],char:"🍋",fitzpatrick_scale:false,category:"food_and_drink"},banana:{keywords:["fruit","food","monkey"],char:"🍌",fitzpatrick_scale:false,category:"food_and_drink"},watermelon:{keywords:["fruit","food","picnic","summer"],char:"🍉",fitzpatrick_scale:false,category:"food_and_drink"},grapes:{keywords:["fruit","food","wine"],char:"🍇",fitzpatrick_scale:false,category:"food_and_drink"},strawberry:{keywords:["fruit","food","nature"],char:"🍓",fitzpatrick_scale:false,category:"food_and_drink"},melon:{keywords:["fruit","nature","food"],char:"🍈",fitzpatrick_scale:false,category:"food_and_drink"},cherries:{keywords:["food","fruit"],char:"🍒",fitzpatrick_scale:false,category:"food_and_drink"},peach:{keywords:["fruit","nature","food"],char:"🍑",fitzpatrick_scale:false,category:"food_and_drink"},pineapple:{keywords:["fruit","nature","food"],char:"🍍",fitzpatrick_scale:false,category:"food_and_drink"},coconut:{keywords:["fruit","nature","food","palm"],char:"🥥",fitzpatrick_scale:false,category:"food_and_drink"},kiwi_fruit:{keywords:["fruit","food"],char:"🥝",fitzpatrick_scale:false,category:"food_and_drink"},mango:{keywords:["fruit","food","tropical"],char:"🥭",fitzpatrick_scale:false,category:"food_and_drink"},avocado:{keywords:["fruit","food"],char:"🥑",fitzpatrick_scale:false,category:"food_and_drink"},broccoli:{keywords:["fruit","food","vegetable"],char:"🥦",fitzpatrick_scale:false,category:"food_and_drink"},tomato:{keywords:["fruit","vegetable","nature","food"],char:"🍅",fitzpatrick_scale:false,category:"food_and_drink"},eggplant:{keywords:["vegetable","nature","food","aubergine"],char:"🍆",fitzpatrick_scale:false,category:"food_and_drink"},cucumber:{keywords:["fruit","food","pickle"],char:"🥒",fitzpatrick_scale:false,category:"food_and_drink"},carrot:{keywords:["vegetable","food","orange"],char:"🥕",fitzpatrick_scale:false,category:"food_and_drink"},hot_pepper:{keywords:["food","spicy","chilli","chili"],char:"🌶",fitzpatrick_scale:false,category:"food_and_drink"},potato:{keywords:["food","tuber","vegatable","starch"],char:"🥔",fitzpatrick_scale:false,category:"food_and_drink"},corn:{keywords:["food","vegetable","plant"],char:"🌽",fitzpatrick_scale:false,category:"food_and_drink"},leafy_greens:{keywords:["food","vegetable","plant","bok choy","cabbage","kale","lettuce"],char:"🥬",fitzpatrick_scale:false,category:"food_and_drink"},sweet_potato:{keywords:["food","nature"],char:"🍠",fitzpatrick_scale:false,category:"food_and_drink"},peanuts:{keywords:["food","nut"],char:"🥜",fitzpatrick_scale:false,category:"food_and_drink"},honey_pot:{keywords:["bees","sweet","kitchen"],char:"🍯",fitzpatrick_scale:false,category:"food_and_drink"},croissant:{keywords:["food","bread","french"],char:"🥐",fitzpatrick_scale:false,category:"food_and_drink"},bread:{keywords:["food","wheat","breakfast","toast"],char:"🍞",fitzpatrick_scale:false,category:"food_and_drink"},baguette_bread:{keywords:["food","bread","french"],char:"🥖",fitzpatrick_scale:false,category:"food_and_drink"},bagel:{keywords:["food","bread","bakery","schmear"],char:"🥯",fitzpatrick_scale:false,category:"food_and_drink"},pretzel:{keywords:["food","bread","twisted"],char:"🥨",fitzpatrick_scale:false,category:"food_and_drink"},cheese:{keywords:["food","chadder"],char:"🧀",fitzpatrick_scale:false,category:"food_and_drink"},egg:{keywords:["food","chicken","breakfast"],char:"🥚",fitzpatrick_scale:false,category:"food_and_drink"},bacon:{keywords:["food","breakfast","pork","pig","meat"],char:"🥓",fitzpatrick_scale:false,category:"food_and_drink"},steak:{keywords:["food","cow","meat","cut","chop","lambchop","porkchop"],char:"🥩",fitzpatrick_scale:false,category:"food_and_drink"},pancakes:{keywords:["food","breakfast","flapjacks","hotcakes"],char:"🥞",fitzpatrick_scale:false,category:"food_and_drink"},poultry_leg:{keywords:["food","meat","drumstick","bird","chicken","turkey"],char:"🍗",fitzpatrick_scale:false,category:"food_and_drink"},meat_on_bone:{keywords:["good","food","drumstick"],char:"🍖",fitzpatrick_scale:false,category:"food_and_drink"},bone:{keywords:["skeleton"],char:"🦴",fitzpatrick_scale:false,category:"food_and_drink"},fried_shrimp:{keywords:["food","animal","appetizer","summer"],char:"🍤",fitzpatrick_scale:false,category:"food_and_drink"},fried_egg:{keywords:["food","breakfast","kitchen","egg"],char:"🍳",fitzpatrick_scale:false,category:"food_and_drink"},hamburger:{keywords:["meat","fast food","beef","cheeseburger","mcdonalds","burger king"],char:"🍔",fitzpatrick_scale:false,category:"food_and_drink"},fries:{keywords:["chips","snack","fast food"],char:"🍟",fitzpatrick_scale:false,category:"food_and_drink"},stuffed_flatbread:{keywords:["food","flatbread","stuffed","gyro"],char:"🥙",fitzpatrick_scale:false,category:"food_and_drink"},hotdog:{keywords:["food","frankfurter"],char:"🌭",fitzpatrick_scale:false,category:"food_and_drink"},pizza:{keywords:["food","party"],char:"🍕",fitzpatrick_scale:false,category:"food_and_drink"},sandwich:{keywords:["food","lunch","bread"],char:"🥪",fitzpatrick_scale:false,category:"food_and_drink"},canned_food:{keywords:["food","soup"],char:"🥫",fitzpatrick_scale:false,category:"food_and_drink"},spaghetti:{keywords:["food","italian","noodle"],char:"🍝",fitzpatrick_scale:false,category:"food_and_drink"},taco:{keywords:["food","mexican"],char:"🌮",fitzpatrick_scale:false,category:"food_and_drink"},burrito:{keywords:["food","mexican"],char:"🌯",fitzpatrick_scale:false,category:"food_and_drink"},green_salad:{keywords:["food","healthy","lettuce"],char:"🥗",fitzpatrick_scale:false,category:"food_and_drink"},shallow_pan_of_food:{keywords:["food","cooking","casserole","paella"],char:"🥘",fitzpatrick_scale:false,category:"food_and_drink"},ramen:{keywords:["food","japanese","noodle","chopsticks"],char:"🍜",fitzpatrick_scale:false,category:"food_and_drink"},stew:{keywords:["food","meat","soup"],char:"🍲",fitzpatrick_scale:false,category:"food_and_drink"},fish_cake:{keywords:["food","japan","sea","beach","narutomaki","pink","swirl","kamaboko","surimi","ramen"],char:"🍥",fitzpatrick_scale:false,category:"food_and_drink"},fortune_cookie:{keywords:["food","prophecy"],char:"🥠",fitzpatrick_scale:false,category:"food_and_drink"},sushi:{keywords:["food","fish","japanese","rice"],char:"🍣",fitzpatrick_scale:false,category:"food_and_drink"},bento:{keywords:["food","japanese","box"],char:"🍱",fitzpatrick_scale:false,category:"food_and_drink"},curry:{keywords:["food","spicy","hot","indian"],char:"🍛",fitzpatrick_scale:false,category:"food_and_drink"},rice_ball:{keywords:["food","japanese"],char:"🍙",fitzpatrick_scale:false,category:"food_and_drink"},rice:{keywords:["food","china","asian"],char:"🍚",fitzpatrick_scale:false,category:"food_and_drink"},rice_cracker:{keywords:["food","japanese"],char:"🍘",fitzpatrick_scale:false,category:"food_and_drink"},oden:{keywords:["food","japanese"],char:"🍢",fitzpatrick_scale:false,category:"food_and_drink"},dango:{keywords:["food","dessert","sweet","japanese","barbecue","meat"],char:"🍡",fitzpatrick_scale:false,category:"food_and_drink"},shaved_ice:{keywords:["hot","dessert","summer"],char:"🍧",fitzpatrick_scale:false,category:"food_and_drink"},ice_cream:{keywords:["food","hot","dessert"],char:"🍨",fitzpatrick_scale:false,category:"food_and_drink"},icecream:{keywords:["food","hot","dessert","summer"],char:"🍦",fitzpatrick_scale:false,category:"food_and_drink"},pie:{keywords:["food","dessert","pastry"],char:"🥧",fitzpatrick_scale:false,category:"food_and_drink"},cake:{keywords:["food","dessert"],char:"🍰",fitzpatrick_scale:false,category:"food_and_drink"},cupcake:{keywords:["food","dessert","bakery","sweet"],char:"🧁",fitzpatrick_scale:false,category:"food_and_drink"},moon_cake:{keywords:["food","autumn"],char:"🥮",fitzpatrick_scale:false,category:"food_and_drink"},birthday:{keywords:["food","dessert","cake"],char:"🎂",fitzpatrick_scale:false,category:"food_and_drink"},custard:{keywords:["dessert","food"],char:"🍮",fitzpatrick_scale:false,category:"food_and_drink"},candy:{keywords:["snack","dessert","sweet","lolly"],char:"🍬",fitzpatrick_scale:false,category:"food_and_drink"},lollipop:{keywords:["food","snack","candy","sweet"],char:"🍭",fitzpatrick_scale:false,category:"food_and_drink"},chocolate_bar:{keywords:["food","snack","dessert","sweet"],char:"🍫",fitzpatrick_scale:false,category:"food_and_drink"},popcorn:{keywords:["food","movie theater","films","snack"],char:"🍿",fitzpatrick_scale:false,category:"food_and_drink"},dumpling:{keywords:["food","empanada","pierogi","potsticker"],char:"🥟",fitzpatrick_scale:false,category:"food_and_drink"},doughnut:{keywords:["food","dessert","snack","sweet","donut"],char:"🍩",fitzpatrick_scale:false,category:"food_and_drink"},cookie:{keywords:["food","snack","oreo","chocolate","sweet","dessert"],char:"🍪",fitzpatrick_scale:false,category:"food_and_drink"},milk_glass:{keywords:["beverage","drink","cow"],char:"🥛",fitzpatrick_scale:false,category:"food_and_drink"},beer:{keywords:["relax","beverage","drink","drunk","party","pub","summer","alcohol","booze"],char:"🍺",fitzpatrick_scale:false,category:"food_and_drink"},beers:{keywords:["relax","beverage","drink","drunk","party","pub","summer","alcohol","booze"],char:"🍻",fitzpatrick_scale:false,category:"food_and_drink"},clinking_glasses:{keywords:["beverage","drink","party","alcohol","celebrate","cheers","wine","champagne","toast"],char:"🥂",fitzpatrick_scale:false,category:"food_and_drink"},wine_glass:{keywords:["drink","beverage","drunk","alcohol","booze"],char:"🍷",fitzpatrick_scale:false,category:"food_and_drink"},tumbler_glass:{keywords:["drink","beverage","drunk","alcohol","liquor","booze","bourbon","scotch","whisky","glass","shot"],char:"🥃",fitzpatrick_scale:false,category:"food_and_drink"},cocktail:{keywords:["drink","drunk","alcohol","beverage","booze","mojito"],char:"🍸",fitzpatrick_scale:false,category:"food_and_drink"},tropical_drink:{keywords:["beverage","cocktail","summer","beach","alcohol","booze","mojito"],char:"🍹",fitzpatrick_scale:false,category:"food_and_drink"},champagne:{keywords:["drink","wine","bottle","celebration"],char:"🍾",fitzpatrick_scale:false,category:"food_and_drink"},sake:{keywords:["wine","drink","drunk","beverage","japanese","alcohol","booze"],char:"🍶",fitzpatrick_scale:false,category:"food_and_drink"},tea:{keywords:["drink","bowl","breakfast","green","british"],char:"🍵",fitzpatrick_scale:false,category:"food_and_drink"},cup_with_straw:{keywords:["drink","soda"],char:"🥤",fitzpatrick_scale:false,category:"food_and_drink"},coffee:{keywords:["beverage","caffeine","latte","espresso"],char:"☕",fitzpatrick_scale:false,category:"food_and_drink"},baby_bottle:{keywords:["food","container","milk"],char:"🍼",fitzpatrick_scale:false,category:"food_and_drink"},salt:{keywords:["condiment","shaker"],char:"🧂",fitzpatrick_scale:false,category:"food_and_drink"},spoon:{keywords:["cutlery","kitchen","tableware"],char:"🥄",fitzpatrick_scale:false,category:"food_and_drink"},fork_and_knife:{keywords:["cutlery","kitchen"],char:"🍴",fitzpatrick_scale:false,category:"food_and_drink"},plate_with_cutlery:{keywords:["food","eat","meal","lunch","dinner","restaurant"],char:"🍽",fitzpatrick_scale:false,category:"food_and_drink"},bowl_with_spoon:{keywords:["food","breakfast","cereal","oatmeal","porridge"],char:"🥣",fitzpatrick_scale:false,category:"food_and_drink"},takeout_box:{keywords:["food","leftovers"],char:"🥡",fitzpatrick_scale:false,category:"food_and_drink"},chopsticks:{keywords:["food"],char:"🥢",fitzpatrick_scale:false,category:"food_and_drink"},soccer:{keywords:["sports","football"],char:"⚽",fitzpatrick_scale:false,category:"activity"},basketball:{keywords:["sports","balls","NBA"],char:"🏀",fitzpatrick_scale:false,category:"activity"},football:{keywords:["sports","balls","NFL"],char:"🏈",fitzpatrick_scale:false,category:"activity"},baseball:{keywords:["sports","balls"],char:"⚾",fitzpatrick_scale:false,category:"activity"},softball:{keywords:["sports","balls"],char:"🥎",fitzpatrick_scale:false,category:"activity"},tennis:{keywords:["sports","balls","green"],char:"🎾",fitzpatrick_scale:false,category:"activity"},volleyball:{keywords:["sports","balls"],char:"🏐",fitzpatrick_scale:false,category:"activity"},rugby_football:{keywords:["sports","team"],char:"🏉",fitzpatrick_scale:false,category:"activity"},flying_disc:{keywords:["sports","frisbee","ultimate"],char:"🥏",fitzpatrick_scale:false,category:"activity"},"8ball":{keywords:["pool","hobby","game","luck","magic"],char:"🎱",fitzpatrick_scale:false,category:"activity"},golf:{keywords:["sports","business","flag","hole","summer"],char:"⛳",fitzpatrick_scale:false,category:"activity"},golfing_woman:{keywords:["sports","business","woman","female"],char:"🏌️♀️",fitzpatrick_scale:false,category:"activity"},golfing_man:{keywords:["sports","business"],char:"🏌",fitzpatrick_scale:true,category:"activity"},ping_pong:{keywords:["sports","pingpong"],char:"🏓",fitzpatrick_scale:false,category:"activity"},badminton:{keywords:["sports"],char:"🏸",fitzpatrick_scale:false,category:"activity"},goal_net:{keywords:["sports"],char:"🥅",fitzpatrick_scale:false,category:"activity"},ice_hockey:{keywords:["sports"],char:"🏒",fitzpatrick_scale:false,category:"activity"},field_hockey:{keywords:["sports"],char:"🏑",fitzpatrick_scale:false,category:"activity"},lacrosse:{keywords:["sports","ball","stick"],char:"🥍",fitzpatrick_scale:false,category:"activity"},cricket:{keywords:["sports"],char:"🏏",fitzpatrick_scale:false,category:"activity"},ski:{keywords:["sports","winter","cold","snow"],char:"🎿",fitzpatrick_scale:false,category:"activity"},skier:{keywords:["sports","winter","snow"],char:"⛷",fitzpatrick_scale:false,category:"activity"},snowboarder:{keywords:["sports","winter"],char:"🏂",fitzpatrick_scale:true,category:"activity"},person_fencing:{keywords:["sports","fencing","sword"],char:"🤺",fitzpatrick_scale:false,category:"activity"},women_wrestling:{keywords:["sports","wrestlers"],char:"🤼♀️",fitzpatrick_scale:false,category:"activity"},men_wrestling:{keywords:["sports","wrestlers"],char:"🤼♂️",fitzpatrick_scale:false,category:"activity"},woman_cartwheeling:{keywords:["gymnastics"],char:"🤸♀️",fitzpatrick_scale:true,category:"activity"},man_cartwheeling:{keywords:["gymnastics"],char:"🤸♂️",fitzpatrick_scale:true,category:"activity"},woman_playing_handball:{keywords:["sports"],char:"🤾♀️",fitzpatrick_scale:true,category:"activity"},man_playing_handball:{keywords:["sports"],char:"🤾♂️",fitzpatrick_scale:true,category:"activity"},ice_skate:{keywords:["sports"],char:"⛸",fitzpatrick_scale:false,category:"activity"},curling_stone:{keywords:["sports"],char:"🥌",fitzpatrick_scale:false,category:"activity"},skateboard:{keywords:["board"],char:"🛹",fitzpatrick_scale:false,category:"activity"},sled:{keywords:["sleigh","luge","toboggan"],char:"🛷",fitzpatrick_scale:false,category:"activity"},bow_and_arrow:{keywords:["sports"],char:"🏹",fitzpatrick_scale:false,category:"activity"},fishing_pole_and_fish:{keywords:["food","hobby","summer"],char:"🎣",fitzpatrick_scale:false,category:"activity"},boxing_glove:{keywords:["sports","fighting"],char:"🥊",fitzpatrick_scale:false,category:"activity"},martial_arts_uniform:{keywords:["judo","karate","taekwondo"],char:"🥋",fitzpatrick_scale:false,category:"activity"},rowing_woman:{keywords:["sports","hobby","water","ship","woman","female"],char:"🚣♀️",fitzpatrick_scale:true,category:"activity"},rowing_man:{keywords:["sports","hobby","water","ship"],char:"🚣",fitzpatrick_scale:true,category:"activity"},climbing_woman:{keywords:["sports","hobby","woman","female","rock"],char:"🧗♀️",fitzpatrick_scale:true,category:"activity"},climbing_man:{keywords:["sports","hobby","man","male","rock"],char:"🧗♂️",fitzpatrick_scale:true,category:"activity"},swimming_woman:{keywords:["sports","exercise","human","athlete","water","summer","woman","female"],char:"🏊♀️",fitzpatrick_scale:true,category:"activity"},swimming_man:{keywords:["sports","exercise","human","athlete","water","summer"],char:"🏊",fitzpatrick_scale:true,category:"activity"},woman_playing_water_polo:{keywords:["sports","pool"],char:"🤽♀️",fitzpatrick_scale:true,category:"activity"},man_playing_water_polo:{keywords:["sports","pool"],char:"🤽♂️",fitzpatrick_scale:true,category:"activity"},woman_in_lotus_position:{keywords:["woman","female","meditation","yoga","serenity","zen","mindfulness"],char:"🧘♀️",fitzpatrick_scale:true,category:"activity"},man_in_lotus_position:{keywords:["man","male","meditation","yoga","serenity","zen","mindfulness"],char:"🧘♂️",fitzpatrick_scale:true,category:"activity"},surfing_woman:{keywords:["sports","ocean","sea","summer","beach","woman","female"],char:"🏄♀️",fitzpatrick_scale:true,category:"activity"},surfing_man:{keywords:["sports","ocean","sea","summer","beach"],char:"🏄",fitzpatrick_scale:true,category:"activity"},bath:{keywords:["clean","shower","bathroom"],char:"🛀",fitzpatrick_scale:true,category:"activity"},basketball_woman:{keywords:["sports","human","woman","female"],char:"⛹️♀️",fitzpatrick_scale:true,category:"activity"},basketball_man:{keywords:["sports","human"],char:"⛹",fitzpatrick_scale:true,category:"activity"},weight_lifting_woman:{keywords:["sports","training","exercise","woman","female"],char:"🏋️♀️",fitzpatrick_scale:true,category:"activity"},weight_lifting_man:{keywords:["sports","training","exercise"],char:"🏋",fitzpatrick_scale:true,category:"activity"},biking_woman:{keywords:["sports","bike","exercise","hipster","woman","female"],char:"🚴♀️",fitzpatrick_scale:true,category:"activity"},biking_man:{keywords:["sports","bike","exercise","hipster"],char:"🚴",fitzpatrick_scale:true,category:"activity"},mountain_biking_woman:{keywords:["transportation","sports","human","race","bike","woman","female"],char:"🚵♀️",fitzpatrick_scale:true,category:"activity"},mountain_biking_man:{keywords:["transportation","sports","human","race","bike"],char:"🚵",fitzpatrick_scale:true,category:"activity"},horse_racing:{keywords:["animal","betting","competition","gambling","luck"],char:"🏇",fitzpatrick_scale:true,category:"activity"},business_suit_levitating:{keywords:["suit","business","levitate","hover","jump"],char:"🕴",fitzpatrick_scale:true,category:"activity"},trophy:{keywords:["win","award","contest","place","ftw","ceremony"],char:"🏆",fitzpatrick_scale:false,category:"activity"},running_shirt_with_sash:{keywords:["play","pageant"],char:"🎽",fitzpatrick_scale:false,category:"activity"},medal_sports:{keywords:["award","winning"],char:"🏅",fitzpatrick_scale:false,category:"activity"},medal_military:{keywords:["award","winning","army"],char:"🎖",fitzpatrick_scale:false,category:"activity"},"1st_place_medal":{keywords:["award","winning","first"],char:"🥇",fitzpatrick_scale:false,category:"activity"},"2nd_place_medal":{keywords:["award","second"],char:"🥈",fitzpatrick_scale:false,category:"activity"},"3rd_place_medal":{keywords:["award","third"],char:"🥉",fitzpatrick_scale:false,category:"activity"},reminder_ribbon:{keywords:["sports","cause","support","awareness"],char:"🎗",fitzpatrick_scale:false,category:"activity"},rosette:{keywords:["flower","decoration","military"],char:"🏵",fitzpatrick_scale:false,category:"activity"},ticket:{keywords:["event","concert","pass"],char:"🎫",fitzpatrick_scale:false,category:"activity"},tickets:{keywords:["sports","concert","entrance"],char:"🎟",fitzpatrick_scale:false,category:"activity"},performing_arts:{keywords:["acting","theater","drama"],char:"🎭",fitzpatrick_scale:false,category:"activity"},art:{keywords:["design","paint","draw","colors"],char:"🎨",fitzpatrick_scale:false,category:"activity"},circus_tent:{keywords:["festival","carnival","party"],char:"🎪",fitzpatrick_scale:false,category:"activity"},woman_juggling:{keywords:["juggle","balance","skill","multitask"],char:"🤹♀️",fitzpatrick_scale:true,category:"activity"},man_juggling:{keywords:["juggle","balance","skill","multitask"],char:"🤹♂️",fitzpatrick_scale:true,category:"activity"},microphone:{keywords:["sound","music","PA","sing","talkshow"],char:"🎤",fitzpatrick_scale:false,category:"activity"},headphones:{keywords:["music","score","gadgets"],char:"🎧",fitzpatrick_scale:false,category:"activity"},musical_score:{keywords:["treble","clef","compose"],char:"🎼",fitzpatrick_scale:false,category:"activity"},musical_keyboard:{keywords:["piano","instrument","compose"],char:"🎹",fitzpatrick_scale:false,category:"activity"},drum:{keywords:["music","instrument","drumsticks","snare"],char:"🥁",fitzpatrick_scale:false,category:"activity"},saxophone:{keywords:["music","instrument","jazz","blues"],char:"🎷",fitzpatrick_scale:false,category:"activity"},trumpet:{keywords:["music","brass"],char:"🎺",fitzpatrick_scale:false,category:"activity"},guitar:{keywords:["music","instrument"],char:"🎸",fitzpatrick_scale:false,category:"activity"},violin:{keywords:["music","instrument","orchestra","symphony"],char:"🎻",fitzpatrick_scale:false,category:"activity"},clapper:{keywords:["movie","film","record"],char:"🎬",fitzpatrick_scale:false,category:"activity"},video_game:{keywords:["play","console","PS4","controller"],char:"🎮",fitzpatrick_scale:false,category:"activity"},space_invader:{keywords:["game","arcade","play"],char:"👾",fitzpatrick_scale:false,category:"activity"},dart:{keywords:["game","play","bar","target","bullseye"],char:"🎯",fitzpatrick_scale:false,category:"activity"},game_die:{keywords:["dice","random","tabletop","play","luck"],char:"🎲",fitzpatrick_scale:false,category:"activity"},chess_pawn:{keywords:["expendable"],char:"♟",fitzpatrick_scale:false,category:"activity"},slot_machine:{keywords:["bet","gamble","vegas","fruit machine","luck","casino"],char:"🎰",fitzpatrick_scale:false,category:"activity"},jigsaw:{keywords:["interlocking","puzzle","piece"],char:"🧩",fitzpatrick_scale:false,category:"activity"},bowling:{keywords:["sports","fun","play"],char:"🎳",fitzpatrick_scale:false,category:"activity"},red_car:{keywords:["red","transportation","vehicle"],char:"🚗",fitzpatrick_scale:false,category:"travel_and_places"},taxi:{keywords:["uber","vehicle","cars","transportation"],char:"🚕",fitzpatrick_scale:false,category:"travel_and_places"},blue_car:{keywords:["transportation","vehicle"],char:"🚙",fitzpatrick_scale:false,category:"travel_and_places"},bus:{keywords:["car","vehicle","transportation"],char:"🚌",fitzpatrick_scale:false,category:"travel_and_places"},trolleybus:{keywords:["bart","transportation","vehicle"],char:"🚎",fitzpatrick_scale:false,category:"travel_and_places"},racing_car:{keywords:["sports","race","fast","formula","f1"],char:"🏎",fitzpatrick_scale:false,category:"travel_and_places"},police_car:{keywords:["vehicle","cars","transportation","law","legal","enforcement"],char:"🚓",fitzpatrick_scale:false,category:"travel_and_places"},ambulance:{keywords:["health","911","hospital"],char:"🚑",fitzpatrick_scale:false,category:"travel_and_places"},fire_engine:{keywords:["transportation","cars","vehicle"],char:"🚒",fitzpatrick_scale:false,category:"travel_and_places"},minibus:{keywords:["vehicle","car","transportation"],char:"🚐",fitzpatrick_scale:false,category:"travel_and_places"},truck:{keywords:["cars","transportation"],char:"🚚",fitzpatrick_scale:false,category:"travel_and_places"},articulated_lorry:{keywords:["vehicle","cars","transportation","express"],char:"🚛",fitzpatrick_scale:false,category:"travel_and_places"},tractor:{keywords:["vehicle","car","farming","agriculture"],char:"🚜",fitzpatrick_scale:false,category:"travel_and_places"},kick_scooter:{keywords:["vehicle","kick","razor"],char:"🛴",fitzpatrick_scale:false,category:"travel_and_places"},motorcycle:{keywords:["race","sports","fast"],char:"🏍",fitzpatrick_scale:false,category:"travel_and_places"},bike:{keywords:["sports","bicycle","exercise","hipster"],char:"🚲",fitzpatrick_scale:false,category:"travel_and_places"},motor_scooter:{keywords:["vehicle","vespa","sasha"],char:"🛵",fitzpatrick_scale:false,category:"travel_and_places"},rotating_light:{keywords:["police","ambulance","911","emergency","alert","error","pinged","law","legal"],char:"🚨",fitzpatrick_scale:false,category:"travel_and_places"},oncoming_police_car:{keywords:["vehicle","law","legal","enforcement","911"],char:"🚔",fitzpatrick_scale:false,category:"travel_and_places"},oncoming_bus:{keywords:["vehicle","transportation"],char:"🚍",fitzpatrick_scale:false,category:"travel_and_places"},oncoming_automobile:{keywords:["car","vehicle","transportation"],char:"🚘",fitzpatrick_scale:false,category:"travel_and_places"},oncoming_taxi:{keywords:["vehicle","cars","uber"],char:"🚖",fitzpatrick_scale:false,category:"travel_and_places"},aerial_tramway:{keywords:["transportation","vehicle","ski"],char:"🚡",fitzpatrick_scale:false,category:"travel_and_places"},mountain_cableway:{keywords:["transportation","vehicle","ski"],char:"🚠",fitzpatrick_scale:false,category:"travel_and_places"},suspension_railway:{keywords:["vehicle","transportation"],char:"🚟",fitzpatrick_scale:false,category:"travel_and_places"},railway_car:{keywords:["transportation","vehicle"],char:"🚃",fitzpatrick_scale:false,category:"travel_and_places"},train:{keywords:["transportation","vehicle","carriage","public","travel"],char:"🚋",fitzpatrick_scale:false,category:"travel_and_places"},monorail:{keywords:["transportation","vehicle"],char:"🚝",fitzpatrick_scale:false,category:"travel_and_places"},bullettrain_side:{keywords:["transportation","vehicle"],char:"🚄",fitzpatrick_scale:false,category:"travel_and_places"},bullettrain_front:{keywords:["transportation","vehicle","speed","fast","public","travel"],char:"🚅",fitzpatrick_scale:false,category:"travel_and_places"},light_rail:{keywords:["transportation","vehicle"],char:"🚈",fitzpatrick_scale:false,category:"travel_and_places"},mountain_railway:{keywords:["transportation","vehicle"],char:"🚞",fitzpatrick_scale:false,category:"travel_and_places"},steam_locomotive:{keywords:["transportation","vehicle","train"],char:"🚂",fitzpatrick_scale:false,category:"travel_and_places"},train2:{keywords:["transportation","vehicle"],char:"🚆",fitzpatrick_scale:false,category:"travel_and_places"},metro:{keywords:["transportation","blue-square","mrt","underground","tube"],char:"🚇",fitzpatrick_scale:false,category:"travel_and_places"},tram:{keywords:["transportation","vehicle"],char:"🚊",fitzpatrick_scale:false,category:"travel_and_places"},station:{keywords:["transportation","vehicle","public"],char:"🚉",fitzpatrick_scale:false,category:"travel_and_places"},flying_saucer:{keywords:["transportation","vehicle","ufo"],char:"🛸",fitzpatrick_scale:false,category:"travel_and_places"},helicopter:{keywords:["transportation","vehicle","fly"],char:"🚁",fitzpatrick_scale:false,category:"travel_and_places"},small_airplane:{keywords:["flight","transportation","fly","vehicle"],char:"🛩",fitzpatrick_scale:false,category:"travel_and_places"},airplane:{keywords:["vehicle","transportation","flight","fly"],char:"✈️",fitzpatrick_scale:false,category:"travel_and_places"},flight_departure:{keywords:["airport","flight","landing"],char:"🛫",fitzpatrick_scale:false,category:"travel_and_places"},flight_arrival:{keywords:["airport","flight","boarding"],char:"🛬",fitzpatrick_scale:false,category:"travel_and_places"},sailboat:{keywords:["ship","summer","transportation","water","sailing"],char:"⛵",fitzpatrick_scale:false,category:"travel_and_places"},motor_boat:{keywords:["ship"],char:"🛥",fitzpatrick_scale:false,category:"travel_and_places"},speedboat:{keywords:["ship","transportation","vehicle","summer"],char:"🚤",fitzpatrick_scale:false,category:"travel_and_places"},ferry:{keywords:["boat","ship","yacht"],char:"⛴",fitzpatrick_scale:false,category:"travel_and_places"},passenger_ship:{keywords:["yacht","cruise","ferry"],char:"🛳",fitzpatrick_scale:false,category:"travel_and_places"},rocket:{keywords:["launch","ship","staffmode","NASA","outer space","outer_space","fly"],char:"🚀",fitzpatrick_scale:false,category:"travel_and_places"},artificial_satellite:{keywords:["communication","gps","orbit","spaceflight","NASA","ISS"],char:"🛰",fitzpatrick_scale:false,category:"travel_and_places"},seat:{keywords:["sit","airplane","transport","bus","flight","fly"],char:"💺",fitzpatrick_scale:false,category:"travel_and_places"},canoe:{keywords:["boat","paddle","water","ship"],char:"🛶",fitzpatrick_scale:false,category:"travel_and_places"},anchor:{keywords:["ship","ferry","sea","boat"],char:"⚓",fitzpatrick_scale:false,category:"travel_and_places"},construction:{keywords:["wip","progress","caution","warning"],char:"🚧",fitzpatrick_scale:false,category:"travel_and_places"},fuelpump:{keywords:["gas station","petroleum"],char:"⛽",fitzpatrick_scale:false,category:"travel_and_places"},busstop:{keywords:["transportation","wait"],char:"🚏",fitzpatrick_scale:false,category:"travel_and_places"},vertical_traffic_light:{keywords:["transportation","driving"],char:"🚦",fitzpatrick_scale:false,category:"travel_and_places"},traffic_light:{keywords:["transportation","signal"],char:"🚥",fitzpatrick_scale:false,category:"travel_and_places"},checkered_flag:{keywords:["contest","finishline","race","gokart"],char:"🏁",fitzpatrick_scale:false,category:"travel_and_places"},ship:{keywords:["transportation","titanic","deploy"],char:"🚢",fitzpatrick_scale:false,category:"travel_and_places"},ferris_wheel:{keywords:["photo","carnival","londoneye"],char:"🎡",fitzpatrick_scale:false,category:"travel_and_places"},roller_coaster:{keywords:["carnival","playground","photo","fun"],char:"🎢",fitzpatrick_scale:false,category:"travel_and_places"},carousel_horse:{keywords:["photo","carnival"],char:"🎠",fitzpatrick_scale:false,category:"travel_and_places"},building_construction:{keywords:["wip","working","progress"],char:"🏗",fitzpatrick_scale:false,category:"travel_and_places"},foggy:{keywords:["photo","mountain"],char:"🌁",fitzpatrick_scale:false,category:"travel_and_places"},tokyo_tower:{keywords:["photo","japanese"],char:"🗼",fitzpatrick_scale:false,category:"travel_and_places"},factory:{keywords:["building","industry","pollution","smoke"],char:"🏭",fitzpatrick_scale:false,category:"travel_and_places"},fountain:{keywords:["photo","summer","water","fresh"],char:"⛲",fitzpatrick_scale:false,category:"travel_and_places"},rice_scene:{keywords:["photo","japan","asia","tsukimi"],char:"🎑",fitzpatrick_scale:false,category:"travel_and_places"},mountain:{keywords:["photo","nature","environment"],char:"⛰",fitzpatrick_scale:false,category:"travel_and_places"},mountain_snow:{keywords:["photo","nature","environment","winter","cold"],char:"🏔",fitzpatrick_scale:false,category:"travel_and_places"},mount_fuji:{keywords:["photo","mountain","nature","japanese"],char:"🗻",fitzpatrick_scale:false,category:"travel_and_places"},volcano:{keywords:["photo","nature","disaster"],char:"🌋",fitzpatrick_scale:false,category:"travel_and_places"},japan:{keywords:["nation","country","japanese","asia"],char:"🗾",fitzpatrick_scale:false,category:"travel_and_places"},camping:{keywords:["photo","outdoors","tent"],char:"🏕",fitzpatrick_scale:false,category:"travel_and_places"},tent:{keywords:["photo","camping","outdoors"],char:"⛺",fitzpatrick_scale:false,category:"travel_and_places"},national_park:{keywords:["photo","environment","nature"],char:"🏞",fitzpatrick_scale:false,category:"travel_and_places"},motorway:{keywords:["road","cupertino","interstate","highway"],char:"🛣",fitzpatrick_scale:false,category:"travel_and_places"},railway_track:{keywords:["train","transportation"],char:"🛤",fitzpatrick_scale:false,category:"travel_and_places"},sunrise:{keywords:["morning","view","vacation","photo"],char:"🌅",fitzpatrick_scale:false,category:"travel_and_places"},sunrise_over_mountains:{keywords:["view","vacation","photo"],char:"🌄",fitzpatrick_scale:false,category:"travel_and_places"},desert:{keywords:["photo","warm","saharah"],char:"🏜",fitzpatrick_scale:false,category:"travel_and_places"},beach_umbrella:{keywords:["weather","summer","sunny","sand","mojito"],char:"🏖",fitzpatrick_scale:false,category:"travel_and_places"},desert_island:{keywords:["photo","tropical","mojito"],char:"🏝",fitzpatrick_scale:false,category:"travel_and_places"},city_sunrise:{keywords:["photo","good morning","dawn"],char:"🌇",fitzpatrick_scale:false,category:"travel_and_places"},city_sunset:{keywords:["photo","evening","sky","buildings"],char:"🌆",fitzpatrick_scale:false,category:"travel_and_places"},cityscape:{keywords:["photo","night life","urban"],char:"🏙",fitzpatrick_scale:false,category:"travel_and_places"},night_with_stars:{keywords:["evening","city","downtown"],char:"🌃",fitzpatrick_scale:false,category:"travel_and_places"},bridge_at_night:{keywords:["photo","sanfrancisco"],char:"🌉",fitzpatrick_scale:false,category:"travel_and_places"},milky_way:{keywords:["photo","space","stars"],char:"🌌",fitzpatrick_scale:false,category:"travel_and_places"},stars:{keywords:["night","photo"],char:"🌠",fitzpatrick_scale:false,category:"travel_and_places"},sparkler:{keywords:["stars","night","shine"],char:"🎇",fitzpatrick_scale:false,category:"travel_and_places"},fireworks:{keywords:["photo","festival","carnival","congratulations"],char:"🎆",fitzpatrick_scale:false,category:"travel_and_places"},rainbow:{keywords:["nature","happy","unicorn_face","photo","sky","spring"],char:"🌈",fitzpatrick_scale:false,category:"travel_and_places"},houses:{keywords:["buildings","photo"],char:"🏘",fitzpatrick_scale:false,category:"travel_and_places"},european_castle:{keywords:["building","royalty","history"],char:"🏰",fitzpatrick_scale:false,category:"travel_and_places"},japanese_castle:{keywords:["photo","building"],char:"🏯",fitzpatrick_scale:false,category:"travel_and_places"},stadium:{keywords:["photo","place","sports","concert","venue"],char:"🏟",fitzpatrick_scale:false,category:"travel_and_places"},statue_of_liberty:{keywords:["american","newyork"],char:"🗽",fitzpatrick_scale:false,category:"travel_and_places"},house:{keywords:["building","home"],char:"🏠",fitzpatrick_scale:false,category:"travel_and_places"},house_with_garden:{keywords:["home","plant","nature"],char:"🏡",fitzpatrick_scale:false,category:"travel_and_places"},derelict_house:{keywords:["abandon","evict","broken","building"],char:"🏚",fitzpatrick_scale:false,category:"travel_and_places"},office:{keywords:["building","bureau","work"],char:"🏢",fitzpatrick_scale:false,category:"travel_and_places"},department_store:{keywords:["building","shopping","mall"],char:"🏬",fitzpatrick_scale:false,category:"travel_and_places"},post_office:{keywords:["building","envelope","communication"],char:"🏣",fitzpatrick_scale:false,category:"travel_and_places"},european_post_office:{keywords:["building","email"],char:"🏤",fitzpatrick_scale:false,category:"travel_and_places"},hospital:{keywords:["building","health","surgery","doctor"],char:"🏥",fitzpatrick_scale:false,category:"travel_and_places"},bank:{keywords:["building","money","sales","cash","business","enterprise"],char:"🏦",fitzpatrick_scale:false,category:"travel_and_places"},hotel:{keywords:["building","accomodation","checkin"],char:"🏨",fitzpatrick_scale:false,category:"travel_and_places"},convenience_store:{keywords:["building","shopping","groceries"],char:"🏪",fitzpatrick_scale:false,category:"travel_and_places"},school:{keywords:["building","student","education","learn","teach"],char:"🏫",fitzpatrick_scale:false,category:"travel_and_places"},love_hotel:{keywords:["like","affection","dating"],char:"🏩",fitzpatrick_scale:false,category:"travel_and_places"},wedding:{keywords:["love","like","affection","couple","marriage","bride","groom"],char:"💒",fitzpatrick_scale:false,category:"travel_and_places"},classical_building:{keywords:["art","culture","history"],char:"🏛",fitzpatrick_scale:false,category:"travel_and_places"},church:{keywords:["building","religion","christ"],char:"⛪",fitzpatrick_scale:false,category:"travel_and_places"},mosque:{keywords:["islam","worship","minaret"],char:"🕌",fitzpatrick_scale:false,category:"travel_and_places"},synagogue:{keywords:["judaism","worship","temple","jewish"],char:"🕍",fitzpatrick_scale:false,category:"travel_and_places"},kaaba:{keywords:["mecca","mosque","islam"],char:"🕋",fitzpatrick_scale:false,category:"travel_and_places"},shinto_shrine:{keywords:["temple","japan","kyoto"],char:"⛩",fitzpatrick_scale:false,category:"travel_and_places"},watch:{keywords:["time","accessories"],char:"⌚",fitzpatrick_scale:false,category:"objects"},iphone:{keywords:["technology","apple","gadgets","dial"],char:"📱",fitzpatrick_scale:false,category:"objects"},calling:{keywords:["iphone","incoming"],char:"📲",fitzpatrick_scale:false,category:"objects"},computer:{keywords:["technology","laptop","screen","display","monitor"],char:"💻",fitzpatrick_scale:false,category:"objects"},keyboard:{keywords:["technology","computer","type","input","text"],char:"⌨",fitzpatrick_scale:false,category:"objects"},desktop_computer:{keywords:["technology","computing","screen"],char:"🖥",fitzpatrick_scale:false,category:"objects"},printer:{keywords:["paper","ink"],char:"🖨",fitzpatrick_scale:false,category:"objects"},computer_mouse:{keywords:["click"],char:"🖱",fitzpatrick_scale:false,category:"objects"},trackball:{keywords:["technology","trackpad"],char:"🖲",fitzpatrick_scale:false,category:"objects"},joystick:{keywords:["game","play"],char:"🕹",fitzpatrick_scale:false,category:"objects"},clamp:{keywords:["tool"],char:"🗜",fitzpatrick_scale:false,category:"objects"},minidisc:{keywords:["technology","record","data","disk","90s"],char:"💽",fitzpatrick_scale:false,category:"objects"},floppy_disk:{keywords:["oldschool","technology","save","90s","80s"],char:"💾",fitzpatrick_scale:false,category:"objects"},cd:{keywords:["technology","dvd","disk","disc","90s"],char:"💿",fitzpatrick_scale:false,category:"objects"},dvd:{keywords:["cd","disk","disc"],char:"📀",fitzpatrick_scale:false,category:"objects"},vhs:{keywords:["record","video","oldschool","90s","80s"],char:"📼",fitzpatrick_scale:false,category:"objects"},camera:{keywords:["gadgets","photography"],char:"📷",fitzpatrick_scale:false,category:"objects"},camera_flash:{keywords:["photography","gadgets"],char:"📸",fitzpatrick_scale:false,category:"objects"},video_camera:{keywords:["film","record"],char:"📹",fitzpatrick_scale:false,category:"objects"},movie_camera:{keywords:["film","record"],char:"🎥",fitzpatrick_scale:false,category:"objects"},film_projector:{keywords:["video","tape","record","movie"],char:"📽",fitzpatrick_scale:false,category:"objects"},film_strip:{keywords:["movie"],char:"🎞",fitzpatrick_scale:false,category:"objects"},telephone_receiver:{keywords:["technology","communication","dial"],char:"📞",fitzpatrick_scale:false,category:"objects"},phone:{keywords:["technology","communication","dial","telephone"],char:"☎️",fitzpatrick_scale:false,category:"objects"},pager:{keywords:["bbcall","oldschool","90s"],char:"📟",fitzpatrick_scale:false,category:"objects"},fax:{keywords:["communication","technology"],char:"📠",fitzpatrick_scale:false,category:"objects"},tv:{keywords:["technology","program","oldschool","show","television"],char:"📺",fitzpatrick_scale:false,category:"objects"},radio:{keywords:["communication","music","podcast","program"],char:"📻",fitzpatrick_scale:false,category:"objects"},studio_microphone:{keywords:["sing","recording","artist","talkshow"],char:"🎙",fitzpatrick_scale:false,category:"objects"},level_slider:{keywords:["scale"],char:"🎚",fitzpatrick_scale:false,category:"objects"},control_knobs:{keywords:["dial"],char:"🎛",fitzpatrick_scale:false,category:"objects"},compass:{keywords:["magnetic","navigation","orienteering"],char:"🧭",fitzpatrick_scale:false,category:"objects"},stopwatch:{keywords:["time","deadline"],char:"⏱",fitzpatrick_scale:false,category:"objects"},timer_clock:{keywords:["alarm"],char:"⏲",fitzpatrick_scale:false,category:"objects"},alarm_clock:{keywords:["time","wake"],char:"⏰",fitzpatrick_scale:false,category:"objects"},mantelpiece_clock:{keywords:["time"],char:"🕰",fitzpatrick_scale:false,category:"objects"},hourglass_flowing_sand:{keywords:["oldschool","time","countdown"],char:"⏳",fitzpatrick_scale:false,category:"objects"},hourglass:{keywords:["time","clock","oldschool","limit","exam","quiz","test"],char:"⌛",fitzpatrick_scale:false,category:"objects"},satellite:{keywords:["communication","future","radio","space"],char:"📡",fitzpatrick_scale:false,category:"objects"},battery:{keywords:["power","energy","sustain"],char:"🔋",fitzpatrick_scale:false,category:"objects"},electric_plug:{keywords:["charger","power"],char:"🔌",fitzpatrick_scale:false,category:"objects"},bulb:{keywords:["light","electricity","idea"],char:"💡",fitzpatrick_scale:false,category:"objects"},flashlight:{keywords:["dark","camping","sight","night"],char:"🔦",fitzpatrick_scale:false,category:"objects"},candle:{keywords:["fire","wax"],char:"🕯",fitzpatrick_scale:false,category:"objects"},fire_extinguisher:{keywords:["quench"],char:"🧯",fitzpatrick_scale:false,category:"objects"},wastebasket:{keywords:["bin","trash","rubbish","garbage","toss"],char:"🗑",fitzpatrick_scale:false,category:"objects"},oil_drum:{keywords:["barrell"],char:"🛢",fitzpatrick_scale:false,category:"objects"},money_with_wings:{keywords:["dollar","bills","payment","sale"],char:"💸",fitzpatrick_scale:false,category:"objects"},dollar:{keywords:["money","sales","bill","currency"],char:"💵",fitzpatrick_scale:false,category:"objects"},yen:{keywords:["money","sales","japanese","dollar","currency"],char:"💴",fitzpatrick_scale:false,category:"objects"},euro:{keywords:["money","sales","dollar","currency"],char:"💶",fitzpatrick_scale:false,category:"objects"},pound:{keywords:["british","sterling","money","sales","bills","uk","england","currency"],char:"💷",fitzpatrick_scale:false,category:"objects"},moneybag:{keywords:["dollar","payment","coins","sale"],char:"💰",fitzpatrick_scale:false,category:"objects"},credit_card:{keywords:["money","sales","dollar","bill","payment","shopping"],char:"💳",fitzpatrick_scale:false,category:"objects"},gem:{keywords:["blue","ruby","diamond","jewelry"],char:"💎",fitzpatrick_scale:false,category:"objects"},balance_scale:{keywords:["law","fairness","weight"],char:"⚖",fitzpatrick_scale:false,category:"objects"},toolbox:{keywords:["tools","diy","fix","maintainer","mechanic"],char:"🧰",fitzpatrick_scale:false,category:"objects"},wrench:{keywords:["tools","diy","ikea","fix","maintainer"],char:"🔧",fitzpatrick_scale:false,category:"objects"},hammer:{keywords:["tools","build","create"],char:"🔨",fitzpatrick_scale:false,category:"objects"},hammer_and_pick:{keywords:["tools","build","create"],char:"⚒",fitzpatrick_scale:false,category:"objects"},hammer_and_wrench:{keywords:["tools","build","create"],char:"🛠",fitzpatrick_scale:false,category:"objects"},pick:{keywords:["tools","dig"],char:"⛏",fitzpatrick_scale:false,category:"objects"},nut_and_bolt:{keywords:["handy","tools","fix"],char:"🔩",fitzpatrick_scale:false,category:"objects"},gear:{keywords:["cog"],char:"⚙",fitzpatrick_scale:false,category:"objects"},brick:{keywords:["bricks"],char:"🧱",fitzpatrick_scale:false,category:"objects"},chains:{keywords:["lock","arrest"],char:"⛓",fitzpatrick_scale:false,category:"objects"},magnet:{keywords:["attraction","magnetic"],char:"🧲",fitzpatrick_scale:false,category:"objects"},gun:{keywords:["violence","weapon","pistol","revolver"],char:"🔫",fitzpatrick_scale:false,category:"objects"},bomb:{keywords:["boom","explode","explosion","terrorism"],char:"💣",fitzpatrick_scale:false,category:"objects"},firecracker:{keywords:["dynamite","boom","explode","explosion","explosive"],char:"🧨",fitzpatrick_scale:false,category:"objects"},hocho:{keywords:["knife","blade","cutlery","kitchen","weapon"],char:"🔪",fitzpatrick_scale:false,category:"objects"},dagger:{keywords:["weapon"],char:"🗡",fitzpatrick_scale:false,category:"objects"},crossed_swords:{keywords:["weapon"],char:"⚔",fitzpatrick_scale:false,category:"objects"},shield:{keywords:["protection","security"],char:"🛡",fitzpatrick_scale:false,category:"objects"},smoking:{keywords:["kills","tobacco","cigarette","joint","smoke"],char:"🚬",fitzpatrick_scale:false,category:"objects"},skull_and_crossbones:{keywords:["poison","danger","deadly","scary","death","pirate","evil"],char:"☠",fitzpatrick_scale:false,category:"objects"},coffin:{keywords:["vampire","dead","die","death","rip","graveyard","cemetery","casket","funeral","box"],char:"⚰",fitzpatrick_scale:false,category:"objects"},funeral_urn:{keywords:["dead","die","death","rip","ashes"],char:"⚱",fitzpatrick_scale:false,category:"objects"},amphora:{keywords:["vase","jar"],char:"🏺",fitzpatrick_scale:false,category:"objects"},crystal_ball:{keywords:["disco","party","magic","circus","fortune_teller"],char:"🔮",fitzpatrick_scale:false,category:"objects"},prayer_beads:{keywords:["dhikr","religious"],char:"📿",fitzpatrick_scale:false,category:"objects"},nazar_amulet:{keywords:["bead","charm"],char:"🧿",fitzpatrick_scale:false,category:"objects"},barber:{keywords:["hair","salon","style"],char:"💈",fitzpatrick_scale:false,category:"objects"},alembic:{keywords:["distilling","science","experiment","chemistry"],char:"⚗",fitzpatrick_scale:false,category:"objects"},telescope:{keywords:["stars","space","zoom","science","astronomy"],char:"🔭",fitzpatrick_scale:false,category:"objects"},microscope:{keywords:["laboratory","experiment","zoomin","science","study"],char:"🔬",fitzpatrick_scale:false,category:"objects"},hole:{keywords:["embarrassing"],char:"🕳",fitzpatrick_scale:false,category:"objects"},pill:{keywords:["health","medicine","doctor","pharmacy","drug"],char:"💊",fitzpatrick_scale:false,category:"objects"},syringe:{keywords:["health","hospital","drugs","blood","medicine","needle","doctor","nurse"],char:"💉",fitzpatrick_scale:false,category:"objects"},dna:{keywords:["biologist","genetics","life"],char:"🧬",fitzpatrick_scale:false,category:"objects"},microbe:{keywords:["amoeba","bacteria","germs"],char:"🦠",fitzpatrick_scale:false,category:"objects"},petri_dish:{keywords:["bacteria","biology","culture","lab"],char:"🧫",fitzpatrick_scale:false,category:"objects"},test_tube:{keywords:["chemistry","experiment","lab","science"],char:"🧪",fitzpatrick_scale:false,category:"objects"},thermometer:{keywords:["weather","temperature","hot","cold"],char:"🌡",fitzpatrick_scale:false,category:"objects"},broom:{keywords:["cleaning","sweeping","witch"],char:"🧹",fitzpatrick_scale:false,category:"objects"},basket:{keywords:["laundry"],char:"🧺",fitzpatrick_scale:false,category:"objects"},toilet_paper:{keywords:["roll"],char:"🧻",fitzpatrick_scale:false,category:"objects"},label:{keywords:["sale","tag"],char:"🏷",fitzpatrick_scale:false,category:"objects"},bookmark:{keywords:["favorite","label","save"],char:"🔖",fitzpatrick_scale:false,category:"objects"},toilet:{keywords:["restroom","wc","washroom","bathroom","potty"],char:"🚽",fitzpatrick_scale:false,category:"objects"},shower:{keywords:["clean","water","bathroom"],char:"🚿",fitzpatrick_scale:false,category:"objects"},bathtub:{keywords:["clean","shower","bathroom"],char:"🛁",fitzpatrick_scale:false,category:"objects"},soap:{keywords:["bar","bathing","cleaning","lather"],char:"🧼",fitzpatrick_scale:false,category:"objects"},sponge:{keywords:["absorbing","cleaning","porous"],char:"🧽",fitzpatrick_scale:false,category:"objects"},lotion_bottle:{keywords:["moisturizer","sunscreen"],char:"🧴",fitzpatrick_scale:false,category:"objects"},key:{keywords:["lock","door","password"],char:"🔑",fitzpatrick_scale:false,category:"objects"},old_key:{keywords:["lock","door","password"],char:"🗝",fitzpatrick_scale:false,category:"objects"},couch_and_lamp:{keywords:["read","chill"],char:"🛋",fitzpatrick_scale:false,category:"objects"},sleeping_bed:{keywords:["bed","rest"],char:"🛌",fitzpatrick_scale:true,category:"objects"},bed:{keywords:["sleep","rest"],char:"🛏",fitzpatrick_scale:false,category:"objects"},door:{keywords:["house","entry","exit"],char:"🚪",fitzpatrick_scale:false,category:"objects"},bellhop_bell:{keywords:["service"],char:"🛎",fitzpatrick_scale:false,category:"objects"},teddy_bear:{keywords:["plush","stuffed"],char:"🧸",fitzpatrick_scale:false,category:"objects"},framed_picture:{keywords:["photography"],char:"🖼",fitzpatrick_scale:false,category:"objects"},world_map:{keywords:["location","direction"],char:"🗺",fitzpatrick_scale:false,category:"objects"},parasol_on_ground:{keywords:["weather","summer"],char:"⛱",fitzpatrick_scale:false,category:"objects"},moyai:{keywords:["rock","easter island","moai"],char:"🗿",fitzpatrick_scale:false,category:"objects"},shopping:{keywords:["mall","buy","purchase"],char:"🛍",fitzpatrick_scale:false,category:"objects"},shopping_cart:{keywords:["trolley"],char:"🛒",fitzpatrick_scale:false,category:"objects"},balloon:{keywords:["party","celebration","birthday","circus"],char:"🎈",fitzpatrick_scale:false,category:"objects"},flags:{keywords:["fish","japanese","koinobori","carp","banner"],char:"🎏",fitzpatrick_scale:false,category:"objects"},ribbon:{keywords:["decoration","pink","girl","bowtie"],char:"🎀",fitzpatrick_scale:false,category:"objects"},gift:{keywords:["present","birthday","christmas","xmas"],char:"🎁",fitzpatrick_scale:false,category:"objects"},confetti_ball:{keywords:["festival","party","birthday","circus"],char:"🎊",fitzpatrick_scale:false,category:"objects"},tada:{keywords:["party","congratulations","birthday","magic","circus","celebration"],char:"🎉",fitzpatrick_scale:false,category:"objects"},dolls:{keywords:["japanese","toy","kimono"],char:"🎎",fitzpatrick_scale:false,category:"objects"},wind_chime:{keywords:["nature","ding","spring","bell"],char:"🎐",fitzpatrick_scale:false,category:"objects"},crossed_flags:{keywords:["japanese","nation","country","border"],char:"🎌",fitzpatrick_scale:false,category:"objects"},izakaya_lantern:{keywords:["light","paper","halloween","spooky"],char:"🏮",fitzpatrick_scale:false,category:"objects"},red_envelope:{keywords:["gift"],char:"🧧",fitzpatrick_scale:false,category:"objects"},email:{keywords:["letter","postal","inbox","communication"],char:"✉️",fitzpatrick_scale:false,category:"objects"},envelope_with_arrow:{keywords:["email","communication"],char:"📩",fitzpatrick_scale:false,category:"objects"},incoming_envelope:{keywords:["email","inbox"],char:"📨",fitzpatrick_scale:false,category:"objects"},"e-mail":{keywords:["communication","inbox"],char:"📧",fitzpatrick_scale:false,category:"objects"},love_letter:{keywords:["email","like","affection","envelope","valentines"],char:"💌",fitzpatrick_scale:false,category:"objects"},postbox:{keywords:["email","letter","envelope"],char:"📮",fitzpatrick_scale:false,category:"objects"},mailbox_closed:{keywords:["email","communication","inbox"],char:"📪",fitzpatrick_scale:false,category:"objects"},mailbox:{keywords:["email","inbox","communication"],char:"📫",fitzpatrick_scale:false,category:"objects"},mailbox_with_mail:{keywords:["email","inbox","communication"],char:"📬",fitzpatrick_scale:false,category:"objects"},mailbox_with_no_mail:{keywords:["email","inbox"],char:"📭",fitzpatrick_scale:false,category:"objects"},package:{keywords:["mail","gift","cardboard","box","moving"],char:"📦",fitzpatrick_scale:false,category:"objects"},postal_horn:{keywords:["instrument","music"],char:"📯",fitzpatrick_scale:false,category:"objects"},inbox_tray:{keywords:["email","documents"],char:"📥",fitzpatrick_scale:false,category:"objects"},outbox_tray:{keywords:["inbox","email"],char:"📤",fitzpatrick_scale:false,category:"objects"},scroll:{keywords:["documents","ancient","history","paper"],char:"📜",fitzpatrick_scale:false,category:"objects"},page_with_curl:{keywords:["documents","office","paper"],char:"📃",fitzpatrick_scale:false,category:"objects"},bookmark_tabs:{keywords:["favorite","save","order","tidy"],char:"📑",fitzpatrick_scale:false,category:"objects"},receipt:{keywords:["accounting","expenses"],char:"🧾",fitzpatrick_scale:false,category:"objects"},bar_chart:{keywords:["graph","presentation","stats"],char:"📊",fitzpatrick_scale:false,category:"objects"},chart_with_upwards_trend:{keywords:["graph","presentation","stats","recovery","business","economics","money","sales","good","success"],char:"📈",fitzpatrick_scale:false,category:"objects"},chart_with_downwards_trend:{keywords:["graph","presentation","stats","recession","business","economics","money","sales","bad","failure"],char:"📉",fitzpatrick_scale:false,category:"objects"},page_facing_up:{keywords:["documents","office","paper","information"],char:"📄",fitzpatrick_scale:false,category:"objects"},date:{keywords:["calendar","schedule"],char:"📅",fitzpatrick_scale:false,category:"objects"},calendar:{keywords:["schedule","date","planning"],char:"📆",fitzpatrick_scale:false,category:"objects"},spiral_calendar:{keywords:["date","schedule","planning"],char:"🗓",fitzpatrick_scale:false,category:"objects"},card_index:{keywords:["business","stationery"],char:"📇",fitzpatrick_scale:false,category:"objects"},card_file_box:{keywords:["business","stationery"],char:"🗃",fitzpatrick_scale:false,category:"objects"},ballot_box:{keywords:["election","vote"],char:"🗳",fitzpatrick_scale:false,category:"objects"},file_cabinet:{keywords:["filing","organizing"],char:"🗄",fitzpatrick_scale:false,category:"objects"},clipboard:{keywords:["stationery","documents"],char:"📋",fitzpatrick_scale:false,category:"objects"},spiral_notepad:{keywords:["memo","stationery"],char:"🗒",fitzpatrick_scale:false,category:"objects"},file_folder:{keywords:["documents","business","office"],char:"📁",fitzpatrick_scale:false,category:"objects"},open_file_folder:{keywords:["documents","load"],char:"📂",fitzpatrick_scale:false,category:"objects"},card_index_dividers:{keywords:["organizing","business","stationery"],char:"🗂",fitzpatrick_scale:false,category:"objects"},newspaper_roll:{keywords:["press","headline"],char:"🗞",fitzpatrick_scale:false,category:"objects"},newspaper:{keywords:["press","headline"],char:"📰",fitzpatrick_scale:false,category:"objects"},notebook:{keywords:["stationery","record","notes","paper","study"],char:"📓",fitzpatrick_scale:false,category:"objects"},closed_book:{keywords:["read","library","knowledge","textbook","learn"],char:"📕",fitzpatrick_scale:false,category:"objects"},green_book:{keywords:["read","library","knowledge","study"],char:"📗",fitzpatrick_scale:false,category:"objects"},blue_book:{keywords:["read","library","knowledge","learn","study"],char:"📘",fitzpatrick_scale:false,category:"objects"},orange_book:{keywords:["read","library","knowledge","textbook","study"],char:"📙",fitzpatrick_scale:false,category:"objects"},notebook_with_decorative_cover:{keywords:["classroom","notes","record","paper","study"],char:"📔",fitzpatrick_scale:false,category:"objects"},ledger:{keywords:["notes","paper"],char:"📒",fitzpatrick_scale:false,category:"objects"},books:{keywords:["literature","library","study"],char:"📚",fitzpatrick_scale:false,category:"objects"},open_book:{keywords:["book","read","library","knowledge","literature","learn","study"],char:"📖",fitzpatrick_scale:false,category:"objects"},safety_pin:{keywords:["diaper"],char:"🧷",fitzpatrick_scale:false,category:"objects"},link:{keywords:["rings","url"],char:"🔗",fitzpatrick_scale:false,category:"objects"},paperclip:{keywords:["documents","stationery"],char:"📎",fitzpatrick_scale:false,category:"objects"},paperclips:{keywords:["documents","stationery"],char:"🖇",fitzpatrick_scale:false,category:"objects"},scissors:{keywords:["stationery","cut"],char:"✂️",fitzpatrick_scale:false,category:"objects"},triangular_ruler:{keywords:["stationery","math","architect","sketch"],char:"📐",fitzpatrick_scale:false,category:"objects"},straight_ruler:{keywords:["stationery","calculate","length","math","school","drawing","architect","sketch"],char:"📏",fitzpatrick_scale:false,category:"objects"},abacus:{keywords:["calculation"],char:"🧮",fitzpatrick_scale:false,category:"objects"},pushpin:{keywords:["stationery","mark","here"],char:"📌",fitzpatrick_scale:false,category:"objects"},round_pushpin:{keywords:["stationery","location","map","here"],char:"📍",fitzpatrick_scale:false,category:"objects"},triangular_flag_on_post:{keywords:["mark","milestone","place"],char:"🚩",fitzpatrick_scale:false,category:"objects"},white_flag:{keywords:["losing","loser","lost","surrender","give up","fail"],char:"🏳",fitzpatrick_scale:false,category:"objects"},black_flag:{keywords:["pirate"],char:"🏴",fitzpatrick_scale:false,category:"objects"},rainbow_flag:{keywords:["flag","rainbow","pride","gay","lgbt","glbt","queer","homosexual","lesbian","bisexual","transgender"],char:"🏳️🌈",fitzpatrick_scale:false,category:"objects"},closed_lock_with_key:{keywords:["security","privacy"],char:"🔐",fitzpatrick_scale:false,category:"objects"},lock:{keywords:["security","password","padlock"],char:"🔒",fitzpatrick_scale:false,category:"objects"},unlock:{keywords:["privacy","security"],char:"🔓",fitzpatrick_scale:false,category:"objects"},lock_with_ink_pen:{keywords:["security","secret"],char:"🔏",fitzpatrick_scale:false,category:"objects"},pen:{keywords:["stationery","writing","write"],char:"🖊",fitzpatrick_scale:false,category:"objects"},fountain_pen:{keywords:["stationery","writing","write"],char:"🖋",fitzpatrick_scale:false,category:"objects"},black_nib:{keywords:["pen","stationery","writing","write"],char:"✒️",fitzpatrick_scale:false,category:"objects"},memo:{keywords:["write","documents","stationery","pencil","paper","writing","legal","exam","quiz","test","study","compose"],char:"📝",fitzpatrick_scale:false,category:"objects"},pencil2:{keywords:["stationery","write","paper","writing","school","study"],char:"✏️",fitzpatrick_scale:false,category:"objects"},crayon:{keywords:["drawing","creativity"],char:"🖍",fitzpatrick_scale:false,category:"objects"},paintbrush:{keywords:["drawing","creativity","art"],char:"🖌",fitzpatrick_scale:false,category:"objects"},mag:{keywords:["search","zoom","find","detective"],char:"🔍",fitzpatrick_scale:false,category:"objects"},mag_right:{keywords:["search","zoom","find","detective"],char:"🔎",fitzpatrick_scale:false,category:"objects"},heart:{keywords:["love","like","valentines"],char:"❤️",fitzpatrick_scale:false,category:"symbols"},orange_heart:{keywords:["love","like","affection","valentines"],char:"🧡",fitzpatrick_scale:false,category:"symbols"},yellow_heart:{keywords:["love","like","affection","valentines"],char:"💛",fitzpatrick_scale:false,category:"symbols"},green_heart:{keywords:["love","like","affection","valentines"],char:"💚",fitzpatrick_scale:false,category:"symbols"},blue_heart:{keywords:["love","like","affection","valentines"],char:"💙",fitzpatrick_scale:false,category:"symbols"},purple_heart:{keywords:["love","like","affection","valentines"],char:"💜",fitzpatrick_scale:false,category:"symbols"},black_heart:{keywords:["evil"],char:"🖤",fitzpatrick_scale:false,category:"symbols"},broken_heart:{keywords:["sad","sorry","break","heart","heartbreak"],char:"💔",fitzpatrick_scale:false,category:"symbols"},heavy_heart_exclamation:{keywords:["decoration","love"],char:"❣",fitzpatrick_scale:false,category:"symbols"},two_hearts:{keywords:["love","like","affection","valentines","heart"],char:"💕",fitzpatrick_scale:false,category:"symbols"},revolving_hearts:{keywords:["love","like","affection","valentines"],char:"💞",fitzpatrick_scale:false,category:"symbols"},heartbeat:{keywords:["love","like","affection","valentines","pink","heart"],char:"💓",fitzpatrick_scale:false,category:"symbols"},heartpulse:{keywords:["like","love","affection","valentines","pink"],char:"💗",fitzpatrick_scale:false,category:"symbols"},sparkling_heart:{keywords:["love","like","affection","valentines"],char:"💖",fitzpatrick_scale:false,category:"symbols"},cupid:{keywords:["love","like","heart","affection","valentines"],char:"💘",fitzpatrick_scale:false,category:"symbols"},gift_heart:{keywords:["love","valentines"],char:"💝",fitzpatrick_scale:false,category:"symbols"},heart_decoration:{keywords:["purple-square","love","like"],char:"💟",fitzpatrick_scale:false,category:"symbols"},peace_symbol:{keywords:["hippie"],char:"☮",fitzpatrick_scale:false,category:"symbols"},latin_cross:{keywords:["christianity"],char:"✝",fitzpatrick_scale:false,category:"symbols"},star_and_crescent:{keywords:["islam"],char:"☪",fitzpatrick_scale:false,category:"symbols"},om:{keywords:["hinduism","buddhism","sikhism","jainism"],char:"🕉",fitzpatrick_scale:false,category:"symbols"},wheel_of_dharma:{keywords:["hinduism","buddhism","sikhism","jainism"],char:"☸",fitzpatrick_scale:false,category:"symbols"},star_of_david:{keywords:["judaism"],char:"✡",fitzpatrick_scale:false,category:"symbols"},six_pointed_star:{keywords:["purple-square","religion","jewish","hexagram"],char:"🔯",fitzpatrick_scale:false,category:"symbols"},menorah:{keywords:["hanukkah","candles","jewish"],char:"🕎",fitzpatrick_scale:false,category:"symbols"},yin_yang:{keywords:["balance"],char:"☯",fitzpatrick_scale:false,category:"symbols"},orthodox_cross:{keywords:["suppedaneum","religion"],char:"☦",fitzpatrick_scale:false,category:"symbols"},place_of_worship:{keywords:["religion","church","temple","prayer"],char:"🛐",fitzpatrick_scale:false,category:"symbols"},ophiuchus:{keywords:["sign","purple-square","constellation","astrology"],char:"⛎",fitzpatrick_scale:false,category:"symbols"},aries:{keywords:["sign","purple-square","zodiac","astrology"],char:"♈",fitzpatrick_scale:false,category:"symbols"},taurus:{keywords:["purple-square","sign","zodiac","astrology"],char:"♉",fitzpatrick_scale:false,category:"symbols"},gemini:{keywords:["sign","zodiac","purple-square","astrology"],char:"♊",fitzpatrick_scale:false,category:"symbols"},cancer:{keywords:["sign","zodiac","purple-square","astrology"],char:"♋",fitzpatrick_scale:false,category:"symbols"},leo:{keywords:["sign","purple-square","zodiac","astrology"],char:"♌",fitzpatrick_scale:false,category:"symbols"},virgo:{keywords:["sign","zodiac","purple-square","astrology"],char:"♍",fitzpatrick_scale:false,category:"symbols"},libra:{keywords:["sign","purple-square","zodiac","astrology"],char:"♎",fitzpatrick_scale:false,category:"symbols"},scorpius:{keywords:["sign","zodiac","purple-square","astrology","scorpio"],char:"♏",fitzpatrick_scale:false,category:"symbols"},sagittarius:{keywords:["sign","zodiac","purple-square","astrology"],char:"♐",fitzpatrick_scale:false,category:"symbols"},capricorn:{keywords:["sign","zodiac","purple-square","astrology"],char:"♑",fitzpatrick_scale:false,category:"symbols"},aquarius:{keywords:["sign","purple-square","zodiac","astrology"],char:"♒",fitzpatrick_scale:false,category:"symbols"},pisces:{keywords:["purple-square","sign","zodiac","astrology"],char:"♓",fitzpatrick_scale:false,category:"symbols"},id:{keywords:["purple-square","words"],char:"🆔",fitzpatrick_scale:false,category:"symbols"},atom_symbol:{keywords:["science","physics","chemistry"],char:"⚛",fitzpatrick_scale:false,category:"symbols"},u7a7a:{keywords:["kanji","japanese","chinese","empty","sky","blue-square"],char:"🈳",fitzpatrick_scale:false,category:"symbols"},u5272:{keywords:["cut","divide","chinese","kanji","pink-square"],char:"🈹",fitzpatrick_scale:false,category:"symbols"},radioactive:{keywords:["nuclear","danger"],char:"☢",fitzpatrick_scale:false,category:"symbols"},biohazard:{keywords:["danger"],char:"☣",fitzpatrick_scale:false,category:"symbols"},mobile_phone_off:{keywords:["mute","orange-square","silence","quiet"],char:"📴",fitzpatrick_scale:false,category:"symbols"},vibration_mode:{keywords:["orange-square","phone"],char:"📳",fitzpatrick_scale:false,category:"symbols"},u6709:{keywords:["orange-square","chinese","have","kanji"],char:"🈶",fitzpatrick_scale:false,category:"symbols"},u7121:{keywords:["nothing","chinese","kanji","japanese","orange-square"],char:"🈚",fitzpatrick_scale:false,category:"symbols"},u7533:{keywords:["chinese","japanese","kanji","orange-square"],char:"🈸",fitzpatrick_scale:false,category:"symbols"},u55b6:{keywords:["japanese","opening hours","orange-square"],char:"🈺",fitzpatrick_scale:false,category:"symbols"},u6708:{keywords:["chinese","month","moon","japanese","orange-square","kanji"],char:"🈷️",fitzpatrick_scale:false,category:"symbols"},eight_pointed_black_star:{keywords:["orange-square","shape","polygon"],char:"✴️",fitzpatrick_scale:false,category:"symbols"},vs:{keywords:["words","orange-square"],char:"🆚",fitzpatrick_scale:false,category:"symbols"},accept:{keywords:["ok","good","chinese","kanji","agree","yes","orange-circle"],char:"🉑",fitzpatrick_scale:false,category:"symbols"},white_flower:{keywords:["japanese","spring"],char:"💮",fitzpatrick_scale:false,category:"symbols"},ideograph_advantage:{keywords:["chinese","kanji","obtain","get","circle"],char:"🉐",fitzpatrick_scale:false,category:"symbols"},secret:{keywords:["privacy","chinese","sshh","kanji","red-circle"],char:"㊙️",fitzpatrick_scale:false,category:"symbols"},congratulations:{keywords:["chinese","kanji","japanese","red-circle"],char:"㊗️",fitzpatrick_scale:false,category:"symbols"},u5408:{keywords:["japanese","chinese","join","kanji","red-square"],char:"🈴",fitzpatrick_scale:false,category:"symbols"},u6e80:{keywords:["full","chinese","japanese","red-square","kanji"],char:"🈵",fitzpatrick_scale:false,category:"symbols"},u7981:{keywords:["kanji","japanese","chinese","forbidden","limit","restricted","red-square"],char:"🈲",fitzpatrick_scale:false,category:"symbols"},a:{keywords:["red-square","alphabet","letter"],char:"🅰️",fitzpatrick_scale:false,category:"symbols"},b:{keywords:["red-square","alphabet","letter"],char:"🅱️",fitzpatrick_scale:false,category:"symbols"},ab:{keywords:["red-square","alphabet"],char:"🆎",fitzpatrick_scale:false,category:"symbols"},cl:{keywords:["alphabet","words","red-square"],char:"🆑",fitzpatrick_scale:false,category:"symbols"},o2:{keywords:["alphabet","red-square","letter"],char:"🅾️",fitzpatrick_scale:false,category:"symbols"},sos:{keywords:["help","red-square","words","emergency","911"],char:"🆘",fitzpatrick_scale:false,category:"symbols"},no_entry:{keywords:["limit","security","privacy","bad","denied","stop","circle"],char:"⛔",fitzpatrick_scale:false,category:"symbols"},name_badge:{keywords:["fire","forbid"],char:"📛",fitzpatrick_scale:false,category:"symbols"},no_entry_sign:{keywords:["forbid","stop","limit","denied","disallow","circle"],char:"🚫",fitzpatrick_scale:false,category:"symbols"},x:{keywords:["no","delete","remove","cancel","red"],char:"❌",fitzpatrick_scale:false,category:"symbols"},o:{keywords:["circle","round"],char:"⭕",fitzpatrick_scale:false,category:"symbols"},stop_sign:{keywords:["stop"],char:"🛑",fitzpatrick_scale:false,category:"symbols"},anger:{keywords:["angry","mad"],char:"💢",fitzpatrick_scale:false,category:"symbols"},hotsprings:{keywords:["bath","warm","relax"],char:"♨️",fitzpatrick_scale:false,category:"symbols"},no_pedestrians:{keywords:["rules","crossing","walking","circle"],char:"🚷",fitzpatrick_scale:false,category:"symbols"},do_not_litter:{keywords:["trash","bin","garbage","circle"],char:"🚯",fitzpatrick_scale:false,category:"symbols"},no_bicycles:{keywords:["cyclist","prohibited","circle"],char:"🚳",fitzpatrick_scale:false,category:"symbols"},"non-potable_water":{keywords:["drink","faucet","tap","circle"],char:"🚱",fitzpatrick_scale:false,category:"symbols"},underage:{keywords:["18","drink","pub","night","minor","circle"],char:"🔞",fitzpatrick_scale:false,category:"symbols"},no_mobile_phones:{keywords:["iphone","mute","circle"],char:"📵",fitzpatrick_scale:false,category:"symbols"},exclamation:{keywords:["heavy_exclamation_mark","danger","surprise","punctuation","wow","warning"],char:"❗",fitzpatrick_scale:false,category:"symbols"},grey_exclamation:{keywords:["surprise","punctuation","gray","wow","warning"],char:"❕",fitzpatrick_scale:false,category:"symbols"},question:{keywords:["doubt","confused"],char:"❓",fitzpatrick_scale:false,category:"symbols"},grey_question:{keywords:["doubts","gray","huh","confused"],char:"❔",fitzpatrick_scale:false,category:"symbols"},bangbang:{keywords:["exclamation","surprise"],char:"‼️",fitzpatrick_scale:false,category:"symbols"},interrobang:{keywords:["wat","punctuation","surprise"],char:"⁉️",fitzpatrick_scale:false,category:"symbols"},100:{keywords:["score","perfect","numbers","century","exam","quiz","test","pass","hundred"],char:"💯",fitzpatrick_scale:false,category:"symbols"},low_brightness:{keywords:["sun","afternoon","warm","summer"],char:"🔅",fitzpatrick_scale:false,category:"symbols"},high_brightness:{keywords:["sun","light"],char:"🔆",fitzpatrick_scale:false,category:"symbols"},trident:{keywords:["weapon","spear"],char:"🔱",fitzpatrick_scale:false,category:"symbols"},fleur_de_lis:{keywords:["decorative","scout"],char:"⚜",fitzpatrick_scale:false,category:"symbols"},part_alternation_mark:{keywords:["graph","presentation","stats","business","economics","bad"],char:"〽️",fitzpatrick_scale:false,category:"symbols"},warning:{keywords:["exclamation","wip","alert","error","problem","issue"],char:"⚠️",fitzpatrick_scale:false,category:"symbols"},children_crossing:{keywords:["school","warning","danger","sign","driving","yellow-diamond"],char:"🚸",fitzpatrick_scale:false,category:"symbols"},beginner:{keywords:["badge","shield"],char:"🔰",fitzpatrick_scale:false,category:"symbols"},recycle:{keywords:["arrow","environment","garbage","trash"],char:"♻️",fitzpatrick_scale:false,category:"symbols"},u6307:{keywords:["chinese","point","green-square","kanji"],char:"🈯",fitzpatrick_scale:false,category:"symbols"},chart:{keywords:["green-square","graph","presentation","stats"],char:"💹",fitzpatrick_scale:false,category:"symbols"},sparkle:{keywords:["stars","green-square","awesome","good","fireworks"],char:"❇️",fitzpatrick_scale:false,category:"symbols"},eight_spoked_asterisk:{keywords:["star","sparkle","green-square"],char:"✳️",fitzpatrick_scale:false,category:"symbols"},negative_squared_cross_mark:{keywords:["x","green-square","no","deny"],char:"❎",fitzpatrick_scale:false,category:"symbols"},white_check_mark:{keywords:["green-square","ok","agree","vote","election","answer","tick"],char:"✅",fitzpatrick_scale:false,category:"symbols"},diamond_shape_with_a_dot_inside:{keywords:["jewel","blue","gem","crystal","fancy"],char:"💠",fitzpatrick_scale:false,category:"symbols"},cyclone:{keywords:["weather","swirl","blue","cloud","vortex","spiral","whirlpool","spin","tornado","hurricane","typhoon"],char:"🌀",fitzpatrick_scale:false,category:"symbols"},loop:{keywords:["tape","cassette"],char:"➿",fitzpatrick_scale:false,category:"symbols"},globe_with_meridians:{keywords:["earth","international","world","internet","interweb","i18n"],char:"🌐",fitzpatrick_scale:false,category:"symbols"},m:{keywords:["alphabet","blue-circle","letter"],char:"Ⓜ️",fitzpatrick_scale:false,category:"symbols"},atm:{keywords:["money","sales","cash","blue-square","payment","bank"],char:"🏧",fitzpatrick_scale:false,category:"symbols"},sa:{keywords:["japanese","blue-square","katakana"],char:"🈂️",fitzpatrick_scale:false,category:"symbols"},passport_control:{keywords:["custom","blue-square"],char:"🛂",fitzpatrick_scale:false,category:"symbols"},customs:{keywords:["passport","border","blue-square"],char:"🛃",fitzpatrick_scale:false,category:"symbols"},baggage_claim:{keywords:["blue-square","airport","transport"],char:"🛄",fitzpatrick_scale:false,category:"symbols"},left_luggage:{keywords:["blue-square","travel"],char:"🛅",fitzpatrick_scale:false,category:"symbols"},wheelchair:{keywords:["blue-square","disabled","a11y","accessibility"],char:"♿",fitzpatrick_scale:false,category:"symbols"},no_smoking:{keywords:["cigarette","blue-square","smell","smoke"],char:"🚭",fitzpatrick_scale:false,category:"symbols"},wc:{keywords:["toilet","restroom","blue-square"],char:"🚾",fitzpatrick_scale:false,category:"symbols"},parking:{keywords:["cars","blue-square","alphabet","letter"],char:"🅿️",fitzpatrick_scale:false,category:"symbols"},potable_water:{keywords:["blue-square","liquid","restroom","cleaning","faucet"],char:"🚰",fitzpatrick_scale:false,category:"symbols"},mens:{keywords:["toilet","restroom","wc","blue-square","gender","male"],char:"🚹",fitzpatrick_scale:false,category:"symbols"},womens:{keywords:["purple-square","woman","female","toilet","loo","restroom","gender"],char:"🚺",fitzpatrick_scale:false,category:"symbols"},baby_symbol:{keywords:["orange-square","child"],char:"🚼",fitzpatrick_scale:false,category:"symbols"},restroom:{keywords:["blue-square","toilet","refresh","wc","gender"],char:"🚻",fitzpatrick_scale:false,category:"symbols"},put_litter_in_its_place:{keywords:["blue-square","sign","human","info"],char:"🚮",fitzpatrick_scale:false,category:"symbols"},cinema:{keywords:["blue-square","record","film","movie","curtain","stage","theater"],char:"🎦",fitzpatrick_scale:false,category:"symbols"},signal_strength:{keywords:["blue-square","reception","phone","internet","connection","wifi","bluetooth","bars"],char:"📶",fitzpatrick_scale:false,category:"symbols"},koko:{keywords:["blue-square","here","katakana","japanese","destination"],char:"🈁",fitzpatrick_scale:false,category:"symbols"},ng:{keywords:["blue-square","words","shape","icon"],char:"🆖",fitzpatrick_scale:false,category:"symbols"},ok:{keywords:["good","agree","yes","blue-square"],char:"🆗",fitzpatrick_scale:false,category:"symbols"},up:{keywords:["blue-square","above","high"],char:"🆙",fitzpatrick_scale:false,category:"symbols"},cool:{keywords:["words","blue-square"],char:"🆒",fitzpatrick_scale:false,category:"symbols"},new:{keywords:["blue-square","words","start"],char:"🆕",fitzpatrick_scale:false,category:"symbols"},free:{keywords:["blue-square","words"],char:"🆓",fitzpatrick_scale:false,category:"symbols"},zero:{keywords:["0","numbers","blue-square","null"],char:"0️⃣",fitzpatrick_scale:false,category:"symbols"},one:{keywords:["blue-square","numbers","1"],char:"1️⃣",fitzpatrick_scale:false,category:"symbols"},two:{keywords:["numbers","2","prime","blue-square"],char:"2️⃣",fitzpatrick_scale:false,category:"symbols"},three:{keywords:["3","numbers","prime","blue-square"],char:"3️⃣",fitzpatrick_scale:false,category:"symbols"},four:{keywords:["4","numbers","blue-square"],char:"4️⃣",fitzpatrick_scale:false,category:"symbols"},five:{keywords:["5","numbers","blue-square","prime"],char:"5️⃣",fitzpatrick_scale:false,category:"symbols"},six:{keywords:["6","numbers","blue-square"],char:"6️⃣",fitzpatrick_scale:false,category:"symbols"},seven:{keywords:["7","numbers","blue-square","prime"],char:"7️⃣",fitzpatrick_scale:false,category:"symbols"},eight:{keywords:["8","blue-square","numbers"],char:"8️⃣",fitzpatrick_scale:false,category:"symbols"},nine:{keywords:["blue-square","numbers","9"],char:"9️⃣",fitzpatrick_scale:false,category:"symbols"},keycap_ten:{keywords:["numbers","10","blue-square"],char:"🔟",fitzpatrick_scale:false,category:"symbols"},asterisk:{keywords:["star","keycap"],char:"*⃣",fitzpatrick_scale:false,category:"symbols"},1234:{keywords:["numbers","blue-square"],char:"🔢",fitzpatrick_scale:false,category:"symbols"},eject_button:{keywords:["blue-square"],char:"⏏️",fitzpatrick_scale:false,category:"symbols"},arrow_forward:{keywords:["blue-square","right","direction","play"],char:"▶️",fitzpatrick_scale:false,category:"symbols"},pause_button:{keywords:["pause","blue-square"],char:"⏸",fitzpatrick_scale:false,category:"symbols"},next_track_button:{keywords:["forward","next","blue-square"],char:"⏭",fitzpatrick_scale:false,category:"symbols"},stop_button:{keywords:["blue-square"],char:"⏹",fitzpatrick_scale:false,category:"symbols"},record_button:{keywords:["blue-square"],char:"⏺",fitzpatrick_scale:false,category:"symbols"},play_or_pause_button:{keywords:["blue-square","play","pause"],char:"⏯",fitzpatrick_scale:false,category:"symbols"},previous_track_button:{keywords:["backward"],char:"⏮",fitzpatrick_scale:false,category:"symbols"},fast_forward:{keywords:["blue-square","play","speed","continue"],char:"⏩",fitzpatrick_scale:false,category:"symbols"},rewind:{keywords:["play","blue-square"],char:"⏪",fitzpatrick_scale:false,category:"symbols"},twisted_rightwards_arrows:{keywords:["blue-square","shuffle","music","random"],char:"🔀",fitzpatrick_scale:false,category:"symbols"},repeat:{keywords:["loop","record"],char:"🔁",fitzpatrick_scale:false,category:"symbols"},repeat_one:{keywords:["blue-square","loop"],char:"🔂",fitzpatrick_scale:false,category:"symbols"},arrow_backward:{keywords:["blue-square","left","direction"],char:"◀️",fitzpatrick_scale:false,category:"symbols"},arrow_up_small:{keywords:["blue-square","triangle","direction","point","forward","top"],char:"🔼",fitzpatrick_scale:false,category:"symbols"},arrow_down_small:{keywords:["blue-square","direction","bottom"],char:"🔽",fitzpatrick_scale:false,category:"symbols"},arrow_double_up:{keywords:["blue-square","direction","top"],char:"⏫",fitzpatrick_scale:false,category:"symbols"},arrow_double_down:{keywords:["blue-square","direction","bottom"],char:"⏬",fitzpatrick_scale:false,category:"symbols"},arrow_right:{keywords:["blue-square","next"],char:"➡️",fitzpatrick_scale:false,category:"symbols"},arrow_left:{keywords:["blue-square","previous","back"],char:"⬅️",fitzpatrick_scale:false,category:"symbols"},arrow_up:{keywords:["blue-square","continue","top","direction"],char:"⬆️",fitzpatrick_scale:false,category:"symbols"},arrow_down:{keywords:["blue-square","direction","bottom"],char:"⬇️",fitzpatrick_scale:false,category:"symbols"},arrow_upper_right:{keywords:["blue-square","point","direction","diagonal","northeast"],char:"↗️",fitzpatrick_scale:false,category:"symbols"},arrow_lower_right:{keywords:["blue-square","direction","diagonal","southeast"],char:"↘️",fitzpatrick_scale:false,category:"symbols"},arrow_lower_left:{keywords:["blue-square","direction","diagonal","southwest"],char:"↙️",fitzpatrick_scale:false,category:"symbols"},arrow_upper_left:{keywords:["blue-square","point","direction","diagonal","northwest"],char:"↖️",fitzpatrick_scale:false,category:"symbols"},arrow_up_down:{keywords:["blue-square","direction","way","vertical"],char:"↕️",fitzpatrick_scale:false,category:"symbols"},left_right_arrow:{keywords:["shape","direction","horizontal","sideways"],char:"↔️",fitzpatrick_scale:false,category:"symbols"},arrows_counterclockwise:{keywords:["blue-square","sync","cycle"],char:"🔄",fitzpatrick_scale:false,category:"symbols"},arrow_right_hook:{keywords:["blue-square","return","rotate","direction"],char:"↪️",fitzpatrick_scale:false,category:"symbols"},leftwards_arrow_with_hook:{keywords:["back","return","blue-square","undo","enter"],char:"↩️",fitzpatrick_scale:false,category:"symbols"},arrow_heading_up:{keywords:["blue-square","direction","top"],char:"⤴️",fitzpatrick_scale:false,category:"symbols"},arrow_heading_down:{keywords:["blue-square","direction","bottom"],char:"⤵️",fitzpatrick_scale:false,category:"symbols"},hash:{keywords:["symbol","blue-square","twitter"],char:"#️⃣",fitzpatrick_scale:false,category:"symbols"},information_source:{keywords:["blue-square","alphabet","letter"],char:"ℹ️",fitzpatrick_scale:false,category:"symbols"},abc:{keywords:["blue-square","alphabet"],char:"🔤",fitzpatrick_scale:false,category:"symbols"},abcd:{keywords:["blue-square","alphabet"],char:"🔡",fitzpatrick_scale:false,category:"symbols"},capital_abcd:{keywords:["alphabet","words","blue-square"],char:"🔠",fitzpatrick_scale:false,category:"symbols"},symbols:{keywords:["blue-square","music","note","ampersand","percent","glyphs","characters"],char:"🔣",fitzpatrick_scale:false,category:"symbols"},musical_note:{keywords:["score","tone","sound"],char:"🎵",fitzpatrick_scale:false,category:"symbols"},notes:{keywords:["music","score"],char:"🎶",fitzpatrick_scale:false,category:"symbols"},wavy_dash:{keywords:["draw","line","moustache","mustache","squiggle","scribble"],char:"〰️",fitzpatrick_scale:false,category:"symbols"},curly_loop:{keywords:["scribble","draw","shape","squiggle"],char:"➰",fitzpatrick_scale:false,category:"symbols"},heavy_check_mark:{keywords:["ok","nike","answer","yes","tick"],char:"✔️",fitzpatrick_scale:false,category:"symbols"},arrows_clockwise:{keywords:["sync","cycle","round","repeat"],char:"🔃",fitzpatrick_scale:false,category:"symbols"},heavy_plus_sign:{keywords:["math","calculation","addition","more","increase"],char:"➕",fitzpatrick_scale:false,category:"symbols"},heavy_minus_sign:{keywords:["math","calculation","subtract","less"],char:"➖",fitzpatrick_scale:false,category:"symbols"},heavy_division_sign:{keywords:["divide","math","calculation"],char:"➗",fitzpatrick_scale:false,category:"symbols"},heavy_multiplication_x:{keywords:["math","calculation"],char:"✖️",fitzpatrick_scale:false,category:"symbols"},infinity:{keywords:["forever"],char:"♾",fitzpatrick_scale:false,category:"symbols"},heavy_dollar_sign:{keywords:["money","sales","payment","currency","buck"],char:"💲",fitzpatrick_scale:false,category:"symbols"},currency_exchange:{keywords:["money","sales","dollar","travel"],char:"💱",fitzpatrick_scale:false,category:"symbols"},copyright:{keywords:["ip","license","circle","law","legal"],char:"©️",fitzpatrick_scale:false,category:"symbols"},registered:{keywords:["alphabet","circle"],char:"®️",fitzpatrick_scale:false,category:"symbols"},tm:{keywords:["trademark","brand","law","legal"],char:"™️",fitzpatrick_scale:false,category:"symbols"},end:{keywords:["words","arrow"],char:"🔚",fitzpatrick_scale:false,category:"symbols"},back:{keywords:["arrow","words","return"],char:"🔙",fitzpatrick_scale:false,category:"symbols"},on:{keywords:["arrow","words"],char:"🔛",fitzpatrick_scale:false,category:"symbols"},top:{keywords:["words","blue-square"],char:"🔝",fitzpatrick_scale:false,category:"symbols"},soon:{keywords:["arrow","words"],char:"🔜",fitzpatrick_scale:false,category:"symbols"},ballot_box_with_check:{keywords:["ok","agree","confirm","black-square","vote","election","yes","tick"],char:"☑️",fitzpatrick_scale:false,category:"symbols"},radio_button:{keywords:["input","old","music","circle"],char:"🔘",fitzpatrick_scale:false,category:"symbols"},white_circle:{keywords:["shape","round"],char:"⚪",fitzpatrick_scale:false,category:"symbols"},black_circle:{keywords:["shape","button","round"],char:"⚫",fitzpatrick_scale:false,category:"symbols"},red_circle:{keywords:["shape","error","danger"],char:"🔴",fitzpatrick_scale:false,category:"symbols"},large_blue_circle:{keywords:["shape","icon","button"],char:"🔵",fitzpatrick_scale:false,category:"symbols"},small_orange_diamond:{keywords:["shape","jewel","gem"],char:"🔸",fitzpatrick_scale:false,category:"symbols"},small_blue_diamond:{keywords:["shape","jewel","gem"],char:"🔹",fitzpatrick_scale:false,category:"symbols"},large_orange_diamond:{keywords:["shape","jewel","gem"],char:"🔶",fitzpatrick_scale:false,category:"symbols"},large_blue_diamond:{keywords:["shape","jewel","gem"],char:"🔷",fitzpatrick_scale:false,category:"symbols"},small_red_triangle:{keywords:["shape","direction","up","top"],char:"🔺",fitzpatrick_scale:false,category:"symbols"},black_small_square:{keywords:["shape","icon"],char:"▪️",fitzpatrick_scale:false,category:"symbols"},white_small_square:{keywords:["shape","icon"],char:"▫️",fitzpatrick_scale:false,category:"symbols"},black_large_square:{keywords:["shape","icon","button"],char:"⬛",fitzpatrick_scale:false,category:"symbols"},white_large_square:{keywords:["shape","icon","stone","button"],char:"⬜",fitzpatrick_scale:false,category:"symbols"},small_red_triangle_down:{keywords:["shape","direction","bottom"],char:"🔻",fitzpatrick_scale:false,category:"symbols"},black_medium_square:{keywords:["shape","button","icon"],char:"◼️",fitzpatrick_scale:false,category:"symbols"},white_medium_square:{keywords:["shape","stone","icon"],char:"◻️",fitzpatrick_scale:false,category:"symbols"},black_medium_small_square:{keywords:["icon","shape","button"],char:"◾",fitzpatrick_scale:false,category:"symbols"},white_medium_small_square:{keywords:["shape","stone","icon","button"],char:"◽",fitzpatrick_scale:false,category:"symbols"},black_square_button:{keywords:["shape","input","frame"],char:"🔲",fitzpatrick_scale:false,category:"symbols"},white_square_button:{keywords:["shape","input"],char:"🔳",fitzpatrick_scale:false,category:"symbols"},speaker:{keywords:["sound","volume","silence","broadcast"],char:"🔈",fitzpatrick_scale:false,category:"symbols"},sound:{keywords:["volume","speaker","broadcast"],char:"🔉",fitzpatrick_scale:false,category:"symbols"},loud_sound:{keywords:["volume","noise","noisy","speaker","broadcast"],char:"🔊",fitzpatrick_scale:false,category:"symbols"},mute:{keywords:["sound","volume","silence","quiet"],char:"🔇",fitzpatrick_scale:false,category:"symbols"},mega:{keywords:["sound","speaker","volume"],char:"📣",fitzpatrick_scale:false,category:"symbols"},loudspeaker:{keywords:["volume","sound"],char:"📢",fitzpatrick_scale:false,category:"symbols"},bell:{keywords:["sound","notification","christmas","xmas","chime"],char:"🔔",fitzpatrick_scale:false,category:"symbols"},no_bell:{keywords:["sound","volume","mute","quiet","silent"],char:"🔕",fitzpatrick_scale:false,category:"symbols"},black_joker:{keywords:["poker","cards","game","play","magic"],char:"🃏",fitzpatrick_scale:false,category:"symbols"},mahjong:{keywords:["game","play","chinese","kanji"],char:"🀄",fitzpatrick_scale:false,category:"symbols"},spades:{keywords:["poker","cards","suits","magic"],char:"♠️",fitzpatrick_scale:false,category:"symbols"},clubs:{keywords:["poker","cards","magic","suits"],char:"♣️",fitzpatrick_scale:false,category:"symbols"},hearts:{keywords:["poker","cards","magic","suits"],char:"♥️",fitzpatrick_scale:false,category:"symbols"},diamonds:{keywords:["poker","cards","magic","suits"],char:"♦️",fitzpatrick_scale:false,category:"symbols"},flower_playing_cards:{keywords:["game","sunset","red"],char:"🎴",fitzpatrick_scale:false,category:"symbols"},thought_balloon:{keywords:["bubble","cloud","speech","thinking","dream"],char:"💭",fitzpatrick_scale:false,category:"symbols"},right_anger_bubble:{keywords:["caption","speech","thinking","mad"],char:"🗯",fitzpatrick_scale:false,category:"symbols"},speech_balloon:{keywords:["bubble","words","message","talk","chatting"],char:"💬",fitzpatrick_scale:false,category:"symbols"},left_speech_bubble:{keywords:["words","message","talk","chatting"],char:"🗨",fitzpatrick_scale:false,category:"symbols"},clock1:{keywords:["time","late","early","schedule"],char:"🕐",fitzpatrick_scale:false,category:"symbols"},clock2:{keywords:["time","late","early","schedule"],char:"🕑",fitzpatrick_scale:false,category:"symbols"},clock3:{keywords:["time","late","early","schedule"],char:"🕒",fitzpatrick_scale:false,category:"symbols"},clock4:{keywords:["time","late","early","schedule"],char:"🕓",fitzpatrick_scale:false,category:"symbols"},clock5:{keywords:["time","late","early","schedule"],char:"🕔",fitzpatrick_scale:false,category:"symbols"},clock6:{keywords:["time","late","early","schedule","dawn","dusk"],char:"🕕",fitzpatrick_scale:false,category:"symbols"},clock7:{keywords:["time","late","early","schedule"],char:"🕖",fitzpatrick_scale:false,category:"symbols"},clock8:{keywords:["time","late","early","schedule"],char:"🕗",fitzpatrick_scale:false,category:"symbols"},clock9:{keywords:["time","late","early","schedule"],char:"🕘",fitzpatrick_scale:false,category:"symbols"},clock10:{keywords:["time","late","early","schedule"],char:"🕙",fitzpatrick_scale:false,category:"symbols"},clock11:{keywords:["time","late","early","schedule"],char:"🕚",fitzpatrick_scale:false,category:"symbols"},clock12:{keywords:["time","noon","midnight","midday","late","early","schedule"],char:"🕛",fitzpatrick_scale:false,category:"symbols"},clock130:{keywords:["time","late","early","schedule"],char:"🕜",fitzpatrick_scale:false,category:"symbols"},clock230:{keywords:["time","late","early","schedule"],char:"🕝",fitzpatrick_scale:false,category:"symbols"},clock330:{keywords:["time","late","early","schedule"],char:"🕞",fitzpatrick_scale:false,category:"symbols"},clock430:{keywords:["time","late","early","schedule"],char:"🕟",fitzpatrick_scale:false,category:"symbols"},clock530:{keywords:["time","late","early","schedule"],char:"🕠",fitzpatrick_scale:false,category:"symbols"},clock630:{keywords:["time","late","early","schedule"],char:"🕡",fitzpatrick_scale:false,category:"symbols"},clock730:{keywords:["time","late","early","schedule"],char:"🕢",fitzpatrick_scale:false,category:"symbols"},clock830:{keywords:["time","late","early","schedule"],char:"🕣",fitzpatrick_scale:false,category:"symbols"},clock930:{keywords:["time","late","early","schedule"],char:"🕤",fitzpatrick_scale:false,category:"symbols"},clock1030:{keywords:["time","late","early","schedule"],char:"🕥",fitzpatrick_scale:false,category:"symbols"},clock1130:{keywords:["time","late","early","schedule"],char:"🕦",fitzpatrick_scale:false,category:"symbols"},clock1230:{keywords:["time","late","early","schedule"],char:"🕧",fitzpatrick_scale:false,category:"symbols"},afghanistan:{keywords:["af","flag","nation","country","banner"],char:"🇦🇫",fitzpatrick_scale:false,category:"flags"},aland_islands:{keywords:["Åland","islands","flag","nation","country","banner"],char:"🇦🇽",fitzpatrick_scale:false,category:"flags"},albania:{keywords:["al","flag","nation","country","banner"],char:"🇦🇱",fitzpatrick_scale:false,category:"flags"},algeria:{keywords:["dz","flag","nation","country","banner"],char:"🇩🇿",fitzpatrick_scale:false,category:"flags"},american_samoa:{keywords:["american","ws","flag","nation","country","banner"],char:"🇦🇸",fitzpatrick_scale:false,category:"flags"},andorra:{keywords:["ad","flag","nation","country","banner"],char:"🇦🇩",fitzpatrick_scale:false,category:"flags"},angola:{keywords:["ao","flag","nation","country","banner"],char:"🇦🇴",fitzpatrick_scale:false,category:"flags"},anguilla:{keywords:["ai","flag","nation","country","banner"],char:"🇦🇮",fitzpatrick_scale:false,category:"flags"},antarctica:{keywords:["aq","flag","nation","country","banner"],char:"🇦🇶",fitzpatrick_scale:false,category:"flags"},antigua_barbuda:{keywords:["antigua","barbuda","flag","nation","country","banner"],char:"🇦🇬",fitzpatrick_scale:false,category:"flags"},argentina:{keywords:["ar","flag","nation","country","banner"],char:"🇦🇷",fitzpatrick_scale:false,category:"flags"},armenia:{keywords:["am","flag","nation","country","banner"],char:"🇦🇲",fitzpatrick_scale:false,category:"flags"},aruba:{keywords:["aw","flag","nation","country","banner"],char:"🇦🇼",fitzpatrick_scale:false,category:"flags"},australia:{keywords:["au","flag","nation","country","banner"],char:"🇦🇺",fitzpatrick_scale:false,category:"flags"},austria:{keywords:["at","flag","nation","country","banner"],char:"🇦🇹",fitzpatrick_scale:false,category:"flags"},azerbaijan:{keywords:["az","flag","nation","country","banner"],char:"🇦🇿",fitzpatrick_scale:false,category:"flags"},bahamas:{keywords:["bs","flag","nation","country","banner"],char:"🇧🇸",fitzpatrick_scale:false,category:"flags"},bahrain:{keywords:["bh","flag","nation","country","banner"],char:"🇧🇭",fitzpatrick_scale:false,category:"flags"},bangladesh:{keywords:["bd","flag","nation","country","banner"],char:"🇧🇩",fitzpatrick_scale:false,category:"flags"},barbados:{keywords:["bb","flag","nation","country","banner"],char:"🇧🇧",fitzpatrick_scale:false,category:"flags"},belarus:{keywords:["by","flag","nation","country","banner"],char:"🇧🇾",fitzpatrick_scale:false,category:"flags"},belgium:{keywords:["be","flag","nation","country","banner"],char:"🇧🇪",fitzpatrick_scale:false,category:"flags"},belize:{keywords:["bz","flag","nation","country","banner"],char:"🇧🇿",fitzpatrick_scale:false,category:"flags"},benin:{keywords:["bj","flag","nation","country","banner"],char:"🇧🇯",fitzpatrick_scale:false,category:"flags"},bermuda:{keywords:["bm","flag","nation","country","banner"],char:"🇧🇲",fitzpatrick_scale:false,category:"flags"},bhutan:{keywords:["bt","flag","nation","country","banner"],char:"🇧🇹",fitzpatrick_scale:false,category:"flags"},bolivia:{keywords:["bo","flag","nation","country","banner"],char:"🇧🇴",fitzpatrick_scale:false,category:"flags"},caribbean_netherlands:{keywords:["bonaire","flag","nation","country","banner"],char:"🇧🇶",fitzpatrick_scale:false,category:"flags"},bosnia_herzegovina:{keywords:["bosnia","herzegovina","flag","nation","country","banner"],char:"🇧🇦",fitzpatrick_scale:false,category:"flags"},botswana:{keywords:["bw","flag","nation","country","banner"],char:"🇧🇼",fitzpatrick_scale:false,category:"flags"},brazil:{keywords:["br","flag","nation","country","banner"],char:"🇧🇷",fitzpatrick_scale:false,category:"flags"},british_indian_ocean_territory:{keywords:["british","indian","ocean","territory","flag","nation","country","banner"],char:"🇮🇴",fitzpatrick_scale:false,category:"flags"},british_virgin_islands:{keywords:["british","virgin","islands","bvi","flag","nation","country","banner"],char:"🇻🇬",fitzpatrick_scale:false,category:"flags"},brunei:{keywords:["bn","darussalam","flag","nation","country","banner"],char:"🇧🇳",fitzpatrick_scale:false,category:"flags"},bulgaria:{keywords:["bg","flag","nation","country","banner"],char:"🇧🇬",fitzpatrick_scale:false,category:"flags"},burkina_faso:{keywords:["burkina","faso","flag","nation","country","banner"],char:"🇧🇫",fitzpatrick_scale:false,category:"flags"},burundi:{keywords:["bi","flag","nation","country","banner"],char:"🇧🇮",fitzpatrick_scale:false,category:"flags"},cape_verde:{keywords:["cabo","verde","flag","nation","country","banner"],char:"🇨🇻",fitzpatrick_scale:false,category:"flags"},cambodia:{keywords:["kh","flag","nation","country","banner"],char:"🇰🇭",fitzpatrick_scale:false,category:"flags"},cameroon:{keywords:["cm","flag","nation","country","banner"],char:"🇨🇲",fitzpatrick_scale:false,category:"flags"},canada:{keywords:["ca","flag","nation","country","banner"],char:"🇨🇦",fitzpatrick_scale:false,category:"flags"},canary_islands:{keywords:["canary","islands","flag","nation","country","banner"],char:"🇮🇨",fitzpatrick_scale:false,category:"flags"},cayman_islands:{keywords:["cayman","islands","flag","nation","country","banner"],char:"🇰🇾",fitzpatrick_scale:false,category:"flags"},central_african_republic:{keywords:["central","african","republic","flag","nation","country","banner"],char:"🇨🇫",fitzpatrick_scale:false,category:"flags"},chad:{keywords:["td","flag","nation","country","banner"],char:"🇹🇩",fitzpatrick_scale:false,category:"flags"},chile:{keywords:["flag","nation","country","banner"],char:"🇨🇱",fitzpatrick_scale:false,category:"flags"},cn:{keywords:["china","chinese","prc","flag","country","nation","banner"],char:"🇨🇳",fitzpatrick_scale:false,category:"flags"},christmas_island:{keywords:["christmas","island","flag","nation","country","banner"],char:"🇨🇽",fitzpatrick_scale:false,category:"flags"},cocos_islands:{keywords:["cocos","keeling","islands","flag","nation","country","banner"],char:"🇨🇨",fitzpatrick_scale:false,category:"flags"},colombia:{keywords:["co","flag","nation","country","banner"],char:"🇨🇴",fitzpatrick_scale:false,category:"flags"},comoros:{keywords:["km","flag","nation","country","banner"],char:"🇰🇲",fitzpatrick_scale:false,category:"flags"},congo_brazzaville:{keywords:["congo","flag","nation","country","banner"],char:"🇨🇬",fitzpatrick_scale:false,category:"flags"},congo_kinshasa:{keywords:["congo","democratic","republic","flag","nation","country","banner"],char:"🇨🇩",fitzpatrick_scale:false,category:"flags"},cook_islands:{keywords:["cook","islands","flag","nation","country","banner"],char:"🇨🇰",fitzpatrick_scale:false,category:"flags"},costa_rica:{keywords:["costa","rica","flag","nation","country","banner"],char:"🇨🇷",fitzpatrick_scale:false,category:"flags"},croatia:{keywords:["hr","flag","nation","country","banner"],char:"🇭🇷",fitzpatrick_scale:false,category:"flags"},cuba:{keywords:["cu","flag","nation","country","banner"],char:"🇨🇺",fitzpatrick_scale:false,category:"flags"},curacao:{keywords:["curaçao","flag","nation","country","banner"],char:"🇨🇼",fitzpatrick_scale:false,category:"flags"},cyprus:{keywords:["cy","flag","nation","country","banner"],char:"🇨🇾",fitzpatrick_scale:false,category:"flags"},czech_republic:{keywords:["cz","flag","nation","country","banner"],char:"🇨🇿",fitzpatrick_scale:false,category:"flags"},denmark:{keywords:["dk","flag","nation","country","banner"],char:"🇩🇰",fitzpatrick_scale:false,category:"flags"},djibouti:{keywords:["dj","flag","nation","country","banner"],char:"🇩🇯",fitzpatrick_scale:false,category:"flags"},dominica:{keywords:["dm","flag","nation","country","banner"],char:"🇩🇲",fitzpatrick_scale:false,category:"flags"},dominican_republic:{keywords:["dominican","republic","flag","nation","country","banner"],char:"🇩🇴",fitzpatrick_scale:false,category:"flags"},ecuador:{keywords:["ec","flag","nation","country","banner"],char:"🇪🇨",fitzpatrick_scale:false,category:"flags"},egypt:{keywords:["eg","flag","nation","country","banner"],char:"🇪🇬",fitzpatrick_scale:false,category:"flags"},el_salvador:{keywords:["el","salvador","flag","nation","country","banner"],char:"🇸🇻",fitzpatrick_scale:false,category:"flags"},equatorial_guinea:{keywords:["equatorial","gn","flag","nation","country","banner"],char:"🇬🇶",fitzpatrick_scale:false,category:"flags"},eritrea:{keywords:["er","flag","nation","country","banner"],char:"🇪🇷",fitzpatrick_scale:false,category:"flags"},estonia:{keywords:["ee","flag","nation","country","banner"],char:"🇪🇪",fitzpatrick_scale:false,category:"flags"},ethiopia:{keywords:["et","flag","nation","country","banner"],char:"🇪🇹",fitzpatrick_scale:false,category:"flags"},eu:{keywords:["european","union","flag","banner"],char:"🇪🇺",fitzpatrick_scale:false,category:"flags"},falkland_islands:{keywords:["falkland","islands","malvinas","flag","nation","country","banner"],char:"🇫🇰",fitzpatrick_scale:false,category:"flags"},faroe_islands:{keywords:["faroe","islands","flag","nation","country","banner"],char:"🇫🇴",fitzpatrick_scale:false,category:"flags"},fiji:{keywords:["fj","flag","nation","country","banner"],char:"🇫🇯",fitzpatrick_scale:false,category:"flags"},finland:{keywords:["fi","flag","nation","country","banner"],char:"🇫🇮",fitzpatrick_scale:false,category:"flags"},fr:{keywords:["banner","flag","nation","france","french","country"],char:"🇫🇷",fitzpatrick_scale:false,category:"flags"},french_guiana:{keywords:["french","guiana","flag","nation","country","banner"],char:"🇬🇫",fitzpatrick_scale:false,category:"flags"},french_polynesia:{keywords:["french","polynesia","flag","nation","country","banner"],char:"🇵🇫",fitzpatrick_scale:false,category:"flags"},french_southern_territories:{keywords:["french","southern","territories","flag","nation","country","banner"],char:"🇹🇫",fitzpatrick_scale:false,category:"flags"},gabon:{keywords:["ga","flag","nation","country","banner"],char:"🇬🇦",fitzpatrick_scale:false,category:"flags"},gambia:{keywords:["gm","flag","nation","country","banner"],char:"🇬🇲",fitzpatrick_scale:false,category:"flags"},georgia:{keywords:["ge","flag","nation","country","banner"],char:"🇬🇪",fitzpatrick_scale:false,category:"flags"},de:{keywords:["german","nation","flag","country","banner"],char:"🇩🇪",fitzpatrick_scale:false,category:"flags"},ghana:{keywords:["gh","flag","nation","country","banner"],char:"🇬🇭",fitzpatrick_scale:false,category:"flags"},gibraltar:{keywords:["gi","flag","nation","country","banner"],char:"🇬🇮",fitzpatrick_scale:false,category:"flags"},greece:{keywords:["gr","flag","nation","country","banner"],char:"🇬🇷",fitzpatrick_scale:false,category:"flags"},greenland:{keywords:["gl","flag","nation","country","banner"],char:"🇬🇱",fitzpatrick_scale:false,category:"flags"},grenada:{keywords:["gd","flag","nation","country","banner"],char:"🇬🇩",fitzpatrick_scale:false,category:"flags"},guadeloupe:{keywords:["gp","flag","nation","country","banner"],char:"🇬🇵",fitzpatrick_scale:false,category:"flags"},guam:{keywords:["gu","flag","nation","country","banner"],char:"🇬🇺",fitzpatrick_scale:false,category:"flags"},guatemala:{keywords:["gt","flag","nation","country","banner"],char:"🇬🇹",fitzpatrick_scale:false,category:"flags"},guernsey:{keywords:["gg","flag","nation","country","banner"],char:"🇬🇬",fitzpatrick_scale:false,category:"flags"},guinea:{keywords:["gn","flag","nation","country","banner"],char:"🇬🇳",fitzpatrick_scale:false,category:"flags"},guinea_bissau:{keywords:["gw","bissau","flag","nation","country","banner"],char:"🇬🇼",fitzpatrick_scale:false,category:"flags"},guyana:{keywords:["gy","flag","nation","country","banner"],char:"🇬🇾",fitzpatrick_scale:false,category:"flags"},haiti:{keywords:["ht","flag","nation","country","banner"],char:"🇭🇹",fitzpatrick_scale:false,category:"flags"},honduras:{keywords:["hn","flag","nation","country","banner"],char:"🇭🇳",fitzpatrick_scale:false,category:"flags"},hong_kong:{keywords:["hong","kong","flag","nation","country","banner"],char:"🇭🇰",fitzpatrick_scale:false,category:"flags"},hungary:{keywords:["hu","flag","nation","country","banner"],char:"🇭🇺",fitzpatrick_scale:false,category:"flags"},iceland:{keywords:["is","flag","nation","country","banner"],char:"🇮🇸",fitzpatrick_scale:false,category:"flags"},india:{keywords:["in","flag","nation","country","banner"],char:"🇮🇳",fitzpatrick_scale:false,category:"flags"},indonesia:{keywords:["flag","nation","country","banner"],char:"🇮🇩",fitzpatrick_scale:false,category:"flags"},iran:{keywords:["iran,","islamic","republic","flag","nation","country","banner"],char:"🇮🇷",fitzpatrick_scale:false,category:"flags"},iraq:{keywords:["iq","flag","nation","country","banner"],char:"🇮🇶",fitzpatrick_scale:false,category:"flags"},ireland:{keywords:["ie","flag","nation","country","banner"],char:"🇮🇪",fitzpatrick_scale:false,category:"flags"},isle_of_man:{keywords:["isle","man","flag","nation","country","banner"],char:"🇮🇲",fitzpatrick_scale:false,category:"flags"},israel:{keywords:["il","flag","nation","country","banner"],char:"🇮🇱",fitzpatrick_scale:false,category:"flags"},it:{keywords:["italy","flag","nation","country","banner"],char:"🇮🇹",fitzpatrick_scale:false,category:"flags"},cote_divoire:{keywords:["ivory","coast","flag","nation","country","banner"],char:"🇨🇮",fitzpatrick_scale:false,category:"flags"},jamaica:{keywords:["jm","flag","nation","country","banner"],char:"🇯🇲",fitzpatrick_scale:false,category:"flags"},jp:{keywords:["japanese","nation","flag","country","banner"],char:"🇯🇵",fitzpatrick_scale:false,category:"flags"},jersey:{keywords:["je","flag","nation","country","banner"],char:"🇯🇪",fitzpatrick_scale:false,category:"flags"},jordan:{keywords:["jo","flag","nation","country","banner"],char:"🇯🇴",fitzpatrick_scale:false,category:"flags"},kazakhstan:{keywords:["kz","flag","nation","country","banner"],char:"🇰🇿",fitzpatrick_scale:false,category:"flags"},kenya:{keywords:["ke","flag","nation","country","banner"],char:"🇰🇪",fitzpatrick_scale:false,category:"flags"},kiribati:{keywords:["ki","flag","nation","country","banner"],char:"🇰🇮",fitzpatrick_scale:false,category:"flags"},kosovo:{keywords:["xk","flag","nation","country","banner"],char:"🇽🇰",fitzpatrick_scale:false,category:"flags"},kuwait:{keywords:["kw","flag","nation","country","banner"],char:"🇰🇼",fitzpatrick_scale:false,category:"flags"},kyrgyzstan:{keywords:["kg","flag","nation","country","banner"],char:"🇰🇬",fitzpatrick_scale:false,category:"flags"},laos:{keywords:["lao","democratic","republic","flag","nation","country","banner"],char:"🇱🇦",fitzpatrick_scale:false,category:"flags"},latvia:{keywords:["lv","flag","nation","country","banner"],char:"🇱🇻",fitzpatrick_scale:false,category:"flags"},lebanon:{keywords:["lb","flag","nation","country","banner"],char:"🇱🇧",fitzpatrick_scale:false,category:"flags"},lesotho:{keywords:["ls","flag","nation","country","banner"],char:"🇱🇸",fitzpatrick_scale:false,category:"flags"},liberia:{keywords:["lr","flag","nation","country","banner"],char:"🇱🇷",fitzpatrick_scale:false,category:"flags"},libya:{keywords:["ly","flag","nation","country","banner"],char:"🇱🇾",fitzpatrick_scale:false,category:"flags"},liechtenstein:{keywords:["li","flag","nation","country","banner"],char:"🇱🇮",fitzpatrick_scale:false,category:"flags"},lithuania:{keywords:["lt","flag","nation","country","banner"],char:"🇱🇹",fitzpatrick_scale:false,category:"flags"},luxembourg:{keywords:["lu","flag","nation","country","banner"],char:"🇱🇺",fitzpatrick_scale:false,category:"flags"},macau:{keywords:["macao","flag","nation","country","banner"],char:"🇲🇴",fitzpatrick_scale:false,category:"flags"},macedonia:{keywords:["macedonia,","flag","nation","country","banner"],char:"🇲🇰",fitzpatrick_scale:false,category:"flags"},madagascar:{keywords:["mg","flag","nation","country","banner"],char:"🇲🇬",fitzpatrick_scale:false,category:"flags"},malawi:{keywords:["mw","flag","nation","country","banner"],char:"🇲🇼",fitzpatrick_scale:false,category:"flags"},malaysia:{keywords:["my","flag","nation","country","banner"],char:"🇲🇾",fitzpatrick_scale:false,category:"flags"},maldives:{keywords:["mv","flag","nation","country","banner"],char:"🇲🇻",fitzpatrick_scale:false,category:"flags"},mali:{keywords:["ml","flag","nation","country","banner"],char:"🇲🇱",fitzpatrick_scale:false,category:"flags"},malta:{keywords:["mt","flag","nation","country","banner"],char:"🇲🇹",fitzpatrick_scale:false,category:"flags"},marshall_islands:{keywords:["marshall","islands","flag","nation","country","banner"],char:"🇲🇭",fitzpatrick_scale:false,category:"flags"},martinique:{keywords:["mq","flag","nation","country","banner"],char:"🇲🇶",fitzpatrick_scale:false,category:"flags"},mauritania:{keywords:["mr","flag","nation","country","banner"],char:"🇲🇷",fitzpatrick_scale:false,category:"flags"},mauritius:{keywords:["mu","flag","nation","country","banner"],char:"🇲🇺",fitzpatrick_scale:false,category:"flags"},mayotte:{keywords:["yt","flag","nation","country","banner"],char:"🇾🇹",fitzpatrick_scale:false,category:"flags"},mexico:{keywords:["mx","flag","nation","country","banner"],char:"🇲🇽",fitzpatrick_scale:false,category:"flags"},micronesia:{keywords:["micronesia,","federated","states","flag","nation","country","banner"],char:"🇫🇲",fitzpatrick_scale:false,category:"flags"},moldova:{keywords:["moldova,","republic","flag","nation","country","banner"],char:"🇲🇩",fitzpatrick_scale:false,category:"flags"},monaco:{keywords:["mc","flag","nation","country","banner"],char:"🇲🇨",fitzpatrick_scale:false,category:"flags"},mongolia:{keywords:["mn","flag","nation","country","banner"],char:"🇲🇳",fitzpatrick_scale:false,category:"flags"},montenegro:{keywords:["me","flag","nation","country","banner"],char:"🇲🇪",fitzpatrick_scale:false,category:"flags"},montserrat:{keywords:["ms","flag","nation","country","banner"],char:"🇲🇸",fitzpatrick_scale:false,category:"flags"},morocco:{keywords:["ma","flag","nation","country","banner"],char:"🇲🇦",fitzpatrick_scale:false,category:"flags"},mozambique:{keywords:["mz","flag","nation","country","banner"],char:"🇲🇿",fitzpatrick_scale:false,category:"flags"},myanmar:{keywords:["mm","flag","nation","country","banner"],char:"🇲🇲",fitzpatrick_scale:false,category:"flags"},namibia:{keywords:["na","flag","nation","country","banner"],char:"🇳🇦",fitzpatrick_scale:false,category:"flags"},nauru:{keywords:["nr","flag","nation","country","banner"],char:"🇳🇷",fitzpatrick_scale:false,category:"flags"},nepal:{keywords:["np","flag","nation","country","banner"],char:"🇳🇵",fitzpatrick_scale:false,category:"flags"},netherlands:{keywords:["nl","flag","nation","country","banner"],char:"🇳🇱",fitzpatrick_scale:false,category:"flags"},new_caledonia:{keywords:["new","caledonia","flag","nation","country","banner"],char:"🇳🇨",fitzpatrick_scale:false,category:"flags"},new_zealand:{keywords:["new","zealand","flag","nation","country","banner"],char:"🇳🇿",fitzpatrick_scale:false,category:"flags"},nicaragua:{keywords:["ni","flag","nation","country","banner"],char:"🇳🇮",fitzpatrick_scale:false,category:"flags"},niger:{keywords:["ne","flag","nation","country","banner"],char:"🇳🇪",fitzpatrick_scale:false,category:"flags"},nigeria:{keywords:["flag","nation","country","banner"],char:"🇳🇬",fitzpatrick_scale:false,category:"flags"},niue:{keywords:["nu","flag","nation","country","banner"],char:"🇳🇺",fitzpatrick_scale:false,category:"flags"},norfolk_island:{keywords:["norfolk","island","flag","nation","country","banner"],char:"🇳🇫",fitzpatrick_scale:false,category:"flags"},northern_mariana_islands:{keywords:["northern","mariana","islands","flag","nation","country","banner"],char:"🇲🇵",fitzpatrick_scale:false,category:"flags"},north_korea:{keywords:["north","korea","nation","flag","country","banner"],char:"🇰🇵",fitzpatrick_scale:false,category:"flags"},norway:{keywords:["no","flag","nation","country","banner"],char:"🇳🇴",fitzpatrick_scale:false,category:"flags"},oman:{keywords:["om_symbol","flag","nation","country","banner"],char:"🇴🇲",fitzpatrick_scale:false,category:"flags"},pakistan:{keywords:["pk","flag","nation","country","banner"],char:"🇵🇰",fitzpatrick_scale:false,category:"flags"},palau:{keywords:["pw","flag","nation","country","banner"],char:"🇵🇼",fitzpatrick_scale:false,category:"flags"},palestinian_territories:{keywords:["palestine","palestinian","territories","flag","nation","country","banner"],char:"🇵🇸",fitzpatrick_scale:false,category:"flags"},panama:{keywords:["pa","flag","nation","country","banner"],char:"🇵🇦",fitzpatrick_scale:false,category:"flags"},papua_new_guinea:{keywords:["papua","new","guinea","flag","nation","country","banner"],char:"🇵🇬",fitzpatrick_scale:false,category:"flags"},paraguay:{keywords:["py","flag","nation","country","banner"],char:"🇵🇾",fitzpatrick_scale:false,category:"flags"},peru:{keywords:["pe","flag","nation","country","banner"],char:"🇵🇪",fitzpatrick_scale:false,category:"flags"},philippines:{keywords:["ph","flag","nation","country","banner"],char:"🇵🇭",fitzpatrick_scale:false,category:"flags"},pitcairn_islands:{keywords:["pitcairn","flag","nation","country","banner"],char:"🇵🇳",fitzpatrick_scale:false,category:"flags"},poland:{keywords:["pl","flag","nation","country","banner"],char:"🇵🇱",fitzpatrick_scale:false,category:"flags"},portugal:{keywords:["pt","flag","nation","country","banner"],char:"🇵🇹",fitzpatrick_scale:false,category:"flags"},puerto_rico:{keywords:["puerto","rico","flag","nation","country","banner"],char:"🇵🇷",fitzpatrick_scale:false,category:"flags"},qatar:{keywords:["qa","flag","nation","country","banner"],char:"🇶🇦",fitzpatrick_scale:false,category:"flags"},reunion:{keywords:["réunion","flag","nation","country","banner"],char:"🇷🇪",fitzpatrick_scale:false,category:"flags"},romania:{keywords:["ro","flag","nation","country","banner"],char:"🇷🇴",fitzpatrick_scale:false,category:"flags"},ru:{keywords:["russian","federation","flag","nation","country","banner"],char:"🇷🇺",fitzpatrick_scale:false,category:"flags"},rwanda:{keywords:["rw","flag","nation","country","banner"],char:"🇷🇼",fitzpatrick_scale:false,category:"flags"},st_barthelemy:{keywords:["saint","barthélemy","flag","nation","country","banner"],char:"🇧🇱",fitzpatrick_scale:false,category:"flags"},st_helena:{keywords:["saint","helena","ascension","tristan","cunha","flag","nation","country","banner"],char:"🇸🇭",fitzpatrick_scale:false,category:"flags"},st_kitts_nevis:{keywords:["saint","kitts","nevis","flag","nation","country","banner"],char:"🇰🇳",fitzpatrick_scale:false,category:"flags"},st_lucia:{keywords:["saint","lucia","flag","nation","country","banner"],char:"🇱🇨",fitzpatrick_scale:false,category:"flags"},st_pierre_miquelon:{keywords:["saint","pierre","miquelon","flag","nation","country","banner"],char:"🇵🇲",fitzpatrick_scale:false,category:"flags"},st_vincent_grenadines:{keywords:["saint","vincent","grenadines","flag","nation","country","banner"],char:"🇻🇨",fitzpatrick_scale:false,category:"flags"},samoa:{keywords:["ws","flag","nation","country","banner"],char:"🇼🇸",fitzpatrick_scale:false,category:"flags"},san_marino:{keywords:["san","marino","flag","nation","country","banner"],char:"🇸🇲",fitzpatrick_scale:false,category:"flags"},sao_tome_principe:{keywords:["sao","tome","principe","flag","nation","country","banner"],char:"🇸🇹",fitzpatrick_scale:false,category:"flags"},saudi_arabia:{keywords:["flag","nation","country","banner"],char:"🇸🇦",fitzpatrick_scale:false,category:"flags"},senegal:{keywords:["sn","flag","nation","country","banner"],char:"🇸🇳",fitzpatrick_scale:false,category:"flags"},serbia:{keywords:["rs","flag","nation","country","banner"],char:"🇷🇸",fitzpatrick_scale:false,category:"flags"},seychelles:{keywords:["sc","flag","nation","country","banner"],char:"🇸🇨",fitzpatrick_scale:false,category:"flags"},sierra_leone:{keywords:["sierra","leone","flag","nation","country","banner"],char:"🇸🇱",fitzpatrick_scale:false,category:"flags"},singapore:{keywords:["sg","flag","nation","country","banner"],char:"🇸🇬",fitzpatrick_scale:false,category:"flags"},sint_maarten:{keywords:["sint","maarten","dutch","flag","nation","country","banner"],char:"🇸🇽",fitzpatrick_scale:false,category:"flags"},slovakia:{keywords:["sk","flag","nation","country","banner"],char:"🇸🇰",fitzpatrick_scale:false,category:"flags"},slovenia:{keywords:["si","flag","nation","country","banner"],char:"🇸🇮",fitzpatrick_scale:false,category:"flags"},solomon_islands:{keywords:["solomon","islands","flag","nation","country","banner"],char:"🇸🇧",fitzpatrick_scale:false,category:"flags"},somalia:{keywords:["so","flag","nation","country","banner"],char:"🇸🇴",fitzpatrick_scale:false,category:"flags"},south_africa:{keywords:["south","africa","flag","nation","country","banner"],char:"🇿🇦",fitzpatrick_scale:false,category:"flags"},south_georgia_south_sandwich_islands:{keywords:["south","georgia","sandwich","islands","flag","nation","country","banner"],char:"🇬🇸",fitzpatrick_scale:false,category:"flags"},kr:{keywords:["south","korea","nation","flag","country","banner"],char:"🇰🇷",fitzpatrick_scale:false,category:"flags"},south_sudan:{keywords:["south","sd","flag","nation","country","banner"],char:"🇸🇸",fitzpatrick_scale:false,category:"flags"},es:{keywords:["spain","flag","nation","country","banner"],char:"🇪🇸",fitzpatrick_scale:false,category:"flags"},sri_lanka:{keywords:["sri","lanka","flag","nation","country","banner"],char:"🇱🇰",fitzpatrick_scale:false,category:"flags"},sudan:{keywords:["sd","flag","nation","country","banner"],char:"🇸🇩",fitzpatrick_scale:false,category:"flags"},suriname:{keywords:["sr","flag","nation","country","banner"],char:"🇸🇷",fitzpatrick_scale:false,category:"flags"},swaziland:{keywords:["sz","flag","nation","country","banner"],char:"🇸🇿",fitzpatrick_scale:false,category:"flags"},sweden:{keywords:["se","flag","nation","country","banner"],char:"🇸🇪",fitzpatrick_scale:false,category:"flags"},switzerland:{keywords:["ch","flag","nation","country","banner"],char:"🇨🇭",fitzpatrick_scale:false,category:"flags"},syria:{keywords:["syrian","arab","republic","flag","nation","country","banner"],char:"🇸🇾",fitzpatrick_scale:false,category:"flags"},taiwan:{keywords:["tw","flag","nation","country","banner"],char:"🇹🇼",fitzpatrick_scale:false,category:"flags"},tajikistan:{keywords:["tj","flag","nation","country","banner"],char:"🇹🇯",fitzpatrick_scale:false,category:"flags"},tanzania:{keywords:["tanzania,","united","republic","flag","nation","country","banner"],char:"🇹🇿",fitzpatrick_scale:false,category:"flags"},thailand:{keywords:["th","flag","nation","country","banner"],char:"🇹🇭",fitzpatrick_scale:false,category:"flags"},timor_leste:{keywords:["timor","leste","flag","nation","country","banner"],char:"🇹🇱",fitzpatrick_scale:false,category:"flags"},togo:{keywords:["tg","flag","nation","country","banner"],char:"🇹🇬",fitzpatrick_scale:false,category:"flags"},tokelau:{keywords:["tk","flag","nation","country","banner"],char:"🇹🇰",fitzpatrick_scale:false,category:"flags"},tonga:{keywords:["to","flag","nation","country","banner"],char:"🇹🇴",fitzpatrick_scale:false,category:"flags"},trinidad_tobago:{keywords:["trinidad","tobago","flag","nation","country","banner"],char:"🇹🇹",fitzpatrick_scale:false,category:"flags"},tunisia:{keywords:["tn","flag","nation","country","banner"],char:"🇹🇳",fitzpatrick_scale:false,category:"flags"},tr:{keywords:["turkey","flag","nation","country","banner"],char:"🇹🇷",fitzpatrick_scale:false,category:"flags"},turkmenistan:{keywords:["flag","nation","country","banner"],char:"🇹🇲",fitzpatrick_scale:false,category:"flags"},turks_caicos_islands:{keywords:["turks","caicos","islands","flag","nation","country","banner"],char:"🇹🇨",fitzpatrick_scale:false,category:"flags"},tuvalu:{keywords:["flag","nation","country","banner"],char:"🇹🇻",fitzpatrick_scale:false,category:"flags"},uganda:{keywords:["ug","flag","nation","country","banner"],char:"🇺🇬",fitzpatrick_scale:false,category:"flags"},ukraine:{keywords:["ua","flag","nation","country","banner"],char:"🇺🇦",fitzpatrick_scale:false,category:"flags"},united_arab_emirates:{keywords:["united","arab","emirates","flag","nation","country","banner"],char:"🇦🇪",fitzpatrick_scale:false,category:"flags"},uk:{keywords:["united","kingdom","great","britain","northern","ireland","flag","nation","country","banner","british","UK","english","england","union jack"],char:"🇬🇧",fitzpatrick_scale:false,category:"flags"},england:{keywords:["flag","english"],char:"🏴",fitzpatrick_scale:false,category:"flags"},scotland:{keywords:["flag","scottish"],char:"🏴",fitzpatrick_scale:false,category:"flags"},wales:{keywords:["flag","welsh"],char:"🏴",fitzpatrick_scale:false,category:"flags"},us:{keywords:["united","states","america","flag","nation","country","banner"],char:"🇺🇸",fitzpatrick_scale:false,category:"flags"},us_virgin_islands:{keywords:["virgin","islands","us","flag","nation","country","banner"],char:"🇻🇮",fitzpatrick_scale:false,category:"flags"},uruguay:{keywords:["uy","flag","nation","country","banner"],char:"🇺🇾",fitzpatrick_scale:false,category:"flags"},uzbekistan:{keywords:["uz","flag","nation","country","banner"],char:"🇺🇿",fitzpatrick_scale:false,category:"flags"},vanuatu:{keywords:["vu","flag","nation","country","banner"],char:"🇻🇺",fitzpatrick_scale:false,category:"flags"},vatican_city:{keywords:["vatican","city","flag","nation","country","banner"],char:"🇻🇦",fitzpatrick_scale:false,category:"flags"},venezuela:{keywords:["ve","bolivarian","republic","flag","nation","country","banner"],char:"🇻🇪",fitzpatrick_scale:false,category:"flags"},vietnam:{keywords:["viet","nam","flag","nation","country","banner"],char:"🇻🇳",fitzpatrick_scale:false,category:"flags"},wallis_futuna:{keywords:["wallis","futuna","flag","nation","country","banner"],char:"🇼🇫",fitzpatrick_scale:false,category:"flags"},western_sahara:{keywords:["western","sahara","flag","nation","country","banner"],char:"🇪🇭",fitzpatrick_scale:false,category:"flags"},yemen:{keywords:["ye","flag","nation","country","banner"],char:"🇾🇪",fitzpatrick_scale:false,category:"flags"},zambia:{keywords:["zm","flag","nation","country","banner"],char:"🇿🇲",fitzpatrick_scale:false,category:"flags"},zimbabwe:{keywords:["zw","flag","nation","country","banner"],char:"🇿🇼",fitzpatrick_scale:false,category:"flags"},united_nations:{keywords:["un","flag","banner"],char:"🇺🇳",fitzpatrick_scale:false,category:"flags"},pirate_flag:{keywords:["skull","crossbones","flag","banner"],char:"🏴☠️",fitzpatrick_scale:false,category:"flags"}})},(e,t,o)=>{o(16)},()=>{(function(){"use strict";const e=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const o=e=>({isFullscreen:()=>e.get()!==null});const n=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const s=e=>{const t=typeof e;if(e===null){return"null"}else if(t==="object"&&Array.isArray(e)){return"array"}else if(t==="object"&&n(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return t}};const r=e=>t=>s(t)===e;const a=e=>t=>typeof t===e;const c=e=>t=>e===t;const i=r("string");const l=r("object");const d=r("array");const u=c(null);const f=a("boolean");const m=c(undefined);const g=e=>e===null||e===undefined;const p=e=>!g(e);const h=a("function");const y=a("number");const b=()=>{};const v=(e,t)=>(...o)=>e(t.apply(null,o));const k=(e,t)=>o=>e(t(o));const w=e=>()=>e;function _(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const x=w(false);const C=w(true);class S{constructor(e,t){this.tag=e;this.value=t}static some(e){return new S(true,e)}static none(){return S.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return S.some(e(this.value))}else{return S.none()}}bind(e){if(this.tag){return e(this.value)}else{return S.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return S.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return p(e)?S.some(e):S.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}S.singletonNone=new S(false);const z=Array.prototype.push;const T=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const E=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const O=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const A=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){return S.some(s)}else if(o(s,n)){break}}return S.none()};const D=(e,t)=>A(e,t,x);const N=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!d(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}z.apply(t,e[o])}return t};const M=(e,t)=>N(T(e,t));const R=(e,t)=>t>=0&&t<e.length?S.some(e[t]):S.none();const B=e=>R(e,0);const L=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return S.none()};const H=(e,t,o)=>e.isSome()&&t.isSome()?S.some(o(e.getOrDie(),t.getOrDie())):S.none();const I=t=>{const o=e(S.none());const n=()=>o.get().each(t);const s=()=>{n();o.set(S.none())};const r=()=>o.get().isSome();const a=()=>o.get();const c=e=>{n();o.set(S.some(e))};return{clear:s,isSet:r,get:a,set:c}};const P=()=>I((e=>e.unbind()));const F=()=>{const e=I(b);const t=t=>e.get().each(t);return{...e,on:t}};const V=(e,t)=>{let o=null;const n=()=>{if(!u(o)){clearTimeout(o);o=null}};const s=(...n)=>{if(u(o)){o=setTimeout((()=>{o=null;e.apply(null,n)}),t)}};return{cancel:n,throttle:s}};const j=Object.keys;const Z=(e,t)=>{const o=j(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const U=typeof window!=="undefined"?window:Function("return this;")();const q=(e,t)=>{let o=t!==undefined&&t!==null?t:U;for(let t=0;t<e.length&&o!==undefined&&o!==null;++t){o=o[e[t]]}return o};const W=(e,t)=>{const o=e.split(".");return q(o,t)};const $=(e,t)=>W(e,t);const G=(e,t)=>{const o=$(e,t);if(o===undefined||o===null){throw new Error(e+" not available on this browser")}return o};const K=Object.getPrototypeOf;const Y=e=>G("HTMLElement",e);const X=e=>{const t=W("ownerDocument.defaultView",e);return l(e)&&(Y(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(K(e).constructor.name))};const J=9;const Q=11;const ee=1;const te=3;const oe=e=>e.dom.nodeType;const ne=e=>t=>oe(t)===e;const se=e=>re(e)&&X(e.dom);const re=ne(ee);const ae=ne(te);const ce=ne(J);const ie=ne(Q);const le=(e,t,o)=>{if(i(o)||f(o)||y(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const de=(e,t,o)=>{le(e.dom,t,o)};const ue=(e,t)=>{const o=e.dom.getAttribute(t);return o===null?undefined:o};const fe=(e,t)=>{e.dom.removeAttribute(t)};const me=e=>e.dom.classList!==undefined;const ge=(e,t)=>me(e)&&e.dom.classList.contains(t);const pe=(e,t,o=0,n)=>{const s=e.indexOf(t,o);if(s!==-1){return m(n)?true:s+t.length<=n}else{return false}};const he=e=>e.style!==undefined&&h(e.style.getPropertyValue);const ye=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return ke(n.childNodes[0])};const be=(e,t)=>{const o=t||document;const n=o.createElement(e);return ke(n)};const ve=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return ke(n)};const ke=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const we=(e,t,o)=>S.from(e.dom.elementFromPoint(t,o)).map(ke);const _e={fromHtml:ye,fromTag:be,fromText:ve,fromDom:ke,fromPoint:we};const xe=(e,t)=>{const o=e.dom;if(o.nodeType!==ee){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const Ce=e=>e.nodeType!==ee&&e.nodeType!==J&&e.nodeType!==Q||e.childElementCount===0;const Se=(e,t)=>{const o=t===undefined?document:t.dom;return Ce(o)?[]:T(o.querySelectorAll(e),_e.fromDom)};const ze=(e,t)=>e.dom===t.dom;const Te=e=>_e.fromDom(e.dom.ownerDocument);const Ee=e=>ce(e)?e:Te(e);const Oe=e=>S.from(e.dom.parentNode).map(_e.fromDom);const Ae=(e,t)=>{const o=h(t)?t:x;let n=e.dom;const s=[];while(n.parentNode!==null&&n.parentNode!==undefined){const e=n.parentNode;const t=_e.fromDom(e);s.push(t);if(o(t)===true){break}else{n=e}}return s};const De=e=>{const t=t=>O(t,(t=>!ze(e,t)));return Oe(e).map(Me).map(t).getOr([])};const Ne=e=>S.from(e.dom.nextSibling).map(_e.fromDom);const Me=e=>T(e.dom.childNodes,_e.fromDom);const Re=e=>ie(e)&&p(e.dom.host);const Be=h(Element.prototype.attachShadow)&&h(Node.prototype.getRootNode);const Le=w(Be);const He=Be?e=>_e.fromDom(e.dom.getRootNode()):Ee;const Ie=e=>{const t=He(e);return Re(t)?S.some(t):S.none()};const Pe=e=>_e.fromDom(e.dom.host);const Fe=e=>{if(Le()&&p(e.target)){const t=_e.fromDom(e.target);if(re(t)&&Ve(t)){if(e.composed&&e.composedPath){const t=e.composedPath();if(t){return B(t)}}}}return S.from(e.target)};const Ve=e=>p(e.dom.shadowRoot);const je=e=>{const t=ae(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return Ie(_e.fromDom(t)).fold((()=>o.body.contains(t)),k(je,Pe))};const Ze=e=>{const t=e.dom.body;if(t===null||t===undefined){throw new Error("Body is not available yet")}return _e.fromDom(t)};const Ue=(e,t,o)=>{if(!i(o)){console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e);throw new Error("CSS value must be a string: "+o)}if(he(e)){e.style.setProperty(t,o)}};const qe=(e,t,o)=>{const n=e.dom;Ue(n,t,o)};const We=(e,t)=>{const o=e.dom;Z(t,((e,t)=>{Ue(o,t,e)}))};const $e=(e,t)=>{const o=e.dom;const n=window.getComputedStyle(o);const s=n.getPropertyValue(t);return s===""&&!je(e)?Ge(o,t):s};const Ge=(e,t)=>he(e)?e.style.getPropertyValue(t):"";const Ke=(e,t,o,n,s,r,a)=>({target:e,x:t,y:o,stop:n,prevent:s,kill:r,raw:a});const Ye=e=>{const t=_e.fromDom(Fe(e).getOr(e.target));const o=()=>e.stopPropagation();const n=()=>e.preventDefault();const s=v(n,o);return Ke(t,e.clientX,e.clientY,o,n,s,e)};const Xe=(e,t)=>o=>{if(e(o)){t(Ye(o))}};const Je=(e,t,o,n,s)=>{const r=Xe(o,n);e.dom.addEventListener(t,r,s);return{unbind:_(et,e,t,r,s)}};const Qe=(e,t,o,n)=>Je(e,t,o,n,false);const et=(e,t,o,n)=>{e.dom.removeEventListener(t,o,n)};const tt=C;const ot=(e,t,o)=>Qe(e,t,tt,o);const nt=e=>{let t=false;let o;return(...n)=>{if(!t){t=true;o=e.apply(null,n)}return o}};const st=(e,t,o,n)=>{const s=e.isiOS()&&/ipad/i.test(o)===true;const r=e.isiOS()&&!s;const a=e.isiOS()||e.isAndroid();const c=a||n("(pointer:coarse)");const i=s||!r&&a&&n("(min-device-width:768px)");const l=r||a&&!i;const d=t.isSafari()&&e.isiOS()&&/safari/i.test(o)===false;const u=!l&&!i&&!d;return{isiPad:w(s),isiPhone:w(r),isTablet:w(i),isPhone:w(l),isTouch:w(c),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:w(d),isDesktop:w(u)}};const rt=(e,t)=>{for(let o=0;o<e.length;o++){const n=e[o];if(n.test(t)){return n}}return undefined};const at=(e,t)=>{const o=rt(e,t);if(!o){return{major:0,minor:0}}const n=e=>Number(t.replace(o,"$"+e));return lt(n(1),n(2))};const ct=(e,t)=>{const o=String(t).toLowerCase();if(e.length===0){return it()}return at(e,o)};const it=()=>lt(0,0);const lt=(e,t)=>({major:e,minor:t});const dt={nu:lt,detect:ct,unknown:it};const ut=(e,t)=>L(t.brands,(t=>{const o=t.brand.toLowerCase();return D(e,(e=>{var t;return o===((t=e.brand)===null||t===void 0?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:dt.nu(parseInt(t.version,10),0)})))}));const ft=(e,t)=>{const o=String(t).toLowerCase();return D(e,(e=>e.search(o)))};const mt=(e,t)=>ft(e,t).map((e=>{const o=dt.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const gt=(e,t)=>ft(e,t).map((e=>{const o=dt.detect(e.versionRegexes,t);return{current:e.name,version:o}}));const pt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/;const ht=e=>t=>pe(t,e);const yt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>pe(e,"edge/")&&pe(e,"chrome")&&pe(e,"safari")&&pe(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,pt],search:e=>pe(e,"chrome")&&!pe(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>pe(e,"msie")||pe(e,"trident")},{name:"Opera",versionRegexes:[pt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ht("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ht("firefox")},{name:"Safari",versionRegexes:[pt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(pe(e,"safari")||pe(e,"mobile/"))&&pe(e,"applewebkit")}];const bt=[{name:"Windows",search:ht("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>pe(e,"iphone")||pe(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ht("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:ht("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ht("linux"),versionRegexes:[]},{name:"Solaris",search:ht("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ht("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ht("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}];const vt={browsers:w(yt),oses:w(bt)};const kt="Edge";const wt="Chromium";const _t="IE";const xt="Opera";const Ct="Firefox";const St="Safari";const zt=()=>Tt({current:undefined,version:dt.unknown()});const Tt=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isEdge:n(kt),isChromium:n(wt),isIE:n(_t),isOpera:n(xt),isFirefox:n(Ct),isSafari:n(St)}};const Et={unknown:zt,nu:Tt,edge:w(kt),chromium:w(wt),ie:w(_t),opera:w(xt),firefox:w(Ct),safari:w(St)};const Ot="Windows";const At="iOS";const Dt="Android";const Nt="Linux";const Mt="macOS";const Rt="Solaris";const Bt="FreeBSD";const Lt="ChromeOS";const Ht=()=>It({current:undefined,version:dt.unknown()});const It=e=>{const t=e.current;const o=e.version;const n=e=>()=>t===e;return{current:t,version:o,isWindows:n(Ot),isiOS:n(At),isAndroid:n(Dt),isMacOS:n(Mt),isLinux:n(Nt),isSolaris:n(Rt),isFreeBSD:n(Bt),isChromeOS:n(Lt)}};const Pt={unknown:Ht,nu:It,windows:w(Ot),ios:w(At),android:w(Dt),linux:w(Nt),macos:w(Mt),solaris:w(Rt),freebsd:w(Bt),chromeos:w(Lt)};const Ft=(e,t,o)=>{const n=vt.browsers();const s=vt.oses();const r=t.bind((e=>ut(n,e))).orThunk((()=>mt(n,e))).fold(Et.unknown,Et.nu);const a=gt(s,e).fold(Pt.unknown,Pt.nu);const c=st(a,r,e,o);return{browser:r,os:a,deviceType:c}};const Vt={detect:Ft};const jt=e=>window.matchMedia(e).matches;let Zt=nt((()=>Vt.detect(navigator.userAgent,S.from(navigator.userAgentData),jt)));const Ut=()=>Zt();const qt=(e,t)=>{const o=(o,n)=>qt(e+o,t+n);return{left:e,top:t,translate:o}};const Wt=qt;const $t=e=>{const t=e!==undefined?e.dom:document;const o=t.body.scrollLeft||t.documentElement.scrollLeft;const n=t.body.scrollTop||t.documentElement.scrollTop;return Wt(o,n)};const Gt=e=>{const t=e===undefined?window:e;if(Ut().browser.isFirefox()){return S.none()}else{return S.from(t.visualViewport)}};const Kt=(e,t,o,n)=>({x:e,y:t,width:o,height:n,right:e+o,bottom:t+n});const Yt=e=>{const t=e===undefined?window:e;const o=t.document;const n=$t(_e.fromDom(o));return Gt(t).fold((()=>{const e=t.document.documentElement;const o=e.clientWidth;const s=e.clientHeight;return Kt(n.left,n.top,o,s)}),(e=>Kt(Math.max(e.pageLeft,n.left),Math.max(e.pageTop,n.top),e.width,e.height)))};const Xt=(e,t,o)=>Gt(o).map((o=>{const n=e=>t(Ye(e));o.addEventListener(e,n);return{unbind:()=>o.removeEventListener(e,n)}})).getOrThunk((()=>({unbind:b})));var Jt=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");var Qt=tinymce.util.Tools.resolve("tinymce.Env");const eo=(e,t)=>{e.dispatch("FullscreenStateChanged",{state:t});e.dispatch("ResizeEditor")};const to=e=>t=>t.options.get(e);const oo=e=>{const t=e.options.register;t("fullscreen_native",{processor:"boolean",default:false})};const no=to("fullscreen_native");const so=e=>{const t=_e.fromDom(e.getElement());return Ie(t).map(Pe).getOrThunk((()=>Ze(Te(t))))};const ro=e=>{if(e.fullscreenElement!==undefined){return e.fullscreenElement}else if(e.msFullscreenElement!==undefined){return e.msFullscreenElement}else if(e.webkitFullscreenElement!==undefined){return e.webkitFullscreenElement}else{return null}};const ao=()=>{if(document.fullscreenElement!==undefined){return"fullscreenchange"}else if(document.msFullscreenElement!==undefined){return"MSFullscreenChange"}else if(document.webkitFullscreenElement!==undefined){return"webkitfullscreenchange"}else{return"fullscreenchange"}};const co=e=>{const t=e.dom;if(t.requestFullscreen){t.requestFullscreen()}else if(t.msRequestFullscreen){t.msRequestFullscreen()}else if(t.webkitRequestFullScreen){t.webkitRequestFullScreen()}};const io=e=>{const t=e.dom;if(t.exitFullscreen){t.exitFullscreen()}else if(t.msExitFullscreen){t.msExitFullscreen()}else if(t.webkitCancelFullScreen){t.webkitCancelFullScreen()}};const lo=e=>e.dom===ro(Te(e).dom);const uo=(e,t,o)=>O(Ae(e,o),t);const fo=(e,t)=>O(De(e),t);const mo=e=>Se(e);const go=(e,t,o)=>uo(e,(e=>xe(e,t)),o);const po=(e,t)=>fo(e,(e=>xe(e,t)));const ho="data-ephox-mobile-fullscreen-style";const yo="display:none!important;";const bo="position:absolute!important;";const vo="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;";const ko="background-color:rgb(255,255,255)!important;";const wo=Qt.os.isAndroid();const _o=e=>{const t=$e(e,"background-color");return t!==undefined&&t!==""?"background-color:"+t+"!important":ko};const xo=(e,t,o)=>{const n=e=>po(e,"*:not(.tox-silver-sink)");const s=t=>o=>{const n=ue(o,"style");const s=n===undefined?"no-styles":n.trim();if(s===t){return}else{de(o,ho,s);We(o,e.parseStyle(t))}};const r=go(t,"*");const a=M(r,n);const c=_o(o);E(a,s(yo));E(r,s(bo+vo+c));const i=wo===true?"":bo;s(i+vo+c)(t)};const Co=e=>{const t=mo("["+ho+"]");E(t,(t=>{const o=ue(t,ho);if(o&&o!=="no-styles"){We(t,e.parseStyle(o))}else{fe(t,"style")}fe(t,ho)}))};const So=Jt.DOM;const zo=()=>Yt(window);const To=e=>window.scrollTo(e.x,e.y);const Eo=Gt().fold((()=>({bind:b,unbind:b})),(e=>{const t=F();const o=P();const n=P();const s=()=>{document.body.scrollTop=0;document.documentElement.scrollTop=0};const r=()=>{window.requestAnimationFrame((()=>{t.on((t=>We(t,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})))}))};const a=V((()=>{s();r()}),50);const c=e=>{t.set(e);a.throttle();o.set(Xt("resize",a.throttle));n.set(Xt("scroll",a.throttle))};const i=()=>{t.on((()=>{o.clear();n.clear()}));t.clear()};return{bind:c,unbind:i}}));const Oo=(e,t)=>{const o=document.body;const n=document.documentElement;const s=e.getContainer();const r=_e.fromDom(s);const a=Ne(r).filter((e=>se(e)&&ge(e,"tox-silver-sink")));const c=so(e);const i=t.get();const l=_e.fromDom(e.getBody());const d=Qt.deviceType.isTouch();const u=s.style;const f=e.iframeElement;const m=f===null||f===void 0?void 0:f.style;const g=e=>{e(o,"tox-fullscreen");e(n,"tox-fullscreen");e(s,"tox-fullscreen");Ie(r).map((e=>Pe(e).dom)).each((t=>{e(t,"tox-fullscreen");e(t,"tox-shadowhost")}))};const p=()=>{if(d){Co(e.dom)}g(So.removeClass);Eo.unbind();S.from(t.get()).each((e=>e.fullscreenChangeHandler.unbind()))};if(!i){const o=ot(Te(c),ao(),(o=>{if(no(e)){if(!lo(c)&&t.get()!==null){Oo(e,t)}}}));const n={scrollPos:zo(),containerWidth:u.width,containerHeight:u.height,containerTop:u.top,containerLeft:u.left,iframeWidth:m.width,iframeHeight:m.height,fullscreenChangeHandler:o,sinkCssPosition:a.map((e=>$e(e,"position")))};if(d){xo(e.dom,r,l)}m.width=m.height="100%";u.width=u.height="";g(So.addClass);a.each((e=>{qe(e,"position","fixed")}));Eo.bind(r);e.on("remove",p);t.set(n);if(no(e)){co(c)}eo(e,true)}else{i.fullscreenChangeHandler.unbind();if(no(e)&&lo(c)){io(Te(c))}m.width=i.iframeWidth;m.height=i.iframeHeight;u.width=i.containerWidth;u.height=i.containerHeight;u.top=i.containerTop;u.left=i.containerLeft;H(a,i.sinkCssPosition,((e,t)=>{qe(e,"position",t)}));p();To(i.scrollPos);t.set(null);eo(e,false);e.off("remove",p)}};const Ao=(e,t)=>{e.addCommand("mceFullScreen",(()=>{Oo(e,t)}))};var Do=tinymce.util.Tools.resolve("tinymce.util.VK");const No=(e,t)=>{e.on("init",(()=>{e.on("keydown",(e=>{if(e.keyCode===Do.TAB&&!(e.metaKey||e.ctrlKey)&&t.get()){e.preventDefault()}}))}))};const Mo=(e,t)=>o=>{o.setActive(t.get()!==null);const n=e=>o.setActive(e.state);e.on("FullscreenStateChanged",n);return()=>e.off("FullscreenStateChanged",n)};const Ro=(e,t)=>{const o=()=>e.execCommand("mceFullScreen");e.ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:o,onSetup:Mo(e,t)});e.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:o,onSetup:Mo(e,t),shortcut:"Meta+Shift+F"})};var Bo=()=>{t.add("fullscreen",(t=>{const n=e(null);if(t.inline){return o(n)}oo(t);Ao(t,n);Ro(t,n);No(t,n);t.addShortcut("Meta+Shift+F","","mceFullScreen");return o(n)}))};Bo()})()},(e,t,o)=>{o(18)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=Object.getPrototypeOf;const o=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const n=e=>{const t=typeof e;if(e===null){return"null"}else if(t==="object"&&Array.isArray(e)){return"array"}else if(t==="object"&&o(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return t}};const s=e=>t=>n(t)===e;const r=e=>t=>typeof t===e;const a=e=>t=>e===t;const c=(e,n)=>l(e)&&o(e,n,((e,o)=>t(e)===o));const i=s("string");const l=s("object");const d=e=>c(e,Object);const u=s("array");const f=a(null);const m=r("boolean");const g=e=>e===null||e===undefined;const p=e=>!g(e);const h=r("function");const y=r("number");const b=(e,t)=>{if(u(e)){for(let o=0,n=e.length;o<n;++o){if(!t(e[o])){return false}}return true}return false};const v=()=>{};class k{constructor(e,t){this.tag=e;this.value=t}static some(e){return new k(true,e)}static none(){return k.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return k.some(e(this.value))}else{return k.none()}}bind(e){if(this.tag){return e(this.value)}else{return k.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return k.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return p(e)?k.some(e):k.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}k.singletonNone=new k(false);const w=Object.keys;const _=Object.hasOwnProperty;const x=(e,t)=>{const o=w(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const C=e=>(t,o)=>{e[o]=t};const S=(e,t,o,n)=>{x(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const z=(e,t)=>{const o={};S(e,t,C(o),v);return o};const T=(e,t)=>_.call(e,t);const E=(e,t)=>T(e,t)&&e[t]!==undefined&&e[t]!==null;const O=Array.prototype.push;const A=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!u(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}O.apply(t,e[o])}return t};const D=(e,t)=>t>=0&&t<e.length?k.some(e[t]):k.none();const N=e=>D(e,0);const M=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return k.none()};typeof window!=="undefined"?window:Function("return this;")();const R=(e,t,o)=>{if(i(o)||m(o)||y(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const B=(e,t,o)=>{R(e.dom,t,o)};const L=(e,t)=>{e.dom.removeAttribute(t)};const H=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return F(n.childNodes[0])};const I=(e,t)=>{const o=t||document;const n=o.createElement(e);return F(n)};const P=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return F(n)};const F=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const V=(e,t,o)=>k.from(e.dom.elementFromPoint(t,o)).map(F);const j={fromHtml:H,fromTag:I,fromText:P,fromDom:F,fromPoint:V};var Z=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");var U=tinymce.util.Tools.resolve("tinymce.util.URI");const q=e=>e.length>0;const W=e=>t=>t.options.get(e);const $=e=>{const t=e.options.register;t("image_dimensions",{processor:"boolean",default:true});t("image_advtab",{processor:"boolean",default:false});t("image_uploadtab",{processor:"boolean",default:true});t("image_prepend_url",{processor:"string",default:""});t("image_class_list",{processor:"object[]"});t("image_description",{processor:"boolean",default:true});t("image_title",{processor:"boolean",default:false});t("image_caption",{processor:"boolean",default:false});t("image_list",{processor:e=>{const t=e===false||i(e)||b(e,l)||h(e);return t?{value:e,valid:t}:{valid:false,message:"Must be false, a string, an array or a function."}},default:false})};const G=W("image_dimensions");const K=W("image_advtab");const Y=W("image_uploadtab");const X=W("image_prepend_url");const J=W("image_class_list");const Q=W("image_description");const ee=W("image_title");const te=W("image_caption");const oe=W("image_list");const ne=W("a11y_advanced_options");const se=W("automatic_uploads");const re=e=>q(e.options.get("images_upload_url"));const ae=e=>p(e.options.get("images_upload_handler"));const ce=(e,t)=>Math.max(parseInt(e,10),parseInt(t,10));const ie=e=>new Promise((t=>{const o=document.createElement("img");const n=e=>{o.onload=o.onerror=null;if(o.parentNode){o.parentNode.removeChild(o)}t(e)};o.onload=()=>{const e=ce(o.width,o.clientWidth);const t=ce(o.height,o.clientHeight);const s={width:e,height:t};n(Promise.resolve(s))};o.onerror=()=>{n(Promise.reject(`Failed to get image dimensions for: ${e}`))};const s=o.style;s.visibility="hidden";s.position="fixed";s.bottom=s.left="0px";s.width=s.height="auto";document.body.appendChild(o);o.src=e}));const le=e=>{if(e){e=e.replace(/px$/,"")}return e};const de=e=>{if(e.length>0&&/^[0-9]+$/.test(e)){e+="px"}return e};const ue=e=>{if(e.margin){const t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0];e["margin-right"]=e["margin-right"]||t[0];e["margin-bottom"]=e["margin-bottom"]||t[0];e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0];e["margin-right"]=e["margin-right"]||t[1];e["margin-bottom"]=e["margin-bottom"]||t[0];e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0];e["margin-right"]=e["margin-right"]||t[1];e["margin-bottom"]=e["margin-bottom"]||t[2];e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0];e["margin-right"]=e["margin-right"]||t[1];e["margin-bottom"]=e["margin-bottom"]||t[2];e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e};const fe=(e,t)=>{const o=oe(e);if(i(o)){fetch(o).then((e=>{if(e.ok){e.json().then(t)}}))}else if(h(o)){o(t)}else{t(o)}};const me=(e,t,o)=>{const n=()=>{o.onload=o.onerror=null;if(e.selection){e.selection.select(o);e.nodeChanged()}};o.onload=()=>{if(!t.width&&!t.height&&G(e)){e.dom.setAttribs(o,{width:String(o.clientWidth),height:String(o.clientHeight)})}n()};o.onerror=n};const ge=e=>new Promise(((t,o)=>{const n=new FileReader;n.onload=()=>{t(n.result)};n.onerror=()=>{var e;o((e=n.error)===null||e===void 0?void 0:e.message)};n.readAsDataURL(e)}));const pe=e=>e.nodeName==="IMG"&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"));const he=(e,t)=>{const o=e.options.get;return U.isDomSafe(t,"img",{allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")})};const ye=Z.DOM;const be=e=>{if(e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight){return le(e.style.marginLeft)}else{return""}};const ve=e=>{if(e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom){return le(e.style.marginTop)}else{return""}};const ke=e=>{if(e.style.borderWidth){return le(e.style.borderWidth)}else{return""}};const we=(e,t)=>{var o;if(e.hasAttribute(t)){return(o=e.getAttribute(t))!==null&&o!==void 0?o:""}else{return""}};const _e=e=>e.parentNode!==null&&e.parentNode.nodeName==="FIGURE";const xe=(e,t,o)=>{if(o===""||o===null){e.removeAttribute(t)}else{e.setAttribute(t,o)}};const Ce=e=>{const t=ye.create("figure",{class:"image"});ye.insertAfter(t,e);t.appendChild(e);t.appendChild(ye.create("figcaption",{contentEditable:"true"},"Caption"));t.contentEditable="false"};const Se=e=>{const t=e.parentNode;if(p(t)){ye.insertAfter(e,t);ye.remove(t)}};const ze=e=>{if(_e(e)){Se(e)}else{Ce(e)}};const Te=(e,t)=>{const o=e.getAttribute("style");const n=t(o!==null?o:"");if(n.length>0){e.setAttribute("style",n);e.setAttribute("data-mce-style",n)}else{e.removeAttribute("style")}};const Ee=(e,t)=>(e,o,n)=>{const s=e.style;if(s[o]){s[o]=de(n);Te(e,t)}else{xe(e,o,n)}};const Oe=(e,t)=>{if(e.style[t]){return le(e.style[t])}else{return we(e,t)}};const Ae=(e,t)=>{const o=de(t);e.style.marginLeft=o;e.style.marginRight=o};const De=(e,t)=>{const o=de(t);e.style.marginTop=o;e.style.marginBottom=o};const Ne=(e,t)=>{const o=de(t);e.style.borderWidth=o};const Me=(e,t)=>{e.style.borderStyle=t};const Re=e=>{var t;return(t=e.style.borderStyle)!==null&&t!==void 0?t:""};const Be=e=>p(e)&&e.nodeName==="FIGURE";const Le=e=>e.nodeName==="IMG";const He=e=>ye.getAttrib(e,"alt").length===0&&ye.getAttrib(e,"role")==="presentation";const Ie=e=>{if(He(e)){return""}else{return we(e,"alt")}};const Pe=()=>({src:"",alt:"",title:"",width:"",height:"",class:"",style:"",caption:false,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:false});const Fe=(e,t)=>{var o;const n=document.createElement("img");xe(n,"style",t.style);if(be(n)||t.hspace!==""){Ae(n,t.hspace)}if(ve(n)||t.vspace!==""){De(n,t.vspace)}if(ke(n)||t.border!==""){Ne(n,t.border)}if(Re(n)||t.borderStyle!==""){Me(n,t.borderStyle)}return e((o=n.getAttribute("style"))!==null&&o!==void 0?o:"")};const Ve=(e,t)=>{const o=document.createElement("img");$e(e,{...t,caption:false},o);Ue(o,t.alt,t.isDecorative);if(t.caption){const e=ye.create("figure",{class:"image"});e.appendChild(o);e.appendChild(ye.create("figcaption",{contentEditable:"true"},"Caption"));e.contentEditable="false";return e}else{return o}};const je=(e,t)=>({src:we(t,"src"),alt:Ie(t),title:we(t,"title"),width:Oe(t,"width"),height:Oe(t,"height"),class:we(t,"class"),style:e(we(t,"style")),caption:_e(t),hspace:be(t),vspace:ve(t),border:ke(t),borderStyle:Re(t),isDecorative:He(t)});const Ze=(e,t,o,n,s)=>{if(o[n]!==t[n]){s(e,n,String(o[n]))}};const Ue=(e,t,o)=>{if(o){ye.setAttrib(e,"role","presentation");const t=j.fromDom(e);B(t,"alt","")}else{if(f(t)){const t=j.fromDom(e);L(t,"alt")}else{const o=j.fromDom(e);B(o,"alt",t)}if(ye.getAttrib(e,"role")==="presentation"){ye.setAttrib(e,"role","")}}};const qe=(e,t,o)=>{if(o.alt!==t.alt||o.isDecorative!==t.isDecorative){Ue(e,o.alt,o.isDecorative)}};const We=(e,t)=>(o,n,s)=>{e(o,s);Te(o,t)};const $e=(e,t,o)=>{const n=je(e,o);Ze(o,n,t,"caption",((e,t,o)=>ze(e)));Ze(o,n,t,"src",xe);Ze(o,n,t,"title",xe);Ze(o,n,t,"width",Ee("width",e));Ze(o,n,t,"height",Ee("height",e));Ze(o,n,t,"class",xe);Ze(o,n,t,"style",We(((e,t)=>xe(e,"style",t)),e));Ze(o,n,t,"hspace",We(Ae,e));Ze(o,n,t,"vspace",We(De,e));Ze(o,n,t,"border",We(Ne,e));Ze(o,n,t,"borderStyle",We(Me,e));qe(o,n,t)};const Ge=(e,t)=>{const o=e.dom.styles.parse(t);const n=ue(o);const s=e.dom.styles.parse(e.dom.styles.serialize(n));return e.dom.styles.serialize(s)};const Ke=e=>{const t=e.selection.getNode();const o=e.dom.getParent(t,"figure.image");if(o){return e.dom.select("img",o)[0]}if(t&&(t.nodeName!=="IMG"||pe(t))){return null}return t};const Ye=(e,t)=>{var o;const n=e.dom;const s=z(e.schema.getTextBlockElements(),((t,o)=>!e.schema.isValidChild(o,"figure")));const r=n.getParent(t.parentNode,(e=>E(s,e.nodeName)),e.getBody());if(r){return(o=n.split(r,t))!==null&&o!==void 0?o:t}else{return t}};const Xe=e=>{const t=Ke(e);return t?je((t=>Ge(e,t)),t):Pe()};const Je=(e,t)=>{const o=Ve((t=>Ge(e,t)),t);e.dom.setAttrib(o,"data-mce-id","__mcenew");e.focus();e.selection.setContent(o.outerHTML);const n=e.dom.select('*[data-mce-id="__mcenew"]')[0];e.dom.setAttrib(n,"data-mce-id",null);if(Be(n)){const t=Ye(e,n);e.selection.select(t)}else{e.selection.select(n)}};const Qe=(e,t)=>{e.dom.setAttrib(t,"src",t.getAttribute("src"))};const et=(e,t)=>{if(t){const o=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(o);e.focus();e.nodeChanged();if(e.dom.isEmpty(e.getBody())){e.setContent("");e.selection.setCursorLocation()}}};const tt=(e,t)=>{const o=Ke(e);if(o){$e((t=>Ge(e,t)),t,o);Qe(e,o);if(Be(o.parentNode)){const t=o.parentNode;Ye(e,t);e.selection.select(o.parentNode)}else{e.selection.select(o);me(e,t,o)}}};const ot=(e,t)=>{const o=t.src;return{...t,src:he(e,o)?o:""}};const nt=(e,t)=>{const o=Ke(e);if(o){const n=je((t=>Ge(e,t)),o);const s={...n,...t};const r=ot(e,s);if(s.src){tt(e,r)}else{et(e,o)}}else if(t.src){Je(e,{...Pe(),...t})}};const st=(e,t)=>{const o=d(e)&&d(t);return o?at(e,t):t};const rt=e=>(...t)=>{if(t.length===0){throw new Error(`Can't merge zero objects`)}const o={};for(let n=0;n<t.length;n++){const s=t[n];for(const t in s){if(T(s,t)){o[t]=e(o[t],s[t])}}}return o};const at=rt(st);var ct=tinymce.util.Tools.resolve("tinymce.util.ImageUploader");var it=tinymce.util.Tools.resolve("tinymce.util.Tools");const lt=e=>i(e.value)?e.value:"";const dt=e=>{if(i(e.text)){return e.text}else if(i(e.title)){return e.title}else{return""}};const ut=(e,t)=>{const o=[];it.each(e,(e=>{const n=dt(e);if(e.menu!==undefined){const s=ut(e.menu,t);o.push({text:n,items:s})}else{const s=t(e);o.push({text:n,value:s})}}));return o};const ft=(e=lt)=>t=>{if(t){return k.from(t).map((t=>ut(t,e)))}else{return k.none()}};const mt=e=>ft(lt)(e);const gt=e=>T(e,"items");const pt=(e,t)=>M(e,(e=>{if(gt(e)){return pt(e.items,t)}else if(e.value===t){return k.some(e)}else{return k.none()}}));const ht=(e,t)=>e.bind((e=>pt(e,t)));const yt={sanitizer:ft,sanitize:mt,findEntry:ht};const bt=e=>({title:"Advanced",name:"advanced",items:[{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]});const vt={makeTab:bt};const kt=e=>{const t=yt.sanitizer((t=>e.convertURL(t.value||t.url||"","src")));const o=new Promise((o=>{fe(e,(e=>{o(t(e).map((e=>A([[{text:"None",value:""}],e]))))}))}));const n=yt.sanitize(J(e));const s=K(e);const r=Y(e);const a=re(e);const c=ae(e);const l=Xe(e);const d=Q(e);const u=ee(e);const f=G(e);const m=te(e);const g=ne(e);const p=se(e);const h=k.some(X(e)).filter((e=>i(e)&&e.length>0));return o.then((e=>({image:l,imageList:e,classList:n,hasAdvTab:s,hasUploadTab:r,hasUploadUrl:a,hasUploadHandler:c,hasDescription:d,hasImageTitle:u,hasDimensions:f,hasImageCaption:m,prependURL:h,hasAccessibilityOptions:g,automaticUploads:p})))};const wt=e=>{const t={name:"src",type:"urlinput",filetype:"image",label:"Source",picker_text:"Browse files"};const o=e.imageList.map((e=>({name:"images",type:"listbox",label:"Image list",items:e})));const n={name:"alt",type:"input",label:"Alternative description",enabled:!(e.hasAccessibilityOptions&&e.image.isDecorative)};const s={name:"title",type:"input",label:"Image title"};const r={name:"dimensions",type:"sizeinput"};const a={type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]};const c=e.classList.map((e=>({name:"classes",type:"listbox",label:"Class",items:e})));const i={type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]};const l=e=>e?{type:"grid",columns:2}:{type:"panel"};return A([[t],o.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[a]:[],e.hasDescription?[n]:[],e.hasImageTitle?[s]:[],e.hasDimensions?[r]:[],[{...l(e.classList.isSome()&&e.hasImageCaption),items:A([c.toArray(),e.hasImageCaption?[i]:[]])}]])};const _t=e=>({title:"General",name:"general",items:wt(e)});const xt={makeTab:_t,makeItems:wt};const Ct=e=>{const t=[{type:"dropzone",name:"fileinput"}];return{title:"Upload",name:"upload",items:t}};const St={makeTab:Ct};const zt=e=>({prevImage:yt.findEntry(e.imageList,e.image.src),prevAlt:e.image.alt,open:true});const Tt=e=>({src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e.class,caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative});const Et=(e,t)=>({src:e.src.value,alt:(e.alt===null||e.alt.length===0)&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,class:e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative});const Ot=(e,t)=>{if(!/^(?:[a-zA-Z]+:)?\/\//.test(t)){return e.prependURL.bind((e=>{if(t.substring(0,e.length)!==e){return k.some(e+t)}return k.none()}))}return k.none()};const At=(e,t)=>{const o=t.getData();Ot(e,o.src.value).each((e=>{t.setData({src:{value:e,meta:o.src.meta}})}))};const Dt=(e,t,o)=>{if(e.hasDescription&&i(o.alt)){t.alt=o.alt}if(e.hasAccessibilityOptions){t.isDecorative=o.isDecorative||t.isDecorative||false}if(e.hasImageTitle&&i(o.title)){t.title=o.title}if(e.hasDimensions){if(i(o.width)){t.dimensions.width=o.width}if(i(o.height)){t.dimensions.height=o.height}}if(i(o.class)){yt.findEntry(e.classList,o.class).each((e=>{t.classes=e.value}))}if(e.hasImageCaption){if(m(o.caption)){t.caption=o.caption}}if(e.hasAdvTab){if(i(o.style)){t.style=o.style}if(i(o.vspace)){t.vspace=o.vspace}if(i(o.border)){t.border=o.border}if(i(o.hspace)){t.hspace=o.hspace}if(i(o.borderstyle)){t.borderstyle=o.borderstyle}}};const Nt=(e,t)=>{const o=t.getData();const n=o.src.meta;if(n!==undefined){const s=at({},o);Dt(e,s,n);t.setData(s)}};const Mt=(e,t,o,n)=>{const s=n.getData();const r=s.src.value;const a=s.src.meta||{};if(!a.width&&!a.height&&t.hasDimensions){if(q(r)){e.imageSize(r).then((e=>{if(o.open){n.setData({dimensions:e})}})).catch((e=>console.error(e)))}else{n.setData({dimensions:{width:"",height:""}})}}};const Rt=(e,t,o)=>{const n=o.getData();const s=yt.findEntry(e.imageList,n.src.value);t.prevImage=s;o.setData({images:s.map((e=>e.value)).getOr("")})};const Bt=(e,t,o,n)=>{At(t,n);Nt(t,n);Mt(e,t,o,n);Rt(t,o,n)};const Lt=(e,t,o,n)=>{const s=n.getData();const r=yt.findEntry(t.imageList,s.images);r.each((e=>{const t=s.alt===""||o.prevImage.map((e=>e.text===s.alt)).getOr(false);if(t){if(e.value===""){n.setData({src:e,alt:o.prevAlt})}else{n.setData({src:e,alt:e.text})}}else{n.setData({src:e})}}));o.prevImage=r;Bt(e,t,o,n)};const Ht=(e,t,o,n)=>{const s=n.getData();n.block("Uploading image");N(s.fileinput).fold((()=>{n.unblock()}),(s=>{const r=URL.createObjectURL(s);const a=()=>{n.unblock();URL.revokeObjectURL(r)};const c=s=>{n.setData({src:{value:s,meta:{}}});n.showTab("general");Bt(e,t,o,n);n.focus("src")};ge(s).then((o=>{const i=e.createBlobCache(s,r,o);if(t.automaticUploads){e.uploadImage(i).then((e=>{c(e.url);a()})).catch((t=>{a();e.alertErr(t)}))}else{e.addToBlobCache(i);c(i.blobUri());n.unblock()}}))}))};const It=(e,t,o)=>(n,s)=>{if(s.name==="src"){Bt(e,t,o,n)}else if(s.name==="images"){Lt(e,t,o,n)}else if(s.name==="alt"){o.prevAlt=n.getData().alt}else if(s.name==="fileinput"){Ht(e,t,o,n)}else if(s.name==="isDecorative"){n.setEnabled("alt",!n.getData().isDecorative)}};const Pt=e=>()=>{e.open=false};const Ft=e=>{if(e.hasAdvTab||e.hasUploadUrl||e.hasUploadHandler){const t={type:"tabpanel",tabs:A([[xt.makeTab(e)],e.hasAdvTab?[vt.makeTab(e)]:[],e.hasUploadTab&&(e.hasUploadUrl||e.hasUploadHandler)?[St.makeTab(e)]:[]])};return t}else{const t={type:"panel",items:xt.makeItems(e)};return t}};const Vt=(e,t,o)=>n=>{const s=at(Tt(t.image),n.getData());const r={...s,style:Fe(o.normalizeCss,Et(s,false))};e.execCommand("mceUpdateImage",false,Et(r,t.hasAccessibilityOptions));e.editorUpload.uploadImagesAuto();n.close()};const jt=e=>t=>{if(!he(e,t)){return Promise.resolve({width:"",height:""})}else{return ie(e.documentBaseURI.toAbsolute(t)).then((e=>({width:String(e.width),height:String(e.height)})))}};const Zt=e=>(t,o,n)=>{var s;return e.editorUpload.blobCache.create({blob:t,blobUri:o,name:(s=t.name)===null||s===void 0?void 0:s.replace(/\.[^\.]+$/,""),filename:t.name,base64:n.split(",")[1]})};const Ut=e=>t=>{e.editorUpload.blobCache.add(t)};const qt=e=>t=>{e.windowManager.alert(t)};const Wt=e=>t=>Ge(e,t);const $t=e=>t=>e.dom.parseStyle(t);const Gt=e=>(t,o)=>e.dom.serializeStyle(t,o);const Kt=e=>t=>ct(e).upload([t],false).then((e=>{var t;if(e.length===0){return Promise.reject("Failed to upload image")}else if(e[0].status===false){return Promise.reject((t=e[0].error)===null||t===void 0?void 0:t.message)}else{return e[0]}}));const Yt=e=>{const t={imageSize:jt(e),addToBlobCache:Ut(e),createBlobCache:Zt(e),alertErr:qt(e),normalizeCss:Wt(e),parseStyle:$t(e),serializeStyle:Gt(e),uploadImage:Kt(e)};const o=()=>{kt(e).then((o=>{const n=zt(o);return{title:"Insert/Edit Image",size:"normal",body:Ft(o),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:Tt(o.image),onSubmit:Vt(e,o,t),onChange:It(t,o,n),onClose:Pt(n)}})).then(e.windowManager.open)};return{open:o}};const Xt=e=>{e.addCommand("mceImage",Yt(e).open);e.addCommand("mceUpdateImage",((t,o)=>{e.undoManager.transact((()=>nt(e,o)))}))};const Jt=e=>{const t=e.attr("class");return p(t)&&/\bimage\b/.test(t)};const Qt=e=>t=>{let o=t.length;const n=t=>{t.attr("contenteditable",e?"true":null)};while(o--){const s=t[o];if(Jt(s)){s.attr("contenteditable",e?"false":null);it.each(s.getAll("figcaption"),n)}}};const eo=e=>{e.on("PreInit",(()=>{e.parser.addNodeFilter("figure",Qt(true));e.serializer.addNodeFilter("figure",Qt(false))}))};const to=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};e.on("NodeChange",o);o();return()=>{e.off("NodeChange",o)}};const oo=e=>{e.ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Yt(e).open,onSetup:t=>{t.setActive(p(Ke(e)));const o=e.selection.selectorChangedWithUnbind("img:not([data-mce-object]):not([data-mce-placeholder]),figure.image",t.setActive).unbind;const n=to(e)(t);return()=>{o();n()}}});e.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Yt(e).open,onSetup:to(e)});e.ui.registry.addContextMenu("image",{update:t=>e.selection.isEditable()&&(Be(t)||Le(t)&&!pe(t))?["image"]:[]})};var no=()=>{e.add("image",(e=>{$(e);eo(e);oo(e);Xt(e)}))};no()})()},(e,t,o)=>{o(20)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=e=>t=>e===t;const a=n("string");const c=n("object");const i=n("array");const l=r(null);const d=s("boolean");const u=e=>e===null||e===undefined;const f=e=>!u(e);const m=s("function");const g=(e,t)=>{if(i(e)){for(let o=0,n=e.length;o<n;++o){if(!t(e[o])){return false}}return true}return false};const p=()=>{};const h=e=>()=>e;const y=(e,t)=>e===t;class b{constructor(e,t){this.tag=e;this.value=t}static some(e){return new b(true,e)}static none(){return b.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return b.some(e(this.value))}else{return b.none()}}bind(e){if(this.tag){return e(this.value)}else{return b.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return b.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return f(e)?b.some(e):b.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}b.singletonNone=new b(false);const v=Array.prototype.indexOf;const k=Array.prototype.push;const w=(e,t)=>v.call(e,t);const _=(e,t)=>w(e,t)>-1;const x=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const C=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const S=(e,t,o)=>{C(e,((e,n)=>{o=t(o,e,n)}));return o};const z=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!i(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}k.apply(t,e[o])}return t};const T=(e,t)=>z(x(e,t));const E=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return b.none()};const O=(e,t,o=y)=>e.exists((e=>o(e,t)));const A=e=>{const t=[];const o=e=>{t.push(e)};for(let t=0;t<e.length;t++){e[t].each(o)}return t};const D=(e,t)=>e?b.some(t):b.none();const N=e=>t=>t.options.get(e);const M=e=>{const t=e.options.register;t("link_assume_external_targets",{processor:e=>{const t=a(e)||d(e);if(t){if(e===true){return{value:1,valid:t}}else if(e==="http"||e==="https"){return{value:e,valid:t}}else{return{value:0,valid:t}}}else{return{valid:false,message:"Must be a string or a boolean."}}},default:false});t("link_context_toolbar",{processor:"boolean",default:false});t("link_list",{processor:e=>a(e)||m(e)||g(e,c)});t("link_default_target",{processor:"string"});t("link_default_protocol",{processor:"string",default:"https"});t("link_target_list",{processor:e=>d(e)||g(e,c),default:true});t("link_rel_list",{processor:"object[]",default:[]});t("link_class_list",{processor:"object[]",default:[]});t("link_title",{processor:"boolean",default:true});t("allow_unsafe_link_target",{processor:"boolean",default:false});t("link_quicklink",{processor:"boolean",default:false})};const R=N("link_assume_external_targets");const B=N("link_context_toolbar");const L=N("link_list");const H=N("link_default_target");const I=N("link_default_protocol");const P=N("link_target_list");const F=N("link_rel_list");const V=N("link_class_list");const j=N("link_title");const Z=N("allow_unsafe_link_target");const U=N("link_quicklink");var q=tinymce.util.Tools.resolve("tinymce.util.Tools");const W=e=>a(e.value)?e.value:"";const $=e=>{if(a(e.text)){return e.text}else if(a(e.title)){return e.title}else{return""}};const G=(e,t)=>{const o=[];q.each(e,(e=>{const n=$(e);if(e.menu!==undefined){const s=G(e.menu,t);o.push({text:n,items:s})}else{const s=t(e);o.push({text:n,value:s})}}));return o};const K=(e=W)=>t=>b.from(t).map((t=>G(t,e)));const Y=e=>K(W)(e);const X=(e,t)=>o=>({name:e,type:"listbox",label:t,items:o});const J={sanitize:Y,sanitizeWith:K,createUi:X,getValue:W};const Q=Object.keys;const ee=Object.hasOwnProperty;const te=(e,t)=>{const o=Q(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const oe=e=>(t,o)=>{e[o]=t};const ne=(e,t,o,n)=>{te(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const se=(e,t)=>{const o={};ne(e,t,oe(o),p);return o};const re=(e,t)=>ee.call(e,t);const ae=(e,t)=>re(e,t)&&e[t]!==undefined&&e[t]!==null;var ce=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");var ie=tinymce.util.Tools.resolve("tinymce.util.URI");const le=e=>f(e)&&e.nodeName.toLowerCase()==="a";const de=e=>le(e)&&!!me(e);const ue=(e,t)=>{if(e.collapsed){return[]}else{const o=e.cloneContents();const n=o.firstChild;const s=new ce(n,o);const r=[];let a=n;do{if(t(a)){r.push(a)}}while(a=s.next());return r}};const fe=e=>/^\w+:/i.test(e);const me=e=>{var t,o;return(o=(t=e.getAttribute("data-mce-href"))!==null&&t!==void 0?t:e.getAttribute("href"))!==null&&o!==void 0?o:""};const ge=(e,t)=>{const o=["noopener"];const n=e?e.split(/\s+/):[];const s=e=>q.trim(e.sort().join(" "));const r=e=>{e=a(e);return e.length>0?e.concat(o):o};const a=e=>e.filter((e=>q.inArray(o,e)===-1));const c=t?r(n):a(n);return c.length>0?s(c):""};const pe=e=>e.replace(/\uFEFF/g,"");const he=(e,t)=>{t=t||ve(e.selection.getRng())[0]||e.selection.getNode();if(Ce(t)){return b.from(e.dom.select("a[href]",t)[0])}else{return b.from(e.dom.getParent(t,"a[href]"))}};const ye=(e,t)=>he(e,t).isSome();const be=(e,t)=>{const o=t.fold((()=>e.getContent({format:"text"})),(e=>e.innerText||e.textContent||""));return pe(o)};const ve=e=>ue(e,de);const ke=e=>q.grep(e,de);const we=e=>ke(e).length>0;const _e=e=>ve(e).length>0;const xe=e=>{const t=e.schema.getTextInlineElements();const o=e=>e.nodeType===1&&!le(e)&&!re(t,e.nodeName.toLowerCase());const n=he(e).exists((e=>e.hasAttribute("data-mce-block")));if(n){return false}const s=e.selection.getRng();if(!s.collapsed){const e=ue(s,o);return e.length===0}else{return true}};const Ce=e=>f(e)&&e.nodeName==="FIGURE"&&/\bimage\b/i.test(e.className);const Se=e=>{const t=["title","rel","class","target"];return S(t,((t,o)=>{e[o].each((e=>{t[o]=e.length>0?e:null}));return t}),{href:e.href})};const ze=(e,t)=>{if((t==="http"||t==="https")&&!fe(e)){return t+"://"+e}return e};const Te=(e,t)=>{const o={...t};if(F(e).length===0&&!Z(e)){const e=ge(o.rel,o.target==="_blank");o.rel=e?e:null}if(b.from(o.target).isNone()&&P(e)===false){o.target=H(e)}o.href=ze(o.href,R(e));return o};const Ee=(e,t,o,n)=>{o.each((e=>{if(re(t,"innerText")){t.innerText=e}else{t.textContent=e}}));e.dom.setAttribs(t,n);e.selection.select(t)};const Oe=(e,t,o,n)=>{const s=e.dom;if(Ce(t)){Ie(s,t,n)}else{o.fold((()=>{e.execCommand("mceInsertLink",false,n)}),(t=>{e.insertContent(s.createHTML("a",n,s.encode(t)))}))}};const Ae=(e,t,o)=>{const n=e.selection.getNode();const s=he(e,n);const r=Te(e,Se(o));e.undoManager.transact((()=>{if(o.href===t.href){t.attach()}s.fold((()=>{Oe(e,n,o.text,r)}),(t=>{e.focus();Ee(e,t,o.text,r)}))}))};const De=e=>{const t=e.dom,o=e.selection;const n=o.getBookmark();const s=o.getRng().cloneRange();const r=t.getParent(s.startContainer,"a[href]",e.getBody());const a=t.getParent(s.endContainer,"a[href]",e.getBody());if(r){s.setStartBefore(r)}if(a){s.setEndAfter(a)}o.setRng(s);e.execCommand("unlink");o.moveToBookmark(n)};const Ne=e=>{e.undoManager.transact((()=>{const t=e.selection.getNode();if(Ce(t)){He(e,t)}else{De(e)}e.focus()}))};const Me=e=>{const{class:t,href:o,rel:n,target:s,text:r,title:a}=e;return se({class:t.getOrNull(),href:o,rel:n.getOrNull(),target:s.getOrNull(),text:r.getOrNull(),title:a.getOrNull()},((e,t)=>l(e)===false))};const Re=(e,t)=>{const o=e.options.get;const n={allow_html_data_urls:o("allow_html_data_urls"),allow_script_urls:o("allow_script_urls"),allow_svg_data_urls:o("allow_svg_data_urls")};const s=t.href;return{...t,href:ie.isDomSafe(s,"a",n)?s:""}};const Be=(e,t,o)=>{const n=Re(e,o);e.hasPlugin("rtc",true)?e.execCommand("createlink",false,Me(n)):Ae(e,t,n)};const Le=e=>{e.hasPlugin("rtc",true)?e.execCommand("unlink"):Ne(e)};const He=(e,t)=>{var o;const n=e.dom.select("img",t)[0];if(n){const s=e.dom.getParents(n,"a[href]",t)[0];if(s){(o=s.parentNode)===null||o===void 0?void 0:o.insertBefore(n,s);e.dom.remove(s)}}};const Ie=(e,t,o)=>{var n;const s=e.select("img",t)[0];if(s){const t=e.create("a",o);(n=s.parentNode)===null||n===void 0?void 0:n.insertBefore(t,s);t.appendChild(s)}};const Pe=e=>ae(e,"items");const Fe=(e,t)=>E(t,(t=>{if(Pe(t)){return Fe(e,t.items)}else{return D(t.value===e,t)}}));const Ve=(e,t,o,n)=>{const s=n[t];const r=e.length>0;return s!==undefined?Fe(s,o).map((t=>({url:{value:t.value,meta:{text:r?e:t.text,attach:p}},text:r?e:t.text}))):b.none()};const je=(e,t)=>{if(t==="link"){return e.link}else if(t==="anchor"){return e.anchor}else{return b.none()}};const Ze=(e,t)=>{const o={text:e.text,title:e.title};const n=e=>{var t;return D(o.title.length<=0,b.from((t=e.meta)===null||t===void 0?void 0:t.title).getOr(""))};const s=e=>{var t;return D(o.text.length<=0,b.from((t=e.meta)===null||t===void 0?void 0:t.text).getOr(e.value))};const r=e=>{const t=s(e.url);const o=n(e.url);if(t.isSome()||o.isSome()){return b.some({...t.map((e=>({text:e}))).getOr({}),...o.map((e=>({title:e}))).getOr({})})}else{return b.none()}};const a=(e,n)=>{const s=je(t,n).getOr([]);return Ve(o.text,n,s,e)};const c=(e,t)=>{const n=t.name;if(n==="url"){return r(e())}else if(_(["anchor","link"],n)){return a(e(),n)}else if(n==="text"||n==="title"){o[n]=e()[n];return b.none()}else{return b.none()}};return{onChange:c}};const Ue={init:Ze,getDelta:Ve};var qe=tinymce.util.Tools.resolve("tinymce.util.Delay");const We=(e,t,o)=>{const n=e.selection.getRng();qe.setEditorTimeout(e,(()=>{e.windowManager.confirm(t,(t=>{e.selection.setRng(n);o(t)}))}))};const $e=e=>{const t=e.href;const o=t.indexOf("@")>0&&t.indexOf("/")===-1&&t.indexOf("mailto:")===-1;return o?b.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:e=>({...e,href:"mailto:"+t})}):b.none()};const Ge=(e,t)=>o=>{const n=o.href;const s=e===1&&!fe(n)||e===0&&/^\s*www(\.|\d\.)/i.test(n);return s?b.some({message:`The URL you entered seems to be an external link. Do you want to add the required ${t}:// prefix?`,preprocess:e=>({...e,href:t+"://"+n})}):b.none()};const Ke=(e,t)=>E([$e,Ge(R(e),I(e))],(e=>e(t))).fold((()=>Promise.resolve(t)),(o=>new Promise((n=>{We(e,o.message,(e=>{n(e?o.preprocess(t):t)}))}))));const Ye={preprocess:Ke};const Xe=e=>{const t=e.dom.select("a:not([href])");const o=T(t,(e=>{const t=e.name||e.id;return t?[{text:t,value:"#"+t}]:[]}));return o.length>0?b.some([{text:"None",value:""}].concat(o)):b.none()};const Je={getAnchors:Xe};const Qe=e=>{const t=V(e);if(t.length>0){return J.sanitize(t)}return b.none()};const et={getClasses:Qe};const tt=e=>{try{return b.some(JSON.parse(e))}catch(e){return b.none()}};const ot=e=>{const t=t=>e.convertURL(t.value||t.url||"","href");const o=L(e);return new Promise((e=>{if(a(o)){fetch(o).then((e=>e.ok?e.text().then(tt):Promise.reject())).then(e,(()=>e(b.none())))}else if(m(o)){o((t=>e(b.some(t))))}else{e(b.from(o))}})).then((e=>e.bind(J.sanitizeWith(t)).map((e=>{if(e.length>0){const t=[{text:"None",value:""}];return t.concat(e)}else{return e}}))))};const nt={getLinks:ot};const st=(e,t)=>{const o=F(e);if(o.length>0){const n=O(t,"_blank");const s=Z(e)===false;const r=e=>ge(J.getValue(e),n);const a=s?J.sanitizeWith(r):J.sanitize;return a(o)}return b.none()};const rt={getRels:st};const at=[{text:"Current window",value:""},{text:"New window",value:"_blank"}];const ct=e=>{const t=P(e);if(i(t)){return J.sanitize(t).orThunk((()=>b.some(at)))}else if(t===false){return b.none()}return b.some(at)};const it={getTargets:ct};const lt=(e,t,o)=>{const n=e.getAttrib(t,o);return n!==null&&n.length>0?b.some(n):b.none()};const dt=(e,t)=>{const o=e.dom;const n=xe(e);const s=n?b.some(be(e.selection,t)):b.none();const r=t.bind((e=>b.from(o.getAttrib(e,"href"))));const a=t.bind((e=>b.from(o.getAttrib(e,"target"))));const c=t.bind((e=>lt(o,e,"rel")));const i=t.bind((e=>lt(o,e,"class")));const l=t.bind((e=>lt(o,e,"title")));return{url:r,text:s,title:l,target:a,rel:c,linkClass:i}};const ut=(e,t)=>nt.getLinks(e).then((o=>{const n=dt(e,t);return{anchor:n,catalogs:{targets:it.getTargets(e),rels:rt.getRels(e,n.target),classes:et.getClasses(e),anchor:Je.getAnchors(e),link:o},optNode:t,flags:{titleEnabled:j(e)}}}));const ft={collect:ut};const mt=(e,t)=>o=>{const n=o.getData();if(!n.url.value){Le(e);o.close();return}const s=e=>b.from(n[e]).filter((o=>!O(t.anchor[e],o)));const r={href:n.url.value,text:s("text"),target:s("target"),rel:s("rel"),class:s("linkClass"),title:s("title")};const a={href:n.url.value,attach:n.url.meta!==undefined&&n.url.meta.attach?n.url.meta.attach:p};Ye.preprocess(e,r).then((t=>{Be(e,a,t)}));o.close()};const gt=e=>{const t=he(e);return ft.collect(e,t)};const pt=(e,t)=>{const o=e.anchor;const n=o.url.getOr("");return{url:{value:n,meta:{original:{value:n}}},text:o.text.getOr(""),title:o.title.getOr(""),anchor:n,link:n,rel:o.rel.getOr(""),target:o.target.or(t).getOr(""),linkClass:o.linkClass.getOr("")}};const ht=(e,t,o)=>{const n=[{name:"url",type:"urlinput",filetype:"file",label:"URL",picker_text:"Browse links"}];const s=e.anchor.text.map((()=>({name:"text",type:"input",label:"Text to display"}))).toArray();const r=e.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[];const a=b.from(H(o));const c=pt(e,a);const i=e.catalogs;const l=Ue.init(c,i);const d={type:"panel",items:z([n,s,r,A([i.anchor.map(J.createUi("anchor","Anchors")),i.rels.map(J.createUi("rel","Rel")),i.targets.map(J.createUi("target","Open link in...")),i.link.map(J.createUi("link","Link list")),i.classes.map(J.createUi("linkClass","Class"))])])};return{title:"Insert/Edit Link",size:"normal",body:d,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:c,onChange:(e,{name:t})=>{l.onChange(e.getData,{name:t}).each((t=>{e.setData(t)}))},onSubmit:t}};const yt=e=>{const t=gt(e);t.then((t=>{const o=mt(e,t);return ht(t,o,e)})).then((t=>{e.windowManager.open(t)}))};const bt=e=>{e.addCommand("mceLink",((t,o)=>{if((o===null||o===void 0?void 0:o.dialog)===true||!U(e)){yt(e)}else{e.dispatch("contexttoolbar-show",{toolbarKey:"quicklink"})}}))};var vt=tinymce.util.Tools.resolve("tinymce.util.VK");const kt=(e,t)=>{document.body.appendChild(e);e.dispatchEvent(t);document.body.removeChild(e)};const wt=e=>{const t=document.createElement("a");t.target="_blank";t.href=e;t.rel="noreferrer noopener";const o=document.createEvent("MouseEvents");o.initMouseEvent("click",true,true,window,0,0,0,0,0,false,false,false,false,0,null);kt(t,o)};const _t=e=>{const t=e.selection.getRng();const o=t.startContainer;return de(o)&&t.startContainer===t.endContainer&&e.dom.select("img",o).length===1};const xt=e=>e.selection.isCollapsed()||_t(e)?ke(e.dom.getParents(e.selection.getStart())):ve(e.selection.getRng());const Ct=e=>xt(e)[0];const St=e=>e.altKey===true&&e.shiftKey===false&&e.ctrlKey===false&&e.metaKey===false;const zt=(e,t)=>{if(t){const o=me(t);if(/^#/.test(o)){const t=e.dom.select(o);if(t.length){e.selection.scrollIntoView(t[0],true)}}else{wt(t.href)}}};const Tt=e=>()=>{e.execCommand("mceLink",false,{dialog:true})};const Et=e=>()=>{zt(e,Ct(e))};const Ot=e=>{e.on("click",(t=>{const o=ke(e.dom.getParents(t.target));if(o.length===1&&vt.metaKeyPressed(t)){t.preventDefault();zt(e,o[0])}}));e.on("keydown",(t=>{if(!t.isDefaultPrevented()&&t.keyCode===13&&St(t)){const o=Ct(e);if(o){t.preventDefault();zt(e,o)}}}))};const At=(e,t)=>{e.on("NodeChange",t);return()=>e.off("NodeChange",t)};const Dt=e=>t=>{const o=()=>{t.setActive(!e.mode.isReadOnly()&&ye(e,e.selection.getNode()));t.setEnabled(e.selection.isEditable())};o();return At(e,o)};const Nt=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};o();return At(e,o)};const Mt=e=>xt(e).length===1;const Rt=e=>t=>{const o=()=>t.setEnabled(Mt(e));o();return At(e,o)};const Bt=e=>t=>{const o=t=>we(t)||_e(e.selection.getRng());const n=e.dom.getParents(e.selection.getStart());const s=n=>{t.setEnabled(o(n)&&e.selection.isEditable())};s(n);return At(e,(e=>s(e.parents)))};const Lt=e=>{e.addShortcut("Meta+K","",(()=>{e.execCommand("mceLink")}))};const Ht=e=>{e.ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Tt(e),onSetup:Dt(e),shortcut:"Meta+K"});e.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Et(e),onSetup:Rt(e)});e.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:()=>Le(e),onSetup:Bt(e)})};const It=e=>{e.ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Et(e),onSetup:Rt(e)});e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onSetup:Nt(e),onAction:Tt(e)});e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:()=>Le(e),onSetup:Bt(e)})};const Pt=e=>{const t="link unlink openlink";const o="link";e.ui.registry.addContextMenu("link",{update:n=>{const s=e.dom.isEditable(n);if(!s){return""}return we(e.dom.getParents(n,"a"))?t:o}})};const Ft=e=>{const t=e=>{e.selection.collapse(false)};const o=t=>{const o=e.selection.getNode();t.setEnabled(ye(e,o));return p};const n=t=>{const o=he(e);const n=xe(e);if(o.isNone()&&n){const n=be(e.selection,o);return D(n.length===0,t)}else{return b.none()}};e.ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Dt(e)},label:"Link",predicate:t=>B(e)&&ye(e,t),initValue:()=>{const t=he(e);return t.fold(h(""),me)},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:true,onSetup:t=>{const o=e.selection.getNode();t.setActive(ye(e,o));return Dt(e)(t)},onAction:o=>{const s=o.getValue();const r=n(s);const a={href:s,attach:p};Be(e,a,{href:s,text:r,title:b.none(),rel:b.none(),target:b.from(H(e)),class:b.none()});t(e);o.hide()}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:o,onAction:t=>{Le(e);t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:o,onAction:t=>{Et(e)();t.hide()}}]})};var Vt=()=>{e.add("link",(e=>{M(e);Ht(e);It(e);Pt(e);Ft(e);Ot(e);bt(e);Lt(e)}))};Vt()})()},(e,t,o)=>{o(22)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=n("string");const a=n("object");const c=n("array");const i=s("boolean");const l=e=>e===null||e===undefined;const d=e=>!l(e);const u=s("function");const f=s("number");const m=()=>{};const g=(e,t)=>o=>e(t(o));const p=e=>()=>e;const h=(e,t)=>e===t;function y(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const b=e=>t=>!e(t);const v=p(false);class k{constructor(e,t){this.tag=e;this.value=t}static some(e){return new k(true,e)}static none(){return k.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return k.some(e(this.value))}else{return k.none()}}bind(e){if(this.tag){return e(this.value)}else{return k.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return k.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return d(e)?k.some(e):k.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}k.singletonNone=new k(false);const w=Array.prototype.slice;const _=Array.prototype.indexOf;const x=Array.prototype.push;const C=(e,t)=>_.call(e,t);const S=(e,t)=>C(e,t)>-1;const z=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return true}}return false};const T=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const E=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const O=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const A=(e,t)=>{if(e.length===0){return[]}else{let o=t(e[0]);const n=[];let s=[];for(let r=0,a=e.length;r<a;r++){const a=e[r];const c=t(a);if(c!==o){n.push(s);s=[]}o=c;s.push(a)}if(s.length!==0){n.push(s)}return n}};const D=(e,t,o)=>{E(e,((e,n)=>{o=t(o,e,n)}));return o};const N=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){return k.some(s)}else if(o(s,n)){break}}return k.none()};const M=(e,t)=>N(e,t,v);const R=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!c(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}x.apply(t,e[o])}return t};const B=(e,t)=>R(T(e,t));const L=e=>{const t=w.call(e,0);t.reverse();return t};const H=(e,t)=>t>=0&&t<e.length?k.some(e[t]):k.none();const I=e=>H(e,0);const P=e=>H(e,e.length-1);const F=(e,t)=>{const o=[];const n=u(t)?e=>z(o,(o=>t(o,e))):e=>S(o,e);for(let t=0,s=e.length;t<s;t++){const s=e[t];if(!n(s)){o.push(s)}}return o};const V=(e,t,o=h)=>e.exists((e=>o(e,t)));const j=(e,t,o=h)=>Z(e,t,o).getOr(e.isNone()&&t.isNone());const Z=(e,t,o)=>e.isSome()&&t.isSome()?k.some(o(e.getOrDie(),t.getOrDie())):k.none();const U=8;const q=9;const W=11;const $=1;const G=3;const K=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return J(n.childNodes[0])};const Y=(e,t)=>{const o=t||document;const n=o.createElement(e);return J(n)};const X=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return J(n)};const J=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const Q=(e,t,o)=>k.from(e.dom.elementFromPoint(t,o)).map(J);const ee={fromHtml:K,fromTag:Y,fromText:X,fromDom:J,fromPoint:Q};const te=(e,t)=>{const o=e.dom;if(o.nodeType!==$){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const oe=(e,t)=>e.dom===t.dom;const ne=(e,t)=>{const o=e.dom;const n=t.dom;return o===n?false:o.contains(n)};const se=te;const re=typeof window!=="undefined"?window:Function("return this;")();const ae=(e,t)=>{let o=t!==undefined&&t!==null?t:re;for(let t=0;t<e.length&&o!==undefined&&o!==null;++t){o=o[e[t]]}return o};const ce=(e,t)=>{const o=e.split(".");return ae(o,t)};const ie=(e,t)=>ce(e,t);const le=(e,t)=>{const o=ie(e,t);if(o===undefined||o===null){throw new Error(e+" not available on this browser")}return o};const de=Object.getPrototypeOf;const ue=e=>le("HTMLElement",e);const fe=e=>{const t=ce("ownerDocument.defaultView",e);return a(e)&&(ue(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(de(e).constructor.name))};const me=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const ge=e=>e.dom.nodeType;const pe=e=>t=>ge(t)===e;const he=e=>ge(e)===U||me(e)==="#comment";const ye=e=>be(e)&&fe(e.dom);const be=pe($);const ve=pe(G);const ke=pe(q);const we=pe(W);const _e=e=>t=>be(t)&&me(t)===e;const xe=e=>ee.fromDom(e.dom.ownerDocument);const Ce=e=>ke(e)?e:xe(e);const Se=e=>k.from(e.dom.parentNode).map(ee.fromDom);const ze=e=>k.from(e.dom.parentElement).map(ee.fromDom);const Te=e=>k.from(e.dom.nextSibling).map(ee.fromDom);const Ee=e=>T(e.dom.childNodes,ee.fromDom);const Oe=(e,t)=>{const o=e.dom.childNodes;return k.from(o[t]).map(ee.fromDom)};const Ae=e=>Oe(e,0);const De=e=>Oe(e,e.dom.childNodes.length-1);const Ne=e=>we(e)&&d(e.dom.host);const Me=u(Element.prototype.attachShadow)&&u(Node.prototype.getRootNode);const Re=Me?e=>ee.fromDom(e.dom.getRootNode()):Ce;const Be=e=>{const t=Re(e);return Ne(t)?k.some(t):k.none()};const Le=e=>ee.fromDom(e.dom.host);const He=e=>{const t=ve(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return Be(ee.fromDom(t)).fold((()=>o.body.contains(t)),g(He,Le))};var Ie=(e,t,o,n,s)=>{if(e(o,n)){return k.some(o)}else if(u(s)&&s(o)){return k.none()}else{return t(o,n,s)}};const Pe=(e,t,o)=>{let n=e.dom;const s=u(o)?o:v;while(n.parentNode){n=n.parentNode;const e=ee.fromDom(n);if(t(e)){return k.some(e)}else if(s(e)){break}}return k.none()};const Fe=(e,t,o)=>{const n=(e,t)=>t(e);return Ie(n,Pe,e,t,o)};const Ve=(e,t,o)=>Pe(e,(e=>te(e,t)),o);const je=(e,t,o)=>{const n=(e,t)=>te(e,t);return Ie(n,Ve,e,t,o)};const Ze=e=>je(e,"[contenteditable]");const Ue=(e,t=false)=>{if(He(e)){return e.dom.isContentEditable}else{return Ze(e).fold(p(t),(e=>qe(e)==="true"))}};const qe=e=>e.dom.contentEditable;const We=(e,t)=>{const o=Se(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))};const $e=(e,t)=>{const o=Te(e);o.fold((()=>{const o=Se(e);o.each((e=>{Ke(e,t)}))}),(e=>{We(e,t)}))};const Ge=(e,t)=>{const o=Ae(e);o.fold((()=>{Ke(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))};const Ke=(e,t)=>{e.dom.appendChild(t.dom)};const Ye=(e,t)=>{E(t,(t=>{We(e,t)}))};const Xe=(e,t)=>{E(t,(t=>{Ke(e,t)}))};const Je=e=>{e.dom.textContent="";E(Ee(e),(e=>{Qe(e)}))};const Qe=e=>{const t=e.dom;if(t.parentNode!==null){t.parentNode.removeChild(t)}};var et=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils");var tt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");var ot=tinymce.util.Tools.resolve("tinymce.util.VK");const nt=e=>T(e,ee.fromDom);const st=Object.keys;const rt=(e,t)=>{const o=st(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const at=e=>(t,o)=>{e[o]=t};const ct=(e,t,o,n)=>{rt(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const it=(e,t)=>{const o={};ct(e,t,at(o),m);return o};const lt=(e,t,o)=>{if(r(o)||i(o)||f(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const dt=(e,t)=>{const o=e.dom;rt(t,((e,t)=>{lt(o,t,e)}))};const ut=e=>D(e.dom.attributes,((e,t)=>{e[t.name]=t.value;return e}),{});const ft=(e,t)=>ee.fromDom(e.dom.cloneNode(t));const mt=e=>ft(e,true);const gt=(e,t)=>{const o=ee.fromTag(t);const n=ut(e);dt(o,n);return o};const pt=(e,t)=>{const o=gt(e,t);$e(e,o);const n=Ee(e);Xe(o,n);Qe(e);return o};var ht=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");var yt=tinymce.util.Tools.resolve("tinymce.util.Tools");const bt=e=>t=>d(t)&&t.nodeName.toLowerCase()===e;const vt=e=>t=>d(t)&&e.test(t.nodeName);const kt=e=>d(e)&&e.nodeType===3;const wt=e=>d(e)&&e.nodeType===1;const _t=vt(/^(OL|UL|DL)$/);const xt=vt(/^(OL|UL)$/);const Ct=bt("ol");const St=vt(/^(LI|DT|DD)$/);const zt=vt(/^(DT|DD)$/);const Tt=vt(/^(TH|TD)$/);const Et=bt("br");const Ot=e=>{var t;return((t=e.parentNode)===null||t===void 0?void 0:t.firstChild)===e};const At=(e,t)=>d(t)&&t.nodeName in e.schema.getTextBlockElements();const Dt=(e,t)=>d(e)&&e.nodeName in t;const Nt=(e,t)=>d(t)&&t.nodeName in e.schema.getVoidElements();const Mt=(e,t)=>{if(!Et(t)){return false}return e.isBlock(t.nextSibling)&&!Et(t.previousSibling)};const Rt=(e,t,o)=>{const n=e.isEmpty(t);if(o&&e.select("span[data-mce-type=bookmark]",t).length>0){return false}return n};const Bt=(e,t)=>e.isChildOf(t,e.getRoot());const Lt=e=>t=>t.options.get(e);const Ht=e=>{const t=e.options.register;t("lists_indent_on_tab",{processor:"boolean",default:true})};const It=Lt("lists_indent_on_tab");const Pt=Lt("forced_root_block");const Ft=Lt("forced_root_block_attrs");const Vt=(e,t,o={})=>{const n=e.dom;const s=e.schema.getBlockElements();const r=n.createFragment();const a=Pt(e);const c=Ft(e);let i;let l;let d=false;l=n.create(a,{...c,...o.style?{style:o.style}:{}});if(!Dt(t.firstChild,s)){r.appendChild(l)}while(i=t.firstChild){const e=i.nodeName;if(!d&&(e!=="SPAN"||i.getAttribute("data-mce-type")!=="bookmark")){d=true}if(Dt(i,s)){r.appendChild(i);l=null}else{if(!l){l=n.create(a,c);r.appendChild(l)}l.appendChild(i)}}if(!d&&l){l.appendChild(n.create("br",{"data-mce-bogus":"1"}))}return r};const jt=ht.DOM;const Zt=(e,t,o)=>{const n=e=>{const t=e.parentNode;if(t){yt.each(s,(e=>{t.insertBefore(e,o.parentNode)}))}jt.remove(e)};const s=jt.select('span[data-mce-type="bookmark"]',t);const r=Vt(e,o);const a=jt.createRng();a.setStartAfter(o);a.setEndAfter(t);const c=a.extractContents();for(let t=c.firstChild;t;t=t.firstChild){if(t.nodeName==="LI"&&e.dom.isEmpty(t)){jt.remove(t);break}}if(!e.dom.isEmpty(c)){jt.insertAfter(c,t)}jt.insertAfter(r,t);const i=o.parentElement;if(i&&Rt(e.dom,i)){n(i)}jt.remove(o);if(Rt(e.dom,t)){jt.remove(t)}};const Ut=_e("dd");const qt=_e("dt");const Wt=(e,t)=>{if(Ut(t)){pt(t,"dt")}else if(qt(t)){ze(t).each((o=>Zt(e,o.dom,t.dom)))}};const $t=e=>{if(qt(e)){pt(e,"dd")}};const Gt=(e,t,o)=>{if(t==="Indent"){E(o,$t)}else{E(o,(t=>Wt(e,t)))}};const Kt=(e,t)=>{if(kt(e)){return{container:e,offset:t}}const o=et.getNode(e,t);if(kt(o)){return{container:o,offset:t>=e.childNodes.length?o.data.length:0}}else if(o.previousSibling&&kt(o.previousSibling)){return{container:o.previousSibling,offset:o.previousSibling.data.length}}else if(o.nextSibling&&kt(o.nextSibling)){return{container:o.nextSibling,offset:0}}return{container:e,offset:t}};const Yt=e=>{const t=e.cloneRange();const o=Kt(e.startContainer,e.startOffset);t.setStart(o.container,o.offset);const n=Kt(e.endContainer,e.endOffset);t.setEnd(n.container,n.offset);return t};const Xt=["OL","UL","DL"];const Jt=Xt.join(",");const Qt=(e,t)=>{const o=t||e.selection.getStart(true);return e.dom.getParent(o,Jt,io(e,o))};const eo=(e,t)=>d(e)&&t.length===1&&t[0]===e;const to=e=>O(e.querySelectorAll(Jt),_t);const oo=e=>{const t=Qt(e);const o=e.selection.getSelectedBlocks();if(eo(t,o)){return to(t)}else{return O(o,(e=>_t(e)&&t!==e))}};const no=(e,t)=>{const o=yt.map(t,(t=>{const o=e.dom.getParent(t,"li,dd,dt",io(e,t));return o?o:t}));return F(o)};const so=e=>{const t=e.selection.getSelectedBlocks();return O(no(e,t),St)};const ro=e=>O(so(e),zt);const ao=(e,t)=>{const o=e.dom.getParents(t,"TD,TH");return o.length>0?o[0]:e.getBody()};const co=(e,t)=>!_t(t)&&!St(t)&&z(Xt,(o=>e.isValidChild(t.nodeName,o)));const io=(e,t)=>{const o=e.dom.getParents(t,e.dom.isBlock);const n=t=>t.nodeName.toLowerCase()!==Pt(e);const s=M(o,(t=>n(t)&&co(e.schema,t)));return s.getOr(e.getBody())};const lo=e=>Se(e).exists((e=>St(e.dom)&&Ae(e).exists((e=>!_t(e.dom)))&&De(e).exists((e=>!_t(e.dom)))));const uo=(e,t)=>{const o=e.dom.getParents(t,"ol,ul",io(e,t));return P(o)};const fo=e=>{const t=uo(e,e.selection.getStart());const o=O(e.selection.getSelectedBlocks(),xt);return t.toArray().concat(o)};const mo=e=>{const t=e.selection.getStart();return e.dom.getParents(t,"ol,ul",io(e,t))};const go=e=>{const t=fo(e);const o=mo(e);return M(o,(e=>lo(ee.fromDom(e)))).fold((()=>po(e,t)),(e=>[e]))};const po=(e,t)=>{const o=T(t,(t=>uo(e,t).getOr(t)));return F(o)};const ho=e=>/\btox\-/.test(e.className);const yo=(e,t)=>N(e,_t,Tt).exists((e=>e.nodeName===t&&!ho(e)));const bo=(e,t)=>t!==null&&!e.dom.isEditable(t);const vo=e=>{const t=Qt(e);return bo(e,t)};const ko=(e,t)=>{const o=e.dom.getParent(t,"ol,ul,dl");return bo(e,o)};const wo=(e,t)=>{const o=e.selection.getNode();t({parents:e.dom.getParents(o),element:o});e.on("NodeChange",t);return()=>e.off("NodeChange",t)};const _o=(e,t)=>{const o=t||document;const n=o.createDocumentFragment();E(e,(e=>{n.appendChild(e.dom)}));return ee.fromDom(n)};const xo=(e,t,o)=>e.dispatch("ListMutation",{action:t,element:o});const Co=e=>t=>t.replace(e,"");const So=Co(/^\s+|\s+$/g);const zo=e=>e.length>0;const To=e=>!zo(e);const Eo=e=>e.style!==undefined&&u(e.style.getPropertyValue);const Oo=(e,t,o)=>{if(!r(o)){console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e);throw new Error("CSS value must be a string: "+o)}if(Eo(e)){e.style.setProperty(t,o)}};const Ao=(e,t,o)=>{const n=e.dom;Oo(n,t,o)};const Do=e=>se(e,"OL,UL");const No=e=>se(e,"LI");const Mo=e=>Ae(e).exists(Do);const Ro=e=>De(e).exists(Do);const Bo=e=>"listAttributes"in e;const Lo=e=>"isComment"in e;const Ho=e=>"isFragment"in e;const Io=e=>e.depth>0;const Po=e=>e.isSelected;const Fo=e=>{const t=Ee(e);const o=Ro(e)?t.slice(0,-1):t;return T(o,mt)};const Vo=(e,t,o)=>Se(e).filter(be).map((n=>({depth:t,dirty:false,isSelected:o,content:Fo(e),itemAttributes:ut(e),listAttributes:ut(n),listType:me(n),isInPreviousLi:false})));const jo=(e,t)=>{Ke(e.item,t.list)};const Zo=e=>{for(let t=1;t<e.length;t++){jo(e[t-1],e[t])}};const Uo=(e,t)=>{Z(P(e),I(t),jo)};const qo=(e,t)=>{const o={list:ee.fromTag(t,e),item:ee.fromTag("li",e)};Ke(o.list,o.item);return o};const Wo=(e,t,o)=>{const n=[];for(let s=0;s<o;s++){n.push(qo(e,Bo(t)?t.listType:t.parentListType))}return n};const $o=(e,t)=>{for(let t=0;t<e.length-1;t++){Ao(e[t].item,"list-style-type","none")}P(e).each((e=>{if(Bo(t)){dt(e.list,t.listAttributes);dt(e.item,t.itemAttributes)}Xe(e.item,t.content)}))};const Go=(e,t)=>{if(me(e.list)!==t.listType){e.list=pt(e.list,t.listType)}dt(e.list,t.listAttributes)};const Ko=(e,t,o)=>{const n=ee.fromTag("li",e);dt(n,t);Xe(n,o);return n};const Yo=(e,t)=>{Ke(e.list,t);e.item=t};const Xo=(e,t,o)=>{const n=t.slice(0,o.depth);P(n).each((t=>{if(Bo(o)){const n=Ko(e,o.itemAttributes,o.content);Yo(t,n);Go(t,o)}else if(Ho(o)){Xe(t.item,o.content)}else{const e=ee.fromHtml(`\x3c!--${o.content}--\x3e`);Ke(t.list,e)}}));return n};const Jo=(e,t,o)=>{const n=Wo(e,o,o.depth-t.length);Zo(n);$o(n,o);Uo(t,n);return t.concat(n)};const Qo=(e,t)=>{let o=k.none();const n=D(t,((t,n,s)=>{if(!Lo(n)){return n.depth>t.length?Jo(e,t,n):Xo(e,t,n)}else{if(s===0){o=k.some(n);return t}return Xo(e,t,n)}}),[]);o.each((e=>{const t=ee.fromHtml(`\x3c!--${e.content}--\x3e`);I(n).each((e=>{Ge(e.list,t)}))}));return I(n).map((e=>e.list))};const en=(e,t)=>{switch(e){case"Indent":t.depth++;break;case"Outdent":t.depth--;break;case"Flatten":t.depth=0}t.dirty=true};const tn=(e,t)=>{if(Bo(e)&&Bo(t)){e.listType=t.listType;e.listAttributes={...t.listAttributes}}};const on=e=>{e.listAttributes=it(e.listAttributes,((e,t)=>t!=="start"))};const nn=(e,t)=>{const o=e[t].depth;const n=e=>e.depth===o&&!e.dirty;const s=e=>e.depth<o;return N(L(e.slice(0,t)),n,s).orThunk((()=>N(e.slice(t+1),n,s)))};const sn=e=>{E(e,((t,o)=>{nn(e,o).fold((()=>{if(t.dirty&&Bo(t)){on(t)}}),(e=>tn(t,e)))}));return e};const rn=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};const an=(e,t,o,n)=>{var s;if(he(n)){return[{depth:e+1,content:(s=n.dom.nodeValue)!==null&&s!==void 0?s:"",dirty:false,isSelected:false,isComment:true}]}t.each((e=>{if(oe(e.start,n)){o.set(true)}}));const r=Vo(n,e,o.get());t.each((e=>{if(oe(e.end,n)){o.set(false)}}));const a=De(n).filter(Do).map((n=>ln(e,t,o,n))).getOr([]);return r.toArray().concat(a)};const cn=(e,t,o,n)=>Ae(n).filter(Do).fold((()=>an(e,t,o,n)),(s=>{const r=D(Ee(n),((n,r,a)=>{if(a===0){return n}else{if(No(r)){return n.concat(an(e,t,o,r))}else{const t={isFragment:true,depth:e,content:[r],isSelected:false,dirty:false,parentListType:me(s)};return n.concat(t)}}}),[]);return ln(e,t,o,s).concat(r)}));const ln=(e,t,o,n)=>B(Ee(n),(n=>{const s=Do(n)?ln:cn;const r=e+1;return s(r,t,o,n)}));const dn=(e,t)=>{const o=rn(false);const n=0;return T(e,(e=>({sourceList:e,entries:ln(n,t,o,e)})))};const un=(e,t)=>{const o=sn(t);return T(o,(t=>{const o=!Lo(t)?_o(t.content):_o([ee.fromHtml(`\x3c!--${t.content}--\x3e`)]);const n=Bo(t)?t.itemAttributes:{};return ee.fromDom(Vt(e,o.dom,n))}))};const fn=(e,t)=>{const o=sn(t);return Qo(e.contentDocument,o).toArray()};const mn=(e,t)=>B(A(t,Io),(t=>{const o=I(t).exists(Io);return o?fn(e,t):un(e,t)}));const gn=(e,t)=>{E(O(e,Po),(e=>en(t,e)))};const pn=e=>{const t=T(so(e),ee.fromDom);return Z(M(t,b(Mo)),M(L(t),b(Mo)),((e,t)=>({start:e,end:t})))};const hn=(e,t,o)=>{const n=dn(t,pn(e));E(n,(t=>{gn(t.entries,o);const n=mn(e,t.entries);E(n,(t=>{xo(e,o==="Indent"?"IndentList":"OutdentList",t.dom)}));Ye(t.sourceList,n);Qe(t.sourceList)}))};const yn=(e,t)=>{const o=nt(go(e));const n=nt(ro(e));let s=false;if(o.length||n.length){const r=e.selection.getBookmark();hn(e,o,t);Gt(e,t,n);e.selection.moveToBookmark(r);e.selection.setRng(Yt(e.selection.getRng()));e.nodeChanged();s=true}return s};const bn=(e,t)=>!vo(e)&&yn(e,t);const vn=e=>bn(e,"Indent");const kn=e=>bn(e,"Outdent");const wn=e=>bn(e,"Flatten");const _n="\ufeff";const xn=e=>e===_n;const Cn=(e,t,o)=>Pe(e,t,o).isSome();const Sn=(e,t)=>Cn(e,y(oe,t));var zn=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager");const Tn=ht.DOM;const En=e=>{const t={};const o=o=>{let n=e[o?"startContainer":"endContainer"];let s=e[o?"startOffset":"endOffset"];if(wt(n)){const e=Tn.create("span",{"data-mce-type":"bookmark"});if(n.hasChildNodes()){s=Math.min(s,n.childNodes.length-1);if(o){n.insertBefore(e,n.childNodes[s])}else{Tn.insertAfter(e,n.childNodes[s])}}else{n.appendChild(e)}n=e;s=0}t[o?"startContainer":"endContainer"]=n;t[o?"startOffset":"endOffset"]=s};o(true);if(!e.collapsed){o()}return t};const On=e=>{const t=t=>{const o=e=>{var t;let o=(t=e.parentNode)===null||t===void 0?void 0:t.firstChild;let n=0;while(o){if(o===e){return n}if(!wt(o)||o.getAttribute("data-mce-type")!=="bookmark"){n++}o=o.nextSibling}return-1};let n=e[t?"startContainer":"endContainer"];let s=e[t?"startOffset":"endOffset"];if(!n){return}if(wt(n)&&n.parentNode){const e=n;s=o(n);n=n.parentNode;Tn.remove(e);if(!n.hasChildNodes()&&Tn.isBlock(n)){n.appendChild(Tn.create("br"))}}e[t?"startContainer":"endContainer"]=n;e[t?"startOffset":"endOffset"]=s};t(true);t();const o=Tn.createRng();o.setStart(e.startContainer,e.startOffset);if(e.endContainer){o.setEnd(e.endContainer,e.endOffset)}return Yt(o)};const An=e=>{switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}};const Dn=(e,t,o)=>{const n=o["list-style-type"]?o["list-style-type"]:null;e.setStyle(t,"list-style-type",n)};const Nn=(e,t)=>{yt.each(t,((t,o)=>{e.setAttribute(o,t)}))};const Mn=(e,t,o)=>{Nn(t,o["list-attributes"]);yt.each(e.select("li",t),(e=>{Nn(e,o["list-item-attributes"])}))};const Rn=(e,t,o)=>{Dn(e,t,o);Mn(e,t,o)};const Bn=(e,t,o)=>{yt.each(o,(o=>e.setStyle(t,o,"")))};const Ln=(e,t)=>d(t)&&!Dt(t,e.schema.getBlockElements());const Hn=(e,t,o,n)=>{let s=t[o?"startContainer":"endContainer"];const r=t[o?"startOffset":"endOffset"];if(wt(s)){s=s.childNodes[Math.min(r,s.childNodes.length-1)]||s}if(!o&&Et(s.nextSibling)){s=s.nextSibling}const a=t=>{while(!e.dom.isBlock(t)&&t.parentNode&&n!==t){t=t.parentNode}return t};const c=(t,o)=>{var n;const s=new tt(t,a(t));const r=o?"next":"prev";let c;while(c=s[r]()){if(!(Nt(e,c)||xn(c.textContent)||((n=c.textContent)===null||n===void 0?void 0:n.length)===0)){return k.some(c)}}return k.none()};if(o&&kt(s)){if(xn(s.textContent)){s=c(s,false).getOr(s)}else{if(s.parentNode!==null&&Ln(e,s.parentNode)){s=s.parentNode}while(s.previousSibling!==null&&(Ln(e,s.previousSibling)||kt(s.previousSibling))){s=s.previousSibling}}}if(!o&&kt(s)){if(xn(s.textContent)){s=c(s,true).getOr(s)}else{if(s.parentNode!==null&&Ln(e,s.parentNode)){s=s.parentNode}while(s.nextSibling!==null&&(Ln(e,s.nextSibling)||kt(s.nextSibling))){s=s.nextSibling}}}while(s.parentNode!==n){const t=s.parentNode;if(At(e,s)){return s}if(/^(TD|TH)$/.test(t.nodeName)){return s}s=t}return s};const In=(e,t,o)=>{const n=[];const s=e.dom;const r=Hn(e,t,true,o);const a=Hn(e,t,false,o);let c;const i=[];for(let e=r;e;e=e.nextSibling){i.push(e);if(e===a){break}}yt.each(i,(t=>{var r;if(At(e,t)){n.push(t);c=null;return}if(s.isBlock(t)||Et(t)){if(Et(t)){s.remove(t)}c=null;return}const a=t.nextSibling;if(zn.isBookmarkNode(t)){if(_t(a)||At(e,a)||!a&&t.parentNode===o){c=null;return}}if(!c){c=s.create("p");(r=t.parentNode)===null||r===void 0?void 0:r.insertBefore(c,t);n.push(c)}c.appendChild(t)}));return n};const Pn=(e,t,o)=>{const n=e.getStyle(t,"list-style-type");let s=o?o["list-style-type"]:"";s=s===null?"":s;return n===s};const Fn=(e,t)=>{const o=e.selection.getStart(true);const n=Hn(e,t,true,e.getBody());if(Sn(ee.fromDom(n),ee.fromDom(t.commonAncestorContainer))){return t.commonAncestorContainer}else{return o}};const Vn=(e,t,o)=>{const n=e.selection.getRng();let s="LI";const r=io(e,Fn(e,n));const a=e.dom;if(a.getContentEditable(e.selection.getNode())==="false"){return}t=t.toUpperCase();if(t==="DL"){s="DT"}const c=En(n);const i=O(In(e,n,r),e.dom.isEditable);yt.each(i,(n=>{let r;const c=n.previousSibling;const i=n.parentNode;if(!St(i)){if(c&&_t(c)&&c.nodeName===t&&Pn(a,c,o)){r=c;n=a.rename(n,s);c.appendChild(n)}else{r=a.create(t);i.insertBefore(r,n);r.appendChild(n);n=a.rename(n,s)}Bn(a,n,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]);Rn(a,r,o);Wn(e.dom,r)}}));e.selection.setRng(On(c))};const jn=(e,t)=>_t(e)&&e.nodeName===(t===null||t===void 0?void 0:t.nodeName);const Zn=(e,t,o)=>{const n=e.getStyle(t,"list-style-type",true);const s=e.getStyle(o,"list-style-type",true);return n===s};const Un=(e,t)=>e.className===t.className;const qn=(e,t,o)=>jn(t,o)&&Zn(e,t,o)&&Un(t,o);const Wn=(e,t)=>{let o;let n=t.nextSibling;if(qn(e,t,n)){const s=n;while(o=s.firstChild){t.appendChild(o)}e.remove(s)}n=t.previousSibling;if(qn(e,t,n)){const s=n;while(o=s.lastChild){t.insertBefore(o,t.firstChild)}e.remove(s)}};const $n=(e,t,o,n)=>{if(t.nodeName!==o){const s=e.dom.rename(t,o);Rn(e.dom,s,n);xo(e,An(o),s)}else{Rn(e.dom,t,n);xo(e,An(o),t)}};const Gn=(e,t,o,n)=>{t.classList.forEach(((e,o,n)=>{if(e.startsWith("tox-")){n.remove(e);if(n.length===0){t.removeAttribute("class")}}}));if(t.nodeName!==o){const s=e.dom.rename(t,o);Rn(e.dom,s,n);xo(e,An(o),s)}else{Rn(e.dom,t,n);xo(e,An(o),t)}};const Kn=(e,t,o,n,s)=>{const r=_t(t);if(r&&t.nodeName===n&&!Yn(s)&&!ho(t)){wn(e)}else{Vn(e,n,s);const a=En(e.selection.getRng());const c=r?[t,...o]:o;const i=r&&ho(t)?Gn:$n;yt.each(c,(t=>{i(e,t,n,s)}));e.selection.setRng(On(a))}};const Yn=e=>"list-style-type"in e;const Xn=(e,t,o,n)=>{if(t===e.getBody()){return}if(t){if(t.nodeName===o&&!Yn(n)&&!ho(t)){wn(e)}else{const s=En(e.selection.getRng());if(ho(t)){t.classList.forEach(((e,o,n)=>{if(e.startsWith("tox-")){n.remove(e);if(n.length===0){t.removeAttribute("class")}}}))}Rn(e.dom,t,n);const r=e.dom.rename(t,o);Wn(e.dom,r);e.selection.setRng(On(s));Vn(e,o,n);xo(e,An(o),r)}}else{Vn(e,o,n);xo(e,An(o),t)}};const Jn=(e,t,o)=>{const n=Qt(e);if(ko(e,n)){return}const s=oo(e);const r=a(o)?o:{};if(s.length>0){Kn(e,n,s,t,r)}else{Xn(e,n,t,r)}};const Qn=ht.DOM;const es=(e,t)=>{const o=t.parentElement;if(o&&o.nodeName==="LI"&&o.firstChild===t){const n=o.previousSibling;if(n&&n.nodeName==="LI"){n.appendChild(t);if(Rt(e,o)){Qn.remove(o)}}else{Qn.setStyle(o,"listStyleType","none")}}if(_t(o)){const e=o.previousSibling;if(e&&e.nodeName==="LI"){e.appendChild(t)}}};const ts=(e,t)=>{const o=yt.grep(e.select("ol,ul",t));yt.each(o,(t=>{es(e,t)}))};const os=(e,t,o,n)=>{let s=t.startContainer;const r=t.startOffset;if(kt(s)&&(o?r<s.data.length:r>0)){return s}const a=e.schema.getNonEmptyElements();if(wt(s)){s=et.getNode(s,r)}const c=new tt(s,n);if(o){if(Mt(e.dom,s)){c.next()}}const i=o?c.next.bind(c):c.prev2.bind(c);while(s=i()){if(s.nodeName==="LI"&&!s.hasChildNodes()){return s}if(a[s.nodeName]){return s}if(kt(s)&&s.data.length>0){return s}}return null};const ns=(e,t)=>{const o=t.childNodes;return o.length===1&&!_t(o[0])&&e.isBlock(o[0])};const ss=e=>k.from(e).map(ee.fromDom).filter(ye).exists((e=>Ue(e)&&!S(["details"],me(e))));const rs=(e,t)=>{if(ns(e,t)&&ss(t.firstChild)){e.remove(t.firstChild,true)}};const as=(e,t,o)=>{let n;const s=ns(e,o)?o.firstChild:o;rs(e,t);if(!Rt(e,t,true)){while(n=t.firstChild){s.appendChild(n)}}};const cs=(e,t,o)=>{let n;const s=t.parentNode;if(!Bt(e,t)||!Bt(e,o)){return}if(_t(o.lastChild)){n=o.lastChild}if(s===o.lastChild){if(Et(s.previousSibling)){e.remove(s.previousSibling)}}const r=o.lastChild;if(r&&Et(r)&&t.hasChildNodes()){e.remove(r)}if(Rt(e,o,true)){Je(ee.fromDom(o))}as(e,t,o);if(n){o.appendChild(n)}const a=ne(ee.fromDom(o),ee.fromDom(t));const c=a?e.getParents(t,_t,o):[];e.remove(t);E(c,(t=>{if(Rt(e,t)&&t!==e.getRoot()){e.remove(t)}}))};const is=(e,t,o)=>{Je(ee.fromDom(o));cs(e.dom,t,o);e.selection.setCursorLocation(o,0)};const ls=(e,t,o,n)=>{const s=e.dom;if(s.isEmpty(n)){is(e,o,n)}else{const r=En(t);cs(s,o,n);e.selection.setRng(On(r))}};const ds=(e,t,o,n)=>{const s=En(t);cs(e.dom,o,n);const r=On(s);e.selection.setRng(r)};const us=(e,t)=>{const o=e.dom,n=e.selection;const s=n.getStart();const r=ao(e,s);const a=o.getParent(n.getStart(),"LI",r);if(a){const s=a.parentElement;if(s===e.getBody()&&Rt(o,s)){return true}const c=Yt(n.getRng());const i=o.getParent(os(e,c,t,r),"LI",r);const l=i&&(t?o.isChildOf(a,i):o.isChildOf(i,a));if(i&&i!==a&&!l){e.undoManager.transact((()=>{if(t){ls(e,c,i,a)}else{if(Ot(a)){kn(e)}else{ds(e,c,a,i)}}}));return true}else if(l&&!t&&i!==a){e.undoManager.transact((()=>{if(c.commonAncestorContainer.parentElement){const t=En(c);const n=c.commonAncestorContainer.parentElement;as(o,c.commonAncestorContainer.parentElement,i);n.remove();const s=On(t);e.selection.setRng(s)}}));return true}else if(!i){if(!t&&c.startOffset===0&&c.endOffset===0){e.undoManager.transact((()=>{wn(e)}));return true}}}return false};const fs=(e,t,o)=>{const n=e.getParent(t.parentNode,e.isBlock,o);e.remove(t);if(n&&e.isEmpty(n)){e.remove(n)}};const ms=(e,t)=>{const o=e.dom;const n=e.selection.getStart();const s=ao(e,n);const r=o.getParent(n,o.isBlock,s);if(r&&o.isEmpty(r,undefined,{checkRootAsContent:true})){const n=Yt(e.selection.getRng());const a=o.getParent(os(e,n,t,s),"LI",s);if(a){const c=e=>S(["td","th","caption"],me(e));const i=e=>e.dom===s;const l=Fe(ee.fromDom(a),c,i);const d=Fe(ee.fromDom(n.startContainer),c,i);if(!j(l,d,oe)){return false}e.undoManager.transact((()=>{const n=a.parentNode;fs(o,r,s);Wn(o,n);e.selection.select(a,true);e.selection.collapse(t)}));return true}}return false};const gs=(e,t)=>us(e,t)||ms(e,t);const ps=e=>{const t=e.selection.getStart();const o=ao(e,t);const n=e.dom.getParent(t,"LI,DT,DD",o);return n||so(e).length>0};const hs=e=>{if(ps(e)){e.undoManager.transact((()=>{e.execCommand("Delete");ts(e.dom,e.getBody())}));return true}return false};const ys=(e,t)=>{const o=e.selection;return!ko(e,o.getNode())&&(o.isCollapsed()?gs(e,t):hs(e))};const bs=e=>{e.on("ExecCommand",(t=>{const o=t.command.toLowerCase();if((o==="delete"||o==="forwarddelete")&&ps(e)){ts(e.dom,e.getBody())}}));e.on("keydown",(t=>{if(t.keyCode===ot.BACKSPACE){if(ys(e,false)){t.preventDefault()}}else if(t.keyCode===ot.DELETE){if(ys(e,true)){t.preventDefault()}}}))};const vs=e=>({backspaceDelete:t=>{ys(e,t)}});const ks=(e,t)=>{const o=Qt(e);if(o===null||ko(e,o)){return}e.undoManager.transact((()=>{if(a(t.styles)){e.dom.setStyles(o,t.styles)}if(a(t.attrs)){rt(t.attrs,((t,n)=>e.dom.setAttrib(o,n,t)))}}))};const ws=e=>{const t=L(So(e).split(""));const o=T(t,((e,t)=>{const o=e.toUpperCase().charCodeAt(0)-"A".charCodeAt(0)+1;return Math.pow(26,t)*o}));return D(o,((e,t)=>e+t),0)};const _s=e=>{e--;if(e<0){return""}else{const t=e%26;const o=Math.floor(e/26);const n=_s(o);const s=String.fromCharCode("A".charCodeAt(0)+t);return n+s}};const xs=e=>/^[A-Z]+$/.test(e);const Cs=e=>/^[a-z]+$/.test(e);const Ss=e=>/^[0-9]+$/.test(e);const zs=e=>{if(Ss(e)){return 2}else if(xs(e)){return 0}else if(Cs(e)){return 1}else if(To(e)){return 3}else{return 4}};const Ts=e=>{switch(zs(e)){case 2:return k.some({listStyleType:k.none(),start:e});case 0:return k.some({listStyleType:k.some("upper-alpha"),start:ws(e).toString()});case 1:return k.some({listStyleType:k.some("lower-alpha"),start:ws(e).toString()});case 3:return k.some({listStyleType:k.none(),start:""});case 4:return k.none()}};const Es=e=>{const t=parseInt(e.start,10);if(V(e.listStyleType,"upper-alpha")){return _s(t)}else if(V(e.listStyleType,"lower-alpha")){return _s(t).toLowerCase()}else{return e.start}};const Os=e=>{const t=Qt(e);if(!Ct(t)||ko(e,t)){return}e.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:Es({start:e.dom.getAttrib(t,"start","1"),listStyleType:k.from(e.dom.getStyle(t,"list-style-type"))})},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],onSubmit:t=>{const o=t.getData();Ts(o.start).each((t=>{e.execCommand("mceListUpdate",false,{attrs:{start:t.start==="1"?"":t.start},styles:{"list-style-type":t.listStyleType.getOr("")}})}));t.close()}})};const As=(e,t)=>()=>{const o=Qt(e);return d(o)&&o.nodeName===t};const Ds=e=>{e.addCommand("mceListProps",(()=>{Os(e)}))};const Ns=e=>{e.on("BeforeExecCommand",(t=>{const o=t.command.toLowerCase();if(o==="indent"){vn(e)}else if(o==="outdent"){kn(e)}}));e.addCommand("InsertUnorderedList",((t,o)=>{Jn(e,"UL",o)}));e.addCommand("InsertOrderedList",((t,o)=>{Jn(e,"OL",o)}));e.addCommand("InsertDefinitionList",((t,o)=>{Jn(e,"DL",o)}));e.addCommand("RemoveList",(()=>{wn(e)}));Ds(e);e.addCommand("mceListUpdate",((t,o)=>{if(a(o)){ks(e,o)}}));e.addQueryStateHandler("InsertUnorderedList",As(e,"UL"));e.addQueryStateHandler("InsertOrderedList",As(e,"OL"));e.addQueryStateHandler("InsertDefinitionList",As(e,"DL"))};var Ms=tinymce.util.Tools.resolve("tinymce.html.Node");const Rs=e=>e.type===3;const Bs=e=>e.length===0;const Ls=e=>{const t=(t,o)=>{const n=Ms.create("li");E(t,(e=>n.append(e)));if(o){e.insert(n,o,true)}else{e.append(n)}};const o=(e,o)=>{if(Rs(o)){return[...e,o]}else if(!Bs(e)&&!Rs(o)){t(e,o);return[]}else{return e}};const n=D(e.children(),o,[]);if(!Bs(n)){t(n)}};const Hs=e=>{e.on("PreInit",(()=>{const{parser:t}=e;t.addNodeFilter("ul,ol",(e=>E(e,Ls)))}))};const Is=e=>{e.on("keydown",(t=>{if(t.keyCode!==ot.TAB||ot.metaKeyPressed(t)){return}e.undoManager.transact((()=>{if(t.shiftKey?kn(e):vn(e)){t.preventDefault()}}))}))};const Ps=e=>{if(It(e)){Is(e)}bs(e)};const Fs=(e,t)=>o=>{const n=n=>{o.setActive(yo(n.parents,t));o.setEnabled(!ko(e,n.element)&&e.selection.isEditable())};o.setEnabled(e.selection.isEditable());return wo(e,n)};const Vs=e=>{const t=t=>()=>e.execCommand(t);if(!e.hasPlugin("advlist")){e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:false,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:Fs(e,"OL")});e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:false,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:Fs(e,"UL")})}};const js=(e,t)=>o=>{const n=n=>o.setEnabled(yo(n.parents,t)&&!ko(e,n.element));return wo(e,n)};const Zs=e=>{const t={text:"List properties...",icon:"ordered-list",onAction:()=>e.execCommand("mceListProps"),onSetup:js(e,"OL")};e.ui.registry.addMenuItem("listprops",t);e.ui.registry.addContextMenu("lists",{update:t=>{const o=Qt(e,t);return Ct(o)?["listprops"]:[]}})};var Us=()=>{e.add("lists",(e=>{Ht(e);Hs(e);if(!e.hasPlugin("rtc",true)){Ps(e);Ns(e)}else{Ds(e)}Vs(e);Zs(e);return vs(e)}))};Us()})()},(e,t,o)=>{o(24)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=n("string");const a=s("boolean");const c=e=>e===null||e===undefined;const i=e=>!c(e);const l=s("function");const d=e=>t=>t.options.get(e);const u=e=>{const t=e.options.register;const o=e=>t=>{const o=a(t)||r(t);if(o){if(a(t)){return{value:t?e:"",valid:o}}else{return{value:t.trim(),valid:o}}}else{return{valid:false,message:"Must be a boolean or string."}}};const n="bold italic | quicklink h2 h3 blockquote";t("quickbars_selection_toolbar",{processor:o(n),default:n});const s="quickimage quicktable";t("quickbars_insert_toolbar",{processor:o(s),default:s});const c="alignleft aligncenter alignright";t("quickbars_image_toolbar",{processor:o(c),default:c})};const f=d("quickbars_selection_toolbar");const m=d("quickbars_insert_toolbar");const g=d("quickbars_image_toolbar");let p=0;const h=e=>{const t=new Date;const o=t.getTime();const n=Math.floor(Math.random()*1e9);p++;return e+"_"+n+p+String(o)};const y=(e,t,o)=>{e.execCommand("mceInsertTable",false,{rows:o,columns:t})};const b=(e,t,o)=>{const n=e.editorUpload.blobCache;const s=n.create(h("mceu"),o,t);n.add(s);e.insertContent(e.dom.createHTML("img",{src:s.blobUri()}))};const v=e=>new Promise((t=>{const o=new FileReader;o.onloadend=()=>{t(o.result.split(",")[1])};o.readAsDataURL(e)}));var k=tinymce.util.Tools.resolve("tinymce.util.Delay");const w=e=>new Promise((t=>{let o=false;const n=document.createElement("input");n.type="file";n.accept="image/*";n.style.position="fixed";n.style.left="0";n.style.top="0";n.style.opacity="0.001";document.body.appendChild(n);const s=e=>{var s;if(!o){(s=n.parentNode)===null||s===void 0?void 0:s.removeChild(n);o=true;t(e)}};const r=e=>{s(Array.prototype.slice.call(e.target.files))};n.addEventListener("input",r);n.addEventListener("change",r);const a=t=>{const n=()=>{s([])};if(!o){if(t.type==="focusin"){k.setEditorTimeout(e,n,1e3)}else{n()}}e.off("focusin remove",a)};e.on("focusin remove",a);n.click()}));const _=e=>{e.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>{w(e).then((t=>{if(t.length>0){const o=t[0];v(o).then((t=>{b(e,t,o)}))}}))}});e.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{y(e,2,2)}})};const x=e=>()=>e;const C=x(false);class S{constructor(e,t){this.tag=e;this.value=t}static some(e){return new S(true,e)}static none(){return S.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return S.some(e(this.value))}else{return S.none()}}bind(e){if(this.tag){return e(this.value)}else{return S.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return S.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return i(e)?S.some(e):S.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}S.singletonNone=new S(false);typeof window!=="undefined"?window:Function("return this;")();const z=1;const T=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const E=(e,t)=>{const o=e.dom;return o&&o.hasAttribute?o.hasAttribute(t):false};var O=(e,t,o,n,s)=>{if(e(o,n)){return S.some(o)}else if(l(s)&&s(o)){return S.none()}else{return t(o,n,s)}};const A=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return M(n.childNodes[0])};const D=(e,t)=>{const o=t||document;const n=o.createElement(e);return M(n)};const N=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return M(n)};const M=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const R=(e,t,o)=>S.from(e.dom.elementFromPoint(t,o)).map(M);const B={fromHtml:A,fromTag:D,fromText:N,fromDom:M,fromPoint:R};const L=(e,t)=>{const o=e.dom;if(o.nodeType!==z){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const H=(e,t,o)=>{let n=e.dom;const s=l(o)?o:C;while(n.parentNode){n=n.parentNode;const e=B.fromDom(n);if(t(e)){return S.some(e)}else if(s(e)){break}}return S.none()};const I=(e,t,o)=>{const n=(e,t)=>t(e);return O(n,H,e,t,o)};const P=(e,t,o)=>I(e,t,o).isSome();const F=(e,t,o)=>H(e,(e=>L(e,t)),o);const V=(e,t,o)=>{const n=(e,t)=>L(e,t);return O(n,F,e,t,o)};const j=e=>{const t=m(e);if(t.length>0){e.ui.registry.addContextToolbar("quickblock",{predicate:t=>{const o=B.fromDom(t);const n=e.schema.getTextBlockElements();const s=t=>t.dom===e.getBody();return!E(o,"data-mce-bogus")&&V(o,'table,[data-mce-bogus="all"]',s).fold((()=>P(o,(t=>T(t)in n&&e.dom.isEmpty(t.dom)),s)),C)},items:t,position:"line",scope:"editor"})}};const Z=e=>e.dom.classList!==undefined;const U=(e,t)=>Z(e)&&e.dom.classList.contains(t);const q=e=>{const t=t=>e.dom.isEditable(t);const o=e=>t(e.parentElement);const n=e=>{const t=e.nodeName==="FIGURE"&&/image/i.test(e.className);const n=e.nodeName==="IMG"||t;const s=U(B.fromDom(e),"mce-pagebreak");return n&&o(e)&&!s};const s=g(e);if(s.length>0){e.ui.registry.addContextToolbar("imageselection",{predicate:n,items:s,position:"node"})}const r=f(e);if(r.length>0){e.ui.registry.addContextToolbar("textselection",{predicate:o=>!n(o)&&!e.selection.isCollapsed()&&t(o),items:r,position:"selection",scope:"editor"})}};var W=()=>{e.add("quickbars",(e=>{u(e);_(e);j(e);q(e)}))};W()})()},(e,t,o)=>{o(26)},()=>{(function(){"use strict";const e=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const o=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const n=e=>{const t=typeof e;if(e===null){return"null"}else if(t==="object"&&Array.isArray(e)){return"array"}else if(t==="object"&&o(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return t}};const s=e=>t=>n(t)===e;const r=e=>t=>typeof t===e;const a=s("string");const c=s("array");const i=r("boolean");const l=e=>e===null||e===undefined;const d=e=>!l(e);const u=r("number");const f=()=>{};const m=e=>()=>e;const g=m(true);const p=`[~№|!-*+-\\/:;?@\\[-\`{}¡«·»¿;·՚-՟։֊־׀׃׆׳״؉؊،؍؛؞؟٪-٭۔܀-܍߷-߹࠰-࠾࡞।॥॰෴๏๚๛༄-༒༺-༽྅࿐-࿔࿙࿚၊-၏჻፡-፨᐀᙭᙮᚛᚜᛫-᛭᜵᜶។-៖៘-៚᠀-᠊᥄᥅᨞᨟᪠-᪦᪨-᪭᭚-᭠᯼-᯿᰻-᰿᱾᱿᳓‐-‧‰-⁃⁅-⁑⁓-⁞⁽⁾₍₎〈〉❨-❵⟅⟆⟦-⟯⦃-⦘⧘-⧛⧼⧽⳹-⳼⳾⳿⵰⸀-⸮⸰⸱、-〃〈-】〔-〟〰〽゠・꓾꓿꘍-꘏꙳꙾꛲-꛷꡴-꡷꣎꣏꣸-꣺꤮꤯꥟꧁-꧍꧞꧟꩜-꩟꫞꫟꯫﴾﴿︐-︙︰-﹒﹔-﹡﹣﹨﹪﹫!-#%-*,-/:;?@[-]_{}⦅-・]`;const h=m(p);class y{constructor(e,t){this.tag=e;this.value=t}static some(e){return new y(true,e)}static none(){return y.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return y.some(e(this.value))}else{return y.none()}}bind(e){if(this.tag){return e(this.value)}else{return y.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return y.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return d(e)?y.some(e):y.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}y.singletonNone=new y(false);const b=h;var v=tinymce.util.Tools.resolve("tinymce.Env");var k=tinymce.util.Tools.resolve("tinymce.util.Tools");const w=Array.prototype.slice;const _=Array.prototype.push;const x=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const C=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const S=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}};const z=(e,t)=>{if(e.length===0){return[]}else{let o=t(e[0]);const n=[];let s=[];for(let r=0,a=e.length;r<a;r++){const a=e[r];const c=t(a);if(c!==o){n.push(s);s=[]}o=c;s.push(a)}if(s.length!==0){n.push(s)}return n}};const T=(e,t,o)=>{C(e,((e,n)=>{o=t(o,e,n)}));return o};const E=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!c(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}_.apply(t,e[o])}return t};const O=(e,t)=>E(x(e,t));const A=(e,t)=>{const o=w.call(e,0);o.sort(t);return o};const D=Object.hasOwnProperty;const N=(e,t)=>D.call(e,t);typeof window!=="undefined"?window:Function("return this;")();const M=9;const R=11;const B=1;const L=3;const H=e=>e.dom.nodeType;const I=e=>t=>H(t)===e;const P=I(L);const F=(e,t,o)=>{if(a(o)||i(o)||u(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const V=(e,t,o)=>{F(e.dom,t,o)};const j=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return q(n.childNodes[0])};const Z=(e,t)=>{const o=t||document;const n=o.createElement(e);return q(n)};const U=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return q(n)};const q=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const W=(e,t,o)=>y.from(e.dom.elementFromPoint(t,o)).map(q);const $={fromHtml:j,fromTag:Z,fromText:U,fromDom:q,fromPoint:W};const G=e=>e.nodeType!==B&&e.nodeType!==M&&e.nodeType!==R||e.childElementCount===0;const K=(e,t)=>{const o=t===undefined?document:t.dom;return G(o)?[]:x(o.querySelectorAll(e),$.fromDom)};const Y=e=>y.from(e.dom.parentNode).map($.fromDom);const X=e=>x(e.dom.childNodes,$.fromDom);const J=(e,t)=>({element:e,offset:t});const Q=(e,t)=>{const o=X(e);return o.length>0&&t<o.length?J(o[t],0):J(e,t)};const ee=(e,t)=>{const o=Y(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))};const te=(e,t)=>{e.dom.appendChild(t.dom)};const oe=(e,t)=>{ee(e,t);te(t,e)};const ne=(e,t)=>{const o=o=>{if(!e(o)){throw new Error("Can only get "+t+" value of a "+t+" node")}return n(o).getOr("")};const n=t=>e(t)?y.from(t.dom.nodeValue):y.none();const s=(o,n)=>{if(!e(o)){throw new Error("Can only set raw "+t+" value of a "+t+" node")}o.dom.nodeValue=n};return{get:o,getOption:n,set:s}};const se=ne(P,"text");const re=e=>se.get(e);const ae=(e,t,o)=>(e.compareDocumentPosition(t)&o)!==0;const ce=(e,t)=>ae(e,t,Node.DOCUMENT_POSITION_PRECEDING);const ie=(e,t)=>K(t,e);var le=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker");const de=(e,t)=>e.isBlock(t)||N(e.schema.getVoidElements(),t.nodeName);const ue=(e,t)=>!e.isEditable(t);const fe=(e,t)=>e.getContentEditable(t)==="true"&&t.parentNode&&!e.isEditable(t.parentNode);const me=(e,t)=>!e.isBlock(t)&&N(e.schema.getWhitespaceElements(),t.nodeName);const ge=(e,t)=>de(e,t)||ue(e,t)||me(e,t)||fe(e,t);const pe=e=>e.nodeType===3;const he=()=>({sOffset:0,fOffset:0,elements:[]});const ye=(e,t)=>Q($.fromDom(e),t);const be=(e,t,o,n,s,r=true)=>{let a=r?t(false):o;while(a){const o=ue(e,a);if(o||me(e,a)){const e=o?n.cef(a):n.boundary(a);if(e){break}else{a=t(true);continue}}else if(de(e,a)){if(n.boundary(a)){break}}else if(pe(a)){n.text(a)}if(a===s){break}else{a=t(false)}}};const ve=(e,t,o,n,s)=>{var r;if(ge(e,o)){return}const a=(r=e.getParent(n,e.isBlock))!==null&&r!==void 0?r:e.getRoot();const c=new le(o,a);const i=s?c.next.bind(c):c.prev.bind(c);be(e,i,o,{boundary:g,cef:g,text:e=>{if(s){t.fOffset+=e.length}else{t.sOffset+=e.length}t.elements.push($.fromDom(e))}})};const ke=(e,t,o,n,s,r=true)=>{const a=new le(o,t);const c=[];let i=he();ve(e,i,o,t,false);const l=()=>{if(i.elements.length>0){c.push(i);i=he()}return false};be(e,a.next.bind(a),o,{boundary:l,cef:e=>{l();if(s){c.push(...s.cef(e))}return false},text:e=>{i.elements.push($.fromDom(e));if(s){s.text(e,i)}}},n,r);if(n){ve(e,i,n,t,true)}l();return c};const we=(e,t)=>{const o=ye(t.startContainer,t.startOffset);const n=o.element.dom;const s=ye(t.endContainer,t.endOffset);const r=s.element.dom;return ke(e,t.commonAncestorContainer,n,r,{text:(e,t)=>{if(e===r){t.fOffset+=e.length-s.offset}else if(e===n){t.sOffset+=o.offset}},cef:t=>{const o=O(ie($.fromDom(t),"*[contenteditable=true]"),(t=>{const o=t.dom;return ke(e,o,o)}));return A(o,((e,t)=>ce(e.elements[0].dom,t.elements[0].dom)?1:-1))}},false)};const _e=(e,t)=>t.collapsed?[]:we(e,t);const xe=(e,t)=>{const o=e.createRng();o.selectNode(t);return _e(e,o)};const Ce=(e,t)=>O(t,(t=>xe(e,t)));const Se=(e,t,o=0,n=e.length)=>{const s=t.regex;s.lastIndex=o;const r=[];let a;while(a=s.exec(e)){const e=a[t.matchIndex];const o=a.index+a[0].indexOf(e);const c=o+e.length;if(c>n){break}r.push({start:o,finish:c});s.lastIndex=c}return r};const ze=(e,t)=>{const o=T(e,((e,o)=>{const n=re(o);const s=e.last;const r=s+n.length;const a=O(t,((e,t)=>{if(e.start<r&&e.finish>s){return[{element:o,start:Math.max(s,e.start)-s,finish:Math.min(r,e.finish)-s,matchId:t}]}else{return[]}}));return{results:e.results.concat(a),last:r}}),{results:[],last:0}).results;return z(o,(e=>e.matchId))};const Te=(e,t)=>O(t,(t=>{const o=t.elements;const n=x(o,re).join("");const s=Se(n,e,t.sOffset,n.length-t.fOffset);return ze(o,s)}));const Ee=(e,t)=>{S(e,((e,o)=>{S(e,(e=>{const n=$.fromDom(t.cloneNode(false));V(n,"data-mce-index",o);const s=e.element.dom;if(s.length===e.finish&&e.start===0){oe(e.element,n)}else{if(s.length!==e.finish){s.splitText(e.finish)}const t=s.splitText(e.start);oe($.fromDom(t),n)}}))}))};const Oe=(e,t,o,n)=>{const s=xe(e,o);const r=Te(t,s);Ee(r,n);return r.length};const Ae=(e,t,o,n)=>{const s=o.getBookmark();const r=e.select("td[data-mce-selected],th[data-mce-selected]");const a=r.length>0?Ce(e,r):_e(e,o.getRng());const c=Te(t,a);Ee(c,n);o.moveToBookmark(s);return c.length};const De=e=>e.getAttribute("data-mce-index");const Ne=(e,t,o,n)=>{const s=e.dom.create("span",{"data-mce-bogus":1});s.className="mce-match-marker";const r=e.getBody();Ze(e,t,false);if(n){return Ae(e.dom,o,e.selection,s)}else{return Oe(e.dom,o,r,s)}};const Me=e=>{var t;const o=e.parentNode;if(e.firstChild){o.insertBefore(e.firstChild,e)}(t=e.parentNode)===null||t===void 0?void 0:t.removeChild(e)};const Re=(e,t)=>{const o=[];const n=k.toArray(e.getBody().getElementsByTagName("span"));if(n.length){for(let e=0;e<n.length;e++){const s=De(n[e]);if(s===null||!s.length){continue}if(s===t.toString()){o.push(n[e])}}}return o};const Be=(e,t,o)=>{const n=t.get();let s=n.index;const r=e.dom;if(o){if(s+1===n.count){s=0}else{s++}}else{if(s-1===-1){s=n.count-1}else{s--}}r.removeClass(Re(e,n.index),"mce-match-marker-selected");const a=Re(e,s);if(a.length){r.addClass(Re(e,s),"mce-match-marker-selected");e.selection.scrollIntoView(a[0]);return s}return-1};const Le=(e,t)=>{const o=t.parentNode;e.remove(t);if(o&&e.isEmpty(o)){e.remove(o)}};const He=(e,t)=>{const o=e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]");const n="("+o+")";return t?`(?:^|\\s|${b()})`+n+`(?=$|\\s|${b()})`:n};const Ie=(e,t,o,n,s,r)=>{const a=e.selection;const c=He(o,s);const i=a.isForward();const l={regex:new RegExp(c,n?"g":"gi"),matchIndex:1};const d=Ne(e,t,l,r);if(v.browser.isSafari()){a.setRng(a.getRng(),i)}if(d){const a=Be(e,t,true);t.set({index:a,count:d,text:o,matchCase:n,wholeWord:s,inSelection:r})}return d};const Pe=(e,t)=>{const o=Be(e,t,true);t.set({...t.get(),index:o})};const Fe=(e,t)=>{const o=Be(e,t,false);t.set({...t.get(),index:o})};const Ve=e=>{const t=De(e);return t!==null&&t.length>0};const je=(e,t,o,n,s)=>{const r=t.get();const a=r.index;let c,i=a;n=n!==false;const l=e.getBody();const d=k.grep(k.toArray(l.getElementsByTagName("span")),Ve);for(let t=0;t<d.length;t++){const l=De(d[t]);let u=c=parseInt(l,10);if(s||u===r.index){if(o.length){d[t].innerText=o;Me(d[t])}else{Le(e.dom,d[t])}while(d[++t]){u=parseInt(De(d[t]),10);if(u===c){Le(e.dom,d[t])}else{t--;break}}if(n){i--}}else if(c>a){d[t].setAttribute("data-mce-index",String(c-1))}}t.set({...r,count:s?0:r.count-1,index:i});if(n){Pe(e,t)}else{Fe(e,t)}return!s&&t.get().count>0};const Ze=(e,t,o)=>{let n;let s;const r=t.get();const a=k.toArray(e.getBody().getElementsByTagName("span"));for(let e=0;e<a.length;e++){const t=De(a[e]);if(t!==null&&t.length){if(t===r.index.toString()){if(!n){n=a[e].firstChild}s=a[e].firstChild}Me(a[e])}}t.set({...r,index:-1,count:0,text:""});if(n&&s){const t=e.dom.createRng();t.setStart(n,0);t.setEnd(s,s.data.length);if(o!==false){e.selection.setRng(t)}return t}else{return undefined}};const Ue=(e,t)=>t.get().count>1;const qe=(e,t)=>t.get().count>1;const We=(e,t)=>{const o=o=>Ze(e,t,o);const n=(o,n,s,r=false)=>Ie(e,t,o,n,s,r);const s=()=>Pe(e,t);const r=()=>Fe(e,t);const a=(o,n,s)=>je(e,t,o,n,s);return{done:o,find:n,next:s,prev:r,replace:a}};const $e=t=>{const o=e(y.none());const n=()=>o.get().each(t);const s=()=>{n();o.set(y.none())};const r=()=>o.get().isSome();const a=()=>o.get();const c=e=>{n();o.set(y.some(e))};return{clear:s,isSet:r,get:a,set:c}};const Ge=()=>{const e=$e(f);const t=t=>e.get().each(t);return{...e,on:t}};const Ke=(e,t)=>{const o=Ge();e.undoManager.add();const n=k.trim(e.selection.getContent({format:"text"}));const s=o=>{o.setEnabled("next",Ue(e,t));o.setEnabled("prev",qe(e,t))};const r=e=>{const o=e.getData();const n=t.get();t.set({...n,matchCase:o.matchcase,wholeWord:o.wholewords,inSelection:o.inselection})};const a=(e,t)=>{const o=["replace","replaceall","prev","next"];const n=o=>e.setEnabled(o,!t);C(o,n)};const c=(e,t)=>{t.redial(g(e,t.getData()))};const i=(e,t)=>{if(v.browser.isSafari()&&v.deviceType.isTouch()&&(t==="find"||t==="replace"||t==="replaceall")){e.focus(t)}};const l=o=>{Ze(e,t,false);a(o,true);s(o)};const d=o=>{const n=o.getData();const r=t.get();if(!n.findtext.length){l(o);return}if(r.text===n.findtext&&r.matchCase===n.matchcase&&r.wholeWord===n.wholewords){Pe(e,t)}else{const s=Ie(e,t,n.findtext,n.matchcase,n.wholewords,n.inselection);if(s<=0){c(true,o)}a(o,s===0)}s(o)};const u=t.get();const f={findtext:n,replacetext:"",wholewords:u.wholeWord,matchcase:u.matchCase,inselection:u.inSelection};const m=e=>{const t=[{type:"label",label:"Find",for:"findtext",items:[{type:"bar",items:[{type:"input",name:"findtext",maximized:true,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",enabled:false,borderless:true},{type:"button",name:"next",text:"Next",icon:"action-next",enabled:false,borderless:true}]}]},{type:"input",name:"replacetext",label:"Replace with",inputMode:"search"}];if(e){t.push({type:"alertbanner",level:"error",text:"Could not find the specified string.",icon:"warning"})}return t};const g=(o,n)=>({title:"Find and Replace",size:"normal",body:{type:"panel",items:m(o)},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:true},{type:"custom",name:"replace",text:"Replace",enabled:false},{type:"custom",name:"replaceall",text:"Replace all",enabled:false}],initialData:n,onChange:(e,n)=>{if(o){c(false,e)}if(n.name==="findtext"&&t.get().count>0){l(e)}},onAction:(o,n)=>{const a=o.getData();switch(n.name){case"find":d(o);break;case"replace":if(!je(e,t,a.replacetext)){l(o)}else{s(o)}break;case"replaceall":je(e,t,a.replacetext,true,true);l(o);break;case"prev":Fe(e,t);s(o);break;case"next":Pe(e,t);s(o);break;case"matchcase":case"wholewords":case"inselection":c(false,o);r(o);l(o);break}i(o,n.name)},onSubmit:e=>{d(e);i(e,"find")},onClose:()=>{e.focus();Ze(e,t);e.undoManager.add()}});o.set(e.windowManager.open(g(false,f),{inline:"toolbar"}))};const Ye=(e,t)=>{e.addCommand("SearchReplace",(()=>{Ke(e,t)}))};const Xe=(e,t)=>()=>{Ke(e,t)};const Je=(e,t)=>{e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:Xe(e,t),icon:"search"});e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:Xe(e,t),icon:"search",shortcut:"Meta+F"});e.shortcuts.add("Meta+F","",Xe(e,t))};var Qe=()=>{t.add("searchreplace",(t=>{const o=e({index:-1,count:0,text:"",matchCase:false,wholeWord:false,inSelection:false});Ye(t,o);Je(t,o);return We(t,o)}))};Qe()})()},(e,t,o)=>{o(28)},()=>{(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=(e,t,o)=>{var n;if(o(e,t.prototype)){return true}else{return((n=e.constructor)===null||n===void 0?void 0:n.name)===t.name}};const o=e=>{const o=typeof e;if(e===null){return"null"}else if(o==="object"&&Array.isArray(e)){return"array"}else if(o==="object"&&t(e,String,((e,t)=>t.isPrototypeOf(e)))){return"string"}else{return o}};const n=e=>t=>o(t)===e;const s=e=>t=>typeof t===e;const r=e=>t=>e===t;const a=n("string");const c=n("array");const i=s("boolean");const l=r(undefined);const d=e=>e===null||e===undefined;const u=e=>!d(e);const f=s("function");const m=s("number");const g=()=>{};const p=(e,t)=>o=>e(t(o));const h=e=>()=>e;const y=e=>e;const b=(e,t)=>e===t;function v(e,...t){return(...o)=>{const n=t.concat(o);return e.apply(null,n)}}const k=e=>{e()};const w=h(false);const _=h(true);class x{constructor(e,t){this.tag=e;this.value=t}static some(e){return new x(true,e)}static none(){return x.singletonNone}fold(e,t){if(this.tag){return t(this.value)}else{return e()}}isSome(){return this.tag}isNone(){return!this.tag}map(e){if(this.tag){return x.some(e(this.value))}else{return x.none()}}bind(e){if(this.tag){return e(this.value)}else{return x.none()}}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){if(!this.tag||e(this.value)){return this}else{return x.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){throw new Error(e!==null&&e!==void 0?e:"Called getOrDie on None")}else{return this.value}}static from(e){return u(e)?x.some(e):x.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){if(this.tag){e(this.value)}}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}x.singletonNone=new x(false);const C=Object.keys;const S=Object.hasOwnProperty;const z=(e,t)=>{const o=C(e);for(let n=0,s=o.length;n<s;n++){const s=o[n];const r=e[s];t(r,s)}};const T=e=>(t,o)=>{e[o]=t};const E=(e,t,o,n)=>{z(e,((e,s)=>{(t(e,s)?o:n)(e,s)}))};const O=(e,t)=>{const o={};E(e,t,T(o),g);return o};const A=(e,t)=>{const o=[];z(e,((e,n)=>{o.push(t(e,n))}));return o};const D=e=>A(e,y);const N=e=>C(e).length;const M=(e,t)=>R(e,t)?x.from(e[t]):x.none();const R=(e,t)=>S.call(e,t);const B=(e,t)=>R(e,t)&&e[t]!==undefined&&e[t]!==null;const L=e=>{for(const t in e){if(S.call(e,t)){return false}}return true};const H=Array.prototype.indexOf;const I=Array.prototype.push;const P=(e,t)=>H.call(e,t);const F=(e,t)=>P(e,t)>-1;const V=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];if(t(n,o)){return true}}return false};const j=(e,t)=>{const o=[];for(let n=0;n<e;n++){o.push(t(n))}return o};const Z=(e,t)=>{const o=e.length;const n=new Array(o);for(let s=0;s<o;s++){const o=e[s];n[s]=t(o,s)}return n};const U=(e,t)=>{for(let o=0,n=e.length;o<n;o++){const n=e[o];t(n,o)}};const q=(e,t)=>{for(let o=e.length-1;o>=0;o--){const n=e[o];t(n,o)}};const W=(e,t)=>{const o=[];const n=[];for(let s=0,r=e.length;s<r;s++){const r=e[s];const a=t(r,s)?o:n;a.push(r)}return{pass:o,fail:n}};const $=(e,t)=>{const o=[];for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){o.push(s)}}return o};const G=(e,t,o)=>{q(e,((e,n)=>{o=t(o,e,n)}));return o};const K=(e,t,o)=>{U(e,((e,n)=>{o=t(o,e,n)}));return o};const Y=(e,t,o)=>{for(let n=0,s=e.length;n<s;n++){const s=e[n];if(t(s,n)){return x.some(s)}else if(o(s,n)){break}}return x.none()};const X=(e,t)=>Y(e,t,w);const J=e=>{const t=[];for(let o=0,n=e.length;o<n;++o){if(!c(e[o])){throw new Error("Arr.flatten item "+o+" was not an array, input: "+e)}I.apply(t,e[o])}return t};const Q=(e,t)=>J(Z(e,t));const ee=(e,t)=>{for(let o=0,n=e.length;o<n;++o){const n=e[o];if(t(n,o)!==true){return false}}return true};const te=(e,t)=>{const o={};for(let n=0,s=e.length;n<s;n++){const s=e[n];o[String(s)]=t(s,n)}return o};const oe=(e,t)=>t>=0&&t<e.length?x.some(e[t]):x.none();const ne=e=>oe(e,0);const se=e=>oe(e,e.length-1);const re=(e,t)=>{for(let o=0;o<e.length;o++){const n=t(e[o],o);if(n.isSome()){return n}}return x.none()};const ae=8;const ce=9;const ie=11;const le=1;const de=3;const ue=(e,t)=>{const o=t||document;const n=o.createElement("div");n.innerHTML=e;if(!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";console.error(t,e);throw new Error(t)}return ge(n.childNodes[0])};const fe=(e,t)=>{const o=t||document;const n=o.createElement(e);return ge(n)};const me=(e,t)=>{const o=t||document;const n=o.createTextNode(e);return ge(n)};const ge=e=>{if(e===null||e===undefined){throw new Error("Node cannot be null or undefined")}return{dom:e}};const pe=(e,t,o)=>x.from(e.dom.elementFromPoint(t,o)).map(ge);const he={fromHtml:ue,fromTag:fe,fromText:me,fromDom:ge,fromPoint:pe};const ye=(e,t)=>{const o=e.dom;if(o.nodeType!==le){return false}else{const e=o;if(e.matches!==undefined){return e.matches(t)}else if(e.msMatchesSelector!==undefined){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector!==undefined){return e.webkitMatchesSelector(t)}else if(e.mozMatchesSelector!==undefined){return e.mozMatchesSelector(t)}else{throw new Error("Browser lacks native selectors")}}};const be=e=>e.nodeType!==le&&e.nodeType!==ce&&e.nodeType!==ie||e.childElementCount===0;const ve=(e,t)=>{const o=t===undefined?document:t.dom;return be(o)?[]:Z(o.querySelectorAll(e),he.fromDom)};const ke=(e,t)=>{const o=t===undefined?document:t.dom;return be(o)?x.none():x.from(o.querySelector(e)).map(he.fromDom)};const we=(e,t)=>e.dom===t.dom;const _e=ye;typeof window!=="undefined"?window:Function("return this;")();const xe=e=>{const t=e.dom.nodeName;return t.toLowerCase()};const Ce=e=>e.dom.nodeType;const Se=e=>t=>Ce(t)===e;const ze=e=>Ce(e)===ae||xe(e)==="#comment";const Te=Se(le);const Ee=Se(de);const Oe=Se(ce);const Ae=Se(ie);const De=e=>t=>Te(t)&&xe(t)===e;const Ne=e=>he.fromDom(e.dom.ownerDocument);const Me=e=>Oe(e)?e:Ne(e);const Re=e=>x.from(e.dom.parentNode).map(he.fromDom);const Be=(e,t)=>{const o=f(t)?t:w;let n=e.dom;const s=[];while(n.parentNode!==null&&n.parentNode!==undefined){const e=n.parentNode;const t=he.fromDom(e);s.push(t);if(o(t)===true){break}else{n=e}}return s};const Le=e=>x.from(e.dom.previousSibling).map(he.fromDom);const He=e=>x.from(e.dom.nextSibling).map(he.fromDom);const Ie=e=>Z(e.dom.childNodes,he.fromDom);const Pe=(e,t)=>{const o=e.dom.childNodes;return x.from(o[t]).map(he.fromDom)};const Fe=e=>Pe(e,0);const Ve=e=>Ae(e)&&u(e.dom.host);const je=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode);const Ze=je?e=>he.fromDom(e.dom.getRootNode()):Me;const Ue=e=>{const t=Ze(e);return Ve(t)?x.some(t):x.none()};const qe=e=>he.fromDom(e.dom.host);const We=e=>{const t=Ee(e)?e.dom.parentNode:e.dom;if(t===undefined||t===null||t.ownerDocument===null){return false}const o=t.ownerDocument;return Ue(he.fromDom(t)).fold((()=>o.body.contains(t)),p(We,qe))};var $e=(e,t,o,n,s)=>{if(e(o,n)){return x.some(o)}else if(f(s)&&s(o)){return x.none()}else{return t(o,n,s)}};const Ge=(e,t,o)=>{let n=e.dom;const s=f(o)?o:w;while(n.parentNode){n=n.parentNode;const e=he.fromDom(n);if(t(e)){return x.some(e)}else if(s(e)){break}}return x.none()};const Ke=(e,t,o)=>{const n=(e,t)=>t(e);return $e(n,Ge,e,t,o)};const Ye=(e,t)=>{const o=e=>t(he.fromDom(e));const n=X(e.dom.childNodes,o);return n.map(he.fromDom)};const Xe=(e,t,o)=>Ge(e,(e=>ye(e,t)),o);const Je=(e,t)=>Ye(e,(e=>ye(e,t)));const Qe=(e,t)=>ke(t,e);const et=(e,t,o)=>{const n=(e,t)=>ye(e,t);return $e(n,Xe,e,t,o)};const tt=e=>et(e,"[contenteditable]");const ot=(e,t=false)=>{if(We(e)){return e.dom.isContentEditable}else{return tt(e).fold(h(t),(e=>nt(e)==="true"))}};const nt=e=>e.dom.contentEditable;const st=e=>e.nodeName.toLowerCase();const rt=e=>he.fromDom(e.getBody());const at=e=>t=>we(t,rt(e));const ct=e=>e?e.replace(/px$/,""):"";const it=e=>/^\d+(\.\d+)?$/.test(e)?e+"px":e;const lt=e=>he.fromDom(e.selection.getStart());const dt=e=>he.fromDom(e.selection.getEnd());const ut=e=>Ke(e,De("table")).forall(ot);const ft=(e,t)=>$(Ie(e),t);const mt=(e,t)=>{let o=[];U(Ie(e),(e=>{if(t(e)){o=o.concat([e])}o=o.concat(mt(e,t))}));return o};const gt=(e,t)=>ft(e,(e=>ye(e,t)));const pt=(e,t)=>ve(t,e);const ht=(e,t,o)=>{if(a(o)||i(o)||m(o)){e.setAttribute(t,o+"")}else{console.error("Invalid call to Attribute.set. Key ",t,":: Value ",o,":: Element ",e);throw new Error("Attribute value was not simple")}};const yt=(e,t,o)=>{ht(e.dom,t,o)};const bt=(e,t)=>{const o=e.dom;z(t,((e,t)=>{ht(o,t,e)}))};const vt=(e,t)=>{const o=e.dom.getAttribute(t);return o===null?undefined:o};const kt=(e,t)=>x.from(vt(e,t));const wt=(e,t)=>{e.dom.removeAttribute(t)};const _t=e=>K(e.dom.attributes,((e,t)=>{e[t.name]=t.value;return e}),{});const xt=(e,t,o=b)=>e.exists((e=>o(e,t)));const Ct=e=>{const t=[];const o=e=>{t.push(e)};for(let t=0;t<e.length;t++){e[t].each(o)}return t};const St=(e,t,o)=>e.isSome()&&t.isSome()?x.some(o(e.getOrDie(),t.getOrDie())):x.none();const zt=e=>e.bind(y);const Tt=(e,t)=>e?x.some(t):x.none();const Et=(e,t)=>e.substring(t);const Ot=(e,t,o)=>t===""||e.length>=t.length&&e.substr(o,o+t.length)===t;const At=(e,t)=>Dt(e,t)?Et(e,t.length):e;const Dt=(e,t)=>Ot(e,t,0);const Nt=e=>t=>t.replace(e,"");const Mt=Nt(/^\s+|\s+$/g);const Rt=e=>e.length>0;const Bt=e=>!Rt(e);const Lt=(e,t=10)=>{const o=parseInt(e,t);return isNaN(o)?x.none():x.some(o)};const Ht=e=>{const t=parseFloat(e);return isNaN(t)?x.none():x.some(t)};const It=e=>e.style!==undefined&&f(e.style.getPropertyValue);const Pt=(e,t,o)=>{if(!a(o)){console.error("Invalid call to CSS.set. Property ",t,":: Value ",o,":: Element ",e);throw new Error("CSS value must be a string: "+o)}if(It(e)){e.style.setProperty(t,o)}};const Ft=(e,t)=>{if(It(e)){e.style.removeProperty(t)}};const Vt=(e,t,o)=>{const n=e.dom;Pt(n,t,o)};const jt=(e,t)=>{const o=e.dom;const n=window.getComputedStyle(o);const s=n.getPropertyValue(t);return s===""&&!We(e)?Zt(o,t):s};const Zt=(e,t)=>It(e)?e.style.getPropertyValue(t):"";const Ut=(e,t)=>{const o=e.dom;const n=Zt(o,t);return x.from(n).filter((e=>e.length>0))};const qt=(e,t)=>{const o=e.dom;Ft(o,t);if(xt(kt(e,"style").map(Mt),"")){wt(e,"style")}};const Wt=(e,t,o=0)=>kt(e,t).map((e=>parseInt(e,10))).getOr(o);const $t=(e,t)=>Gt(e,t,_);const Gt=(e,t,o)=>Q(Ie(e),(e=>{if(ye(e,t)){return o(e)?[e]:[]}else{return Gt(e,t,o)}}));const Kt=["tfoot","thead","tbody","colgroup"];const Yt=e=>F(Kt,e);const Xt=(e,t)=>({rows:e,columns:t});const Jt=(e,t,o)=>({element:e,rowspan:t,colspan:o});const Qt=(e,t,o,n,s,r)=>({element:e,rowspan:t,colspan:o,row:n,column:s,isLocked:r});const eo=(e,t,o)=>({element:e,cells:t,section:o});const to=(e,t,o,n)=>({startRow:e,startCol:t,finishRow:o,finishCol:n});const oo=(e,t,o)=>({element:e,colspan:t,column:o});const no=(e,t)=>({element:e,columns:t});const so=(e,t,o=w)=>{if(o(t)){return x.none()}if(F(e,xe(t))){return x.some(t)}const n=e=>ye(e,"table")||o(e);return Xe(t,e.join(","),n)};const ro=(e,t)=>so(["td","th"],e,t);const ao=e=>$t(e,"th,td");const co=e=>{if(ye(e,"colgroup")){return gt(e,"col")}else{return Q(uo(e),(e=>gt(e,"col")))}};const io=(e,t)=>et(e,"table",t);const lo=e=>$t(e,"tr");const uo=e=>io(e).fold(h([]),(e=>gt(e,"colgroup")));const fo=(e,t)=>Z(e,(e=>{if(xe(e)==="colgroup"){const t=Z(co(e),(e=>{const t=Wt(e,"span",1);return Jt(e,1,t)}));return eo(e,t,"colgroup")}else{const o=Z(ao(e),(e=>{const t=Wt(e,"rowspan",1);const o=Wt(e,"colspan",1);return Jt(e,t,o)}));return eo(e,o,t(e))}}));const mo=e=>Re(e).map((e=>{const t=xe(e);return Yt(t)?t:"tbody"})).getOr("tbody");const go=e=>{const t=lo(e);const o=uo(e);const n=[...o,...t];return fo(n,mo)};const po="data-snooker-locked-cols";const ho=e=>kt(e,po).bind((e=>x.from(e.match(/\d+/g)))).map((e=>te(e,_)));const yo=(e,t)=>e+","+t;const bo=(e,t,o)=>x.from(e.access[yo(t,o)]);const vo=(e,t,o)=>{const n=ko(e,(e=>o(t,e.element)));return n.length>0?x.some(n[0]):x.none()};const ko=(e,t)=>{const o=Q(e.all,(e=>e.cells));return $(o,t)};const wo=e=>{const t={};let o=0;U(e.cells,(e=>{const n=e.colspan;j(n,(s=>{const r=o+s;t[r]=oo(e.element,n,r)}));o+=n}));return t};const _o=e=>{const t={};const o=[];const n=ne(e).map((e=>e.element)).bind(io);const s=n.bind(ho).getOr({});let r=0;let a=0;let c=0;const{pass:i,fail:l}=W(e,(e=>e.section==="colgroup"));U(l,(e=>{const n=[];U(e.cells,(e=>{let o=0;while(t[yo(c,o)]!==undefined){o++}const r=B(s,o.toString());const i=Qt(e.element,e.rowspan,e.colspan,c,o,r);for(let n=0;n<e.colspan;n++){for(let s=0;s<e.rowspan;s++){const e=c+s;const r=o+n;const l=yo(e,r);t[l]=i;a=Math.max(a,r+1)}}n.push(i)}));r++;o.push(eo(e.element,n,e.section));c++}));const{columns:d,colgroups:u}=se(i).map((e=>{const t=wo(e);const o=no(e.element,D(t));return{colgroups:[o],columns:t}})).getOrThunk((()=>({colgroups:[],columns:{}})));const f=Xt(r,a);return{grid:f,access:t,all:o,columns:d,colgroups:u}};const xo=e=>{const t=go(e);return _o(t)};const Co=e=>Q(e.all,(e=>e.cells));const So=e=>D(e.columns);const zo=e=>C(e.columns).length>0;const To=(e,t)=>x.from(e.columns[t]);const Eo={fromTable:xo,generate:_o,getAt:bo,findItem:vo,filterItems:ko,justCells:Co,justColumns:So,hasColumns:zo,getColumnAt:To};var Oo=tinymce.util.Tools.resolve("tinymce.util.Tools");const Ao=(e,t,o)=>{const n=e.select("td,th",t);let s;for(let t=0;t<n.length;t++){const r=e.getStyle(n[t],o);if(l(s)){s=r}if(s!==r){return""}}return s};const Do=(e,t,o)=>{Oo.each("left center right".split(" "),(n=>{if(n!==o){e.formatter.remove("align"+n,{},t)}}));if(o){e.formatter.apply("align"+o,{},t)}};const No=(e,t,o)=>{Oo.each("top middle bottom".split(" "),(n=>{if(n!==o){e.formatter.remove("valign"+n,{},t)}}));if(o){e.formatter.apply("valign"+o,{},t)}};const Mo=(e,t,o)=>{e.dispatch("TableModified",{...o,table:t})};const Ro=(e,t)=>Ht(e).getOr(t);const Bo=(e,t,o)=>Ro(jt(e,t),o);const Lo=(e,t,o,n)=>{const s=Bo(e,`padding-${o}`,0);const r=Bo(e,`padding-${n}`,0);const a=Bo(e,`border-${o}-width`,0);const c=Bo(e,`border-${n}-width`,0);return t-s-r-a-c};const Ho=(e,t)=>{const o=e.dom;const n=o.getBoundingClientRect().width||o.offsetWidth;return t==="border-box"?n:Lo(e,n,"left","right")};const Io=e=>Ho(e,"content-box");const Po=Io;var Fo=tinymce.util.Tools.resolve("tinymce.Env");const Vo="tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol";const jo=j(5,(e=>{const t=`${e+1}px`;return{title:t,value:t}}));const Zo=Z(["Solid","Dotted","Dashed","Double","Groove","Ridge","Inset","Outset","None","Hidden"],(e=>({title:e,value:e.toLowerCase()})));const Uo="100%";const qo=e=>{var t;const o=e.dom;const n=(t=o.getParent(e.selection.getStart(),o.isBlock))!==null&&t!==void 0?t:e.getBody();return Po(he.fromDom(n))+"px"};const Wo=(e,t)=>{if(mn(e)||!sn(e)){return t}else if(fn(e)){return{...t,width:qo(e)}}else{return{...t,width:Uo}}};const $o=(e,t)=>{if(mn(e)||sn(e)){return t}else if(fn(e)){return{...t,width:qo(e)}}else{return{...t,width:Uo}}};const Go=e=>t=>t.options.get(e);const Ko=e=>{const t=e.options.register;t("table_border_widths",{processor:"object[]",default:jo});t("table_border_styles",{processor:"object[]",default:Zo});t("table_cell_advtab",{processor:"boolean",default:true});t("table_row_advtab",{processor:"boolean",default:true});t("table_advtab",{processor:"boolean",default:true});t("table_appearance_options",{processor:"boolean",default:true});t("table_grid",{processor:"boolean",default:!Fo.deviceType.isTouch()});t("table_cell_class_list",{processor:"object[]",default:[]});t("table_row_class_list",{processor:"object[]",default:[]});t("table_class_list",{processor:"object[]",default:[]});t("table_toolbar",{processor:"string",default:Vo});t("table_background_color_map",{processor:"object[]",default:[]});t("table_border_color_map",{processor:"object[]",default:[]})};const Yo=Go("table_sizing_mode");const Xo=Go("table_border_widths");const Jo=Go("table_border_styles");const Qo=Go("table_cell_advtab");const en=Go("table_row_advtab");const tn=Go("table_advtab");const on=Go("table_appearance_options");const nn=Go("table_grid");const sn=Go("table_style_by_css");const rn=Go("table_cell_class_list");const an=Go("table_row_class_list");const cn=Go("table_class_list");const ln=Go("table_toolbar");const dn=Go("table_background_color_map");const un=Go("table_border_color_map");const fn=e=>Yo(e)==="fixed";const mn=e=>Yo(e)==="responsive";const gn=e=>{const t=e.options;const o=t.get("table_default_styles");return t.isSet("table_default_styles")?o:Wo(e,o)};const pn=e=>{const t=e.options;const o=t.get("table_default_attributes");return t.isSet("table_default_attributes")?o:$o(e,o)};const hn=(e,t)=>t.column>=e.startCol&&t.column+t.colspan-1<=e.finishCol&&t.row>=e.startRow&&t.row+t.rowspan-1<=e.finishRow;const yn=(e,t)=>{let o=true;const n=v(hn,t);for(let s=t.startRow;s<=t.finishRow;s++){for(let r=t.startCol;r<=t.finishCol;r++){o=o&&Eo.getAt(e,s,r).exists(n)}}return o?x.some(t):x.none()};const bn=(e,t)=>to(Math.min(e.row,t.row),Math.min(e.column,t.column),Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),Math.max(e.column+e.colspan-1,t.column+t.colspan-1));const vn=(e,t,o)=>{const n=Eo.findItem(e,t,we);const s=Eo.findItem(e,o,we);return n.bind((e=>s.map((t=>bn(e,t)))))};const kn=(e,t,o)=>vn(e,t,o).bind((t=>yn(e,t)));const wn=(e,t,o)=>{const n=_n(e);return kn(n,t,o)};const _n=Eo.fromTable;const xn=(e,t)=>{const o=Re(e);o.each((o=>{o.dom.insertBefore(t.dom,e.dom)}))};const Cn=(e,t)=>{const o=He(e);o.fold((()=>{const o=Re(e);o.each((e=>{zn(e,t)}))}),(e=>{xn(e,t)}))};const Sn=(e,t)=>{const o=Fe(e);o.fold((()=>{zn(e,t)}),(o=>{e.dom.insertBefore(t.dom,o.dom)}))};const zn=(e,t)=>{e.dom.appendChild(t.dom)};const Tn=(e,t)=>{xn(e,t);zn(t,e)};const En=(e,t)=>{U(t,((o,n)=>{const s=n===0?e:t[n-1];Cn(s,o)}))};const On=(e,t)=>{U(t,(t=>{zn(e,t)}))};const An=e=>{const t=e.dom;if(t.parentNode!==null){t.parentNode.removeChild(t)}};const Dn=e=>{const t=Ie(e);if(t.length>0){En(e,t)}An(e)};const Nn=(e,t)=>{const o=o=>{if(!e(o)){throw new Error("Can only get "+t+" value of a "+t+" node")}return n(o).getOr("")};const n=t=>e(t)?x.from(t.dom.nodeValue):x.none();const s=(o,n)=>{if(!e(o)){throw new Error("Can only set raw "+t+" value of a "+t+" node")}o.dom.nodeValue=n};return{get:o,getOption:n,set:s}};const Mn=Nn(Ee,"text");const Rn=e=>Mn.get(e);const Bn=(e,t)=>Mn.set(e,t);var Ln=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];var Hn=()=>{const e=e=>he.fromDom(e.dom.cloneNode(false));const t=e=>Me(e).dom;const o=e=>{if(!Te(e)){return false}if(xe(e)==="body"){return true}return F(Ln,xe(e))};const n=e=>{if(!Te(e)){return false}return F(["br","img","hr","input"],xe(e))};const s=e=>Te(e)&&vt(e,"contenteditable")==="false";const r=(e,t)=>e.dom.compareDocumentPosition(t.dom);const a=(e,t)=>{const o=_t(e);bt(t,o)};const c=e=>{const t=xe(e);return F(["script","noscript","iframe","noframes","noembed","title","style","textarea","xmp"],t)};const i=e=>Te(e)?kt(e,"lang"):x.none();return{up:h({selector:Xe,closest:et,predicate:Ge,all:Be}),down:h({selector:pt,predicate:mt}),styles:h({get:jt,getRaw:Ut,set:Vt,remove:qt}),attrs:h({get:vt,set:yt,remove:wt,copyTo:a}),insert:h({before:xn,after:Cn,afterAll:En,append:zn,appendAll:On,prepend:Sn,wrap:Tn}),remove:h({unwrap:Dn,remove:An}),create:h({nu:he.fromTag,clone:e,text:he.fromText}),query:h({comparePosition:r,prevSibling:Le,nextSibling:He}),property:h({children:Ie,name:xe,parent:Re,document:t,isText:Ee,isComment:ze,isElement:Te,isSpecial:c,getLanguage:i,getText:Rn,setText:Bn,isBoundary:o,isEmptyTag:n,isNonEditable:s}),eq:we,is:_e}};const In=(e,t,o,n)=>{const s=o[0];const r=o.slice(1);return n(e,t,s,r)};const Pn=(e,t,o)=>o.length>0?In(e,t,o,Fn):x.none();const Fn=(e,t,o,n)=>{const s=t(e,o);return G(n,((o,n)=>{const s=t(e,n);return Vn(e,o,s)}),s)};const Vn=(e,t,o)=>t.bind((t=>o.filter(v(e.eq,t))));const jn=Pn;const Zn=Hn();const Un=(e,t)=>jn(Zn,((t,o)=>e(o)),t);const qn=e=>Xe(e,"table");const Wn=(e,t)=>{const o=pt(e,t);return o.length>0?x.some(o):x.none()};const $n=(e,t,o)=>Qe(e,t).bind((t=>Qe(e,o).bind((e=>Un(qn,[t,e]).map((o=>({first:t,last:e,table:o})))))));const Gn=(e,t)=>Wn(e,t);const Kn=(e,t,o)=>$n(e,t,o).bind((t=>{const o=t=>we(e,t);const n="thead,tfoot,tbody,table";const s=Xe(t.first,n,o);const r=Xe(t.last,n,o);return s.bind((e=>r.bind((o=>we(e,o)?wn(t.table,t.first,t.last):x.none()))))}));const Yn=e=>Z(e,he.fromDom);const Xn="data-mce-selected";const Jn="td["+Xn+"],th["+Xn+"]";const Qn="data-mce-first-selected";const es="td["+Qn+"],th["+Qn+"]";const ts="data-mce-last-selected";const os="td["+ts+"],th["+ts+"]";const ns={selected:Xn,selectedSelector:Jn,firstSelected:Qn,firstSelectedSelector:es,lastSelected:ts,lastSelectedSelector:os};const ss=e=>io(e).bind((e=>Gn(e,ns.firstSelectedSelector))).fold(h(e),(e=>e[0]));const rs=e=>(t,o)=>{const n=xe(t);const s=n==="col"||n==="colgroup"?ss(t):t;return et(s,e,o)};const as=rs("th,td,caption");const cs=rs("th,td");const is=e=>Yn(e.model.table.getSelectedCells());const ls=(e,t)=>{const o=cs(e);const n=o.bind((e=>io(e))).map((e=>lo(e)));return St(o,n,((e,o)=>$(o,(o=>V(Yn(o.dom.cells),(o=>vt(o,t)==="1"||we(o,e))))))).getOr([])};const ds=[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}];const us=e=>({value:ps(e)});const fs=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;const ms=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;const gs=e=>fs.test(e)||ms.test(e);const ps=e=>At(e,"#").toUpperCase();const hs=e=>gs(e)?x.some({value:ps(e)}):x.none();const ys=e=>{const t=e.toString(16);return(t.length===1?"0"+t:t).toUpperCase()};const bs=e=>{const t=ys(e.red)+ys(e.green)+ys(e.blue);return us(t)};const vs=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i;const ks=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i;const ws=(e,t,o,n)=>({red:e,green:t,blue:o,alpha:n});const _s=(e,t,o,n)=>{const s=parseInt(e,10);const r=parseInt(t,10);const a=parseInt(o,10);const c=parseFloat(n);return ws(s,r,a,c)};const xs=e=>{const t=vs.exec(e);if(t!==null){return x.some(_s(t[1],t[2],t[3],"1"))}const o=ks.exec(e);if(o!==null){return x.some(_s(o[1],o[2],o[3],o[4]))}return x.none()};const Cs=e=>hs(e).orThunk((()=>xs(e).map(bs))).getOrThunk((()=>{const t=document.createElement("canvas");t.height=1;t.width=1;const o=t.getContext("2d");o.clearRect(0,0,t.width,t.height);o.fillStyle="#FFFFFF";o.fillStyle=e;o.fillRect(0,0,1,1);const n=o.getImageData(0,0,1,1).data;const s=n[0];const r=n[1];const a=n[2];const c=n[3];return bs(ws(s,r,a,c))}));const Ss=e=>xs(e).map(bs).map((e=>"#"+e.value)).getOr(e);const zs=e=>{let t=e;const o=()=>t;const n=e=>{t=e};return{get:o,set:n}};const Ts=e=>{const t=zs(x.none());const o=()=>t.get().each(e);const n=()=>{o();t.set(x.none())};const s=()=>t.get().isSome();const r=()=>t.get();const a=e=>{o();t.set(x.some(e))};return{clear:n,isSet:s,get:r,set:a}};const Es=()=>Ts((e=>e.unbind()));const Os=(e,t,o)=>n=>{const s=Es();const r=Bt(o);const a=()=>{const a=is(e);const c=n=>e.formatter.match(t,{value:o},n.dom,r);if(r){n.setActive(!V(a,c));s.set(e.formatter.formatChanged(t,(e=>n.setActive(!e)),true))}else{n.setActive(ee(a,c));s.set(e.formatter.formatChanged(t,n.setActive,false,{value:o}))}};e.initialized?a():e.on("init",a);return s.clear};const As=e=>B(e,"menu");const Ds=e=>Z(e,(e=>{const t=e.text||e.title||"";if(As(e)){return{text:t,items:Ds(e.menu)}}else{return{text:t,value:e.value}}}));const Ns=e=>{if(!e.length){return x.none()}return x.some(Ds([{text:"Select...",value:"mce-no-match"},...e]))};const Ms=(e,t,o,n)=>Z(t,(t=>{const s=t.text||t.title;if(As(t)){return{type:"nestedmenuitem",text:s,getSubmenuItems:()=>Ms(e,t.menu,o,n)}}else{return{text:s,type:"togglemenuitem",onAction:()=>n(t.value),onSetup:Os(e,o,t.value)}}}));const Rs=(e,t)=>o=>{e.execCommand("mceTableApplyCellStyle",false,{[t]:o})};const Bs=e=>Q(e,(e=>{if(As(e)){return[{...e,menu:Bs(e.menu)}]}else{return Rt(e.value)?[e]:[]}}));const Ls=(e,t,o,n)=>s=>s(Ms(e,t,o,n));const Hs=(e,t,o)=>{const n=Z(t,(e=>({text:e.title,value:"#"+Cs(e.value).value,type:"choiceitem"})));return[{type:"fancymenuitem",fancytype:"colorswatch",initData:{colors:n.length>0?n:undefined,allowCustomColors:false},onAction:t=>{const n=t.value==="remove"?"":t.value;e.execCommand("mceTableApplyCellStyle",false,{[o]:n})}}]};const Is=e=>()=>{const t=e.queryCommandValue("mceTableRowType");const o=t==="header"?"body":"header";e.execCommand("mceTableRowType",false,{type:o})};const Ps=e=>()=>{const t=e.queryCommandValue("mceTableColType");const o=t==="th"?"td":"th";e.execCommand("mceTableColType",false,{type:o})};const Fs=e=>Ns(rn(e)).map((e=>({name:"class",type:"listbox",label:"Class",items:e})));const Vs=[{name:"width",type:"input",label:"Width"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"Horizontal align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"Vertical align",items:ds}];const js=e=>Vs.concat(Fs(e).toArray());const Zs=(e,t)=>{const o=[{text:"Select...",value:""}];const n=[{name:"borderstyle",type:"listbox",label:"Border style",items:o.concat(Ds(Jo(e)))},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];const s={name:"borderwidth",type:"input",label:"Border width"};const r=t==="cell"?[s].concat(n):n;return{title:"Advanced",name:"advanced",items:r}};const Us=(e,t)=>{const o=e.dom;const n=(e,n)=>{o.setAttrib(t,e,n)};const s=(e,n)=>{o.setStyle(t,e,n)};const r=(o,n)=>{if(n===""){e.formatter.remove(o,{value:null},t,true)}else{e.formatter.apply(o,{value:n},t)}};return{setAttrib:n,setStyle:s,setFormat:r}};const qs={normal:Us};const Ws=De("th");const $s=(e,t)=>{if(e&&t){return"sectionCells"}else if(e){return"section"}else{return"cells"}};const Gs=e=>{const t=e.section==="thead";const o=xt(Ks(e.cells),"th");if(e.section==="tfoot"){return{type:"footer"}}else if(t||o){return{type:"header",subType:$s(t,o)}}else{return{type:"body"}}};const Ks=e=>{const t=$(e,(e=>Ws(e.element)));if(t.length===0){return x.some("td")}else if(t.length===e.length){return x.some("th")}else{return x.none()}};const Ys=e=>{const t=Z(e,(e=>Gs(e).type));const o=F(t,"header");const n=F(t,"footer");if(!o&&!n){return x.some("body")}else{const e=F(t,"body");if(o&&!e&&!n){return x.some("header")}else if(!o&&!e&&n){return x.some("footer")}else{return x.none()}}};const Xs=e=>{let t=false;let o;return(...n)=>{if(!t){t=true;o=e.apply(null,n)}return o}};const Js=(e,t)=>re(e.all,(e=>X(e.cells,(e=>we(t,e.element)))));const Qs=(e,t,o)=>{const n=Z(t.selection,(t=>ro(t).bind((t=>Js(e,t))).filter(o)));const s=Ct(n);return Tt(s.length>0,s)};const er=(e,t)=>t.mergable;const tr=(e,t)=>t.unmergable;const or=(e,t)=>Qs(e,t,_);const nr=(e,t)=>Js(e,t).exists((e=>!e.isLocked));const sr=(e,t)=>ee(t,(t=>nr(e,t)));const rr=(e,t)=>er(e,t).filter((t=>sr(e,t.cells)));const ar=(e,t)=>tr(e,t).filter((t=>sr(e,t)));const cr=e=>{if(!c(e)){throw new Error("cases must be an array")}if(e.length===0){throw new Error("there must be at least one case")}const t=[];const o={};U(e,((n,s)=>{const r=C(n);if(r.length!==1){throw new Error("one and only one name per case")}const a=r[0];const i=n[a];if(o[a]!==undefined){throw new Error("duplicate key detected:"+a)}else if(a==="cata"){throw new Error("cannot have a case named cata (sorry)")}else if(!c(i)){throw new Error("case arguments must be an array")}t.push(a);o[a]=(...o)=>{const n=o.length;if(n!==i.length){throw new Error("Wrong number of arguments to case "+a+". Expected "+i.length+" ("+i+"), got "+n)}const r=e=>{const n=C(e);if(t.length!==n.length){throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+n.join(","))}const s=ee(t,(e=>F(n,e)));if(!s){throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+t.join(", "))}return e[a].apply(null,o)};return{fold:(...t)=>{if(t.length!==e.length){throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length)}const n=t[s];return n.apply(null,o)},match:r,log:e=>{console.log(e,{constructors:t,constructor:a,params:o})}}}}));return o};const ir={generate:cr};const lr=ir.generate([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]);({...lr});const dr=(e,t)=>{const o=Eo.fromTable(e);const n=or(o,t);return n.bind((e=>{const t=e[e.length-1];const n=e[0].row;const s=t.row+t.rowspan;const r=o.all.slice(n,s);return Ys(r)})).getOr("")};const ur=dr;const fr=e=>Dt(e,"rgb")?Ss(e):e;const mr=e=>{const t=he.fromDom(e);return{borderwidth:Ut(t,"border-width").getOr(""),borderstyle:Ut(t,"border-style").getOr(""),bordercolor:Ut(t,"border-color").map(fr).getOr(""),backgroundcolor:Ut(t,"background-color").map(fr).getOr("")}};const gr=e=>{const t=e[0];const o=e.slice(1);U(o,(e=>{U(C(t),(o=>{z(e,((e,n)=>{const s=t[o];if(s!==""&&o===n){if(s!==e){t[o]=o==="class"?"mce-no-match":""}}}))}))}));return t};const pr=(e,t,o,n)=>X(e,(e=>!l(o.formatter.matchNode(n,t+e)))).getOr("");const hr=v(pr,["left","center","right"],"align");const yr=v(pr,["top","middle","bottom"],"valign");const br=(e,t)=>{const o=gn(e);const n=pn(e);const s=()=>({borderstyle:M(o,"border-style").getOr(""),bordercolor:fr(M(o,"border-color").getOr("")),backgroundcolor:fr(M(o,"background-color").getOr(""))});const r={height:"",width:"100%",cellspacing:"",cellpadding:"",caption:false,class:"",align:"",border:""};const a=()=>{const t=o["border-width"];if(sn(e)&&t){return{border:t}}return M(n,"border").fold((()=>({})),(e=>({border:e})))};const c=t?s():{};const i=()=>{const e=M(o,"border-spacing").or(M(n,"cellspacing")).fold((()=>({})),(e=>({cellspacing:e})));const t=M(o,"border-padding").or(M(n,"cellpadding")).fold((()=>({})),(e=>({cellpadding:e})));return{...e,...t}};const l={...r,...o,...n,...c,...a(),...i()};return l};const vr=e=>io(he.fromDom(e)).map((t=>{const o={selection:Yn(e.cells)};return ur(t,o)})).getOr("");const kr=(e,t,o)=>{const n=(t,o)=>{const n=Ut(he.fromDom(o),"border-width");if(sn(e)&&n.isSome()){return n.getOr("")}return t.getAttrib(o,"border")||Ao(e.dom,o,"border-width")||Ao(e.dom,o,"border")||""};const s=e.dom;const r=sn(e)?s.getStyle(t,"border-spacing")||s.getAttrib(t,"cellspacing"):s.getAttrib(t,"cellspacing")||s.getStyle(t,"border-spacing");const a=sn(e)?Ao(s,t,"padding")||s.getAttrib(t,"cellpadding"):s.getAttrib(t,"cellpadding")||Ao(s,t,"padding");return{width:s.getStyle(t,"width")||s.getAttrib(t,"width"),height:s.getStyle(t,"height")||s.getAttrib(t,"height"),cellspacing:r!==null&&r!==void 0?r:"",cellpadding:a!==null&&a!==void 0?a:"",border:n(s,t),caption:!!s.select("caption",t)[0],class:s.getAttrib(t,"class",""),align:hr(e,t),...o?mr(t):{}}};const wr=(e,t,o)=>{const n=e.dom;return{height:n.getStyle(t,"height")||n.getAttrib(t,"height"),class:n.getAttrib(t,"class",""),type:vr(t),align:hr(e,t),...o?mr(t):{}}};const _r=(e,t,o,n)=>{const s=e.dom;const r=n.getOr(t);const a=(e,t)=>s.getStyle(e,t)||s.getAttrib(e,t);return{width:a(r,"width"),scope:s.getAttrib(t,"scope"),celltype:st(t),class:s.getAttrib(t,"class",""),halign:hr(e,t),valign:yr(e,t),...o?mr(t):{}}};const xr=(e,t)=>{const o=Eo.fromTable(e);const n=Eo.justCells(o);const s=$(n,(e=>V(t,(t=>we(e.element,t)))));return Z(s,(e=>({element:e.element.dom,column:Eo.getColumnAt(o,e.column).map((e=>e.element.dom))})))};const Cr=(e,t,o,n)=>{if(n("scope")){e.setAttrib("scope",o.scope)}if(n("class")&&o.class!=="mce-no-match"){e.setAttrib("class",o.class)}if(n("width")){t.setStyle("width",it(o.width))}};const Sr=(e,t,o)=>{if(o("backgroundcolor")){e.setFormat("tablecellbackgroundcolor",t.backgroundcolor)}if(o("bordercolor")){e.setFormat("tablecellbordercolor",t.bordercolor)}if(o("borderstyle")){e.setFormat("tablecellborderstyle",t.borderstyle)}if(o("borderwidth")){e.setFormat("tablecellborderwidth",it(t.borderwidth))}};const zr=(e,t,o,n)=>{const s=t.length===1;U(t,(t=>{const r=t.element;const a=s?_:n;const c=qs.normal(e,r);const i=t.column.map((t=>qs.normal(e,t))).getOr(c);Cr(c,i,o,a);if(Qo(e)){Sr(c,o,a)}if(n("halign")){Do(e,r,o.halign)}if(n("valign")){No(e,r,o.valign)}}))};const Tr=(e,t)=>{e.execCommand("mceTableCellType",false,{type:t.celltype,no_events:true})};const Er=(e,t,o,n)=>{const s=O(n,((e,t)=>o[t]!==e));if(N(s)>0&&t.length>=1){io(t[0]).each((o=>{const r=xr(o,t);const a=N(O(s,((e,t)=>t!=="scope"&&t!=="celltype")))>0;const c=R(s,"celltype");if(a||R(s,"scope")){zr(e,r,n,v(R,s))}if(c){Tr(e,n)}Mo(e,o.dom,{structure:c,style:a})}))}};const Or=(e,t,o,n)=>{const s=n.getData();n.close();e.undoManager.transact((()=>{Er(e,t,o,s);e.focus()}))};const Ar=(e,t)=>{const o=io(t[0]).map((o=>Z(xr(o,t),(t=>_r(e,t.element,Qo(e),t.column)))));return gr(o.getOrDie())};const Dr=e=>{const t=is(e);if(t.length===0){return}const o=Ar(e,t);const n={type:"tabpanel",tabs:[{title:"General",name:"general",items:js(e)},Zs(e,"cell")]};const s={type:"panel",items:[{type:"grid",columns:2,items:js(e)}]};e.windowManager.open({title:"Cell Properties",size:"normal",body:Qo(e)?n:s,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:o,onSubmit:v(Or,e,t,o)})};const Nr=e=>Ns(an(e)).map((e=>({name:"class",type:"listbox",label:"Class",items:e})));const Mr=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}];const Rr=e=>Mr.concat(Nr(e).toArray());const Br=(e,t,o)=>{if(o("class")&&t.class!=="mce-no-match"){e.setAttrib("class",t.class)}if(o("height")){e.setStyle("height",it(t.height))}};const Lr=(e,t,o)=>{if(o("backgroundcolor")){e.setStyle("background-color",t.backgroundcolor)}if(o("bordercolor")){e.setStyle("border-color",t.bordercolor)}if(o("borderstyle")){e.setStyle("border-style",t.borderstyle)}};const Hr=(e,t,o,n)=>{const s=t.length===1;const r=s?_:n;U(t,(t=>{const s=gt(he.fromDom(t),"td,th");const a=qs.normal(e,t);Br(a,o,r);if(en(e)){Lr(a,o,r)}if(n("height")){U(s,(t=>{e.dom.setStyle(t.dom,"height",null)}))}if(n("align")){Do(e,t,o.align)}}))};const Ir=(e,t)=>{e.execCommand("mceTableRowType",false,{type:t.type,no_events:true})};const Pr=(e,t,o,n)=>{const s=O(n,((e,t)=>o[t]!==e));if(N(s)>0){const o=R(s,"type");const r=o?N(s)>1:true;if(r){Hr(e,t,n,v(R,s))}if(o){Ir(e,n)}io(he.fromDom(t[0])).each((t=>Mo(e,t.dom,{structure:o,style:r})))}};const Fr=(e,t,o,n)=>{const s=n.getData();n.close();e.undoManager.transact((()=>{Pr(e,t,o,s);e.focus()}))};const Vr=e=>{const t=ls(lt(e),ns.selected);if(t.length===0){return}const o=Z(t,(t=>wr(e,t.dom,en(e))));const n=gr(o);const s={type:"tabpanel",tabs:[{title:"General",name:"general",items:Rr(e)},Zs(e,"row")]};const r={type:"panel",items:[{type:"grid",columns:2,items:Rr(e)}]};e.windowManager.open({title:"Row Properties",size:"normal",body:en(e)?s:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:n,onSubmit:v(Fr,e,Z(t,(e=>e.dom)),n)})};const jr=(e,t,o)=>{const n=!o?[]:[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}];const s=[{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}];const r=on(e)?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[];const a=[{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}];const c=t.length>0?[{name:"class",type:"listbox",label:"Class",items:t}]:[];return n.concat(s).concat(r).concat(a).concat(c)};const Zr=(e,t,o,n)=>{if(t.tagName==="TD"||t.tagName==="TH"){if(a(o)&&u(n)){e.setStyle(t,o,n)}else{e.setStyles(t,o)}}else{if(t.children){for(let s=0;s<t.children.length;s++){Zr(e,t.children[s],o,n)}}}};const Ur=(e,t,o,n)=>{const s=e.dom;const r={};const a={};const c=sn(e);const i=tn(e);const d=parseFloat(o.border)===0;if(!l(o.class)&&o.class!=="mce-no-match"){r.class=o.class}a.height=it(o.height);if(c){a.width=it(o.width)}else if(s.getAttrib(t,"width")){r.width=ct(o.width)}if(c){if(d){r.border=0;a["border-width"]=""}else{a["border-width"]=it(o.border);r.border=1}a["border-spacing"]=it(o.cellspacing)}else{r.border=d?0:o.border;r.cellpadding=o.cellpadding;r.cellspacing=o.cellspacing}if(c&&t.children){const e={};if(d){e["border-width"]=""}else if(n.border){e["border-width"]=it(o.border)}if(n.cellpadding){e.padding=it(o.cellpadding)}if(i&&n.bordercolor){e["border-color"]=o.bordercolor}if(!L(e)){for(let o=0;o<t.children.length;o++){Zr(s,t.children[o],e)}}}if(i){const e=o;a["background-color"]=e.backgroundcolor;a["border-color"]=e.bordercolor;a["border-style"]=e.borderstyle}s.setStyles(t,{...gn(e),...a});s.setAttribs(t,{...pn(e),...r})};const qr=(e,t,o,n)=>{const s=e.dom;const r=n.getData();const a=O(r,((e,t)=>o[t]!==e));n.close();e.undoManager.transact((()=>{if(!t){const o=Lt(r.cols).getOr(1);const n=Lt(r.rows).getOr(1);e.execCommand("mceInsertTable",false,{rows:n,columns:o});t=cs(lt(e),at(e)).bind((t=>io(t,at(e)))).map((e=>e.dom)).getOrDie()}if(N(a)>0){const o={border:R(a,"border"),bordercolor:R(a,"bordercolor"),cellpadding:R(a,"cellpadding")};Ur(e,t,r,o);const n=s.select("caption",t)[0];if(n&&!r.caption||!n&&r.caption){e.execCommand("mceTableToggleCaption")}Do(e,t,r.align)}e.focus();e.addVisual();if(N(a)>0){const o=R(a,"caption");const n=o?N(a)>1:true;Mo(e,t,{structure:o,style:n})}}))};const Wr=(e,t)=>{const o=e.dom;let n;let s=br(e,tn(e));if(t){s.cols="1";s.rows="1";if(tn(e)){s.borderstyle="";s.bordercolor="";s.backgroundcolor=""}}else{n=o.getParent(e.selection.getStart(),"table",e.getBody());if(n){s=kr(e,n,tn(e))}else{if(tn(e)){s.borderstyle="";s.bordercolor="";s.backgroundcolor=""}}}const r=Ns(cn(e));if(r.isSome()){if(s.class){s.class=s.class.replace(/\s*mce\-item\-table\s*/g,"")}}const a={type:"grid",columns:2,items:jr(e,r.getOr([]),t)};const c=()=>({type:"panel",items:[a]});const i=()=>({type:"tabpanel",tabs:[{title:"General",name:"general",items:[a]},Zs(e,"table")]});const l=tn(e)?i():c();e.windowManager.open({title:"Table Properties",size:"normal",body:l,onSubmit:v(qr,e,n,s),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:true}],initialData:s})};const $r=e=>{const t=t=>{if(ut(lt(e))){t()}};z({mceTableProps:v(Wr,e,false),mceTableRowProps:v(Vr,e),mceTableCellProps:v(Dr,e),mceInsertTableDialog:v(Wr,e,true)},((o,n)=>e.addCommand(n,(()=>t(o)))))};const Gr=(e,t)=>Je(e,t).isSome();const Kr=y;const Yr=e=>{const t=(e,t)=>kt(e,t).exists((e=>parseInt(e,10)>1));const o=e=>t(e,"rowspan")||t(e,"colspan");return e.length>0&&ee(e,o)?x.some(e):x.none()};const Xr=(e,t,o)=>{if(t.length<=1){return x.none()}else{return Kn(e,o.firstSelectedSelector,o.lastSelectedSelector).map((e=>({bounds:e,cells:t})))}};const Jr=e=>({element:e,mergable:x.none(),unmergable:x.none(),selection:[e]});const Qr=(e,t,o)=>({element:o,mergable:Xr(t,e,ns),unmergable:Yr(e),selection:Kr(e)});const ea=e=>{const t=zs(x.none());const o=zs([]);let n=x.none();const s=De("caption");const r=e=>n.forall((t=>!t[e]));const a=()=>as(lt(e),at(e));const c=()=>as(dt(e),at(e));const i=()=>a().bind((t=>zt(St(io(t),c().bind(io),((o,n)=>{if(we(o,n)){if(s(t)){return x.some(Jr(t))}else{return x.some(Qr(is(e),o,t))}}return x.none()})))));const l=e=>{const t=io(e.element);return t.map((t=>{const o=Eo.fromTable(t);const n=or(o,e).getOr([]);const s=K(n,((e,t)=>{if(t.isLocked){e.onAny=true;if(t.column===0){e.onFirst=true}else if(t.column+t.colspan>=o.grid.columns){e.onLast=true}}return e}),{onAny:false,onFirst:false,onLast:false});return{mergeable:rr(o,e).isSome(),unmergeable:ar(o,e).isSome(),locked:s}}))};const d=()=>{t.set(Xs(i)());n=t.get().bind(l);U(o.get(),k)};const u=e=>{e();o.set(o.get().concat([e]));return()=>{o.set($(o.get(),(t=>t!==e)))}};const f=(o,n)=>u((()=>t.get().fold((()=>{o.setEnabled(false)}),(t=>{o.setEnabled(!n(t)&&e.selection.isEditable())}))));const m=(o,n,s)=>u((()=>t.get().fold((()=>{o.setEnabled(false);o.setActive(false)}),(t=>{o.setEnabled(!n(t)&&e.selection.isEditable());o.setActive(s(t))}))));const g=e=>n.exists((t=>t.locked[e]));const p=e=>f(e,(e=>false));const h=e=>f(e,(e=>s(e.element)));const y=e=>t=>f(t,(t=>s(t.element)||g(e)));const b=e=>t=>f(t,(t=>s(t.element)||e().isNone()));const v=(e,t)=>o=>f(o,(o=>s(o.element)||e().isNone()||g(t)));const _=e=>f(e,(e=>r("mergeable")));const C=e=>f(e,(e=>r("unmergeable")));const S=t=>m(t,w,(t=>{const o=io(t.element,at(e));return o.exists((e=>Gr(e,"caption")))}));const z=(t,o)=>n=>m(n,(e=>s(e.element)),(()=>e.queryCommandValue(t)===o));const T=z("mceTableRowType","header");const E=z("mceTableColType","th");e.on("NodeChange ExecCommand TableSelectorChange",d);return{onSetupTable:p,onSetupCellOrRow:h,onSetupColumn:y,onSetupPasteable:b,onSetupPasteableColumn:v,onSetupMergeable:_,onSetupUnmergeable:C,resetTargets:d,onSetupTableWithCaption:S,onSetupTableRowHeaders:T,onSetupTableColumnHeaders:E,targets:t.get}};var ta=tinymce.util.Tools.resolve("tinymce.FakeClipboard");const oa="x-tinymce/dom-table-";const na=oa+"rows";const sa=oa+"columns";const ra=e=>{var t;const o=(t=ta.read())!==null&&t!==void 0?t:[];return re(o,(t=>x.from(t.getType(e))))};const aa=()=>ra(na);const ca=()=>ra(sa);const ia=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};e.on("NodeChange",o);o();return()=>{e.off("NodeChange",o)}};const la=(e,t)=>{e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",onSetup:ia(e),fetch:e=>e("inserttable | cell row column | advtablesort | tableprops deletetable")});const o=t=>()=>e.execCommand(t);const n=(t,n)=>{if(e.queryCommandSupported(n.command)){e.ui.registry.addButton(t,{...n,onAction:f(n.onAction)?n.onAction:o(n.command)})}};const s=(t,n)=>{if(e.queryCommandSupported(n.command)){e.ui.registry.addToggleButton(t,{...n,onAction:f(n.onAction)?n.onAction:o(n.command)})}};n("tableprops",{tooltip:"Table properties",command:"mceTableProps",icon:"table",onSetup:t.onSetupTable});n("tabledelete",{tooltip:"Delete table",command:"mceTableDelete",icon:"table-delete-table",onSetup:t.onSetupTable});n("tablecellprops",{tooltip:"Cell properties",command:"mceTableCellProps",icon:"table-cell-properties",onSetup:t.onSetupCellOrRow});n("tablemergecells",{tooltip:"Merge cells",command:"mceTableMergeCells",icon:"table-merge-cells",onSetup:t.onSetupMergeable});n("tablesplitcells",{tooltip:"Split cell",command:"mceTableSplitCells",icon:"table-split-cells",onSetup:t.onSetupUnmergeable});n("tableinsertrowbefore",{tooltip:"Insert row before",command:"mceTableInsertRowBefore",icon:"table-insert-row-above",onSetup:t.onSetupCellOrRow});n("tableinsertrowafter",{tooltip:"Insert row after",command:"mceTableInsertRowAfter",icon:"table-insert-row-after",onSetup:t.onSetupCellOrRow});n("tabledeleterow",{tooltip:"Delete row",command:"mceTableDeleteRow",icon:"table-delete-row",onSetup:t.onSetupCellOrRow});n("tablerowprops",{tooltip:"Row properties",command:"mceTableRowProps",icon:"table-row-properties",onSetup:t.onSetupCellOrRow});n("tableinsertcolbefore",{tooltip:"Insert column before",command:"mceTableInsertColBefore",icon:"table-insert-column-before",onSetup:t.onSetupColumn("onFirst")});n("tableinsertcolafter",{tooltip:"Insert column after",command:"mceTableInsertColAfter",icon:"table-insert-column-after",onSetup:t.onSetupColumn("onLast")});n("tabledeletecol",{tooltip:"Delete column",command:"mceTableDeleteCol",icon:"table-delete-column",onSetup:t.onSetupColumn("onAny")});n("tablecutrow",{tooltip:"Cut row",command:"mceTableCutRow",icon:"cut-row",onSetup:t.onSetupCellOrRow});n("tablecopyrow",{tooltip:"Copy row",command:"mceTableCopyRow",icon:"duplicate-row",onSetup:t.onSetupCellOrRow});n("tablepasterowbefore",{tooltip:"Paste row before",command:"mceTablePasteRowBefore",icon:"paste-row-before",onSetup:t.onSetupPasteable(aa)});n("tablepasterowafter",{tooltip:"Paste row after",command:"mceTablePasteRowAfter",icon:"paste-row-after",onSetup:t.onSetupPasteable(aa)});n("tablecutcol",{tooltip:"Cut column",command:"mceTableCutCol",icon:"cut-column",onSetup:t.onSetupColumn("onAny")});n("tablecopycol",{tooltip:"Copy column",command:"mceTableCopyCol",icon:"duplicate-column",onSetup:t.onSetupColumn("onAny")});n("tablepastecolbefore",{tooltip:"Paste column before",command:"mceTablePasteColBefore",icon:"paste-column-before",onSetup:t.onSetupPasteableColumn(ca,"onFirst")});n("tablepastecolafter",{tooltip:"Paste column after",command:"mceTablePasteColAfter",icon:"paste-column-after",onSetup:t.onSetupPasteableColumn(ca,"onLast")});n("tableinsertdialog",{tooltip:"Insert table",command:"mceInsertTableDialog",icon:"table",onSetup:ia(e)});const r=Bs(cn(e));if(r.length!==0&&e.queryCommandSupported("mceTableToggleClass")){e.ui.registry.addMenuButton("tableclass",{icon:"table-classes",tooltip:"Table styles",fetch:Ls(e,r,"tableclass",(t=>e.execCommand("mceTableToggleClass",false,t))),onSetup:t.onSetupTable})}const a=Bs(rn(e));if(a.length!==0&&e.queryCommandSupported("mceTableCellToggleClass")){e.ui.registry.addMenuButton("tablecellclass",{icon:"table-cell-classes",tooltip:"Cell styles",fetch:Ls(e,a,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",false,t))),onSetup:t.onSetupCellOrRow})}if(e.queryCommandSupported("mceTableApplyCellStyle")){e.ui.registry.addMenuButton("tablecellvalign",{icon:"vertical-align",tooltip:"Vertical align",fetch:Ls(e,ds,"tablecellverticalalign",Rs(e,"vertical-align")),onSetup:t.onSetupCellOrRow});e.ui.registry.addMenuButton("tablecellborderwidth",{icon:"border-width",tooltip:"Border width",fetch:Ls(e,Xo(e),"tablecellborderwidth",Rs(e,"border-width")),onSetup:t.onSetupCellOrRow});e.ui.registry.addMenuButton("tablecellborderstyle",{icon:"border-style",tooltip:"Border style",fetch:Ls(e,Jo(e),"tablecellborderstyle",Rs(e,"border-style")),onSetup:t.onSetupCellOrRow});e.ui.registry.addMenuButton("tablecellbackgroundcolor",{icon:"cell-background-color",tooltip:"Background color",fetch:t=>t(Hs(e,dn(e),"background-color")),onSetup:t.onSetupCellOrRow});e.ui.registry.addMenuButton("tablecellbordercolor",{icon:"cell-border-color",tooltip:"Border color",fetch:t=>t(Hs(e,un(e),"border-color")),onSetup:t.onSetupCellOrRow})}s("tablecaption",{tooltip:"Table caption",icon:"table-caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption});s("tablerowheader",{tooltip:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Is(e),onSetup:t.onSetupTableRowHeaders});s("tablecolheader",{tooltip:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Ps(e),onSetup:t.onSetupTableColumnHeaders})};const da=e=>{const t=t=>e.dom.is(t,"table")&&e.getBody().contains(t)&&e.dom.isEditable(t.parentNode);const o=ln(e);if(o.length>0){e.ui.registry.addContextToolbar("table",{predicate:t,items:o,scope:"node",position:"node"})}};const ua=e=>t=>{const o=()=>{t.setEnabled(e.selection.isEditable())};e.on("NodeChange",o);o();return()=>{e.off("NodeChange",o)}};const fa=(e,t)=>{const o=t=>()=>e.execCommand(t);const n=(t,n)=>{if(e.queryCommandSupported(n.command)){e.ui.registry.addMenuItem(t,{...n,onAction:f(n.onAction)?n.onAction:o(n.command)});return true}else{return false}};const s=(t,n)=>{if(e.queryCommandSupported(n.command)){e.ui.registry.addToggleMenuItem(t,{...n,onAction:f(n.onAction)?n.onAction:o(n.command)})}};const r=t=>{e.execCommand("mceInsertTable",false,{rows:t.numRows,columns:t.numColumns})};const a=[n("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",command:"mceTableInsertRowBefore",onSetup:t.onSetupCellOrRow}),n("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",command:"mceTableInsertRowAfter",onSetup:t.onSetupCellOrRow}),n("tabledeleterow",{text:"Delete row",icon:"table-delete-row",command:"mceTableDeleteRow",onSetup:t.onSetupCellOrRow}),n("tablerowprops",{text:"Row properties",icon:"table-row-properties",command:"mceTableRowProps",onSetup:t.onSetupCellOrRow}),n("tablecutrow",{text:"Cut row",icon:"cut-row",command:"mceTableCutRow",onSetup:t.onSetupCellOrRow}),n("tablecopyrow",{text:"Copy row",icon:"duplicate-row",command:"mceTableCopyRow",onSetup:t.onSetupCellOrRow}),n("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",command:"mceTablePasteRowBefore",onSetup:t.onSetupPasteable(aa)}),n("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",command:"mceTablePasteRowAfter",onSetup:t.onSetupPasteable(aa)})];const c=[n("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",command:"mceTableInsertColBefore",onSetup:t.onSetupColumn("onFirst")}),n("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",command:"mceTableInsertColAfter",onSetup:t.onSetupColumn("onLast")}),n("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",command:"mceTableDeleteCol",onSetup:t.onSetupColumn("onAny")}),n("tablecutcolumn",{text:"Cut column",icon:"cut-column",command:"mceTableCutCol",onSetup:t.onSetupColumn("onAny")}),n("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",command:"mceTableCopyCol",onSetup:t.onSetupColumn("onAny")}),n("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",command:"mceTablePasteColBefore",onSetup:t.onSetupPasteableColumn(ca,"onFirst")}),n("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",command:"mceTablePasteColAfter",onSetup:t.onSetupPasteableColumn(ca,"onLast")})];const i=[n("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",command:"mceTableCellProps",onSetup:t.onSetupCellOrRow}),n("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",command:"mceTableMergeCells",onSetup:t.onSetupMergeable}),n("tablesplitcells",{text:"Split cell",icon:"table-split-cells",command:"mceTableSplitCells",onSetup:t.onSetupUnmergeable})];if(!nn(e)){e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:ua(e)})}else{e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:()=>[{type:"fancymenuitem",fancytype:"inserttable",onAction:r}],onSetup:ua(e)})}e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:o("mceInsertTableDialog"),onSetup:ua(e)});n("tableprops",{text:"Table properties",onSetup:t.onSetupTable,command:"mceTableProps"});n("deletetable",{text:"Delete table",icon:"table-delete-table",onSetup:t.onSetupTable,command:"mceTableDelete"});if(F(a,true)){e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:h("tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter")})}if(F(c,true)){e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:h("tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter")})}if(F(i,true)){e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:h("tablecellprops tablemergecells tablesplitcells")})}e.ui.registry.addContextMenu("table",{update:()=>{t.resetTargets();return t.targets().fold(h(""),(e=>{if(xe(e.element)==="caption"){return"tableprops deletetable"}else{return"cell row column | advtablesort | tableprops deletetable"}}))}});const l=Bs(cn(e));if(l.length!==0&&e.queryCommandSupported("mceTableToggleClass")){e.ui.registry.addNestedMenuItem("tableclass",{icon:"table-classes",text:"Table styles",getSubmenuItems:()=>Ms(e,l,"tableclass",(t=>e.execCommand("mceTableToggleClass",false,t))),onSetup:t.onSetupTable})}const d=Bs(rn(e));if(d.length!==0&&e.queryCommandSupported("mceTableCellToggleClass")){e.ui.registry.addNestedMenuItem("tablecellclass",{icon:"table-cell-classes",text:"Cell styles",getSubmenuItems:()=>Ms(e,d,"tablecellclass",(t=>e.execCommand("mceTableCellToggleClass",false,t))),onSetup:t.onSetupCellOrRow})}if(e.queryCommandSupported("mceTableApplyCellStyle")){e.ui.registry.addNestedMenuItem("tablecellvalign",{icon:"vertical-align",text:"Vertical align",getSubmenuItems:()=>Ms(e,ds,"tablecellverticalalign",Rs(e,"vertical-align")),onSetup:t.onSetupCellOrRow});e.ui.registry.addNestedMenuItem("tablecellborderwidth",{icon:"border-width",text:"Border width",getSubmenuItems:()=>Ms(e,Xo(e),"tablecellborderwidth",Rs(e,"border-width")),onSetup:t.onSetupCellOrRow});e.ui.registry.addNestedMenuItem("tablecellborderstyle",{icon:"border-style",text:"Border style",getSubmenuItems:()=>Ms(e,Jo(e),"tablecellborderstyle",Rs(e,"border-style")),onSetup:t.onSetupCellOrRow});e.ui.registry.addNestedMenuItem("tablecellbackgroundcolor",{icon:"cell-background-color",text:"Background color",getSubmenuItems:()=>Hs(e,dn(e),"background-color"),onSetup:t.onSetupCellOrRow});e.ui.registry.addNestedMenuItem("tablecellbordercolor",{icon:"cell-border-color",text:"Border color",getSubmenuItems:()=>Hs(e,un(e),"border-color"),onSetup:t.onSetupCellOrRow})}s("tablecaption",{icon:"table-caption",text:"Table caption",command:"mceTableToggleCaption",onSetup:t.onSetupTableWithCaption});s("tablerowheader",{text:"Row header",icon:"table-top-header",command:"mceTableRowType",onAction:Is(e),onSetup:t.onSetupTableRowHeaders});s("tablecolheader",{text:"Column header",icon:"table-left-header",command:"mceTableColType",onAction:Ps(e),onSetup:t.onSetupTableRowHeaders})};const ma=e=>{const t=ea(e);Ko(e);$r(e);fa(e,t);la(e,t);da(e)};var ga=()=>{e.add("table",ma)};ga()})()}];var t={};function o(n){var s=t[n];if(s!==undefined){return s.exports}var r=t[n]={exports:{}};e[n](r,r.exports,o);return r.exports}var n={}; /** * --------------------------------------------------------------------- * * GLPI - Gestionnaire Libre de Parc Informatique * * http://glpi-project.org * * @copyright 2015-2024 Teclib' and contributors. * @copyright 2003-2014 by the INDEPNET Development Team. * @licence https://www.gnu.org/licenses/gpl-3.0.html * * --------------------------------------------------------------------- * * LICENSE * * This file is part of GLPI. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * * --------------------------------------------------------------------- */window.tinymce=window.tinyMCE=o(1);o(2);o(3);o(5);o(6);o(8);o(10);o(12);o(14);o(15);o(17);o(19);o(21);o(23);o(25);o(27)})();