2 lines
1.0 MiB
2 lines
1.0 MiB
!function(){"use strict";function t(t){if(null===t)return"null";if(void 0===t)return"undefined";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}function e(t){return g((function(e,n){if(e.length!==n.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!t.eq(e[o],n[o]))return!1;return!0}))}function n(t){return g((function(n,r){var o,i,a=Object.keys(n),u=Object.keys(r);if(o=e(h),i=function(t){return undefined,Array.prototype.slice.call(t).sort(undefined)},!g((function(t,e){return o.eq(i(t),i(e))})).eq(a,u))return!1;for(var c=a.length,s=0;s<c;s++){var l=a[s];if(!t.eq(n[l],r[l]))return!1}return!0}))}function r(t){return function(e){return r=typeof(n=e),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}}function o(t){return function(e){return typeof e===t}}function i(t){return function(e){return t===e}}function a(t){return null==t}function u(t){return!a(t)}function c(){}function s(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}}function l(t,e){return function(n){return t(e(n))}}function f(t){return function(){return t}}function d(t){return t}function m(t,e){return t===e}var g=function(t){return{eq:t}},h=g((function(t,e){return t===e})),p=g((function(r,o){if(r===o)return!0;var i=t(r);return i===t(o)&&(-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(i)?r===o:"array"===i?e(p).eq(r,o):"object"===i&&n(p).eq(r,o))})),v=r("string"),b=r("object"),y=r("array"),x=i(null),w=o("boolean"),C=i(void 0),S=o("function"),k=o("number");function O(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}function E(t){return function(e){return!t(e)}}function _(t){return t()}function T(t){t()}function M(){return A}var D=f(!1),z=f(!0),A={fold:function(t,e){return t()},isSome:D,isNone:z,getOr:d,getOrThunk:N,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:f(null),getOrUndefined:f(void 0),or:d,orThunk:N,map:M,each:c,bind:M,exists:D,forall:z,filter:function(){return A},toArray:function(){return[]},toString:f("none()")};function N(t){return t()}function B(t,e){return yt.call(t,e)}function R(t,e){return-1<B(t,e)}function H(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return!0;return!1}function V(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r}function I(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}function L(t,e){for(var n=t.length-1;0<=n;n--)e(t[n],n)}function F(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}}function P(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n}function U(t,e,n){return L(t,(function(t,r){n=e(n,t,r)})),n}function j(t,e,n){return I(t,(function(t,r){n=e(n,t,r)})),n}function W(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return vt.some(i);if(n(i,r))break}return vt.none()}function q(t,e){return W(t,e,D)}function G(t,e){for(var n=0,r=t.length;n<r;n++)if(e(t[n],n))return vt.some(n);return vt.none()}function $(t,e){return function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!y(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);xt.apply(e,t[n])}return e}(V(t,e))}function X(t,e){for(var n=0,r=t.length;n<r;++n)if(!0!==e(t[n],n))return!1;return!0}function K(t){var e=bt.call(t,0);return e.reverse(),e}function Y(t,e){return P(t,(function(t){return!R(e,t)}))}function J(t,e){var n=bt.call(t,0);return n.sort(e),n}function Q(t,e){return 0<=e&&e<t.length?vt.some(t[e]):vt.none()}function Z(t){return Q(t,0)}function tt(t){return Q(t,t.length-1)}function et(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return vt.none()}function nt(t,e){for(var n=Ct(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}function rt(t,e){return kt(t,(function(t,n){return{k:n,v:e(t,n)}}))}function ot(t){return function(e,n){t[n]=e}}function it(t,e,n,r){return nt(t,(function(t,o){(e(t,o)?n:r)(t,o)})),1}function at(t,e){var n={};return it(t,e,ot(n),c),n}function ut(t,e){return Ot(t,e)?vt.from(t[e]):vt.none()}function ct(t,e){return Ot(t,e)&&void 0!==t[e]&&null!==t[e]}function st(t,e,n){var r,o;if(!t)return!1;if(n=n||t,void 0!==t.length){for(r=0,o=t.length;r<o;r++)if(!1===e.call(n,t[r],r,t))return!1}else for(r in t)if(Ot(t,r)&&!1===e.call(n,t[r],r,t))return!1;return!0}function lt(t,e){var n=[];return st(t,(function(r,o){n.push(e(r,o,t))})),n}function ft(t,e){var n=[];return st(t,(function(r,o){e&&!e(r,o,t)||n.push(r)})),n}function dt(t,e){if(t)for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function mt(t,e,n,r){for(var o=C(n)?t[0]:n,i=0;i<t.length;i++)o=e.call(r,o,t[i],i);return o}function gt(t,e,n){for(var r=0,o=t.length;r<o;r++)if(e.call(n,t[r],r,t))return r;return-1}function ht(t){return t[t.length-1]}var pt=function(t){function e(){return o}function n(e){return e(t)}var r=f(t),o={fold:function(e,n){return n(t)},isSome:z,isNone:D,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return pt(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:A},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},vt={some:pt,none:M,from:function(t){return null==t?A:pt(t)}},bt=Array.prototype.slice,yt=Array.prototype.indexOf,xt=Array.prototype.push,wt=S(Array.from)?Array.from:function(t){return bt.call(t)},Ct=Object.keys,St=Object.hasOwnProperty,kt=function(t,e){var n={};return nt(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},Ot=function(t,e){return St.call(t,e)},Et=Array.isArray,_t=function(){return(_t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Tt(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||((r=r||Array.prototype.slice.call(e,0,o))[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}function Mt(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}}function Dt(t,e){var n=String(e).toLowerCase();return q(t,(function(t){return t.search(n)}))}function zt(t,e){return-1!==t.indexOf(e)}function At(t){return function(e){return e.replace(t,"")}}function Nt(t){return 0<t.length}function Bt(t){return!Nt(t)}function Rt(t){return function(e){return zt(e,t)}}function Ht(t){return window.matchMedia(t).matches}function Vt(t){return null==t?"":(""+t).replace(Ce,"")}function It(t,e){return e?!("array"!==e||!Et(t))||typeof t===e:void 0!==t}function Lt(t,e){for(var n=[],r=function(t){return n.push(t),e(t)},o=e(t);(o=o.bind(r)).isSome(););return n}function Ft(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}function Pt(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount}function Ut(t,e){return t.dom===e.dom}function jt(t,e){return de().browser.isIE()?(n=t.dom,r=e.dom,o=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(n.compareDocumentPosition(r)&o)):(i=t.dom)!==(a=e.dom)&&i.contains(a);var n,r,o,i,a}function Wt(){return Xt(0,0)}function qt(t){function e(t){return function(){return n===t}}var n=t.current,r=t.version;return{current:n,version:r,isEdge:e("Edge"),isChrome:e("Chrome"),isIE:e("IE"),isOpera:e("Opera"),isFirefox:e(ne),isSafari:e("Safari")}}function Gt(t){function e(t){return function(){return n===t}}var n=t.current,r=t.version;return{current:n,version:r,isWindows:e(ie),isiOS:e("iOS"),isAndroid:e(ae),isOSX:e("OSX"),isLinux:e("Linux"),isSolaris:e(ue),isFreeBSD:e(ce),isChromeOS:e(se)}}function $t(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}var Xt=function(t,e){return{major:t,minor:e}},Kt={nu:Xt,detect:function(t,e){var n,r,o=String(e).toLowerCase();return 0===t.length?Wt():(r=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,n=o))?Xt(i(1),i(2)):{major:0,minor:0};function i(t){return Number(n.replace(r,"$"+t))}},unknown:Wt},Yt=function(t,e){return""===(n=e)||t.length>=n.length&&t.substr(0,0+n.length)===n;var n},Jt=At(/^\s+|\s+$/g),Qt=At(/^\s+/g),Zt=At(/\s+$/g),te=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ee={browsers:f([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return zt(t,"edge/")&&zt(t,"chrome")&&zt(t,"safari")&&zt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,te],search:function(t){return zt(t,"chrome")&&!zt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return zt(t,"msie")||zt(t,"trident")}},{name:"Opera",versionRegexes:[te,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Rt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Rt("firefox")},{name:"Safari",versionRegexes:[te,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(zt(t,"safari")||zt(t,"mobile/"))&&zt(t,"applewebkit")}}]),oses:f([{name:"Windows",search:Rt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return zt(t,"iphone")||zt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Rt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Rt("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Rt("linux"),versionRegexes:[]},{name:"Solaris",search:Rt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Rt("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Rt("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},ne="Firefox",re=function(){return qt({current:void 0,version:Kt.unknown()})},oe=qt,ie=(f("Edge"),f("Chrome"),f("IE"),f("Opera"),f(ne),f("Safari"),"Windows"),ae="Android",ue="Solaris",ce="FreeBSD",se="ChromeOS",le=function(){return Gt({current:void 0,version:Kt.unknown()})},fe=Gt,de=(f(ie),f("iOS"),f(ae),f("Linux"),f("OSX"),f(ue),f(ce),f(se),Mt((function(){return t=navigator.userAgent,e=vt.from(navigator.userAgentData),n=Ht,p=ee.browsers(),v=ee.oses(),b=e.bind((function(t){return e=p,et(t.brands,(function(t){var n=t.brand.toLowerCase();return q(e,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(e){return{current:e.name,version:Kt.nu(parseInt(t.version,10),0)}}))}));var e})).orThunk((function(){return Dt(p,e=t).map((function(t){var n=Kt.detect(t.versionRegexes,e);return{current:t.name,version:n}}));var e})).fold(re,oe),y=Dt(v,r=t).map((function(t){var e=Kt.detect(t.versionRegexes,r);return{current:t.name,version:e}})).fold(le,fe),{browser:b,os:y,deviceType:(i=b,a=t,u=n,c=(o=y).isiOS()&&!0===/ipad/i.test(a),s=o.isiOS()&&!c,d=(l=o.isiOS()||o.isAndroid())||u("(pointer:coarse)"),m=c||!s&&l&&u("(min-device-width:768px)"),g=s||l&&!m,h=i.isSafari()&&o.isiOS()&&!1===/safari/i.test(a),{isiPad:f(c),isiPhone:f(s),isTablet:f(m),isPhone:f(g),isTouch:f(d),isAndroid:o.isAndroid,isiOS:o.isiOS,isWebView:f(h),isDesktop:f(!g&&!m&&!h)})};var t,e,n,r,o,i,a,u,c,s,l,d,m,g,h,p,v,b,y}))),me=navigator.userAgent,ge=de(),he=ge.browser,pe=ge.os,ve=ge.deviceType,be=/WebKit/.test(me)&&!he.isEdge(),ye="FormData"in window&&"FileReader"in window&&"URL"in window&&!!URL.createObjectURL,xe=-1!==me.indexOf("Windows Phone"),we={opera:he.isOpera(),webkit:be,ie:!(!he.isIE()&&!he.isEdge())&&he.version.major,gecko:he.isFirefox(),mac:pe.isOSX()||pe.isiOS(),iOS:ve.isiPad()||ve.isiPhone(),android:pe.isAndroid(),contentEditable:!0,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:!0,range:window.getSelection&&"Range"in window,documentMode:he.isIE()?document.documentMode||7:10,fileApi:ye,ceFalse:!0,cacheSuffix:null,container:null,experimentalShadowDom:!1,canHaveCSP:!he.isIE(),desktop:ve.isDesktop(),windowsPhone:xe,browser:{current:he.current,version:he.version,isChrome:he.isChrome,isEdge:he.isEdge,isFirefox:he.isFirefox,isIE:he.isIE,isOpera:he.isOpera,isSafari:he.isSafari},os:{current:pe.current,version:pe.version,isAndroid:pe.isAndroid,isChromeOS:pe.isChromeOS,isFreeBSD:pe.isFreeBSD,isiOS:pe.isiOS,isLinux:pe.isLinux,isOSX:pe.isOSX,isSolaris:pe.isSolaris,isWindows:pe.isWindows},deviceType:{isDesktop:ve.isDesktop,isiPad:ve.isiPad,isiPhone:ve.isiPhone,isPhone:ve.isPhone,isTablet:ve.isTablet,isTouch:ve.isTouch,isWebView:ve.isWebView}},Ce=/^\s*|\s*$/g,Se=function(t,e,n,r){r=r||this,t&&st(t=n?t[n]:t,(function(t,o){return!1!==e.call(r,t,o,n)&&void Se(t,e,n,r)}))},ke={trim:Vt,isArray:Et,is:It,toArray:function(t){if(Et(t))return t;for(var e=[],n=0,r=t.length;n<r;n++)e[n]=t[n];return e},makeMap:function(t,e,n){var r;for(e=e||",",n=n||{},r=(t="string"==typeof(t=t||[])?t.split(e):t).length;r--;)n[t[r]]={};return n},each:st,map:lt,grep:ft,inArray:dt,hasOwn:Ot,extend:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o,i,a=e[r];for(o in a)!Ot(a,o)||void 0!==(i=a[o])&&(t[o]=i)}return t},create:function(t,e,n){var r,o,i,a=this,u=0,c=(t=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(t))[3].match(/(^|\.)(\w+)$/i)[2],s=a.createNS(t[3].replace(/\.\w+$/,""),n);if(!s[c]){if("static"===t[2])return s[c]=e,void(this.onCreate&&this.onCreate(t[2],t[3],s[c]));e[c]||(e[c]=function(){},u=1),s[c]=e[c],a.extend(s[c].prototype,e),t[5]&&(r=a.resolve(t[5]).prototype,o=t[5].match(/\.(\w+)$/i)[1],i=s[c],s[c]=u?function(){return r[o].apply(this,arguments)}:function(){return this.parent=r[o],i.apply(this,arguments)},s[c].prototype[c]=s[c],a.each(r,(function(t,e){s[c].prototype[e]=r[e]})),a.each(e,(function(t,e){r[e]?s[c].prototype[e]=function(){return this.parent=r[e],t.apply(this,arguments)}:e!==c&&(s[c].prototype[e]=t)}))),a.each(e.static,(function(t,e){s[c][e]=t}))}},walk:Se,createNS:function(t,e){var n,r;for(e=e||window,t=t.split("."),n=0;n<t.length;n++)e[r=t[n]]||(e[r]={}),e=e[r];return e},resolve:function(t,e){var n,r;for(e=e||window,n=0,r=(t=t.split(".")).length;n<r&&(e=e[t[n]]);n++);return e},explode:function(t,e){return!t||It(t,"array")?t:lt(t.split(e||","),Vt)},_addCacheSuffix:function(t){var e=we.cacheSuffix;return e&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t}},Oe={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return $t(n.childNodes[0])},fromTag:function(t,e){return $t((e||document).createElement(t))},fromText:function(t,e){return $t((e||document).createTextNode(t))},fromDom:$t,fromPoint:function(t,e,n){return vt.from(t.dom.elementFromPoint(e,n)).map($t)}};function Ee(t){return t.dom.nodeName.toLowerCase()}function _e(t){return t.dom.nodeType}function Te(t){return function(e){return _e(e)===t}}function Me(t){return Oe.fromDom(t.dom.ownerDocument)}function De(t){return _n(t)?t:Me(t)}function ze(t){return Oe.fromDom(De(t).dom.defaultView)}function Ae(t){return vt.from(t.dom.parentNode).map(Oe.fromDom)}function Ne(t){return vt.from(t.dom.previousSibling).map(Oe.fromDom)}function Be(t){return vt.from(t.dom.nextSibling).map(Oe.fromDom)}function Re(t){return K(Lt(t,Ne))}function He(t){return Lt(t,Be)}function Ve(t,e){var n=t.dom.childNodes;return vt.from(n[e]).map(Oe.fromDom)}function Ie(t){return Ve(t,0)}function Le(t){return Ve(t,t.dom.childNodes.length-1)}function Fe(t){return t.dom.childNodes.length}function Pe(t){return Tn(t)&&u(t.dom.host)}function Ue(t){return Pe(t)?t:function(){var e=De(t).dom.head;if(null==e)throw new Error("Head is not available yet");return Oe.fromDom(e)}()}function je(t){return Oe.fromDom(t.dom.host)}function We(t,e){Ae(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))}function qe(t,e){Be(t).fold((function(){Ae(t).each((function(t){Nn(t,e)}))}),(function(t){We(t,e)}))}function Ge(t,e){Ie(t).fold((function(){Nn(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))}function $e(t,e){I(e,(function(e){Nn(t,e)}))}function Xe(t){t.dom.textContent="",I(Mn(t),(function(t){Bn(t)}))}function Ke(t){var e,n=Mn(t);0<n.length&&(e=t,I(n,(function(t){We(e,t)}))),Bn(t)}function Ye(t,e){return void 0!==t?t:void 0!==e?e:0}function Je(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return Vn(n,r)}function Qe(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)}function Ze(t,e){de().browser.isSafari()&&S(t.dom.scrollIntoViewIfNeeded)?t.dom.scrollIntoViewIfNeeded(!1):t.dom.scrollIntoView(e)}function tn(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}}function en(t){var e=void 0===t?window:t,n=e.document,r=Je(Oe.fromDom(n)),o=void 0===e?window:e;return(de().browser.isFirefox()?vt.none():vt.from(o.visualViewport)).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return tn(r.left,r.top,n,o)}),(function(t){return tn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))}function nn(t){return function(e){return!!e&&e.nodeType===t}}function rn(t){return t&&!Object.getPrototypeOf(t)}function on(t){var e=t.map((function(t){return t.toLowerCase()}));return function(t){if(t&&t.nodeName){var n=t.nodeName.toLowerCase();return R(e,n)}return!1}}function an(t,e){var n=e.toLowerCase().split(" ");return function(e){if(Ln(e))for(var r=0;r<n.length;r++){var o=e.ownerDocument.defaultView.getComputedStyle(e,null);if((o?o.getPropertyValue(t):null)===n[r])return!0}return!1}}function un(t){return function(e){return Ln(e)&&e.hasAttribute(t)}}function cn(t){return Ln(t)&&t.hasAttribute("data-mce-bogus")}function sn(t){return Ln(t)&&"TABLE"===t.tagName}function ln(t){return function(e){if(Ln(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}}function fn(t,e,n){return void 0===n&&(n=m),t.exists((function(t){return n(t,e)}))}function dn(t,e,n){return t.isSome()&&e.isSome()?vt.some(n(t.getOrDie(),e.getOrDie())):vt.none()}function mn(t){return void 0!==t.style&&S(t.style.getPropertyValue)}function gn(t,e,n){if(!(v(n)||w(n)||k(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")}function hn(t,e,n){gn(t.dom,e,n)}function pn(t,e){var n=t.dom;nt(e,(function(t,e){gn(n,e,t)}))}function vn(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n}function bn(t,e){return vt.from(vn(t,e))}function yn(t,e){t.dom.removeAttribute(e)}function xn(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Rn(t)?r:Jn(n,e)}function wn(t,e){var n=t.dom,r=Jn(n,e);return vt.from(r).filter((function(t){return 0<t.length}))}function Cn(t){var e={},n=t.dom;if(mn(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e}function Sn(t){return q(t,On)}function kn(t,e){return t.children&&R(t.children,e)}"undefined"!=typeof window||Function("return this;")();var On=Te(1),En=Te(3),_n=Te(9),Tn=Te(11),Mn=function(t){return V(t.dom.childNodes,Oe.fromDom)},Dn=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),zn=f(Dn),An=Dn?function(t){return Oe.fromDom(t.dom.getRootNode())}:De,Nn=function(t,e){t.dom.appendChild(e.dom)},Bn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Rn=function(t){var e=En(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n=e.ownerDocument,r=Oe.fromDom(e),o=An(r);return(Pe(o)?vt.some(o):vt.none()).fold((function(){return n.body.contains(e)}),l(Rn,je))},Hn=function(t,e){return{left:t,top:e,translate:function(n,r){return Hn(t+n,e+r)}}},Vn=Hn,In=function(t){var e,n=t.dom,r=n.ownerDocument.body;return r===n?Vn(r.offsetLeft,r.offsetTop):Rn(t)?(e=n.getBoundingClientRect(),Vn(e.left,e.top)):Vn(0,0)},Ln=nn(1),Fn=on(["textarea","input"]),Pn=nn(3),Un=nn(8),jn=nn(9),Wn=nn(11),qn=on(["br"]),Gn=on(["img"]),$n=ln("true"),Xn=ln("false"),Kn=on(["td","th"]),Yn=on(["video","audio","object","embed"]),Jn=function(t,e){return mn(t)?t.style.getPropertyValue(e):""},Qn=de().browser,Zn={},tr={exports:Zn};function er(t){setTimeout((function(){throw t}),0)}function nr(t){return ur((function(){return new or(t)}))}function rr(t){if(!y(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return I(t,(function(r,o){var i=Ct(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!y(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[o].apply(null,n)},match:function(t){var r=Ct(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!X(e,(function(t){return R(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)},log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n}!function(){var t=this,e=function(){var t,e,n,r={exports:{}};function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n,r=1===t._state?e.onFulfilled:e.onRejected;if(null!==r){try{n=r(t._value)}catch(n){return void c(e.promise,n)}u(e.promise,n)}else(1===t._state?u:c)(e.promise,t._value)}))):t._deferreds.push(e)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void f((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function l(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function f(t,e){var n=!1;try{t((function(t){n||(n=!0,u(e,t))}),(function(t){n||(n=!0,c(e,t))}))}catch(t){if(n)return;n=!0,c(e,t)}}t=r,e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new l(t,e,n)),n},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){if(0===e.length)return t([]);for(var r=e.length,o=0;o<e.length;o++)!function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return u.call(a,(function(t){o(i,t)}),n),0}e[i]=a,0==--r&&t(e)}catch(a){n(a)}}(o,e[o])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},i._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},t.exports?t.exports=i:e.Promise||(e.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof Zn&&void 0!==tr?tr.exports=e():(t="undefined"!=typeof globalThis?globalThis:t||self).EphoxContactWrapper=e()}();var or=tr.exports.boltExport,ir=function(t){function e(t){o()?i(t):r.push(t)}var n=vt.none(),r=[],o=function(){return n.isSome()},i=function(t){n.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(n=vt.some(t),I(r,i),r=[])})),{get:e,map:function(t){return ir((function(n){e((function(e){n(t(e))}))}))},isReady:o}},ar={nu:ir,pure:function(t){return ir((function(e){e(t)}))}},ur=function(t){function e(e){t().then(e,er)}return{map:function(e){return ur((function(){return t().then(e)}))},bind:function(e){return ur((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return ur((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return ar.nu(e)},toCached:function(){var e=null;return ur((function(){return e=null===e?t():e}))},toPromise:t,get:e}},cr=function(t){return{isValue:z,isError:D,getOr:f(t),getOrThunk:f(t),getOrDie:f(t),or:function(e){return cr(t)},orThunk:function(e){return cr(t)},fold:function(e,n){return n(t)},map:function(e){return cr(e(t))},mapError:function(e){return cr(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return vt.some(t)}}},sr=function(t){return{isValue:D,isError:z,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return e=String(t),function(){throw new Error(e)}();var e},or:d,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return sr(t)},mapError:function(e){return sr(e(t))},each:c,bind:function(e){return sr(t)},exists:D,forall:z,toOptional:vt.none}},lr={value:cr,error:sr,fromOption:function(t,e){return t.fold((function(){return sr(e)}),cr)}};function fr(t){return t.fold(d,d)}function dr(t,e,n,r,o){return t(n,r)?vt.some(n):S(o)&&o(n)?vt.none():e(n,r,o)}function mr(t,e,n){for(var r=t.dom,o=S(n)?n:D;r.parentNode;){r=r.parentNode;var i=Oe.fromDom(r);if(e(i))return vt.some(i);if(o(i))break}return vt.none()}function gr(t,e,n){return dr((function(t,e){return e(t)}),mr,t,e,n)}function hr(t,e,n){return mr(t,(function(t){return Ft(t,e)}),n)}function pr(t,e){return n=e,Pt(r=void 0===t?document:t.dom)?vt.none():vt.from(r.querySelector(n)).map(Oe.fromDom);var n,r}function vr(t,e,n){return dr(Ft,hr,t,e,n)}function br(t,e){return"number"!=typeof e&&(e=0),setTimeout(t,e)}function yr(t,e){return"number"!=typeof e&&(e=1),setInterval(t,e)}function xr(t,e){function n(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];clearTimeout(r),r=br((function(){t.apply(this,n)}),e)}var r;return n.stop=function(){clearTimeout(r)},n}function wr(t,e){function n(n,r,o){var s,f=ke._addCacheSuffix(n),d=ut(a,f).getOrThunk((function(){return{id:"mce-u"+i++,passed:[],failed:[],count:0}}));function m(t,e){for(var n=t.length;n--;)t[n]();d.status=e,d.passed=[],d.failed=[],s&&(s.onload=null,s.onerror=null,s=null)}function g(){return m(d.passed,2),0}function h(){return m(d.failed,3)}(a[f]=d).count++;var p,v,b,y=function(){var e=y;!function(){for(var e=t.styleSheets,n=e.length;n--;){var r=e[n].ownerNode;if(r&&r.id===s.id)return g(),1}}()&&(Date.now()-v<l?Or.setTimeout(e):h())};r&&d.passed.push(r),o&&d.failed.push(o),1!==d.status&&(2!==d.status?3!==d.status?(d.status=1,pn(p=Oe.fromTag("link",c.dom),{rel:"stylesheet",type:"text/css",id:d.id}),v=Date.now(),e.contentCssCors&&hn(p,"crossOrigin","anonymous"),e.referrerPolicy&&hn(p,"referrerpolicy",e.referrerPolicy),(s=p.dom).onload=y,s.onerror=h,b=p,Nn(Ue(u),b),hn(p,"href",f)):h():g())}function r(t){return nr((function(e){n(t,s(e,f(lr.value(t))),s(e,f(lr.error(t))))}))}function o(t){var e=ke._addCacheSuffix(t);ut(a,e).each((function(t){var n;0==--t.count&&(delete a[e],n=t.id,pr(Ue(u),"#"+n).each(Bn))}))}void 0===e&&(e={});var i=0,a={},u=Oe.fromDom(t),c=De(u),l=e.maxLoadTime||5e3;return{load:n,loadAll:function(t,e,n){var o,i=V(t,r);o=i,nr((function(t){var e=[],n=0;0===o.length?t([]):I(o,(function(r,i){var a;r.get((a=i,function(r){e[a]=r,++n>=o.length&&t(e)}))}))})).get((function(t){var r=F(t,(function(t){return t.isValue()}));0<r.fail.length?n(r.fail.map(fr)):e(r.pass.map(fr))}))},unload:o,unloadAll:function(t){I(t,(function(t){o(t)}))},_setReferrerPolicy:function(t){e.referrerPolicy=t}}}rr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Cr,Sr,kr=window.Promise||or,Or={requestAnimationFrame:function(t,e){Cr?Cr.then(t):Cr=new kr((function(t){!function(t,e){for(var n=window.requestAnimationFrame,r=["ms","moz","webkit"],o=0;o<r.length&&!n;o++)n=window[r[o]+"RequestAnimationFrame"];(n=n||function(t){window.setTimeout(t,0)})(t,e)}(t,e=e||document.body)})).then(t)},setTimeout:br,setInterval:yr,setEditorTimeout:function(t,e,n){return br((function(){t.removed||e()}),n)},setEditorInterval:function(t,e,n){var r=yr((function(){t.removed?clearInterval(r):e()}),n);return r},debounce:xr,throttle:xr,clearInterval:function(t){return clearInterval(t)},clearTimeout:function(t){return clearTimeout(t)}},Er=(Sr=new WeakMap,{forElement:function(t,e){var n=An(t).dom;return vt.from(Sr.get(n)).getOrThunk((function(){var t=wr(n,e);return Sr.set(n,t),t}))}}),_r=(Tr.prototype.current=function(){return this.node},Tr.prototype.next=function(t){return this.node=this.findSibling(this.node,"firstChild","nextSibling",t),this.node},Tr.prototype.prev=function(t){return this.node=this.findSibling(this.node,"lastChild","previousSibling",t),this.node},Tr.prototype.prev2=function(t){return this.node=this.findPreviousNode(this.node,"lastChild","previousSibling",t),this.node},Tr.prototype.findSibling=function(t,e,n,r){var o,i;if(t){if(!r&&t[e])return t[e];if(t!==this.rootNode){if(o=t[n])return o;for(i=t.parentNode;i&&i!==this.rootNode;i=i.parentNode)if(o=i[n])return o}}},Tr.prototype.findPreviousNode=function(t,e,n,r){var o,i,a;if(t&&(o=t[n],!this.rootNode||o!==this.rootNode)){if(o){if(!r)for(a=o[e];a;a=a[e])if(!a[e])return a;return o}return(i=t.parentNode)&&i!==this.rootNode?i:void 0}},Tr);function Tr(t,e){this.node=t,this.rootNode=e,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}function Mr(t){var e;return function(n){return e=e||function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n}(t,z),Ot(e,Ee(n))}}function Dr(t){return On(t)&&!lo(t)}function zr(t){return On(t)&&"br"===Ee(t)}function Ar(t){return ko(t)&&(t=t.parentNode),So(t)&&t.hasAttribute("data-mce-caret")}function Nr(t){return ko(t)&&wo(t.data)}function Br(t){return Ar(t)||Nr(t)}function Rr(t){return t.firstChild!==t.lastChild||!qn(t.firstChild)}function Hr(t){var e=t.container();return!!Pn(e)&&(e.data.charAt(t.offset())===xo||t.isAtStart()&&Nr(e.previousSibling))}function Vr(t){var e=t.container();return!!Pn(e)&&(e.data.charAt(t.offset()-1)===xo||t.isAtEnd()&&Nr(e.nextSibling))}function Ir(t){return t&&t.hasAttribute("data-mce-caret")?(cn(n=(e=t.getElementsByTagName("br"))[e.length-1])&&n.parentNode.removeChild(n),t.removeAttribute("data-mce-caret"),t.removeAttribute("data-mce-bogus"),t.removeAttribute("style"),t.removeAttribute("_moz_abspos"),t):null;var e,n}function Lr(t){return Ar(t.startContainer)}function Fr(t){return!Bo(t)&&(Do(t)?!zo(t.parentNode):Ao(t)||Mo(t)||No(t)||Ro(t))}function Pr(t,e){return Fr(t)&&function(t,e){for(t=t.parentNode;t&&t!==e;t=t.parentNode){if(Ro(t))return!1;if(_o(t))return!0}return!0}(t,e)}function Ur(t){return Ho.test(t)}function jr(t,e){return Fr(t)&&!1===(a=e,Pn(i=t)&&Ur(i.data)&&!1===(n=i,r=Oe.fromDom(a),hr(Oe.fromDom(n),"pre,code",O(Ut,r)).isSome()))||Ln(o=t)&&"A"===o.nodeName&&!o.hasAttribute("href")&&(o.hasAttribute("name")||o.hasAttribute("id"))||Vo(t);var n,r,o,i,a}function Wr(t,e){return function(t,e){var n=0;if(jr(t,t))return!1;var r=t.firstChild;if(!r)return!0;var o=new _r(r,t);do{if(e){if(Lo(r)){r=o.next(!0);continue}if(Io(r)){r=o.next();continue}}if(qn(r))n++,r=o.next();else{if(jr(r,t))return!1;r=o.next()}}while(r);return n<=1}(t.dom,e=void 0===e||e)}function qr(t,e){return u(t)&&(jr(t,e)||Dr(Oe.fromDom(t)))}function Gr(t){return"span"===t.nodeName.toLowerCase()&&"bookmark"===t.getAttribute("data-mce-type")}function $r(t,e){var n,r,o,i={};if(t){for(t=t.split(","),e=e||10,n=0;n<t.length;n+=2)r=String.fromCharCode(parseInt(t[n],e)),$o[r]||(o="&"+t[n+1]+";",i[r]=o,i[o]=r);return i}}function Xr(t,e){return t.replace(e?Uo:jo,(function(t){return $o[t]||t}))}function Kr(t,e){return t.replace(e?Uo:jo,(function(t){return 1<t.length?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":$o[t]||"&#"+t.charCodeAt(0)+";"}))}function Yr(t,e,n){return n=n||Ko,t.replace(e?Uo:jo,(function(t){return $o[t]||n[t]||t}))}function Jr(t,e){return(t=ke.trim(t))?t.split(e||" "):[]}function Qr(t,e){var n=Zo(t," ",Zo(t.toUpperCase()," "));return ei(n,e)}function Zr(t){return Qr("td th li dt dd figcaption caption details summary",t.getTextBlockElements())}function to(t,e){var n;return t&&(n={},ti(t="string"==typeof t?{"*":t}:t,(function(t,r){n[r]=n[r.toUpperCase()]=("map"===e?Zo:ni)(t,/[, ]/)}))),n}function eo(t){function e(e,n,r){var o=t[e];return o?o=Zo(o,/[, ]/,Zo(o.toUpperCase(),/[, ]/)):(o=Jo[e])||(o=Qr(n,r),Jo[e]=o),o}var n,r,o,i,a,u,c,s,l={},d={},m=[],g={},h={},p=(n=(t=t||{}).schema,s={},Jo[n]||(r="id accesskey class dir lang style tabindex title role",o="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",i="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==n&&(r+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",o+=" article aside details dialog figure main header footer hgroup section nav",i+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==n&&(r+=" xml:lang",i=[i,c="acronym applet basefont big font strike tt"].join(" "),ti(Jr(c),(function(t){v(t,"",i)})),o=[o,u="center dir isindex noframes"].join(" "),a=[o,i].join(" "),ti(Jr(u),(function(t){v(t,"",a)}))),a=a||[o,i].join(" "),v("html","manifest","head body"),v("head","","base command link meta noscript script style title"),v("title hr noscript br"),v("base","href target"),v("link","href rel media hreflang type sizes hreflang"),v("meta","name http-equiv content charset"),v("style","media type scoped"),v("script","src async defer type charset"),v("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",a),v("address dt dd div caption","",a),v("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","",i),v("blockquote","cite",a),v("ol","reversed start type","li"),v("ul","","li"),v("li","value",a),v("dl","","dt dd"),v("a","href target rel media hreflang type",i),v("q","cite",i),v("ins del","cite datetime",a),v("img","src sizes srcset alt usemap ismap width height"),v("iframe","src name width height",a),v("embed","src type width height"),v("object","data type typemustmatch name usemap form width height",[a,"param"].join(" ")),v("param","name value"),v("map","name",[a,"area"].join(" ")),v("area","alt coords shape href target rel media hreflang type"),v("table","border","caption colgroup thead tfoot tbody tr"+("html4"===n?" col":"")),v("colgroup","span","col"),v("col","span"),v("tbody thead tfoot","","tr"),v("tr","","td th"),v("td","colspan rowspan headers",a),v("th","colspan rowspan headers scope abbr",a),v("form","accept-charset action autocomplete enctype method name novalidate target",a),v("fieldset","disabled form name",[a,"legend"].join(" ")),v("label","form for",i),v("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"),v("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===n?a:i),v("select","disabled form multiple name required size","option optgroup"),v("optgroup","disabled label","option"),v("option","disabled label selected value"),v("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),v("menu","type label",[a,"li"].join(" ")),v("noscript","",a),"html4"!==n&&(v("wbr"),v("ruby","",[i,"rt rp"].join(" ")),v("figcaption","",a),v("mark rt rp summary bdi","",i),v("canvas","width height",a),v("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[a,"track source"].join(" ")),v("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[a,"track source"].join(" ")),v("picture","","img source"),v("source","src srcset type media sizes"),v("track","kind src srclang label default"),v("datalist","",[i,"option"].join(" ")),v("article section nav aside main header footer","",a),v("hgroup","","h1 h2 h3 h4 h5 h6"),v("figure","",[a,"figcaption"].join(" ")),v("time","datetime",i),v("dialog","open",a),v("command","type label icon disabled checked radiogroup command"),v("output","for form name",i),v("progress","value max",i),v("meter","value min max low high optimum",i),v("details","open",[a,"summary"].join(" ")),v("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==n&&(b("script","language xml:space"),b("style","xml:space"),b("object","declare classid code codebase codetype archive standby align border hspace vspace"),b("embed","align name hspace vspace"),b("param","valuetype type"),b("a","charset name rev shape coords"),b("br","clear"),b("applet","codebase archive code object alt name width height align hspace vspace"),b("img","name longdesc align border hspace vspace"),b("iframe","longdesc frameborder marginwidth marginheight scrolling align"),b("font basefont","size color face"),b("input","usemap align"),b("select"),b("textarea"),b("h1 h2 h3 h4 h5 h6 div p legend caption","align"),b("ul","type compact"),b("li","type"),b("ol dl menu dir","compact"),b("pre","width xml:space"),b("hr","align noshade size width"),b("isindex","prompt"),b("table","summary width frame rules cellspacing cellpadding align bgcolor"),b("col","width align char charoff valign"),b("colgroup","width align char charoff valign"),b("thead","align char charoff valign"),b("tr","align char charoff valign bgcolor"),b("th","axis align char charoff valign nowrap bgcolor width height"),b("form","accept"),b("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),b("tfoot","align char charoff valign"),b("tbody","align char charoff valign"),b("area","nohref"),b("body","background bgcolor text link vlink alink")),"html4"!==n&&(b("input button select textarea","autofocus"),b("input textarea","placeholder"),b("a","download"),b("link script img","crossorigin"),b("img","loading"),b("iframe","sandbox seamless allowfullscreen loading")),ti(Jr("a form meter progress dfn"),(function(t){s[t]&&delete s[t].children[t]})),delete s.caption.children.table,delete s.script,Jo[n]=s));function v(t,e,n){function o(t,e){for(var n={},r=0,o=t.length;r<o;r++)n[t[r]]=e||{};return n}var i,a;e=e||"","string"==typeof(n=n||[])&&(n=Jr(n));for(var u=Jr(t),c=u.length;c--;)a={attributes:o(i=Jr([r,e].join(" "))),attributesOrder:i,children:o(n,Qo)},s[u[c]]=a}function b(t,e){for(var n,r,o,i=Jr(t),a=i.length,u=Jr(e);a--;)for(n=s[i[a]],r=0,o=u.length;r<o;r++)n.attributes[u[r]]={},n.attributesOrder.push(u[r])}!1===t.verify_html&&(t.valid_elements="*[*]");var y=to(t.valid_styles),x=to(t.invalid_styles,"map"),w=to(t.valid_classes,"map"),C=e("whitespace_elements","pre script noscript style textarea video audio iframe object code"),S=e("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),k=e("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),O=e("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),E="td th iframe video audio object script code",_=e("non_empty_elements",E+" pre",k),T=e("move_caret_before_on_enter_elements",E+" table",k),M=e("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),D=e("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",M),z=e("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp");function A(t){return new RegExp("^"+t.replace(/([?+*])/g,".$1")+"$")}function N(t){var e,n,r,o,i,a,u,c,s,f,d,g,h,p,v,b,y,x,w=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/,C=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,S=/[*?+]/;if(t){var k=Jr(t,",");for(l["@"]&&(b=l["@"].attributes,y=l["@"].attributesOrder),e=0,n=k.length;e<n;e++)if(i=w.exec(k[e])){if(p=i[1],s=i[2],v=i[3],c=i[5],a={attributes:g={},attributesOrder:h=[]},"#"===p&&(a.paddEmpty=!0),"-"===p&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),b&&(nt(b,(function(t,e){g[e]=t})),h.push.apply(h,y)),c)for(r=0,o=(c=Jr(c,"|")).length;r<o;r++)(i=C.exec(c[r]))&&(u={},d=i[1],f=i[2].replace(/[\\:]:/g,":"),p=i[3],x=i[4],"!"===d&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(f),u.required=!0),"-"!==d?(p&&("="===p&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:f,value:x}),u.defaultValue=x),":"===p&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:f,value:x}),u.forcedValue=x),"<"===p&&(u.validValues=Zo(x,"?"))),S.test(f)?(a.attributePatterns=a.attributePatterns||[],u.pattern=A(f),a.attributePatterns.push(u)):(g[f]||h.push(f),g[f]=u)):(delete g[f],h.splice(ri(h,f),1)));b||"@"!==s||(b=g,y=h),v&&(a.outputName=s,l[v]=a),S.test(s)?(a.pattern=A(s),m.push(a)):l[s]=a}}}function B(t){l={},m=[],N(t),ti(p,(function(t,e){d[e]=t.children}))}function R(t){var e=/^(~)?(.+)$/;t&&(Jo.text_block_elements=Jo.block_elements=null,ti(Jr(t,","),(function(t){var n,r=e.exec(t),o="~"===r[1],i=o?"span":"div",a=r[2];d[a]=d[i],g[a]=i,o||(D[a.toUpperCase()]={},D[a]={}),l[a]||(n=l[i],delete(n=ei({},n)).removeEmptyAttrs,delete n.removeEmpty,l[a]=n),ti(d,(function(t,e){t[i]&&(d[e]=t=ei({},d[e]),t[a]=t[i])}))})))}function H(e){var n=/^([+\-]?)([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]+)\[([^\]]+)]$/;Jo[t.schema]=null,e&&ti(Jr(e,","),(function(t){var e,r,o=n.exec(t);o&&(r=o[1],e=r?d[o[2]]:d[o[2]]={"#comment":{}},e=d[o[2]],ti(Jr(o[3],"|"),(function(t){"-"===r?delete e[t]:e[t]={}})))}))}function V(t){var e,n=l[t];if(n)return n;for(e=m.length;e--;)if((n=m[e]).pattern.test(t))return n}ti((t.special||"script noscript iframe noframes noembed title style textarea xmp").split(" "),(function(t){h[t]=new RegExp("</"+t+"[^>]*>","gi")})),t.valid_elements?B(t.valid_elements):(ti(p,(function(t,e){l[e]={attributes:t.attributes,attributesOrder:t.attributesOrder},d[e]=t.children})),"html5"!==t.schema&&ti(Jr("strong/b em/i"),(function(t){var e=Jr(t,"/");l[e[1]].outputName=e[0]})),ti(z,(function(e,n){l[n]&&(t.padd_empty_block_inline_children&&(l[n].paddInEmptyBlock=!0),l[n].removeEmpty=!0)})),ti(Jr("ol ul blockquote a table tbody"),(function(t){l[t]&&(l[t].removeEmpty=!0)})),ti(Jr("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),(function(t){l[t].paddEmpty=!0})),ti(Jr("span"),(function(t){l[t].removeEmptyAttrs=!0}))),R(t.custom_elements),H(t.valid_children),N(t.extended_valid_elements),H("+ol[ul|ol],+ul[ul|ol]"),ti({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"},(function(t,e){l[e]&&(l[e].parentsRequired=Jr(t))})),t.invalid_elements&&ti(ni(t.invalid_elements),(function(t){l[t]&&delete l[t]})),V("span")||N("span[!data-mce-type|*]");var I=f(y),L=f(x),F=f(w),P=f(O),U=f(D),j=f(M),W=f(z),q=f(k),G=f(S),$=f(_),X=f(T),K=f(C),Y=f(h),J=f(g);return{children:d,elements:l,getValidStyles:I,getValidClasses:F,getBlockElements:U,getInvalidStyles:L,getShortEndedElements:q,getTextBlockElements:j,getTextInlineElements:W,getBoolAttrs:P,getElementRule:V,getSelfClosingElements:G,getNonEmptyElements:$,getMoveCaretBeforeOnEnterElements:X,getWhiteSpaceElements:K,getSpecialElements:Y,isValidChild:function(t,e){var n=d[t.toLowerCase()];return!(!n||!n[e.toLowerCase()])},isValid:function(t,e){var n,r,o=V(t);if(o){if(!e)return!0;if(o.attributes[e])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(t))return!0}return!1},getCustomElements:J,addValidElements:N,setValidElements:B,addCustomElements:R,addValidChildren:H}}function no(t,e,n,r){function o(t){return 1<(t=parseInt(t,10).toString(16)).length?t:"0"+t}return"#"+o(e)+o(n)+o(r)}function ro(t,e){var n,r,o=this,i=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,a=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,u=/\s*([^:]+):\s*([^;]+);?/g,c=/\s+$/,s={},l=bo;t=t||{},e&&(n=e.getValidStyles(),r=e.getInvalidStyles());for(var f=("\\\" \\' \\; \\: ; : "+l).split(" "),d=0;d<f.length;d++)s[f[d]]=l+d,s[l+d]=f[d];return{toHex:function(t){return t.replace(i,no)},parse:function(e){function n(t,e,n){var r=k[t+"-top"+e];if(r){var o=k[t+"-right"+e];if(o){var i=k[t+"-bottom"+e];if(i){var a=k[t+"-left"+e];if(a){var u=[r,o,i,a];for(d=u.length-1;d--&&u[d]===u[d+1];);-1<d&&n||(k[t+e]=-1===d?u[0]:u.join(" "),delete k[t+"-top"+e],delete k[t+"-right"+e],delete k[t+"-bottom"+e],delete k[t+"-left"+e])}}}}}function r(t){var e,n=k[t];if(n){for(e=(n=n.split(" ")).length;e--;)if(n[e]!==n[0])return;return k[t]=n[0],1}}function f(t){return x=!0,s[t]}function m(t,e){return x&&(t=t.replace(/\uFEFF[0-9]/g,(function(t){return s[t]}))),e?t:t.replace(/\\([\'\";:])/g,"$1")}function g(t){return String.fromCharCode(parseInt(t.slice(1),16))}function h(t){return t.replace(/\\[0-9a-f]+/gi,g)}function p(e,n,r,o,i,a){if(i=i||a)return"'"+(i=m(i)).replace(/\'/g,"\\'")+"'";if(n=m(n||r||o),!t.allow_script_urls){var u=n.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(u))return"";if(!t.allow_svg_data_urls&&/^data:image\/svg/i.test(u))return""}return"url('"+(n=O?O.call(E,n,"style"):n).replace(/\'/g,"\\'")+"')"}var v,b,y,x,w,C,S,k={},O=t.url_converter,E=t.url_converter_scope||o;if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,(function(t){return t.replace(/[;:]/g,f)}));v=u.exec(e);)u.lastIndex=v.index+v[0].length,b=v[1].replace(c,"").toLowerCase(),y=v[2].replace(c,""),b&&y&&(b=h(b),y=h(y),-1===b.indexOf(l)&&-1===b.indexOf('"')&&(t.allow_script_urls||"behavior"!==b&&!/expression\s*\(|\/\*|\*\//.test(y))&&("font-weight"===b&&"700"===y?y="bold":"color"!==b&&"background-color"!==b||(y=y.toLowerCase()),y=(y=y.replace(i,no)).replace(a,p),k[b]=x?m(y,!0):y));n("border","",!0),n("border","-width"),n("border","-color"),n("border","-style"),n("padding",""),n("margin",""),C="border-style",S="border-color",r(w="border-width")&&r(C)&&r(S)&&(k.border=k[w]+" "+k[C]+" "+k[S],delete k[w],delete k[C],delete k[S]),"medium none"===k.border&&delete k.border,"none"===k["border-image"]&&delete k["border-image"]}return k},serialize:function(t,e){function o(e){var r,o=n[e];if(o)for(var a=0,u=o.length;a<u;a++)e=o[a],(r=t[e])&&(i+=(0<i.length?" ":"")+e+": "+r+";")}var i="";return e&&n?(o("*"),o(e)):nt(t,(function(t,n){var o;!t||r&&((o=r["*"])&&o[n]||(o=r[e])&&o[n])||(i+=(0<i.length?" ":"")+n+": "+t+";")})),i}}}function oo(t){return t instanceof Event||S(t.initEvent)}function io(t,e,n,r){var o,i,c=function(t){var e,n=null!=r?r:{};for(e in t)Ot(oi,e)||(n[e]=t[e]);return u(n.composedPath)&&(n.composedPath=function(){return t.composedPath()}),n}(e);return c.type=t,a(c.target)&&(c.target=null!==(o=c.srcElement)&&void 0!==o?o:n),(a((i=e).preventDefault)||oo(i))&&(c.preventDefault=function(){c.defaultPrevented=!0,c.isDefaultPrevented=z,S(e.preventDefault)?e.preventDefault():oo(e)&&(e.returnValue=!1)},c.stopPropagation=function(){c.cancelBubble=!0,c.isPropagationStopped=z,S(e.stopPropagation)?e.stopPropagation():oo(e)&&(e.cancelBubble=!0)},c.stopImmediatePropagation=function(){c.isImmediatePropagationStopped=z,c.stopPropagation()},c.isDefaultPrevented!==z&&c.isDefaultPrevented!==D&&(c.isDefaultPrevented=!0===c.defaultPrevented?z:D,c.isPropagationStopped=!0===c.cancelBubble?z:D,c.isImmediatePropagationStopped=D)),c}function ao(t,e,n,r){t.addEventListener?t.addEventListener(e,n,r||!1):t.attachEvent&&t.attachEvent("on"+e,n)}function uo(t,e,n,r){t.removeEventListener?t.removeEventListener(e,n,r||!1):t.detachEvent&&t.detachEvent("on"+e,n)}function co(t,e){var n,r,o,i,a=io(t.type,t,document,e);return u(i=t)&&ii.test(i.type)&&C(t.pageX)&&!C(t.clientX)&&(r=(n=a.target.ownerDocument||document).documentElement,o=n.body,a.pageX=t.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),a.pageY=t.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),C(a.metaKey)&&(a.metaKey=!1),a}var so=Mr(["h1","h2","h3","h4","h5","h6"]),lo=Mr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),fo=Mr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),mo=Mr(["ul","ol","dl"]),go=Mr(["li","dd","dt"]),ho=Mr(["thead","tbody","tfoot"]),po=Mr(["td","th"]),vo=Mr(["pre","script","textarea","style"]),bo="\ufeff",yo=" ",xo=bo,wo=function(t){return t===bo},Co=function(t){return t.replace(/\uFEFF/g,"")},So=Ln,ko=Pn,Oo=function(t){return ko(t)&&t.data[0]===xo},Eo=function(t){return ko(t)&&t.data[t.data.length-1]===xo},_o=$n,To=Xn,Mo=qn,Do=Pn,zo=on(["script","style","textarea"]),Ao=on(["img","input","textarea","hr","iframe","video","audio","object","embed"]),No=on(["table"]),Bo=Br,Ro=function(t){return!1===(Ln(e=t)&&"true"===e.getAttribute("unselectable"))&&To(t);var e},Ho=/^[ \t\r\n]*$/,Vo=un("data-mce-bookmark"),Io=un("data-mce-bogus"),Lo=function(t){return Ln(t)&&"all"===t.getAttribute("data-mce-bogus")},Fo=function(t,e,n){var r=n||e;if(Ln(e)&&Gr(e))return e;for(var o,i,a,u,c,s,l,f,d,m,g,h=e.childNodes,p=h.length-1;0<=p;p--)Fo(t,h[p],r);return!Ln(e)||1===(o=e.childNodes).length&&Gr(o[0])&&e.parentNode.insertBefore(o[0],e),Wn(a=e)||jn(a)||jr(e,r)||Ln(i=e)&&0<i.childNodes.length||(c=r,Pn(u=e)&&0<u.data.length&&(f=new _r(s=u,l=c).prev(!1),d=new _r(s,l).next(!1),m=C(f)||qr(f,l),g=C(d)||qr(d,l),m&&g))||t.remove(e),e},Po=ke.makeMap,Uo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,jo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\"\']/g,qo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Go={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:"Ÿ"},$o={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Xo={"<":"<",">":">","&":"&",""":'"',"'":"'"},Ko=$r("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),Yo={encodeRaw:Xr,encodeAllRaw:function(t){return(""+t).replace(Wo,(function(t){return $o[t]||t}))},encodeNumeric:Kr,encodeNamed:Yr,getEncodeFunc:function(t,e){var n=$r(e)||Ko,r=Po(t.replace(/\+/g,","));return r.named&&r.numeric?function(t,e){return t.replace(e?Uo:jo,(function(t){return void 0!==$o[t]?$o[t]:void 0!==n[t]?n[t]:1<t.length?"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";":"&#"+t.charCodeAt(0)+";"}))}:r.named?e?function(t,e){return Yr(t,e,n)}:Yr:r.numeric?Kr:Xr},decode:function(t){return t.replace(qo,(function(t,e){return e?65535<(e="x"===e.charAt(0).toLowerCase()?parseInt(e.substr(1),16):parseInt(e,10))?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):Go[e]||String.fromCharCode(e):Xo[t]||Ko[t]||(n=t,(r=Oe.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r}))}},Jo={},Qo={},Zo=ke.makeMap,ti=ke.each,ei=ke.extend,ni=ke.explode,ri=ke.inArray,oi={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},ii=/^(?:mouse|contextmenu)|click/,ai=(ui.prototype.bind=function(t,e,n,r){function o(t){f.executeHandlers(co(t||d.event),i)}var i,a,u,c,s,l,f=this,d=window;if(t&&3!==t.nodeType&&8!==t.nodeType){t[f.expando]?i=t[f.expando]:(i=f.count++,t[f.expando]=i,f.events[i]={}),r=r||t;for(var m=e.split(" "),g=m.length;g--;)s=o,c=l=!1,"DOMContentLoaded"===(u=m[g])&&(u="ready"),f.domLoaded&&"ready"===u&&"complete"===t.readyState?n.call(r,co({type:u})):(f.hasMouseEnterLeave||(c=f.mouseEnterLeave[u])&&(s=function(t){var e=t.currentTarget,n=t.relatedTarget;if(n&&e.contains)n=e.contains(n);else for(;n&&n!==e;)n=n.parentNode;n||((t=co(t||d.event)).type="mouseout"===t.type?"mouseleave":"mouseenter",t.target=e,f.executeHandlers(t,i))}),f.hasFocusIn||"focusin"!==u&&"focusout"!==u||(l=!0,c="focusin"===u?"focus":"blur",s=function(t){(t=co(t||d.event)).type="focus"===t.type?"focusin":"focusout",f.executeHandlers(t,i)}),(a=f.events[i][u])?"ready"===u&&f.domLoaded?n(co({type:u})):a.push({func:n,scope:r}):(f.events[i][u]=a=[{func:n,scope:r}],a.fakeName=c,a.capture=l,a.nativeHandler=s,"ready"===u?function(t,e,n){var r,o=t.document,i={type:"ready"};n.domLoaded?e(i):(r=function(){uo(t,"DOMContentLoaded",r),uo(t,"load",r),n.domLoaded||(n.domLoaded=!0,e(i)),t=null},"complete"===o.readyState||"interactive"===o.readyState&&o.body?r():ao(t,"DOMContentLoaded",r),n.domLoaded||ao(t,"load",r))}(t,s,f):ao(t,c||u,s,l)));return t=a=null,n}},ui.prototype.unbind=function(t,e,n){var r,o,i;if(!t||3===t.nodeType||8===t.nodeType)return this;var a=t[this.expando];if(a){if(i=this.events[a],e){for(var u,c,s,l,f=e.split(" "),d=f.length;d--;)if(l=i[o=f[d]]){if(n)for(r=l.length;r--;)l[r].func===n&&(u=l.nativeHandler,c=l.fakeName,s=l.capture,(l=l.slice(0,r).concat(l.slice(r+1))).nativeHandler=u,l.fakeName=c,l.capture=s,i[o]=l);n&&0!==l.length||(delete i[o],uo(t,l.fakeName||o,l.nativeHandler,l.capture))}}else nt(i,(function(e,n){uo(t,e.fakeName||n,e.nativeHandler,e.capture)})),i={};for(o in i)if(Ot(i,o))return this;delete this.events[a];try{delete t[this.expando]}catch(e){t[this.expando]=null}}return this},ui.prototype.fire=function(t,e,n){var r;if(!t||3===t.nodeType||8===t.nodeType)return this;for(var o=co({type:e,target:t},n);(r=t[this.expando])&&this.executeHandlers(o,r),(t=t.parentNode||t.ownerDocument||t.defaultView||t.parentWindow)&&!o.isPropagationStopped(););return this},ui.prototype.clean=function(t){var e,n;if(!t||3===t.nodeType||8===t.nodeType)return this;if(t[this.expando]&&this.unbind(t),(t=t.getElementsByTagName?t:t.document)&&t.getElementsByTagName)for(this.unbind(t),e=(n=t.getElementsByTagName("*")).length;e--;)(t=n[e])[this.expando]&&this.unbind(t);return this},ui.prototype.destroy=function(){this.events={}},ui.prototype.cancel=function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),!1},ui.prototype.executeHandlers=function(t,e){var n=this.events[e],r=n&&n[t.type];if(r)for(var o=0,i=r.length;o<i;o++){var a=r[o];if(a&&!1===a.func.call(a.scope,t)&&t.preventDefault(),t.isImmediatePropagationStopped())return}},ui.Event=new ui,ui);function ui(){this.domLoaded=!1,this.events={},this.count=1,this.expando="mce-data-"+(+new Date).toString(32),this.hasMouseEnterLeave="onmouseenter"in document.documentElement,this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}function ci(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(65536+r):String.fromCharCode(r>>10|55296,1023&r|56320)}var si,li,fi,di,mi,gi,hi,pi,vi,bi,yi,xi,wi,Ci,Si,ki,Oi,Ei="sizzle"+-new Date,_i=window.document,Ti=0,Mi=0,Di=ua(),zi=ua(),Ai=ua(),Ni=function(t,e){return t===e&&(bi=!0),0},Bi="undefined",Ri={}.hasOwnProperty,Hi=[],Vi=Hi.pop,Ii=Hi.push,Li=Hi.push,Fi=Hi.slice,Pi=Hi.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(this[e]===t)return e;return-1},Ui="[\\x20\\t\\r\\n\\f]",ji="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",Wi="\\["+Ui+"*("+ji+")(?:"+Ui+"*([*^$|!~]?=)"+Ui+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ji+"))|)"+Ui+"*\\]",qi=":("+ji+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+Wi+")*)|.*)\\)|)",Gi=new RegExp("^"+Ui+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Ui+"+$","g"),$i=new RegExp("^"+Ui+"*,"+Ui+"*"),Xi=new RegExp("^"+Ui+"*([>+~]|"+Ui+")"+Ui+"*"),Ki=new RegExp("="+Ui+"*([^\\]'\"]*?)"+Ui+"*\\]","g"),Yi=new RegExp(qi),Ji=new RegExp("^"+ji+"$"),Qi={ID:new RegExp("^#("+ji+")"),CLASS:new RegExp("^\\.("+ji+")"),TAG:new RegExp("^("+ji+"|[*])"),ATTR:new RegExp("^"+Wi),PSEUDO:new RegExp("^"+qi),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Ui+"*(even|odd|(([+-]|)(\\d*)n|)"+Ui+"*(?:([+-]|)"+Ui+"*(\\d+)|))"+Ui+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+Ui+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Ui+"*((?:-\\d)?\\d*)"+Ui+"*\\)|)(?=[^-]|$)","i")},Zi=/^(?:input|select|textarea|button)$/i,ta=/^h\d$/i,ea=/^[^{]+\{\s*\[native \w/,na=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ra=/[+~]/,oa=/'|\\/g,ia=new RegExp("\\\\([\\da-f]{1,6}"+Ui+"?|("+Ui+")|.)","ig");try{Li.apply(Hi=Fi.call(_i.childNodes),_i.childNodes),Hi[_i.childNodes.length].nodeType}catch(r){Li={apply:Hi.length?function(t,e){Ii.apply(t,Fi.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}var aa=function(t,e,n,r){var o,i,a,u,c,s,l,f,d,m;if((e?e.ownerDocument||e:_i)!==xi&&yi(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(u=(e=e||xi).nodeType)&&9!==u)return[];if(Ci&&!r){if(o=na.exec(t))if(a=o[1]){if(9===u){if(!(i=e.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&Oi(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return Li.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&si.getElementsByClassName)return Li.apply(n,e.getElementsByClassName(a)),n}if(si.qsa&&(!Si||!Si.test(t))){if(f=l=Ei,d=e,m=9===u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(s=mi(t),(l=e.getAttribute("id"))?f=l.replace(oa,"\\$&"):e.setAttribute("id",f),f="[id='"+f+"'] ",c=s.length;c--;)s[c]=f+ma(s[c]);d=ra.test(t)&&fa(e.parentNode)||e,m=s.join(",")}if(m)try{return Li.apply(n,d.querySelectorAll(m)),n}catch(t){}finally{l||e.removeAttribute("id")}}}return hi(t.replace(Gi,"$1"),e,n,r)};function ua(){var t=[];return function e(n,r){return t.push(n+" ")>li.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function ca(t){return t[Ei]=!0,t}function sa(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function la(t){return ca((function(e){return e=+e,ca((function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function fa(t){return t&&typeof t.getElementsByTagName!=Bi&&t}function da(){}function ma(t){for(var e=0,n=t.length,r="";e<n;e++)r+=t[e].value;return r}function ga(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=Mi++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,a){var u,c,s=[Ti,i];if(a){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if((u=(c=e[Ei]||(e[Ei]={}))[r])&&u[0]===Ti&&u[1]===i)return s[2]=u[2];if((c[r]=s)[2]=t(e,n,a))return!0}}}function ha(t){return 1<t.length?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function pa(t,e,n,r,o){for(var i,a=[],u=0,c=t.length,s=null!=e;u<c;u++)(i=t[u])&&(n&&!n(i,r,o)||(a.push(i),s&&e.push(u)));return a}function va(t){return void 0!==t}function ba(t){return"string"==typeof t}function ya(t,e){var n,r=(e=e||Ea).createElement("div"),o=e.createDocumentFragment();for(r.innerHTML=t;n=r.firstChild;)o.appendChild(n);return o}function xa(t,e){return t&&e&&-1!==(" "+t.className+" ").indexOf(" "+e+" ")}function wa(t,e,n){var r,o;return e=Ga(e)[0],t.each((function(){n&&r===this.parentNode||(r=this.parentNode,o=e.cloneNode(!1),this.parentNode.insertBefore(o,this)),o.appendChild(this)})),t}function Ca(t,e){return new Ga.fn.init(t,e)}function Sa(t){return null==t?"":(""+t).replace(La,"")}function ka(t,e){var n,r,o,i;if(t)if(void 0===(n=t.length)){for(r in t)if(t.hasOwnProperty(r)&&(i=t[r],!1===e.call(i,r,i)))break}else for(o=0;o<n&&(i=t[o],!1!==e.call(i,o,i));o++);return t}function Oa(t,e){var n=[];return ka(t,(function(t,r){e(r,t)&&n.push(r)})),n}si=aa.support={},di=aa.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},yi=aa.setDocument=function(t){var e,n=t?t.ownerDocument||t:_i,r=n.defaultView;return n!==xi&&9===n.nodeType&&n.documentElement?(wi=(xi=n).documentElement,Ci=!di(n),r&&r!==function(t){try{return t.top}catch(t){}return null}(r)&&(r.addEventListener?r.addEventListener("unload",(function(){yi()}),!1):r.attachEvent&&r.attachEvent("onunload",(function(){yi()}))),si.attributes=!0,si.getElementsByTagName=!0,si.getElementsByClassName=ea.test(n.getElementsByClassName),si.getById=!0,li.find.ID=function(t,e){if(typeof e.getElementById!=Bi&&Ci){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},li.filter.ID=function(t){var e=t.replace(ia,ci);return function(t){return t.getAttribute("id")===e}},li.find.TAG=si.getElementsByTagName?function(t,e){if(typeof e.getElementsByTagName!=Bi)return e.getElementsByTagName(t)}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"!==t)return i;for(;n=i[o++];)1===n.nodeType&&r.push(n);return r},li.find.CLASS=si.getElementsByClassName&&function(t,e){if(Ci)return e.getElementsByClassName(t)},ki=[],Si=[],si.disconnectedMatch=!0,Si=Si.length&&new RegExp(Si.join("|")),ki=ki.length&&new RegExp(ki.join("|")),e=ea.test(wi.compareDocumentPosition),Oi=e||ea.test(wi.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},Ni=e?function(t,e){return t===e?(bi=!0,0):(r=!t.compareDocumentPosition-!e.compareDocumentPosition)||(1&(r=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!si.sortDetached&&e.compareDocumentPosition(t)===r?t===n||t.ownerDocument===_i&&Oi(_i,t)?-1:e===n||e.ownerDocument===_i&&Oi(_i,e)?1:vi?Pi.call(vi,t)-Pi.call(vi,e):0:4&r?-1:1);var r}:function(t,e){if(t===e)return bi=!0,0;var r,o=0,i=t.parentNode,a=e.parentNode,u=[t],c=[e];if(!i||!a)return t===n?-1:e===n?1:i?-1:a?1:vi?Pi.call(vi,t)-Pi.call(vi,e):0;if(i===a)return sa(t,e);for(r=t;r=r.parentNode;)u.unshift(r);for(r=e;r=r.parentNode;)c.unshift(r);for(;u[o]===c[o];)o++;return o?sa(u[o],c[o]):u[o]===_i?-1:c[o]===_i?1:0},n):xi},aa.matches=function(t,e){return aa(t,null,null,e)},aa.matchesSelector=function(t,e){if((t.ownerDocument||t)!==xi&&yi(t),e=e.replace(Ki,"='$1']"),si.matchesSelector&&Ci&&(!ki||!ki.test(e))&&(!Si||!Si.test(e)))try{var n=(void 0).call(t,e);if(n||si.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return 0<aa(e,xi,null,[t]).length},aa.contains=function(t,e){return(t.ownerDocument||t)!==xi&&yi(t),Oi(t,e)},aa.attr=function(t,e){(t.ownerDocument||t)!==xi&&yi(t);var n=li.attrHandle[e.toLowerCase()],r=n&&Ri.call(li.attrHandle,e.toLowerCase())?n(t,e,!Ci):void 0;return void 0!==r?r:si.attributes||!Ci?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},aa.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},aa.uniqueSort=function(t){var e,n=[],r=0,o=0;if(bi=!si.detectDuplicates,vi=!si.sortStable&&t.slice(0),t.sort(Ni),bi){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return vi=null,t},fi=aa.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=fi(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=fi(e);return n},(li=aa.selectors={cacheLength:50,createPseudo:ca,match:Qi,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(ia,ci),t[3]=(t[3]||t[4]||t[5]||"").replace(ia,ci),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||aa.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&aa.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Qi.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Yi.test(n)&&(e=mi(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(ia,ci).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=Di[t+" "];return e||(e=new RegExp("(^|"+Ui+")"+t+"("+Ui+"|$)"))&&Di(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!=Bi&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=aa.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&-1<o.indexOf(n):"$="===e?n&&o.slice(-n.length)===n:"~="===e?-1<(" "+o+" ").indexOf(n):"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,c){var s,l,f,d,m,g,h=i!=a?"nextSibling":"previousSibling",p=e.parentNode,v=u&&e.nodeName.toLowerCase(),b=!c&&!u;if(p){if(i){for(;h;){for(f=e;f=f[h];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;g=h="only"===t&&!g&&"nextSibling"}return!0}if(g=[a?p.firstChild:p.lastChild],a&&b){for(m=(s=(l=p[Ei]||(p[Ei]={}))[t]||[])[0]===Ti&&s[1],d=s[0]===Ti&&s[2],f=m&&p.childNodes[m];f=++m&&f&&f[h]||(d=m=0)||g.pop();)if(1===f.nodeType&&++d&&f===e){l[t]=[Ti,m,d];break}}else if(b&&(s=(e[Ei]||(e[Ei]={}))[t])&&s[0]===Ti)d=s[1];else for(;(f=++m&&f&&f[h]||(d=m=0)||g.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(b&&((f[Ei]||(f[Ei]={}))[t]=[Ti,d]),f!==e)););return(d-=o)===r||d%r==0&&0<=d/r}}},PSEUDO:function(t,e){var n,r=li.pseudos[t]||li.setFilters[t.toLowerCase()]||aa.error("unsupported pseudo: "+t);return r[Ei]?r(e):1<r.length?(n=[t,t,"",e],li.setFilters.hasOwnProperty(t.toLowerCase())?ca((function(t,n){for(var o,i=r(t,e),a=i.length;a--;)t[o=Pi.call(t,i[a])]=!(n[o]=i[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:ca((function(t){var e=[],n=[],r=gi(t.replace(Gi,"$1"));return r[Ei]?ca((function(t,e,n,o){for(var i,a=r(t,null,o,[]),u=t.length;u--;)(i=a[u])&&(t[u]=!(e[u]=i))})):function(t,o,i){return e[0]=t,r(e,null,i,n),e[0]=null,!n.pop()}})),has:ca((function(t){return function(e){return 0<aa(t,e).length}})),contains:ca((function(t){return t=t.replace(ia,ci),function(e){return-1<(e.textContent||e.innerText||fi(e)).indexOf(t)}})),lang:ca((function(t){return Ji.test(t||"")||aa.error("unsupported lang: "+t),t=t.replace(ia,ci).toLowerCase(),function(e){var n;do{if(n=Ci?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=window.location&&window.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===wi},focus:function(t){return t===xi.activeElement&&(!xi.hasFocus||xi.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!li.pseudos.empty(t)},header:function(t){return ta.test(t.nodeName)},input:function(t){return Zi.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:la((function(){return[0]})),last:la((function(t,e){return[e-1]})),eq:la((function(t,e,n){return[n<0?n+e:n]})),even:la((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:la((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:la((function(t,e,n){for(var r=n<0?n+e:n;0<=--r;)t.push(r);return t})),gt:la((function(t,e,n){for(var r=n<0?n+e:n;++r<e;)t.push(r);return t}))}}).pseudos.nth=li.pseudos.eq,I(["radio","checkbox","file","password","image"],(function(t){var e;li.pseudos[t]=(e=t,function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e})})),I(["submit","reset"],(function(t){var e;li.pseudos[t]=(e=t,function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e})})),da.prototype=li.filters=li.pseudos,li.setFilters=new da,mi=aa.tokenize=function(t,e){var n,r,o,i,a,u,c,s=zi[t+" "];if(s)return e?0:s.slice(0);for(a=t,u=[],c=li.preFilter;a;){for(i in n&&!(r=$i.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=Xi.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Gi," ")}),a=a.slice(n.length)),li.filter)li.filter.hasOwnProperty(i)&&(!(r=Qi[i].exec(a))||c[i]&&!(r=c[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length)));if(!n)break}return e?a.length:a?aa.error(t):zi(t,u).slice(0)},gi=aa.compile=function(t,e){var n,r,o,i,a,u=[],c=[],s=Ai[t+" "];if(!s){for(n=(e=e||mi(t)).length;n--;)((s=function t(e){for(var n,r,o,i=e.length,a=li.relative[e[0].type],u=a||li.relative[" "],c=a?1:0,s=ga((function(t){return t===n}),u,!0),l=ga((function(t){return-1<Pi.call(n,t)}),u,!0),f=[function(t,e,r){var o=!a&&(r||e!==pi)||((n=e).nodeType?s:l)(t,e,r);return n=null,o}];c<i;c++)if(r=li.relative[e[c].type])f=[ga(ha(f),r)];else{if((r=li.filter[e[c].type].apply(null,e[c].matches))[Ei]){for(o=++c;o<i&&!li.relative[e[o].type];o++);return function t(e,n,r,o,i,a){return o&&!o[Ei]&&(o=t(o)),i&&!i[Ei]&&(i=t(i,a)),ca((function(t,a,u,c){var s,l,f,d=[],m=[],g=a.length,h=t||function(t,e,n){for(var r=0,o=e.length;r<o;r++)aa(t,e[r],n);return n}(n||"*",u.nodeType?[u]:u,[]),p=!e||!t&&n?h:pa(h,d,e,u,c),v=r?i||(t?e:g||o)?[]:a:p;if(r&&r(p,v,u,c),o)for(s=pa(v,m),o(s,[],u,c),l=s.length;l--;)(f=s[l])&&(v[m[l]]=!(p[m[l]]=f));if(t){if(i||e){if(i){for(s=[],l=v.length;l--;)(f=v[l])&&s.push(p[l]=f);i(null,v=[],s,c)}for(l=v.length;l--;)(f=v[l])&&-1<(s=i?Pi.call(t,f):d[l])&&(t[s]=!(a[s]=f))}}else v=pa(v===a?v.splice(g,v.length):v),i?i(null,a,v,c):Li.apply(a,v)}))}(1<c&&ha(f),1<c&&ma(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(Gi,"$1"),r,c<o&&t(e.slice(c,o)),o<i&&t(e=e.slice(o)),o<i&&ma(e))}f.push(r)}return ha(f)}(e[n]))[Ei]?u:c).push(s);(s=Ai(t,(r=c,i=0<(o=u).length,a=0<r.length,i?ca(l):l))).selector=t}function l(t,e,n,u,c){var s,l,f,d=0,m="0",g=t&&[],h=[],p=pi,v=t||a&&li.find.TAG("*",c),b=Ti+=null==p?1:Math.random()||.1,y=v.length;for(c&&(pi=e!==xi&&e);m!==y&&null!=(s=v[m]);m++){if(a&&s){for(l=0;f=r[l++];)if(f(s,e,n)){u.push(s);break}c&&(Ti=b)}i&&((s=!f&&s)&&d--,t&&g.push(s))}if(d+=m,i&&m!==d){for(l=0;f=o[l++];)f(g,h,e,n);if(t){if(0<d)for(;m--;)g[m]||h[m]||(h[m]=Vi.call(u));h=pa(h)}Li.apply(u,h),c&&!t&&0<h.length&&1<d+o.length&&aa.uniqueSort(u)}return c&&(Ti=b,pi=p),g}return s},hi=aa.select=function(t,e,n,r){var o,i,a,u,c,s="function"==typeof t&&t,l=!r&&mi(t=s.selector||t);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&si.getById&&9===e.nodeType&&Ci&&li.relative[i[1].type]){if(!(e=(li.find.ID(a.matches[0].replace(ia,ci),e)||[])[0]))return n;s&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=Qi.needsContext.test(t)?0:i.length;o--&&(a=i[o],!li.relative[u=a.type]);)if((c=li.find[u])&&(r=c(a.matches[0].replace(ia,ci),ra.test(i[0].type)&&fa(e.parentNode)||e))){if(i.splice(o,1),!(t=r.length&&ma(i)))return Li.apply(n,r),n;break}}return(s||gi(t,l))(r,e,!Ci,n,ra.test(t)&&fa(e.parentNode)||e),n},si.sortStable=Ei.split("").sort(Ni).join("")===Ei,si.detectDuplicates=!!bi,yi(),si.sortDetached=!0;var Ea=document,_a=Array.prototype.push,Ta=Array.prototype.slice,Ma=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Da=ai.Event,za=ke.makeMap("children,contents,next,prev"),Aa=function(t,e,n,r){var o;if(ba(e))e=ya(e,Fa(t[0]));else if(e.length&&!e.nodeType){if(e=Ga.makeArray(e),r)for(o=e.length-1;0<=o;o--)Aa(t,e[o],n,r);else for(o=0;o<e.length;o++)Aa(t,e[o],n,r);return t}if(e.nodeType)for(o=t.length;o--;)n.call(t[o],e);return t},Na=ke.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),Ba=ke.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),Ra={for:"htmlFor",class:"className",readonly:"readOnly"},Ha={float:"cssFloat"},Va={},Ia={},La=/^\s*|\s*$/g,Fa=function(t){return t?9===t.nodeType?t:t.ownerDocument:Ea};function Pa(t,e,n){var r=[],o=t[e];for("string"!=typeof n&&n instanceof Ga&&(n=n[0]);o&&9!==o.nodeType;){if(void 0!==n){if(o===n)break;if("string"==typeof n&&Ga(o).is(n))break}1===o.nodeType&&r.push(o),o=o[e]}return r}function Ua(t,e,n,r){var o=[];for(r instanceof Ga&&(r=r[0]);t;t=t[e])if(!n||t.nodeType===n){if(void 0!==r){if(t===r)break;if("string"==typeof r&&Ga(t).is(r))break}o.push(t)}return o}function ja(t,e,n){for(t=t[e];t;t=t[e])if(t.nodeType===n)return t;return null}function Wa(t,e){var n=e.attr("style"),r=t.serialize(t.parse(n),e[0].nodeName)||null;e.attr("data-mce-style",r)}function qa(t,e){var n,r,o=0;if(t)for(n=t.nodeType,t=t.previousSibling;t;t=t.previousSibling)r=t.nodeType,(!e||3!==r||r!==n&&t.nodeValue.length)&&(o++,n=r);return o}Ca.fn=Ca.prototype={constructor:Ca,selector:"",context:null,length:0,init:function(t,e){var n,r,o=this;if(!t)return o;if(t.nodeType)return o.context=o[0]=t,o.length=1,o;if(e&&e.nodeType)o.context=e;else{if(e)return Ga(t).attr(e);o.context=e=document}if(ba(t)){if(!(n="<"===(o.selector=t).charAt(0)&&">"===t.charAt(t.length-1)&&3<=t.length?[null,t,null]:Ma.exec(t)))return Ga(e).find(t);if(n[1])for(r=ya(t,Fa(e)).firstChild;r;)_a.call(o,r),r=r.nextSibling;else{if(!(r=Fa(e).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(t);o.length=1,o[0]=r}}else this.add(t,!1);return o},toArray:function(){return ke.toArray(this)},add:function(t,e){var n,r;if(ba(t))return this.add(Ga(t));if(!1!==e)for(n=Ga.unique(this.toArray().concat(Ga.makeArray(t))),this.length=n.length,r=0;r<n.length;r++)this[r]=n[r];else _a.apply(this,Ga.makeArray(t));return this},attr:function(t,e){var n,r=this;if("object"==typeof t)ka(t,(function(t,e){r.attr(t,e)}));else{if(!va(e)){if(r[0]&&1===r[0].nodeType){if((n=Va[t])&&n.get)return n.get(r[0],t);if(Ba[t])return r.prop(t)?t:void 0;null===(e=r[0].getAttribute(t,2))&&(e=void 0)}return e}this.each((function(){var n;1===this.nodeType&&((n=Va[t])&&n.set?n.set(this,e):null===e?this.removeAttribute(t,2):this.setAttribute(t,e,2))}))}return r},removeAttr:function(t){return this.attr(t,null)},prop:function(t,e){var n=this;if("object"==typeof(t=Ra[t]||t))ka(t,(function(t,e){n.prop(t,e)}));else{if(!va(e))return n[0]&&n[0].nodeType&&t in n[0]?n[0][t]:e;this.each((function(){1===this.nodeType&&(this[t]=e)}))}return n},css:function(t,e){function n(t){return t.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()}))}function r(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t}))}var o,i,a=this;if("object"==typeof t)ka(t,(function(t,e){a.css(t,e)}));else if(va(e))t=n(t),"number"!=typeof e||Na[t]||(e=e.toString()+"px"),a.each((function(){var n=this.style;if((i=Ia[t])&&i.set)i.set(this,e);else{try{this.style[Ha[t]||t]=e}catch(n){}null!==e&&""!==e||(n.removeProperty?n.removeProperty(r(t)):n.removeAttribute(t))}}));else{if(o=a[0],(i=Ia[t])&&i.get)return i.get(o);if(!o.ownerDocument.defaultView)return o.currentStyle?o.currentStyle[n(t)]:"";try{return o.ownerDocument.defaultView.getComputedStyle(o,null).getPropertyValue(r(t))}catch(n){return}}return a},remove:function(){for(var t,e=this.length;e--;)t=this[e],Da.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var t,e=this.length;e--;)for(t=this[e];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(t){var e;if(va(t)){e=this.length;try{for(;e--;)this[e].innerHTML=t}catch(n){Ga(this[e]).empty().append(t)}return this}return this[0]?this[0].innerHTML:""},text:function(t){var e;if(va(t)){for(e=this.length;e--;)"innerText"in this[e]?this[e].innerText=t:this[0].textContent=t;return this}return this[0]?this[0].innerText||this[0].textContent:""},append:function(){return Aa(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(t)}))},prepend:function(){return Aa(this,arguments,(function(t){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(t,this.firstChild)}),!0)},before:function(){return this[0]&&this[0].parentNode?Aa(this,arguments,(function(t){this.parentNode.insertBefore(t,this)})):this},after:function(){return this[0]&&this[0].parentNode?Aa(this,arguments,(function(t){this.parentNode.insertBefore(t,this.nextSibling)}),!0):this},appendTo:function(t){return Ga(t).append(this),this},prependTo:function(t){return Ga(t).prepend(this),this},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){return wa(this,t)},wrapAll:function(t){return wa(this,t,!0)},wrapInner:function(t){return this.each((function(){Ga(this).contents().wrapAll(t)})),this},unwrap:function(){return this.parent().each((function(){Ga(this).replaceWith(this.childNodes)}))},clone:function(){var t=[];return this.each((function(){t.push(this.cloneNode(!0))})),Ga(t)},addClass:function(t){return this.toggleClass(t,!0)},removeClass:function(t){return this.toggleClass(t,!1)},toggleClass:function(t,e){var n=this;return"string"!=typeof t||(-1!==t.indexOf(" ")?ka(t.split(" "),(function(){n.toggleClass(this,e)})):n.each((function(n,r){var o,i=xa(r,t);i!==e&&(o=r.className,i?r.className=Sa((" "+o+" ").replace(" "+t+" "," ")):r.className+=o?" "+t:t)}))),n},hasClass:function(t){return xa(this[0],t)},each:function(t){return ka(this,t)},on:function(t,e){return this.each((function(){Da.bind(this,t,e)}))},off:function(t,e){return this.each((function(){Da.unbind(this,t,e)}))},trigger:function(t){return this.each((function(){"object"==typeof t?Da.fire(this,t.type,t):Da.fire(this,t)}))},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return Ga(Ta.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(t){for(var e=[],n=0,r=this.length;n<r;n++)Ga.find(t,this[n],e);return Ga(e)},filter:function(t){return Ga("function"==typeof t?Oa(this.toArray(),(function(e,n){return t(n,e)})):Ga.filter(t,this.toArray()))},closest:function(t){var e=[];return t instanceof Ga&&(t=t[0]),this.each((function(n,r){for(;r;){if("string"==typeof t&&Ga(r).is(t)){e.push(r);break}if(r===t){e.push(r);break}r=r.parentNode}})),Ga(e)},offset:function(t){var e,n,r,o,i=0,a=0;return t?this.css(t):((e=this[0])&&(r=(n=e.ownerDocument).documentElement,e.getBoundingClientRect&&(i=(o=e.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:_a,sort:Array.prototype.sort,splice:Array.prototype.splice},ke.extend(Ca,{extend:ke.extend,makeArray:function(t){return t&&t===t.window||t.nodeType?[t]:ke.toArray(t)},inArray:function(t,e){var n;if(e.indexOf)return e.indexOf(t);for(n=e.length;n--;)if(e[n]===t)return n;return-1},isArray:ke.isArray,each:ka,trim:Sa,grep:Oa,find:aa,expr:aa.selectors,unique:aa.uniqueSort,text:aa.getText,contains:aa.contains,filter:function(t,e,n){var r=e.length;for(n&&(t=":not("+t+")");r--;)1!==e[r].nodeType&&e.splice(r,1);return 1===e.length?Ga.find.matchesSelector(e[0],t)?[e[0]]:[]:Ga.find.matches(t,e)}}),ka({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Pa(t,"parentNode")},next:function(t){return ja(t,"nextSibling",1)},prev:function(t){return ja(t,"previousSibling",1)},children:function(t){return Ua(t.firstChild,"nextSibling",1)},contents:function(t){return ke.toArray(("iframe"===t.nodeName?t.contentDocument||t.contentWindow.document:t).childNodes)}},(function(t,e){Ca.fn[t]=function(n){var r=[];this.each((function(){var t=e.call(r,this,n,r);t&&(Ga.isArray(t)?r.push.apply(r,t):r.push(t))})),1<this.length&&(za[t]||(r=Ga.unique(r)),0===t.indexOf("parents")&&(r=r.reverse()));var o=Ga(r);return n?o.filter(n):o}})),ka({parentsUntil:function(t,e){return Pa(t,"parentNode",e)},nextUntil:function(t,e){return Ua(t,"nextSibling",1,e).slice(1)},prevUntil:function(t,e){return Ua(t,"previousSibling",1,e).slice(1)}},(function(t,e){Ca.fn[t]=function(n,r){var o=[];this.each((function(){var t=e.call(o,this,n,o);t&&(Ga.isArray(t)?o.push.apply(o,t):o.push(t))})),1<this.length&&(o=Ga.unique(o),0!==t.indexOf("parents")&&"prevUntil"!==t||(o=o.reverse()));var i=Ga(o);return r?i.filter(r):i}})),Ca.fn.is=function(t){return!!t&&0<this.filter(t).length},Ca.fn.init.prototype=Ca.fn,Ca.overrideDefaults=function(t){var e,n=function(r,o){return e=e||t(),0===arguments.length&&(r=e.element),o=o||e.context,new n.fn.init(r,o)};return Ga.extend(n,this),n},Ca.attrHooks=Va,Ca.cssHooks=Ia;var Ga=Ca,$a=ke.each,Xa=ke.grep,Ka=we.ie,Ya=/^([a-z0-9],?)+$/i,Ja=function(t,e){function n(e){return e&&t&&v(e)?t.getElementById(e):e}function r(t){return G("string"==typeof t?n(t):t)}function o(t,e,n){var o,i,a=r(t);return void 0===(i=a.length?(o=J[e])&&o.get?o.get(a,e):a.attr(e):i)?n||"":i}function i(t){var e=n(t);return e?e.attributes:[]}function u(t,n,o){""===o&&(o=null);var i,a=r(t),u=a.attr(n);a.length&&((i=J[n])&&i.set?i.set(a,o,n):a.attr(n,o),u!==o&&e.onSetAttrib&&e.onSetAttrib({attrElm:a,attrName:n,attrValue:o}))}function s(){return e.root_element||t.body}function l(e,r){return function(t,e,n){var r,o=0,i=0,a=t.ownerDocument;if(n=n||t,e){if(n===t&&e.getBoundingClientRect&&"static"===xn(Oe.fromDom(t),"position")){var u=e.getBoundingClientRect();return{x:o=u.left+(a.documentElement.scrollLeft||t.scrollLeft)-a.documentElement.clientLeft,y:i=u.top+(a.documentElement.scrollTop||t.scrollTop)-a.documentElement.clientTop}}for(var c=e;c&&c!==n&&c.nodeType&&!kn(c,n);){var s=c;o+=s.offsetLeft||0,i+=s.offsetTop||0,c=s.offsetParent}for(c=e.parentNode;c&&c!==n&&c.nodeType&&!kn(c,n);)o-=c.scrollLeft||0,i-=c.scrollTop||0,c=c.parentNode;i+=(r=Oe.fromDom(e),Qn.isFirefox()&&"table"===Ee(r)?Sn(Mn(r)).filter((function(t){return"caption"===Ee(t)})).bind((function(t){return Sn(He(t)).map((function(e){var n=e.dom.offsetTop,r=t.dom.offsetTop,o=t.dom.offsetHeight;return n<=r?-o:0}))})).getOr(0):0)}return{x:o,y:i}}(t.body,n(e),r)}function d(t,e,n){var o=r(t);return n?o.css(e):("float"===(e=e.replace(/-(\D)/g,(function(t,e){return e.toUpperCase()})))&&(e=we.browser.isIE()?"styleFloat":"cssFloat"),o[0]&&o[0].style?o[0].style[e]:void 0)}function m(t){var e=d(t=n(t),"width"),r=d(t,"height");return-1===e.indexOf("px")&&(e=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(e,10)||t.offsetWidth||t.clientWidth,h:parseInt(r,10)||t.offsetHeight||t.clientHeight}}function g(t,e){if(!t)return!1;if(!Array.isArray(t)){if("*"===e)return 1===t.nodeType;if(Ya.test(e)){for(var n=e.toLowerCase().split(/,/),r=t.nodeName.toLowerCase(),o=n.length-1;0<=o;o--)if(n[o]===r)return!0;return!1}if(t.nodeType&&1!==t.nodeType)return!1}var i=Array.isArray(t)?t:[t];return 0<aa(e,i[0].ownerDocument||i[0],null,i).length}function h(t,e,r,o){var i,u=[],c=n(t);for(o=void 0===o,r=r||("BODY"!==s().nodeName?s().parentNode:null),ke.is(e,"string")&&(e="*"===(i=e)?function(t){return 1===t.nodeType}:function(t){return g(t,i)});c&&!(c===r||a(c.nodeType)||jn(c)||Wn(c));){if(!e||"function"==typeof e&&e(c)){if(!o)return[c];u.push(c)}c=c.parentNode}return o?u:null}function p(t,e,n){var r=e;if(t)for("string"==typeof e&&(r=function(t){return g(t,e)}),t=t[n];t;t=t[n])if("function"==typeof r&&r(t))return t;return null}function b(t,e,r){var o,i="string"==typeof t?n(t):t;return!!i&&(ke.isArray(i)&&(i.length||0===i.length)?(o=[],$a(i,(function(t,i){t&&o.push(e.call(r,"string"==typeof t?n(t):t,i))})),o):e.call(r||this,i))}function y(t,e){r(t).each((function(t,n){$a(e,(function(t,e){u(n,e,t)}))}))}function x(t,e){var n=r(t);Ka?n.each((function(t,n){if(!1!==n.canHaveHTML){for(;n.firstChild;)n.removeChild(n.firstChild);try{n.innerHTML="<br>"+e,n.removeChild(n.firstChild)}catch(t){Ga("<div></div>").html("<br>"+e).contents().slice(1).appendTo(n)}return e}})):n.html(e)}function w(e,n,r,o,i){return b(e,(function(e){var a="string"==typeof n?t.createElement(n):n;return y(a,r),o&&("string"!=typeof o&&o.nodeType?a.appendChild(o):"string"==typeof o&&x(a,o)),i?a:e.appendChild(a)}))}function C(e,n,r){return w(t.createElement(e),e,n,r,!0)}function S(t,e){var n=r(t);return(e?n.each((function(){for(var t;t=this.firstChild;)3===t.nodeType&&0===t.data.length?this.removeChild(t):this.parentNode.insertBefore(t,this)})):n).remove(),1<n.length?n.toArray():n[0]}function k(t,e,n){r(t).toggleClass(e,n).each((function(){""===this.className&&Ga(this).attr("class",null)}))}function O(t,e,n){return b(e,(function(e){return ke.is(e,"array")&&(t=t.cloneNode(!0)),n&&$a(Xa(e.childNodes),(function(e){t.appendChild(e)})),e.parentNode.replaceChild(t,e)}))}function E(t){if(Ln(t)){var e="a"===t.nodeName.toLowerCase()&&!o(t,"href")&&o(t,"id");return o(t,"name")||o(t,"data-mce-bookmark")||e?1:void 0}}function _(){return t.createRange()}function T(t){if(t&&Ln(t)){var e=t.getAttribute("data-mce-contenteditable");return e&&"inherit"!==e?e:"inherit"!==t.contentEditable?t.contentEditable:null}return null}void 0===e&&(e={});var M,D,z,A,N,B,R={},H=window,V={},L=0,F=Er.forElement(Oe.fromDom(t),{contentCssCors:e.contentCssCors,referrerPolicy:e.referrerPolicy}),P=[],U=e.schema||eo({}),j=ro({url_converter:e.url_converter,url_converter_scope:e.url_converter_scope},e.schema),W=e.ownEvents?new ai:ai.Event,q=U.getBlockElements(),G=Ga.overrideDefaults((function(){return{context:t,element:Y.getRoot()}})),$=Yo.encodeAllRaw,X=function(n,r,o,i){if(ke.isArray(n)){for(var a=n.length,u=[];a--;)u[a]=X(n[a],r,o,i);return u}return!e.collect||n!==t&&n!==H||P.push([n,r,o,i]),W.bind(n,r,o,i||Y)},K=function(e,n,r){if(ke.isArray(e)){for(var o=e.length,i=[];o--;)i[o]=K(e[o],n,r);return i}if(0<P.length&&(e===t||e===H))for(o=P.length;o--;){var a=P[o];e!==a[0]||n&&n!==a[1]||r&&r!==a[2]||W.unbind(a[0],a[1],a[2])}return W.unbind(e,n,r)},Y={doc:t,settings:e,win:H,files:V,stdMode:!0,boxModel:!0,styleSheetLoader:F,boundEvents:P,styles:j,schema:U,events:W,isBlock:function(t){if("string"==typeof t)return!!q[t];if(t){var e=t.nodeType;if(e)return!(1!==e||!q[t.nodeName])}return!1},$:G,$$:r,root:null,clone:function(e,n){if(!Ka||1!==e.nodeType||n)return e.cloneNode(n);var r=t.createElement(e.nodeName);return $a(i(e),(function(t){u(r,t.nodeName,o(e,t.nodeName))})),r},getRoot:s,getViewPort:function(t){var e=en(t);return{x:e.x,y:e.y,w:e.width,h:e.height}},getRect:function(t){var e=l(t=n(t)),r=m(t);return{x:e.x,y:e.y,w:r.w,h:r.h}},getSize:m,getParent:function(t,e,n){var r=h(t,e,n,!1);return r&&0<r.length?r[0]:null},getParents:h,get:n,getNext:function(t,e){return p(t,e,"nextSibling")},getPrev:function(t,e){return p(t,e,"previousSibling")},select:function(r,o){return aa(r,n(o)||e.root_element||t,[])},is:g,add:w,create:C,createHTML:function(t,e,n){var r,o="";for(r in o+="<"+t,e)ct(e,r)&&(o+=" "+r+'="'+$(e[r])+'"');return void 0!==n?o+">"+n+"</"+t+">":o+" />"},createFragment:function(e){var n,r=t.createElement("div"),o=t.createDocumentFragment();for(o.appendChild(r),e&&(r.innerHTML=e);n=r.firstChild;)o.appendChild(n);return o.removeChild(r),o},remove:S,setStyle:function(t,n,o){var i=v(n)?r(t).css(n,o):r(t).css(n);e.update_styles&&Wa(j,i)},getStyle:d,setStyles:function(t,n){var o=r(t).css(n);e.update_styles&&Wa(j,o)},removeAllAttribs:function(t){return b(t,(function(t){for(var e=t.attributes,n=e.length-1;0<=n;n--)t.removeAttributeNode(e.item(n))}))},setAttrib:u,setAttribs:y,getAttrib:o,getPos:l,parseStyle:function(t){return j.parse(t)},serializeStyle:function(t,e){return j.serialize(t,e)},addStyle:function(e){var n,r;if(Y!==Ja.DOM&&t===document){if(R[e])return;R[e]=!0}(r=t.getElementById("mceDefaultStyles"))||((r=t.createElement("style")).id="mceDefaultStyles",r.type="text/css",(n=t.getElementsByTagName("head")[0]).firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.styleSheet?r.styleSheet.cssText+=e:r.appendChild(t.createTextNode(e))},loadCSS:function(t){I((t=t||"").split(","),(function(t){V[t]=!0,F.load(t,c)}))},addClass:function(t,e){r(t).addClass(e)},removeClass:function(t,e){k(t,e,!1)},hasClass:function(t,e){return r(t).hasClass(e)},toggleClass:k,show:function(t){r(t).show()},hide:function(t){r(t).hide()},isHidden:function(t){return"none"===r(t).css("display")},uniqueId:function(t){return(t||"mce_")+L++},setHTML:x,getOuterHTML:function(t){var e="string"==typeof t?n(t):t;return Ln(e)?e.outerHTML:Ga("<div></div>").append(Ga(e).clone()).html()},setOuterHTML:function(t,e){r(t).each((function(){try{if("outerHTML"in this)return void(this.outerHTML=e)}catch(t){}S(Ga(this).html(e),!0)}))},decode:Yo.decode,encode:$,insertAfter:function(t,e){var r=n(e);return b(t,(function(t){var e=r.parentNode,n=r.nextSibling;return n?e.insertBefore(t,n):e.appendChild(t),t}))},replace:O,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=C(e),$a(i(t),(function(e){u(n,e.nodeName,o(t,e.nodeName))})),O(n,t,!0)),n||t},findCommonAncestor:function(t,e){for(var n,r=t;r;){for(n=e;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&t.ownerDocument?t.ownerDocument.documentElement:r},toHex:function(t){return j.toHex(ke.trim(t))},run:b,getAttribs:i,isEmpty:function(t,e){var n,r,o=0;if(E(t))return!1;if(t=t.firstChild){var i=new _r(t,t.parentNode),a=U?U.getWhiteSpaceElements():{};e=e||(U?U.getNonEmptyElements():null);do{if(n=t.nodeType,Ln(t)){var u=t.getAttribute("data-mce-bogus");if(u){t=i.next("all"===u);continue}if(r=t.nodeName.toLowerCase(),e&&e[r]){if("br"!==r)return!1;o++,t=i.next();continue}if(E(t))return!1}if(8===n)return!1;if(3===n&&!Ur(t.nodeValue))return!1;if(3===n&&t.parentNode&&a[t.parentNode.nodeName]&&Ur(t.nodeValue))return!1;t=i.next()}while(t)}return o<=1},createRng:_,nodeIndex:qa,split:function(t,e,n){var r,o,i,a=_();if(t&&e)return a.setStart(t.parentNode,qa(t)),a.setEnd(e.parentNode,qa(e)),r=a.extractContents(),(a=_()).setStart(e.parentNode,qa(e)+1),a.setEnd(t.parentNode,qa(t)+1),o=a.extractContents(),(i=t.parentNode).insertBefore(Fo(Y,r),t),n?i.insertBefore(n,t):i.insertBefore(e,t),i.insertBefore(Fo(Y,o),t),S(t),n||e},bind:X,unbind:K,fire:function(t,e,n){return W.fire(t,e,n)},getContentEditable:T,getContentEditableParent:function(t){for(var e=s(),n=null;t&&t!==e&&null===(n=T(t));t=t.parentNode);return n},destroy:function(){if(0<P.length)for(var t=P.length;t--;){var e=P[t];W.unbind(e[0],e[1],e[2])}nt(V,(function(t,e){F.unload(e),delete V[e]})),aa.setDocument&&aa.setDocument()},isChildOf:function(t,e){if(Ka){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}return t===e||e.contains(t)},dumpRng:function(t){return"startContainer: "+t.startContainer.nodeName+", startOffset: "+t.startOffset+", endContainer: "+t.endContainer.nodeName+", endOffset: "+t.endOffset}},J=(M=j,z=f(Y),N={set:function(t,e,n){D.url_converter&&null!==e&&(e=D.url_converter.call(D.url_converter_scope||z(),e,n,t[0])),t.attr("data-mce-"+n,e).attr(n,e)},get:function(t,e){return t.attr("data-mce-"+e)||t.attr(e)}},B={style:{set:function(t,e){null===e||"object"!=typeof e?(A&&t.attr("data-mce-style",e),null!==e&&"string"==typeof e?(t.removeAttr("style"),t.css(M.parse(e))):t.attr("style",e)):t.css(e)},get:function(t){var e=t.attr("data-mce-style")||t.attr("style");return M.serialize(M.parse(e),t[0].nodeName)}}},(A=(D=e).keep_values)&&(B.href=B.src=N),B);return Y};Ja.DOM=Ja(document),Ja.nodeIndex=qa;var Qa=Ja.DOM,Za=ke.each,tu=ke.grep,eu=(nu.prototype._setReferrerPolicy=function(t){this.settings.referrerPolicy=t},nu.prototype.loadScript=function(t,e,n){function r(){o.remove(i),a&&(a.onerror=a.onload=a=null)}var o=Qa,i=o.uniqueId(),a=document.createElement("script");a.id=i,a.type="text/javascript",a.src=ke._addCacheSuffix(t),this.settings.referrerPolicy&&o.setAttrib(a,"referrerpolicy",this.settings.referrerPolicy),a.onload=function(){r(),e()},a.onerror=function(){r(),S(n)?n():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(a)},nu.prototype.isDone=function(t){return 2===this.states[t]},nu.prototype.markDone=function(t){this.states[t]=2},nu.prototype.add=function(t,e,n,r){var o=this.states[t];this.queue.push(t),void 0===o&&(this.states[t]=0),e&&(this.scriptLoadedCallbacks[t]||(this.scriptLoadedCallbacks[t]=[]),this.scriptLoadedCallbacks[t].push({success:e,failure:r,scope:n||this}))},nu.prototype.load=function(t,e,n,r){return this.add(t,e,n,r)},nu.prototype.remove=function(t){delete this.states[t],delete this.scriptLoadedCallbacks[t]},nu.prototype.loadQueue=function(t,e,n){this.loadScripts(this.queue,t,e,n)},nu.prototype.loadScripts=function(t,e,n,r){function o(t,e){Za(i.scriptLoadedCallbacks[e],(function(e){S(e[t])&&e[t].call(e.scope)})),i.scriptLoadedCallbacks[e]=void 0}var i=this,a=[];i.queueLoadedCallbacks.push({success:e,failure:r,scope:n||this});var u=function(){var e,n=tu(t);t.length=0,Za(n,(function(t){2!==i.states[t]?3!==i.states[t]?1!==i.states[t]&&(i.states[t]=1,i.loading++,i.loadScript(t,(function(){i.states[t]=2,i.loading--,o("success",t),u()}),(function(){i.states[t]=3,i.loading--,a.push(t),o("failure",t),u()}))):o("failure",t):o("success",t)})),i.loading||(e=i.queueLoadedCallbacks.slice(0),i.queueLoadedCallbacks.length=0,Za(e,(function(t){0===a.length?S(t.success)&&t.success.call(t.scope):S(t.failure)&&t.failure.call(t.scope,a)})))};u()},nu.ScriptLoader=new nu,nu);function nu(t){void 0===t&&(t={}),this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=0,this.settings=t}function ru(t){var e=t;return{get:function(){return e},set:function(t){e=t}}}function ou(){return ut(iu,au.get())}var iu={},au=ru("en"),uu={getData:function(){return rt(iu,(function(t){return _t({},t)}))},setCode:function(t){t&&au.set(t)},getCode:function(){return au.get()},add:function(t,e){var n=iu[t];n||(iu[t]=n={}),nt(e,(function(t,e){n[e.toLowerCase()]=t}))},translate:function(t){function e(t){return S(t)?Object.prototype.toString.call(t):u(t)?"":""+t}function n(t){var n=e(t);return ut(a,n.toLowerCase()).map(e).getOr(n)}function r(t){return t.replace(/{context:\w+}$/,"")}var o,i,a=ou().getOr({}),u=function(t){return""===t||null==t};if(u(t))return"";if(b(o=t)&&Ot(o,"raw"))return e(t.raw);if(y(i=t)&&1<i.length){var c=t.slice(1);return r(n(t[0]).replace(/\{([0-9]+)\}/g,(function(t,n){return Ot(c,n)?e(c[n]):t})))}return r(n(t))},isRtl:function(){return ou().bind((function(t){return ut(t,"_dir")})).exists((function(t){return"rtl"===t}))},hasCode:function(t){return Ot(iu,t)}},cu=function(){function t(t,e){I(P(u,(function(n){return n.name===t&&n.state===e})),(function(t){return t.callback()}))}function e(t){return(a[t]?a[t].dependencies:undefined)||[]}function n(t,e){return"object"==typeof e?e:"string"==typeof t?{prefix:"",resource:e,suffix:""}:{prefix:t.prefix,resource:e,suffix:t.suffix}}function r(t,e,n){void 0===n&&(n="added"),Ot(a,t)&&"added"===n||Ot(i,t)&&"loaded"===n?e():u.push({name:t,state:n,callback:e})}var o=[],i={},a={},u=[],c=function(r,o,u,s,l){var f,d;i[r]||(0!==(f="string"==typeof o?o:o.prefix+o.resource+o.suffix).indexOf("/")&&-1===f.indexOf("://")&&(f=cu.baseURL+"/"+f),i[r]=f.substring(0,f.lastIndexOf("/")),d=function(){var i,a,l;t(r,"loaded"),i=o,a=u,l=s,I(e(r),(function(t){var e=n(i,t);c(e.resource,e,void 0,void 0)})),a&&(l?a.call(l):a.call(eu))},a[r]?d():eu.ScriptLoader.add(f,d,s,l))};return{items:o,urls:i,lookup:a,_listeners:u,get:function(t){if(a[t])return a[t].instance},dependencies:e,requireLangPack:function(t,e){!1!==cu.languageLoad&&r(t,(function(){var n=uu.getCode();!n||e&&-1===(","+(e||"")+",").indexOf(","+n+",")||eu.ScriptLoader.add(i[t]+"/langs/"+n+".js")}),"loaded")},add:function(e,n,r){var i=n;return o.push(i),a[e]={instance:i,dependencies:r},t(e,"added"),i},remove:function(t){delete i[t],delete a[t]},createUrl:n,addComponents:function(t,e){var n=i[t];I(e,(function(t){eu.ScriptLoader.add(n+"/"+t)}))},load:c,waitFor:r}};function su(){var t,e,n=(t=c,e=ru(vt.none()),{clear:function(){r(),e.set(vt.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){r(),e.set(vt.some(t))}});function r(){return e.get().each(t)}return _t(_t({},n),{on:function(t){return n.get().each(t)}})}function lu(t,e){var n=null;return{cancel:function(){x(n)||(clearTimeout(n),n=null)},throttle:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];x(n)&&(n=setTimeout((function(){n=null,t.apply(null,r)}),e))}}}function fu(t,e){function n(){x(r)||(clearTimeout(r),r=null)}var r=null;return{cancel:n,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n(),r=setTimeout((function(){r=null,t.apply(null,o)}),e)}}}function du(t,e){var n=vn(t,e);return void 0===n||""===n?[]:n.split(" ")}function mu(t){return void 0!==t.dom.classList}function gu(t,e){var n,r,o;mu(t)?t.dom.classList.add(e):(r=e,o=du(n=t,"class").concat([r]),hn(n,"class",o.join(" ")))}function hu(t,e){return mu(t)&&t.dom.classList.contains(e)}function pu(t,e){return Pt(n=void 0===t?document:t.dom)?[]:V(n.querySelectorAll(e),Oe.fromDom);var n}function vu(t,e){function n(t,e){return(n=t.dom)&&n.hasAttribute&&n.hasAttribute(e)?vt.some(vn(t,e)):vt.none();var n}var r=t.selection.getRng(),o=Oe.fromDom(r.startContainer),i=Oe.fromDom(t.getBody()),a=e.fold((function(){return"."+Pu()}),(function(t){return"["+Uu()+'="'+t+'"]'}));return vr(Ve(o,r.startOffset).getOr(o),a,(function(t){return Ut(t,i)})).bind((function(e){return n(e,""+ju()).bind((function(r){return n(e,""+Uu()).map((function(e){var n=Wu(t,r);return{uid:r,name:e,elements:n}}))}))}))}function bu(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++qu+String(e)}function yu(t,e){var n,r,o=Me(t).dom,i=Oe.fromDom(o.createDocumentFragment());$e(i,(n=e,(r=(o||document).createElement("div")).innerHTML=n,Mn(Oe.fromDom(r)))),Xe(t),Nn(t,i)}function xu(t,e){return Oe.fromDom(t.dom.cloneNode(e))}function wu(t){return xu(t,!1)}function Cu(t){return xu(t,!0)}function Su(t,e,n){function r(t){for(var e;(e=o[t]())&&!Pn(e)&&!n(e););return vt.from(e).filter(Pn)}void 0===n&&(n=D);var o=new _r(t,e);return{current:function(){return vt.from(o.current()).filter(Pn)},next:function(){return r("next")},prev:function(){return r("prev")},prev2:function(){return r("prev2")}}}function ku(t,e){var n=e||function(e){return t.isBlock(e)||qn(e)||Xn(e)},r=function(t,e,n,o){if(Pn(t)){var i=o(t,e,t.data);if(-1!==i)return vt.some({container:t,offset:i})}return n().bind((function(t){return r(t.container,t.offset,n,o)}))};return{backwards:function(t,e,o,i){var a=Su(t,i,n);return r(t,e,(function(){return a.prev().map((function(t){return{container:t,offset:t.length}}))}),o).getOrNull()},forwards:function(t,e,o,i){var a=Su(t,i,n);return r(t,e,(function(){return a.next().map((function(t){return{container:t,offset:0}}))}),o).getOrNull()}}}function Ou(t){return t?{left:Gu(t.left),top:Gu(t.top),bottom:Gu(t.bottom),right:Gu(t.right),width:Gu(t.width),height:Gu(t.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}}function Eu(t,e){return t=Ou(t),e||(t.left=t.left+t.width),t.right=t.left,t.width=0,t}function _u(t,e,n){return 0<=t&&t<=Math.min(e.height,n.height)/2}function Tu(t,e){var n=Math.min(e.height/2,t.height/2);return t.bottom-n<e.top||!(t.top>e.bottom)&&_u(e.top-t.bottom,t,e)}function Mu(t,e){return t.top>e.bottom||!(t.bottom<e.top)&&_u(e.bottom-t.top,t,e)}function Du(t,e,n){return e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom}function zu(t){var e=t.startContainer,n=t.startOffset;return e.hasChildNodes()&&t.endOffset===n+1?e.childNodes[n]:null}function Au(t,e){if(Ln(t)&&t.hasChildNodes()){var n=t.childNodes;return n[(r=n.length-1,Math.min(Math.max(e,0),r))]}return t;var r}function Nu(t){return"string"==typeof t&&768<=t.charCodeAt(0)&&$u.test(t)}function Bu(t){return"createRange"in t?t.createRange():Ja.DOM.createRng()}function Ru(t){return t&&/[\r\n\t ]/.test(t)}function Hu(t){return t.setStart&&t.setEnd}function Vu(t){var e=t.startContainer,n=t.startOffset;if(Ru(t.toString())&&Zu(e.parentNode)&&Pn(e)){var r=e.data;return Ru(r[n-1])||Ru(r[n+1])?1:void 0}}function Iu(t){return 0===t.left&&0===t.right&&0===t.top&&0===t.bottom}function Lu(t,e){var n=Eu(t,e);return n.width=1,n.right=n.left+1,n}cu.languageLoad=!0,cu.baseURL="",cu.PluginManager=cu(),cu.ThemeManager=cu();var Fu=function(t,e){var n=[];return I(Mn(t),(function(t){n=(n=e(t)?n.concat([t]):n).concat(Fu(t,e))})),n},Pu=f("mce-annotation"),Uu=f("data-mce-annotation"),ju=f("data-mce-annotation-uid"),Wu=function(t,e){return pu(Oe.fromDom(t.getBody()),"["+ju()+'="'+e+'"]')},qu=0,Gu=Math.round,$u=new RegExp("[̀-ͯ҃-҇҈-҉֑-ֽֿׁ-ׂׄ-ׇׅؐ-ًؚ-ٰٟۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣣ-ंऺ़ु-ै्॑-ॗॢ-ॣঁ়াু-ৄ্ৗৢ-ৣਁ-ਂ਼ੁ-ੂੇ-ੈੋ-੍ੑੰ-ੱੵઁ-ં઼ુ-ૅે-ૈ્ૢ-ૣଁ଼ାିୁ-ୄ୍ୖୗୢ-ୣஂாீ்ௗఀా-ీె-ైొ-్ౕ-ౖౢ-ౣಁ಼ಿೂೆೌ-್ೕ-ೖೢ-ೣഁാു-ൄ്ൗൢ-ൣ්ාි-ුූෟัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-ཱ༹༙༵༷-ཾྀ-྄྆-྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္-်ွ-ှၘ-ၙၞ-ၠၱ-ၴႂႅ-ႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳ឴-឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧ-ᤨᤲ᤹-᤻ᨗ-ᨘᨛᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼᪰-᪽᪾ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀ-ᮁᮢ-ᮥᮨ-ᮩ᮫-ᮭ᯦ᯨ-ᯩᯭᯯ-ᯱᰬ-ᰳᰶ-᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᳸-᳹᷀-᷵᷼-᷿-⃐-⃜⃝-⃠⃡⃢-⃤⃥-⃰⳯-⵿⳱ⷠ-〪ⷿ-〭〮-゙〯-゚꙯꙰-꙲ꙴ-꙽ꚞ-ꚟ꛰-꛱ꠂ꠆ꠋꠥ-ꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꧥꨩ-ꨮꨱ-ꨲꨵ-ꨶꩃꩌꩼꪰꪲ-ꪴꪷ-ꪸꪾ-꪿꫁ꫬ-ꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-゙︯-゚]"),Xu=Ln,Ku=Fr,Yu=an("display","block table"),Ju=an("float","left right"),Qu=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(!t[n](e))return!1;return!0}}(Xu,Ku,E(Ju)),Zu=E(an("white-space","pre pre-line pre-wrap")),tc=Pn,ec=qn,nc=Ja.nodeIndex,rc=function(t,e){if(!(e<0&&Ln(t)&&t.hasChildNodes()))return Au(t,e)},oc=function(t){var e=t.getClientRects(),n=0<e.length?Ou(e[0]):Ou(t.getBoundingClientRect());return!Hu(t)&&ec(t)&&Iu(n)?function(t){var e=t.ownerDocument,n=Bu(e),r=e.createTextNode(yo),o=t.parentNode;o.insertBefore(r,t),n.setStart(r,0),n.setEnd(r,1);var i=Ou(n.getBoundingClientRect());return o.removeChild(r),i}(t):Iu(n)&&Hu(t)?function(t){var e=t.startContainer,n=t.endContainer,r=t.startOffset,o=t.endOffset;if(e===n&&Pn(n)&&0===r&&1===o){var i=t.cloneRange();return i.setEndAfter(n),oc(i)}return null}(t):n},ic=function(t,e,n){function r(){return n=n||function(t){function e(t){var e;0!==t.height&&(0<r.length&&(e=r[r.length-1],t.left===e.left&&t.top===e.top&&t.bottom===e.bottom&&t.right===e.right)||r.push(t))}function n(t,n){var o=Bu(t.ownerDocument);if(n<t.data.length){if(Nu(t.data[n]))return r;if(Nu(t.data[n-1])&&(o.setStart(t,n),o.setEnd(t,n+1),!Vu(o)))return e(Lu(oc(o),!1)),r}0<n&&(o.setStart(t,n-1),o.setEnd(t,n),Vu(o)||e(Lu(oc(o),!1))),n<t.data.length&&(o.setStart(t,n),o.setEnd(t,n+1),Vu(o)||e(Lu(oc(o),!0)))}var r=[],o=t.container(),i=t.offset();if(tc(o))return n(o,i),r;if(Xu(o))if(t.isAtEnd()){var a=rc(o,i);tc(a)&&n(a,a.data.length),Qu(a)&&!ec(a)&&e(Lu(oc(a),!1))}else{if(a=rc(o,i),tc(a)&&n(a,0),Qu(a)&&t.isAtEnd())return e(Lu(oc(a),!1)),r;var u=rc(t.container(),t.offset()-1);Qu(u)&&!ec(u)&&(!Yu(u)&&!Yu(a)&&Qu(a)||e(Lu(oc(u),!1))),Qu(a)&&e(Lu(oc(a),!0))}return r}(ic(t,e))}return{container:f(t),offset:f(e),toRange:function(){var n=Bu(t.ownerDocument);return n.setStart(t,e),n.setEnd(t,e),n},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return tc(t),0===e},isAtEnd:function(){return tc(t)?e>=t.data.length:e>=t.childNodes.length},isEqual:function(n){return n&&t===n.container()&&e===n.offset()},getNode:function(n){return rc(t,n?e-1:e)}}};function ac(t,e){Pn(e)&&0===e.data.length&&t.remove(e)}function uc(t,e,n){var r,o,i,a,u,c,s;Wn(n)?(i=t,a=e,c=vt.from((u=n).firstChild),s=vt.from(u.lastChild),a.insertNode(u),c.each((function(t){return ac(i,t.previousSibling)})),s.each((function(t){return ac(i,t.nextSibling)}))):(r=t,e.insertNode(o=n),ac(r,o.previousSibling),ac(r,o.nextSibling))}function cc(t){return function(e){return t===e}}function sc(t){var e,n,r,o;return(is(t)?"text()":t.nodeName.toLowerCase())+"["+(r=gt(n=ss(cs(e=t)),cc(e),e),o=mt(n=n.slice(0,r+1),(function(t,e,r){return is(e)&&is(n[r-1])&&t++,t}),0),gt(n=ft(n,on([e.nodeName])),cc(e),e)-o+"]")}function lc(t,e){var n,r,o,i=[],a=e.container(),u=e.offset();return is(a)?n=function(t,e){for(;(t=t.previousSibling)&&is(t);)e+=t.data.length;return e}(a,u):(u>=(r=a.childNodes).length?(n="after",u=r.length-1):n="before",a=r[u]),i.push(sc(a)),o=ft(function(t,e){var n=[];for(e=e.parentNode;e!==t;e=e.parentNode)n.push(e);return n}(t,a),E(cn)),(i=i.concat(lt(o,sc))).reverse().join("/")+","+n}function fc(t,e){if(!e)return null;var n=e.split(","),r=n[0].split("/"),o=1<n.length?n[1]:"before",i=mt(r,(function(t,e){var n,r,o,i,a=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(e);return a?("text()"===a[1]&&(a[1]="#text"),n=t,r=a[1],o=parseInt(a[2],10),i=ft(i=ss(n),(function(t,e){return!is(t)||!is(i[e-1])})),(i=ft(i,on([r])))[o]):null}),t);return i?is(i)?function(t,e){for(var n,r=t,o=0;is(r);){if(n=r.data.length,o<=e&&e<=o+n){t=r,e-=o;break}if(!is(r.nextSibling)){t=r,e=n;break}o+=n,r=r.nextSibling}return is(t)&&e>t.data.length&&(e=t.data.length),ic(t,e)}(i,parseInt(o,10)):(o="after"===o?us(i)+1:us(i),ic(i.parentNode,o)):null}function dc(t,e,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],c=[],s=0,l=t.getRoot();for(Pn(a)?c.push(n?function(t,e,n){for(var r=t(e.data.slice(0,n)).length,o=e.previousSibling;o&&Pn(o);o=o.previousSibling)r+=t(o.data).length;return r}(e,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(s=1,u=Math.max(0,i.length-1)),c.push(t.nodeIndex(i[u],n)+s));a&&a!==l;a=a.parentNode)c.push(t.nodeIndex(a,n));return c}function mc(t,e,n){var r=0;return ke.each(t.select(e),(function(t){if("all"!==t.getAttribute("data-mce-bogus"))return t!==n&&void r++})),r}function gc(t,e){var n,r=e?"start":"end",o=t[r+"Container"],i=t[r+"Offset"];Ln(o)&&"TR"===o.nodeName&&(o=(n=o.childNodes)[Math.min(e?i:i-1,n.length-1)])&&(i=e?0:o.childNodes.length,t["set"+(e?"Start":"End")](o,i))}function hc(t){return gc(t,!0),gc(t,!1),t}function pc(t,e){var n;return Ln(t)&&(t=Au(t,e),ls(t))?t:Br(t)?(n=(t=Pn(t)&&Ar(t)?t.parentNode:t).previousSibling,ls(n)?n:(n=t.nextSibling,ls(n)?n:void 0)):void 0}function vc(t,e,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(ls(r)||"IMG"===o)return{name:o,index:mc(n.dom,o,r)};var a,u,c,s,l,f,d,m=pc((a=i).startContainer,a.startOffset)||pc(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:mc(n.dom,o,m)}:(f=(c=n).dom,(d={}).start=dc(f,u=t,s=e,l=i,!0),c.isCollapsed()||(d.end=dc(f,u,s,l,!1)),Lr(l)&&(d.isFakeCaret=!0),d)}function bc(t,e,n){var r={"data-mce-type":"bookmark",id:e,style:"overflow:hidden;line-height:0px"};return n?t.create("span",r,""):t.create("span",r)}function yc(t,e){var n=t.dom,r=t.getRng(),o=n.uniqueId(),i=t.isCollapsed(),a=t.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:mc(n,u,a)};var c=hc(r.cloneRange());return i||(c.collapse(!1),uc(n,c,bc(n,o+"_end",e))),(r=hc(r)).collapse(!0),uc(n,r,bc(n,o+"_start",e)),t.moveToBookmark({id:o,keep:!0}),{id:o}}function xc(t,e,n){var r=t.getParam(e,n);return-1===r.indexOf("=")?r:ut(t.getParam(e,"","hash"),t.id).getOr(n)}function wc(t){return t.getParam("content_security_policy","")}function Cc(t){if(t.getParam("force_p_newlines",!1))return"p";var e=t.getParam("forced_root_block","p");return!1===e?"":!0===e?"p":e}function Sc(t){return t.getParam("forced_root_block_attrs",{})}function kc(t){return t.getParam("automatic_uploads",!0,"boolean")}function Oc(t){return t.getParam("icons","","string")}function Ec(t){return t.getParam("referrer_policy","","string")}function _c(t){return t.getParam("language","en","string")}function Tc(t){return t.getParam("indent_use_margin",!1)}function Mc(t){var e=t.getParam("font_css",[]);return y(e)?e:V(e.split(","),Jt)}function Dc(t){var e=t.getParam("object_resizing");return!1!==e&&!we.iOS&&(v(e)?e:"table,img,figure.image,div,video,iframe")}function zc(t){return t.getParam("event_root")}function Ac(t){return t.getParam("theme")}function Nc(t){return!1!==t.getParam("inline_boundaries")}function Bc(t){return t.getParam("plugins","","string")}function Rc(t){var e=t.parentNode;e&&e.removeChild(t)}function Hc(t){var e=Co(t);return{count:t.length-e.length,text:e}}function Vc(t){for(var e;-1!==(e=t.data.lastIndexOf(xo));)t.deleteData(e,1)}function Ic(t,e){return hs(t),e}function Lc(t,e){var n,r=e.container(),o=(-1===(n=B(wt(r.childNodes),t))?vt.none():vt.some(n)).map((function(t){return t<e.offset()?ic(r,e.offset()-1):e})).getOr(e);return hs(t),o}function Fc(t,e){return ic.isTextPosition(e)?(r=e,gs(n=t)&&r.container()===n?(a=Hc((o=n).data.substr(0,(i=r).offset())),u=Hc(o.data.substr(i.offset())),0<(a.text+u.text).length?(Vc(o),ic(o,i.offset()-a.count)):i):Ic(n,r)):(c=t,((s=e).container()===c.parentNode?Lc:Ic)(c,s));var n,r,o,i,a,u,c,s}function Pc(t,e,n){var r,o,i,a=Eu(e.getBoundingClientRect(),n),u="BODY"===t.tagName?(r=t.ownerDocument.documentElement,o=t.scrollLeft||r.scrollLeft,t.scrollTop||r.scrollTop):(i=t.getBoundingClientRect(),o=t.scrollLeft-i.left,t.scrollTop-i.top);a.left+=o,a.right+=o,a.top+=u,a.bottom+=u,a.width=1;var c=e.offsetWidth-e.clientWidth;return 0<c&&(n&&(c*=-1),a.left+=c,a.right+=c),a}function Uc(){return ps.isIE()||ps.isEdge()||ps.isFirefox()}function jc(t){return xs(t)||sn(t)&&Uc()}function Wc(t,e){for(var n;n=t(e);)if(!Os(n))return n;return null}function qc(t,e,n,r,o){var i=new _r(t,r),a=ws(t)||Os(t);if(e<0){if(a&&n(t=Wc(i.prev.bind(i),!0)))return t;for(;t=Wc(i.prev.bind(i),o);)if(n(t))return t}if(0<e){if(a&&n(t=Wc(i.next.bind(i),!0)))return t;for(;t=Wc(i.next.bind(i),o);)if(n(t))return t}return null}function Gc(t,e){for(;t&&t!==e;){if(Ss(t))return t;t=t.parentNode}return null}function $c(t,e,n){return Gc(t.container(),n)===Gc(e.container(),n)}function Xc(t,e){if(!e)return null;var n=e.container(),r=e.offset();return Es(n)?n.childNodes[r+t]:null}function Kc(t,e){var n=e.ownerDocument.createRange();return t?(n.setStartBefore(e),n.setEndBefore(e)):(n.setStartAfter(e),n.setEndAfter(e)),n}function Yc(t,e,n){for(var r,o,i=t?"previousSibling":"nextSibling";n&&n!==e;){var a=n[i];if(ks(a)&&(a=a[i]),ws(a)||Cs(a)){if(o=n,Gc(a,r=e)===Gc(o,r))return a;break}if(_s(a))break;n=n.parentNode}return null}function Jc(t,e,n){var r,o=O(Yc,!0,e),i=O(Yc,!1,e),a=n.startContainer,u=n.startOffset;if(Ar(a)){var c=(a=Es(a)?a:a.parentNode).getAttribute("data-mce-caret");if("before"===c&&jc(r=a.nextSibling))return Ts(r);if("after"===c&&jc(r=a.previousSibling))return Ms(r)}if(!n.collapsed)return n;if(Pn(a)){if(ks(a)){if(1===t){if(r=i(a))return Ts(r);if(r=o(a))return Ms(r)}if(-1===t){if(r=o(a))return Ms(r);if(r=i(a))return Ts(r)}return n}if(Eo(a)&&u>=a.data.length-1)return 1===t&&(r=i(a))?Ts(r):n;if(Oo(a)&&u<=1)return-1===t&&(r=o(a))?Ms(r):n;if(u===a.data.length)return(r=i(a))?Ts(r):n;if(0===u)return(r=o(a))?Ms(r):n}return n}function Qc(t,e){return vt.from(Xc(t?0:-1,e)).filter(ws)}function Zc(t,e,n){var r=Jc(t,e,n);return-1===t?ic.fromRangeStart(r):ic.fromRangeEnd(r)}function ts(t){return vt.from(t.getNode()).map(Oe.fromDom)}function es(t,e){for(;e=t(e);)if(e.isVisible())return e;return e}function ns(t,e){var n=$c(t,e);return!(n||!qn(t.getNode()))||n}ic.fromRangeStart=function(t){return ic(t.startContainer,t.startOffset)},ic.fromRangeEnd=function(t){return ic(t.endContainer,t.endOffset)},ic.after=function(t){return ic(t.parentNode,nc(t)+1)},ic.before=function(t){return ic(t.parentNode,nc(t))},ic.isAbove=function(t,e){return dn(Z(e.getClientRects()),tt(t.getClientRects()),Tu).getOr(!1)},ic.isBelow=function(t,e){return dn(tt(e.getClientRects()),Z(t.getClientRects()),Mu).getOr(!1)},ic.isAtStart=function(t){return!!t&&t.isAtStart()},ic.isAtEnd=function(t){return!!t&&t.isAtEnd()},ic.isTextPosition=function(t){return!!t&&Pn(t.container())},ic.isElementPosition=function(t){return!1===ic.isTextPosition(t)};var rs,os,is=Pn,as=cn,us=Ja.nodeIndex,cs=function(t){var e=t.parentNode;return as(e)?cs(e):e},ss=function(t){return t?mt(t.childNodes,(function(t,e){return as(e)&&"BR"!==e.nodeName?t=t.concat(ss(e)):t.push(e),t}),[]):[]},ls=Xn,fs=O(vc,d,!0),ds=Ja.DOM,ms=Ln,gs=Pn,hs=function(t){ms(t)&&Br(t)&&(Rr(t)?t.removeAttribute("data-mce-caret"):Rc(t)),gs(t)&&(Vc(t),0===t.data.length&&Rc(t))},ps=de().browser,vs=Xn,bs=Yn,ys=Kn,xs=function(t){return vs(t)||bs(t)},ws=Xn,Cs=Yn,Ss=an("display","block table table-cell table-caption list-item"),ks=Br,Os=Ar,Es=Ln,_s=Fr,Ts=O(Kc,!0),Ms=O(Kc,!1);function Ds(t,e){return t.hasChildNodes()&&e<t.childNodes.length?t.childNodes[e]:null}function zs(t,e){if(0<t){if(Wl(e.previousSibling)&&!Pl(e.previousSibling))return ic.before(e);if(Pl(e))return ic(e,0)}if(t<0){if(Wl(e.nextSibling)&&!Pl(e.nextSibling))return ic.after(e);if(Pl(e))return ic(e,e.data.length)}return t<0&&!jl(e)?ic.after(e):ic.before(e)}function As(t){return{next:function(e){return Gl(rs.Forwards,e,t)},prev:function(e){return Gl(rs.Backwards,e,t)}}}function Ns(t){return ic.isTextPosition(t)?0===t.offset():Fr(t.getNode())}function Bs(t){if(ic.isTextPosition(t)){var e=t.container();return t.offset()===e.data.length}return Fr(t.getNode(!0))}function Rs(t,e){return!ic.isTextPosition(t)&&!ic.isTextPosition(e)&&t.getNode()===e.getNode(!0)}function Hs(t,e,n){return $l(t,e,n).bind((function(r){return $c(n,r,e)&&(o=n,i=r,t?!Rs(o,i)&&(ic.isTextPosition(a=o)||!qn(a.getNode()))&&Bs(o)&&Ns(i):!Rs(i,o)&&Ns(o)&&Bs(i))?$l(t,e,r):vt.some(r);var o,i,a}))}function Vs(t,e){var n,r,o,i,a,u=t?e.firstChild:e.lastChild;return Pn(u)?vt.some(ic(u,t?0:u.data.length)):u?Fr(u)?vt.some(t?ic.before(u):qn(a=u)?ic.before(a):ic.after(a)):(r=e,o=u,i=(n=t)?ic.before(o):ic.after(o),$l(n,r,i)):vt.none()}function Is(t){return Ln(t)&&t.id===Zl}function Ls(t,e){for(;e&&e!==t;){if(e.id===Zl)return e;e=e.parentNode}return null}function Fs(t){return ke.isArray(t.start)}function Ps(t,e){return Ln(e)&&t.isBlock(e)&&!e.innerHTML&&!we.ie&&(e.innerHTML='<br data-mce-bogus="1" />'),e}function Us(t,e,n){return!1===e.hasChildNodes()&&Ls(t,e)&&(o=n,i=(r=e).ownerDocument.createTextNode(xo),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),1);var r,o,i}function js(t,e,n,r){var o,i,a,u,c=n[e?"start":"end"],s=t.getRoot();if(c){for(a=c[0],i=s,o=c.length-1;1<=o;o--){if(u=i.childNodes,Us(s,i,r))return 1;if(c[o]>u.length-1)return Us(s,i,r)||function(t){return Ql(i).fold(D,(function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0}))}(r);i=u[c[o]]}3===i.nodeType&&(a=Math.min(c[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(c[0],i.childNodes.length)),e?r.setStart(i,a):r.setEnd(i,a)}return 1}function Ws(t){return Pn(t)&&0<t.data.length}function qs(t,e,n){var r,o,i,a,u,c,s=t.get(n.id+"_"+e),l=n.keep;if(s){if(r=s.parentNode,o="start"===e?l?s.hasChildNodes()?(r=s.firstChild,1):Ws(s.nextSibling)?(r=s.nextSibling,0):Ws(s.previousSibling)?(r=s.previousSibling,s.previousSibling.data.length):(r=s.parentNode,t.nodeIndex(s)+1):t.nodeIndex(s):l?s.hasChildNodes()?(r=s.firstChild,1):Ws(s.previousSibling)?(r=s.previousSibling,s.previousSibling.data.length):(r=s.parentNode,t.nodeIndex(s)):t.nodeIndex(s),u=r,c=o,!l){for(a=s.previousSibling,i=s.nextSibling,ke.each(ke.grep(s.childNodes),(function(t){Pn(t)&&(t.nodeValue=t.nodeValue.replace(/\uFEFF/g,""))}));s=t.get(n.id+"_"+e);)t.remove(s,!0);a&&i&&a.nodeType===i.nodeType&&Pn(a)&&!we.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),t.remove(i),u=a,c=o)}return vt.some(ic(u,c))}return vt.none()}function Gs(t,e){(function(t,e){var n,r,o,i,a,u,c,s,l,f,d,m,g=t.dom;if(e){if(Fs(e))return d=e,m=(f=g).createRng(),js(f,!0,d,m)&&js(f,!1,d,m)?vt.some(m):vt.none();if(v(e.start))return vt.some((c=e,s=(u=g).createRng(),l=fc(u.getRoot(),c.start),s.setStart(l.container(),l.offset()),l=fc(u.getRoot(),c.end),s.setEnd(l.container(),l.offset()),s));if(Ot(e,"id"))return dn(a=qs(o=g,"start",i=e),qs(o,"end",i).or(a),(function(t,e){var n=o.createRng();return n.setStart(Ps(o,t.container()),t.offset()),n.setEnd(Ps(o,e.container()),e.offset()),n}));if(Ot(e,"name"))return n=g,vt.from(n.select((r=e).name)[r.index]).map((function(t){var e=n.createRng();return e.selectNode(t),e}));if(Ot(e,"rng"))return vt.some(e.rng)}return vt.none()})(t,e).each((function(e){t.setRng(e)}))}function $s(t){return Ln(t)&&"SPAN"===t.tagName&&"bookmark"===t.getAttribute("data-mce-type")}function Xs(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)}function Ks(t){return!Xs(t)&&!ef(t)}function Ys(t){return t.nodeType}function Js(t,e,n){var r,o=n.startOffset,i=n.startContainer;if((i!==n.endContainer||!(r=i.childNodes[o])||!/^(IMG)$/.test(r.nodeName))&&Ln(i)){var a=i.childNodes,u=void 0;o<a.length?(i=a[o],u=new _r(i,t.getParent(i,t.isBlock))):(i=a[a.length-1],(u=new _r(i,t.getParent(i,t.isBlock))).next(!0));for(var c=u.current();c;c=u.next())if(Pn(c)&&!nf(c))return n.setStart(c,0),e.setRng(n),0}}function Qs(t,e,n){if(t){var r=e?"nextSibling":"previousSibling";for(t=n?t:t[r];t;t=t[r])if(Ln(t)||!nf(t))return t}}function Zs(t,e){return Ys(e)&&(e=e.nodeName),!!t.schema.getTextBlockElements()[e.toLowerCase()]}function tl(t,e,n){return t.schema.isValidChild(e,n)}function el(t,e){return S(t)?t=t(e):u(e)&&(t=t.replace(/%(\w+)/g,(function(t,n){return e[n]||t}))),t}function nl(t,e){return t=""+((t=t||"").nodeName||t),e=""+((e=e||"").nodeName||e),t.toLowerCase()===e.toLowerCase()}function rl(t,e,n){return"color"!==n&&"backgroundColor"!==n||(e=t.toHex(e)),"fontWeight"===n&&700===e&&(e="bold"),""+("fontFamily"===n?e.replace(/[\'\"]/g,"").replace(/,\s+/g,","):e)}function ol(t,e,n){return rl(t,t.getStyle(e,n),n)}function il(t,e){var n;return t.getParent(e,(function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n})),n}function al(t,e,n){return t.getParents(e,n,t.getRoot())}function ul(t,e){return H(t.formatter.get(e),(function(t){function e(t){return 1<t.length&&"%"===t.charAt(0)}return H(["styles","attributes"],(function(n){return ut(t,n).exists((function(t){var n,r;return H(y(t)?t:(n=d,r=[],nt(t,(function(t,e){r.push(n(t,e))})),r),e)}))}))}))}function cl(t){return ct(t,"block")}function sl(t){return ct(t,"selector")}function ll(t){return ct(t,"inline")}function fl(t){return sl(t)&&!1!==t.expand&&!ll(t)}function dl(t,e){for(var n=e;n;){if(Ln(n)&&t.getContentEditable(n))return"false"===t.getContentEditable(n)?n:e;n=n.parentNode}return e}function ml(t,e,n,r){for(var o=e.data,i=n;t?0<=i:i<o.length;t?i--:i++)if(r(o.charAt(i)))return t?i+1:i;return-1}function gl(t,e,n){return ml(t,e,n,(function(t){return ef(t)||Xs(t)}))}function hl(t,e,n){return ml(t,e,n,Ks)}function pl(t,e,n,r,o,i){function a(e,n,r){var i=ku(t),a=o?i.backwards:i.forwards;return vt.from(a(e,n,(function(t,e){return rf(t.parentNode)?-1:r(o,u=t,e)}),c))}var u,c=t.getParent(n,t.isBlock)||e;return a(n,r,gl).bind((function(t){return i?a(t.container,t.offset+(o?-1:0),hl):vt.some(t)})).orThunk((function(){return u?vt.some({container:u,offset:o?0:u.length}):vt.none()}))}function vl(t,e,n,r,o){Pn(r)&&Bt(r.data)&&r[o]&&(r=r[o]);for(var i=of(t,r),a=0;a<i.length;a++)for(var c=0;c<e.length;c++){var s=e[c];if((!u(s.collapsed)||s.collapsed===n.collapsed)&&sl(s)&&t.is(i[a],s.selector))return i[a]}return r}function bl(t,e,n,r){var o,i=n,a=t.dom,u=a.getRoot(),c=e[0];if((i=cl(c)?c.wrapper?null:a.getParent(n,c.block,u):i)||(o=a.getParent(n,"LI,TD,TH"),i=a.getParent(Pn(n)?n.parentNode:n,(function(e){return e!==u&&uf(t,e)}),o)),!(i=i&&cl(c)&&c.wrapper&&of(a,i,"ul,ol").reverse()[0]||i))for(i=n;i[r]&&!a.isBlock(i[r])&&!nl(i=i[r],"br"););return i||n}function yl(t,e,n,r,o){var i,a=n,u=o?"previousSibling":"nextSibling",c=t.getRoot();if(Pn(n)&&!af(n)&&(o?0<r:r<n.data.length))return n;for(;;){if(!e[0].block_expand&&t.isBlock(a))return a;for(var s=a[u];s;s=s[u]){var l=Pn(s)&&!cf(t,c,s,u);if(!rf(s)&&(!qn(i=s)||!i.getAttribute("data-mce-bogus")||i.nextSibling)&&!af(s,l))return a}if(a===c||a.parentNode===c){n=a;break}a=a.parentNode}return n}function xl(t){return rf(t.parentNode)||rf(t)}function wl(t,e,n,r){void 0===r&&(r=!1);var o=e.startContainer,i=e.startOffset,a=e.endContainer,u=e.endOffset,c=t.dom,s=n[0];return Ln(o)&&o.hasChildNodes()&&(o=Au(o,i),Pn(o)&&(i=0)),Ln(a)&&a.hasChildNodes()&&(a=Au(a,e.collapsed?u:u-1),Pn(a)&&(u=a.nodeValue.length)),o=dl(c,o),a=dl(c,a),xl(o)&&(o=rf(o)?o:o.parentNode,o=e.collapsed?o.previousSibling||o:o.nextSibling||o,Pn(o)&&(i=e.collapsed?o.length:0)),xl(a)&&(a=rf(a)?a:a.parentNode,a=e.collapsed?a.nextSibling||a:a.previousSibling||a,Pn(a)&&(u=e.collapsed?0:a.length)),e.collapsed&&(pl(c,t.getBody(),o,i,!0,r).each((function(t){var e=t.container,n=t.offset;o=e,i=n})),pl(c,t.getBody(),a,u,!1,r).each((function(t){var e=t.container,n=t.offset;a=e,u=n}))),(ll(s)||s.block_expand)&&(ll(s)&&Pn(o)&&0!==i||(o=yl(c,n,o,i,!0)),ll(s)&&Pn(a)&&u!==a.nodeValue.length||(a=yl(c,n,a,u,!1))),fl(s)&&(o=vl(c,n,e,o,"previousSibling"),a=vl(c,n,e,a,"nextSibling")),(cl(s)||sl(s))&&(o=bl(t,n,o,"previousSibling"),a=bl(t,n,a,"nextSibling"),cl(s)&&(c.isBlock(o)||(o=yl(c,n,o,i,!0)),c.isBlock(a)||(a=yl(c,n,a,u,!1)))),Ln(o)&&(i=c.nodeIndex(o),o=o.parentNode),Ln(a)&&(u=c.nodeIndex(a)+1,a=a.parentNode),{startContainer:o,startOffset:i,endContainer:a,endOffset:u}}function Cl(t,e,n){function r(t){var e=t[0];Pn(e)&&e===c&&u>=e.data.length&&t.splice(0,1);var n=t[t.length-1];return 0===s&&0<t.length&&n===l&&Pn(n)&&t.splice(t.length-1,1),t}function o(t,e,n){for(var r=[];t&&t!==n;t=t[e])r.push(t);return r}function i(e,n){return t.getParent(e,(function(t){return t.parentNode===n}),n)}function a(t,e,i){var a=i?"nextSibling":"previousSibling",u=t;for(u.parentNode;u&&u!==e;u=c){var c=u.parentNode,s=o(u===t?u:u[a],a);s.length&&(i||s.reverse(),n(r(s)))}}var u=e.startOffset,c=Au(e.startContainer,u),s=e.endOffset,l=Au(e.endContainer,s-1);if(c===l)return n(r([c]));var f=t.findCommonAncestor(c,l);if(t.isChildOf(c,l))return a(c,f,!0);if(t.isChildOf(l,c))return a(l,f);var d=i(c,f)||c,m=i(l,f)||l;a(c,d,!0);var g=o(d===c?d:d.nextSibling,"nextSibling",m===l?m.nextSibling:m);g.length&&n(r(g)),a(l,m)}function Sl(t){var e=[];if(t)for(var n=0;n<t.rangeCount;n++)e.push(t.getRangeAt(n));return e}function kl(t,e){var n=pu(e,"td[data-mce-selected],th[data-mce-selected]");return 0<n.length?n:P($(t,(function(t){var e=zu(t);return e?[Oe.fromDom(e)]:[]})),po)}function Ol(t){return kl(Sl(t.selection.getSel()),Oe.fromDom(t.getBody()))}function El(t,e){return hr(t,"table",e)}function _l(t,e){return dn((o=e.startContainer,i=e.startOffset,Pn(o)?0===i?vt.some(Oe.fromDom(o)):vt.none():vt.from(o.childNodes[i]).map(Oe.fromDom)),(n=e.endContainer,r=e.endOffset,Pn(n)?r===n.data.length?vt.some(Oe.fromDom(n)):vt.none():vt.from(n.childNodes[r-1]).map(Oe.fromDom)),(function(e,n){var r=q(sf(t),O(Ut,e)),o=q(lf(t),O(Ut,n));return r.isSome()&&o.isSome()})).getOr(!1);var n,r,o,i}function Tl(t,e,n,r){var o=n,i=new _r(n,o),a=at(t.schema.getMoveCaretBeforeOnEnterElements(),(function(t,e){return!R(["td","th","table"],e.toLowerCase())}));do{if(Pn(n)&&0!==ke.trim(n.nodeValue).length)return r?e.setStart(n,0):e.setEnd(n,n.nodeValue.length),0;if(a[n.nodeName])return r?e.setStartBefore(n):"BR"===n.nodeName?e.setEndBefore(n):e.setEndAfter(n),0}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?e.setStart(o,0):e.setEnd(o,o.childNodes.length))}function Ml(t){var e=t.selection.getSel();return e&&0<e.rangeCount}function Dl(t,e){var n=Ol(t);0<n.length?I(n,(function(n){var r=n.dom,o=t.dom.createRng();o.setStartBefore(r),o.setEndAfter(r),e(o,!0)})):e(t.selection.getRng(),!1)}function zl(t,e,n){var r=yc(t,e);n(r),t.moveToBookmark(r)}function Al(t){return ff.get(t)}function Nl(t,e,n,r){var o=e.uid,i=void 0===o?bu("mce-annotation"):o,a=function(t,e){var n={};for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]]);return n}(e,["uid"]),u=Oe.fromTag("span",t);gu(u,Pu()),hn(u,""+ju(),i),hn(u,""+Uu(),n);var c,s=r(i,a),l=s.attributes,f=s.classes,d=void 0===f?[]:f;return pn(u,void 0===l?{}:l),c=u,I(d,(function(t){gu(c,t)})),u}function Bl(t){var e,n,r,o=(e={},{register:function(t,n){e[t]={name:t,settings:n}},lookup:function(t){return ut(e,t).map((function(t){return t.settings}))}});r=o,(n=t).on("init",(function(){n.serializer.addNodeFilter("span",(function(t){I(t,(function(t){vt.from(t.attr(Uu())).bind(r.lookup).each((function(e){!1===e.persistent&&t.unwrap()}))}))}))}));var i=function(t){function e(){return{listeners:[],previous:su()}}function n(t,e){r(t,(function(t){return e(t),t}))}function r(t,n){var r=o.get(),i=n(ut(r,t).getOrThunk(e));r[t]=i,o.set(r)}var o=ru({}),i=fu((function(){var e=o.get();I(J(Ct(e)),(function(e){r(e,(function(r){var o=r.previous.get();return vu(t,vt.some(e)).fold((function(){var t;o.isSome()&&(n(t=e,(function(e){I(e.listeners,(function(e){return e(!1,t)}))})),r.previous.clear())}),(function(t){var e,i,a,u=t.uid,c=t.name,s=t.elements;fn(o,u)||(i=u,a=s,n(e=c,(function(t){I(t.listeners,(function(t){return t(!0,e,{uid:i,nodes:V(a,(function(t){return t.dom}))})}))})),r.previous.set(u))})),{previous:r.previous,listeners:r.listeners}}))}))}),30);return t.on("remove",(function(){i.cancel()})),t.on("NodeChange",(function(){i.throttle()})),{addListener:function(t,e){r(t,(function(t){return{previous:t.previous,listeners:t.listeners.concat([e])}}))}}}(t);return{register:function(t,e){o.register(t,e)},annotate:function(e,n){o.lookup(e).each((function(r){var o,i,a,u;i=e,a=r,u=n,(o=t).undoManager.transact((function(){var t,e,n,r,c=o.selection,s=c.getRng(),l=0<Ol(o).length;s.collapsed&&!l&&(n=wl(t=o,e=s,[{inline:"span"}]),e.setStart(n.startContainer,n.startOffset),e.setEnd(n.endContainer,n.endOffset),t.selection.setRng(e)),c.getRng().collapsed&&!l?(yu(r=Nl(o.getDoc(),u,i,a.decorate),yo),c.getRng().insertNode(r.dom),c.select(r.dom)):zl(c,!1,(function(){Dl(o,(function(t){!function(t,e,n,r,o){function i(){s.clear()}function a(t){I(t,l)}var u=[],c=Nl(t.getDoc(),o,n,r),s=su(),l=function(e){var n,r,o,l,f,d;switch(o=t,f="span",d=Ee(l=e),Ae(l).fold((function(){return"skipping"}),(function(t){return"br"===d||En(n=l)&&Al(n)===xo?"valid":On(e=l)&&hu(e,Pu())?"existing":Is(l.dom)?"caret":tl(o,f,d)&&tl(o,Ee(t),f)?"valid":"invalid-child";var e,n}))){case"invalid-child":i(),a(Mn(e)),i();break;case"valid":We(n=e,r=s.get().getOrThunk((function(){var t=wu(c);return u.push(t),s.set(t),t}))),Nn(r,n)}};Cl(t.dom,e,(function(t){i(),a(V(t,Oe.fromDom))}))}(o,t,i,a.decorate,u)}))}))}))}))},annotationChanged:function(t,e){i.addListener(t,e)},remove:function(e){vu(t,vt.some(e)).each((function(t){I(t.elements,Ke)}))},getAll:function(e){var n,r,o;return rt((n=e,r=pu(Oe.fromDom(t.getBody()),"["+Uu()+'="'+n+'"]'),o={},I(r,(function(t){var e=vn(t,ju()),n=ut(o,e).getOr([]);o[e]=n.concat([t])})),o),(function(t){return V(t,(function(t){return t.dom}))}))}}}function Rl(t){return{getBookmark:O(tf,t),moveToBookmark:O(Gs,t)}}function Hl(t){return Ao(t)||!!Ro(e=t)&&!0!==j(wt(e.getElementsByTagName("*")),(function(t,e){return t||_o(e)}),!1);var e}(os=rs=rs||{})[os.Backwards=-1]="Backwards",os[os.Forwards=1]="Forwards";var Vl,Il,Ll,Fl=Xn,Pl=Pn,Ul=Ln,jl=qn,Wl=Fr,ql=Pr,Gl=function(t,e,n){var r,o,i;if(!Ul(n)||!e)return null;if(e.isEqual(ic.after(n))&&n.lastChild){if(i=ic.after(n.lastChild),t<0&&Wl(n.lastChild)&&Ul(n.lastChild))return jl(n.lastChild)?ic.before(n.lastChild):i}else i=e;var a,u,c,s=i.container(),l=i.offset();if(Pl(s)){if(t<0&&0<l)return ic(s,--l);if(0<t&&l<s.length)return ic(s,++l);r=s}else{if(t<0&&0<l&&(f=Ds(s,l-1),Wl(f)))return!Hl(f)&&(o=qc(f,t,ql,f))?Pl(o)?ic(o,o.data.length):ic.after(o):Pl(f)?ic(f,f.data.length):ic.before(f);if(0<t&&l<s.childNodes.length&&(f=Ds(s,l),Wl(f)))return jl(f)?(a=n,(c=(u=f).nextSibling)&&Wl(c)?Pl(c)?ic(c,0):ic.before(c):Gl(rs.Forwards,ic.after(u),a)):!Hl(f)&&(o=qc(f,t,ql,f))?Pl(o)?ic(o,0):ic.before(o):Pl(f)?ic(f,0):ic.after(f);r=f||i.getNode()}if((0<t&&i.isAtEnd()||t<0&&i.isAtStart())&&(r=qc(r,t,z,n,!0),ql(r,n)))return zs(t,r);var f=qc(r,t,ql,n),d=ht(P(function(t,e){for(var n=[];t&&t!==e;)n.push(t),t=t.parentNode;return n}(s,n),Fl));return!d||f&&d.contains(f)?f?zs(t,f):null:0<t?ic.after(d):ic.before(d)},$l=function(t,e,n){var r=As(e);return vt.from(t?r.next(n):r.prev(n))},Xl=function(t,e,n,r){return Hs(t,e,n).bind((function(n){return r(n)?Xl(t,e,n,r):vt.some(n)}))},Kl=O($l,!0),Yl=O($l,!1),Jl=O(Vs,!0),Ql=O(Vs,!1),Zl="_mce_caret",tf=function(t,e,n){return 2===e?vc(Co,n,t):3===e?(o=(r=t).getRng(),{start:lc(r.dom.getRoot(),ic.fromRangeStart(o)),end:lc(r.dom.getRoot(),ic.fromRangeEnd(o))}):e?{rng:t.getRng()}:yc(t,!1);var r,o},ef=(Vl=yo,function(t){return Vl===t}),nf=function(t,e){return void 0===e&&(e=!1),!(!u(t)||!Pn(t))&&Ur(e?t.data.replace(/ /g," "):t.data)},rf=$s,of=al,af=nf,uf=Zs,cf=function(t,e,n,r){var o=n.parentNode;return!u(n[r])&&(!(o!==e&&!a(o)&&!t.isBlock(o))||cf(t,e,o,r))},sf=function(t){return Ie(t).fold(f([t]),(function(e){return[t].concat(sf(e))}))},lf=function(t){return Le(t).fold(f([t]),(function(e){return"br"===Ee(e)?Ne(e).map((function(e){return[t].concat(lf(e))})).getOr([]):[t].concat(lf(e))}))},ff=(Il=En,{get:function(t){if(!Il(t))throw new Error("Can only get text value of a text node");return Ll(t).getOr("")},getOption:Ll=function(t){return Il(t)?vt.from(t.dom.nodeValue):vt.none()},set:function(t,e){if(!Il(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=e}});function df(t,e){for(;e&&e!==t;){if($n(e)||Xn(e))return e;e=e.parentNode}return null}function mf(t,e,n){if(!n.collapsed){if(we.browser.isIE()&&n.startOffset===n.endOffset-1&&n.startContainer===n.endContainer){var r=n.startContainer.childNodes[n.startOffset];if(Ln(r))return H(r.getClientRects(),(function(n){return Du(n,t,e)}))}return H(n.getClientRects(),(function(n){return Du(n,t,e)}))}}function gf(t,e,n){return t.fire(e,n)}function hf(t,e,n,r){return t.fire("FormatApply",{format:e,node:n,vars:r})}function pf(t,e,n,r){return t.fire("FormatRemove",{format:e,node:n,vars:r})}function vf(t,e){function n(t){return t&&("IMG"===t.nodeName||e.dom.is(t,"figure.image"))}function r(t){return Yn(t)||D.hasClass(t,"mce-preview-object")}function o(t){var r=t.target;!function(t,e){if("longpress"!==t.type&&0!==t.type.indexOf("touch"))return n(t.target)&&!mf(t.clientX,t.clientY,e);var r=t.touches[0];return n(t.target)&&!mf(r.clientX,r.clientY,e)}(t,e.selection.getRng())||t.isDefaultPrevented()||e.selection.select(r)}function i(t){return D.is(t,"figure.image")?[t.querySelector("img")]:D.hasClass(t,"mce-preview-object")&&u(t.firstElementChild)?[t,t.firstElementChild]:[t]}function a(t){var n=Dc(e);return!!n&&"false"!==t.getAttribute("data-mce-resize")&&t!==e.getBody()&&(D.hasClass(t,"mce-preview-object")?Ft(Oe.fromDom(t.firstElementChild),n):Ft(Oe.fromDom(t),n))}function c(t,n,r){u(r)&&I(i(t),(function(t){t.style[n]||!e.schema.isValid(t.nodeName.toLowerCase(),n)?D.setStyle(t,n,r):D.setAttrib(t,n,""+r)}))}function s(t,e,n){c(t,"width",e),c(t,"height",n)}function l(t){var o,i,a,u,c,l,f=t.screenX-y,d=t.screenY-x;O=f*v[2]+w,E=d*v[3]+C,O=O<5?5:O,E=E<5?5:E,((n(g)||r(g))&&!1!==e.getParam("resize_img_proportional",!0,"boolean")?!Df.modifierPressed(t):Df.modifierPressed(t))&&(B(f)>B(d)?(E=R(O*S),O=R(E/S)):(O=R(E/S),E=R(O*S))),s(h,O,E),o=v.startPos.x+f,i=v.startPos.y+d,D.setStyles(p,{left:o=0<o?o:0,top:i=0<i?i:0,display:"block"}),p.innerHTML=O+" × "+E,v[2]<0&&h.clientWidth<=O&&D.setStyle(h,"left",void 0+(w-O)),v[3]<0&&h.clientHeight<=E&&D.setStyle(h,"top",void 0+(C-E)),(f=H.scrollWidth-_)+(d=H.scrollHeight-T)!=0&&D.setStyles(p,{left:o-f,top:i-d}),k||(a=g,u=w,c=C,l="corner-"+v.name,e.fire("ObjectResizeStart",{target:a,width:u,height:c,origin:l}),k=!0)}function f(n){function r(t,e){if(t)do{if(t===e)return 1}while(t=t.parentNode)}var o;k||e.removed||(z(D.select("img[data-mce-selected],hr[data-mce-selected]"),(function(t){t.removeAttribute(M)})),o="mousedown"===n.type?n.target:t.getNode(),r(o=D.$(o).closest("table,img,figure.image,hr,video,span.mce-preview-object")[0],H)&&(m(),r(t.getStart(!0),o)&&r(t.getEnd(!0),o))?F(o):P())}function d(t){return zf(df(e.getBody(),t))}function m(){try{e.getDoc().execCommand("enableObjectResizing",!1,"false")}catch(t){}}var g,h,p,v,b,y,x,w,C,S,k,O,E,_,T,M="data-mce-selected",D=e.dom,z=ke.each,A=e.getDoc(),N=document,B=Math.abs,R=Math.round,H=e.getBody(),V={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]},L=function(){var t,n,r,o,i=k;k=!1,i&&(c(g,"width",O),c(g,"height",E)),D.unbind(A,"mousemove",l),D.unbind(A,"mouseup",L),N!==A&&(D.unbind(N,"mousemove",l),D.unbind(N,"mouseup",L)),D.remove(h),D.remove(p),D.remove(b),F(g),i&&(t=g,n=O,r=E,o="corner-"+v.name,e.fire("ObjectResized",{target:t,width:n,height:r,origin:o}),D.setAttrib(g,"style",D.getAttrib(g,"style"))),e.nodeChanged()},F=function(t){U();var n=D.getPos(t,H),o=n.x,u=n.y,c=t.getBoundingClientRect(),f=c.width||c.right-c.left,d=c.height||c.bottom-c.top;g!==t&&(P(),g=t,O=E=0);var m=e.fire("ObjectSelected",{target:t}),k=D.getAttrib(g,M,"1");a(t)&&!m.isDefaultPrevented()?z(V,(function(t,e){var n=D.get("mceResizeHandle"+e);n&&D.remove(n),n=D.add(H,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all",class:"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===we.ie&&(n.contentEditable=!1),D.bind(n,"mousedown",(function(n){var a,c,m;n.stopImmediatePropagation(),n.preventDefault(),a=n,m=i(g)[0],y=a.screenX,x=a.screenY,w=m.clientWidth,C=m.clientHeight,S=C/w,(v=t).name=e,v.startPos={x:f*t[0]+o,y:d*t[1]+u},_=H.scrollWidth,T=H.scrollHeight,b=D.add(H,"div",{class:"mce-resize-backdrop","data-mce-bogus":"all"}),D.setStyles(b,{position:"fixed",left:"0",top:"0",width:"100%",height:"100%"}),h=r(c=g)?D.create("img",{src:we.transparentSrc}):c.cloneNode(!0),D.addClass(h,"mce-clonedresizable"),D.setAttrib(h,"data-mce-bogus","all"),h.contentEditable="false",D.setStyles(h,{left:o,top:u,margin:0}),s(h,f,d),h.removeAttribute(M),H.appendChild(h),D.bind(A,"mousemove",l),D.bind(A,"mouseup",L),N!==A&&(D.bind(N,"mousemove",l),D.bind(N,"mouseup",L)),p=D.add(H,"div",{class:"mce-resize-helper","data-mce-bogus":"all"},w+" × "+C)})),t.elm=n,D.setStyles(n,{left:f*t[0]+o-n.offsetWidth/2,top:d*t[1]+u-n.offsetHeight/2})})):P(),D.getAttrib(g,M)||g.setAttribute(M,k)},P=function(){U(),g&&g.removeAttribute(M),nt(V,(function(t,e){var n=D.get("mceResizeHandle"+e);n&&(D.unbind(n),D.remove(n))}))},U=function(){nt(V,(function(t){t.elm&&(D.unbind(t.elm),delete t.elm)}))};return e.on("init",(function(){var t;m(),(we.browser.isIE()||we.browser.isEdge())&&(e.on("mousedown click",(function(t){var n=t.target,r=n.nodeName;k||!/^(TABLE|IMG|HR)$/.test(r)||d(n)||(2!==t.button&&e.selection.select(n,"TABLE"===r),"mousedown"===t.type&&e.nodeChanged())})),D.bind(H,"mscontrolselect",t=function(t){function n(t){Or.setEditorTimeout(e,(function(){return e.selection.select(t)}))}if(d(t.target)||Yn(t.target))return t.preventDefault(),void n(t.target);/^(TABLE|IMG|HR)$/.test(t.target.nodeName)&&(t.preventDefault(),"IMG"===t.target.tagName&&n(t.target))}),e.on("remove",(function(){return D.unbind(H,"mscontrolselect",t)})));var n=Or.throttle((function(t){e.composing||f(t)}));e.on("NodeChange ResizeEditor ResizeWindow ResizeContent drop",n),e.on("keyup compositionend",(function(t){g&&"TABLE"===g.nodeName&&n(t)})),e.on("hide blur",P),e.on("contextmenu longpress",o,!0)})),e.on("remove",U),{isResizable:a,showResizeRect:F,hideResizeRect:P,updateResizeRect:f,destroy:function(){g=h=b=null}}}function bf(t){return $n(t)||Xn(t)}function yf(t,e,n){var r,o,i,a,u,c=n;if(c.caretPositionFromPoint)(o=c.caretPositionFromPoint(t,e))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(c.caretRangeFromPoint)r=c.caretRangeFromPoint(t,e);else if(c.body.createTextRange){r=c.body.createTextRange();try{r.moveToPoint(t,e),r.collapse(!0)}catch(o){r=function(t,e,n){var r,o=n.elementFromPoint(t,e),i=n.body.createTextRange();if(o&&"HTML"!==o.tagName||(o=n.body),i.moveToElementText(o),0<(r=(r=ke.toArray(i.getClientRects())).sort((function(t,n){return(t=Math.abs(Math.max(t.top-e,t.bottom-e)))-Math.abs(Math.max(n.top-e,n.bottom-e))}))).length){e=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(t,e),i.collapse(!0),i}catch(t){}}return null}(t,e,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Xn(function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(u,a,bf))?null:i}return r}function xf(t,e){return t&&e&&t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}function wf(t,e,n){return null!==function(t,e,n){for(;t&&t!==e;){if(n(t))return t;t=t.parentNode}return null}(t,e,n)}function Cf(t){return t&&"TABLE"===t.nodeName}function Sf(t,e,n){for(var r=new _r(e,t.getParent(e.parentNode,t.isBlock)||t.getRoot());e=r[n?"prev":"next"]();)if(qn(e))return 1}function kf(t,e,n,r,o){var i,a,u=t.getRoot(),c=t.schema.getNonEmptyElements(),s=t.getParent(o.parentNode,t.isBlock)||u;if(r&&qn(o)&&e&&t.isEmpty(s))return vt.some(ic(o.parentNode,t.nodeIndex(o)));for(var l,f,d=new _r(o,s);a=d[r?"prev":"next"]();){if("false"===t.getContentEditableParent(a)||(f=u,Br(l=a)&&!1===wf(l,f,Is)))return vt.none();if(Pn(a)&&0<a.nodeValue.length)return!1===wf(a,u,(function(t){return"A"===t.nodeName}))?vt.some(ic(a,r?a.nodeValue.length:0)):vt.none();if(t.isBlock(a)||c[a.nodeName.toLowerCase()])return vt.none();i=a}return n&&i?vt.some(ic(i,0)):vt.none()}function Of(t,e,n,r){var o,i=t.getRoot(),a=!1,u=r[(n?"start":"end")+"Container"],c=r[(n?"start":"end")+"Offset"],s=Ln(u)&&c===u.childNodes.length,l=t.schema.getNonEmptyElements(),f=n;if(Br(u))return vt.none();if(Ln(u)&&c>u.childNodes.length-1&&(f=!1),jn(u)&&(u=i,c=0),u===i){if(f&&(d=u.childNodes[0<c?c-1:0])){if(Br(d))return vt.none();if(l[d.nodeName]||Cf(d))return vt.none()}if(u.hasChildNodes()){if(c=Math.min(!f&&0<c?c-1:c,u.childNodes.length-1),u=u.childNodes[c],c=Pn(u)&&s?u.data.length:0,!e&&u===i.lastChild&&Cf(u))return vt.none();if(function(t,e){for(;e&&e!==t;){if(Xn(e))return 1;e=e.parentNode}}(i,u)||Br(u))return vt.none();if(u.hasChildNodes()&&!1===Cf(u)){var d=u,m=new _r(u,i);do{if(Xn(d)||Br(d)){a=!1;break}if(Pn(d)&&0<d.nodeValue.length){c=f?0:d.nodeValue.length,u=d,a=!0;break}if(l[d.nodeName.toLowerCase()]&&(!(o=d)||!/^(TD|TH|CAPTION)$/.test(o.nodeName))){c=t.nodeIndex(d),u=d.parentNode,f||c++,a=!0;break}}while(d=f?m.next():m.prev())}}}return e&&(Pn(u)&&0===c&&kf(t,s,e,!0,u).each((function(t){u=t.container(),c=t.offset(),a=!0})),Ln(u)&&(!(d=(d=u.childNodes[c])||u.childNodes[c-1])||!qn(d)||d.previousSibling&&"A"===d.previousSibling.nodeName||Sf(t,d,!1)||Sf(t,d,!0)||kf(t,s,e,!0,d).each((function(t){u=t.container(),c=t.offset(),a=!0})))),f&&!e&&Pn(u)&&c===u.nodeValue.length&&kf(t,s,e,!1,u).each((function(t){u=t.container(),c=t.offset(),a=!0})),a?vt.some(ic(u,c)):vt.none()}function Ef(t,e){var n=e.collapsed,r=e.cloneRange(),o=ic.fromRangeStart(e);return Of(t,n,!0,r).each((function(t){n&&ic.isAbove(o,t)||r.setStart(t.container(),t.offset())})),n||Of(t,n,!1,r).each((function(t){r.setEnd(t.container(),t.offset())})),n&&r.collapse(!0),xf(e,r)?vt.none():vt.some(r)}function _f(t,e){return t.splitText(e)}function Tf(t){var e=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset;return e===r&&Pn(e)?0<n&&n<e.nodeValue.length&&(e=(r=_f(e,n)).previousSibling,n<o?(e=r=_f(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Pn(e)&&0<n&&n<e.nodeValue.length&&(e=_f(e,n),n=0),Pn(r)&&0<o&&o<r.nodeValue.length&&(o=(r=_f(r,o).previousSibling).nodeValue.length)),{startContainer:e,startOffset:n,endContainer:r,endOffset:o}}function Mf(t){return{walk:function(e,n){return Cl(t,e,n)},split:Tf,normalize:function(e){return Ef(t,e).fold(D,(function(t){return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),!0}))}}}Rl.isBookmarkNode=$s;var Df={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:function(t){return t.shiftKey||t.ctrlKey||t.altKey||Df.metaKeyPressed(t)},metaKeyPressed:function(t){return we.mac?t.metaKey:t.ctrlKey&&!t.altKey}},zf=Xn;Mf.compareRanges=xf,Mf.getCaretRangeFromPoint=yf,Mf.getSelectedNode=zu,Mf.getNode=Au;var Af,Nf,Bf=(Af="height",Nf=function(t){var e=t.dom;return Rn(t)?e.getBoundingClientRect().height:e.offsetHeight},{set:function(t,e){if(!k(e)&&!e.match(/^[0-9]+$/))throw new Error(Af+".set accepts only positive integer values. Value was "+e);var n=t.dom;mn(n)&&(n.style[Af]=e+"px")},get:Rf,getOuter:Rf,aggregate:Hf,max:function(t,e,n){var r=Hf(t,n);return r<e?e-r:0}});function Rf(t){var e=Nf(t);if(e<=0||null===e){var n=xn(t,Af);return parseFloat(n)||0}return e}function Hf(t,e){return j(e,(function(e,n){var r=xn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)}function Vf(t){return"textarea"===Ee(t)}function If(t,e){var n=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return Vn(n.offsetLeft,n.offsetTop);var i=Ye(null==r?void 0:r.pageYOffset,o.scrollTop),a=Ye(null==r?void 0:r.pageXOffset,o.scrollLeft),u=Ye(o.clientTop,n.clientTop),c=Ye(o.clientLeft,n.clientLeft);return In(t).translate(a-c,i-u)}(t),r=Bf.get(t);return{element:t,bottom:n.top+r,height:r,pos:n,cleanup:e}}function Lf(t,e,n,r){Od(t,(function(o,i){return kd(t,e,n,r)}),n)}function Ff(t,e,n,r,o){var i={elm:r.element.dom,alignToTop:o};t.fire("ScrollIntoView",i).isDefaultPrevented()||(n(e,Je(e).top,r,o),t.fire("AfterScrollIntoView",i))}function Pf(t,e,n,r){var o=Oe.fromDom(t.getDoc());Ff(t,o,n,If(Oe.fromDom(e),c),r)}function Uf(t,e,n,r){var o,i=t.pos;n?Qe(i.left,i.top,r):(o=i.top-e+t.height,Qe(i.left,o,r))}function jf(t,e,n,r,o){var i=n+e,a=r.pos.top,u=r.bottom,c=n<=u-a;a<e?Uf(r,n,!1!==o,t):i<a?Uf(r,n,c?!1!==o:!0===o,t):i<u&&!c&&Uf(r,n,!0===o,t)}function Wf(t,e,n,r){jf(t,e,t.dom.defaultView.innerHeight,n,r)}function qf(t,e,n,r){jf(t,e,t.dom.defaultView.innerHeight,n,r);var o,i,a,u,c,s,l,f=(o=n.element,u=Je(Oe.fromDom(document)),a=(i=Sd).owner(o),c=Cd(i,a),s=In(o),l=U(c,(function(t,e){var n=In(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0}),Vn(l.left+s.left+u.left,l.top+s.top+u.top)),d=en(window);f.top<d.y?Ze(n.element,!1!==r):f.top>d.bottom&&Ze(n.element,!0===r)}function Gf(t,e,n){return Lf(t,Wf,e,n)}function $f(t,e,n){return Pf(t,e,Wf,n)}function Xf(t,e,n){return Lf(t,qf,e,n)}function Kf(t,e,n){return Pf(t,e,qf,n)}function Yf(t,e,n){(t.inline?Gf:Xf)(t,e,n)}function Jf(t){var e=An(t).dom;return t.dom===e.activeElement}function Qf(t){return void 0===t&&(t=Oe.fromDom(document)),vt.from(t.dom.activeElement).map(Oe.fromDom)}function Zf(t,e){var n=En(e)?Al(e).length:Mn(e).length+1;return n<t?n:t<0?0:t}function td(t){return Md.range(t.start,Zf(t.soffset,t.start),t.finish,Zf(t.foffset,t.finish))}function ed(t,e){return!rn(e.dom)&&(jt(t,e)||Ut(t,e))}function nd(t){return function(e){return ed(t,e.start)&&ed(t,e.finish)}}function rd(t){return!0===t.inline||Dd.isIE()}function od(t){return Md.range(Oe.fromDom(t.startContainer),t.startOffset,Oe.fromDom(t.endContainer),t.endOffset)}function id(t){var e=document.createRange();try{return e.setStart(t.start.dom,t.soffset),e.setEnd(t.finish.dom,t.foffset),vt.some(e)}catch(t){return vt.none()}}function ad(t){var e,n,r=rd(t)?((n=ze(e=Oe.fromDom(t.getBody())).dom.getSelection())&&0!==n.rangeCount?vt.from(n.getRangeAt(0)):vt.none()).map(od).filter(nd(e)):vt.none();t.bookmark=r.isSome()?r:t.bookmark}function ud(t){return(t.bookmark||vt.none()).bind((function(e){return n=Oe.fromDom(t.getBody()),vt.from(e).filter(nd(n)).map(td);var n})).bind(id)}function cd(t,e){var n=t.getParam("custom_ui_selector","","string");return null!==Ad.getParent(e,(function(e){return zd.isEditorUIElement(e)||!!n&&t.dom.is(e,n)}))}function sd(t,e){var n=e.editor;(function(t){var e=lu((function(){ad(t)}),0);t.on("init",(function(){function n(){o.throttle()}var r,o,i,a,u,c;t.inline&&(r=t,o=e,Ja.DOM.bind(document,"mouseup",n),r.on("remove",(function(){Ja.DOM.unbind(document,"mouseup",n)}))),i=t,a=e,de().browser.isIE()?(c=i).on("focusout",(function(){ad(c)})):(u=a,i.on("mouseup touchend",(function(t){u.throttle()}))),i.on("keyup NodeChange",(function(t){"nodechange"===t.type&&t.selectionChange||ad(i)}))})),t.on("remove",(function(){e.cancel()}))})(n),n.on("focusin",(function(){var e=t.focusedEditor;e!==n&&(e&&e.fire("blur",{focusedEditor:n}),t.setActive(n),(t.focusedEditor=n).fire("focus",{blurredEditor:e}),n.focus(!0))})),n.on("focusout",(function(){Or.setEditorTimeout(n,(function(){var e=t.focusedEditor;cd(n,function(t){try{return Qf(An(Oe.fromDom(t.getElement()))).fold((function(){return document.body}),(function(t){return t.dom}))}catch(t){return document.body}}(n))||e!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null)}))})),wd||(wd=function(e){var n=t.activeEditor;n&&function(t){if(zn()&&u(t.target)){var e=Oe.fromDom(t.target);if(On(e)&&u(e.dom.shadowRoot)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return Z(n)}}return vt.from(t.target)}(e).each((function(e){e.ownerDocument===document&&(e===document.body||cd(n,e)||t.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),t.focusedEditor=null))}))},Ad.bind(document,"focusin",wd))}function ld(t,e){t.focusedEditor===e.editor&&(t.focusedEditor=null),t.activeEditor||(Ad.unbind(document,"focusin",wd),wd=null)}function fd(t,e){var n,r;n=Oe.fromDom(t.getBody()),((r=e).collapsed?vt.from(Au(r.startContainer,r.startOffset)).map(Oe.fromDom):vt.none()).bind((function(t){return ho(t)?vt.some(t):!1===jt(n,t)?vt.some(n):vt.none()})).bind((function(t){return Jl(t.dom)})).fold((function(){t.selection.normalize()}),(function(e){return t.selection.setRng(e.toRange())}))}function dd(t){if(t.setActive)try{t.setActive()}catch(e){t.focus()}else t.focus()}function md(t){return t.inline?(r=t.getBody())&&(Jf(e=Oe.fromDom(r))||Qf(An(n=e)).filter((function(t){return n.dom.contains(t.dom)})).isSome()):t.iframeElement&&Jf(Oe.fromDom(t.iframeElement));var e,n,r}function gd(t,e,n,r,o){var i=n?e.startContainer:e.endContainer,a=n?e.startOffset:e.endOffset;return vt.from(i).map(Oe.fromDom).map((function(t){return r&&e.collapsed?t:Ve(t,o(t,a)).getOr(t)})).bind((function(t){return On(t)?vt.some(t):Ae(t).filter(On)})).map((function(t){return t.dom})).getOr(t)}function hd(t,e,n){return gd(t,e,!0,n,(function(t,e){return Math.min(Fe(t),e)}))}function pd(t,e,n){return gd(t,e,!1,n,(function(t,e){return 0<e?e-1:e}))}function vd(t,e){for(var n=t;t&&Pn(t)&&0===t.length;)t=e?t.nextSibling:t.previousSibling;return t||n}function bd(t,e){return V(e,(function(e){var n=t.fire("GetSelectionRange",{range:e});return n.range!==e?n.range:e}))}function yd(t,e,n){var r=n?"lastChild":"firstChild",o=n?"prev":"next";if(t[r])return t[r];if(t!==e){var i=t[o];if(i)return i;for(var a=t.parent;a&&a!==e;a=a.parent)if(i=a[o])return i}}function xd(t){var e="a"===t.name&&!t.attr("href")&&t.attr("id");return t.attr("name")||t.attr("id")&&!t.firstChild||t.attr("data-mce-bookmark")||e}var wd,Cd=function(t,e){return t.view(e).fold(f([]),(function(e){var n=t.owner(e),r=Cd(t,n);return[e].concat(r)}))},Sd=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?vt.none():vt.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Oe.fromDom)},owner:De}),kd=function(t,e,n,r){var o=Oe.fromDom(t.getBody()),i=Oe.fromDom(t.getDoc());o.dom.offsetWidth;var a,u,c=(a=function(t,e){var n=Mn(t);if(0===n.length||Vf(t))return{element:t,offset:e};if(e<n.length&&!Vf(n[e]))return{element:n[e],offset:0};var r=n[n.length-1];return Vf(r)?{element:t,offset:e}:"img"===Ee(r)?{element:r,offset:1}:En(r)?{element:r,offset:Al(r).length}:{element:r,offset:Mn(r).length}}(Oe.fromDom(n.startContainer),n.startOffset),u=Oe.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">\ufeff</span>'),We(a.element,u),If(u,(function(){return Bn(u)})));Ff(t,i,e,c,r),c.cleanup()},Od=function(t,e,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;e(Oe.fromDom(r),Oe.fromDom(i));var u=t.dom.createRng();u.setStart(r,o),u.setEnd(i,a),t.selection.setRng(n)},Ed=rr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),_d=(Ed.before,Ed.on,Ed.after,function(t){return t.fold(d,d,d)}),Td=rr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Md={domRange:Td.domRange,relative:Td.relative,exact:Td.exact,exactFromRange:function(t){return Td.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){return ze(t.match({domRange:function(t){return Oe.fromDom(t.startContainer)},relative:function(t,e){return _d(t)},exact:function(t,e,n,r){return t}}))},range:function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}}},Dd=de().browser,zd={isEditorUIElement:function(t){var e=t.className.toString();return-1!==e.indexOf("tox-")||-1!==e.indexOf("mce-")}},Ad=Ja.DOM,Nd=function(t){return t.editorManager.setActive(t)},Bd={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Rd=(Hd.create=function(t,e){var n=new Hd(t,Bd[t]||1);return e&&nt(e,(function(t,e){n.attr(e,t)})),n},Hd.prototype.replace=function(t){return t.parent&&t.remove(),this.insert(t,this),this.remove(),this},Hd.prototype.attr=function(t,e){var n,r=this;if("string"!=typeof t)return null!=t&&nt(t,(function(t,e){r.attr(e,t)})),r;if(n=r.attributes){if(void 0===e)return n.map[t];if(null===e){if(t in n.map){delete n.map[t];for(var o=n.length;o--;)if(n[o].name===t)return n.splice(o,1),r}return r}if(t in n.map){for(o=n.length;o--;)if(n[o].name===t){n[o].value=e;break}}else n.push({name:t,value:e});return n.map[t]=e,r}},Hd.prototype.clone=function(){var t,e=new Hd(this.name,this.type);if(t=this.attributes){var n=[];n.map={};for(var r=0,o=t.length;r<o;r++){var i=t[r];"id"!==i.name&&(n[n.length]={name:i.name,value:i.value},n.map[i.name]=i.value)}e.attributes=n}return e.value=this.value,e.shortEnded=this.shortEnded,e},Hd.prototype.wrap=function(t){return this.parent.insert(t,this),t.append(this),this},Hd.prototype.unwrap=function(){for(var t=this.firstChild;t;){var e=t.next;this.insert(t,this,!0),t=e}this.remove()},Hd.prototype.remove=function(){var t=this.parent,e=this.next,n=this.prev;return t&&(t.firstChild===this?(t.firstChild=e)&&(e.prev=null):n.next=e,t.lastChild===this?(t.lastChild=n)&&(n.next=null):e.prev=n,this.parent=this.next=this.prev=null),this},Hd.prototype.append=function(t){t.parent&&t.remove();var e=this.lastChild;return e?((e.next=t).prev=e,this.lastChild=t):this.lastChild=this.firstChild=t,t.parent=this,t},Hd.prototype.insert=function(t,e,n){t.parent&&t.remove();var r=e.parent||this;return n?(e===r.firstChild?r.firstChild=t:e.prev.next=t,t.prev=e.prev,(t.next=e).prev=t):(e===r.lastChild?r.lastChild=t:e.next.prev=t,t.next=e.next,(t.prev=e).next=t),t.parent=r,t},Hd.prototype.getAll=function(t){for(var e=[],n=this.firstChild;n;n=yd(n,this))n.name===t&&e.push(n);return e},Hd.prototype.children=function(){for(var t=[],e=this.firstChild;e;e=e.next)t.push(e);return t},Hd.prototype.empty=function(){if(this.firstChild){for(var t=[],e=this.firstChild;e;e=yd(e,this))t.push(e);for(var n=t.length;n--;)(e=t[n]).parent=e.firstChild=e.lastChild=e.next=e.prev=null}return this.firstChild=this.lastChild=null,this},Hd.prototype.isEmpty=function(t,e,n){void 0===e&&(e={});var r=this.firstChild;if(xd(this))return!1;if(r)do{if(1===r.type){if(r.attr("data-mce-bogus"))continue;if(t[r.name])return!1;if(xd(r))return!1}if(8===r.type)return!1;if(3===r.type&&!function(t){if(Ur(t.value)){var e=t.parent;return!e||"span"===e.name&&!e.attr("style")||!/^[ ]+$/.test(t.value)}}(r))return!1;if(3===r.type&&r.parent&&e[r.parent.name]&&Ur(r.value))return!1;if(n&&n(r))return!1}while(r=yd(r,this));return!0},Hd.prototype.walk=function(t){return yd(this,null,t)},Hd);function Hd(t,e){this.name=t,1===(this.type=e)&&(this.attributes=[],this.attributes.map={})}function Vd(t,e){return t.replace(e.re,(function(t){return ut(e.uris,t).getOr(t)}))}var Id=ke.each,Ld=ke.trim,Fd="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Pd={ftp:21,http:80,https:443,mailto:25},Ud=["img","video"],jd=(Wd.parseDataUri=function(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:e=r?r[1]:e,data:n[1]}},Wd.isDomSafe=function(t,e,n){if((n=void 0===n?{}:n).allow_script_urls)return!0;var r,o,i,a,c=Yo.decode(t).replace(/[\s\u0000-\u001F]+/g,"");try{c=decodeURIComponent(c)}catch(t){c=unescape(c)}return!(/((java|vb)script|mhtml):/i.test(c)||(o=c,i=e,!(r=n).allow_html_data_urls&&(/^data:image\//i.test(o)?(u(a=r.allow_svg_data_urls)?!a:!u(i)||!R(Ud,i))&&/^data:image\/svg\+xml/i.test(o):/^data:/i.test(o))))},Wd.getDocumentBaseUrl=function(t){var e=0!==t.protocol.indexOf("http")&&"file:"!==t.protocol?t.href:t.protocol+"//"+t.host+t.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(e)&&(e=e.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(e)||(e+="/")),e},Wd.prototype.setPath=function(t){var e=/^(.*?)\/?(\w+)?$/.exec(t);this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},Wd.prototype.toRelative=function(t){var e;if("./"===t)return t;var n=new Wd(t,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(e=this.toRelPath(this.path,n.path),n.query&&(e+="?"+n.query),n.anchor&&(e+="#"+n.anchor),e)},Wd.prototype.toAbsolute=function(t,e){var n=new Wd(t,{base_uri:this});return n.getURI(e&&this.isSameOrigin(n))},Wd.prototype.isSameOrigin=function(t){if(this.host==t.host&&this.protocol==t.protocol){if(this.port==t.port)return!0;var e=Pd[this.protocol];if(e&&(this.port||e)==(t.port||e))return!0}return!1},Wd.prototype.toRelPath=function(t,e){var n,r,o=0,i="",a=t.substring(0,t.lastIndexOf("/")).split("/"),u=e.split("/");if(a.length>=u.length)for(n=0,r=a.length;n<r;n++)if(n>=u.length||a[n]!==u[n]){o=n+1;break}if(a.length<u.length)for(n=0,r=u.length;n<r;n++)if(n>=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return e;for(n=0,r=a.length-(o-1);n<r;n++)i+="../";for(n=o-1,r=u.length;n<r;n++)i+=n!==o-1?"/"+u[n]:u[n];return i},Wd.prototype.toAbsPath=function(t,e){var n,r,o=0,i=[],a=/\/$/.test(e)?"/":"",u=t.split("/"),c=e.split("/");for(Id(u,(function(t){t&&i.push(t)})),u=i,n=c.length-1,i=[];0<=n;n--)0!==c[n].length&&"."!==c[n]&&(".."!==c[n]?0<o?o--:i.push(c[n]):o++);return 0!==(r=(n=u.length-o)<=0?K(i).join("/"):u.slice(0,n).join("/")+"/"+K(i).join("/")).indexOf("/")&&(r="/"+r),a&&r.lastIndexOf("/")!==r.length-1&&(r+=a),r},Wd.prototype.getURI=function(t){var e;return void 0===t&&(t=!1),this.source&&!t||(e="",t||(this.protocol?e+=this.protocol+"://":e+="//",this.userInfo&&(e+=this.userInfo+"@"),this.host&&(e+=this.host),this.port&&(e+=":"+this.port)),this.path&&(e+=this.path),this.query&&(e+="?"+this.query),this.anchor&&(e+="#"+this.anchor),this.source=e),this.source},Wd);function Wd(t,e){t=Ld(t),this.settings=e||{};var n,r,o,i,a=this.settings.base_uri,u=this;/^([\w\-]+):([^\/]{2})/i.test(t)||/^\s*#/.test(t)?u.source=t:(n=0===t.indexOf("//"),0!==t.indexOf("/")||n||(t=(a&&a.protocol||"http")+"://mce_host"+t),/^[\w\-]*:?\/\//.test(t)||(r=this.settings.base_uri?this.settings.base_uri.path:new Wd(document.location.href).directory,t=this.settings.base_uri&&""==this.settings.base_uri.protocol?"//mce_host"+u.toAbsPath(r,t):(o=/([^#?]*)([#?]?.*)/.exec(t),(a&&a.protocol||"http")+"://mce_host"+u.toAbsPath(r,o[1])+o[2])),t=t.replace(/@@/g,"(mce_at)"),i=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(t),Id(Fd,(function(t,e){var n=(n=i[e])&&n.replace(/\(mce_at\)/g,"@@");u[t]=n})),a&&(u.protocol||(u.protocol=a.protocol),u.userInfo||(u.userInfo=a.userInfo),u.port||"mce_host"!==u.host||(u.port=a.port),u.host&&"mce_host"!==u.host||(u.host=a.host),u.source=""),n&&(u.protocol=""))}function qd(t,e,n){for(var r=/<([!?\/])?([A-Za-z0-9\-_:.]+)/g,o=/(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g,i=t.getShortEndedElements(),a=1,u=n;0!==a;)for(r.lastIndex=u;;){var c=r.exec(e);if(null===c)return u;if("!"===c[1]){u=Yt(c[2],"--")?Kd(e,!1,c.index+"!--".length):Kd(e,!0,c.index+1);break}o.lastIndex=r.lastIndex;var s=o.exec(e);if(!x(s)&&s.index===r.lastIndex){"/"===c[1]?--a:Ot(i,c[2])||(a+=1),u=r.lastIndex+s[0].length;break}}return u}function Gd(t,e){void 0===e&&(e=eo()),t=t||{};var n=Xd(),r=n.createElement("form");!1!==t.fix_self_closing&&(t.fix_self_closing=!0);var o=t.comment||c,i=t.cdata||c,a=t.text||c,u=t.start||c,s=t.end||c,l=t.pi||c,f=t.doctype||c;return{parse:function(c,d){void 0===d&&(d="html"),function(c,d){void 0===d&&(d="html");for(var m,g,h,p,v,b,y,x,w,C,S,k,O,E,_,T,M,D,z,A=c.html,N=0,B=[],R=0,H=Yo.decode,V=ke.makeMap("src,href,data,background,action,formaction,poster,xlink:href"),I="html"===d?0:1,L=function(t){for(var e,n=B.length;n--&&B[n].name!==t;);if(0<=n){for(e=B.length-1;n<=e;e--)(t=B[e]).valid&&s(t.name);B.length=n}},F=function(t,e){return a(Vd(t,c),e)},P=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),t.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),o(Vd(e,c)))},U=function(t,e){var n=t||"",r=!Yt(n,"--"),o=Kd(A,r,e);return t=A.substr(e,o-e),P(r?n+t:t),o+1},j=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^'\">]+(?:\"[^\"]*\"|'[^']*'))*[^\"'>]*(?:\"[^\">]*|'[^'>]*)?|\\s*|\\/)>))","g"),W=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,q=e.getShortEndedElements(),G=t.self_closing_elements||e.getSelfClosingElements(),$=e.getBoolAttrs(),X=t.validate,K=t.remove_internals,Y=t.fix_self_closing,J=e.getSpecialElements(),Q=A+">";m=j.exec(Q);){var Z=m[0];if(N<m.index&&F(H(A.substr(N,m.index-N))),g=m[7])L(g=":"===(g=g.toLowerCase()).charAt(0)?g.substr(1):g);else if(g=m[8]){if(m.index+Z.length>A.length){F(H(A.substr(m.index))),N=m.index+Z.length;continue}w=(g=":"===(g=g.toLowerCase()).charAt(0)?g.substr(1):g)in q,Y&&G[g]&&0<B.length&&B[B.length-1].name===g&&L(g);var tt=function(t,e){var n=t.exec(e);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null}(W,m[9]);if(null!==tt){if("all"===tt){N=qd(e,A,j.lastIndex),j.lastIndex=N;continue}S=!1}if(!X||(C=e.getElementRule(g))){if(S=!0,X&&(E=C.attributes,_=C.attributePatterns),(O=m[9])?((x=-1!==O.indexOf("data-mce-type"))&&K&&(S=!1),(p=[]).map={},O.replace(W,(function(e,o,i,a,u){return function(e,o,i,a,u){var s;if(i=Vd((o=o.toLowerCase())in $?o:H(i||a||u||""),c),X&&!x&&0==(0===(s=o).indexOf("data-")||0===s.indexOf("aria-"))){var l=E[o];if(!l&&_){for(var f=_.length;f--&&!(l=_[f]).pattern.test(o););-1===f&&(l=null)}if(!l)return;if(l.validValues&&!(i in l.validValues))return}("name"===o||"id"===o)&&e in $d&&(i in n||i in r)||V[o]&&!jd.isDomSafe(i,e,t)||x&&(o in V||0===o.indexOf("on"))||(p.map[o]=i,p.push({name:o,value:i}))}(g,o,i,a,u),""}))):(p=[]).map={},X&&!x){if(T=C.attributesRequired,M=C.attributesDefault,D=C.attributesForced,C.removeEmptyAttrs&&!p.length&&(S=!1),D)for(v=D.length;v--;)y=(k=D[v]).name,"{$uid}"===(z=k.value)&&(z="mce_"+R++),p.map[y]=z,p.push({name:y,value:z});if(M)for(v=M.length;v--;)(y=(k=M[v]).name)in p.map||("{$uid}"===(z=k.value)&&(z="mce_"+R++),p.map[y]=z,p.push({name:y,value:z}));if(T){for(v=T.length;v--&&!(T[v]in p.map););-1===v&&(S=!1)}if(k=p.map["data-mce-bogus"]){if("all"===k){N=qd(e,A,j.lastIndex),j.lastIndex=N;continue}S=!1}}S&&u(g,p,w)}else S=!1;if(h=J[g]){h.lastIndex=N=m.index+Z.length,N=(m=h.exec(A))?(S&&(b=A.substr(N,m.index-N)),m.index+m[0].length):(b=A.substr(N),A.length),S&&(0<b.length&&F(b,!0),s(g)),j.lastIndex=N;continue}w||(O&&O.indexOf("/")===O.length-1?S&&s(g):B.push({name:g,valid:S}))}else if(g=m[1])P(g);else if(g=m[2]){if(!(1==I||t.preserve_cdata||0<B.length&&e.isValidChild(B[B.length-1].name,"#cdata"))){N=U("",m.index+2),j.lastIndex=N;continue}i(g)}else if(g=m[3])f(g);else{if((g=m[4])||"<!"===Z){N=U(g,m.index+Z.length),j.lastIndex=N;continue}if(g=m[5]){if(1!=I){N=U("?",m.index+2),j.lastIndex=N;continue}l(g,m[6])}}N=m.index+Z.length}for(N<A.length&&F(H(A.substr(N))),v=B.length-1;0<=v;v--)(g=B[v]).valid&&s(g.name)}(function(t){for(var e,n=/data:[^;<"'\s]+;base64,([a-z0-9\+\/=\s]+)/gi,r=[],o={},i=bu("img"),a=0,u=0;e=n.exec(t);){var c=e[0],s=i+"_"+u++;o[s]=c,a<e.index&&r.push(t.substr(a,e.index-a)),r.push(s),a=e.index+c.length}var l=new RegExp(i+"_[0-9]+","g");return 0===a?{prefix:i,uris:o,html:t,re:l}:(a<t.length&&r.push(t.substr(a)),{prefix:i,uris:o,html:r.join(""),re:l})}(c),d)}}}var $d=ke.makeMap("button,fieldset,form,iframe,img,image,input,object,output,select,textarea"),Xd=Mt((function(){return document.implementation.createHTMLDocument("parser")})),Kd=function(t,e,n){void 0===n&&(n=0);var r=t.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(e){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/g;a.lastIndex=n;var u,c=a.exec(t);return c?c.index+c[0].length:r.length};function Yd(t,e){for(var n,r,o,i,a=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,u=t.schema,c=(n=t.getTempAttrs(),r=e,o=new RegExp(["\\s?("+n.join("|")+')="[^"]+"'].join("|"),"gi"),r.replace(o,"")),s=u.getShortEndedElements();i=a.exec(c);){var l=a.lastIndex,f=i[0].length,d=s[i[1]]?l:Gd.findEndTag(u,c,l);c=c.substring(0,l-f)+c.substring(d);a.lastIndex=l-f}return Co(c)}function Jd(t){return{compare:function(e,n){return e.nodeName===n.nodeName&&!(!o(r(e),r(n))||!o(t.parseStyle(t.getAttrib(e,"style")),t.parseStyle(t.getAttrib(n,"style")))||$s(e)||$s(n));function r(e){var n={};return em(t.getAttribs(e),(function(r){var o=r.nodeName.toLowerCase();0!==o.indexOf("_")&&"style"!==o&&0!==o.indexOf("data-")&&(n[o]=t.getAttrib(e,o))})),n}function o(t,e){var n,r;for(r in t)if(Ot(t,r)){if(void 0===(n=e[r]))return;if(t[r]!==n)return;delete e[r]}for(r in e)if(Ot(e,r))return;return 1}}}}function Qd(t){var e=[],n=(t=t||{}).indent,r=nm(t.indent_before||""),o=nm(t.indent_after||""),i=Yo.getEncodeFunc(t.entity_encoding||"raw",t.entities),a="html"===t.element_format;return{start:function(t,u,c){var s,l,f,d;if(n&&r[t]&&0<e.length&&0<(d=e[e.length-1]).length&&"\n"!==d&&e.push("\n"),e.push("<",t),u)for(s=0,l=u.length;s<l;s++)f=u[s],e.push(" ",f.name,'="',i(f.value,!0),'"');e[e.length]=!c||a?">":" />",c&&n&&o[t]&&0<e.length&&0<(d=e[e.length-1]).length&&"\n"!==d&&e.push("\n")},end:function(t){var r;e.push("</",t,">"),n&&o[t]&&0<e.length&&0<(r=e[e.length-1]).length&&"\n"!==r&&e.push("\n")},text:function(t,n){0<t.length&&(e[e.length]=n?t:i(t))},cdata:function(t){e.push("<![CDATA[",t,"]]>")},comment:function(t){e.push("\x3c!--",t,"--\x3e")},pi:function(t,r){r?e.push("<?",t," ",i(r),"?>"):e.push("<?",t,"?>"),n&&e.push("\n")},doctype:function(t){e.push("<!DOCTYPE",t,">",n?"\n":"")},reset:function(){e.length=0},getContent:function(){return e.join("").replace(/\n$/,"")}}}function Zd(t,e){void 0===e&&(e=eo());var n=Qd(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(r){var o=t.validate,i={3:function(t){n.text(t.value,t.raw)},8:function(t){n.comment(t.value)},7:function(t){n.pi(t.name,t.value)},10:function(t){n.doctype(t.value)},4:function(t){n.cdata(t.value)},11:function(t){if(t=t.firstChild)for(;a(t),t=t.next;);}};n.reset();var a=function(t){var r=i[t.type];if(r)r(t);else{var u=t.name,c=t.shortEnded,s=t.attributes;if(o&&s&&1<s.length){var l=[];l.map={};var f=e.getElementRule(t.name);if(f){for(var d=0,m=f.attributesOrder.length;d<m;d++)(g=f.attributesOrder[d])in s.map&&(h=s.map[g],l.map[g]=h,l.push({name:g,value:h}));var g,h;for(d=0,m=s.length;d<m;d++)(g=s[d].name)in l.map||(h=s.map[g],l.map[g]=h,l.push({name:g,value:h}));s=l}}if(n.start(t.name,s,c),!c){if(t=t.firstChild)for(;a(t),t=t.next;);n.end(u)}}};return 1!==r.type||t.inner?i[11](r):a(r),n.getContent()}}}Gd.findEndTag=qd;var tm=Yd,em=ke.each,nm=ke.makeMap,rm=new Set;function om(t,e){return Ct(t.parseStyle(t.getAttrib(e,"style")))}function im(t,e,n){return vt.from(n.container()).filter(Pn).exists((function(r){var o=t?0:-1;return e(r.data.charAt(n.offset()+o))}))}function am(t){var e=t.container();return Pn(e)&&(0===e.data.length||wo(e.data)&&Rl.isBookmarkNode(e.parentNode))}function um(t,e){return function(n){return vt.from(Xc(t?0:-1,n)).filter(e).isSome()}}function cm(t){return Gn(t)&&"block"===xn(Oe.fromDom(t),"display")}function sm(t){return Xn(t)&&!(Ln(e=t)&&"all"===e.getAttribute("data-mce-bogus"));var e}function lm(t){Xe(t),Nn(t,Oe.fromHtml('<br data-mce-bogus="1">'))}function fm(t){Le(t).each((function(e){Ne(e).each((function(n){lo(t)&&zr(e)&&lo(n)&&Bn(e)}))}))}function dm(t,e){return o=D,jt(r=e,n=t)?function(t,e){for(var n=S(e)?e:D,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=Oe.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(n,(function(t){return o(t)||Ut(t,r)})).slice(0,-1):[];var n,r,o}function mm(t,e){return[t].concat(dm(t,e))}function gm(t,e,n){return Xl(t,e,n,am)}function hm(t,e){return q(mm(Oe.fromDom(e.container()),t),lo)}function pm(t,e,n){return gm(t,e.dom,n).forall((function(t){return hm(e,n).fold((function(){return!1===$c(t,n,e.dom)}),(function(r){return!1===$c(t,n,e.dom)&&jt(r,Oe.fromDom(t.container()))}))}))}function vm(t,e,n){return hm(e,n).fold((function(){return gm(t,e.dom,n).forall((function(t){return!1===$c(t,n,e.dom)}))}),(function(e){return gm(t,e.dom,n).isNone()}))}function bm(t){return ts(t).exists(zr)}function ym(t,e,n){var r=Z(P(mm(Oe.fromDom(n.container()),e),lo)).getOr(e);return $l(t,r.dom,n).filter(bm)}function xm(t,e){return ts(e).exists(zr)||ym(!0,t,e).isSome()}function wm(t,e){return vt.from(e.getNode(!0)).map(Oe.fromDom).exists(zr)||ym(!1,t,e).isSome()}function Cm(t){return ic.isTextPosition(t)&&!t.isAtStart()&&!t.isAtEnd()}function Sm(t,e){return Z(P(mm(Oe.fromDom(e.container()),t),lo)).getOr(t)}function km(t,e){return Cm(e)?Vg(e):Vg(e)||Yl(Sm(t,e).dom,e).exists(Vg)}function Om(t,e){return Cm(e)?Hg(e):Hg(e)||Kl(Sm(t,e).dom,e).exists(Hg)}function Em(t){return ts(t).bind((function(t){return gr(t,On)})).exists((function(t){return R(["pre","pre-wrap"],xn(t,"white-space"))}))}function _m(t,e){return!Em(e)&&(Gg(t,e)||Xg(t,e)||wm(t,e)||km(t,e))}function Tm(t,e){return!Em(e)&&($g(t,e)||Kg(t,e)||xm(t,e)||Om(t,e))}function Mm(t,e){return _m(t,e)||Tm(t,(r=(n=e).container(),o=n.offset(),Pn(r)&&o<r.data.length?ic(r,o+1):n));var n,r,o}function Dm(t,e){return ef(t.charAt(e))}function zm(t){var e=t.container();return Pn(e)&&zt(e.data,yo)}function Am(t){var e=Oe.fromDom(t.getBody());t.selection.isCollapsed()&&function(t,e){return vt.some(e).filter(zm).bind((function(e){var n,r,o,i,a,u,c,s,l,f=e.container(),d=t,m=(a=f).data,g=ic(a,0);return(!Dm(m,0)||Mm(d,g)?(s=(u=f).data,(l=V(c=s.split(""),(function(t,e){return ef(t)&&0<e&&e<c.length-1&&Ks(c[e-1])&&Ks(c[e+1])?" ":t})).join(""))!==s&&(u.data=l,1)):(a.data=" "+m.slice(1),1))||(n=t,o=(r=f).data,i=ic(r,o.length-1),Dm(o,o.length-1)&&!Mm(n,i)&&(r.data=o.slice(0,-1)+" ",1))?vt.some(e):vt.none()}))}(e,ic.fromRangeStart(t.selection.getRng())).each((function(e){t.selection.setRng(e.toRange())}))}function Nm(t,e,n){var r,o,i,a,u,c,s,l;0!==n&&(o=mr(r=Oe.fromDom(t),lo).getOr(r),i=t.data.slice(e,e+n),a=e+n>=t.data.length&&Tm(o,ic(t,t.data.length)),u=0===e&&_m(o,ic(t,0)),t.replaceData(e,n,(s=u,l=a,j(c=i,(function(t,e){return Xs(e)||ef(e)?t.previousCharIsSpace||""===t.str&&s||t.str.length===c.length-1&&l?{previousCharIsSpace:!1,str:t.str+yo}:{previousCharIsSpace:!0,str:t.str+" "}:{previousCharIsSpace:!1,str:t.str+e}}),{previousCharIsSpace:!1,str:""}).str)))}function Bm(t,e){var n=t.data.slice(e);Nm(t,e,n.length-Qt(n).length)}function Rm(t,e){var n=t.data.slice(0,e),r=n.length-Zt(n).length;Nm(t,e-r,r)}function Hm(t,e,n,r){void 0===r&&(r=!0);var o=Zt(t.data).length,i=r?t:e,a=r?e:t;return r?i.appendData(a.data):i.insertData(0,a.data),Bn(Oe.fromDom(a)),n&&Bm(i,o),i}function Vm(t,e){return r=t,o=(n=e).container(),i=n.offset(),!1===ic.isTextPosition(n)&&o===r.parentNode&&i>ic.before(r).offset()?ic(e.container(),e.offset()-1):e;var n,r,o,i}function Im(t){return Fr(t.previousSibling)?vt.some((e=t.previousSibling,Pn(e)?ic(e,e.data.length):ic.after(e))):t.previousSibling?Ql(t.previousSibling):vt.none();var e}function Lm(t){return Fr(t.nextSibling)?vt.some((e=t.nextSibling,Pn(e)?ic(e,0):ic.before(e))):t.nextSibling?Jl(t.nextSibling):vt.none();var e}function Fm(t,e){return Im(e).orThunk((function(){return Lm(e)})).orThunk((function(){return n=t,o=ic.before((r=e).previousSibling||r.parentNode),Yl(n,o).fold((function(){return Kl(n,ic.after(r))}),vt.some);var n,r,o}))}function Pm(t,e){return Lm(e).orThunk((function(){return Im(e)})).orThunk((function(){return Kl(n=t,ic.after(r=e)).fold((function(){return Yl(n,ic.before(r))}),vt.some);var n,r}))}function Um(t,e,n){n.fold((function(){t.focus()}),(function(n){t.selection.setRng(n.toRange(),e)}))}function jm(t,e){return e&&Ot(t.schema.getBlockElements(),Ee(e))}function Wm(t){if(Wr(t)){var e=Oe.fromHtml('<br data-mce-bogus="1">');return Xe(t),Nn(t,e),vt.some(ic.before(e.dom))}return vt.none()}function qm(t,e,n,r){void 0===r&&(r=!0);var o,i,a,u,c,s,l,f,d,m,g,h,p=(e?Pm:Fm)(t.getBody(),h=n.dom).map(O(Vm,h)),v=mr(n,O(jm,t),(o=t.getBody(),function(t){return t.dom===o})),b=(u=p,i=a=n,c=Ot(t.schema.getTextInlineElements(),Ee(i)),m=Ne(a).filter(En),g=Be(a).filter(En),Bn(a),l=g,f=u,d=function(t,e,n){var r=t.dom,o=e.dom,i=r.data.length;return Hm(r,o,c),n.container()===o?ic(r,i):n},((s=m).isSome()&&l.isSome()&&f.isSome()?vt.some(d(s.getOrDie(),l.getOrDie(),f.getOrDie())):vt.none()).orThunk((function(){return c&&(m.each((function(t){return Rm(t.dom,t.dom.length)})),g.each((function(t){return Bm(t.dom,0)}))),u})));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):v.bind(Wm).fold((function(){r&&Um(t,e,b)}),(function(n){r&&Um(t,e,vt.some(n))}))}function Gm(t){return pu(t,"td,th")}function $m(t,e){return{start:t,end:e}}function Xm(t,e){return vr(Oe.fromDom(t),"td,th",e)}function Km(t){return!Ut(t.start,t.end)}function Ym(t,e){return El(t.start,e).bind((function(n){return El(t.end,e).bind((function(t){return Ut(n,t)?vt.some(n):vt.none()}))}))}function Jm(t){return function(e){return Ym(e,t).map((function(t){return{rng:e,table:t,cells:Gm(t)}}))}}function Qm(t,e,n,r){if(n.collapsed||!t.forall(Km))return vt.none();if(e.isSameTable){var o=t.bind(Jm(r));return vt.some({start:o,end:o})}var i,a,u=Xm(n.startContainer,r),c=Xm(n.endContainer,r),s=u.bind((a=r,function(t){return El(t,a).bind((function(e){return tt(Gm(e)).map((function(e){return $m(t,e)}))}))})).bind(Jm(r)),l=c.bind((i=r,function(t){return El(t,i).bind((function(e){return Z(Gm(e)).map((function(e){return $m(e,t)}))}))})).bind(Jm(r));return vt.some({start:s,end:l})}function Zm(t,e){return G(t,(function(t){return Ut(t,e)}))}function tg(t){return dn(Zm(t.cells,t.rng.start),Zm(t.cells,t.rng.end),(function(e,n){return t.cells.slice(e,n+1)}))}function eg(t,e){var n=e.startTable,r=e.endTable,o=t.cloneRange();return n.each((function(t){return o.setStartAfter(t.dom)})),r.each((function(t){return o.setEndBefore(t.dom)})),o}function ng(t){return I(t,(function(t){yn(t,"contenteditable"),lm(t)})),0}function rg(t,e,n,r){var o=n.cloneRange();r?(o.setStart(n.startContainer,n.startOffset),o.setEndAfter(e.dom.lastChild)):(o.setStartBefore(e.dom.firstChild),o.setEnd(n.endContainer,n.endOffset)),th(t,o,e,!1)}function og(t){var e=Ol(t),n=Oe.fromDom(t.selection.getNode());Kn(n.dom)&&Wr(n)?t.selection.setCursorLocation(n.dom,0):t.selection.collapse(!0),1<e.length&&H(e,(function(t){return Ut(t,n)}))&&hn(n,"data-mce-selected","1")}function ig(t,e,n){var r=t.selection.getRng();return ng(n.bind((function(n){var o,i,a,u=n.rng,c=n.isStartInTable,s=(o=c?u.endContainer:u.startContainer,vt.from(t.dom.getParent(o,t.dom.isBlock)).map(Oe.fromDom));u.deleteContents(),i=t,a=c,s.filter(Wr).each((function(t){a?Bn(t):(lm(t),i.selection.setCursorLocation(t.dom,0))}));var l=c?e[0]:e[e.length-1];return rg(t,l,r,c),Wr(l)?vt.none():vt.some(c?e.slice(1):e.slice(0,-1))})).getOr(e)),og(t),!0}function ag(t,e,n,r){var o=t.selection.getRng(),i=e[0],a=n[n.length-1];rg(t,i,o,!0),rg(t,a,o,!1);var u=Wr(i)?e:e.slice(1),c=Wr(a)?n:n.slice(0,-1);return ng(u.concat(c)),r.deleteContents(),og(t),!0}function ug(t,e){return qm(t,!1,e),!0}function cg(t,e){return q(mm(e,t),po)}function sg(t,e){return(t?Ug:jg)(e)}function lg(t,e){var n,r,o,i,a,u,c,s,l=Oe.fromDom(t.selection.getStart(!0)),f=Ol(t);return t.selection.isCollapsed()&&0===f.length?function(t,e,n){var r=Oe.fromDom(t.getBody());return eh(r,n).fold((function(){return o=t,i=e,a=r,u=n,c=ic.fromRangeStart(o.selection.getRng()),cg(a,u).bind((function(t){return Wr(t)?nh(o,t):(e=a,n=t,r=c,Hs(i,o.getBody(),r).bind((function(t){return cg(e,Oe.fromDom(t.getNode())).map((function(t){return!1===Ut(t,n)}))})));var e,n,r})).getOr(!1)||(l=e,f=ic.fromRangeStart((s=t).selection.getRng()),sg(l,f)||$l(l,s.getBody(),f).exists((function(t){return sg(l,t)})));var o,i,a,u,c,s,l,f}),(function(n){return l=e,f=r,d=n,m=ic.fromRangeStart((s=t).selection.getRng()),(Wr(d)?nh(s,d):(i=f,u=d,c=m,Hs(a=l,(o=s).getBody(),c).bind((function(t){return r=a,s=c,l=t,Jl((n=u).dom).bind((function(t){return Ql(n.dom).map((function(e){return r?s.isEqual(t)&&l.isEqual(e):s.isEqual(e)&&l.isEqual(t)}))})).getOr(!0)?nh(o,u):(e=u,eh(i,Oe.fromDom(t.getNode())).map((function(t){return!1===Ut(t,e)})));var e,n,r,s,l})).or(vt.some(!0)))).getOr(!1);var o,i,a,u,c,s,l,f,d,m}))}(t,e,l):(r=l,o=f,i=Oe.fromDom((n=t).getBody()),a=n.selection.getRng(),0!==o.length?ig(n,o,vt.none()):(u=n,s=a,eh(c=i,r).fold((function(){return t=u,function(t,e){var n,r,o,i,a,u,c,s,l,f,d,m,g,h,p,v,b=(n=t,function(t){return Ut(n,t)}),y=dn(Xm((r=e).startContainer,o=b),Xm(r.endContainer,o),$m),x=(l=b,f=w((s=e).startContainer),d=w(s.endContainer),m=f.isSome(),g=d.isSome(),{startTable:f,endTable:d,isStartInTable:m,isEndInTable:g,isSameTable:h=dn(f,d,Ut).getOr(!1),isMultiTable:!h&&m&&g});function w(t){return El(Oe.fromDom(t),l)}return p=e,v=b,y.exists((function(t){return!Km(e=t)&&Ym(e,v).exists((function(t){var e=t.dom.rows;return 1===e.length&&1===e[0].cells.length}))&&_l(t.start,p);var e}))?y.map((function(t){return Qg.singleCellTable(e,t.start)})):x.isMultiTable?Qm(y,u=x,c=e,b).bind((function(t){var e=t.start,n=t.end,r=e.bind(tg).getOr([]),o=n.bind(tg).getOr([]);if(0<r.length&&0<o.length){var i=eg(c,u);return vt.some(Qg.multiTable(r,o,i))}return vt.none()})):Qm(y,i=x,a=e,b).bind((function(t){var e=t.start,n=t.end;return e.or(n)})).bind((function(t){var e=i.isSameTable,n=tg(t).getOr([]);if(e&&t.cells.length===n.length)return vt.some(Qg.fullTable(t.table));if(0<n.length){if(e)return vt.some(Qg.partialTable(n,vt.none()));var r=eg(a,i);return vt.some(Qg.partialTable(n,vt.some(_t(_t({},i),{rng:r}))))}return vt.none()}))}(c,s).map((function(e){return e.fold(O(th,t),O(ug,t),O(ig,t),O(ag,t))}));var t}),(function(t){return nh(u,t)})).getOr(!1)))}function fg(t){return t.collapsed?t:(e=t,n=ic.fromRangeStart(e),r=ic.fromRangeEnd(e),o=e.commonAncestorContainer,$l(!1,o,r).map((function(t){return!$c(n,r,o)&&$c(n,t,o)?(i=n.container(),a=n.offset(),u=t.container(),c=t.offset(),(s=document.createRange()).setStart(i,a),s.setEnd(u,c),s):e;var i,a,u,c,s})).getOr(e));var e,n,r,o}function dg(t,e){var n=t.getParent(e,t.isBlock);return n&&"LI"===n.nodeName?n:null}function mg(t,e){var n=ic.after(t),r=As(e).prev(n);return r?r.toRange():null}function gg(t,e,n,r){function o(t){var r=ic.fromRangeStart(n),o=As(e.getRoot()),i=1===t?o.prev(r):o.next(r);return!i||dg(e,i.getNode())!==M}var i,a,u,c,s,l,f,d,m,g,h,p,v,b,y,x,w,C,S,k,O,E,_,T=(i=e,s=t.serialize(r),u=(a=i.createFragment(s)).firstChild,c=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),c&&"mce_marker"===c.id&&c.parentNode.removeChild(c),a),M=dg(e,n.startContainer),D=function(t){return 0<t.length&&(!(r=t[t.length-1]).firstChild||(e=r)&&e.firstChild&&e.firstChild===e.lastChild&&((n=e.firstChild).data===yo||qn(n)))?t.slice(0,-1):t;var e,n,r}(P(T.firstChild.childNodes,(function(t){return"LI"===t.nodeName}))),z=e.getRoot();return o(1)?(S=z,_=(C=M).parentNode,ke.each(D,(function(t){_.insertBefore(t,C)})),k=S,O=ic.before(C),(E=As(k).next(O))?E.toRange():null):o(2)?(l=M,d=z,e.insertAfter((f=D).reverse(),l),mg(f[0],d)):(g=D,h=z,p=m=M,b=(v=n).cloneRange(),y=v.cloneRange(),b.setStartBefore(p),y.setEndAfter(p),x=[b.cloneContents(),y.cloneContents()],(w=m.parentNode).insertBefore(x[0],m),ke.each(g,(function(t){w.insertBefore(t,m)})),w.insertBefore(x[1],m),w.removeChild(m),mg(g[g.length-1],h))}function hg(t,e,n){var r,o,i,a,c=t.selection,s=t.dom;/^ | $/.test(e)&&(r=s,o=c.getRng(),i=e,i=_m(a=Oe.fromDom(r.getRoot()),ic.fromRangeStart(o))?i.replace(/^ /," "):i.replace(/^ /," "),e=i=Tm(a,ic.fromRangeEnd(o))?i.replace(/( | )(<br( \/)>)?$/," "):i.replace(/ (<br( \/)?>)?$/," "));var l=t.parser,f=n.merge,d=Zd({validate:t.getParam("validate")},t.schema),m='<span id="mce_marker" data-mce-type="bookmark"></span>',g=t.fire("BeforeSetContent",{content:e,format:"html",selection:!0,paste:n.paste});if(g.isDefaultPrevented())t.fire("SetContent",{content:g.content,format:"html",selection:!0,paste:n.paste});else{-1===(e=g.content).indexOf("{$caret}")&&(e+="{$caret}"),e=e.replace(/\{\$caret\}/,m);var h,p,v=(h=c.getRng()).startContainer||(h.parentElement?h.parentElement():null),b=t.getBody();v===b&&c.isCollapsed()&&s.isBlock(b.firstChild)&&(p=b.firstChild)&&!t.schema.getShortEndedElements()[p.nodeName]&&s.isEmpty(b.firstChild)&&((h=s.createRng()).setStart(b.firstChild,0),h.setEnd(b.firstChild,0),c.setRng(h)),c.isCollapsed()||function(t){var e=t.dom,n=fg(t.selection.getRng());t.selection.setRng(n);var r,o=e.getParent(n.startContainer,rh),i=n;null!==(r=o)&&r===e.getParent(i.endContainer,rh)&&_l(Oe.fromDom(r),i)?th(t,n,Oe.fromDom(o)):t.getDoc().execCommand("Delete",!1,null)}(t);var y,x,w,C,S,k,O,E,_,T,M,D,z,A,N={context:(I=c.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},B=l.parse(e,N);if(!0===n.paste&&function(t,e){var n,r,o,i,a,u=e.firstChild,c=e.lastChild;return u&&"meta"===u.name&&(u=u.next),r=c=c&&"mce_marker"===c.attr("id")?c.prev:c,o=(n=t).getNonEmptyElements(),r&&(r.isEmpty(o)||(i=r,n.getBlockElements()[i.name]&&i.firstChild&&i.firstChild===i.lastChild&&("br"===(a=i.firstChild).name||a.value===yo)))&&(c=c.prev),u&&u===c&&("ul"===u.name||"ol"===u.name)}(t.schema,B)&&dg(s,I))return h=gg(d,s,c.getRng(),B),c.setRng(h),void t.fire("SetContent",g);if(function(){for(var t=B;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(),"mce_marker"===(V=B.lastChild).attr("id"))for(var R=V,V=V.prev;V;V=V.walk(!0))if(3===V.type||!s.isBlock(V.name)){t.schema.isValidChild(V.parent.name,"span")&&V.parent.insert(R,V,"br"===V.name);break}if(t._selectionOverrides.showBlockCaretContainer(I),N.invalid){t.selection.setContent(m);var I=c.getNode(),L=t.getBody();for(9===I.nodeType?I=V=L:V=I;V!==L;)V=(I=V).parentNode;e=I===L?L.innerHTML:s.getOuterHTML(I),e=d.serialize(l.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,(function(){return d.serialize(B)})))),I===L?s.setHTML(L,e):s.setOuterHTML(I,e)}else y=t,x=e=d.serialize(B),"all"===(w=I).getAttribute("data-mce-bogus")?w.parentNode.insertBefore(y.dom.createFragment(x),w):(C=w.firstChild,S=w.lastChild,!C||C===S&&"BR"===C.nodeName?y.dom.setHTML(w,x):y.selection.setContent(x));O=f,T=(k=t).schema.getTextInlineElements(),M=k.dom,O&&(E=k.getBody(),_=Jd(M),ke.each(M.select("*[data-mce-fragment]"),(function(t){if(u(T[t.nodeName.toLowerCase()])&&X(om(M,t),(function(t){return!rm.has(t)})))for(var e=t.parentNode;u(e)&&e!==E&&!function(t,e,n){function r(r){var o=t.getStyle(e,r),i=t.getStyle(n,r);return Nt(o)&&Nt(i)&&o!==i}var o=om(t,e),i=om(t,n);return H(o,(function(t){function e(e){return H(e,(function(e){return e===t}))}if(e(i)||!e(Rg))return r(t);var n=P(i,(function(t){return H(Rg,(function(e){return Yt(t,e)}))}));return H(n,r)}))}(M,t,e);e=e.parentNode)if(_.compare(e,t)){M.remove(t,!0);break}}))),function(t,e){var n,r=t.dom,o=t.selection;if(e){o.scrollIntoView(e);var i=df(t.getBody(),e);if("false"===r.getContentEditable(i))return r.remove(e),o.select(i);var a,u=r.createRng(),c=e.previousSibling;Pn(c)?(u.setStart(c,c.nodeValue.length),we.ie||(a=e.nextSibling,Pn(a)&&(c.appendData(a.data),a.parentNode.removeChild(a)))):(u.setStartBefore(e),u.setEndBefore(e));var s=r.getParent(e,r.isBlock);r.remove(e),s&&r.isEmpty(s)&&(t.$(s).empty(),u.setStart(s,0),u.setEnd(s,0),rh(s)||s.getAttribute("data-mce-fragment")||!(n=function(e){var n=ic.fromRangeStart(e);if(n=As(t.getBody()).next(n))return n.toRange()}(u))?r.add(s,r.create("br",{"data-mce-bogus":"1"})):(u=n,r.remove(s))),o.setRng(u)}}(t,s.get("mce_marker")),D=t.getBody(),ke.each(D.getElementsByTagName("*"),(function(t){t.removeAttribute("data-mce-fragment")})),z=s,A=c.getStart(),vt.from(z.getParent(A,"td,th")).map(Oe.fromDom).each(fm),t.fire("SetContent",g),t.addVisual()}}function pg(t){return t instanceof Rd}function vg(t,e,n){var r;t.dom.setHTML(t.getBody(),e),!0!==n&&md(r=t)&&Jl(r.getBody()).each((function(t){var e=t.getNode(),n=sn(e)?Jl(e).getOr(t):t;r.selection.setRng(n.toRange())}))}function bg(t){return S(t)?t:D}function yg(t,e,n){var r=e(t),o=bg(n);return r.orThunk((function(){return o(t)?vt.none():function(e){for(var n=t.dom,r=bg(o);n.parentNode;){n=n.parentNode;var i=Oe.fromDom(n),a=e(i);if(a.isSome())return a;if(r(i))break}return vt.none()}(e)}))}function xg(t,e,n){var r=t.formatter.get(n);if(r)for(var o=0;o<r.length;o++){var i=r[o];if(sl(i)&&!1===i.inherit&&t.dom.is(e,i.selector))return 1}}function wg(t,e,n,r,o){var i=t.dom.getRoot();return e!==i&&(e=t.dom.getParent(e,(function(e){return!!xg(t,e,n)||e.parentNode===i||!!ah(t,e,n,r,!0)})),!!ah(t,e,n,r,o))}function Cg(t,e,n){return!!ih(e,n.inline)||!!ih(e,n.block)||(n.selector?1===e.nodeType&&t.is(e,n.selector):void 0)}function Sg(t,e,n,r,o,i){var u=n[r];if(S(n.onmatch))return n.onmatch(e,n,r);if(u)if(C(u.length)){for(var c in u)if(Ot(u,c)){var s="attributes"===r?t.getAttrib(e,c):ol(t,e,c),l=el(u[c],i),f=a(s)||Bt(s);if(!f||!a(l)){if(o&&f&&!n.exact)return;if((!o||n.exact)&&!ih(s,rl(t,l,c)))return}}}else for(var d=0;d<u.length;d++)if("attributes"===r?t.getAttrib(e,u[d]):ol(t,e,u[d]))return 1;return 1}function kg(t,e,n,r,o){if(r)return wg(t,r,e,n,o);if(r=t.selection.getNode(),wg(t,r,e,n,o))return!0;var i=t.selection.getStart();return!(i===r||!wg(t,i,e,n,o))}function Og(t){return 0<function(t){for(var e=[];t;){if(3===t.nodeType&&t.nodeValue!==uh||1<t.childNodes.length)return[];1===t.nodeType&&e.push(t),t=t.firstChild}return e}(t).length}function Eg(t){if(t){var e=new _r(t,t);for(t=e.current();t;t=e.next())if(Pn(t))return t}return null}function _g(t){var e=Oe.fromTag("span");return pn(e,{id:ch,"data-mce-bogus":"1","data-mce-type":"format-caret"}),t&&Nn(e,Oe.fromText(uh)),e}function Tg(t,e,n){void 0===n&&(n=!0);var r,o,i,a,u,c,s,l,f=t.dom,d=t.selection;Og(e)?qm(t,!1,Oe.fromDom(e),n):(r=d.getRng(),o=f.getParent(e,f.isBlock),i=r.startContainer,a=r.startOffset,u=r.endContainer,c=r.endOffset,(l=Eg(e))&&l.nodeValue.charAt(0)===uh&&l.deleteData(0,1),s=l,f.remove(e,!0),i===s&&0<a&&r.setStart(s,a-1),u===s&&0<c&&r.setEnd(s,c-1),o&&f.isEmpty(o)&&lm(Oe.fromDom(o)),d.setRng(r))}function Mg(t,e,n){void 0===n&&(n=!0);var r=t.dom,o=t.selection;if(e)Tg(t,e,n);else if(!(e=Ls(t.getBody(),o.getStart())))for(;e=r.get(ch);)Tg(t,e,!1)}function Dg(t,e){return t.appendChild(e),e}function zg(t,e){var n=U(t,(function(t,e){return Dg(t,e.cloneNode(!1))}),e);return Dg(n,n.ownerDocument.createTextNode(uh))}function Ag(t,e,r,o,i,a){var u,c,s=t.formatter,l=t.dom,f=P(Ct(s.get()),(function(t){return t!==o&&!zt(t,"removeformat")}));if(0<P((u=t,c=r,j(f,(function(t,e){var n=ul(u,e);return u.formatter.matchNode(c,e,{},n)?t.concat([e]):t}),[])),(function(e){return a=o,u=["inline","block","selector","attributes","styles","classes"],!H((i=t).formatter.get(e),(function(t){var e=r(t);return H(i.formatter.get(a),(function(t){var o,i=r(t),a=e,u=i;return n(o=void 0===o?p:o).eq(a,u)}))}));function r(t){return at(t,(function(t,e){return H(u,(function(t){return t===e}))}))}var i,a,u})).length){var d=r.cloneNode(!1);return l.add(e,d),s.remove(o,i,d,a),l.remove(d),vt.some(d)}return vt.none()}function Ng(t,e){var n=t.schema.getTextInlineElements();return Ot(n,Ee(e))&&!Is(e.dom)&&!cn(e.dom)}I(["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-color","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"],(function(t){rm.add(t)}));var Bg,Rg=["font","text-decoration","text-emphasis"],Hg=O(im,!0,Xs),Vg=O(im,!1,Xs),Ig=um(!0,cm),Lg=um(!1,cm),Fg=um(!0,Yn),Pg=um(!1,Yn),Ug=um(!0,sn),jg=um(!1,sn),Wg=um(!0,sm),qg=um(!1,sm),Gg=O(vm,!1),$g=O(vm,!0),Xg=O(pm,!1),Kg=O(pm,!0),Yg=O(ym,!1),Jg=O(ym,!0),Qg=rr([{singleCellTable:["rng","cell"]},{fullTable:["table"]},{partialTable:["cells","outsideDetails"]},{multiTable:["startTableCells","endTableCells","betweenRng"]}]),Zg=function(t){var e;return(8===_e(e=t)||"#comment"===Ee(e)?Ne:Le)(t).bind(Zg).orThunk((function(){return vt.some(t)}))},th=function(t,e,n,r){void 0===r&&(r=!0),e.deleteContents();var o,i=Zg(n).getOr(n),a=Oe.fromDom(t.dom.getParent(i.dom,t.dom.isBlock));return Wr(a)&&(lm(a),r&&t.selection.setCursorLocation(a.dom,0)),Ut(n,a)||I((fn(Ae(a),n)?[]:Ae(o=a).map(Mn).map((function(t){return P(t,(function(t){return!Ut(o,t)}))})).getOr([])).concat(Mn(n)),(function(t){Ut(t,a)||jt(t,a)||!Wr(t)||Bn(t)})),!0},eh=function(t,e){return q(mm(e,t),(function(t){return On(t)&&"caption"===Ee(t)}))},nh=function(t,e){return lm(e),t.selection.setCursorLocation(e.dom,0),vt.some(!0)},rh=Kn,oh=function(t,e){e(t),t.firstChild&&oh(t.firstChild,e),t.next&&oh(t.next,e)},ih=nl,ah=function(t,e,n,r,o){var i=t.formatter.get(n),a=t.dom;if(i&&e)for(var u=0;u<i.length;u++){var c=i[u];if(Cg(t.dom,e,c)&&Sg(a,e,c,"attributes",o,r)&&Sg(a,e,c,"styles",o,r)){var s=c.classes;if(s)for(var l=0;l<s.length;l++)if(!t.dom.hasClass(e,el(s[l],r)))return;return c}}},uh=xo,ch="_mce_caret",sh={},lh=ft,fh=st;function dh(t){return Ln(t)&&!$s(t)&&!Is(t)&&!cn(t)}function mh(t,e){for(var n=t;n;n=n[e]){if(Pn(n)&&Nt(n.data))return t;if(Ln(n)&&!$s(n))return n}return t}function gh(t,e,n){var r=Jd(t);if(e&&n&&(e=mh(e,"previousSibling"),n=mh(n,"nextSibling"),r.compare(e,n))){for(var o=e.nextSibling;o&&o!==n;){var i=o;o=o.nextSibling;e.appendChild(i)}return t.remove(n),ke.each(ke.grep(n.childNodes),(function(t){e.appendChild(t)})),e}return n}function hh(t,e,n,r){var o;r&&!1!==e.merge_siblings&&(o=gh(t,Qs(r),r),gh(t,o,Qs(o,!0)))}function ph(t,e){return function(n){return!(!n||!ol(t,n,e))}}function vh(t,e,n){return function(r){var o,i;t.setStyle(r,e,n),""===r.getAttribute("style")&&r.removeAttribute("style"),o=t,"SPAN"===(i=r).nodeName&&0===o.getAttribs(i).length&&o.remove(i,!0)}}function bh(t,e,n){return t.isChildOf(e,n)&&e!==n&&!t.isBlock(n)}function yh(t,e,n){var r,o=e[n?"startContainer":"endContainer"],i=e[n?"startOffset":"endOffset"];return Ln(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r<i?r:i]),Pn(o)&&n&&i>=o.nodeValue.length&&(o=new _r(o,t.getBody()).next()||o),Pn(o)&&!n&&0===i&&new _r(o,t.getBody()).prev()||o}function xh(t,e){var n=e?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(t.nodeName)&&t[n]){var r=t[n];return"TR"===t.nodeName&&r[n]||r}return t}function wh(t,e,n,r){var o=t.create(n,r);return e.parentNode.insertBefore(o,e),o.appendChild(e),o}function Ch(t,e,n,r,o){var i=Oe.fromDom(e),a=Oe.fromDom(t.create(r,o));return $e(a,(n?He:Re)(i)),n?(We(i,a),Ge(a,i)):(qe(i,a),Nn(a,i)),a.dom}function Sh(t,e,n,r){var o=Qs(e,n,r);return a(o)||"BR"===o.nodeName||t.isBlock(o)}function kh(t,e,n,r,o){var i,a,u=t.dom,c=u,s=r;if(!(ll(a=e)&&fp(s,a.inline)||cl(a)&&fp(s,a.block)||sl(a)&&Ln(s)&&c.is(s,a.selector)||e.links&&"A"===r.nodeName))return cp.keep();var l,f,d,m,g,h,p,v,b=r;if(ll(e)&&"all"===e.remove&&y(e.preserve_attributes)){var x=P(u.getAttribs(b),(function(t){return R(e.preserve_attributes,t.name.toLowerCase())}));if(u.removeAllAttribs(b),I(x,(function(t){return u.setAttrib(b,t.name,t.value)})),0<x.length)return cp.rename("span")}if("all"!==e.remove){lp(e.styles,(function(t,r){t=rl(u,el(t,n),r+""),k(r)&&(r=t,o=null),!e.remove_similar&&o&&!fp(ol(u,o,r),t)||u.setStyle(b,r,""),i=!0})),i&&""===u.getAttrib(b,"style")&&(b.removeAttribute("style"),b.removeAttribute("data-mce-style")),lp(e.attributes,(function(t,r){var i;if(t=el(t,n),k(r)&&(r=t,o=null),e.remove_similar||!o||fp(u.getAttrib(o,r),t))if("class"===r&&(t=u.getAttrib(b,r))&&(i="",I(t.split(/\s+/),(function(t){/mce\-\w+/.test(t)&&(i+=(i?" ":"")+t)})),i))u.setAttrib(b,r,i);else{if(sp.test(r)&&b.removeAttribute("data-mce-"+r),"style"===r&&on(["li"])(b)&&"none"===u.getStyle(b,"list-style-type"))return b.removeAttribute(r),void u.setStyle(b,"list-style-type","none");"class"===r&&b.removeAttribute("className"),b.removeAttribute(r)}})),lp(e.classes,(function(t){t=el(t,n),o&&!u.hasClass(o,t)||u.removeClass(b,t)}));for(var w=u.getAttribs(b),C=0;C<w.length;C++){var S=w[C].nodeName;if(0!==S.indexOf("_")&&0!==S.indexOf("data-"))return cp.keep()}}return"none"!==e.remove?(l=t,d=e,h=(f=b).parentNode,p=l.dom,v=Cc(l),cl(d)&&(v?h===p.getRoot()&&(d.list_block&&fp(f,d.list_block)||I(wt(f.childNodes),(function(t){tl(l,v,t.nodeName.toLowerCase())?m?m.appendChild(t):(m=wh(p,t,v),p.setAttribs(m,l.settings.forced_root_block_attrs)):m=null}))):p.isBlock(f)&&!p.isBlock(h)&&(Sh(p,f,!1)||Sh(p,f.firstChild,!0,!0)||f.insertBefore(p.create("br"),f.firstChild),Sh(p,f,!0)||Sh(p,f.lastChild,!1,!0)||f.appendChild(p.create("br")))),sl(g=d)&&ll(g)&&fn(ut(g,"mixed"),!0)&&!fp(d.inline,f)||p.remove(f,!0),cp.removed()):cp.keep()}function Oh(t,e,n,r,o){return kh(t,e,n,r,o).fold(D,(function(e){return t.dom.rename(r,e),!0}),z)}function Eh(t,e,n,r,o){function i(r){var i,a,u,c,s,l=(a=e,u=n,c=o,I(al((i=t).dom,r.parentNode).reverse(),(function(t){var e;s||"_start"===t.id||"_end"===t.id||(e=ah(i,t,a,u,c))&&!1!==e.split&&(s=t)})),s);return function(t,e,n,r,o,i,a,u){var c,s,l=t.dom;if(n){for(var d=n.parentNode,m=r.parentNode;m&&m!==d;m=m.parentNode){for(var g=l.clone(m,!1),h=0;h<e.length&&null!==(g=function(t,e,n){return kh(t,e,u,n,n).fold(f(n),(function(e){return t.dom.createFragment().appendChild(n),t.dom.rename(n,e)}),f(null))}(t,e[h],g));h++);g&&(c&&g.appendChild(c),s=s||g,c=g)}a.mixed&&l.isBlock(n)||(r=l.split(n,r)),c&&(o.parentNode.insertBefore(c,o),s.appendChild(o),ll(a)&&hh(l,a,0,c))}return r}(t,d,l,r,r,0,m,n)}function a(e){return H(d,(function(r){return Oh(t,r,n,e,e)}))}function c(t){var e,n=h.get(t?"_start":"_end"),r=n[t?"firstChild":"lastChild"];return $s(e=r)&&Ln(e)&&("_start"===e.id||"_end"===e.id)&&(r=r[t?"firstChild":"lastChild"]),Pn(r)&&0===r.data.length&&(r=t?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),h.remove(n,!0),r}function s(e){var n=wl(t,e,d,e.collapsed);if(m.split){if(n=Tf(n),(o=yh(t,n,!0))!==(a=yh(t,n))){if(o=xh(o,!0),a=xh(a,!1),bh(h,o,a)){var r=vt.from(o.firstChild).getOr(o);return i(Ch(h,r,!0,"span",{id:"_start","data-mce-type":"bookmark"})),void c(!0)}if(bh(h,a,o))return r=vt.from(a.lastChild).getOr(a),i(Ch(h,r,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void c(!1);var o=wh(h,o,"span",{id:"_start","data-mce-type":"bookmark"}),a=wh(h,a,"span",{id:"_end","data-mce-type":"bookmark"}),u=h.createRng();u.setStartAfter(o),u.setEndBefore(a),Cl(h,u,(function(t){I(t,(function(t){$s(t)||$s(t.parentNode)||i(t)}))})),i(o),i(a),o=c(!0),a=c()}else o=a=i(o);n.startContainer=o.parentNode||o,n.startOffset=h.nodeIndex(o),n.endContainer=a.parentNode||a,n.endOffset=h.nodeIndex(a)+1}Cl(h,n,(function(t){I(t,v)}))}var l,d=t.formatter.get(e),m=d[0],g=!0,h=t.dom,p=t.selection,v=function(e){var n=!0,r=!1;Ln(e)&&h.getContentEditable(e)&&(n=g,g="true"===h.getContentEditable(e),r=!0);var o,i,c=wt(e.childNodes);if(g&&!r&&(o=a(e)||H(d,(function(t){return Cg(h,e,t)})),i=e.parentNode,!o&&u(i)&&fl(m)&&a(i)),m.deep&&c.length){for(var s=0;s<c.length;s++)v(c[s]);r&&(g=n)}I(["underline","line-through","overline"],(function(n){Ln(e)&&t.dom.getStyle(e,"text-decoration")===n&&e.parentNode&&il(h,e.parentNode)===n&&Oh(t,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:n}},null,e)}))};if(r)return Ys(r)?((l=h.createRng()).setStartBefore(r),l.setEndAfter(r),s(l)):s(r),void pf(t,e,r,n);if("false"!==h.getContentEditable(p.getNode()))p.isCollapsed()&&ll(m)&&!Ol(t).length?function(t,e,n,r){var o,i,a,u,c,s,l,f,d,m,g,h,p,v,b,y=t.dom,x=t.selection,w=[],C=x.getRng(),S=C.startContainer,k=C.startOffset,E=S;for(3===S.nodeType&&(k!==S.nodeValue.length&&(o=!0),E=E.parentNode);E;){if(ah(t,E,e,n,r)){i=E;break}E.nextSibling&&(o=!0),w.push(E),E=E.parentNode}i&&(o?(a=x.getBookmark(),C.collapse(!0),u=Tf(wl(t,C,t.formatter.get(e),!0)),t.formatter.remove(e,n,u,r),x.moveToBookmark(a)):(c=Ls(t.getBody(),i),d=s=_g(!1).dom,(h=(g=t.dom).getParent(m=null!==c?c:i,O(Zs,t)))&&g.isEmpty(h)?m.parentNode.replaceChild(d,m):(v=pu(p=Oe.fromDom(m),"br"),b=P(function(){for(var t=[],e=p.dom;e;)t.push(Oe.fromDom(e)),e=e.lastChild;return t}().slice(-1),zr),v.length===b.length&&I(b,Bn),g.isEmpty(m)?m.parentNode.replaceChild(d,m):g.insertAfter(d,m)),l=Ag(t,s,i,e,n,r),f=zg(w.concat(l.toArray()),s),Tg(t,c,!1),x.setCursorLocation(f,1),y.isEmpty(i)&&y.remove(i)))}(t,e,n,o):(zl(p,!0,(function(){Dl(t,s)})),ll(m)&&kg(t,e,n,p.getStart())&&Js(h,p,p.getRng()),t.nodeChanged()),pf(t,e,r,n);else{r=p.getNode();for(var b=0;b<d.length&&(!d[b].ceFalseOverride||!Oh(t,d[b],n,r,r));b++);pf(t,e,r,n)}}function _h(t){return Ln(t)&&!$s(t)&&!Is(t)&&!cn(t)}function Th(t){return Ot(t,"vars")}function Mh(t,e,n,r,o){return W(e,(function(e){var i=t.formatter.matchNode(e,n,null!=o?o:{},r);return!C(i)}),(function(e){return xg(t,e,n)||!r&&u(t.formatter.matchNode(e,n,o,!0))}))}function Dh(t,e){var n=null!=e?e:hp(t);return P(al(t.dom,n),(function(t){return Ln(t)&&!cn(t)}))}function zh(t,e){var n=(e||document).createDocumentFragment();return I(t,(function(t){n.appendChild(t.dom)})),Oe.fromDom(n)}function Ah(t,e,n){return{element:t,width:e,rows:n}}function Nh(t,e){return{element:t,cells:e}}function Bh(t,e){var n=parseInt(vn(t,e),10);return isNaN(n)?1:n}function Rh(t){return j(t,(function(t,e){return e.cells.length>t?e.cells.length:t}),0)}function Hh(t,e){for(var n=t.rows,r=0;r<n.length;r++)for(var o=n[r].cells,i=0;i<o.length;i++)if(Ut(o[i],e))return vt.some({x:i,y:r});return vt.none()}function Vh(t,e,n,r,o){for(var i=[],a=t.rows,u=n;u<=o;u++){var c=a[u].cells,s=e<r?c.slice(e,r+1):c.slice(r,e+1);i.push(Nh(a[u].element,s))}return i}function Ih(t,e){var n,r,o,i=Oe.fromDom(e.commonAncestorContainer),a=mm(i,t),u=P(a,(function(t){return Dr(t)||so(t)})),c=(o=e,q(r=a,(function(t){return"li"===Ee(t)&&_l(t,o)})).fold(f([]),(function(t){return q(r,(function(t){return"ul"===Ee(t)||"ol"===Ee(t)})).map((function(t){var e=Oe.fromTag(Ee(t));return function(t,e){var n=t.dom;nt(e,(function(t,e){!function(t,e,n){if(!v(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);mn(t)&&t.style.setProperty(e,n)}(n,e,t)}))}(e,at(Cn(t),(function(t,e){return Yt(e,"list-style")}))),[Oe.fromTag("li"),e]})).getOr([])})));return V(u.concat(c.length?c:go(n=i)?Ae(n).filter(mo).fold(f([]),(function(t){return[n,t]})):mo(n)?[n]:[]),wu)}function Lh(){return zh([])}function Fh(t,e){return hr(e[0],"table",O(Ut,t)).bind((function(t){var n,r,o=e[0],i=e[e.length-1],a=function(t){var e=Ah(wu(t),0,[]);return I(pu(t,"tr"),(function(t,n){I(pu(t,"td,th"),(function(r,o){!function(t,e,n,r,o){for(var i=Bh(o,"rowspan"),a=Bh(o,"colspan"),u=t.rows,c=n;c<n+i;c++){u[c]||(u[c]=Nh(Cu(r),[]));for(var s=e;s<e+a;s++)u[c].cells[s]=c===n&&s===e?o:wu(o)}}(e,function(t,e,n){for(;r=e,((o=t.rows)[n]?o[n].cells:[])[r];)e++;var r,o;return e}(e,o,n),n,t,r)}))})),Ah(e.element,Rh(e.rows),e.rows)}(t);return r=i,Hh(n=a,o).bind((function(t){return Hh(n,r).map((function(e){return r=n,o=t.x,i=t.y,a=e.x,c=i<(u=e.y)?Vh(r,o,i,a,u):Vh(r,o,u,a,i),Ah(r.element,Rh(c),c);var r,o,i,a,u,c}))})).map((function(t){return zh([(n=V((e=t).rows,(function(t){var e=V(t.cells,(function(t){var e=Cu(t);return yn(e,"colspan"),yn(e,"rowspan"),e})),n=wu(t.element);return $e(n,e),n})),r=wu(e.element),$e(o=Oe.fromTag("tbody"),n),Nn(r,o),r)]);var e,n,r,o}))})).getOrThunk(Lh)}function Ph(t,e){return 0<=e&&e<t.length&&Xs(t.charAt(e))}function Uh(t,e){var n=Co(t.innerText);return e?n.replace(/^[ \f\n\r\t\v]+/,""):n}function jh(t){return Ln(t)?t.outerHTML:Pn(t)?Yo.encodeRaw(t.data,!1):Un(t)?"\x3c!--"+t.data+"--\x3e":""}function Wh(t){var e,n=$((e=t.getBody(),P(V(wt(e.childNodes),jh),(function(t){return 0<t.length}))),(function(e){var n=Yd(t.serializer,e);return 0<n.length?[n]:[]})),r=n.join("");return-1!==r.indexOf("</iframe>")?{type:"fragmented",fragments:n,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:r,bookmark:null,beforeBookmark:null}}function qh(t,e,n){var r,o,i,a,c,s,l,f,d,m,g,h=n?e.beforeBookmark:e.bookmark;function p(t,e,n,r){for(var o=t;o-e<r&&o<n&&a[o]===c[o-e];)++o;return{start:t,end:o,diag:e}}"fragmented"===e.type?(r=e.fragments,o=t.getBody(),i=V(wt(o.childNodes),jh),function(t,e){var n=0;I(t,(function(t){var r,o,i,a,u,c,s,l;0===t[0]?n++:1===t[0]?(a=e,u=t[1],c=n,l=function(t){var e,n=document.createElement("div"),r=document.createDocumentFragment();for(t&&(n.innerHTML=t);e=n.firstChild;)r.appendChild(e);return r}(u),a.hasChildNodes()&&c<a.childNodes.length?(s=a.childNodes[c]).parentNode.insertBefore(l,s):a.appendChild(l),n++):2===t[0]&&(o=n,(r=e).hasChildNodes()&&o<r.childNodes.length&&(i=r.childNodes[o]).parentNode.removeChild(i))}))}((c=r,s=(a=i).length+c.length+2,l=new Array(s),f=new Array(s),d=function(t,e,n,r,o){var i=m(t,e,n,r);if(null===i||i.start===e&&i.diag===e-r||i.end===t&&i.diag===t-n)for(var u=t,s=n;u<e||s<r;)u<e&&s<r&&a[u]===c[s]?(o.push([0,a[u]]),++u,++s):r-n<e-t?(o.push([2,a[u]]),++u):(o.push([1,c[s]]),++s);else{d(t,i.start,n,i.start-i.diag,o);for(var l=i.start;l<i.end;++l)o.push([0,a[l]]);d(i.end,e,i.end-i.diag,r,o)}},m=function(t,e,n,r){var o=e-t,i=r-n;if(0==o||0==i)return null;var u,s,d,m,g,h=o-i,v=i+o,b=(v%2==0?v:1+v)/2;for(l[1+b]=t,f[1+b]=e+1,u=0;u<=b;++u){for(s=-u;s<=u;s+=2){for(d=s+b,s===-u||s!==u&&l[d-1]<l[d+1]?l[d]=l[d+1]:l[d]=l[d-1]+1,g=(m=l[d])-t+n-s;m<e&&g<r&&a[m]===c[g];)l[d]=++m,++g;if(h%2!=0&&h-u<=s&&s<=h+u&&f[d-h]<=l[d])return p(f[d-h],s+t-n,e,r)}for(s=h-u;s<=h+u;s+=2){for(d=s+b-h,s===h-u||s!==h+u&&f[d+1]<=f[d-1]?f[d]=f[d+1]-1:f[d]=f[d-1],g=(m=f[d]-1)-t+n-s;t<=m&&n<=g&&a[m]===c[g];)f[d]=m--,g--;if(h%2==0&&-u<=s&&s<=u&&f[d]<=l[d+h])return p(f[d],s+t-n,e,r)}}},g=[],d(0,a.length,0,c.length,g),g),o)):t.setContent(e.content,{format:"raw",no_selection:!u(h)||!Fs(h)||!h.isFakeCaret}),t.selection.moveToBookmark(h)}function Gh(t){return"fragmented"===t.type?t.fragments.join(""):t.content}function $h(t){var e=Oe.fromTag("body",vp());return yu(e,Gh(t)),I(pu(e,"*[data-mce-bogus]"),Ke),e.dom.innerHTML}function Xh(t,e){return!(!t||!e)&&(r=e,Gh(t)===Gh(r)||(n=e,$h(t)===$h(n)));var n,r}function Kh(t){return 0===t.get()}function Yh(t,e,n){Kh(n)&&(t.typing=e)}function Jh(t,e){t.typing&&(Yh(t,!1,e),t.add())}function Qh(t){return{undoManager:{beforeChange:function(e,n){var r=t,o=n;Kh(e)&&o.set(fs(r.selection))},add:function(e,n,r,o,i,a){return function(t,e,n,r,o,i,a){var u=Wh(t);if(i=ke.extend(i=i||{},u),!1===Kh(r)||t.removed)return null;var c=e.data[n.get()];if(t.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&Xh(c,i))return null;e.data[n.get()]&&o.get().each((function(t){e.data[n.get()].beforeBookmark=t}));var s=t.getParam("custom_undo_redo_levels",0,"number");if(s&&e.data.length>s){for(var l=0;l<e.data.length-1;l++)e.data[l]=e.data[l+1];e.data.length--,n.set(e.data.length)}i.bookmark=fs(t.selection),n.get()<e.data.length-1&&(e.data.length=n.get()+1),e.data.push(i),n.set(e.data.length-1);var f={level:i,lastLevel:c,originalEvent:a};return 0<n.get()?(t.setDirty(!0),t.fire("AddUndo",f),t.fire("change",f)):t.fire("AddUndo",f),i}(t,e,n,r,o,i,a)},undo:function(e,n,r){return o=t,a=n,u=r,(i=e).typing&&(i.add(),i.typing=!1,Yh(i,!1,a)),0<u.get()&&(u.set(u.get()-1),qh(o,c=i.data[u.get()],!0),o.setDirty(!0),o.fire("Undo",{level:c})),c;var o,i,a,u,c},redo:function(e,n){return r=t,i=n,(o=e).get()<i.length-1&&(o.set(o.get()+1),qh(r,a=i[o.get()],!1),r.setDirty(!0),r.fire("Redo",{level:a})),a;var r,o,i,a},clear:function(e,n){var r,o=t,i=n;(r=e).data=[],i.set(0),r.typing=!1,o.fire("ClearUndos")},reset:function(t){var e;(e=t).clear(),e.add()},hasUndo:function(e,n){return r=t,o=e,0<n.get()||o.typing&&o.data[0]&&!Xh(Wh(r),o.data[0]);var r,o},hasRedo:function(t,e){return n=t,e.get()<n.data.length-1&&!n.typing;var n},transact:function(t,e,n){return o=n,Jh(r=t,e),r.beforeChange(),r.ignore(o),r.add();var r,o},ignore:function(t,e){try{t.set(t.get()+1),e()}finally{t.set(t.get()-1)}},extra:function(e,n,r,o){var i,a,u=t,c=n,s=o;(i=e).transact(r)&&(a=i.data[c.get()].bookmark,qh(u,i.data[c.get()-1],!0),i.transact(s)&&(i.data[c.get()-1].beforeBookmark=a))}},formatter:{match:function(e,n,r,o){return kg(t,e,n,r,o)},matchAll:function(e,n){return o=e,i=n,a=[],u={},c=(r=t).selection.getStart(),r.dom.getParent(c,(function(t){for(var e=0;e<o.length;e++){var n=o[e];!u[n]&&ah(r,t,n,i)&&(u[n]=!0,a.push(n))}}),r.dom.getRoot()),a;var r,o,i,a,u,c},matchNode:function(e,n,r,o){return ah(t,e,n,r,o)},canApply:function(e){return function(t){var n=t.formatter.get(e),r=t.dom;if(n)for(var o=al(r,t.selection.getStart()),i=n.length-1;0<=i;i--){var a=n[i];if(!sl(a)||u(a.defaultBlock))return!0;for(var c=o.length-1;0<=c;c--)if(r.is(o[c],a.selector))return!0}return!1}(t)},closest:function(e){return r=t,o=e,vt.from(r.selection.getStart(!0)).bind((function(t){return yg(Oe.fromDom(t),(function(t){return et(o,(function(e){return ah(r,t.dom,n=e)?vt.some(n):vt.none();var n}))}),n)})).getOrNull();function n(t){return Ut(t,Oe.fromDom(r.getBody()))}var r,o},apply:function(e,n,r){return gp(t,e,n,r)},remove:function(e,n,r,o){return Eh(t,e,n,r,o)},toggle:function(e,n,r){var o,i=e,a=n,u=r,c=(o=t).formatter.get(i);(!kg(o,i,a,u)||"toggle"in c[0]&&!c[0].toggle?gp:Eh)(o,i,a,u)},formatChanged:function(e,n,r,o,i){return function(t,e,n,r,o,i){var a,u,c,s,l,f,d,m,g;return null===e.get()&&(u=t,(a=e).set({}),u.on("NodeChange",(function(t){pp(u,t.element,a.get())})),u.on("FormatApply FormatRemove",(function(t){var e=vt.from(t.node).map((function(t){return Ys(t)?t:t.startContainer})).bind((function(t){return Ln(t)?vt.some(t):vt.from(t.parentElement)})).getOrThunk((function(){return hp(u)}));pp(u,e,a.get())}))),c=t,l=n,f=r,d=o,m=i,g=(s=e).get(),I(l.split(","),(function(t){function e(){var e=Dh(c);return Mh(c,e,t,d,m).isSome()}var n,r=ut(g,t).getOrThunk((function(){var e={withSimilar:{state:ru(!1),similar:!0,callbacks:[]},withoutSimilar:{state:ru(!1),similar:!1,callbacks:[]},withVars:[]};return g[t]=e}));C(m)?((n=d?r.withSimilar:r.withoutSimilar).callbacks.push(f),1===n.callbacks.length&&n.state.set(e())):r.withVars.push({state:ru(e()),similar:d,vars:m,callback:f})})),s.set(g),{unbind:function(){var t,o=n,i=r,a=(t=e).get();I(o.split(","),(function(t){return ut(a,t).each((function(e){a[t]={withSimilar:_t(_t({},e.withSimilar),{callbacks:P(e.withSimilar.callbacks,(function(t){return t!==i}))}),withoutSimilar:_t(_t({},e.withoutSimilar),{callbacks:P(e.withoutSimilar.callbacks,(function(t){return t!==i}))}),withVars:P(e.withVars,(function(t){return t.callback!==i}))}}))})),t.set(a)}}}(t,e,n,r,o,i)}},editor:{getContent:function(e,n){return r=t,o=e,i=n,vt.from(r.getBody()).fold(f("tree"===o.format?new Rd("body",11):""),(function(t){return e=r,a=t,u=i,d=_t(_t({},n=o),{format:u,get:!0,getInner:!0}),g="raw"===(m=n.no_events?d:e.fire("BeforeGetContent",d)).format?ke.trim(tm(e.serializer,a.innerHTML)):"text"===m.format?e.dom.isEmpty(a)?"":Co(a.innerText||a.textContent):"tree"===m.format?e.serializer.serialize(a,m):(s=(c=e).serializer.serialize(a,m),l=Cc(c),f=new RegExp("^(<"+l+"[^>]*>( | |\\s| |<br \\/>|)<\\/"+l+">[\r\n]*|<br \\/>[\r\n]*)$"),s.replace(f,"")),R(["text","tree"],m.format)||vo(Oe.fromDom(a))?m.content=g:m.content=ke.trim(g),(m.no_events?m:e.fire("GetContent",m)).content;var e,n,a,u,c,s,l,f,d,m,g}));var r,o,i},setContent:function(e,n){return function(t,e,n){var r,o=(r=e,_t(_t({format:"html"},n),{set:!0,content:pg(r)?"":r})),i=n.no_events?o:t.fire("BeforeSetContent",o);return pg(e)||(e=i.content),vt.from(t.getBody()).fold(f(e),(function(n){return pg(e)?function(t,e,n,r){var o,i,a,u;o=t.parser.getNodeFilters(),i=t.parser.getAttributeFilters(),a=n,u=function(t,e){var n,r,o={},i={},u=[];for(n in a.firstChild&&oh(a.firstChild,(function(n){I(t,(function(t){t.name===n.name&&(o[t.name]?o[t.name].nodes.push(n):o[t.name]={filter:t,nodes:[n]})})),I(e,(function(t){"string"==typeof n.attr(t.name)&&(i[t.name]?i[t.name].nodes.push(n):i[t.name]={filter:t,nodes:[n]})}))})),o)Ot(o,n)&&u.push(o[n]);for(r in i)Ot(i,r)&&u.push(i[r]);return u}(o,i),I(u,(function(t){I(t.filter.callbacks,(function(e){e(t.nodes,t.filter.name,{})}))}));var c=Zd({validate:t.validate},t.schema).serialize(n);return r.content=vo(Oe.fromDom(e))?c:ke.trim(c),vg(t,r.content,r.no_selection),r.no_events||t.fire("SetContent",r),n}(t,n,e,i):(r=t,o=n,u=i,0===(a=e).length||/^\s+$/.test(a)?(c='<br data-mce-bogus="1">',"TABLE"===o.nodeName?a="<tr><td>"+c+"</td></tr>":/^(UL|OL)$/.test(o.nodeName)&&(a="<li>"+c+"</li>"),a=(s=Cc(r))&&r.schema.isValidChild(o.nodeName.toLowerCase(),s.toLowerCase())?(a=c,r.dom.createHTML(s,Sc(r),a)):a||'<br data-mce-bogus="1">',vg(r,a,u.no_selection),r.fire("SetContent",u)):("raw"!==u.format&&(a=Zd({validate:r.validate},r.schema).serialize(r.parser.parse(a,{isRootContent:!0,insert:!0}))),u.content=vo(Oe.fromDom(o))?a:ke.trim(a),vg(r,u.content,u.no_selection),u.no_events||r.fire("SetContent",u)),u.content);var r,o,a,u,c,s}))}(t,e,n)},insertContent:function(e,n){return hg(t,e,n)},addVisual:function(e){var n,r=e,o=(n=t).dom,i=u(r)?r:n.getBody();C(n.hasVisual)&&(n.hasVisual=n.getParam("visual",!0,"boolean")),I(o.select("table,a",i),(function(t){switch(t.nodeName){case"TABLE":var e=n.getParam("visual_table_class","mce-item-table","string"),r=o.getAttrib(t,"border");r&&"0"!==r||!n.hasVisual?o.removeClass(t,e):o.addClass(t,e);break;case"A":var i,a;o.getAttrib(t,"href")||(i=o.getAttrib(t,"name")||t.id,a=n.getParam("visual_anchor_class","mce-item-anchor","string"),i&&n.hasVisual?o.addClass(t,a):o.removeClass(t,a))}})),n.fire("VisualAid",{element:r,hasVisual:n.hasVisual})}},selection:{getContent:function(e,n){return function(t,e,n){var r,o=(r=e,_t(_t({},n=void 0===n?{}:n),{format:r,get:!0,selection:!0})),i=t.fire("BeforeGetContent",o);if(i.isDefaultPrevented())return t.fire("GetContent",i),i.content;if("text"===i.format)return m=t,vt.from(m.selection.getRng()).map((function(t){var e=vt.from(m.dom.getParent(t.commonAncestorContainer,m.dom.isBlock)),n=m.getBody(),r=e.map((function(t){return t.nodeName})).getOr("div").toLowerCase(),o=we.browser.isIE()&&"pre"!==r,i=m.dom.add(n,r,{"data-mce-bogus":"all",style:"overflow: hidden; opacity: 0;"},t.cloneContents()),a=Uh(i,o),u=Co(i.textContent);if(m.dom.remove(i),Ph(u,0)||Ph(u,u.length-1)){var c=Uh(e.getOr(n),o),s=c.indexOf(a);return-1===s?a:(Ph(c,s-1)?" ":"")+a+(Ph(c,s+a.length)?" ":"")}return a})).getOr("");i.getInner=!0;var a,u,c,s,l,f,d,m,g=(u=i,c=(a=t).selection.getRng(),s=a.dom.create("body"),l=a.selection.getSel(),f=bd(a,Sl(l)),(d=u.contextual?function(t,e){var n,r,o,i,a,u,c,s=kl(e,t);return 0<s.length?Fh(t,s):(n=t,0<(r=e).length&&r[0].collapsed?Lh():(o=n,i=r[0],a=Oe.fromDom(i.cloneContents()),c=j(u=Ih(o,i),(function(t,e){return Nn(e,t),e}),a),0<u.length?zh([c]):c))}(Oe.fromDom(a.getBody()),f).dom:c.cloneContents())&&s.appendChild(d),a.selection.serializer.serialize(s,u));return"tree"===i.format?g:(i.content=t.selection.isCollapsed()?"":g,t.fire("GetContent",i),i.content)}(t,e,n)}},raw:{getModel:function(){return vt.none()}}}}function Zh(t){return Ot(t.plugins,"rtc")}function tp(t){var e=t;return ut(t.plugins,"rtc").bind((function(t){return vt.from(t.setup)})).fold((function(){return e.rtcInstance=Qh(t),vt.none()}),(function(t){var n,r;return e.rtcInstance=(n=f(null),r=f(""),{undoManager:{beforeChange:c,add:n,undo:n,redo:n,clear:c,reset:c,hasUndo:D,hasRedo:D,transact:n,ignore:c,extra:c},formatter:{match:D,matchAll:f([]),matchNode:f(void 0),canApply:D,closest:r,apply:c,remove:c,toggle:c,formatChanged:f({unbind:c})},editor:{getContent:r,setContent:r,insertContent:c,addVisual:c},selection:{getContent:r},raw:{getModel:f(vt.none())}}),vt.some((function(){return t().then((function(t){return e.rtcInstance=(r=t.undoManager,o=t.formatter,i=t.editor,a=t.selection,u=t.raw,{undoManager:{beforeChange:r.beforeChange,add:r.add,undo:r.undo,redo:r.redo,clear:r.clear,reset:r.reset,hasUndo:r.hasUndo,hasRedo:r.hasRedo,transact:function(t,e,n){return r.transact(n)},ignore:function(t,e){return r.ignore(e)},extra:function(t,e,n,o){return r.extra(n,o)}},formatter:{match:function(t,e,r,i){return o.match(t,n(e),i)},matchAll:o.matchAll,matchNode:o.matchNode,canApply:function(t){return o.canApply(t)},closest:function(t){return o.closest(t)},apply:function(t,e,r){return o.apply(t,n(e))},remove:function(t,e,r,i){return o.remove(t,n(e))},toggle:function(t,e,r){return o.toggle(t,n(e))},formatChanged:function(t,e,n,r,i){return o.formatChanged(e,n,r,i)}},editor:{getContent:function(t,e){return i.getContent(t)},setContent:function(t,e){return i.setContent(t,e)},insertContent:function(t,e){return i.insertContent(t)},addVisual:i.addVisual},selection:{getContent:function(t,e){return a.getContent(e)}},raw:{getModel:function(){return vt.some(u.getRawModel())}}}),t.rtc.isRemote;function n(t){return b(t)?t:{}}var r,o,i,a,u}))}))}))}function ep(t){return t.rtcInstance||Qh(t)}function np(t){var e=t.rtcInstance;if(e)return e;throw new Error("Failed to get RTC instance not yet initialized.")}function rp(t){return 0===t.dom.length?(Bn(t),vt.none()):vt.some(t)}function op(t,e,n,r){t.bind((function(t){return(r?Rm:Bm)(t.dom,r?t.dom.length:0),e.filter(En).map((function(e){var o=n,i=r,a=t.dom,u=e.dom,c=(i?a:u).length;i?(Hm(a,u,!1,!i),o.setStart(u,c)):(Hm(u,a,!1,!i),o.setEnd(u,c))}))})).orThunk((function(){var t=r;return e.filter((function(t){return Rl.isBookmarkNode(t.dom)})).bind(t?Be:Ne).or(e).filter(En).map((function(t){var e,n=r;Ae(e=t).each((function(t){var r=e.dom;n&&_m(t,ic(r,0))?Bm(r,0):!n&&Tm(t,ic(r,r.length))&&Rm(r,r.length)}))}))}))}function ip(t,e,n){var r;t&&Ot(t,e)&&(0===(r=P(t[e],(function(t){return t!==n}))).length?delete t[e]:t[e]=r)}Bg=function(t){var e,n=t.selection.getRng(),r=on(["pre"]);n.collapsed||(e=t.selection.getSelectedBlocks(),fh(lh(lh(e,r),(function(t){return r(t.previousSibling)&&-1!==dt(e,t.previousSibling)})),(function(t){var e,n=t.previousSibling;Ga(e=t).remove(),Ga(n).append("<br><br>").append(e.childNodes)})))},sh.pre||(sh.pre=[]),sh.pre.push(Bg);var ap=ke.each,up=function(t,e,n){ap(t.childNodes,(function(t){dh(t)&&(e(t)&&n(t),t.hasChildNodes()&&up(t,e,n))}))},cp=rr([{keep:[]},{rename:["name"]},{removed:[]}]),sp=/^(src|href|style)$/,lp=ke.each,fp=nl,dp=ke.each,mp=ke.each,gp=function(t,e,n,r){function o(t,e){var o;S((e=void 0===e?m:e).onformat)&&e.onformat(t,e,n,r),mp(e.styles,(function(e,r){h.setStyle(t,r,el(e,n))})),!e.styles||(o=h.getAttrib(t,"style"))&&h.setAttrib(t,"data-mce-style",o),mp(e.attributes,(function(e,r){h.setAttrib(t,r,el(e,n))})),mp(e.classes,(function(e){e=el(e,n),h.hasClass(t,e)||h.addClass(t,e)}))}function i(t,e){var n=!1;return mp(t,(function(t){return!!sl(t)&&(u(t.collapsed)&&t.collapsed!==g||!h.is(e,t.selector)||Is(e)?void 0:(o(e,t),!(n=!0)))})),n}function a(r,a,c){var s=[],l=!0,f=m.inline||m.block,g=function(t){if(v(t)){var e=h.create(t);return o(e),e}return null}(f);Cl(r,a,(function(a){var h,p=function(a){var v=!1,b=l,y=a.nodeName.toLowerCase(),x=a.parentNode,w=x.nodeName.toLowerCase();if(Ln(a)&&r.getContentEditable(a)&&(b=l,l="true"===r.getContentEditable(a),v=!0),qn(a)&&!function(t,e,n,r){if(t.getParam("format_empty_lines",!1,"boolean")&&ll(e)){var o=Zr(t.schema),i=(a=Oe.fromDom(n),c=function(t){return Is(t.dom)},((s=(u=a).dom).parentNode?function(t,e){return q(t.dom.childNodes,(function(t){return e(Oe.fromDom(t))})).map(Oe.fromDom)}(Oe.fromDom(s.parentNode),(function(t){return!Ut(u,t)&&c(t)})):vt.none()).isSome());return ct(o,r)&&Wr(Oe.fromDom(n.parentNode),!1)&&!i}var a,u,c,s}(t,m,a,w))return h=null,void(cl(m)&&r.remove(a));if(cl(m)&&m.wrapper&&ah(t,a,e,n))h=null;else{if(l&&!v&&cl(m)&&!m.wrapper&&Zs(t,y)&&tl(t,w,f)){var C=r.rename(a,f);return o(C),s.push(C),void(h=null)}if(sl(m)){var S=i(d,a);if(!S&&u(x)&&fl(m)&&(S=i(d,x)),!ll(m)||S)return void(h=null)}!l||v||!tl(t,f,y)||!tl(t,w,f)||!c&&Pn(a)&&wo(a.data)||Is(a)||ll(m)&&r.isBlock(a)?(h=null,I(wt(a.childNodes),p),v&&(l=b),h=null):(h||(h=r.clone(g,!1),a.parentNode.insertBefore(h,a),s.push(h)),h.appendChild(a))}};I(a,p)})),!0===m.links&&I(s,(function(t){var e=function(t){"A"===t.nodeName&&o(t,m),I(wt(t.childNodes),e)};e(t)})),I(s,(function(i){var a,c,l,f,g,h,p,v,b,y,x,w,C,S,k,O,E,_,T=(a=0,I(i.childNodes,(function(t){var e;u(e=t)&&Pn(e)&&0===e.length||$s(t)||a++})),a);function M(t){var e;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(e=il(C,t.parentNode),C.getStyle(t,"color")&&e?C.setStyle(t,"text-decoration",e):C.getStyle(t,"text-decoration")===e&&C.setStyle(t,"text-decoration",null))}!(1<s.length)&&r.isBlock(i)||0!==T?(ll(m)||cl(m)&&m.wrapper)&&(m.exact||1!==T||(i=q((w=i).childNodes,_h).filter((function(t){return Cg(r,t,m)})).map((function(t){var e=r.clone(t,!1);return o(e),r.replace(e,w,!0),r.remove(t,!0),e})).getOr(w)),O=t,E=n,_=i,dp(d,(function(t){var e,n,r;ll(t)&&dp(O.dom.select(t.inline,_),(function(e){dh(e)&&Oh(O,t,E,e,t.exact?e:null)})),e=O.dom,(n=t).clear_child_styles&&(r=n.links?"*:not(a)":"*",ap(e.select(r,_),(function(t){dh(t)&&ap(n.styles,(function(n,r){e.setStyle(t,r,"")}))})))})),v=m,ah(p=t,(x=i).parentNode,b=e,y=n)&&Oh(p,v,y,x)||v.merge_with_parents&&p.dom.getParent(x.parentNode,(function(t){if(ah(p,t,b,y))return Oh(p,v,y,x),!0})),h=i,(g=m).styles&&g.styles.backgroundColor&&up(h,ph(r,"fontSize"),vh(r,"backgroundColor",el(g.styles.backgroundColor,n))),C=r,k=i,(S=m).styles&&(S.styles.color||S.styles.textDecoration)&&(ke.walk(k,M,"childNodes"),M(k)),c=r,f=i,!ll(l=m)||"sub"!==l.inline&&"sup"!==l.inline||(up(f,ph(c,"fontSize"),vh(c,"fontSize","")),c.remove(c.select("sup"===l.inline?"sub":"sup",f),!0)),hh(r,m,0,i)):r.remove(i,!0)}))}var c,s,l,f,d=t.formatter.get(e),m=d[0],g=!r&&t.selection.isCollapsed(),h=t.dom,p=t.selection;if("false"!==h.getContentEditable(p.getNode()))m&&(r?Ys(r)?i(d,r)||((c=h.createRng()).setStartBefore(r),c.setEndAfter(r),a(h,wl(t,c,d),!0)):a(h,r,!0):g&&ll(m)&&!Ol(t).length?function(t,e,n){var r,o=t.selection,i=o.getRng(),a=i.startOffset,u=i.startContainer.nodeValue,c=Ls(t.getBody(),o.getStart());c&&(r=Eg(c));var s,l,f,d,m=/[^\s\u00a0\u00ad\u200b\ufeff]/;u&&0<a&&a<u.length&&m.test(u.charAt(a))&&m.test(u.charAt(a-1))?(s=o.getBookmark(),i.collapse(!0),l=Tf(wl(t,i,t.formatter.get(e))),t.formatter.apply(e,n,l),o.moveToBookmark(s)):(c&&r.nodeValue===uh||(f=t.getDoc(),d=_g(!0).dom,r=(c=f.importNode(d,!0)).firstChild,i.insertNode(c),a=1),t.formatter.apply(e,n,c),o.setCursorLocation(r,a))}(t,e,n):(s=p.getNode(),l=d[0],t.settings.forced_root_block||!l.defaultBlock||h.getParent(s,h.isBlock)||gp(t,l.defaultBlock),p.setRng(fg(p.getRng())),zl(p,!0,(function(){Dl(t,(function(e,n){var r=n?e:wl(t,e,d);a(h,r,!1)}))})),Js(h,p,p.getRng()),t.nodeChanged()),f=t,fh(sh[e],(function(t){t(f)}))),hf(t,e,r,n);else{r=p.getNode();for(var b=0,y=d.length;b<y;b++){var x=d[b];if(x.ceFalseOverride&&sl(x)&&h.is(r,x.selector)){o(r,x);break}}hf(t,e,r,n)}},hp=function(t){return t.selection.getStart()},pp=function(t,e,n){var r=Dh(t,e);nt(n,(function(n,o){function i(n){var i,a=Mh(t,r,o,n.similar,Th(n)?n.vars:void 0),u=a.isSome();n.state.get()!==u&&(n.state.set(u),i=a.getOr(e),Th(n)?n.callback(u,{node:i,format:o,parents:r}):I(n.callbacks,(function(t){return t(u,{node:i,format:o,parents:r})})))}I([n.withSimilar,n.withoutSimilar],i),I(n.withVars,i)}))},vp=Mt((function(){return document.implementation.createHTMLDocument("undo")}));function bp(t){return t.select}function yp(t){return t&&t.ownerDocument&&jt(Oe.fromDom(t.ownerDocument),Oe.fromDom(t))}function xp(t,e,n,r){function o(t,e){return function(t,e,n){var r,o=(r=e,_t(_t({format:"html"},n=void 0===n?{}:n),{set:!0,selection:!0,content:r})),i=o;if(!o.no_events){var a=t.fire("BeforeSetContent",o);if(a.isDefaultPrevented())return void t.fire("SetContent",a);i=a}i.content=function(t,e){if("raw"===e.format)return e.content;var n=t.selection.getRng(),r=t.dom.getParent(n.commonAncestorContainer,t.dom.isBlock),o=r?{context:r.nodeName.toLowerCase()}:{},i=t.parser.parse(e.content,_t(_t({isRootContent:!0,forced_root_block:!1},o),e));return Zd({validate:t.validate},t.schema).serialize(i)}(t,i);var u=t.selection.getRng();!function(t,e){var n=vt.from(e.firstChild).map(Oe.fromDom),r=vt.from(e.lastChild).map(Oe.fromDom);t.deleteContents(),t.insertNode(e);var o=n.bind(Ne).filter(En).bind(rp),i=r.bind(Be).filter(En).bind(rp);op(o,n,t,!0),op(i,r,t,!1),t.collapse(!1)}(u,u.createContextualFragment(i.content)),t.selection.setRng(u),Yf(t,u),i.no_events||t.fire("SetContent",i)}(r,t,e)}function i(){var e=c(),n=null==e?void 0:e.anchorNode,r=null==e?void 0:e.focusNode;if(!e||!n||!r||rn(n)||rn(r))return!0;var o=t.createRng();o.setStart(n,e.anchorOffset),o.collapse(!0);var i=t.createRng();return i.setStart(r,e.focusOffset),i.collapse(!0),o.compareBoundaryPoints(o.START_TO_START,i)<=0}function a(t){var e=p();e.collapse(!!t),v(e)}function c(){return e.getSelection?e.getSelection():e.document.selection}var s,l,f,d,m,g,h=function(t,e){return m||(m={},g={},d.on("NodeChange",(function(t){var e=t.element,n=C(e),r={};ke.each(m,(function(t,e){w(e,n).each((function(o){g[e]||(I(t,(function(t){t(!0,{node:o,selector:e,parents:n})})),g[e]=t),r[e]=t}))})),ke.each(g,(function(t,o){r[o]||(delete g[o],ke.each(t,(function(t){t(!1,{node:e,selector:o,parents:n})})))}))}))),m[t]||(m[t]=[]),m[t].push(e),w(t,C(d.selection.getStart())).each((function(){g[t]=m[t]})),{unbind:function(){ip(m,t,e),ip(g,t,e)}}},p=function(){function n(t,e,n){try{return e.compareBoundaryPoints(t,n)}catch(t){return-1}}var o,i,a,u=e.document;if(void 0!==r.bookmark&&!1===md(r)){var f=ud(r);if(f.isSome())return f.map((function(t){return bd(r,[t])[0]})).getOr(u.createRange())}try{(o=c())&&!rn(o.anchorNode)&&(i=0<o.rangeCount?o.getRangeAt(0):(o.createRange?o:u).createRange(),i=bd(r,[i])[0])}catch(n){}return(i=i||(u.createRange?u.createRange():u.body.createTextRange())).setStart&&9===i.startContainer.nodeType&&i.collapsed&&(a=t.getRoot(),i.setStart(a,0),i.setEnd(a,0)),s&&l&&(0===n(i.START_TO_START,i,s)&&0===n(i.END_TO_END,i,s)?i=l:l=s=null),i},v=function(t,e){var n;if((o=t)&&(bp(o)||yp(o.startContainer)&&yp(o.endContainer))){var o,i=bp(t)?t:null;if(i){l=null;try{i.select()}catch(t){}}else{var a=c();if(t=r.fire("SetSelectionRange",{range:t,forward:e}).range,a){l=t;try{a.removeAllRanges(),a.addRange(t)}catch(t){}!1===e&&a.extend&&(a.collapse(t.endContainer,t.endOffset),a.extend(t.startContainer,t.startOffset)),s=0<a.rangeCount?a.getRangeAt(0):null}t.collapsed||t.startContainer!==t.endContainer||!a.setBaseAndExtent||we.ie||t.endOffset-t.startOffset<2&&t.startContainer.hasChildNodes()&&(n=t.startContainer.childNodes[t.startOffset])&&"IMG"===n.tagName&&(a.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset),a.anchorNode===t.startContainer&&a.focusNode===t.endContainer||a.setBaseAndExtent(n,0,n,1)),r.fire("AfterSetSelectionRange",{range:t,forward:e})}}},b={bookmarkManager:null,controlSelection:null,dom:f=t,win:e,serializer:n,editor:d=r,collapse:a,setCursorLocation:function(e,n){var o=t.createRng();u(e)&&u(n)?(o.setStart(e,n),o.setEnd(e,n),v(o),a(!1)):(Tl(t,o,r.getBody(),!0),v(o))},getContent:function(t){return n=(e=void 0===(e=t)?{}:e).format||"html",o=e,np(r).selection.getContent(n,o);var e,n,o},setContent:o,getBookmark:function(t,e){return y.getBookmark(t,e)},moveToBookmark:function(t){return y.moveToBookmark(t)},select:function(e,n){var r=t,o=n;return vt.from(e).map((function(t){var e=r.nodeIndex(t),n=r.createRng();return n.setStart(t.parentNode,e),n.setEnd(t.parentNode,e+1),o&&(Tl(r,n,t,!0),Tl(r,n,t,!1)),n})).each(v),e},isCollapsed:function(){var t=p(),e=c();return!(!t||t.item)&&(t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!e||t.collapsed)},isForward:i,setNode:function(e){return o(t.getOuterHTML(e)),e},getNode:function(){return function(t,e){if(!e)return t;var n=e.startContainer,r=e.endContainer,o=e.startOffset,i=e.endOffset,a=e.commonAncestorContainer;return!e.collapsed&&(n===r&&i-o<2&&n.hasChildNodes()&&(a=n.childNodes[o]),3===n.nodeType&&3===r.nodeType&&(n=n.length===o?vd(n.nextSibling,!0):n.parentNode,r=0===i?vd(r.previousSibling,!1):r.parentNode,n&&n===r))?n:a&&3===a.nodeType?a.parentNode:a}(r.getBody(),p())},getSel:c,setRng:v,getRng:p,getStart:function(t){return hd(r.getBody(),p(),t)},getEnd:function(t){return pd(r.getBody(),p(),t)},getSelectedBlocks:function(e,n){return function(t,e,n,r){var o=[],i=t.getRoot();if(n=t.getParent(n||hd(i,e,e.collapsed),t.isBlock),r=t.getParent(r||pd(i,e,e.collapsed),t.isBlock),n&&n!==i&&o.push(n),n&&r&&n!==r)for(var a,u=new _r(n,i);(a=u.next())&&a!==r;)t.isBlock(a)&&o.push(a);return r&&n!==r&&r!==i&&o.push(r),o}(t,p(),e,n)},normalize:function(){var e=p();if(1<Sl(c()).length||!Ml(r))return e;var n=Ef(t,e);return n.each((function(t){v(t,i())})),n.getOr(e)},selectorChanged:function(t,e){return h(t,e),b},selectorChangedWithUnbind:h,getScrollContainer:function(){for(var e,n=t.getRoot();n&&"BODY"!==n.nodeName;){if(n.scrollHeight>n.clientHeight){e=n;break}n=n.parentNode}return e},scrollIntoView:function(t,e){u(t)?(r.inline?$f:Kf)(r,t,e):Yf(r,p(),e)},placeCaretAt:function(t,e){return v(yf(t,e,r.getDoc()))},getBoundingClientRect:function(){var t=p();return t.collapsed?ic.fromRangeStart(t).getClientRects()[0]:t.getBoundingClientRect()},destroy:function(){e=s=l=null,x.destroy()}},y=Rl(b),x=vf(b,r);function w(t,e){return q(e,(function(e){return f.is(e,t)}))}function C(t){return f.getParents(t,null,f.getRoot())}return b.bookmarkManager=y,b.controlSelection=x,b}function wp(t){var e,n=decodeURIComponent(t).split(","),r=/data:([^;]+)/.exec(n[0]);return{type:e=r?r[1]:e,data:n[1]}}function Cp(t,e){var n;try{n=atob(e)}catch(t){return vt.none()}for(var r=new Uint8Array(n.length),o=0;o<r.length;o++)r[o]=n.charCodeAt(o);return vt.some(new Blob([r],{type:t}))}function Sp(t){return 0===t.indexOf("blob:")?(e=t,new kr((function(t,n){function r(){n("Cannot convert "+e+" to Blob. Resource might not exist or is inaccessible.")}try{var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="blob",o.onload=function(){200===o.status?t(o.response):r()},o.onerror=r,o.send()}catch(t){r()}}))):0===t.indexOf("data:")?(n=t,new kr((function(t){var e=wp(n);Cp(e.type,e.data).fold((function(){return t(new Blob([]))}),t)}))):null;var e,n}function kp(t){return(t||"blobid")+jp++}function Op(t,e,n,r){(t.padd_empty_with_br||e.insert)&&n[r.name]?r.empty().append(new Rd("br",1)).shortEnded=!0:r.empty().append(new Rd("#text",3)).value=yo}function Ep(t,e,n,r){return r.isEmpty(e,n,(function(e){return(n=t.getElementRule(e.name))&&n.paddEmpty;var n}))}function _p(t,e){void 0===e&&(e=eo());var n={},r=[],o={},i={};function a(t){var e=t.name;e in n&&((u=o[e])?u.push(t):o[e]=[t]);for(var a=r.length;a--;){var u,c=r[a].name;c in t.attributes.map&&((u=i[c])?u.push(t):i[c]=[t])}return t}(t=t||{}).validate=!("validate"in t)||t.validate,t.root_name=t.root_name||"body";var c={schema:e,addAttributeFilter:function(t,e){Gp($p(t),(function(t){for(var n=0;n<r.length;n++)if(r[n].name===t)return void r[n].callbacks.push(e);r.push({name:t,callbacks:[e]})}))},getAttributeFilters:function(){return[].concat(r)},addNodeFilter:function(t,e){Gp($p(t),(function(t){var r=n[t];r||(n[t]=r=[]),r.push(e)}))},getNodeFilters:function(){var t,e=[];for(t in n)Ot(n,t)&&e.push({name:t,callbacks:n[t]});return e},filterNode:a,parse:function(c,s){var l,f,d,m,g,h,p,v,b=[];function y(t){for(var n=e.getBlockElements(),r=t.prev;r&&3===r.type;){var o=r.value.replace(D,"");if(0<o.length)return r.value=o,0;var i=r.next;if(i){if(3===i.type&&i.value.length){r=r.prev;continue}if(!n[i.name]&&"script"!==i.name&&"style"!==i.name){r=r.prev;continue}}var a=r.prev;r.remove(),r=a}}function x(t,e){var r,i=new Rd(t,e);return t in n&&((r=o[t])?r.push(i):o[t]=[i]),i}s=s||{},o={},i={};var w=Xp(qp("script,style,head,html,body,title,meta,param"),e.getBlockElements()),C=Zr(e),S=e.getNonEmptyElements(),k=e.children,O=t.validate,E=("forced_root_block"in s?s:t).forced_root_block,_=!1===E?"":!0===E?"p":E,T=e.getWhiteSpaceElements(),M=/^[ \t\r\n]+/,D=/[ \t\r\n]+$/,z=/[ \t\r\n]+/g,A=/^[ \t\r\n]+$/,N=Ot(T,s.context)||Ot(T,t.root_name),B=Gd({validate:O,document:t.document,allow_html_data_urls:t.allow_html_data_urls,allow_svg_data_urls:t.allow_svg_data_urls,allow_script_urls:t.allow_script_urls,allow_conditional_comments:t.allow_conditional_comments,preserve_cdata:t.preserve_cdata,self_closing_elements:function(t){var e,n={};for(e in t)"li"!==e&&"p"!==e&&(n[e]=t[e]);return n}(e.getSelfClosingElements()),cdata:function(t){v.append(x("#cdata",4)).value=t},text:function(t,e){var n,r;N||(t=t.replace(z," "),(r=v.lastChild)&&(Ot(w,r.name)||"br"===r.name)&&(t=t.replace(M,""))),0!==t.length&&((n=x("#text",3)).raw=!!e,v.append(n).value=t)},comment:function(t){v.append(x("#comment",8)).value=t},pi:function(t,e){v.append(x(t,7)).value=e,y(v)},doctype:function(t){v.append(x("#doctype",10)).value=t,y(v)},start:function(t,n,o){var a=O?e.getElementRule(t):{};if(a){var u=x(a.outputName||t,1);u.attributes=n,u.shortEnded=o,v.append(u);var c=k[v.name];c&&k[u.name]&&!c[u.name]&&b.push(u);for(var s=r.length;s--;){var l=r[s].name;l in n.map&&((h=i[l])?h.push(u):i[l]=[u])}w[t]&&y(u),o||(v=u),!N&&T[t]&&(N=!0)}},end:function(n){var r,o,i,a,c=O?e.getElementRule(n):{};if(c){if(w[n]&&!N){if((r=v.firstChild)&&3===r.type)if(0<(o=r.value.replace(M,"")).length)r.value=o,r=r.next;else for(i=r.next,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.next,0!==o.length&&!A.test(o)||(r.remove(),r=i),r=i;if((r=v.lastChild)&&3===r.type)if(0<(o=r.value.replace(D,"")).length)r.value=o,r=r.prev;else for(i=r.prev,r.remove(),r=i;r&&3===r.type;)o=r.value,i=r.prev,0!==o.length&&!A.test(o)||(r.remove(),r=i),r=i}N&&T[n]&&(N=!1);var l=Ep(e,S,T,v),f=v.parent;c.paddInEmptyBlock&&l&&function(){for(var t=v;u(t);){if(t.name in C)return Ep(e,S,T,t);t=t.parent}}()?Op(t,s,w,v):c.removeEmpty&&l?w[v.name]?v.empty().remove():v.unwrap():c.paddEmpty&&(Wp(a=v,"#text")&&a.firstChild.value===yo||l)&&Op(t,s,w,v),v=f}}},e),R=v=new Rd(s.context||t.root_name,11);if(B.parse(c,s.format),O&&b.length&&(s.context?s.invalid=!0:function(t){for(var n=qp("tr,td,th,tbody,thead,tfoot,table"),r=e.getNonEmptyElements(),o=e.getWhiteSpaceElements(),i=e.getTextBlockElements(),u=e.getSpecialElements(),c=function(t,n){if(void 0===n&&(n=t.parent),u[t.name])t.empty().remove();else{for(var r=0,o=t.children();r<o.length;r++){var i=o[r];e.isValidChild(n.name,i.name)||c(i,n)}t.unwrap()}},s=0;s<t.length;s++){var l,f=t[s],d=void 0,m=void 0;if(f.parent&&!f.fixed)if(i[f.name]&&"li"===f.parent.name){for(var g=f.next;g&&i[g.name];)g.name="li",g.fixed=!0,f.parent.insert(g,f.parent),g=g.next;f.unwrap()}else{var h=[f];for(d=f.parent;d&&!e.isValidChild(d.name,f.name)&&!n[d.name];d=d.parent)h.push(d);if(d&&1<h.length)if(e.isValidChild(d.name,f.name)){h.reverse();for(var p=l=a(h[0].clone()),v=0;v<h.length-1;v++){e.isValidChild(p.name,h[v].name)?(m=a(h[v].clone()),p.append(m)):m=p;for(var b=h[v].firstChild;b&&b!==h[v+1];){var y=b.next;m.append(b),b=y}p=m}Ep(e,r,o,l)?d.insert(f,h[0],!0):(d.insert(l,h[0],!0),d.insert(f,l)),d=h[0],(Ep(e,r,o,d)||Wp(d,"br"))&&d.empty().remove()}else c(f);else f.parent&&("li"!==f.name?e.isValidChild(f.parent.name,"div")&&e.isValidChild("div",f.name)?f.wrap(a(new Rd("div",1))):c(f):!(g=f.prev)||"ul"!==g.name&&"ol"!==g.name?!(g=f.next)||"ul"!==g.name&&"ol"!==g.name?f.wrap(a(new Rd("ul",1))):g.insert(f,g.firstChild,!0):g.append(f))}}}(b)),_&&("body"===R.name||s.isRootContent)&&function(){function n(t){t&&((r=t.firstChild)&&3===r.type&&(r.value=r.value.replace(M,"")),(r=t.lastChild)&&3===r.type&&(r.value=r.value.replace(D,"")))}var r=R.firstChild,o=null;if(e.isValidChild(R.name,_.toLowerCase())){for(;r;){var i=r.next;3===r.type||1===r.type&&"p"!==r.name&&!w[r.name]&&!r.attr("data-mce-type")?(o||((o=x(_,1)).attr(t.forced_root_block_attrs),R.insert(o,r)),o.append(r)):(n(o),o=null),r=i}n(o)}}(),!s.invalid){for(p in o)if(Ot(o,p)){for(h=n[p],m=(l=o[p]).length;m--;)l[m].parent||l.splice(m,1);for(f=0,d=h.length;f<d;f++)h[f](l,p,s)}for(f=0,d=r.length;f<d;f++)if((h=r[f]).name in i){for(m=(l=i[h.name]).length;m--;)l[m].parent||l.splice(m,1);for(m=0,g=h.callbacks.length;m<g;m++)h.callbacks[m](l,h.name,s)}}return R}};return function(t,e){var n,r,o,i=t.schema;function a(t){var e,n,i=t.attr("src");(e=t).attr("src")===we.transparentSrc||u(e.attr("data-mce-placeholder"))||u(t.attr("data-mce-bogus"))||((n=/data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(i))?vt.some({type:n[1],data:decodeURIComponent(n[2])}):vt.none()).filter((function(){return function(t,e){if(e.images_dataimg_filter){var n=new Image;return n.src=t.attr("src"),nt(t.attributes.map,(function(t,e){n.setAttribute(e,t)})),e.images_dataimg_filter(n)}return!0}(t,r)})).bind((function(t){var e=t.type,n=t.data;return vt.from(o.getByData(n,e)).orThunk((function(){return Cp(e,n).map((function(t){var e=o.create(kp(),t,n);return o.add(e),e}))}))})).each((function(e){t.attr("src",e.blobUri())}))}e.remove_trailing_brs&&t.addNodeFilter("br",(function(t,n,r){var o,a,u,c,s,l,f,d,m=t.length,g=ke.extend({},i.getBlockElements()),h=i.getNonEmptyElements(),p=i.getWhiteSpaceElements();for(g.body=1,o=0;o<m;o++)if(u=(a=t[o]).parent,g[a.parent.name]&&a===u.lastChild){for(s=a.prev;s;){if("span"!==(l=s.name)||"bookmark"!==s.attr("data-mce-type")){"br"===l&&(a=null);break}s=s.prev}a&&(a.remove(),Ep(i,h,p,u)&&(f=i.getElementRule(u.name))&&(f.removeEmpty?u.remove():f.paddEmpty&&Op(e,r,g,u)))}else{for(c=a;u&&u.firstChild===c&&u.lastChild===c&&!g[(c=u).name];)u=u.parent;c===u&&!0!==e.padd_empty_with_br&&((d=new Rd("#text",3)).value=yo,a.replace(d))}})),t.addAttributeFilter("href",(function(t){var n,r,o=t.length;if(!e.allow_unsafe_link_target)for(;o--;){var i=t[o];"a"===i.name&&"_blank"===i.attr("target")&&i.attr("rel",(r=void 0,r=(n=i.attr("rel"))?ke.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter((function(t){return 0<t.length})).concat(["noopener"]).sort().join(" ")))}})),e.allow_html_in_named_anchor||t.addAttributeFilter("id,name",(function(t){for(var e,n,r,o,i=t.length;i--;)if("a"===(o=t[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,e=o.lastChild;n=e.prev,r.insert(e,o),e=n;);})),e.fix_list_elements&&t.addNodeFilter("ul,ol",(function(t){for(var e,n,r,o=t.length;o--;)"ul"!==(r=(n=t[o]).parent).name&&"ol"!==r.name||(n.prev&&"li"===n.prev.name?n.prev.append(n):((e=new Rd("li",1)).attr("style","list-style-type: none"),n.wrap(e)))})),e.validate&&i.getValidClasses()&&t.addAttributeFilter("class",(function(t){for(var e=i.getValidClasses(),n=t.length;n--;){for(var r=t[n],o=r.attr("class").split(" "),a="",u=0;u<o.length;u++){var c=o[u],s=!1,l=e["*"];l&&l[c]&&(s=!0),l=e[r.name],(s=!(s||!l||!l[c])||s)&&(a&&(a+=" "),a+=c)}a.length||(a=null),r.attr("class",a)}})),n=t,(o=(r=e).blob_cache)&&n.addAttributeFilter("src",(function(t){return I(t,a)}))}(c,t),t.inline_styles&&function(t,e){var n,r,o,i,a=ro();e.convert_fonts_to_spans&&(r=t,o=a,i=ke.explode(e.font_size_legacy_values),r.addNodeFilter("font",(function(t){I(t,(function(t){var e,n=o.parse(t.attr("style")),r=t.attr("color"),a=t.attr("face"),u=t.attr("size");r&&(n.color=r),a&&(n["font-family"]=a),u&&(n["font-size"]=i[parseInt(t.attr("size"),10)-1]),t.name="span",t.attr("style",o.serialize(n)),e=t,I(["color","face","size"],(function(t){e.attr(t,null)}))}))}))),n=a,t.addNodeFilter("strike",(function(t){I(t,(function(t){var e=n.parse(t.attr("style"));e["text-decoration"]="line-through",t.name="span",t.attr("style",n.serialize(e))}))}))}(c,t),c}function Tp(t,e,n){-1===ke.inArray(e,n)&&(t.addAttributeFilter(n,(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),e.push(n))}function Mp(t,e){var n=function(t,e){var n=["data-mce-selected"],r=e&&e.dom?e.dom:Ja.DOM,o=e&&e.schema?e.schema:eo(t);t.entity_encoding=t.entity_encoding||"named",t.remove_trailing_brs=!("remove_trailing_brs"in t)||t.remove_trailing_brs;var i,a=_p(t,o),u=t,c=r;return(i=a).addAttributeFilter("data-mce-tabindex",(function(t,e){for(var n=t.length;n--;){var r=t[n];r.attr("tabindex",r.attr("data-mce-tabindex")),r.attr(e,null)}})),i.addAttributeFilter("src,href,style",(function(t,e){for(var n="data-mce-"+e,r=u.url_converter,o=u.url_converter_scope,i=t.length;i--;){var a=t[i],s=a.attr(n);void 0!==s?(a.attr(e,0<s.length?s:null),a.attr(n,null)):(s=a.attr(e),"style"===e?s=c.serializeStyle(c.parseStyle(s),a.name):r&&(s=r.call(o,s,e,a.name)),a.attr(e,0<s.length?s:null))}})),i.addAttributeFilter("class",(function(t){for(var e=t.length;e--;){var n,r=t[e];r.attr("class")&&(n=r.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),r.attr("class",0<n.length?n:null))}})),i.addAttributeFilter("data-mce-type",(function(t,e,n){for(var r=t.length;r--;){var o=t[r];"bookmark"!==o.attr("data-mce-type")||n.cleanup||(vt.from(o.firstChild).exists((function(t){return!wo(t.value)}))?o.unwrap():o.remove())}})),i.addNodeFilter("noscript",(function(t){for(var e=t.length;e--;){var n=t[e].firstChild;n&&(n.value=Yo.decode(n.value))}})),i.addNodeFilter("script,style",(function(t,e){for(var n=function(t){return t.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,"")},r=t.length;r--;){var o,i=t[r],a=i.firstChild?i.firstChild.value:"";"script"===e?((o=i.attr("type"))&&i.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===u.element_format&&0<a.length&&(i.firstChild.value="// <![CDATA[\n"+n(a)+"\n// ]]>")):"xhtml"===u.element_format&&0<a.length&&(i.firstChild.value="\x3c!--\n"+n(a)+"\n--\x3e")}})),i.addNodeFilter("#comment",(function(t){for(var e=t.length;e--;){var n=t[e];u.preserve_cdata&&0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=c.decode(n.value.replace(/^\[CDATA\[|\]\]$/g,""))):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}})),i.addNodeFilter("xml:namespace,input",(function(t,e){for(var n=t.length;n--;){var r=t[n];7===r.type?r.remove():1===r.type&&("input"!==e||r.attr("type")||r.attr("type","text"))}})),i.addAttributeFilter("data-mce-type",(function(t){I(t,(function(t){"format-caret"===t.attr("data-mce-type")&&(t.isEmpty(i.schema.getNonEmptyElements())?t.remove():t.unwrap())}))})),i.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize,data-mce-placeholder",(function(t,e){for(var n=t.length;n--;)t[n].attr(e,null)})),{schema:o,addNodeFilter:a.addNodeFilter,addAttributeFilter:a.addAttributeFilter,serialize:function(n,i){var u,c,s,l,f,d,m,g,h,p,v,b,y,x,w,C,S,k,O,E,_,T,M,D,z,A,N,B,R,H=_t({format:"html"},i=void 0===i?{}:i),V=(b=n,M=y=H,u=(v=e)&&v.hasEventListeners("PreProcess")&&!M.no_events?(w=y,E=(x=v).dom,_=b.cloneNode(!0),(T=document.implementation).createHTMLDocument&&(S=T.createHTMLDocument(""),ke.each("BODY"===_.nodeName?_.childNodes:[_],(function(t){S.body.appendChild(S.importNode(t,!0))})),_="BODY"!==_.nodeName?S.body.firstChild:S.body,C=E.doc,E.doc=S),k=x,O=_t(_t({},w),{node:_}),k.fire("PreProcess",O),C&&(E.doc=C),_):b,s=Co((c=H).getInner?u.innerHTML:r.getOuterHTML(u)),c.selection||vo(Oe.fromDom(u))?s:ke.trim(s)),I=(l=a,f=V,m=(d=H).selection?_t({forced_root_block:!1},d):d,!L(p=(g=l.parse(f,m)).lastChild)||L(h=p.prev)&&(p.remove(),h.remove()),g);function L(t){return t&&"br"===t.name}return"tree"===H.format?I:(D=e,z=H,A=I,R=Zd(t,o).serialize(A),z.no_events||!D?R:(N=D,B=_t(_t({},z),{content:R}),N.fire("PostProcess",B).content))},addRules:o.addValidElements,setRules:o.setValidElements,addTempAttr:O(Tp,a,n),getTempAttrs:f(n),getNodeFilters:a.getNodeFilters,getAttributeFilters:a.getAttributeFilters}}(t,e);return{schema:n.schema,addNodeFilter:n.addNodeFilter,addAttributeFilter:n.addAttributeFilter,serialize:n.serialize,addRules:n.addRules,setRules:n.setRules,addTempAttr:n.addTempAttr,getTempAttrs:n.getTempAttrs,getNodeFilters:n.getNodeFilters,getAttributeFilters:n.getAttributeFilters}}function Dp(t,e,n){return r=n=void 0===n?{}:n,ep(t).editor.setContent(e,r);var r}function zp(t){return vt.from(t).each((function(t){return t.destroy()}))}function Ap(t){var e=y(t)?t.join(" "):t;return P(V(v(e)?e.split(" "):[],Jt),(function(t){return 0<t.length}))}function Np(t,e){return Ot(t.sections(),e)}function Bp(t,e){return ut(t,"toolbar_mode").orThunk((function(){return ut(t,"toolbar_drawer").map((function(t){return!1===t?"wrap":t}))})).getOr(e)}function Rp(t,e,n,r,o){var i,a,u,c,s,l,d,m,g=t?{mobile:(i=e,a={resize:!1,toolbar_mode:Bp(o.mobile||{},"scrolling"),toolbar_sticky:!1},_t(_t(_t({},iv),a),i?{menubar:!1}:{}))}:{},h=(s=["mobile"],it(Yp(g,o),(function(t,e){return R(s,e)}),ot(l={}),ot(d={})),{sections:f((m={t:l,f:d}).t),settings:f(m.f)}),p=ke.extend(n,r,h.settings(),t&&Np(h,"mobile")?function(t){void 0===t&&(t={});var e=ut(h.sections(),"mobile").getOr({});return ke.extend({},t,e)}():{},{validate:!0,external_plugins:(u=r,c=h.settings().external_plugins||{},u&&u.external_plugins?ke.extend({},u.external_plugins,c):c)});return function(t,e,n,r){var o,i,a,u,c,s,l,f,d=Ap(n.forced_plugins),m=Ap(r.plugins),g=Np(o=e,"mobile")?o.sections().mobile:{},h=(u=e,c=m,s=g.plugins?Ap(g.plugins):m,i=(a=t)&&(f=(l=u).sections(),Np(l,"mobile")&&"mobile"===f.mobile.theme)?P(s,O(R,ov)):a&&Np(u,"mobile")?s:c,[].concat(Ap(d)).concat(Ap(i)));if(we.browser.isIE()&&R(h,"rtc"))throw new Error("RTC plugin is not supported on IE 11.");return ke.extend(r,{plugins:h.join(" ")})}(t,h,r,p)}function Hp(t,e,n){return vt.from(e.settings[n]).filter(t)}function Vp(t,e){return e.dom[t]}function Ip(t,e){return parseInt(xn(e,t),10)}function Lp(t,e,n){var r,o,i,a,u,c,s=Oe.fromDom(t.getBody()),l=t.inline?s:Oe.fromDom(De(s).dom.documentElement),f=(r=t.inline,i=e,a=n,u=(o=l).dom.getBoundingClientRect(),{x:i-(r?u.left+o.dom.clientLeft+lv(o):0),y:a-(r?u.top+o.dom.clientTop+sv(o):0)}),d=f.x,m=f.y,g=uv(c=l),h=cv(c);return 0<=d&&0<=m&&d<=g&&m<=h}function Fp(t){function e(){var e=t.theme;return e&&e.getNotificationManagerImpl?e.getNotificationManagerImpl():{open:n,close:n,reposition:n,getArgs:n};function n(){throw new Error("Theme did not provide a NotificationManager implementation.")}}function n(){return vt.from(u[0])}function r(){0<u.length&&e().reposition(u)}function o(t){G(u,(function(e){return e===t})).each((function(t){u.splice(t,1)}))}function i(i,a){if(void 0===a&&(a=!0),!t.removed&&(s=(c=t).inline?c.getBody():c.getContentAreaContainer(),vt.from(s).map(Oe.fromDom).map(Rn).getOr(!1)))return a&&t.fire("BeforeOpenNotification",{notification:i}),q(u,(function(t){return!((n=e().getArgs(t)).type!==i.type||n.text!==i.text||n.progressBar||n.timeout||i.progressBar||i.timeout);var n})).getOrThunk((function(){t.editorManager.setActive(t);var a=e().open(i,(function(){o(a),r(),n().fold((function(){return t.focus()}),(function(t){return Oe.fromDom(t.getEl()).dom.focus()}))}));return u.push(a),r(),t.fire("OpenNotification",{notification:_t({},a)}),a}));var c,s}var a,u=[],c=f(u);return(a=t).on("SkinLoaded",(function(){var t=a.getParam("service_message");t&&i({text:t,type:"warning",timeout:0},!1),r()})),a.on("show ResizeEditor ResizeWindow NodeChange",(function(){Or.requestAnimationFrame(r)})),a.on("remove",(function(){I(u.slice(),(function(t){e().close(t)}))})),{open:i,close:function(){n().each((function(t){e().close(t),o(t),r()}))},getNotifications:c}}var Pp,Up,jp=0,Wp=function(t,e){return t&&t.firstChild&&t.firstChild===t.lastChild&&t.firstChild.name===e},qp=ke.makeMap,Gp=ke.each,$p=ke.explode,Xp=ke.extend,Kp=Ja.DOM,Yp=(Pp=function(t,e){return b(t)&&b(e)?Yp(t,e):e},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(0===t.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<t.length;r++){var o,i=t[r];for(o in i)Ot(i,o)&&(n[o]=Pp(n[o],i[o]))}return n}),Jp="autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,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,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists".split(","),Qp="bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor".split(","),Zp="imagetools,toc".split(","),tv=de().deviceType,ev=tv.isTouch(),nv=tv.isPhone(),rv=tv.isTablet(),ov=["lists","autolink","autosave"],iv={table_grid:!1,object_resizing:!1,resize:!1},av=(Up={},{add:function(t,e){Up[t]=e},get:function(t){return Up[t]||{icons:{}}},has:function(t){return Ot(Up,t)}}),uv=O(Vp,"clientWidth"),cv=O(Vp,"clientHeight"),sv=O(Ip,"margin-top"),lv=O(Ip,"margin-left"),fv=cu.PluginManager,dv=cu.ThemeManager;function mv(t){function e(){var e=t.theme;return e&&e.getWindowManagerImpl?e.getWindowManagerImpl():{open:n,openUrl:n,alert:n,confirm:n,close:n,getParams:n,setParams:n};function n(){throw new Error("Theme did not provide a WindowManager implementation.")}}function n(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e?e.apply(t,n):void 0}}function r(e){t.fire("CloseWindow",{dialog:e}),0===(i=P(i,(function(t){return t!==e}))).length&&t.focus()}function o(e){t.editorManager.setActive(t),ad(t);var n,r=e();return n=r,i.push(n),t.fire("OpenWindow",{dialog:n}),r}var i=[];return t.on("remove",(function(){I(i,(function(t){e().close(t)}))})),{open:function(t,n){return o((function(){return e().open(t,n,r)}))},openUrl:function(t){return o((function(){return e().openUrl(t,r)}))},alert:function(t,r,o){var i=e();i.alert(t,n(o||i,r))},confirm:function(t,r,o){var i=e();i.confirm(t,n(o||i,r))},close:function(){vt.from(i[i.length-1]).each((function(t){e().close(t),r(t)}))}}}function gv(t,e){t.notificationManager.open({type:"error",text:e})}function hv(t,e){t._skinLoaded?gv(t,e):t.on("SkinLoaded",(function(){gv(t,e)}))}function pv(t,e,n){gf(t,e,{message:n}),console.error(n)}function vv(t,e,n){return n?"Failed to load "+t+": "+n+" from url "+e:"Failed to load "+t+" url: "+e}function bv(t,e,n){pv(t,"PluginLoadError",vv("plugin",e,n))}function yv(){function t(t,e){return{status:t,resultUri:e}}function e(t){return t in n}var n={};return{hasBlobUri:e,getResultUri:function(t){var e=n[t];return e?e.resultUri:null},isPending:function(t){return!!e(t)&&1===n[t].status},isUploaded:function(t){return!!e(t)&&2===n[t].status},markPending:function(e){n[e]=t(1,null)},markUploaded:function(e,r){n[e]=t(2,r)},removeFailed:function(t){delete n[t]},destroy:function(){n={}}}}function xv(t){return t+Fb+++"s"+(new Date).getTime().toString(36)+e()+e()+e();function e(){return Math.round(4294967295*Math.random()).toString(36)}}function wv(){function t(t){return q(r,t).getOrUndefined()}function e(t){if(!t.blob||!t.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");var e=t.id||xv("blobid"),n=t.name||e,r=t.blob;return{id:f(e),name:f(n),filename:f(t.filename||n+"."+({"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"}[r.type.toLowerCase()]||"dat")),blob:f(r),base64:f(t.base64),blobUri:f(t.blobUri||URL.createObjectURL(r)),uri:f(t.uri)}}function n(e){return t((function(t){return t.id()===e}))}var r=[];return{create:function(t,n,r,o,i){if(v(t))return e({id:t,name:o,filename:i,blob:n,base64:r});if(b(t))return e(t);throw new Error("Unknown input type")},add:function(t){n(t.id())||r.push(t)},get:n,getByUri:function(e){return t((function(t){return t.blobUri()===e}))},getByData:function(e,n){return t((function(t){return t.base64()===e&&t.blob().type===n}))},findFirst:t,removeByUri:function(t){r=P(r,(function(e){return e.blobUri()!==t||void URL.revokeObjectURL(e.blobUri())}))},destroy:function(){I(r,(function(t){URL.revokeObjectURL(t.blobUri())})),r=[]}}}function Cv(t){return function(){return t.notificationManager.open({text:t.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})}}function Sv(t,e){return function(t,e){function n(t,n,r,o){var i=new XMLHttpRequest;i.open("POST",e.url),i.withCredentials=e.credentials,i.upload.onprogress=function(t){o(t.loaded/t.total*100)},i.onerror=function(){r("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var t,o,a;i.status<200||300<=i.status?r("HTTP Error: "+i.status):(t=JSON.parse(i.responseText))&&"string"==typeof t.location?n((o=e.basePath,a=t.location,o?o.replace(/\/$/,"")+"/"+a.replace(/^\//,""):a)):r("Invalid JSON: "+i.responseText)};var a=new FormData;a.append("file",t.blob(),t.filename()),i.send(a)}function r(t,e){return{url:e,blobInfo:t,status:!0}}function o(t,e,n){return{url:"",blobInfo:t,status:!1,error:{message:e,options:n}}}function i(t,e){ke.each(a[t],(function(t){t(e)})),delete a[t]}var a={};return!1===S(e.handler)&&(e.handler=n),{upload:function(u,c){return e.url||e.handler!==n?(l=c,s=ke.grep(u,(function(e){return!t.isUploaded(e.blobUri())})),kr.all(ke.map(s,(function(n){return t.isPending(n.blobUri())?(f=n.blobUri(),new kr((function(t){a[f]=a[f]||[],a[f].push(t)}))):(u=n,c=e.handler,s=l,t.markPending(u.blobUri()),new kr((function(e){var n;try{var a=function(){n&&n.close()};c(u,(function(n){a(),t.markUploaded(u.blobUri(),n),i(u.blobUri(),r(u,n)),e(r(u,n))}),(function(n,r){var c=r||{};a(),t.removeFailed(u.blobUri()),i(u.blobUri(),o(u,n,c)),e(o(u,n,c))}),(function(t){t<0||100<t||vt.from(n).orThunk((function(){return vt.from(s).map(_)})).each((function(e){(n=e).progressBar.value(t)}))}))}catch(t){e(o(u,t.message,{}))}})));var u,c,s,f})))):new kr((function(t){t([])}));var s,l}}}(e,{url:t.getParam("images_upload_url","","string"),basePath:t.getParam("images_upload_base_path","","string"),credentials:t.getParam("images_upload_credentials",!1,"boolean"),handler:t.getParam("images_upload_handler",null,"function")})}function kv(t){function e(e){return function(n){return t.selection?e(n):[]}}function n(t,e,n){for(var r=0;-1!==(r=t.indexOf(e,r))&&(t=t.substring(0,r)+n+t.substr(r+e.length),r+=n.length-e.length+1),-1!==r;);return t}function r(t,e,r){return t=n(t,'src="'+e+'"','src="'+r+'"'+(r===we.transparentSrc?' data-mce-placeholder="1"':"")),n(t,'data-mce-src="'+e+'"','data-mce-src="'+r+'"')}function o(e,n){I(t.undoManager.data,(function(t){"fragmented"===t.type?t.fragments=V(t.fragments,(function(t){return r(t,e,n)})):t.content=r(t.content,e,n)}))}function i(n){return s=s||Sv(t,g),v().then(e((function(r){var i=V(r,(function(t){return t.blobInfo}));return s.upload(i,Cv(t)).then(e((function(e){var i=[],a=V(e,(function(e,n){var a,u,c,s,l=r[n].blobInfo,f=r[n].image;return e.status&&t.getParam("images_replace_blob_uris",!0,"boolean")?(m.removeByUri(f.src),Zh(t)||(u=f,c=e.url,s=t.convertURL(c,"src"),o(u.src,c),t.$(u).attr({src:t.getParam("images_reuse_filename",!1,"boolean")?c+(-1===c.indexOf("?")?"?":"&")+(new Date).getTime():c,"data-mce-src":s}))):e.error&&(e.error.options.remove&&(o(f.getAttribute("src"),we.transparentSrc),i.push(f)),a=e.error.message,hv(t,uu.translate(["Failed to upload image: {0}",a]))),{element:f,status:e.status,uploadUri:e.url,blobInfo:l}}));return 0<a.length&&p.fireIfChanged(),0<i.length&&(Zh(t)?console.error("Removing images on failed uploads is currently unsupported for RTC"):t.undoManager.transact((function(){I(i,(function(e){t.dom.remove(e),m.removeByUri(e.src)}))}))),n&&n(a),a})))})))}function a(e){if(kc(t))return i(e)}function u(e){return!1!==X(h,(function(t){return t(e)}))&&(0!==e.getAttribute("src").indexOf("data:")||t.getParam("images_dataimg_filter",z,"function")(e))}function c(e){return e.replace(/src="(blob:[^"]+)"/g,(function(e,n){var r=g.getResultUri(n);if(r)return'src="'+r+'"';var o=(o=m.getByUri(n))||j(t.editorManager.get(),(function(t,e){return t||e.editorUpload&&e.editorUpload.blobCache.getByUri(n)}),null);return o?'src="data:'+o.blob().type+";base64,"+o.base64()+'"':e}))}var s,l,f,d,m=wv(),g=yv(),h=[],p=(d=ru(null),(f=t).on("change AddUndo",(function(t){d.set(_t({},t.level))})),{fireIfChanged:function(){var t=f.undoManager.data;tt(t).filter((function(t){return!Xh(d.get(),t)})).each((function(e){f.setDirty(!0),f.fire("change",{level:e,lastLevel:Q(t,t.length-2).getOrNull()})}))}}),v=function(){return(l=l||function(t,e){var n={};return{findAll:function(r,o){o=o||z;var i=V(P(r?wt(r.getElementsByTagName("img")):[],(function(e){var n=e.src;return we.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&n&&n!==we.transparentSrc&&(0===n.indexOf("blob:")?!t.isUploaded(n)&&o(e):0===n.indexOf("data:")&&o(e))})),(function(t){if(void 0!==n[t.src])return new kr((function(e){n[t.src].then((function(n){return"string"==typeof n?n:void e({image:t,blobInfo:n.blobInfo})}))}));var r=new kr((function(n,r){var o,i,a,u,c,s,l,f,d;o=e,a=n,u=r,0!==(i=t).src.indexOf("blob:")?(s=(c=wp(i.src)).data,l=c.type,f=s,(d=o.getByData(f,l))?a({image:i,blobInfo:d}):Sp(i.src).then((function(t){d=o.create(kp(),t,f),o.add(d),a({image:i,blobInfo:d})}),(function(t){u(t)}))):(d=o.getByUri(i.src))?a({image:i,blobInfo:d}):Sp(i.src).then((function(t){var e=t;new kr((function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)})).then((function(e){f=wp(e).data,d=o.create(kp(),t,f),o.add(d),a({image:i,blobInfo:d})}))}),(function(t){u(t)}))})).then((function(t){return delete n[t.image.src],t})).catch((function(e){return delete n[t.src],e}));return n[t.src]=r}));return kr.all(i)}}}(g,m)).findAll(t.getBody(),u).then(e((function(e){return e=P(e,(function(e){return"string"!=typeof e||void hv(t,e)})),Zh(t)||I(e,(function(t){o(t.image.src,t.blobInfo.blobUri()),t.image.src=t.blobInfo.blobUri(),t.image.removeAttribute("data-mce-src")})),e})))};return t.on("SetContent",(function(){(kc(t)?a:v)()})),t.on("RawSaveContent",(function(t){t.content=c(t.content)})),t.on("GetContent",(function(t){t.source_view||"raw"===t.format||"tree"===t.format||(t.content=c(t.content))})),t.on("PostRender",(function(){t.parser.addNodeFilter("img",(function(t){I(t,(function(t){var e,n=t.attr("src");m.getByUri(n)||(e=g.getResultUri(n))&&t.attr("src",e)}))}))})),{blobCache:m,addFilter:function(t){h.push(t)},uploadImages:i,uploadImagesAuto:a,scanForImages:v,destroy:function(){m.destroy(),g.destroy(),l=s=null}}}function Ov(t,e){function n(t){o="string"==typeof t?{name:t,classes:[],attrs:{}}:t;var e,n=Ub.create(o.name),r=n;return(e=o).classes.length&&Ub.addClass(r,e.classes.join(" ")),Ub.setAttribs(r,e.attrs),n}var r,o,i,a=e&&e.schema||eo({}),u=function(t,e,r){var o,i,c,s,l,f,d,m=0<e.length&&e[0],g=m&&m.name,h=(s=g,l="string"!=typeof(c=t)?c.nodeName.toLowerCase():c,!(!(d=(f=a.getElementRule(l))&&f.parentsRequired)||!d.length)&&(s&&-1!==ke.inArray(d,s)?s:d[0]));if(h)g===h?(i=e[0],e=e.slice(1)):i=h;else if(m)i=e[0],e=e.slice(1);else if(!r)return t;return i&&(o=n(i)).appendChild(t),r&&(o||(o=Ub.create("div")).appendChild(t),ke.each(r,(function(e){var r=n(e);o.insertBefore(r,t)}))),u(o,e,i&&i.siblings)};return t&&t.length?(r=n(o=t[0]),(i=Ub.create("div")).appendChild(u(r,t.slice(1),o.siblings)),i):""}function Ev(t){var e,n={classes:[],attrs:{}};return"*"!==(t=n.selector=ke.trim(t))&&(e=t.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,(function(t,e,r,o,i){switch(e){case"#":n.attrs.id=r;break;case".":n.classes.push(r);break;case":":-1!==ke.inArray("checked disabled enabled read-only required".split(" "),r)&&(n.attrs[r]=r)}var a;return"["!==o||(a=i.match(/([\w\-]+)(?:\=\"([^\"]+))?/))&&(n.attrs[a[1]]=a[2]),""}))),n.name=e||"div",n}function _v(t,e){var n,r,o="",i=(r=t.getParam("preview_styles","font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),v(r)?r:"");if(""===i)return"";function a(t){return t.replace(/%(\w+)/g,"")}if("string"==typeof e){if(!(e=t.formatter.get(e)))return;e=e[0]}if("preview"in e){var u=ut(e,"preview");if(fn(u,!1))return"";i=u.getOr(i)}var c,s=e.block||e.inline||"span",l=(c=e.selector)&&"string"==typeof c?(c=(c=c.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),ke.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),(function(t){var e=ke.map(t.split(/(?:~\+|~|\+)/),Ev),n=e.pop();return e.length&&(n.siblings=e),n})).reverse()):[],f=l.length?(l[0].name||(l[0].name=s),s=e.selector,Ov(l,t)):Ov([s],t),d=Ub.select(s,f)[0]||f.firstChild;return Pb(e.styles,(function(t,e){var n=a(t);n&&Ub.setStyle(d,e,n)})),Pb(e.attributes,(function(t,e){var n=a(t);n&&Ub.setAttrib(d,e,n)})),Pb(e.classes,(function(t){var e=a(t);Ub.hasClass(d,e)||Ub.addClass(d,e)})),t.fire("PreviewFormats"),Ub.setStyles(f,{position:"absolute",left:-65535}),t.getBody().appendChild(f),n=Ub.getStyle(t.getBody(),"fontSize",!0),n=/px$/.test(n)?parseInt(n,10):0,Pb(i.split(" "),(function(e){var r=Ub.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(r)&&(r=Ub.getStyle(t.getBody(),e,!0),"#ffffff"===Ub.toHex(r).toLowerCase())||"color"===e&&"#000000"===Ub.toHex(r).toLowerCase())){if("font-size"===e&&/em|%$/.test(r)){if(0===n)return;r=parseFloat(r)/(/%$/.test(r)?100:1)*n+"px"}"border"===e&&r&&(o+="padding:0 2px;"),o+=e+":"+r+";"}})),t.fire("AfterPreviewFormats"),Ub.remove(f),o}function Tv(t){var e,n,r,o,i,a,c=(o={},(i=function(t,e){t&&(v(t)?(I(e=y(e)?e:[e],(function(t){C(t.deep)&&(t.deep=!sl(t)),C(t.split)&&(t.split=!sl(t)||ll(t)),C(t.remove)&&sl(t)&&!ll(t)&&(t.remove="none"),sl(t)&&ll(t)&&(t.mixed=!0,t.block_expand=!0),v(t.classes)&&(t.classes=t.classes.split(/\s+/))})),o[t]=e):nt(t,(function(t,e){i(e,t)})))})((n=(e=t).dom,r={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:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img,audio,video",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table,audio,video",collapsed:!1,styles:{float:"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",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:!0},{inline:"u",remove:"all",preserve_attributes:["class","style"]}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"s",remove:"all",preserve_attributes:["class","style"]}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},lineheight:{selector:"h1,h2,h3,h4,h5,h6,p,li,td,th,div",defaultBlock:"p",styles:{lineHeight:"%value"}},fontsize_class:{inline:"span",attributes:{class:"%value"}},blockquote:{block:"blockquote",wrapper:!0,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(t,e,n){return Ln(t)&&t.hasAttribute("href")},onformat:function(t,e,r){ke.each(r,(function(e,r){n.setAttrib(t,r,e)}))}},lang:{inline:"span",clear_child_styles:!0,remove_similar:!0,attributes:{lang:"%value","data-mce-lang":function(t){var e;return null!==(e=null==t?void 0:t.customValue)&&void 0!==e?e: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:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]},ke.each("p h1 h2 h3 h4 h5 h6 div address pre dt dd samp".split(/\s/),(function(t){r[t]={block:t,remove:"all"}})),r)),i(e.getParam("formats")),{get:function(t){return u(t)?o[t]:o},has:function(t){return Ot(o,t)},register:i,unregister:function(t){return t&&o[t]&&delete o[t],o}}),s=ru(null);return function(t){t.addShortcut("meta+b","","Bold"),t.addShortcut("meta+i","","Italic"),t.addShortcut("meta+u","","Underline");for(var e=1;e<=6;e++)t.addShortcut("access+"+e,"",["FormatBlock",!1,"h"+e]);t.addShortcut("access+7","",["FormatBlock",!1,"p"]),t.addShortcut("access+8","",["FormatBlock",!1,"div"]),t.addShortcut("access+9","",["FormatBlock",!1,"address"])}(t),(a=t).on("mouseup keydown",(function(t){var e=a,n=t.keyCode,r=e.selection,o=e.getBody();Mg(e,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==uh||Mg(e,Ls(o,r.getStart())),37!==n&&39!==n||Mg(e,Ls(o,r.getStart()))})),{get:c.get,has:c.has,register:c.register,unregister:c.unregister,apply:function(e,n,r){var o=e,i=n,a=r;np(t).formatter.apply(o,i,a)},remove:function(e,n,r,o){var i=e,a=n,u=r,c=o;np(t).formatter.remove(i,a,u,c)},toggle:function(e,n,r){var o=e,i=n,a=r;np(t).formatter.toggle(o,i,a)},match:function(e,n,r,o){return i=e,a=n,u=r,c=o,np(t).formatter.match(i,a,u,c);var i,a,u,c},closest:function(e){return n=e,np(t).formatter.closest(n);var n},matchAll:function(e,n){return r=e,o=n,np(t).formatter.matchAll(r,o);var r,o},matchNode:function(e,n,r,o){return i=e,a=n,u=r,c=o,np(t).formatter.matchNode(i,a,u,c);var i,a,u,c},canApply:function(e){return n=e,np(t).formatter.canApply(n);var n},formatChanged:function(e,n,r,o){return i=s,a=e,u=n,c=r,l=o,np(t).formatter.formatChanged(i,a,u,c,l);var i,a,u,c,l},getCssText:O(_v,t)}}function Mv(t){switch(t.toLowerCase()){case"undo":case"redo":case"mcerepaint":case"mcefocus":return 1;default:return}}function Dv(t){var e,n,r,o,i,a=su(),u=ru(0),c=ru(0),s={data:[],typing:!1,beforeChange:function(){var e=u,n=a;np(t).undoManager.beforeChange(e,n)},add:function(e,n){return r=s,o=c,i=u,l=a,f=e,d=n,np(t).undoManager.add(r,o,i,l,f,d);var r,o,i,l,f,d},undo:function(){return e=s,n=u,r=c,np(t).undoManager.undo(e,n,r);var e,n,r},redo:function(){return e=c,n=s.data,np(t).undoManager.redo(e,n);var e,n},clear:function(){var e=s,n=c;np(t).undoManager.clear(e,n)},reset:function(){var e=s;np(t).undoManager.reset(e)},hasUndo:function(){return e=s,n=c,np(t).undoManager.hasUndo(e,n);var e,n},hasRedo:function(){return e=s,n=c,np(t).undoManager.hasRedo(e,n);var e,n},transact:function(e){return n=s,r=u,o=e,np(t).undoManager.transact(n,r,o);var n,r,o},ignore:function(e){var n=u,r=e;np(t).undoManager.ignore(n,r)},extra:function(e,n){var r=s,o=c,i=e,a=n;np(t).undoManager.extra(r,o,i,a)}};return Zh(t)||(r=s,o=u,i=ru(!1),(n=t).on("init",(function(){r.add()})),n.on("BeforeExecCommand",(function(t){Mv(t.command)||(Jh(r,o),r.beforeChange())})),n.on("ExecCommand",(function(t){Mv(t.command)||l(t)})),n.on("ObjectResizeStart cut",(function(){r.beforeChange()})),n.on("SaveContent ObjectResized blur",l),n.on("dragend",l),n.on("keyup",(function(t){var e=t.keyCode;t.isDefaultPrevented()||((33<=e&&e<=36||37<=e&&e<=40||45===e||t.ctrlKey)&&(l(),n.nodeChanged()),46!==e&&8!==e||n.nodeChanged(),i.get()&&r.typing&&!1===Xh(Wh(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))})),n.on("keydown",(function(t){var e,n=t.keyCode;t.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&l(t):(e=t.ctrlKey&&!t.altKey||t.metaKey,!(n<16||20<n)||224===n||91===n||r.typing||e||(r.beforeChange(),Yh(r,!0,o),r.add({},t),i.set(!0))))})),n.on("mousedown",(function(t){r.typing&&l(t)})),n.on("input",(function(t){t.inputType&&("insertReplacementText"===t.inputType||"insertText"===t.inputType&&null===t.data||"insertFromPaste"===t.inputType||"insertFromDrop"===t.inputType)&&l(t)})),n.on("AddUndo Undo Redo ClearUndos",(function(t){t.isDefaultPrevented()||n.nodeChanged()}))),(e=t).addShortcut("meta+z","","Undo"),e.addShortcut("meta+y,meta+shift+z","","Redo"),s;function l(t){Yh(r,!1,o),r.add({},t)}}function zv(t){return"keydown"===t.type||"keyup"===t.type}function Av(t){var e=t.keyCode;return e===Df.BACKSPACE||e===Df.DELETE}function Nv(t,e){return Ft(Oe.fromDom(e),t.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string"))}function Bv(t,e,n){var r,o,i=(r=t,o=e,P(Ja.DOM.getParents(n.container(),"*",o),r));return vt.from(i[i.length-1])}function Rv(t,e){if(!e)return e;var n=e.container(),r=e.offset();return t?Nr(n)?Pn(n.nextSibling)?ic(n.nextSibling,0):ic.after(n):Hr(e)?ic(n,r+1):e:Nr(n)?Pn(n.previousSibling)?ic(n.previousSibling,n.previousSibling.data.length):ic.before(n):Vr(e)?ic(n,r-1):e}function Hv(t){return fo(t)||go(t)}function Vv(t,e){return jt(t,e)?gr(e,Hv,(n=t,function(t){return Ut(n,Oe.fromDom(t.dom.parentNode))})):vt.none();var n}function Iv(t){var e,n,r;t.dom.isEmpty(t.getBody())&&(t.setContent(""),r=(n=(e=t).getBody()).firstChild&&e.dom.isBlock(n.firstChild)?n.firstChild:n,e.selection.setCursorLocation(r,0))}function Lv(t,e){return{from:t,to:e}}function Fv(t,e){return Vv(Oe.fromDom(t),Oe.fromDom(e.container())).map((function(t){return{block:t,position:e}}))}function Pv(t){var e,n=G(e=Mn(t),lo).fold(f(e),(function(t){return e.slice(0,t)}));return I(n,Bn),n}function Uv(t,e){return q(mm(e,t).reverse(),(function(t){return Wr(t)})).each(Bn)}function jv(t,e,n,r){if(Wr(n))return lm(n),Jl(n.dom);0===P(Re(r),(function(t){return!Wr(t)})).length&&Wr(e)&&We(r,Oe.fromTag("br"));var o=Yl(n.dom,ic.before(r.dom));return I(Pv(e),(function(t){We(r,t)})),Uv(t,e),o}function Wv(t,e,n){if(Wr(n))return Bn(n),Wr(e)&&lm(e),Jl(e.dom);var r=Ql(n.dom);return I(Pv(e),(function(t){Nn(n,t)})),Uv(t,e),r}function qv(t,e){Vs(t,e.dom).map((function(t){return t.getNode()})).map(Oe.fromDom).filter(zr).each(Bn)}function Gv(t,e,n){return qv(!0,e),qv(!1,n),(jt(o=n,r=e)?(i=mm(r,o),vt.from(i[i.length-1])):vt.none()).fold(O(Wv,t,e,n),O(jv,t,e,n));var r,o,i}function $v(t,e,n,r){return e?Gv(t,r,n):Gv(t,n,r)}function Xv(t,e){var n,r,o,i,a,u,c,s=Oe.fromDom(t.getBody()),l=(n=s.dom,r=e,((o=t.selection.getRng()).collapsed?(a=r,u=Fv(i=n,ic.fromRangeStart(o)),c=u.bind((function(t){return $l(a,i,t.position).bind((function(t){return Fv(i,t).map((function(t){return e=i,n=a,qn((r=t).position.getNode())&&!1===Wr(r.block)?Vs(!1,r.block.dom).bind((function(t){return t.isEqual(r.position)?$l(n,e,t).bind((function(t){return Fv(e,t)})):vt.some(r)})).getOr(r):r;var e,n,r}))}))})),dn(u,c,Lv).filter((function(t){return!1===Ut(t.from.block,t.to.block)&&Ae((n=t).from.block).bind((function(t){return Ae(n.to.block).filter((function(e){return Ut(t,e)}))})).isSome()&&!1===Xn((e=t).from.block.dom)&&!1===Xn(e.to.block.dom);var e,n}))):vt.none()).bind((function(t){return $v(s,e,t.from.block,t.to.block)})));return l.each((function(e){t.selection.setRng(e.toRange())})),l.isSome()}function Kv(t,e){var n=Oe.fromDom(e),r=O(Ut,t);return mr(n,po,r).isSome()}function Yv(t,e){return!t.selection.isCollapsed()&&function(t){var e,n,r,o,i,a,u,c,s,l,f=Oe.fromDom(t.getBody());return a=t.selection.getRng(),s=Yl((i=f).dom,ic.fromRangeStart(a)).isNone(),l=Kl(i.dom,ic.fromRangeEnd(a)).isNone(),!Kv(u=i,(c=a).startContainer)&&!Kv(u,c.endContainer)&&s&&l?((o=t).setContent(""),o.selection.setCursorLocation(),!0):(e=f,n=t.selection,r=n.getRng(),dn(Vv(e,Oe.fromDom(r.startContainer)),Vv(e,Oe.fromDom(r.endContainer)),(function(t,o){return!1===Ut(t,o)&&(r.deleteContents(),$v(e,!0,t,o).each((function(t){n.setRng(t.toRange())})),!0)})).getOr(!1))}(t)}function Jv(t,e,n,r,o){return vt.from(e._selectionOverrides.showCaret(t,n,r,o))}function Qv(t,e){var n,r;return t.fire("BeforeObjectSelected",{target:e}).isDefaultPrevented()?vt.none():vt.some(((r=(n=e).ownerDocument.createRange()).selectNode(n),r))}function Zv(t,e,n){var r=Jc(1,t.getBody(),e),o=ic.fromRangeStart(r),i=o.getNode();if(xs(i))return Jv(1,t,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(xs(a))return Jv(1,t,a,!1,!1);var u=t.dom.getParent(o.getNode(),(function(t){return Kb(t)||Xb(t)}));return xs(u)?Jv(1,t,u,!1,n):vt.none()}function tb(t,e,n){return e.collapsed?Zv(t,e,n).getOr(e):e}function eb(t){return Wg(t)||Fg(t)}function nb(t){return qg(t)||Pg(t)}function rb(t,e,n,r,o,i){var a,u;return Jv(r,t,i.getNode(!o),o,!0).each((function(n){var r;e.collapsed?(r=e.cloneRange(),o?r.setEnd(n.startContainer,n.startOffset):r.setStart(n.endContainer,n.endOffset),r.deleteContents()):e.deleteContents(),t.selection.setRng(n)})),a=t.dom,Pn(u=n)&&0===u.data.length&&a.remove(u),!0}function ob(t,e){var n=t.selection.getRng();if(!Pn(n.commonAncestorContainer))return!1;var r=e?rs.Forwards:rs.Backwards,o=As(t.getBody()),i=O(es,e?o.next:o.prev),a=e?eb:nb,u=Zc(r,t.getBody(),n),c=Rv(e,i(u));if(!c||!ns(u,c))return!1;if(a(c))return rb(t,n,u.getNode(),r,e,c);var s=i(c);return!!(s&&a(s)&&ns(c,s))&&rb(t,n,u.getNode(),r,e,s)}function ib(t,e,n){return $l(e,t,n).bind((function(r){return f=r.getNode(),po(Oe.fromDom(f))||go(Oe.fromDom(f))||(u=t,l=r,Qc(!(c=e),s=n).fold((function(){return Qc(c,l).fold(D,d)}),d))?vt.none():e&&Xn(r.getNode())||!1===e&&Xn(r.getNode(!0))?(o=t,i=n,a=r.getNode(!1===e),Vv(Oe.fromDom(o),Oe.fromDom(i.getNode())).map((function(t){return Wr(t)?Yb.remove(t.dom):Yb.moveToElement(a)})).orThunk((function(){return vt.some(Yb.moveToElement(a))}))):e&&qg(n)||!1===e&&Wg(n)?vt.some(Yb.moveToPosition(r)):vt.none();var o,i,a,u,c,s,l,f;function d(t){return Dr(Oe.fromDom(t))&&!$c(s,l,u)}}))}function ab(t,e){return vt.from(df(t.getBody(),e))}function ub(t,e){var n=t.selection.getNode();return ab(t,n).filter(Xn).fold((function(){return l=t.getBody(),d=Jc((f=e)?1:-1,l,t.selection.getRng()),m=ic.fromRangeStart(d),g=Oe.fromDom(l),(!1===f&&qg(m)?vt.some(Yb.remove(m.getNode(!0))):f&&Wg(m)?vt.some(Yb.remove(m.getNode())):!1===f&&Wg(m)&&wm(g,m)?Yg(g,m).map((function(t){return Yb.remove(t.getNode())})):f&&qg(m)&&xm(g,m)?Jg(g,m).map((function(t){return Yb.remove(t.getNode())})):(n=l,r=f,c=(o=m).getNode(!1===(u=r)),s=u?"after":"before",Ln(c)&&c.getAttribute("data-mce-caret")===s?(a=o.getNode(!1===(i=r)),(i&&Xn(a.nextSibling)?vt.some(Yb.moveToElement(a.nextSibling)):!1===i&&Xn(a.previousSibling)?vt.some(Yb.moveToElement(a.previousSibling)):vt.none()).fold((function(){return ib(n,r,o)}),vt.some)):ib(n,r,o).bind((function(t){return e=n,r=o,t.fold((function(t){return vt.some(Yb.remove(t))}),(function(t){return vt.some(Yb.moveToElement(t))}),(function(t){return $c(r,t,e)?vt.none():vt.some(Yb.moveToPosition(t))}));var e,r})))).exists((function(n){return n.fold((function(t){return a._selectionOverrides.hideFakeCaret(),qm(a,u,Oe.fromDom(t)),!0}),(i=u=e,function(t){var e=i?ic.before(t):ic.after(t);return o.selection.setRng(e.toRange()),!0}),(r=o=a=t,function(t){return r.selection.setRng(t.toRange()),!0}));var r,o,i,a,u}));var n,r,o,i,a,u,c,s,l,f,d,m,g}),z)}function cb(t,e){var n=t.selection.getNode();return!(!Xn(n)||Kn(n))&&ab(t,n.parentNode).filter(Xn).fold((function(){return I(pu(Oe.fromDom(t.getBody()),".mce-offscreen-selection"),Bn),qm(t,e,Oe.fromDom(t.selection.getNode())),Iv(t),!0}),z)}function sb(t){var e,n=t.dom,r=t.selection,o=df(t.getBody(),r.getNode());return $n(o)&&n.isBlock(o)&&n.isEmpty(o)&&(e=n.create("br",{"data-mce-bogus":"1"}),n.setHTML(o,""),o.appendChild(e),r.setRng(ic.before(e).toRange())),!0}function lb(t,e){return(t.selection.isCollapsed()?ub:cb)(t,e)}function fb(t,e){return!!t.selection.isCollapsed()&&(n=t,r=e,o=ic.fromRangeStart(n.selection.getRng()),$l(r,n.getBody(),o).filter((function(t){return(r?Ig:Lg)(t)})).bind((function(t){return vt.from(Xc(r?0:-1,t))})).exists((function(t){return n.selection.select(t),!0})));var n,r,o}function db(t){return Jb(t)&&t.data[0]===xo}function mb(t){return Jb(t)&&t.data[t.data.length-1]===xo}function gb(t){return t.ownerDocument.createTextNode(xo)}function hb(t,e){return(t?function(t){if(Jb(t.previousSibling))return mb(t.previousSibling)||t.previousSibling.appendData(xo),t.previousSibling;if(Jb(t))return db(t)||t.insertData(0,xo),t;var e=gb(t);return t.parentNode.insertBefore(e,t),e}:function(t){if(Jb(t.nextSibling))return db(t.nextSibling)||t.nextSibling.insertData(0,xo),t.nextSibling;if(Jb(t))return mb(t)||t.appendData(xo),t;var e=gb(t);return t.nextSibling?t.parentNode.insertBefore(e,t.nextSibling):t.parentNode.appendChild(e),e})(e)}function pb(t,e){return Pn(t.container())?hb(e,t.container()):hb(e,t.getNode())}function vb(t,e){var n=e.get();return n&&t.container()===n&&Nr(n)}function bb(t,e){return e.fold((function(e){hs(t.get());var n=Qb(e);return t.set(n),vt.some(ic(n,n.length-1))}),(function(e){return Jl(e).map((function(e){if(vb(e,t))return ic(t.get(),1);hs(t.get());var n=pb(e,!0);return t.set(n),ic(n,1)}))}),(function(e){return Ql(e).map((function(e){if(vb(e,t))return ic(t.get(),t.get().length-1);hs(t.get());var n=pb(e,!1);return t.set(n),ic(n,n.length-1)}))}),(function(e){hs(t.get());var n=Zb(e);return t.set(n),vt.some(ic(n,1))}))}function yb(t,e){for(var n=0;n<t.length;n++){var r=t[n].apply(null,e);if(r.isSome())return r}return vt.none()}function xb(t,e){return Gc(e,t)||t}function wb(t,e,n){var r=Gb(n),o=xb(e,r.container());return Bv(t,o,r).fold((function(){return Kl(o,r).bind(O(Bv,t,o)).map((function(t){return ty.before(t)}))}),vt.none)}function Cb(t,e){return null===Ls(t,e)}function Sb(t,e,n){return Bv(t,e,n).filter(O(Cb,e))}function kb(t,e,n){var r=$b(n);return Sb(t,e,r).bind((function(t){return Yl(t,r).isNone()?vt.some(ty.start(t)):vt.none()}))}function Ob(t,e,n){var r=Gb(n);return Sb(t,e,r).bind((function(t){return Kl(t,r).isNone()?vt.some(ty.end(t)):vt.none()}))}function Eb(t,e,n){var r=$b(n),o=xb(e,r.container());return Bv(t,o,r).fold((function(){return Yl(o,r).bind(O(Bv,t,o)).map((function(t){return ty.after(t)}))}),vt.none)}function _b(t){return!1===(e=ey(t),"rtl"===Ja.DOM.getStyle(e,"direction",!0)||(n=e.textContent,qb.test(n)));var e,n}function Tb(t,e,n){return yb([wb,kb,Ob,Eb],[t,e,n]).filter(_b)}function Mb(t){return t.fold(f("before"),f("start"),f("end"),f("after"))}function Db(t){return t.fold(ty.before,ty.before,ty.after,ty.after)}function zb(t){return t.fold(ty.start,ty.start,ty.end,ty.end)}function Ab(t,e,n,r,o,i){return dn(Bv(e,n,r),Bv(e,n,o),(function(e,r){return e!==r&&(a=r,u=Gc(e,o=n),c=Gc(a,o),u&&u===c)?ty.after(t?e:r):i;var o,a,u,c})).getOr(i)}function Nb(t,e){return t.fold(z,(function(t){return r=e,!(Mb(n=t)===Mb(r)&&ey(n)===ey(r));var n,r}))}function Bb(t,e){return t?e.fold(s(vt.some,ty.start),vt.none,s(vt.some,ty.after),vt.none):e.fold(vt.none,s(vt.some,ty.before),vt.none,s(vt.some,ty.end))}function Rb(t,e,n,r){var o=Rv(t,r),i=Tb(e,n,o);return Tb(e,n,o).bind(O(Bb,t)).orThunk((function(){return a=e,u=n,c=i,s=Rv(o=t,r),$l(o,u,s).map(O(Rv,o)).fold((function(){return c.map(Db)}),(function(t){return Tb(a,u,t).map(O(Ab,o,a,u,s,t)).filter(O(Nb,c))})).filter(_b);var o,a,u,c,s}))}function Hb(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=window.console;r&&(r.error||r.log).apply(r,Tt([t],e,!1))}var Vb,Ib,Lb=function(t,e){var n=t.editorManager.baseURL+"/skins/content",r="content"+t.editorManager.suffix+".css",o=!0===t.inline;return V(e,(function(e){return/^[a-z0-9\-]+$/i.test(e)&&!o?n+"/"+e+"/"+r:t.documentBaseURI.toAbsolute(e)}))},Fb=0,Pb=ke.each,Ub=Ja.DOM,jb=[9,27,Df.HOME,Df.END,19,20,44,144,145,33,34,45,16,17,18,91,92,93,Df.DOWN,Df.UP,Df.LEFT,Df.RIGHT].concat(we.browser.isFirefox()?[224]:[]),Wb="data-mce-placeholder",qb=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Gb=O(Rv,!0),$b=O(Rv,!1),Xb=$n,Kb=Xn,Yb=rr([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),Jb=Pn,Qb=O(hb,!0),Zb=O(hb,!1),ty=rr([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),ey=function(t){return t.fold(d,d,d,d)};function ny(t,e,n){var r=t?1:-1;return e.setRng(ic(n.container(),n.offset()+r).toRange()),e.getSel().modify("move",t?"forward":"backward","word"),!0}function ry(t,e){return t===rs.Backwards?K(e):e}function oy(t,e,n,r){for(var o,i,a,u,c=As(n),s=r,l=[];s;){var f=(a=c,u=s,e===rs.Forwards?a.next(u):a.prev(u));if(!f)break;if(qn(f.getNode(!1)))return e===rs.Forwards?{positions:ry(e,l).concat([f]),breakType:Vb.Br,breakAt:vt.some(f)}:{positions:ry(e,l),breakType:Vb.Br,breakAt:vt.some(f)};if(f.isVisible()){if(t(s,f)){var d=(o=s,qn((i=f).getNode(e===rs.Forwards))?Vb.Br:!1===$c(o,i)?Vb.Block:Vb.Wrap);return{positions:ry(e,l),breakType:d,breakAt:vt.some(f)}}l.push(f),s=f}else s=f}return{positions:ry(e,l),breakType:Vb.Eol,breakAt:vt.none()}}function iy(t,e,n,r){return e(n,r).breakAt.map((function(r){var o=e(n,r).positions;return t===rs.Backwards?o.concat(r):[r].concat(o)})).getOr([])}function ay(t,e){return j(t,(function(t,n){return t.fold((function(){return vt.some(n)}),(function(r){return dn(Z(r.getClientRects()),Z(n.getClientRects()),(function(t,o){var i=Math.abs(e-t.left);return Math.abs(e-o.left)<=i?n:r})).or(t)}))}),vt.none())}function uy(t,e){return Z(e.getClientRects()).bind((function(e){return ay(t,e.left)}))}function cy(t){function e(e){return V(e,(function(e){var n=Ou(e);return n.node=t,n}))}if(Ln(t))return e(t.getClientRects());if(Pn(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}function sy(t){return $(t,cy)}O(Rb,!1),O(Rb,!0),(Ib=Vb={})[Ib.Br=0]="Br",Ib[Ib.Block=1]="Block",Ib[Ib.Wrap=2]="Wrap",Ib[Ib.Eol=3]="Eol";var ly,fy,dy=O(oy,ic.isAbove,-1),my=O(oy,ic.isBelow,1),gy=O(iy,-1,dy),hy=O(iy,1,my);function py(t,e,n,r,o,i){function a(r){var i=sy([r]);-1===t&&(i=i.reverse());for(var a=0;a<i.length;a++){var l=i[a];if(!n(l,s)){if(0<c.length&&e(l,ht(c))&&u++,l.line=u,o(l))return!0;c.push(l)}}}var u=0,c=[],s=ht(i.getClientRects());if(!s)return c;var l=i.getNode();return a(l),function(t,e,n,r){for(;r=qc(r,t,Pr,e);)if(n(r))return}(t,r,a,l),c}function vy(t){return function(e){return e.line>t}}function by(t){return function(e){return e.line===t}}function yy(t,e){return Math.abs(t.left-e)}function xy(t,e){return Math.abs(t.right-e)}function wy(t,e){return t>=e.left&&t<=e.right}function Cy(t,e){return t>=e.top&&t<=e.bottom}function Sy(t,e,n){return void 0===n&&(n=z),mt(t,(function(t,r){if(wy(e,r))return n(r)?r:t;if(wy(e,t))return n(t)?t:r;var o=Math.min(yy(t,e),xy(t,e)),i=Math.min(yy(r,e),xy(r,e));return i===o&&ct(r,"node")&&uw(r.node)||i<o?r:t}))}function ky(t,e,n,r,o){var i=cw(r,t,Pr,e,!o);do{if(!i||n(i))return}while(i=cw(i,t,Pr,e))}function Oy(t,e){t.selection.setRng(e),Yf(t,t.selection.getRng())}function Ey(t,e,n){return vt.some(tb(t,e,n))}function _y(t,e,n,r,o,i){var a=e===rs.Forwards,u=As(t.getBody()),c=O(es,a?u.next:u.prev),s=a?r:o;if(!n.collapsed){var l=zu(n);if(i(l))return Jv(e,t,l,e===rs.Backwards,!1)}var f=Zc(e,t.getBody(),n);if(s(f))return Qv(t,f.getNode(!a));var d=Rv(a,c(f)),m=Lr(n);if(!d)return m?vt.some(n):vt.none();if(s(d))return Jv(e,t,d.getNode(!a),a,!1);var g=c(d);return g&&s(g)&&ns(d,g)?Jv(e,t,g.getNode(!a),a,!1):m?Ey(t,d.toRange(),!1):vt.none()}function Ty(t,e,n,r,o,i){var a=Zc(e,t.getBody(),n),u=ht(a.getClientRects()),c=e===ly.Down;if(!u)return vt.none();var s,l=P((c?aw:iw)(t.getBody(),vy(1),a),by(1)),f=u.left,d=Sy(l,f);if(d&&i(d.node)){var m=Math.abs(f-d.left),g=Math.abs(f-d.right);return Jv(e,t,d.node,m<g,!1)}if(s=r(a)?a.getNode():o(a)?a.getNode(!0):zu(n)){var h=function(t,e,n,r){function o(t){return ht(t.getClientRects())}var i,a,u,c=As(e),s=[],l=0,f=1===t?(i=c.next,a=Mu,u=Tu,ic.after(r)):(i=c.prev,a=Tu,u=Mu,ic.before(r)),d=o(f);do{if(f.isVisible()){var m=o(f);if(!u(m,d)){0<s.length&&a(m,ht(s))&&l++;var g=Ou(m);if(g.position=f,g.line=l,n(g))return s;s.push(g)}}}while(f=i(f));return s}(e,t.getBody(),vy(1),s),p=Sy(P(h,by(1)),f);if(p)return Ey(t,p.position.toRange(),!1);if(p=ht(P(h,by(0))))return Ey(t,p.position.toRange(),!1)}return 0===l.length?sw(t,c).filter(c?o:r).map((function(e){return tb(t,e.toRange(),!1)})):vt.none()}function My(t,e,n){return sw(t,e).filter(n).exists((function(e){return t.selection.setRng(e.toRange()),!0}))}function Dy(t,e){var n=t.dom.createRng();n.setStart(e.container(),e.offset()),n.setEnd(e.container(),e.offset()),t.selection.setRng(n)}function zy(t,e){t?e.setAttribute("data-mce-selected","inline-boundary"):e.removeAttribute("data-mce-selected")}function Ay(t,e,n){return bb(e,n).map((function(e){return Dy(t,e),n}))}function Ny(t,e,n){return!!Nc(t)&&(o=e,i=n,a=(r=t).getBody(),u=ic.fromRangeStart(r.selection.getRng()),Rb(i,O(Nv,r),a,u).bind((function(t){return Ay(r,o,t)})).isSome());var r,o,i,a,u}function By(t,e,n){return!!Nc(e)&&(r=t,i=(o=e).selection.getRng(),a=r?ic.fromRangeEnd(i):ic.fromRangeStart(i),!!S(o.selection.getSel().modify)&&(r&&Hr(a)?ny(!0,o.selection,a):!(r||!Vr(a))&&ny(!1,o.selection,a)));var r,o,i,a}function Ry(t,e,n){if(Nc(t)){var r=sw(t,e).getOrThunk((function(){var n=t.selection.getRng();return e?ic.fromRangeEnd(n):ic.fromRangeStart(n)}));return Tb(O(Nv,t),t.getBody(),r).exists((function(e){var r=Db(e);return bb(n,r).exists((function(e){return Dy(t,e),!0}))}))}return!1}function Hy(t,e){return function(n){return bb(e,n).exists((function(e){return Dy(t,e),!0}))}}function Vy(t,e,n,r){var o=t.getBody(),i=O(Nv,t);t.undoManager.ignore((function(){var a,u,c;t.selection.setRng((a=n,u=r,(c=document.createRange()).setStart(a.container(),a.offset()),c.setEnd(u.container(),u.offset()),c)),t.execCommand("Delete"),Tb(i,o,ic.fromRangeStart(t.selection.getRng())).map(zb).map(Hy(t,e))})),t.nodeChanged()}function Iy(t,e,n){if(t.selection.isCollapsed()&&Nc(t)){var r=ic.fromRangeStart(t.selection.getRng());return i=e,a=n,u=r,c=(o=t).getBody(),s=Gc(u.container(),c)||c,l=O(Nv,o),(d=Tb(l,s,u)).bind((function(t){return a?t.fold(f(vt.some(zb(t))),vt.none,f(vt.some(Db(t))),vt.none):t.fold(vt.none,f(vt.some(Db(t))),vt.none,f(vt.some(zb(t))))})).map(Hy(o,i)).getOrThunk((function(){var t=Hs(a,s,u),e=t.bind((function(t){return Tb(l,s,t)}));return dn(d,e,(function(){return Bv(l,s,u).exists((function(t){return!!dn(Jl(e=t),Ql(e),(function(t,n){var r=Rv(!0,t),o=Rv(!1,n);return Kl(e,r).forall((function(t){return t.isEqual(o)}))})).getOr(!0)&&(qm(o,a,Oe.fromDom(t)),!0);var e}))})).orThunk((function(){return e.bind((function(e){return t.map((function(t){return a?Vy(o,i,u,t):Vy(o,i,t,u),!0}))}))})).getOr(!1)}))}var o,i,a,u,c,s,l,d;return!1}function Ly(t){return 1===Fe(t)}function Fy(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n,r=Oe.fromDom(t.getBody()),o=Oe.fromDom(t.selection.getStart()),i=P(G(n=mm(o,r),lo).fold(f(n),(function(t){return n.slice(0,t)})),Ly);return tt(i).exists((function(n){var r,o,a,u,c,s,l,f,d,m=ic.fromRangeStart(t.selection.getRng()),g=e,h=m,p=n.dom;return!(!dn(Jl(p),Ql(p),(function(t,e){var n=Rv(!0,t),r=Rv(!1,e),o=Rv(!1,h);return g?Kl(p,o).exists((function(t){return t.isEqual(r)&&h.isEqual(n)})):Yl(p,o).exists((function(t){return t.isEqual(n)&&h.isEqual(r)}))})).getOr(!0)||Is((r=n).dom)&&Og(r.dom)||(o=e,u=n,0===(d=V(P(i,O(Ng,a=t)),(function(t){return t.dom}))).length?qm(a,o,u):(s=u.dom,f=zg(d,(l=_g(!1)).dom),We(Oe.fromDom(s),l),Bn(Oe.fromDom(s)),c=ic(f,0),a.selection.setRng(c.toRange())),0))}))}(t,e)}function Py(t,e,n){return t._selectionOverrides.hideFakeCaret(),qm(t,e,Oe.fromDom(n)),!0}function Uy(t,e){return t.selection.isCollapsed()?(i=t,u=(a=e)?Fg:Pg,c=a?rs.Forwards:rs.Backwards,s=Zc(c,i.getBody(),i.selection.getRng()),u(s)?Py(i,a,s.getNode(!a)):vt.from(Rv(a,s)).filter((function(t){return u(t)&&ns(s,t)})).exists((function(t){return Py(i,a,t.getNode(!a))}))):(r=e,o=(n=t).selection.getNode(),!!Yn(o)&&Py(n,r,o));var n,r,o,i,a,u,c,s}function jy(t){var e=parseInt(t,10);return isNaN(e)?0:e}function Wy(t,e){return(t||"table"===Ee(e)?"margin":"padding")+("rtl"===xn(e,"direction")?"-right":"-left")}function qy(t){var e,n=dw(t);return!t.mode.isReadOnly()&&(1<n.length||(e=t,X(n,(function(t){var n=wn(t,Wy(Tc(e),t)).map(jy).getOr(0);return"false"!==e.dom.getContentEditable(t.dom)&&0<n}))))}function Gy(t){return mo(t)||go(t)}function $y(t,e){var n=t.dom,r=t.selection,o=t.formatter,i=t.getParam("indentation","40px","string"),a=/[a-z%]+$/i.exec(i)[0],u=parseInt(i,10),c=Tc(t),s=Cc(t);t.queryCommandState("InsertUnorderedList")||t.queryCommandState("InsertOrderedList")||""!==s||n.getParent(r.getNode(),n.isBlock)||o.apply("div"),I(dw(t),(function(t){var r,o=n,i=e,s=u,l=a,f=t.dom,d=Wy(c,Oe.fromDom(f));"outdent"===i?(r=Math.max(0,jy(f.style[d])-s),o.setStyle(f,d,r?r+l:"")):(r=jy(f.style[d])+s+l,o.setStyle(f,d,r))}))}function Xy(t,e){if(t.selection.isCollapsed()&&qy(t)){var n=t.dom,r=t.selection.getRng(),o=ic.fromRangeStart(r),i=n.getParent(r.startContainer,n.isBlock);if(null!==i&&Gg(Oe.fromDom(i),o))return $y(t,"outdent"),!0}return!1}function Ky(t,e){t.getDoc().execCommand(e,!1,null)}function Yy(t){return void 0===t.touches||1!==t.touches.length?vt.none():vt.some(t.touches[0])}function Jy(t,e){return Ot(t,e.nodeName)}function Qy(t){var e,n,r,o=t.dom,i=t.selection,a=t.schema,u=a.getBlockElements(),c=i.getStart(),s=t.getBody(),l=Cc(t);if(c&&Ln(c)&&l){var f=s.nodeName.toLowerCase();if(a.isValidChild(f,l.toLowerCase())&&(d=u,m=s,g=c,!H(dm(Oe.fromDom(g),Oe.fromDom(m)),(function(t){return Jy(d,t.dom)})))){var d,m,g,h,p,v=i.getRng(),b=v.startContainer,y=v.startOffset,x=v.endContainer,w=v.endOffset,C=md(t);for(c=s.firstChild;c;)h=u,Pn(p=c)||Ln(p)&&!Jy(h,p)&&!$s(p)?function(t,e){if(Pn(e)){if(0===e.nodeValue.length)return 1;if(/^\s+$/.test(e.nodeValue)&&(!e.nextSibling||Jy(t,e.nextSibling)))return 1}}(u,c)?(c=(n=c).nextSibling,o.remove(n)):(e||(e=o.create(l,Sc(t)),c.parentNode.insertBefore(e,c),r=!0),c=(n=c).nextSibling,e.appendChild(n)):(e=null,c=c.nextSibling);r&&C&&(v.setStart(b,y),v.setEnd(x,w),i.setRng(v),t.nodeChanged())}}}function Zy(t,e){e.hasAttribute("data-mce-caret")&&(Ir(e),t.selection.setRng(t.selection.getRng()),t.selection.scrollIntoView(e))}function tx(t,e){var n=pr(Oe.fromDom(t.getBody()),"*[data-mce-caret]").map((function(t){return t.dom})).getOrNull();if(n)return"compositionstart"===e.type?(e.preventDefault(),e.stopPropagation(),void Zy(t,n)):void(Rr(n)&&(Zy(t,n),t.undoManager.add()))}function ex(t,e,n){var r,o,i,a=As(t.getBody()),u=O(es,1===e?a.next:a.prev);!n.collapsed||""===Cc(t)||(r=t.dom.getParent(n.startContainer,"PRE"))&&(u(ic.fromRangeStart(n))||(i=t.dom.create(Cc(t)),(!we.ie||11<=we.ie)&&(i.innerHTML='<br data-mce-bogus="1">'),o=i,1===e?t.$(r).after(o):t.$(r).before(o),t.selection.select(o,!0),t.selection.collapse()))}function nx(t,e){return n=t,r=e?rs.Forwards:rs.Backwards,o=n.selection.getRng(),_y(n,r,o,Wg,qg,mw).orThunk((function(){return ex(n,r,o),vt.none()})).exists((function(e){return Oy(t,e),!0}));var n,r,o}function rx(t,e){return r=e?1:-1,o=(n=t).selection.getRng(),Ty(n,r,o,(function(t){return Wg(t)||Ug(t)}),(function(t){return qg(t)||jg(t)}),mw).orThunk((function(){return ex(n,r,o),vt.none()})).exists((function(e){return Oy(t,e),!0}));var n,r,o}function ox(t,e){return My(t,e,e?qg:Wg)}function ix(t){return R(["figcaption"],Ee(t))}function ax(t){var e=document.createRange();return e.setStartBefore(t.dom),e.setEndBefore(t.dom),e}function ux(t,e,n){(n?Nn:Ge)(t,e)}function cx(t,e){return!!t.selection.isCollapsed()&&function(t,e){var n=Oe.fromDom(t.getBody()),r=ic.fromRangeStart(t.selection.getRng()),o=Cc(t),i=Sc(t),a=r,u=O(Ut,n);return gr(Oe.fromDom(a.container()),lo,u).filter(ix).exists((function(){if(b=n,y=r,e?(w=b.dom,my(w,y).breakAt.isNone()):(x=b.dom,dy(x,y).breakAt.isNone())){var a=(u=n,s=i,l=e,""===(c=o)?(p=l,ux(u,v=Oe.fromTag("br"),p),ax(v)):(f=u,d=l,m=s,g=Oe.fromTag(c),h=Oe.fromTag("br"),pn(g,m),Nn(g,h),ux(f,g,d),ax(h)));return t.selection.setRng(a),!0}var u,c,s,l,f,d,m,g,h,p,v,b,y,x,w;return!1}))}(t,e)}function sx(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(null,e)}}function lx(t,e){return q((n=e,$(V(t,(function(t){return _t({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:c},t)})),(function(t){return n.keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[t]:[]}))),(function(t){return t.action()}));var n}function fx(t,e){var n=e?rs.Forwards:rs.Backwards,r=t.selection.getRng();return _y(t,n,r,Fg,Pg,Yn).exists((function(e){return Oy(t,e),!0}))}function dx(t,e){var n=e?1:-1,r=t.selection.getRng();return Ty(t,n,r,Fg,Pg,Yn).exists((function(e){return Oy(t,e),!0}))}function mx(t,e){return My(t,e,e?Pg:Fg)}function gx(t,e,n,r,o){var i,a=pu(Oe.fromDom(n),"td,th,caption").map((function(t){return t.dom})),u=P((i=t,$(a,(function(t){var e,n={left:(e=Ou(t.getBoundingClientRect())).left- -1,top:e.top- -1,right:e.right+-2,bottom:e.bottom+-2,width:e.width+-1,height:e.height+-1};return[{x:n.left,y:i(n),cell:t},{x:n.right,y:i(n),cell:t}]}))),(function(t){return e(t,o)})),c=r,s=o;return j(u,(function(t,e){return t.fold((function(){return vt.some(e)}),(function(t){var n=Math.sqrt(Math.abs(t.x-c)+Math.abs(t.y-s)),r=Math.sqrt(Math.abs(e.x-c)+Math.abs(e.y-s));return vt.some(r<n?e:t)}))}),vt.none()).map((function(t){return t.cell}))}function hx(t,e,n){var r,o,i=t(e,n);return i.breakType===Vb.Wrap&&0===i.positions.length||!qn(n.getNode())&&i.breakType===Vb.Br&&1===i.positions.length?(r=t,o=e,!i.breakAt.exists((function(t){return r(o,t).breakAt.isSome()}))):i.breakAt.isNone()}function px(t,e,n,r){var o,i,a,u=t.selection.getRng(),c=e?1:-1;return!(!Uc()||(o=e,i=n,a=ic.fromRangeStart(u),!Vs(!o,i).exists((function(t){return t.isEqual(a)})))||(Jv(c,t,n,!e,!1).each((function(e){Oy(t,e)})),0))}function vx(t,e,n){var r,o,i=(r=!!e,o=n.getNode(r),Ln(o)&&"TABLE"===o.nodeName?vt.some(o):vt.none()),a=!1===e;i.fold((function(){return Oy(t,n.toRange())}),(function(r){return Vs(a,t.getBody()).filter((function(t){return t.isEqual(n)})).fold((function(){return Oy(t,n.toRange())}),(function(o){var i,a,u=e,c=r,s=n;(a=Cc(i=t))?i.undoManager.transact((function(){var t=Oe.fromTag(a);pn(t,Sc(i)),Nn(t,Oe.fromTag("br")),(u?qe:We)(Oe.fromDom(c),t);var e=i.dom.createRng();e.setStart(t.dom,0),e.setEnd(t.dom,0),Oy(i,e)})):Oy(i,s.toRange())}))}))}function bx(t,e,n,r){var o,i,a,u,c,s,l,f,d,m,g=t.selection.getRng(),h=ic.fromRangeStart(g),p=t.getBody();if(e||!pw(r,h))return!(!e||!vw(r,h)||(o=p,d=i=n,vx(t,e,v=tt((m=a=h).getClientRects()).bind((function(t){return hw(d,t.left,t.top)})).bind((function(t){return uy(Jl(e=t).map((function(t){return[t].concat(my(e,t).positions)})).getOr([]),m);var e})).orThunk((function(){return Z(a.getClientRects()).bind((function(t){return ay(hy(o,ic.after(i)),t.left)}))})).getOr(ic.after(i))),0));var v=(u=p,l=c=n,Z((f=s=h).getClientRects()).bind((function(t){return gw(l,t.left,t.top)})).bind((function(t){return uy(Ql(e=t).map((function(t){return dy(e,t).positions.concat(t)})).getOr([]),f);var e})).orThunk((function(){return Z(s.getClientRects()).bind((function(t){return ay(gy(u,ic.before(c)),t.left)}))})).getOr(ic.before(c)));return vx(t,e,v),!0}function yx(t,e,n){return vt.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind((function(r){return vt.from(t.dom.getParent(r,"table")).map((function(o){return n(t,e,o,r)}))})).getOr(!1)}function xx(t,e){return yx(t,e,px)}function wx(t,e){return yx(t,e,bx)}function Cx(t,e){var n,r,o=e,i=t.dom,a=t.schema.getMoveCaretBeforeOnEnterElements();if(e){!/^(LI|DT|DD)$/.test(e.nodeName)||(r=function(t){for(;t;){if(1===t.nodeType||3===t.nodeType&&t.data&&/[\r\n\s]/.test(t.data))return t;t=t.nextSibling}}(e.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&e.insertBefore(i.doc.createTextNode(yo),e.firstChild);var u=i.createRng();if(e.normalize(),e.hasChildNodes()){for(var c=new _r(e,e);n=c.current();){if(Pn(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=c.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else qn(e)?e.nextSibling&&i.isBlock(e.nextSibling)?(u.setStartBefore(e),u.setEndBefore(e)):(u.setStartAfter(e),u.setEndAfter(e)):(u.setStart(e,0),u.setEnd(e,0));t.selection.setRng(u),Yf(t,u)}}function Sx(t){return vt.from(t.dom.getParent(t.selection.getStart(!0),t.dom.isBlock))}function kx(t,e){return t&&t.parentNode&&t.parentNode.nodeName===e}function Ox(t){return t&&/^(OL|UL|LI)$/.test(t.nodeName)}function Ex(t){var e=t.parentNode;return/^(LI|DT|DD)$/.test(e.nodeName)?e:t}function _x(t,e,n){for(var r=t[n?"firstChild":"lastChild"];r&&!Ln(r);)r=r[n?"nextSibling":"previousSibling"];return r===e}function Tx(t){t.innerHTML='<br data-mce-bogus="1">'}function Mx(t,e){return t.nodeName===e||t.previousSibling&&t.previousSibling.nodeName===e}function Dx(t,e){return e&&t.isBlock(e)&&!/^(TD|TH|CAPTION|FORM)$/.test(e.nodeName)&&!/^(fixed|absolute)/i.test(e.style.position)&&"true"!==t.getContentEditable(e)}function zx(t,e,n){return!1===Pn(e)?n:t?1===n&&e.data.charAt(n-1)===xo?0:n:n===e.data.length-1&&e.data.charAt(n)===xo?e.data.length:n}function Ax(t,e){for(var n,r=t.getRoot(),o=e;o!==r&&"false"!==t.getContentEditable(o);)"true"===t.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}function Nx(t,e){var n=Cc(t);n&&n.toLowerCase()===e.tagName.toLowerCase()&&function(t,e,n){var r=t.dom;vt.from(n.style).map(r.parseStyle).each((function(t){var n=Cn(Oe.fromDom(e)),o=_t(_t({},n),t);r.setStyles(e,o)})),dn(vt.from(n.class).map((function(t){return t.split(/\s+/)})),vt.from(e.className).map((function(t){return P(t.split(/\s+/),(function(t){return""!==t}))})),(function(t,n){var o=P(n,(function(e){return!R(t,e)})),i=Tt(Tt([],t,!0),o,!0);r.setAttrib(e,"class",i.join(" "))}));var o=["style","class"],i=at(n,(function(t,e){return!R(o,e)}));r.setAttribs(e,i)}(t,e,Sc(t))}function Bx(t,e,n){var r=t.dom.createRng();n?(r.setStartBefore(e),r.setEndBefore(e)):(r.setStartAfter(e),r.setEndAfter(e)),t.selection.setRng(r),Yf(t,r)}function Rx(t,e){var n=Oe.fromTag("br");We(Oe.fromDom(e),n),t.undoManager.add()}function Hx(t,e){bw(t.getBody(),e)||qe(Oe.fromDom(e),Oe.fromTag("br"));var n=Oe.fromTag("br");qe(Oe.fromDom(e),n),Bx(t,n.dom,!1),t.undoManager.add()}function Vx(t){return t&&"A"===t.nodeName&&"href"in t}function Ix(t){return t.fold(D,Vx,Vx,D)}function Lx(t,e){e.fold(c,O(Rx,t),O(Hx,t),c)}function Fx(t,e){var n,r,o,i=(r=O(Nv,n=t),o=ic.fromRangeStart(n.selection.getRng()),Tb(r,n.getBody(),o).filter(Ix));i.isSome()?i.each(O(Lx,t)):function(t,e){var n,r,o=t.selection,i=t.dom,a=o.getRng();Ef(i,a).each((function(t){a.setStart(t.startContainer,t.startOffset),a.setEnd(t.endContainer,t.endOffset)}));var u,c=a.startOffset,s=a.startContainer;1===s.nodeType&&s.hasChildNodes()&&(u=c>s.childNodes.length-1,s=s.childNodes[Math.min(c,s.childNodes.length-1)]||s,c=u&&3===s.nodeType?s.nodeValue.length:0);var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!e||!e.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&c>=s.nodeValue.length&&!function(t){for(var e,n=new _r(s,l),r=t.getNonEmptyElements();e=n.next();)if(r[e.nodeName.toLowerCase()]||0<e.length)return 1}(t.schema)&&(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0),n=i.create("br"),uc(i,a,n),Bx(t,n,r),t.undoManager.add()}(t,e)}function Px(t,e){return Sx(t).filter((function(t){return 0<e.length&&Ft(Oe.fromDom(t),e)})).isSome()}function Ux(t,e){return Px(t,t.getParam("no_newline_selector",""))}function jx(t){return function(e,n){return""===Cc(e)===t}}function Wx(t){return function(e,n){return Sx(e).filter((function(t){return go(Oe.fromDom(t))})).isSome()===t}}function qx(t,e){return function(n,r){return Sx(n).fold(f(""),(function(t){return t.nodeName.toUpperCase()}))===t.toUpperCase()===e}}function Gx(t){return qx("pre",t)}function $x(t){return function(e,n){return e.getParam("br_in_pre",!0)===t}}function Xx(t,e){return Px(t,t.getParam("br_newline_selector",".mce-toc h2,figcaption,caption"))}function Kx(t,e){return e}function Yx(t){var e=Cc(t),n=function(t,e){for(var n,r=t.getRoot(),o=e;o!==r&&"false"!==t.getContentEditable(o);)"true"===t.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r}(t.dom,t.selection.getStart());return n&&t.schema.isValidChild(n.nodeName,e||"P")}function Jx(t,e){return function(n,r){return j(t,(function(t,e){return t&&e(n,r)}),!0)?vt.some(e):vt.none()}}function Qx(t,e){var n,r;n=t,r=e,yb([Jx([Ux],yw.none()),Jx([qx("summary",!0)],yw.br()),Jx([Gx(!0),$x(!1),Kx],yw.br()),Jx([Gx(!0),$x(!1)],yw.block()),Jx([Gx(!0),$x(!0),Kx],yw.block()),Jx([Gx(!0),$x(!0)],yw.br()),Jx([Wx(!0),Kx],yw.br()),Jx([Wx(!0)],yw.block()),Jx([jx(!0),Kx,Yx],yw.block()),Jx([jx(!0)],yw.br()),Jx([Xx],yw.br()),Jx([jx(!1),Kx],yw.br()),Jx([Yx],yw.block())],[n,!(!r||!r.shiftKey)]).getOr(yw.none()).fold((function(){Fx(t,e)}),(function(){!function(t,e){function n(e){var n,r=m,o=l.getTextInlineElements(),i=e||"TABLE"===x||"HR"===x?s.create(e||h):b.cloneNode(!1),a=i;if(!1===t.getParam("keep_styles",!0))s.setAttrib(i,"style",null),s.setAttrib(i,"class",null);else for(;o[r.nodeName]&&(Is(r)||$s(r)||(n=r.cloneNode(!1),s.setAttrib(n,"id",""),i.hasChildNodes()?n.appendChild(i.firstChild):a=n,i.appendChild(n))),(r=r.parentNode)&&r!==L;);return Nx(t,i),Tx(a),i}function r(t){var e,n,r=zx(t,m,g);if(!Pn(m)||!(t?0<r:r<m.nodeValue.length)){if(m.parentNode===b&&c&&!t)return 1;if(t&&Ln(m)&&m===b.firstChild)return 1;if(Mx(m,"TABLE")||Mx(m,"HR"))return c&&!t||!c&&t;var o=new _r(m,b);for(Pn(m)&&(t&&0===r?o.prev():t||r!==m.nodeValue.length||o.next());e=o.current();){if(Ln(e)){if(!e.getAttribute("data-mce-bogus")&&(n=e.nodeName.toLowerCase(),f[n]&&"br"!==n))return}else if(Pn(e)&&!Ur(e.nodeValue))return;t?o.prev():o.next()}return 1}}function o(){a=/^(H[1-6]|PRE|FIGURE)$/.test(x)&&"HGROUP"!==w?n(h):n(),t.getParam("end_container_on_empty_block",!1)&&Dx(s,y)&&s.isEmpty(b)?a=s.split(y,b):s.insertAfter(a,b),Cx(t,a)}var i,a,u,c,s=t.dom,l=t.schema,f=l.getNonEmptyElements(),d=t.selection.getRng();Ef(s,d).each((function(t){d.setStart(t.startContainer,t.startOffset),d.setEnd(t.endContainer,t.endOffset)}));var m=d.startContainer,g=d.startOffset,h=Cc(t),p=!(!e||!e.shiftKey),v=!(!e||!e.ctrlKey);Ln(m)&&m.hasChildNodes()&&(c=g>m.childNodes.length-1,m=m.childNodes[Math.min(g,m.childNodes.length-1)]||m,g=c&&Pn(m)?m.nodeValue.length:0);var b,y,x,w,C,S,k,O,E,_,T,M,D,z,A,N,B,R,H,V,L=Ax(s,m);L&&((h&&!p||!h&&p)&&(m=function(t,e,n,r){var o,i,a,u,c,s,l=h||"P",f=t.dom,d=Ax(f,n),m=f.getParent(n,f.isBlock);if(!m||!Dx(f,m)){if(c=((m=m||d)===t.getBody()||(s=m)&&/^(TD|TH|CAPTION)$/.test(s.nodeName)?m:m.parentNode).nodeName.toLowerCase(),!m.hasChildNodes())return Nx(t,o=f.create(l)),m.appendChild(o),e.setStart(o,0),e.setEnd(o,0),o;for(a=n;a.parentNode!==m;)a=a.parentNode;for(;a&&!f.isBlock(a);)a=(i=a).previousSibling;if(i&&t.schema.isValidChild(c,l.toLowerCase())){for(Nx(t,o=f.create(l)),i.parentNode.insertBefore(o,i),a=i;a&&!f.isBlock(a);)u=a.nextSibling,o.appendChild(a),a=u;e.setStart(n,r),e.setEnd(n,r)}}return n}(t,d,m,g)),y=(b=s.getParent(m,s.isBlock))?s.getParent(b.parentNode,s.isBlock):null,x=b?b.nodeName.toUpperCase():"","LI"!==(w=y?y.nodeName.toUpperCase():"")||v||(y=(b=y).parentNode,x=w),/^(LI|DT|DD)$/.test(x)&&s.isEmpty(b)?(O=n,E=y,_=b,T=h,H=(k=t).dom,V=k.selection.getRng(),E!==k.getBody()&&(D=(T=Ox(M=E)&&Ox(M.parentNode)?"LI":T)?O(T):H.create("BR"),_x(E,_,!0)&&_x(E,_,!1)?kx(E,"LI")?(z=Ex(E),H.insertAfter(D,z),(null===(R=(B=E).parentNode)||void 0===R?void 0:R.firstChild)===B?H.remove(z):H.remove(E)):H.replace(D,E):(_x(E,_,!0)?kx(E,"LI")?(H.insertAfter(D,Ex(E)),D.appendChild(H.doc.createTextNode(" ")),D.appendChild(E)):E.parentNode.insertBefore(D,E):_x(E,_,!1)?H.insertAfter(D,Ex(E)):(E=Ex(E),(A=V.cloneRange()).setStartAfter(_),A.setEndAfter(E),N=A.extractContents(),"LI"===T&&N.firstChild&&"LI"===N.firstChild.nodeName?(D=N.firstChild,H.insertAfter(N,E)):(H.insertAfter(N,E),H.insertAfter(D,E))),H.remove(_)),Cx(k,D))):h&&b===t.getBody()||(h=h||"P",Ar(b)?(a=Ir(b),s.isEmpty(b)&&Tx(b),Nx(t,a),Cx(t,a)):r()?o():r(!0)?(a=b.parentNode.insertBefore(n(),b),Cx(t,Mx(b,"HR")?a:b)):((S=(C=d).cloneRange()).setStart(C.startContainer,zx(!0,C.startContainer,C.startOffset)),S.setEnd(C.endContainer,zx(!1,C.endContainer,C.endOffset)),(i=S.cloneRange()).setEndAfter(b),u=i.extractContents(),I(Fu(Oe.fromDom(u),En),(function(t){var e=t.dom;e.nodeValue=Co(e.nodeValue)})),function(t){for(;Pn(t)&&(t.nodeValue=t.nodeValue.replace(/^[\r\n]+/,"")),t=t.firstChild;);}(u),a=u.firstChild,s.insertAfter(u,b),function(t,e){var n,r,o=a,i=[];if(o){for(;o=o.firstChild;){if(t.isBlock(o))return;Ln(o)&&!e[o.nodeName.toLowerCase()]&&i.push(o)}for(n=i.length;n--;)(!(o=i[n]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue||(r=o)&&"A"===r.nodeName&&t.isEmpty(r))&&t.remove(o)}}(s,f),function(t,e){e.normalize();var n=e.lastChild;n&&!/^(left|right)$/gi.test(t.getStyle(n,"float",!0))||t.add(e,"br")}(s,b),s.isEmpty(b)&&Tx(b),a.normalize(),s.isEmpty(a)?(s.remove(a),o()):(Nx(t,a),Cx(t,a))),s.setAttrib(a,"id",""),t.fire("NewBlock",{newBlock:a})))}(t,e)}),c)}function Zx(t){return t.stopImmediatePropagation()}function tw(t){return t.keyCode===Df.PAGE_UP||t.keyCode===Df.PAGE_DOWN}function ew(t,e,n){n&&!t.get()?e.on("NodeChange",Zx,!0):!n&&t.get()&&e.off("NodeChange",Zx),t.set(n)}function nw(t,e){var n=e.container(),r=e.offset();return Pn(n)?(n.insertData(r,t),vt.some(ic(n,r+t.length))):ts(e).map((function(n){var r=Oe.fromText(t);return(e.isAtEnd()?qe:We)(n,r),ic(r.dom,t.length)}))}function rw(t){var e,n,r=ic.fromRangeStart(t.selection.getRng()),o=Oe.fromDom(t.getBody());if(t.selection.isCollapsed()){var i=O(Nv,t),a=ic.fromRangeStart(t.selection.getRng());return Tb(i,t.getBody(),a).bind((n=o,function(t){return t.fold((function(t){return Yl(n.dom,ic.before(t))}),(function(t){return Jl(t)}),(function(t){return Ql(t)}),(function(t){return Kl(n.dom,ic.after(t))}))})).bind(function(t,e){return function(n){return i=t,(!Em(a=n)&&(o=a,Yl((r=i).dom,o).isNone()||Kl(r.dom,o).isNone()||Gg(r,o)||$g(r,o)||wm(r,o)||xm(r,o)||km(i,a)||Om(i,a))?Cw:Sw)(e);var r,o,i,a}}(o,r)).exists((e=t,function(t){return e.selection.setRng(t.toRange()),e.nodeChanged(),!0}))}return!1}function ow(t){var e,n,r,o,i,a,u,c,s,l,f,d,m,g,h=function(t){var e=ru(null),n=O(Nv,t);return t.on("NodeChange",(function(r){var o,i,a,u,c,s,l,f,d,m,g,h,p;!Nc(t)||we.browser.isIE()&&r.initial||(c=n,s=t.dom,l=r.parents,I(Y(f=P(V(pu(Oe.fromDom(s.getRoot()),'*[data-mce-selected="inline-boundary"]'),(function(t){return t.dom})),c),d=P(l,c)),O(zy,!1)),I(Y(d,f),O(zy,!0)),g=e,(m=t).selection.isCollapsed()&&!0!==m.composing&&g.get()&&(h=ic.fromRangeStart(m.selection.getRng()),ic.isTextPosition(h)&&!1===(Hr(p=h)||Vr(p))&&(Dy(m,Fc(g.get(),h)),g.set(null))),o=n,i=t,a=e,u=r.parents,i.selection.isCollapsed()&&I(P(u,o),(function(t){var e=ic.fromRangeStart(i.selection.getRng());Tb(o,i.getBody(),e).bind((function(t){return Ay(i,a,t)}))})))})),e}(t);return t.on("keyup compositionstart",O(tx,t)),g=h,(m=t).on("keydown",(function(t){var e,n,r,o;!1===t.isDefaultPrevented()&&(e=m,n=g,r=t,o=de().os,lx([{keyCode:Df.RIGHT,action:sx(nx,e,!0)},{keyCode:Df.LEFT,action:sx(nx,e,!1)},{keyCode:Df.UP,action:sx(rx,e,!1)},{keyCode:Df.DOWN,action:sx(rx,e,!0)},{keyCode:Df.RIGHT,action:sx(xx,e,!0)},{keyCode:Df.LEFT,action:sx(xx,e,!1)},{keyCode:Df.UP,action:sx(wx,e,!1)},{keyCode:Df.DOWN,action:sx(wx,e,!0)},{keyCode:Df.RIGHT,action:sx(fx,e,!0)},{keyCode:Df.LEFT,action:sx(fx,e,!1)},{keyCode:Df.UP,action:sx(dx,e,!1)},{keyCode:Df.DOWN,action:sx(dx,e,!0)},{keyCode:Df.RIGHT,action:sx(Ny,e,n,!0)},{keyCode:Df.LEFT,action:sx(Ny,e,n,!1)},{keyCode:Df.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:sx(lw,e,n)},{keyCode:Df.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:sx(fw,e,n)},{keyCode:Df.UP,action:sx(cx,e,!1)},{keyCode:Df.DOWN,action:sx(cx,e,!0)}],r).each((function(t){r.preventDefault()})))})),d=h,(f=t).on("keydown",(function(t){var e,n,r;!1===t.isDefaultPrevented()&&(n=d,r=t,lx([{keyCode:Df.BACKSPACE,action:sx(Xy,e=f,!1)},{keyCode:Df.BACKSPACE,action:sx(lb,e,!1)},{keyCode:Df.DELETE,action:sx(lb,e,!0)},{keyCode:Df.BACKSPACE,action:sx(ob,e,!1)},{keyCode:Df.DELETE,action:sx(ob,e,!0)},{keyCode:Df.BACKSPACE,action:sx(Iy,e,n,!1)},{keyCode:Df.DELETE,action:sx(Iy,e,n,!0)},{keyCode:Df.BACKSPACE,action:sx(lg,e,!1)},{keyCode:Df.DELETE,action:sx(lg,e,!0)},{keyCode:Df.BACKSPACE,action:sx(fb,e,!1)},{keyCode:Df.DELETE,action:sx(fb,e,!0)},{keyCode:Df.BACKSPACE,action:sx(Uy,e,!1)},{keyCode:Df.DELETE,action:sx(Uy,e,!0)},{keyCode:Df.BACKSPACE,action:sx(Yv,e,!1)},{keyCode:Df.DELETE,action:sx(Yv,e,!0)},{keyCode:Df.BACKSPACE,action:sx(Xv,e,!1)},{keyCode:Df.DELETE,action:sx(Xv,e,!0)},{keyCode:Df.BACKSPACE,action:sx(Fy,e,!1)},{keyCode:Df.DELETE,action:sx(Fy,e,!0)}],r).each((function(t){r.preventDefault()})))})),f.on("keyup",(function(t){var e,n;!1===t.isDefaultPrevented()&&(n=t,lx([{keyCode:Df.BACKSPACE,action:sx(sb,e=f)},{keyCode:Df.DELETE,action:sx(sb,e)}],n))})),(l=t).on("keydown",(function(t){var e,n,r;t.keyCode===Df.ENTER&&(e=l,(n=t).isDefaultPrevented()||(n.preventDefault(),(r=e.undoManager).typing&&(r.typing=!1,r.add()),e.undoManager.transact((function(){!1===e.selection.isCollapsed()&&e.execCommand("Delete"),Qx(e,n)}))))})),(s=t).on("keydown",(function(t){var e;!1===t.isDefaultPrevented()&&(e=t,lx([{keyCode:Df.SPACEBAR,action:sx(rw,s)}],e).each((function(t){e.preventDefault()})))})),u=a=t,c=lu((function(){u.composing||Am(u)}),0),xw.isIE()&&(u.on("keypress",(function(t){c.throttle()})),u.on("remove",(function(t){c.cancel()}))),a.on("input",(function(t){!1===t.isComposing&&Am(a)})),i=h,(o=t).on("keydown",(function(t){var e,n,r;!1===t.isDefaultPrevented()&&(n=i,r=t,lx([{keyCode:Df.END,action:sx(ox,e=o,!0)},{keyCode:Df.HOME,action:sx(ox,e,!1)},{keyCode:Df.END,action:sx(mx,e,!0)},{keyCode:Df.HOME,action:sx(mx,e,!1)},{keyCode:Df.END,action:sx(Ry,e,!0,n)},{keyCode:Df.HOME,action:sx(Ry,e,!1,n)}],r).each((function(t){r.preventDefault()})))})),e=t,n=h,ww.os.isOSX()||(r=ru(!1),e.on("keydown",(function(t){tw(t)&&ew(r,e,!0)})),e.on("keyup",(function(t){var o,i,a;!1===t.isDefaultPrevented()&&(a=t,lx([{keyCode:Df.PAGE_UP,action:sx(Ry,o=e,!1,i=n)},{keyCode:Df.PAGE_DOWN,action:sx(Ry,o,!0,i)}],a)),tw(t)&&r.get()&&(ew(r,e,!1),e.nodeChanged())}))),h}(fy=ly=ly||{})[fy.Up=-1]="Up",fy[fy.Down=1]="Down";var iw=O(py,ly.Up,Tu,Mu),aw=O(py,ly.Down,Mu,Tu),uw=Xn,cw=qc,sw=function(t,e){var n=t.selection.getRng(),r=t.getBody();if(e){var o=ic.fromRangeEnd(n),i=my(r,o);return tt(i.positions)}return o=ic.fromRangeStart(n),Z((i=dy(r,o)).positions)},lw=O(By,!0),fw=O(By,!1),dw=function(t){return P(V(t.selection.getSelectedBlocks(),Oe.fromDom),(function(t){return!Gy(t)&&!Ae(t).exists(Gy)&&gr(t,(function(t){return $n(t.dom)||Xn(t.dom)})).exists((function(t){return $n(t.dom)}))}))},mw=Xn,gw=O(gx,(function(t){return t.bottom}),(function(t,e){return t.y<e})),hw=O(gx,(function(t){return t.top}),(function(t,e){return t.y>e})),pw=O(hx,dy),vw=O(hx,my),bw=function(t,e){return n=ic.after(e),!!qn(n.getNode())||Kl(t,ic.after(e)).map((function(t){return qn(t.getNode())})).getOr(!1);var n},yw=rr([{br:[]},{block:[]},{none:[]}]),xw=de().browser,ww=de(),Cw=O(nw,yo),Sw=O(nw," "),kw=(Ow.prototype.nodeChanged=function(t){var e,n,r,o=this.editor.selection;this.editor.initialized&&o&&!this.editor.getParam("disable_nodechange")&&!this.editor.mode.isReadOnly()&&(r=this.editor.getBody(),(e=o.getStart(!0)||r).ownerDocument===this.editor.getDoc()&&this.editor.dom.isChildOf(e,r)||(e=r),n=[],this.editor.dom.getParent(e,(function(t){return t===r||void n.push(t)})),(t=t||{}).element=e,t.parents=n,this.editor.fire("NodeChange",t))},Ow.prototype.isSameElementPath=function(t){var e,n=this.editor.$(t).parentsUntil(this.editor.getBody()).add(t);if(n.length===this.lastPath.length){for(e=n.length;0<=e&&n[e]===this.lastPath[e];e--);if(-1===e)return this.lastPath=n,!0}return this.lastPath=n,!1},Ow);function Ow(t){var e;this.lastPath=[],this.editor=t;var n=this;"onselectionchange"in t.getDoc()||t.on("NodeChange click mouseup keyup focus",(function(n){var r=t.selection.getRng(),o={startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset};"nodechange"!==n.type&&xf(o,e)||t.fire("SelectionChange"),e=o})),t.on("contextmenu",(function(){t.fire("SelectionChange")})),t.on("SelectionChange",(function(){var e=t.selection.getStart(!0);!e||!we.range&&t.selection.isCollapsed()||Ml(t)&&!n.isSameElementPath(e)&&t.dom.isChildOf(e,t.getBody())&&t.nodeChanged({selectionChange:!0})})),t.on("mouseup",(function(e){!e.isDefaultPrevented()&&Ml(t)&&("IMG"===t.selection.getNode().nodeName?Or.setEditorTimeout(t,(function(){t.nodeChanged()})):t.nodeChanged())}))}function Ew(t){return Ln(t)&&fo(Oe.fromDom(t))}function _w(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=n.defaultView;return{top:e.top+o.pageYOffset-r.clientTop,left:e.left+o.pageXOffset-r.clientLeft}}function Tw(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Mw(t){var e,n,r,o,i,a,u=su(),c=Ja.DOM,s=document,l=function(t,e){var n=Or.throttle((function(t,n){e._selectionOverrides.hideFakeCaret(),e.selection.placeCaretAt(t,n)}),0);return e.on("remove",n.stop),function(r){return t.on((function(t){var o,i,a,u,c,s,l,f,d,m,g,h,p,v,b,y,x,w,C,S,k=Math.max(Math.abs(r.screenX-t.screenX),Math.abs(r.screenY-t.screenY));if(!t.dragging&&10<k){if(e.fire("dragstart",{target:t.element}).isDefaultPrevented())return;t.dragging=!0,e.focus()}t.dragging&&(h=t,o={pageX:(b=r,y=(v=e).inline?_w(v.getBody()):{left:0,top:0},S=(C=v).getBody(),x=C.inline?{left:S.scrollLeft,top:S.scrollTop}:{left:0,top:0},(p={pageX:(w=function(t,e){if(e.target.ownerDocument===t.getDoc())return{left:e.pageX,top:e.pageY};var n,r,o,i,a,u=_w(t.getContentAreaContainer()),c=(r=(n=t).getBody(),o=n.getDoc().documentElement,i={left:r.scrollLeft,top:r.scrollTop},a={left:r.scrollLeft||o.scrollLeft,top:r.scrollTop||o.scrollTop},n.inline?i:a);return{left:e.pageX-u.left+c.left,top:e.pageY-u.top+c.top}}(v,b)).left-y.left+x.left,pageY:w.top-y.top+x.top}).pageX-h.relX),pageY:p.pageY+5},m=t.ghost,g=e.getBody(),m.parentNode!==g&&g.appendChild(m),i=t.ghost,u=t.width,c=t.height,s=t.maxX,l=t.maxY,d=f=0,i.style.left=(a=o).pageX+"px",i.style.top=a.pageY+"px",l<a.pageY+c&&(d=a.pageY+c-l),i.style.width=u-(f=s<a.pageX+u?a.pageX+u-s:f)+"px",i.style.height=c-d+"px",n(r.clientX,r.clientY))}))}}(i=u,a=t),f=(e=r=u,function(){e.on((function(t){t.dragging&&n.fire("dragend")})),Yw(e)});(n=o=t).on("mousedown",(function(t){var e,n,r,o,u,c;0===t.button&&(e=q(a.dom.getParents(t.target),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){for(var n=0;n<t.length;n++)if(t[n](e))return!0;return!1}}(Xw,Kw)).getOr(null),u=a.getBody(),Xw(c=e)&&c!==u&&(n=a.dom.getPos(e),r=a.getBody(),o=a.getDoc().documentElement,i.set({element:e,dragging:!1,screenX:t.screenX,screenY:t.screenY,maxX:(a.inline?r.scrollWidth:o.offsetWidth)-2,maxY:(a.inline?r.scrollHeight:o.offsetHeight)-2,relX:t.pageX-n.x,relY:t.pageY-n.y,width:e.offsetWidth,height:e.offsetHeight,ghost:function(t,e,n){var r=a.dom,o=t.cloneNode(!0);r.setStyles(o,{width:e,height:n}),r.setAttrib(o,"data-mce-selected",null);var i=r.create("div",{class:"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return r.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:e,height:n}),r.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(e,e.offsetWidth,e.offsetHeight)})))})),t.on("mousemove",l),t.on("mouseup",(function(t){r.on((function(e){var n,r,i,a,u,c;e.dragging&&((a=3===(c=(i=o).selection.getSel().getRangeAt(0).startContainer).nodeType?c.parentNode:c)===(u=e.element)||i.dom.isChildOf(a,u)||Xw(a)||((r=e.element.cloneNode(!0)).removeAttribute("data-mce-selected"),n=r,o.fire("drop",{clientX:t.clientX,clientY:t.clientY}).isDefaultPrevented()||o.undoManager.transact((function(){Tw(e.element),o.insertContent(o.dom.getOuterHTML(n)),o._selectionOverrides.hideFakeCaret()}))),o.fire("dragend"))})),Yw(r)})),c.bind(s,"mousemove",l),c.bind(s,"mouseup",f),t.on("remove",(function(){c.unbind(s,"mousemove",l),c.unbind(s,"mouseup",f)})),t.on("keydown",(function(t){t.keyCode===Df.ESC&&f()}))}function Dw(t,e){return df(t.getBody(),e)}function zw(t){function e(t){return t!==v&&(Qw(t)||Yn(t))&&h.isChildOf(t,v)}function n(t){return Wg(t)||qg(t)||Fg(t)||Pg(t)}function r(t){t&&g.setRng(t)}function o(e,n,r,o){return void 0===o&&(o=!0),t.fire("ShowCaret",{target:n,direction:e,before:r}).isDefaultPrevented()?null:(o&&g.scrollIntoView(n,-1===e),b.show(r,n))}function i(t){return Br(t)||Oo(t)||Eo(t)}function u(t){return i(t.startContainer)||i(t.endContainer)}function c(n,r){if(!n)return null;if(n.collapsed){if(!u(n)){var i=r?1:-1,a=Zc(i,v,n),c=a.getNode(!r);if(jc(c))return o(i,c,!!r&&!a.isAtEnd(),!1);var s=a.getNode(r);if(jc(s))return o(i,s,!r&&!a.isAtEnd(),!1)}return null}var f=n.startContainer,d=n.startOffset,m=n.endOffset;if(3===f.nodeType&&0===d&&Qw(f.parentNode)&&(f=f.parentNode,d=h.nodeIndex(f),f=f.parentNode),1!==f.nodeType)return null;if(m===d+1&&f===n.endContainer){var p=f.childNodes[d];if(e(p))return function(e){var n=e.cloneNode(!0),r=t.fire("ObjectSelected",{target:e,targetClone:n});if(r.isDefaultPrevented())return null;var o=function(e,n,r){var o=t.$,i=pr(Oe.fromDom(t.getBody()),"#"+y).fold((function(){return o([])}),(function(t){return o([t.dom])}));0===i.length&&(i=o('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",y)).appendTo(t.getBody());var a=h.createRng();n===r&&we.ie?(i.empty().append('<p style="font-size: 0" data-mce-bogus="all"> </p>').append(n),a.setStartAfter(i[0].firstChild.firstChild),a.setEndAfter(n)):(i.empty().append(yo).append(n).append(yo),a.setStart(i[0].firstChild,1),a.setEnd(i[0].lastChild,0)),i.css({top:h.getPos(e,t.getBody()).y}),i[0].focus();var u=g.getSel();return u.removeAllRanges(),u.addRange(a),a}(e,r.targetClone,n),i=Oe.fromDom(e);return I(pu(Oe.fromDom(t.getBody()),"*[data-mce-selected]"),(function(t){Ut(i,t)||yn(t,x)})),h.getAttrib(e,x)||e.setAttribute(x,"1"),l=e,C(),o}(p)}return null}function s(){l&&l.removeAttribute(x),pr(Oe.fromDom(t.getBody()),"#"+y).each(Bn),l=null}var l,f,d,m,g=t.selection,h=t.dom,p=h.isBlock,v=t.getBody(),b=function(t,e,n,r){function o(){!function(){for(var t=pu(Oe.fromDom(e),"*[contentEditable=false],video,audio,embed,object"),n=0;n<t.length;n++){var r,o=t[n].dom,i=o.previousSibling;Eo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(r.length-1,1)),i=o.nextSibling,Oo(i)&&(1===(r=i.data).length?i.parentNode.removeChild(i):i.deleteData(0,1))}}(),a&&(hs(a),a=null),u.on((function(t){Ga(t.caret).remove(),u.clear()})),i&&(Or.clearInterval(i),i=void 0)}var i,a,u=su(),c=Cc(t),s=0<c.length?c:"p";return{show:function(t,c){var l;if(o(),ys(c))return null;if(!n(c))return a=function(t,e){var n=t.ownerDocument.createTextNode(xo),r=t.parentNode;if(e){if(o=t.previousSibling,ko(o)){if(Br(o))return o;if(Eo(o))return o.splitText(o.data.length-1)}r.insertBefore(n,t)}else{var o=t.nextSibling;if(ko(o)){if(Br(o))return o;if(Oo(o))return o.splitText(1),o}t.nextSibling?r.insertBefore(n,t.nextSibling):r.appendChild(n)}return n}(c,t),l=c.ownerDocument.createRange(),xs(a.nextSibling)?(l.setStart(a,0),l.setEnd(a,0)):(l.setStart(a,1),l.setEnd(a,1)),l;a=function(t,e,n){var r,o=e.ownerDocument.createElement(t);o.setAttribute("data-mce-caret",n?"before":"after"),o.setAttribute("data-mce-bogus","all"),o.appendChild(((r=document.createElement("br")).setAttribute("data-mce-bogus","1"),r));var i=e.parentNode;return n?i.insertBefore(o,e):e.nextSibling?i.insertBefore(o,e.nextSibling):i.appendChild(o),o}(s,c,t);var f=Pc(e,c,t);Ga(a).css("top",f.top);var d=Ga('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(_t({},f)).appendTo(e)[0];return u.set({caret:d,element:c,before:t}),t&&Ga(d).addClass("mce-visual-caret-before"),i=Or.setInterval((function(){r()?Ga("div.mce-visual-caret",e).toggleClass("mce-visual-caret-hidden"):Ga("div.mce-visual-caret",e).addClass("mce-visual-caret-hidden")}),500),(l=c.ownerDocument.createRange()).setStart(a,0),l.setEnd(a,0),l},hide:o,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){u.on((function(t){var n=Pc(e,t.element,t.before);Ga(t.caret).css(_t({},n))}))},destroy:function(){return Or.clearInterval(i)}}}(t,v,p,(function(){return md(t)})),y="sel-"+h.uniqueId(),x="data-mce-selected",w=g.getRng,C=function(){b.hide()};return we.ceFalse&&!Zh(t)&&(t.on("mouseup",(function(e){var n=w();n.collapsed&&Lp(t,e.clientX,e.clientY)&&Zv(t,n,!1).each(r)})),t.on("click",(function(e){var n=Dw(t,e.target);n&&(Qw(n)&&(e.preventDefault(),t.focus()),Jw(n)&&h.isChildOf(n,g.getNode())&&s())})),t.on("blur NewBlock",s),t.on("ResizeWindow FullscreenStateChanged",b.reposition),t.on("tap",(function(n){var r=n.target,o=Dw(t,r);Qw(o)?(n.preventDefault(),Qv(t,o).each(c)):e(r)&&Qv(t,r).each(c)}),!0),t.on("mousedown",(function(i){var u,l,f,d,m,b,y,x=i.target;x!==v&&"HTML"!==x.nodeName&&!h.isChildOf(x,v)||!1===Lp(t,i.clientX,i.clientY)||((u=Dw(t,x))?Qw(u)?(i.preventDefault(),Qv(t,u).each(c)):(s(),Jw(u)&&i.shiftKey||mf(i.clientX,i.clientY,g.getRng())||(C(),g.placeCaretAt(i.clientX,i.clientY))):e(x)?Qv(t,x).each(c):!1===jc(x)&&(s(),C(),(l=function(t,e,n){function r(t){return!sn(t.node)&&!Yn(t.node)}var o,i,a,u=sy(P(wt(t.getElementsByTagName("*")),jc));return(a=Sy(P(u,O(Cy,n)),e,r))&&(a=Sy(function(t,e,n){function r(t,n){var r=P(sy([n]),(function(n){return!t(n,e)}));return o=o.concat(r),0===r.length}void 0===n&&(n=!0);var o=[];return o.push(e),ky(ly.Up,t,O(r,Tu),e.node,n),ky(ly.Down,t,O(r,Mu),e.node,n),o}(t,a,r(a)),e,r))&&jc(a.node)?{node:(o=a).node,before:yy(o,i=e)<xy(o,i)}:null}(v,i.clientX,i.clientY))&&(f=x,d=l.node,b=h.getParent(f,p),y=h.getParent(d,p),!a(b)&&(f!==y&&h.isChildOf(b,y)&&!1===Qw(Dw(t,b))||!h.isChildOf(y,b)&&(m=y,h.getParent(b,p)!==h.getParent(m,p))&&function(t){var e=t.firstChild;if(!a(e)){var r=ic.before(e);if(qn(r.getNode())&&1===t.childNodes.length)return!n(r);var o=As(t).next(r);return o&&!n(o)}}(b))||(i.preventDefault(),r(o(1,l.node,l.before,!1)),t.getBody().focus()))))})),t.on("keypress",(function(t){Df.modifierPressed(t)||Qw(g.getNode())&&t.preventDefault()})),t.on("GetSelectionRange",(function(t){var e=t.range;l&&(l.parentNode?((e=e.cloneRange()).selectNode(l),t.range=e):l=null)})),t.on("SetSelectionRange",(function(e){var n,r,o,i,a,u,s;e.range=(n=e.range,r=t.schema.getShortEndedElements(),o=h.createRng(),i=n.startContainer,a=n.startOffset,u=n.endContainer,s=n.endOffset,Ot(r,i.nodeName.toLowerCase())?0===a?o.setStartBefore(i):o.setStartAfter(i):o.setStart(i,a),Ot(r,u.nodeName.toLowerCase())?0===s?o.setEndBefore(u):o.setEndAfter(u):o.setEnd(u,s),o);var l=c(e.range,e.forward);l&&(e.range=l)})),t.on("AfterSetSelectionRange",(function(t){var e=t.range,n=e.startContainer.parentNode;u(e)||"mcepastebin"===n.id||C(),h.hasClass(n,"mce-offscreen-selection")||s()})),t.on("copy",(function(t){var e,n,r=t.clipboardData;t.isDefaultPrevented()||!t.clipboardData||we.ie||(e=(n=h.get(y))&&n.getElementsByTagName("*")[0])&&(t.preventDefault(),r.clearData(),r.setData("text/html",e.outerHTML),r.setData("text/plain",e.outerText||e.innerText))})),function(t){var e,n;function r(t){var e;t.isDefaultPrevented()||(e=t.dataTransfer)&&(R(e.types,"Files")||0<e.files.length)&&(t.preventDefault(),"drop"===t.type&&hv(n,"Dropped file type is not supported"))}function o(t){cd(n,t.target)&&r(t)}function i(){var t=Ja.DOM,e=n.dom,i=document,a=n.inline?n.getBody():n.getDoc(),u=["drop","dragover"];I(u,(function(n){t.bind(i,n,o),e.bind(a,n,r)})),n.on("remove",(function(){I(u,(function(n){t.unbind(i,n,o),e.unbind(a,n,r)}))}))}Mw(t),(e=t).on("drop",(function(t){var n=void 0!==t.clientX?e.getDoc().elementFromPoint(t.clientX,t.clientY):null;!Xw(n)&&"false"!==e.dom.getContentEditableParent(n)||t.preventDefault()})),t.getParam("block_unsupported_drop",!0,"boolean")&&(n=t).on("init",(function(){Or.setEditorTimeout(n,i,0)}))}(t),d=lu((function(){var t,e;f.removed||!f.getBody().contains(document.activeElement)||(t=f.selection.getRng()).collapsed&&(e=tb(f,t,!1),f.selection.setRng(e))}),0),(f=t).on("focus",(function(){d.throttle()})),f.on("blur",(function(){d.cancel()})),(m=t).on("init",(function(){m.on("focusin",(function(t){var e,n,r=t.target;Yn(r)&&(e=df(m.getBody(),r),n=Xn(e)?e:r,m.selection.getNode()!==n&&Qv(m,n).each((function(t){return m.selection.setRng(t)})))}))}))),{showCaret:o,showBlockCaretContainer:function(t){t.hasAttribute("data-mce-caret")&&(Ir(t),r(w()),g.scrollIntoView(t))},hideFakeCaret:C,destroy:function(){b.destroy(),l=null}}}function Aw(t){return at(t,(function(t){return!1===C(t)}))}function Nw(t){var e=t.settings;return Aw({block_elements:e.block_elements,boolean_attributes:e.boolean_attributes,custom_elements:e.custom_elements,extended_valid_elements:e.extended_valid_elements,invalid_elements:e.invalid_elements,invalid_styles:e.invalid_styles,move_caret_before_on_enter_elements:e.move_caret_before_on_enter_elements,non_empty_elements:e.non_empty_elements,schema:e.schema,self_closing_elements:e.self_closing_elements,short_ended_elements:e.short_ended_elements,special:e.special,text_block_elements:e.text_block_elements,text_inline_elements:e.text_inline_elements,valid_children:e.valid_children,valid_classes:e.valid_classes,valid_elements:e.valid_elements,valid_styles:e.valid_styles,verify_html:e.verify_html,whitespace_elements:e.whitespace_elements,padd_empty_block_inline_children:e.format_empty_lines})}function Bw(t){var e=t.settings,n=t.editorUpload.blobCache;return Aw({allow_conditional_comments:e.allow_conditional_comments,allow_html_data_urls:e.allow_html_data_urls,allow_svg_data_urls:e.allow_svg_data_urls,allow_html_in_named_anchor:e.allow_html_in_named_anchor,allow_script_urls:e.allow_script_urls,allow_unsafe_link_target:e.allow_unsafe_link_target,convert_fonts_to_spans:e.convert_fonts_to_spans,fix_list_elements:e.fix_list_elements,font_size_legacy_values:e.font_size_legacy_values,forced_root_block:e.forced_root_block,forced_root_block_attrs:e.forced_root_block_attrs,padd_empty_with_br:e.padd_empty_with_br,preserve_cdata:e.preserve_cdata,remove_trailing_brs:e.remove_trailing_brs,inline_styles:e.inline_styles,root_name:t.inline?t.getElement().nodeName.toLowerCase():void 0,validate:!0,blob_cache:n,document:t.getDoc(),images_dataimg_filter:e.images_dataimg_filter})}function Rw(t){return(t.inline?t.ui:t.dom).styleSheetLoader}function Hw(t){function e(){o.unloadAll(a),t.inline||t.ui.styleSheetLoader.unloadAll(i)}function n(){t.removed?e():t.on("remove",e)}var r,o=Rw(t),i=Mc(t),a=t.contentCSS;0<t.contentStyles.length&&(r="",ke.each(t.contentStyles,(function(t){r+=t+"\r\n"})),t.dom.addStyle(r));var u,c,s,l,f,d,m,g,h,p=kr.all((u=t,c=a,s=i,l=[new kr((function(t,e){return Rw(u).loadAll(c,t,e)}))],u.inline?l:l.concat([new kr((function(t,e){return u.ui.styleSheetLoader.loadAll(s,t,e)}))]))).then(n).catch(n);return t.settings.content_style&&(d=(f=t).settings.content_style,m=Oe.fromDom(f.getBody()),g=Ue(An(m)),hn(h=Oe.fromTag("style"),"type","text/css"),Nn(h,Oe.fromText(d)),Nn(g,h),f.on("remove",(function(){Bn(h)}))),p}function Vw(t){var e;!0!==t.removed&&(Zh(e=t)||e.load({initial:!0,format:"html"}),e.startContent=e.getContent({format:"raw"}),function(t){var e,n,r;t.bindPendingEventDelegates(),t.initialized=!0,t.fire("Init"),t.focus(!0),r=(n=t).dom.getRoot(),n.inline||Ml(n)&&n.selection.getStart(!0)!==r||Jl(r).each((function(t){var e,r,o,i,a=t.getNode(),u=sn(a)?Jl(a).getOr(t):t;we.browser.isIE()?(e=n,r=u.toRange(),o=Oe.fromDom(e.getBody()),i=(rd(e)?vt.from(r):vt.none()).map(od).filter(nd(o)),e.bookmark=i.isSome()?i:e.bookmark):n.selection.setRng(u.toRange())})),t.nodeChanged({initial:!0}),t.execCallback("init_instance_callback",t),(e=t).settings.auto_focus&&Or.setEditorTimeout(e,(function(){var t=!0===e.settings.auto_focus?e:e.editorManager.get(e.settings.auto_focus);t.destroyed||t.focus()}),100)}(t))}function Iw(t,e){var n=t.settings,r=t.getElement(),o=t.getDoc();n.inline||(t.getElement().style.visibility=t.orgVisibility),e||t.inline||(o.open(),o.write(t.iframeHTML),o.close()),t.inline&&(Zw.addClass(r,"mce-content-body"),t.contentDocument=o=document,t.contentWindow=window,t.bodyElement=r,t.contentAreaContainer=r);var i,a,u,s,l,f,d,m,g,h,p,b,y=t.getBody();y.disabled=!0,t.readonly=!!n.readonly,t.readonly||(t.inline&&"static"===Zw.getStyle(y,"position",!0)&&(y.style.position="relative"),y.contentEditable=t.getParam("content_editable_state",!0)),y.disabled=!1,t.editorUpload=kv(t),t.schema=eo(Nw(t)),t.dom=Ja(o,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:n.force_hex_style_colors,update_styles:!0,root_element:t.inline?t.getBody():null,collect:function(){return t.inline},schema:t.schema,contentCssCors:t.getParam("content_css_cors",!1,"boolean"),referrerPolicy:Ec(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((a=_p(Bw(i=t),i.schema)).addAttributeFilter("src,href,style,tabindex",(function(t,e){for(var n,r,o=t.length,a=i.dom,u="data-mce-"+e;o--;)(r=(n=t[o]).attr(e))&&!n.attr(u)&&0!==r.indexOf("data:")&&0!==r.indexOf("blob:")&&("style"===e?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(u,r),n.attr(e,r)):"tabindex"===e?(n.attr(u,r),n.attr(e,null)):n.attr(u,i.convertURL(r,e,n.name)))})),a.addNodeFilter("script",(function(t){for(var e=t.length;e--;){var n=t[e],r=n.attr("type")||"no/type";0!==r.indexOf("mce-")&&n.attr("type","mce-"+r)}})),i.settings.preserve_cdata&&a.addNodeFilter("#cdata",(function(t){for(var e=t.length;e--;){var n=t[e];n.type=8,n.name="#comment",n.value="[CDATA["+i.dom.encode(n.value)+"]]"}})),a.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",(function(t){for(var e=t.length,n=i.schema.getNonEmptyElements();e--;){var r=t[e];r.isEmpty(n)&&0===r.getAll("br").length&&(r.append(new Rd("br",1)).shortEnded=!0)}})),a),t.serializer=Mp((s=(u=t).settings,_t(_t(_t({},Bw(u)),Nw(u)),Aw({url_converter:s.url_converter,url_converter_scope:s.url_converter_scope,element_format:s.element_format,entities:s.entities,entity_encoding:s.entity_encoding,indent:s.indent,indent_after:s.indent_after,indent_before:s.indent_before}))),t),t.selection=xp(t.dom,t.getWin(),t.serializer,t),t.annotator=Bl(t),t.formatter=Tv(t),t.undoManager=Dv(t),t._nodeChangeDispatcher=new kw(t),t._selectionOverrides=zw(t),g=t,h=su(),p=ru(!1),b=fu((function(t){g.fire("longpress",_t(_t({},t),{type:"longpress"})),p.set(!0)}),400),g.on("touchstart",(function(t){Yy(t).each((function(e){b.cancel();var n={x:e.clientX,y:e.clientY,target:t.target};b.throttle(t),p.set(!1),h.set(n)}))}),!0),g.on("touchmove",(function(t){b.cancel(),Yy(t).each((function(t){h.on((function(e){var n=t,r=e,o=Math.abs(n.clientX-r.x),i=Math.abs(n.clientY-r.y);(5<o||5<i)&&(h.clear(),p.set(!1),g.fire("longpresscancel"))}))}))}),!0),g.on("touchend touchcancel",(function(t){b.cancel(),"touchcancel"!==t.type&&h.get().filter((function(e){return e.target.isEqualNode(t.target)})).each((function(){p.get()?t.preventDefault():g.fire("tap",_t(_t({},t),{type:"tap"}))}))}),!0),(d=f=t).on("click",(function(t){d.dom.getParent(t.target,"details")&&t.preventDefault()})),(m=f).parser.addNodeFilter("details",(function(t){I(t,(function(t){t.attr("data-mce-open",t.attr("open")),t.attr("open","open")}))})),m.serializer.addNodeFilter("details",(function(t){I(t,(function(t){var e=t.attr("data-mce-open");t.attr("open",v(e)?e:null),t.attr("data-mce-open",null)}))})),Zh(t)||(l=t).on("click",(function(t){var e,n,r,o,i;3<=t.detail&&(r=(e=l).selection.getRng(),o=ic.fromRangeStart(r),i=ic.fromRangeEnd(r),!ic.isElementPosition(o)||Ew(n=o.container())&&Jl(n).each((function(t){return r.setStart(t.container(),t.offset())})),!ic.isElementPosition(i)||Ew(n=o.container())&&Ql(n).each((function(t){return r.setEnd(t.container(),t.offset())})),e.selection.setRng(fg(r)))}));var x,w,C,S,k,E,_,T,M,D=Zh(x=t)?ru(null):ow(x);M=D,(T=t).addCommand("delete",(function(){var t,e=M;Xy(t=T)||lb(t,!1)||ob(t,!1)||Iy(t,e,!1)||Xv(t,!1)||lg(t)||fb(t,!1)||Uy(t,!1)||Yv(t)||Fy(t,!1)||(Ky(t,"Delete"),Iv(t))})),T.addCommand("forwardDelete",(function(){var t,e=M;lb(t=T,!0)||ob(t,!0)||Iy(t,e,!0)||Xv(t,!0)||lg(t)||fb(t,!0)||Uy(t,!0)||Yv(t)||Fy(t,!0)||Ky(t,"ForwardDelete")})),Cc(w=t)&&w.on("NodeChange",O(Qy,w)),S=(C=t).dom,k=Cc(C),E=C.getParam("placeholder",ds.getAttrib(C.getElement(),"placeholder"),"string"),_=function(t,e){var n,r,o;!function(t){if(zv(t)){var e=t.keyCode;return!Av(t)&&(Df.metaKeyPressed(t)||t.altKey||112<=e&&e<=123||R(jb,e))}}(t)&&(n=C.getBody(),r=!(zv(o=t)&&!(Av(o)||"keyup"===o.type&&229===o.keyCode))&&function(t,e,n){if(Wr(Oe.fromDom(e),!1)){var r=""===n,o=e.firstElementChild;return!o||!t.getStyle(e.firstElementChild,"padding-left")&&!t.getStyle(e.firstElementChild,"padding-right")&&(r?!t.isBlock(o):n===o.nodeName.toLowerCase())}return!1}(S,n,k),""!==S.getAttrib(n,Wb)===r&&!e||(S.setAttrib(n,Wb,r?E:null),S.setAttrib(n,"aria-placeholder",r?E:null),C.fire("PlaceholderToggle",{state:r}),C.on(r?"keydown":"keyup",_),C.off(r?"keyup":"keydown",_)))},E&&C.on("init",(function(t){_(t,!0),C.on("change SetContent ExecCommand",_),C.on("paste",(function(t){return Or.setEditorTimeout(C,(function(){return _(t)}))}))}));var z=tp(t);(function(t){var e=t.settings,n=t.getDoc(),r=t.getBody();t.fire("PreInit"),e.browser_spellcheck||e.gecko_spellcheck||(n.body.spellcheck=!1,Zw.setAttrib(r,"spellcheck","false")),t.quirks=function(t){function e(e,n){try{t.getDoc().execCommand(e,!1,n)}catch(e){}}function n(t){return t.isDefaultPrevented()}function r(){t.shortcuts.add("meta+a",null,"SelectAll")}function o(){t.inline||y.bind(t.getDoc(),"mousedown mouseup",(function(e){var n;e.target===t.getDoc().documentElement&&(n=x.getRng(),t.getBody().focus(),"mousedown"===e.type?Br(n.startContainer)||x.placeCaretAt(e.clientX,e.clientY):x.setRng(n))}))}function i(){Range.prototype.getClientRects||t.on("mousedown",(function(e){var r;n(e)||"HTML"!==e.target.nodeName||((r=t.getBody()).blur(),Or.setEditorTimeout(t,(function(){r.focus()})))}))}function a(){t.on("click",(function(e){var n=e.target;/^(IMG|HR)$/.test(n.nodeName)&&"false"!==y.getContentEditableParent(n)&&(e.preventDefault(),t.selection.select(n),t.nodeChanged()),"A"===n.nodeName&&y.hasClass(n,"mce-item-anchor")&&(e.preventDefault(),x.select(n))}))}function u(){t.on("keydown",(function(t){if(!n(t)&&t.keyCode===v&&x.isCollapsed()&&0===x.getRng().startOffset){var e=x.getNode().previousSibling;if(e&&e.nodeName&&"table"===e.nodeName.toLowerCase())return t.preventDefault(),!1}}))}function s(){t.getParam("readonly")||t.on("BeforeExecCommand mousedown",(function(){e("StyleWithCSS",!1),e("enableInlineTableEditing",!1),Dc(t)||e("enableObjectResizing",!1)}))}function l(){t.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function f(){t.inline||t.on("keydown",(function(){document.activeElement===document.body&&t.getWin().focus()}))}function d(){t.inline||(t.contentStyles.push("body {min-height: 150px}"),t.on("click",(function(e){var n;"HTML"===e.target.nodeName&&(11<we.ie?t.getBody().focus():(n=t.selection.getRng(),t.getBody().focus(),t.selection.setRng(n),t.selection.normalize(),t.nodeChanged()))})))}function m(){we.mac&&t.on("keydown",(function(e){!Df.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),t.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}))}function g(){t.on("click",(function(t){var e=t.target;do{if("A"===e.tagName)return void t.preventDefault()}while(e=e.parentNode)})),t.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function h(){t.on("init",(function(){t.dom.bind(t.getBody(),"submit",(function(t){t.preventDefault()}))}))}var p=ke.each,v=Df.BACKSPACE,b=Df.DELETE,y=t.dom,x=t.selection,w=t.parser,C=we.gecko,S=we.ie,k=we.webkit,O="data:text/mce-internal,",E=S?"Text":"URL",_=c;return Zh(t)?(k&&(o(),a(),h(),r(),we.iOS&&(f(),d(),g())),C&&(i(),s(),l(),m())):(t.on("keydown",(function(e){if(!n(e)&&e.keyCode===Df.BACKSPACE){var r,o=(r=x.getRng()).startContainer,i=r.startOffset,a=y.getRoot(),u=o;if(r.collapsed&&0===i){for(;u&&u.parentNode&&u.parentNode.firstChild===u&&u.parentNode!==a;)u=u.parentNode;"BLOCKQUOTE"===u.tagName&&(t.formatter.toggle("blockquote",null,u),(r=y.createRng()).setStart(o,0),r.setEnd(o,0),x.setRng(r))}}})),t.on("keydown",(function(e){var r,o,i,a,u=e.keyCode;n(e)||u!==b&&u!==v||(r=t.selection.isCollapsed(),o=t.getBody(),r&&!y.isEmpty(o)||!r&&(i=D(t.selection.getRng()),(a=y.createRng()).selectNode(t.getBody()),i!==D(a))||(e.preventDefault(),t.setContent(""),o.firstChild&&y.isBlock(o.firstChild)?t.selection.setCursorLocation(o.firstChild,0):t.selection.setCursorLocation(o,0),t.nodeChanged()))})),we.windowsPhone||t.on("keyup focusin mouseup",(function(t){Df.modifierPressed(t)||x.normalize()}),!0),k&&(o(),a(),Cc(t)&&t.on("init",(function(){e("DefaultParagraphSeparator",Cc(t))})),h(),u(),w.addNodeFilter("br",(function(t){for(var e=t.length;e--;)"Apple-interchange-newline"===t[e].attr("class")&&t[e].remove()})),we.iOS?(f(),d(),g()):r()),11<=we.ie&&(d(),u()),we.ie&&(r(),e("AutoUrlDetect",!1),t.on("dragstart",(function(e){var n,r,o;(n=e).dataTransfer&&(t.selection.isCollapsed()&&"IMG"===n.target.tagName&&x.select(n.target),0<(r=t.selection.getContent()).length&&(o=O+escape(t.id)+","+escape(r),n.dataTransfer.setData(E,o)))})),t.on("drop",(function(e){var r,o,i,a;n(e)||(r=e.dataTransfer&&(a=e.dataTransfer.getData(E))&&0<=a.indexOf(O)?(a=a.substr(O.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null)&&r.id!==t.id&&(e.preventDefault(),o=yf(e.x,e.y,t.getDoc()),x.setRng(o),i=r.html,t.queryCommandSupported("mceInsertClipboardContent")?t.execCommand("mceInsertClipboardContent",!1,{content:i,internal:!0}):t.execCommand("mceInsertContent",!1,i))}))),C&&(t.on("keydown",(function(e){if(!n(e)&&e.keyCode===v&&t.getBody().getElementsByTagName("hr").length&&x.isCollapsed()&&0===x.getRng().startOffset){var r=x.getNode(),o=r.previousSibling;if("HR"===r.nodeName)return y.remove(r),void e.preventDefault();o&&o.nodeName&&"hr"===o.nodeName.toLowerCase()&&(y.remove(o),e.preventDefault())}})),i(),t.on("keypress",(function(e){var r;if(!n(e)&&(8===e.keyCode||46===e.keyCode)&&M())return r=T(),t.getDoc().execCommand("delete",!1,null),r(),e.preventDefault(),!1})),y.bind(t.getDoc(),"cut",(function(e){var r;!n(e)&&M()&&(r=T(),Or.setEditorTimeout(t,(function(){r()})))})),s(),t.on("SetContent ExecCommand",(function(t){"setcontent"!==t.type&&"mceInsertLink"!==t.command||p(y.select("a"),(function(t){var e=t.parentNode,n=y.getRoot();if(e.lastChild===t){for(;e&&!y.isBlock(e);){if(e.parentNode.lastChild!==e||e===n)return;e=e.parentNode}y.add(e,"br",{"data-mce-bogus":1})}}))})),l(),m(),u())),{refreshContentEditable:_,isHidden:function(){if(!C||t.removed)return!1;var e=t.selection.getSel();return!e||!e.rangeCount||0===e.rangeCount}};function T(){var e=y.getAttribs(x.getStart().cloneNode(!1));return function(){var n=x.getStart();n!==t.getBody()&&(y.setAttrib(n,"style",null),p(e,(function(t){n.setAttributeNode(t.cloneNode(!0))})))}}function M(){return!x.isCollapsed()&&y.getParent(x.getStart(),y.isBlock)!==y.getParent(x.getEnd(),y.isBlock)}function D(t){var e=y.create("body"),n=t.cloneContents();return e.appendChild(n),x.serializer.serialize(e,{format:"html"})}}(t),t.fire("PostRender");var o=t.getParam("directionality",uu.isRtl()?"rtl":void 0);void 0!==o&&(r.dir=o),e.protect&&t.on("BeforeSetContent",(function(t){ke.each(e.protect,(function(e){t.content=t.content.replace(e,(function(t){return"\x3c!--mce:protected "+escape(t)+"--\x3e"}))}))})),t.on("SetContent",(function(){t.addVisual(t.getBody())})),t.on("compositionstart compositionend",(function(e){t.composing="compositionstart"===e.type}))})(t),z.fold((function(){Hw(t).then((function(){return Vw(t)}))}),(function(e){t.setProgressState(!0),Hw(t).then((function(){e().then((function(e){t.setProgressState(!1),Vw(t)}),(function(e){t.notificationManager.open({type:"error",text:String(e)}),Vw(t)}))}))}))}function Lw(t){return t.replace(/^\-/,"")}function Fw(t){return{editorContainer:t,iframeContainer:t,api:{}}}function Pw(t){var e,n,r,o,i,a,u,s;t.fire("ScriptsLoaded"),e=t,n=ke.trim(Oc(e)),r=e.ui.registry.getAll().icons,nt(_t(_t({},av.get("default").icons),av.get(n).icons),(function(t,n){Ot(r,n)||e.ui.registry.addIcon(n,t)})),a=Ac(o=t),v(a)?(o.settings.theme=Lw(a),i=dv.get(a),o.theme=new i(o,dv.urls[a]),o.theme.init&&o.theme.init(o,dv.urls[a]||o.documentBaseUrl.replace(/\/$/,""),o.$)):o.theme={},s=[],ke.each(Bc(u=t).split(/[ ,]/),(function(t){nC(u,s,Lw(t))}));var l=function(t){var e,n,r,o,i,a,u,c=t.getElement();return t.orgDisplay=c.style.display,v(Ac(t))?t.theme.renderUI():S(Ac(t))?(n=(e=t).getElement(),(r=Ac(e)(e,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||e.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||e.id+"_iframecontainer"),r.height=r.iframeHeight||n.offsetHeight,r):(u=(o=t).getElement(),o.inline?Fw(null):(i=u,a=eC.create("div"),eC.insertAfter(a,i),Fw(a)))}(t),f=t,d=vt.from(l.api).getOr({}),m={show:vt.from(d.show).getOr(c),hide:vt.from(d.hide).getOr(c),disable:vt.from(d.disable).getOr(c),isDisabled:vt.from(d.isDisabled).getOr(D),enable:function(){f.mode.isReadOnly()||vt.from(d.enable).map(T)}};f.ui=_t(_t({},f.ui),m);var g,h,p,b={editorContainer:l.editorContainer,iframeContainer:l.iframeContainer};return t.editorContainer=b.editorContainer||null,function(t){var e,n;t.contentCSS=t.contentCSS.concat(Lb(t,(n=(e=t).getParam("content_css"),v(n)?V(n.split(","),Jt):y(n)?n:!1===n||e.inline?[]:["default"])),Lb(t,Mc(t)))}(t),t.inline?Iw(t):(p=function(t,e){var n,r,o,i,a=t.translate("Rich Text Area"),u=(n=t.id,r=a,e.height,o=t.getParam("iframe_attrs",{}),pn(i=Oe.fromTag("iframe"),o),pn(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),gu(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,t.fire("load")};var c=function(t,e){if(document.domain!==window.location.hostname&&we.browser.isIE()){var n=xv("mce");t[n]=function(){Iw(t)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return tC.setAttrib(e,"src",r),!0}return!1}(t,u);return t.contentAreaContainer=e.iframeContainer,t.iframeElement=u,t.iframeHTML=function(t){var e=t.getParam("doctype","<!DOCTYPE html>")+"<html><head>";t.getParam("document_base_url","")!==t.documentBaseUrl&&(e+='<base href="'+t.documentBaseURI.getURI()+'" />'),e+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';var n=xc(t,"body_id","tinymce"),r=xc(t,"body_class",""),o=t.translate(t.getParam("iframe_aria_text","Rich Text Area. Press ALT-0 for help.","string"));return wc(t)&&(e+='<meta http-equiv="Content-Security-Policy" content="'+wc(t)+'" />'),e+'</head><body id="'+n+'" class="mce-content-body '+r+'" data-id="'+t.id+'" aria-label="'+o+'"><br></body></html>'}(t),tC.add(e.iframeContainer,u),c}(g=t,h=b),h.editorContainer&&(tC.get(h.editorContainer).style.display=g.orgDisplay,g.hidden=tC.isHidden(h.editorContainer)),g.getElement().style.display="none",tC.setAttrib(g.id,"aria-hidden","true"),void(p||Iw(g)))}function Uw(t){return"-"===t.charAt(0)}function jw(t,e,n){return vt.from(e).filter((function(t){return 0<t.length&&!av.has(t)})).map((function(e){return{url:t.editorManager.baseURL+"/icons/"+e+"/icons"+n+".js",name:vt.some(e)}}))}function Ww(t){return function(e,n){return vt.from(n).map(Oe.fromDom).filter(On).bind((function(n){return r=t,o=e,i=n.dom,yg(Oe.fromDom(i),(function(t){return wn(e=t,r).orThunk((function(){return"font"===Ee(e)?ut(oC,r).bind((function(t){return bn(e,t)})):vt.none()}));var e}),(function(t){return Ut(Oe.fromDom(o),t)})).or((a=n.dom,vt.from(Ja.DOM.getStyle(a,t,!0))));var r,o,i,a})).getOr("")}}function qw(t){return Jl(t.getBody()).map((function(t){var e=t.container();return Pn(e)?e.parentNode:e}))}function Gw(t,e){return n=t,r=l(vt.some,e),o=n,vt.from(o.selection.getRng()).bind((function(t){var e=o.getBody();return t.startContainer===e&&0===t.startOffset?vt.none():vt.from(o.selection.getStart(!0))})).orThunk(O(qw,n)).map(Oe.fromDom).filter(On).bind(r);var n,r,o}function $w(t,e){if(/^[0-9.]+$/.test(e)){var n=parseInt(e,10);if(1<=n&&n<=7){var r=ke.explode(t.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),o=ke.explode(t.getParam("font_size_classes",""));return o?o[n-1]||e:r[n-1]||e}return e}return e}var Xw=Xn,Kw=$n,Yw=function(t){t.on((function(t){Tw(t.ghost)})),t.clear()},Jw=$n,Qw=Xn,Zw=Ja.DOM,tC=Ja.DOM,eC=Ja.DOM,nC=function(t,e,n){var r,o,i,a,u=fv.get(n),c=fv.urls[n]||t.documentBaseUrl.replace(/\/$/,"");if(n=ke.trim(n),u&&-1===ke.inArray(e,n)&&(ke.each(fv.dependencies(n),(function(n){nC(t,e,n)})),!t.plugins[n]))try{var s=new u(t,c,t.$);(t.plugins[n]=s).init&&(s.init(t,c),e.push(n))}catch(u){o=n,i=u,gf(r=t,"PluginLoadError",{message:a=uu.translate(["Failed to initialize plugin: {0}",o])}),Hb(a,i),hv(r,a)}},rC=Ja.DOM,oC={"font-size":"size","font-family":"face"},iC=Ww("font-size"),aC=s((function(t){return t.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")}),Ww("font-family")),uC=ke.each,cC=ke.map,sC=ke.inArray,lC=(fC.prototype.execCommand=function(t,e,n,r){var o,i,a=!1,u=this;if(!u.editor.removed){if("mcefocus"!==t.toLowerCase()&&(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||r&&r.skip_focus?ud(i=u.editor).each((function(t){return i.selection.setRng(t)})):u.editor.focus()),(r=u.editor.fire("BeforeExecCommand",{command:t,ui:e,value:n})).isDefaultPrevented())return!1;var c=t.toLowerCase();if(o=u.commands.exec[c])return o(c,e,n),u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;if(uC(this.editor.plugins,(function(r){if(r.execCommand&&r.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!(a=!0)})),a)return a;if(u.editor.theme&&u.editor.theme.execCommand&&u.editor.theme.execCommand(t,e,n))return u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0;try{a=u.editor.getDoc().execCommand(t,e,n)}catch(r){}return!!a&&(u.editor.fire("ExecCommand",{command:t,ui:e,value:n}),!0)}},fC.prototype.queryCommandState=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.state[t])return e(t);try{return this.editor.getDoc().queryCommandState(t)}catch(t){}return!1}},fC.prototype.queryCommandValue=function(t){var e;if(!this.editor.quirks.isHidden()&&!this.editor.removed){if(t=t.toLowerCase(),e=this.commands.value[t])return e(t);try{return this.editor.getDoc().queryCommandValue(t)}catch(t){}}},fC.prototype.addCommands=function(t,e){void 0===e&&(e="exec");var n=this;uC(t,(function(t,r){uC(r.toLowerCase().split(","),(function(r){n.commands[e][r]=t}))}))},fC.prototype.addCommand=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.exec[t]=function(t,o,i,a){return e.call(n||r.editor,o,i,a)}},fC.prototype.queryCommandSupported=function(t){if(t=t.toLowerCase(),this.commands.exec[t])return!0;try{return this.editor.getDoc().queryCommandSupported(t)}catch(t){}return!1},fC.prototype.addQueryStateHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.state[t]=function(){return e.call(n||r.editor)}},fC.prototype.addQueryValueHandler=function(t,e,n){var r=this;t=t.toLowerCase(),this.commands.value[t]=function(){return e.call(n||r.editor)}},fC.prototype.hasCustomCommand=function(t){return t=t.toLowerCase(),!!this.commands.exec[t]},fC.prototype.execNativeCommand=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=null),this.editor.getDoc().execCommand(t,e,n)},fC.prototype.isFormatMatch=function(t){return this.editor.formatter.match(t)},fC.prototype.toggleFormat=function(t,e){this.editor.formatter.toggle(t,e),this.editor.nodeChanged()},fC.prototype.storeSelection=function(t){this.selectionBookmark=this.editor.selection.getBookmark(t)},fC.prototype.restoreSelection=function(){this.editor.selection.moveToBookmark(this.selectionBookmark)},fC.prototype.setupCommands=function(t){var e=this;function n(e){return function(){var n=t.selection,r=n.isCollapsed()?[t.dom.getParent(n.getNode(),t.dom.isBlock)]:n.getSelectedBlocks(),o=cC(r,(function(n){return!!t.formatter.matchNode(n,e)}));return-1!==sC(o,!0)}}this.addCommands({"mceResetDesignMode,mceBeginUndoLevel":c,"mceEndUndoLevel,mceAddUndoLevel":function(){t.undoManager.add()},mceFocus:function(e,n,r){var o,i;i=r,(o=t).removed||(i?Nd:function(t){var e=t.selection,n=t.getBody(),r=e.getRng();t.quirks.refreshContentEditable(),void 0!==t.bookmark&&!1===md(t)&&ud(t).each((function(e){t.selection.setRng(e),r=e}));var o,i,a=(o=t,i=e.getNode(),o.dom.getParent(i,(function(t){return"true"===o.dom.getContentEditable(t)})));if(t.$.contains(n,a))return dd(a),fd(t,r),Nd(t);t.inline||(we.opera||dd(n),t.getWin().focus()),(we.gecko||t.inline)&&(dd(n),fd(t,r)),Nd(t)})(o)},"Cut,Copy,Paste":function(n){var r,o,i=t.getDoc();try{e.execNativeCommand(n)}catch(n){r=!0}!(r="paste"===n&&!i.queryCommandEnabled(n)||r)&&i.queryCommandSupported(n)||(o=t.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead."),we.mac&&(o=o.replace(/Ctrl\+/g,"⌘+")),t.notificationManager.open({text:o,type:"error"}))},unlink:function(){var e;t.selection.isCollapsed()?(e=t.dom.getParent(t.selection.getStart(),"a"))&&t.dom.remove(e,!0):t.formatter.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(n){var r=n.substring(7);"full"===r&&(r="justify"),uC("left,center,right,justify".split(","),(function(e){r!==e&&t.formatter.remove("align"+e)})),"none"!==r&&e.toggleFormat("align"+r)},"InsertUnorderedList,InsertOrderedList":function(n){var r;e.execNativeCommand(n);var o=t.dom.getParent(t.selection.getNode(),"ol,ul");o&&(r=o.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(r.nodeName)&&(e.storeSelection(),t.dom.split(r,o),e.restoreSelection()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){e.toggleFormat(t)},"ForeColor,HiliteColor":function(t,n,r){e.toggleFormat(t,{value:r})},FontName:function(e,n,r){var o,i;i=$w(o=t,r),o.formatter.toggle("fontname",{value:V(i.split(/\s*,\s*/),(function(t){return-1===t.indexOf(" ")||Yt(t,'"')||Yt(t,"'")?t:"'"+t+"'"})).join(",")}),o.nodeChanged()},FontSize:function(e,n,r){var o;(o=t).formatter.toggle("fontsize",{value:$w(o,r)}),o.nodeChanged()},LineHeight:function(e,n,r){var o;(o=t).formatter.toggle("lineheight",{value:String(r)}),o.nodeChanged()},Lang:function(t,n,r){e.toggleFormat(t,{value:r.code,customValue:r.customCode})},RemoveFormat:function(e){t.formatter.remove(e)},mceBlockQuote:function(){e.toggleFormat("blockquote")},FormatBlock:function(t,n,r){return e.toggleFormat(r||"p")},mceCleanup:function(){var e=t.selection.getBookmark();t.setContent(t.getContent()),t.selection.moveToBookmark(e)},mceRemoveNode:function(n,r,o){var i=o||t.selection.getNode();i!==t.getBody()&&(e.storeSelection(),t.dom.remove(i,!0),e.restoreSelection())},mceSelectNodeDepth:function(e,n,r){var o=0;t.dom.getParent(t.selection.getNode(),(function(e){if(1===e.nodeType&&o++===r)return t.selection.select(e),!1}),t.getBody())},mceSelectNode:function(e,n,r){t.selection.select(r)},mceInsertContent:function(e,n,r){var o,i,a,u;o=t,i=function(t){if("string"==typeof t)return{content:t,details:{}};var e=ke.extend({paste:t.paste,data:{paste:t.paste}},t);return{content:t.content,details:e}}(r),a=i.content,u=i.details,ep(o).editor.insertContent(a,u)},mceInsertRawHTML:function(e,n,r){t.selection.setContent("tiny_mce_marker");var o=t.getContent();t.setContent(o.replace(/tiny_mce_marker/g,(function(){return r})))},mceInsertNewLine:function(e,n,r){Qx(t,r)},mceToggleFormat:function(t,n,r){e.toggleFormat(r)},mceSetContent:function(e,n,r){t.setContent(r)},"Indent,Outdent":function(e){$y(t,e)},mceRepaint:c,InsertHorizontalRule:function(){t.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){t.hasVisual=!t.hasVisual,t.addVisual()},mceReplaceContent:function(e,n,r){t.execCommand("mceInsertContent",!1,r.replace(/\{\$selection\}/g,t.selection.getContent({format:"text"})))},mceInsertLink:function(e,n,r){"string"==typeof r&&(r={href:r});var o=t.dom.getParent(t.selection.getNode(),"a");r.href=r.href.replace(/ /g,"%20"),o&&r.href||t.formatter.remove("link"),r.href&&t.formatter.apply("link",r,o)},selectAll:function(){var e,n=t.dom.getParent(t.selection.getStart(),$n);n&&((e=t.dom.createRng()).selectNodeContents(n),t.selection.setRng(e))},mceNewDocument:function(){t.setContent("")},InsertLineBreak:function(e,n,r){return Fx(t,r),!0}}),e.addCommands({JustifyLeft:n("alignleft"),JustifyCenter:n("aligncenter"),JustifyRight:n("alignright"),JustifyFull:n("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(t){return e.isFormatMatch(t)},mceBlockQuote:function(){return e.isFormatMatch("blockquote")},Outdent:function(){return qy(t)},"InsertUnorderedList,InsertOrderedList":function(e){var n=t.dom.getParent(t.selection.getNode(),"ul,ol");return n&&("insertunorderedlist"===e&&"UL"===n.tagName||"insertorderedlist"===e&&"OL"===n.tagName)}},"state"),e.addCommands({Undo:function(){t.undoManager.undo()},Redo:function(){t.undoManager.redo()}}),e.addQueryValueHandler("FontName",(function(){return Gw(e=t,(function(t){return aC(e.getBody(),t.dom)})).getOr("");var e}),this),e.addQueryValueHandler("FontSize",(function(){return Gw(e=t,(function(t){return iC(e.getBody(),t.dom)})).getOr("");var e}),this),e.addQueryValueHandler("LineHeight",(function(){return Gw(e=t,(function(t){var n=Oe.fromDom(e.getBody());return yg(t,(function(t){return wn(t,"line-height")}),O(Ut,n)).getOrThunk((function(){var e=parseFloat(xn(t,"line-height")),n=parseFloat(xn(t,"font-size"));return String(e/n)}))})).getOr("");var e}),this)},fC);function fC(t){this.commands={state:{},exec:{},value:{}},this.editor=t,this.setupCommands(t)}function dC(t,e,n){try{t.getDoc().execCommand(e,!1,String(n))}catch(t){}}function mC(t,e){t.dom.contentEditable=e?"true":"false"}function gC(t,e){var n,r,o=Oe.fromDom(t.getBody());(function(t,e,n){var r,o,i,a,u,c;hu(t,e)&&!1===n?(o=e,mu(r=t)?r.dom.classList.remove(o):(u=o,0<(c=P(du(a=r,"class"),(function(t){return t!==u}))).length?hn(a,"class",c.join(" ")):yn(a,"class")),0===(mu(i=r)?i.dom.classList:du(i,"class")).length&&yn(i,"class")):n&&gu(t,e)})(o,"mce-content-readonly",e),e?(t.selection.controlSelection.hideResizeRect(),t._selectionOverrides.hideFakeCaret(),vt.from(t.selection.getNode()).each((function(t){t.removeAttribute("data-mce-selected")})),mC(o,!(t.readonly=!0)),I(pu(o,'*[contenteditable="true"]'),(function(t){hn(t,vC,"true"),mC(t,!1)}))):(mC(o,!(t.readonly=!1)),I(pu(o,"*["+vC+'="true"]'),(function(t){yn(t,vC),mC(t,!0)})),dC(t,"StyleWithCSS",!1),dC(t,"enableInlineTableEditing",!1),dC(t,"enableObjectResizing",!1),(md(n=t)||(r=n,Qf(An(Oe.fromDom(r.getElement()))).filter((function(t){return!(void 0!==(e=t.dom.classList)&&(e.contains("tox-edit-area")||e.contains("tox-edit-area__iframe")||e.contains("mce-content-body")))&&cd(r,t.dom);var e})).isSome()))&&t.focus(),t.selection.setRng(t.selection.getRng()),t.nodeChanged())}function hC(t){return t.readonly}function pC(t){t.parser.addAttributeFilter("contenteditable",(function(e){hC(t)&&I(e,(function(t){t.attr(vC,t.attr("contenteditable")),t.attr("contenteditable","false")}))})),t.serializer.addAttributeFilter(vC,(function(e){hC(t)&&I(e,(function(t){t.attr("contenteditable",t.attr(vC))}))})),t.serializer.addTempAttr(vC)}var vC="data-mce-contenteditable",bC=ke.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"," "),yC=(xC.isNative=function(t){return!!bC[t.toLowerCase()]},xC.prototype.fire=function(t,e){var n=t.toLowerCase(),r=io(n,e||{},this.scope);this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i<a;i++){var u=o[i];if(!u.removed){if(u.once&&this.off(n,u.func),r.isImmediatePropagationStopped())return r;if(!1===u.func.call(this.scope,r))return r.preventDefault(),r}}return r},xC.prototype.on=function(t,e,n,r){if(e=!1===e?D:e){var o={func:e,removed:!1};r&&ke.extend(o,r);for(var i=t.toLowerCase().split(" "),a=i.length;a--;){var u=i[a],c=this.bindings[u];c||(c=[],this.toggleEvent(u,!0)),c=n?Tt([o],c,!0):Tt(Tt([],c,!0),[o],!1),this.bindings[u]=c}}return this},xC.prototype.off=function(t,e){var n=this;if(t)for(var r=t.toLowerCase().split(" "),o=r.length;o--;){var i,a=r[o],u=this.bindings[a];if(!a)return nt(this.bindings,(function(t,e){n.toggleEvent(e,!1),delete n.bindings[e]})),this;u&&(e?(u=(i=F(u,(function(t){return t.func===e}))).fail,this.bindings[a]=u,I(i.pass,(function(t){t.removed=!0}))):u.length=0,u.length||(this.toggleEvent(t,!1),delete this.bindings[a]))}else nt(this.bindings,(function(t,e){n.toggleEvent(e,!1)})),this.bindings={};return this},xC.prototype.once=function(t,e,n){return this.on(t,e,n,{once:!0})},xC.prototype.has=function(t){return t=t.toLowerCase(),!(!this.bindings[t]||0===this.bindings[t].length)},xC);function xC(t){this.bindings={},this.settings=t||{},this.scope=this.settings.scope||this,this.toggleEvent=this.settings.toggleEvent||D}function wC(t){return t._eventDispatcher||(t._eventDispatcher=new yC({scope:t,toggleEvent:function(e,n){yC.isNative(e)&&t.toggleNativeEvent&&t.toggleNativeEvent(e,n)}})),t._eventDispatcher}function CC(t,e){if("selectionchange"===e)return t.getDoc();if(!t.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(e))return t.getDoc().documentElement;var n=zc(t);return n?(t.eventRoot||(t.eventRoot=MC.select(n)[0]),t.eventRoot):t.getBody()}function SC(t,e,n){var r,o,i,a;t.hidden||hC(t)?hC(t)&&(r=t,"click"!==(o=n).type||Df.metaKeyPressed(o)||(i=Oe.fromDom(o.target),a=r,vr(i,"a",(function(t){return Ut(t,Oe.fromDom(a.getBody()))})).bind((function(t){return bn(t,"href")})).each((function(t){var e,n;o.preventDefault(),/^#/.test(t)?(e=r.dom.select(t+',[name="'+(Yt(n=t,"#")?n.substring("#".length):n)+'"]')).length&&r.selection.scrollIntoView(e[0],!0):window.open(t,"_blank","rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes")})))):t.fire(e,n)}function kC(t,e){var n,r;t.delegates||(t.delegates={}),t.delegates[e]||t.removed||(r=CC(t,e),zc(t)?(_C||(_C={},t.editorManager.on("removeEditor",(function(){t.editorManager.activeEditor||_C&&(nt(_C,(function(e,n){t.dom.unbind(CC(t,n))})),_C=null)}))),_C[e]||(_C[e]=n=function(n){for(var r=n.target,o=t.editorManager.get(),i=o.length;i--;){var a=o[i].getBody();a!==r&&!MC.isChildOf(r,a)||SC(o[i],e,n)}},MC.bind(r,e,n))):(MC.bind(r,e,n=function(n){SC(t,e,n)}),t.delegates[e]=n))}function OC(t,e,n,r){var o=n[e.get()],i=n[r];try{i.activate()}catch(t){return void console.error("problem while activating editor mode "+r+":",t)}o.deactivate(),o.editorReadOnly!==i.editorReadOnly&&gC(t,i.editorReadOnly),e.set(r),t.fire("SwitchMode",{mode:r})}function EC(t){var e,n={};AC(NC(t.toLowerCase(),"+"),(function(t){t in RC?n[t]=!0:/^[0-9]{2,}$/.test(t)?n.keyCode=parseInt(t,10):(n.charCode=t.charCodeAt(0),n.keyCode=BC[t]||t.toUpperCase().charCodeAt(0))}));var r=[n.keyCode];for(e in RC)n[e]?r.push(e):n[e]=!1;return n.id=r.join(","),n.access&&(n.alt=!0,we.mac?n.ctrl=!0:n.shift=!0),n.meta&&(we.mac?n.meta=!0:(n.ctrl=!0,n.meta=!1)),n}var _C,TC={fire:function(t,e,n){if(this.removed&&"remove"!==t&&"detach"!==t)return e;var r=wC(this).fire(t,e);if(!1!==n&&this.parent)for(var o=this.parent();o&&!r.isPropagationStopped();)o.fire(t,r,!1),o=o.parent();return r},on:function(t,e,n){return wC(this).on(t,e,n)},off:function(t,e){return wC(this).off(t,e)},once:function(t,e){return wC(this).once(t,e)},hasEventListeners:function(t){return wC(this).has(t)}},MC=Ja.DOM,DC=_t(_t({},TC),{bindPendingEventDelegates:function(){var t=this;ke.each(t._pendingNativeEvents,(function(e){kC(t,e)}))},toggleNativeEvent:function(t,e){var n=this;"focus"!==t&&"blur"!==t&&(n.removed||(e?n.initialized?kC(n,t):n._pendingNativeEvents?n._pendingNativeEvents.push(t):n._pendingNativeEvents=[t]:n.initialized&&(n.dom.unbind(CC(n,t),t,n.delegates[t]),delete n.delegates[t])))},unbindAllNativeEvents:function(){var t=this,e=t.getBody(),n=t.dom;t.delegates&&(nt(t.delegates,(function(e,n){t.dom.unbind(CC(t,n),n,e)})),delete t.delegates),!t.inline&&e&&n&&(e.onload=null,n.unbind(t.getWin()),n.unbind(t.getDoc())),n&&(n.unbind(e),n.unbind(t.getContainer()))}}),zC=["design","readonly"],AC=ke.each,NC=ke.explode,BC={f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},RC=ke.makeMap("alt,ctrl,shift,meta,access"),HC=(VC.prototype.add=function(t,e,n,r){var o=this,i=o.normalizeCommandFunc(n);return AC(NC(ke.trim(t)),(function(t){var n=o.createShortcut(t,e,i,r);o.shortcuts[n.id]=n})),!0},VC.prototype.remove=function(t){var e=this.createShortcut(t);return!!this.shortcuts[e.id]&&(delete this.shortcuts[e.id],!0)},VC.prototype.normalizeCommandFunc=function(t){var e=this,n=t;return"string"==typeof n?function(){e.editor.execCommand(n,!1,null)}:ke.isArray(n)?function(){e.editor.execCommand(n[0],n[1],n[2])}:n},VC.prototype.createShortcut=function(t,e,n,r){var o=ke.map(NC(t,">"),EC);return o[o.length-1]=ke.extend(o[o.length-1],{func:n,scope:r||this.editor}),ke.extend(o[0],{desc:this.editor.translate(e),subpatterns:o.slice(1)})},VC.prototype.hasModifier=function(t){return t.altKey||t.ctrlKey||t.metaKey},VC.prototype.isFunctionKey=function(t){return"keydown"===t.type&&112<=t.keyCode&&t.keyCode<=123},VC.prototype.matchShortcut=function(t,e){return!!e&&e.ctrl===t.ctrlKey&&e.meta===t.metaKey&&e.alt===t.altKey&&e.shift===t.shiftKey&&!!(t.keyCode===e.keyCode||t.charCode&&t.charCode===e.charCode)&&(t.preventDefault(),!0)},VC.prototype.executeShortcutAction=function(t){return t.func?t.func.call(t.scope):null},VC);function VC(t){this.shortcuts={},this.pendingPatterns=[],this.editor=t;var e=this;t.on("keyup keypress keydown",(function(t){!e.hasModifier(t)&&!e.isFunctionKey(t)||t.isDefaultPrevented()||(AC(e.shortcuts,(function(n){if(e.matchShortcut(t,n))return e.pendingPatterns=n.subpatterns.slice(0),"keydown"===t.type&&e.executeShortcutAction(n),!0})),e.matchShortcut(t,e.pendingPatterns[0])&&(1===e.pendingPatterns.length&&"keydown"===t.type&&e.executeShortcutAction(e.pendingPatterns[0]),e.pendingPatterns.shift()))}))}var IC=Ja.DOM,LC=ke.extend,FC=ke.each,PC=ke.resolve,UC=we.ie,jC=(WC.prototype.render=function(){!function(t){var e=t.id;uu.setCode(_c(t));var n,r,o,i,a=function(){rC.unbind(window,"ready",a),t.render()};ai.Event.domLoaded?t.getElement()&&we.contentEditable&&(n=Oe.fromDom(t.getElement()),r=j(n.dom.attributes,(function(t,e){return t[e.name]=e.value,t}),{}),t.on("remove",(function(){L(n.dom.attributes,(function(t){return yn(n,t.name),0})),pn(n,r)})),t.ui.styleSheetLoader=Er.forElement(n,{contentCssCors:(o=t).getParam("content_css_cors"),referrerPolicy:Ec(o)}),t.getParam("inline")?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden"),(i=t.getElement().form||rC.getParent(e,"form"))&&(t.formElement=i,t.getParam("hidden_input")&&!Fn(t.getElement())&&(rC.insertAfter(rC.create("input",{type:"hidden",name:e}),e),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},rC.bind(i,"submit reset",t.formEventDelegate),t.on("reset",(function(){t.resetContent()})),!t.getParam("submit_patch")||i.submit.nodeType||i.submit.length||i._mceOldSubmit||(i._mceOldSubmit=i.submit,i.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),i._mceOldSubmit(i)})),t.windowManager=mv(t),t.notificationManager=Fp(t),"xml"===t.getParam("encoding")&&t.on("GetContent",(function(t){t.save&&(t.content=rC.encode(t.content))})),t.getParam("add_form_submit_trigger")&&t.on("submit",(function(){t.initialized&&t.save()})),t.getParam("add_unload_trigger")&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),function(t,e){var n,r,o=eu.ScriptLoader,i=o,a=e,u=function(){var n,r,i,a,u,s,l,f,d;u=o,f=_c(s=t),d=s.getParam("language_url","","string"),!1===uu.hasCode(f)&&"en"!==f&&(l=""!==d?d:s.editorManager.baseURL+"/langs/"+f+".js",u.add(l,c,void 0,(function(){pv(s,"LanguageLoadError",vv("language",l,f))}))),i=o,I(function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e}([jw(a=t,"default",e),vt.from(a.getParam("icons_url","","string")).filter((function(t){return 0<t.length})).map((function(t){return{url:t,name:vt.none()}})).orThunk((function(){return jw(a,Oc(a),"")}))]),(function(t){i.add(t.url,c,void 0,(function(){pv(a,"IconsLoadError",vv("icons",t.url,t.name.getOrUndefined()))}))})),n=t,r=e,ke.each(n.getParam("external_plugins"),(function(t,e){fv.load(e,t,c,void 0,(function(){bv(n,t,e)})),n.settings.plugins+=" "+e})),ke.each(Bc(n).split(/[ ,]/),(function(t){var e,o;(t=ke.trim(t))&&!fv.urls[t]&&(Uw(t)?(t=t.substr(1,t.length),e=fv.dependencies(t),ke.each(e,(function(t){var e=fv.createUrl({prefix:"plugins/",resource:t,suffix:"/plugin"+r+".js"},t);fv.load(e.resource,e,c,void 0,(function(){bv(n,e.prefix+e.resource+e.suffix,e.resource)}))}))):(o={prefix:"plugins/",resource:t,suffix:"/plugin"+r+".js"},fv.load(t,o,c,void 0,(function(){bv(n,o.prefix+o.resource+o.suffix,t)}))))})),o.loadQueue((function(){t.removed||Pw(t)}),t,(function(){t.removed||Pw(t)}))},s=Ac(n=t);v(s)?(Uw(s)||Ot(dv.urls,s)||((r=n.getParam("theme_url"))?dv.load(s,n.documentBaseURI.toAbsolute(r)):dv.load(s,"themes/"+s+"/theme"+a+".js")),i.loadQueue((function(){dv.waitFor(s,u)}))):u()}(t,t.suffix)):rC.bind(window,"ready",a)}(this)},WC.prototype.focus=function(t){this.execCommand("mceFocus",!1,t)},WC.prototype.hasFocus=function(){return md(this)},WC.prototype.execCallback=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o=this.settings[t];if(o)return this.callbackLookup&&(r=this.callbackLookup[t])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?PC(r):0,o=PC(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[t]={func:o,scope:r}),o.apply(r||this,e)},WC.prototype.translate=function(t){return uu.translate(t)},WC.prototype.getParam=function(t,e,n){return i=e,a=n,l=(o=t)in(r=this).settings?r.settings[o]:i,"hash"===a?(s={},"string"==typeof(c=l)?I(0<c.indexOf("=")?c.split(/[;,](?![^=;,]*(?:[;,]|$))/):c.split(","),(function(t){var e=t.split("=");1<e.length?s[ke.trim(e[0])]=ke.trim(e[1]):s[ke.trim(e[0])]=ke.trim(e[0])})):s=c,s):"string"===a?Hp(v,r,o).getOr(i):"number"===a?Hp(k,r,o).getOr(i):"boolean"===a?Hp(w,r,o).getOr(i):"object"===a?Hp(b,r,o).getOr(i):"array"===a?Hp(y,r,o).getOr(i):"string[]"===a?Hp((u=v,function(t){return y(t)&&X(t,u)}),r,o).getOr(i):"function"===a?Hp(S,r,o).getOr(i):l;var r,o,i,a,u,c,s,l},WC.prototype.hasPlugin=function(t,e){return!(!R(Bc(this).split(/[ ,]/),t)||e&&void 0===fv.get(t))},WC.prototype.nodeChanged=function(t){this._nodeChangeDispatcher.nodeChanged(t)},WC.prototype.addCommand=function(t,e,n){this.editorCommands.addCommand(t,e,n)},WC.prototype.addQueryStateHandler=function(t,e,n){this.editorCommands.addQueryStateHandler(t,e,n)},WC.prototype.addQueryValueHandler=function(t,e,n){this.editorCommands.addQueryValueHandler(t,e,n)},WC.prototype.addShortcut=function(t,e,n,r){this.shortcuts.add(t,e,n,r)},WC.prototype.execCommand=function(t,e,n,r){return this.editorCommands.execCommand(t,e,n,r)},WC.prototype.queryCommandState=function(t){return this.editorCommands.queryCommandState(t)},WC.prototype.queryCommandValue=function(t){return this.editorCommands.queryCommandValue(t)},WC.prototype.queryCommandSupported=function(t){return this.editorCommands.queryCommandSupported(t)},WC.prototype.show=function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable="true":(IC.show(this.getContainer()),IC.hide(this.id)),this.load(),this.fire("show"))},WC.prototype.hide=function(){var t=this,e=t.getDoc();t.hidden||(UC&&e&&!t.inline&&e.execCommand("SelectAll"),t.save(),t.inline?(t.getBody().contentEditable="false",t===t.editorManager.focusedEditor&&(t.editorManager.focusedEditor=null)):(IC.hide(t.getContainer()),IC.setStyle(t.id,"display",t.orgDisplay)),t.hidden=!0,t.fire("hide"))},WC.prototype.isHidden=function(){return!!this.hidden},WC.prototype.setProgressState=function(t,e){this.fire("ProgressState",{state:t,time:e})},WC.prototype.load=function(t){var e=this.getElement();if(this.removed)return"";if(e){(t=t||{}).load=!0;var n=Fn(e)?e.value:e.innerHTML,r=this.setContent(n,t);return t.element=e,t.no_events||this.fire("LoadContent",t),t.element=e=null,r}},WC.prototype.save=function(t){var e,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(t=t||{}).save=!0,t.element=o,t.content=r.getContent(t),t.no_events||r.fire("SaveContent",t),"raw"===t.format&&r.fire("RawSaveContent",t),e=t.content,Fn(o)?o.value=e:(!t.is_removing&&r.inline||(o.innerHTML=e),(n=IC.getParent(r.id,"form"))&&FC(n.elements,(function(t){if(t.name===r.id)return t.value=e,!1}))),t.element=o=null,!1!==t.set_dirty&&r.setDirty(!1),e},WC.prototype.setContent=function(t,e){return Dp(this,t,e)},WC.prototype.getContent=function(t){return this,n=(e=void 0===(e=t)?{}:e).format||"html",r=e,ep(this).editor.getContent(r,n);var e,n,r},WC.prototype.insertContent=function(t,e){e&&(t=LC({content:t},e)),this.execCommand("mceInsertContent",!1,t)},WC.prototype.resetContent=function(t){void 0===t?Dp(this,this.startContent,{format:"raw"}):Dp(this,t),this.undoManager.reset(),this.setDirty(!1),this.nodeChanged()},WC.prototype.isDirty=function(){return!this.isNotDirty},WC.prototype.setDirty=function(t){var e=!this.isNotDirty;this.isNotDirty=!t,t&&t!==e&&this.fire("dirty")},WC.prototype.getContainer=function(){return this.container||(this.container=IC.get(this.editorContainer||this.id+"_parent")),this.container},WC.prototype.getContentAreaContainer=function(){return this.contentAreaContainer},WC.prototype.getElement=function(){return this.targetElm||(this.targetElm=IC.get(this.id)),this.targetElm},WC.prototype.getWin=function(){var t;return this.contentWindow||(t=this.iframeElement)&&(this.contentWindow=t.contentWindow),this.contentWindow},WC.prototype.getDoc=function(){var t;return this.contentDocument||(t=this.getWin())&&(this.contentDocument=t.document),this.contentDocument},WC.prototype.getBody=function(){var t=this.getDoc();return this.bodyElement||(t?t.body:null)},WC.prototype.convertURL=function(t,e,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",t,n,!0,e):!r.convert_urls||n&&"LINK"===n.nodeName||0===t.indexOf("file:")||0===t.length?t:r.relative_urls?this.documentBaseURI.toRelative(t):this.documentBaseURI.toAbsolute(t,r.remove_script_host)},WC.prototype.addVisual=function(t){var e;e=t,np(this).editor.addVisual(e)},WC.prototype.remove=function(){var t,e,n,r,o;(t=this).removed||(e=t._selectionOverrides,n=t.editorUpload,r=t.getBody(),o=t.getElement(),r&&t.save({is_removing:!0}),t.removed=!0,t.unbindAllNativeEvents(),t.hasHiddenInput&&o&&Kp.remove(o.nextSibling),t.fire("remove"),t.editorManager.remove(t),!t.inline&&r&&Kp.setStyle(t.id,"display",t.orgDisplay),t.fire("detach"),Kp.remove(t.getContainer()),zp(e),zp(n),t.destroy())},WC.prototype.destroy=function(t){var e,n,r,o,i,a,u;n=t,a=(e=this).selection,u=e.dom,e.destroyed||(n||e.removed?(n||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),zp(a),zp(u)),(o=(r=e).formElement)&&(o._mceOldSubmit&&(o.submit=o._mceOldSubmit,o._mceOldSubmit=null),Kp.unbind(o,"submit reset",r.formEventDelegate)),(i=e).contentAreaContainer=i.formElement=i.container=i.editorContainer=null,i.bodyElement=i.contentDocument=i.contentWindow=null,i.iframeElement=i.targetElm=null,i.selection&&(i.selection=i.selection.win=i.selection.dom=i.selection.dom.doc=null),e.destroyed=!0):e.remove())},WC.prototype.uploadImages=function(t){return this.editorUpload.uploadImages(t)},WC.prototype._scanForImages=function(){return this.editorUpload.scanForImages()},WC.prototype.addButton=function(){throw new Error("editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead")},WC.prototype.addSidebar=function(){throw new Error("editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead")},WC.prototype.addMenuItem=function(){throw new Error("editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead")},WC.prototype.addContextToolbar=function(){throw new Error("editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead")},WC);function WC(t,e,n){var r,o,i,a,u,s,l,f,d,m,g,h,p,v,b,y,x=this;function w(t,e){return function(n,r){return t[n.toLowerCase()]=_t(_t({},r),{type:e})}}this.plugins={},this.contentCSS=[],this.contentStyles=[],this.loadedCSS={},this.isNotDirty=!1,this.editorManager=n,this.documentBaseUrl=n.documentBaseURL,LC(this,DC),this.settings=(d=this.documentBaseUrl,m=n.defaultSettings,h=d,p=ev,this,v={id:t,theme:"silver",toolbar_mode:Bp(g=e,"floating"),plugins:"",document_base_url:h,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"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,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"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,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:this.convertURL,url_converter_scope:this},b=_t(_t({},v),p?iv:{}),!1!==(y=Rp(nv||rv,nv,b,m,g)).deprecation_warnings&&function(t,e){var n,r,o,i,a,u,c,s=(n=t,r=P(Jp,(function(t){return Ot(n,t)})),!1!==(o=n.forced_root_block)&&""!==o||r.push("forced_root_block (false only)"),J(r)),l=(c=ke.makeMap(e.plugins," "),J(Tt(Tt([],P(Qp,g),!0),$(Zp,(function(t){return g(t)?[t+" (moving to premium)"]:[]})),!0))),f=0<l.length,d=0<s.length,m="mobile"===e.theme;function g(t){return Ot(c,t)}(f||d||m)&&(i=m?"\n\nThemes:\n- mobile":"",a=f?"\n\nPlugins:\n- "+l.join("\n- "):"",u=d?"\n\nSettings:\n- "+s.join("\n- "):"",console.warn("The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information."+i+a+u))}(g,y),y),this.settings.suffix&&(n.suffix=this.settings.suffix),this.suffix=n.suffix,this.settings.base_url&&n._setBaseUrl(this.settings.base_url),this.baseUri=n.baseURI,this.settings.referrer_policy&&(eu.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy),Ja.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy)),cu.languageLoad=this.settings.language_load,cu.baseURL=n.baseURL,this.id=t,this.setDirty(!1),this.documentBaseURI=new jd(this.settings.document_base_url,{base_uri:this.baseUri}),this.baseURI=this.baseUri,this.inline=!!this.settings.inline,this.shortcuts=new HC(this),this.editorCommands=new lC(this),this.settings.cache_suffix&&(we.cacheSuffix=this.settings.cache_suffix.replace(/^[\?\&]+/,"")),this.ui={registry:{addAutocompleter:(u={},(r={addButton:w(o={},"button"),addGroupToolbarButton:w(o,"grouptoolbarbutton"),addToggleButton:w(o,"togglebutton"),addMenuButton:w(o,"menubutton"),addSplitButton:w(o,"splitbutton"),addMenuItem:w(i={},"menuitem"),addNestedMenuItem:w(i,"nestedmenuitem"),addToggleMenuItem:w(i,"togglemenuitem"),addAutocompleter:w(a={},"autocompleter"),addContextMenu:w(s={},"contextmenu"),addContextToolbar:w(l={},"contexttoolbar"),addContextForm:w(l,"contextform"),addSidebar:w(f={},"sidebar"),addIcon:function(t,e){return u[t.toLowerCase()]=e},getAll:function(){return{buttons:o,menuItems:i,icons:u,popups:a,contextMenus:s,contextToolbars:l,sidebars:f}}}).addAutocompleter),addButton:r.addButton,addContextForm:r.addContextForm,addContextMenu:r.addContextMenu,addContextToolbar:r.addContextToolbar,addIcon:r.addIcon,addMenuButton:r.addMenuButton,addMenuItem:r.addMenuItem,addNestedMenuItem:r.addNestedMenuItem,addSidebar:r.addSidebar,addSplitButton:r.addSplitButton,addToggleButton:r.addToggleButton,addGroupToolbarButton:r.addGroupToolbarButton,addToggleMenuItem:r.addToggleMenuItem,getAll:r.getAll},styleSheetLoader:void 0,show:c,hide:c,enable:c,disable:c,isDisabled:D};var C,S,k,O,E,_=(O=ru("design"),E=ru({design:{activate:c,deactivate:c,editorReadOnly:!1},readonly:{activate:c,deactivate:c,editorReadOnly:!0}}),(S=C=this).serializer?pC(S):S.on("PreInit",(function(){pC(S)})),(k=C).on("ShowCaret",(function(t){hC(k)&&t.preventDefault()})),k.on("ObjectSelected",(function(t){hC(k)&&t.preventDefault()})),{isReadOnly:function(){return hC(C)},set:function(t){return function(t,e,n,r){if(r!==n.get()){if(!Ot(e,r))throw new Error("Editor mode '"+r+"' is invalid");t.initialized?OC(t,n,e,r):t.on("init",(function(){return OC(t,n,e,r)}))}}(C,E.get(),O,t)},get:function(){return O.get()},register:function(t,e){E.set(function(t,e,n){var r;if(R(zC,e))throw new Error("Cannot override default mode "+e);return _t(_t({},t),((r={})[e]=_t(_t({},n),{deactivate:function(){try{n.deactivate()}catch(t){console.error("problem while deactivating editor mode "+e+":",t)}}}),r))}(E.get(),t,e))}});this.mode=_,this.setMode=_.set,n.fire("SetupEditor",{editor:this}),this.execCallback("setup",this),this.$=Ga.overrideDefaults((function(){return{context:x.inline?x.getBody():x.getDoc(),element:x.getBody()}}))}function qC(t){var e=t.type;JC(oS.get(),(function(n){switch(e){case"scroll":n.fire("ScrollWindow",t);break;case"resize":n.fire("ResizeWindow",t)}}))}function GC(t){t!==tS&&(t?Ga(window).on("resize scroll",qC):Ga(window).off("resize scroll",qC),tS=t)}function $C(t){var e=nS;delete eS[t.id];for(var n=0;n<eS.length;n++)if(eS[n]===t){eS.splice(n,1);break}return nS=P(nS,(function(e){return t!==e})),oS.activeEditor===t&&(oS.activeEditor=0<nS.length?nS[0]:null),oS.focusedEditor===t&&(oS.focusedEditor=null),e.length!==nS.length}var XC,KC=Ja.DOM,YC=ke.explode,JC=ke.each,QC=ke.extend,ZC=0,tS=!1,eS=[],nS=[],rS="CSS1Compat"!==document.compatMode,oS=_t(_t({},TC),{baseURI:null,baseURL:null,defaultSettings:{},documentBaseURL:null,suffix:null,$:Ga,majorVersion:"5",minorVersion:"10.7",releaseDate:"2022-12-06",editors:eS,i18n:uu,activeEditor:null,focusedEditor:null,settings:{},setup:function(){var t,e="",n=jd.getDocumentBaseUrl(document.location);/^[^:]+:\/\/\/?[^\/]+\//.test(n)&&(n=n.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"));var r=window.tinymce||window.tinyMCEPreInit;if(r)t=r.base||r.baseURL,e=r.suffix;else{for(var o,i=document.getElementsByTagName("script"),a=0;a<i.length;a++)if(""!==(o=i[a].src||"")){var u=o.substring(o.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(o)){-1!==u.indexOf(".min")&&(e=".min"),t=o.substring(0,o.lastIndexOf("/"));break}}!t&&document.currentScript&&(-1!==(o=document.currentScript.src).indexOf(".min")&&(e=".min"),t=o.substring(0,o.lastIndexOf("/")))}this.baseURL=new jd(n).toAbsolute(t),this.documentBaseURL=n,this.baseURI=new jd(this.baseURL),this.suffix=e,this.on("AddEditor",O(sd,this)),this.on("RemoveEditor",O(ld,this))},overrideDefaults:function(t){var e=t.base_url;e&&this._setBaseUrl(e);var n=t.suffix;t.suffix&&(this.suffix=n);var r=(this.defaultSettings=t).plugin_base_urls;void 0!==r&&nt(r,(function(t,e){cu.PluginManager.urls[e]=t}))},init:function(t){function e(t){var e=t.id;return e||(e=ut(t,"name").filter((function(t){return!KC.get(t)})).getOrThunk(KC.uniqueId),t.setAttribute("id",e)),e}function n(t,e){return e.constructor===RegExp?e.test(t.className):KC.hasClass(t,e)}var r,o=this,i=ke.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"," "),a=function(t){r=t},u=function(){function r(t,e,n){var r=new jC(t,e,o);f.push(r),r.on("init",(function(){++l===c.length&&a(f)})),r.targetElm=r.targetElm||n,r.render()}var c,s,l=0,f=[];KC.unbind(window,"ready",u),(s=t.onpageload)&&s.apply(o,[]),c=Ga.unique(function(t){var e=[];if(we.browser.isIE()&&we.browser.version.major<11)return Hb("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(rS)return Hb("Failed to initialize the editor as the document is not in standards mode. TinyMCE requires standards mode."),[];if(t.types)return JC(t.types,(function(t){e=e.concat(KC.select(t.selector))})),e;if(t.selector)return KC.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":var r=t.elements||"";0<r.length&&JC(YC(r),(function(t){var n=KC.get(t);n?e.push(n):JC(document.forms,(function(n){JC(n.elements,(function(n){n.name===t&&(t="mce_editor_"+ZC++,KC.setAttrib(n,"id",t),e.push(n))}))}))}));break;case"textareas":case"specific_textareas":JC(KC.select("textarea"),(function(r){t.editor_deselector&&n(r,t.editor_deselector)||t.editor_selector&&!n(r,t.editor_selector)||e.push(r)}))}return e}(t)),t.types?JC(t.types,(function(n){ke.each(c,(function(o){return!KC.is(o,n.selector)||(r(e(o),QC({},t,n),o),!1)}))})):(ke.each(c,(function(t){var e;(e=o.get(t.id))&&e.initialized&&!(e.getContainer()||e.getBody()).parentNode&&($C(e),e.unbindAllNativeEvents(),e.destroy(!0),e.removed=!0)})),0===(c=ke.grep(c,(function(t){return!o.get(t.id)}))).length?a([]):JC(c,(function(n){var o=n;t.inline&&o.tagName.toLowerCase()in i?Hb("Could not initialize inline editor on invalid inline target element",n):r(e(n),t,n)})))};return o.settings=t,KC.bind(window,"ready",u),new kr((function(t){r?t(r):a=function(e){t(e)}}))},get:function(t){return 0===arguments.length?nS.slice(0):v(t)?q(nS,(function(e){return e.id===t})).getOr(null):k(t)&&nS[t]||null},add:function(t){var e=this;return eS[t.id]===t||(null===e.get(t.id)&&("length"!==t.id&&(eS[t.id]=t),eS.push(t),nS.push(t)),GC(!0),e.activeEditor=t,e.fire("AddEditor",{editor:t}),XC||(XC=function(t){var n=e.fire("BeforeUnload");if(n.returnValue)return t.preventDefault(),t.returnValue=n.returnValue,n.returnValue},window.addEventListener("beforeunload",XC))),t},createEditor:function(t,e){return this.add(new jC(t,e,this))},remove:function(t){var e,n,r=this;if(t){if(!v(t))return n=t,x(r.get(n.id))?null:($C(n)&&r.fire("RemoveEditor",{editor:n}),0===nS.length&&window.removeEventListener("beforeunload",XC),n.remove(),GC(0<nS.length),n);JC(KC.select(t),(function(t){(n=r.get(t.id))&&r.remove(n)}))}else for(e=nS.length-1;0<=e;e--)r.remove(nS[e])},execCommand:function(t,e,n){var r=this.get(n);switch(t){case"mceAddEditor":return this.get(n)||new jC(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",!1,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(t,e,n)},triggerSave:function(){JC(nS,(function(t){t.save()}))},addI18n:function(t,e){uu.add(t,e)},translate:function(t){return uu.translate(t)},setActive:function(t){var e=this.activeEditor;this.activeEditor!==t&&(e&&e.fire("deactivate",{relatedTarget:t}),t.fire("activate",{relatedTarget:e})),this.activeEditor=t},_setBaseUrl:function(t){this.baseURL=new jd(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new jd(this.baseURL)}});function iS(t,e,n){var r=e.x,o=e.y,i=t.w,a=t.h,u=e.w,c=e.h,s=(n||"").split("");return"b"===s[0]&&(o+=c),"r"===s[1]&&(r+=u),"c"===s[0]&&(o+=gS(c/2)),"c"===s[1]&&(r+=gS(u/2)),"b"===s[3]&&(o-=a),"r"===s[4]&&(r-=i),"c"===s[3]&&(o-=gS(a/2)),"c"===s[4]&&(r-=gS(i/2)),uS(r,o,i,a)}function aS(){}function uS(t,e,n,r){return{x:t,y:e,w:n,h:r}}oS.setup();var cS,sS,lS,fS,dS=Math.min,mS=Math.max,gS=Math.round,hS={inflate:function(t,e,n){return uS(t.x-e,t.y-n,t.w+2*e,t.h+2*n)},relativePosition:iS,findBestRelativePosition:function(t,e,n,r){for(var o,i=0;i<r.length;i++)if((o=iS(t,e,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(t,e){var n=mS(t.x,e.x),r=mS(t.y,e.y),o=dS(t.x+t.w,e.x+e.w),i=dS(t.y+t.h,e.y+e.h);return o-n<0||i-r<0?null:uS(n,r,o-n,i-r)},clamp:function(t,e,n){var r=t.x,o=t.y,i=t.x+t.w,a=t.y+t.h,u=e.x+e.w,c=e.y+e.h,s=mS(0,e.x-r),l=mS(0,e.y-o),f=mS(0,i-u),d=mS(0,a-c);return r+=s,o+=l,n&&(i+=s,a+=l,r-=f,o-=d),uS(r,o,(i-=f)-r,(a-=d)-o)},create:uS,fromClientRect:function(t){return uS(t.left,t.top,t.width,t.height)}},pS=(cS={},sS={},{load:function(t,e){var n='Script at URL "'+e+'" failed to load',r='Script at URL "'+e+"\" did not call `tinymce.Resource.add('"+t+"', data)` within 1 second";if(void 0!==cS[t])return cS[t];var o=new kr((function(o,i){var a=function(t,e,n){function r(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];o||(o=!0,null!==i&&(clearTimeout(i),i=null),t.apply(null,e))}}void 0===n&&(n=1e3);var o=!1,i=null,a=r(t),u=r(e);return{start:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];o||null!==i||(i=setTimeout((function(){return u.apply(null,t)}),n))},resolve:a,reject:u}}(o,i);sS[t]=a.resolve,eu.ScriptLoader.loadScript(e,(function(){return a.start(r)}),(function(){return a.reject(n)}))}));return cS[t]=o},add:function(t,e){void 0!==sS[t]&&(sS[t](e),delete sS[t]),cS[t]=kr.resolve(e)}}),vS=ke.each,bS=ke.extend;aS.extend=lS=function(t){function e(){var t,e,n;if(!fS&&(this.init&&this.init.apply(this,arguments),e=this.Mixins))for(t=e.length;t--;)(n=e[t]).init&&n.init.apply(this,arguments)}function n(){return this}var r=this.prototype;fS=!0;var o=new this;return fS=!1,t.Mixins&&(vS(t.Mixins,(function(e){for(var n in e)"init"!==n&&(t[n]=e[n])})),r.Mixins&&(t.Mixins=r.Mixins.concat(t.Mixins))),t.Methods&&vS(t.Methods.split(","),(function(e){t[e]=n})),t.Properties&&vS(t.Properties.split(","),(function(e){var n="_"+e;t[e]=function(t){return void 0!==t?(this[n]=t,this):this[n]}})),t.Statics&&vS(t.Statics,(function(t,n){e[n]=t})),t.Defaults&&r.Defaults&&(t.Defaults=bS({},r.Defaults,t.Defaults)),nt(t,(function(t,e){var n,i;"function"==typeof t&&r[e]?o[e]=(n=e,i=t,function(){var t=this._super;this._super=r[n];var e=i.apply(this,arguments);return this._super=t,e}):o[e]=t})),e.prototype=o,(e.constructor=e).extend=lS,e};var yS,xS,wS,CS=Math.min,SS=Math.max,kS=Math.round,OS={serialize:function(t){var e=JSON.stringify(t);return v(e)?e.replace(/[\u0080-\uFFFF]/g,(function(t){var e=t.charCodeAt(0).toString(16);return"\\u"+"0000".substring(e.length)+e})):e},parse:function(t){try{return JSON.parse(t)}catch(t){}}},ES={callbacks:{},count:0,send:function(t){var e=this,n=Ja.DOM,r=(void 0!==t.count?t:e).count,o="tinymce_jsonp_"+r;e.callbacks[r]=function(i){n.remove(o),delete e.callbacks[r],t.callback(i)},n.add(n.doc.body,"script",{id:o,src:t.url,type:"text/javascript"}),e.count++}},_S=_t(_t({},TC),{send:function(t){var e,n=0,r=function(){!t.async||4===e.readyState||1e4<n++?(t.success&&n<1e4&&200===e.status?t.success.call(t.success_scope,""+e.responseText,e,t):t.error&&t.error.call(t.error_scope,1e4<n?"TIMED_OUT":"GENERAL",e,t),e=null):Or.setTimeout(r,10)};if(t.scope=t.scope||this,t.success_scope=t.success_scope||t.scope,t.error_scope=t.error_scope||t.scope,t.async=!1!==t.async,t.data=t.data||"",_S.fire("beforeInitialize",{settings:t}),(e=new XMLHttpRequest).overrideMimeType&&e.overrideMimeType(t.content_type),e.open(t.type||(t.data?"POST":"GET"),t.url,t.async),t.crossDomain&&(e.withCredentials=!0),t.content_type&&e.setRequestHeader("Content-Type",t.content_type),t.requestheaders&&ke.each(t.requestheaders,(function(t){e.setRequestHeader(t.key,t.value)})),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),(e=_S.fire("beforeSend",{xhr:e,settings:t}).xhr).send(t.data),!t.async)return r();Or.setTimeout(r,10)}}),TS=ke.extend,MS=(DS.sendRPC=function(t){return(new DS).send(t)},DS.prototype.send=function(t){var e=t.error,n=t.success,r=TS(this.settings,t);r.success=function(t,o){(t=void 0===(t=OS.parse(t))?{error:"JSON Parse error."}:t).error?e.call(r.error_scope||r.scope,t.error,o):n.call(r.success_scope||r.scope,t.result)},r.error=function(t,n){e&&e.call(r.error_scope||r.scope,t,n)},r.data=OS.serialize({id:t.id||"c"+this.count++,method:t.method,params:t.params}),r.content_type="application/json",_S.send(r)},DS);function DS(t){this.settings=TS({},t),this.count=0}try{var zS,AS="__storage_test__";(zS=window.localStorage).setItem(AS,AS),zS.removeItem(AS)}catch(r){yS={},xS=[],wS={getItem:function(t){return yS[t]||null},setItem:function(t,e){xS.push(t),yS[t]=String(e)},key:function(t){return xS[t]},removeItem:function(t){xS=xS.filter((function(e){return e===t})),delete yS[t]},clear:function(){xS=[],yS={}},length:0},Object.defineProperty(wS,"length",{get:function(){return xS.length},configurable:!1,enumerable:!1}),zS=wS}var NS={geom:{Rect:hS},util:{Promise:kr,Delay:Or,Tools:ke,VK:Df,URI:jd,Class:aS,EventDispatcher:yC,Observable:TC,I18n:uu,XHR:_S,JSON:OS,JSONRequest:MS,JSONP:ES,LocalStorage:zS,Color:function(t){function e(t){var e;return"object"==typeof t?"r"in t?(r=t.r,o=t.g,i=t.b):"v"in t&&function(t,e,n){if(t=(parseInt(t,10)||0)%360,e=parseInt(e,10)/100,n=parseInt(n,10)/100,e=SS(0,CS(e,1)),n=SS(0,CS(n,1)),0!==e){var a=t/60,u=n*e,c=u*(1-Math.abs(a%2-1)),s=n-u;switch(Math.floor(a)){case 0:r=u,o=c,i=0;break;case 1:r=c,o=u,i=0;break;case 2:r=0,o=u,i=c;break;case 3:r=0,o=c,i=u;break;case 4:r=c,o=0,i=u;break;case 5:r=u,o=0,i=c;break;default:r=o=i=0}r=kS(255*(r+s)),o=kS(255*(o+s)),i=kS(255*(i+s))}else r=o=i=kS(255*n)}(t.h,t.s,t.v):(e=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(t))?(r=parseInt(e[1],10),o=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(t))?(r=parseInt(e[1],16),o=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/#([0-F])([0-F])([0-F])/gi.exec(t))&&(r=parseInt(e[1]+e[1],16),o=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16)),r=r<0?0:255<r?255:r,o=o<0?0:255<o?255:o,i=i<0?0:255<i?255:i,n}var n={},r=0,o=0,i=0;return t&&e(t),n.toRgb=function(){return{r:r,g:o,b:i}},n.toHsv=function(){return t=r,e=o,n=i,u=0,(c=CS(t/=255,CS(e/=255,n/=255)))===(s=SS(t,SS(e,n)))?{h:0,s:0,v:100*(u=c)}:(a=(s-c)/s,{h:kS(60*((t===c?3:n===c?1:5)-(t===c?e-n:n===c?t-e:n-t)/((u=s)-c))),s:kS(100*a),v:kS(100*u)});var t,e,n,a,u,c,s},n.toHex=function(){function t(t){return 1<(t=parseInt(t,10).toString(16)).length?t:"0"+t}return"#"+t(r)+t(o)+t(i)},n.parse=e,n},ImageUploader:function(t){var e=yv(),n=Sv(t,e);return{upload:function(e,r){return n.upload(e,(r=void 0===r||r)?Cv(t):void 0)}}}},dom:{EventUtils:ai,Sizzle:aa,DomQuery:Ga,TreeWalker:_r,TextSeeker:ku,DOMUtils:Ja,ScriptLoader:eu,RangeUtils:Mf,Serializer:Mp,StyleSheetLoader:wr,ControlSelection:vf,BookmarkManager:Rl,Selection:xp,Event:ai.Event},html:{Styles:ro,Entities:Yo,Node:Rd,Schema:eo,SaxParser:Gd,DomParser:_p,Writer:Qd,Serializer:Zd},Env:we,AddOnManager:cu,Annotator:Bl,Formatter:Tv,UndoManager:Dv,EditorCommands:lC,WindowManager:mv,NotificationManager:Fp,EditorObservable:DC,Shortcuts:HC,Editor:jC,FocusManager:zd,EditorManager:oS,DOM:Ja.DOM,ScriptLoader:eu.ScriptLoader,PluginManager:fv,ThemeManager:dv,IconManager:av,Resource:pS,trim:ke.trim,isArray:ke.isArray,is:ke.is,toArray:ke.toArray,makeMap:ke.makeMap,each:ke.each,map:ke.map,grep:ke.grep,inArray:ke.inArray,extend:ke.extend,create:ke.create,walk:ke.walk,createNS:ke.createNS,resolve:ke.resolve,explode:ke.explode,_addCacheSuffix:ke._addCacheSuffix,isOpera:we.opera,isWebKit:we.webkit,isIE:we.ie,isGecko:we.gecko,isMac:we.mac},BS=ke.extend(oS,NS),RS=BS;window.tinymce=RS,window.tinyMCE=RS,function(t){if("object"==typeof module)try{module.exports=t}catch(t){}}(BS)}(),function(){"use strict";var t=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},e=function(t){return function(e){return typeof e===t}},n=function(t){return function(e){return t===e}},r=t("string"),o=t("object"),i=t("array"),a=n(null),u=e("boolean"),c=n(void 0),s=function(t){return null==t},l=function(t){return!s(t)},f=e("function"),d=e("number"),m=function(t,e){if(i(t)){for(var n=0,r=t.length;n<r;++n)if(!e(t[n]))return!1;return!0}return!1},g=function(){},h=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},p=function(t){return function(){return t}},v=function(t){return t},b=function(t,e){return t===e};function y(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var x=function(t){return function(e){return!t(e)}},w=function(t){return function(){throw new Error(t)}},C=p(!1),S=p(!0),k=tinymce.util.Tools.resolve("tinymce.ThemeManager"),O=function(){return O=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},O.apply(this,arguments)};function E(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function _(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var T,M,D=function(){return z},z=(T=function(t){return t()},{fold:function(t,e){return t()},isSome:C,isNone:S,getOr:M=v,getOrThunk:T,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:p(null),getOrUndefined:p(void 0),or:M,orThunk:T,map:D,each:g,bind:D,exists:C,forall:S,filter:function(){return D()},toArray:function(){return[]},toString:p("none()")}),A=function(t){var e=p(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:S,isNone:C,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return A(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:z},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},N={some:A,none:D,from:function(t){return null==t?z:A(t)}},B=Array.prototype.slice,R=Array.prototype.indexOf,H=Array.prototype.push,V=function(t,e){return R.call(t,e)},I=function(t,e){return V(t,e)>-1},L=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},F=function(t,e){for(var n=[],r=0;r<t;r++)n.push(e(r));return n},P=function(t,e){for(var n=[],r=0;r<t.length;r+=e){var o=B.call(t,r,r+e);n.push(o)}return n},U=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},j=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},W=function(t,e){for(var n=[],r=[],o=0,i=t.length;o<i;o++){var a=t[o];(e(a,o)?n:r).push(a)}return{pass:n,fail:r}},q=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},G=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},$=function(t,e,n){return j(t,(function(t,r){n=e(n,t,r)})),n},X=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return N.some(i);if(n(i,r))break}return N.none()}(t,e,C)},K=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return N.some(n)}return N.none()},Y=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!i(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);H.apply(e,t[n])}return e},J=function(t,e){return Y(U(t,e))},Q=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},Z=function(t){var e=B.call(t,0);return e.reverse(),e},tt=function(t,e){return q(t,(function(t){return!I(e,t)}))},et=function(t,e){for(var n={},r=0,o=t.length;r<o;r++){var i=t[r];n[String(i)]=e(i,r)}return n},nt=function(t){return[t]},rt=function(t,e){var n=B.call(t,0);return n.sort(e),n},ot=function(t,e){return e>=0&&e<t.length?N.some(t[e]):N.none()},it=function(t){return ot(t,0)},at=function(t){return ot(t,t.length-1)},ut=f(Array.from)?Array.from:function(t){return B.call(t)},ct=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return N.none()},st=Object.keys,lt=Object.hasOwnProperty,ft=function(t,e){for(var n=st(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},dt=function(t,e){return mt(t,(function(t,n){return{k:n,v:e(t,n)}}))},mt=function(t,e){var n={};return ft(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},gt=function(t,e){var n={};return function(t,e,n,r){ft(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),g),n},ht=function(t,e){var n=[];return ft(t,(function(t,r){n.push(e(t,r))})),n},pt=function(t,e){for(var n=st(t),r=0,o=n.length;r<o;r++){var i=n[r],a=t[i];if(e(a,i,t))return N.some(a)}return N.none()},vt=function(t){return ht(t,v)},bt=function(t,e){return yt(t,e)?N.from(t[e]):N.none()},yt=function(t,e){return lt.call(t,e)},xt=function(t,e){return yt(t,e)&&void 0!==t[e]&&null!==t[e]},wt=function(t,e,n){return void 0===n&&(n=b),t.exists((function(t){return n(t,e)}))},Ct=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},St=function(t,e,n){return t.isSome()&&e.isSome()?N.some(n(t.getOrDie(),e.getOrDie())):N.none()},kt=function(t,e){return t?N.some(e):N.none()},Ot=function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e},Et=function(t,e){return-1!==t.indexOf(e)},_t=function(t,e){return Ot(t,e,0)},Tt=function(t,e){return Ot(t,e,t.length-e.length)},Mt=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),Dt=function(t){return t.length>0},zt=function(t){return void 0!==t.style&&f(t.style.getPropertyValue)},At=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Nt={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return At(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return At(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return At(n)},fromDom:At,fromPoint:function(t,e,n){return N.from(t.dom.elementFromPoint(e,n)).map(At)}};"undefined"!=typeof window?window:Function("return this;")();var Bt,Rt=function(t){return t.dom.nodeName.toLowerCase()},Ht=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},Vt=Ht(1),It=Ht(3),Lt=Ht(9),Ft=Ht(11),Pt=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},Ut=function(){return jt(0,0)},jt=function(t,e){return{major:t,minor:e}},Wt={nu:jt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Ut():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return jt(r(1),r(2))}(t,n)},unknown:Ut},qt=function(t,e){var n=String(e).toLowerCase();return X(t,(function(t){return t.search(n)}))},Gt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$t=function(t){return function(e){return Et(e,t)}},Xt=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Et(t,"edge/")&&Et(t,"chrome")&&Et(t,"safari")&&Et(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Gt],search:function(t){return Et(t,"chrome")&&!Et(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Et(t,"msie")||Et(t,"trident")}},{name:"Opera",versionRegexes:[Gt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$t("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$t("firefox")},{name:"Safari",versionRegexes:[Gt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Et(t,"safari")||Et(t,"mobile/"))&&Et(t,"applewebkit")}}],Kt=[{name:"Windows",search:$t("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Et(t,"iphone")||Et(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$t("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$t("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$t("linux"),versionRegexes:[]},{name:"Solaris",search:$t("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$t("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$t("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Yt={browsers:p(Xt),oses:p(Kt)},Jt="Edge",Qt="Chrome",Zt="Opera",te="Firefox",ee="Safari",ne=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(Jt),isChrome:r(Qt),isIE:r("IE"),isOpera:r(Zt),isFirefox:r(te),isSafari:r(ee)}},re={unknown:function(){return ne({current:void 0,version:Wt.unknown()})},nu:ne,edge:p(Jt),chrome:p(Qt),ie:p("IE"),opera:p(Zt),firefox:p(te),safari:p(ee)},oe="Windows",ie="Android",ae="Linux",ue="Solaris",ce="FreeBSD",se="ChromeOS",le=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(oe),isiOS:r("iOS"),isAndroid:r(ie),isOSX:r("OSX"),isLinux:r(ae),isSolaris:r(ue),isFreeBSD:r(ce),isChromeOS:r(se)}},fe={unknown:function(){return le({current:void 0,version:Wt.unknown()})},nu:le,windows:p(oe),ios:p("iOS"),android:p(ie),linux:p(ae),osx:p("OSX"),solaris:p(ue),freebsd:p(ce),chromeos:p(se)},de=function(t,e,n){var r=Yt.browsers(),o=Yt.oses(),i=e.bind((function(t){return function(t,e){return ct(e.brands,(function(e){var n=e.brand.toLowerCase();return X(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:Wt.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return qt(t,e).map((function(t){var n=Wt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(re.unknown,re.nu),a=function(t,e){return qt(t,e).map((function(t){var n=Wt.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(fe.unknown,fe.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:p(o),isiPhone:p(i),isTablet:p(c),isPhone:p(s),isTouch:p(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:p(l),isDesktop:p(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},me=function(t){return window.matchMedia(t).matches},ge=Pt((function(){return de(navigator.userAgent,N.from(navigator.userAgentData),me)})),he=function(){return ge()},pe=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ve=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},be=function(t,e){return t.dom===e.dom},ye=function(t,e){return function(t,e){return function(t,e,n){return 0!=(t.compareDocumentPosition(e)&n)}(t,e,Node.DOCUMENT_POSITION_CONTAINED_BY)}(t.dom,e.dom)},xe=function(t,e){return he().browser.isIE()?ye(t,e):function(t,e){var n=t.dom,r=e.dom;return n!==r&&n.contains(r)}(t,e)},we=function(t){return Nt.fromDom(t.dom.ownerDocument)},Ce=function(t){return Lt(t)?t:we(t)},Se=function(t){return Nt.fromDom(Ce(t).dom.documentElement)},ke=function(t){return Nt.fromDom(Ce(t).dom.defaultView)},Oe=function(t){return N.from(t.dom.parentNode).map(Nt.fromDom)},Ee=function(t){return N.from(t.dom.offsetParent).map(Nt.fromDom)},_e=function(t){return U(t.dom.childNodes,Nt.fromDom)},Te=function(t,e){var n=t.dom.childNodes;return N.from(n[e]).map(Nt.fromDom)},Me=function(t,e){return{element:t,offset:e}},De=function(t,e){var n=_e(t);return n.length>0&&e<n.length?Me(n[e],0):Me(t,e)},ze=function(t){return Ft(t)&&l(t.dom.host)},Ae=f(Element.prototype.attachShadow)&&f(Node.prototype.getRootNode),Ne=p(Ae),Be=Ae?function(t){return Nt.fromDom(t.dom.getRootNode())}:Ce,Re=function(t){return ze(t)?t:Nt.fromDom(Ce(t).dom.body)},He=function(t){var e=Be(t);return ze(e)?N.some(e):N.none()},Ve=function(t){return Nt.fromDom(t.dom.host)},Ie=function(t){return l(t.dom.shadowRoot)},Le=function(t){var e=It(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return He(Nt.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=Le,r=Ve,function(t){return n(r(t))}))},Fe=function(){return Pe(Nt.fromDom(document))},Pe=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return Nt.fromDom(e)},Ue=function(t,e,n){if(!(r(n)||u(n)||d(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},je=function(t,e,n){Ue(t.dom,e,n)},We=function(t,e){var n=t.dom;ft(e,(function(t,e){Ue(n,e,t)}))},qe=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},Ge=function(t,e){return N.from(qe(t,e))},$e=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},Xe=function(t,e){t.dom.removeAttribute(e)},Ke=function(t,e,n){if(!r(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);zt(t)&&t.style.setProperty(e,n)},Ye=function(t,e){zt(t)&&t.style.removeProperty(e)},Je=function(t,e,n){var r=t.dom;Ke(r,e,n)},Qe=function(t,e){var n=t.dom;ft(e,(function(t,e){Ke(n,e,t)}))},Ze=function(t,e){var n=t.dom;ft(e,(function(t,e){t.fold((function(){Ye(n,e)}),(function(t){Ke(n,e,t)}))}))},tn=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||Le(t)?r:en(n,e)},en=function(t,e){return zt(t)?t.style.getPropertyValue(e):""},nn=function(t,e){var n=t.dom,r=en(n,e);return N.from(r).filter((function(t){return t.length>0}))},rn=function(t){var e={},n=t.dom;if(zt(n))for(var r=0;r<n.style.length;r++){var o=n.style.item(r);e[o]=n.style[o]}return e},on=function(t,e,n){var r=Nt.fromTag(t);return Je(r,e,n),nn(r,e).isSome()},an=function(t,e){var n=t.dom;Ye(n,e),wt(Ge(t,"style").map(Mt),"")&&Xe(t,"style")},un=function(t){return t.dom.offsetWidth},cn=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=tn(n,t);return parseFloat(o)||0}return r},r=function(t,e){return $(e,(function(e,n){var r=tn(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!d(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;zt(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},sn=cn("height",(function(t){var e=t.dom;return Le(t)?e.getBoundingClientRect().height:e.offsetHeight})),ln=function(t){return sn.get(t)},fn=function(t){return sn.getOuter(t)},dn=function(t,e){return{left:t,top:e,translate:function(n,r){return dn(t+n,e+r)}}},mn=dn,gn=function(t,e){return void 0!==t?t:void 0!==e?e:0},hn=function(t){var e=t.dom.ownerDocument,n=e.body,r=e.defaultView,o=e.documentElement;if(n===t.dom)return mn(n.offsetLeft,n.offsetTop);var i=gn(null==r?void 0:r.pageYOffset,o.scrollTop),a=gn(null==r?void 0:r.pageXOffset,o.scrollLeft),u=gn(o.clientTop,n.clientTop),c=gn(o.clientLeft,n.clientLeft);return pn(t).translate(a-c,i-u)},pn=function(t){var e=t.dom,n=e.ownerDocument.body;return n===e?mn(n.offsetLeft,n.offsetTop):Le(t)?function(t){var e=t.getBoundingClientRect();return mn(e.left,e.top)}(e):mn(0,0)},vn=cn("width",(function(t){return t.dom.offsetWidth})),bn=function(t){return vn.get(t)},yn=function(t){return vn.getOuter(t)},xn=function(t){var e=Nt.fromDom(function(t){if(Ne()&&l(t.target)){var e=Nt.fromDom(t.target);if(Vt(e)&&Ie(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return it(n)}}return N.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=h(r,n);return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(e,t.clientX,t.clientY,n,r,o,t)},wn=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(xn(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:y(Cn,t,e,i,o)}},Cn=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Sn=function(t,e){Oe(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},kn=function(t,e){var n=function(t){return N.from(t.dom.nextSibling).map(Nt.fromDom)}(t);n.fold((function(){Oe(t).each((function(t){En(t,e)}))}),(function(t){Sn(t,e)}))},On=function(t,e){var n=function(t){return Te(t,0)}(t);n.fold((function(){En(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},En=function(t,e){t.dom.appendChild(e.dom)},_n=function(t,e){j(e,(function(e){En(t,e)}))},Tn=function(t){t.dom.textContent="",j(_e(t),(function(t){Mn(t)}))},Mn=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Dn=function(t){var e,n=_e(t);n.length>0&&(e=t,j(n,(function(t){Sn(e,t)}))),Mn(t)},zn=function(t){var e=void 0!==t?t.dom:document,n=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop;return mn(n,r)},An=function(t,e,n){var r=(void 0!==n?n.dom:document).defaultView;r&&r.scrollTo(t,e)},Nn=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Bn=function(t){var e=void 0===t?window:t,n=e.document,r=zn(Nt.fromDom(n));return function(t){var e=void 0===t?window:t;return he().browser.isFirefox()?N.none():N.from(e.visualViewport)}(e).fold((function(){var t=e.document.documentElement,n=t.clientWidth,o=t.clientHeight;return Nn(r.left,r.top,n,o)}),(function(t){return Nn(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)}))},Rn=function(t,e){return t.view(e).fold(p([]),(function(e){var n=t.owner(e),r=Rn(t,n);return[e].concat(r)}))},Hn=Object.freeze({__proto__:null,view:function(t){var e;return(t.dom===document?N.none():N.from(null===(e=t.dom.defaultView)||void 0===e?void 0:e.frameElement)).map(Nt.fromDom)},owner:function(t){return we(t)}}),Vn=function(t){var e=Nt.fromDom(document),n=zn(e),r=function(t,e){var n=e.owner(t),r=Rn(e,n);return N.some(r)}(t,Hn);return r.fold(y(hn,t),(function(e){var r=pn(t),o=G(e,(function(t,e){var n=pn(e);return{left:t.left+n.left,top:t.top+n.top}}),{left:0,top:0});return mn(o.left+r.left+n.left,o.top+r.top+n.top)}))},In=function(t,e,n,r){return{x:t,y:e,width:n,height:r,right:t+n,bottom:e+r}},Ln=function(t){var e=hn(t),n=yn(t),r=fn(t);return In(e.left,e.top,n,r)},Fn=function(t){var e=Vn(t),n=yn(t),r=fn(t);return In(e.left,e.top,n,r)},Pn=function(){return Bn(window)},Un=function(t){return{isValue:S,isError:C,getOr:p(t),getOrThunk:p(t),getOrDie:p(t),or:function(e){return Un(t)},orThunk:function(e){return Un(t)},fold:function(e,n){return n(t)},map:function(e){return Un(e(t))},mapError:function(e){return Un(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return N.some(t)}}},jn=function(t){return{isValue:C,isError:S,getOr:v,getOrThunk:function(t){return t()},getOrDie:function(){return w(String(t))()},or:v,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return jn(t)},mapError:function(e){return jn(e(t))},each:g,bind:function(e){return jn(t)},exists:C,forall:S,toOptional:N.none}},Wn={value:Un,error:jn,fromOption:function(t,e){return t.fold((function(){return jn(e)}),Un)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(Bt||(Bt={}));var qn=function(t,e,n){return t.stype===Bt.Error?e(t.serror):n(t.svalue)},Gn=function(t){return{stype:Bt.Value,svalue:t}},$n=function(t){return{stype:Bt.Error,serror:t}},Xn=function(t){return t.fold($n,Gn)},Kn=function(t){return qn(t,Wn.error,Wn.value)},Yn=Gn,Jn=function(t){var e=[],n=[];return j(t,(function(t){qn(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Qn=$n,Zn=function(t,e){return t.stype===Bt.Value?e(t.svalue):t},tr=function(t,e){return t.stype===Bt.Error?e(t.serror):t},er=function(t,e){return t.stype===Bt.Value?{stype:Bt.Value,svalue:e(t.svalue)}:t},nr=function(t,e){return t.stype===Bt.Error?{stype:Bt.Error,serror:e(t.serror)}:t},rr=qn,or=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},ir=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},ar=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)yt(i,a)&&(r[a]=t(r[a],i[a]))}return r}},ur=ar((function(t,e){return o(t)&&o(e)?ur(t,e):e})),cr=ar((function(t,e){return e})),sr=function(t){return{tag:"defaultedThunk",process:t}},lr=function(t){return sr(p(t))},fr=function(t){return{tag:"mergeWithThunk",process:t}},dr=function(t){return h(Qn,Y)(t)},mr=function(t){var e=Jn(t);return e.errors.length>0?dr(e.errors):Yn(e.values)},gr=function(t){return o(t)&&st(t).length>100?" removed due to size":JSON.stringify(t,null,2)},hr=function(t,e){return Qn([{path:t,getErrorInfo:e}])},pr=function(t){return{extract:function(e,n){return tr(t(n),(function(t){return function(t,e){return hr(t,p(e))}(e,t)}))},toString:p("val")}},vr=pr(Yn),br=function(t,e,n,r){return bt(e,n).fold((function(){return function(t,e,n){return hr(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+gr(n)}))}(t,n,e)}),r)},yr=function(t,e,n,r){return r(bt(t,e).getOrThunk((function(){return n(t)})))},xr=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},a=function(t){return t.fold((function(){return Yn(N.none())}),(function(t){var n=o.extract(e.concat([r]),t);return er(n,N.some)}))};switch(t.tag){case"required":return br(e,n,r,i);case"defaultedThunk":return yr(n,r,t.process,i);case"option":return function(t,e,n){return n(bt(t,e))}(n,r,a);case"defaultedOptionThunk":return function(t,e,n,r){return r(bt(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,a);case"mergeWithThunk":return yr(n,r,p({}),(function(e){var r=ur(t.process(n),e);return i(r)}))}},wr=function(t){return{extract:function(e,n){return t().extract(e,n)},toString:function(){return t().toString()}}},Cr=function(t){return st(gt(t,l))},Sr=function(t){var e=kr(t),n=G(t,(function(t,e){return ir(e,(function(e){var n;return ur(t,((n={})[e]=!0,n))}),p(t))}),{});return{extract:function(t,r){var o=u(r)?[]:Cr(r),i=q(o,(function(t){return!xt(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return hr(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},kr=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,a=n;i<a.length;i++){var u=a[i];ir(u,(function(n,i,a,u){var c=xr(a,t,e,n,u);rr(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?Qn(o):Yn(r)}(e,n,t)},toString:function(){var e=U(t,(function(t){return ir(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"}}},Or=function(t){return{extract:function(e,n){var r=U(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return mr(r)},toString:function(){return"array("+t.toString()+")"}}},Er=function(t){return{extract:function(e,n){for(var r=[],o=0,i=t;o<i.length;o++){var a=i[o].extract(e,n);if(a.stype===Bt.Value)return a;r.push(a)}return mr(r)},toString:function(){return"oneOf("+U(t,(function(t){return t.toString()})).join(", ")+")"}}},_r=function(t,e){return{extract:function(n,r){var o=st(r),i=function(e,n){return Or(pr(t)).extract(e,n)}(n,o);return Zn(i,(function(t){var o=U(t,(function(t){return or(t,t,{tag:"required",process:{}},e)}));return kr(o).extract(n,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},Tr=h(Or,kr),Mr=p(vr),Dr=function(t,e){return pr((function(n){var r=typeof n;return t(n)?Yn(n):Qn("Expected type: "+e+" but got: "+r)}))},zr=Dr(d,"number"),Ar=Dr(r,"string"),Nr=Dr(u,"boolean"),Br=Dr(f,"function"),Rr=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every((function(e){return Rr(t[e])}));default:return!1}},Hr=pr((function(t){return Rr(t)?Yn(t):Qn("Expected value to be acceptable for sending via postMessage")})),Vr=function(t,e,n,r){return bt(n,r).fold((function(){return function(t,e,n){return hr(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+gr(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},Ir=function(t,e){return{extract:function(n,r){return bt(r,t).fold((function(){return function(t,e){return hr(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return Vr(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+st(e)}}},Lr=function(t){return pr((function(e){return t(e).fold(Qn,Yn)}))},Fr=function(t,e){return _r((function(e){return Xn(t(e))}),e)},Pr=function(t,e,n){return Kn(function(t,e,n){var r=e.extract([t],n);return nr(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},Ur=function(t){return t.fold((function(t){throw new Error(Wr(t))}),v)},jr=function(t,e,n){return Ur(Pr(t,e,n))},Wr=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:p("... (only showing first ten failures)")}]):e,U(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+gr(t.input);var e,n},qr=function(t,e){return Ir(t,dt(e,kr))},Gr=or,$r=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Xr=function(t){return Lr((function(e){return I(t,e)?Wn.value(e):Wn.error('Unsupported value: "'+e+'", choose one of "'+t.join(", ")+'".')}))},Kr=function(t){return Gr(t,t,{tag:"required",process:{}},Mr())},Yr=function(t,e){return Gr(t,t,{tag:"required",process:{}},e)},Jr=function(t){return Yr(t,zr)},Qr=function(t){return Yr(t,Ar)},Zr=function(t,e){return Gr(t,t,{tag:"required",process:{}},Xr(e))},to=function(t){return Yr(t,Br)},eo=function(t,e){return Gr(t,t,{tag:"required",process:{}},kr(e))},no=function(t,e){return Gr(t,t,{tag:"required",process:{}},Tr(e))},ro=function(t,e){return Gr(t,t,{tag:"required",process:{}},Or(e))},oo=function(t){return Gr(t,t,{tag:"option",process:{}},Mr())},io=function(t,e){return Gr(t,t,{tag:"option",process:{}},e)},ao=function(t){return io(t,zr)},uo=function(t){return io(t,Ar)},co=function(t){return io(t,Br)},so=function(t,e){return io(t,Or(e))},lo=function(t,e){return io(t,kr(e))},fo=function(t,e){return Gr(t,t,lr(e),Mr())},mo=function(t,e,n){return Gr(t,t,lr(e),n)},go=function(t,e){return mo(t,e,zr)},ho=function(t,e){return mo(t,e,Ar)},po=function(t,e,n){return mo(t,e,Xr(n))},vo=function(t,e){return mo(t,e,Nr)},bo=function(t,e){return mo(t,e,Br)},yo=function(t,e,n){return mo(t,e,Or(n))},xo=function(t,e,n){return mo(t,e,kr(n))},wo=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Co=function(t){if(!i(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return j(t,(function(r,o){var a=st(r);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=r[u];if(void 0!==n[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!i(c))throw new Error("case arguments must be an array");e.push(u),n[u]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+i);return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[o].apply(null,n)},match:function(t){var r=st(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!Q(e,(function(t){return I(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[u].apply(null,n)},log:function(t){console.log(t,{constructors:e,constructor:u,params:n})}}}})),n};Co([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var So,ko=function(t,e){return function(t,e){var n={};return ft(t,(function(t,r){I(e,r)||(n[r]=t)})),n}(t,e)},Oo=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},Eo=function(t){return function(t){var e={};return j(t,(function(t){e[t.key]=t.value})),e}(t)},_o=function(t,e){var n,r=function(t){var e=[],n=[];return j(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,Wn.error(Y(n))):function(t,e){return 0===t.length?Wn.value(e):Wn.value(ur(e,cr.apply(void 0,t)))}(r.values,e)},To=function(t){return f(t)?t:C},Mo=function(t,e,n){for(var r=t.dom,o=To(n);r.parentNode;){r=r.parentNode;var i=Nt.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return N.none()},Do=function(t,e,n){var r=e(t),o=To(n);return r.orThunk((function(){return o(t)?N.none():Mo(t,e,o)}))},zo=function(t,e){return be(t.element,e.event.target)},Ao={can:S,abort:C,run:g},No=function(t){if(!xt(t,"can")&&!xt(t,"abort")&&!xt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return O(O({},Ao),t)},Bo=function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return $(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return{can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];j(t,(function(t){t.run.apply(void 0,e)}))}}},Ro=p,Ho=Ro("touchstart"),Vo=Ro("touchmove"),Io=Ro("touchend"),Lo=Ro("touchcancel"),Fo=Ro("mousedown"),Po=Ro("mousemove"),Uo=Ro("mouseout"),jo=Ro("mouseup"),Wo=Ro("mouseover"),qo=Ro("focusin"),Go=Ro("focusout"),$o=Ro("keydown"),Xo=Ro("keyup"),Ko=Ro("input"),Yo=Ro("change"),Jo=Ro("click"),Qo=Ro("transitioncancel"),Zo=Ro("transitionend"),ti=Ro("transitionstart"),ei=Ro("selectstart"),ni=function(t){return p("alloy."+t)},ri={tap:ni("tap")},oi=ni("focus"),ii=ni("blur.post"),ai=ni("paste.post"),ui=ni("receive"),ci=ni("execute"),si=ni("focus.item"),li=ri.tap,fi=ni("longpress"),di=ni("sandbox.close"),mi=ni("typeahead.cancel"),gi=ni("system.init"),hi=ni("system.touchmove"),pi=ni("system.touchend"),vi=ni("system.scroll"),bi=ni("system.resize"),yi=ni("system.attached"),xi=ni("system.detached"),wi=ni("system.dismissRequested"),Ci=ni("system.repositionRequested"),Si=ni("focusmanager.shifted"),ki=ni("slotcontainer.visibility"),Oi=ni("change.tab"),Ei=ni("dismiss.tab"),_i=ni("highlight"),Ti=ni("dehighlight"),Mi=function(t,e){Ni(t,t.element,e,{})},Di=function(t,e,n){Ni(t,t.element,e,n)},zi=function(t){Mi(t,ci())},Ai=function(t,e,n){Ni(t,e,n,{})},Ni=function(t,e,n,r){var o=O({target:e},r);t.getSystem().triggerEvent(n,e,o)},Bi=function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)},Ri=function(t){return Eo(t)},Hi=function(t,e){return{key:t,value:No({abort:e})}},Vi=function(t){return{key:t,value:No({run:function(t,e){e.event.prevent()}})}},Ii=function(t,e){return{key:t,value:No({run:e})}},Li=function(t,e,n){return{key:t,value:No({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Fi=function(t){return function(e){return{key:t,value:No({run:function(t,n){zo(t,n)&&e(t,n)}})}}},Pi=function(t,e,n){return function(t,e){return Ii(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){Bi(e,e.element,t,r)}))}))}(t,e.partUids[n])},Ui=function(t,e){return Ii(t,(function(t,n){var r=n.event,o=t.getSystem().getByDom(r.target).getOrThunk((function(){return Do(r.target,(function(e){return t.getSystem().getByDom(e).toOptional()}),C).getOr(t)}));e(t,o,n)}))},ji=function(t){return Ii(t,(function(t,e){e.cut()}))},Wi=function(t){return Ii(t,(function(t,e){e.stop()}))},qi=function(t,e){return Fi(t)(e)},Gi=Fi(yi()),$i=Fi(xi()),Xi=Fi(gi()),Ki=function(t){return function(e){return Ii(t,e)}}(ci()),Yi=function(t){return t.dom.innerHTML},Ji=function(t,e){var n=we(t).dom,r=Nt.fromDom(n.createDocumentFragment()),o=function(t,e){var n=(e||document).createElement("div");return n.innerHTML=t,_e(Nt.fromDom(n))}(e,n);_n(r,o),Tn(t),En(t,r)},Qi=function(t){return function(t,e){return Nt.fromDom(t.dom.cloneNode(e))}(t,!1)},Zi=function(t){return ze(t)?"#shadow-root":function(t){var e=Nt.fromTag("div"),n=Nt.fromDom(t.dom.cloneNode(!0));return En(e,n),Yi(e)}(Qi(t))},ta=function(t){return Zi(t)},ea=Ri([function(t,e){return{key:t,value:No({can:e})}}(oi(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return be(e,t.element)&&!be(e,n)}(t,r,o)||(console.warn(oi()+" did not get interpreted by the desired target. \nOriginator: "+ta(r)+"\nTarget: "+ta(o)+"\nCheck the "+oi()+" event handlers"),!1)}))]),na=Object.freeze({__proto__:null,events:ea}),ra=0,oa=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++ra+String(e)},ia=p("alloy-id-"),aa=p("data-alloy-id"),ua=ia(),ca=aa(),sa=function(t,e){Object.defineProperty(t.dom,ca,{value:e,writable:!0})},la=function(t){var e=Vt(t)?t.dom[ca]:null;return N.from(e)},fa=function(t){return oa(t)},da=v,ma=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+ta(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:p("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:C}},ga=ma(),ha=function(t){return U(t,(function(t){return Tt(t,"/*")?t.substring(0,t.length-"/*".length):t}))},pa=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ha(i)}},t},va=oa("alloy-premade"),ba=function(t){return Oo(va,t)},ya=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ha(i.slice(1))}},t}((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return t.apply(void 0,_([e.getApis(),e],n,!1))}),t)},xa={init:function(){return wa({readState:p("No State required")})}},wa=function(t){return t},Ca=function(t,e){var n={};return ft(t,(function(t,r){ft(t,(function(t,o){var i=bt(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},Sa=function(t){return{classes:c(t.classes)?[]:t.classes,attributes:c(t.attributes)?{}:t.attributes,styles:c(t.styles)?{}:t.styles}},ka=function(t){return t.cHandler},Oa=function(t,e){return{name:t,handler:e}},Ea=function(t,e,n){var r=O(O({},n),function(t,e){var n={};return j(t,(function(t){n[t.name()]=t.handlers(e)})),n}(e,t));return Ca(r,Oa)},_a=function(t){var e=function(t){return f(t)?{can:S,abort:C,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},Ta=function(t,e,n){var r=e[n];return r?function(t,e,n,r){try{var o=rt(n,(function(n,o){var i=n[e],a=o[e],u=r.indexOf(i),c=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<c?-1:c<u?1:0}));return Wn.value(o)}catch(t){return Wn.error([t])}}("Event: "+n,"name",t,r).map((function(t){var e=U(t,(function(t){return t.handler}));return Bo(e)})):function(t,e){return Wn.error(["The event ("+t+') 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(U(e,(function(t){return t.name})),null,2)])}(n,t)},Ma=function(t,e){var n=ht(t,(function(t,n){return(1===t.length?Wn.value(t[0].handler):Ta(t,e,n)).map((function(r){var o=_a(r),i=t.length>1?q(e[n],(function(e){return L(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Oo(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return _o(n,{})},Da="alloy.base.behaviour",za=kr([Gr("dom","dom",{tag:"required",process:{}},kr([Kr("tag"),fo("styles",{}),fo("classes",[]),fo("attributes",{}),oo("value"),oo("innerHtml")])),Kr("components"),Kr("uid"),fo("events",{}),fo("apis",{}),Gr("eventOrder","eventOrder",function(t){return fr(p(t))}((So={},So[ci()]=["disabling",Da,"toggling","typeaheadevents"],So[oi()]=[Da,"focusing","keying"],So[gi()]=[Da,"disabling","toggling","representing"],So[Ko()]=[Da,"representing","streaming","invalidating"],So[xi()]=[Da,"representing","item-events","tooltipping"],So[Fo()]=["focusing",Da,"item-type-events"],So[Ho()]=["focusing",Da,"item-type-events"],So[Wo()]=["item-type-events","tooltipping"],So[ui()]=["receiving","reflecting","tooltipping"],So)),Mr()),oo("domModification")]),Aa=function(t){return t.events},Na=function(t,e){var n=qe(t,e);return void 0===n||""===n?[]:n.split(" ")},Ba=function(t){return void 0!==t.dom.classList},Ra=function(t,e){return function(t,e,n){var r=Na(t,e).concat([n]);return je(t,e,r.join(" ")),!0}(t,"class",e)},Ha=function(t,e){return function(t,e,n){var r=q(Na(t,e),(function(t){return t!==n}));return r.length>0?je(t,e,r.join(" ")):Xe(t,e),!1}(t,"class",e)},Va=function(t,e){Ba(t)?t.dom.classList.add(e):Ra(t,e)},Ia=function(t){var e=Ba(t)?t.dom.classList:function(t){return Na(t,"class")}(t);0===e.length&&Xe(t,"class")},La=function(t,e){Ba(t)?t.dom.classList.remove(e):Ha(t,e);Ia(t)},Fa=function(t,e){return Ba(t)&&t.dom.classList.contains(e)},Pa=function(t,e){j(e,(function(e){Va(t,e)}))},Ua=function(t,e){j(e,(function(e){La(t,e)}))},ja=function(t){return t.dom.value},Wa=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},qa=function(t,e){return function(t,e){var n=U(e,(function(t){return lo(t.name(),[Kr("config"),fo("state",xa)])})),r=Pr("component.behaviours",kr(n),t.behaviours).fold((function(e){throw new Error(Wr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),v);return{list:e,data:dt(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return p(e)}))}}(t,e)},Ga=function(t){var e=function(t){var e=bt(t,"behaviours").getOr({});return J(st(e),(function(t){var n=e[t];return l(n)?[n.me]:[]}))}(t);return qa(t,e)},$a=function(t,e,n){var r,o,i,a=O(O({},(r=t).dom),{uid:r.uid,domChildren:U(r.components,(function(t){return t.element}))}),u=function(t){return t.domModification.fold((function(){return Sa({})}),Sa)}(t),c={"alloy.base.modification":u},s=e.length>0?function(t,e,n,r){var o=O({},e);j(n,(function(e){o[e.name()]=e.exhibit(t,r)}));var i=Ca(o,(function(t,e){return{name:t,modification:e}})),a=function(t){return G(t,(function(t,e){return O(O({},e.modification),t)}),{})},u=G(i.classes,(function(t,e){return e.modification.concat(t)}),[]),c=a(i.attributes),s=a(i.styles);return Sa({classes:u,attributes:c,styles:s})}(n,c,e,a):u;return i=s,O(O({},o=a),{attributes:O(O({},o.attributes),i.attributes),styles:O(O({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Xa=function(t,e,n){var r={"alloy.base.behaviour":Aa(t)};return function(t,e,n,r){var o=Ea(t,n,r);return Ma(o,e)}(n,t.eventOrder,e,r).getOrDie()},Ka=function(t){var e=function(){return l},n=wo(ga),r=Ur(function(t){return Pr("custom.definition",za,t)}(t)),o=Ga(t),i=function(t){return t.list}(o),a=function(t){return t.data}(o),u=function(t){var e=Nt.fromTag(t.tag);We(e,t.attributes),Pa(e,t.classes),Qe(e,t.styles),t.innerHtml.each((function(t){return Ji(e,t)}));var n=t.domChildren;return _n(e,n),t.value.each((function(t){Wa(e,t)})),t.uid,sa(e,t.uid),e}($a(r,i,a)),c=Xa(r,i,a),s=wo(r.components),l={uid:t.uid,getSystem:n.get,config:function(e){var n=a;return(f(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return f(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(ma(e))},element:u,syncComponents:function(){var t=_e(u),e=J(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),nt)}));s.set(e)},components:s.get,events:c};return l},Ya=function(t){var e=da(t),n=e.events,r=E(e,["events"]),o=function(t){var e=bt(t,"components").getOr([]);return U(e,tu)}(r),i=O(O({},r),{events:O(O({},na),n),components:o});return Wn.value(Ka(i))},Ja=function(t){var e=Nt.fromText(t);return Qa({element:e})},Qa=function(t){var e=jr("external.component",Sr([Kr("element"),oo("uid")]),t),n=wo(ma()),r=e.uid.getOrThunk((function(){return fa("external")}));sa(e.element,r);var o={uid:r,getSystem:n.get,config:N.none,hasConfigured:C,connect:function(t){n.set(t)},disconnect:function(){n.set(ma((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:p("No state"),syncComponents:g,components:p([]),events:{}};return ba(o)},Za=fa,tu=function(t){return function(t){return bt(t,va)}(t).getOrThunk((function(){var e=function(t){return yt(t,"uid")}(t)?t:O({uid:Za("")},t);return Ya(e).getOrDie()}))},eu=ba;function nu(t,e,n,r,o){return t(n,r)?N.some(n):f(o)&&o(n)?N.none():e(n,r,o)}var ru,ou=function(t,e,n){for(var r=t.dom,o=f(n)?n:C;r.parentNode;){r=r.parentNode;var i=Nt.fromDom(r);if(e(i))return N.some(i);if(o(i))break}return N.none()},iu=function(t,e,n){return nu((function(t,e){return e(t)}),ou,t,e,n)},au=function(t,e,n){return iu(t,e,n).isSome()},uu=function(t,e,n){return ou(t,(function(t){return pe(t,e)}),n)},cu=function(t,e){return function(t,e){return X(t.dom.childNodes,(function(t){return e(Nt.fromDom(t))})).map(Nt.fromDom)}(t,(function(t){return pe(t,e)}))},su=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ve(n)?N.none():N.from(n.querySelector(t)).map(Nt.fromDom)}(e,t)},lu=function(t,e,n){return nu((function(t,e){return pe(t,e)}),uu,t,e,n)},fu=function(){var t=oa("aria-owns");return{id:t,link:function(e){je(e,"aria-owns",t)},unlink:function(t){Xe(t,"aria-owns")}}},du=function(t,e){return function(t){var e=iu(t,(function(t){if(!Vt(t))return!1;var e=qe(t,"id");return void 0!==e&&e.indexOf("aria-owns")>-1}));return e.bind((function(t){var e=qe(t,"id"),n=Be(t);return su(n,'[aria-owns="'+e+'"]')}))}(e).exists((function(e){return mu(t,e)}))},mu=function(t,e){return au(e,(function(e){return be(e,t.element)}),C)||du(t,e)},gu="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(ru||(ru={}));var hu=wo({}),pu=function(t,e,n){switch(bt(hu.get(),t).orThunk((function(){var e=st(hu.get());return ct(e,(function(e){return t.indexOf(e)>-1?N.some(hu.get()[e]):N.none()}))})).getOr(ru.NORMAL)){case ru.NORMAL:return n(yu());case ru.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();I(["mousemove","mouseover","mouseout",gi()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:U(n,(function(t){return I(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+ta(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case ru.STOP:return!0}},vu=["alloy/data/Fields","alloy/debugging/Debugging"],bu=function(t,e,n){return pu(t,e,n)},yu=p({logEventCut:g,logEventStopped:g,logNoParent:g,logEventNoHandlers:g,logEventResponse:g,write:g}),xu=p([Kr("menu"),Kr("selectedMenu")]),wu=p([Kr("item"),Kr("selectedItem")]);p(kr(wu().concat(xu())));var Cu=p(kr(wu())),Su=eo("initSize",[Kr("numColumns"),Kr("numRows")]),ku=function(){return eo("markers",[Kr("backgroundMenu")].concat(xu()).concat(wu()))},Ou=function(t){return eo("markers",U(t,Kr))},Eu=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return X(e,(function(t){return t.indexOf("alloy")>0&&!L(vu,(function(e){return t.indexOf(e)>-1}))})).getOr(gu)}}(),Gr(e,e,n,Lr((function(t){return Wn.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},_u=function(t){return Eu(0,t,lr(g))},Tu=function(t){return Eu(0,t,lr(N.none))},Mu=function(t){return Eu(0,t,{tag:"required",process:{}})},Du=function(t){return Eu(0,t,{tag:"required",process:{}})},zu=function(t,e){return $r(t,p(e))},Au=function(t){return $r(t,v)},Nu=p(Su),Bu=function(t,e,n,r,o,i,a,u){return void 0===u&&(u=!1),{x:t,y:e,bubble:n,direction:r,placement:o,restriction:i,label:a+"-"+o,alwaysFit:u}},Ru=Co([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Hu=Ru.southeast,Vu=Ru.southwest,Iu=Ru.northeast,Lu=Ru.northwest,Fu=Ru.south,Pu=Ru.north,Uu=Ru.east,ju=Ru.west,Wu=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},qu=function(t,e,n){return Math.min(Math.max(t,e),n)},Gu=function(t,e){return et(["left","right","top","bottom"],(function(n){return bt(e,n).map((function(e){return function(t,e){switch(e){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(t,e)}))}))},$u="layout",Xu=function(t){return t.x},Ku=function(t,e){return t.x+t.width/2-e.width/2},Yu=function(t,e){return t.x+t.width-e.width},Ju=function(t,e){return t.y-e.height},Qu=function(t){return t.y+t.height},Zu=function(t,e){return t.y+t.height/2-e.height/2},tc=function(t,e,n){return Bu(Xu(t),Qu(t),n.southeast(),Hu(),"southeast",Gu(t,{left:1,top:3}),$u)},ec=function(t,e,n){return Bu(Yu(t,e),Qu(t),n.southwest(),Vu(),"southwest",Gu(t,{right:0,top:3}),$u)},nc=function(t,e,n){return Bu(Xu(t),Ju(t,e),n.northeast(),Iu(),"northeast",Gu(t,{left:1,bottom:2}),$u)},rc=function(t,e,n){return Bu(Yu(t,e),Ju(t,e),n.northwest(),Lu(),"northwest",Gu(t,{right:0,bottom:2}),$u)},oc=function(t,e,n){return Bu(Ku(t,e),Ju(t,e),n.north(),Pu(),"north",Gu(t,{bottom:2}),$u)},ic=function(t,e,n){return Bu(Ku(t,e),Qu(t),n.south(),Fu(),"south",Gu(t,{top:3}),$u)},ac=function(t,e,n){return Bu(function(t){return t.x+t.width}(t),Zu(t,e),n.east(),Uu(),"east",Gu(t,{left:0}),$u)},uc=function(t,e,n){return Bu(function(t,e){return t.x-e.width}(t,e),Zu(t,e),n.west(),ju(),"west",Gu(t,{right:1}),$u)},cc=function(){return[tc,ec,nc,rc,ic,oc,ac,uc]},sc=function(){return[ec,tc,rc,nc,ic,oc,ac,uc]},lc=function(){return[nc,rc,tc,ec,oc,ic]},fc=function(){return[rc,nc,ec,tc,oc,ic]},dc=function(){return[tc,ec,nc,rc,ic,oc]},mc=function(){return[ec,tc,rc,nc,ic,oc]},gc=Object.freeze({__proto__:null,events:function(t){return Ri([Ii(ui(),(function(e,n){var r=t.channels,o=st(r),i=n,a=function(t,e){return e.universal?t:q(t,(function(t){return I(e.channels,t)}))}(o,i);j(a,(function(t){var n=r[t],o=n.schema,a=jr("channel["+t+"] data\nReceiver: "+ta(e.element),o,i.data);n.onReceive(e,a)}))}))])}}),hc=[Yr("channels",Fr(Wn.value,Sr([Mu("onReceive"),fo("schema",Mr())])))],pc=function(t,e,n){return Xi((function(r,o){n(r,t,e)}))},vc=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:ha(a.slice(0,1).concat(a.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:p(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},bc=function(t){return{key:t,value:void 0}},yc=function(t,e,n,r,o,i,a){var u=function(t){return xt(t,n)?t[n]():N.none()},c=dt(o,(function(t,e){return vc(n,t,e)})),s=dt(i,(function(t,e){return pa(t,e)})),l=O(O(O({},s),c),{revoke:y(bc,n),config:function(e){var r=jr(n+"-config",t,e);return{key:n,value:{config:r,me:l,configAsRaw:Pt((function(){return jr(n+"-config",t,e)})),initialConfig:e,state:a}}},schema:p(e),exhibit:function(t,e){return St(u(t),bt(r,"exhibit"),(function(t,n){return n(e,t.config,t.state)})).getOrThunk((function(){return Sa({})}))},name:p(n),handlers:function(t){return u(t).map((function(t){return bt(r,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return l},xc=function(t){return Eo(t)},wc=Sr([Kr("fields"),Kr("name"),fo("active",{}),fo("apis",{}),fo("state",xa),fo("extra",{})]),Cc=function(t){var e=jr("Creating behaviour: "+t.name,wc,t);return function(t,e,n,r,o,i){var a,u,c=Sr(t),s=lo(e,[(a="config",u=t,io(a,Sr(u)))]);return yc(c,s,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},Sc=Sr([Kr("branchKey"),Kr("branches"),Kr("name"),fo("active",{}),fo("apis",{}),fo("state",xa),fo("extra",{})]),kc=function(t){var e=jr("Creating behaviour: "+t.name,Sc,t);return function(t,e,n,r,o,i){var a=t,u=lo(e,[io("config",t)]);return yc(a,u,e,n,r,o,i)}(qr(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)},Oc=p(void 0),Ec=Cc({fields:hc,name:"receiving",active:gc}),_c=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({classes:[],styles:e.useFixed()?{}:{position:"relative"}})}}),Tc=function(){return Nt.fromDom(document)},Mc=function(t){return t.dom.focus()},Dc=function(t){var e=Be(t).dom;return t.dom===e.activeElement},zc=function(t){return void 0===t&&(t=Tc()),N.from(t.dom.activeElement).map(Nt.fromDom)},Ac=function(t){return zc(Be(t)).filter((function(e){return t.dom.contains(e.dom)}))},Nc=function(t,e){var n=Be(e),r=zc(n).bind((function(t){var n,r,o=function(e){return be(t,e)};return o(e)?N.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=Nt.fromDom(t.childNodes[e]);if(n(o))return N.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return N.none()})(e.dom))})),o=t(e);return r.each((function(t){zc(n).filter((function(e){return be(e,t)})).fold((function(){Mc(t)}),g)})),o},Bc=function(t,e,n,r,o){var i=function(t){return t+"px"};return{position:t,left:e.map(i),top:n.map(i),right:r.map(i),bottom:o.map(i)}},Rc=function(t,e){Ze(t,function(t){return O(O({},t),{position:N.some(t.position)})}(e))},Hc=Co([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Vc=function(t,e,n,r,o,i){var a=e.rect,u=a.x-n,c=a.y-r,s=o-(u+a.width),l=i-(c+a.height),f=N.some(u),d=N.some(c),m=N.some(s),g=N.some(l),h=N.none();return function(t,e,n,r,o,i,a,u,c){return t.fold(e,n,r,o,i,a,u,c)}(e.direction,(function(){return Bc(t,f,d,h,h)}),(function(){return Bc(t,h,d,m,h)}),(function(){return Bc(t,f,h,h,g)}),(function(){return Bc(t,h,h,m,g)}),(function(){return Bc(t,f,d,h,h)}),(function(){return Bc(t,f,h,h,g)}),(function(){return Bc(t,f,d,h,h)}),(function(){return Bc(t,h,d,m,h)}))},Ic=function(t,e){return t.fold((function(){var t=e.rect;return Bc("absolute",N.some(t.x),N.some(t.y),N.none(),N.none())}),(function(t,n,r,o){return Vc("absolute",e,t,n,r,o)}),(function(t,n,r,o){return Vc("fixed",e,t,n,r,o)}))},Lc=function(t,e){var n=y(Vn,e),r=t.fold(n,n,(function(){var t=zn();return Vn(e).translate(-t.left,-t.top)})),o=yn(e),i=fn(e);return In(r.left,r.top,o,i)},Fc=function(t,e){return e.fold((function(){return t.fold(Pn,Pn,In)}),(function(e){return t.fold(e,e,(function(){var n=e(),r=Pc(t,n.x,n.y);return In(r.left,r.top,n.width,n.height)}))}))},Pc=function(t,e,n){var r=mn(e,n);return t.fold(p(r),p(r),(function(){var t=zn();return r.translate(-t.left,-t.top)}))};Hc.none;var Uc,jc=Hc.relative,Wc=Hc.fixed,qc=function(t,e){return function(t,e){return{anchorBox:t,origin:e}}(t,e)},Gc="data-alloy-placement",$c=function(t){return Ge(t,Gc)},Xc=Co([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Kc=function(t,e,n,r){var o=t.bubble,i=o.offset,a=function(t,e,n){var r=function(r,o){return e[r].map((function(e){var i="top"===r||"bottom"===r,a=i?n.top:n.left,u=("left"===r||"top"===r?Math.max:Math.min)(e,o)+a;return i?qu(u,t.y,t.bottom):qu(u,t.x,t.right)})).getOr(o)},o=r("left",t.x),i=r("top",t.y),a=r("right",t.right),u=r("bottom",t.bottom);return In(o,i,a-o,u-i)}(r,t.restriction,i),u=t.x+i.left,c=t.y+i.top,s=In(u,c,e,n),l=function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:a>=n&&a<=o&&u>=r&&u<=i,sizeInBounds:c<=o&&c>=n&&s<=i&&s>=r,visibleW:Math.min(l,a>=n?o-a:c-n),visibleH:Math.min(f,u>=r?i-u:s-r)}}(s,a),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,h=f&&d,v=h?s:function(t,e){var n=e.x,r=e.y,o=e.right,i=e.bottom,a=t.x,u=t.y,c=t.width,s=t.height,l=Math.max(n,o-c),f=Math.max(r,i-s),d=qu(a,n,l),m=qu(u,r,f),g=Math.min(d+c,o)-d,h=Math.min(m+s,i)-m;return In(d,m,g,h)}(s,a),b=v.width>0&&v.height>0,y=function(t,e,n){var r=p(e.bottom-n.y),o=p(n.bottom-e.y),i=function(t,e,n,r){return t.fold(e,e,r,r,e,r,n,n)}(t,o,o,r),a=p(e.right-n.x),u=p(n.right-e.x),c=function(t,e,n,r){return t.fold(e,r,e,r,n,n,e,r)}(t,u,u,a);return{maxWidth:c,maxHeight:i}}(t.direction,v,r),x=y.maxWidth,w={rect:v,maxHeight:y.maxHeight,maxWidth:x,direction:t.direction,placement:t.placement,classes:{on:o.classesOn,off:o.classesOff},layout:t.label,testY:c};return h||t.alwaysFit?Xc.fit(w):Xc.nofit(w,m,g,b)},Yc=function(t){var e=wo(N.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(N.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(N.some(t))}}},Jc=function(){return Yc((function(t){return t.destroy()}))},Qc=function(){return Yc((function(t){return t.unbind()}))},Zc=function(){var t=Yc(g);return O(O({},t),{on:function(e){return t.get().each(e)}})},ts=S,es=function(t,e,n){return function(t,e,n,r){return wn(t,e,n,r,!1)}(t,e,ts,n)},ns=function(t,e,n){return function(t,e,n,r){return wn(t,e,n,r,!0)}(t,e,ts,n)},rs=xn,os=["top","bottom","right","left"],is="data-alloy-transition-timer",as=function(t,e){return function(t,e){return Q(e,(function(e){return Fa(t,e)}))}(t,e.classes)},us=function(t,e){var n=function(t){return parseFloat(t).toFixed(3)};return pt(e,(function(e,r){var o,i,a,u=t[r].map(n),c=e.map(n);return void 0===a&&(a=b),!St(o=u,i=c,a).getOr(o.isNone()&&i.isNone())})).isSome()},cs=function(t,e){var n,o=Qc(),i=Qc(),a=function(e){var n,r=null!==(n=e.raw.pseudoElement)&&void 0!==n?n:"";return be(e.target,t)&&!Dt(r)&&I(os,e.raw.propertyName)},u=function(r){if(s(r)||a(r)){o.clear(),i.clear();var u=null==r?void 0:r.raw.type;(s(u)||u===Zo())&&(clearTimeout(n),Xe(t,is),Ua(t,e.classes))}},c=function(){o.set(es(t,Zo(),u)),i.set(es(t,Qo(),u))};if("ontransitionstart"in t.dom)var l=es(t,ti(),(function(t){a(t)&&(l.unbind(),c())}));else c();var f=function(t){var e=function(e){var n=tn(t,e),o=r(n)?n.split(/\s*,\s*/):[];return q(o,Dt)},n=function(t){if(r(t)&&/^[\d.]+/.test(t)){var e=parseFloat(t);return Tt(t,"ms")?e:1e3*e}return 0},o=e("transition-delay"),i=e("transition-duration");return $(i,(function(t,e,r){var i=n(o[r])+n(e);return Math.max(t,i)}),0)}(t);requestAnimationFrame((function(){n=setTimeout(u,f+17),je(t,is,n)}))},ss=function(t,e,n,r,o,i){var a=function(t,e,n){return n.exists((function(n){var r=t.mode;return"all"===r||n[r]!==e[r]}))}(r,o,i);if(a||as(t,r)){Je(t,"position",n.position);var u=Lc(e,t),c=Ic(e,O(O({},o),{rect:u})),s=et(os,(function(t){return c[t]}));us(n,s)&&(Ze(t,s),a&&function(t,e){Pa(t,e.classes),Ge(t,is).each((function(e){clearTimeout(parseInt(e,10)),Xe(t,is)})),cs(t,e)}(t,r),un(t))}else Ua(t,r.classes)},ls=function(t,e,n,r){an(e,"max-height"),an(e,"max-width");var o,i={width:yn(o=e),height:fn(o)};return function(t,e,n,r,o,i){var a=r.width,u=r.height,c=function(e,c,s,l,f){var d=e(n,r,o,t,i),m=Kc(d,a,u,i);return m.fold(p(m),(function(t,e,n,r){return(f===r?n>l||e>s:!f&&r)?m:Xc.nofit(c,s,l,f)}))},s=$(e,(function(t,e){var n=y(c,e);return t.fold(p(t),n)}),Xc.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:Hu(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(v,v)}(e,r.preference,t,i,n,r.bounds)},fs=function(t,e){!function(t,e){je(t,Gc,e)}(t,e.placement)},ds=function(t,e){!function(t,e){var n=sn.max(t,e,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Je(t,"max-height",n+"px")}(t,Math.floor(e))},ms=p((function(t,e){ds(t,e),Qe(t,{"overflow-x":"hidden","overflow-y":"auto"})})),gs=p((function(t,e){ds(t,e)})),hs=function(t,e,n){return void 0===t[e]?n:t[e]},ps=function(t,e,n,r){var o=ls(t,e,n,r);return function(t,e,n){var r=Ic(n.origin,e);n.transition.each((function(o){ss(t,n.origin,r,o,e,n.lastPlacement)})),Rc(t,r)}(e,o,r),fs(e,o),function(t,e){var n=e.classes;Ua(t,n.off),Pa(t,n.on)}(e,o),function(t,e,n){(0,n.maxHeightFunction)(t,e.maxHeight)}(e,o,r),function(t,e,n){(0,n.maxWidthFunction)(t,e.maxWidth)}(e,o,r),{layout:o.layout,placement:o.placement}},vs=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],bs=function(t,e,n,r){void 0===r&&(r=1);var o=t*r,i=e*r,a=function(t){return bt(n,t).getOr([])},u=function(t,e,n){var r=tt(vs,n);return{offset:mn(t,e),classesOn:J(n,a),classesOff:J(r,a)}};return{southeast:function(){return u(-t,e,["top","alignLeft"])},southwest:function(){return u(t,e,["top","alignRight"])},south:function(){return u(-t/2,e,["top","alignCentre"])},northeast:function(){return u(-t,-e,["bottom","alignLeft"])},northwest:function(){return u(t,-e,["bottom","alignRight"])},north:function(){return u(-t/2,-e,["bottom","alignCentre"])},east:function(){return u(t,-e/2,["valignCentre","left"])},west:function(){return u(-t,-e/2,["valignCentre","right"])},insetNortheast:function(){return u(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return u(-o,i,["top","alignRight","inset"])},insetNorth:function(){return u(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return u(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return u(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return u(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return u(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return u(o,-i/2,["valignCentre","left","inset"])}}},ys=function(){return bs(0,0,{})},xs=v,ws=function(t,e){return function(n){return"rtl"===Cs(n)?e:t}},Cs=function(t){return"rtl"===tn(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Uc||(Uc={}));var Ss="data-alloy-vertical-dir",ks=function(t){return au(t,(function(t){return Vt(t)&&qe(t,"data-alloy-vertical-dir")===Uc.BottomToTop}))},Os=function(){return lo("layouts",[Kr("onLtr"),Kr("onRtl"),oo("onBottomLtr"),oo("onBottomRtl")])},Es=function(t,e,n,r,o,i,a){var u=a.map(ks).getOr(!1),c=e.layouts.map((function(e){return e.onLtr(t)})),s=e.layouts.map((function(e){return e.onRtl(t)})),l=u?e.layouts.bind((function(e){return e.onBottomLtr.map((function(e){return e(t)}))})).or(c).getOr(o):c.getOr(n),f=u?e.layouts.bind((function(e){return e.onBottomRtl.map((function(e){return e(t)}))})).or(s).getOr(i):s.getOr(r);return ws(l,f)(t)},_s=[Kr("hotspot"),oo("bubble"),fo("overrides",{}),Os(),zu("placement",(function(t,e,n){var r=e.hotspot,o=Lc(n,r.element),i=Es(t.element,e,dc(),mc(),lc(),fc(),N.some(e.hotspot.element));return N.some(xs({anchorBox:o,bubble:e.bubble.getOr(ys()),overrides:e.overrides,layouts:i,placer:N.none()}))}))],Ts=[Kr("x"),Kr("y"),fo("height",0),fo("width",0),fo("bubble",ys()),fo("overrides",{}),Os(),zu("placement",(function(t,e,n){var r=Pc(n,e.x,e.y),o=In(r.left,r.top,e.width,e.height),i=Es(t.element,e,cc(),sc(),cc(),sc(),N.none());return N.some(xs({anchorBox:o,bubble:e.bubble,overrides:e.overrides,layouts:i,placer:N.none()}))}))],Ms=Co([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ds=function(t){return t.fold(v,(function(t,e,n){return t.translate(-e,-n)}))},zs=function(t){return t.fold(v,v)},As=function(t){return $(t,(function(t,e){return t.translate(e.left,e.top)}),mn(0,0))},Ns=function(t){var e=U(t,zs);return As(e)},Bs=Ms.screen,Rs=Ms.absolute,Hs=function(t,e,n){var r=we(t.element),o=zn(r),i=function(t,e,n){var r=ke(n.root).dom;return N.from(r.frameElement).map(Nt.fromDom).filter((function(e){var n=we(e),r=we(t.element);return be(n,r)})).map(hn)}(t,0,n).getOr(o);return Rs(i,o.left,o.top)},Vs=function(t,e,n,r){var o=Bs(mn(t,e));return N.some(function(t,e,n){return{point:t,width:e,height:n}}(o,n,r))},Is=function(t,e,n,r,o){return t.map((function(t){var i,a,u,c=[e,t.point],s=(i=function(){return Ns(c)},a=function(){return Ns(c)},u=function(){return function(t){var e=U(t,Ds);return As(e)}(c)},r.fold(i,a,u)),l=function(t,e,n,r){return{x:t,y:e,width:n,height:r}}(s.left,s.top,t.width,t.height),f=n.showAbove?lc():dc(),d=n.showAbove?fc():mc(),m=Es(o,n,f,d,f,d,N.none());return xs({anchorBox:l,bubble:n.bubble.getOr(ys()),overrides:n.overrides,layouts:m,placer:N.none()})}))},Ls=[Kr("node"),Kr("root"),oo("bubble"),Os(),fo("overrides",{}),fo("showAbove",!1),zu("placement",(function(t,e,n){var r=Hs(t,0,e);return e.node.filter(Le).bind((function(o){var i=o.dom.getBoundingClientRect(),a=Vs(i.left,i.top,i.width,i.height),u=e.node.getOr(t.element);return Is(a,r,e,n,u)}))}))],Fs=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Ps=Co([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Us=(Ps.before,Ps.on,Ps.after,function(t){return t.fold(v,v,v)}),js=Co([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ws={domRange:js.domRange,relative:js.relative,exact:js.exact,exactFromRange:function(t){return js.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return Nt.fromDom(t.startContainer)},relative:function(t,e){return Us(t)},exact:function(t,e,n,r){return t}})}(t);return ke(e)},range:Fs},qs=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},Gs=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},$s=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},Xs=Co([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ks=function(t,e,n){return e(Nt.fromDom(n.startContainer),n.startOffset,Nt.fromDom(n.endContainer),n.endOffset)},Ys=function(t,e){var n=function(t,e){return e.match({domRange:function(t){return{ltr:p(t),rtl:N.none}},relative:function(e,n){return{ltr:Pt((function(){return qs(t,e,n)})),rtl:Pt((function(){return N.some(qs(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:Pt((function(){return Gs(t,e,n,r,o)})),rtl:Pt((function(){return N.some(Gs(t,r,o,e,n))}))}}})}(t,e);return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return Xs.rtl(Nt.fromDom(t.endContainer),t.endOffset,Nt.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Ks(0,Xs.ltr,n)})):Ks(0,Xs.ltr,n)}(0,n)},Js=function(t,e){return Ys(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})};Xs.ltr,Xs.rtl;var Qs,Zs=function(t,e){var n=function(e){return t(e)?N.from(e.dom.nodeValue):N.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(It,"text"),tl=function(t){return Zs.getOption(t)},el=["img","br"],nl=function(t){var e=tl(t).filter((function(t){return 0!==t.trim().length||t.indexOf(" ")>-1})).isSome();return e||I(el,Rt(t))},rl=function(t,e){var n=function(t){for(var r=_e(t),o=r.length-1;o>=0;o--){var i=r[o];if(e(i))return N.some(i);var a=n(i);if(a.isSome())return a}return N.none()};return n(t)},ol=function(t,e){return function(t,e){var n=void 0===e?document:e.dom;return ve(n)?[]:U(n.querySelectorAll(t),Nt.fromDom)}(e,t)},il=function(t,e,n,r){var o=function(t,e,n,r){var o=we(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=be(t,n)&&e===r;return o.collapsed&&!i},al=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return N.some(Fs(Nt.fromDom(e.startContainer),e.startOffset,Nt.fromDom(n.endContainer),n.endOffset))}return N.none()},ul=function(t){if(null===t.anchorNode||null===t.focusNode)return al(t);var e=Nt.fromDom(t.anchorNode),n=Nt.fromDom(t.focusNode);return il(e,t.anchorOffset,n,t.focusOffset)?N.some(Fs(e,t.anchorOffset,n,t.focusOffset)):al(t)},cl=function(t){return function(t){return N.from(t.getSelection())}(t).filter((function(t){return t.rangeCount>0})).bind(ul)},sl=function(t,e){return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?N.some(n).map($s):N.none()}(Js(t,e))},ll=function(t,e){return function(t){var e=t.getBoundingClientRect();return e.width>0||e.height>0?N.some(e).map($s):N.none()}(Js(t,e))},fl=function(t,e){return{element:t,offset:e}},dl=function(t,e){var n=_e(t);if(0===n.length)return fl(t,e);if(e<n.length)return fl(n[e],0);var r=n[n.length-1],o=It(r)?function(t){return Zs.get(t)}(r).length:_e(r).length;return fl(r,o)},ml=function(t,e){return It(t)?fl(t,e):dl(t,e)},gl=function(t,e){return e.getSelection.getOrThunk((function(){return function(){return cl(t)}}))().map((function(t){var e=ml(t.start,t.soffset),n=ml(t.finish,t.foffset);return Ws.range(e.element,e.offset,n.element,n.offset)}))},hl=[oo("getSelection"),Kr("root"),oo("bubble"),Os(),fo("overrides",{}),fo("showAbove",!1),zu("placement",(function(t,e,n){var r=ke(e.root).dom,o=Hs(t,0,e),i=gl(r,e).bind((function(t){var e=ll(r,Ws.exactFromRange(t)).orThunk((function(){var e=Nt.fromText("\ufeff");Sn(t.start,e);var n=sl(r,Ws.exact(e,0,e,1));return Mn(e),n}));return e.bind((function(t){return Vs(t.left,t.top,t.width,t.height)}))})),a=gl(r,e).bind((function(t){return Vt(t.start)?N.some(t.start):function(t){return Oe(t)}(t.start)})),u=a.getOr(t.element);return Is(i,o,e,n,u)}))],pl="link-layout",vl=function(t){return t.x+t.width},bl=function(t,e){return t.x-e.width},yl=function(t,e){return t.y-e.height+t.height},xl=function(t){return t.y},wl=function(t,e,n){return Bu(vl(t),xl(t),n.southeast(),Hu(),"southeast",Gu(t,{left:0,top:2}),pl)},Cl=function(t,e,n){return Bu(bl(t,e),xl(t),n.southwest(),Vu(),"southwest",Gu(t,{right:1,top:2}),pl)},Sl=function(t,e,n){return Bu(vl(t),yl(t,e),n.northeast(),Iu(),"northeast",Gu(t,{left:0,bottom:3}),pl)},kl=function(t,e,n){return Bu(bl(t,e),yl(t,e),n.northwest(),Lu(),"northwest",Gu(t,{right:1,bottom:3}),pl)},Ol=function(){return[wl,Cl,Sl,kl]},El=function(){return[Cl,wl,kl,Sl]},_l=[Kr("item"),Os(),fo("overrides",{}),zu("placement",(function(t,e,n){var r=Lc(n,e.item.element),o=Es(t.element,e,Ol(),El(),Ol(),El(),N.none());return N.some(xs({anchorBox:r,bubble:ys(),overrides:e.overrides,layouts:o,placer:N.none()}))}))],Tl=qr("type",{selection:hl,node:Ls,hotspot:_s,submenu:_l,makeshift:Ts}),Ml=[ro("classes",Ar),po("mode","all",["all","layout","placement"])],Dl=[fo("useFixed",C),oo("getBounds")],zl=[Yr("anchor",Tl),lo("transition",Ml)],Al=function(t,e,n,r,o,i,a){return function(t,e,n,r,o,i,a,u){var c=hs(a,"maxHeightFunction",ms()),s=hs(a,"maxWidthFunction",g),l=t.anchorBox,f=t.origin,d={bounds:Fc(f,i),origin:f,preference:r,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:o,transition:u};return ps(l,e,n,d)}(qc(n.anchorBox,e),o.element,n.bubble,n.layouts,i,r,n.overrides,a)},Nl=function(t,e,n,r,o,i){var a=i.map(Ln);return Bl(t,e,n,r,o,a)},Bl=function(t,e,n,r,o,i){var a=jr("placement.info",kr(zl),o),u=a.anchor,c=r.element,s=n.get(r.uid);Nc((function(){Je(c,"position","fixed");var o=nn(c,"visibility");Je(c,"visibility","hidden");var l=e.useFixed()?function(){var t=document.documentElement;return Wc(0,0,t.clientWidth,t.clientHeight)}():function(t){var e=hn(t.element),n=t.element.dom.getBoundingClientRect();return jc(e.left,e.top,n.width,n.height)}(t),f=u.placement,d=i.map(p).or(e.getBounds);f(t,u,l).each((function(e){var o=e.placer.getOr(Al)(t,l,e,d,r,s,a.transition);n.set(r.uid,o)})),o.fold((function(){an(c,"visibility")}),(function(t){Je(c,"visibility",t)})),nn(c,"left").isNone()&&nn(c,"top").isNone()&&nn(c,"right").isNone()&&nn(c,"bottom").isNone()&&wt(nn(c,"position"),"fixed")&&an(c,"position")}),c)},Rl=Object.freeze({__proto__:null,position:function(t,e,n,r,o){Nl(t,e,n,r,o,N.none())},positionWithin:Nl,positionWithinBounds:Bl,getMode:function(t,e,n){return e.useFixed()?"fixed":"absolute"},reset:function(t,e,n,r){var o=r.element;j(["position","left","right","top","bottom"],(function(t){return an(o,t)})),function(t){Xe(t,Gc)}(o),n.clear(r.uid)}}),Hl=Object.freeze({__proto__:null,init:function(){var t={};return wa({readState:function(){return t},clear:function(e){l(e)?delete t[e]:t={}},set:function(e,n){t[e]=n},get:function(e){return bt(t,e)}})}}),Vl=Cc({fields:Dl,name:"positioning",active:_c,apis:Rl,state:Hl}),Il=function(t){Mi(t,xi());var e=t.components();j(e,Il)},Ll=function(t){var e=t.components();j(e,Ll),Mi(t,yi())},Fl=function(t,e){En(t.element,e.element)},Pl=function(t,e){var n=t.components();!function(t){j(t.components(),(function(t){return Mn(t.element)})),Tn(t.element),t.syncComponents()}(t);var r=tt(n,e);j(r,(function(e){Il(e),t.getSystem().removeFromWorld(e)})),j(e,(function(e){e.getSystem().isConnected()?Fl(t,e):(t.getSystem().addToWorld(e),Fl(t,e),Le(t.element)&&Ll(e)),t.syncComponents()}))},Ul=function(t,e){jl(t,e,En)},jl=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),Le(t.element)&&Ll(e),t.syncComponents()},Wl=function(t){Il(t),Mn(t.element),t.getSystem().removeFromWorld(t)},ql=function(t){var e=Oe(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));Wl(t),e.each((function(t){t.syncComponents()}))},Gl=function(t){var e=t.components();j(e,Wl),Tn(t.element),t.syncComponents()},$l=function(t,e){Xl(t,e,En)},Xl=function(t,e,n){n(t,e.element);var r=_e(e.element);j(r,(function(t){e.getByDom(t).each(Ll)}))},Kl=function(t){var e=_e(t.element);j(e,(function(e){t.getByDom(e).each(Il)})),Mn(t.element)},Yl=function(t,e,n,r){n.get().each((function(e){Gl(t)}));var o=e.getAttachPoint(t);Ul(o,t);var i=t.getSystem().build(r);return Ul(t,i),n.set(i),i},Jl=function(t,e,n,r){var o=Yl(t,e,n,r);return e.onOpen(t,o),o},Ql=function(t,e,n){n.get().each((function(r){Gl(t),ql(t),e.onClose(t,r),n.clear()}))},Zl=function(t,e,n){return n.isOpen()},tf=function(t,e,n){var r=e.getAttachPoint(t);Je(t.element,"position",Vl.getMode(r)),function(t,e,n,r){nn(t.element,e).fold((function(){Xe(t.element,n)}),(function(e){je(t.element,n,e)})),Je(t.element,e,r)}(t,"visibility",e.cloakVisibilityAttr,"hidden")},ef=function(t,e,n){(function(t){return L(["top","left","right","bottom"],(function(e){return nn(t,e).isSome()}))})(t.element)||an(t.element,"position"),function(t,e,n){Ge(t.element,n).fold((function(){return an(t.element,e)}),(function(n){return Je(t.element,e,n)}))}(t,"visibility",e.cloakVisibilityAttr)},nf=Object.freeze({__proto__:null,cloak:tf,decloak:ef,open:Jl,openWhileCloaked:function(t,e,n,r,o){tf(t,e),Jl(t,e,n,r),o(),ef(t,e)},close:Ql,isOpen:Zl,isPartOf:function(t,e,n,r){return Zl(0,0,n)&&n.get().exists((function(n){return e.isPartOf(t,n,r)}))},getState:function(t,e,n){return n.get()},setContent:function(t,e,n,r){return n.get().map((function(){return Yl(t,e,n,r)}))}}),rf=Object.freeze({__proto__:null,events:function(t,e){return Ri([Ii(di(),(function(n,r){Ql(n,t,e)}))])}}),of=[_u("onOpen"),_u("onClose"),Kr("isPartOf"),Kr("getAttachPoint"),fo("cloakVisibilityAttr","data-precloak-visibility")],af=Object.freeze({__proto__:null,init:function(){var t=Zc(),e=p("not-implemented");return wa({readState:e,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}}),uf=Cc({fields:of,name:"sandboxing",active:rf,apis:nf,state:af}),cf=p("dismiss.popups"),sf=p("reposition.popups"),lf=p("mouse.released"),ff=Sr([fo("isExtraPart",C),lo("fireEventInstead",[fo("event",wi())])]),df=function(t){var e,n=jr("Dismissal",ff,t);return(e={})[cf()]={schema:Sr([Kr("target")]),onReceive:function(t,e){uf.isOpen(t)&&(uf.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold((function(){return uf.close(t)}),(function(e){return Mi(t,e.event)})))}},e},mf=Sr([lo("fireEventInstead",[fo("event",Ci())]),to("doReposition")]),gf=function(t){var e,n=jr("Reposition",mf,t);return(e={})[sf()]={onReceive:function(t){uf.isOpen(t)&&n.fireEventInstead.fold((function(){return n.doReposition(t)}),(function(e){return Mi(t,e.event)}))}},e},hf=function(t,e,n){e.store.manager.onLoad(t,e,n)},pf=function(t,e,n){e.store.manager.onUnload(t,e,n)},vf=Object.freeze({__proto__:null,onLoad:hf,onUnload:pf,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),bf=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[Gi((function(n,r){hf(n,t,e)})),$i((function(n,r){pf(n,t,e)}))]:[pc(t,e,hf)];return Ri(n)}}),yf=function(){var t=wo(null);return wa({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},xf=function(){var t=wo({}),e=wo({});return wa({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:e.get()}},lookup:function(n){return bt(t.get(),n).orThunk((function(){return bt(e.get(),n)}))},update:function(n){var r=t.get(),o=e.get(),i={},a={};j(n,(function(t){i[t.value]=t,bt(t,"meta").each((function(e){bt(e,"text").each((function(e){a[e]=t}))}))})),t.set(O(O({},r),i)),e.set(O(O({},o),a))},clear:function(){t.set({}),e.set({})}})},wf=Object.freeze({__proto__:null,memory:yf,dataset:xf,manual:function(){return wa({readState:g})},init:function(t){return t.store.manager.state(t)}}),Cf=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Sf=[oo("initialValue"),Kr("getFallbackEntry"),Kr("getDataKey"),Kr("setValue"),zu("manager",{setValue:Cf,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){Cf(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:xf})],kf=[Kr("getValue"),fo("setValue",g),oo("initialValue"),zu("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:g,state:xa.init})],Of=[oo("initialValue"),zu("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:yf})],Ef=[mo("store",{mode:"memory"},qr("mode",{memory:Of,manual:kf,dataset:Sf})),_u("onSetValue"),fo("resetOnDom",!1)],_f=Cc({fields:Ef,name:"representing",active:bf,apis:vf,extra:{setValueFrom:function(t,e){var n=_f.getValue(e);_f.setValue(t,n)}},state:wf}),Tf=function(t,e){return xo(t,{},U(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,Gr(n,n,{tag:"option",process:{}},pr((function(t){return Qn("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([$r("dump",v)]))},Mf=function(t){return t.dump},Df=function(t,e){return O(O({},xc(e)),t.dump)},zf=Tf,Af=Df,Nf="placeholder",Bf=Co([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Rf=function(t){return yt(t,"uiType")},Hf=function(t,e,n,r){return Rf(n)&&n.uiType===Nf?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?Bf.single(!0,p(n)):bt(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+st(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):Bf.single(!1,p(n))},Vf=function(t,e,n,r){return Hf(t,0,n,r).fold((function(o,i){var a=Rf(n)?i(e,n.config,n.validated):i(e),u=bt(a,"components").getOr([]),c=J(u,(function(n){return Vf(t,e,n,r)}));return[O(O({},a),{components:c})]}),(function(t,r){if(Rf(n)){var o=r(e,n.config,n.validated);return n.validated.preprocess.getOr(v)(o)}return r(e)}))},If=function(t,e,n,r){var o=dt(r,(function(t,e){return r=t,o=!1,{name:p(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return J(n,(function(n){return Vf(t,e,n,r)}))}(t,e,n,o);return ft(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},Lf=Bf.single,Ff=Bf.multiple,Pf=p(Nf),Uf=Co([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),jf=fo("factory",{sketch:v}),Wf=fo("schema",[]),qf=Kr("name"),Gf=Gr("pname","pname",sr((function(t){return"<alloy."+oa(t.name)+">"})),Mr()),$f=$r("schema",(function(){return[oo("preprocess")]})),Xf=fo("defaults",p({})),Kf=fo("overrides",p({})),Yf=kr([jf,Wf,qf,Gf,Xf,Kf]),Jf=kr([jf,Wf,qf,Xf,Kf]),Qf=kr([jf,Wf,qf,Gf,Xf,Kf]),Zf=kr([jf,$f,qf,Kr("unit"),Gf,Xf,Kf]),td=function(t){return t.fold(N.some,N.none,N.some,N.some)},ed=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},nd=function(t,e){return function(n){var r=jr("Converting part type",e,n);return t(r)}},rd=nd(Uf.required,Yf),od=nd(Uf.external,Jf),id=nd(Uf.optional,Qf),ad=nd(Uf.group,Zf),ud=p("entirety"),cd=Object.freeze({__proto__:null,required:rd,external:od,optional:id,group:ad,asNamedPart:td,name:ed,asCommon:function(t){return t.fold(v,v,v,v)},original:ud}),sd=function(t,e,n,r){return ur(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},ld=function(t,e){var n={};return j(e,(function(e){td(e).each((function(e){var r=fd(t,e.pname);n[e.name]=function(n){var o=jr("Part: "+e.name+" in "+t,kr(e.schema),n);return O(O({},r),{config:n,validated:o})}}))})),n},fd=function(t,e){return{uiType:Pf(),owner:t,name:e}},dd=function(t,e,n){return{uiType:Pf(),owner:t,name:e,config:n,validated:{}}},md=function(t){return J(t,(function(t){return t.fold(N.none,N.some,N.none,N.none).map((function(t){return eo(t.name,t.schema.concat([Au(ud())]))})).toArray()}))},gd=function(t){return U(t,ed)},hd=function(t,e,n){return function(t,e,n){var r={},o={};return j(n,(function(t){t.fold((function(t){r[t.pname]=Lf(!0,(function(e,n,r){return t.factory.sketch(sd(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=p(t.factory.sketch(sd(e,t,n[ud()]),n))}),(function(t){r[t.pname]=Lf(!1,(function(e,n,r){return t.factory.sketch(sd(e,t,n,r))}))}),(function(t){r[t.pname]=Ff(!0,(function(e,n,r){var o=e[t.name];return U(o,(function(n){return t.factory.sketch(ur(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:p(r),externals:p(o)}}(0,e,n)},pd=function(t,e,n){return If(N.some(t),e,e.components,n)},vd=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},bd=function(t,e,n){return vd(t,e,n).getOrDie("Could not find part: "+n)},yd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return j(n,(function(t){r[t]=p(i.getByUid(o[t]))})),r},xd=function(t,e){var n=t.getSystem();return dt(e.partUids,(function(t,e){return p(n.getByUid(t))}))},wd=function(t){return st(t.partUids)},Cd=function(t,e,n){var r={},o=e.partUids,i=t.getSystem();return j(n,(function(t){r[t]=p(i.getByUid(o[t]).getOrDie())})),r},Sd=function(t,e){var n=gd(e);return Eo(U(n,(function(e){return{key:e,value:t+"-"+e}})))},kd=function(t){return Gr("partUids","partUids",fr((function(e){return Sd(e.uid,t)})),Mr())},Od=Object.freeze({__proto__:null,generate:ld,generateOne:dd,schemas:md,names:gd,substitutes:hd,components:pd,defaultUids:Sd,defaultUidsSchema:kd,getAllParts:xd,getAllPartNames:wd,getPart:vd,getPartOrDie:bd,getParts:yd,getPartsOrDie:Cd}),Ed=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[eo("parts",t)]:[]).concat([Kr("uid"),fo("dom",{}),fo("components",[]),Au("originalSpec"),fo("debug.sketcher",{})]).concat(e)}(r,o);return jr(t+" [SpecSchema]",Sr(i.concat(e)),n)},_d=function(t,e,n,r,o){var i=Td(o),a=md(n),u=kd(n),c=Ed(t,e,i,a,[u]),s=hd(0,c,n);return r(c,pd(t,c,s.internals()),i,s.externals())},Td=function(t){return function(t){return yt(t,"uid")}(t)?t:O(O({},t),{uid:fa("uid")})},Md=Sr([Kr("name"),Kr("factory"),Kr("configFields"),fo("apis",{}),fo("extraApis",{})]),Dd=Sr([Kr("name"),Kr("factory"),Kr("configFields"),Kr("partFields"),fo("apis",{}),fo("extraApis",{})]),zd=function(t){var e=jr("Sketcher for "+t.name,Md,t),n=dt(e.apis,ya),r=dt(e.extraApis,(function(t,e){return pa(t,e)}));return O(O({name:e.name,configFields:e.configFields,sketch:function(t){return function(t,e,n,r){var o=Td(r);return n(Ed(t,e,o,[],[]),o)}(e.name,e.configFields,e.factory,t)}},n),r)},Ad=function(t){var e=jr("Sketcher for "+t.name,Dd,t),n=ld(e.name,e.partFields),r=dt(e.apis,ya),o=dt(e.extraApis,(function(t,e){return pa(t,e)}));return O(O({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(t){return _d(e.name,e.configFields,e.partFields,e.factory,t)},parts:n},r),o)},Nd=function(t){return"input"===Rt(t)&&"radio"!==qe(t,"type")||"textarea"===Rt(t)},Bd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),Rd=[Kr("find")],Hd=Cc({fields:Rd,name:"composing",apis:Bd}),Vd=["input","button","textarea","select"],Id=function(t,e,n){(e.disabled()?Wd:qd)(t,e)},Ld=function(t,e){return!0===e.useNative&&I(Vd,Rt(t.element))},Fd=function(t){je(t.element,"disabled","disabled")},Pd=function(t){Xe(t.element,"disabled")},Ud=function(t){je(t.element,"aria-disabled","true")},jd=function(t){je(t.element,"aria-disabled","false")},Wd=function(t,e,n){e.disableClass.each((function(e){Va(t.element,e)})),(Ld(t,e)?Fd:Ud)(t),e.onDisabled(t)},qd=function(t,e,n){e.disableClass.each((function(e){La(t.element,e)})),(Ld(t,e)?Pd:jd)(t),e.onEnabled(t)},Gd=function(t,e){return Ld(t,e)?function(t){return $e(t.element,"disabled")}(t):function(t){return"true"===qe(t.element,"aria-disabled")}(t)},$d=Object.freeze({__proto__:null,enable:qd,disable:Wd,isDisabled:Gd,onLoad:Id,set:function(t,e,n,r){(r?Wd:qd)(t,e)}}),Xd=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Ri([Hi(ci(),(function(e,n){return Gd(e,t)})),pc(t,e,Id)])}}),Kd=[bo("disabled",C),fo("useNative",!0),oo("disableClass"),_u("onDisabled"),_u("onEnabled")],Yd=Cc({fields:Kd,name:"disabling",active:Xd,apis:$d}),Jd=function(t,e,n,r){var o=ol(t.element,"."+e.highlightClass);j(o,(function(n){L(r,(function(t){return t.element===n}))||(La(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),Mi(n,Ti())})))}))},Qd=function(t,e,n,r){Jd(t,e,0,[r]),Zd(t,e,n,r)||(Va(r.element,e.highlightClass),e.onHighlight(t,r),Mi(r,_i()))},Zd=function(t,e,n,r){return Fa(r.element,e.highlightClass)},tm=function(t,e,n,r){var o=ol(t.element,"."+e.itemClass);return N.from(o[r]).fold((function(){return Wn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},em=function(t,e,n){return su(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},nm=function(t,e,n){var r=ol(t.element,"."+e.itemClass);return(r.length>0?N.some(r[r.length-1]):N.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},rm=function(t,e,n,r){var o=ol(t.element,"."+e.itemClass),i=K(o,(function(t){return Fa(t,e.highlightClass)}));return i.bind((function(e){var n=Wu(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},om=function(t,e,n){var r=ol(t.element,"."+e.itemClass);return Ct(U(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},im=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Jd(t,e,0,[])},dehighlight:function(t,e,n,r){Zd(t,e,n,r)&&(La(r.element,e.highlightClass),e.onDehighlight(t,r),Mi(r,Ti()))},highlight:Qd,highlightFirst:function(t,e,n){em(t,e).each((function(r){Qd(t,e,n,r)}))},highlightLast:function(t,e,n){nm(t,e).each((function(r){Qd(t,e,n,r)}))},highlightAt:function(t,e,n,r){tm(t,e,n,r).fold((function(t){throw t}),(function(r){Qd(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=om(t,e);X(o,r).each((function(r){Qd(t,e,n,r)}))},isHighlighted:Zd,getHighlighted:function(t,e,n){return su(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:em,getLast:nm,getPrevious:function(t,e,n){return rm(t,e,0,-1)},getNext:function(t,e,n){return rm(t,e,0,1)},getCandidates:om}),am=[Kr("highlightClass"),Kr("itemClass"),_u("onHighlight"),_u("onDehighlight")],um=Cc({fields:am,name:"highlighting",apis:im}),cm=[8],sm=[9],lm=[13],fm=[27],dm=[32],mm=[37],gm=[38],hm=[39],pm=[40],vm=function(t,e,n){var r=Z(t.slice(0,e)),o=Z(t.slice(e+1));return X(r.concat(o),n)},bm=function(t,e,n){var r=Z(t.slice(0,e));return X(r,n)},ym=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return X(o.concat(r),n)},xm=function(t,e,n){var r=t.slice(e+1);return X(r,n)},wm=function(t){return function(e){var n=e.raw;return I(t,n.which)}},Cm=function(t){return function(e){return Q(t,(function(t){return t(e)}))}},Sm=function(t){return!0===t.raw.shiftKey},km=function(t){return!0===t.raw.ctrlKey},Om=x(Sm),Em=function(t,e){return{matches:t,classification:e}},_m=function(t,e,n){e.exists((function(t){return n.exists((function(e){return be(e,t)}))}))||Di(t,Si(),{prevFocus:e,newFocus:n})},Tm=function(){var t=function(t){return Ac(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);_m(e,r,o)}}},Mm=function(){var t=function(t){return um.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(g,(function(t){um.highlight(e,t)}));var o=t(e);_m(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Qs||(Qs={}));var Dm,zm=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a,u,c=n(t,e,r,o);return(i=c,a=e.event,u=X(i,(function(t){return t.matches(a)})),u.map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},a={schema:function(){return t.concat([fo("focusManager",Tm()),mo("focusInside","onFocus",Lr((function(t){return I(["onFocus","onEnterOrSpace","onApi"],t)?Wn.value(t):Wn.error("Invalid value for focusInside")}))),zu("handler",a),zu("state",e),zu("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==Qs.OnFocusMode?N.none():o(t).map((function(n){return Ii(oi(),(function(r,o){n(r,t,e),o.stop()}))})),u=[Ii($o(),(function(r,a){i(r,a,n,t,e).fold((function(){!function(n,r){var i=wm(dm.concat(lm))(r.event);t.focusInside===Qs.OnEnterOrSpaceMode&&i&&zo(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,a)}),(function(t){a.stop()}))})),Ii(Xo(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Ri(a.toArray().concat(u))}};return a},Am=function(t){var e=[oo("onEscape"),oo("onEnter"),fo("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),fo("firstTabstop",0),fo("useTabstopAt",S),oo("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return lu(e,t)})).getOr(e);return ln(n)>0},r=function(t,e,r){(function(t,e){var r=ol(t.element,e.selector),o=q(r,(function(t){return n(e,t)}));return N.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?N.some(!0):N.none()}),(function(e){return o.focusManager.set(t,e),N.some(!0)}))},i=function(t,e,n,r){var i=ol(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return lu(t,e.selector)}))}(t,n).bind((function(e){return K(i,y(be,e)).bind((function(e){return o(t,i,e,n,r)}))}))},a=p([Em(Cm([Sm,wm(sm)]),(function(t,e,n){var r=n.cyclic?vm:bm;return i(t,0,n,r)})),Em(wm(sm),(function(t,e,n){var r=n.cyclic?ym:xm;return i(t,0,n,r)})),Em(wm(fm),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),Em(Cm([Om,wm(lm)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),u=p([]);return zm(e,xa.init,a,u,(function(){return N.some(r)}))},Nm=Am($r("cyclic",C)),Bm=Am($r("cyclic",S)),Rm=function(t,e,n){return Nd(n)&&wm(dm)(e.event)?N.none():function(t,e,n){return Ai(t,n,ci()),N.some(!0)}(t,0,n)},Hm=function(t,e){return N.some(!0)},Vm=[fo("execute",Rm),fo("useSpace",!1),fo("useEnter",!0),fo("useControlEnter",!1),fo("useDown",!1)],Im=function(t,e,n){return n.execute(t,e,t.element)},Lm=zm(Vm,xa.init,(function(t,e,n,r){var o=n.useSpace&&!Nd(t.element)?dm:[],i=n.useEnter?lm:[],a=n.useDown?pm:[],u=o.concat(i).concat(a);return[Em(wm(u),Im)].concat(n.useControlEnter?[Em(Cm([km,wm(lm)]),Im)]:[])}),(function(t,e,n,r){return n.useSpace&&!Nd(t.element)?[Em(wm(dm),Hm)]:[]}),(function(){return N.none()})),Fm=function(){var t=Zc();return wa({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Pm=Object.freeze({__proto__:null,flatgrid:Fm,init:function(t){return t.state(t)}}),Um=function(t){return function(e,n,r,o){var i=t(e.element);return Gm(i,e,n,r,o)}},jm=function(t,e){var n=ws(t,e);return Um(n)},Wm=function(t,e){var n=ws(e,t);return Um(n)},qm=function(t){return function(e,n,r,o){return Gm(t,e,n,r,o)}},Gm=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},$m=qm,Xm=qm,Km=qm,Ym=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},Jm=function(t,e,n){var r=ol(t,n);return function(t,e){return K(t,e).map((function(e){return{index:e,candidates:t}}))}(q(r,Ym),(function(t){return be(t,e)}))},Qm=function(t,e){return K(t,(function(t){return be(e,t)}))},Zm=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?N.some(t[r]):N.none()}))},tg=function(t,e,n,r,o){return Zm(t,e,r,(function(e,i){var a=e===n-1?t.length-e*r:r,u=Wu(i,o,0,a-1);return N.some({row:e,column:u})}))},eg=function(t,e,n,r,o){return Zm(t,e,r,(function(e,i){var a=Wu(e,o,0,n-1),u=a===n-1?t.length-a*r:r,c=qu(i,0,u-1);return N.some({row:a,column:c})}))},ng=[Kr("selector"),fo("execute",Rm),Tu("onEscape"),fo("captureTab",!1),Nu()],rg=function(t,e,n){su(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},og=function(t){return function(e,n,r,o){return Jm(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},ig=function(t,e,n){return n.captureTab?N.some(!0):N.none()},ag=og((function(t,e,n,r){return tg(t,e,n,r,-1)})),ug=og((function(t,e,n,r){return tg(t,e,n,r,1)})),cg=og((function(t,e,n,r){return eg(t,e,n,r,-1)})),sg=og((function(t,e,n,r){return eg(t,e,n,r,1)})),lg=p([Em(wm(mm),jm(ag,ug)),Em(wm(hm),Wm(ag,ug)),Em(wm(gm),$m(cg)),Em(wm(pm),Xm(sg)),Em(Cm([Sm,wm(sm)]),ig),Em(Cm([Om,wm(sm)]),ig),Em(wm(fm),(function(t,e,n){return n.onEscape(t,e)})),Em(wm(dm.concat(lm)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return lu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),fg=p([Em(wm(dm),Hm)]),dg=zm(ng,Fm,lg,fg,(function(){return N.some(rg)})),mg=function(t,e,n,r){var o=function(t,e,n){var i,a=Wu(e,r,0,n.length-1);return a===t?N.none():(i=n[a],"button"===Rt(i)&&"disabled"===qe(i,"disabled")?o(t,a,n):N.from(n[a]))};return Jm(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},gg=[Kr("selector"),fo("getInitial",N.none),fo("execute",Rm),Tu("onEscape"),fo("executeOnMove",!1),fo("allowVertical",!0)],hg=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return lu(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},pg=function(t,e,n){e.getInitial(t).orThunk((function(){return su(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},vg=function(t,e,n){return mg(t,n.selector,e,-1)},bg=function(t,e,n){return mg(t,n.selector,e,1)},yg=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?hg(e,n,r):N.some(!0)}))}},xg=function(t,e,n){return n.onEscape(t,e)},wg=p([Em(wm(dm),Hm)]),Cg=zm(gg,xa.init,(function(t,e,n,r){var o=mm.concat(n.allowVertical?gm:[]),i=hm.concat(n.allowVertical?pm:[]);return[Em(wm(o),yg(jm(vg,bg))),Em(wm(i),yg(Wm(vg,bg))),Em(wm(lm),hg),Em(wm(dm),hg),Em(wm(fm),xg)]}),wg,(function(){return N.some(pg)})),Sg=function(t,e,n){return N.from(t[e]).bind((function(t){return N.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},kg=function(t,e,n,r){var o=t[e].length,i=Wu(n,r,0,o-1);return Sg(t,e,i)},Og=function(t,e,n,r){var o=Wu(n,r,0,t.length-1),i=t[o].length,a=qu(e,0,i-1);return Sg(t,o,a)},Eg=function(t,e,n,r){var o=t[e].length,i=qu(n+r,0,o-1);return Sg(t,e,i)},_g=function(t,e,n,r){var o=qu(n+r,0,t.length-1),i=t[o].length,a=qu(e,0,i-1);return Sg(t,o,a)},Tg=[eo("selectors",[Kr("row"),Kr("cell")]),fo("cycles",!0),fo("previousSelector",N.none),fo("execute",Rm)],Mg=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return su(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Dg=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return lu(r,o.selectors.row).bind((function(t){var e=ol(t,o.selectors.cell);return Qm(e,r).bind((function(e){var r=ol(n,o.selectors.row);return Qm(r,t).bind((function(t){var n=function(t,e){return U(t,(function(t){return ol(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},zg=Dg((function(t,e,n){return kg(t,e,n,-1)}),(function(t,e,n){return Eg(t,e,n,-1)})),Ag=Dg((function(t,e,n){return kg(t,e,n,1)}),(function(t,e,n){return Eg(t,e,n,1)})),Ng=Dg((function(t,e,n){return Og(t,n,e,-1)}),(function(t,e,n){return _g(t,n,e,-1)})),Bg=Dg((function(t,e,n){return Og(t,n,e,1)}),(function(t,e,n){return _g(t,n,e,1)})),Rg=p([Em(wm(mm),jm(zg,Ag)),Em(wm(hm),Wm(zg,Ag)),Em(wm(gm),$m(Ng)),Em(wm(pm),Xm(Bg)),Em(wm(dm.concat(lm)),(function(t,e,n){return Ac(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),Hg=p([Em(wm(dm),Hm)]),Vg=zm(Tg,xa.init,Rg,Hg,(function(){return N.some(Mg)})),Ig=[Kr("selector"),fo("execute",Rm),fo("moveOnTab",!1)],Lg=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Fg=function(t,e,n){su(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Pg=function(t,e,n){return mg(t,n.selector,e,-1)},Ug=function(t,e,n){return mg(t,n.selector,e,1)},jg=p([Em(wm(gm),Km(Pg)),Em(wm(pm),Km(Ug)),Em(Cm([Sm,wm(sm)]),(function(t,e,n,r){return n.moveOnTab?Km(Pg)(t,e,n,r):N.none()})),Em(Cm([Om,wm(sm)]),(function(t,e,n,r){return n.moveOnTab?Km(Ug)(t,e,n,r):N.none()})),Em(wm(lm),Lg),Em(wm(dm),Lg)]),Wg=p([Em(wm(dm),Hm)]),qg=zm(Ig,xa.init,jg,Wg,(function(){return N.some(Fg)})),Gg=[Tu("onSpace"),Tu("onEnter"),Tu("onShiftEnter"),Tu("onLeft"),Tu("onRight"),Tu("onTab"),Tu("onShiftTab"),Tu("onUp"),Tu("onDown"),Tu("onEscape"),fo("stopSpaceKeyup",!1),oo("focusIn")],$g=zm(Gg,xa.init,(function(t,e,n){return[Em(wm(dm),n.onSpace),Em(Cm([Om,wm(lm)]),n.onEnter),Em(Cm([Sm,wm(lm)]),n.onShiftEnter),Em(Cm([Sm,wm(sm)]),n.onShiftTab),Em(Cm([Om,wm(sm)]),n.onTab),Em(wm(gm),n.onUp),Em(wm(pm),n.onDown),Em(wm(mm),n.onLeft),Em(wm(hm),n.onRight),Em(wm(dm),n.onSpace),Em(wm(fm),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[Em(wm(dm),Hm)]:[]}),(function(t){return t.focusIn})),Xg=Nm.schema(),Kg=Bm.schema(),Yg=Cg.schema(),Jg=dg.schema(),Qg=Vg.schema(),Zg=Lm.schema(),th=qg.schema(),eh=$g.schema(),nh=kc({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Xg,cyclic:Kg,flow:Yg,flatgrid:Jg,matrix:Qg,execution:Zg,menu:th,special:eh}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return xt(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Pm}),rh=function(t,e,n,r){var o=t.getSystem().build(r);jl(t,o,n)},oh=function(t,e,n,r){var o=ih(t),i=X(o,(function(t){return be(r.element,t.element)}));i.each(ql)},ih=function(t,e){return t.components()},ah=function(t,e,n,r,o){var i=ih(t);return N.from(i[r]).map((function(e){return oh(t,0,0,e),o.each((function(e){rh(t,0,(function(t,e){!function(t,e,n){Te(t,n).fold((function(){En(t,e)}),(function(t){Sn(t,e)}))}(t,e,r)}),e)})),e}))},uh=Object.freeze({__proto__:null,append:function(t,e,n,r){rh(t,0,En,r)},prepend:function(t,e,n,r){rh(t,0,On,r)},remove:oh,replaceAt:ah,replaceBy:function(t,e,n,r,o){var i=ih(t);return K(i,r).bind((function(e){return ah(t,0,0,e,o)}))},set:function(t,e,n,r){Nc((function(){var e=U(r,t.getSystem().build);Pl(t,e)}),t.element)},contents:ih}),ch=Cc({fields:[],name:"replacing",apis:uh}),sh=function(t,e){var n=function(t,e){var n=Ri(e);return Cc({fields:[Kr("enabled")],name:t,active:{events:p(n)}})}(t,e);return{key:t,value:{config:{},me:n,configAsRaw:p({}),initialConfig:{},state:xa}}},lh=function(t,e){e.ignore||(Mc(t.element),e.onFocus(t))},fh=Object.freeze({__proto__:null,focus:lh,blur:function(t,e){e.ignore||function(t){t.dom.blur()}(t.element)},isFocused:function(t){return Dc(t.element)}}),dh=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return Sa(n)},events:function(t){return Ri([Ii(oi(),(function(e,n){lh(e,t),n.stop()}))].concat(t.stopMousedown?[Ii(Fo(),(function(t,e){e.event.prevent()}))]:[]))}}),mh=[_u("onFocus"),fo("stopMousedown",!1),fo("ignore",!1)],gh=Cc({fields:mh,name:"focusing",active:dh,apis:fh}),hh=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},ph=function(t,e,n){e.toggleClass.each((function(e){n.get()?Va(t.element,e):La(t.element,e)}))},vh=function(t,e,n){xh(t,e,n,!n.get())},bh=function(t,e,n){n.set(!0),ph(t,e,n),hh(t,e,n)},yh=function(t,e,n){n.set(!1),ph(t,e,n),hh(t,e,n)},xh=function(t,e,n,r){(r?bh:yh)(t,e,n)},wh=function(t,e,n){xh(t,e,n,e.selected)},Ch=Object.freeze({__proto__:null,onLoad:wh,toggle:vh,isOn:function(t,e,n){return n.get()},on:bh,off:yh,set:xh}),Sh=Object.freeze({__proto__:null,exhibit:function(){return Sa({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=vh,Ki((function(t){o(t,n,r)}))),a=pc(t,e,wh);return Ri(Y([t.toggleOnExecute?[i]:[],[a]]))}}),kh=function(t,e,n){je(t.element,"aria-expanded",n)},Oh=[fo("selected",!1),oo("toggleClass"),fo("toggleOnExecute",!0),mo("aria",{mode:"none"},qr("mode",{pressed:[fo("syncWithExpanded",!1),zu("update",(function(t,e,n){je(t.element,"aria-pressed",n),e.syncWithExpanded&&kh(t,e,n)}))],checked:[zu("update",(function(t,e,n){je(t.element,"aria-checked",n)}))],expanded:[zu("update",kh)],selected:[zu("update",(function(t,e,n){je(t.element,"aria-selected",n)}))],none:[zu("update",g)]}))],Eh=Cc({fields:Oh,name:"toggling",active:Sh,apis:Ch,state:(Dm=!1,{init:function(){var t=wo(Dm);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Dm)},readState:function(){return t.get()}}}})}),_h=function(){var t=function(t,e){e.stop(),zi(t)};return[Ii(Jo(),t),Ii(li(),t),ji(Ho()),ji(Fo())]},Th=function(t){return Ri(Y([t.map((function(t){return Ki((function(e,n){t(e),n.stop()}))})).toArray(),_h()]))},Mh="alloy.item-hover",Dh="alloy.item-focus",zh=function(t){(Ac(t.element).isNone()||gh.isFocused(t))&&(gh.isFocused(t)||gh.focus(t),Di(t,Mh,{item:t}))},Ah=function(t){Di(t,Dh,{item:t})},Nh=p(Mh),Bh=p(Dh),Rh=[Kr("data"),Kr("components"),Kr("dom"),fo("hasSubmenu",!1),oo("toggling"),zf("itemBehaviours",[Eh,gh,nh,_f]),fo("ignoreFocus",!1),fo("domModification",{}),zu("builder",(function(t){return{dom:t.dom,domModification:O(O({},t.domModification),{attributes:O(O(O({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Af(t.itemBehaviours,[t.toggling.fold(Eh.revoke,(function(t){return Eh.config(O({aria:{mode:"checked"}},t))})),gh.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Ah(t)}}),nh.config({mode:"execution"}),_f.config({store:{mode:"memory",initialValue:t.data}}),sh("item-type-events",_(_([],_h(),!0),[Ii(Wo(),zh),Ii(si(),gh.focus)],!1))]),components:t.components,eventOrder:t.eventOrder}})),fo("eventOrder",{})],Hh=[Kr("dom"),Kr("components"),zu("builder",(function(t){return{dom:t.dom,components:t.components,events:Ri([Wi(si())])}}))],Vh=p("item-widget"),Ih=p([rd({name:"widget",overrides:function(t){return{behaviours:xc([_f.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:g}})])}}})]),Lh=[Kr("uid"),Kr("data"),Kr("components"),Kr("dom"),fo("autofocus",!1),fo("ignoreFocus",!1),zf("widgetBehaviours",[_f,gh,nh]),fo("domModification",{}),kd(Ih()),zu("builder",(function(t){var e=hd(Vh(),t,Ih()),n=pd(Vh(),t,e.internals()),r=function(e){return vd(e,t,"widget").map((function(t){return nh.focusIn(t),t}))},o=function(e,n){return Nd(n.event.target)?N.none():t.autofocus?(n.setSource(e.element),N.none()):N.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Ri([Ki((function(t,e){r(t).each((function(t){e.stop()}))})),Ii(Wo(),zh),Ii(si(),(function(e,n){t.autofocus?r(e):gh.focus(e)}))]),behaviours:Af(t.widgetBehaviours,[_f.config({store:{mode:"memory",initialValue:t.data}}),gh.config({ignore:t.ignoreFocus,onFocus:function(t){Ah(t)}}),nh.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Oc(),onLeft:o,onRight:o,onEscape:function(e,n){return gh.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),N.none()):N.none():(gh.focus(e),N.some(!0))}})])}}))],Fh=qr("type",{widget:Lh,item:Rh,separator:Hh}),Ph=p([ad({factory:{sketch:function(t){var e=jr("menu.spec item",Fh,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(t,e){return yt(e,"uid")?e:O(O({},e),{uid:fa("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Uh=p([Kr("value"),Kr("items"),Kr("dom"),Kr("components"),fo("eventOrder",{}),Tf("menuBehaviours",[um,_f,Hd,nh]),mo("movement",{mode:"menu",moveOnTab:!0},qr("mode",{grid:[Nu(),zu("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[zu("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Kr("rowSelector")],menu:[fo("moveOnTab",!0),zu("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Yr("markers",Cu()),fo("fakeFocus",!1),fo("focusManager",Tm()),_u("onHighlight")]),jh=p("alloy.menu-focus"),Wh=Ad({name:"Menu",configFields:Uh(),partFields:Ph(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Df(t.menuBehaviours,[um.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),_f.config({store:{mode:"memory",initialValue:t.value}}),Hd.config({find:N.some}),nh.config(t.movement.config(t,t.movement))]),events:Ri([Ii(Bh(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){um.highlight(t,n),e.stop(),Di(t,jh(),{menu:t,item:n})}))})),Ii(Nh(),(function(t,e){var n=e.event.item;um.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),qh=function(t,e,n,r){return bt(n,r).bind((function(r){return bt(t,r).bind((function(r){var o=qh(t,e,n,r);return N.some([r].concat(o))}))})).getOr([])},Gh=function(t,e){var n={};ft(t,(function(t,e){j(t,(function(t){n[t]=e}))}));var r=e,o=mt(e,(function(t,e){return{k:t,v:e}})),i=dt(o,(function(t,e){return[e].concat(qh(n,r,o,e))}));return dt(n,(function(t){return bt(i,t).getOr([t])}))},$h=function(t){return"prepared"===t.type?N.some(t.menu):N.none()},Xh={init:function(){var t=wo({}),e=wo({}),n=wo({}),r=Zc(),o=wo({}),i=function(e,n,r){return a(e).bind((function(o){return function(e){return pt(t.get(),(function(t,n){return t===e}))}(e).bind((function(t){return n(t).map((function(t){return{triggeredMenu:o,triggeringItem:t,triggeringPath:r}}))}))}))},a=function(t){return u(t).bind($h)},u=function(t){return bt(e.get(),t)},c=function(e){return bt(t.get(),e)};return{setMenuBuilt:function(t,n){var r;e.set(O(O({},e.get()),((r={})[t]={type:"prepared",menu:n},r)))},setContents:function(i,a,u,c){r.set(i),t.set(u),e.set(a),o.set(c);var s=Gh(c,u);n.set(s)},expand:function(e){return bt(t.get(),e).map((function(t){var r=bt(n.get(),e).getOr([]);return[t].concat(r)}))},refresh:function(t){return bt(n.get(),t)},collapse:function(t){return bt(n.get(),t).bind((function(t){return t.length>1?N.some(t.slice(1)):N.none()}))},lookupMenu:u,lookupItem:c,otherMenus:function(t){var e=o.get();return tt(st(e),t)},getPrimary:function(){return r.get().bind(a)},getMenus:function(){return e.get()},clear:function(){t.set({}),e.set({}),n.set({}),r.clear()},isClear:function(){return r.get().isNone()},getTriggeringPath:function(t,e){var o=q(c(t).toArray(),(function(t){return a(t).isSome()}));return bt(n.get(),t).bind((function(t){var n=Z(o.concat(t));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return N.none();e.push(r.getOrDie())}return N.some(e)}(J(n,(function(t,o){return i(t,e,n.slice(0,o+1)).fold((function(){return wt(r.get(),t)?[]:[N.none()]}),(function(t){return[N.some(t)]}))})))}))}}},extractPreparedMenu:$h},Kh=p("collapse-item"),Yh=zd({name:"TieredMenu",configFields:[Du("onExecute"),Du("onEscape"),Mu("onOpenMenu"),Mu("onOpenSubmenu"),_u("onRepositionMenu"),_u("onCollapseMenu"),fo("highlightImmediately",!0),eo("data",[Kr("primary"),Kr("menus"),Kr("expansions")]),fo("fakeFocus",!1),_u("onHighlight"),_u("onHover"),ku(),Kr("dom"),fo("navigateOnHover",!0),fo("stayInDom",!1),Tf("tmenuBehaviours",[nh,um,Hd,ch]),fo("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(t,e){var n,r=Zc(),o=Xh.init(),i=function(e){var n=function(e,n,r){return dt(r,(function(r,o){var i=function(){return Wh.sketch(O(O({},r),{value:o,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:t.onHighlight,focusManager:t.fakeFocus?Mm():Tm()}))};return o===n?{type:"prepared",menu:e.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))}(e,t.data.primary,t.data.menus),r=u();return o.setContents(t.data.primary,n,t.data.expansions,r),o.getPrimary()},a=function(t){return _f.getValue(t).value},u=function(e){return dt(t.data.menus,(function(t,e){return J(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},c=function(t,e){um.highlight(t,e),um.getHighlighted(e).orThunk((function(){return um.getFirst(e)})).each((function(e){Ai(t,e.element,si())}))},s=function(t,e){return Ct(U(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?N.some(t.menu):N.none()}))})))},l=function(e,n,r){var o=s(n,n.otherMenus(r));j(o,(function(n){Ua(n.element,[t.markers.backgroundMenu]),t.stayInDom||ch.remove(e,n)}))},f=function(e,n){var o=function(e){return r.get().getOrThunk((function(){var n={},o=ol(e.element,"."+t.markers.item),i=q(o,(function(t){return"true"===qe(t,"aria-haspopup")}));return j(i,(function(t){e.getSystem().getByDom(t).each((function(t){var e=a(t);n[e]=t}))})),r.set(n),n}))}(e);ft(o,(function(t,e){var r=I(n,e);je(t.element,"aria-expanded",r)}))},d=function(e,n,r){return N.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return N.none();var i=o.menu,a=s(n,r.slice(1));return j(a,(function(e){Va(e.element,t.markers.backgroundMenu)})),Le(i.element)||ch.append(e,eu(i)),Ua(i.element,[t.markers.backgroundMenu]),c(e,i),l(e,n,r),N.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(n||(n={}));var m=function(e,r,i){if(void 0===i&&(i=n.HighlightSubmenu),r.hasConfigured(Yd)&&Yd.isDisabled(r))return N.some(r);var u=a(r);return o.expand(u).bind((function(a){return f(e,a),N.from(a[0]).bind((function(u){return o.lookupMenu(u).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return o.setMenuBuilt(e,r),r}return n.menu}(e,u,c);return Le(s.element)||ch.append(e,eu(s)),t.onOpenSubmenu(e,r,s,Z(a)),i===n.HighlightSubmenu?(um.highlightFirst(s),d(e,o,a)):(um.dehighlightAll(s),N.some(r))}))}))}))},h=function(e,n){var r=a(n);return o.collapse(r).bind((function(r){return f(e,r),d(e,o,r).map((function(r){return t.onCollapseMenu(e,n,r),r}))}))},p=function(e){return function(n,r){return lu(r.getSource(),"."+t.markers.item).bind((function(t){return n.getSystem().getByDom(t).toOptional().bind((function(t){return e(n,t).map(S)}))}))}},v=Ri([Ii(jh(),(function(t,e){var n=e.event.item;o.lookupItem(a(n)).each((function(){var n=e.event.menu;um.highlight(t,n);var r=a(e.event.item);o.refresh(r).each((function(e){return l(t,o,e)}))}))})),Ki((function(e,r){var o=r.event.target;e.getSystem().getByDom(o).each((function(r){0===a(r).indexOf("collapse-item")&&h(e,r),m(e,r,n.HighlightSubmenu).fold((function(){t.onExecute(e,r)}),g)}))})),Gi((function(e,n){i(e).each((function(n){ch.append(e,eu(n)),t.onOpenMenu(e,n),t.highlightImmediately&&c(e,n)}))}))].concat(t.navigateOnHover?[Ii(Nh(),(function(e,r){var i=r.event.item;!function(t,e){var n=a(e);o.refresh(n).bind((function(e){return f(t,e),d(t,o,e)}))}(e,i),m(e,i,n.HighlightParent),t.onHover(e,i)}))]:[])),b=function(t){return um.getHighlighted(t).bind(um.getHighlighted)},y={collapseMenu:function(t){b(t).each((function(e){h(t,e)}))},highlightPrimary:function(t){o.getPrimary().each((function(e){c(t,e)}))},repositionMenus:function(e){var n=o.getPrimary().bind((function(t){return b(e).bind((function(t){var e=a(t),n=vt(o.getMenus()),r=Ct(U(n,Xh.extractPreparedMenu));return o.getTriggeringPath(e,(function(t){return function(t,e,n){return ct(e,(function(t){if(!t.getSystem().isConnected())return N.none();var e=um.getCandidates(t);return X(e,(function(t){return a(t)===n}))}))}(0,r,t)}))})).map((function(e){return{primary:t,triggeringPath:e}}))}));n.fold((function(){(function(t){return N.from(t.components()[0]).filter((function(t){return"menu"===qe(t.element,"role")}))})(e).each((function(n){t.onRepositionMenu(e,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;t.onRepositionMenu(e,r,o)}))}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Df(t.tmenuBehaviours,[nh.config({mode:"special",onRight:p((function(t,e){return Nd(e.element)?N.none():m(t,e,n.HighlightSubmenu)})),onLeft:p((function(t,e){return Nd(e.element)?N.none():h(t,e)})),onEscape:p((function(e,n){return h(e,n).orThunk((function(){return t.onEscape(e,n).map((function(){return e}))}))})),focusIn:function(t,e){o.getPrimary().each((function(e){Ai(t,e.element,si())}))}}),um.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),Hd.config({find:function(t){return um.getHighlighted(t)}}),ch.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Oo(t,e),expansions:{}}},collapseItem:function(t){return{value:oa(Kh()),meta:{text:t}}}}}),Jh=zd({name:"InlineView",configFields:[Kr("lazySink"),_u("onShow"),_u("onHide"),co("onEscape"),Tf("inlineBehaviours",[uf,_f,Ec]),lo("fireDismissalEventInstead",[fo("event",wi())]),lo("fireRepositionEventInstead",[fo("event",Ci())]),fo("getRelated",N.none),fo("isExtraPart",C),fo("eventOrder",N.none)],factory:function(t,e){var n=function(t,e,n,o){r(t,e,n,(function(){return o.map((function(t){return Ln(t)}))}))},r=function(e,n,r,o){var i=t.lazySink(e).getOrDie();uf.openWhileCloaked(e,n,(function(){return Vl.positionWithinBounds(i,e,r,o())})),_f.setValue(e,N.some({mode:"position",config:r,getBounds:o}))},o=function(e,n,r,o){var i=function(t,e,n,r,o){var i=function(){return t.lazySink(e)},a="horizontal"===r.type?{layouts:{onLtr:function(){return dc()},onRtl:function(){return mc()}}}:{},u=function(t){return function(t){return 2===t.length}(t)?a:{}};return Yh.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return uf.close(e),t.onEscape.map((function(t){return t(e)})),N.some(!0)},onExecute:function(){return N.some(!0)},onOpenMenu:function(t,e){Vl.positionWithinBounds(i().getOrDie(),e,n,o())},onOpenSubmenu:function(t,e,n,r){var o=i().getOrDie();Vl.position(o,n,{anchor:O({type:"submenu",item:e},u(r))})},onRepositionMenu:function(t,e,r){var a=i().getOrDie();Vl.positionWithinBounds(a,e,n,o()),j(r,(function(t){var e=u(t.triggeringPath);Vl.position(a,t.triggeredMenu,{anchor:O({type:"submenu",item:t.triggeringItem},e)})}))}})}(t,e,n,r,o);uf.open(e,i),_f.setValue(e,N.some({mode:"menu",menu:i}))},i=function(e){uf.isOpen(e)&&_f.getValue(e).each((function(n){switch(n.mode){case"menu":uf.getState(e).each(Yh.repositionMenus);break;case"position":var r=t.lazySink(e).getOrDie();Vl.positionWithinBounds(r,e,n.config,n.getBounds())}}))},a={setContent:function(t,e){uf.setContent(t,e)},showAt:function(t,e,r){n(t,e,r,N.none())},showWithin:n,showWithinBounds:r,showMenuAt:function(t,e,n){o(t,e,n,N.none)},showMenuWithinBounds:o,hide:function(t){uf.isOpen(t)&&(_f.setValue(t,N.none()),uf.close(t))},getContent:function(t){return uf.getState(t)},reposition:i,isOpen:uf.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Df(t.inlineBehaviours,[uf.config({isPartOf:function(e,n,r){return mu(n,r)||function(e,n){return t.getRelated(e).exists((function(t){return mu(t,n)}))}(e,r)},getAttachPoint:function(e){return t.lazySink(e).getOrDie()},onOpen:function(e){t.onShow(e)},onClose:function(e){t.onHide(e)}}),_f.config({store:{mode:"memory",initialValue:N.none()}}),Ec.config({channels:O(O({},df(O({isExtraPart:e.isExtraPart},t.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),gf(O(O({},t.fireRepositionEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:t.eventOrder,apis:a}},apis:{showAt:function(t,e,n,r){t.showAt(e,n,r)},showWithin:function(t,e,n,r,o){t.showWithin(e,n,r,o)},showWithinBounds:function(t,e,n,r,o){t.showWithinBounds(e,n,r,o)},showMenuAt:function(t,e,n,r){t.showMenuAt(e,n,r)},showMenuWithinBounds:function(t,e,n,r,o){t.showMenuWithinBounds(e,n,r,o)},hide:function(t,e){t.hide(e)},isOpen:function(t,e){return t.isOpen(e)},getContent:function(t,e){return t.getContent(e)},setContent:function(t,e,n){t.setContent(e,n)},reposition:function(t,e){t.reposition(e)}}}),Qh="layout-inset",Zh=function(t){return t.x},tp=function(t,e){return t.x+t.width/2-e.width/2},ep=function(t,e){return t.x+t.width-e.width},np=function(t){return t.y},rp=function(t,e){return t.y+t.height-e.height},op=function(t,e){return t.y+t.height/2-e.height/2},ip=function(t,e,n){return Bu(ep(t,e),rp(t,e),n.insetSouthwest(),Lu(),"southwest",Gu(t,{right:0,bottom:3}),Qh)},ap=function(t,e,n){return Bu(Zh(t),rp(t,e),n.insetSoutheast(),Iu(),"southeast",Gu(t,{left:1,bottom:3}),Qh)},up=function(t,e,n){return Bu(ep(t,e),np(t),n.insetNorthwest(),Vu(),"northwest",Gu(t,{right:0,top:2}),Qh)},cp=function(t,e,n){return Bu(Zh(t),np(t),n.insetNortheast(),Hu(),"northeast",Gu(t,{left:1,top:2}),Qh)},sp=function(t,e,n){return Bu(tp(t,e),np(t),n.insetNorth(),Fu(),"north",Gu(t,{top:2}),Qh)},lp=function(t,e,n){return Bu(tp(t,e),rp(t,e),n.insetSouth(),Pu(),"south",Gu(t,{bottom:3}),Qh)},fp=function(t,e,n){return Bu(ep(t,e),op(t,e),n.insetEast(),ju(),"east",Gu(t,{right:0}),Qh)},dp=function(t,e,n){return Bu(Zh(t),op(t,e),n.insetWest(),Uu(),"west",Gu(t,{left:1}),Qh)},mp=function(t){switch(t){case"north":return sp;case"northeast":return cp;case"northwest":return up;case"south":return lp;case"southeast":return ap;case"southwest":return ip;case"east":return fp;case"west":return dp}},gp=function(t,e,n,r,o){return $c(r).map(mp).getOr(sp)(t,e,n,r,o)},hp=function(t){switch(t){case"north":return lp;case"northeast":return ap;case"northwest":return ip;case"south":return sp;case"southeast":return cp;case"southwest":return up;case"east":return dp;case"west":return fp}},pp=function(t,e,n,r,o){return $c(r).map(hp).getOr(sp)(t,e,n,r,o)},vp=tinymce.util.Tools.resolve("tinymce.util.Delay"),bp=zd({name:"Button",factory:function(t){var e=Th(t.action),n=t.dom.tag,r=function(e){return bt(t.dom,"attributes").bind((function(t){return bt(t,e)}))};return{uid:t.uid,dom:t.dom,components:t.components,events:e,behaviours:Af(t.buttonBehaviours,[gh.config({}),nh.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===n){var t=r("type").getOr("button"),e=r("role").map((function(t){return{role:t}})).getOr({});return O({type:t},e)}return{role:r("role").getOr("button")}}()},eventOrder:t.eventOrder}},configFields:[fo("uid",void 0),Kr("dom"),fo("components",[]),zf("buttonBehaviours",[gh,nh]),oo("action"),oo("role"),fo("eventOrder",{})]}),yp=function(t){var e=function(t){return void 0!==t.uid}(t)&&xt(t,"uid")?t.uid:fa("memento");return{get:function(t){return t.getSystem().getByUid(e).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(e).toOptional()},asSpec:function(){return O(O({},t),{uid:e})}}},xp=tinymce.util.Tools.resolve("tinymce.util.I18n"),wp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},Cp="temporary-placeholder",Sp=function(t){return function(){return bt(t,Cp).getOr("!not found!")}},kp=function(t,e){var n=t.toLowerCase();if(xp.isRtl()){var r=function(t,e){return Tt(t,e)?t:function(t,e){return t+e}(t,e)}(n,"-rtl");return yt(e,r)?r:n}return n},Op=function(t,e){return bt(e,kp(t,e))},Ep=function(t,e){var n=e();return Op(t,n).getOrThunk(Sp(n))},_p=function(){return sh("add-focusable",[Gi((function(t){cu(t.element,"svg").each((function(t){return je(t,"focusable","false")}))}))])},Tp=function(t,e,n,r){var o,i,a=function(t){return!!xp.isRtl()&&yt(wp,t)}(e)?["tox-icon--flip"]:[],u=bt(n,kp(e,n)).or(r).getOrThunk(Sp(n));return{dom:{tag:t.tag,attributes:null!==(o=t.attributes)&&void 0!==o?o:{},classes:t.classes.concat(a),innerHtml:u},behaviours:xc(_(_([],null!==(i=t.behaviours)&&void 0!==i?i:[],!0),[_p()],!1))}},Mp=function(t,e,n,r){return void 0===r&&(r=N.none()),Tp(e,t,n(),r)},Dp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},zp=zd({name:"Notification",factory:function(t){var e,n,r,o,i,a=yp({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:xc([ch.config({})])}),u=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},c=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},s=yp({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(0)]},c(0)],behaviours:xc([ch.config({})])}),l={updateProgress:function(t,e){t.getSystem().isConnected()&&s.getOpt(t).each((function(t){ch.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[u(e)]},c(e)])}))},updateText:function(t,e){if(t.getSystem().isConnected()){var n=a.get(t);ch.set(n,[Ja(e)])}}},f=Y([t.icon.toArray(),t.level.toArray(),t.level.bind((function(t){return N.from(Dp[t])})).toArray()]),d=yp(bp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Mp("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":t.translationProvider("Close")}},t.iconProvider)],action:function(e){t.onAction(e)}})),m=(e=f,n={tag:"div",classes:["tox-notification__icon"]},r=t.iconProvider,o=r(),i=X(e,(function(t){return yt(o,kp(t,o))})),Tp(n,i.getOr(Cp),o,N.none())),g=[m,{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:xc([ch.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map((function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]})).getOr(["tox-notification","tox-notification--in"])},behaviours:xc([gh.config({}),sh("notification-events",[Ii(qo(),(function(t){d.getOpt(t).each(gh.focus)}))])]),components:g.concat(t.progress?[s.asSpec()]:[]).concat(t.closeButton?[d.asSpec()]:[]),apis:l}},configFields:[oo("level"),Kr("progress"),Kr("icon"),Kr("onAction"),Kr("text"),Kr("iconProvider"),Kr("translationProvider"),vo("closeButton",!0)],apis:{updateProgress:function(t,e,n){t.updateProgress(e,n)},updateText:function(t,e,n){t.updateText(e,n)}}});function Ap(t,e,n){var r=e.backstage.shared;return{open:function(e,o){var i=!e.closeButton&&e.timeout&&(e.timeout>0||e.timeout<0),a=function(){o(),Jh.hide(c)},u=tu(zp.sketch({text:e.text,level:I(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:N.from(e.icon),closeButton:!i,onAction:a,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),c=tu(Jh.sketch(O({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(c),e.timeout>0&&vp.setTimeout((function(){a()}),e.timeout);var s=function(){var e=Ln(Nt.fromDom(t.getContentAreaContainer())),n=Pn(),r=qu(n.x,e.x,e.right),o=qu(n.y,e.y,e.bottom),i=Math.max(e.right,n.right),a=Math.max(e.bottom,n.bottom);return N.some(In(r,o,i-r,a-o))};return{close:a,moveTo:function(t,e){Jh.showAt(c,eu(u),{anchor:{type:"makeshift",x:t,y:e}})},moveRel:function(t,e){var n=eu(u),o={maxHeightFunction:gs()};if("banner"!==e&&l(t)){var i=function(t){switch(t){case"bc-bc":return lp;case"tc-tc":return sp;case"tc-bc":return oc;default:return ic}}(e),a={type:"node",root:Fe(),node:N.some(Nt.fromDom(t)),overrides:o,layouts:{onRtl:function(){return[i]},onLtr:function(){return[i]}}};Jh.showWithinBounds(c,n,{anchor:a},s)}else{var f=O(O({},r.anchors.banner()),{overrides:o});Jh.showWithinBounds(c,n,{anchor:f},s)}},text:function(t){zp.updateText(u,t)},settings:e,getEl:function(){return u.element.dom},progressBar:{value:function(t){zp.updateProgress(u,t)}}}},close:function(t){t.close()},reposition:function(t){t.length>0&&j(t,(function(e,n){0===n?e.moveRel(null,"banner"):e.moveRel(t[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var Np,Bp=function(t,e){var n=null,r=function(){a(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Rp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Hp=function(t,e,n,r,o){var i=Rp(t,(function(e){return function(t,e){return t.isBlock(e)||I(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===t.getContentEditable(e)}(t,e)}));return N.from(i.backwards(e,n,r,o))},Vp=function(t,e){return Ip(Nt.fromDom(t.selection.getNode())).getOrThunk((function(){var n=Nt.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return En(n,Nt.fromDom(e.extractContents())),e.insertNode(n.dom),Oe(n).each((function(t){return t.dom.normalize()})),function(t){return rl(t,nl)}(n).map((function(e){t.selection.setCursorLocation(e.dom,function(t){return"img"===Rt(t)?1:tl(t).fold((function(){return _e(t).length}),(function(t){return t.length}))}(e))})),n}))},Ip=function(t){return lu(t,"[data-mce-autocompleter]")},Lp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Fp=function(t){return""!==t&&-1!==" \f\n\r\t\v".indexOf(t)},Pp=function(t,e){return t.substring(e.length)},Up=function(t,e,n,r){if(void 0===r&&(r=0),!(o=e).collapsed||3!==o.startContainer.nodeType)return N.none();var o,i=t.getParent(e.startContainer,t.isBlock)||t.getRoot();return Hp(t,e.startContainer,e.startOffset,(function(t,e,r){return function(t,e,n){var r;for(r=e-1;r>=0;r--){var o=t.charAt(r);if(Fp(o))return N.none();if(o===n)break}return N.some(r)}(r,e,n).getOr(e)}),i).bind((function(t){var o=e.cloneRange();if(o.setStart(t.container,t.offset),o.setEnd(e.endContainer,e.endOffset),o.collapsed)return N.none();var i=Lp(o);return 0!==i.lastIndexOf(n)||Pp(i,n).length<r?N.none():N.some({text:Pp(i,n),range:o,triggerChar:n})}))},jp=function(t,e,n,r){return void 0===r&&(r=0),Ip(Nt.fromDom(e.startContainer)).fold((function(){return Up(t,e,n,r)}),(function(e){var r=t.createRng();r.selectNode(e.dom);var o=Lp(r);return N.some({range:r,text:Pp(o,n),triggerChar:n})}))},Wp=function(t,e){e.on("keypress compositionend",t.onKeypress.throttle),e.on("remove",t.onKeypress.cancel);var n=function(t,e){Di(t,$o(),{raw:e})};e.on("keydown",(function(e){var r=function(){return t.getView().bind(um.getHighlighted)};8===e.which&&t.onKeypress.throttle(e),t.isActive()&&(27===e.which&&t.cancelIfNecessary(),t.isMenuOpen()?13===e.which?(r().each(zi),e.preventDefault()):40===e.which?(r().fold((function(){t.getView().each(um.highlightFirst)}),(function(t){n(t,e)})),e.preventDefault(),e.stopImmediatePropagation()):37!==e.which&&38!==e.which&&39!==e.which||r().each((function(t){n(t,e),e.preventDefault(),e.stopImmediatePropagation()})):13!==e.which&&38!==e.which&&40!==e.which||t.cancelIfNecessary())})),e.on("NodeChange",(function(e){t.isActive()&&!t.isProcessingAction()&&Ip(Nt.fromDom(e.element)).isNone()&&t.cancelIfNecessary()}))},qp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Gp=function(t,e){return{container:t,offset:e}},$p=function(t){if(function(t){return 3===t.nodeType}(t))return Gp(t,t.data.length);var e=t.childNodes;return e.length>0?$p(e[e.length-1]):Gp(t,e.length)},Xp=function(t,e){var n=t.childNodes;return n.length>0&&e<n.length?Xp(n[e],0):n.length>0&&function(t){return 1===t.nodeType}(t)&&n.length===e?$p(n[n.length-1]):Gp(t,e)},Kp=function(t){return function(e){var n=Xp(e.startContainer,e.startOffset);return!function(t,e){return Hp(t,e.container,e.offset,(function(t,e){return 0===e?-1:e}),t.getRoot()).filter((function(t){var e=t.container.data.charAt(t.offset-1);return!Fp(e)})).isSome()}(t,n)}},Yp=function(t,e){var n=e(),r=t.selection.getRng();return function(t,e,n){return ct(n.triggerChars,(function(n){return jp(t,e,n)}))}(t.dom,r,n).bind((function(n){return Jp(t,e,n)}))},Jp=function(t,e,n,r){void 0===r&&(r={});var o=e(),i=t.selection.getRng().startContainer.nodeValue,a=q(o.lookupByChar(n.triggerChar),(function(e){return n.text.length>=e.minChars&&e.matches.getOrThunk((function(){return Kp(t.dom)}))(n.range,i,n.text)}));if(0===a.length)return N.none();var u=qp.all(U(a,(function(t){return t.fetch(n.text,t.maxResults,r).then((function(e){return{matchText:n.text,items:e,columns:t.columns,onAction:t.onAction,highlightOn:t.highlightOn}}))})));return N.some({lookupData:u,context:n})},Qp=kr([Qr("type"),uo("text")]),Zp=kr([fo("type","autocompleteitem"),fo("active",!1),fo("disabled",!1),fo("meta",{}),Qr("value"),uo("text"),uo("icon")]),tv=kr([Qr("type"),Qr("ch"),go("minChars",1),fo("columns",1),go("maxResults",10),co("matches"),to("fetch"),to("onAction"),yo("highlightOn",[],Ar)]),ev=[vo("disabled",!1),uo("tooltip"),uo("icon"),uo("text"),bo("onSetup",(function(){return g}))],nv=kr([Qr("type"),to("onAction")].concat(ev)),rv=function(t){return Pr("toolbarbutton",nv,t)},ov=[vo("active",!1)].concat(ev),iv=kr(ov.concat([Qr("type"),to("onAction")])),av=function(t){return Pr("ToggleButton",iv,t)},uv=[bo("predicate",C),po("scope","node",["node","editor"]),po("position","selection",["node","selection","line"])],cv=ev.concat([fo("type","contextformbutton"),fo("primary",!1),to("onAction"),$r("original",v)]),sv=ov.concat([fo("type","contextformbutton"),fo("primary",!1),to("onAction"),$r("original",v)]),lv=ev.concat([fo("type","contextformbutton")]),fv=ov.concat([fo("type","contextformtogglebutton")]),dv=qr("type",{contextformbutton:cv,contextformtogglebutton:sv}),mv=kr([fo("type","contextform"),bo("initValue",p("")),uo("label"),ro("commands",dv),io("launch",qr("type",{contextformbutton:lv,contextformtogglebutton:fv}))].concat(uv)),gv=kr([fo("type","contexttoolbar"),Qr("items")].concat(uv)),hv=function(t){var e=t.ui.registry.getAll().popups,n=dt(e,(function(t){return(e=t,Pr("Autocompleter",tv,e)).fold((function(t){throw new Error(Wr(t))}),v);var e})),r=function(t){var e={};return j(t,(function(t){e[t]={}})),st(e)}(ht(n,(function(t){return t.ch}))),o=vt(n);return{dataset:n,triggerChars:r,lookupByChar:function(t){return q(o,(function(e){return e.ch===t}))}}};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Np||(Np={}));var pv,vv=Np,bv="tox-menu-nav__js",yv="tox-collection__item",xv="tox-swatch",wv={normal:bv,color:xv},Cv="tox-collection__item--enabled",Sv="tox-collection__item-icon",kv="tox-collection__item-label",Ov="tox-collection__item-caret",Ev="tox-collection__item--active",_v="tox-collection__item-container",Tv="tox-collection__item-container--row",Mv=function(t){return bt(wv,t).getOr(bv)},Dv=function(t){return"color"===t?"tox-swatches":"tox-menu"},zv=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Dv(t),tieredMenu:"tox-tiered-menu"}},Av=function(t){var e=zv(t);return{backgroundMenu:e.backgroundMenu,selectedMenu:e.selectedMenu,menu:e.menu,selectedItem:e.selectedItem,item:Mv(t)}},Nv=function(t,e,n){var r=zv(n);return{tag:"div",classes:Y([[r.menu,"tox-menu-"+e+"-column"],t?[r.hasIcons]:[]])}},Bv=[Wh.parts.items({})],Rv=function(t,e,n){var r=zv(n);return{dom:{tag:"div",classes:Y([[r.tieredMenu]])},markers:Av(n)}},Hv=function(t,e){return function(n){var r=P(n,e);return U(r,(function(e){return{dom:t,components:e}}))}},Vv=function(t,e){var n=[],r=[];return j(t,(function(t,o){e(t,o)?(r.length>0&&n.push(r),r=[],yt(t.dom,"innerHtml")&&r.push(t)):r.push(t)})),r.length>0&&n.push(r),U(n,(function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}))},Iv=function(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Wh.parts.items({preprocess:function(n){return"auto"!==t&&t>1?Hv({tag:"div",classes:["tox-collection__group"]},t)(n):Vv(n,(function(t,n){return"separator"===e[n].type}))}})]}},Lv=function(t){return L(t,(function(t){return"icon"in t&&void 0!==t.icon}))},Fv=function(t){return console.error(Wr(t)),console.log(t),N.none()},Pv=function(t,e,n,r,o){var i,a=(i=n,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Wh.parts.items({preprocess:function(t){return Vv(t,(function(t,e){return"separator"===i[e].type}))}})]});return{value:t,dom:a.dom,components:a.components,items:n}},Uv=function(t,e,n,r,o){if("color"===o){var i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Wh.parts.items({preprocess:"auto"!==t?Hv({tag:"div",classes:["tox-swatches__row"]},t):v})]}]}}(r);return{value:t,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r)return{value:t,dom:(i=Iv(r,n)).dom,components:i.components,items:n};if("normal"===o&&1===r)return{value:t,dom:(i=Iv(1,n)).dom,components:i.components,items:n};if("normal"===o)return{value:t,dom:(i=Iv(r,n)).dom,components:i.components,items:n};if("listpreview"===o&&"auto"!==r){i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Wh.parts.items({preprocess:Hv({tag:"div",classes:["tox-collection__group"]},t)})]}}(r);return{value:t,dom:i.dom,components:i.components,items:n}}return{value:t,dom:Nv(e,r,o),components:Bv,items:n}},jv=[Qr("type"),Qr("src"),uo("alt"),yo("classes",[],Ar)],Wv=kr(jv),qv=[Qr("type"),Qr("text"),uo("name"),yo("classes",["tox-collection__item-label"],Ar)],Gv=kr(qv),$v=wr((function(){return Ir("type",{cardimage:Wv,cardtext:Gv,cardcontainer:Xv})})),Xv=kr([Qr("type"),ho("direction","horizontal"),ho("align","left"),ho("valign","middle"),ro("items",$v)]),Kv=[vo("disabled",!1),uo("text"),uo("shortcut"),Gr("value","value",sr((function(){return oa("menuitem-value")})),Mr()),fo("meta",{})],Yv=kr([Qr("type"),uo("label"),ro("items",$v),bo("onSetup",(function(){return g})),bo("onAction",g)].concat(Kv)),Jv=kr([Qr("type"),vo("active",!1),uo("icon")].concat(Kv)),Qv=[Qr("type"),Qr("fancytype"),bo("onAction",g)],Zv=[fo("initData",{})].concat(Qv),tb=[xo("initData",{},[vo("allowCustomColors",!0),so("colors",Mr())])].concat(Qv),eb=qr("fancytype",{inserttable:Zv,colorswatch:tb}),nb=kr([Qr("type"),bo("onSetup",(function(){return g})),bo("onAction",g),uo("icon")].concat(Kv)),rb=kr([Qr("type"),to("getSubmenuItems"),bo("onSetup",(function(){return g})),uo("icon")].concat(Kv)),ob=kr([Qr("type"),uo("icon"),vo("active",!1),bo("onSetup",(function(){return g})),to("onAction")].concat(Kv)),ib=function(t,e,n){var r=ol(t.element,"."+n);if(r.length>0){var o=K(r,(function(t){var n=t.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>e})).getOr(r.length);return N.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return N.none()},ab=function(t,e){return xc([sh(t,e)])},ub=function(t){return ab(oa("unnamed-events"),t)},cb=oa("tooltip.exclusive"),sb=oa("tooltip.show"),lb=oa("tooltip.hide"),fb=function(t,e,n){t.getSystem().broadcastOn([cb],{})},db=Object.freeze({__proto__:null,hideAllExclusive:fb,setComponents:function(t,e,n,r){n.getTooltip().each((function(t){t.getSystem().isConnected()&&ch.set(t,r)}))}}),mb=Object.freeze({__proto__:null,events:function(t,e){var n=function(n){e.getTooltip().each((function(r){ql(r),t.onHide(n,r),e.clearTooltip()})),e.clearTimer()};return Ri(Y([[Ii(sb,(function(n){e.resetTimer((function(){!function(n){if(!e.isShowing()){fb(n);var r=t.lazySink(n).getOrDie(),o=n.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:Ri("normal"===t.mode?[Ii(Wo(),(function(t){Mi(n,sb)})),Ii(Uo(),(function(t){Mi(n,lb)}))]:[]),behaviours:xc([ch.config({})])});e.setTooltip(o),Ul(r,o),t.onShow(n,o),Vl.position(r,o,{anchor:t.anchor(n)})}}(n)}),t.delay)})),Ii(lb,(function(r){e.resetTimer((function(){n(r)}),t.delay)})),Ii(ui(),(function(t,e){var r=e;r.universal||I(r.channels,cb)&&n(t)})),$i((function(t){n(t)}))],"normal"===t.mode?[Ii(qo(),(function(t){Mi(t,sb)})),Ii(ii(),(function(t){Mi(t,lb)})),Ii(Wo(),(function(t){Mi(t,sb)})),Ii(Uo(),(function(t){Mi(t,lb)}))]:[Ii(_i(),(function(t,e){Mi(t,sb)})),Ii(Ti(),(function(t){Mi(t,lb)}))]]))}}),gb=[Kr("lazySink"),Kr("tooltipDom"),fo("exclusive",!0),fo("tooltipComponents",[]),fo("delay",300),po("mode","normal",["normal","follow-highlight"]),fo("anchor",(function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:p([ic,oc,tc,nc,ec,rc]),onRtl:p([ic,oc,tc,nc,ec,rc])}}})),_u("onHide"),_u("onShow")],hb=Cc({fields:gb,name:"tooltipping",active:mb,state:Object.freeze({__proto__:null,init:function(){var t=Zc(),e=Zc(),n=function(){t.on(clearTimeout)},r=p("not-implemented");return wa({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:n,resetTimer:function(e,r){n(),t.set(setTimeout(e,r))},readState:r})}}),apis:db}),pb=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),vb=tinymce.util.Tools.resolve("tinymce.EditorManager"),bb=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},yb=function(t){return t.getParam("width",pb.DOM.getStyle(t.getElement(),"width"))},xb=function(t){return N.from(t.getParam("min_width")).filter(d)},wb=function(t){return N.from(t.getParam("min_height")).filter(d)},Cb=function(t){return N.from(t.getParam("max_width")).filter(d)},Sb=function(t){return N.from(t.getParam("max_height")).filter(d)},kb=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Ob=function(t){var e=t.getParam("toolbar",!0),n=!0===e,o=r(e),a=i(e)&&e.length>0;return!_b(t)&&(a||o||n)},Eb=function(t){var e=F(9,(function(e){return t.getParam("toolbar"+(e+1),!1,"string")})),n=q(e,(function(t){return"string"==typeof t}));return n.length>0?N.some(n):N.none()},_b=function(t){return Eb(t).fold((function(){return t.getParam("toolbar",[],"string[]").length>0}),S)};!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(pv||(pv={}));var Tb,Mb=function(t){return t.getParam("toolbar_mode","","string")};!function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(Tb||(Tb={}));var Db,zb,Ab=function(t){return t.getParam("toolbar_location",Tb.auto,"string")},Nb=function(t){return Ab(t)===Tb.bottom},Bb=function(t){if(!t.inline)return N.none();var e=function(t){return t.getParam("fixed_toolbar_container","","string")}(t);if(e.length>0)return su(Fe(),e);var n=function(t){return t.getParam("fixed_toolbar_container_target")}(t);return l(n)?N.some(Nt.fromDom(n)):N.none()},Rb=function(t){return t.inline&&Bb(t).isSome()},Hb=function(t){return Bb(t).getOrThunk((function(){return Re(Be(Nt.fromDom(t.getElement())))}))},Vb=function(t){return t.inline&&!kb(t)&&!Ob(t)&&!_b(t)},Ib=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Rb(t)&&!Vb(t)},Lb=function(t){var e=t.getParam("menu");return e?dt(e,(function(t){return O(O({},t),{items:t.items})})):{}},Fb=function(t){return t.getParam("menubar")},Pb=function(t){return t.getParam("anchor_top","#top")},Ub=function(t){return t.getParam("anchor_bottom","#bottom")},jb="silver.readonly",Wb=kr([(Db="readonly",Yr(Db,Nr))]),qb=function(t,e){var n=t.outerContainer.element;e&&(t.mothership.broadcastOn([cf()],{target:n}),t.uiMothership.broadcastOn([cf()],{target:n})),t.mothership.broadcastOn([jb],{readonly:e}),t.uiMothership.broadcastOn([jb],{readonly:e})},Gb=function(t,e){t.on("init",(function(){t.mode.isReadOnly()&&qb(e,!0)})),t.on("SwitchMode",(function(){return qb(e,t.mode.isReadOnly())})),function(t){return t.getParam("readonly",!1,"boolean")}(t)&&t.setMode("readonly")},$b=function(){var t;return Ec.config({channels:(t={},t[jb]={schema:Wb,onReceive:function(t,e){Yd.set(t,e.readonly)}},t)})},Xb=function(t){return Yd.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Kb=function(t){return Yd.config({disabled:t})},Yb=function(t){return Yd.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Jb=function(t){return Yd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Qb=function(t,e){var n=t.getApi(e);return function(t){t(n)}},Zb=function(t,e){return Gi((function(n){Qb(t,n)((function(n){var r=t.onSetup(n);f(r)&&e.set(r)}))}))},ty=function(t,e){return $i((function(n){return Qb(t,n)(e.get())}))},ey=function(t,e){return Ki((function(n,r){Qb(t,n)(t.onAction),t.triggersSubmenu||e!==vv.CLOSE_ON_EXECUTE||(Mi(n,di()),r.stop())}))},ny=((zb={})[ci()]=["disabling","alloy.base.behaviour","toggling","item-events"],zb),ry=Ct,oy=function(t,e,n,r){var o=wo(g);return{type:"item",dom:e.dom,components:ry(e.optComponents),data:t.data,eventOrder:ny,hasSubmenu:t.triggersSubmenu,itemBehaviours:xc([sh("item-events",[ey(t,n),Zb(t,o),ty(t,o)]),Xb((function(){return t.disabled||r.isDisabled()})),$b(),ch.config({})].concat(t.itemBehaviours))}},iy=function(t){return{value:t.value,meta:O({text:t.text.getOr("")},t.meta)}},ay=tinymce.util.Tools.resolve("tinymce.Env"),uy=function(t){var e=ay.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),r=U(n,(function(t){var n=t.toLowerCase().trim();return yt(e,n)?e[n]:t}));return ay.mac?r.join(""):r.join("+")},cy=function(t,e,n){return void 0===n&&(n=[Sv]),Mp(t,{tag:"div",classes:n},e)},sy=function(t){return{dom:{tag:"div",classes:[kv]},components:[Ja(xp.translate(t))]}},ly=function(t,e){return{dom:{tag:"div",classes:e,innerHtml:t}}},fy=function(t,e){return{dom:{tag:"div",classes:[kv]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Ja(xp.translate(e))]}]}},dy=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:uy(t)}}},my=function(t){return cy("checkmark",t,["tox-collection__item-checkmark"])},gy=function(t,e,n){var r,o,i,a,u=t.ariaLabel,c=t.value,s=t.iconContent.map((function(t){return function(t,e,n){var r=e();return Op(t,r).or(n).getOrThunk(Sp(r))}(t,e.icons,n)}));return{dom:(r=xv,o=s.getOr(""),i=u.map((function(t){return{title:e.translate(t)}})).getOr({}),a={tag:"div",attributes:i,classes:[r]},O(O({},a),"custom"===c?{tag:"button",classes:_(_([],a.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:o}:"remove"===c?{classes:_(_([],a.classes,!0),["tox-swatch--remove"],!1),innerHtml:o}:{attributes:O(O({},a.attributes),{"data-mce-color":c}),styles:{"background-color":c}})),optComponents:[]}},hy=function(t){var e=t.map((function(t){return{attributes:{title:xp.translate(t)}}})).getOr({});return O({tag:"div",classes:[bv,yv]},e)},py=function(t,e,n,r){return void 0===r&&(r=N.none()),"color"===t.presets?gy(t,e,r):function(t,e,n,r){var o={tag:"div",classes:[Sv]},i=n?t.iconContent.map((function(t){return Mp(t,o,e.icons,r)})).orThunk((function(){return N.some({dom:o})})):N.none(),a=t.checkMark,u=N.from(t.meta).fold((function(){return sy}),(function(t){return yt(t,"style")?y(fy,t.style):sy})),c=t.htmlContent.fold((function(){return t.textContent.map(u)}),(function(t){return N.some(ly(t,[kv]))}));return{dom:hy(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(dy),a,t.caret]}}(t,e,n,r)},vy=function(t,e){return bt(t,"tooltipWorker").map((function(t){return[hb.config({lazySink:e.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:gs}}},mode:"follow-highlight",onShow:function(e,n){t((function(t){hb.setComponents(e,[Qa({element:Nt.fromDom(t)})])}))}})]})).getOr([])},by=function(t,e){var n=function(t){return pb.DOM.encode(t)}(xp.translate(t));if(e.length>0){var r=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(e),"gi");return n.replace(r,(function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"}))}return n},yy=function(t,e){return U(t,(function(t){switch(t.type){case"cardcontainer":return function(t,e){var n="vertical"===t.direction?"tox-collection__item-container--column":Tv,r="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[_v,n,r,function(){switch(t.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:e}}(t,yy(t.items,e));case"cardimage":return function(t,e,n){return{dom:{tag:"img",classes:e,attributes:{src:t,alt:n.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var n=t.name.exists((function(t){return I(e.cardText.highlightOn,t)})),r=n?N.from(e.cardText.matchText).getOr(""):"";return ly(by(t.text,r),t.classes)}}))},xy=ld(Vh(),Ih()),wy=function(t){return{value:t}},Cy=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Sy=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ky=function(t){return Cy.test(t)||Sy.test(t)},Oy=function(t){return function(t,e){return _t(t,e)?function(t,e){return t.substring(e)}(t,e.length):t}(t,"#").toUpperCase()},Ey=function(t){var e=function(t){var e=t.value.replace(Cy,(function(t,e,n,r){return e+e+n+n+r+r}));return{value:e}}(t),n=Sy.exec(e.value);return null===n?["FFFFFF","FF","FF","FF"]:n},_y=function(t){var e=t.toString(16);return(1===e.length?"0"+e:e).toUpperCase()},Ty=function(t){var e=_y(t.red)+_y(t.green)+_y(t.blue);return wy(e)},My=Math.min,Dy=Math.max,zy=Math.round,Ay=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ny=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,By=function(t,e,n,r){return{red:t,green:e,blue:n,alpha:r}},Ry=function(t){var e=parseInt(t,10);return e.toString()===t&&e>=0&&e<=255},Hy=function(t){var e,n,r,o=(t.hue||0)%360,i=t.saturation/100,a=t.value/100;if(i=Dy(0,My(i,1)),a=Dy(0,My(a,1)),0===i)return e=n=r=zy(255*a),By(e,n,r,1);var u=o/60,c=a*i,s=c*(1-Math.abs(u%2-1)),l=a-c;switch(Math.floor(u)){case 0:e=c,n=s,r=0;break;case 1:e=s,n=c,r=0;break;case 2:e=0,n=c,r=s;break;case 3:e=0,n=s,r=c;break;case 4:e=s,n=0,r=c;break;case 5:e=c,n=0,r=s;break;default:e=n=r=0}return e=zy(255*(e+l)),n=zy(255*(n+l)),r=zy(255*(r+l)),By(e,n,r,1)},Vy=function(t){var e=Ey(t),n=parseInt(e[1],16),r=parseInt(e[2],16),o=parseInt(e[3],16);return By(n,r,o,1)},Iy=function(t,e,n,r){var o=parseInt(t,10),i=parseInt(e,10),a=parseInt(n,10),u=parseFloat(r);return By(o,i,a,u)},Ly=function(t){if("transparent"===t)return N.some(By(0,0,0,0));var e=Ay.exec(t);if(null!==e)return N.some(Iy(e[1],e[2],e[3],"1"));var n=Ny.exec(t);return null!==n?N.some(Iy(n[1],n[2],n[3],n[4])):N.none()},Fy=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Py=By(255,0,0,1),Uy=function(t,e){return t.fire("ResizeContent",e)},jy=function(t,e,n){return{hue:t,saturation:e,value:n}},Wy=function(t){var e,n=0,r=0,o=t.red/255,i=t.green/255,a=t.blue/255,u=Math.min(o,Math.min(i,a)),c=Math.max(o,Math.max(i,a));return u===c?jy(0,0,100*(r=u)):(n=60*((n=o===u?3:a===u?1:5)-(o===u?i-a:a===u?o-i:a-o)/(c-u)),e=(c-u)/c,r=c,jy(Math.round(n),Math.round(100*e),Math.round(100*r)))},qy=function(t){return Ty(Hy(t))},Gy=function(t){return(e=t,ky(e)?N.some({value:Oy(e)}):N.none()).orThunk((function(){return Ly(t).map(Ty)})).getOrThunk((function(){var e=document.createElement("canvas");e.height=1,e.width=1;var n=e.getContext("2d");n.clearRect(0,0,e.width,e.height),n.fillStyle="#FFFFFF",n.fillStyle=t,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],u=r[3];return Ty(By(o,i,a,u))}));var e},$y=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Xy="tinymce-custom-colors";var Ky,Yy="choiceitem",Jy=[{type:Yy,text:"Light Green",value:"#BFEDD2"},{type:Yy,text:"Light Yellow",value:"#FBEEB8"},{type:Yy,text:"Light Red",value:"#F8CAC6"},{type:Yy,text:"Light Purple",value:"#ECCAFA"},{type:Yy,text:"Light Blue",value:"#C2E0F4"},{type:Yy,text:"Green",value:"#2DC26B"},{type:Yy,text:"Yellow",value:"#F1C40F"},{type:Yy,text:"Red",value:"#E03E2D"},{type:Yy,text:"Purple",value:"#B96AD9"},{type:Yy,text:"Blue",value:"#3598DB"},{type:Yy,text:"Dark Turquoise",value:"#169179"},{type:Yy,text:"Orange",value:"#E67E23"},{type:Yy,text:"Dark Red",value:"#BA372A"},{type:Yy,text:"Dark Purple",value:"#843FA1"},{type:Yy,text:"Dark Blue",value:"#236FA1"},{type:Yy,text:"Light Gray",value:"#ECF0F1"},{type:Yy,text:"Medium Gray",value:"#CED4D9"},{type:Yy,text:"Gray",value:"#95A5A6"},{type:Yy,text:"Dark Gray",value:"#7E8C8D"},{type:Yy,text:"Navy Blue",value:"#34495E"},{type:Yy,text:"Black",value:"#000000"},{type:Yy,text:"White",value:"#ffffff"}],Qy=function(t){void 0===t&&(t=10);var e,n=$y.getItem(Xy),o=r(n)?JSON.parse(n):[],i=t-(e=o).length<0?e.slice(0,t):e,a=function(t){i.splice(t,1)};return{add:function(e){(function(t,e){var n=V(t,e);return-1===n?N.none():N.some(n)})(i,e).each(a),i.unshift(e),i.length>t&&i.pop(),$y.setItem(Xy,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Zy=function(t){return!1!==t.getParam("custom_colors")},tx=function(t){var e=function(t){return t.getParam("color_map")}(t);return void 0!==e?function(t){for(var e=[],n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+Gy(t[n]).value,type:"choiceitem"});return e}(e):Jy},ex=function(t){Qy.add(t)},nx="#000000",rx=function(t){var e=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))}(tx(t).length);return function(t,e){return t.getParam("color_cols",e,"number")}(t,e)},ox=function(t){var e="choiceitem",n={type:e,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n]},ix=function(t,e,n,r){"custom"===n?fx(t)((function(n){n.each((function(n){ex(n),t.execCommand("mceApplyTextcolor",e,n),r(n)}))}),nx):"remove"===n?(r(""),t.execCommand("mceRemoveTextcolor",e)):(r(n),t.execCommand("mceApplyTextcolor",e,n))},ax=function(t,e){return t.concat(U(Qy.state(),(function(t){return{type:Yy,text:t,value:t}})).concat(ox(e)))},ux=function(t,e){return function(n){n(ax(t,e))}},cx=function(t,e,n){var r="forecolor"===e?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(r,n)},sx=function(t,e,n,r,o){t.ui.registry.addSplitButton(e,{tooltip:r,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var r=function(t,e){var n;return t.dom.getParents(t.selection.getStart(),(function(t){var r;(r=t.style["forecolor"===e?"color":"background-color"])&&(n=n||r)})),N.from(n)}(t,n);return r.bind((function(t){return Ly(t).map((function(t){var n=Ty(t).value;return Et(e.toLowerCase(),n)}))})).getOr(!1)},columns:rx(t),fetch:ux(tx(t),Zy(t)),onAction:function(e){ix(t,n,o.get(),g)},onItemAction:function(r,i){ix(t,n,i,(function(n){o.set(n),function(t,e){t.fire("TextColorChange",e)}(t,{name:e,color:n})}))},onSetup:function(n){cx(n,e,o.get());var r=function(t){t.name===e&&cx(n,t.name,t.color)};return t.on("TextColorChange",r),function(){t.off("TextColorChange",r)}}})},lx=function(t,e,n,r){t.ui.registry.addNestedMenuItem(e,{text:r,icon:"forecolor"===e?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(e){ix(t,n,e.value,g)}}]}})},fx=function(t){return function(e,n){var r=!1,o={colorpicker:n};t.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:!0}],initialData:o,onAction:function(t,e){"hex-valid"===e.name&&(r=e.value)},onSubmit:function(n){var o=n.getData().colorpicker;r?(e(N.from(o)),n.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",o]))},onClose:g,onCancel:function(){e(N.none())}})}},dx=function(t,e,n,r,o,i,a,u){var c=Lv(e),s=mx(e,n,r,"color"!==o?"normal":"color",i,a,u);return Uv(t,c,s,r,o)},mx=function(t,e,n,r,o,i,a){return Ct(U(t,(function(u){return"choiceitem"===u.type?(c=u,Pr("choicemenuitem",Jv,c)).fold(Fv,(function(c){return N.some(function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=py({presets:n,textContent:e?t.text:N.none(),htmlContent:N.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:e?t.shortcut:N.none(),checkMark:e?N.some(my(a.icons)):N.none(),caret:N.none(),value:t.value},a,u);return ur(oy({data:iy(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Eh.set(t,e)},isActive:function(){return Eh.isOn(t)},isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},onAction:function(e){return r(t.value)},onSetup:function(t){return t.setActive(o),g},triggersSubmenu:!1,itemBehaviours:[]},c,i,a),{toggling:{toggleClass:Cv,toggleOnExecute:!1,selected:t.active}})}(c,1===n,r,e,i(u.value),o,a,Lv(t)))})):N.none();var c})))},gx=function(t,e){var n=Av(e);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===e?"tox-swatches__row":"tox-collection__group")}},hx=function(t,e){var n=t.initData.allowCustomColors&&e.colorinput.hasCustomColors();return t.initData.colors.fold((function(){return ax(e.colorinput.getColors(),n)}),(function(t){return t.concat(ox(n))}))},px=oa("cell-over"),vx=oa("cell-execute"),bx=function(t,e,n){var r,o=function(n){return Di(n,vx,{row:t,col:e})},i=function(t,e){e.stop(),o(t)};return tu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:xc([sh("insert-table-picker-cell",[Ii(Wo(),gh.focus),Ii(ci(),o),Ii(Jo(),i),Ii(li(),i)]),Eh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),gh.config({onFocus:function(n){return Di(n,px,{row:t,col:e})}})])})},yx=function(t){return J(t,(function(t){return U(t,eu)}))},xx=function(t,e){return Ja(e+"x"+t)},wx={inserttable:function(t){var e=oa("size-label"),n=function(t,e,n){for(var r=[],o=0;o<e;o++){for(var i=[],a=0;a<n;a++)i.push(bx(o,a,t));r.push(i)}return r}(e,10,10),r=xx(0,0),o=yp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:e}},components:[r],behaviours:xc([ch.config({})])});return{type:"widget",data:{value:oa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[xy.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:yx(n).concat(o.asSpec()),behaviours:xc([sh("insert-table-picker",[Gi((function(t){ch.set(o.get(t),[r])})),Ui(px,(function(t,e,r){var i=r.event,a=i.row,u=i.col;!function(t,e,n,r,o){for(var i=0;i<r;i++)for(var a=0;a<o;a++)Eh.set(t[i][a],i<=e&&a<=n)}(n,a,u,10,10),ch.set(o.get(t),[xx(a+1,u+1)])})),Ui(vx,(function(e,n,r){var o=r.event,i=o.row,a=o.col;t.onAction({numRows:i+1,numColumns:a+1}),Mi(e,di())}))]),nh.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,e){var n=hx(t,e),r=e.colorinput.getColorCols(),o="color",i=dx(oa("menu-value"),n,(function(e){t.onAction({value:e})}),r,o,vv.CLOSE_ON_EXECUTE,C,e.shared.providers),a=O(O({},i),{markers:Av(o),movement:gx(r,o)});return{type:"widget",data:{value:oa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[xy.widget(Wh.sketch(a))]}}},Cx=function(t,e,n,r,o,i,a,u){void 0===u&&(u=!0);var c=py({presets:r,textContent:N.none(),htmlContent:n?t.text.map((function(t){return by(t,e)})):N.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:N.none(),checkMark:N.none(),caret:N.none(),value:t.value},a.providers,u,t.icon);return oy({data:iy(t),disabled:t.disabled,getApi:p({}),onAction:function(e){return o(t.value,t.meta)},onSetup:p(g),triggersSubmenu:!1,itemBehaviours:vy(t.meta,a)},c,i,a.providers)},Sx=function(t){var e=t.text.fold((function(){return{}}),(function(t){return{innerHtml:t}}));return{type:"separator",dom:O({tag:"div",classes:[yv,"tox-collection__group-heading"]},e),components:[]}},kx=function(t,e,n,r){void 0===r&&(r=!0);var o=py({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:N.none(),ariaLabel:t.text,caret:N.none(),checkMark:N.none(),shortcutContent:t.shortcut},n,r);return oy({data:iy(t),getApi:function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n)},Ox=function(t,e,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var i,a=o?(i=n.icons,cy("chevron-down",i,[Ov])):function(t){return cy("chevron-right",t,[Ov])}(n.icons),u=py({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:N.none(),ariaLabel:t.text,caret:N.some(a),checkMark:N.none(),shortcutContent:t.shortcut},n,r);return oy({data:iy(t),getApi:function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},disabled:t.disabled,onAction:g,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,e,n)},Ex=function(t,e,n,r){void 0===r&&(r=!0);var o=py({iconContent:t.icon,textContent:t.text,htmlContent:N.none(),ariaLabel:t.text,checkMark:N.some(my(n.icons)),caret:N.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},n,r);return ur(oy({data:iy(t),disabled:t.disabled,getApi:function(t){return{setActive:function(e){Eh.set(t,e)},isActive:function(){return Eh.isOn(t)},isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,e,n),{toggling:{toggleClass:Cv,toggleOnExecute:!1,selected:t.active}})},_x=function(t,e){return bt(wx,t.fancytype).map((function(n){return n(t,e)}))},Tx=function(t,e,n,r){var o={dom:hy(t.label),optComponents:[N.some({dom:{tag:"div",classes:[_v,Tv]},components:yy(t.items,r)})]};return oy({data:iy(O({text:N.none()},t)),disabled:t.disabled,getApi:function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){Yd.set(t,e),j(ol(t.element,"*"),(function(n){t.getSystem().getByDom(n).each((function(t){t.hasConfigured(Yd)&&Yd.set(t,e)}))}))}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:N.from(r.itemBehaviours).getOr([])},o,e,n.providers)};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(Ky||(Ky={}));var Mx=function(t,e,n,r,o){var i,a=n.shared.providers,u=function(t){return o?O(O({},t),{shortcut:N.none(),icon:t.text.isSome()?N.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,Pr("menuitem",nb,i)).fold(Fv,(function(t){return N.some(kx(u(t),e,a,r))}));case"nestedmenuitem":return function(t){return Pr("nestedmenuitem",rb,t)}(t).fold(Fv,(function(t){return N.some(Ox(u(t),e,a,r,o))}));case"togglemenuitem":return function(t){return Pr("togglemenuitem",ob,t)}(t).fold(Fv,(function(t){return N.some(Ex(u(t),e,a,r))}));case"separator":return function(t){return Pr("separatormenuitem",Qp,t)}(t).fold(Fv,(function(t){return N.some(Sx(t))}));case"fancymenuitem":return function(t){return Pr("fancymenuitem",eb,t)}(t).fold(Fv,(function(t){return _x(u(t),n)}));default:return console.error("Unknown item in general menu",t),N.none()}},Dx=function(t,e,n,r,o,i,a){var u=1===r,c=!u||Lv(t);return Ct(U(t,(function(t){switch(t.type){case"separator":return(r=t,Pr("Autocompleter.Separator",Qp,r)).fold(Fv,(function(t){return N.some(Sx(t))}));case"cardmenuitem":return function(t){return Pr("cardmenuitem",Yv,t)}(t).fold(Fv,(function(t){return N.some(Tx(O(O({},t),{onAction:function(e){t.onAction(e),n(t.value,t.meta)}}),o,i,{itemBehaviours:vy(t.meta,i),cardText:{matchText:e,highlightOn:a}}))}));default:return function(t){return Pr("Autocompleter.Item",Zp,t)}(t).fold(Fv,(function(t){return N.some(Cx(t,e,u,"normal",n,o,i,c))}))}var r})))},zx=function(t,e,n,r,o){var i=Lv(e),a=Ct(U(e,(function(t){var e=function(t){return Mx(t,n,r,function(t){return o?!yt(t,"text"):i}(t),o)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?e(O(O({},t),{disabled:!0})):e(t)})));return(o?Pv:Uv)(t,i,a,1,"normal")},Ax=function(t){return Yh.singleData(t.value,t)},Nx=function(t,e){var n=Zc(),r=wo(!1),o=tu(Jh.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:xc([sh("dismissAutocompleter",[Ii(wi(),(function(){return u()}))])]),lazySink:e.getSink})),i=function(){return n.get().isSome()},a=function(){i()&&Jh.hide(o)},u=function(){if(i()){var e=n.get().map((function(t){return t.element}));Ip(e.getOr(Nt.fromDom(t.selection.getNode()))).each(Dn),a(),n.clear(),r.set(!1)}},c=Pt((function(){return hv(t)})),s=function(e,n,r,i){e.matchLength=n.text.length;var a=ct(r,(function(t){return N.from(t.columns)})).getOr(1);Jh.showAt(o,Wh.sketch(function(t,e,n,r){var o=n===Ky.ContentFocus?Mm():Tm(),i=gx(e,r),a=Av(r);return{dom:t.dom,components:t.components,items:t.items,value:t.value,markers:{selectedItem:a.selectedItem,item:a.item},movement:i,fakeFocus:n===Ky.ContentFocus,focusManager:o,menuBehaviours:ub("auto"!==e?[]:[Gi((function(t,e){ib(t,4,a.item).each((function(e){var n=e.numColumns,r=e.numRows;nh.setGridSize(t,r,n)}))}))])}}(Uv("autocompleter-value",!0,i,a,"normal"),a,Ky.ContentFocus,"normal")),{anchor:{type:"node",root:Nt.fromDom(t.getBody()),node:N.from(e.element)}}),Jh.getContent(o).each(um.highlightFirst)},l=function(o){(function(e){return n.get().map((function(n){return jp(t.dom,t.selection.getRng(),n.triggerChar).bind((function(n){return Jp(t,c,n,e)}))})).getOrThunk((function(){return Yp(t,c)}))})(o).fold(u,(function(o){!function(e){if(!i()){var o=Vp(t,e.range);n.set({triggerChar:e.triggerChar,element:o,matchLength:e.text.length}),r.set(!1)}}(o.context),o.lookupData.then((function(i){n.get().map((function(n){var c,f,d,m=o.context;if(n.triggerChar===m.triggerChar){var g=(c=m.triggerChar,d=ct(f=i,(function(t){return N.from(t.columns)})).getOr(1),J(f,(function(n){var o=n.items;return Dx(o,n.matchText,(function(e,o){var i=t.selection.getRng();jp(t.dom,i,c).fold((function(){return console.error("Lost context. Cursor probably moved")}),(function(t){var i=t.range,c={hide:function(){u()},reload:function(t){a(),l(t)}};r.set(!0),n.onAction(c,i,e,o),r.set(!1)}))}),d,vv.BUBBLE_TO_SANDBOX,e,n.highlightOn)})));g.length>0?s(n,m,i,g):m.text.length-n.matchLength>=10?u():a()}}))}))}))},f={onKeypress:Bp((function(t){27!==t.which&&l()}),50),cancelIfNecessary:u,isMenuOpen:function(){return Jh.isOpen(o)},isActive:i,isProcessingAction:r.get,getView:function(){return Jh.getContent(o)}};!1===t.hasPlugin("rtc")&&Wp(f,t)},Bx=function(t,e,n){return lu(t,e,n).isSome()},Rx=function(t,e){var n=null;return{cancel:function(){null!==n&&(clearTimeout(n),n=null)},schedule:function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n=setTimeout((function(){t.apply(null,r),n=null}),e)}}},Hx=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?N.none():N.some(e.touches[0])},Vx=function(t){var e=Zc(),n=wo(!1),r=Rx((function(e){t.triggerEvent(fi(),e),n.set(!0)}),400),o=Eo([{key:Ho(),value:function(t){return Hx(t).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:t.target};r.schedule(t),n.set(!1),e.set(i)})),N.none()}},{key:Vo(),value:function(t){return r.cancel(),Hx(t).each((function(t){e.on((function(n){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,n)&&e.clear()}))})),N.none()}},{key:Io(),value:function(o){r.cancel();return e.get().filter((function(t){return be(t.target,o.target)})).map((function(e){return n.get()?(o.prevent(),!1):t.triggerEvent(li(),o)}))}}]);return{fireIfReady:function(t,e){return bt(o,e).bind((function(e){return e(t)}))}}},Ix=function(){return he().browser.isFirefox()},Lx=function(t,e){var n=O({stopBackspace:!0},e),r=Vx(n),o=U(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(e){return es(t,e,(function(t){r.fireIfReady(t,e).each((function(e){e&&t.kill()})),n.triggerEvent(e,t)&&t.kill()}))})),i=Zc(),a=es(t,"paste",(function(t){r.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),n.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout((function(){n.triggerEvent(ai(),t)}),0))})),u=es(t,"keydown",(function(t){n.triggerEvent("keydown",t)?t.kill():n.stopBackspace&&function(t){return t.raw.which===cm[0]&&!I(["input","textarea"],Rt(t.target))&&!Bx(t.target,'[contenteditable="true"]')}(t)&&t.prevent()})),c=function(t,e){return Ix()?ns(t,"focus",e):es(t,"focusin",e)}(t,(function(t){n.triggerEvent("focusin",t)&&t.kill()})),s=Zc(),l=function(t,e){return Ix()?ns(t,"blur",e):es(t,"focusout",e)}(t,(function(t){n.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout((function(){n.triggerEvent(ii(),t)}),0))}));return{unbind:function(){j(o,(function(t){t.unbind()})),u.unbind(),c.unbind(),l.unbind(),a.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},Fx=function(t,e){var n=bt(t,"target").getOr(e);return wo(n)},Px=Co([{stopped:[]},{resume:["element"]},{complete:[]}]),Ux=function(t,e,n,r,o,i){var a=t(e,r),u=function(t,e){var n=wo(!1),r=wo(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(e,r),Px.complete()}),(function(t){var n=t.descHandler;return ka(n)(u),u.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Px.stopped()):u.isCut()?(i.logEventCut(e,t.element,n.purpose),Px.complete()):Oe(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Px.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Px.resume(r)}))}))},jx=function(t,e,n,r,o,i){return Ux(t,e,n,r,o,i).fold(S,(function(r){return jx(t,e,n,r,o,i)}),C)},Wx=function(t,e,n){var r=function(t){var e=wo(!1);return{stop:function(){e.set(!0)},cut:g,isStopped:e.get,isCut:C,event:t,setSource:w("Cannot set source of a broadcasted event"),getSource:w("Cannot get source of a broadcasted event")}}(e);return j(t,(function(t){var e=t.descHandler;ka(e)(r)})),r.isStopped()},qx=function(t,e,n,r,o){var i=Fx(n,r);return jx(t,e,n,r,i,o)},Gx=function(){var t={};return{registerId:function(e,n,r){ft(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=y.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){ft(t,(function(t,n){yt(t,e)&&delete t[e]}))},filterByType:function(e){return bt(t,e).map((function(t){return ht(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return bt(t,n).bind((function(t){return Do(r,(function(e){return function(t,e){return la(e).bind((function(e){return bt(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},$x=function(){var t=Gx(),e={},n=function(t){var e=t.element;return la(e).getOrThunk((function(){return function(t,e){var n=oa(ua+t);return sa(e,n),n}("uid-",t.element)}))},r=function(n){la(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);xt(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+ta(o.element)+"\nCannot use it for: "+ta(t.element)+"\nThe conflicting element is"+(Le(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var a=[o];t.registerId(a,i,o.events),e[i]=o},unregister:r,getById:function(t){return bt(e,t)}}},Xx=zd({name:"Container",factory:function(t){var e=t.dom,n=e.attributes,r=E(e,["attributes"]);return{uid:t.uid,dom:O({tag:"div",attributes:O({role:"presentation"},n)},r),components:t.components,behaviours:Mf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[fo("components",[]),Tf("containerBehaviours",[]),fo("events",{}),fo("domModification",{}),fo("eventOrder",{})]}),Kx=function(t){var e=function(e){return Oe(t.element).fold(S,(function(t){return be(e,t)}))},n=$x(),r=function(t,r){return n.find(e,t,r)},o=Lx(t.element,{triggerEvent:function(t,e){return bu(t,e.target,(function(n){return function(t,e,n,r){return qx(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:p("real"),triggerEvent:function(t,e,n){bu(t,e,(function(o){return qx(r,t,n,e,o)}))},triggerFocus:function(t,e){la(t).fold((function(){Mc(t)}),(function(n){bu(oi(),t,(function(n){return function(t,e,n,r,o){var i=Fx(n,r);Ux(t,e,n,r,i,o)}(r,oi(),{originator:e,kill:g,prevent:g,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return h(t)},getByDom:function(t){return v(t)},build:tu,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){a(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:S},a=function(t){t.connect(i),It(t.element)||(n.register(t),j(t.components(),a),i.triggerEvent(gi(),t.element,{target:t.element}))},u=function(t){It(t.element)||(j(t.components(),u),n.unregister(t)),t.disconnect()},c=function(e){Ul(t,e)},s=function(t){ql(t)},l=function(t){var e=n.filter(ui());j(e,(function(e){var n=e.descHandler;ka(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return Wx(r,e)},h=function(t){return n.getById(t).fold((function(){return Wn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),Wn.value)},v=function(t){var e=la(t).getOr("not found");return h(e)};return a(t),{root:t,element:t.element,destroy:function(){o.unbind(),Mn(t.element)},add:c,remove:s,getByUid:h,getByDom:v,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Yx=p([fo("prefix","form-field"),Tf("fieldBehaviours",[Hd,_f])]),Jx=p([id({schema:[Kr("dom")],name:"label"}),id({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Kr("text")],name:"aria-descriptor"}),rd({factory:{sketch:function(t){var e=ko(t,["factory"]);return t.factory.sketch(e)}},schema:[Kr("factory")],name:"field"})]),Qx=Ad({name:"FormField",configFields:Yx(),partFields:Jx(),factory:function(t,e,n,r){var o=Df(t.fieldBehaviours,[Hd.config({find:function(e){return vd(e,t,"field")}}),_f.config({store:{mode:"manual",getValue:function(t){return Hd.getCurrent(t).bind(_f.getValue)},setValue:function(t,e){Hd.getCurrent(t).each((function(t){_f.setValue(t,e)}))}}})]),i=Ri([Gi((function(e,n){var r=yd(e,t,["label","field","aria-descriptor"]);r.field().each((function(e){var n=oa(t.prefix);r.label().each((function(t){je(t.element,"for",n),je(e.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=oa(t.prefix);je(n.element,"id",r),je(e.element,"aria-describedby",r)}))}))}))]),a={getField:function(e){return vd(e,t,"field")},getLabel:function(e){return vd(e,t,"label")}};return{uid:t.uid,dom:t.dom,components:e,behaviours:o,events:i,apis:a}},apis:{getField:function(t,e){return t.getField(e)},getLabel:function(t,e){return t.getLabel(e)}}}),Zx=Object.freeze({__proto__:null,exhibit:function(t,e){return Sa({attributes:Eo([{key:e.tabAttr,value:"true"}])})}}),tw=[fo("tabAttr","data-alloy-tabstop")],ew=Cc({fields:tw,name:"tabstopping",active:Zx}),nw=tinymce.util.Tools.resolve("tinymce.html.Entities"),rw=function(t,e,n,r){var o=ow(t,e,n,r);return Qx.sketch(o)},ow=function(t,e,n,r){return{dom:iw(n),components:t.toArray().concat([e]),fieldBehaviours:xc(r)}},iw=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},aw=function(t,e){return Qx.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}})},uw=oa("form-component-change"),cw=oa("form-close"),sw=oa("form-cancel"),lw=oa("form-action"),fw=oa("form-submit"),dw=oa("form-block"),mw=oa("form-unblock"),gw=oa("form-tabchange"),hw=oa("form-resize"),pw=function(t,e){var n,r,o,i=t.label.map((function(t){return aw(t,e)})),a=function(t){return function(e,n){lu(n.event.target,"[data-collection-item-value]").each((function(r){t(e,n,r,qe(r,"data-collection-item-value"))}))}},u=a((function(n,r,o,i){r.stop(),e.isDisabled()||Di(n,lw,{name:t.name,value:i})})),c=[Ii(Wo(),a((function(t,e,n){Mc(n)}))),Ii(Jo(),u),Ii(li(),u),Ii(qo(),a((function(t,e,n){su(t.element,"."+Ev).each((function(t){La(t,Ev)})),Va(n,Ev)}))),Ii(Go(),a((function(t){su(t.element,"."+Ev).each((function(t){La(t,Ev)}))}))),Ki(a((function(e,n,r,o){Di(e,lw,{name:t.name,value:o})})))],s=function(t,e){return U(ol(t.element,".tox-collection__item"),e)},l=Qx.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:v},behaviours:xc([Yd.config({disabled:e.isDisabled,onDisabled:function(t){s(t,(function(t){Va(t,"tox-collection__item--state-disabled"),je(t,"aria-disabled",!0)}))},onEnabled:function(t){s(t,(function(t){La(t,"tox-collection__item--state-disabled"),Xe(t,"aria-disabled")}))}}),$b(),ch.config({}),_f.config({store:{mode:"memory",initialValue:[]},onSetValue:function(n,r){!function(n,r){var o=U(r,(function(n){var r=xp.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'+r+"</div>":"",i='<div class="tox-collection__item-icon">'+n.icon+"</div>",a={_:" "," - ":" ","-":" "},u=r.replace(/\_| \- |\-/g,(function(t){return a[t]}));return'<div class="tox-collection__item'+(e.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+nw.encodeAllRaw(n.value)+'" title="'+u+'" aria-label="'+u+'">'+i+o+"</div>"})),i="auto"!==t.columns&&t.columns>1?P(o,t.columns):[o],a=U(i,(function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}));Ji(n.element,a.join(""))}(n,r),"auto"===t.columns&&ib(n,5,"tox-collection__item").each((function(t){var e=t.numRows,r=t.numColumns;nh.setGridSize(n,e,r)})),Mi(n,hw)}}),ew.config({}),nh.config((r=t.columns,o="normal",1===r?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===r?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===o?".tox-swatches__row":".tox-collection__group",cell:"color"===o?"."+xv:"."+yv}})),sh("collection-events",c)]),eventOrder:(n={},n[ci()]=["disabling","alloy.base.behaviour","collection-events"],n)});return rw(i,l,["tox-form__group--collection"],[])},vw=p([oo("data"),fo("inputAttributes",{}),fo("inputStyles",{}),fo("tag","input"),fo("inputClasses",[]),_u("onSetValue"),fo("styles",{}),fo("eventOrder",{}),Tf("inputBehaviours",[_f,gh]),fo("selectOnFocus",!0)]),bw=function(t){return xc([gh.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=ja(e);e.dom.setSelectionRange(0,n.length)}:g})])},yw=function(t){return O(O({},bw(t)),Df(t.inputBehaviours,[_f.config({store:O(O({mode:"manual"},t.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return ja(t.element)},setValue:function(t,e){ja(t.element)!==e&&Wa(t.element,e)}}),onSetValue:t.onSetValue})]))},xw=function(t){return{tag:t.tag,attributes:O({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},ww=zd({name:"Input",configFields:vw(),factory:function(t,e){return{uid:t.uid,dom:xw(t),components:[],behaviours:yw(t),eventOrder:t.eventOrder}}}),Cw={},Sw={exports:Cw};!function(t,e,n,r){!function(r,o){"object"==typeof e&&void 0!==n?n.exports=o():"function"==typeof t&&t.amd?t(o):(r="undefined"!=typeof globalThis?globalThis:r||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var n=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}}))}(void 0,Cw,Sw);var kw,Ow=Sw.exports.boltExport,Ew=function(t){var e=N.none(),n=[],r=function(t){o()?a(t):n.push(t)},o=function(){return e.isSome()},i=function(t){j(t,a)},a=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=N.some(t),i(n),n=[])})),{get:r,map:function(t){return Ew((function(e){r((function(n){e(t(n))}))}))},isReady:o}},_w={nu:Ew,pure:function(t){return Ew((function(e){e(t)}))}},Tw=function(t){setTimeout((function(){throw t}),0)},Mw=function(t){var e=function(e){t().then(e,Tw)};return{map:function(e){return Mw((function(){return t().then(e)}))},bind:function(e){return Mw((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return Mw((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return _w.nu(e)},toCached:function(){var e=null;return Mw((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Dw=function(t){return Mw((function(){return new Ow(t)}))},zw=function(t){return Mw((function(){return Ow.resolve(t)}))},Aw=["input","textarea"],Nw=function(t){var e=Rt(t);return I(Aw,e)},Bw=function(t,e){var n=e.getRoot(t).getOr(t.element);La(n,e.invalidClass),e.notify.each((function(e){Nw(t.element)&&je(t.element,"aria-invalid",!1),e.getContainer(t).each((function(t){Ji(t,e.validHtml)})),e.onValid(t)}))},Rw=function(t,e,n,r){var o=e.getRoot(t).getOr(t.element);Va(o,e.invalidClass),e.notify.each((function(e){Nw(t.element)&&je(t.element,"aria-invalid",!0),e.getContainer(t).each((function(t){Ji(t,r)})),e.onInvalid(t,r)}))},Hw=function(t,e,n){return e.validator.fold((function(){return zw(Wn.value(!0))}),(function(e){return e.validate(t)}))},Vw=function(t,e,n){return e.notify.each((function(e){e.onValidate(t)})),Hw(t,e).map((function(n){return t.getSystem().isConnected()?n.fold((function(n){return Rw(t,e,0,n),Wn.error(n)}),(function(n){return Bw(t,e),Wn.value(n)})):Wn.error("No longer in system")}))},Iw=Object.freeze({__proto__:null,markValid:Bw,markInvalid:Rw,query:Hw,run:Vw,isInvalid:function(t,e){var n=e.getRoot(t).getOr(t.element);return Fa(n,e.invalidClass)}}),Lw=Object.freeze({__proto__:null,events:function(t,e){return t.validator.map((function(e){return Ri([Ii(e.onEvent,(function(e){Vw(e,t).get(v)}))].concat(e.validateOnLoad?[Gi((function(e){Vw(e,t).get(g)}))]:[]))})).getOr({})}}),Fw=[Kr("invalidClass"),fo("getRoot",N.none),lo("notify",[fo("aria","alert"),fo("getContainer",N.none),fo("validHtml",""),_u("onValid"),_u("onInvalid"),_u("onValidate")]),lo("validator",[Kr("validate"),fo("onEvent","input"),fo("validateOnLoad",!0)])],Pw=Cc({fields:Fw,name:"invalidating",active:Lw,apis:Iw,extra:{validation:function(t){return function(e){var n=_f.getValue(e);return zw(t(n))}}}}),Uw=Object.freeze({__proto__:null,getCoupled:function(t,e,n,r){return n.getOrCreate(t,e,r)}}),jw=[Yr("others",Fr(Wn.value,Mr()))],Ww=Object.freeze({__proto__:null,init:function(){var t={},e=p({});return wa({readState:e,getOrCreate:function(e,n,r){var o=st(n.others);if(o)return bt(t,r).getOrThunk((function(){var o=bt(n.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(o);return t[r]=i,i}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}}),qw=Cc({fields:jw,name:"coupling",apis:Uw,state:Ww}),Gw=p("sink"),$w=p(id({name:Gw(),overrides:p({dom:{tag:"div"},behaviours:xc([Vl.config({useFixed:S})]),events:Ri([ji($o()),ji(Fo()),ji(Jo())])})}));!function(t){t[t.HighlightFirst=0]="HighlightFirst",t[t.HighlightNone=1]="HighlightNone"}(kw||(kw={}));var Xw,Kw,Yw,Jw=function(t,e){var n=t.getHotspot(e).getOr(e),r="hotspot",o=t.getAnchorOverrides();return t.layouts.fold((function(){return{type:r,hotspot:n,overrides:o}}),(function(t){return{type:r,hotspot:n,overrides:o,layouts:t}}))},Qw=function(t,e,n,r,o,i,a){var u=function(t,e,n,r,o,i,a){var u=function(t,e,n){return(0,t.fetch)(n).map(e)}(t,e,r),c=nC(r,t);return u.map((function(t){return t.bind((function(t){return N.from(Yh.sketch(O(O({},i.menu()),{uid:fa(""),data:t,highlightImmediately:a===kw.HighlightFirst,onOpenMenu:function(t,e){var r=c().getOrDie();Vl.position(r,e,{anchor:n}),uf.decloak(o)},onOpenSubmenu:function(t,e,n){var r=c().getOrDie();Vl.position(r,n,{anchor:{type:"submenu",item:e}}),uf.decloak(o)},onRepositionMenu:function(t,e,r){var o=c().getOrDie();Vl.position(o,e,{anchor:n}),j(r,(function(t){Vl.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})}))},onEscape:function(){return gh.focus(r),uf.close(o),N.some(!0)}})))}))}))}(t,e,Jw(t,n),n,r,o,a);return u.map((function(t){return t.fold((function(){uf.isOpen(r)&&uf.close(r)}),(function(t){uf.cloak(r),uf.open(r,t),i(r)})),r}))},Zw=function(t,e,n,r,o,i,a){return uf.close(r),zw(r)},tC=function(t,e,n,r,o,i){var a=qw.getCoupled(n,"sandbox");return(uf.isOpen(a)?Zw:Qw)(t,e,n,a,r,o,i)},eC=function(t,e,n){var r=Hd.getCurrent(e).getOr(e),o=bn(t.element);n?Je(r.element,"min-width",o+"px"):function(t,e){vn.set(t,e)}(r.element,o)},nC=function(t,e){return t.getSystem().getByUid(e.uid+"-"+Gw()).map((function(t){return function(){return Wn.value(t)}})).getOrThunk((function(){return e.lazySink.fold((function(){return function(){return Wn.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(e){return function(){return e(t)}}))}))},rC=function(t){uf.getState(t).each((function(t){Yh.repositionMenus(t)}))},oC=function(t,e,n){var r=fu(),o=nC(e,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:r.id,role:"listbox"}},behaviours:Af(t.sandboxBehaviours,[_f.config({store:{mode:"memory",initialValue:e}}),uf.config({onOpen:function(o,i){var a=Jw(t,e);r.link(e.element),t.matchWidth&&eC(a.hotspot,i,t.useMinWidth),t.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(t,o){r.unlink(e.element),void 0!==n&&void 0!==n.onClose&&n.onClose(t,o)},isPartOf:function(t,n,r){return mu(n,r)||mu(e,r)},getAttachPoint:function(){return o().getOrDie()}}),Hd.config({find:function(t){return uf.getState(t).bind((function(t){return Hd.getCurrent(t)}))}}),Ec.config({channels:O(O({},df({isExtraPart:C})),gf({doReposition:rC}))})])}},iC=function(t){var e=qw.getCoupled(t,"sandbox");rC(e)},aC=function(){return[fo("sandboxClasses",[]),zf("sandboxBehaviours",[Hd,Ec,uf,_f])]},uC=p([Kr("dom"),Kr("fetch"),_u("onOpen"),Tu("onExecute"),fo("getHotspot",N.some),fo("getAnchorOverrides",p({})),Os(),Tf("dropdownBehaviours",[Eh,qw,nh,gh]),Kr("toggleClass"),fo("eventOrder",{}),oo("lazySink"),fo("matchWidth",!1),fo("useMinWidth",!1),oo("role")].concat(aC())),cC=p([od({schema:[ku()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),$w()]),sC=Ad({name:"Dropdown",configFields:uC(),partFields:cC(),factory:function(t,e,n,r){var o,i,a=function(t){uf.getState(t).each((function(t){Yh.highlightPrimary(t)}))},u={expand:function(e){Eh.isOn(e)||tC(t,v,e,r,g,kw.HighlightNone).get(g)},open:function(e){Eh.isOn(e)||tC(t,v,e,r,g,kw.HighlightFirst).get(g)},isOpen:Eh.isOn,close:function(e){Eh.isOn(e)&&tC(t,v,e,r,g,kw.HighlightFirst).get(g)},repositionMenus:function(t){Eh.isOn(t)&&iC(t)}},c=function(t,e){return zi(t),N.some(!0)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Df(t.dropdownBehaviours,[Eh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),qw.config({others:{sandbox:function(e){return oC(t,e,{onOpen:function(){return Eh.on(e)},onClose:function(){return Eh.off(e)}})}}}),nh.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,e){if(sC.isOpen(t)){var n=qw.getCoupled(t,"sandbox");a(n)}else sC.open(t);return N.some(!0)},onEscape:function(t,e){return sC.isOpen(t)?(sC.close(t),N.some(!0)):N.none()}}),gh.config({})]),events:Th(N.some((function(e){tC(t,v,e,r,a,kw.HighlightFirst).get(g)}))),eventOrder:O(O({},t.eventOrder),(o={},o[ci()]=["disabling","toggling","alloy.base.behaviour"],o)),apis:u,domModification:{attributes:O(O({"aria-haspopup":"true"},t.role.fold((function(){return{}}),(function(t){return{role:t}}))),"button"===t.dom.tag?{type:(i="type",bt(t.dom,"attributes").bind((function(t){return bt(t,i)}))).getOr("button")}:{})}}},apis:{open:function(t,e){return t.open(e)},expand:function(t,e){return t.expand(e)},close:function(t,e){return t.close(e)},isOpen:function(t,e){return t.isOpen(e)},repositionMenus:function(t,e){return t.repositionMenus(e)}}}),lC=Object.freeze({__proto__:null,events:function(){return Ri([Hi(ei(),S)])},exhibit:function(){return Sa({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),fC=Cc({fields:[],name:"unselecting",active:lC}),dC=oa("color-input-change"),mC=oa("color-swatch-change"),gC=oa("color-picker-cancel"),hC=function(t,e,n){var r=Qx.parts.field({factory:ww,inputClasses:["tox-textfield"],onSetValue:function(t){return Pw.run(t).get(g)},inputBehaviours:xc([Yd.config({disabled:e.providers.isDisabled}),$b(),ew.config({}),Pw.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Oe(t.element)},notify:{onValid:function(t){var e=_f.getValue(t);Di(t,dC,{color:e})}},validator:{validateOnLoad:!1,validate:function(t){var e=_f.getValue(t);if(0===e.length)return zw(Wn.value(!0));var n=Nt.fromTag("span");Je(n,"background-color",e);var r=nn(n,"background-color").fold((function(){return Wn.error("blah")}),(function(t){return Wn.value(e)}));return zw(r)}}})]),selectOnFocus:!1}),o=t.label.map((function(t){return aw(t,e.providers)})),i=function(t,e){Di(t,mC,{value:e})},a=yp(function(t,e){return sC.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:xc([Kb(e.providers.isDisabled),$b(),fC.config({}),ew.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:e.getSink,fetch:function(n){return Dw((function(e){return t.fetch(e)})).map((function(r){return N.from(Ax(ur(dx(oa("menu-value"),r,(function(e){t.onItemAction(n,e)}),t.columns,t.presets,vv.CLOSE_ON_EXECUTE,C,e.providers),{movement:gx(t.columns,t.presets)})))}))},parts:{menu:Rv(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":e.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[ec,tc,ic]},onLtr:function(){return[tc,ec,ic]}},components:[],fetch:ux(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(t,e){a.getOpt(t).each((function(t){"custom"===e?n.colorPicker((function(e){e.fold((function(){return Mi(t,gC)}),(function(e){i(t,e),ex(e)}))}),"#ffffff"):i(t,"remove"===e?"":e)}))}},e));return Qx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:o.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:xc([sh("form-field-events",[Ii(dC,(function(e,n){a.getOpt(e).each((function(t){Je(t.element,"background-color",n.event.color)})),Di(e,uw,{name:t.name})})),Ii(mC,(function(t,e){Qx.getField(t).each((function(n){_f.setValue(n,e.event.value),Hd.getCurrent(t).each(gh.focus)}))})),Ii(gC,(function(t,e){Qx.getField(t).each((function(e){Hd.getCurrent(t).each(gh.focus)}))}))])])})},pC=id({schema:[Kr("dom")],name:"label"}),vC=function(t){return id({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Ri([Li(Ho(),(function(e,n,r){return t(e,r)}),[e]),Li(Fo(),(function(e,n,r){return t(e,r)}),[e]),Li(Po(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},bC=vC("top-left"),yC=vC("top"),xC=vC("top-right"),wC=vC("right"),CC=vC("bottom-right"),SC=vC("bottom"),kC=vC("bottom-left"),OC=vC("left"),EC=rd({name:"thumb",defaults:p({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Ri([Pi(Ho(),t,"spectrum"),Pi(Vo(),t,"spectrum"),Pi(Io(),t,"spectrum"),Pi(Fo(),t,"spectrum"),Pi(Po(),t,"spectrum"),Pi(jo(),t,"spectrum")])}}}),_C=rd({schema:[$r("mouseIsDown",(function(){return wo(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:xc([nh.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),gh.config({})]),events:Ri([Ii(Ho(),n),Ii(Vo(),n),Ii(Fo(),n),Ii(Po(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),TC=[pC,OC,wC,yC,SC,bC,xC,kC,CC,EC,_C],MC=p("slider.change.value"),DC=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?N.some(n.touches[0]).map((function(t){return mn(t.clientX,t.clientY)})):N.none()}var r=e;return void 0!==r.clientX?N.some(r).map((function(t){return mn(t.clientX,t.clientY)})):N.none()},zC=function(t){return t.model.minX},AC=function(t){return t.model.minY},NC=function(t){return t.model.minX-1},BC=function(t){return t.model.minY-1},RC=function(t){return t.model.maxX},HC=function(t){return t.model.maxY},VC=function(t){return t.model.maxX+1},IC=function(t){return t.model.maxY+1},LC=function(t,e,n){return e(t)-n(t)},FC=function(t){return LC(t,RC,zC)},PC=function(t){return LC(t,HC,AC)},UC=function(t){return FC(t)/2},jC=function(t){return PC(t)/2},WC=function(t){return t.stepSize},qC=function(t){return t.snapToGrid},GC=function(t){return t.snapStart},$C=function(t){return t.rounded},XC=function(t,e){return void 0!==t[e+"-edge"]},KC=function(t){return XC(t,"left")},YC=function(t){return XC(t,"right")},JC=function(t){return XC(t,"top")},QC=function(t){return XC(t,"bottom")},ZC=function(t){return t.model.value.get()},tS=function(t){return{x:t}},eS=function(t){return{y:t}},nS=function(t,e){return{x:t,y:e}},rS=function(t,e){Di(t,MC(),{value:e})},oS=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},iS=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},aS=function(t,e,n){return Math.max(e,Math.min(n,t))},uS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,a=t.snap,u=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=aS(p/m*r+e,g,h);return a&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return aS(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),c=e+Math.min(u,a+i)*r;return Math.max(e,c)}))}(v,e,n,i,u):c?Math.round(v):v},cS=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?a?u:l:(o-e)/r*c},sS="top",lS="right",fS="bottom",dS="left",mS=function(t){return t.element.dom.getBoundingClientRect()},gS=function(t,e){return t[e]},hS=function(t){var e=mS(t);return gS(e,dS)},pS=function(t){var e=mS(t);return gS(e,lS)},vS=function(t){var e=mS(t);return gS(e,sS)},bS=function(t){var e=mS(t);return gS(e,fS)},yS=function(t){var e=mS(t);return gS(e,"width")},xS=function(t){var e=mS(t);return gS(e,"height")},wS=function(t,e,n){return(t+e)/2-n},CS=function(t,e){var n=mS(t),r=mS(e),o=gS(n,dS),i=gS(n,lS),a=gS(r,dS);return wS(o,i,a)},SS=function(t,e){var n=mS(t),r=mS(e),o=gS(n,sS),i=gS(n,fS),a=gS(r,sS);return wS(o,i,a)},kS=function(t,e){Di(t,MC(),{value:e})},OS=function(t){return{x:t}},ES=function(t,e,n){var r={min:zC(e),max:RC(e),range:FC(e),value:n,step:WC(e),snap:qC(e),snapStart:GC(e),rounded:$C(e),hasMinEdge:KC(e),hasMaxEdge:YC(e),minBound:hS(t),maxBound:pS(t),screenRange:yS(t)};return uS(r)},_S=function(t){return function(e,n){return function(t,e,n){var r=(t>0?iS:oS)(ZC(n).x,zC(n),RC(n),WC(n));return kS(e,OS(r)),N.some(r)}(t,e,n).map(S)}},TS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=yS(t),a=r.bind((function(e){return N.some(CS(e,t))})).getOr(0),u=o.bind((function(e){return N.some(CS(e,t))})).getOr(i),c={min:zC(e),max:RC(e),range:FC(e),value:n,hasMinEdge:KC(e),hasMaxEdge:YC(e),minBound:hS(t),minOffset:0,maxBound:pS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return cS(c)}(e,i,n,r,o);return hS(e)-hS(t)+a},MS=_S(-1),DS=_S(1),zS=N.none,AS=N.none,NS={"top-left":N.none(),top:N.none(),"top-right":N.none(),right:N.some((function(t,e){rS(t,tS(VC(e)))})),"bottom-right":N.none(),bottom:N.none(),"bottom-left":N.none(),left:N.some((function(t,e){rS(t,tS(NC(e)))}))},BS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=ES(t,e,n),o=OS(r);return kS(t,o),r},setToMin:function(t,e){var n=zC(e);kS(t,OS(n))},setToMax:function(t,e){var n=RC(e);kS(t,OS(n))},findValueOfOffset:ES,getValueFromEvent:function(t){return DC(t).map((function(t){return t.left}))},findPositionOfValue:TS,setPositionFromValue:function(t,e,n,r){var o=ZC(n),i=TS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=bn(e.element)/2;Je(e.element,"left",i-a+"px")},onLeft:MS,onRight:DS,onUp:zS,onDown:AS,edgeActions:NS}),RS=function(t,e){Di(t,MC(),{value:e})},HS=function(t){return{y:t}},VS=function(t,e,n){var r={min:AC(e),max:HC(e),range:PC(e),value:n,step:WC(e),snap:qC(e),snapStart:GC(e),rounded:$C(e),hasMinEdge:JC(e),hasMaxEdge:QC(e),minBound:vS(t),maxBound:bS(t),screenRange:xS(t)};return uS(r)},IS=function(t){return function(e,n){return function(t,e,n){var r=(t>0?iS:oS)(ZC(n).y,AC(n),HC(n),WC(n));return RS(e,HS(r)),N.some(r)}(t,e,n).map(S)}},LS=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=xS(t),a=r.bind((function(e){return N.some(SS(e,t))})).getOr(0),u=o.bind((function(e){return N.some(SS(e,t))})).getOr(i),c={min:AC(e),max:HC(e),range:PC(e),value:n,hasMinEdge:JC(e),hasMaxEdge:QC(e),minBound:vS(t),minOffset:0,maxBound:bS(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return cS(c)}(e,i,n,r,o);return vS(e)-vS(t)+a},FS=N.none,PS=N.none,US=IS(-1),jS=IS(1),WS={"top-left":N.none(),top:N.some((function(t,e){rS(t,eS(BC(e)))})),"top-right":N.none(),right:N.none(),"bottom-right":N.none(),bottom:N.some((function(t,e){rS(t,eS(IC(e)))})),"bottom-left":N.none(),left:N.none()},qS=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=VS(t,e,n),o=HS(r);return RS(t,o),r},setToMin:function(t,e){var n=AC(e);RS(t,HS(n))},setToMax:function(t,e){var n=HC(e);RS(t,HS(n))},findValueOfOffset:VS,getValueFromEvent:function(t){return DC(t).map((function(t){return t.top}))},findPositionOfValue:LS,setPositionFromValue:function(t,e,n,r){var o=ZC(n),i=LS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=ln(e.element)/2;Je(e.element,"top",i-a+"px")},onLeft:FS,onRight:PS,onUp:US,onDown:jS,edgeActions:WS}),GS=function(t,e){Di(t,MC(),{value:e})},$S=function(t,e){return{x:t,y:e}},XS=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?iS:oS,i=e?ZC(r).x:o(ZC(r).x,zC(r),RC(r),WC(r)),a=e?o(ZC(r).y,AC(r),HC(r),WC(r)):ZC(r).y;return GS(n,$S(i,a)),N.some(i)}(t,e,n,r).map(S)}},KS=XS(-1,!1),YS=XS(1,!1),JS=XS(-1,!0),QS=XS(1,!0),ZS={"top-left":N.some((function(t,e){rS(t,nS(NC(e),BC(e)))})),top:N.some((function(t,e){rS(t,nS(UC(e),BC(e)))})),"top-right":N.some((function(t,e){rS(t,nS(VC(e),BC(e)))})),right:N.some((function(t,e){rS(t,nS(VC(e),jC(e)))})),"bottom-right":N.some((function(t,e){rS(t,nS(VC(e),IC(e)))})),bottom:N.some((function(t,e){rS(t,nS(UC(e),IC(e)))})),"bottom-left":N.some((function(t,e){rS(t,nS(NC(e),IC(e)))})),left:N.some((function(t,e){rS(t,nS(NC(e),jC(e)))}))},tk=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=ES(t,e,n.left),o=VS(t,e,n.top),i=$S(r,o);return GS(t,i),i},setToMin:function(t,e){var n=zC(e),r=AC(e);GS(t,$S(n,r))},setToMax:function(t,e){var n=RC(e),r=HC(e);GS(t,$S(n,r))},getValueFromEvent:function(t){return DC(t)},setPositionFromValue:function(t,e,n,r){var o=ZC(n),i=TS(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=LS(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=bn(e.element)/2,c=ln(e.element)/2;Je(e.element,"left",i-u+"px"),Je(e.element,"top",a-c+"px")},onLeft:KS,onRight:YS,onUp:JS,onDown:QS,edgeActions:ZS}),ek=Ad({name:"Slider",configFields:[fo("stepSize",1),fo("onChange",g),fo("onChoose",g),fo("onInit",g),fo("onDragStart",g),fo("onDragEnd",g),fo("snapToGrid",!1),fo("rounded",!0),oo("snapStart"),Yr("model",qr("mode",{x:[fo("minX",0),fo("maxX",100),$r("value",(function(t){return wo(t.mode.minX)})),Kr("getInitialValue"),zu("manager",BS)],y:[fo("minY",0),fo("maxY",100),$r("value",(function(t){return wo(t.mode.minY)})),Kr("getInitialValue"),zu("manager",qS)],xy:[fo("minX",0),fo("maxX",100),fo("minY",0),fo("maxY",100),$r("value",(function(t){return wo({x:t.mode.minX,y:t.mode.minY})})),Kr("getInitialValue"),zu("manager",tk)]})),Tf("sliderBehaviours",[nh,_f]),$r("mouseIsDown",(function(){return wo(!1)}))],partFields:TC,factory:function(t,e,n,r){var o,i=function(e){return bd(e,t,"thumb")},a=function(e){return bd(e,t,"spectrum")},u=function(e){return vd(e,t,"left-edge")},c=function(e){return vd(e,t,"right-edge")},s=function(e){return vd(e,t,"top-edge")},l=function(e){return vd(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&vd(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:Df(t.sliderBehaviours,[nh.config({mode:"special",focusIn:function(e){return vd(e,t,"spectrum").map(nh.focusIn).map(S)}}),_f.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),Ec.config({channels:(o={},o[lf()]={onReceive:h},o)})]),events:Ri([Ii(MC(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),N.some(!0)}(e,n.event.value)})),Gi((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var u=a(e);t.onInit(e,o,u,f.value.get())})),Ii(Ho(),p),Ii(Io(),v),Ii(Fo(),p),Ii(jo(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),nk=oa("rgb-hex-update"),rk=oa("slider-update"),ok=oa("palette-update"),ik="form",ak=[Tf("formBehaviours",[_f])],uk=function(t){return"<alloy.field."+t+">"},ck=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:Df(t.formBehaviours,[_f.config({store:{mode:"manual",getValue:function(e){var n=xd(e,t);return dt(n,(function(t,e){return t().bind((function(t){var n,r,o=Hd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+ta(t.element)),n.fold((function(){return Wn.error(r)}),Wn.value)})).map(_f.getValue)}))},setValue:function(e,n){ft(n,(function(n,r){vd(e,t,r).each((function(t){Hd.getCurrent(t).each((function(t){_f.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return vd(e,t,n).bind(Hd.getCurrent)}}}},sk={getField:ya((function(t,e,n){return t.getField(e,n)})),sketch:function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),dd(ik,uk(e),n)},record:p(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return rd({name:t,pname:uk(t)})}));return _d(ik,ak,o,ck,n)}},lk=oa("valid-input"),fk=oa("invalid-input"),dk=oa("validating-input"),mk="colorcustom.rgb.",gk=function(t,e,n,r){var o=function(n,r){return Pw.config({invalidClass:e("invalid"),notify:{onValidate:function(t){Di(t,dk,{type:n})},onValid:function(t){Di(t,lk,{type:n,value:_f.getValue(t)})},onInvalid:function(t){Di(t,fk,{type:n,value:_f.getValue(t)})}},validator:{validate:function(e){var n=_f.getValue(e),o=r(n)?Wn.value(!0):Wn.error(t("aria.input.invalid"));return zw(o)},validateOnLoad:!1}})},i=function(n,r,i,a,u){var c=t(mk+"range"),s=Qx.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),l=Qx.parts.field({data:u,factory:ww,inputAttributes:O({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[e("textfield")],inputBehaviours:xc([o(r,n),ew.config({})]),onSetValue:function(t){Pw.isInvalid(t)&&Pw.run(t).get(g)}}),f=[s,l],d="hex"!==r?[Qx.parts["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:f.concat(d)}},a=function(t,e){var n=e.red,r=e.green,o=e.blue;_f.setValue(t,{red:n,green:r,blue:o})},u=yp({dom:{tag:"div",classes:[e("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),c=function(t,e){u.getOpt(t).each((function(t){Je(t.element,"background-color","#"+e.value)}))},s=zd({factory:function(){var o={red:wo(N.some(255)),green:wo(N.some(255)),blue:wo(N.some(255)),hex:wo(N.some("ffffff"))},s=function(t){return o[t].get()},l=function(t,e){o[t].set(e)},f=function(t){var e=t.red,n=t.green,r=t.blue;l("red",N.some(e)),l("green",N.some(n)),l("blue",N.some(r))},d=function(t,e){var n=e.event;"hex"!==n.type?l(n.type,N.none()):r(t)},m=function(t,e,n){var r=parseInt(n,10);l(e,N.some(r)),s("red").bind((function(t){return s("green").bind((function(e){return s("blue").map((function(n){return By(t,e,n,1)}))}))})).each((function(e){var n=function(t,e){var n=Ty(e);return sk.getField(t,"hex").each((function(e){gh.isFocused(e)||_f.setValue(t,{hex:n.value})})),n}(t,e);Di(t,nk,{hex:n}),c(t,n)}))},g=function(t,e){var r=e.event;!function(t){return"hex"===t.type}(r)?m(t,r.type,r.value):function(t,e){n(t);var r=wy(e);l("hex",N.some(e));var o=Vy(r);a(t,o),f(o),Di(t,nk,{hex:r}),c(t,r)}(t,r.value)},h=function(e){return{label:t(mk+e+".label"),description:t(mk+e+".description")}},p=h("red"),v=h("green"),b=h("blue"),y=h("hex");return ur(sk.sketch((function(n){return{dom:{tag:"form",classes:[e("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[n.field("red",Qx.sketch(i(Ry,"red",p.label,p.description,255))),n.field("green",Qx.sketch(i(Ry,"green",v.label,v.description,255))),n.field("blue",Qx.sketch(i(Ry,"blue",b.label,b.description,255))),n.field("hex",Qx.sketch(i(ky,"hex",y.label,y.description,"ffffff"))),u.asSpec()],formBehaviours:xc([Pw.config({invalidClass:e("form-invalid")}),sh("rgb-form-events",[Ii(lk,g),Ii(fk,d),Ii(dk,d)])])}})),{apis:{updateHex:function(t,e){_f.setValue(t,{hex:e.value}),function(t,e){var n=Vy(e);a(t,n),f(n)}(t,e),c(t,e)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,e,n){t.updateHex(e,n)}},extraApis:{}});return s},hk=function(t,e){var n=ek.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[e("sv-palette-spectrum")]}}),r=ek.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette-thumb")],innerHtml:"<div class="+e("sv-palette-inner-thumb")+' role="presentation"></div>'}}),o=function(t,e){var n=t.width,r=t.height,o=t.getContext("2d");if(null!==o){o.fillStyle=e,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}},i=zd({factory:function(t){var i=p({x:0,y:0}),a=xc([Hd.config({find:N.some}),gh.config({})]);return ek.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[e("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:function(t,e,n){Di(t,ok,{value:n})},onInit:function(t,e,n,r){o(n.element.dom,Fy(Py))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,e,n){!function(t,e){var n=t.components()[0].element.dom,r=jy(e,100,100),i=Hy(r);o(n,Fy(i))}(e,n)},setThumb:function(t,e,n){!function(t,e){var n=Wy(Vy(e));ek.setValue(t,{x:n.saturation,y:100-n.value})}(e,n)}},extraApis:{}});return i},pk=function(t,e){var n=zd({name:"ColourPicker",configFields:[Kr("dom"),fo("onValidHex",g),fo("onInvalidHex",g)],factory:function(n){var r,o=gk(t,e,n.onValidHex,n.onInvalidHex),i=hk(0,e),a=function(t){return 100-t/360*100},u={paletteRgba:wo(Py),paletteHue:wo(0)},c=yp(function(t,e){var n=ek.parts.spectrum({dom:{tag:"div",classes:[e("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=ek.parts.thumb({dom:{tag:"div",classes:[e("hue-slider-thumb")],attributes:{role:"presentation"}}});return ek.sketch({dom:{tag:"div",classes:[e("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:p({y:0})},components:[n,r],sliderBehaviours:xc([gh.config({})]),onChange:function(t,e,n){Di(t,rk,{value:n})}})}(0,e)),s=yp(i.sketch({})),l=yp(o.sketch({})),f=function(t,e,n){s.getOpt(t).each((function(t){i.setHue(t,n)}))},d=function(t,e){l.getOpt(t).each((function(t){o.updateHex(t,e)}))},m=function(t,e,n){c.getOpt(t).each((function(t){ek.setValue(t,{y:a(n)})}))},g=function(t,e){s.getOpt(t).each((function(t){i.setThumb(t,e)}))},h=function(t,e,n,r){!function(t,e){var n=Vy(t);u.paletteRgba.set(n),u.paletteHue.set(e)}(e,n),j(r,(function(r){r(t,e,n)}))};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:xc([sh("colour-picker-events",[Ii(nk,(r=[f,m,g],function(t,e){var n=e.event.hex,o=function(t){return Wy(Vy(t))}(n);h(t,n,o.hue,r)})),Ii(ok,function(){var t=[d];return function(e,n){var r=n.event.value,o=u.paletteHue.get(),i=jy(o,r.x,100-r.y),a=qy(i);h(e,a,o,t)}}()),Ii(rk,function(){var t=[f,d];return function(e,n){var r=function(t){return(100-t)/100*360}(n.event.value.y),o=u.paletteRgba.get(),i=Wy(o),a=jy(r,i.saturation,i.value),c=qy(a);h(e,c,r,t)}}())]),Hd.config({find:function(t){return l.getOpt(t)}}),nh.config({mode:"acyclic"})])}}});return n},vk=function(){return Hd.config({find:N.some})},bk=function(t){return Hd.config({find:t.getOpt})},yk=function(t){return Hd.config({find:function(e){return Te(e.element,t).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}})},xk={"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","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},wk=function(t){return function(t){return xk[t]}(t)},Ck=tinymce.util.Tools.resolve("tinymce.Resource"),Sk=tinymce.util.Tools.resolve("tinymce.util.Tools"),kk=kr([fo("preprocess",v),fo("postprocess",v)]),Ok=function(t,e,n){return _f.config(ur({store:{mode:"manual",getValue:e,setValue:n}},t.map((function(t){return{store:{initialValue:t}}})).getOr({})))},Ek=function(t,e,n){return Ok(t,(function(t){return e(t.element)}),(function(t,e){return n(t.element,e)}))},_k=function(t,e){var n=jr("RepresentingConfigs.memento processors",kk,e);return _f.config({store:{mode:"manual",getValue:function(e){var r=t.get(e),o=_f.getValue(r);return n.postprocess(o)},setValue:function(e,r){var o=n.preprocess(r),i=t.get(e);_f.setValue(i,o)}}})},Tk=Ok,Mk=function(t){return Ek(t,Yi,Ji)},Dk=function(t){return _f.config({store:{mode:"memory",initialValue:t}})},zk=function(t,e){var n=function(t,e){e.stop()},r=function(t){return function(e,n){j(t,(function(t){t(e,n)}))}},o=function(t,e){if(!Yd.isDisabled(t)){var n=e.event.raw;a(t,n.dataTransfer.files)}},i=function(t,e){var n=e.event.raw.target;a(t,n.files)},a=function(n,r){_f.setValue(n,function(t,e){var n=Sk.explode(e.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"));return q(ut(t),(function(t){return L(n,(function(e){return Tt(t.name.toLowerCase(),"."+e.toLowerCase())}))}))}(r,e)),Di(n,uw,{name:t.name})},u=yp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:xc([sh("input-file-events",[ji(Jo()),ji(li())])])}),c=t.label.map((function(t){return aw(t,e)})),s=Qx.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:xc([Dk([]),vk(),Yd.config({}),Eh.config({toggleClass:"dragenter",toggleOnExecute:!1}),sh("dropzone-events",[Ii("dragenter",r([n,Eh.toggle])),Ii("dragleave",r([n,Eh.toggle])),Ii("dragover",n),Ii("drop",r([n,o])),Ii(Yo(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:e.translate("Drop an image here")}},bp.sketch({dom:{tag:"button",innerHtml:e.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(t){u.get(t).element.dom.click()},buttonBehaviours:xc([ew.config({}),Kb(e.isDisabled),$b()])})]}]}}}});return rw(c,s,["tox-form__group--stretched"],[])},Ak=oa("alloy-fake-before-tabstop"),Nk=oa("alloy-fake-after-tabstop"),Bk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:xc([gh.config({ignore:!0}),ew.config({})])}},Rk=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Bk([Ak]),t,Bk([Nk])],behaviours:xc([yk(1)])}},Hk=function(t,e){Di(t,$o(),{raw:{which:9,shiftKey:e}})},Vk=function(t,e){var n=e.element;Fa(n,Ak)?Hk(t,!0):Fa(n,Nk)&&Hk(t,!1)},Ik=function(t){return Bx(t,["."+Ak,"."+Nk].join(","),C)},Lk=!(he().browser.isIE()||he().browser.isEdge()),Fk=function(t,e){var n=Lk&&t.sandboxed,r=O(O({},t.label.map((function(t){return{title:t}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=function(t){var e=wo("");return{getValue:function(t){return e.get()},setValue:function(n,r){if(t)je(n.element,"srcdoc",r);else{je(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}e.set(r)}}}(n),i=t.label.map((function(t){return aw(t,e)})),a=Qx.parts.field({factory:{sketch:function(t){return Rk({uid:t.uid,dom:{tag:"iframe",attributes:r},behaviours:xc([ew.config({}),gh.config({}),Tk(N.none(),o.getValue,o.setValue)])})}}});return rw(i,a,["tox-form__group--stretched"],[])},Pk=function(t,e){return Wk(document.createElement("canvas"),t,e)},Uk=function(t){var e=Pk(t.width,t.height);return jk(e).drawImage(t,0,0),e},jk=function(t){return t.getContext("2d")},Wk=function(t,e,n){return t.width=e,t.height=n,t},qk=function(t){return t.naturalWidth||t.width},Gk=function(t){return t.naturalHeight||t.height},$k=function(t){return new Ow((function(e,n){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return N.none();for(var r=n[1],o=e[1],i=1024,a=atob(o),u=a.length,c=Math.ceil(u/i),s=new Array(c),l=0;l<c;++l){for(var f=l*i,d=Math.min(f+i,u),m=new Array(d-f),g=f,h=0;g<d;++h,++g)m[h]=a[g].charCodeAt(0);s[l]=new Uint8Array(m)}return N.some(new Blob(s,{type:r}))})(t).fold((function(){n("uri is not base64: "+t)}),e)}))},Xk=function(t,e,n){return e=e||"image/png",f(HTMLCanvasElement.prototype.toBlob)?new Ow((function(r,o){t.toBlob((function(t){t?r(t):o()}),e,n)})):$k(t.toDataURL(e,n))},Kk=function(t){return function(t){return new Ow((function(e,n){var r=URL.createObjectURL(t),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",u)},a=function(){i(),e(o)},u=function(){i(),n("Unable to load data of type "+t.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",u),o.src=r,o.complete&&setTimeout(a,0)}))}(t).then((function(t){Yk(t);var e=Pk(qk(t),Gk(t));return jk(e).drawImage(t,0,0),e}))},Yk=function(t){URL.revokeObjectURL(t.src)},Jk=function(t,e,n){var r=e.type,o=p(r),i=p(n),a=function(e,n){return t.then((function(t){return function(t,e,n){return e=e||"image/png",t.toDataURL(e,n)}(t,e,n)}))};return{getType:o,toBlob:function(){return Ow.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then((function(t){return Xk(t,e,n)}))},toAdjustedDataURL:a,toAdjustedBase64:function(t,e){return a(t,e).then((function(t){return t.split(",")[1]}))},toCanvas:function(){return t.then(Uk)}}},Qk=function(t){return function(t){return new Ow((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(e){return Jk(Kk(t),t,e)}))},Zk=function(t,e){return Xk(t,e).then((function(e){return Jk(Ow.resolve(t),e,t.toDataURL())}))},tO=function(t,e,n){var r="string"==typeof t?parseFloat(t):t;return r>n?r=n:r<e&&(r=e),r},eO=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],nO=function(t,e){for(var n,r=[],o=new Array(25),i=0;i<5;i++){for(var a=0;a<5;a++)r[a]=e[a+5*i];for(a=0;a<5;a++){n=0;for(var u=0;u<5;u++)n+=t[a+5*u]*r[u];o[a+5*i]=n}}return o},rO=function(t,e){return t.toCanvas().then((function(n){return oO(n,t.getType(),e)}))},oO=function(t,e,n){var r=jk(t),o=function(t,e){for(var n,r,o,i,a=t.data,u=e[0],c=e[1],s=e[2],l=e[3],f=e[4],d=e[5],m=e[6],g=e[7],h=e[8],p=e[9],v=e[10],b=e[11],y=e[12],x=e[13],w=e[14],C=e[15],S=e[16],k=e[17],O=e[18],E=e[19],_=0;_<a.length;_+=4)n=a[_],r=a[_+1],o=a[_+2],i=a[_+3],a[_]=n*u+r*c+o*s+i*l+f,a[_+1]=n*d+r*m+o*g+i*h+p,a[_+2]=n*v+r*b+o*y+i*x+w,a[_+3]=n*C+r*S+o*k+i*O+E;return t}(r.getImageData(0,0,t.width,t.height),n);return r.putImageData(o,0,0),Zk(t,e)},iO=function(t,e,n){var r=jk(t),o=r.getImageData(0,0,t.width,t.height),i=r.getImageData(0,0,t.width,t.height);return i=function(t,e,n){for(var r=function(t,e,n){return t>n?t=n:t<e&&(t=e),t},o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=t.data,u=e.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=4*(r(l+h-i,0,s-1)*c+v),y=n[h*o+p];d+=a[b]*y,m+=a[b+1]*y,g+=a[b+2]*y}var x=4*(l*c+f);u[x]=r(d,0,255),u[x+1]=r(m,0,255),u[x+2]=r(g,0,255)}return e}(o,i,n),r.putImageData(i,0,0),Zk(t,e)},aO=function(t){return function(e,n){return rO(e,t([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}},uO=function(t){return function(e){return rO(e,t)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),cO=aO((function(t,e){return e=tO(255*e,-255,255),nO(t,[1,0,0,0,e,0,1,0,0,e,0,0,1,0,e,0,0,0,1,0,0,0,0,0,1])})),sO=aO((function(t,e){var n;return e=tO(e,-1,1),n=(e*=100)<0?127+e/100*127:127*(n=0===(n=e%1)?eO[e]:eO[Math.floor(e)]*(1-n)+eO[Math.floor(e)+1]*n)+127,nO(t,[n/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),lO=function(t,e,n,r){return rO(t,function(t,e,n,r){return e=tO(e,0,2),n=tO(n,0,2),r=tO(r,0,2),nO(t,[e,0,0,0,0,0,n,0,0,0,0,0,r,0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],e,n,r))},fO=(Xw=[0,-1,0,-1,5,-1,0,-1,0],function(t){return function(t,e){return t.toCanvas().then((function(n){return iO(n,t.getType(),e)}))}(t,Xw)}),dO=(Kw=function(t,e){return 255*Math.pow(t/255,1-e)},function(t,e){return t.toCanvas().then((function(n){return function(t,e,n){for(var r=jk(t),o=new Array(256),i=0;i<o.length;i++)o[i]=Kw(i,n);var a=function(t,e){for(var n=t.data,r=0;r<n.length;r+=4)n[r]=e[n[r]],n[r+1]=e[n[r+1]],n[r+2]=e[n[r+2]];return t}(r.getImageData(0,0,t.width,t.height),o);return r.putImageData(a,0,0),Zk(t,e)}(n,t.getType(),e)}))}),mO=function(t,e,n){var r=qk(t),o=Gk(t),i=e/r,a=n/o,u=!1;(i<.5||i>2)&&(i=i<.5?.5:2,u=!0),(a<.5||a>2)&&(a=a<.5?.5:2,u=!0);var c=gO(t,i,a);return u?c.then((function(t){return mO(t,e,n)})):c},gO=function(t,e,n){return new Ow((function(r){var o=qk(t),i=Gk(t),a=Math.floor(o*e),u=Math.floor(i*n),c=Pk(a,u);jk(c).drawImage(t,0,0,o,i,0,0,a,u),r(c)}))},hO=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},pO=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,a=Math.sin(r),u=Math.cos(r),c=hO(Math.abs(o*u)+Math.abs(i*a)),s=hO(Math.abs(o*a)+Math.abs(i*u)),l=Pk(c,s),f=jk(l);return f.translate(c/2,s/2),f.rotate(r),f.drawImage(t,-o/2,-i/2),Zk(l,e)},vO=function(t,e,n){var r=Pk(t.width,t.height),o=jk(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),Zk(r,e)},bO=function(t,e,n,r,o,i){var a=Pk(o,i);return jk(a).drawImage(t,-n,-r),Zk(a,e)},yO=function(t){return uO(t)},xO=function(t){return fO(t)},wO=function(t,e){return dO(t,e)},CO=function(t,e){return cO(t,e)},SO=function(t,e){return sO(t,e)},kO=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return vO(n,t.getType(),e)}))}(t,e)},OO=function(t,e,n,r,o){return function(t,e,n,r,o){return t.toCanvas().then((function(i){return bO(i,t.getType(),e,n,r,o)}))}(t,e,n,r,o)},EO=function(t,e,n){return function(t,e,n){return t.toCanvas().then((function(r){return mO(r,e,n).then((function(e){return Zk(e,t.getType())}))}))}(t,e,n)},_O=function(t,e){return function(t,e){return t.toCanvas().then((function(n){return pO(n,t.getType(),e)}))}(t,e)},TO=function(t,e,n){return Mp(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},e)},MO=function(t,e){return TO(t,e,[])},DO=function(t,e){return TO(t,e,[ch.config({})])},zO=function(t,e,n){return{dom:{tag:"span",innerHtml:n.translate(t),classes:[e+"__select-label"]},behaviours:xc([ch.config({})])}},AO=oa("toolbar.button.execute"),NO=((Yw={})[ci()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],Yw),BO=oa("update-menu-text"),RO=oa("update-menu-icon"),HO=function(t,e,n){var r=wo(g),o=t.text.map((function(t){return yp(zO(t,e,n.providers))})),i=t.icon.map((function(t){return yp(DO(t,n.providers.icons))})),a=function(t,e){var n=_f.getValue(t);return gh.focus(n),Di(n,"keydown",{raw:e.event.raw}),sC.close(n),N.some(!0)},u=t.role.fold((function(){return{}}),(function(t){return{role:t}})),c=t.tooltip.fold((function(){return{}}),(function(t){var e=n.providers.translate(t);return{title:e,"aria-label":e}})),s=Mp("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},n.providers.icons);return yp(sC.sketch(O(O(O({},t.uid?{uid:t.uid}:{}),u),{dom:{tag:"button",classes:[e,e+"--select"].concat(U(t.classes,(function(t){return e+"--"+t}))),attributes:O({},c)},components:ry([i.map((function(t){return t.asSpec()})),o.map((function(t){return t.asSpec()})),N.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:xc(_(_([],t.dropdownBehaviours,!0),[Kb((function(){return t.disabled||n.providers.isDisabled()})),$b(),fC.config({}),ch.config({}),sh("dropdown-events",[Zb(t,r),ty(t,r)]),sh("menubutton-update-display-text",[Ii(BO,(function(t,e){o.bind((function(e){return e.getOpt(t)})).each((function(t){ch.set(t,[Ja(n.providers.translate(e.event.text))])}))})),Ii(RO,(function(t,e){i.bind((function(e){return e.getOpt(t)})).each((function(t){ch.set(t,[DO(e.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:ur(NO,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:xc([nh.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:e+"--active",parts:{menu:Rv(0,t.columns,t.presets)},fetch:function(e){return Dw(y(t.fetch,e))}}))).asSpec()},VO=function(t){return"separator"===t.type},IO={type:"separator"},LO=function(t,e){var n=$(t,(function(t,n){return function(t){return r(t)}(n)?""===n?t:"|"===n?t.length>0&&!VO(t[t.length-1])?t.concat([IO]):t:yt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])}),[]);return n.length>0&&VO(n[n.length-1])&&n.pop(),n},FO=function(t,e){return function(t){return yt(t,"getSubmenuItems")}(t)?function(t,e){var n=t.getSubmenuItems(),r=PO(n,e);return{item:t,menus:ur(r.menus,Oo(t.value,r.items)),expansions:ur(r.expansions,Oo(t.value,t.value))}}(t,e):{item:t,menus:{},expansions:{}}},PO=function(t,e){var n=LO(r(t)?t.split(" "):t,e);return G(n,(function(t,n){var r=function(t){if(VO(t))return t;var e=bt(t,"value").getOrThunk((function(){return oa("generated-menu-item")}));return ur({value:e},t)}(n),o=FO(r,e);return{menus:ur(t.menus,o.menus),items:[o.item].concat(t.items),expansions:ur(t.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},UO=function(t,e,n,r){var o=oa("primary-menu"),i=PO(t,n.shared.providers.menuItems());if(0===i.items.length)return N.none();var a=zx(o,i.items,e,n,r),u=dt(i.menus,(function(t,r){return zx(r,t,e,n,!1)})),c=ur(u,Oo(o,a));return N.from(Yh.tieredData(o,c,i.expansions))},jO=function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)},setActive:function(e){var n=t.element;e?(Va(n,"tox-tbtn--enabled"),je(n,"aria-pressed",!0)):(La(n,"tox-tbtn--enabled"),Xe(n,"aria-pressed"))},isActive:function(){return Fa(t.element,"tox-tbtn--enabled")}}},WO=function(t,e,n,r){return HO({text:t.text,icon:t.icon,tooltip:t.tooltip,role:r,fetch:function(e,r){t.fetch((function(t){r(UO(t,vv.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:t.onSetup,getApi:jO,columns:1,presets:"normal",classes:[],dropdownBehaviours:[ew.config({})]},e,n.shared)},qO=function(t,e,n){var r=function(t){return function(r){var o=!r.isActive();r.setActive(o),t.storage.set(o),n.shared.getSink().each((function(n){e().getOpt(n).each((function(e){Mc(e.element),Di(e,lw,{name:t.name,value:t.storage.get()})}))}))}},o=function(t){return function(e){e.setActive(t.storage.get())}};return function(e){e(U(t,(function(t){var e=t.text.fold((function(){return{}}),(function(t){return{text:t}}));return O(O({type:t.type,active:!1},e),{onAction:r(t),onSetup:o(t)})})))}},GO=function(t,e,n,r,o,i){void 0===n&&(n=[]);var a=e.fold((function(){return{}}),(function(t){return{action:t}})),u=O({buttonBehaviours:xc([Kb((function(){return t.disabled||i.isDisabled()})),$b(),ew.config({}),sh("button press",[Vi("click"),Vi("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),c=ur(u,{dom:r});return ur(c,{components:o})},$O=function(t,e,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map((function(t){return{"aria-label":n.translate(t),title:n.translate(t)}})).getOr({})},i=t.icon.map((function(t){return MO(t,n.icons)})),a=ry([i]);return GO(t,e,r,o,a,n)},XO=function(t,e,n,r){void 0===r&&(r=[]);var o=$O(t,N.some(e),n,r);return bp.sketch(o)},KO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(t.text),a=t.icon?t.icon.map((function(t){return MO(t,n.icons)})):N.none(),u=a.isSome()?ry([a]):[],c=a.isSome()?{}:{innerHtml:i},s=_(_(_(_([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),t.borderless?["tox-button--naked"]:[],!0),o,!0),l=O(O({tag:"button",classes:s},c),{attributes:{title:i}});return GO(t,e,r,l,u,n)},YO=function(t,e,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=KO(t,N.some(e),n,r,o);return bp.sketch(i)},JO=function(t,e){return function(n){"custom"===e?Di(n,lw,{name:t,value:{}}):"submit"===e?Mi(n,fw):"cancel"===e?Mi(n,sw):console.error("Unknown button type: ",e)}},QO=function(t,e,n){if(function(t,e){return"menu"===e}(0,e)){var r=t,o=O(O({},t),{onSetup:function(e){return e.setDisabled(t.disabled),g},fetch:qO(r.items,(function(){return i}),n)}),i=yp(WO(o,"tox-tbtn",n,N.none()));return i.asSpec()}if(function(t,e){return"custom"===e||"cancel"===e||"submit"===e}(0,e)){var a=JO(t.name,e),u=O(O({},t),{borderless:!1});return YO(u,a,n.shared.providers,[])}console.error("Unknown footer button type: ",e)},ZO=function(t,e){var n,r,o=JO(t.name,"custom");return n=N.none(),r=Qx.parts.field(O({factory:bp},KO(t,N.some(o),e,[Dk(""),vk()]))),rw(n,r,[],[])},tE=p([fo("field1Name","field1"),fo("field2Name","field2"),Mu("onLockedChange"),Ou(["lockClass"]),fo("locked",!1),zf("coupledFieldBehaviours",[Hd,_f])]),eE=function(t,e){return rd({factory:Qx,name:t,overrides:function(t){return{fieldBehaviours:xc([sh("coupled-input-behaviour",[Ii(Ko(),(function(n){(function(t,e,n){return vd(t,e,n).bind(Hd.getCurrent)})(n,t,e).each((function(e){vd(n,t,"lock").each((function(r){Eh.isOn(r)&&t.onLockedChange(n,e,r)}))}))}))])])}}})},nE=p([eE("field1","field2"),eE("field2","field1"),rd({factory:bp,schema:[Kr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:xc([Eh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),rE=Ad({name:"FormCoupledInputs",configFields:tE(),partFields:nE(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Af(t.coupledFieldBehaviours,[Hd.config({find:N.some}),_f.config({store:{mode:"manual",getValue:function(e){var n,r=Cd(e,t,["field1","field2"]);return(n={})[t.field1Name]=_f.getValue(r.field1()),n[t.field2Name]=_f.getValue(r.field2()),n},setValue:function(e,n){var r=Cd(e,t,["field1","field2"]);xt(n,t.field1Name)&&_f.setValue(r.field1(),n[t.field1Name]),xt(n,t.field2Name)&&_f.setValue(r.field2(),n[t.field2Name])}}})]),apis:{getField1:function(e){return vd(e,t,"field1")},getField2:function(e){return vd(e,t,"field2")},getLock:function(e){return vd(e,t,"lock")}}}},apis:{getField1:function(t,e){return t.getField1(e)},getField2:function(t,e){return t.getField2(e)},getLock:function(t,e){return t.getLock(e)}}}),oE=function(t){var e=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==e){var n=parseFloat(e[1]),r=e[2];return Wn.value({value:n,unit:r})}return Wn.error(t)},iE=function(t,e){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(t){return yt(n,t)};return t.unit===e?N.some(t.value):r(t.unit)&&r(e)?n[t.unit]===n[e]?N.some(t.value):N.some(t.value/n[t.unit]*n[e]):N.none()},aE=function(t){return N.none()},uE=function(t,e){var n=oE(t).toOptional(),r=oE(e).toOptional();return St(n,r,(function(t,e){return iE(t,e.unit).map((function(t){return e.value/t})).map((function(t){return function(t,e){return function(n){return iE(n,e).map((function(n){return{value:n*t,unit:e}}))}}(t,e.unit)})).getOr(aE)})).getOr(aE)},cE=function(t,e){var n=aE,r=oa("ratio-event"),o=function(t){return Mp(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},e.icons)},i=rE.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:e.translate(t.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:xc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),$b(),ew.config({})])}),a=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},u=function(n){return Qx.parts.field({factory:ww,inputClasses:["tox-textfield"],inputBehaviours:xc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),$b(),ew.config({}),sh("size-input-events",[Ii(qo(),(function(t,e){Di(t,r,{isField1:n})})),Ii(Yo(),(function(e,n){Di(e,uw,{name:t.name})}))])]),selectOnFocus:!1})},c=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}},s=rE.parts.field1(a([Qx.parts.label(c("Width")),u(!0)])),l=rE.parts.field2(a([Qx.parts.label(c("Height")),u(!1)]));return rE.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([c(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,e,r){oE(_f.getValue(t)).each((function(t){n(t).each((function(t){_f.setValue(e,function(t){var e,n={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},r=t.value.toFixed((e=t.unit)in n?n[e]:1);return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+t.unit}(t))}))}))},coupledFieldBehaviours:xc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){rE.getField1(t).bind(Qx.getField).each(Yd.disable),rE.getField2(t).bind(Qx.getField).each(Yd.disable),rE.getLock(t).each(Yd.disable)},onEnabled:function(t){rE.getField1(t).bind(Qx.getField).each(Yd.enable),rE.getField2(t).bind(Qx.getField).each(Yd.enable),rE.getLock(t).each(Yd.enable)}}),$b(),sh("size-input-events2",[Ii(r,(function(t,e){var r=e.event.isField1,o=r?rE.getField1(t):rE.getField2(t),i=r?rE.getField2(t):rE.getField1(t),a=o.map(_f.getValue).getOr(""),u=i.map(_f.getValue).getOr("");n=uE(a,u)}))])])})},sE={undo:p(oa("undo")),redo:p(oa("redo")),zoom:p(oa("zoom")),back:p(oa("back")),apply:p(oa("apply")),swap:p(oa("swap")),transform:p(oa("transform")),tempTransform:p(oa("temp-transform")),transformApply:p(oa("transform-apply"))},lE=p("save-state"),fE=p("disable"),dE=p("enable"),mE={formActionEvent:lw,saveState:lE,disable:fE,enable:dE},gE=function(t,e){var n=function(t,n,r,o){return yp(YO({name:t,text:t,disabled:r,primary:o,icon:N.none(),borderless:!1},n,e))},r=function(t,n,r,o){return yp(XO({name:t,icon:N.some(t),tooltip:N.some(n),disabled:o,primary:!1,borderless:!1},r,e))},o=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Yd)&&Yd.disable(n)}))},i=function(t,e){t.map((function(t){var n=t.get(e);n.hasConfigured(Yd)&&Yd.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},u=g,c=function(t,e,n){Di(t,e,n)},s=function(t){return Mi(t,mE.disable())},l=function(t){return Mi(t,mE.enable())},f=function(t,e){s(t),c(t,sE.transform(),{transform:e}),l(t)},d=function(t){return function(){tt.getOpt(t).each((function(t){ch.set(t,[Q])}))}},m=function(t,e){s(t),c(t,sE.transformApply(),{transform:e,swap:d(t)}),l(t)},h=function(){return n("Back",(function(t){return c(t,sE.back(),{swap:d(t)})}),!1,!1)},v=function(){return yp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:xc([Yd.config({})])})},b=function(){return n("Apply",(function(t){return c(t,sE.apply(),{swap:d(t)})}),!0,!0)},y=[h(),v(),n("Apply",(function(e){var n=function(e){var n=t.getRect();return OO(e,n.x,n.y,n.w,n.h)};m(e,n),t.hideCrop()}),!1,!0)],x=Xx.sketch({dom:a,components:y.map((function(t){return t.asSpec()})),containerBehaviours:xc([sh("image-tools-crop-buttons-events",[Ii(mE.disable(),(function(t,e){o(y,t)})),Ii(mE.enable(),(function(t,e){i(y,t)}))])])}),w=yp(cE({name:"size",label:N.none(),constrain:!0,disabled:!1},e)),C=[h(),v(),w,v(),n("Apply",(function(t){w.getOpt(t).each((function(e){var n=_f.getValue(e),r=function(t,e){return function(n){return EO(n,t,e)}}(parseInt(n.width,10),parseInt(n.height,10));m(t,r)}))}),!1,!0)],S=Xx.sketch({dom:a,components:C.map((function(t){return t.asSpec()})),containerBehaviours:xc([sh("image-tools-resize-buttons-events",[Ii(mE.disable(),(function(t,e){o(C,t)})),Ii(mE.enable(),(function(t,e){i(C,t)}))])])}),k=function(t,e){return function(n){return t(n,e)}},O=k(kO,"h"),E=k(kO,"v"),_=k(_O,-90),T=k(_O,90),M=function(t,e){!function(t,e){s(t),c(t,sE.tempTransform(),{transform:e}),l(t)}(t,e)},D=[h(),v(),r("flip-horizontally","Flip horizontally",(function(t){M(t,O)}),!1),r("flip-vertically","Flip vertically",(function(t){M(t,E)}),!1),r("rotate-left","Rotate counterclockwise",(function(t){M(t,_)}),!1),r("rotate-right","Rotate clockwise",(function(t){M(t,T)}),!1),v(),b()],z=Xx.sketch({dom:a,components:D.map((function(t){return t.asSpec()})),containerBehaviours:xc([sh("image-tools-fliprotate-buttons-events",[Ii(mE.disable(),(function(t,e){o(D,t)})),Ii(mE.enable(),(function(t,e){i(D,t)}))])])}),A=function(t,n,r,o,i){var a=ek.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:e.translate(t)}}),u=ek.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=ek.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return yp(ek.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:p({x:o})},components:[a,u,c],sliderBehaviours:xc([gh.config({})]),onChoose:n}))},B=function(t,e,n,r,o){return A(t,(function(t,n,r){var o=k(e,r.x/100);f(t,o)}),n,r,o)},R=function(t,e,n,r,u){var c=function(t,e,n,r,o){return[h(),B(t,e,n,r,o),b()]}(t,e,n,r,u);return Xx.sketch({dom:a,components:c.map((function(t){return t.asSpec()})),containerBehaviours:xc([sh("image-tools-filter-panel-buttons-events",[Ii(mE.disable(),(function(t,e){o(c,t)})),Ii(mE.enable(),(function(t,e){i(c,t)}))])])})},H=[h(),v(),b()],V=Xx.sketch({dom:a,components:H.map((function(t){return t.asSpec()}))}),I=R("Brightness",CO,-100,0,100),L=R("Contrast",SO,-100,0,100),F=R("Gamma",wO,-100,0,100),P=function(t,e,n){return function(r){return function(t,e,n,r){return lO(t,e,n,r)}(r,t,e,n)}},U=function(t){return A(t,(function(t,e,n){var r=j.getOpt(t),o=q.getOpt(t),i=W.getOpt(t);r.each((function(e){o.each((function(n){i.each((function(r){var o=_f.getValue(e).x/100,i=_f.getValue(r).x/100,a=_f.getValue(n).x/100,u=P(o,i,a);f(t,u)}))}))}))}),0,100,200)},j=U("R"),W=U("G"),q=U("B"),G=[h(),j,W,q,b()],$=Xx.sketch({dom:a,components:G.map((function(t){return t.asSpec()}))}),X=function(t,e,n){return function(r){c(r,sE.swap(),{transform:e,swap:function(){tt.getOpt(r).each((function(e){ch.set(e,[t]),n(e)}))}})}},K=N.some(xO),Y=N.some(yO),J=[r("crop","Crop",X(x,N.none(),(function(e){t.showCrop()})),!1),r("resize","Resize",X(S,N.none(),(function(e){w.getOpt(e).each((function(e){var n=t.getMeasurements(),r=n.width,o=n.height;_f.setValue(e,{width:r,height:o})}))})),!1),r("orientation","Orientation",X(z,N.none(),u),!1),r("brightness","Brightness",X(I,N.none(),u),!1),r("sharpen","Sharpen",X(V,K,u),!1),r("contrast","Contrast",X(L,N.none(),u),!1),r("color-levels","Color levels",X($,N.none(),u),!1),r("gamma","Gamma",X(F,N.none(),u),!1),r("invert","Invert",X(V,Y,u),!1)],Q=Xx.sketch({dom:a,components:J.map((function(t){return t.asSpec()}))}),Z=Xx.sketch({dom:{tag:"div"},components:[Q],containerBehaviours:xc([ch.config({})])}),tt=yp(Z);return{memContainer:tt,getApplyButton:function(t){return tt.getOpt(t).map((function(t){var e=t.components()[0];return e.components()[e.components().length-1]}))}}},hE=tinymce.util.Tools.resolve("tinymce.geom.Rect"),pE=tinymce.util.Tools.resolve("tinymce.util.Observable"),vE=tinymce.util.Tools.resolve("tinymce.util.VK"),bE=function(t){if(function(t){return l(t.changedTouches)}(t))for(var e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]};function yE(t,e){var n,r,o,i,a,u,c,s=[],f=[],d=null!==(n=e.document)&&void 0!==n?n:document,m=null!==(r=e.root)&&void 0!==r?r:d,g=Nt.fromDom(d),h=Nt.fromDom(m.getElementById(null!==(o=e.handle)&&void 0!==o?o:t)),p=function(t){var n=t.raw,r=function(t){var e=Math.max,n=t.documentElement,r=t.body,o=e(n.scrollWidth,r.scrollWidth),i=e(n.clientWidth,r.clientWidth),a=e(n.offsetWidth,r.offsetWidth),u=e(n.scrollHeight,r.scrollHeight),c=e(n.clientHeight,r.clientHeight);return{width:o<a?i:o,height:u<e(n.offsetHeight,r.offsetHeight)?c:u}}(d);bE(n),t.prevent(),a=n.button,u=n.screenX,c=n.screenY;var o=tn(h,"cursor");i=Nt.fromTag("div",d),Qe(i,{position:"absolute",top:"0",left:"0",width:r.width+"px",height:r.height+"px","z-index":"2147483647",opacity:"0.0001",cursor:o}),En(Pe(g),i),f.push(es(g,"mousemove",v),es(g,"touchmove",v),es(g,"mouseup",b),es(g,"touchend",b)),e.start(n)},v=function(t){var n=t.raw;if(bE(n),n.button!==a)return b(t);n.deltaX=n.screenX-u,n.deltaY=n.screenY-c,t.prevent(),e.drag(n)},b=function(t){bE(t.raw),j(f,(function(t){return t.unbind()})),f=[],Mn(i),e.stop&&e.stop(t.raw)};return s.push(es(h,"mousedown",p),es(h,"touchstart",p)),{destroy:function(){j(f.concat(s),(function(t){return t.unbind()})),f=[],s=[],l(i)&&Mn(i)}}}var xE=0,wE=function(t,e,n,r,o){var i,a=[],u="tox-",c=u+"crid-"+xE++,s=Nt.fromDom(r),l=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],f=["top","right","bottom","left"],d=function(t,e){return{x:e.x-t.x,y:e.y-t.y,w:e.w,h:e.h}},m=function(e,r,o,i){var a=r.x+o*e.deltaX,u=r.y+i*e.deltaY,c=Math.max(20,r.w+o*e.deltaW),s=Math.max(20,r.h+i*e.deltaH),l=t=hE.clamp({x:a,y:u,w:c,h:s},n,"move"===e.name);l=d(n,l),v.fire("updateRect",{rect:l}),p(l)},g=function(t){var n=function(t,e){su(s,"#"+c+"-"+t).each((function(t){Qe(t,{left:e.x+"px",top:e.y+"px",width:Math.max(0,e.w)+"px",height:Math.max(0,e.h)+"px"})}))};j(l,(function(e){su(s,"#"+c+"-"+e.name).each((function(n){Qe(n,{left:t.w*e.xMul+t.x+"px",top:t.h*e.yMul+t.y+"px"})}))})),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)},h=function(e){g(t=e)},p=function(t){var e,r;h((e=n,{x:(r=t).x+e.x,y:r.y+e.y,w:r.w,h:r.h}))};!function(){var e=Nt.fromTag("div");We(e,{id:c,class:u+"croprect-container",role:"grid","aria-dropeffect":"execute"}),En(s,e),j(f,(function(t){su(s,"#"+c).each((function(e){var n=Nt.fromTag("div");We(n,{id:c+"-"+t,class:u+"croprect-block","data-mce-bogus":"all"}),Je(n,"display","none"),En(e,n)}))})),j(l,(function(t){su(s,"#"+c).each((function(e){var n=Nt.fromTag("div");We(n,{id:c+"-"+t.name,"aria-label":t.label,"aria-grabbed":"false","data-mce-bogus":"all",role:"gridcell",tabindex:"-1",title:t.label}),Pa(n,[u+"croprect-handle",u+"croprect-handle-"+t.name]),Je(n,"display","none"),En(e,n)}))})),i=U(l,(function(e){var n;return yE(c,{document:r.ownerDocument,root:Be(s).dom,handle:c+"-"+e.name,start:function(){n=t},drag:function(t){m(e,n,t.deltaX,t.deltaY)}})})),g(t);var n=function(t){je(t.target,"aria-grabbed","focus"===t.raw.type?"true":"false")};a.push(es(s,"focusin",n),es(s,"focusout",n),es(s,"keydown",(function(e){var n;j(l,(function(t){if(qe(e.target,"id")===c+"-"+t.name)return n=t,!1}));var r=function(t,e,r,o,i){t.stopPropagation(),t.preventDefault(),m(n,r,o,i)};switch(e.raw.keyCode){case vE.LEFT:r(e,0,t,-10,0);break;case vE.RIGHT:r(e,0,t,10,0);break;case vE.UP:r(e,0,t,0,-10);break;case vE.DOWN:r(e,0,t,0,10);break;case vE.ENTER:case vE.SPACEBAR:e.prevent(),o()}})))}();var v=O(O({},pE),{toggleVisibility:function(t){var e=_(_([],U(l,(function(t){return"#"+c+"-"+t.name})),!0),U(f,(function(t){return"#"+c+"-"+t})),!0).join(","),n=ol(s,e);j(n,t?function(t){return an(t,"display")}:function(t){return Je(t,"display","none")})},setClampRect:function(e){n=e,g(t)},setRect:h,getInnerRect:function(){return d(n,t)},setInnerRect:p,setViewPortRect:function(n){e=n,g(t)},destroy:function(){j(i,(function(t){return t.destroy()})),i=[],j(a,(function(t){return t.unbind()})),a=[]}});return v},CE=function(t){var e,n=yp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),r=wo(1),o=(e=Jc(),O(O({},e),{run:function(t){return e.get().each(t)}})),i=wo({x:0,y:0,w:1,h:1}),a=wo({x:0,y:0,w:1,h:1}),u=function(t,e){l.getOpt(t).each((function(t){var a=r.get(),u=bn(t.element),c=ln(t.element),s=e.dom.naturalWidth*a,l=e.dom.naturalHeight*a,f=Math.max(0,u/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};Qe(e,m),n.getOpt(t).each((function(t){Qe(t.element,m)})),o.run((function(t){var e=i.get();t.setRect({x:e.x*a+f,y:e.y*a+d,w:e.w*a,h:e.h*a}),t.setClampRect({x:f,y:d,w:s,h:l}),t.setViewPortRect({x:0,y:0,w:u,h:c})}))}))},c=function(t,e){var n,o=Nt.fromTag("img");return je(o,"src",e),(n=o.dom,new qp((function(t){var e=function(){n.removeEventListener("load",e),t(n)};n.complete?t(n):n.addEventListener("load",e)}))).then((function(){t.getSystem().isConnected()&&l.getOpt(t).map((function(t){var e=Qa({element:o});ch.replaceAt(t,1,N.some(e));var n=a.get(),c={x:0,y:0,w:o.dom.naturalWidth,h:o.dom.naturalHeight};a.set(c);var s=hE.inflate(c,-20,-20);i.set(s),n.w===c.w&&n.h===c.h||function(t,e){l.getOpt(t).each((function(t){var n=bn(t.element),o=ln(t.element),i=e.dom.naturalWidth,a=e.dom.naturalHeight,u=Math.min(n/i,o/a);u>=1?r.set(1):r.set(u)}))}(t,o),u(t,o)}))}))},s=Xx.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[n.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:xc([sh("image-panel-crop-events",[Gi((function(t){l.getOpt(t).each((function(t){var e=t.element.dom,n=wE({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,g);n.toggleVisibility(!1),n.on("updateRect",(function(t){var e=t.rect,n=r.get(),o={x:Math.round(e.x/n),y:Math.round(e.y/n),w:Math.round(e.w/n),h:Math.round(e.h/n)};i.set(o)})),o.set(n)}))})),$i((function(){o.clear()}))])])}],containerBehaviours:xc([ch.config({}),sh("image-panel-events",[Gi((function(e){c(e,t)}))])])}),l=yp(s);return{memContainer:l,updateSrc:c,zoom:function(t,e){var n=r.get(),o=e>0?Math.min(2,n+.1):Math.max(.1,n-.1);r.set(o),l.getOpt(t).each((function(t){var e=t.components()[1].element;u(t,e)}))},showCrop:function(){o.run((function(t){t.toggleVisibility(!0)}))},hideCrop:function(){o.run((function(t){t.toggleVisibility(!1)}))},getRect:function(){return i.get()},getMeasurements:function(){var t=a.get();return{width:t.w,height:t.h}}}},SE=function(t,e,n,r,o){return XO({name:t,icon:N.some(e),disabled:n,tooltip:N.some(t),primary:!1,borderless:!1},r,o)},kE=function(t,e){e?Yd.enable(t):Yd.disable(t)};var OE,EE=function(t){var e,n,r,o,i=wo(t),a=Zc(),u=(n=-1,{data:e=[],add:function(t){var r=e.splice(++n);return e.push(t),{state:t,removed:r}},undo:function(){if(r())return e[--n]},redo:function(){if(o())return e[++n]},canUndo:r=function(){return n>0},canRedo:o=function(){return-1!==n&&n<e.length-1}});u.add(t);var c=function(t){i.set(t)},s=function(t){return{blob:t,url:URL.createObjectURL(t)}},l=function(t){URL.revokeObjectURL(t.url)},f=function(){a.on(l),a.clear()},d=function(t){var e=s(t);c(e);var n,r=u.add(e).removed;return n=r,Sk.each(n,l),e.url};return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:d,getTempState:function(){return a.get().getOrThunk(i.get)},updateTempState:function(t){var e=s(t);return f(),a.set(e),e.url},addTempState:function(t){var e=s(t);return a.set(e),e.url},applyTempState:function(t){return a.get().fold(g,(function(e){d(e.blob),t()}))},destroyTempState:f,undo:function(){var t=u.undo();return c(t),t.url},redo:function(){var t=u.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:u.canUndo(),redoEnabled:u.canRedo()}}}},_E=function(t,e){var n=EE(t.currentState),r=function(t){var e=n.getHistoryStates();d.updateButtonUndoStates(t,e.undoEnabled,e.redoEnabled),Di(t,mE.formActionEvent,{name:mE.saveState(),value:e.undoEnabled})},o=function(t){return t.toBlob()},i=function(t){Di(t,mE.formActionEvent,{name:mE.disable(),value:{}})},a=function(t){m.getApplyButton(t).each((function(t){Yd.enable(t)})),Di(t,mE.formActionEvent,{name:mE.enable(),value:{}})},u=function(t,e){return i(t),f.updateSrc(t,e)},c=function(t,e,n,c,s){i(t),function(t){return Qk(t)}(e).then(n).then(o).then(c).then((function(e){return u(t,e)})).then((function(){r(t),s(),a(t)})).catch((function(e){console.log(e),t.getSystem().isConnected()&&a(t)}))},s=function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(t){return n.updateTempState(t)}),r)},l=function(t){var e=n.getBlobState().url;return n.destroyTempState(),r(t),e},f=CE(t.currentState.url),d=function(t){var e=yp(SE("Undo","undo",!0,(function(t){Di(t,sE.undo(),{direction:1})}),t)),n=yp(SE("Redo","redo",!0,(function(t){Di(t,sE.redo(),{direction:1})}),t)),r=Xx.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[e.asSpec(),n.asSpec(),SE("Zoom in","zoom-in",!1,(function(t){Di(t,sE.zoom(),{direction:1})}),t),SE("Zoom out","zoom-out",!1,(function(t){Di(t,sE.zoom(),{direction:-1})}),t)]});return{container:r,updateButtonUndoStates:function(t,r,o){e.getOpt(t).each((function(t){kE(t,r)})),n.getOpt(t).each((function(t){kE(t,o)}))}}}(e),m=gE(f,e);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[m.memContainer.asSpec(),f.memContainer.asSpec(),d.container],behaviours:xc([_f.config({store:{mode:"manual",getValue:function(){return n.getBlobState()}}}),sh("image-tools-events",[Ii(sE.undo(),(function(t,e){var o=n.undo();u(t,o).then((function(e){a(t),r(t)}))})),Ii(sE.redo(),(function(t,e){var o=n.redo();u(t,o).then((function(e){a(t),r(t)}))})),Ii(sE.zoom(),(function(t,e){var n=e.event.direction;f.zoom(t,n)})),Ii(sE.back(),(function(t,e){!function(t){var e=l(t);u(t,e).then((function(e){a(t)}))}(t),(0,e.event.swap)(),f.hideCrop()})),Ii(sE.apply(),(function(t,e){n.applyTempState((function(){l(t),(0,e.event.swap)()}))})),Ii(sE.transform(),(function(t,e){return s(t,e.event.transform,g)})),Ii(sE.tempTransform(),(function(t,e){return function(t,e){var r=n.getTempState().blob;c(t,r,e,(function(t){return n.addTempState(t)}),g)}(t,e.event.transform)})),Ii(sE.transformApply(),(function(t,e){return function(t,e,r){var o=n.getBlobState().blob;c(t,o,e,(function(e){var r=n.addBlobState(e);return l(t),r}),r)}(t,e.event.transform,e.event.swap)})),Ii(sE.swap(),(function(t,e){!function(t){d.updateButtonUndoStates(t,!1,!1)}(t);var n=e.event.transform,r=e.event.swap;n.fold((function(){r()}),(function(e){s(t,e,r)}))}))]),vk()])}},TE=function(t){return!yt(t,"items")},ME="data-value",DE=function(t,e,n,r){return U(n,(function(n){return TE(n)?{type:"togglemenuitem",text:n.text,value:n.value,active:n.value===r,onAction:function(){_f.setValue(t,n.value),Di(t,uw,{name:e}),gh.focus(t)}}:{type:"nestedmenuitem",text:n.text,getSubmenuItems:function(){return DE(t,e,n.items,r)}}}))},zE=function(t,e){return ct(t,(function(t){return TE(t)?kt(t.value===e,t):zE(t.items,e)}))},AE=zd({name:"HtmlSelect",configFields:[Kr("options"),Tf("selectBehaviours",[gh,_f]),fo("selectClasses",[]),fo("selectAttributes",{}),oo("data")],factory:function(t,e){var n=U(t.options,(function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}})),r=t.data.map((function(t){return Oo("initialValue",t)})).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:n,behaviours:Df(t.selectBehaviours,[gh.config({}),_f.config({store:O({mode:"manual",getValue:function(t){return ja(t.element)},setValue:function(e,n){X(t.options,(function(t){return t.value===n})).isSome()&&Wa(e.element,n)}},r)})])}}}),NE=function(t,e){var n=t.label.map((function(t){return aw(t,e)})),r=[Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),$b(),nh.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Mi(t,fw),N.some(!0)}}),sh("textfield-change",[Ii(Ko(),(function(e,n){Di(e,uw,{name:t.name})})),Ii(ai(),(function(e,n){Di(e,uw,{name:t.name})}))]),ew.config({})],o=t.validation.map((function(t){return Pw.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-invalid",validator:{validate:function(e){var n=_f.getValue(e),r=t.validator(n);return zw(!0===r?Wn.value(n):Wn.error(r))},validateOnLoad:t.validateOnLoad}})})).toArray(),i=t.placeholder.fold(p({}),(function(t){return{placeholder:e.translate(t)}})),a=t.inputMode.fold(p({}),(function(t){return{inputmode:t}})),u=O(O({},i),a),c=Qx.parts.field({tag:!0===t.multiline?"textarea":"input",inputAttributes:u,inputClasses:[t.classname],inputBehaviours:xc(Y([r,o])),selectOnFocus:!1,factory:ww}),s=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),l=[Yd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Qx.getField(t).each(Yd.disable)},onEnabled:function(t){Qx.getField(t).each(Yd.enable)}}),$b()];return rw(n,c,s,l)},BE=Object.freeze({__proto__:null,events:function(t,e){var n=t.stream.streams.setup(t,e);return Ri([Ii(t.event,n),$i((function(){return e.cancel()}))].concat(t.cancelEvent.map((function(t){return[Ii(t,(function(){return e.cancel()}))]})).getOr([])))}}),RE=function(t){var e=wo(null);return wa({readState:function(){return{timer:null!==e.get()?"set":"unset"}},setTimer:function(t){e.set(t)},cancel:function(){var t=e.get();null!==t&&t.cancel()}})},HE=Object.freeze({__proto__:null,throttle:RE,init:function(t){return t.stream.streams.state(t)}}),VE=[Yr("stream",qr("mode",{throttle:[Kr("delay"),fo("stopEvent",!0),zu("streams",{setup:function(t,e){var n=t.stream,r=Bp(t.onStream,n.delay);return e.setTimer(r),function(t,e){r.throttle(t,e),n.stopEvent&&e.stop()}},state:RE})]})),fo("event","input"),oo("cancelEvent"),Mu("onStream")],IE=Cc({fields:VE,name:"streaming",active:BE,state:HE}),LE=function(t,e,n){var r=_f.getValue(n);_f.setValue(e,r),PE(e)},FE=function(t,e){var n=t.element,r=ja(n),o=n.dom;"number"!==qe(n,"type")&&e(o,r)},PE=function(t){FE(t,(function(t,e){return t.setSelectionRange(e.length,e.length)}))},UE=function(t,e,n){if(t.selectsOver){var r=_f.getValue(e),o=t.getDisplayText(r),i=_f.getValue(n);return 0===t.getDisplayText(i).indexOf(o)?N.some((function(){LE(0,e,n),function(t,e){FE(t,(function(t,n){return t.setSelectionRange(e,n.length)}))}(e,o.length)})):N.none()}return N.none()},jE=p("alloy.typeahead.itemexecute"),WE=p([oo("lazySink"),Kr("fetch"),fo("minChars",5),fo("responseTime",1e3),_u("onOpen"),fo("getHotspot",N.some),fo("getAnchorOverrides",p({})),fo("layouts",N.none()),fo("eventOrder",{}),xo("model",{},[fo("getDisplayText",(function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value})),fo("selectsOver",!0),fo("populateFromBrowse",!0)]),_u("onSetValue"),Tu("onExecute"),_u("onItemExecute"),fo("inputClasses",[]),fo("inputAttributes",{}),fo("inputStyles",{}),fo("matchWidth",!0),fo("useMinWidth",!1),fo("dismissOnBlur",!0),Ou(["openClass"]),oo("initialData"),Tf("typeaheadBehaviours",[gh,_f,IE,nh,Eh,qw]),$r("previewing",(function(){return wo(!0)}))].concat(vw()).concat(aC())),qE=p([od({schema:[ku()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlight:function(e,n){t.previewing.get()?e.getSystem().getByUid(t.uid).each((function(r){UE(t.model,r,n).fold((function(){return um.dehighlight(e,n)}),(function(t){return t()}))})):e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&LE(t.model,e,n)})),t.previewing.set(!1)},onExecute:function(e,n){return e.getSystem().getByUid(t.uid).toOptional().map((function(t){return Di(t,jE(),{item:n}),!0}))},onHover:function(e,n){t.previewing.set(!1),e.getSystem().getByUid(t.uid).each((function(e){t.model.populateFromBrowse&&LE(t.model,e,n)}))}}}})]),GE=Ad({name:"Typeahead",configFields:WE(),partFields:qE(),factory:function(t,e,n,r){var o=function(e,n,o){t.previewing.set(!1);var i=qw.getCoupled(e,"sandbox");if(uf.isOpen(i))Hd.getCurrent(i).each((function(t){um.getHighlighted(t).fold((function(){o(t)}),(function(){Bi(i,t.element,"keydown",n)}))}));else{Qw(t,a(e),e,i,r,(function(t){Hd.getCurrent(t).each(o)}),kw.HighlightFirst).get(g)}},i=bw(t),a=function(t){return function(e){return e.map((function(e){var n=vt(e.menus),r=J(n,(function(t){return q(t.items,(function(t){return"item"===t.type}))}));return _f.getState(t).update(U(r,(function(t){return t.data}))),e}))}},u=[gh.config({}),_f.config({onSetValue:t.onSetValue,store:O({mode:"dataset",getDataKey:function(t){return ja(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(e,n){Wa(e.element,t.model.getDisplayText(n))}},t.initialData.map((function(t){return Oo("initialValue",t)})).getOr({}))}),IE.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(e,n){var o=qw.getCoupled(e,"sandbox");if(gh.isFocused(e)&&ja(e.element).length>=t.minChars){var i=Hd.getCurrent(o).bind((function(t){return um.getHighlighted(t).map(_f.getValue)}));t.previewing.set(!0);Qw(t,a(e),e,o,r,(function(e){Hd.getCurrent(o).each((function(e){i.fold((function(){t.model.selectsOver&&um.highlightFirst(e)}),(function(t){um.highlightBy(e,(function(e){return _f.getValue(e).value===t.value})),um.getHighlighted(e).orThunk((function(){return um.highlightFirst(e),N.none()}))}))}))}),kw.HighlightFirst).get(g)}},cancelEvent:mi()}),nh.config({mode:"special",onDown:function(t,e){return o(t,e,um.highlightFirst),N.some(!0)},onEscape:function(t){var e=qw.getCoupled(t,"sandbox");return uf.isOpen(e)?(uf.close(e),N.some(!0)):N.none()},onUp:function(t,e){return o(t,e,um.highlightLast),N.some(!0)},onEnter:function(e){var n=qw.getCoupled(e,"sandbox"),r=uf.isOpen(n);if(r&&!t.previewing.get())return Hd.getCurrent(n).bind((function(t){return um.getHighlighted(t)})).map((function(t){return Di(e,jE(),{item:t}),!0}));var o=_f.getValue(e);return Mi(e,mi()),t.onExecute(n,e,o),r&&uf.close(n),N.some(!0)}}),Eh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),qw.config({others:{sandbox:function(e){return oC(t,e,{onOpen:function(){return Eh.on(e)},onClose:function(){return Eh.off(e)}})}}}),sh("typeaheadevents",[Ki((function(e){var n=g;tC(t,a(e),e,r,n,kw.HighlightFirst).get(g)})),Ii(jE(),(function(e,n){var r=qw.getCoupled(e,"sandbox");LE(t.model,e,n.event.item),Mi(e,mi()),t.onItemExecute(e,r,n.event.item,_f.getValue(e)),uf.close(r),PE(e)}))].concat(t.dismissOnBlur?[Ii(ii(),(function(t){var e=qw.getCoupled(t,"sandbox");Ac(e.element).isNone()&&uf.close(e)}))]:[]))];return{uid:t.uid,dom:xw(ur(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:O(O({},i),Df(t.typeaheadBehaviours,u)),eventOrder:t.eventOrder}}}),$E=function(t){return O(O({},t),{toCached:function(){return $E(t.toCached())},bindFuture:function(e){return $E(t.bind((function(t){return t.fold((function(t){return zw(Wn.error(t))}),(function(t){return e(t)}))})))},bindResult:function(e){return $E(t.map((function(t){return t.bind(e)})))},mapResult:function(e){return $E(t.map((function(t){return t.map(e)})))},mapError:function(e){return $E(t.map((function(t){return t.mapError(e)})))},foldResult:function(e,n){return t.map((function(t){return t.fold(e,n)}))},withTimeout:function(e,n){return $E(Dw((function(r){var o=!1,i=setTimeout((function(){o=!0,r(Wn.error(n()))}),e);t.get((function(t){o||(clearTimeout(i),r(t))}))})))}})},XE=function(t){return $E(Dw(t))},KE=XE,YE={type:"separator"},JE=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:g}},QE=function(t,e){return{type:"menuitem",value:e,text:t,meta:{attach:void 0},onAction:g}},ZE=function(t,e){return function(t){return U(t,JE)}(function(t,e){return q(e,(function(e){return e.type===t}))}(t,e))},t_=function(t){return ZE("header",t.targets)},e_=function(t){return ZE("anchor",t.targets)},n_=function(t){return N.from(t.anchorTop).map((function(t){return QE("<top>",t)})).toArray()},r_=function(t){return N.from(t.anchorBottom).map((function(t){return QE("<bottom>",t)})).toArray()},o_=function(t,e){var n=t.toLowerCase();return q(e,(function(t){var e=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text;return Et(e.toLowerCase(),n)||Et(t.value.toLowerCase(),n)}))},i_=function(t,e,n){var r=_f.getValue(e),o=void 0!==r.meta.text?r.meta.text:r.value;return n.getLinkInformation().fold((function(){return[]}),(function(e){var r,i=o_(o,function(t){return U(t,(function(t){return QE(t,t)}))}(n.getHistory(t)));return"file"===t?(r=[i,o_(o,t_(e)),o_(o,Y([n_(e),e_(e),r_(e)]))],$(r,(function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(YE,e)}),[])):i}))},a_=oa("aria-invalid"),u_=function(t){return function(e,n,r){return bt(n,"name").fold((function(){return t(n,r)}),(function(o){return e.field(o,t(n,r))}))}},c_={bar:u_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),collection:u_((function(t,e){return pw(t,e.shared.providers)})),alertbanner:u_((function(t,e){return function(t,e){return Xx.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[bp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Ep(t.icon,e.icons),attributes:{title:e.translate(t.iconTooltip)}},action:function(e){Di(e,lw,{name:"alert-banner",value:t.url})},buttonBehaviours:xc([_p()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(t.text)}}]})}(t,e.shared.providers)})),input:u_((function(t,e){return function(t,e){return NE({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:t.disabled,classname:"tox-textfield",validation:N.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),textarea:u_((function(t,e){return function(t,e){return NE({name:t.name,multiline:!0,label:t.label,inputMode:N.none(),placeholder:t.placeholder,flex:!0,disabled:t.disabled,classname:"tox-textarea",validation:N.none(),maximized:t.maximized},e)}(t,e.shared.providers)})),label:u_((function(t,e){return function(t,e){var n={dom:{tag:"label",innerHtml:e.providers.translate(t.label),classes:["tox-label"]}},r=U(t.items,e.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(r),behaviours:xc([vk(),ch.config({}),Mk(N.none()),nh.config({mode:"acyclic"})])}}(t,e.shared)})),iframe:function(t){return function(e,n,r){var o=ur(n,{source:"dynamic"});return u_(t)(e,o,r)}}((function(t,e){return Fk(t,e.shared.providers)})),button:u_((function(t,e){return ZO(t,e.shared.providers)})),checkbox:u_((function(t,e){return function(t,e){var n=_f.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,e){t.element.dom.checked=e}}}),r=function(t){return t.element.dom.click(),N.some(!0)},o=Qx.parts.field({factory:{sketch:v},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:xc([vk(),Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),ew.config({}),gh.config({}),n,nh.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),sh("checkbox-events",[Ii(Yo(),(function(e,n){Di(e,uw,{name:t.name})}))])])}),i=Qx.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:e.translate(t.label)},behaviours:xc([fC.config({})])}),a=function(t){return Mp("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},e.icons)},u=yp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return Qx.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),i],fieldBehaviours:xc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Qx.getField(t).each(Yd.disable)},onEnabled:function(t){Qx.getField(t).each(Yd.enable)}}),$b()])})}(t,e.shared.providers)})),colorinput:u_((function(t,e){return hC(t,e.shared,e.colorinput)})),colorpicker:u_((function(t){var e=function(t){return"tox-"+t},n=pk(wk,e),r=yp(n.sketch({dom:{tag:"div",classes:[e("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Di(t,lw,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Di(t,lw,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:xc([_f.config({store:{mode:"manual",getValue:function(t){var e=r.get(t);return Hd.getCurrent(e).bind((function(t){return _f.getValue(t).hex})).map((function(t){return"#"+t})).getOr("")},setValue:function(t,e){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(e),o=r.get(t);Hd.getCurrent(o).fold((function(){console.log("Can not find form")}),(function(t){_f.setValue(t,{hex:N.from(n[1]).getOr("")}),sk.getField(t,"hex").each((function(t){Mi(t,Ko())}))}))}}}),vk()])}})),dropzone:u_((function(t,e){return zk(t,e.shared.providers)})),grid:u_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:U(t.items,e.interpreter)}}(t,e.shared)})),listbox:u_((function(t,e){return function(t,e){var n=e.shared.providers,r=it(t.items).filter(TE),o=t.label.map((function(t){return aw(t,n)})),i=Qx.parts.field({dom:{},factory:{sketch:function(n){return HO({uid:n.uid,text:r.map((function(t){return t.text})),icon:N.none(),tooltip:t.label,role:N.none(),fetch:function(n,r){var o=DE(n,t.name,t.items,_f.getValue(n));r(UO(o,vv.CLOSE_ON_EXECUTE,e,!1))},onSetup:p(g),getApi:p({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[ew.config({}),_f.config({store:{mode:"manual",initialValue:r.map((function(t){return t.value})).getOr(""),getValue:function(t){return qe(t.element,ME)},setValue:function(e,n){zE(t.items,n).each((function(t){je(e.element,ME,t.value),Di(e,BO,{text:t.text})}))}}})]},"tox-listbox",e.shared)}}}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[i]};return Qx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Y([o.toArray(),[a]]),fieldBehaviours:xc([Yd.config({disabled:p(t.disabled),onDisabled:function(t){Qx.getField(t).each(Yd.disable)},onEnabled:function(t){Qx.getField(t).each(Yd.enable)}})])})}(t,e)})),selectbox:u_((function(t,e){return function(t,e){var n=U(t.items,(function(t){return{text:e.translate(t.text),value:t.value}})),r=t.label.map((function(t){return aw(t,e)})),o=Qx.parts.field({dom:{},selectAttributes:{size:t.size},options:n,factory:AE,selectBehaviours:xc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()}}),ew.config({}),sh("selectbox-change",[Ii(Yo(),(function(e,n){Di(e,uw,{name:t.name})}))])])}),i=t.size>1?N.none():N.some(Mp("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},e.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:Y([[o],i.toArray()])};return Qx.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Y([r.toArray(),[a]]),fieldBehaviours:xc([Yd.config({disabled:function(){return t.disabled||e.isDisabled()},onDisabled:function(t){Qx.getField(t).each(Yd.disable)},onEnabled:function(t){Qx.getField(t).each(Yd.enable)}}),$b()])})}(t,e.shared.providers)})),sizeinput:u_((function(t,e){return cE(t,e.shared.providers)})),urlinput:u_((function(t,e){return function(t,e,n){var r,o=e.shared.providers,i=function(e){var r=_f.getValue(e);n.addToHistory(r.value,t.filetype)},a=Qx.parts.field({factory:GE,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":a_,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=i_(t.filetype,r,n),i=UO(o,vv.BUBBLE_TO_SANDBOX,e,!1);return zw(i)},getHotspot:function(t){return d.getOpt(t)},onSetValue:function(t,e){t.hasConfigured(Pw)&&Pw.run(t).get(g)},typeaheadBehaviours:xc(Y([n.getValidationHandler().map((function(e){return Pw.config({getRoot:function(t){return Oe(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,e){c.getOpt(t).each((function(t){je(t.element,"title",o.translate(e))}))}},validator:{validate:function(n){var r=_f.getValue(n);return KE((function(n){e({type:t.filetype,url:r.value},(function(t){if("invalid"===t.status){var e=Wn.error(t.message);n(e)}else{var r=Wn.value(t.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Yd.config({disabled:function(){return t.disabled||o.isDisabled()}}),ew.config({}),sh("urlinput-events",Y(["file"===t.filetype?[Ii(Ko(),(function(e){Di(e,uw,{name:t.name})}))]:[],[Ii(Yo(),(function(e){Di(e,uw,{name:t.name}),i(e)})),Ii(ai(),(function(e){Di(e,uw,{name:t.name}),i(e)}))]]))]])),eventOrder:(r={},r[Ko()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:e.shared.getSink,parts:{menu:Rv(0,0,"normal")},onExecute:function(t,e,n){Di(e,fw,{})},onItemExecute:function(e,n,r,o){i(e),Di(e,uw,{name:t.name})}}),u=t.label.map((function(t){return aw(t,o)})),c=yp(function(t,e,n,r){return void 0===n&&(n=t),void 0===r&&(r=t),Mp(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:O({title:o.translate(r),"aria-live":"polite"},e.fold((function(){return{}}),(function(t){return{id:t}})))},o.icons)}("invalid",N.some(a_),"warning")),s=yp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[c.asSpec()]}),l=n.getUrlPicker(t.filetype),f=oa("browser.url.event"),d=yp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,s.asSpec()],behaviours:xc([Yd.config({disabled:function(){return t.disabled||o.isDisabled()}})])}),m=yp(YO({name:t.name,icon:N.some("browse"),text:t.label.getOr(""),disabled:t.disabled,primary:!1,borderless:!0},(function(t){return Mi(t,f)}),o,[],["tox-browse-url"]));return Qx.sketch({dom:iw([]),components:u.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Y([[d.asSpec()],l.map((function(){return m.asSpec()})).toArray()])}]),fieldBehaviours:xc([Yd.config({disabled:function(){return t.disabled||o.isDisabled()},onDisabled:function(t){Qx.getField(t).each(Yd.disable),m.getOpt(t).each(Yd.disable)},onEnabled:function(t){Qx.getField(t).each(Yd.enable),m.getOpt(t).each(Yd.enable)}}),$b(),sh("url-input-events",[Ii(f,(function(e){Hd.getCurrent(e).each((function(n){var r=_f.getValue(n),o=O({fieldname:t.name},r);l.each((function(r){r(o).get((function(r){_f.setValue(n,r),Di(e,uw,{name:t.name})}))}))}))}))])])})}(t,e,e.urlinput)})),customeditor:u_((function(t){var e=Zc(),n=yp({dom:{tag:t.tag}}),r=Zc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:xc([sh("custom-editor-events",[Gi((function(o){n.getOpt(o).each((function(n){(!function(t){return yt(t,"init")}(t)?Ck.load(t.scriptId,t.scriptUrl).then((function(e){return e(n.element.dom,t.settings)})):t.init(n.element.dom)).then((function(t){r.on((function(e){t.setValue(e)})),r.clear(),e.set(t)}))}))}))]),_f.config({store:{mode:"manual",getValue:function(){return e.get().fold((function(){return r.get().getOr("")}),(function(t){return t.getValue()}))},setValue:function(t,n){e.get().fold((function(){r.set(n)}),(function(t){return t.setValue(n)}))}}}),vk()]),components:[n.asSpec()]}})),htmlpanel:u_((function(t){return"presentation"===t.presets?Xx.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Xx.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:xc([ew.config({}),gh.config({})])})})),imagetools:u_((function(t,e){return _E(t,e.shared.providers)})),table:u_((function(t,e){return function(t,e){var n,r,o=function(t){return{dom:{tag:"th",innerHtml:e.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:e.translate(t)}}},a=function(t){return{dom:{tag:"tr"},components:U(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:U(r,o)}]}),(n=t.cells,{dom:{tag:"tbody"},components:U(n,a)})],behaviours:xc([ew.config({}),gh.config({})])}}(t,e.shared.providers)})),panel:u_((function(t,e){return function(t,e){return{dom:{tag:"div",classes:t.classes},components:U(t.items,e.shared.interpreter)}}(t,e)}))},s_={field:function(t,e){return e}},l_=function(t,e,n){var r=ur(n,{shared:{interpreter:function(e){return f_(t,e,r)}}});return f_(t,e,r)},f_=function(t,e,n){return bt(c_,e.type).fold((function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e}),(function(r){return r(t,e,n)}))},d_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},m_=function(t,e,n){var r={maxHeightFunction:gs()};return function(){return n()?{type:"node",root:Re(t()),node:N.from(t()),bubble:bs(12,12,d_),layouts:{onRtl:function(){return[cp]},onLtr:function(){return[up]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:bs(-12,12,d_),layouts:{onRtl:function(){return[tc]},onLtr:function(){return[ec]}},overrides:r}}},g_=function(t,e,n){return function(){return n()?{type:"node",root:Re(t()),node:N.from(t()),layouts:{onRtl:function(){return[sp]},onLtr:function(){return[sp]}}}:{type:"hotspot",hotspot:e(),layouts:{onRtl:function(){return[ic]},onLtr:function(){return[ic]}}}}},h_=function(t,e){return function(){return{type:"selection",root:e(),getSelection:function(){var e=t.selection.getRng();return N.some(Ws.range(Nt.fromDom(e.startContainer),e.startOffset,Nt.fromDom(e.endContainer),e.endOffset))}}}},p_=function(t){return function(e){return{type:"node",root:t(),node:e}}},v_=function(t,e,n){var r=Rb(t),o=function(){return Nt.fromDom(t.getBody())},i=function(){return Nt.fromDom(t.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:m_(i,e,a),banner:g_(i,e,a),cursor:h_(t,o),node:p_(o)}},b_=function(t){return function(e,n){fx(t)(e,n)}},y_=function(t){return function(){return Zy(t)}},x_=function(t){return function(){return tx(t)}},w_=function(t){return function(){return rx(t)}},C_=function(t){return{colorPicker:b_(t),hasCustomColors:y_(t),getColors:x_(t),getColorCols:w_(t)}},S_=function(t){return function(){return function(t){return t.getParam("draggable_modal",!1,"boolean")}(t)}},k_=function(t){return{isDraggableModal:S_(t)}},O_=[{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"}]}],E_=function(t){return $(t,(function(t,e){if(yt(e,"items")){var n=E_(e.items);return{customFormats:t.customFormats.concat(n.customFormats),formats:t.formats.concat([{title:e.title,items:n.formats}])}}if(function(t){return yt(t,"inline")}(e)||function(t){return yt(t,"block")}(e)||function(t){return yt(t,"selector")}(e)){var o="custom-"+(r(e.name)?e.name:e.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:e}]),formats:t.formats.concat([{title:e.title,format:o,icon:e.icon}])}}return O(O({},t),{formats:t.formats.concat(e)})}),{customFormats:[],formats:[]})},__=function(t){return function(t){return N.from(t.getParam("style_formats")).filter(i)}(t).map((function(e){var n=function(t,e){var n=E_(e),r=function(e){j(e,(function(e){t.formatter.has(e.name)||t.formatter.register(e.name,e.format)}))};return t.formatter?r(n.customFormats):t.on("init",(function(){r(n.customFormats)})),n.formats}(t,e);return function(t){return t.getParam("style_formats_merge",!1,"boolean")}(t)?O_.concat(n):n})).getOr(O_)},T_=function(t,e,n){var r={type:"formatter",isSelected:e(t.format),getStylePreview:n(t.format)};return ur(t,r)},M_=function(t,e,n,o){var i=function(e){return U(e,(function(e){var a=st(e);if(xt(e,"items")){var u=i(e.items);return ur(function(t){return ur(t,{type:"submenu"})}(e),{getStyleItems:p(u)})}return xt(e,"format")?function(t){return T_(t,n,o)}(e):1===a.length&&I(a,"title")?ur(e,{type:"separator"}):function(e){var i=r(e.name)?e.name:oa(e.title),a="custom-"+i,u={type:"formatter",format:a,isSelected:n(a),getStylePreview:o(a)},c=ur(e,u);return t.formatter.register(i,c),c}(e)}))};return i(e)},D_=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){var n=t.formatter.get(e);return void 0!==n?N.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):N.none()}},r=function(t){var e=t.items;return void 0!==e&&e.length>0?J(e,r):[t.format]},o=wo([]),i=wo([]),a=wo([]),u=wo([]),c=wo(!1);t.on("PreInit",(function(a){var u=__(t),c=M_(t,u,e,n);o.set(c),i.set(J(c,r))})),t.on("addStyleModifications",(function(o){var i=M_(t,o.items,e,n);a.set(i),c.set(o.replace),u.set(J(i,r))}));return{getData:function(){var t=c.get()?[]:o.get(),e=a.get();return t.concat(e)},getFlattenedKeys:function(){var t=c.get()?[]:i.get(),e=u.get();return t.concat(e)}}},z_=Sk.trim,A_=function(t){return function(e){if(function(t){return l(t)&&1===t.nodeType}(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},N_=A_("true"),B_=A_("false"),R_=function(t,e,n,r,o){return{type:t,title:e,url:n,level:r,attach:o}},H_=function(t){return t.innerText||t.textContent},V_=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&L_(t)},I_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},L_=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return N_(t)}return!1}(t)&&!B_(t)},F_=function(t){return I_(t)&&L_(t)},P_=function(t){var e=function(t){return t.id?t.id:oa("h")}(t);return R_("header",H_(t),"#"+e,function(t){return I_(t)?parseInt(t.nodeName.substr(1),10):0}(t),(function(){t.id=e}))},U_=function(t){var e=t.id||t.name,n=H_(t);return R_("anchor",n||"#"+e,"#"+e,0,g)},j_=function(t){var e,n,r=(e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,U(ol(Nt.fromDom(n),e),(function(t){return t.dom})));return r},W_=function(t){return z_(t.title).length>0},q_=function(t){var e=j_(t);return q(function(t){return U(q(t,F_),P_)}(e).concat(function(t){return U(q(t,V_),U_)}(e)),W_)},G_="tinymce-url-history",$_=function(t){return r(t)&&/^https?/.test(t)},X_=function(t){return o(t)&&pt(t,(function(t){return!(i(e=t)&&e.length<=5&&Q(e,$_));var e})).isNone()},K_=function(){var t,e=$y.getItem(G_);if(null===e)return{};try{t=JSON.parse(e)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+G_+" was not valid JSON",t),{};throw t}return X_(t)?t:(console.log("Local storage "+G_+" was not valid format",t),{})},Y_=function(t){var e=K_();return bt(e,t).getOr([])},J_=function(t,e){if($_(t)){var n=K_(),r=bt(n,e).getOr([]),o=q(r,(function(e){return e!==t}));n[e]=[t].concat(o).slice(0,5),function(t){if(!X_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));$y.setItem(G_,JSON.stringify(t))}(n)}},Q_=function(t){return!!t},Z_=function(t){return dt(Sk.makeMap(t,/[, ]/),Q_)},tT=function(t){return N.from(function(t){return t.getParam("file_picker_callback")}(t)).filter(f)},eT=function(t,e){var n=function(t){var e=N.some(function(t){return t.getParam("file_picker_types")}(t)).filter(Q_),n=N.some(function(t){return t.getParam("file_browser_callback_types")}(t)).filter(Q_),r=e.or(n).map(Z_);return tT(t).fold(C,(function(t){return r.fold(S,(function(t){return st(t).length>0&&t}))}))}(t);return u(n)?n?tT(t):N.none():n[e]?tT(t):N.none()},nT=function(t){return N.from(t).filter(r).getOrUndefined()},rT=function(t){return{getHistory:Y_,addToHistory:J_,getLinkInformation:function(){return function(t){return function(t){return!1===t.getParam("typeahead_urls")}(t)?N.none():N.some({targets:q_(t.getBody()),anchorTop:nT(Pb(t)),anchorBottom:nT(Ub(t))})}(t)},getValidationHandler:function(){return function(t){return N.from(function(t){var e=t.getParam("file_picker_validator_handler",void 0,"function");return void 0===e?t.getParam("filepicker_validator_handler",void 0,"function"):e}(t))}(t)},getUrlPicker:function(e){return function(t,e){return eT(t,e).map((function(n){return function(i){return Dw((function(a){var u=O({filetype:e,fieldname:i.fieldname},N.from(i.meta).getOr({}));n.call(t,(function(t,e){if(!r(t))throw new Error("Expected value to be string");if(void 0!==e&&!o(e))throw new Error("Expected meta to be a object");a({value:t,meta:e})}),i.value,u)}))}}))}(t,e)}}},oT=function(t,e,n){var r=wo(!1),o=function(t){var e=wo(Nb(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===e.get()},getDockingMode:e.get,setDockingMode:e.set}}(e),i={shared:{providers:{icons:function(){return e.ui.registry.getAll().icons},menuItems:function(){return e.ui.registry.getAll().menuItems},translate:xp.translate,isDisabled:function(){return e.mode.isReadOnly()||e.ui.isDisabled()},getSetting:e.getParam.bind(e)},interpreter:function(t){return function(t,e){return f_(s_,t,e)}(t,i)},anchors:v_(e,n,o.isPositionedAtTop),header:o,getSink:function(){return Wn.value(t)}},urlinput:rT(e),styleselect:D_(e),colorinput:C_(e),dialog:k_(e),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}};return i},iT=Od,aT=cd,uT=p([fo("shell",!1),Kr("makeItem"),fo("setupItem",g),zf("listBehaviours",[ch])]),cT=id({name:"items",overrides:function(){return{behaviours:xc([ch.config({})])}}}),sT=p([cT]),lT=p("CustomList"),fT=Ad({name:lT(),configFields:uT(),partFields:sT(),factory:function(t,e,n,r){var o=t.shell?{behaviours:[ch.config({})],components:[]}:{behaviours:[],components:e},i=function(e){return t.shell?N.some(e):vd(e,t,"items")};return{uid:t.uid,dom:t.dom,components:o.components,behaviours:Df(t.listBehaviours,o.behaviours),apis:{setItems:function(e,n){i(e).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=ch.contents(r),i=n.length,a=i-o.length,u=a>0?F(a,(function(){return t.makeItem()})):[],c=o.slice(i);j(c,(function(t){return ch.remove(r,t)})),j(u,(function(t){return ch.append(r,t)}));var s=ch.contents(r);j(s,(function(r,o){t.setupItem(e,r,n[o],o)}))}))}}}},apis:{setItems:function(t,e,n){t.setItems(e,n)}}}),dT=p([Kr("dom"),fo("shell",!0),Tf("toolbarBehaviours",[ch])]),mT=p([id({name:"groups",overrides:function(){return{behaviours:xc([ch.config({})])}}})]),gT=Ad({name:"Toolbar",configFields:dT(),partFields:mT(),factory:function(t,e,n,r){var o=function(e){return t.shell?N.some(e):vd(e,t,"groups")},i=t.shell?{behaviours:[ch.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Df(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){ch.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),hT=g,pT=C,vT=p([]),bT=Object.freeze({__proto__:null,setup:hT,isDocked:pT,getBehaviours:vT}),yT=function(t){return(wt(nn(t,"position"),"fixed")?N.none():Ee(t)).orThunk((function(){var e=Nt.fromTag("span");return Oe(t).bind((function(t){En(t,e);var n=Ee(e);return Mn(e),n}))}))},xT=function(t){return yT(t).map(hn).getOrThunk((function(){return mn(0,0)}))},wT=Co([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),CT=function(t,e){var n=t.element;Va(n,e.transitionClass),La(n,e.fadeOutClass),Va(n,e.fadeInClass),e.onShow(t)},ST=function(t,e){var n=t.element;Va(n,e.transitionClass),La(n,e.fadeInClass),Va(n,e.fadeOutClass),e.onHide(t)},kT=function(t,e,n){return Q(t,(function(t){switch(t){case"bottom":return function(t,e){return t.bottom<=e.bottom}(e,n);case"top":return function(t,e){return t.y>=e.y}(e,n)}}))},OT=function(t,e){return e.getInitialPos().map((function(e){return In(e.bounds.x,e.bounds.y,bn(t),ln(t))}))},ET=function(t,e,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return N.some(wT.static());case"absolute":var o=yT(t).map(Ln).getOrThunk((function(){return Ln(Fe())}));return N.some(wT.absolute(Bc("absolute",bt(r.style,"left").map((function(t){return e.x-o.x})),bt(r.style,"top").map((function(t){return e.y-o.y})),bt(r.style,"right").map((function(t){return o.right-e.right})),bt(r.style,"bottom").map((function(t){return o.bottom-e.bottom})))));default:return N.none()}}))},_T=function(t,e,n){var r=Ln(t);if(kT(n.getModes(),r,e))return N.none();!function(t,e,n){n.setInitialPos({style:rn(t),position:tn(t,"position")||"static",bounds:e})}(t,r,n);var o=Pn(),i=r.x-o.x,a=e.y-o.y,u=o.bottom-e.bottom,c=r.y<=e.y;return N.some(wT.fixed(Bc("fixed",N.some(i),c?N.some(a):N.none(),N.none(),c?N.none():N.some(u))))},TT=function(t,e,n){var r=t.element;return wt(nn(r,"position"),"fixed")?function(t,e,n){return OT(t,n).filter((function(t){return kT(n.getModes(),t,e)})).bind((function(e){return ET(t,e,n)}))}(r,e,n):_T(r,e,n)},MT=function(t,e,n){n.setDocked(!1),j(["left","right","top","bottom","position"],(function(e){return an(t.element,e)})),e.onUndocked(t)},DT=function(t,e,n,r){var o="fixed"===r.position;n.setDocked(o),Rc(t.element,r),(o?e.onDocked:e.onUndocked)(t)},zT=function(t,e,n,r,o){void 0===o&&(o=!1),e.contextual.each((function(e){e.lazyContext(t).each((function(i){var a=function(t,e){return t.y<e.bottom&&t.bottom>e.y}(i,r);a!==n.isVisible()&&(n.setVisible(a),o&&!a?(Pa(t.element,[e.fadeOutClass]),e.onHide(t)):(a?CT:ST)(t,e))}))}))},AT=function(t,e,n){var r=t.element;n.setDocked(!1),function(t,e){var n=t.element;return OT(n,e).bind((function(t){return ET(n,t,e)}))}(t,n).each((function(r){r.fold((function(){return MT(t,e,n)}),(function(r){return DT(t,e,n,r)}),g)})),n.setVisible(!0),e.contextual.each((function(e){Ua(r,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(t)})),NT(t,e,n)},NT=function(t,e,n){t.getSystem().isConnected()&&function(t,e,n){var r=e.lazyViewport(t);n.isDocked()&&zT(t,e,n,r),TT(t,r,n).each((function(o){o.fold((function(){return MT(t,e,n)}),(function(r){return DT(t,e,n,r)}),(function(o){zT(t,e,n,r,!0),DT(t,e,n,o)}))}))}(t,e,n)},BT=function(t,e,n){n.isDocked()&&AT(t,e,n)},RT=Object.freeze({__proto__:null,refresh:NT,reset:BT,isDocked:function(t,e,n){return n.isDocked()},getModes:function(t,e,n){return n.getModes()},setModes:function(t,e,n,r){return n.setModes(r)}}),HT=Object.freeze({__proto__:null,events:function(t,e){return Ri([qi(Zo(),(function(n,r){t.contextual.each((function(t){Fa(n.element,t.transitionClass)&&(Ua(n.element,[t.transitionClass,t.fadeInClass]),(e.isVisible()?t.onShown:t.onHidden)(n));r.stop()}))})),Ii(vi(),(function(n,r){NT(n,t,e)})),Ii(bi(),(function(n,r){BT(n,t,e)}))])}}),VT=[lo("contextual",[Qr("fadeInClass"),Qr("fadeOutClass"),Qr("transitionClass"),to("lazyContext"),_u("onShow"),_u("onShown"),_u("onHide"),_u("onHidden")]),bo("lazyViewport",Pn),yo("modes",["top","bottom"],Ar),_u("onDocked"),_u("onUndocked")],IT=Cc({fields:VT,name:"docking",active:HT,apis:RT,state:Object.freeze({__proto__:null,init:function(t){var e=wo(!1),n=wo(!0),r=Zc(),o=wo(t.modes);return wa({isDocked:e.get,setDocked:e.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:function(){return"docked: "+e.get()+", visible: "+n.get()+", modes: "+o.get().join(",")}})}})}),LT=p(oa("toolbar-height-change")),FT={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},PT="tox-tinymce--toolbar-sticky-on",UT="tox-tinymce--toolbar-sticky-off",jT=function(t,e){return I(IT.getModes(t),e)},WT=function(t){var e=t.element;Oe(e).each((function(n){var r="padding-"+IT.getModes(t)[0];if(IT.isDocked(t)){var o=bn(n);Je(e,"width",o+"px"),Je(n,r,function(t){return fn(t)+(parseInt(tn(t,"margin-top"),10)||0)+(parseInt(tn(t,"margin-bottom"),10)||0)}(e)+"px")}else an(e,"width"),an(n,r)}))},qT=function(t,e){e?(La(t,FT.fadeOutClass),Pa(t,[FT.transitionClass,FT.fadeInClass])):(La(t,FT.fadeInClass),Pa(t,[FT.fadeOutClass,FT.transitionClass]))},GT=function(t,e){var n=Nt.fromDom(t.getContainer());e?(Va(n,PT),La(n,UT)):(Va(n,UT),La(n,PT))},$T=function(t,e){var n=Zc(),r=e.getSink,o=function(t){r().each((function(e){return t(e.element)}))},i=function(e){t.inline||WT(e),GT(t,IT.isDocked(e)),e.getSystem().broadcastOn([sf()],{}),r().each((function(t){return t.getSystem().broadcastOn([sf()],{})}))},a=t.inline?[]:function(){var t;return[Ec.config({channels:(t={},t[LT()]={onReceive:WT},t)})]}();return _([gh.config({}),IT.config({contextual:O({lazyContext:function(e){var n=fn(e.element),r=t.inline?t.getContentAreaContainer():t.getContainer(),o=Ln(Nt.fromDom(r)),i=o.height-n,a=o.y+(jT(e,"top")?0:n);return N.some(In(o.x,a,o.width,i))},onShow:function(){o((function(t){return qT(t,!0)}))},onShown:function(t){o((function(t){return Ua(t,[FT.transitionClass,FT.fadeInClass])})),n.get().each((function(e){var r,o,i;r=t.element,i=we(o=e),zc(i).filter((function(t){return!be(o,t)})).filter((function(t){return be(t,Nt.fromDom(i.dom.body))||xe(r,t)})).each((function(){return Mc(o)})),n.clear()}))},onHide:function(t){(function(t,e){return Ac(t).orThunk((function(){return e().toOptional().bind((function(t){return Ac(t.element)}))}))})(t.element,r).fold(n.clear,n.set),o((function(t){return qT(t,!1)}))},onHidden:function(){o((function(t){return Ua(t,[FT.transitionClass])}))}},FT),lazyViewport:function(e){var n=Pn(),r=function(t){return t.getParam("toolbar_sticky_offset",0,"number")}(t),o=n.y+(jT(e,"top")?r:0),i=n.height-(jT(e,"bottom")?r:0);return In(n.x,o,n.width,i)},modes:[e.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},XT=Object.freeze({__proto__:null,setup:function(t,e,n){t.inline||(e.header.isPositionedAtTop()||t.on("ResizeEditor",(function(){n().each(IT.reset)})),t.on("ResizeWindow ResizeEditor",(function(){n().each(WT)})),t.on("SkinLoaded",(function(){n().each((function(t){IT.isDocked(t)?IT.reset(t):IT.refresh(t)}))})),t.on("FullscreenStateChanged",(function(){n().each(IT.reset)}))),t.on("AfterScrollIntoView",(function(t){n().each((function(e){IT.refresh(e);var n=e.element;Ym(n)&&function(t,e){var n=we(e),r=n.dom.defaultView.innerHeight,o=zn(n),i=Nt.fromDom(t.elm),a=Fn(i),u=ln(i),c=a.y,s=c+u,l=hn(e),f=ln(e),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,h=Math.abs(m-(o.top+r))<2;if(g&&c<m)An(o.left,c-f,n);else if(h&&s>d){var p=c-r+u+f;An(o.left,p,n)}}(t,n)}))})),t.on("PostRender",(function(){GT(t,!1)}))},isDocked:function(t){return t().map(IT.isDocked).getOr(!1)},getBehaviours:$T}),KT=kr([Qr("type"),Yr("items",Er([Tr([Qr("name"),ro("items",Ar)]),Ar]))].concat(ev)),YT=[uo("text"),uo("tooltip"),uo("icon"),to("fetch"),bo("onSetup",(function(){return g}))],JT=kr(_([Qr("type")],YT,!0)),QT=function(t){return Pr("menubutton",JT,t)},ZT=kr([Qr("type"),uo("tooltip"),uo("icon"),uo("text"),co("select"),to("fetch"),bo("onSetup",(function(){return g})),po("presets","normal",["normal","color","listpreview"]),fo("columns",1),to("onAction"),to("onItemAction")]),tM=zd({factory:function(t,e){var n={focus:nh.focusIn,setMenus:function(t,n){var r=U(n,(function(t){var n={type:"menubutton",text:t.text,fetch:function(e){e(t.getItems())}},r=QT(n).mapError((function(t){return Wr(t)})).getOrDie();return WO(r,"tox-mbtn",e.backstage,N.some("menuitem"))}));ch.set(t,r)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:xc([ch.config({}),sh("menubar-events",[Gi((function(e){t.onSetup(e)})),Ii(Wo(),(function(t,e){su(t.element,".tox-mbtn--active").each((function(n){lu(e.event.target,".tox-mbtn").each((function(e){be(n,e)||t.getSystem().getByDom(n).each((function(n){t.getSystem().getByDom(e).each((function(t){sC.expand(t),sC.close(n),gh.focus(t)}))}))}))}))})),Ii(Si(),(function(t,e){e.event.prevFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(n){e.event.newFocus.bind((function(e){return t.getSystem().getByDom(e).toOptional()})).each((function(t){sC.isOpen(n)&&(sC.expand(t),sC.close(n))}))}))}))]),nh.config({mode:"flow",selector:".tox-mbtn",onEscape:function(e){return t.onEscape(e),N.some(!0)}}),ew.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Kr("dom"),Kr("uid"),Kr("onEscape"),Kr("backstage"),fo("onSetup",g)],apis:{focus:function(t,e){t.focus(e)},setMenus:function(t,e,n){t.setMenus(e,n)}}}),eM=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},nM=function(t){return t.dimension.property},rM=function(t,e){return t.dimension.getDimension(e)},oM=function(t,e){var n=eM(t,e);Ua(n,[e.shrinkingClass,e.growingClass])},iM=function(t,e){La(t.element,e.openClass),Va(t.element,e.closedClass),Je(t.element,nM(e),"0px"),un(t.element)},aM=function(t,e){La(t.element,e.closedClass),Va(t.element,e.openClass),an(t.element,nM(e))},uM=function(t,e,n,r){n.setCollapsed(),Je(t.element,nM(e),rM(e,t.element)),un(t.element),oM(t,e),iM(t,e),e.onStartShrink(t),e.onShrunk(t)},cM=function(t,e,n,r){var o=r.getOrThunk((function(){return rM(e,t.element)}));n.setCollapsed(),Je(t.element,nM(e),o),un(t.element);var i=eM(t,e);La(i,e.growingClass),Va(i,e.shrinkingClass),iM(t,e),e.onStartShrink(t)},sM=function(t,e,n){var r=rM(e,t.element);("0px"===r?uM:cM)(t,e,n,N.some(r))},lM=function(t,e,n){var r=eM(t,e),o=Fa(r,e.shrinkingClass),i=rM(e,t.element);aM(t,e);var a=rM(e,t.element);(o?function(){Je(t.element,nM(e),i),un(t.element)}:function(){iM(t,e)})(),La(r,e.shrinkingClass),Va(r,e.growingClass),aM(t,e),Je(t.element,nM(e),a),n.setExpanded(),e.onStartGrow(t)},fM=function(t,e,n){var r=eM(t,e);return!0===Fa(r,e.growingClass)},dM=function(t,e,n){var r=eM(t,e);return!0===Fa(r,e.shrinkingClass)},mM=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){an(t.element,nM(e));var r=rM(e,t.element);Je(t.element,nM(e),r)}},grow:function(t,e,n){n.isExpanded()||lM(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&sM(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&uM(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:fM,isShrinking:dM,isTransitioning:function(t,e,n){return fM(t,e)||dM(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?sM:lM)(t,e,n)},disableTransitions:oM}),gM=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return Sa(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Oo(e.dimension.property,"0px")})},events:function(t,e){return Ri([qi(Zo(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(oM(n,t),e.isExpanded()&&an(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),hM=[Kr("closedClass"),Kr("openClass"),Kr("shrinkingClass"),Kr("growingClass"),oo("getAnimationRoot"),_u("onShrunk"),_u("onStartShrink"),_u("onGrown"),_u("onStartGrow"),fo("expanded",!1),Yr("dimension",qr("property",{width:[zu("property","width"),zu("getDimension",(function(t){return bn(t)+"px"}))],height:[zu("property","height"),zu("getDimension",(function(t){return ln(t)+"px"}))]}))],pM=Cc({fields:hM,name:"sliding",active:gM,apis:mM,state:Object.freeze({__proto__:null,init:function(t){var e=wo(t.expanded);return wa({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:y(e.set,!1),setExpanded:y(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),vM="container",bM=[Tf("slotBehaviours",[])],yM=function(t){return"<alloy.field."+t+">"},xM=function(t,e){var n,r=function(e){return wd(t)},o=function(e,n){return function(r,o){return vd(r,t,o).map((function(t){return e(t,o)})).getOr(n)}},i=function(t,e){return"true"!==qe(t.element,"aria-hidden")},a=o(i,!1),u=o((function(t,e){if(i(t)){var n=t.element;Je(n,"display","none"),je(n,"aria-hidden","true"),Di(t,ki(),{name:e,visible:!1})}})),c=(n=u,function(t,e){j(e,(function(e){return n(t,e)}))}),s=o((function(t,e){if(!i(t)){var n=t.element;an(n,"display"),Xe(n,"aria-hidden"),Di(t,ki(),{name:e,visible:!0})}})),l={getSlotNames:r,getSlot:function(e,n){return vd(e,t,n)},isShowing:a,hideSlot:u,hideAllSlots:function(t){return c(t,r())},showSlot:s};return{uid:t.uid,dom:t.dom,components:e,behaviours:Mf(t.slotBehaviours),apis:l}},wM=dt({getSlotNames:function(t,e){return t.getSlotNames(e)},getSlot:function(t,e,n){return t.getSlot(e,n)},isShowing:function(t,e,n){return t.isShowing(e,n)},hideSlot:function(t,e,n){return t.hideSlot(e,n)},hideAllSlots:function(t,e){return t.hideAllSlots(e)},showSlot:function(t,e,n){return t.showSlot(e,n)}},(function(t){return ya(t)})),CM=O(O({},wM),{sketch:function(t){var e=function(){var t=[];return{slot:function(e,n){return t.push(e),dd(vM,yM(e),n)},record:p(t)}}(),n=t(e),r=e.record(),o=U(r,(function(t){return rd({name:t,pname:yM(t)})}));return _d(vM,bM,o,xM,n)}}),SM=kr([uo("icon"),uo("tooltip"),bo("onShow",g),bo("onHide",g),bo("onSetup",(function(){return g}))]),kM=function(t){return{element:function(){return t.element.dom}}},OM=function(t,e){var n=U(st(e),(function(t){var n=e[t],r=Ur(function(t){return Pr("sidebar",SM,t)}(n));return{name:t,getApi:kM,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return U(n,(function(e){var r=wo(g);return t.slot(e.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:ub([Zb(e,r),ty(e,r),Ii(ki(),(function(t,e){var r=e.event,o=X(n,(function(t){return t.name===r.name}));o.each((function(e){(r.visible?e.onShow:e.onHide)(e.getApi(t))}))}))])})}))},EM=function(t){return CM.sketch((function(e){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:OM(e,t),slotBehaviours:ub([Gi((function(t){return CM.hideAllSlots(t)}))])}}))},_M=function(t){return Hd.getCurrent(t).bind((function(t){return pM.isGrowing(t)||pM.hasGrown(t)?Hd.getCurrent(t).bind((function(t){return X(CM.getSlotNames(t),(function(e){return CM.isShowing(t,e)}))})):N.none()}))},TM=oa("FixSizeEvent"),MM=oa("AutoSizeEvent"),DM=Object.freeze({__proto__:null,block:function(t,e,n,r){je(t.element,"aria-busy",!0);var o=e.getRoot(t).getOr(t),i=xc([nh.config({mode:"special",onTab:function(){return N.some(!0)},onShiftTab:function(){return N.some(!0)}}),gh.config({})]),a=r(o,i),u=o.getSystem().build(a);ch.append(o,eu(u)),u.hasConfigured(nh)&&e.focus&&nh.focusIn(u),n.isBlocked()||e.onBlock(t),n.blockWith((function(){return ch.remove(o,u)}))},unblock:function(t,e,n){Xe(t.element,"aria-busy"),n.isBlocked()&&e.onUnblock(t),n.clear()}}),zM=[bo("getRoot",N.none),vo("focus",!0),_u("onBlock"),_u("onUnblock")],AM=Cc({fields:zM,name:"blocking",apis:DM,state:Object.freeze({__proto__:null,init:function(){var t=Jc();return wa({readState:t.isSet,blockWith:function(e){t.set({destroy:e})},clear:t.clear,isBlocked:t.isSet})}})}),NM=function(t){var e=Nt.fromHtml(t),n=_e(e),r=function(t){var e=void 0!==t.dom.attributes?t.dom.attributes:[];return $(e,(function(t,e){var n;return"class"===e.name?t:O(O({},t),((n={})[e.name]=e.value,n))}),{})}(e),o=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(e),i=0===n.length?{}:{innerHtml:Yi(e)};return O({tag:Rt(e),classes:o,attributes:r},i)},BM=function(t){return Hd.getCurrent(t).each((function(t){return Mc(t.element)}))},RM=function(t,e,n,r){var o=e.element;if(function(t,e){var n="tabindex",r="data-mce-"+n;N.from(t.iframeElement).map(Nt.fromDom).each((function(t){e?(Ge(t,n).each((function(e){return je(t,r,e)})),je(t,n,-1)):(Xe(t,n),Ge(t,r).each((function(e){je(t,n,e),Xe(t,r)})))}))}(t,n),n)AM.block(e,function(t){return function(e,n){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:NM('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(r)),an(o,"display"),Xe(o,"aria-hidden"),t.hasFocus()&&BM(e);else{var i=Hd.getCurrent(e).exists((function(t){return Dc(t.element)}));AM.unblock(e),Je(o,"display","none"),je(o,"aria-hidden","true"),i&&t.focus()}},HM=function(t,e,n){var r=wo(!1),o=Zc(),i=function(n){var o;!r.get()||function(t){return"focusin"===t.type}(o=n)&&(o.composed?it(o.composedPath()):N.from(o.target)).map(Nt.fromDom).filter(Vt).exists((function(t){return Fa(t,"mce-pastebin")}))||(n.preventDefault(),BM(e()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",(function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",(function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)}))}));var a=function(o){o!==r.get()&&(r.set(o),RM(t,e(),o,n.providers),t.fire("AfterProgressState",{state:o}))};t.on("ProgressState",(function(e){if(o.on(vp.clearTimeout),d(e.time)){var n=vp.setEditorTimeout(t,(function(){return a(e.state)}),e.time);o.set(n)}else a(e.state),o.clear()}))},VM=function(t,e,n){return{within:t,extra:e,withinWidth:n}},IM=function(t,e,n){var r=function(t,e){var n=$(t,(function(t,n){return e(n,t.len).fold(p(t),(function(e){return{len:e.finish,list:t.list.concat([e])}}))}),{len:0,list:[]});return n.list}(t,(function(t,e){var r=n(t);return N.some({element:t,start:e,finish:e+r,width:r})})),o=q(r,(function(t){return t.finish<=e})),i=G(o,(function(t,e){return t+e.width}),0);return{within:o,extra:r.slice(o.length),withinWidth:i}},LM=function(t){return U(t,(function(t){return t.element}))},FM=function(t,e,n,r){var o=function(t,e,n){var r=IM(e,t,n);return 0===r.extra.length?N.some(r):N.none()}(t,e,n).getOrThunk((function(){return IM(e,t-n(r),n)})),i=o.within,a=o.extra,u=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?function(t,e,n){var r=LM(t.concat(e));return VM(r,[],n)}(i,a,u):a.length>=1?function(t,e,n,r){var o=LM(t).concat([n]);return VM(o,LM(e),r)}(i,a,r,u):function(t,e,n){return VM(LM(t),[],n)}(i,0,u)},PM=function(t,e){var n=U(e,(function(t){return eu(t)}));gT.setGroups(t,n)},UM=function(t,e,n){var r=e.builtGroups.get();if(0!==r.length){var o=bd(t,e,"primary"),i=qw.getCoupled(t,"overflowGroup");Je(o.element,"visibility","hidden");var a=r.concat([i]),u=ct(a,(function(t){return Ac(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}));n([]),PM(o,a);var c=bn(o.element),s=FM(c,e.builtGroups.get(),(function(t){return bn(t.element)}),i);0===s.extra.length?(ch.remove(o,i),n([])):(PM(o,s.within),n(s.extra)),an(o.element,"visibility"),un(o.element),u.each(gh.focus)}},jM=p([Tf("splitToolbarBehaviours",[qw]),$r("builtGroups",(function(){return wo([])}))]),WM=p([Ou(["overflowToggledClass"]),co("getOverflowBounds"),Kr("lazySink"),$r("overflowGroups",(function(){return wo([])}))].concat(jM())),qM=p([rd({factory:gT,schema:dT(),name:"primary"}),od({schema:dT(),name:"overflow"}),od({name:"overflow-button"}),od({name:"overflow-group"})]),GM=p((function(t,e){!function(t,e){var n=vn.max(t,e,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Je(t,"max-width",n+"px")}(t,Math.floor(e))})),$M=p([Ou(["toggledClass"]),Kr("lazySink"),to("fetch"),co("getBounds"),lo("fireDismissalEventInstead",[fo("event",wi())]),Os()]),XM=p([od({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:xc([Eh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),od({factory:gT,schema:dT(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:xc([nh.config({mode:"cyclic",onEscape:function(e){return vd(e,t,"button").each(gh.focus),N.none()}})])}}})]),KM=function(t,e){var n=qw.getCoupled(t,"toolbarSandbox");uf.isOpen(n)?uf.close(n):uf.open(n,e.toolbar())},YM=function(t,e,n,r){var o=n.getBounds.map((function(t){return t()})),i=n.lazySink(t).getOrDie();Vl.positionWithinBounds(i,e,{anchor:{type:"hotspot",hotspot:t,layouts:r,overrides:{maxWidthFunction:GM()}}},o)},JM=function(t,e,n,r,o){gT.setGroups(e,o),YM(t,e,n,r),Eh.on(t)},QM=Ad({name:"FloatingToolbarButton",factory:function(t,e,n,r){return O(O({},bp.sketch(O(O({},r.button()),{action:function(t){KM(t,r)},buttonBehaviours:Af({dump:r.button().buttonBehaviours},[qw.config({others:{toolbarSandbox:function(e){return function(t,e,n){var r=fu();return{dom:{tag:"div",attributes:{id:r.id}},behaviours:xc([nh.config({mode:"special",onEscape:function(t){return uf.close(t),N.some(!0)}}),uf.config({onOpen:function(o,i){n.fetch().get((function(o){JM(t,i,n,e.layouts,o),r.link(t.element),nh.focusIn(i)}))},onClose:function(){Eh.off(t),gh.focus(t),r.unlink(t.element)},isPartOf:function(e,n,r){return mu(n,r)||mu(t,r)},getAttachPoint:function(){return n.lazySink(t).getOrDie()}}),Ec.config({channels:O(O({},df(O({isExtraPart:C},n.fireDismissalEventInstead.map((function(t){return{fireEventInstead:{event:t.event}}})).getOr({})))),gf({doReposition:function(){uf.getState(qw.getCoupled(t,"toolbarSandbox")).each((function(r){YM(t,r,n,e.layouts)}))}}))})])}}(e,n,t)}}})])}))),{apis:{setGroups:function(e,r){uf.getState(qw.getCoupled(e,"toolbarSandbox")).each((function(o){JM(e,o,t,n.layouts,r)}))},reposition:function(e){uf.getState(qw.getCoupled(e,"toolbarSandbox")).each((function(r){YM(e,r,t,n.layouts)}))},toggle:function(t){KM(t,r)},getToolbar:function(t){return uf.getState(qw.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return uf.isOpen(qw.getCoupled(t,"toolbarSandbox"))}}})},configFields:$M(),partFields:XM(),apis:{setGroups:function(t,e,n){t.setGroups(e,n)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},getToolbar:function(t,e){return t.getToolbar(e)},isOpen:function(t,e){return t.isOpen(e)}}}),ZM=p([Kr("items"),Ou(["itemSelector"]),Tf("tgroupBehaviours",[nh])]),tD=p([ad({name:"items",unit:"item"})]),eD=Ad({name:"ToolbarGroup",configFields:ZM(),partFields:tD(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:Df(t.tgroupBehaviours,[nh.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),nD=function(t){return U(t,(function(t){return eu(t)}))},rD=function(t,e,n){UM(t,n,(function(r){n.overflowGroups.set(r),e.getOpt(t).each((function(t){QM.setGroups(t,nD(r))}))}))},oD=Ad({name:"SplitFloatingToolbar",configFields:WM(),partFields:qM(),factory:function(t,e,n,r){var o=yp(QM.sketch({fetch:function(){return Dw((function(e){e(nD(t.overflowGroups.get()))}))},layouts:{onLtr:function(){return[ec,tc]},onRtl:function(){return[tc,ec]},onBottomLtr:function(){return[rc,nc]},onBottomRtl:function(){return[nc,rc]}},getBounds:n.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:t.uid,dom:t.dom,components:e,behaviours:Df(t.splitToolbarBehaviours,[qw.config({others:{overflowGroup:function(){return eD.sketch(O(O({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(e,n){t.builtGroups.set(U(n,e.getSystem().build)),rD(e,o,t)},refresh:function(e){return rD(e,o,t)},toggle:function(t){o.getOpt(t).each((function(t){QM.toggle(t)}))},isOpen:function(t){return o.getOpt(t).map(QM.isOpen).getOr(!1)},reposition:function(t){o.getOpt(t).each((function(t){QM.reposition(t)}))},getOverflow:function(t){return o.getOpt(t).bind(QM.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},reposition:function(t,e){t.reposition(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)},getOverflow:function(t,e){return t.getOverflow(e)}}}),iD=p([Ou(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),_u("onOpened"),_u("onClosed")].concat(jM())),aD=p([rd({factory:gT,schema:dT(),name:"primary"}),rd({factory:gT,schema:dT(),name:"overflow",overrides:function(t){return{toolbarBehaviours:xc([pM.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(e){vd(e,t,"overflow-button").each((function(t){Eh.off(t),gh.focus(t)})),t.onClosed(e)},onGrown:function(e){nh.focusIn(e),t.onOpened(e)},onStartGrow:function(e){vd(e,t,"overflow-button").each(Eh.on)}}),nh.config({mode:"acyclic",onEscape:function(e){return vd(e,t,"overflow-button").each(gh.focus),N.some(!0)}})])}}}),od({name:"overflow-button",overrides:function(t){return{buttonBehaviours:xc([Eh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),od({name:"overflow-group"})]),uD=function(t,e){vd(t,e,"overflow-button").bind((function(){return vd(t,e,"overflow")})).each((function(n){cD(t,e),pM.toggleGrow(n)}))},cD=function(t,e){vd(t,e,"overflow").each((function(n){UM(t,e,(function(t){var e=U(t,(function(t){return eu(t)}));gT.setGroups(n,e)})),vd(t,e,"overflow-button").each((function(t){pM.hasGrown(n)&&Eh.on(t)})),pM.refresh(n)}))},sD=Ad({name:"SplitSlidingToolbar",configFields:iD(),partFields:aD(),factory:function(t,e,n,r){var o="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:e,behaviours:Df(t.splitToolbarBehaviours,[qw.config({others:{overflowGroup:function(t){return eD.sketch(O(O({},r["overflow-group"]()),{items:[bp.sketch(O(O({},r["overflow-button"]()),{action:function(e){Mi(t,o)}}))]}))}}}),sh("toolbar-toggle-events",[Ii(o,(function(e){uD(e,t)}))])]),apis:{setGroups:function(e,n){!function(e,n){var r=U(n,e.getSystem().build);t.builtGroups.set(r)}(e,n),cD(e,t)},refresh:function(e){return cD(e,t)},toggle:function(e){return uD(e,t)},isOpen:function(e){return function(t,e){return vd(t,e,"overflow").map(pM.hasGrown).getOr(!1)}(e,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)},refresh:function(t,e){t.refresh(e)},toggle:function(t,e){t.toggle(e)},isOpen:function(t,e){return t.isOpen(e)}}}),lD=function(t){var e=t.title.fold((function(){return{}}),(function(t){return{attributes:{title:t}}}));return{dom:O({tag:"div",classes:["tox-toolbar__group"]},e),components:[eD.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:xc([ew.config({}),gh.config({})])}},fD=function(t){return eD.sketch(lD(t))},dD=function(t,e){var n=Gi((function(e){var n=U(t.initGroups,fD);gT.setGroups(e,n)}));return xc([Jb(t.providers.isDisabled),$b(),nh.config({mode:e,onEscape:t.onEscape,selector:".tox-toolbar__group"}),sh("toolbar-events",[n])])},mD=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":lD({title:N.none(),items:[]}),"overflow-button":$O({name:"more",icon:N.some("more-drawer"),disabled:!1,tooltip:N.some("More..."),primary:!1,borderless:!1},N.none(),t.providers)},splitToolbarBehaviours:dD(t,e)}},gD=function(t){var e=mD(t),n=oD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return oD.sketch(O(O({},e),{lazySink:t.getSink,getOverflowBounds:function(){var e=t.moreDrawerData.lazyHeader().element,n=Fn(e),r=Se(e),o=Fn(r),i=Math.max(r.dom.scrollHeight,o.height);return In(n.x+4,o.y,n.width-8,i)},parts:O(O({},e.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},hD=function(t){var e=sD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=sD.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=mD(t);return sD.sketch(O(O({},r),{components:[e,n],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:function(t){t.getSystem().broadcastOn([LT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([LT()],{type:"closed"})}}))},pD=function(t){var e=t.cyclicKeying?"cyclic":"acyclic";return gT.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===pv.scrolling?["tox-toolbar--scrolling"]:[])},components:[gT.parts.groups({})],toolbarBehaviours:dD(t,e)})},vD=aT.optional({factory:tM,name:"menubar",schema:[Kr("backstage")]}),bD=aT.optional({factory:{sketch:function(t){return fT.sketch({uid:t.uid,dom:t.dom,listBehaviours:xc([nh.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return pD({type:t.type,uid:oa("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),N.some(!0)}})},setupItem:function(t,e,n,r){gT.setGroups(e,n)},shell:!0})}},name:"multiple-toolbar",schema:[Kr("dom"),Kr("onEscape")]}),yD=aT.optional({factory:{sketch:function(t){var e=function(t){return t.type===pv.sliding?hD:t.type===pv.floating?gD:pD}(t);return e({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),N.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Kr("dom"),Kr("onEscape"),Kr("getSink")]}),xD=aT.optional({factory:{sketch:function(t){var e=t.editor,n=t.sticky?$T:vT;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:xc(n(e,t.sharedBackstage))}}},name:"header",schema:[Kr("dom")]}),wD=aT.optional({name:"socket",schema:[Kr("dom")]}),CD=aT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:xc([ew.config({}),gh.config({}),pM.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:function(t){Hd.getCurrent(t).each(CM.hideAllSlots),Mi(t,MM)},onGrown:function(t){Mi(t,MM)},onStartGrow:function(t){Di(t,TM,{width:nn(t.element,"width").getOr("")})},onStartShrink:function(t){Di(t,TM,{width:bn(t.element)+"px"})}}),ch.config({}),Hd.config({find:function(t){var e=ch.contents(t);return it(e)}})])}],behaviours:xc([yk(0),sh("sidebar-sliding-events",[Ii(TM,(function(t,e){Je(t.element,"width",e.event.width)})),Ii(MM,(function(t,e){an(t.element,"width")}))])])}}},name:"sidebar",schema:[Kr("dom")]}),SD=aT.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:xc([ch.config({}),AM.config({focus:!1}),Hd.config({find:function(t){return it(t.components())}})]),components:[]}}},name:"throbber",schema:[Kr("dom")]}),kD=Ad({name:"OuterContainer",factory:function(t,e,n){var r={getSocket:function(e){return iT.getPart(e,t,"socket")},setSidebar:function(e,n){iT.getPart(e,t,"sidebar").each((function(t){return function(t,e){Hd.getCurrent(t).each((function(t){return ch.set(t,[EM(e)])}))}(t,n)}))},toggleSidebar:function(e,n){iT.getPart(e,t,"sidebar").each((function(t){return function(t,e){Hd.getCurrent(t).each((function(t){Hd.getCurrent(t).each((function(n){pM.hasGrown(t)?CM.isShowing(n,e)?pM.shrink(t):(CM.hideAllSlots(n),CM.showSlot(n,e)):(CM.hideAllSlots(n),CM.showSlot(n,e),pM.grow(t))}))}))}(t,n)}))},whichSidebar:function(e){return iT.getPart(e,t,"sidebar").bind(_M).getOrNull()},getHeader:function(e){return iT.getPart(e,t,"header")},getToolbar:function(e){return iT.getPart(e,t,"toolbar")},setToolbar:function(e,n){iT.getPart(e,t,"toolbar").each((function(t){t.getApis().setGroups(t,n)}))},setToolbars:function(e,n){iT.getPart(e,t,"multiple-toolbar").each((function(t){fT.setItems(t,n)}))},refreshToolbar:function(e){iT.getPart(e,t,"toolbar").each((function(t){return t.getApis().refresh(t)}))},toggleToolbarDrawer:function(e){iT.getPart(e,t,"toolbar").each((function(t){var e,n;e=t.getApis().toggle,n=function(e){return e(t)},null!=e?N.some(n(e)):N.none()}))},isToolbarDrawerToggled:function(e){return iT.getPart(e,t,"toolbar").bind((function(t){return N.from(t.getApis().isOpen).map((function(e){return e(t)}))})).getOr(!1)},getThrobber:function(e){return iT.getPart(e,t,"throbber")},focusToolbar:function(e){iT.getPart(e,t,"toolbar").orThunk((function(){return iT.getPart(e,t,"multiple-toolbar")})).each((function(t){nh.focusIn(t)}))},setMenubar:function(e,n){iT.getPart(e,t,"menubar").each((function(t){tM.setMenus(t,n)}))},focusMenubar:function(e){iT.getPart(e,t,"menubar").each((function(t){tM.focus(t)}))}};return{uid:t.uid,dom:t.dom,components:e,apis:r,behaviours:t.behaviours}},configFields:[Kr("dom"),Kr("behaviours")],partFields:[xD,vD,yD,bD,wD,CD,SD],apis:{getSocket:function(t,e){return t.getSocket(e)},setSidebar:function(t,e,n){t.setSidebar(e,n)},toggleSidebar:function(t,e,n){t.toggleSidebar(e,n)},whichSidebar:function(t,e){return t.whichSidebar(e)},getHeader:function(t,e){return t.getHeader(e)},getToolbar:function(t,e){return t.getToolbar(e)},setToolbar:function(t,e,n){var r=U(n,(function(t){return fD(t)}));t.setToolbar(e,r)},setToolbars:function(t,e,n){var r=U(n,(function(t){return U(t,fD)}));t.setToolbars(e,r)},refreshToolbar:function(t,e){return t.refreshToolbar(e)},toggleToolbarDrawer:function(t,e){t.toggleToolbarDrawer(e)},isToolbarDrawerToggled:function(t,e){return t.isToolbarDrawerToggled(e)},getThrobber:function(t,e){return t.getThrobber(e)},setMenubar:function(t,e,n){t.setMenubar(e,n)},focusMenubar:function(t,e){t.focusMenubar(e)},focusToolbar:function(t,e){t.focusToolbar(e)}}}),OD={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},ED=function(t){return"string"==typeof t?t.split(" "):t},_D=function(t,e){var n=O(O({},OD),e.menus),r=st(e.menus).length>0,o=void 0===e.menubar||!0===e.menubar?ED("file edit view insert format tools table help"):ED(!1===e.menubar?"":e.menubar),i=q(o,(function(t){var n=yt(OD,t);return r?n||bt(e.menus,t).exists((function(t){return yt(t,"items")})):n})),a=U(i,(function(r){var o=n[r];return function(t,e,n){var r=function(t){return t.getParam("removed_menuitems","")}(n).split(/[ ,]/);return{text:t.title,getItems:function(){return J(t.items,(function(t){var n=t.toLowerCase();return 0===n.trim().length||L(r,(function(t){return t===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]}))}}}({title:o.title,items:ED(o.items)},e,t)}));return q(a,(function(t){return t.getItems().length>0&&L(t.getItems(),(function(t){return"separator"!==t.type}))}))},TD=function(t){var e=function(){t._skinLoaded=!0,function(t){t.fire("SkinLoaded")}(t)};return function(){t.initialized?e():t.on("init",e)}},MD=function(t,e,n){return new qp((function(r,o){n.load(e,r,o),t.on("remove",(function(){return n.unload(e)}))}))},DD=function(t,e){return MD(t,e+"/skin.min.css",t.ui.styleSheetLoader)},zD=function(t,e){var n;return(n=Nt.fromDom(t.getElement()),He(n).isSome())?MD(t,e+"/skin.shadowdom.min.css",pb.DOM.styleSheetLoader):qp.resolve()},AD=function(t,e){var n=function(t){var e=t.getParam("skin"),n=t.getParam("skin_url");if(!1!==e){var r=e||"oxide";n=n?t.documentBaseURI.toAbsolute(n):vb.baseURL+"/skins/ui/"+r}return n}(e);n&&e.contentCSS.push(n+(t?"/content.inline":"/content")+".min.css"),!1===function(t){return!1===t.getParam("skin")}(e)&&r(n)?qp.all([DD(e,n),zD(e,n)]).then(TD(e),function(t,e){return function(){return function(t,e){return t.fire("SkinLoadError",e)}(t,{message:e})}}(e,"Skin could not be loaded")):TD(e)()},ND=y(AD,!1),BD=y(AD,!0),RD=function(t,e){return function(n){var r=Qc(),o=function(){n.setActive(t.formatter.match(e));var o=t.formatter.formatChanged(e,n.setActive);r.set(o)};return t.initialized?o():t.once("init",o),function(){t.off("init",o),r.clear()}}},HD=function(t,e,n){return function(r){var o=function(){return n(r)},i=function(){n(r),t.on(e,o)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(e,o)}}},VD=function(t){return function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("mceToggleFormat",!1,e.format)}))}}},ID=function(t,e){return function(){return t.execCommand(e)}},LD=function(t,e,n){var r=function(t,r,i,a){var u=e.shared.providers.translate(t.title);if("separator"===t.type)return N.some({type:"separator",text:u});if("submenu"===t.type){var c=J(t.getStyleItems(),(function(t){return o(t,r,a)}));return 0===r&&c.length<=0?N.none():N.some({type:"nestedmenuitem",text:u,disabled:c.length<=0,getSubmenuItems:function(){return J(t.getStyleItems(),(function(t){return o(t,r,a)}))}})}return N.some(O({type:"togglemenuitem",text:u,icon:t.icon,active:t.isSelected(a),disabled:i,onAction:n.onAction(t)},t.getStylePreview().fold((function(){return{}}),(function(t){return{meta:{style:t}}}))))},o=function(t,e,o){var i="formatter"===t.type&&n.isInvalid(t);return 0===e?i?[]:r(t,e,!1,o).toArray():r(t,e,i,o).toArray()},i=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return J(t,(function(t){return o(t,r,e)}))};return{validateItems:i,getFetch:function(t,e){return function(n,r){var o=e(),a=i(o);r(UO(a,vv.CLOSE_ON_EXECUTE,t,!1))}}}},FD=function(t,e,n){var r=n.dataset,o="basic"===r.type?function(){return U(r.data,(function(t){return T_(t,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:LD(0,e,n),getStyleItems:o}},PD=function(t,e,n){var r=FD(0,e,n),o=r.items,i=r.getStyleItems,a=HD(t,"NodeChange",(function(t){var e=t.getComponent();n.updateText(e)}));return HO({text:n.icon.isSome()?N.none():n.text,icon:n.icon,tooltip:N.from(n.tooltip),role:N.none(),fetch:o.getFetch(e,i),onSetup:a,getApi:function(t){return{getComponent:p(t)}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",e.shared)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(OE||(OE={}));var UD,jD,WD,qD,GD,$D=function(t,e,n,r){var o=function(t){return U(t,(function(t){var e=t,n=t,r=t.split("=");return r.length>1&&(e=r[0],n=r[1]),{title:e,format:n}}))}(function(t,e){return e===OE.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.getParam(e,n,"string"),r));return{type:"basic",data:o}},XD=[{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"}],KD=function(t){var e={type:"basic",data:XD};return{tooltip:"Align",text:N.none(),icon:N.some("align-left"),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:N.none,getPreviewFor:function(t){return N.none},onAction:function(e){return function(){return X(XD,(function(t){return t.format===e.format})).each((function(e){return t.execCommand(e.command)}))}},updateText:function(e){var n=X(XD,(function(e){return t.formatter.match(e.format)})),r=n.fold(p("left"),(function(t){return t.title.toLowerCase()}));Di(e,RO,{icon:"align-"+r})},dataset:e,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},YD=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],JD=function(t){var e=t.split(/\s*,\s*/);return U(e,(function(t){return t.replace(/^['"]+|['"]+$/g,"")}))},QD=function(t){var e="System Font",n=function(){var n=function(t){return t?JD(t)[0]:""},o=t.queryCommandValue("FontName"),i=r.data,a=o?o.toLowerCase():"",u=X(i,(function(t){var e=t.format;return e.toLowerCase()===a||n(e).toLowerCase()===n(a).toLowerCase()})).orThunk((function(){return kt(function(t){var e;return 0===t.indexOf("-apple-system")&&(e=JD(t.toLowerCase()),Q(YD,(function(t){return e.indexOf(t.toLowerCase())>-1})))}(a),{title:e,format:a})}));return{matchOpt:u,font:o}},r=$D(t,"font_formats","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",OE.SemiColon);return{tooltip:"Fonts",text:N.some(e),icon:N.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return N.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontName",!1,e.format)}))}},updateText:function(t){var e=n(),r=e.matchOpt,o=e.font,i=r.fold(p(o),(function(t){return t.title}));Di(t,BO,{text:i})},dataset:r,shouldHide:!1,isInvalid:C}},ZD={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},tz={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},ez=function(t,e){return/[0-9.]+px$/.test(t)?function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}(72*parseInt(t,10)/96,e||0)+"pt":bt(tz,t).getOr(t)},nz=function(t){var e=function(){var e=N.none(),n=r.data,o=t.queryCommandValue("FontSize");if(o)for(var i=function(t){var r=ez(o,t),i=function(t){return bt(ZD,t).getOr("")}(r);e=X(n,(function(t){return t.format===o||t.format===r||t.format===i}))},a=3;e.isNone()&&a>=0;a--)i(a);return{matchOpt:e,size:o}},n=p(N.none),r=$D(t,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",OE.Space);return{tooltip:"Font sizes",text:N.some("12pt"),icon:N.none(),isSelectedFor:function(t){return function(e){return e.exists((function(e){return e.format===t}))}},getPreviewFor:n,getCurrentValue:function(){return e().matchOpt},onAction:function(e){return function(){t.undoManager.transact((function(){t.focus(),t.execCommand("FontSize",!1,e.format)}))}},updateText:function(t){var n=e(),r=n.matchOpt,o=n.size,i=r.fold(p(o),(function(t){return t.title}));Di(t,BO,{text:i})},dataset:r,shouldHide:!1,isInvalid:C}},rz=function(t,e){var n=e(),r=U(n,(function(t){return t.format}));return N.from(t.formatter.closest(r)).bind((function(t){return X(n,(function(e){return e.format===t}))})).orThunk((function(){return kt(t.formatter.match("p"),{title:"Paragraph",format:"p"})}))},oz=function(t){var e="Paragraph",n=$D(t,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",OE.SemiColon);return{tooltip:"Blocks",text:N.some(e),icon:N.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:N.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return N.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))})}},onAction:VD(t),updateText:function(r){var o=rz(t,(function(){return n.data})).fold(p(e),(function(t){return t.title}));Di(r,BO,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(e){return!t.formatter.canApply(e.format)}}},iz=function(t,e){var n="Paragraph";return{tooltip:"Formats",text:N.some(n),icon:N.none(),isSelectedFor:function(e){return function(){return t.formatter.match(e)}},getCurrentValue:N.none,getPreviewFor:function(e){return function(){var n=t.formatter.get(e);return void 0!==n?N.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(e))}):N.none()}},onAction:VD(t),updateText:function(e){var r=function(t){var e=t.items;return void 0!==e&&e.length>0?J(e,r):[{title:t.title,format:t.format}]},o=J(__(t),r),i=rz(t,p(o)).fold(p(n),(function(t){return t.title}));Di(e,BO,{text:i})},shouldHide:t.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(e){return!t.formatter.canApply(e.format)},dataset:e}},az=Object.freeze({__proto__:null,events:function(t,e){var n=function(n,r){t.updateState.each((function(t){var o=t(n,r);e.set(o)})),t.renderComponents.each((function(t){var o=t(r,e.get()),i=U(o,n.getSystem().build);Pl(n,i)}))};return Ri([Ii(ui(),(function(e,r){var o=r;if(!o.universal){var i=t.channel;I(o.channels,i)&&n(e,o.data)}})),Gi((function(e,r){t.initialData.each((function(t){n(e,t)}))}))])}}),uz=Object.freeze({__proto__:null,getState:function(t,e,n){return n}}),cz=[Kr("channel"),oo("renderComponents"),oo("updateState"),oo("initialData")],sz=Object.freeze({__proto__:null,init:function(){var t=wo(N.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(N.none())}}}}),lz=Cc({fields:cz,name:"reflecting",active:az,apis:uz,state:sz}),fz=p([Kr("toggleClass"),Kr("fetch"),Mu("onExecute"),fo("getHotspot",N.some),fo("getAnchorOverrides",p({})),Os(),Mu("onItemExecute"),oo("lazySink"),Kr("dom"),_u("onOpen"),Tf("splitDropdownBehaviours",[qw,nh,gh]),fo("matchWidth",!1),fo("useMinWidth",!1),fo("eventOrder",{}),oo("role")].concat(aC())),dz=rd({factory:bp,schema:[Kr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:xc([gh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each(zi)},buttonBehaviours:xc([Eh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),mz=rd({factory:bp,schema:[Kr("dom")],name:"button",defaults:function(){return{buttonBehaviours:xc([gh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(e){e.getSystem().getByUid(t.uid).each((function(n){t.onExecute(n,e)}))}}}}),gz=p([dz,mz,id({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Kr("text")],name:"aria-descriptor"}),od({schema:[ku()],name:"menu",defaults:function(t){return{onExecute:function(e,n){e.getSystem().getByUid(t.uid).each((function(r){t.onItemExecute(r,e,n)}))}}}}),$w()]),hz=Ad({name:"SplitDropdown",configFields:fz(),partFields:gz(),factory:function(t,e,n,r){var o,i=function(t){Hd.getCurrent(t).each((function(t){um.highlightFirst(t),nh.focusIn(t)}))},a=function(e){tC(t,v,e,r,i,kw.HighlightFirst).get(g)},u=function(e){var n=bd(e,t,"button");return zi(n),N.some(!0)},c=O(O({},Ri([Gi((function(e,n){vd(e,t,"aria-descriptor").each((function(t){var n=oa("aria");je(t.element,"id",n),je(e.element,"aria-describedby",n)}))}))])),Th(N.some(a))),s={repositionMenus:function(t){Eh.isOn(t)&&iC(t)}};return{uid:t.uid,dom:t.dom,components:e,apis:s,eventOrder:O(O({},t.eventOrder),(o={},o[ci()]=["disabling","toggling","alloy.base.behaviour"],o)),events:c,behaviours:Df(t.splitDropdownBehaviours,[qw.config({others:{sandbox:function(e){var n=bd(e,t,"arrow");return oC(t,e,{onOpen:function(){Eh.on(n),Eh.on(e)},onClose:function(){Eh.off(n),Eh.off(e)}})}}}),nh.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return a(t),N.some(!0)}}),gh.config({}),Eh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,e){return t.repositionMenus(e)}}}),pz=function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},vz=function(t){return{setActive:function(e){Eh.set(t,e)},isActive:function(){return Eh.isOn(t)},isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)}}},bz=function(t,e){return t.map((function(t){return{"aria-label":e.translate(t),title:e.translate(t)}})).getOr({})},yz=oa("focus-button"),xz=function(t,e,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:bz(n,i)},components:ry([t.map((function(t){return MO(t,i.icons)})),e.map((function(t){return zO(t,"tox-tbtn",i)}))]),eventOrder:(a={},a[Fo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:xc([Jb(i.isDisabled),$b(),sh("common-button-display-events",[Ii(Fo(),(function(t,e){e.event.prevent(),Mi(t,yz)}))])].concat(r.map((function(n){return lz.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(t,e){return ry([t.icon.map((function(t){return MO(t,i.icons)})),t.text.map((function(t){return zO(t,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},wz=function(t,e,n){var r,o=wo(g),i=xz(t.icon,t.text,t.tooltip,N.none(),N.none(),n);return bp.sketch({dom:i.dom,components:i.components,eventOrder:NO,buttonBehaviours:xc([sh("toolbar-button-events",[(r={onAction:t.onAction,getApi:e.getApi},Ki((function(t,e){Qb(r,t)((function(e){Di(t,AO,{buttonApi:e}),r.onAction(e)}))}))),Zb(e,o),ty(e,o)]),Jb((function(){return t.disabled||n.isDisabled()})),$b()].concat(e.toolbarButtonBehaviours))})},Cz=function(t,e,n){return wz(t,{toolbarButtonBehaviours:[].concat(n.length>0?[sh("toolbarButtonWith",n)]:[]),getApi:pz,onSetup:t.onSetup},e)},Sz=function(t,e,n){return ur(wz(t,{toolbarButtonBehaviours:[ch.config({}),Eh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[sh("toolbarToggleButtonWith",n)]:[]),getApi:vz,onSetup:t.onSetup},e))},kz=function(t,e,n){return function(r){return Dw((function(t){return e.fetch(t)})).map((function(o){return N.from(Ax(ur(dx(oa("menu-value"),o,(function(n){e.onItemAction(t(r),n)}),e.columns,e.presets,vv.CLOSE_ON_EXECUTE,e.select.getOr(C),n),{movement:gx(e.columns,e.presets),menuBehaviours:ub("auto"!==e.columns?[]:[Gi((function(t,n){ib(t,4,Mv(e.presets)).each((function(e){var n=e.numRows,r=e.numColumns;nh.setGridSize(t,n,r)}))}))])})))}))}},Oz=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{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"]}],Ez=function(t,e){return function(n,r,o){var i=t(n).mapError((function(t){return Wr(t)})).getOrDie();return e(i,r,o)}},_z={button:Ez(rv,(function(t,e){return n=t,r=e.backstage.shared.providers,Cz(n,r,[]);var n,r})),togglebutton:Ez(av,(function(t,e){return n=t,r=e.backstage.shared.providers,Sz(n,r,[]);var n,r})),menubutton:Ez(QT,(function(t,e){return WO(t,"tox-tbtn",e.backstage,N.none())})),splitbutton:Ez((function(t){return Pr("SplitButton",ZT,t)}),(function(t,e){return function(t,e){var n,r=oa("channel-update-split-dropdown-display"),o=function(t){return{isDisabled:function(){return Yd.isDisabled(t)},setDisabled:function(e){return Yd.set(t,e)},setIconFill:function(e,n){su(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){je(t,"fill",n)}))},setIconStroke:function(e,n){su(t.element,'svg path[id="'+e+'"], rect[id="'+e+'"]').each((function(t){je(t,"stroke",n)}))},setActive:function(e){je(t.element,"aria-pressed",e),su(t.element,"span").each((function(n){t.getSystem().getByDom(n).each((function(t){return Eh.set(t,e)}))}))},isActive:function(){return su(t.element,"span").exists((function(e){return t.getSystem().getByDom(e).exists(Eh.isOn)}))}}},i=wo(g),a={getApi:o,onSetup:t.onSetup};return hz.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:O({"aria-pressed":!1},bz(t.tooltip,e.providers))},onExecute:function(e){t.onAction(o(e))},onItemExecute:function(t,e,n){},splitDropdownBehaviours:xc([Yb(e.providers.isDisabled),$b(),sh("split-dropdown-events",[Ii(yz,gh.focus),Zb(a,i),ty(a,i)]),fC.config({})]),eventOrder:(n={},n[yi()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:e.getSink,fetch:kz(o,t,e.providers),parts:{menu:Rv(0,t.columns,t.presets)},components:[hz.parts.button(xz(t.icon,t.text,N.none(),N.some(r),N.some([Eh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),e.providers)),hz.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Ep("chevron-down",e.providers.icons)},buttonBehaviours:xc([Yb(e.providers.isDisabled),$b(),_p()])}),hz.parts["aria-descriptor"]({text:e.providers.translate("To open the popup, press Shift+Enter")})]})}(t,e.backstage.shared)})),grouptoolbarbutton:Ez((function(t){return Pr("GroupToolbarButton",KT,t)}),(function(t,e,n){var r,o=n.ui.registry.getAll().buttons,i=((r={})[Ss]=e.backstage.shared.header.isPositionedAtTop()?Uc.TopToBottom:Uc.BottomToTop,r);if(Mb(n)===pv.floating)return function(t,e,n,r){var o=e.shared;return QM.sketch({lazySink:o.getSink,fetch:function(){return Dw((function(e){e(U(n(t.items),fD))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:xz(t.icon,t.text,t.tooltip,N.none(),N.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})}(t,e.backstage,(function(t){return zz(n,{buttons:o,toolbar:t,allowToolbarGroups:!1},e,N.none())}),i);throw new Error("Toolbar groups are only supported when using floating toolbar mode")})),styleSelectButton:function(t,e){return function(t,e){var n=O({type:"advanced"},e.styleselect);return PD(t,e,iz(t,n))}(t,e.backstage)},fontsizeSelectButton:function(t,e){return function(t,e){return PD(t,e,nz(t))}(t,e.backstage)},fontSelectButton:function(t,e){return function(t,e){return PD(t,e,QD(t))}(t,e.backstage)},formatButton:function(t,e){return function(t,e){return PD(t,e,oz(t))}(t,e.backstage)},alignMenuButton:function(t,e){return function(t,e){return PD(t,e,KD(t))}(t,e.backstage)}},Tz={styleselect:_z.styleSelectButton,fontsizeselect:_z.fontsizeSelectButton,fontselect:_z.fontSelectButton,formatselect:_z.formatButton,align:_z.alignMenuButton},Mz=function(t){var e,n=t.toolbar,o=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var e=U(Oz,(function(e){var n=q(e.items,(function(e){return yt(t,e)||yt(Tz,e)}));return{name:e.name,items:n}}));return q(e,(function(t){return t.items.length>0}))}(o):r(n)?(e=n.split("|"),U(e,(function(t){return{items:t.trim().split(" ")}}))):function(t){return m(t,(function(t){return yt(t,"name")&&yt(t,"items")}))}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},Dz=function(t,e,n,r,o,i){return bt(e,n.toLowerCase()).orThunk((function(){return i.bind((function(t){return ct(t,(function(t){return bt(e,t+n.toLowerCase())}))}))})).fold((function(){return bt(Tz,n.toLowerCase()).map((function(e){return e(t,o)})).orThunk((function(){return N.none()}))}),(function(e){return"grouptoolbarbutton"!==e.type||r?function(t,e,n){return bt(_z,t.type).fold((function(){return console.error("skipping button defined by",t),N.none()}),(function(r){return N.some(r(t,e,n))}))}(e,o,t):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),N.none())}))},zz=function(t,e,n,r){var o=Mz(e),i=U(o,(function(o){var i=J(o.items,(function(o){return 0===o.trim().length?[]:Dz(t,e.buttons,o,e.allowToolbarGroups,n,r).toArray()}));return{title:N.from(t.translate(o.name)),items:i}}));return q(i,(function(t){return t.items.length>0}))},Az=function(t,e,n,o){var i=e.outerContainer,a=n.toolbar,u=n.buttons;if(m(a,r)){var c=a.map((function(e){var r={toolbar:e,buttons:u,allowToolbarGroups:n.allowToolbarGroups};return zz(t,r,{backstage:o},N.none())}));kD.setToolbars(i,c)}else kD.setToolbar(i,zz(t,n,{backstage:o},N.none()))},Nz=he(),Bz=Nz.os.isiOS()&&Nz.os.version.major<=12,Rz=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=wo(0),u=e.outerContainer;ND(t);var c=Nt.fromDom(o.targetNode),s=Re(Be(c));!function(t,e){Xl(t,e,kn)}(c,e.mothership),$l(s,e.uiMothership),t.on("PostRender",(function(){Az(t,e,n,r),i.set(t.getWin().innerWidth),kD.setMenubar(u,_D(t,n)),kD.setSidebar(u,n.sidebar),function(t,e){var n=t.dom,r=t.getWin(),o=t.getDoc().documentElement,i=wo(mn(r.innerWidth,r.innerHeight)),a=wo(mn(o.offsetWidth,o.offsetHeight)),u=function(){var e=i.get();e.left===r.innerWidth&&e.top===r.innerHeight||(i.set(mn(r.innerWidth,r.innerHeight)),Uy(t))},c=function(){var e=t.getDoc().documentElement,n=a.get();n.left===e.offsetWidth&&n.top===e.offsetHeight||(a.set(mn(e.offsetWidth,e.offsetHeight)),Uy(t))},s=function(e){return function(t,e){return t.fire("ScrollContent",e)}(t,e)};n.bind(r,"resize",u),n.bind(r,"scroll",s);var l=ns(Nt.fromDom(t.getBody()),"load",c),f=e.uiMothership.element;t.on("hide",(function(){Je(f,"display","none")})),t.on("show",(function(){an(f,"display")})),t.on("NodeChange",c),t.on("remove",(function(){l.unbind(),n.unbind(r,"resize",u),n.unbind(r,"scroll",s),r=null}))}(t,e)}));var l,f,d,m=kD.getSocket(u).getOrDie("Could not find expected socket element");if(Bz){Qe(m.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var g=(l=function(){t.fire("ScrollContent")},f=20,d=null,{cancel:function(){a(d)||(clearTimeout(d),d=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];a(d)&&(d=setTimeout((function(){d=null,l.apply(null,t)}),f))}}),h=es(m.element,"scroll",g.throttle);t.on("remove",h.unbind)}Gb(t,e),t.addCommand("ToggleSidebar",(function(e,n){kD.toggleSidebar(u,n),t.fire("ToggleSidebar")})),t.addQueryValueHandler("ToggleSidebar",(function(){return kD.whichSidebar(u)}));var p=Mb(t);p!==pv.sliding&&p!==pv.floating||t.on("ResizeWindow ResizeEditor ResizeContent",(function(){var n=t.getWin().innerWidth;n!==i.get()&&(kD.refreshToolbar(e.outerContainer),i.set(n))}));var v={enable:function(){qb(e,!1)},disable:function(){qb(e,!0)},isDisabled:function(){return Yd.isDisabled(u)}};return{iframeContainer:m.element.dom,editorContainer:u.element.dom,api:v}}}),Hz=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?N.some(parseInt(""+t,10)):N.none()},Vz=function(t){return d(t)?t+"px":t},Iz=function(t,e,n){var r=e.filter((function(e){return t<e})),o=n.filter((function(e){return t>e}));return r.or(o).getOr(t)},Lz=function(t){var e=function(t){var e=bb(t),n=wb(t),r=Sb(t);return Hz(e).map((function(t){return Iz(t,n,r)}))}(t);return e.getOr(bb(t))},Fz=function(t){var e=yb(t),n=xb(t),r=Cb(t);return Hz(e).map((function(t){return Iz(t,n,r)}))},Pz=function(t,e,n,r,o){var i=n.uiMothership,a=n.outerContainer,u=pb.DOM,c=Rb(t),s=Ib(t),l=Cb(t).or(Fz(t)),f=r.shared.header,d=f.isPositionedAtTop,m=Mb(t),g=m===pv.sliding||m===pv.floating,h=wo(!1),v=function(){return h.get()&&!t.removed},b=function(t){return g?t.fold(p(0),(function(t){return t.components().length>1?ln(t.components()[1].element):0})):0},y=function(){i.broadcastOn([sf()],{})},x=function(t){if(void 0===t&&(t=!1),v()){var n;if(c||(n=l.getOrThunk((function(){var t=Hz(tn(Fe(),"margin-left")).getOr(0);return bn(Fe())-hn(e).left+t})),Je(o.get().element,"max-width",n+"px")),g&&kD.refreshToolbar(a),c||function(){var t=kD.getToolbar(a),n=b(t),r=Ln(e),i=d()?Math.max(r.y-ln(o.get().element)+n,0):r.bottom;Qe(a.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})}(),s){var r=o.get();t?IT.reset(r):IT.refresh(r)}y()}},w=function(n){if(void 0===n&&(n=!0),!c&&s&&v()){var r=f.getDockingMode(),i=function(n){switch(Ab(t)){case Tb.auto:var r=kD.getToolbar(a),o=b(r),i=ln(n.element)-o,u=Ln(e);if(u.y>i)return"top";var c=Se(e),s=Math.max(c.dom.scrollHeight,ln(c));return u.bottom<s-i||Pn().bottom<u.bottom-i?"bottom":"top";case Tb.bottom:return"bottom";case Tb.top:default:return"top"}}(o.get());i!==r&&(!function(t){var e=o.get();IT.setModes(e,[t]),f.setDockingMode(t);var n=d()?Uc.TopToBottom:Uc.BottomToTop;je(e.element,Ss,n)}(i),n&&x(!0))}};return{isVisible:v,isPositionedAtTop:d,show:function(){h.set(!0),Je(a.element,"display","flex"),u.addClass(t.getBody(),"mce-edit-focus"),an(i.element,"display"),w(!1),x()},hide:function(){h.set(!1),n.outerContainer&&(Je(a.element,"display","none"),u.removeClass(t.getBody(),"mce-edit-focus")),Je(i.element,"display","none")},update:x,updateMode:w,repositionPopups:y}},Uz=function(t,e){var n=Ln(t);return{pos:e?n.y:n.bottom,bounds:n}},jz=Object.freeze({__proto__:null,render:function(t,e,n,r,o){var i=e.mothership,a=e.uiMothership,u=e.outerContainer,c=wo(null),s=Nt.fromDom(o.targetNode),l=Pz(t,s,e,r,c),f=function(t){return t.getParam("toolbar_persist",!1,"boolean")}(t);BD(t);var d=function(){if(c.get())l.show();else{c.set(kD.getHeader(u).getOrDie());var o=Hb(t);$l(o,i),$l(o,a),Az(t,e,n,r),kD.setMenubar(u,_D(t,n)),l.show(),function(t,e,n,r){var o=wo(Uz(e,n.isPositionedAtTop())),i=function(r){var i=Uz(e,n.isPositionedAtTop()),a=i.pos,u=i.bounds,c=o.get(),s=c.pos,l=c.bounds,f=u.height!==l.height||u.width!==l.width;o.set({pos:a,bounds:u}),f&&Uy(t,r),n.isVisible()&&(s!==a?n.update(!0):f&&(n.updateMode(),n.repositionPopups()))};r||(t.on("activate",n.show),t.on("deactivate",n.hide)),t.on("SkinLoaded ResizeWindow",(function(){return n.update(!0)})),t.on("NodeChange keydown",(function(t){vp.requestAnimationFrame((function(){return i(t)}))})),t.on("ScrollWindow",(function(){return n.updateMode()}));var a=Qc();a.set(ns(Nt.fromDom(t.getBody()),"load",i)),t.on("remove",(function(){a.clear()}))}(t,s,l,f),t.nodeChanged()}};t.on("show",d),t.on("hide",l.hide),f||(t.on("focus",d),t.on("blur",l.hide)),t.on("init",(function(){(t.hasFocus()||f)&&d()})),Gb(t,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){qb(e,!1)},disable:function(){qb(e,!0)},isDisabled:function(){return Yd.isDisabled(u)}};return{editorContainer:u.element.dom,api:m}}}),Wz="contexttoolbar-hide",qz=function(t,e){return Ii(AO,(function(n,r){var o=function(t){return{hide:function(){return Mi(t,di())},getValue:function(){return _f.getValue(t)}}}(t.get(n));e.onAction(o,r.event.buttonApi)}))},Gz=function(t,e,n){var r={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===e.type?function(t,e,n){var r=e.original;r.primary;var o=E(r,["primary"]),i=Ur(av(O(O({},o),{type:"togglebutton",onAction:g})));return Sz(i,n.backstage.shared.providers,[qz(t,e)])}(t,e,r):function(t,e,n){var r=e.original;r.primary;var o=E(r,["primary"]),i=Ur(rv(O(O({},o),{type:"button",onAction:g})));return Cz(i,n.backstage.shared.providers,[qz(t,e)])}(t,e,r)},$z=function(t,e){var n=t.label.fold((function(){return{}}),(function(t){return{"aria-label":t}})),r=yp(ww.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:n,selectOnFocus:!0,inputBehaviours:xc([nh.config({mode:"special",onEnter:function(t){return o.findPrimary(t).map((function(t){return zi(t),!0}))},onLeft:function(t,e){return e.cut(),N.none()},onRight:function(t,e){return e.cut(),N.none()}})])})),o=function(t,e,n){var r=U(e,(function(e){return yp(Gz(t,e,n))}));return{asSpecs:function(){return U(r,(function(t){return t.asSpec()}))},findPrimary:function(t){return ct(e,(function(e,n){return e.primary?N.from(r[n]).bind((function(e){return e.getOpt(t)})).filter(x(Yd.isDisabled)):N.none()}))}}}(r,t.commands,e);return[{title:N.none(),items:[r.asSpec()]},{title:N.none(),items:o.asSpecs()}]},Xz=$z,Kz=function(t,e,n){return void 0===n&&(n=.01),e.bottom-t.y>=n&&t.bottom-e.y>=n},Yz=function(t){var e=function(t){var e=t.getBoundingClientRect();if(e.height<=0&&e.width<=0){var n=De(Nt.fromDom(t.startContainer),t.startOffset).element;return(It(n)?Oe(n):N.some(n)).filter(Vt).map((function(t){return t.dom.getBoundingClientRect()})).getOr(e)}return e}(t.selection.getRng());if(t.inline){var n=zn();return In(n.left+e.left,n.top+e.top,e.width,e.height)}var r=Fn(Nt.fromDom(t.getBody()));return In(r.x+e.left,r.y+e.top,e.width,e.height)},Jz=function(t,e,n,r){void 0===r&&(r=0);var o=Bn(window),i=Ln(Nt.fromDom(t.getContentAreaContainer())),a=kb(t)||Ob(t)||_b(t),u=function(t,e,n){var r=Math.max(t.x+n,e.x);return{x:r,width:Math.min(t.right-n,e.right)-r}}(i,o,r),c=u.x,s=u.width;if(t.inline&&!a)return In(c,o.y,s,o.height);var l=function(t,e,n,r,o,i){var a=Nt.fromDom(t.getContainer()),u=su(a,".tox-editor-header").getOr(a),c=Ln(u),s=c.y>=e.bottom,l=r&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,n.y),bottom:n.bottom};if(t.inline&&!l)return{y:n.y,bottom:Math.min(c.y-i,n.bottom)};var f="line"===o?Ln(a):e;return l?{y:Math.max(c.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(c.y-i,n.bottom)}}(t,i,o,e.header.isPositionedAtTop(),n,r),f=l.y,d=l.bottom;return In(c,f,s,d-f)},Qz={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"]},Zz={maxHeightFunction:gs(),maxWidthFunction:GM()},tA=function(t){return"node"===t},eA=function(t,e,n,r,o){var i=Yz(t),a=r.lastElement().exists((function(t){return be(n,t)}));return function(t,e){var n=t.selection.getRng(),r=De(Nt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&be(r.element,e)}(t,n)?a?gp:sp:a?function(t,e,n){var r=nn(t,"position");Je(t,"position",e);var o=n(t);return r.each((function(e){return Je(t,"position",e)})),o}(e,r.getMode(),(function(){return Kz(i,Ln(e))&&!r.isReposition()?pp:gp})):("fixed"===r.getMode()?o.y+zn().top:o.y)+(ln(e)+12)<=i.y?sp:lp},nA=function(t,e,n,r){var o=function(e){return function(r,o,i,a,u){var c=eA(t,a,e,n,u),s=O(O({},r),{y:u.y,height:u.height});return O(O({},c(s,o,i,a,u)),{alwaysFit:!0})}},i=function(t){return tA(r)?[o(t)]:[]};return e?{onLtr:function(t){return[ic,tc,ec,nc,rc,oc].concat(i(t))},onRtl:function(t){return[ic,ec,tc,rc,nc,oc].concat(i(t))}}:{onLtr:function(t){return[oc,ic,nc,tc,rc,ec].concat(i(t))},onRtl:function(t){return[oc,ic,rc,ec,nc,tc].concat(i(t))}}},rA=function(t,e){var n=q(e,(function(e){return e.predicate(t.dom)})),r=W(n,(function(t){return"contexttoolbar"===t.type}));return{contextToolbars:r.pass,contextForms:r.fail}},oA=function(t,e,n){var r=rA(t,e);if(r.contextForms.length>0)return N.some({elem:t,toolbars:[r.contextForms[0]]});var o=rA(t,n);if(o.contextForms.length>0)return N.some({elem:t,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var e=function(e){return L(t,(function(t){return t.position===e}))},n=function(e){return q(t,(function(t){return t.position===e}))},r=e("selection"),o=e("node");if(r||o){if(o&&r){var i=n("node"),a=U(n("selection"),(function(t){return O(O({},t),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")}(r.contextToolbars.concat(o.contextToolbars));return N.some({elem:t,toolbars:i})}return N.none()},iA=function(t,e,n){return t(e)?N.none():Mo(e,(function(t){if(Vt(t)){var e=rA(t,n.inNodeScope),r=e.contextToolbars,o=e.contextForms,i=o.length>0?o:function(t){if(t.length<=1)return t;var e=function(e){return X(t,(function(t){return t.position===e}))},n=e("selection").orThunk((function(){return e("node")})).orThunk((function(){return e("line")})).map((function(t){return t.position}));return n.fold((function(){return[]}),(function(e){return q(t,(function(t){return t.position===e}))}))}(r);return i.length>0?N.some({elem:t,toolbars:i}):N.none()}return N.none()}),t)},aA=function(t,e){var n={},r=[],o=[],i={},a={},u=function(t,u){var c=Ur(Pr("ContextForm",mv,u));n[t]=c,c.launch.map((function(n){i["form:"+t]=O(O({},u.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){e(c)}})})),"editor"===c.scope?o.push(c):r.push(c),a[t]=c},c=function(t,e){var n;(n=e,Pr("ContextToolbar",gv,n)).each((function(n){"editor"===e.scope?o.push(n):r.push(n),a[t]=n}))},s=st(t);return j(s,(function(e){var n=t[e];"contextform"===n.type?u(e,n):"contexttoolbar"===n.type&&c(e,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},uA=oa("forward-slide"),cA=oa("backward-slide"),sA=oa("change-slide-event"),lA="tox-pop--resizing",fA="tox-pop--transition",dA=function(t,e,n,r){var o,i,a=r.backstage,u=a.shared,c=he().deviceType.isTouch,s=Zc(),l=Zc(),f=Zc(),d=tu((o={sink:n,onEscape:function(){return t.focus(),N.some(!0)}},i=wo([]),Jh.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Jh.getContent(t).each((function(t){an(t.element,"visibility")})),La(t.element,lA),an(t.element,"width")},inlineBehaviours:xc([sh("context-toolbar-events",[qi(Zo(),(function(t,e){"width"===e.event.raw.propertyName&&(La(t.element,lA),an(t.element,"width"))})),Ii(sA,(function(t,e){var n=t.element;an(n,"width");var r=bn(n);Jh.setContent(t,e.event.contents),Va(n,lA);var o=bn(n);Je(n,"width",r+"px"),Jh.getContent(t).each((function(t){e.event.focus.bind((function(t){return Mc(t),Ac(n)})).orThunk((function(){return nh.focusIn(t),zc(Be(n))}))})),vp.setTimeout((function(){Je(t.element,"width",o+"px")}),0)})),Ii(uA,(function(t,e){Jh.getContent(t).each((function(e){i.set(i.get().concat([{bar:e,focus:zc(Be(t.element))}]))})),Di(t,sA,{contents:e.event.forwardContents,focus:N.none()})})),Ii(cA,(function(t,e){at(i.get()).each((function(e){i.set(i.get().slice(0,i.get().length-1)),Di(t,sA,{contents:eu(e.bar),focus:e.focus})}))}))]),nh.config({mode:"special",onEscape:function(t){return at(i.get()).fold((function(){return o.onEscape()}),(function(e){return Mi(t,cA),N.some(!0)}))}})]),lazySink:function(){return Wn.value(o.sink)}}))),m=function(){var e=f.get().getOr("node"),n=tA(e)?1:0;return Jz(t,u,e,n)},h=function(){return!(t.removed||c()&&a.isContextMenuOpen())},p=function(){if(h()){var e=m(),n=wt(f.get(),"node")?function(t,e){return e.filter(Le).map(Fn).getOrThunk((function(){return Yz(t)}))}(t,s.get()):Yz(t);return e.height<=0||!Kz(n,e)}return!0},v=function(){s.clear(),l.clear(),f.clear(),Jh.hide(d)},b=function(){if(Jh.isOpen(d)){var t=d.element;an(t,"display"),p()?Je(t,"display","none"):(l.set(0),Jh.reposition(d))}},y=function(e){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[e],behaviours:xc([nh.config({mode:"acyclic"}),sh("pop-dialog-wrap-events",[Gi((function(e){t.shortcuts.add("ctrl+F9","focus statusbar",(function(){return nh.focusIn(e)}))})),$i((function(e){t.shortcuts.remove("ctrl+F9")}))])])}},x=Pt((function(){return aA(e,(function(t){var e=w([t]);Di(d,uA,{forwardContents:y(e)})}))})),w=function(e){var n=t.ui.registry.getAll().buttons,o=x(),i=O(O({},n),o.formNavigators),a=Mb(t)===pv.scrolling?pv.scrolling:pv.default,c=Y(U(e,(function(e){return"contexttoolbar"===e.type?function(e,n){return zz(t,{buttons:e,toolbar:n.items,allowToolbarGroups:!1},r,N.some(["form:"]))}(i,e):function(t,e){return Xz(t,e)}(e,u.providers)})));return pD({type:a,uid:oa("context-toolbar"),initGroups:c,onEscape:N.none,cyclicKeying:!0,providers:u.providers})},C=function(e,r){var o="node"===e?u.anchors.node(r):u.anchors.cursor(),i=function(t,e,n,r){return"line"===e?{bubble:bs(12,0,Qz),layouts:{onLtr:function(){return[ac]},onRtl:function(){return[uc]}},overrides:Zz}:{bubble:bs(0,12,Qz,1/12),layouts:nA(t,n,r,e),overrides:Zz}}(t,e,c(),{lastElement:s.get,isReposition:function(){return wt(l.get(),0)},getMode:function(){return Vl.getMode(n)}});return ur(o,i)},S=function(t,e){if(k.cancel(),h()){var r=w(t),o=t[0].position,i=C(o,e);f.set(o),l.set(1);var a=d.element;an(a,"display"),function(t){return wt(St(t,s.get(),be),!0)}(e)||(La(a,fA),Vl.reset(n,d)),Jh.showWithinBounds(d,y(r),{anchor:i,transition:{classes:[fA],mode:"placement"}},(function(){return N.some(m())})),e.fold(s.clear,s.set),p()&&Je(a,"display","none")}},k=Bp((function(){t.hasFocus()&&!t.removed&&(Fa(d.element,fA)?k.throttle():function(t,e){var n=Nt.fromDom(e.getBody()),r=function(t){return be(t,n)},o=Nt.fromDom(e.selection.getNode());return function(t){return!r(t)&&!xe(n,t)}(o)?N.none():oA(o,t.inNodeScope,t.inEditorScope).orThunk((function(){return iA(r,o,t)}))}(x(),t).fold(v,(function(t){S(t.toolbars,N.some(t.elem))})))}),17);t.on("init",(function(){t.on("remove",v),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",b),t.on("click keyup focus SetContent",k.throttle),t.on(Wz,v),t.on("contexttoolbar-show",(function(e){var n=x();bt(n.lookupTable,e.toolbarKey).each((function(n){S([n],kt(e.target!==t,e.target)),Jh.getContent(d).each(nh.focusIn)}))})),t.on("focusout",(function(e){vp.setEditorTimeout(t,(function(){Ac(n.element).isNone()&&Ac(d.element).isNone()&&v()}),0)})),t.on("SwitchMode",(function(){t.mode.isReadOnly()&&v()})),t.on("AfterProgressState",(function(e){e.state?v():t.hasFocus()&&k.throttle()})),t.on("NodeChange",(function(t){Ac(d.element).fold(k.throttle,g)}))}))},mA={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:[""]},gA=(jD="[eE][+-]?"+(UD="[0-9]+"),WD=function(t){return"(?:"+t+")?"},qD=["Infinity",UD+"\\."+WD(UD)+WD(jD),"\\."+UD+WD(jD),UD+WD(jD)].join("|"),new RegExp("^([+-]?(?:"+qD+"))(.*)$")),hA=function(t,e){return N.from(gA.exec(t)).bind((function(t){var n=Number(t[1]),r=t[2];return function(t,e){return L(e,(function(e){return L(mA[e],(function(e){return t===e}))}))}(r,e)?N.some({value:n,unit:r}):N.none()}))},pA=function(t,e){var n=function(){var n=e.getOptions(t),r=e.getCurrent(t).map(e.hash),o=Zc();return U(n,(function(n){return{type:"togglemenuitem",text:e.display(n),onSetup:function(i){var a=function(t){t&&(o.on((function(t){return t.setActive(!1)})),o.set(i)),i.setActive(t)};a(wt(r,e.hash(n)));var u=e.watcher(t,n,a);return function(){o.clear(),u()}},onAction:function(){return e.setCurrent(t,n)}}}))};t.ui.registry.addMenuButton(e.name,{tooltip:e.text,icon:e.icon,fetch:function(t){return t(n())},onSetup:e.onToolbarSetup}),t.ui.registry.addNestedMenuItem(e.name,{type:"nestedmenuitem",text:e.text,getSubmenuItems:n,onSetup:e.onMenuSetup})},vA={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return function(t,e){return hA(t,e).map((function(t){return t.value+t.unit}))}(t,["fixed","relative","empty"]).getOr(t)},display:v,watcher:function(t,e,n){return t.formatter.formatChanged("lineheight",n,!1,{value:e}).unbind},getCurrent:function(t){return N.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,e){return t.execCommand("LineHeight",!1,e)}},bA=function(t){pA(t,vA),function(t){var e=N.from(function(t){return t.getParam("content_langs",void 0,"array")}(t));return e.map((function(e){return{name:"language",text:"Language",icon:"language",getOptions:p(e),hash:function(t){return c(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,e,n){return t.formatter.formatChanged("lang",n,!1,{value:e.code,customValue:e.customCode}).unbind},getCurrent:function(t){var e=Nt.fromDom(t.selection.getNode());return Do(e,(function(t){return N.some(t).filter(Vt).bind((function(t){return Ge(t,"lang").map((function(e){return{code:e,customCode:Ge(t,"data-mce-lang").getOrUndefined(),title:""}}))}))}))},setCurrent:function(t,e){return t.execCommand("Lang",!1,e)},onToolbarSetup:function(e){var n=Qc();return e.setActive(t.formatter.match("lang",{},void 0,!0)),n.set(t.formatter.formatChanged("lang",e.setActive,!0)),n.clear}}}))}(t).each((function(e){return pA(t,e)}))},yA=function(t,e){!function(t,e){var n=FD(0,e,KD(t));t.ui.registry.addNestedMenuItem("align",{text:e.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=FD(0,e,QD(t));t.ui.registry.addNestedMenuItem("fontformats",{text:e.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=O({type:"advanced"},e.styleselect),r=FD(0,e,iz(t,n));t.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})}(t,e),function(t,e){var n=FD(0,e,oz(t));t.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e),function(t,e){var n=FD(0,e,nz(t));t.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})}(t,e)},xA=function(t){return HD(t,"NodeChange",(function(e){e.setDisabled(!t.queryCommandState("outdent"))}))},wA=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:xA(t),onAction:ID(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:ID(t,"indent")})}(t)},CA=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},SA=function(t){!function(t){Sk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(e,n){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onSetup:RD(t,e.name),onAction:CA(t,e.name)})}));for(var e=1;e<=6;e++){var n="h"+e;t.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+e,onSetup:RD(t,n),onAction:CA(t,n)})}}(t),function(t){Sk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(e){t.ui.registry.addButton(e.name,{tooltip:e.text,icon:e.icon,onAction:ID(t,e.action)})}))}(t),function(t){Sk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:ID(t,e.action),onSetup:RD(t,e.name)})}))}(t)},kA=function(t){SA(t),function(t){Sk.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",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){t.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:ID(t,e.action)})})),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:CA(t,"code")})}(t)},OA=function(t,e){return HD(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(t.mode.isReadOnly()||!t.undoManager[e]())}))},EA=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:OA(t,"hasUndo"),onAction:ID(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:OA(t,"hasRedo"),onAction:ID(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:OA(t,"hasUndo"),onAction:ID(t,"undo")}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:OA(t,"hasRedo"),onAction:ID(t,"redo")})}(t)},_A=function(t){return HD(t,"VisualAid",(function(e){e.setActive(t.hasVisual)}))},TA=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:ID(t,"mceToggleVisualAid")})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:_A(t),onAction:ID(t,"mceToggleVisualAid")})}(t)},MA=function(t,e){!function(t){j([{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"}],(function(e){t.ui.registry.addToggleButton(e.name,{tooltip:e.text,icon:e.icon,onAction:ID(t,e.cmd),onSetup:RD(t,e.name)})})),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:ID(t,"JustifyNone")})}(t),kA(t),yA(t,e),EA(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",(function(e,n){!function(t,e,n){t.undoManager.transact((function(){t.focus(),t.formatter.apply(e,{value:n}),t.nodeChanged()}))}(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){!function(t,e){t.undoManager.transact((function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()}))}(t,e)}))}(t);var e=wo(nx),n=wo(nx);sx(t,"forecolor","forecolor","Text color",e),sx(t,"backcolor","hilitecolor","Background color",n),lx(t,"forecolor","forecolor","Text color"),lx(t,"backcolor","hilitecolor","Background color")}(t),TA(t),wA(t),bA(t)},DA=function(t,e){return{type:"makeshift",x:t,y:e}},zA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},AA=function(t,e){var n=pb.DOM.getPos(t);return function(t,e,n){return DA(t.x+e,t.y+n)}(e,n.x,n.y)},NA=function(t,e){return"contextmenu"===e.type||"longpress"===e.type?t.inline?function(t){if(zA(t)){var e=t.touches[0];return DA(e.pageX,e.pageY)}return DA(t.pageX,t.pageY)}(e):AA(t.getContentAreaContainer(),function(t){if(zA(t)){var e=t.touches[0];return DA(e.clientX,e.clientY)}return DA(t.clientX,t.clientY)}(e)):BA(t)},BA=function(t){return{type:"selection",root:Nt.fromDom(t.selection.getNode())}},RA=function(t,e,n){switch(n){case"node":return function(t){return{type:"node",node:N.some(Nt.fromDom(t.selection.getNode())),root:Nt.fromDom(t.getBody())}}(t);case"point":return NA(t,e);case"selection":return BA(t)}},HA=function(t,e,n,r,o,i){var a=n(),u=RA(t,e,i);UO(a,vv.CLOSE_ON_EXECUTE,r,!1).map((function(t){e.preventDefault(),Jh.showMenuAt(o,{anchor:u},{menu:{markers:Av("normal")},data:t})}))},VA={onLtr:function(){return[ic,tc,ec,nc,rc,oc,sp,lp,cp,ap,up,ip]},onRtl:function(){return[ic,ec,tc,rc,nc,oc,sp,lp,up,ip,cp,ap]}},IA={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"]},LA=function(t,e,n,r,o,i,a){var u=function(t,e,n){var r=RA(t,e,n);return O({bubble:bs(0,"point"===n?12:0,IA),layouts:VA,overrides:{maxWidthFunction:GM(),maxHeightFunction:gs()}},r)}(t,e,i);UO(n,vv.CLOSE_ON_EXECUTE,r,!0).map((function(n){e.preventDefault(),Jh.showMenuWithinBounds(o,{anchor:u},{menu:{markers:Av("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return N.some(Jz(t,r.shared,"node"===i?"node":"selection"))})),t.fire(Wz)}))},FA=function(t,e,n,r,o,i){var a=he(),u=a.os.isiOS(),c=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){var a=n();LA(t,e,a,r,o,i,!(s||u||c&&l))};if((c||u)&&"node"!==i){var d=function(){!function(t){var e=t.selection.getRng(),n=function(){vp.setEditorTimeout(t,(function(){t.selection.setRng(e)}),10),i()};t.once("touchend",n);var r=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",r,!0);var o=function(){return i()};t.once("longpresscancel",o);var i=function(){t.off("touchend",n),t.off("longpresscancel",o),t.off("mousedown",r)}}(t),f()};!function(t,e){var n=t.selection;if(n.isCollapsed()||e.touches.length<1)return!1;var r=e.touches[0],o=n.getRng();return sl(t.getWin(),Ws.domRange(o)).exists((function(t){return t.left<=r.clientX&&t.right>=r.clientX&&t.top<=r.clientY&&t.bottom>=r.clientY}))}(t,e)?(t.once("selectionchange",d),t.once("touchend",(function(){return t.off("selectionchange",d)}))):d()}else f()},PA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},UA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},jA=function(t){return function(t,e,n){var r=t.ui.registry.getAll().contextMenus;return N.from(t.getParam(e)).map(PA).getOrThunk((function(){return q(PA(n),(function(t){return yt(r,t)}))}))}(t,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},WA=function(t){return r(t)?"|"===t:"separator"===t.type},qA={type:"separator"},GA=function(t){var e,n=function(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}};if(r(t))return t;switch(t.type){case"separator":return qA;case"submenu":return O(O({type:"nestedmenuitem"},n(t)),{getSubmenuItems:function(){var e=t.getSubmenuItems();return r(e)?e:U(e,GA)}});default:return O(O({type:"menuitem"},n(t)),{onAction:(e=t.onAction,function(){return e()})})}},$A=function(t,e){if(0===e.length)return t;var n=at(t).filter((function(t){return!WA(t)})),r=n.fold((function(){return[]}),(function(t){return[qA]}));return t.concat(r).concat(e).concat([qA])},XA=function(t,e){return"longpress"!==e.type&&(2!==e.button||e.target===t.getBody()&&""===e.pointerType)},KA=function(t,e){return XA(t,e)?t.selection.getStart(!0):e.target},YA=function(t,e,n){var o=he().deviceType.isTouch,i=tu(Jh.sketch({dom:{tag:"div"},lazySink:e,onEscape:function(){return t.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:xc([sh("dismissContextMenu",[Ii(wi(),(function(e,n){uf.close(e),t.focus()}))])])})),a=function(t){return Jh.hide(i)},u=function(e){if(UA(t)&&e.preventDefault(),!function(t,e){return e.ctrlKey&&!UA(t)}(t,e)&&!function(t){return!1===t.getParam("contextmenu")}(t)){var a=function(t,e){var n=function(t){return t.getParam("contextmenu_avoid_overlap","","string")}(t),r=XA(t,e)?"selection":"point";if(Dt(n)){var o=KA(t,e);return Bx(Nt.fromDom(o),n)?"node":r}return r}(t,e);(o()?FA:HA)(t,e,(function(){var n=KA(t,e),o=t.ui.registry.getAll(),i=jA(t);return function(t,e,n){var o=$(e,(function(e,o){return bt(t,o.toLowerCase()).map((function(t){var o=t.update(n);if(r(o))return $A(e,o.split(" "));if(o.length>0){var i=U(o,GA);return $A(e,i)}return e})).getOrThunk((function(){return e.concat([o])}))}),[]);return o.length>0&&WA(o[o.length-1])&&o.pop(),o}(o.contextMenus,i,n)}),n,i,a)}};t.on("init",(function(){var e="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(e,a),t.on("longpress contextmenu",u)}))},JA=Co([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),QA=function(t){return function(e){return e.translate(-t.left,-t.top)}},ZA=function(t){return function(e){return e.translate(t.left,t.top)}},tN=function(t){return function(e,n){return $(t,(function(t,e){return e(t)}),mn(e,n))}},eN=function(t,e,n){return t.fold(tN([ZA(n),QA(e)]),tN([QA(e)]),tN([]))},nN=function(t,e,n){return t.fold(tN([ZA(n)]),tN([]),tN([ZA(e)]))},rN=function(t,e,n){return t.fold(tN([]),tN([QA(n)]),tN([ZA(e),QA(n)]))},oN=function(t,e,n){var r=t.fold((function(t,e){return{position:N.some("absolute"),left:N.some(t+"px"),top:N.some(e+"px")}}),(function(t,e){return{position:N.some("absolute"),left:N.some(t-n.left+"px"),top:N.some(e-n.top+"px")}}),(function(t,e){return{position:N.some("fixed"),left:N.some(t+"px"),top:N.some(e+"px")}}));return O({right:N.none(),bottom:N.none()},r)},iN=function(t,e,n,r){var o=function(t,o){return function(i,a){var u=t(e,n,r);return o(i.getOr(u.left),a.getOr(u.top))}};return t.fold(o(rN,aN),o(nN,uN),o(eN,cN))},aN=JA.offset,uN=JA.absolute,cN=JA.fixed,sN=function(t,e){var n=qe(t,e);return c(n)?NaN:parseInt(n,10)},lN=function(t,e,n,r){return function(t,e){var n=t.element,r=sN(n,e.leftAttr),o=sN(n,e.topAttr);return isNaN(r)||isNaN(o)?N.none():N.some(mn(r,o))}(t,e).fold((function(){return n}),(function(t){return cN(t.left+r.left,t.top+r.top)}))},fN=function(t,e,n,r,o,i){var a=lN(t,e,n,r),u=e.mustSnap?gN(t,e,a,o,i):hN(t,e,a,o,i),c=eN(a,o,i);return function(t,e,n){var r=t.element;je(r,e.leftAttr,n.left+"px"),je(r,e.topAttr,n.top+"px")}(t,e,c),u.fold((function(){return{coord:cN(c.left,c.top),extra:N.none()}}),(function(t){return{coord:t.output,extra:t.extra}}))},dN=function(t,e){!function(t,e){var n=t.element;Xe(n,e.leftAttr),Xe(n,e.topAttr)}(t,e)},mN=function(t,e,n,r){return ct(t,(function(t){var o=t.sensor,i=function(t,e,n,r,o,i){var a=nN(t,o,i),u=nN(e,o,i);return Math.abs(a.left-u.left)<=n&&Math.abs(a.top-u.top)<=r}(e,o,t.range.left,t.range.top,n,r);return i?N.some({output:iN(t.output,e,n,r),extra:t.extra}):N.none()}))},gN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return mN(i,n,r,o).orThunk((function(){var t=$(i,(function(t,e){var i=e.sensor,a=function(t,e,n,r,o,i){var a=nN(t,o,i),u=nN(e,o,i),c=Math.abs(a.left-u.left),s=Math.abs(a.top-u.top);return mn(c,s)}(n,i,e.range.left,e.range.top,r,o);return t.deltas.fold((function(){return{deltas:N.some(a),snap:N.some(e)}}),(function(n){return(a.left+a.top)/2<=(n.left+n.top)/2?{deltas:N.some(a),snap:N.some(e)}:t}))}),{deltas:N.none(),snap:N.none()});return t.snap.map((function(t){return{output:iN(t.output,n,r,o),extra:t.extra}}))}))},hN=function(t,e,n,r,o){var i=e.getSnapPoints(t);return mN(i,n,r,o)},pN=Object.freeze({__proto__:null,snapTo:function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=we(t.element),a=zn(i),u=xT(o),c=function(t,e,n){return{coord:iN(t.output,t.output,e,n),extra:t.extra}}(r,a,u),s=oN(c.coord,0,u);Ze(o,s)}}}),vN="data-initial-z-index",bN=function(t,e){t.getSystem().addToGui(e),function(t){Oe(t.element).filter(Vt).each((function(e){nn(e,"z-index").each((function(t){je(e,vN,t)})),Je(e,"z-index",tn(t.element,"z-index"))}))}(e)},yN=function(t){!function(t){Oe(t.element).filter(Vt).each((function(t){Ge(t,vN).fold((function(){return an(t,"z-index")}),(function(e){return Je(t,"z-index",e)})),Xe(t,vN)}))}(t),t.getSystem().removeFromGui(t)},xN=function(t,e,n){return t.getSystem().build(Xx.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e]},events:n}))},wN=lo("snaps",[Kr("getSnapPoints"),_u("onSensor"),Kr("leftAttr"),Kr("topAttr"),fo("lazyViewport",Pn),fo("mustSnap",!1)]),CN=[fo("useFixed",C),Kr("blockerClass"),fo("getTarget",v),fo("onDrag",g),fo("repositionTarget",!0),fo("onDrop",g),bo("getBounds",Pn),wN],SN=function(t){return(e=nn(t,"left"),n=nn(t,"top"),r=nn(t,"position"),o=function(t,e,n){return("fixed"===n?cN:aN)(parseInt(t,10),parseInt(e,10))},e.isSome()&&n.isSome()&&r.isSome()?N.some(o(e.getOrDie(),n.getOrDie(),r.getOrDie())):N.none()).getOrThunk((function(){var e=hn(t);return uN(e.left,e.top)}));var e,n,r,o},kN=function(t,e,n,r,o,i,a){return function(t,e,n,r,o){var i=o.bounds,a=nN(e,n,r),u=qu(a.left,i.x,i.x+i.width-o.width),c=qu(a.top,i.y,i.y+i.height-o.height),s=uN(u,c);return e.fold((function(){var t=rN(s,n,r);return aN(t.left,t.top)}),p(s),(function(){var t=eN(s,n,r);return cN(t.left,t.top)}))}(0,e.fold((function(){var t,e,a,u=(t=n,e=i.left,a=i.top,t.fold((function(t,n){return aN(t+e,n+a)}),(function(t,n){return uN(t+e,n+a)}),(function(t,n){return cN(t+e,n+a)}))),c=eN(u,r,o);return cN(c.left,c.top)}),(function(e){var a=fN(t,e,n,i,r,o);return a.extra.each((function(n){e.onSensor(t,n)})),a.coord})),r,o,a)},ON=function(t,e){return{bounds:t.getBounds(),height:fn(e.element),width:yn(e.element)}},EN=function(t,e,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return ON(e,t)}));i.each((function(n){!function(t,e,n,r){var o=e.getTarget(t.element);if(e.repositionTarget){var i=we(t.element),a=zn(i),u=xT(o),c=SN(o),s=kN(t,e.snaps,c,a,u,r,n),l=oN(s,0,u);Ze(o,l)}e.onDrag(t,o,r)}(t,e,a,n)}))},_N=function(t,e,n,r){e.each(yN),n.snaps.each((function(e){dN(t,e)}));var o=n.getTarget(t.element);r.reset(),n.onDrop(t,o)},TN=function(t){return function(e,n){var r=function(t){n.setStartData(ON(e,t))};return Ri(_([Ii(vi(),(function(t){n.getStartData().each((function(){return r(t)}))}))],t(e,n,r),!0))}},MN=Object.freeze({__proto__:null,getData:function(t){return N.from(mn(t.x,t.y))},getDelta:function(t,e){return mn(e.left-t.left,e.top-t.top)}}),DN=function(t,e,n){return[Ii(Fo(),(function(r,o){if(0===o.event.raw.button){o.stop();var i=function(){return _N(r,N.some(c),t,e)},a=Rx(i,200),u={drop:i,delayDrop:a.schedule,forceDrop:i,move:function(n){a.cancel(),EN(r,t,e,MN,n)}},c=xN(r,t.blockerClass,function(t){return Ri([Ii(Fo(),t.forceDrop),Ii(jo(),t.drop),Ii(Po(),(function(e,n){t.move(n.event)})),Ii(Uo(),t.delayDrop)])}(u));n(r),bN(r,c)}}))]},zN=_(_([],CN,!0),[zu("dragger",{handlers:TN(DN)})],!1),AN=Object.freeze({__proto__:null,getData:function(t){var e=t.raw.touches;return 1===e.length?function(t){var e=t[0];return N.some(mn(e.clientX,e.clientY))}(e):N.none()},getDelta:function(t,e){return mn(e.left-t.left,e.top-t.top)}}),NN=function(t,e,n){var r=Zc(),o=function(n){_N(n,r.get(),t,e),r.clear()};return[Ii(Ho(),(function(i,a){a.stop();var u=function(){return o(i)},c={drop:u,delayDrop:g,forceDrop:u,move:function(n){EN(i,t,e,AN,n)}},s=xN(i,t.blockerClass,function(t){return Ri([Ii(Ho(),t.forceDrop),Ii(Io(),t.drop),Ii(Lo(),t.drop),Ii(Vo(),(function(e,n){t.move(n.event)}))])}(c));r.set(s);n(i),bN(i,s)})),Ii(Vo(),(function(n,r){r.stop(),EN(n,t,e,AN,r.event)})),Ii(Io(),(function(t,e){e.stop(),o(t)})),Ii(Lo(),o)]},BN=zN,RN=_(_([],CN,!0),[zu("dragger",{handlers:TN(NN)})],!1),HN=_(_([],CN,!0),[zu("dragger",{handlers:TN((function(t,e,n){return _(_([],DN(t,e,n),!0),NN(t,e,n),!0)}))})],!1),VN=Object.freeze({__proto__:null,mouse:BN,touch:RN,mouseOrTouch:HN}),IN=Object.freeze({__proto__:null,init:function(){var t=N.none(),e=N.none(),n=p({});return wa({readState:n,reset:function(){t=N.none(),e=N.none()},update:function(e,n){return e.getData(n).bind((function(n){return function(e,n){var r=t.map((function(t){return e.getDelta(t,n)}));return t=N.some(n),r}(e,n)}))},getStartData:function(){return e},setStartData:function(t){e=N.some(t)}})}}),LN=kc({branchKey:"mode",branches:VN,name:"dragging",active:{events:function(t,e){return t.dragger.handlers(t,e)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:N.from(t.extra)}}},state:IN,apis:pN}),FN=function(t,e,n,r,o,i){return t.fold((function(){return LN.snap({sensor:uN(n-20,r-20),range:mn(o,i),output:uN(N.some(n),N.some(r)),extra:{td:e}})}),(function(t){var o=n-20,i=r-20,a=t.element.dom.getBoundingClientRect();return LN.snap({sensor:uN(o,i),range:mn(40,40),output:uN(N.some(n-a.width/2),N.some(r-a.height/2)),extra:{td:e}})}))},PN=function(t,e,n){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,r){var o=r.td;(function(t,e){return t.exists((function(t){return be(t,e)}))})(e.get(),o)||(e.set(o),n(o))},mustSnap:!0}},UN=function(t){return yp(bp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:xc([LN.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),fC.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},jN=function(t,e){var n=wo([]),r=wo([]),o=wo(!1),i=Zc(),a=Zc(),u=function(t){var n=Fn(t);return FN(f.getOpt(e),t,n.x,n.y,n.width,n.height)},c=function(t){var n=Fn(t);return FN(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=PN((function(){return U(n.get(),(function(t){return u(t)}))}),i,(function(e){a.get().each((function(n){t.fire("TableSelectorChange",{start:e,finish:n})}))})),l=PN((function(){return U(r.get(),(function(t){return c(t)}))}),a,(function(e){i.get().each((function(n){t.fire("TableSelectorChange",{start:n,finish:e})}))})),f=UN(s),d=UN(l),m=tu(f.asSpec()),g=tu(d.asSpec()),h=function(e,n,r,o){var i=r(n);LN.snapTo(e,i);!function(e,n,r,o){var i=n.dom.getBoundingClientRect();an(e.element,"display");var a=ke(Nt.fromDom(t.getBody())).dom.innerHeight,u=r(i),c=o(i,a);(u||c)&&Je(e.element,"display","none")}(e,n,(function(t){return t[o]<0}),(function(t,e){return t[o]>e}))},p=function(t){return h(m,t,u,"top")},v=function(t){return h(g,t,c,"bottom")};he().deviceType.isTouch()&&(t.on("TableSelectionChange",(function(t){o.get()||(Ul(e,m),Ul(e,g),o.set(!0)),i.set(t.start),a.set(t.finish),t.otherCells.each((function(e){n.set(e.upOrLeftCells),r.set(e.downOrRightCells),p(t.start),v(t.finish)}))})),t.on("ResizeEditor ResizeWindow ScrollContent",(function(){i.get().each(p),a.get().each(v)})),t.on("TableSelectionClear",(function(){o.get()&&(ql(m),ql(g),o.set(!1)),i.clear(),a.clear()})))},WN=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},qN=function(t,e,n){e.delimiter||(e.delimiter="»");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:xc([nh.config({mode:"flow",selector:"div[role=button]"}),Yd.config({disabled:n.isDisabled}),$b(),ew.config({}),ch.config({}),sh("elementPathEvents",[Gi((function(r,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return nh.focusIn(r)})),t.on("NodeChange",(function(o){var i,a,u=function(e){for(var n=[],r=e.length;r-- >0;){var o=e[r];if(1===o.nodeType&&!WN(o)){var i=t.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(o.parents);u.length>0?ch.set(r,(i=U(u||[],(function(e,r){return bp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:e.name},action:function(n){t.focus(),t.selection.select(e.element),t.nodeChanged()},buttonBehaviours:xc([Kb(n.isDisabled),$b()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+e.delimiter+" "}},$(i.slice(1),(function(t,e){var n=t;return n.push(a),n.push(e),n}),[i[0]]))):ch.set(r,[])}))}))])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(GD||(GD={}));var GN=function(t,e,n){var r=Nt.fromDom(t.getContainer()),o=function(t,e,n,r,o){var i={};return i.height=Iz(r+e.top,wb(t),Sb(t)),n===GD.Both&&(i.width=Iz(o+e.left,xb(t),Cb(t))),i}(t,e,n,ln(r),bn(r));ft(o,(function(t,e){return Je(r,e,Vz(t))})),function(t){t.fire("ResizeEditor")}(t)},$N=function(t,e,n,r){var o=mn(20*n,20*r);return GN(t,o,e),N.some(!0)},XN=function(t,e){var n=function(t){var e=!t.hasPlugin("autoresize"),n=t.getParam("resize",e);return!1===n?GD.None:"both"===n?GD.Both:GD.Vertical}(t);return n===GD.None?N.none():N.some(Mp("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:e.translate("Resize")},behaviours:[LN.config({mode:"mouse",repositionTarget:!1,onDrag:function(e,r,o){return GN(t,o,n)},blockerClass:"tox-blocker"}),nh.config({mode:"special",onLeft:function(){return $N(t,n,-1,0)},onRight:function(){return $N(t,n,1,0)},onUp:function(){return $N(t,n,0,-1)},onDown:function(){return $N(t,n,0,1)}}),ew.config({}),gh.config({})]},e.icons))},KN=function(t,e){var n=function(){var n,r=[];return t.getParam("elementpath",!0,"boolean")&&r.push(qN(t,{},e)),t.hasPlugin("wordcount")&&r.push(function(t,e){var n,r=function(t,n,r){return ch.set(t,[Ja(e.translate(["{0} "+r,n[r]]))])};return bp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:xc([Kb(e.isDisabled),$b(),ew.config({}),ch.config({}),_f.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),sh("wordcount-events",[Ki((function(t){var e=_f.getValue(t),n="words"===e.mode?"characters":"words";_f.setValue(t,{mode:n,count:e.count}),r(t,e.count,n)})),Gi((function(e){t.on("wordCountUpdate",(function(t){var n=_f.getValue(e).mode;_f.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)}))}))])]),eventOrder:(n={},n[ci()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})}(t,e)),t.getParam("branding",!0,"boolean")&&r.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(n=xp.translate(["Powered by {0}","Tiny"]))+'">'+n+"</a>"}}),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var r=n(),o=XN(t,e);return r.concat(o.toArray())}()}},YN=function(t){var e,n,r,o,i=t.inline,a=i?jz:Rz,u=Ib(t)?XT:bT,c=N.none(),s=he(),l=s.browser.isIE()?["tox-platform-ie"]:[],f=s.deviceType.isTouch()?["tox-platform-touch"]:[],d=Nb(t),m=Hb(t),h=xp.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(e={},e[Ss]=d?Uc.BottomToTop:Uc.TopToBottom,e)},v=function(){return c.bind(kD.getHeader)},b=function(){Je(G.element,"width",document.body.clientWidth+"px")},y=tu((n=be(Fe(),m)&&"grid"===tn(m,"display"),r={dom:O({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(l).concat(f)},h),behaviours:xc([Vl.config({useFixed:function(){return u.isDocked(v)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Ri([Ii(bi(),b)])},ur(r,n?o:{}))),x=function(){return Wn.value(y)},w=yp({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return c.bind((function(t){return kD.getThrobber(t)})).getOrDie("Could not find throbber element")},S=oT(y,t,(function(){return c.bind((function(t){return w.getOpt(t)})).getOrDie("Could not find a anchor bar element")})),k=kD.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){t.focus()}}),E=Mb(t),_=kD.parts.toolbar(O({dom:{tag:"div",classes:["tox-toolbar"]},getSink:x,providers:S.shared.providers,onEscape:function(){t.focus()},type:E,lazyToolbar:function(){return c.bind((function(t){return kD.getToolbar(t)})).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),T=kD.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:S.shared.providers,onEscape:function(){t.focus()},type:E}),M=kD.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),D=kD.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),z=kD.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),A=t.getParam("statusbar",!0,"boolean")&&!i?N.some(KN(t,S.shared.providers)):N.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[M,D]},R=_b(t),H=Ob(t),V=kb(t),I=kD.parts.header({dom:O({tag:"div",classes:["tox-editor-header"]},p),components:Y([V?[k]:[],R?[T]:H?[_]:[],Rb(t)?[]:[w.asSpec()]]),sticky:Ib(t),editor:t,sharedBackstage:S.shared}),L=Y([d?[]:[I],i?[]:[B],d?[I]:[]]),F=Y([[{dom:{tag:"div",classes:["tox-editor-container"]},components:L}],i?[]:A.toArray(),[z]]),P=Vb(t),U=O(O({role:"application"},xp.isRtl()?{dir:"rtl"}:{}),P?{"aria-hidden":"true"}:{}),W=tu(kD.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(l),styles:O({visibility:"hidden"},P?{opacity:"0",border:"0"}:{}),attributes:U},components:F,behaviours:xc([$b(),Yd.config({disableClass:"tox-tinymce--disabled"}),nh.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"})])}));c=N.some(W),t.shortcuts.add("alt+F9","focus menubar",(function(){kD.focusMenubar(W)})),t.shortcuts.add("alt+F10","focus toolbar",(function(){kD.focusToolbar(W)})),t.addCommand("ToggleToolbarDrawer",(function(){kD.toggleToolbarDrawer(W)})),t.addQueryStateHandler("ToggleToolbarDrawer",(function(){return kD.isToolbarDrawerToggled(W)}));var q=Kx(W),G=Kx(y);!function(t,e,n){var r=function(t,r){j([e,n],(function(e){e.broadcastEvent(t,r)}))},o=function(t,r){j([e,n],(function(e){e.broadcastOn([t],r)}))},i=function(t){return o(cf(),{target:t.target})},a=Tc(),u=es(a,"touchstart",i),c=es(a,"touchmove",(function(t){return r(hi(),t)})),s=es(a,"touchend",(function(t){return r(pi(),t)})),l=es(a,"mousedown",i),f=es(a,"mouseup",(function(t){0===t.raw.button&&o(lf(),{target:t.target})})),d=function(t){return o(cf(),{target:Nt.fromDom(t.target)})},m=function(t){0===t.button&&o(lf(),{target:Nt.fromDom(t.target)})},g=function(){j(t.editorManager.get(),(function(e){t!==e&&e.fire("DismissPopups",{relatedTarget:t})}))},h=function(t){return r(vi(),rs(t))},p=function(t){o(sf(),{}),r(bi(),rs(t))},v=function(){return o(sf(),{})},b=function(e){e.state&&o(cf(),{target:Nt.fromDom(t.getContainer())})},y=function(t){o(cf(),{target:Nt.fromDom(t.relatedTarget.getContainer())})};t.on("PostRender",(function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",h),t.on("ResizeWindow",p),t.on("ResizeEditor",v),t.on("AfterProgressState",b),t.on("DismissPopups",y)})),t.on("remove",(function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",h),t.off("ResizeWindow",p),t.off("ResizeEditor",v),t.off("AfterProgressState",b),t.off("DismissPopups",y),l.unbind(),u.unbind(),c.unbind(),s.unbind(),f.unbind()})),t.on("detach",(function(){Kl(e),Kl(n),e.destroy(),n.destroy()}))}(t,q,G);var $=function(){var e=Vz(Lz(t)),n=Vz(function(t){return Fz(t).getOr(yb(t))}(t));return t.inline||(on("div","width",n)&&Je(W.element,"width",n),on("div","height",e)?Je(W.element,"height",e):Je(W.element,"height","200px")),e};return{mothership:q,uiMothership:G,backstage:S,renderUI:function(){u.setup(t,S.shared,v),MA(t,S),YA(t,x,S),function(t){var e=t.ui.registry.getAll().sidebars;j(st(e),(function(n){var r=e[n],o=function(){return wt(N.from(t.queryCommandValue("ToggleSidebar")),n)};t.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(e){t.execCommand("ToggleSidebar",!1,n),e.setActive(o())},onSetup:function(e){var n=function(){return e.setActive(o())};return t.on("ToggleSidebar",n),function(){t.off("ToggleSidebar",n)}}})}))}(t),HM(t,C,S.shared),dt(function(t){return t.getParam("toolbar_groups",{},"object")}(t),(function(e,n){t.ui.registry.addGroupToolbarButton(n,e)}));var e=t.ui.registry.getAll(),n=e.buttons,r=e.menuItems,o=e.contextToolbars,i=e.sidebars,c=Eb(t),s={menuItems:r,menus:Lb(t),menubar:Fb(t),toolbar:c.getOrThunk((function(){return function(t){return t.getParam("toolbar",!0)}(t)})),allowToolbarGroups:E===pv.floating,buttons:n,sidebar:i};dA(t,o,y,{backstage:S}),jN(t,y);var l=t.getElement(),f=$(),d={mothership:q,uiMothership:G,outerContainer:W},m={targetNode:l,height:f};return a.render(t,d,s,S,m)},getUi:function(){return{channels:{broadcastAll:G.broadcast,broadcastOn:G.broadcastOn,register:g}}}}},JN=p([Kr("lazySink"),oo("dragBlockClass"),bo("getBounds",Pn),fo("useTabstopAt",S),fo("eventOrder",{}),Tf("modalBehaviours",[nh]),Tu("onExecute"),Du("onEscape")]),QN={sketch:v},ZN=p([id({name:"draghandle",overrides:function(t,e){return{behaviours:xc([LN.config({mode:"mouse",getTarget:function(t){return uu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(e,null,2)).message),getBounds:t.getDragBounds})])}}}),rd({schema:[Kr("dom")],name:"title"}),rd({factory:QN,schema:[Kr("dom")],name:"close"}),rd({factory:QN,schema:[Kr("dom")],name:"body"}),id({factory:QN,schema:[Kr("dom")],name:"footer"}),od({factory:{sketch:function(t,e){return O(O({},t),{dom:e.dom,components:e.components})}},schema:[fo("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),fo("components",[])],name:"blocker"})]),tB=Ad({name:"ModalDialog",configFields:JN(),partFields:ZN(),factory:function(t,e,n,r){var o,i=Zc(),a=oa("modal-events"),u=O(O({},t.eventOrder),((o={})[yi()]=[a].concat(t.eventOrder["alloy.system.attached"]||[]),o));return{uid:t.uid,dom:t.dom,components:e,apis:{show:function(e){i.set(e);var n=t.lazySink(e).getOrDie(),o=r.blocker(),a=n.getSystem().build(O(O({},o),{components:o.components.concat([eu(e)]),behaviours:xc([gh.config({}),sh("dialog-blocker-events",[qi(qo(),(function(){nh.focusIn(e)}))])])}));Ul(n,a),nh.focusIn(e)},hide:function(t){i.clear(),Oe(t.element).each((function(e){t.getSystem().getByDom(e).each((function(t){ql(t)}))}))},getBody:function(e){return bd(e,t,"body")},getFooter:function(e){return bd(e,t,"footer")},setIdle:function(t){AM.unblock(t)},setBusy:function(t,e){AM.block(t,e)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Df(t.modalBehaviours,[ch.config({}),nh.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt}),AM.config({getRoot:i.get}),sh(a,[Gi((function(e){var n,r,o,i,a,u;n=e.element,r=bd(e,t,"title").element,o=Ge(n,"id").fold((function(){var t=oa("dialog-label");return je(r,"id",t),t}),v),je(n,"aria-labelledby",o),i=e.element,a=bd(e,t,"body").element,u=N.from(qe(i,"id")).fold((function(){var t=oa("dialog-describe");return je(a,"id",t),t}),v),je(i,"aria-describedby",u)}))])])}},apis:{show:function(t,e){t.show(e)},hide:function(t,e){t.hide(e)},getBody:function(t,e){return t.getBody(e)},getFooter:function(t,e){return t.getFooter(e)},setBusy:function(t,e,n){t.setBusy(e,n)},setIdle:function(t,e){t.setIdle(e)}}}),eB=kr([Qr("type"),Qr("name")].concat(Kv)),nB=Nr,rB=[Gr("name","name",sr((function(){return oa("button-name")})),Ar),uo("icon"),po("align","end",["start","end"]),vo("primary",!1),vo("disabled",!1)],oB=_(_([],rB,!0),[Qr("text")],!1),iB=_([Zr("type",["submit","cancel","custom"])],oB,!0),aB=_([Zr("type",["menu"]),uo("text"),uo("tooltip"),uo("icon"),ro("items",eB)],rB,!0),uB=qr("type",{submit:iB,cancel:iB,custom:iB,menu:aB}),cB=[Qr("type"),Qr("text"),Zr("level",["info","warn","error","success"]),Qr("icon"),fo("url","")],sB=kr(cB),lB=[Qr("type"),Qr("text"),vo("disabled",!1),vo("primary",!1),Gr("name","name",sr((function(){return oa("button-name")})),Ar),uo("icon"),vo("borderless",!1)],fB=kr(lB),dB=[Qr("type"),Qr("name"),Qr("label"),vo("disabled",!1)],mB=kr(dB),gB=Nr,hB=[Qr("type"),Qr("name")],pB=hB.concat([uo("label")]),vB=pB.concat([fo("columns","auto")]),bB=kr(vB),yB=Tr([Qr("value"),Qr("text"),Qr("icon")]),xB=kr(pB),wB=Ar,CB=kr(pB),SB=Ar,kB=hB.concat([ho("tag","textarea"),Qr("scriptId"),Qr("scriptUrl"),function(t,e){return mo(t,e,Hr)}("settings",void 0)]),OB=hB.concat([ho("tag","textarea"),to("init")]),EB=Lr((function(t){return Pr("customeditor.old",Sr(OB),t).orThunk((function(){return Pr("customeditor.new",Sr(kB),t)}))})),_B=Ar,TB=kr(pB),MB=Or(vr),DB=function(t){return[Qr("type"),Jr("columns"),t]},zB=[Qr("type"),Qr("html"),po("presets","presentation",["presentation","document"])],AB=kr(zB),NB=pB.concat([vo("sandboxed",!0)]),BB=kr(NB),RB=Ar,HB=pB.concat([Yr("currentState",kr([Kr("blob"),Qr("url")]))]),VB=kr(HB),IB=pB.concat([uo("inputMode"),uo("placeholder"),vo("maximized",!1),vo("disabled",!1)]),LB=kr(IB),FB=Ar,PB=function(t){return[Qr("type"),Qr("label"),t]},UB=[Qr("text"),Qr("value")],jB=[Qr("text"),ro("items",function(t,e){return n=Pt(e),{extract:function(t,e){return n().extract(t,e)},toString:function(){return n().toString()}};var n}(0,(function(){return WB})))],WB=Er([kr(UB),kr(jB)]),qB=pB.concat([ro("items",WB),vo("disabled",!1)]),GB=kr(qB),$B=Ar,XB=pB.concat([no("items",[Qr("text"),Qr("value")]),go("size",1),vo("disabled",!1)]),KB=kr(XB),YB=Ar,JB=pB.concat([vo("constrain",!0),vo("disabled",!1)]),QB=kr(JB),ZB=kr([Qr("width"),Qr("height")]),tR=[Qr("type"),ro("header",Ar),ro("cells",Or(Ar))],eR=kr(tR),nR=pB.concat([uo("placeholder"),vo("maximized",!1),vo("disabled",!1)]),rR=kr(nR),oR=Ar,iR=pB.concat([po("filetype","file",["image","media","file"]),fo("disabled",!1)]),aR=kr(iR),uR=kr([Qr("value"),fo("meta",{})]),cR=function(t){return Gr("items","items",{tag:"required",process:{}},Or(Lr((function(e){return Pr("Checking item of "+t,sR,e).fold((function(t){return Wn.error(Wr(t))}),(function(t){return Wn.value(t)}))}))))},sR=wr((function(){return Ir("type",{alertbanner:sB,bar:kr((t=cR("bar"),[Qr("type"),t])),button:fB,checkbox:mB,colorinput:xB,colorpicker:CB,dropzone:TB,grid:kr(DB(cR("grid"))),iframe:BB,input:LB,listbox:GB,selectbox:KB,sizeinput:QB,textarea:rR,urlinput:aR,customeditor:EB,htmlpanel:AB,imagetools:VB,collection:bB,label:kr(PB(cR("label"))),table:eR,panel:fR});var t})),lR=[Qr("type"),fo("classes",[]),ro("items",sR)],fR=kr(lR),dR=[Gr("name","name",sr((function(){return oa("tab-name")})),Ar),Qr("title"),ro("items",sR)],mR=[Qr("type"),no("tabs",dR)],gR=kr(mR),hR=oB,pR=uB,vR=kr([Qr("title"),Yr("body",Ir("type",{panel:fR,tabpanel:gR})),ho("size","normal"),ro("buttons",pR),fo("initialData",{}),bo("onAction",g),bo("onChange",g),bo("onSubmit",g),bo("onClose",g),bo("onCancel",g),fo("onTabChange",g)]),bR=kr(_([Zr("type",["cancel","custom"])],hR,!0)),yR=kr([Qr("title"),Qr("url"),ao("height"),ao("width"),so("buttons",bR),bo("onAction",g),bo("onCancel",g),bo("onClose",g),bo("onMessage",g)]),xR=function(t){return o(t)?[t].concat(J(vt(t),xR)):i(t)?J(t,xR):[]},wR=function(t){return r(t.type)&&r(t.name)},CR={checkbox:gB,colorinput:wB,colorpicker:SB,dropzone:MB,input:FB,iframe:RB,sizeinput:ZB,selectbox:YB,listbox:$B,size:ZB,textarea:oR,urlinput:uR,customeditor:_B,collection:yB,togglemenuitem:nB},SR=function(t){var e=function(t){return q(xR(t),wR)}(t),n=J(e,(function(t){return function(t){return N.from(CR[t.type])}(t).fold((function(){return[]}),(function(e){return[Yr(t.name,e)]}))}));return kr(n)},kR=function(t){return{internalDialog:Ur(Pr("dialog",vR,t)),dataValidator:SR(t),initialData:t.initialData}},OR={open:function(t,e){var n=kR(e);return t(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(t,e){return t(Ur(Pr("dialog",yR,e)))},redial:function(t){return kR(t)}},ER=function(t){var e=[],n={};return ft(t,(function(t,r){t.fold((function(){e.push(r)}),(function(t){n[r]=t}))})),e.length>0?Wn.error(e):Wn.value(n)},_R=function(t,e){var n=yp(sk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:U(t.items,(function(t){return l_(n,t,e)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:xc([nh.config({mode:"acyclic",useTabstopAt:x(Ik)}),bk(n),_k(n,{postprocess:function(t){return ER(t).fold((function(t){return console.error(t),{}}),v)}})])}},TR=zd({name:"TabButton",configFields:[fo("uid",void 0),Kr("value"),Gr("dom","dom",fr((function(){return{attributes:{role:"tab",id:oa("aria"),"aria-selected":"false"}}})),Mr()),oo("action"),fo("domModification",{}),Tf("tabButtonBehaviours",[gh,nh,_f]),Kr("view")],factory:function(t,e){return{uid:t.uid,dom:t.dom,components:t.components,events:Th(t.action),behaviours:Df(t.tabButtonBehaviours,[gh.config({}),nh.config({mode:"execution",useSpace:!0,useEnter:!0}),_f.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),MR=p([Kr("tabs"),Kr("dom"),fo("clickToDismiss",!1),Tf("tabbarBehaviours",[um,nh]),Ou(["tabClass","selectedClass"])]),DR=ad({factory:TR,name:"tabs",unit:"tab",overrides:function(t){var e=function(t,e){um.dehighlight(t,e),Di(t,Ei(),{tabbar:t,button:e})},n=function(t,e){um.highlight(t,e),Di(t,Oi(),{tabbar:t,button:e})};return{action:function(r){var o=r.getSystem().getByUid(t.uid).getOrDie(),i=um.isHighlighted(o,r);(i&&t.clickToDismiss?e:i?g:n)(o,r)},domModification:{classes:[t.markers.tabClass]}}}}),zR=p([DR]),AR=Ad({name:"Tabbar",configFields:MR(),partFields:zR(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Df(t.tabbarBehaviours,[um.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,e){je(e.element,"aria-selected","true")},onDehighlight:function(t,e){je(e.element,"aria-selected","false")}}),nh.config({mode:"flow",getInitial:function(t){return um.getHighlighted(t).map((function(t){return t.element}))},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),NR=zd({name:"Tabview",configFields:[Tf("tabviewBehaviours",[ch])],factory:function(t,e){return{uid:t.uid,dom:t.dom,behaviours:Df(t.tabviewBehaviours,[ch.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),BR=p([fo("selectFirst",!0),_u("onChangeTab"),_u("onDismissTab"),fo("tabs",[]),Tf("tabSectionBehaviours",[])]),RR=rd({factory:AR,schema:[Kr("dom"),eo("markers",[Kr("tabClass"),Kr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),HR=rd({factory:NR,name:"tabview"}),VR=p([RR,HR]),IR=Ad({name:"TabSection",configFields:BR(),partFields:VR(),factory:function(t,e,n,r){var o=function(e,n){vd(e,t,"tabbar").each((function(t){n(t).each(zi)}))};return{uid:t.uid,dom:t.dom,components:e,behaviours:Mf(t.tabSectionBehaviours),events:Ri(Y([t.selectFirst?[Gi((function(t,e){o(t,um.getFirst)}))]:[],[Ii(Oi(),(function(e,n){!function(e){var n=_f.getValue(e);vd(e,t,"tabview").each((function(r){var o=X(t.tabs,(function(t){return t.value===n}));o.each((function(n){var o=n.view();Ge(e.element,"id").each((function(t){je(r.element,"aria-labelledby",t)})),ch.set(r,o),t.onChangeTab(r,e,o)}))}))}(n.event.button)})),Ii(Ei(),(function(e,n){var r=n.event.button;t.onDismissTab(e,r)}))]])),apis:{getViewItems:function(e){return vd(e,t,"tabview").map((function(t){return ch.contents(t)})).getOr([])},showTab:function(t,e){o(t,(function(t){var n=um.getCandidates(t);return X(n,(function(t){return _f.getValue(t)===e})).filter((function(e){return!um.isHighlighted(t,e)}))}))}}}},apis:{getViewItems:function(t,e){return t.getViewItems(e)},showTab:function(t,e,n){t.showTab(e,n)}}}),LR=function(t,e){Je(t,"height",e+"px"),he().browser.isIE()?an(t,"flex-basis"):Je(t,"flex-basis",e+"px")},FR=function(t,e,n){uu(t,'[role="dialog"]').each((function(t){su(t,'[role="tablist"]').each((function(r){n.get().map((function(n){return Je(e,"height","0"),Je(e,"flex-basis","0"),Math.min(n,function(t,e,n){var r,o=Se(t).dom,i=uu(t,".tox-dialog-wrap").getOr(t);r="fixed"===tn(i,"position")?Math.max(o.clientHeight,window.innerHeight):Math.max(o.offsetHeight,o.scrollHeight);var a=ln(e),u=e.dom.offsetLeft>=n.dom.offsetLeft+bn(n)?Math.max(ln(n),a):a,c=parseInt(tn(t,"margin-top"),10)||0,s=parseInt(tn(t,"margin-bottom"),10)||0;return r-(ln(t)+c+s-u)}(t,e,r))})).each((function(t){LR(e,t)}))}))}))},PR=function(t){return su(t,'[role="tabpanel"]')},UR=function(t){var e,n,r=(e=Zc(),n=[Gi((function(n){var r=n.element;PR(r).each((function(o){Je(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=function(t,e,n){return U(t,(function(r,o){ch.set(n,t[o].view());var i=e.dom.getBoundingClientRect();return ch.set(n,[]),i.height}))}(t,o,n),i=function(t){return it(rt(t,(function(t,e){return t>e?-1:t<e?1:0})))}(r);i.fold(e.clear,e.set)})),FR(r,o,e),an(o,"visibility"),function(t,e){it(t).each((function(t){return IR.showTab(e,t.value)}))}(t,n),vp.requestAnimationFrame((function(){FR(r,o,e)}))}))})),Ii(bi(),(function(t){var n=t.element;PR(n).each((function(t){FR(n,t,e)}))})),Ii(hw,(function(t,n){var r=t.element;PR(r).each((function(t){var n=zc(Be(t));Je(t,"visibility","hidden");var o=nn(t,"height").map((function(t){return parseInt(t,10)}));an(t,"height"),an(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;o.forall((function(t){return i>t}))?(e.set(i),FR(r,t,e)):o.each((function(e){LR(t,e)})),an(t,"visibility"),n.each(Mc)}))}))],{extraEvents:n,selectFirst:!1});return{smartTabHeight:r,naiveTabHeight:{extraEvents:[],selectFirst:!0}}},jR="send-data-to-section",WR="send-data-to-view",qR=function(t,e){var n=wo({}),r=function(t){var e=_f.getValue(t),r=ER(e).getOr({}),o=n.get(),i=ur(o,r);n.set(i)},o=function(t){var e=n.get();_f.setValue(t,e)},i=wo(null),a=U(t.tabs,(function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[sk.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:U(t.items,(function(t){return l_(n,t,e)})),formBehaviours:xc([nh.config({mode:"acyclic",useTabstopAt:x(Ik)}),sh("TabView.form.events",[Gi(o),$i(r)]),Ec.config({channels:Eo([{key:jR,value:{onReceive:r}},{key:WR,value:{onReceive:o}}])})])}}))]}}})),u=UR(a).smartTabHeight;return IR.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,e,n){var r=_f.getValue(e);Di(t,gw,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[IR.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[AR.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:xc([ew.config({})])}),IR.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:u.selectFirst,tabSectionBehaviours:xc([sh("tabpanel",u.extraEvents),nh.config({mode:"acyclic"}),Hd.config({find:function(t){return it(IR.getViewItems(t))}}),_f.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([jR],{}),n.get()},setValue:function(t,e){n.set(e),t.getSystem().broadcastOn([WR],{})}}})])})},GR=oa("update-dialog"),$R=oa("update-title"),XR=oa("update-body"),KR=oa("update-footer"),YR=oa("body-send-message"),JR=function(t,e,n,r){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:O(O({},e.map((function(t){return{id:t}})).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:xc([yk(0),lz.config({channel:XR,updateState:function(t,e){return N.some({isTabPanel:function(){return"tabpanel"===e.body.type}})},renderComponents:function(t){return"tabpanel"===t.body.type?[qR(t.body,n)]:[_R(t.body,n)]},initialData:t})])}};function QR(t){return QR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},QR(t)}function ZR(t,e){return ZR=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ZR(t,e)}function tH(t,e,n){return tH=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&ZR(o,n.prototype),o},tH.apply(null,arguments)}function eH(t){return function(t){if(Array.isArray(t))return nH(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return nH(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nH(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nH(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var rH=Object.hasOwnProperty,oH=Object.setPrototypeOf,iH=Object.isFrozen,aH=Object.getPrototypeOf,uH=Object.getOwnPropertyDescriptor,cH=Object.freeze,sH=Object.seal,lH=Object.create,fH="undefined"!=typeof Reflect&&Reflect,dH=fH.apply,mH=fH.construct;dH||(dH=function(t,e,n){return t.apply(e,n)}),cH||(cH=function(t){return t}),sH||(sH=function(t){return t}),mH||(mH=function(t,e){return tH(t,eH(e))});var gH,hH=OH(Array.prototype.forEach),pH=OH(Array.prototype.pop),vH=OH(Array.prototype.push),bH=OH(String.prototype.toLowerCase),yH=OH(String.prototype.match),xH=OH(String.prototype.replace),wH=OH(String.prototype.indexOf),CH=OH(String.prototype.trim),SH=OH(RegExp.prototype.test),kH=(gH=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return mH(gH,e)});function OH(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return dH(t,e,r)}}function EH(t,e){oH&&oH(t,null);for(var n=e.length;n--;){var r=e[n];if("string"==typeof r){var o=bH(r);o!==r&&(iH(e)||(e[n]=o),r=o)}t[r]=!0}return t}function _H(t){var e,n=lH(null);for(e in t)dH(rH,t,[e])&&(n[e]=t[e]);return n}function TH(t,e){for(;null!==t;){var n=uH(t,e);if(n){if(n.get)return OH(n.get);if("function"==typeof n.value)return OH(n.value)}t=aH(t)}return function(t){return console.warn("fallback value for",t),null}}var MH=cH(["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"]),DH=cH(["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"]),zH=cH(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),AH=cH(["animate","color-profile","cursor","discard","fedropshadow","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"]),NH=cH(["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"]),BH=cH(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),RH=cH(["#text"]),HH=cH(["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"]),VH=cH(["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"]),IH=cH(["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"]),LH=cH(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FH=sH(/\{\{[\w\W]*|[\w\W]*\}\}/gm),PH=sH(/<%[\w\W]*|[\w\W]*%>/gm),UH=sH(/^data-[\-\w.\u00B7-\uFFFF]/),jH=sH(/^aria-[\-\w]+$/),WH=sH(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qH=sH(/^(?:\w+script|data):/i),GH=sH(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$H=sH(/^html$/i),XH=function(){return"undefined"==typeof window?null:window};var KH=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:XH(),n=function(e){return t(e)};if(n.version="2.3.8",n.removed=[],!e||!e.document||9!==e.document.nodeType)return n.isSupported=!1,n;var r=e.document,o=e.document,i=e.DocumentFragment,a=e.HTMLTemplateElement,u=e.Node,c=e.Element,s=e.NodeFilter,l=e.NamedNodeMap,f=void 0===l?e.NamedNodeMap||e.MozNamedAttrMap:l,d=e.HTMLFormElement,m=e.DOMParser,g=e.trustedTypes,h=c.prototype,p=TH(h,"cloneNode"),v=TH(h,"nextSibling"),b=TH(h,"childNodes"),y=TH(h,"parentNode");if("function"==typeof a){var x=o.createElement("template");x.content&&x.content.ownerDocument&&(o=x.content.ownerDocument)}var w=function(t,e){if("object"!==QR(t)||"function"!=typeof t.createPolicy)return null;var n=null,r="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(r)&&(n=e.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(g,r),C=w?w.createHTML(""):"",S=o,k=S.implementation,O=S.createNodeIterator,E=S.createDocumentFragment,_=S.getElementsByTagName,T=r.importNode,M={};try{M=_H(o).documentMode?o.documentMode:{}}catch(t){}var D={};n.isSupported="function"==typeof y&&k&&void 0!==k.createHTMLDocument&&9!==M;var z,A,N=FH,B=PH,R=UH,H=jH,V=qH,I=GH,L=WH,F=null,P=EH({},[].concat(eH(MH),eH(DH),eH(zH),eH(NH),eH(RH))),U=null,j=EH({},[].concat(eH(HH),eH(VH),eH(IH),eH(LH))),W=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,G=null,$=!0,X=!0,K=!1,Y=!1,J=!1,Q=!1,Z=!1,tt=!1,et=!1,nt=!1,rt=!0,ot=!0,it=!1,at={},ut=null,ct=EH({},["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"]),st=null,lt=EH({},["audio","video","img","source","image","track"]),ft=null,dt=EH({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mt="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml",pt=ht,vt=!1,bt=["application/xhtml+xml","text/html"],yt=null,xt=o.createElement("form"),wt=function(t){return t instanceof RegExp||t instanceof Function},Ct=function(t){yt&&yt===t||(t&&"object"===QR(t)||(t={}),t=_H(t),F="ALLOWED_TAGS"in t?EH({},t.ALLOWED_TAGS):P,U="ALLOWED_ATTR"in t?EH({},t.ALLOWED_ATTR):j,ft="ADD_URI_SAFE_ATTR"in t?EH(_H(dt),t.ADD_URI_SAFE_ATTR):dt,st="ADD_DATA_URI_TAGS"in t?EH(_H(lt),t.ADD_DATA_URI_TAGS):lt,ut="FORBID_CONTENTS"in t?EH({},t.FORBID_CONTENTS):ct,q="FORBID_TAGS"in t?EH({},t.FORBID_TAGS):{},G="FORBID_ATTR"in t?EH({},t.FORBID_ATTR):{},at="USE_PROFILES"in t&&t.USE_PROFILES,$=!1!==t.ALLOW_ARIA_ATTR,X=!1!==t.ALLOW_DATA_ATTR,K=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=t.SAFE_FOR_TEMPLATES||!1,J=t.WHOLE_DOCUMENT||!1,tt=t.RETURN_DOM||!1,et=t.RETURN_DOM_FRAGMENT||!1,nt=t.RETURN_TRUSTED_TYPE||!1,Z=t.FORCE_BODY||!1,rt=!1!==t.SANITIZE_DOM,ot=!1!==t.KEEP_CONTENT,it=t.IN_PLACE||!1,L=t.ALLOWED_URI_REGEXP||L,pt=t.NAMESPACE||ht,t.CUSTOM_ELEMENT_HANDLING&&wt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&wt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(W.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),z=z=-1===bt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,A="application/xhtml+xml"===z?function(t){return t}:bH,Y&&(X=!1),et&&(tt=!0),at&&(F=EH({},eH(RH)),U=[],!0===at.html&&(EH(F,MH),EH(U,HH)),!0===at.svg&&(EH(F,DH),EH(U,VH),EH(U,LH)),!0===at.svgFilters&&(EH(F,zH),EH(U,VH),EH(U,LH)),!0===at.mathMl&&(EH(F,NH),EH(U,IH),EH(U,LH))),t.ADD_TAGS&&(F===P&&(F=_H(F)),EH(F,t.ADD_TAGS)),t.ADD_ATTR&&(U===j&&(U=_H(U)),EH(U,t.ADD_ATTR)),t.ADD_URI_SAFE_ATTR&&EH(ft,t.ADD_URI_SAFE_ATTR),t.FORBID_CONTENTS&&(ut===ct&&(ut=_H(ut)),EH(ut,t.FORBID_CONTENTS)),ot&&(F["#text"]=!0),J&&EH(F,["html","head","body"]),F.table&&(EH(F,["tbody"]),delete q.tbody),cH&&cH(t),yt=t)},St=EH({},["mi","mo","mn","ms","mtext"]),kt=EH({},["foreignobject","desc","title","annotation-xml"]),Ot=EH({},["title","style","font","a","script"]),Et=EH({},DH);EH(Et,zH),EH(Et,AH);var _t=EH({},NH);EH(_t,BH);var Tt=function(t){vH(n.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=C}catch(e){t.remove()}}},Mt=function(t,e){try{vH(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){vH(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!U[t])if(tt||et)try{Tt(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Dt=function(t){var e,n;if(Z)t="<remove></remove>"+t;else{var r=yH(t,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===z&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var i=w?w.createHTML(t):t;if(pt===ht)try{e=(new m).parseFromString(i,z)}catch(t){}if(!e||!e.documentElement){e=k.createDocument(pt,"template",null);try{e.documentElement.innerHTML=vt?"":i}catch(t){}}var a=e.body||e.documentElement;return t&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),pt===ht?_.call(e,J?"html":"body")[0]:J?e.documentElement:a},zt=function(t){return O.call(t.ownerDocument||t,t,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},At=function(t){return"object"===QR(u)?t instanceof u:t&&"object"===QR(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Nt=function(t,e,r){D[t]&&hH(D[t],(function(t){t.call(n,e,r,yt)}))},Bt=function(t){var e,r;if(Nt("beforeSanitizeElements",t,null),(r=t)instanceof d&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof f)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore))return Tt(t),!0;if(SH(/[\u0080-\uFFFF]/,t.nodeName))return Tt(t),!0;var o=A(t.nodeName);if(Nt("uponSanitizeElement",t,{tagName:o,allowedTags:F}),t.hasChildNodes()&&!At(t.firstElementChild)&&(!At(t.content)||!At(t.content.firstElementChild))&&SH(/<[/\w]/g,t.innerHTML)&&SH(/<[/\w]/g,t.textContent))return Tt(t),!0;if("select"===o&&SH(/<template/i,t.innerHTML))return Tt(t),!0;if(!F[o]||q[o]){if(!q[o]&&Ht(o)){if(W.tagNameCheck instanceof RegExp&&SH(W.tagNameCheck,o))return!1;if(W.tagNameCheck instanceof Function&&W.tagNameCheck(o))return!1}if(ot&&!ut[o]){var i=y(t)||t.parentNode,a=b(t)||t.childNodes;if(a&&i)for(var u=a.length-1;u>=0;--u)i.insertBefore(p(a[u],!0),v(t))}return Tt(t),!0}return t instanceof c&&!function(t){var e=y(t);e&&e.tagName||(e={namespaceURI:ht,tagName:"template"});var n=bH(t.tagName),r=bH(e.tagName);return t.namespaceURI===gt?e.namespaceURI===ht?"svg"===n:e.namespaceURI===mt?"svg"===n&&("annotation-xml"===r||St[r]):Boolean(Et[n]):t.namespaceURI===mt?e.namespaceURI===ht?"math"===n:e.namespaceURI===gt?"math"===n&&kt[r]:Boolean(_t[n]):t.namespaceURI===ht&&!(e.namespaceURI===gt&&!kt[r])&&!(e.namespaceURI===mt&&!St[r])&&!_t[n]&&(Ot[n]||!Et[n])}(t)?(Tt(t),!0):"noscript"!==o&&"noembed"!==o||!SH(/<\/no(script|embed)/i,t.innerHTML)?(Y&&3===t.nodeType&&(e=t.textContent,e=xH(e,N," "),e=xH(e,B," "),t.textContent!==e&&(vH(n.removed,{element:t.cloneNode()}),t.textContent=e)),Nt("afterSanitizeElements",t,null),!1):(Tt(t),!0)},Rt=function(t,e,n){if(rt&&("id"===e||"name"===e)&&(n in o||n in xt))return!1;if(X&&!G[e]&&SH(R,e));else if($&&SH(H,e));else if(!U[e]||G[e]){if(!(Ht(t)&&(W.tagNameCheck instanceof RegExp&&SH(W.tagNameCheck,t)||W.tagNameCheck instanceof Function&&W.tagNameCheck(t))&&(W.attributeNameCheck instanceof RegExp&&SH(W.attributeNameCheck,e)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(e))||"is"===e&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&SH(W.tagNameCheck,n)||W.tagNameCheck instanceof Function&&W.tagNameCheck(n))))return!1}else if(ft[e]);else if(SH(L,xH(n,I,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==wH(n,"data:")||!st[t]){if(K&&!SH(V,xH(n,I,"")));else if(n)return!1}else;return!0},Ht=function(t){return t.indexOf("-")>0},Vt=function(t){var e,r,o,i;Nt("beforeSanitizeAttributes",t,null);var a=t.attributes;if(a){var u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(i=a.length;i--;){var c=e=a[i],s=c.name,l=c.namespaceURI;if(r="value"===s?e.value:CH(e.value),o=A(s),u.attrName=o,u.attrValue=r,u.keepAttr=!0,u.forceKeepAttr=void 0,Nt("uponSanitizeAttribute",t,u),r=u.attrValue,!u.forceKeepAttr&&(Mt(s,t),u.keepAttr))if(SH(/\/>/i,r))Mt(s,t);else{Y&&(r=xH(r,N," "),r=xH(r,B," "));var f=A(t.nodeName);if(Rt(f,o,r))try{l?t.setAttributeNS(l,s,r):t.setAttribute(s,r),pH(n.removed)}catch(t){}}}Nt("afterSanitizeAttributes",t,null)}},It=function t(e){var n,r=zt(e);for(Nt("beforeSanitizeShadowDOM",e,null);n=r.nextNode();)Nt("uponSanitizeShadowNode",n,null),Bt(n)||(n.content instanceof i&&t(n.content),Vt(n));Nt("afterSanitizeShadowDOM",e,null)};return n.sanitize=function(t,o){var a,c,s,l,f;if((vt=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!At(t)){if("function"!=typeof t.toString)throw kH("toString is not a function");if("string"!=typeof(t=t.toString()))throw kH("dirty is not a string, aborting")}if(!n.isSupported){if("object"===QR(e.toStaticHTML)||"function"==typeof e.toStaticHTML){if("string"==typeof t)return e.toStaticHTML(t);if(At(t))return e.toStaticHTML(t.outerHTML)}return t}if(Q||Ct(o),n.removed=[],"string"==typeof t&&(it=!1),it){if(t.nodeName){var d=A(t.nodeName);if(!F[d]||q[d])throw kH("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof u)1===(c=(a=Dt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?a=c:a.appendChild(c);else{if(!tt&&!Y&&!J&&-1===t.indexOf("<"))return w&&nt?w.createHTML(t):t;if(!(a=Dt(t)))return tt?null:nt?C:""}a&&Z&&Tt(a.firstChild);for(var m=zt(it?t:a);s=m.nextNode();)3===s.nodeType&&s===l||Bt(s)||(s.content instanceof i&&It(s.content),Vt(s),l=s);if(l=null,it)return t;if(tt){if(et)for(f=E.call(a.ownerDocument);a.firstChild;)f.appendChild(a.firstChild);else f=a;return U.shadowroot&&(f=T.call(r,f,!0)),f}var g=J?a.outerHTML:a.innerHTML;return J&&F["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&SH($H,a.ownerDocument.doctype.name)&&(g="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+g),Y&&(g=xH(g,N," "),g=xH(g,B," ")),w&&nt?w.createHTML(g):g},n.setConfig=function(t){Ct(t),Q=!0},n.clearConfig=function(){yt=null,Q=!1},n.isValidAttribute=function(t,e,n){yt||Ct({});var r=A(t),o=A(e);return Rt(r,o,n)},n.addHook=function(t,e){"function"==typeof e&&(D[t]=D[t]||[],vH(D[t],e))},n.removeHook=function(t){if(D[t])return pH(D[t])},n.removeHooks=function(t){D[t]&&(D[t]=[])},n.removeAllHooks=function(){D={}},n}(),YH=function(t){return KH().sanitize(t)},JH=ay.deviceType.isTouch(),QH=function(t,e){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,e]}},ZH=function(t,e){return tB.parts.close(bp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close")}},action:t,buttonBehaviours:xc([ew.config({})])}))},tV=function(){return tB.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},eV=function(t,e){return tB.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:NM("<p>"+YH(e.translate(t))+"</p>")}]}]})},nV=function(t){return tB.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},rV=function(t,e){return[Xx.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Xx.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:e})]},oV=function(t){var e,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return tB.sketch({lazySink:t.lazySink,onEscape:function(e){return t.onEscape(e),N.some(!0)},useTabstopAt:function(t){return!Ik(t)},dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:O({position:"relative"},t.extraStyles)},components:_([t.header,t.body],t.footer.toArray(),!0),parts:{blocker:{dom:NM('<div class="'+r+'"></div>'),components:[{dom:{tag:"div",classes:JH?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:xc(_([gh.config({}),sh("dialog-events",t.dialogEvents.concat([qi(qo(),(function(t,e){nh.focusIn(t)}))])),sh("scroll-lock",[Gi((function(){Va(Fe(),i)})),$i((function(){La(Fe(),i)}))])],t.extraBehaviours,!0)),eventOrder:O((e={},e[ci()]=["dialog-events"],e[yi()]=["scroll-lock","dialog-events","alloy.base.behaviour"],e[xi()]=["alloy.base.behaviour","dialog-events","scroll-lock"],e),t.eventOrder)})},iV=function(t){return bp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Mp("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){Mi(t,sw)}})},aV=function(t,e,n){var r=function(t){return[Ja(n.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:O({},e.map((function(t){return{id:t}})).getOr({}))},components:r(t),behaviours:xc([lz.config({channel:$R,renderComponents:r})])}},uV=function(){return{dom:NM('<div class="tox-dialog__draghandle"></div>')}},cV=function(t,e){return function(t,e){var n=tB.parts.title(aV(t,N.none(),e)),r=tB.parts.draghandle(uV()),o=tB.parts.close(iV(e)),i=[n].concat(t.draggable?[r]:[]).concat([o]);return Xx.sketch({dom:NM('<div class="tox-dialog__header"></div>'),components:i})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},e.shared.providers)},sV=function(t,e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:e,components:[{dom:NM('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},lV=function(t,e,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){tB.setBusy(t(),(function(t,r){return sV(n.message,r,e)}))},onUnblock:function(){tB.setIdle(t())}}},fV=function(t,e,n,r){var o;return tu(oV(O(O({},t),{lazySink:r.shared.getSink,extraBehaviours:_([lz.config({channel:GR,updateState:function(t,e){return N.some(e)},initialData:e}),Dk({})],t.extraBehaviours,!0),onEscape:function(t){Mi(t,sw)},dialogEvents:n,eventOrder:(o={},o[ui()]=[lz.name(),Ec.name()],o[yi()]=["scroll-lock",lz.name(),"messages","dialog-events","alloy.base.behaviour"],o[xi()]=["alloy.base.behaviour","dialog-events","messages",lz.name(),"scroll-lock"],o)})))},dV=function(t){return U(t,(function(t){return"menu"===t.type?function(t){var e=U(t.items,(function(t){var e=wo(!1);return O(O({},t),{storage:e})}));return O(O({},t),{items:e})}(t):t}))},mV=function(t){return $(t,(function(t,e){return"menu"===e.type?$(e.items,(function(t,e){return t[e.name]=e.storage,t}),t):t}),{})},gV=function(t,e){return[Ui(qo(),Vk),t(cw,(function(t,n){e.onClose(),n.onClose()})),t(sw,(function(t,e,n,r){e.onCancel(t),Mi(r,cw)})),Ii(mw,(function(t,n){return e.onUnblock()})),Ii(dw,(function(t,n){return e.onBlock(n.event)}))]},hV=function(t,e){var n=function(e,n){return Ii(e,(function(e,o){r(e,(function(r,i){n(t(),r,o.event,e)}))}))},r=function(t,e){lz.getState(t).get().each((function(n){e(n,t)}))};return _(_([],gV(n,e),!0),[n(lw,(function(t,e,n){e.onAction(t,{name:n.name})}))],!1)},pV=function(t,e,n){var r=function(e,n){return Ii(e,(function(e,r){o(e,(function(o,i){n(t(),o,r.event,e)}))}))},o=function(t,e){lz.getState(t).get().each((function(n){e(n.internalDialog,t)}))};return _(_([],gV(r,e),!0),[r(fw,(function(t,e){return e.onSubmit(t)})),r(uw,(function(t,e,n){e.onChange(t,{name:n.name})})),r(lw,(function(t,e,r,o){var i=function(){return nh.focusIn(o)},a=function(t){return $e(t,"disabled")||Ge(t,"aria-disabled").exists((function(t){return"true"===t}))},u=Be(o.element),c=zc(u);e.onAction(t,{name:r.name,value:r.value}),zc(u).fold(i,(function(t){a(t)||c.exists((function(e){return xe(t,e)&&a(e)}))?i():n().toOptional().filter((function(e){return!xe(e.element,t)})).each(i)}))})),r(gw,(function(t,e,n){e.onTabChange(t,{newTabName:n.name,oldTabName:n.oldName})})),$i((function(e){var n=t();_f.setValue(e,n.getData())}))],!1)},vV=function(t,e){var n=e.map((function(t){return t.footerButtons})).getOr([]),r=W(n,(function(t){return"start"===t.align})),o=function(t,e){return Xx.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:U(e,(function(t){return t.memento.asSpec()}))})};return[o("start",r.pass),o("end",r.fail)]},bV=function(t,e){return{dom:NM('<div class="tox-dialog__footer"></div>'),components:[],behaviours:xc([lz.config({channel:KR,initialData:t,updateState:function(t,n){var r=U(n.buttons,(function(t){var n=yp(function(t,e){return QO(t,t.type,e)}(t,e));return{name:t.name,align:t.align,memento:n}}));return N.some({lookupByName:function(t,e){return function(t,e,n){return X(e,(function(t){return t.name===n})).bind((function(e){return e.memento.getOpt(t)}))}(t,r,e)},footerButtons:r})},renderComponents:vV})])}},yV=function(t,e){return tB.parts.footer(bV(t,e))},xV=function(t,e){if(t.getRoot().getSystem().isConnected()){var n=Hd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return sk.getField(n,e).fold((function(){var r=t.getFooter();return lz.getState(r).get().bind((function(t){return t.lookupByName(n,e)}))}),(function(t){return N.some(t)}))}return N.none()},wV=function(t,e,n){var o=function(e){var n=t.getRoot();n.getSystem().isConnected()&&e(n)},i={getData:function(){var e=t.getRoot(),r=e.getSystem().isConnected()?t.getFormWrapper():e,o=_f.getValue(r),i=dt(n,(function(t){return t.get()}));return O(O({},o),i)},setData:function(e){o((function(r){var o=i.getData(),a=O(O({},o),e),u=function(t,e){var n=t.getRoot();return lz.getState(n).get().map((function(t){return Ur(Pr("data",t.dataValidator,e))})).getOr(e)}(t,a),c=t.getFormWrapper();_f.setValue(c,u),ft(n,(function(t,e){yt(a,e)&&t.set(a[e])}))}))},disable:function(e){xV(t,e).each(Yd.disable)},enable:function(e){xV(t,e).each(Yd.enable)},focus:function(e){xV(t,e).each(gh.focus)},block:function(t){if(!r(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");o((function(e){Di(e,dw,{message:t})}))},unblock:function(){o((function(t){Mi(t,mw)}))},showTab:function(e){o((function(n){var r=t.getBody();lz.getState(r).get().exists((function(t){return t.isTabPanel()}))&&Hd.getCurrent(r).each((function(t){IR.showTab(t,e)}))}))},redial:function(t){o((function(n){var r=e(t);n.getSystem().broadcastOn([GR],r),n.getSystem().broadcastOn([$R],r.internalDialog),n.getSystem().broadcastOn([XR],r.internalDialog),n.getSystem().broadcastOn([KR],r.internalDialog),i.setData(r.initialData)}))},close:function(){o((function(t){Mi(t,cw)}))}};return i},CV=function(t,e,n){var r=cV(t.internalDialog.title,n),o=function(t,e){var n=JR(t,N.none(),e,!1);return tB.parts.body(n)}({body:t.internalDialog.body},n),i=dV(t.internalDialog.buttons),a=mV(i),u=yV({buttons:i},n),c=pV((function(){return m}),lV((function(){return f}),n.shared.providers,e),n.shared.getSink),s=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),l={header:r,body:o,footer:N.some(u),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=fV(l,t,c,n),d={getRoot:p(f),getBody:function(){return tB.getBody(f)},getFooter:function(){return tB.getFooter(f)},getFormWrapper:function(){var t=tB.getBody(f);return Hd.getCurrent(t).getOr(t)}},m=wV(d,e.redial,a);return{dialog:f,instanceApi:m}},SV=function(t,e,n,r){var o,i,a,u,c,s=oa("dialog-label"),l=oa("dialog-content"),f=yp((a={title:t.internalDialog.title,draggable:!0},u=s,c=n.shared.providers,Xx.sketch({dom:NM('<div class="tox-dialog__header"></div>'),components:[aV(a,N.some(u),c),uV(),iV(c)],containerBehaviours:xc([LN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return lu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),d=yp(function(t,e,n,r){return JR(t,N.some(e),n,r)}({body:t.internalDialog.body},l,n,r)),m=dV(t.internalDialog.buttons),g=mV(m),h=yp(function(t,e){return bV(t,e)}({buttons:m},n)),v=pV((function(){return y}),{onBlock:function(t){AM.block(b,(function(e,r){return sV(t.message,r,n.shared.providers)}))},onUnblock:function(){AM.unblock(b)},onClose:function(){return e.closeWindow()}},n.shared.getSink),b=tu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=s,o["aria-describedby"]=l,o)},eventOrder:(i={},i[ui()]=[lz.name(),Ec.name()],i[ci()]=["execute-on-form"],i[yi()]=["reflecting","execute-on-form"],i),behaviours:xc([nh.config({mode:"cyclic",onEscape:function(t){return Mi(t,cw),N.some(!0)},useTabstopAt:function(t){return!Ik(t)&&("button"!==Rt(t)||"disabled"!==qe(t,"disabled"))}}),lz.config({channel:GR,updateState:function(t,e){return N.some(e)},initialData:t}),gh.config({}),sh("execute-on-form",v.concat([qi(qo(),(function(t,e){nh.focusIn(t)}))])),AM.config({getRoot:function(){return N.some(b)}}),ch.config({}),Dk({})]),components:[f.asSpec(),d.asSpec(),h.asSpec()]}),y=wV({getRoot:p(b),getFooter:function(){return h.get(b)},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return Hd.getCurrent(t).getOr(t)}},e.redial,g);return{dialog:b,instanceApi:y}},kV=tinymce.util.Tools.resolve("tinymce.util.URI"),OV=["insertContent","setContent","execCommand","close","block","unblock"],EV=function(t){return o(t)&&-1!==OV.indexOf(t.mceAction)},_V=function(t,e,n,i){var a,c,s,l=cV(t.title,i),f=function(t){var e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Rk({dom:{tag:"iframe",attributes:{src:t.url}},behaviours:xc([ew.config({}),gh.config({})])})]}],behaviours:xc([nh.config({mode:"acyclic",useTabstopAt:x(Ik)})])};return tB.parts.body(e)}(t),d=t.buttons.bind((function(t){return 0===t.length?N.none():N.some(yV({buttons:t},i))})),m=hV((function(){return C}),lV((function(){return w}),i.shared.providers,e)),g=O(O({},t.height.fold((function(){return{}}),(function(t){return{height:t+"px","max-height":t+"px"}}))),t.width.fold((function(){return{}}),(function(t){return{width:t+"px","max-width":t+"px"}}))),h=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],p=new kV(t.url,{base_uri:new kV(window.location.href)}),v=p.protocol+"://"+p.host+(p.port?":"+p.port:""),b=Qc(),y=[sh("messages",[Gi((function(){var e=es(Nt.fromDom(window),"message",(function(e){if(p.isSameOrigin(new kV(e.raw.origin))){var r=e.raw.data;EV(r)?function(t,e,n){switch(n.mceAction){case"insertContent":t.insertContent(n.content);break;case"setContent":t.setContent(n.content);break;case"execCommand":var r=!!u(n.ui)&&n.ui;t.execCommand(n.cmd,r,n.value);break;case"close":e.close();break;case"block":e.block(n.message);break;case"unblock":e.unblock()}}(n,C,r):function(t){return!EV(t)&&o(t)&&yt(t,"mceAction")}(r)&&t.onMessage(C,r)}}));b.set(e)})),$i(b.clear)]),Ec.config({channels:(a={},a[YR]={onReceive:function(t,e){su(t.element,"iframe").each((function(t){t.dom.contentWindow.postMessage(e,v)}))}},a)})],w=fV({header:l,body:f,footer:d,extraClasses:h,extraBehaviours:y,extraStyles:g},t,m,i),C=(c=w,s=function(t){c.getSystem().isConnected()&&t(c)},{block:function(t){if(!r(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s((function(e){Di(e,dw,{message:t})}))},unblock:function(){s((function(t){Mi(t,mw)}))},close:function(){s((function(t){Mi(t,cw)}))},sendMessage:function(t){s((function(e){e.getSystem().broadcastOn([YR],t)}))}});return{dialog:w,instanceApi:C}},TV=function(t,e,n){return e&&n?[]:[IT.config({contextual:{lazyContext:function(){return N.some(Ln(Nt.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},MV=function(t){var e=t.backstage,n=t.editor,r=Ib(n),o=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(){tB.hide(c),r()},i=yp(QO({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:N.none()},"cancel",t.backstage)),a=tV(),u=ZH(o,e.providers),c=tu(oV({lazySink:function(){return e.getSink()},header:QH(a,u),body:eV(n,e.providers),footer:N.some(nV(rV([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(sw,o)],eventOrder:{}}));tB.show(c);var s=i.get(c);gh.focus(s)}}}(t),i=function(t){var e=t.backstage.shared;return{open:function(n,r){var o=function(t){tB.hide(s),r(t)},i=yp(QO({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:N.none()},"submit",t.backstage)),a=QO({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:N.none()},"cancel",t.backstage),u=tV(),c=ZH((function(){return o(!1)}),e.providers),s=tu(oV({lazySink:function(){return e.getSink()},header:QH(u,c),body:eV(n,e.providers),footer:N.some(nV(rV([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Ii(sw,(function(){return o(!1)})),Ii(fw,(function(){return o(!0)}))],eventOrder:{}}));tB.show(s);var l=i.get(s);gh.focus(l)}}}(t),a=function(t,r){return OR.openUrl((function(t){var o=_V(t,{closeWindow:function(){tB.hide(o.dialog),r(o.instanceApi)}},n,e);return tB.show(o.dialog),o.instanceApi}),t)},u=function(t,n){return OR.open((function(t,r,o){var i=r,a=CV({dataValidator:o,initialData:i,internalDialog:t},{redial:OR.redial,closeWindow:function(){tB.hide(a.dialog),n(a.instanceApi)}},e);return tB.show(a.dialog),a.instanceApi.setData(i),a.instanceApi}),t)},c=function(t,o,i,a){return OR.open((function(t,u,c){var s=Ur(Pr("data",c,u)),l=Zc(),f=e.shared.header.isPositionedAtTop(),d=function(){return l.on((function(t){Jh.reposition(t),IT.refresh(t)}))},m=SV({dataValidator:c,initialData:s,internalDialog:t},{redial:OR.redial,closeWindow:function(){l.on(Jh.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},e,a),g=tu(Jh.sketch(O(O({lazySink:e.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:xc(_([sh("window-manager-inline-events",[Ii(wi(),(function(t,e){Mi(m.dialog,sw)}))])],TV(n,r,f),!0)),isExtraPart:function(t,e){return function(t){return Bx(t,".tox-alert-dialog")||Bx(t,".tox-confirm-dialog")}(e)}})));return l.set(g),Jh.showWithin(g,eu(m.dialog),{anchor:o},N.some(Fe())),r&&f||(IT.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),nh.focusIn(m.dialog),m.instanceApi}),t)};return{open:function(t,n,r){return void 0!==n&&"toolbar"===n.inline?c(t,e.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?c(t,e.shared.anchors.cursor(),r,n.ariaAttrs):u(t,r)},openUrl:function(t,e){return a(t,e)},alert:function(t,e){o.open(t,(function(){e()}))},close:function(t){t.close()},confirm:function(t,e){i.open(t,(function(t){e(t)}))}}};k.add("silver",(function(t){var e=YN(t),n=e.uiMothership,r=e.backstage,o=e.renderUI,i=e.getUi;Nx(t,r.shared);var a=MV({editor:t,backstage:r});return{renderUI:o,getWindowManagerImpl:p(a),getNotificationManagerImpl:function(){return Ap(t,{backstage:r},n)},ui:i()}}))}(),function(){"use strict";var t=function(){return t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},t.apply(this,arguments)};function e(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function n(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var r=function(t){return function(e){return function(t){var e=typeof t;return null===t?"null":"object"===e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"===e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(e)===t}},o=function(t){return function(e){return typeof e===t}},i=function(t){return function(e){return t===e}},a=r("string"),u=r("object"),c=r("array"),s=i(null),l=o("boolean"),f=i(void 0),d=function(t){return!function(t){return null==t}(t)},m=o("function"),g=o("number"),h=function(){},p=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t(e.apply(null,n))}},v=function(t){return function(){return t}},b=function(t){return t},y=function(t,e){return t===e};function x(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.concat(n);return t.apply(null,o)}}var w,C,S=function(t){return function(e){return!t(e)}},k=function(t){return function(){throw new Error(t)}},O=function(t){return t()},E=v(!1),_=v(!0),T=function(){return M},M={fold:function(t,e){return t()},isSome:E,isNone:_,getOr:C=b,getOrThunk:w=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(void 0),or:C,orThunk:w,map:T,each:h,bind:T,exists:E,forall:_,filter:function(){return T()},toArray:function(){return[]},toString:v("none()")},D=function(t){var e=v(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},isSome:_,isNone:E,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return D(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:M},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},z={some:D,none:T,from:function(t){return null==t?M:D(t)}},A=function(t){var e,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,e=t.apply(null,r)),e}},N=Array.prototype.slice,B=Array.prototype.indexOf,R=Array.prototype.push,H=function(t,e){return function(t,e){return B.call(t,e)}(t,e)>-1},V=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return!0}return!1},I=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o)}return r},L=function(t,e){for(var n=0,r=t.length;n<r;n++){e(t[n],n)}},F=function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r)&&n.push(i)}return n},P=function(t,e,n){return function(t,e){for(var n=t.length-1;n>=0;n--)e(t[n],n)}(t,(function(t,r){n=e(n,t,r)})),n},U=function(t,e,n){return L(t,(function(t,r){n=e(n,t,r)})),n},j=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return z.some(i);if(n(i,r))break}return z.none()}(t,e,E)},W=function(t,e){for(var n=0,r=t.length;n<r;n++){if(e(t[n],n))return z.some(n)}return z.none()},q=function(t){for(var e=[],n=0,r=t.length;n<r;++n){if(!c(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);R.apply(e,t[n])}return e},G=function(t,e){return q(I(t,e))},$=function(t,e){for(var n=0,r=t.length;n<r;++n){if(!0!==e(t[n],n))return!1}return!0},X=function(t){var e=N.call(t,0);return e.reverse(),e},K=function(t,e){return F(t,(function(t){return!H(e,t)}))},Y=function(t){return[t]},J=function(t){return function(t,e){return e>=0&&e<t.length?z.some(t[e]):z.none()}(t,0)},Q=function(t,e){for(var n=0;n<t.length;n++){var r=e(t[n],n);if(r.isSome())return r}return z.none()},Z=function(){return tt(0,0)},tt=function(t,e){return{major:t,minor:e}},et={nu:tt,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?Z():function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.test(e))return r}}(t,e);if(!n)return{major:0,minor:0};var r=function(t){return Number(e.replace(n,"$"+t))};return tt(r(1),r(2))}(t,n)},unknown:Z},nt=function(t,e){var n=String(e).toLowerCase();return j(t,(function(t){return t.search(n)}))},rt=function(t,e){return-1!==t.indexOf(e)},ot=function(t){return function(e){return e.replace(t,"")}}(/^\s+|\s+$/g),it=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,at=function(t){return function(e){return rt(e,t)}},ut=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return rt(t,"edge/")&&rt(t,"chrome")&&rt(t,"safari")&&rt(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,it],search:function(t){return rt(t,"chrome")&&!rt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return rt(t,"msie")||rt(t,"trident")}},{name:"Opera",versionRegexes:[it,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:at("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:at("firefox")},{name:"Safari",versionRegexes:[it,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(rt(t,"safari")||rt(t,"mobile/"))&&rt(t,"applewebkit")}}],ct=[{name:"Windows",search:at("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return rt(t,"iphone")||rt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:at("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:at("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:at("linux"),versionRegexes:[]},{name:"Solaris",search:at("sunos"),versionRegexes:[]},{name:"FreeBSD",search:at("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:at("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],st={browsers:v(ut),oses:v(ct)},lt="Edge",ft="Chrome",dt="Opera",mt="Firefox",gt="Safari",ht=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isEdge:r(lt),isChrome:r(ft),isIE:r("IE"),isOpera:r(dt),isFirefox:r(mt),isSafari:r(gt)}},pt={unknown:function(){return ht({current:void 0,version:et.unknown()})},nu:ht,edge:v(lt),chrome:v(ft),ie:v("IE"),opera:v(dt),firefox:v(mt),safari:v(gt)},vt="Windows",bt="Android",yt="Linux",xt="Solaris",wt="FreeBSD",Ct="ChromeOS",St=function(t){var e=t.current,n=t.version,r=function(t){return function(){return e===t}};return{current:e,version:n,isWindows:r(vt),isiOS:r("iOS"),isAndroid:r(bt),isOSX:r("OSX"),isLinux:r(yt),isSolaris:r(xt),isFreeBSD:r(wt),isChromeOS:r(Ct)}},kt={unknown:function(){return St({current:void 0,version:et.unknown()})},nu:St,windows:v(vt),ios:v("iOS"),android:v(bt),linux:v(yt),osx:v("OSX"),solaris:v(xt),freebsd:v(wt),chromeos:v(Ct)},Ot=function(t,e,n){var r=st.browsers(),o=st.oses(),i=e.bind((function(t){return function(t,e){return Q(e.brands,(function(e){var n=e.brand.toLowerCase();return j(t,(function(t){var e;return n===(null===(e=t.brand)||void 0===e?void 0:e.toLowerCase())})).map((function(t){return{current:t.name,version:et.nu(parseInt(e.version,10),0)}}))}))}(r,t)})).orThunk((function(){return function(t,e){return nt(t,e).map((function(t){var n=et.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(r,t)})).fold(pt.unknown,pt.nu),a=function(t,e){return nt(t,e).map((function(t){var n=et.detect(t.versionRegexes,e);return{current:t.name,version:n}}))}(o,t).fold(kt.unknown,kt.nu),u=function(t,e,n,r){var o=t.isiOS()&&!0===/ipad/i.test(n),i=t.isiOS()&&!o,a=t.isiOS()||t.isAndroid(),u=a||r("(pointer:coarse)"),c=o||!i&&a&&r("(min-device-width:768px)"),s=i||a&&!c,l=e.isSafari()&&t.isiOS()&&!1===/safari/i.test(n),f=!s&&!c&&!l;return{isiPad:v(o),isiPhone:v(i),isTablet:v(c),isPhone:v(s),isTouch:v(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:v(l),isDesktop:v(f)}}(a,i,t,n);return{browser:i,os:a,deviceType:u}},Et=function(t){return window.matchMedia(t).matches},_t=A((function(){return Ot(navigator.userAgent,z.from(navigator.userAgentData),Et)})),Tt=function(){return _t()},Mt=v,Dt=Mt("touchstart"),zt=Mt("touchmove"),At=Mt("touchend"),Nt=Mt("mousedown"),Bt=Mt("mousemove"),Rt=Mt("mouseup"),Ht=Mt("mouseover"),Vt=Mt("keydown"),It=Mt("keyup"),Lt=Mt("input"),Ft=Mt("change"),Pt=Mt("click"),Ut=Mt("transitionend"),jt=Mt("selectstart"),Wt=function(t){return v("alloy."+t)},qt={tap:Wt("tap")},Gt=Wt("focus"),$t=Wt("blur.post"),Xt=Wt("paste.post"),Kt=Wt("receive"),Yt=Wt("execute"),Jt=Wt("focus.item"),Qt=qt.tap,Zt=Wt("longpress"),te=Wt("system.init"),ee=Wt("system.attached"),ne=Wt("system.detached"),re=Wt("focusmanager.shifted"),oe=Wt("highlight"),ie=Wt("dehighlight"),ae=function(t,e){le(t,t.element,e,{})},ue=function(t,e,n){le(t,t.element,e,n)},ce=function(t){ae(t,Yt())},se=function(t,e,n){le(t,e,n,{})},le=function(e,n,r,o){var i=t({target:n},o);e.getSystem().triggerEvent(r,n,i)},fe=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},de={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||n.childNodes.length>1)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return fe(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return fe(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return fe(n)},fromDom:fe,fromPoint:function(t,e,n){return z.from(t.dom.elementFromPoint(e,n)).map(fe)}},me=function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(void 0!==r.matches)return r.matches(e);if(void 0!==r.msMatchesSelector)return r.msMatchesSelector(e);if(void 0!==r.webkitMatchesSelector)return r.webkitMatchesSelector(e);if(void 0!==r.mozMatchesSelector)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ge=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},he=function(t,e){var n=void 0===e?document:e.dom;return ge(n)?[]:I(n.querySelectorAll(t),de.fromDom)},pe=function(t,e){var n=void 0===e?document:e.dom;return ge(n)?z.none():z.from(n.querySelector(t)).map(de.fromDom)},ve=function(t,e){return t.dom===e.dom};"undefined"!=typeof window?window:Function("return this;")();var be,ye=function(t){return t.dom.nodeName.toLowerCase()},xe=function(t){return function(e){return function(t){return t.dom.nodeType}(e)===t}},we=xe(1),Ce=xe(3),Se=xe(9),ke=xe(11),Oe=function(t){return de.fromDom(t.dom.ownerDocument)},Ee=function(t){return Se(t)?t:Oe(t)},_e=function(t){return z.from(t.dom.parentNode).map(de.fromDom)},Te=function(t){return I(t.dom.childNodes,de.fromDom)},Me=function(t,e){var n=t.dom.childNodes;return z.from(n[e]).map(de.fromDom)},De=function(t,e){_e(t).each((function(n){n.dom.insertBefore(e.dom,t.dom)}))},ze=function(t,e){var n=function(t){return z.from(t.dom.nextSibling).map(de.fromDom)}(t);n.fold((function(){_e(t).each((function(t){Ne(t,e)}))}),(function(t){De(t,e)}))},Ae=function(t,e){var n=function(t){return Me(t,0)}(t);n.fold((function(){Ne(t,e)}),(function(n){t.dom.insertBefore(e.dom,n.dom)}))},Ne=function(t,e){t.dom.appendChild(e.dom)},Be=function(t,e){L(e,(function(e){Ne(t,e)}))},Re=function(t){t.dom.textContent="",L(Te(t),(function(t){He(t)}))},He=function(t){var e=t.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ve=function(t){return ke(t)&&d(t.dom.host)},Ie=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode),Le=v(Ie),Fe=Ie?function(t){return de.fromDom(t.dom.getRootNode())}:Ee,Pe=function(t){return de.fromDom(t.dom.host)},Ue=function(t){return d(t.dom.shadowRoot)},je=function(t){var e=Ce(t)?t.dom.parentNode:t.dom;if(null==e||null===e.ownerDocument)return!1;var n,r,o=e.ownerDocument;return function(t){var e=Fe(t);return Ve(e)?z.some(e):z.none()}(de.fromDom(e)).fold((function(){return o.body.contains(e)}),(n=je,r=Pe,function(t){return n(r(t))}))},We=function(){return qe(de.fromDom(document))},qe=function(t){var e=t.dom.body;if(null==e)throw new Error("Body is not available yet");return de.fromDom(e)},Ge=function(t){ae(t,ne());var e=t.components();L(e,Ge)},$e=function(t){var e=t.components();L(e,$e),ae(t,ee())},Xe=function(t,e){Ne(t.element,e.element)},Ke=function(t,e){var n=t.components();!function(t){L(t.components(),(function(t){return He(t.element)})),Re(t.element),t.syncComponents()}(t);var r=K(n,e);L(r,(function(e){Ge(e),t.getSystem().removeFromWorld(e)})),L(e,(function(e){e.getSystem().isConnected()?Xe(t,e):(t.getSystem().addToWorld(e),Xe(t,e),je(t.element)&&$e(e)),t.syncComponents()}))},Ye=function(t,e,n){t.getSystem().addToWorld(e),n(t.element,e.element),je(t.element)&&$e(e),t.syncComponents()},Je=function(t){var e=_e(t.element).bind((function(e){return t.getSystem().getByDom(e).toOptional()}));!function(t){Ge(t),He(t.element),t.getSystem().removeFromWorld(t)}(t),e.each((function(t){t.syncComponents()}))},Qe=function(t,e,n){n(t,e.element);var r=Te(e.element);L(r,(function(t){e.getByDom(t).each($e)}))},Ze=Object.keys,tn=Object.hasOwnProperty,en=function(t,e){for(var n=Ze(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}},nn=function(t,e){return rn(t,(function(t,n){return{k:n,v:e(t,n)}}))},rn=function(t,e){var n={};return en(t,(function(t,r){var o=e(t,r);n[o.k]=o.v})),n},on=function(t,e){var n={};return function(t,e,n,r){en(t,(function(t,o){(e(t,o)?n:r)(t,o)}))}(t,e,function(t){return function(e,n){t[n]=e}}(n),h),n},an=function(t,e){var n=[];return en(t,(function(t,r){n.push(e(t,r))})),n},un=function(t,e){return cn(t,e)?z.from(t[e]):z.none()},cn=function(t,e){return tn.call(t,e)},sn=function(t,e){return cn(t,e)&&void 0!==t[e]&&null!==t[e]},ln=function(t,e,n){if(!(a(n)||l(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",n,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(e,n+"")},fn=function(t,e,n){ln(t.dom,e,n)},dn=function(t,e){var n=t.dom;en(e,(function(t,e){ln(n,e,t)}))},mn=function(t,e){var n=t.dom.getAttribute(e);return null===n?void 0:n},gn=function(t,e){return z.from(mn(t,e))},hn=function(t,e){var n=t.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(e)},pn=function(t,e){t.dom.removeAttribute(e)},vn=function(t,e){var n=mn(t,e);return void 0===n||""===n?[]:n.split(" ")},bn=function(t){return void 0!==t.dom.classList},yn=function(t,e){return function(t,e,n){var r=vn(t,e).concat([n]);return fn(t,e,r.join(" ")),!0}(t,"class",e)},xn=function(t,e){return function(t,e,n){var r=F(vn(t,e),(function(t){return t!==n}));return r.length>0?fn(t,e,r.join(" ")):pn(t,e),!1}(t,"class",e)},wn=function(t,e){bn(t)?t.dom.classList.add(e):yn(t,e)},Cn=function(t){var e=bn(t)?t.dom.classList:function(t){return vn(t,"class")}(t);0===e.length&&pn(t,"class")},Sn=function(t,e){bn(t)?t.dom.classList.remove(e):xn(t,e);Cn(t)},kn=function(t,e){return bn(t)&&t.dom.classList.contains(e)},On=function(t,e,n){Sn(t,n),wn(t,e)},En=Object.freeze({__proto__:null,toAlpha:function(t,e,n){On(t.element,e.alpha,e.omega)},toOmega:function(t,e,n){On(t.element,e.omega,e.alpha)},isAlpha:function(t,e,n){return kn(t.element,e.alpha)},isOmega:function(t,e,n){return kn(t.element,e.omega)},clear:function(t,e,n){Sn(t.element,e.alpha),Sn(t.element,e.omega)}}),_n=function(t){return{isValue:_,isError:E,getOr:v(t),getOrThunk:v(t),getOrDie:v(t),or:function(e){return _n(t)},orThunk:function(e){return _n(t)},fold:function(e,n){return n(t)},map:function(e){return _n(e(t))},mapError:function(e){return _n(t)},each:function(e){e(t)},bind:function(e){return e(t)},exists:function(e){return e(t)},forall:function(e){return e(t)},toOptional:function(){return z.some(t)}}},Tn=function(t){return{isValue:E,isError:_,getOr:b,getOrThunk:function(t){return t()},getOrDie:function(){return k(String(t))()},or:b,orThunk:function(t){return t()},fold:function(e,n){return e(t)},map:function(e){return Tn(t)},mapError:function(e){return Tn(e(t))},each:h,bind:function(e){return Tn(t)},exists:E,forall:_,toOptional:z.none}},Mn={value:_n,error:Tn,fromOption:function(t,e){return t.fold((function(){return Tn(e)}),_n)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(be||(be={}));var Dn,zn,An=function(t,e,n){return t.stype===be.Error?e(t.serror):n(t.svalue)},Nn=function(t){return{stype:be.Value,svalue:t}},Bn=function(t){return{stype:be.Error,serror:t}},Rn=function(t){return t.fold(Bn,Nn)},Hn=function(t){return An(t,Mn.error,Mn.value)},Vn=Nn,In=function(t){var e=[],n=[];return L(t,(function(t){An(t,(function(t){return n.push(t)}),(function(t){return e.push(t)}))})),{values:e,errors:n}},Ln=Bn,Fn=function(t,e){return t.stype===be.Value?e(t.svalue):t},Pn=function(t,e){return t.stype===be.Error?e(t.serror):t},Un=function(t,e){return t.stype===be.Value?{stype:be.Value,svalue:e(t.svalue)}:t},jn=function(t,e){return t.stype===be.Error?{stype:be.Error,serror:e(t.serror)}:t},Wn=An,qn=function(t,e,n,r){return{tag:"field",key:t,newKey:e,presence:n,prop:r}},Gn=function(t,e,n){switch(t.tag){case"field":return e(t.key,t.newKey,t.presence,t.prop);case"custom":return n(t.newKey,t.instantiator)}},$n=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<e.length;o++){var i=e[o];for(var a in i)cn(i,a)&&(r[a]=t(r[a],i[a]))}return r}},Xn=$n((function(t,e){return u(t)&&u(e)?Xn(t,e):e})),Kn=$n((function(t,e){return e})),Yn=function(t){return{tag:"defaultedThunk",process:t}},Jn=function(t){return Yn(v(t))},Qn=function(t){return{tag:"mergeWithThunk",process:t}},Zn=function(t){return p(Ln,q)(t)},tr=function(t){var e=In(t);return e.errors.length>0?Zn(e.errors):Vn(e.values)},er=function(t){return u(t)&&Ze(t).length>100?" removed due to size":JSON.stringify(t,null,2)},nr=function(t,e){return Ln([{path:t,getErrorInfo:e}])},rr=function(t){return{extract:function(e,n){return Pn(t(n),(function(t){return function(t,e){return nr(t,v(e))}(e,t)}))},toString:v("val")}},or=rr(Vn),ir=function(t,e,n,r){return un(e,n).fold((function(){return function(t,e,n){return nr(t,(function(){return'Could not find valid *required* value for "'+e+'" in '+er(n)}))}(t,n,e)}),r)},ar=function(t,e,n,r){return r(un(t,e).getOrThunk((function(){return n(t)})))},ur=function(t,e,n,r,o){var i=function(t){return o.extract(e.concat([r]),t)},a=function(t){return t.fold((function(){return Vn(z.none())}),(function(t){var n=o.extract(e.concat([r]),t);return Un(n,z.some)}))};switch(t.tag){case"required":return ir(e,n,r,i);case"defaultedThunk":return ar(n,r,t.process,i);case"option":return function(t,e,n){return n(un(t,e))}(n,r,a);case"defaultedOptionThunk":return function(t,e,n,r){return r(un(t,e).map((function(e){return!0===e?n(t):e})))}(n,r,t.process,a);case"mergeWithThunk":return ar(n,r,v({}),(function(e){var r=Xn(t.process(n),e);return i(r)}))}},cr=function(t){return Ze(on(t,d))},sr=function(t){var e=lr(t),n=P(t,(function(t,e){return Gn(e,(function(e){var n;return Xn(t,((n={})[e]=!0,n))}),v(t))}),{});return{extract:function(t,r){var o=l(r)?[]:cr(r),i=F(o,(function(t){return!sn(n,t)}));return 0===i.length?e.extract(t,r):function(t,e){return nr(t,(function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))}(t,i)},toString:e.toString}},lr=function(t){return{extract:function(e,n){return function(t,e,n){for(var r={},o=[],i=0,a=n;i<a.length;i++){var u=a[i];Gn(u,(function(n,i,a,u){var c=ur(a,t,e,n,u);Wn(c,(function(t){o.push.apply(o,t)}),(function(t){r[i]=t}))}),(function(t,n){r[t]=n(e)}))}return o.length>0?Ln(o):Vn(r)}(e,n,t)},toString:function(){var e=I(t,(function(t){return Gn(t,(function(t,e,n,r){return t+" -> "+r.toString()}),(function(t,e){return"state("+t+")"}))}));return"obj{\n"+e.join("\n")+"}"}}},fr=function(t,e){var n=function(e,n){return function(t){return{extract:function(e,n){var r=I(n,(function(n,r){return t.extract(e.concat(["["+r+"]"]),n)}));return tr(r)},toString:function(){return"array("+t.toString()+")"}}}(rr(t)).extract(e,n)};return{extract:function(t,r){var o=Ze(r),i=n(t,o);return Fn(i,(function(n){var o=I(n,(function(t){return qn(t,t,{tag:"required",process:{}},e)}));return lr(o).extract(t,r)}))},toString:function(){return"setOf("+e.toString()+")"}}},dr=v(or),mr=(Dn=m,zn="function",rr((function(t){var e=typeof t;return Dn(t)?Vn(t):Ln("Expected type: "+zn+" but got: "+e)}))),gr=function(t,e,n,r){return un(n,r).fold((function(){return function(t,e,n){return nr(t,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+er(e)}))}(t,n,r)}),(function(n){return n.extract(t.concat(["branch: "+r]),e)}))},hr=function(t,e){return{extract:function(n,r){return un(r,t).fold((function(){return function(t,e){return nr(t,(function(){return'Choice schema did not contain choice key: "'+e+'"'}))}(n,t)}),(function(t){return gr(n,r,e,t)}))},toString:function(){return"chooseOn("+t+"). Possible values: "+Ze(e)}}},pr=function(t){return rr((function(e){return t(e).fold(Ln,Vn)}))},vr=function(t,e){return fr((function(e){return Rn(t(e))}),e)},br=function(t,e,n){return Hn(function(t,e,n){var r=e.extract([t],n);return jn(r,(function(t){return{input:n,errors:t}}))}(t,e,n))},yr=function(t){return t.fold((function(t){throw new Error(wr(t))}),b)},xr=function(t,e,n){return yr(br(t,e,n))},wr=function(t){return"Errors: \n"+(e=t.errors,n=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:v("... (only showing first ten failures)")}]):e,I(n,(function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))).join("\n")+"\n\nInput object: "+er(t.input);var e,n},Cr=function(t,e){return hr(t,nn(e,lr))},Sr=qn,kr=function(t,e){return{tag:"custom",newKey:t,instantiator:e}},Or=function(t){return Sr(t,t,{tag:"required",process:{}},dr())},Er=function(t,e){return Sr(t,t,{tag:"required",process:{}},e)},_r=function(t,e){return Sr(t,t,{tag:"required",process:{}},lr(e))},Tr=function(t){return Sr(t,t,{tag:"option",process:{}},dr())},Mr=function(t,e){return Sr(t,t,{tag:"option",process:{}},e)},Dr=function(t,e){return Mr(t,lr(e))},zr=function(t,e){return Mr(t,sr(e))},Ar=function(t,e){return Sr(t,t,Jn(e),dr())},Nr=function(t,e,n){return Sr(t,t,Jn(e),n)},Br=[Or("alpha"),Or("omega")],Rr=function(t){if(!c(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var e=[],n={};return L(t,(function(r,o){var i=Ze(r);if(1!==i.length)throw new Error("one and only one name per case");var a=i[0],u=r[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!c(u))throw new Error("case arguments must be an array");e.push(a),n[a]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=n.length;if(i!==u.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+u.length+" ("+u+"), got "+i);return{fold:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[o].apply(null,n)},match:function(t){var r=Ze(t);if(e.length!==r.length)throw new Error("Wrong number of arguments to match. Expected: "+e.join(",")+"\nActual: "+r.join(","));if(!$(e,(function(t){return H(r,t)})))throw new Error("Not all branches were specified when using match. Specified: "+r.join(", ")+"\nRequired: "+e.join(", "));return t[a].apply(null,n)},log:function(t){console.log(t,{constructors:e,constructor:a,params:n})}}}})),n};Rr([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Hr,Vr=function(t,e){return function(t,e){var n={};return en(t,(function(t,r){H(e,r)||(n[r]=t)})),n}(t,e)},Ir=function(t,e){return function(t,e){var n;return(n={})[t]=e,n}(t,e)},Lr=function(t){return function(t){var e={};return L(t,(function(t){e[t.key]=t.value})),e}(t)},Fr=function(t,e){var n,r=function(t){var e=[],n=[];return L(t,(function(t){t.fold((function(t){e.push(t)}),(function(t){n.push(t)}))})),{errors:e,values:n}}(t);return r.errors.length>0?(n=r.errors,Mn.error(q(n))):function(t,e){return 0===t.length?Mn.value(e):Mn.value(Xn(e,Kn.apply(void 0,t)))}(r.values,e)},Pr=function(t,e,n){return void 0===n&&(n=y),t.exists((function(t){return n(t,e)}))},Ur=function(t){for(var e=[],n=function(t){e.push(t)},r=0;r<t.length;r++)t[r].each(n);return e},jr=function(t){return m(t)?t:E},Wr=function(t,e,n){var r=e(t),o=jr(n);return r.orThunk((function(){return o(t)?z.none():function(t,e,n){for(var r=t.dom,o=jr(n);r.parentNode;){r=r.parentNode;var i=de.fromDom(r),a=e(i);if(a.isSome())return a;if(o(i))break}return z.none()}(t,e,o)}))},qr=function(t,e){return ve(t.element,e.event.target)},Gr={can:_,abort:E,run:h},$r=function(e){if(!sn(e,"can")&&!sn(e,"abort")&&!sn(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return t(t({},Gr),e)},Xr=function(t){var e=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return U(t,(function(t,r){return t&&e(r).apply(void 0,n)}),!0)}}(t,(function(t){return t.can})),n=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return U(t,(function(t,r){return t||e(r).apply(void 0,n)}),!1)}}(t,(function(t){return t.abort}));return{can:e,abort:n,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];L(t,(function(t){t.run.apply(void 0,e)}))}}},Kr=function(t){return Lr(t)},Yr=function(t,e){return{key:t,value:$r({abort:e})}},Jr=function(t,e){return{key:t,value:$r({run:e})}},Qr=function(t,e,n){return{key:t,value:$r({run:function(t,r){e.apply(void 0,[t,r].concat(n))}})}},Zr=function(t){return function(e){return{key:t,value:$r({run:function(t,n){qr(t,n)&&e(t,n)}})}}},to=function(t,e,n){return function(t,e){return Jr(t,(function(n,r){n.getSystem().getByUid(e).each((function(e){!function(t,e,n,r){t.getSystem().triggerEvent(n,e,r.event)}(e,e.element,t,r)}))}))}(t,e.partUids[n])},eo=function(t){return Jr(t,(function(t,e){e.cut()}))},no=function(t){return Jr(t,(function(t,e){e.stop()}))},ro=function(t,e){return Zr(t)(e)},oo=Zr(ee()),io=Zr(ne()),ao=Zr(te()),uo=function(t){return function(e){return Jr(t,e)}}(Yt()),co=function(t){return I(t,(function(t){return function(t,e,n){return""===e||t.length>=e.length&&t.substr(n,n+e.length)===e}(e=t,n="/*",e.length-n.length)?t.substring(0,t.length-"/*".length):t;var e,n}))},so=function(t,e){var n=t.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:co(i)}},t},lo=function(t){return{classes:f(t.classes)?[]:t.classes,attributes:f(t.attributes)?{}:t.attributes,styles:f(t.styles)?{}:t.styles}},fo=function(t,e,n){return ao((function(r,o){n(r,t,e)}))},mo=function(t,e,n){return function(t,e,n){var r=n.toString(),o=r.indexOf(")")+1,i=r.indexOf("("),a=r.substring(i+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:e,parameters:co(a.slice(0,1).concat(a.slice(3)))}},t}((function(r){for(var o=[],i=1;i<arguments.length;i++)o[i-1]=arguments[i];var a=[r].concat(o);return r.config({name:v(t)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+n)}),(function(t){var n=Array.prototype.slice.call(a,1);return e.apply(void 0,[r,t.config,t.state].concat(n))}))}),n,e)},go=function(t){return{key:t,value:void 0}},ho=function(e,n,r,o,i,a,u){var c=function(t){return sn(t,r)?t[r]():z.none()},s=nn(i,(function(t,e){return mo(r,t,e)})),l=nn(a,(function(t,e){return so(t,e)})),f=t(t(t({},l),s),{revoke:x(go,r),config:function(t){var n=xr(r+"-config",e,t);return{key:r,value:{config:n,me:f,configAsRaw:A((function(){return xr(r+"-config",e,t)})),initialConfig:t,state:u}}},schema:v(n),exhibit:function(t,e){return(n=c(t),r=un(o,"exhibit"),i=function(t,n){return n(e,t.config,t.state)},n.isSome()&&r.isSome()?z.some(i(n.getOrDie(),r.getOrDie())):z.none()).getOrThunk((function(){return lo({})}));var n,r,i},name:v(r),handlers:function(t){return c(t).map((function(t){return un(o,"events").getOr((function(){return{}}))(t.config,t.state)})).getOr({})}});return f},po={init:function(){return vo({readState:v("No State required")})}},vo=function(t){return t},bo=function(t){return Lr(t)},yo=sr([Or("fields"),Or("name"),Ar("active",{}),Ar("apis",{}),Ar("state",po),Ar("extra",{})]),xo=function(t){var e=xr("Creating behaviour: "+t.name,yo,t);return function(t,e,n,r,o,i){var a=sr(t),u=Dr(e,[zr("config",t)]);return ho(a,u,e,n,r,o,i)}(e.fields,e.name,e.active,e.apis,e.extra,e.state)},wo=sr([Or("branchKey"),Or("branches"),Or("name"),Ar("active",{}),Ar("apis",{}),Ar("state",po),Ar("extra",{})]),Co=v(void 0),So=xo({fields:Br,name:"swapping",apis:En}),ko=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},Oo=function(t){return t.dom.focus()},Eo=function(t){return t.dom.blur()},_o=function(t){return void 0===t&&(t=de.fromDom(document)),z.from(t.dom.activeElement).map(de.fromDom)},To=function(t){return _o(Fe(t)).filter((function(e){return t.dom.contains(e.dom)}))},Mo=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Do=tinymce.util.Tools.resolve("tinymce.ThemeManager"),zo=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Ao=["undo","bold","italic","link","image","bullist","styleselect"],No="formatChanged",Bo="orientationChanged",Ro="dropupDismissed",Ho=function(t){return t.dom.innerHTML},Vo=function(t,e){var n,r,o=Oe(t).dom,i=de.fromDom(o.createDocumentFragment()),a=(n=e,(r=(o||document).createElement("div")).innerHTML=n,Te(de.fromDom(r)));Be(i,a),Re(t),Ne(t,i)},Io=function(t){return function(t,e){return de.fromDom(t.dom.cloneNode(e))}(t,!1)},Lo=function(t){return Ve(t)?"#shadow-root":function(t){var e=de.fromTag("div"),n=de.fromDom(t.dom.cloneNode(!0));return Ne(e,n),Ho(e)}(Io(t))},Fo=function(t){return Lo(t)},Po=Object.freeze({__proto__:null,events:function(t){return Kr([Jr(Kt(),(function(e,n){var r=t.channels,o=Ze(r),i=n,a=function(t,e){return e.universal?t:F(t,(function(t){return H(e.channels,t)}))}(o,i);L(a,(function(t){var n=r[t],o=n.schema,a=xr("channel["+t+"] data\nReceiver: "+Fo(e.element),o,i.data);n.onReceive(e,a)}))}))])}}),Uo="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(Hr||(Hr={}));var jo=ko({}),Wo=function(t,e,n){switch(un(jo.get(),t).orThunk((function(){var e=Ze(jo.get());return Q(e,(function(e){return t.indexOf(e)>-1?z.some(jo.get()[e]):z.none()}))})).getOr(Hr.NORMAL)){case Hr.NORMAL:return n($o());case Hr.LOGGING:var r=function(t,e){var n=[],r=(new Date).getTime();return{logEventCut:function(t,e,r){n.push({outcome:"cut",target:e,purpose:r})},logEventStopped:function(t,e,r){n.push({outcome:"stopped",target:e,purpose:r})},logNoParent:function(t,e,r){n.push({outcome:"no-parent",target:e,purpose:r})},logEventNoHandlers:function(t,e){n.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(t,e,r){n.push({outcome:"response",purpose:r,target:e})},write:function(){var o=(new Date).getTime();H(["mousemove","mouseover","mouseout",te()],t)||console.log(t,{event:t,time:o-r,target:e.dom,sequence:I(n,(function(t){return H(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Fo(t.target)+")":t.outcome}))})}}}(t,e),o=n(r);return r.write(),o;case Hr.STOP:return!0}},qo=["alloy/data/Fields","alloy/debugging/Debugging"],Go=function(t,e,n){return Wo(t,e,n)},$o=v({logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h}),Xo=v([Or("menu"),Or("selectedMenu")]),Ko=v([Or("item"),Or("selectedItem")]);v(lr(Ko().concat(Xo())));var Yo,Jo=v(lr(Ko())),Qo=_r("initSize",[Or("numColumns"),Or("numRows")]),Zo=function(t,e,n){return function(){var t=new Error;if(void 0!==t.stack){var e=t.stack.split("\n");return j(e,(function(t){return t.indexOf("alloy")>0&&!V(qo,(function(e){return t.indexOf(e)>-1}))})).getOr(Uo)}}(),Sr(e,e,n,pr((function(t){return Mn.value((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}))})))},ti=function(t){return Zo(0,t,Jn(h))},ei=function(t){return Zo(0,t,Jn(z.none))},ni=function(t){return Zo(0,t,{tag:"required",process:{}})},ri=function(t){return Zo(0,t,{tag:"required",process:{}})},oi=function(t,e){return kr(t,v(e))},ii=function(t){return kr(t,b)},ai=v(Qo),ui=[Er("channels",vr(Mn.value,sr([ni("onReceive"),Ar("schema",dr())])))],ci=xo({fields:ui,name:"receiving",active:Po}),si=function(t,e,n){var r=e.aria;r.update(t,r,n.get())},li=function(t,e,n){e.toggleClass.each((function(e){n.get()?wn(t.element,e):Sn(t.element,e)}))},fi=function(t,e,n){gi(t,e,n,!n.get())},di=function(t,e,n){n.set(!0),li(t,e,n),si(t,e,n)},mi=function(t,e,n){n.set(!1),li(t,e,n),si(t,e,n)},gi=function(t,e,n,r){(r?di:mi)(t,e,n)},hi=function(t,e,n){gi(t,e,n,e.selected)},pi=Object.freeze({__proto__:null,onLoad:hi,toggle:fi,isOn:function(t,e,n){return n.get()},on:di,off:mi,set:gi}),vi=Object.freeze({__proto__:null,exhibit:function(){return lo({})},events:function(t,e){var n,r,o,i=(n=t,r=e,o=fi,uo((function(t){o(t,n,r)}))),a=fo(t,e,hi);return Kr(q([t.toggleOnExecute?[i]:[],[a]]))}}),bi=function(t,e,n){fn(t.element,"aria-expanded",n)},yi=[Ar("selected",!1),Tr("toggleClass"),Ar("toggleOnExecute",!0),Nr("aria",{mode:"none"},Cr("mode",{pressed:[Ar("syncWithExpanded",!1),oi("update",(function(t,e,n){fn(t.element,"aria-pressed",n),e.syncWithExpanded&&bi(t,e,n)}))],checked:[oi("update",(function(t,e,n){fn(t.element,"aria-checked",n)}))],expanded:[oi("update",bi)],selected:[oi("update",(function(t,e,n){fn(t.element,"aria-selected",n)}))],none:[oi("update",h)]}))],xi=xo({fields:yi,name:"toggling",active:vi,apis:pi,state:(Yo=!1,{init:function(){var t=ko(Yo);return{get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(Yo)},readState:function(){return t.get()}}}})}),wi=function(t,e){return ci.config({channels:Ir(No,{onReceive:function(n,r){r.command===t&&e(n,r.state)}})})},Ci=function(t){return ci.config({channels:Ir(Bo,{onReceive:t})})},Si=function(t,e){return{key:t,value:{onReceive:e}}},ki="tinymce-mobile",Oi=function(t){return ki+"-"+t},Ei=function(){var t=function(t,e){e.stop(),ce(t)};return[Jr(Pt(),t),Jr(Qt(),t),eo(Dt()),eo(Nt())]},_i=function(t,e){e.ignore||(Oo(t.element),e.onFocus(t))},Ti=Object.freeze({__proto__:null,focus:_i,blur:function(t,e){e.ignore||Eo(t.element)},isFocused:function(t){return function(t){var e=Fe(t).dom;return t.dom===e.activeElement}(t.element)}}),Mi=Object.freeze({__proto__:null,exhibit:function(t,e){var n=e.ignore?{}:{attributes:{tabindex:"-1"}};return lo(n)},events:function(t){return Kr([Jr(Gt(),(function(e,n){_i(e,t),n.stop()}))].concat(t.stopMousedown?[Jr(Nt(),(function(t,e){e.event.prevent()}))]:[]))}}),Di=[ti("onFocus"),Ar("stopMousedown",!1),Ar("ignore",!1)],zi=xo({fields:Di,name:"focusing",active:Mi,apis:Ti}),Ai=function(t){return void 0!==t.style&&m(t.style.getPropertyValue)},Ni=function(t,e,n){if(!a(n))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",n,":: Element ",t),new Error("CSS value must be a string: "+n);Ai(t)&&t.style.setProperty(e,n)},Bi=function(t,e,n){var r=t.dom;Ni(r,e,n)},Ri=function(t,e){var n=t.dom;en(e,(function(t,e){Ni(n,e,t)}))},Hi=function(t,e){var n=t.dom,r=window.getComputedStyle(n).getPropertyValue(e);return""!==r||je(t)?r:Vi(n,e)},Vi=function(t,e){return Ai(t)?t.style.getPropertyValue(e):""},Ii=function(t,e){var n=t.dom,r=Vi(n,e);return z.from(r).filter((function(t){return t.length>0}))},Li=function(t,e){!function(t,e){Ai(t)&&t.style.removeProperty(e)}(t.dom,e),Pr(gn(t,"style").map(ot),"")&&pn(t,"style")},Fi=function(t){return t.dom.offsetWidth},Pi=function(t,e){var n=function(n){var r=e(n);if(r<=0||null===r){var o=Hi(n,t);return parseFloat(o)||0}return r},r=function(t,e){return U(e,(function(e,n){var r=Hi(t,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?e:e+o}),0)};return{set:function(e,n){if(!g(n)&&!n.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+n);var r=e.dom;Ai(r)&&(r.style[t]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(t,e,n){var o=r(t,n);return e>o?e-o:0}}},Ui=Pi("height",(function(t){var e=t.dom;return je(t)?e.getBoundingClientRect().height:e.offsetHeight})),ji=function(t){return Ui.get(t)},Wi=function(t,e,n){return F(function(t,e){for(var n=m(e)?e:E,r=t.dom,o=[];null!==r.parentNode&&void 0!==r.parentNode;){var i=r.parentNode,a=de.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(t,n),e)},qi=function(t,e){return F(function(t){return _e(t).map(Te).map((function(e){return F(e,(function(e){return!ve(t,e)}))})).getOr([])}(t),e)},Gi=function(t,e,n){return Wi(t,(function(t){return me(t,e)}),n)},$i=function(t,e){return qi(t,(function(t){return me(t,e)}))},Xi=function(t,e){return he(e,t)};function Ki(t,e,n,r,o){return t(n,r)?z.some(n):m(o)&&o(n)?z.none():e(n,r,o)}var Yi,Ji=function(t,e,n){for(var r=t.dom,o=m(n)?n:E;r.parentNode;){r=r.parentNode;var i=de.fromDom(r);if(e(i))return z.some(i);if(o(i))break}return z.none()},Qi=function(t){return pe(t)},Zi=function(t,e,n){return Ji(t,(function(t){return me(t,e)}),n)},ta=function(t,e){return pe(e,t)},ea=function(t,e,n){return Ki((function(t,e){return me(t,e)}),Zi,t,e,n)},na=[8],ra=[9],oa=[13],ia=[27],aa=[32],ua=[37],ca=[38],sa=[39],la=[40],fa=function(t,e,n){var r=X(t.slice(0,e)),o=X(t.slice(e+1));return j(r.concat(o),n)},da=function(t,e,n){var r=X(t.slice(0,e));return j(r,n)},ma=function(t,e,n){var r=t.slice(0,e),o=t.slice(e+1);return j(o.concat(r),n)},ga=function(t,e,n){var r=t.slice(e+1);return j(r,n)},ha=function(t){return function(e){var n=e.raw;return H(t,n.which)}},pa=function(t){return function(e){return $(t,(function(t){return t(e)}))}},va=function(t){return!0===t.raw.shiftKey},ba=function(t){return!0===t.raw.ctrlKey},ya=S(va),xa=function(t,e){return{matches:t,classification:e}},wa=function(t,e,n,r){var o=t+e;return o>r?n:o<n?r:o},Ca=function(t,e,n){return Math.min(Math.max(t,e),n)},Sa=function(t,e,n,r){var o=Xi(t.element,"."+e.highlightClass);L(o,(function(n){V(r,(function(t){return t.element===n}))||(Sn(n,e.highlightClass),t.getSystem().getByDom(n).each((function(n){e.onDehighlight(t,n),ae(n,ie())})))}))},ka=function(t,e,n,r){Sa(t,e,0,[r]),Oa(t,e,n,r)||(wn(r.element,e.highlightClass),e.onHighlight(t,r),ae(r,oe()))},Oa=function(t,e,n,r){return kn(r.element,e.highlightClass)},Ea=function(t,e,n,r){var o=Xi(t.element,"."+e.itemClass);return z.from(o[r]).fold((function(){return Mn.error(new Error("No element found with index "+r))}),t.getSystem().getByDom)},_a=function(t,e,n){return ta(t.element,"."+e.itemClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Ta=function(t,e,n){var r=Xi(t.element,"."+e.itemClass);return(r.length>0?z.some(r[r.length-1]):z.none()).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},Ma=function(t,e,n,r){var o=Xi(t.element,"."+e.itemClass);return W(o,(function(t){return kn(t,e.highlightClass)})).bind((function(e){var n=wa(e,r,0,o.length-1);return t.getSystem().getByDom(o[n]).toOptional()}))},Da=function(t,e,n){var r=Xi(t.element,"."+e.itemClass);return Ur(I(r,(function(e){return t.getSystem().getByDom(e).toOptional()})))},za=Object.freeze({__proto__:null,dehighlightAll:function(t,e,n){return Sa(t,e,0,[])},dehighlight:function(t,e,n,r){Oa(t,e,n,r)&&(Sn(r.element,e.highlightClass),e.onDehighlight(t,r),ae(r,ie()))},highlight:ka,highlightFirst:function(t,e,n){_a(t,e).each((function(r){ka(t,e,n,r)}))},highlightLast:function(t,e,n){Ta(t,e).each((function(r){ka(t,e,n,r)}))},highlightAt:function(t,e,n,r){Ea(t,e,n,r).fold((function(t){throw t}),(function(r){ka(t,e,n,r)}))},highlightBy:function(t,e,n,r){var o=Da(t,e);j(o,r).each((function(r){ka(t,e,n,r)}))},isHighlighted:Oa,getHighlighted:function(t,e,n){return ta(t.element,"."+e.highlightClass).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))},getFirst:_a,getLast:Ta,getPrevious:function(t,e,n){return Ma(t,e,0,-1)},getNext:function(t,e,n){return Ma(t,e,0,1)},getCandidates:Da}),Aa=[Or("highlightClass"),Or("itemClass"),ti("onHighlight"),ti("onDehighlight")],Na=xo({fields:Aa,name:"highlighting",apis:za}),Ba=function(t,e,n){e.exists((function(t){return n.exists((function(e){return ve(e,t)}))}))||ue(t,re(),{prevFocus:e,newFocus:n})},Ra=function(){var t=function(t){return To(t.element)};return{get:t,set:function(e,n){var r=t(e);e.getSystem().triggerFocus(n,e.element);var o=t(e);Ba(e,r,o)}}},Ha=function(){var t=function(t){return Na.getHighlighted(t).map((function(t){return t.element}))};return{get:t,set:function(e,n){var r=t(e);e.getSystem().getByDom(n).fold(h,(function(t){Na.highlight(e,t)}));var o=t(e);Ba(e,r,o)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Yi||(Yi={}));var Va=function(t,e,n,r,o){var i=function(t,e,n,r,o){var i,a,u,c=n(t,e,r,o);return(i=c,a=e.event,u=j(i,(function(t){return t.matches(a)})),u.map((function(t){return t.classification}))).bind((function(n){return n(t,e,r,o)}))},a={schema:function(){return t.concat([Ar("focusManager",Ra()),Nr("focusInside","onFocus",pr((function(t){return H(["onFocus","onEnterOrSpace","onApi"],t)?Mn.value(t):Mn.error("Invalid value for focusInside")}))),oi("handler",a),oi("state",e),oi("sendFocusIn",o)])},processKey:i,toEvents:function(t,e){var a=t.focusInside!==Yi.OnFocusMode?z.none():o(t).map((function(n){return Jr(Gt(),(function(r,o){n(r,t,e),o.stop()}))})),u=[Jr(Vt(),(function(r,a){i(r,a,n,t,e).fold((function(){!function(n,r){var i=ha(aa.concat(oa))(r.event);t.focusInside===Yi.OnEnterOrSpaceMode&&i&&qr(n,r)&&o(t).each((function(o){o(n,t,e),r.stop()}))}(r,a)}),(function(t){a.stop()}))})),Jr(It(),(function(n,o){i(n,o,r,t,e).each((function(t){o.stop()}))}))];return Kr(a.toArray().concat(u))}};return a},Ia=function(t){var e=[Tr("onEscape"),Tr("onEnter"),Ar("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ar("firstTabstop",0),Ar("useTabstopAt",_),Tr("visibilitySelector")].concat([t]),n=function(t,e){var n=t.visibilitySelector.bind((function(t){return ea(e,t)})).getOr(e);return ji(n)>0},r=function(t,e,r){(function(t,e){var r=Xi(t.element,e.selector),o=F(r,(function(t){return n(e,t)}));return z.from(o[e.firstTabstop])})(t,e).each((function(n){e.focusManager.set(t,n)}))},o=function(t,e,r,o,i){return i(e,r,(function(t){return function(t,e){return n(t,e)&&t.useTabstopAt(e)}(o,t)})).fold((function(){return o.cyclic?z.some(!0):z.none()}),(function(e){return o.focusManager.set(t,e),z.some(!0)}))},i=function(t,e,n,r){var i=Xi(t.element,n.selector);return function(t,e){return e.focusManager.get(t).bind((function(t){return ea(t,e.selector)}))}(t,n).bind((function(e){return W(i,x(ve,e)).bind((function(e){return o(t,i,e,n,r)}))}))},a=v([xa(pa([va,ha(ra)]),(function(t,e,n){var r=n.cyclic?fa:da;return i(t,0,n,r)})),xa(ha(ra),(function(t,e,n){var r=n.cyclic?ma:ga;return i(t,0,n,r)})),xa(ha(ia),(function(t,e,n){return n.onEscape.bind((function(n){return n(t,e)}))})),xa(pa([ya,ha(oa)]),(function(t,e,n){return n.onEnter.bind((function(n){return n(t,e)}))}))]),u=v([]);return Va(e,po.init,a,u,(function(){return z.some(r)}))},La=Ia(kr("cyclic",E)),Fa=Ia(kr("cyclic",_)),Pa=function(t){return"input"===ye(t)&&"radio"!==mn(t,"type")||"textarea"===ye(t)},Ua=function(t,e,n){return Pa(n)&&ha(aa)(e.event)?z.none():function(t,e,n){return se(t,n,Yt()),z.some(!0)}(t,0,n)},ja=function(t,e){return z.some(!0)},Wa=[Ar("execute",Ua),Ar("useSpace",!1),Ar("useEnter",!0),Ar("useControlEnter",!1),Ar("useDown",!1)],qa=function(t,e,n){return n.execute(t,e,t.element)},Ga=Va(Wa,po.init,(function(t,e,n,r){var o=n.useSpace&&!Pa(t.element)?aa:[],i=n.useEnter?oa:[],a=n.useDown?la:[],u=o.concat(i).concat(a);return[xa(ha(u),qa)].concat(n.useControlEnter?[xa(pa([ba,ha(oa)]),qa)]:[])}),(function(t,e,n,r){return n.useSpace&&!Pa(t.element)?[xa(ha(aa),ja)]:[]}),(function(){return z.none()})),$a=function(t){var e=ko(z.none()),n=function(){return e.get().each(t)};return{clear:function(){n(),e.set(z.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(z.some(t))}}},Xa=function(){var e=$a((function(t){return t.destroy()}));return t(t({},e),{run:function(t){return e.get().each(t)}})},Ka=function(){var e=$a(h);return t(t({},e),{on:function(t){return e.get().each(t)}})},Ya=function(){var t=Ka();return vo({readState:function(){return t.get().map((function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set({numRows:e,numColumns:n})},getNumRows:function(){return t.get().map((function(t){return t.numRows}))},getNumColumns:function(){return t.get().map((function(t){return t.numColumns}))}})},Ja=Object.freeze({__proto__:null,flatgrid:Ya,init:function(t){return t.state(t)}}),Qa=function(t,e){return function(n){return"rtl"===Za(n)?e:t}},Za=function(t){return"rtl"===Hi(t,"direction")?"rtl":"ltr"},tu=function(t){return function(e,n,r,o){var i=t(e.element);return ou(i,e,n,r,o)}},eu=function(t,e){var n=Qa(t,e);return tu(n)},nu=function(t,e){var n=Qa(e,t);return tu(n)},ru=function(t){return function(e,n,r,o){return ou(t,e,n,r,o)}},ou=function(t,e,n,r,o){return r.focusManager.get(e).bind((function(n){return t(e.element,n,r,o)})).map((function(t){return r.focusManager.set(e,t),!0}))},iu=ru,au=ru,uu=ru,cu=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},su=function(t,e,n){var r=Xi(t,n);return function(t,e){return W(t,e).map((function(e){return{index:e,candidates:t}}))}(F(r,cu),(function(t){return ve(t,e)}))},lu=function(t,e){return W(t,(function(t){return ve(e,t)}))},fu=function(t,e,n,r){return r(Math.floor(e/n),e%n).bind((function(e){var r=e.row*n+e.column;return r>=0&&r<t.length?z.some(t[r]):z.none()}))},du=function(t,e,n,r,o){return fu(t,e,r,(function(e,i){var a=e===n-1?t.length-e*r:r,u=wa(i,o,0,a-1);return z.some({row:e,column:u})}))},mu=function(t,e,n,r,o){return fu(t,e,r,(function(e,i){var a=wa(e,o,0,n-1),u=a===n-1?t.length-a*r:r,c=Ca(i,0,u-1);return z.some({row:a,column:c})}))},gu=[Or("selector"),Ar("execute",Ua),ei("onEscape"),Ar("captureTab",!1),ai()],hu=function(t,e,n){ta(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},pu=function(t){return function(e,n,r,o){return su(e,n,r.selector).bind((function(e){return t(e.candidates,e.index,o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}},vu=function(t,e,n){return n.captureTab?z.some(!0):z.none()},bu=pu((function(t,e,n,r){return du(t,e,n,r,-1)})),yu=pu((function(t,e,n,r){return du(t,e,n,r,1)})),xu=pu((function(t,e,n,r){return mu(t,e,n,r,-1)})),wu=pu((function(t,e,n,r){return mu(t,e,n,r,1)})),Cu=v([xa(ha(ua),eu(bu,yu)),xa(ha(sa),nu(bu,yu)),xa(ha(ca),iu(xu)),xa(ha(la),au(wu)),xa(pa([va,ha(ra)]),vu),xa(pa([ya,ha(ra)]),vu),xa(ha(ia),(function(t,e,n){return n.onEscape(t,e)})),xa(ha(aa.concat(oa)),(function(t,e,n,r){return function(t,e){return e.focusManager.get(t).bind((function(t){return ea(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))}))]),Su=v([xa(ha(aa),ja)]),ku=Va(gu,Ya,Cu,Su,(function(){return z.some(hu)})),Ou=function(t,e,n,r){var o=function(t,e,n){var i,a=wa(e,r,0,n.length-1);return a===t?z.none():(i=n[a],"button"===ye(i)&&"disabled"===mn(i,"disabled")?o(t,a,n):z.from(n[a]))};return su(t,n,e).bind((function(t){var e=t.index,n=t.candidates;return o(e,e,n)}))},Eu=[Or("selector"),Ar("getInitial",z.none),Ar("execute",Ua),ei("onEscape"),Ar("executeOnMove",!1),Ar("allowVertical",!0)],_u=function(t,e,n){return function(t,e){return e.focusManager.get(t).bind((function(t){return ea(t,e.selector)}))}(t,n).bind((function(r){return n.execute(t,e,r)}))},Tu=function(t,e,n){e.getInitial(t).orThunk((function(){return ta(t.element,e.selector)})).each((function(n){e.focusManager.set(t,n)}))},Mu=function(t,e,n){return Ou(t,n.selector,e,-1)},Du=function(t,e,n){return Ou(t,n.selector,e,1)},zu=function(t){return function(e,n,r,o){return t(e,n,r,o).bind((function(){return r.executeOnMove?_u(e,n,r):z.some(!0)}))}},Au=function(t,e,n){return n.onEscape(t,e)},Nu=v([xa(ha(aa),ja)]),Bu=Va(Eu,po.init,(function(t,e,n,r){var o=ua.concat(n.allowVertical?ca:[]),i=sa.concat(n.allowVertical?la:[]);return[xa(ha(o),zu(eu(Mu,Du))),xa(ha(i),zu(nu(Mu,Du))),xa(ha(oa),_u),xa(ha(aa),_u),xa(ha(ia),Au)]}),Nu,(function(){return z.some(Tu)})),Ru=function(t,e,n){return z.from(t[e]).bind((function(t){return z.from(t[n]).map((function(t){return{rowIndex:e,columnIndex:n,cell:t}}))}))},Hu=function(t,e,n,r){var o=t[e].length,i=wa(n,r,0,o-1);return Ru(t,e,i)},Vu=function(t,e,n,r){var o=wa(n,r,0,t.length-1),i=t[o].length,a=Ca(e,0,i-1);return Ru(t,o,a)},Iu=function(t,e,n,r){var o=t[e].length,i=Ca(n+r,0,o-1);return Ru(t,e,i)},Lu=function(t,e,n,r){var o=Ca(n+r,0,t.length-1),i=t[o].length,a=Ca(e,0,i-1);return Ru(t,o,a)},Fu=[_r("selectors",[Or("row"),Or("cell")]),Ar("cycles",!0),Ar("previousSelector",z.none),Ar("execute",Ua)],Pu=function(t,e,n){e.previousSelector(t).orThunk((function(){var n=e.selectors;return ta(t.element,n.cell)})).each((function(n){e.focusManager.set(t,n)}))},Uu=function(t,e){return function(n,r,o){var i=o.cycles?t:e;return ea(r,o.selectors.row).bind((function(t){var e=Xi(t,o.selectors.cell);return lu(e,r).bind((function(e){var r=Xi(n,o.selectors.row);return lu(r,t).bind((function(t){var n=function(t,e){return I(t,(function(t){return Xi(t,e.selectors.cell)}))}(r,o);return i(n,t,e).map((function(t){return t.cell}))}))}))}))}},ju=Uu((function(t,e,n){return Hu(t,e,n,-1)}),(function(t,e,n){return Iu(t,e,n,-1)})),Wu=Uu((function(t,e,n){return Hu(t,e,n,1)}),(function(t,e,n){return Iu(t,e,n,1)})),qu=Uu((function(t,e,n){return Vu(t,n,e,-1)}),(function(t,e,n){return Lu(t,n,e,-1)})),Gu=Uu((function(t,e,n){return Vu(t,n,e,1)}),(function(t,e,n){return Lu(t,n,e,1)})),$u=v([xa(ha(ua),eu(ju,Wu)),xa(ha(sa),nu(ju,Wu)),xa(ha(ca),iu(qu)),xa(ha(la),au(Gu)),xa(ha(aa.concat(oa)),(function(t,e,n){return To(t.element).bind((function(r){return n.execute(t,e,r)}))}))]),Xu=v([xa(ha(aa),ja)]),Ku=Va(Fu,po.init,$u,Xu,(function(){return z.some(Pu)})),Yu=[Or("selector"),Ar("execute",Ua),Ar("moveOnTab",!1)],Ju=function(t,e,n){return n.focusManager.get(t).bind((function(r){return n.execute(t,e,r)}))},Qu=function(t,e,n){ta(t.element,e.selector).each((function(n){e.focusManager.set(t,n)}))},Zu=function(t,e,n){return Ou(t,n.selector,e,-1)},tc=function(t,e,n){return Ou(t,n.selector,e,1)},ec=v([xa(ha(ca),uu(Zu)),xa(ha(la),uu(tc)),xa(pa([va,ha(ra)]),(function(t,e,n,r){return n.moveOnTab?uu(Zu)(t,e,n,r):z.none()})),xa(pa([ya,ha(ra)]),(function(t,e,n,r){return n.moveOnTab?uu(tc)(t,e,n,r):z.none()})),xa(ha(oa),Ju),xa(ha(aa),Ju)]),nc=v([xa(ha(aa),ja)]),rc=Va(Yu,po.init,ec,nc,(function(){return z.some(Qu)})),oc=[ei("onSpace"),ei("onEnter"),ei("onShiftEnter"),ei("onLeft"),ei("onRight"),ei("onTab"),ei("onShiftTab"),ei("onUp"),ei("onDown"),ei("onEscape"),Ar("stopSpaceKeyup",!1),Tr("focusIn")],ic=Va(oc,po.init,(function(t,e,n){return[xa(ha(aa),n.onSpace),xa(pa([ya,ha(oa)]),n.onEnter),xa(pa([va,ha(oa)]),n.onShiftEnter),xa(pa([va,ha(ra)]),n.onShiftTab),xa(pa([ya,ha(ra)]),n.onTab),xa(ha(ca),n.onUp),xa(ha(la),n.onDown),xa(ha(ua),n.onLeft),xa(ha(sa),n.onRight),xa(ha(aa),n.onSpace),xa(ha(ia),n.onEscape)]}),(function(t,e,n){return n.stopSpaceKeyup?[xa(ha(aa),ja)]:[]}),(function(t){return t.focusIn})),ac=La.schema(),uc=Fa.schema(),cc=Bu.schema(),sc=ku.schema(),lc=Ku.schema(),fc=Ga.schema(),dc=rc.schema(),mc=ic.schema(),gc=function(t){var e=xr("Creating behaviour: "+t.name,wo,t);return function(t,e,n,r,o,i){var a=t,u=Dr(e,[Mr("config",t)]);return ho(a,u,e,n,r,o,i)}(Cr(e.branchKey,e.branches),e.name,e.active,e.apis,e.extra,e.state)}({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:ac,cyclic:uc,flow:cc,flatgrid:sc,matrix:lc,execution:fc,menu:dc,special:mc}),name:"keying",active:{events:function(t,e){return t.handler.toEvents(t,e)}},apis:{focusIn:function(t,e,n){e.sendFocusIn(e).fold((function(){t.getSystem().triggerFocus(t.element,t.element)}),(function(r){r(t,e,n)}))},setGridSize:function(t,e,n,r,o){!function(t){return sn(t,"setGridSize")}(n)?console.error("Layout does not support setGridSize"):n.setGridSize(r,o)}},state:Ja}),hc=function(t,e){return n=t,r={},o=I(e,(function(e){return n=e.name(),r="Cannot configure "+e.name()+" for "+t,Sr(n,n,{tag:"option",process:{}},rr((function(t){return Ln("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([kr("dump",b)]),Nr(n,r,lr(o));var n,r,o},pc=function(t){return t.dump},vc=function(e,n){return t(t({},bo(n)),e.dump)},bc=hc,yc=vc,xc="placeholder",wc=Rr([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Cc=function(t){return cn(t,"uiType")},Sc=function(t,e,n,r){return Cc(n)&&n.uiType===xc?function(t,e,n,r){return t.exists((function(t){return t!==n.owner}))?wc.single(!0,v(n)):un(r,n.name).fold((function(){throw new Error("Unknown placeholder component: "+n.name+"\nKnown: ["+Ze(r)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(n,null,2))}),(function(t){return t.replace()}))}(t,0,n,r):wc.single(!1,v(n))},kc=function(e,n,r,o){return Sc(e,0,r,o).fold((function(i,a){var u=Cc(r)?a(n,r.config,r.validated):a(n),c=un(u,"components").getOr([]),s=G(c,(function(t){return kc(e,n,t,o)}));return[t(t({},u),{components:s})]}),(function(t,e){if(Cc(r)){var o=e(n,r.config,r.validated);return r.validated.preprocess.getOr(b)(o)}return e(n)}))},Oc=function(t,e,n,r){var o=nn(r,(function(t,e){return r=t,o=!1,{name:v(n=e),required:function(){return r.fold((function(t,e){return t}),(function(t,e){return t}))},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+n);return o=!0,r}};var n,r,o})),i=function(t,e,n,r){return G(n,(function(n){return kc(t,e,n,r)}))}(t,e,n,o);return en(o,(function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))})),i},Ec=wc.single,_c=wc.multiple,Tc=v(xc),Mc=0,Dc=function(t){var e=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Mc+String(e)},zc=Rr([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Ac=Ar("factory",{sketch:b}),Nc=Ar("schema",[]),Bc=Or("name"),Rc=Sr("pname","pname",Yn((function(t){return"<alloy."+Dc(t.name)+">"})),dr()),Hc=kr("schema",(function(){return[Tr("preprocess")]})),Vc=Ar("defaults",v({})),Ic=Ar("overrides",v({})),Lc=lr([Ac,Nc,Bc,Rc,Vc,Ic]),Fc=lr([Ac,Nc,Bc,Vc,Ic]),Pc=lr([Ac,Nc,Bc,Rc,Vc,Ic]),Uc=lr([Ac,Hc,Bc,Or("unit"),Rc,Vc,Ic]),jc=function(t){var e=function(t){return t.name};return t.fold(e,e,e,e)},Wc=function(t,e){return function(n){var r=xr("Converting part type",e,n);return t(r)}},qc=Wc(zc.required,Lc);Wc(zc.external,Fc);var Gc=Wc(zc.optional,Pc),$c=Wc(zc.group,Uc),Xc=v("entirety"),Kc=function(t,e,n,r){return Xn(e.defaults(t,n,r),n,{uid:t.partUids[e.name]},e.overrides(t,n,r))},Yc=function(e,n){var r={};return L(n,(function(n){(function(t){return t.fold(z.some,z.none,z.some,z.some)})(n).each((function(n){var o=Jc(e,n.pname);r[n.name]=function(r){var i=xr("Part: "+n.name+" in "+e,lr(n.schema),r);return t(t({},o),{config:r,validated:i})}}))})),r},Jc=function(t,e){return{uiType:Tc(),owner:t,name:e}},Qc=function(t,e,n){return function(t,e,n){var r={},o={};return L(n,(function(t){t.fold((function(t){r[t.pname]=Ec(!0,(function(e,n,r){return t.factory.sketch(Kc(e,t,n,r))}))}),(function(t){var n=e.parts[t.name];o[t.name]=v(t.factory.sketch(Kc(e,t,n[Xc()]),n))}),(function(t){r[t.pname]=Ec(!1,(function(e,n,r){return t.factory.sketch(Kc(e,t,n,r))}))}),(function(t){r[t.pname]=_c(!0,(function(e,n,r){var o=e[t.name];return I(o,(function(n){return t.factory.sketch(Xn(t.defaults(e,n,r),n,t.overrides(e,n)))}))}))}))})),{internals:v(r),externals:v(o)}}(0,e,n)},Zc=function(t,e,n){return Oc(z.some(t),e,e.components,n)},ts=function(t,e,n){var r=e.partUids[n];return t.getSystem().getByUid(r).toOptional()},es=function(t,e,n){return ts(t,e,n).getOrDie("Could not find part: "+n)},ns=function(t,e){var n=function(t){return I(t,jc)}(e);return Lr(I(n,(function(e){return{key:e,value:t+"-"+e}})))},rs=function(t){return Sr("partUids","partUids",Qn((function(e){return ns(e.uid,t)})),dr())},os=Dc("alloy-premade"),is=function(t){return Ir(os,t)},as=function(t){return function(t,e){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:co(i.slice(1))}},t}((function(e){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return t.apply(void 0,n([e.getApis(),e],r,!1))}),t)},us=v("alloy-id-"),cs=v("data-alloy-id"),ss=us(),ls=cs(),fs=function(t,e){Object.defineProperty(t.dom,ls,{value:e,writable:!0})},ds=function(t){var e=we(t)?t.dom[ls]:null;return z.from(e)},ms=function(t){return Dc(t)},gs=function(t,e,n,r,o){var i=function(t,e){return(t.length>0?[_r("parts",t)]:[]).concat([Or("uid"),Ar("dom",{}),Ar("components",[]),ii("originalSpec"),Ar("debug.sketcher",{})]).concat(e)}(r,o);return xr(t+" [SpecSchema]",sr(i.concat(e)),n)},hs=function(t,e,n,r,o){var i=ps(o),a=function(t){return G(t,(function(t){return t.fold(z.none,z.some,z.none,z.none).map((function(t){return _r(t.name,t.schema.concat([ii(Xc())]))})).toArray()}))}(n),u=rs(n),c=gs(t,e,i,a,[u]),s=Qc(0,c,n);return r(c,Zc(t,c,s.internals()),i,s.externals())},ps=function(e){return function(t){return cn(t,"uid")}(e)?e:t(t({},e),{uid:ms("uid")})},vs=sr([Or("name"),Or("factory"),Or("configFields"),Ar("apis",{}),Ar("extraApis",{})]),bs=sr([Or("name"),Or("factory"),Or("configFields"),Or("partFields"),Ar("apis",{}),Ar("extraApis",{})]),ys=function(e){var n=xr("Sketcher for "+e.name,vs,e),r=nn(n.apis,as),o=nn(n.extraApis,(function(t,e){return so(t,e)}));return t(t({name:n.name,configFields:n.configFields,sketch:function(t){return function(t,e,n,r){var o=ps(r);return n(gs(t,e,o,[],[]),o)}(n.name,n.configFields,n.factory,t)}},r),o)},xs=function(e){var n=xr("Sketcher for "+e.name,bs,e),r=Yc(n.name,n.partFields),o=nn(n.apis,as),i=nn(n.extraApis,(function(t,e){return so(t,e)}));return t(t({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return hs(n.name,n.configFields,n.partFields,n.factory,t)},parts:r},o),i)},ws=ys({name:"Button",factory:function(e){var n,r=(n=e.action,Kr(q([n.map((function(t){return uo((function(e,n){t(e),n.stop()}))})).toArray(),Ei()]))),o=e.dom.tag,i=function(t){return un(e.dom,"attributes").bind((function(e){return un(e,t)}))};return{uid:e.uid,dom:e.dom,components:e.components,events:r,behaviours:yc(e.buttonBehaviours,[zi.config({}),gc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===o){var e=i("type").getOr("button"),n=i("role").map((function(t){return{role:t}})).getOr({});return t({type:e},n)}return{role:i("role").getOr("button")}}()},eventOrder:e.eventOrder}},configFields:[Ar("uid",void 0),Or("dom"),Ar("components",[]),bc("buttonBehaviours",[zi,gc]),Tr("action"),Tr("role"),Ar("eventOrder",{})]}),Cs=Object.freeze({__proto__:null,events:function(){return Kr([Yr(jt(),_)])},exhibit:function(){return lo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),Ss=xo({fields:[],name:"unselecting",active:Cs}),ks=function(e){var n=de.fromHtml(e),r=Te(n),o=function(e){var n=void 0!==e.dom.attributes?e.dom.attributes:[];return U(n,(function(e,n){var r;return"class"===n.name?e:t(t({},e),((r={})[n.name]=n.value,r))}),{})}(n),i=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(n),a=0===r.length?{}:{innerHtml:Ho(n)};return t({tag:ye(n),classes:i,attributes:o},a)},Os=function(t){var e,n=(e={prefix:ki},t.replace(/\$\{([^{}]*)\}/g,(function(t,n){var r=e[n];return function(t){var e=typeof t;return"string"===e||"number"===e}(r)?r.toString():t})));return ks(n)},Es=function(t){return{dom:Os(t)}},_s=function(t){return bo([xi.config({toggleClass:Oi("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),wi(t,(function(t,e){(e?xi.on:xi.off)(t)}))])},Ts=function(t,e,n,r){var o=_s(n);return Ds(e,r,o,t)},Ms=function(t,e){var n=e.ui.registry.getAll().icons;return z.from(n[t]).fold((function(){return Os('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+t+' ${prefix}-icon"></span>')}),(function(t){return Os('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+t+"</span>")}))},Ds=function(t,e,n,r){return ws.sketch({dom:Ms(t,r),action:e,buttonBehaviours:Xn(bo([Ss.config({})]),n)})},zs=Gc({schema:[Or("dom")],name:"label"}),As=function(t){return Gc({name:t+"-edge",overrides:function(e){return e.model.manager.edgeActions[t].fold((function(){return{}}),(function(t){return{events:Kr([Qr(Dt(),(function(e,n,r){return t(e,r)}),[e]),Qr(Nt(),(function(e,n,r){return t(e,r)}),[e]),Qr(Bt(),(function(e,n,r){r.mouseIsDown.get()&&t(e,r)}),[e])])}}))}})},Ns=As("top-left"),Bs=As("top"),Rs=As("top-right"),Hs=As("right"),Vs=As("bottom-right"),Is=As("bottom"),Ls=As("bottom-left"),Fs=As("left"),Ps=qc({name:"thumb",defaults:v({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Kr([to(Dt(),t,"spectrum"),to(zt(),t,"spectrum"),to(At(),t,"spectrum"),to(Nt(),t,"spectrum"),to(Bt(),t,"spectrum"),to(Rt(),t,"spectrum")])}}}),Us=qc({schema:[kr("mouseIsDown",(function(){return ko(!1)}))],name:"spectrum",overrides:function(t){var e=t.model.manager,n=function(n,r){return e.getValueFromEvent(r).map((function(r){return e.setValueFrom(n,t,r)}))};return{behaviours:bo([gc.config({mode:"special",onLeft:function(n){return e.onLeft(n,t)},onRight:function(n){return e.onRight(n,t)},onUp:function(n){return e.onUp(n,t)},onDown:function(n){return e.onDown(n,t)}}),zi.config({})]),events:Kr([Jr(Dt(),n),Jr(zt(),n),Jr(Nt(),n),Jr(Bt(),(function(e,r){t.mouseIsDown.get()&&n(e,r)}))])}}}),js=[zs,Fs,Hs,Bs,Is,Ns,Rs,Ls,Vs,Ps,Us],Ws=function(t,e,n){e.store.manager.onLoad(t,e,n)},qs=function(t,e,n){e.store.manager.onUnload(t,e,n)},Gs=Object.freeze({__proto__:null,onLoad:Ws,onUnload:qs,setValue:function(t,e,n,r){e.store.manager.setValue(t,e,n,r)},getValue:function(t,e,n){return e.store.manager.getValue(t,e,n)},getState:function(t,e,n){return n}}),$s=Object.freeze({__proto__:null,events:function(t,e){var n=t.resetOnDom?[oo((function(n,r){Ws(n,t,e)})),io((function(n,r){qs(n,t,e)}))]:[fo(t,e,Ws)];return Kr(n)}}),Xs=function(){var t=ko(null);return vo({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Ks=function(){var e=ko({}),n=ko({});return vo({readState:function(){return{mode:"dataset",dataByValue:e.get(),dataByText:n.get()}},lookup:function(t){return un(e.get(),t).orThunk((function(){return un(n.get(),t)}))},update:function(r){var o=e.get(),i=n.get(),a={},u={};L(r,(function(t){a[t.value]=t,un(t,"meta").each((function(e){un(e,"text").each((function(e){u[e]=t}))}))})),e.set(t(t({},o),a)),n.set(t(t({},i),u))},clear:function(){e.set({}),n.set({})}})},Ys=Object.freeze({__proto__:null,memory:Xs,dataset:Ks,manual:function(){return vo({readState:h})},init:function(t){return t.store.manager.state(t)}}),Js=function(t,e,n,r){var o=e.store;n.update([r]),o.setValue(t,r),e.onSetValue(t,r)},Qs=[Tr("initialValue"),Or("getFallbackEntry"),Or("getDataKey"),Or("setValue"),oi("manager",{setValue:Js,getValue:function(t,e,n){var r=e.store,o=r.getDataKey(t);return n.lookup(o).getOrThunk((function(){return r.getFallbackEntry(o)}))},onLoad:function(t,e,n){e.store.initialValue.each((function(r){Js(t,e,n,r)}))},onUnload:function(t,e,n){n.clear()},state:Ks})],Zs=[Or("getValue"),Ar("setValue",h),Tr("initialValue"),oi("manager",{setValue:function(t,e,n,r){e.store.setValue(t,r),e.onSetValue(t,r)},getValue:function(t,e,n){return e.store.getValue(t)},onLoad:function(t,e,n){e.store.initialValue.each((function(n){e.store.setValue(t,n)}))},onUnload:h,state:po.init})],tl=[Tr("initialValue"),oi("manager",{setValue:function(t,e,n,r){n.set(r),e.onSetValue(t,r)},getValue:function(t,e,n){return n.get()},onLoad:function(t,e,n){e.store.initialValue.each((function(t){n.isNotSet()&&n.set(t)}))},onUnload:function(t,e,n){n.clear()},state:Xs})],el=[Nr("store",{mode:"memory"},Cr("mode",{memory:tl,manual:Zs,dataset:Qs})),ti("onSetValue"),Ar("resetOnDom",!1)],nl=xo({fields:el,name:"representing",active:$s,apis:Gs,extra:{setValueFrom:function(t,e){var n=nl.getValue(e);nl.setValue(t,n)}},state:Ys}),rl=Pi("width",(function(t){return t.dom.offsetWidth})),ol=function(t,e){return rl.set(t,e)},il=function(t){return rl.get(t)},al=function(t,e){return{left:t,top:e,translate:function(n,r){return al(t+n,e+r)}}},ul=al,cl=v("slider.change.value"),sl=function(t){var e=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(e)){var n=e;return void 0!==n.touches&&1===n.touches.length?z.some(n.touches[0]).map((function(t){return ul(t.clientX,t.clientY)})):z.none()}var r=e;return void 0!==r.clientX?z.some(r).map((function(t){return ul(t.clientX,t.clientY)})):z.none()},ll=function(t){return t.model.minX},fl=function(t){return t.model.minY},dl=function(t){return t.model.minX-1},ml=function(t){return t.model.minY-1},gl=function(t){return t.model.maxX},hl=function(t){return t.model.maxY},pl=function(t){return t.model.maxX+1},vl=function(t){return t.model.maxY+1},bl=function(t,e,n){return e(t)-n(t)},yl=function(t){return bl(t,gl,ll)},xl=function(t){return bl(t,hl,fl)},wl=function(t){return yl(t)/2},Cl=function(t){return xl(t)/2},Sl=function(t){return t.stepSize},kl=function(t){return t.snapToGrid},Ol=function(t){return t.snapStart},El=function(t){return t.rounded},_l=function(t,e){return void 0!==t[e+"-edge"]},Tl=function(t){return _l(t,"left")},Ml=function(t){return _l(t,"right")},Dl=function(t){return _l(t,"top")},zl=function(t){return _l(t,"bottom")},Al=function(t){return t.model.value.get()},Nl=function(t){return{x:t}},Bl=function(t){return{y:t}},Rl=function(t,e){return{x:t,y:e}},Hl=function(t,e){ue(t,cl(),{value:e})},Vl=function(t,e,n,r){return t<e?t:t>n?n:t===e?e-1:Math.max(e,t-r)},Il=function(t,e,n,r){return t>n?t:t<e?e:t===n?n+1:Math.min(n,t+r)},Ll=function(t,e,n){return Math.max(e,Math.min(n,t))},Fl=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.step,a=t.snap,u=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?e-1:e,h=l?n+1:n;if(o<f)return g;if(o>d)return h;var p=function(t,e,n){return Math.min(n,Math.max(t,e))-e}(o,f,d),v=Ll(p/m*r+e,g,h);return a&&v>=e&&v<=n?function(t,e,n,r,o){return o.fold((function(){var o=t-e,i=Math.round(o/r)*r;return Ll(e+i,e-1,n+1)}),(function(e){var o=(t-e)%r,i=Math.round(o/r),a=Math.floor((t-e)/r),u=Math.floor((n-e)/r),c=e+Math.min(u,a+i)*r;return Math.max(e,c)}))}(v,e,n,i,u):c?Math.round(v):v},Pl=function(t){var e=t.min,n=t.max,r=t.range,o=t.value,i=t.hasMinEdge,a=t.hasMaxEdge,u=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return o<e?i?0:s:o>n?a?u:l:(o-e)/r*c},Ul="top",jl="right",Wl="bottom",ql="left",Gl=function(t){return t.element.dom.getBoundingClientRect()},$l=function(t,e){return t[e]},Xl=function(t){var e=Gl(t);return $l(e,ql)},Kl=function(t){var e=Gl(t);return $l(e,jl)},Yl=function(t){var e=Gl(t);return $l(e,Ul)},Jl=function(t){var e=Gl(t);return $l(e,Wl)},Ql=function(t){var e=Gl(t);return $l(e,"width")},Zl=function(t){var e=Gl(t);return $l(e,"height")},tf=function(t,e,n){return(t+e)/2-n},ef=function(t,e){var n=Gl(t),r=Gl(e),o=$l(n,ql),i=$l(n,jl),a=$l(r,ql);return tf(o,i,a)},nf=function(t,e){var n=Gl(t),r=Gl(e),o=$l(n,Ul),i=$l(n,Wl),a=$l(r,Ul);return tf(o,i,a)},rf=function(t,e){ue(t,cl(),{value:e})},of=function(t){return{x:t}},af=function(t,e,n){var r={min:ll(e),max:gl(e),range:yl(e),value:n,step:Sl(e),snap:kl(e),snapStart:Ol(e),rounded:El(e),hasMinEdge:Tl(e),hasMaxEdge:Ml(e),minBound:Xl(t),maxBound:Kl(t),screenRange:Ql(t)};return Fl(r)},uf=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Il:Vl)(Al(n).x,ll(n),gl(n),Sl(n));return rf(e,of(r)),z.some(r)}(t,e,n).map(_)}},cf=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=Ql(t),a=r.bind((function(e){return z.some(ef(e,t))})).getOr(0),u=o.bind((function(e){return z.some(ef(e,t))})).getOr(i),c={min:ll(e),max:gl(e),range:yl(e),value:n,hasMinEdge:Tl(e),hasMaxEdge:Ml(e),minBound:Xl(t),minOffset:0,maxBound:Kl(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Pl(c)}(e,i,n,r,o);return Xl(e)-Xl(t)+a},sf=uf(-1),lf=uf(1),ff=z.none,df=z.none,mf={"top-left":z.none(),top:z.none(),"top-right":z.none(),right:z.some((function(t,e){Hl(t,Nl(pl(e)))})),"bottom-right":z.none(),bottom:z.none(),"bottom-left":z.none(),left:z.some((function(t,e){Hl(t,Nl(dl(e)))}))},gf=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=af(t,e,n),o=of(r);return rf(t,o),r},setToMin:function(t,e){var n=ll(e);rf(t,of(n))},setToMax:function(t,e){var n=gl(e);rf(t,of(n))},findValueOfOffset:af,getValueFromEvent:function(t){return sl(t).map((function(t){return t.left}))},findPositionOfValue:cf,setPositionFromValue:function(t,e,n,r){var o=Al(n),i=cf(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=il(e.element)/2;Bi(e.element,"left",i-a+"px")},onLeft:sf,onRight:lf,onUp:ff,onDown:df,edgeActions:mf}),hf=function(t,e){ue(t,cl(),{value:e})},pf=function(t){return{y:t}},vf=function(t,e,n){var r={min:fl(e),max:hl(e),range:xl(e),value:n,step:Sl(e),snap:kl(e),snapStart:Ol(e),rounded:El(e),hasMinEdge:Dl(e),hasMaxEdge:zl(e),minBound:Yl(t),maxBound:Jl(t),screenRange:Zl(t)};return Fl(r)},bf=function(t){return function(e,n){return function(t,e,n){var r=(t>0?Il:Vl)(Al(n).y,fl(n),hl(n),Sl(n));return hf(e,pf(r)),z.some(r)}(t,e,n).map(_)}},yf=function(t,e,n,r,o,i){var a=function(t,e,n,r,o){var i=Zl(t),a=r.bind((function(e){return z.some(nf(e,t))})).getOr(0),u=o.bind((function(e){return z.some(nf(e,t))})).getOr(i),c={min:fl(e),max:hl(e),range:xl(e),value:n,hasMinEdge:Dl(e),hasMaxEdge:zl(e),minBound:Yl(t),minOffset:0,maxBound:Jl(t),maxOffset:i,centerMinEdge:a,centerMaxEdge:u};return Pl(c)}(e,i,n,r,o);return Yl(e)-Yl(t)+a},xf=z.none,wf=z.none,Cf=bf(-1),Sf=bf(1),kf={"top-left":z.none(),top:z.some((function(t,e){Hl(t,Bl(ml(e)))})),"top-right":z.none(),right:z.none(),"bottom-right":z.none(),bottom:z.some((function(t,e){Hl(t,Bl(vl(e)))})),"bottom-left":z.none(),left:z.none()},Of=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=vf(t,e,n),o=pf(r);return hf(t,o),r},setToMin:function(t,e){var n=fl(e);hf(t,pf(n))},setToMax:function(t,e){var n=hl(e);hf(t,pf(n))},findValueOfOffset:vf,getValueFromEvent:function(t){return sl(t).map((function(t){return t.top}))},findPositionOfValue:yf,setPositionFromValue:function(t,e,n,r){var o=Al(n),i=yf(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),a=ji(e.element)/2;Bi(e.element,"top",i-a+"px")},onLeft:xf,onRight:wf,onUp:Cf,onDown:Sf,edgeActions:kf}),Ef=function(t,e){ue(t,cl(),{value:e})},_f=function(t,e){return{x:t,y:e}},Tf=function(t,e){return function(n,r){return function(t,e,n,r){var o=t>0?Il:Vl,i=e?Al(r).x:o(Al(r).x,ll(r),gl(r),Sl(r)),a=e?o(Al(r).y,fl(r),hl(r),Sl(r)):Al(r).y;return Ef(n,_f(i,a)),z.some(i)}(t,e,n,r).map(_)}},Mf=Tf(-1,!1),Df=Tf(1,!1),zf=Tf(-1,!0),Af=Tf(1,!0),Nf={"top-left":z.some((function(t,e){Hl(t,Rl(dl(e),ml(e)))})),top:z.some((function(t,e){Hl(t,Rl(wl(e),ml(e)))})),"top-right":z.some((function(t,e){Hl(t,Rl(pl(e),ml(e)))})),right:z.some((function(t,e){Hl(t,Rl(pl(e),Cl(e)))})),"bottom-right":z.some((function(t,e){Hl(t,Rl(pl(e),vl(e)))})),bottom:z.some((function(t,e){Hl(t,Rl(wl(e),vl(e)))})),"bottom-left":z.some((function(t,e){Hl(t,Rl(dl(e),vl(e)))})),left:z.some((function(t,e){Hl(t,Rl(dl(e),Cl(e)))}))},Bf=Object.freeze({__proto__:null,setValueFrom:function(t,e,n){var r=af(t,e,n.left),o=vf(t,e,n.top),i=_f(r,o);return Ef(t,i),i},setToMin:function(t,e){var n=ll(e),r=fl(e);Ef(t,_f(n,r))},setToMax:function(t,e){var n=gl(e),r=hl(e);Ef(t,_f(n,r))},getValueFromEvent:function(t){return sl(t)},setPositionFromValue:function(t,e,n,r){var o=Al(n),i=cf(t,r.getSpectrum(t),o.x,r.getLeftEdge(t),r.getRightEdge(t),n),a=yf(t,r.getSpectrum(t),o.y,r.getTopEdge(t),r.getBottomEdge(t),n),u=il(e.element)/2,c=ji(e.element)/2;Bi(e.element,"left",i-u+"px"),Bi(e.element,"top",a-c+"px")},onLeft:Mf,onRight:Df,onUp:zf,onDown:Af,edgeActions:Nf}),Rf=[Ar("stepSize",1),Ar("onChange",h),Ar("onChoose",h),Ar("onInit",h),Ar("onDragStart",h),Ar("onDragEnd",h),Ar("snapToGrid",!1),Ar("rounded",!0),Tr("snapStart"),Er("model",Cr("mode",{x:[Ar("minX",0),Ar("maxX",100),kr("value",(function(t){return ko(t.mode.minX)})),Or("getInitialValue"),oi("manager",gf)],y:[Ar("minY",0),Ar("maxY",100),kr("value",(function(t){return ko(t.mode.minY)})),Or("getInitialValue"),oi("manager",Of)],xy:[Ar("minX",0),Ar("maxX",100),Ar("minY",0),Ar("maxY",100),kr("value",(function(t){return ko({x:t.mode.minX,y:t.mode.minY})})),Or("getInitialValue"),oi("manager",Bf)]})),hc("sliderBehaviours",[gc,nl]),kr("mouseIsDown",(function(){return ko(!1)}))],Hf=v("mouse.released"),Vf=xs({name:"Slider",configFields:Rf,partFields:js,factory:function(t,e,n,r){var o,i=function(e){return es(e,t,"thumb")},a=function(e){return es(e,t,"spectrum")},u=function(e){return ts(e,t,"left-edge")},c=function(e){return ts(e,t,"right-edge")},s=function(e){return ts(e,t,"top-edge")},l=function(e){return ts(e,t,"bottom-edge")},f=t.model,d=f.manager,m=function(e,n){d.setPositionFromValue(e,n,t,{getLeftEdge:u,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,e){f.value.set(e);var n=i(t);m(t,n)},h=function(e){var n=t.mouseIsDown.get();t.mouseIsDown.set(!1),n&&ts(e,t,"thumb").each((function(n){var r=f.value.get();t.onChoose(e,n,r)}))},p=function(e,n){n.stop(),t.mouseIsDown.set(!0),t.onDragStart(e,i(e))},v=function(e,n){n.stop(),t.onDragEnd(e,i(e)),h(e)};return{uid:t.uid,dom:t.dom,components:e,behaviours:vc(t.sliderBehaviours,[gc.config({mode:"special",focusIn:function(e){return ts(e,t,"spectrum").map(gc.focusIn).map(_)}}),nl.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),ci.config({channels:(o={},o[Hf()]={onReceive:h},o)})]),events:Kr([Jr(cl(),(function(e,n){!function(e,n){g(e,n);var r=i(e);t.onChange(e,r,n),z.some(!0)}(e,n.event.value)})),oo((function(e,n){var r=f.getInitialValue();f.value.set(r);var o=i(e);m(e,o);var u=a(e);t.onInit(e,o,u,f.value.get())})),Jr(Dt(),p),Jr(At(),v),Jr(Nt(),p),Jr(Rt(),v)]),apis:{resetToMin:function(e){d.setToMin(e,t)},resetToMax:function(e){d.setToMax(e,t)},setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,e,n){t.setValue(e,n)},resetToMin:function(t,e){t.resetToMin(e)},resetToMax:function(t,e){t.resetToMax(e)},refresh:function(t,e){t.refresh(e)}}}),If=function(t,e,n,r){return Ds(e,(function(){var r=n();t.setContextToolbar([{label:e+" group",items:r}])}),{},r)},Lf=function(t){var e=function(t){return t<0?"black":t>360?"white":"hsl("+t+", 100%, 50%)"};return Vf.sketch({dom:Os('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Vf.parts["left-edge"](Es('<div class="${prefix}-hue-slider-black"></div>')),Vf.parts.spectrum({dom:Os('<div class="${prefix}-slider-gradient-container"></div>'),components:[Es('<div class="${prefix}-slider-gradient"></div>')],behaviours:bo([xi.config({toggleClass:Oi("thumb-active")})])}),Vf.parts["right-edge"](Es('<div class="${prefix}-hue-slider-white"></div>')),Vf.parts.thumb({dom:Os('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([xi.config({toggleClass:Oi("thumb-active")})])})],onChange:function(n,r,o){var i=e(o.x());Bi(r.element,"background-color",i),t.onChange(n,r,i)},onDragStart:function(t,e){xi.on(e)},onDragEnd:function(t,e){xi.off(e)},onInit:function(t,n,r,o){var i=e(o.x());Bi(n.element,"background-color",i)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:t.getInitialValue()}}},sliderBehaviours:bo([Ci(Vf.refresh)])})},Ff=function(t,e){var n={onChange:function(t,n,r){e.undoManager.transact((function(){e.formatter.apply("forecolor",{value:r}),e.nodeChanged()}))},getInitialValue:v(-1)};return If(t,"color-levels",(function(){return function(t){return[Lf(t)]}(n)}),e)},Pf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Uf=function(t,e){return(we(e)?z.some(e):_e(e).filter(we)).map((function(e){var n=function(t,e,n){return Ki((function(t,e){return e(t)}),Ji,t,e,n)}(e,(function(t){return Ii(t,"font-size").isSome()}),t).bind((function(t){return Ii(t,"font-size")}));return n.getOrThunk((function(){return Hi(e,"font-size")}))})).getOr("")},jf=function(t){var e=t.selection.getStart(),n=de.fromDom(e),r=de.fromDom(t.getBody()),o=Uf((function(t){return ve(r,t)}),n);return j(Pf,(function(t){return o===t})).getOr("medium")},Wf=function(t){return function(t){return W(Pf,(function(e){return e===t}))}(jf(t)).getOr(2)},qf=function(t,e){(function(t){return z.from(Pf[t])})(e).each((function(e){!function(t,e){jf(t)!==e&&t.execCommand("fontSize",!1,e)}(t,e)}))},Gf=v(Pf),$f=sr([Or("getInitialValue"),Or("onChange"),Or("category"),Or("sizes")]),Xf=function(t){var e=xr("SizeSlider",$f,t);return Vf.sketch({dom:{tag:"div",classes:[Oi("slider-"+e.category+"-size-container"),Oi("slider"),Oi("slider-size-container")]},onChange:function(t,n,r){var o=r.x();(function(t){return t>=0&&t<e.sizes.length})(o)&&e.onChange(o)},onDragStart:function(t,e){xi.on(e)},onDragEnd:function(t,e){xi.off(e)},model:{mode:"x",minX:0,maxX:e.sizes.length-1,getInitialValue:function(){return{x:e.getInitialValue()}}},stepSize:1,snapToGrid:!0,sliderBehaviours:bo([Ci(Vf.refresh)]),components:[Vf.parts.spectrum({dom:Os('<div class="${prefix}-slider-size-container"></div>'),components:[Es('<div class="${prefix}-slider-size-line"></div>')]}),Vf.parts.thumb({dom:Os('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([xi.config({toggleClass:Oi("thumb-active")})])})]})},Kf=Gf(),Yf=function(t){return Xf({onChange:t.onChange,sizes:Kf,category:"font",getInitialValue:t.getInitialValue})},Jf=function(t){return[Es('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),Yf(t),Es('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')]},Qf=function(e){var n=function(t){return void 0!==t.uid}(e)&&sn(e,"uid")?e.uid:ms("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return t(t({},e),{uid:n})}}},Zf={},td={exports:Zf};!function(t,e,n,r){!function(r,o){"object"==typeof e&&void 0!==n?n.exports=o():"function"==typeof t&&t.amd?t(o):(r="undefined"!=typeof globalThis?globalThis:r||self).EphoxContactWrapper=o()}(this,(function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e={exports:{}};!function(e){!function(t){var n=setTimeout;function r(){}function o(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function i(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,o._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}a(e.promise,r)}else(1===t._state?a:u)(e.promise,t._value)}))):t._deferreds.push(e)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void c(t);if("function"==typeof n)return void l((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,c(t)}catch(e){u(t,e)}var r,i}function u(t,e){t._state=2,t._value=e,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&o._immediateFn((function(){t._handled||o._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)i(t,t._deferreds[e]);t._deferreds=null}function s(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,a(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}o.prototype.catch=function(t){return this.then(null,t)},o.prototype.then=function(t,e){var n=new this.constructor(r);return i(this,new s(t,e,n)),n},o.all=function(t){var e=Array.prototype.slice.call(t);return new o((function(t,n){if(0===e.length)return t([]);var r=e.length;function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(t){o(i,t)}),n)}e[i]=a,0==--r&&t(e)}catch(t){n(t)}}for(var i=0;i<e.length;i++)o(i,e[i])}))},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o((function(e){e(t)}))},o.reject=function(t){return new o((function(e,n){n(t)}))},o.race=function(t){return new o((function(e,n){for(var r=0,o=t.length;r<o;r++)t[r].then(e,n)}))},o._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){n(t,0)},o._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},o._setImmediateFn=function(t){o._immediateFn=t},o._setUnhandledRejectionFn=function(t){o._unhandledRejectionFn=t},e.exports?e.exports=o:t.Promise||(t.Promise=o)}(t)}(e);var n=e.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||n}}))}(void 0,Zf,td);var ed,nd,rd,od=td.exports.boltExport,id=function(t){return function(t){return new od((function(e){var n=new FileReader;n.onloadend=function(){e(n.result)},n.readAsDataURL(t)}))}(t).then((function(t){return t.split(",")[1]}))},ad=function(t,e){(function(t){return id(t)})(e).then((function(n){t.undoManager.transact((function(){var r=t.editorUpload.blobCache,o=r.create(Dc("mceu"),e,n);r.add(o);var i=t.dom.createHTML("img",{src:o.blobUri()});t.insertContent(i)}))}))},ud=function(t){var e=Qf({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Kr([eo(Pt()),Jr(Ft(),(function(e,n){(function(t){var e=t.event.raw,n=e.target.files||e.dataTransfer.files;return z.from(n[0])})(n).each((function(e){ad(t,e)}))}))])});return ws.sketch({dom:Ms("image",t),components:[e.asSpec()],action:function(t){e.get(t).element.dom.click()}})},cd=function(t){return t.dom.textContent},sd=function(t){return t.length>0},ld=function(t){return null==t?"":t},fd=function(t){return gd(t).fold((function(){return function(t){return{url:"",text:t.selection.getContent({format:"text"}),title:"",target:"",link:z.none()}}(t)}),(function(t){return function(t){var e=cd(t),n=mn(t,"href"),r=mn(t,"title"),o=mn(t,"target");return{url:ld(n),text:e!==n?ld(e):"",title:ld(r),target:ld(o),link:z.some(t)}}(t)}))},dd=function(t,e,n){return n.text.toOptional().filter(sd).fold((function(){return function(t){return mn(t,"href")===cd(t)}(t)?z.some(e):z.none()}),z.some)},md=function(t,e){e.url.toOptional().filter(sd).fold((function(){!function(t,e){e.link.bind(b).each((function(e){t.execCommand("unlink")}))}(t,e)}),(function(n){var r=function(t,e){var n={};return n.href=t,e.title.toOptional().filter(sd).each((function(t){n.title=t})),e.target.toOptional().filter(sd).each((function(t){n.target=t})),n}(n,e);e.link.bind(b).fold((function(){var o=e.text.toOptional().filter(sd).getOr(n);t.insertContent(t.dom.createHTML("a",r,t.dom.encode(o)))}),(function(t){var o=dd(t,n,e);dn(t,r),o.each((function(e){!function(t,e){t.dom.textContent=e}(t,e)}))}))}))},gd=function(t){var e=de.fromDom(t.selection.getStart());return ea(e,"a")},hd=Tt(),pd=function(t,e){var n=e.selection.getRng();t(),e.selection.setRng(n)},vd=function(t,e){var n=function(t,e){var n=Kr(e);return xo({fields:[Or("enabled")],name:t,active:{events:v(n)}})}(t,e);return{key:t,value:{config:{},me:n,configAsRaw:v({}),initialConfig:{},state:po}}},bd=Object.freeze({__proto__:null,getCurrent:function(t,e,n){return e.find(t)}}),yd=[Or("find")],xd=xo({fields:yd,name:"composing",apis:bd}),wd=ys({name:"Container",factory:function(n){var r=n.dom,o=r.attributes,i=e(r,["attributes"]);return{uid:n.uid,dom:t({tag:"div",attributes:t({role:"presentation"},o)},i),components:n.components,behaviours:pc(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Ar("components",[]),hc("containerBehaviours",[]),Ar("events",{}),Ar("domModification",{}),Ar("eventOrder",{})]}),Cd=ys({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:yc(t.dataBehaviours,[nl.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),xd.config({find:z.some})]),events:Kr([oo((function(e,n){nl.setValue(e,t.getInitialValue())}))])}},configFields:[Or("uid"),Or("dom"),Or("getInitialValue"),bc("dataBehaviours",[nl,xd])]}),Sd=function(t){return t.dom.value},kd=function(t,e){if(void 0===e)throw new Error("Value.set was undefined");t.dom.value=e},Od=v([Tr("data"),Ar("inputAttributes",{}),Ar("inputStyles",{}),Ar("tag","input"),Ar("inputClasses",[]),ti("onSetValue"),Ar("styles",{}),Ar("eventOrder",{}),hc("inputBehaviours",[nl,zi]),Ar("selectOnFocus",!0)]),Ed=function(e){return t(t({},function(t){return bo([zi.config({onFocus:t.selectOnFocus?function(t){var e=t.element,n=Sd(e);e.dom.setSelectionRange(0,n.length)}:h})])}(e)),vc(e.inputBehaviours,[nl.config({store:t(t({mode:"manual"},e.data.map((function(t){return{initialValue:t}})).getOr({})),{getValue:function(t){return Sd(t.element)},setValue:function(t,e){Sd(t.element)!==e&&kd(t.element,e)}}),onSetValue:e.onSetValue})]))},_d=function(e){return{tag:e.tag,attributes:t({type:"text"},e.inputAttributes),styles:e.inputStyles,classes:e.inputClasses}},Td=ys({name:"Input",configFields:Od(),factory:function(t,e){return{uid:t.uid,dom:_d(t),components:[],behaviours:Ed(t),eventOrder:t.eventOrder}}}),Md=Object.freeze({__proto__:null,exhibit:function(t,e){return lo({attributes:Lr([{key:e.tabAttr,value:"true"}])})}}),Dd=[Ar("tabAttr","data-alloy-tabstop")],zd=xo({fields:Dd,name:"tabstopping",active:Md}),Ad=tinymce.util.Tools.resolve("tinymce.util.I18n"),Nd=function(t,e){var n=Qf(Td.sketch({inputAttributes:{placeholder:Ad.translate(e)},onSetValue:function(t,e){ae(t,Lt())},inputBehaviours:bo([xd.config({find:z.some}),zd.config({}),gc.config({mode:"execution"})]),selectOnFocus:!1})),r=Qf(ws.sketch({dom:Os('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(t){var e=n.get(t);nl.setValue(e,"")}}));return{name:t,spec:wd.sketch({dom:Os('<div class="${prefix}-input-container"></div>'),components:[n.asSpec(),r.asSpec()],containerBehaviours:bo([xi.config({toggleClass:Oi("input-container-empty")}),xd.config({find:function(t){return z.some(n.get(t))}}),vd("input-clearing",[Jr(Lt(),(function(t){var e=n.get(t);(nl.getValue(e).length>0?xi.off:xi.on)(t)}))])])})}},Bd=function(t){return{name:t,spec:Cd.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return z.none()}})}},Rd=["input","button","textarea","select"],Hd=function(t,e,n){(e.disabled()?Ud:jd)(t,e)},Vd=function(t,e){return!0===e.useNative&&H(Rd,ye(t.element))},Id=function(t){fn(t.element,"disabled","disabled")},Ld=function(t){pn(t.element,"disabled")},Fd=function(t){fn(t.element,"aria-disabled","true")},Pd=function(t){fn(t.element,"aria-disabled","false")},Ud=function(t,e,n){e.disableClass.each((function(e){wn(t.element,e)})),(Vd(t,e)?Id:Fd)(t),e.onDisabled(t)},jd=function(t,e,n){e.disableClass.each((function(e){Sn(t.element,e)})),(Vd(t,e)?Ld:Pd)(t),e.onEnabled(t)},Wd=function(t,e){return Vd(t,e)?function(t){return hn(t.element,"disabled")}(t):function(t){return"true"===mn(t.element,"aria-disabled")}(t)},qd=Object.freeze({__proto__:null,enable:jd,disable:Ud,isDisabled:Wd,onLoad:Hd,set:function(t,e,n,r){(r?Ud:jd)(t,e)}}),Gd=Object.freeze({__proto__:null,exhibit:function(t,e){return lo({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,e){return Kr([Yr(Yt(),(function(e,n){return Wd(e,t)})),fo(t,e,Hd)])}}),$d=[(ed="disabled",nd=E,Nr(ed,nd,mr)),Ar("useNative",!0),Tr("disableClass"),ti("onDisabled"),ti("onEnabled")],Xd=xo({fields:$d,name:"disabling",active:Gd,apis:qd}),Kd="form",Yd=[hc("formBehaviours",[nl])],Jd=function(t){return"<alloy.field."+t+">"},Qd=function(t,e){return{uid:t.uid,dom:t.dom,components:e,behaviours:vc(t.formBehaviours,[nl.config({store:{mode:"manual",getValue:function(e){var n=function(t,e){var n=t.getSystem();return nn(e.partUids,(function(t,e){return v(n.getByUid(t))}))}(e,t);return nn(n,(function(t,e){return t().bind((function(t){var n,r,o=xd.getCurrent(t);return n=o,r=new Error("Cannot find a current component to extract the value from for form part '"+e+"': "+Fo(t.element)),n.fold((function(){return Mn.error(r)}),Mn.value)})).map(nl.getValue)}))},setValue:function(e,n){en(n,(function(n,r){ts(e,t,r).each((function(t){xd.getCurrent(t).each((function(t){nl.setValue(t,n)}))}))}))}}})]),apis:{getField:function(e,n){return ts(e,t,n).bind(xd.getCurrent)}}}},Zd=(as((function(t,e,n){return t.getField(e,n)})),function(t){var e=function(){var t=[];return{field:function(e,n){return t.push(e),function(t,e,n){return{uiType:Tc(),owner:t,name:e,config:n,validated:{}}}(Kd,Jd(e),n)},record:v(t)}}(),n=t(e),r=e.record(),o=I(r,(function(t){return qc({name:t,pname:Jd(t)})}));return hs(Kd,Yd,o,Qd,n)}),tm=function(t){var e="navigateEvent",n=lr([Or("fields"),Ar("maxFieldIndex",t.fields.length-1),Or("onExecute"),Or("getInitialValue"),kr("state",(function(){return{dialogSwipeState:Ka(),currentScreen:ko(0)}}))]),r=xr("SerialisedDialog",n,t),o=function(t,n,r){return ws.sketch({dom:Os('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ue(n,e,{direction:t})},buttonBehaviours:bo([Xd.config({disableClass:Oi("toolbar-navigation-disabled"),disabled:function(){return!r}})])})},i=function(t,e){var n=Xi(t.element,"."+Oi("serialised-dialog-screen"));ta(t.element,"."+Oi("serialised-dialog-chain")).each((function(t){r.state.currentScreen.get()+e>=0&&r.state.currentScreen.get()+e<n.length&&(Ii(t,"left").each((function(r){var o=parseInt(r,10),i=il(n[0]);Bi(t,"left",o-e*i+"px")})),r.state.currentScreen.set(r.state.currentScreen.get()+e))}))},a=function(t){var e=Xi(t.element,"input");z.from(e[r.state.currentScreen.get()]).each((function(e){t.getSystem().getByDom(e).each((function(e){var n,r;n=t,r=e.element,n.getSystem().triggerFocus(r,n.element)}))}));var n=c.get(t);Na.highlightAt(n,r.state.currentScreen.get())},u=Qf(Zd((function(t){return{dom:Os('<div class="${prefix}-serialised-dialog"></div>'),components:[wd.sketch({dom:Os('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:I(r.fields,(function(e,n){return n<=r.maxFieldIndex?wd.sketch({dom:Os('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",n>0),t.field(e.name,e.spec),o(1,"next",n<r.maxFieldIndex)]}):t.field(e.name,e.spec)}))})],formBehaviours:bo([Ci((function(t,e){!function(t,e){ta(t.element,"."+Oi("serialised-dialog-chain")).each((function(t){Bi(t,"left",-r.state.currentScreen.get()*e.width+"px")}))}(t,e)})),gc.config({mode:"special",focusIn:function(t,e){a(t)},onTab:function(t,e){return i(t,1),z.some(!0)},onShiftTab:function(t,e){return i(t,-1),z.some(!0)}}),vd("form-events",[oo((function(t,e){r.state.currentScreen.set(0),r.state.dialogSwipeState.clear();var n=c.get(t);Na.highlightFirst(n),r.getInitialValue(t).each((function(e){nl.setValue(t,e)}))})),uo(r.onExecute),Jr(Ut(),(function(t,e){"left"===e.event.raw.propertyName&&a(t)})),Jr(e,(function(t,e){var n=e.event.direction;i(t,n)}))])])}}))),c=Qf({dom:Os('<div class="${prefix}-dot-container"></div>'),behaviours:bo([Na.config({highlightClass:Oi("dot-active"),itemClass:Oi("dot-item")})]),components:G(r.fields,(function(t,e){return e<=r.maxFieldIndex?[Es('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]}))});return{dom:Os('<div class="${prefix}-serializer-wrapper"></div>'),components:[u.asSpec(),c.asSpec()],behaviours:bo([gc.config({mode:"special",focusIn:function(t){var e=u.get(t);gc.focusIn(e)}}),vd("serializer-wrapper-events",[Jr(Dt(),(function(t,e){var n=e.event;r.state.dialogSwipeState.set(function(t){return{xValue:t,points:[]}}(n.raw.touches[0].clientX))})),Jr(zt(),(function(t,e){var n=e.event;r.state.dialogSwipeState.on((function(t){e.event.prevent(),r.state.dialogSwipeState.set(function(t,e){if(e===t.xValue)return t;var n=e-t.xValue>0?1:-1,r={direction:n,xValue:e};return{xValue:e,points:(0===t.points.length?[]:t.points[t.points.length-1].direction===n?t.points.slice(0,t.points.length-1):t.points).concat([r])}}(t,n.raw.touches[0].clientX))}))})),Jr(At(),(function(t,e){r.state.dialogSwipeState.on((function(e){var n=u.get(t),r=-1*function(t){if(0===t.points.length)return 0;var e=t.points[0].direction,n=t.points[t.points.length-1].direction;return-1===e&&-1===n?-1:1===e&&1===n?1:0}(e);i(n,r)}))}))])])}},em=A((function(t,e){return[{label:"the link group",items:[tm({fields:[Nd("url","Type or paste URL"),Nd("text","Link text"),Nd("title","Link title"),Nd("target","Link target"),Bd("link")],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return z.some(fd(e))},onExecute:function(n,r){var o=nl.getValue(n);md(e,o),t.restoreToolbar(),e.focus()}})]}]})),nm=function(t,e){return Ts(e,"link","link",(function(){var n=em(t,e);t.setContextToolbar(n),function(t,e){(hd.os.isAndroid()?pd:O)(e,t)}(e,(function(){t.focusToolbar()})),gd(e).each((function(t){e.selection.select(t.dom)}))}))},rm=Kr([function(t,e){return{key:t,value:$r({can:e})}}(Gt(),(function(t,e){var n=e.event,r=n.originator,o=n.target;return!function(t,e,n){return ve(e,t.element)&&!ve(e,n)}(t,r,o)||(console.warn(Gt()+" did not get interpreted by the desired target. \nOriginator: "+Fo(r)+"\nTarget: "+Fo(o)+"\nCheck the "+Gt()+" event handlers"),!1)}))]),om=Object.freeze({__proto__:null,events:rm}),im=b,am=function(t){var e=function(e){return"The component must be in a context to execute: "+e+(t?"\n"+Fo(t().element)+" is not in context.":"")},n=function(t){return function(){throw new Error(e(t))}},r=function(t){return function(){console.warn(e(t))}};return{debugInfo:v("fake"),triggerEvent:r("triggerEvent"),triggerFocus:r("triggerFocus"),triggerEscape:r("triggerEscape"),broadcast:r("broadcast"),broadcastOn:r("broadcastOn"),broadcastEvent:r("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:E}},um=am(),cm=function(t,e){var n={};return en(t,(function(t,r){en(t,(function(t,o){var i=un(n,o).getOr([]);n[o]=i.concat([e(r,t)])}))})),n},sm=function(t,e,n,r){try{var o=(i=n,a=function(n,o){var i=n[e],a=o[e],u=r.indexOf(i),c=r.indexOf(a);if(-1===u)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+a+".\nOrder specified: "+JSON.stringify(r,null,2));return u<c?-1:c<u?1:0},(u=N.call(i,0)).sort(a),u);return Mn.value(o)}catch(t){return Mn.error([t])}var i,a,u},lm=function(t){return t.cHandler},fm=function(t,e){return{name:t,handler:e}},dm=function(e,n,r){var o=t(t({},r),function(t,e){var n={};return L(t,(function(t){n[t.name()]=t.handlers(e)})),n}(n,e));return cm(o,fm)},mm=function(t){var e=function(t){return m(t)?{can:_,abort:E,run:t}:t}(t);return function(t,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];var i=[t,n].concat(r);e.abort.apply(void 0,i)?n.stop():e.can.apply(void 0,i)&&e.run.apply(void 0,i)}},gm=function(t,e,n){var r=e[n];return r?sm("Event: "+n,"name",t,r).map((function(t){var e=I(t,(function(t){return t.handler}));return Xr(e)})):function(t,e){return Mn.error(["The event ("+t+') 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(I(e,(function(t){return t.name})),null,2)])}(n,t)},hm=function(t,e){var n=an(t,(function(t,n){return(1===t.length?Mn.value(t[0].handler):gm(t,e,n)).map((function(r){var o=mm(r),i=t.length>1?F(e[n],(function(e){return V(t,(function(t){return t.name===e}))})).join(" > "):t[0].name;return Ir(n,function(t,e){return{handler:t,purpose:e}}(o,i))}))}));return Fr(n,{})},pm="alloy.base.behaviour",vm=lr([Sr("dom","dom",{tag:"required",process:{}},lr([Or("tag"),Ar("styles",{}),Ar("classes",[]),Ar("attributes",{}),Tr("value"),Tr("innerHtml")])),Or("components"),Or("uid"),Ar("events",{}),Ar("apis",{}),Sr("eventOrder","eventOrder",function(t){return Qn(v(t))}((rd={},rd[Yt()]=["disabling",pm,"toggling","typeaheadevents"],rd[Gt()]=[pm,"focusing","keying"],rd[te()]=[pm,"disabling","toggling","representing"],rd[Lt()]=[pm,"representing","streaming","invalidating"],rd[ne()]=[pm,"representing","item-events","tooltipping"],rd[Nt()]=["focusing",pm,"item-type-events"],rd[Dt()]=["focusing",pm,"item-type-events"],rd[Ht()]=["item-type-events","tooltipping"],rd[Kt()]=["receiving","reflecting","tooltipping"],rd)),dr()),Tr("domModification")]),bm=function(t){return t.events},ym=function(t,e){L(e,(function(e){wn(t,e)}))},xm=function(t,e){L(e,(function(e){Sn(t,e)}))},wm=function(t,e){return function(t,e){var n=I(e,(function(t){return Dr(t.name(),[Or("config"),Ar("state",po)])})),r=br("component.behaviours",lr(n),t.behaviours).fold((function(e){throw new Error(wr(e)+"\nComplete spec:\n"+JSON.stringify(t,null,2))}),b);return{list:e,data:nn(r,(function(t){var e=t.map((function(t){return{config:t.config,state:t.state.init(t.config)}}));return v(e)}))}}(t,e)},Cm=function(t){var e=function(t){var e=un(t,"behaviours").getOr({});return G(Ze(e),(function(t){var n=e[t];return d(n)?[n.me]:[]}))}(t);return wm(t,e)},Sm=function(e,n,r){var o,i,a,u=t(t({},(o=e).dom),{uid:o.uid,domChildren:I(o.components,(function(t){return t.element}))}),c=function(t){return t.domModification.fold((function(){return lo({})}),lo)}(e),s={"alloy.base.modification":c},l=n.length>0?function(e,n,r,o){var i=t({},n);L(r,(function(t){i[t.name()]=t.exhibit(e,o)}));var a=cm(i,(function(t,e){return{name:t,modification:e}})),u=function(e){return P(e,(function(e,n){return t(t({},n.modification),e)}),{})},c=P(a.classes,(function(t,e){return e.modification.concat(t)}),[]),s=u(a.attributes),l=u(a.styles);return lo({classes:c,attributes:s,styles:l})}(r,s,n,u):c;return a=l,t(t({},i=u),{attributes:t(t({},i.attributes),a.attributes),styles:t(t({},i.styles),a.styles),classes:i.classes.concat(a.classes)})},km=function(t,e,n){var r={"alloy.base.behaviour":bm(t)};return function(t,e,n,r){var o=dm(t,n,r);return hm(o,e)}(n,t.eventOrder,e,r).getOrDie()},Om=function(t){var e=function(){return l},n=ko(um),r=yr(function(t){return br("custom.definition",vm,t)}(t)),o=Cm(t),i=function(t){return t.list}(o),a=function(t){return t.data}(o),u=function(t){var e=de.fromTag(t.tag);dn(e,t.attributes),ym(e,t.classes),Ri(e,t.styles),t.innerHtml.each((function(t){return Vo(e,t)}));var n=t.domChildren;return Be(e,n),t.value.each((function(t){kd(e,t)})),t.uid,fs(e,t.uid),e}(Sm(r,i,a)),c=km(r,i,a),s=ko(r.components),l={uid:t.uid,getSystem:n.get,config:function(e){var n=a;return(m(n[e.name()])?n[e.name()]:function(){throw new Error("Could not find "+e.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return m(a[t.name()])},spec:t,readState:function(t){return a[t]().map((function(t){return t.state.readState()})).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(am(e))},element:u,syncComponents:function(){var t=Te(u),e=G(t,(function(t){return n.get().getByDom(t).fold((function(){return[]}),Y)}));s.set(e)},components:s.get,events:c};return l},Em=function(n){var r=im(n),o=r.events,i=e(r,["events"]),a=function(t){var e=un(t,"components").getOr([]);return I(e,Dm)}(i),u=t(t({},i),{events:t(t({},om),o),components:a});return Mn.value(Om(u))},_m=function(t){var e=de.fromText(t);return Tm({element:e})},Tm=function(t){var e=xr("external.component",sr([Or("element"),Tr("uid")]),t),n=ko(am()),r=e.uid.getOrThunk((function(){return ms("external")}));fs(e.element,r);var o={uid:r,getSystem:n.get,config:z.none,hasConfigured:E,connect:function(t){n.set(t)},disconnect:function(){n.set(am((function(){return o})))},getApis:function(){return{}},element:e.element,spec:t,readState:v("No state"),syncComponents:h,components:v([]),events:{}};return is(o)},Mm=ms,Dm=function(e){return function(t){return un(t,os)}(e).getOrThunk((function(){var n=function(t){return cn(t,"uid")}(e)?e:t({uid:Mm("")},e);return Em(n).getOrDie()}))},zm=is,Am="alloy.item-hover",Nm="alloy.item-focus",Bm=function(t){(To(t.element).isNone()||zi.isFocused(t))&&(zi.isFocused(t)||zi.focus(t),ue(t,Am,{item:t}))},Rm=function(t){ue(t,Nm,{item:t})},Hm=v(Am),Vm=v(Nm),Im=[Or("data"),Or("components"),Or("dom"),Ar("hasSubmenu",!1),Tr("toggling"),bc("itemBehaviours",[xi,zi,gc,nl]),Ar("ignoreFocus",!1),Ar("domModification",{}),oi("builder",(function(e){return{dom:e.dom,domModification:t(t({},e.domModification),{attributes:t(t(t({role:e.toggling.isSome()?"menuitemcheckbox":"menuitem"},e.domModification.attributes),{"aria-haspopup":e.hasSubmenu}),e.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:yc(e.itemBehaviours,[e.toggling.fold(xi.revoke,(function(e){return xi.config(t({aria:{mode:"checked"}},e))})),zi.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:function(t){Rm(t)}}),gc.config({mode:"execution"}),nl.config({store:{mode:"memory",initialValue:e.data}}),vd("item-type-events",n(n([],Ei(),!0),[Jr(Ht(),Bm),Jr(Jt(),zi.focus)],!1))]),components:e.components,eventOrder:e.eventOrder}})),Ar("eventOrder",{})],Lm=[Or("dom"),Or("components"),oi("builder",(function(t){return{dom:t.dom,components:t.components,events:Kr([no(Jt())])}}))],Fm=v("item-widget"),Pm=v([qc({name:"widget",overrides:function(t){return{behaviours:bo([nl.config({store:{mode:"manual",getValue:function(e){return t.data},setValue:h}})])}}})]),Um=[Or("uid"),Or("data"),Or("components"),Or("dom"),Ar("autofocus",!1),Ar("ignoreFocus",!1),bc("widgetBehaviours",[nl,zi,gc]),Ar("domModification",{}),rs(Pm()),oi("builder",(function(t){var e=Qc(Fm(),t,Pm()),n=Zc(Fm(),t,e.internals()),r=function(e){return ts(e,t,"widget").map((function(t){return gc.focusIn(t),t}))},o=function(e,n){return Pa(n.event.target)?z.none():t.autofocus?(n.setSource(e.element),z.none()):z.none()};return{dom:t.dom,components:n,domModification:t.domModification,events:Kr([uo((function(t,e){r(t).each((function(t){e.stop()}))})),Jr(Ht(),Bm),Jr(Jt(),(function(e,n){t.autofocus?r(e):zi.focus(e)}))]),behaviours:yc(t.widgetBehaviours,[nl.config({store:{mode:"memory",initialValue:t.data}}),zi.config({ignore:t.ignoreFocus,onFocus:function(t){Rm(t)}}),gc.config({mode:"special",focusIn:t.autofocus?function(t){r(t)}:Co(),onLeft:o,onRight:o,onEscape:function(e,n){return zi.isFocused(e)||t.autofocus?t.autofocus?(n.setSource(e.element),z.none()):z.none():(zi.focus(e),z.some(!0))}})])}}))],jm=Cr("type",{widget:Um,item:Im,separator:Lm}),Wm=v([$c({factory:{sketch:function(t){var e=xr("menu.spec item",jm,t);return e.builder(e)}},name:"items",unit:"item",defaults:function(e,n){return cn(n,"uid")?n:t(t({},n),{uid:ms("item")})},overrides:function(t,e){return{type:e.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),qm=v([Or("value"),Or("items"),Or("dom"),Or("components"),Ar("eventOrder",{}),hc("menuBehaviours",[Na,nl,xd,gc]),Nr("movement",{mode:"menu",moveOnTab:!0},Cr("mode",{grid:[ai(),oi("config",(function(t,e){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:t.focusManager}}))],matrix:[oi("config",(function(t,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}})),Or("rowSelector")],menu:[Ar("moveOnTab",!0),oi("config",(function(t,e){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:e.moveOnTab,focusManager:t.focusManager}}))]})),Er("markers",Jo()),Ar("fakeFocus",!1),Ar("focusManager",Ra()),ti("onHighlight")]),Gm=v("alloy.menu-focus"),$m=xs({name:"Menu",configFields:qm(),partFields:Wm(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:vc(t.menuBehaviours,[Na.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),nl.config({store:{mode:"memory",initialValue:t.value}}),xd.config({find:z.some}),gc.config(t.movement.config(t,t.movement))]),events:Kr([Jr(Vm(),(function(t,e){var n=e.event;t.getSystem().getByDom(n.target).each((function(n){Na.highlight(t,n),e.stop(),ue(t,Gm(),{menu:t,item:n})}))})),Jr(Hm(),(function(t,e){var n=e.event.item;Na.highlight(t,n)}))]),components:e,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Xm=function(t,e){var n=Fe(e),r=_o(n).bind((function(t){var n,r,o=function(e){return ve(t,e)};return o(e)?z.some(e):(n=o,(r=function(t){for(var e=0;e<t.childNodes.length;e++){var o=de.fromDom(t.childNodes[e]);if(n(o))return z.some(o);var i=r(t.childNodes[e]);if(i.isSome())return i}return z.none()})(e.dom))})),o=t(e);return r.each((function(t){_o(n).filter((function(e){return ve(e,t)})).fold((function(){Oo(t)}),h)})),o},Km=function(t,e,n,r){var o=t.getSystem().build(r);Ye(t,o,n)},Ym=function(t,e,n,r){var o=Jm(t),i=j(o,(function(t){return ve(r.element,t.element)}));i.each(Je)},Jm=function(t,e){return t.components()},Qm=function(t,e,n,r,o){var i=Jm(t);return z.from(i[r]).map((function(e){return Ym(t,0,0,e),o.each((function(e){Km(t,0,(function(t,e){!function(t,e,n){Me(t,n).fold((function(){Ne(t,e)}),(function(t){De(t,e)}))}(t,e,r)}),e)})),e}))},Zm=Object.freeze({__proto__:null,append:function(t,e,n,r){Km(t,0,Ne,r)},prepend:function(t,e,n,r){Km(t,0,Ae,r)},remove:Ym,replaceAt:Qm,replaceBy:function(t,e,n,r,o){var i=Jm(t);return W(i,r).bind((function(e){return Qm(t,0,0,e,o)}))},set:function(t,e,n,r){Xm((function(){var e=I(r,t.getSystem().build);Ke(t,e)}),t.element)},contents:Jm}),tg=xo({fields:[],name:"replacing",apis:Zm}),eg=function(t,e,n,r){return un(n,r).bind((function(r){return un(t,r).bind((function(r){var o=eg(t,e,n,r);return z.some([r].concat(o))}))})).getOr([])},ng=function(t,e){var n={};en(t,(function(t,e){L(t,(function(t){n[t]=e}))}));var r=e,o=rn(e,(function(t,e){return{k:t,v:e}})),i=nn(o,(function(t,e){return[e].concat(eg(n,r,o,e))}));return nn(n,(function(t){return un(i,t).getOr([t])}))},rg=function(t){return"prepared"===t.type?z.some(t.menu):z.none()},og={init:function(){var e=ko({}),n=ko({}),r=ko({}),o=Ka(),i=ko({}),a=function(t){return function(t,e){for(var n=Ze(t),r=0,o=n.length;r<o;r++){var i=n[r],a=t[i];if(e(a,i,t))return z.some(a)}return z.none()}(e.get(),(function(e,n){return e===t}))},u=function(t){return c(t).bind(rg)},c=function(t){return un(n.get(),t)},s=function(t){return un(e.get(),t)};return{setMenuBuilt:function(e,r){var o;n.set(t(t({},n.get()),((o={})[e]={type:"prepared",menu:r},o)))},setContents:function(t,a,u,c){o.set(t),e.set(u),n.set(a),i.set(c);var s=ng(c,u);r.set(s)},expand:function(t){return un(e.get(),t).map((function(e){var n=un(r.get(),t).getOr([]);return[e].concat(n)}))},refresh:function(t){return un(r.get(),t)},collapse:function(t){return un(r.get(),t).bind((function(t){return t.length>1?z.some(t.slice(1)):z.none()}))},lookupMenu:c,lookupItem:s,otherMenus:function(t){var e=i.get();return K(Ze(e),t)},getPrimary:function(){return o.get().bind(u)},getMenus:function(){return n.get()},clear:function(){e.set({}),n.set({}),r.set({}),o.clear()},isClear:function(){return o.get().isNone()},getTriggeringPath:function(t,e){var n=F(s(t).toArray(),(function(t){return u(t).isSome()}));return un(r.get(),t).bind((function(t){var r=X(n.concat(t)),i=G(r,(function(t,n){return function(t,e,n){return u(t).bind((function(r){return a(t).bind((function(t){return e(t).map((function(t){return{triggeredMenu:r,triggeringItem:t,triggeringPath:n}}))}))}))}(t,e,r.slice(0,n+1)).fold((function(){return Pr(o.get(),t)?[]:[z.none()]}),(function(t){return[z.some(t)]}))}));return function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];if(!r.isSome())return z.none();e.push(r.getOrDie())}return z.some(e)}(i)}))}}},extractPreparedMenu:rg},ig=v("collapse-item"),ag=ys({name:"TieredMenu",configFields:[ri("onExecute"),ri("onEscape"),ni("onOpenMenu"),ni("onOpenSubmenu"),ti("onRepositionMenu"),ti("onCollapseMenu"),Ar("highlightImmediately",!0),_r("data",[Or("primary"),Or("menus"),Or("expansions")]),Ar("fakeFocus",!1),ti("onHighlight"),ti("onHover"),_r("markers",[Or("backgroundMenu")].concat(Xo()).concat(Ko())),Or("dom"),Ar("navigateOnHover",!0),Ar("stayInDom",!1),hc("tmenuBehaviours",[gc,Na,xd,tg]),Ar("eventOrder",{})],apis:{collapseMenu:function(t,e){t.collapseMenu(e)},highlightPrimary:function(t,e){t.highlightPrimary(e)},repositionMenus:function(t,e){t.repositionMenus(e)}},factory:function(e,n){var r,o=Ka(),i=og.init(),a=function(n){var r=function(n,r,o){return nn(o,(function(o,i){var a=function(){return $m.sketch(t(t({},o),{value:i,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:e.onHighlight,focusManager:e.fakeFocus?Ha():Ra()}))};return i===r?{type:"prepared",menu:n.getSystem().build(a())}:{type:"notbuilt",nbMenu:a}}))}(n,e.data.primary,e.data.menus),o=c();return i.setContents(e.data.primary,r,e.data.expansions,o),i.getPrimary()},u=function(t){return nl.getValue(t).value},c=function(t){return nn(e.data.menus,(function(t,e){return G(t.items,(function(t){return"separator"===t.type?[]:[t.data.value]}))}))},s=function(t,e){Na.highlight(t,e),Na.getHighlighted(e).orThunk((function(){return Na.getFirst(e)})).each((function(e){se(t,e.element,Jt())}))},l=function(t,e){return Ur(I(e,(function(e){return t.lookupMenu(e).bind((function(t){return"prepared"===t.type?z.some(t.menu):z.none()}))})))},f=function(t,n,r){var o=l(n,n.otherMenus(r));L(o,(function(n){xm(n.element,[e.markers.backgroundMenu]),e.stayInDom||tg.remove(t,n)}))},d=function(t,n){var r=function(t){return o.get().getOrThunk((function(){var n={},r=Xi(t.element,"."+e.markers.item),i=F(r,(function(t){return"true"===mn(t,"aria-haspopup")}));return L(i,(function(e){t.getSystem().getByDom(e).each((function(t){var e=u(t);n[e]=t}))})),o.set(n),n}))}(t);en(r,(function(t,e){var r=H(n,e);fn(t.element,"aria-expanded",r)}))},m=function(t,n,r){return z.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return z.none();var i=o.menu,a=l(n,r.slice(1));return L(a,(function(t){wn(t.element,e.markers.backgroundMenu)})),je(i.element)||tg.append(t,zm(i)),xm(i.element,[e.markers.backgroundMenu]),s(t,i),f(t,n,r),z.some(i)}))}))};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(r||(r={}));var g=function(t,n,o){if(void 0===o&&(o=r.HighlightSubmenu),n.hasConfigured(Xd)&&Xd.isDisabled(n))return z.some(n);var a=u(n);return i.expand(a).bind((function(a){return d(t,a),z.from(a[0]).bind((function(u){return i.lookupMenu(u).bind((function(c){var s=function(t,e,n){if("notbuilt"===n.type){var r=t.getSystem().build(n.nbMenu());return i.setMenuBuilt(e,r),r}return n.menu}(t,u,c);return je(s.element)||tg.append(t,zm(s)),e.onOpenSubmenu(t,n,s,X(a)),o===r.HighlightSubmenu?(Na.highlightFirst(s),m(t,i,a)):(Na.dehighlightAll(s),z.some(n))}))}))}))},p=function(t,n){var r=u(n);return i.collapse(r).bind((function(r){return d(t,r),m(t,i,r).map((function(r){return e.onCollapseMenu(t,n,r),r}))}))},v=function(t){return function(n,r){return ea(r.getSource(),"."+e.markers.item).bind((function(e){return n.getSystem().getByDom(e).toOptional().bind((function(e){return t(n,e).map(_)}))}))}},y=Kr([Jr(Gm(),(function(t,e){var n=e.event.item;i.lookupItem(u(n)).each((function(){var n=e.event.menu;Na.highlight(t,n);var r=u(e.event.item);i.refresh(r).each((function(e){return f(t,i,e)}))}))})),uo((function(t,n){var o=n.event.target;t.getSystem().getByDom(o).each((function(n){0===u(n).indexOf("collapse-item")&&p(t,n),g(t,n,r.HighlightSubmenu).fold((function(){e.onExecute(t,n)}),h)}))})),oo((function(t,n){a(t).each((function(n){tg.append(t,zm(n)),e.onOpenMenu(t,n),e.highlightImmediately&&s(t,n)}))}))].concat(e.navigateOnHover?[Jr(Hm(),(function(t,n){var o=n.event.item;!function(t,e){var n=u(e);i.refresh(n).bind((function(e){return d(t,e),m(t,i,e)}))}(t,o),g(t,o,r.HighlightParent),e.onHover(t,o)}))]:[])),x=function(t){return Na.getHighlighted(t).bind(Na.getHighlighted)},w={collapseMenu:function(t){x(t).each((function(e){p(t,e)}))},highlightPrimary:function(t){i.getPrimary().each((function(e){s(t,e)}))},repositionMenus:function(t){var n=i.getPrimary().bind((function(e){return x(t).bind((function(t){var e,n=u(t),r=(e=i.getMenus(),an(e,b)),o=Ur(I(r,og.extractPreparedMenu));return i.getTriggeringPath(n,(function(t){return function(t,e,n){return Q(e,(function(t){if(!t.getSystem().isConnected())return z.none();var e=Na.getCandidates(t);return j(e,(function(t){return u(t)===n}))}))}(0,o,t)}))})).map((function(t){return{primary:e,triggeringPath:t}}))}));n.fold((function(){(function(t){return z.from(t.components()[0]).filter((function(t){return"menu"===mn(t.element,"role")}))})(t).each((function(n){e.onRepositionMenu(t,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;e.onRepositionMenu(t,r,o)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:vc(e.tmenuBehaviours,[gc.config({mode:"special",onRight:v((function(t,e){return Pa(e.element)?z.none():g(t,e,r.HighlightSubmenu)})),onLeft:v((function(t,e){return Pa(e.element)?z.none():p(t,e)})),onEscape:v((function(t,n){return p(t,n).orThunk((function(){return e.onEscape(t,n).map((function(){return t}))}))})),focusIn:function(t,e){i.getPrimary().each((function(e){se(t,e.element,Jt())}))}}),Na.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),xd.config({find:function(t){return Na.getHighlighted(t)}}),tg.config({})]),eventOrder:e.eventOrder,apis:w,events:y}},extraApis:{tieredData:function(t,e,n){return{primary:t,menus:e,expansions:n}},singleData:function(t,e){return{primary:t,menus:Ir(t,e),expansions:{}}},collapseItem:function(t){return{value:Dc(ig()),meta:{text:t}}}}}),ug=function(t,e,n,r){return un(e.routes,r.start).bind((function(t){return un(t,r.destination)}))},cg=function(t,e,n,r){return ug(0,e,0,r).bind((function(t){return t.transition.map((function(e){return{transition:e,route:t}}))}))},sg=function(t,e,n){(function(t,e,n){return lg(t,e).bind((function(r){return cg(t,e,n,r)}))})(t,e,n).each((function(n){var r=n.transition;Sn(t.element,r.transitionClass),pn(t.element,e.destinationAttr)}))},lg=function(t,e,n){var r=t.element;return gn(r,e.destinationAttr).map((function(n){return{start:mn(t.element,e.stateAttr),destination:n}}))},fg=function(t,e,n,r){sg(t,e,n),hn(t.element,e.stateAttr)&&mn(t.element,e.stateAttr)!==r&&e.onFinish(t,r),fn(t.element,e.stateAttr,r)},dg=Object.freeze({__proto__:null,findRoute:ug,disableTransition:sg,getCurrentRoute:lg,jumpTo:fg,progressTo:function(t,e,n,r){!function(t,e,n,r){hn(t.element,e.destinationAttr)&&(gn(t.element,e.destinationAttr).each((function(n){fn(t.element,e.stateAttr,n)})),pn(t.element,e.destinationAttr))}(t,e);var o=function(t,e,n,r){return{start:mn(t.element,e.stateAttr),destination:r}}(t,e,0,r);cg(t,e,n,o).fold((function(){fg(t,e,n,r)}),(function(o){sg(t,e,n);var i=o.transition;wn(t.element,i.transitionClass),fn(t.element,e.destinationAttr,r)}))},getState:function(t,e,n){return gn(t.element,e.stateAttr)}}),mg=Object.freeze({__proto__:null,events:function(t,e){return Kr([Jr(Ut(),(function(n,r){var o=r.event.raw;lg(n,t).each((function(r){ug(0,t,0,r).each((function(i){i.transition.each((function(i){o.propertyName===i.property&&(fg(n,t,e,r.destination),t.onTransition(n,r))}))}))}))})),oo((function(n,r){fg(n,t,e,t.initialState)}))])}}),gg=[Ar("destinationAttr","data-transitioning-destination"),Ar("stateAttr","data-transitioning-state"),Or("initialState"),ti("onTransition"),ti("onFinish"),Er("routes",vr(Mn.value,vr(Mn.value,sr([zr("transition",[Or("property"),Or("transitionClass")])]))))],hg=xo({fields:gg,name:"transitioning",active:mg,apis:dg,extra:{createRoutes:function(t){var e={};return en(t,(function(t,n){var r=n.split("<->");e[r[0]]=Ir(r[1],t),e[r[1]]=Ir(r[0],t)})),e},createBistate:function(t,e,n){return Lr([{key:t,value:Ir(e,n)},{key:e,value:Ir(t,n)}])},createTristate:function(t,e,n,r){return Lr([{key:t,value:Lr([{key:e,value:r},{key:n,value:r}])},{key:e,value:Lr([{key:t,value:r},{key:n,value:r}])},{key:n,value:Lr([{key:t,value:r},{key:e,value:r}])}])}}}),pg=Oi("scrollable"),vg=function(t){wn(t,pg)},bg=function(t){Sn(t,pg)},yg=pg,xg=function(t){return un(t,"format").getOr(t.title)},wg=function(t,e,n,r,o){return{data:{value:t,text:e},type:"item",dom:{tag:"div",classes:o?[Oi("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Oi("format-matches"),selected:n},itemBehaviours:bo(o?[]:[wi(t,(function(t,e){(e?xi.on:xi.off)(t)}))]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},Cg=function(t,e,n,r){return{value:t,dom:{tag:"div"},components:[ws.sketch({dom:{tag:"div",classes:[Oi("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Oi("styles-collapse-icon")]}},_m(t)]:[_m(t)],action:function(t){if(r){var e=n().get(t);ag.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Oi("styles-menu-items-container")]},components:[$m.parts.items({})],behaviours:bo([vd("adhoc-scrollable-menu",[oo((function(t,e){Bi(t.element,"overflow-y","auto"),Bi(t.element,"-webkit-overflow-scrolling","touch"),vg(t.element)})),io((function(t){Li(t.element,"overflow-y"),Li(t.element,"-webkit-overflow-scrolling"),bg(t.element)}))])])}],items:e,menuBehaviours:bo([hg.config({initialState:"after",routes:hg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Sg=function(t){var e,n,r,o,i,a=(e=t.formats,n=function(){return u},r=Cg("Styles",[].concat(I(e.items,(function(t){return wg(xg(t),t.title,t.isSelected(),t.getPreview(),sn(e.expansions,xg(t)))}))),n,!1),o=nn(e.menus,(function(t,r){var o=I(t,(function(t){return wg(xg(t),t.title,void 0!==t.isSelected&&t.isSelected(),void 0!==t.getPreview?t.getPreview():"",sn(e.expansions,xg(t)))}));return Cg(r,o,n,!0)})),i=Xn(o,Ir("styles",r)),{tmenu:ag.tieredData("styles",i,e.expansions)}),u=Qf(ag.sketch({dom:{tag:"div",classes:[Oi("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(e,n){var r=nl.getValue(n);return t.handle(n,r.value),z.none()},onEscape:function(){return z.none()},onOpenMenu:function(t,e){var n=il(t.element);ol(e.element,n),hg.jumpTo(e,"current")},onOpenSubmenu:function(t,e,n){var r=il(t.element),o=Zi(e.element,'[role="menu"]').getOrDie("hacky"),i=t.getSystem().getByDom(o).getOrDie();ol(n.element,r),hg.progressTo(i,"before"),hg.jumpTo(n,"after"),hg.progressTo(n,"current")},onCollapseMenu:function(t,e,n){var r=Zi(e.element,'[role="menu"]').getOrDie("hacky"),o=t.getSystem().getByDom(r).getOrDie();hg.progressTo(o,"after"),hg.progressTo(n,"current")},navigateOnHover:!1,highlightImmediately:!0,data:a.tmenu,markers:{backgroundMenu:Oi("styles-background-menu"),menu:Oi("styles-menu"),selectedMenu:Oi("styles-selected-menu"),item:Oi("styles-item"),selectedItem:Oi("styles-selected-item")}}));return u.asSpec()},kg=function(t){return sn(t,"items")?function(t){var e=Xn(Vr(t,["items"]),{menu:!0}),n=Og(t.items);return{item:e,menus:Xn(n.menus,Ir(t.title,n.items)),expansions:Xn(n.expansions,Ir(t.title,t.title))}}(t):{item:t,menus:{},expansions:{}}},Og=function(t){return P(t,(function(t,e){var n=kg(e);return{menus:Xn(t.menus,n.menus),items:[n.item].concat(t.items),expansions:Xn(t.expansions,n.expansions)}}),{menus:{},expansions:{},items:[]})},Eg=function(t){var e=function(e){return function(){return t.formatter.match(e)}},n=function(e){return function(){return t.formatter.getCssText(e)}},r=function(o){return I(o,(function(o){if(sn(o,"items")){var i=r(o.items);return Xn(function(t){return Xn(t,{isSelected:E,getPreview:v("")})}(o),{items:i})}return sn(o,"format")?function(t){return Xn(t,{isSelected:e(t.format),getPreview:n(t.format)})}(o):function(r){var o=Dc(r.title),i=Xn(r,{format:o,isSelected:e(o),getPreview:n(o)});return t.formatter.register(o,i),i}(o)}))};return r(function(t){return t.getParam("style_formats",zo,"array")}(t))},_g=function(t,e,n){var r=function(t,e){var n=function(e){return G(e,(function(e){return void 0!==e.items?n(e.items).length>0?[e]:[]:!sn(e,"format")||t.formatter.canApply(e.format)?[e]:[]}))},r=n(e);return Og(r)}(t,e);return Sg({formats:r,handle:function(e,r){t.undoManager.transact((function(){xi.isOn(e)?t.formatter.remove(r):t.formatter.apply(r)})),n()}})},Tg=function(t){var e=t.replace(/\|/g," ").trim();return e.length>0?e.split(/\s+/):[]},Mg=function(t){return G(t,(function(t){return c(t)?Mg(t):Tg(t)}))},Dg=function(t){var e=function(t){return t.getParam("toolbar",Ao,"array")}(t);return c(e)?Mg(e):Tg(e)},zg=function(t,e){var n=function(t){return function(){return function(t,e){return Ds(e,(function(){t.execCommand(e)}),{},t)}(e,t)}},r=function(t){return function(){return function(t,e){var n=_s(e);return Ds(e,(function(){t.execCommand(e)}),n,t)}(e,t)}},o=function(t,n,r){return function(){return Ts(e,t,n,r)}},i=n("undo"),a=n("redo"),u=r("bold"),c=r("italic"),s=r("underline"),l=n("removeformat"),f=o("unlink","link",(function(){e.execCommand("unlink",null,!1)})),d=o("unordered-list","ul",(function(){e.execCommand("InsertUnorderedList",null,!1)})),m=o("ordered-list","ol",(function(){e.execCommand("InsertOrderedList",null,!1)})),g=Eg(e),h=function(){return _g(e,g,(function(){e.fire("scrollIntoView")}))},p=function(t,n){return{isSupported:function(){var n=e.ui.registry.getAll().buttons;return t.forall((function(t){return sn(n,t)}))},sketch:n}};return{undo:p(z.none(),i),redo:p(z.none(),a),bold:p(z.none(),u),italic:p(z.none(),c),underline:p(z.none(),s),removeformat:p(z.none(),l),link:p(z.none(),(function(){return nm(t,e)})),unlink:p(z.none(),f),image:p(z.none(),(function(){return ud(e)})),bullist:p(z.some("bullist"),d),numlist:p(z.some("numlist"),m),fontsizeselect:p(z.none(),(function(){return function(t,e){var n={onChange:function(t){qf(e,t)},getInitialValue:function(){return Wf(e)}};return If(t,"font-size",(function(){return Jf(n)}),e)}(t,e)})),forecolor:p(z.none(),(function(){return Ff(t,e)})),styleselect:p(z.none(),(function(){return Ds("style-formats",(function(n){e.fire("toReading"),t.dropup.appear(h,xi.on,n)}),bo([xi.config({toggleClass:Oi("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),ci.config({channels:Lr([Si(Bo,xi.off),Si(Ro,xi.off)])})]),e)}))}},Ag=function(t){var e=de.fromDom(function(t){if(Le()&&d(t.target)){var e=de.fromDom(t.target);if(we(e)&&Ue(e)&&t.composed&&t.composedPath){var n=t.composedPath();if(n)return J(n)}}return z.from(t.target)}(t).getOr(t.target)),n=function(){return t.stopPropagation()},r=function(){return t.preventDefault()},o=p(r,n);return function(t,e,n,r,o,i,a){return{target:t,x:e,y:n,stop:r,prevent:o,kill:i,raw:a}}(e,t.clientX,t.clientY,n,r,o,t)},Ng=function(t,e,n,r,o){var i=function(t,e){return function(n){t(n)&&e(Ag(n))}}(n,r);return t.dom.addEventListener(e,i,o),{unbind:x(Bg,t,e,i,o)}},Bg=function(t,e,n,r){t.dom.removeEventListener(e,n,r)},Rg=_,Hg=function(t,e,n){return function(t,e,n,r){return Ng(t,e,n,r,!1)}(t,e,Rg,n)},Vg=function(t,e,n){return function(t,e,n,r){return Ng(t,e,n,r,!0)}(t,e,Rg,n)},Ig=tinymce.util.Tools.resolve("tinymce.util.Delay"),Lg=function(t){var e=t.matchMedia("(orientation: portrait)").matches;return{isPortrait:v(e)}},Fg=function(t){var e=Tt().os.isiOS(),n=Lg(t).isPortrait();return e&&!n?t.screen.height:t.screen.width},Pg=function(t,e){var n=de.fromDom(t),r=null,o=Hg(n,"orientationchange",(function(){Ig.clearInterval(r);var n=Lg(t);e.onChange(n),i((function(){e.onReady(n)}))})),i=function(e){Ig.clearInterval(r);var n=t.innerHeight,o=0;r=Ig.setInterval((function(){n!==t.innerHeight?(Ig.clearInterval(r),e(z.some(t.innerHeight))):o>20&&(Ig.clearInterval(r),e(z.none())),o++}),50)};return{onAdjustment:i,destroy:function(){o.unbind()}}},Ug=function(t,e,n){var r,o=t.document.createRange();return r=o,e.fold((function(t){r.setStartBefore(t.dom)}),(function(t,e){r.setStart(t.dom,e)}),(function(t){r.setStartAfter(t.dom)})),function(t,e){e.fold((function(e){t.setEndBefore(e.dom)}),(function(e,n){t.setEnd(e.dom,n)}),(function(e){t.setEndAfter(e.dom)}))}(o,n),o},jg=function(t,e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},Wg=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},qg=Rr([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Gg=function(t,e,n){return e(de.fromDom(n.startContainer),n.startOffset,de.fromDom(n.endContainer),n.endOffset)},$g=function(t,e){var n=function(t,e){return e.match({domRange:function(t){return{ltr:v(t),rtl:z.none}},relative:function(e,n){return{ltr:A((function(){return Ug(t,e,n)})),rtl:A((function(){return z.some(Ug(t,n,e))}))}},exact:function(e,n,r,o){return{ltr:A((function(){return jg(t,e,n,r,o)})),rtl:A((function(){return z.some(jg(t,r,o,e,n))}))}}})}(t,e);return function(t,e){var n=e.ltr();return n.collapsed?e.rtl().filter((function(t){return!1===t.collapsed})).map((function(t){return qg.rtl(de.fromDom(t.endContainer),t.endOffset,de.fromDom(t.startContainer),t.startOffset)})).getOrThunk((function(){return Gg(0,qg.ltr,n)})):Gg(0,qg.ltr,n)}(0,n)};qg.ltr,qg.rtl;var Xg=function(t,e,n,r){return{start:t,soffset:e,finish:n,foffset:r}},Kg=function(t,e){var n=function(e){return t(e)?z.from(e.dom.nodeValue):z.none()};return{get:function(r){if(!t(r))throw new Error("Can only get "+e+" value of a "+e+" node");return n(r).getOr("")},getOption:n,set:function(n,r){if(!t(n))throw new Error("Can only set raw "+e+" value of a "+e+" node");n.dom.nodeValue=r}}}(Ce,"text"),Yg=function(t){return"img"===ye(t)?1:function(t){return Kg.getOption(t)}(t).fold((function(){return Te(t).length}),(function(t){return t.length}))},Jg=Rr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Qg={before:Jg.before,on:Jg.on,after:Jg.after,cata:function(t,e,n,r){return t.fold(e,n,r)},getStart:function(t){return t.fold(b,b,b)}},Zg=Rr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),th={domRange:Zg.domRange,relative:Zg.relative,exact:Zg.exact,exactFromRange:function(t){return Zg.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var e=function(t){return t.match({domRange:function(t){return de.fromDom(t.startContainer)},relative:function(t,e){return Qg.getStart(t)},exact:function(t,e,n,r){return t}})}(t);return function(t){return de.fromDom(Ee(t).dom.defaultView)}(e)},range:Xg},eh=function(t,e){var n=ye(t);return"input"===n?Qg.after(t):H(["br","img"],n)?0===e?Qg.before(t):Qg.after(t):Qg.on(t,e)},nh=function(t,e,n,r){var o=function(t,e,n,r){var o=Oe(t).dom.createRange();return o.setStart(t.dom,e),o.setEnd(n.dom,r),o}(t,e,n,r),i=ve(t,n)&&e===r;return o.collapsed&&!i},rh=function(t){return z.from(t.getSelection())},oh=function(t,e,n,r,o){!function(t,e){rh(t).each((function(t){t.removeAllRanges(),t.addRange(e)}))}(t,jg(t,e,n,r,o))},ih=function(t,e,n,r,o){var i=function(t,e,n,r){var o=eh(t,e),i=eh(n,r);return th.relative(o,i)}(e,n,r,o);!function(t,e){$g(t,e).match({ltr:function(e,n,r,o){oh(t,e,n,r,o)},rtl:function(e,n,r,o){rh(t).each((function(i){if(i.setBaseAndExtent)i.setBaseAndExtent(e.dom,n,r.dom,o);else if(i.extend)try{!function(t,e,n,r,o,i){e.collapse(n.dom,r),e.extend(o.dom,i)}(0,i,e,n,r,o)}catch(i){oh(t,r,o,e,n)}else oh(t,r,o,e,n)}))}})}(t,i)},ah=function(t){if(t.rangeCount>0){var e=t.getRangeAt(0),n=t.getRangeAt(t.rangeCount-1);return z.some(Xg(de.fromDom(e.startContainer),e.startOffset,de.fromDom(n.endContainer),n.endOffset))}return z.none()},uh=function(t){if(null===t.anchorNode||null===t.focusNode)return ah(t);var e=de.fromDom(t.anchorNode),n=de.fromDom(t.focusNode);return nh(e,t.anchorOffset,n,t.focusOffset)?z.some(Xg(e,t.anchorOffset,n,t.focusOffset)):ah(t)},ch=function(t){return rh(t).filter((function(t){return t.rangeCount>0})).bind(uh)},sh=function(t,e){var n=function(t,e){return $g(t,e).match({ltr:function(e,n,r,o){var i=t.document.createRange();return i.setStart(e.dom,n),i.setEnd(r.dom,o),i},rtl:function(e,n,r,o){var i=t.document.createRange();return i.setStart(r.dom,o),i.setEnd(e.dom,n),i}})}(t,e);return function(t){var e=t.getClientRects(),n=e.length>0?e[0]:t.getBoundingClientRect();return n.width>0||n.height>0?z.some(n).map(Wg):z.none()}(n)},lh=function(t){return z.from(t.dom.contentWindow)},fh=function(t){return lh(t).bind(ch)},dh=function(t){return t.getFrame()},mh=function(t,e,n,r){return t[n].getOrThunk((function(){return function(t){return Hg(e,r,t)}}))},gh=function(t){var e=dh(t);return function(t){return z.some(de.fromDom(t.dom.contentWindow.document.body))}(e).bind((function(n){return function(t){return z.some(de.fromDom(t.dom.contentWindow.document))}(e).bind((function(r){return lh(e).map((function(o){var i=de.fromDom(r.dom.documentElement),a=t.getCursorBox.getOrThunk((function(){return function(){return function(t){return ch(t).map((function(t){return th.exact(t.start,t.soffset,t.finish,t.foffset)}))}(o).bind((function(t){return sh(o,t).orThunk((function(){return function(t){return ch(t).filter((function(t){return ve(t.start,t.finish)&&t.soffset===t.foffset})).bind((function(t){var e=t.start.dom.getBoundingClientRect();return e.width>0||e.height>0?z.some(e):z.none()}))}(o)}))}))}})),u=t.setSelection.getOrThunk((function(){return function(t,e,n,r){ih(o,t,e,n,r)}})),c=t.clearSelection.getOrThunk((function(){return function(){!function(t){rh(t).each((function(t){return t.removeAllRanges()}))}(o)}}));return{body:n,doc:r,win:o,html:i,getSelection:x(fh,e),setSelection:u,clearSelection:c,frame:e,onKeyup:mh(t,r,"onKeyup","keyup"),onNodeChanged:mh(t,r,"onNodeChanged","SelectionChange"),onDomChanged:t.onDomChanged,onScrollToCursor:t.onScrollToCursor,onScrollToElement:t.onScrollToElement,onToReading:t.onToReading,onToEditing:t.onToEditing,onToolbarScrollStart:t.onToolbarScrollStart,onTouchContent:t.onTouchContent,onTapContent:t.onTapContent,onTouchToolstrip:t.onTouchToolstrip,getCursorBox:a}}))}))}))},hh=function(t,e){return function(n){return n[t].getOrThunk((function(){var t=dh(n);return function(){return e(t)}}))()}}("getWin",lh),ph=function(){var t=Qi("head").getOrDie(),e=Qi('meta[name="viewport"]').getOrThunk((function(){var e=de.fromTag("meta");return fn(e,"name","viewport"),Ne(t,e),e})),n=mn(e,"content");return{maximize:function(){fn(e,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){null!=n&&n.length>0?fn(e,"content",n):fn(e,"content","user-scalable=yes")}}},vh="data-ephox-mobile-fullscreen-style",bh="position:absolute!important;",yh="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",xh=Tt().os.isAndroid(),wh=function(t,e){var n=function(t){return function(e){var n=mn(e,"style"),r=void 0===n?"no-styles":n.trim();r!==t&&(fn(e,vh,r),fn(e,"style",t))}},r=Gi(t,"*"),o=G(r,(function(t){return $i(t,"*")})),i=function(t){var e=Hi(t,"background-color");return void 0!==e&&""!==e?"background-color:"+e+"!important":"background-color:rgb(255,255,255)!important;"}(e);L(o,n("display:none!important;")),L(r,n(bh+yh+i)),n((!0===xh?"":bh)+yh+i)(t)},Ch=function(){var t=he("["+vh+"]");L(t,(function(t){var e=mn(t,vh);"no-styles"!==e?fn(t,"style",e):pn(t,"style"),pn(t,vh)}))},Sh=function(t){var e=t.raw;return void 0===e.touches||1!==e.touches.length?z.none():z.some(e.touches[0])},kh=function(t){var e,n,r,o=Ka(),i=ko(!1),a=(e=function(e){t.triggerEvent(Zt(),e),i.set(!0)},n=400,r=null,{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];r=setTimeout((function(){e.apply(null,t),r=null}),n)}}),u=Lr([{key:Dt(),value:function(t){return Sh(t).each((function(e){a.cancel();var n={x:e.clientX,y:e.clientY,target:t.target};a.schedule(t),i.set(!1),o.set(n)})),z.none()}},{key:zt(),value:function(t){return a.cancel(),Sh(t).each((function(t){o.on((function(e){(function(t,e){var n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y);return n>5||r>5})(t,e)&&o.clear()}))})),z.none()}},{key:At(),value:function(e){a.cancel();return o.get().filter((function(t){return ve(t.target,e.target)})).map((function(n){return i.get()?(e.prevent(),!1):t.triggerEvent(Qt(),e)}))}}]);return{fireIfReady:function(t,e){return un(u,e).bind((function(e){return e(t)}))}}},Oh=function(t){var e=kh({triggerEvent:function(e,n){t.onTapContent(n)}});return{fireTouchstart:function(t){e.fireIfReady(t,"touchstart")},onTouchend:function(){return Hg(t.body,"touchend",(function(t){e.fireIfReady(t,"touchend")}))},onTouchmove:function(){return Hg(t.body,"touchmove",(function(t){e.fireIfReady(t,"touchmove")}))}}},Eh=Tt().os.version.major>=6,_h=function(t,e,n){var r=Oh(t),o=Oe(e),i=function(t){return!ve(t.start,t.finish)||t.soffset!==t.foffset},a=function(){var r=t.doc.dom.hasFocus()&&t.getSelection().exists(i);n.getByDom(e).each(!0===(r||_o(o).filter((function(t){return"input"===ye(t)})).exists((function(t){return t.dom.selectionStart!==t.dom.selectionEnd})))?xi.on:xi.off)},u=[Hg(t.body,"touchstart",(function(e){t.onTouchContent(),r.fireTouchstart(e)})),r.onTouchmove(),r.onTouchend(),Hg(e,"touchstart",(function(e){t.onTouchToolstrip()})),t.onToReading((function(){Eo(t.body)})),t.onToEditing(h),t.onScrollToCursor((function(e){e.preventDefault(),t.getCursorBox().each((function(e){var n=t.win,r=e.top>n.innerHeight||e.bottom>n.innerHeight?e.bottom-n.innerHeight+50:0;0!==r&&n.scrollTo(n.pageXOffset,n.pageYOffset+r)}))}))].concat(!0===Eh?[]:[Hg(de.fromDom(t.win),"blur",(function(){n.getByDom(e).each(xi.off)})),Hg(o,"select",a),Hg(t.doc,"selectionchange",a)]);return{destroy:function(){L(u,(function(t){t.unbind()}))}}},Th=function(t,e){var n=parseInt(mn(t,e),10);return isNaN(n)?0:n},Mh=function(e){return t(t({},e),{width:2})},Dh=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},zh=function(t){var e=t.getSelection();return void 0!==e&&e.rangeCount>0?function(t){if(t.collapsed){var e=de.fromDom(t.startContainer);return _e(e).bind((function(n){var r=th.exact(e,t.startOffset,n,Yg(n));return sh(t.startContainer.ownerDocument.defaultView,r).map(Mh).map(Y)})).getOr([])}return I(t.getClientRects(),Dh)}(e.getRangeAt(0)):[]},Ah=function(t){t.focus();var e=de.fromDom(t.document.body);(_o().exists((function(t){return H(["input","textarea"],ye(t))}))?function(t){Ig.setTimeout((function(){t()}),0)}:O)((function(){_o().each(Eo),Oo(e)}))},Nh="data-"+Oi("last-outer-height"),Bh=function(t,e){fn(t,Nh,e)},Rh=function(t){return{top:t.top,bottom:t.top+t.height}},Hh=function(t,e){var n=function(t){return Th(t,Nh)}(e),r=t.innerHeight;return n>r?z.some(n-r):z.none()},Vh=function(t,e){var n=de.fromDom(e.document.body),r=Hg(de.fromDom(t),"resize",(function(){Hh(t,n).each((function(t){(function(t){var e=zh(t);return e.length>0?z.some(e[0]).map(Rh):z.none()})(e).each((function(n){var r=function(t,e,n){return e.top>t.innerHeight||e.bottom>t.innerHeight?Math.min(n,e.bottom-t.innerHeight+50):0}(e,n,t);0!==r&&e.scrollTo(e.pageXOffset,e.pageYOffset+r)}))})),Bh(n,t.innerHeight)}));Bh(n,t.innerHeight);return{toEditing:function(){Ah(e)},destroy:function(){r.unbind()}}},Ih=function(t,e){var n=null,r=function(){s(n)||(clearTimeout(n),n=null)};return{cancel:r,throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r(),n=setTimeout((function(){n=null,t.apply(null,o)}),e)}}},Lh=function(t,e){var n,r,o,i=Qf(wd.sketch({dom:Os('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:bo([xi.config({toggleClass:Oi("mask-tap-icon-selected"),toggleOnExecute:!1})])})),a=(n=t,r=200,o=null,{cancel:function(){s(o)||(clearTimeout(o),o=null)},throttle:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];s(o)&&(o=setTimeout((function(){o=null,n.apply(null,t)}),r))}});return wd.sketch({dom:Os('<div class="${prefix}-disabled-mask"></div>'),components:[wd.sketch({dom:Os('<div class="${prefix}-content-container"></div>'),components:[ws.sketch({dom:Os('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(t){a.throttle()},buttonBehaviours:bo([xi.config({toggleClass:Oi("mask-tap-icon-selected")})])})]})]})},Fh=v({unbind:h}),Ph=lr([_r("editor",[Or("getFrame"),Tr("getBody"),Tr("getDoc"),Tr("getWin"),Tr("getSelection"),Tr("setSelection"),Tr("clearSelection"),Tr("cursorSaver"),Tr("onKeyup"),Tr("onNodeChanged"),Tr("getCursorBox"),Or("onDomChanged"),Ar("onTouchContent",h),Ar("onTapContent",h),Ar("onTouchToolstrip",h),Ar("onScrollToCursor",Fh),Ar("onScrollToElement",Fh),Ar("onToEditing",Fh),Ar("onToReading",Fh),Ar("onToolbarScrollStart",b)]),Or("socket"),Or("toolstrip"),Or("dropup"),Or("toolbar"),Or("container"),Or("alloy"),kr("win",(function(t){return Oe(t.socket).dom.defaultView})),kr("body",(function(t){return de.fromDom(t.socket.dom.ownerDocument.body)})),Ar("translate",b),Ar("setReadOnly",h),Ar("readOnlyOnInit",_)]),Uh=function(t){var e=xr("Getting AndroidWebapp schema",Ph,t);Bi(e.toolstrip,"width","100%");var n=Dm(Lh((function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()}),e.translate));e.alloy.add(n);var r={show:function(){e.alloy.add(n)},hide:function(){e.alloy.remove(n)}};Ne(e.container,n.element);var o=function(t,e){var n=ph(),r=Xa(),o=Xa();return{enter:function(){e.hide(),wn(t.container,Oi("fullscreen-maximized")),wn(t.container,Oi("android-maximized")),n.maximize(),wn(t.body,Oi("android-scroll-reload")),r.set(Vh(t.win,hh(t.editor).getOrDie("no"))),gh(t.editor).each((function(e){wh(t.container,e.body),o.set(_h(e,t.toolstrip,t.alloy))}))},exit:function(){n.restore(),e.show(),Sn(t.container,Oi("fullscreen-maximized")),Sn(t.container,Oi("android-maximized")),Ch(),Sn(t.body,Oi("android-scroll-reload")),o.clear(),r.clear()}}}(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:h,enter:o.enter,exit:o.exit,destroy:h}},jh=v([Or("dom"),Ar("shell",!0),hc("toolbarBehaviours",[tg])]),Wh=v([Gc({name:"groups",overrides:function(){return{behaviours:bo([tg.config({})])}}})]),qh=xs({name:"Toolbar",configFields:jh(),partFields:Wh(),factory:function(t,e,n,r){var o=function(e){return t.shell?z.some(e):ts(e,t,"groups")},i=t.shell?{behaviours:[tg.config({})],components:[]}:{behaviours:[],components:e};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:vc(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,e){o(t).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(t){tg.set(t,e)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,e,n){t.setGroups(e,n)}}}),Gh=v([Or("items"),function(t){return _r("markers",I(t,Or))}(["itemSelector"]),hc("tgroupBehaviours",[gc])]),$h=v([$c({name:"items",unit:"item"})]),Xh=xs({name:"ToolbarGroup",configFields:Gh(),partFields:$h(),factory:function(t,e,n,r){return{uid:t.uid,dom:t.dom,components:e,behaviours:vc(t.tgroupBehaviours,[gc.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),Kh="data-"+Oi("horizontal-scroll"),Yh=function(t){return"true"===mn(t,Kh)?function(t){return t.dom.scrollLeft>0||function(t){t.dom.scrollLeft=1;var e=0!==t.dom.scrollLeft;return t.dom.scrollLeft=0,e}(t)}(t):function(t){return t.dom.scrollTop>0||function(t){t.dom.scrollTop=1;var e=0!==t.dom.scrollTop;return t.dom.scrollTop=0,e}(t)}(t)},Jh=function(){var t=function(t){var e=!0===t.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Os('<div aria-label="'+t.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:bo([vd("adhoc-scrollable-toolbar",!0===t.scrollable?[ao((function(t,e){var n;Bi(t.element,"overflow-x","auto"),n=t.element,fn(n,Kh,"true"),vg(t.element)}))]:[])]),components:[wd.sketch({components:[Xh.parts.items({})]})],markers:{itemSelector:"."+Oi("toolbar-group-item")},items:t.items}},e=Dm(qh.sketch({dom:Os('<div class="${prefix}-toolbar"></div>'),components:[qh.parts.groups({})],toolbarBehaviours:bo([xi.config({toggleClass:Oi("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),gc.config({mode:"cyclic"})]),shell:!0})),n=Dm(wd.sketch({dom:{classes:[Oi("toolstrip")]},components:[zm(e)],containerBehaviours:bo([xi.config({toggleClass:Oi("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){qh.setGroups(e,o.get()),xi.off(e)},o=ko([]);return{wrapper:n,toolbar:e,createGroups:function(e){return I(e,p(Xh.sketch,t))},setGroups:function(t){o.set(t),r()},setContextToolbar:function(t){xi.on(e),qh.setGroups(e,t)},restoreToolbar:function(){xi.isOn(e)&&r()},refresh:function(){},focus:function(){gc.focusIn(e)}}},Qh=function(t){return Dm(ws.sketch({dom:Os('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){t.run((function(t){t.setReadOnly(!1)}))}}))},Zh=function(){return Dm(wd.sketch({dom:Os('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:bo([tg.config({})])}))},tp=function(t,e){tg.append(t,zm(e))},ep=function(t,e){tg.remove(t,e)},np=function(t,e,n,r){(!0===n?So.toAlpha:So.toOmega)(r),(n?tp:ep)(t,e)},rp=function(t,e){return e.getAnimationRoot.fold((function(){return t.element}),(function(e){return e(t)}))},op=function(t){return t.dimension.property},ip=function(t,e){return t.dimension.getDimension(e)},ap=function(t,e){var n=rp(t,e);xm(n,[e.shrinkingClass,e.growingClass])},up=function(t,e){Sn(t.element,e.openClass),wn(t.element,e.closedClass),Bi(t.element,op(e),"0px"),Fi(t.element)},cp=function(t,e){Sn(t.element,e.closedClass),wn(t.element,e.openClass),Li(t.element,op(e))},sp=function(t,e,n,r){n.setCollapsed(),Bi(t.element,op(e),ip(e,t.element)),Fi(t.element),ap(t,e),up(t,e),e.onStartShrink(t),e.onShrunk(t)},lp=function(t,e,n,r){var o=r.getOrThunk((function(){return ip(e,t.element)}));n.setCollapsed(),Bi(t.element,op(e),o),Fi(t.element);var i=rp(t,e);Sn(i,e.growingClass),wn(i,e.shrinkingClass),up(t,e),e.onStartShrink(t)},fp=function(t,e,n){var r=ip(e,t.element);("0px"===r?sp:lp)(t,e,n,z.some(r))},dp=function(t,e,n){var r=rp(t,e),o=kn(r,e.shrinkingClass),i=ip(e,t.element);cp(t,e);var a=ip(e,t.element);(o?function(){Bi(t.element,op(e),i),Fi(t.element)}:function(){up(t,e)})(),Sn(r,e.shrinkingClass),wn(r,e.growingClass),cp(t,e),Bi(t.element,op(e),a),n.setExpanded(),e.onStartGrow(t)},mp=function(t,e,n){var r=rp(t,e);return!0===kn(r,e.growingClass)},gp=function(t,e,n){var r=rp(t,e);return!0===kn(r,e.shrinkingClass)},hp=Object.freeze({__proto__:null,refresh:function(t,e,n){if(n.isExpanded()){Li(t.element,op(e));var r=ip(e,t.element);Bi(t.element,op(e),r)}},grow:function(t,e,n){n.isExpanded()||dp(t,e,n)},shrink:function(t,e,n){n.isExpanded()&&fp(t,e,n)},immediateShrink:function(t,e,n){n.isExpanded()&&sp(t,e,n)},hasGrown:function(t,e,n){return n.isExpanded()},hasShrunk:function(t,e,n){return n.isCollapsed()},isGrowing:mp,isShrinking:gp,isTransitioning:function(t,e,n){return mp(t,e)||gp(t,e)},toggleGrow:function(t,e,n){(n.isExpanded()?fp:dp)(t,e,n)},disableTransitions:ap}),pp=Object.freeze({__proto__:null,exhibit:function(t,e,n){var r=e.expanded;return lo(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:Ir(e.dimension.property,"0px")})},events:function(t,e){return Kr([ro(Ut(),(function(n,r){r.event.raw.propertyName===t.dimension.property&&(ap(n,t),e.isExpanded()&&Li(n.element,t.dimension.property),(e.isExpanded()?t.onGrown:t.onShrunk)(n))}))])}}),vp=[Or("closedClass"),Or("openClass"),Or("shrinkingClass"),Or("growingClass"),Tr("getAnimationRoot"),ti("onShrunk"),ti("onStartShrink"),ti("onGrown"),ti("onStartGrow"),Ar("expanded",!1),Er("dimension",Cr("property",{width:[oi("property","width"),oi("getDimension",(function(t){return il(t)+"px"}))],height:[oi("property","height"),oi("getDimension",(function(t){return ji(t)+"px"}))]}))],bp=Object.freeze({__proto__:null,init:function(t){var e=ko(t.expanded);return vo({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:x(e.set,!1),setExpanded:x(e.set,!0),readState:function(){return"expanded: "+e.get()}})}}),yp=xo({fields:vp,name:"sliding",active:pp,apis:hp,state:bp}),xp=function(t,e){var n=Dm(wd.sketch({dom:{tag:"div",classes:[Oi("dropup")]},components:[],containerBehaviours:bo([tg.config({}),yp.config({closedClass:Oi("dropup-closed"),openClass:Oi("dropup-open"),shrinkingClass:Oi("dropup-shrinking"),growingClass:Oi("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){t(),e(),tg.set(n,[])},onGrown:function(n){t(),e()}}),Ci((function(t,e){r(h)}))])})),r=function(t){window.requestAnimationFrame((function(){t(),yp.shrink(n)}))};return{appear:function(t,e,r){!0===yp.hasShrunk(n)&&!1===yp.isTransitioning(n)&&window.requestAnimationFrame((function(){e(r),tg.set(n,[t()]),yp.grow(n)}))},disappear:r,component:n,element:n.element}},wp=function(t){var e,n;return t.raw.which===na[0]&&!H(["input","textarea"],ye(t.target))&&(e=t.target,!ea(e,'[contenteditable="true"]',n).isSome())},Cp=function(){return Tt().browser.isFirefox()},Sp=function(e,n){var r=t({stopBackspace:!0},n),o=kh(r),i=I(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(t){return Hg(e,t,(function(e){o.fireIfReady(e,t).each((function(t){t&&e.kill()})),r.triggerEvent(t,e)&&e.kill()}))})),a=Ka(),u=Hg(e,"paste",(function(t){o.fireIfReady(t,"paste").each((function(e){e&&t.kill()})),r.triggerEvent("paste",t)&&t.kill(),a.set(setTimeout((function(){r.triggerEvent(Xt(),t)}),0))})),c=Hg(e,"keydown",(function(t){r.triggerEvent("keydown",t)?t.kill():r.stopBackspace&&wp(t)&&t.prevent()})),s=function(t,e){return Cp()?Vg(t,"focus",e):Hg(t,"focusin",e)}(e,(function(t){r.triggerEvent("focusin",t)&&t.kill()})),l=Ka(),f=function(t,e){return Cp()?Vg(t,"blur",e):Hg(t,"focusout",e)}(e,(function(t){r.triggerEvent("focusout",t)&&t.kill(),l.set(setTimeout((function(){r.triggerEvent($t(),t)}),0))}));return{unbind:function(){L(i,(function(t){t.unbind()})),c.unbind(),s.unbind(),f.unbind(),u.unbind(),a.on(clearTimeout),l.on(clearTimeout)}}},kp=function(t,e){var n=un(t,"target").getOr(e);return ko(n)},Op=Rr([{stopped:[]},{resume:["element"]},{complete:[]}]),Ep=function(t,e,n,r,o,i){var a=t(e,r),u=function(t,e){var n=ko(!1),r=ko(!1);return{stop:function(){n.set(!0)},cut:function(){r.set(!0)},isStopped:n.get,isCut:r.get,event:t,setSource:e.set,getSource:e.get}}(n,o);return a.fold((function(){return i.logEventNoHandlers(e,r),Op.complete()}),(function(t){var n=t.descHandler;return lm(n)(u),u.isStopped()?(i.logEventStopped(e,t.element,n.purpose),Op.stopped()):u.isCut()?(i.logEventCut(e,t.element,n.purpose),Op.complete()):_e(t.element).fold((function(){return i.logNoParent(e,t.element,n.purpose),Op.complete()}),(function(r){return i.logEventResponse(e,t.element,n.purpose),Op.resume(r)}))}))},_p=function(t,e,n,r,o,i){return Ep(t,e,n,r,o,i).fold(_,(function(r){return _p(t,e,n,r,o,i)}),E)},Tp=function(t,e,n){var r=function(t){var e=ko(!1);return{stop:function(){e.set(!0)},cut:h,isStopped:e.get,isCut:E,event:t,setSource:k("Cannot set source of a broadcasted event"),getSource:k("Cannot get source of a broadcasted event")}}(e);return L(t,(function(t){var e=t.descHandler;lm(e)(r)})),r.isStopped()},Mp=function(t,e,n,r,o){var i=kp(n,r);return _p(t,e,n,r,i,o)},Dp=function(){var t={};return{registerId:function(e,n,r){en(r,(function(r,o){var i=void 0!==t[o]?t[o]:{};i[n]=function(t,e){return n=x.apply(void 0,[t.handler].concat(e)),r=t.purpose,{cHandler:n,purpose:r};var n,r}(r,e),t[o]=i}))},unregisterId:function(e){en(t,(function(t,n){cn(t,e)&&delete t[e]}))},filterByType:function(e){return un(t,e).map((function(t){return an(t,(function(t,e){return function(t,e){return{id:t,descHandler:e}}(e,t)}))})).getOr([])},find:function(e,n,r){return un(t,n).bind((function(t){return Wr(r,(function(e){return function(t,e){return ds(e).bind((function(e){return un(t,e)})).map((function(t){return function(t,e){return{element:t,descHandler:e}}(e,t)}))}(t,e)}),e)}))}}},zp=function(){var t=Dp(),e={},n=function(t){var e=t.element;return ds(e).getOrThunk((function(){return function(t,e){var n=Dc(ss+t);return fs(e,n),n}("uid-",t.element)}))},r=function(n){ds(n.element).each((function(n){delete e[n],t.unregisterId(n)}))};return{find:function(e,n,r){return t.find(e,n,r)},filter:function(e){return t.filterByType(e)},register:function(o){var i=n(o);sn(e,i)&&function(t,n){var o=e[n];if(o!==t)throw new Error('The tagId "'+n+'" is already used by: '+Fo(o.element)+"\nCannot use it for: "+Fo(t.element)+"\nThe conflicting element is"+(je(o.element)?" ":" not ")+"already in the DOM");r(t)}(o,i);var a=[o];t.registerId(a,i,o.events),e[i]=o},unregister:r,getById:function(t){return un(e,t)}}},Ap=function(t){var e=function(e){return _e(t.element).fold(_,(function(t){return ve(e,t)}))},n=zp(),r=function(t,r){return n.find(e,t,r)},o=Sp(t.element,{triggerEvent:function(t,e){return Go(t,e.target,(function(n){return function(t,e,n,r){return Mp(t,e,n,n.target,r)}(r,t,e,n)}))}}),i={debugInfo:v("real"),triggerEvent:function(t,e,n){Go(t,e,(function(o){return Mp(r,t,n,e,o)}))},triggerFocus:function(t,e){ds(t).fold((function(){Oo(t)}),(function(n){Go(Gt(),t,(function(n){return function(t,e,n,r,o){var i=kp(n,r);Ep(t,e,n,r,i,o)}(r,Gt(),{originator:e,kill:h,prevent:h,target:t},t,n),!1}))}))},triggerEscape:function(t,e){i.triggerEvent("keydown",t.element,e.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Dm,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){a(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,e){d(t,e)},broadcastEvent:function(t,e){m(t,e)},isConnected:_},a=function(t){t.connect(i),Ce(t.element)||(n.register(t),L(t.components(),a),i.triggerEvent(te(),t.element,{target:t.element}))},u=function(t){Ce(t.element)||(L(t.components(),u),n.unregister(t)),t.disconnect()},c=function(e){!function(t,e){Ye(t,e,Ne)}(t,e)},s=function(t){Je(t)},l=function(t){var e=n.filter(Kt());L(e,(function(e){var n=e.descHandler;lm(n)(t)}))},f=function(t){l({universal:!0,data:t})},d=function(t,e){l({universal:!1,channels:t,data:e})},m=function(t,e){var r=n.filter(t);return Tp(r,e)},g=function(t){return n.getById(t).fold((function(){return Mn.error(new Error('Could not find component with uid: "'+t+'" in system.'))}),Mn.value)},p=function(t){var e=ds(t).getOr("not found");return g(e)};return a(t),{root:t,element:t.element,destroy:function(){o.unbind(),He(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:a,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Np=Oi("readonly-mode"),Bp=Oi("edit-mode");function Rp(t){var e=Dm(wd.sketch({dom:{classes:[Oi("outer-container")].concat(t.classes)},containerBehaviours:bo([So.config({alpha:Np,omega:Bp})])}));return Ap(e)}var Hp=function(t,e){var n=de.fromTag("input");Ri(n,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Ne(t,n),Oo(n),e(n),He(n)},Vp=function(t){var e=t.getSelection();if(e.rangeCount>0){var n=e.getRangeAt(0),r=t.document.createRange();r.setStart(n.startContainer,n.startOffset),r.setEnd(n.endContainer,n.endOffset),e.removeAllRanges(),e.addRange(r)}},Ip=function(t,e){_o().each((function(t){ve(t,e)||Eo(t)})),t.focus(),Oo(de.fromDom(t.document.body)),Vp(t)},Lp=function(t,e,n,r){var o=function(){Ip(e,r)},i=Hg(n,"keydown",(function(t){H(["input","textarea"],ye(t.target))||o()}));return{toReading:function(){Hp(t,Eo)},toEditing:o,onToolbarTouch:h,destroy:function(){i.unbind()}}},Fp=function(t,e,n,r,o){var i=function(){e.run((function(t){t.refreshSelection()}))},a=function(t,n){var o=t-r.dom.scrollTop;e.run((function(t){t.scrollIntoView(o,o+n)}))},u=function(){e.run((function(t){t.clearSelection()}))},c=function(){t.getCursorBox().each((function(t){a(t.top,t.height)})),e.run((function(t){t.syncHeight()}))},s=Oh(t),l=Ih(c,300),f=[t.onKeyup((function(){u(),l.throttle()})),t.onNodeChanged(i),t.onDomChanged(l.throttle),t.onDomChanged(i),t.onScrollToCursor((function(t){t.preventDefault(),l.throttle()})),t.onScrollToElement((function(t){t.element,a(e,r)})),t.onToEditing((function(){e.run((function(t){t.toEditing()}))})),t.onToReading((function(){e.run((function(t){t.toReading()}))})),Hg(t.doc,"touchend",(function(e){ve(t.html,e.target)||ve(t.body,e.target)})),Hg(n,"transitionend",(function(t){var r;"height"===t.raw.propertyName&&(r=ji(n),e.run((function(t){t.setViewportOffset(r)})),i(),c())})),Vg(n,"touchstart",(function(n){var r;e.run((function(t){t.highlightSelection()})),r=n,e.run((function(t){t.onToolbarTouch(r)})),t.onTouchToolstrip()})),Hg(t.body,"touchstart",(function(e){u(),t.onTouchContent(),s.fireTouchstart(e)})),s.onTouchmove(),s.onTouchend(),Hg(t.body,"click",(function(t){t.kill()})),Hg(n,"touchmove",(function(){t.onToolbarScrollStart()}))];return{destroy:function(){L(f,(function(t){t.unbind()}))}}};var Pp,Up=function(t){var e=z.none(),n=[],r=function(t){o()?a(t):n.push(t)},o=function(){return e.isSome()},i=function(t){L(t,a)},a=function(t){e.each((function(e){setTimeout((function(){t(e)}),0)}))};return t((function(t){o()||(e=z.some(t),i(n),n=[])})),{get:r,map:function(t){return Up((function(e){r((function(n){e(t(n))}))}))},isReady:o}},jp={nu:Up,pure:function(t){return Up((function(e){e(t)}))}},Wp=function(t){setTimeout((function(){throw t}),0)},qp=function(t){var e=function(e){t().then(e,Wp)};return{map:function(e){return qp((function(){return t().then(e)}))},bind:function(e){return qp((function(){return t().then((function(t){return e(t).toPromise()}))}))},anonBind:function(e){return qp((function(){return t().then((function(){return e.toPromise()}))}))},toLazy:function(){return jp.nu(e)},toCached:function(){var e=null;return qp((function(){return null===e&&(e=t()),e}))},toPromise:t,get:e}},Gp=function(t){return qp((function(){return new od(t)}))},$p=function(t){return qp((function(){return od.resolve(t)}))},Xp=function(t,e){return Q([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],(function(n){return function(t,e){return t?z.some(e):z.none()}(t<=n.width&&e<=n.height,n.keyboard)})).getOr({portrait:e/5,landscape:t/4})},Kp=function(t){var e=Lg(t).isPortrait(),n=function(t){return Xp(t.screen.width,t.screen.height)}(t),r=e?n.portrait:n.landscape;return(e?t.screen.height:t.screen.width)-t.innerHeight>r?0:r},Yp=function(t,e){var n=Oe(t).dom.defaultView;return ji(t)+ji(e)-Kp(n)},Jp=function(t,e,n){var r=Yp(e,n),o=ji(e)+ji(n)-r;Bi(t,"padding-bottom",o+"px")},Qp=Rr([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),Zp="data-"+Oi("position-y-fixed"),tv="data-"+Oi("y-property"),ev="data-"+Oi("scrolling"),nv="data-"+Oi("last-window-height"),rv=function(t){return Th(t,Zp)},ov=function(t,e){var n=function(t){return mn(t,tv)}(t);return Qp.fixed(t,n,e)},iv=function(t,e){return Qp.scroller(t,e)},av=function(t){var e=rv(t);return("true"===mn(t,ev)?iv:ov)(t,e)},uv=function(t,e,n){var r=Oe(t).dom.defaultView.innerHeight;return fn(t,nv,r+"px"),r-e-n},cv=function(t,e,n,r){var o=Oe(t).dom.defaultView,i=function(t){var e=mn(t,"style");return Ri(t,{position:"absolute",top:"0px"}),fn(t,Zp,"0px"),fn(t,tv,"top"),{restore:function(){fn(t,"style",e||""),pn(t,Zp),pn(t,tv)}}}(n),a=ji(n),u=ji(r),c=function(t,e,n){var r=mn(n,"style");return vg(n),Ri(n,{position:"absolute",height:e+"px",width:"100%",top:t+"px"}),fn(n,Zp,t+"px"),fn(n,ev,"true"),fn(n,tv,"top"),{restore:function(){bg(n),fn(n,"style",r||""),pn(n,Zp),pn(n,ev),pn(n,tv)}}}(a,uv(t,a,u),t),s=function(t){var e=mn(t,"style");return Ri(t,{position:"absolute",bottom:"0px"}),fn(t,Zp,"0px"),fn(t,tv,"bottom"),{restore:function(){fn(t,"style",e||""),pn(t,Zp),pn(t,tv)}}}(r),l=!0,f=function(){var e=o.innerHeight,n=function(t){return Th(t,nv)}(t);return e>n},d=function(){if(l){var o=ji(n),i=ji(r),a=uv(t,o,i);fn(t,Zp,o+"px"),Bi(t,"height",a+"px"),Jp(e,t,r)}};return Jp(e,t,r),{setViewportOffset:function(e){fn(t,Zp,e+"px"),d()},isExpanding:f,isShrinking:S(f),refresh:d,restore:function(){l=!1,i.restore(),c.restore(),s.restore()}}},sv=(Pp=null,{animate:function(t,e,n,r,o,i){var a=!1,u=function(t){a=!0,o(t)};Ig.clearInterval(Pp);var c=function(t){Ig.clearInterval(Pp),u(t)};Pp=Ig.setInterval((function(){var o=t();(function(t,e,n){return Math.abs(t-e)<=n?z.none():t<e?z.some(t+n):z.some(t-n)})(o,e,n).fold((function(){Ig.clearInterval(Pp),u(e)}),(function(n){if(r(n,c),!a){var i=t();(i!==n||Math.abs(i-e)>Math.abs(o-e))&&(Ig.clearInterval(Pp),u(e))}}))}),i)}}),lv="data-"+Oi("last-scroll-top"),fv=function(t){var e=Ii(t,"top").getOr("0");return parseInt(e,10)},dv=function(t){return parseInt(t.dom.scrollTop,10)},mv=function(t,e){return Gp((function(n){var r=x(dv,t);fn(t,lv,r());var o=Math.abs(e-r()),i=Math.ceil(o/10);sv.animate(r,e,i,(function(e,n){Th(t,lv)!==t.dom.scrollTop?n(t.dom.scrollTop):(t.dom.scrollTop=e,fn(t,lv,e))}),(function(){t.dom.scrollTop=e,fn(t,lv,e),n(e)}),10)}))},gv=function(t,e){var n=e+rv(t)+"px";Bi(t,"top",n)};var hv=function(t,e){return e((function(e){var n=[],r=0;0===t.length?e([]):L(t,(function(o,i){o.get(function(o){return function(i){n[o]=i,++r>=t.length&&e(n)}}(i))}))}))},pv=function(t,e,n){var r=e+n,o=Ii(t,"top").getOr(n),i=r-parseInt(o,10);return function(t,e,n){return Gp((function(r){var o=x(dv,t);sv.animate(o,e,15,(function(e){t.dom.scrollTop=e,Bi(t,"top",fv(t)+15+"px")}),(function(){t.dom.scrollTop=e,Bi(t,"top",n+"px"),r(e)}),10)}))}(t,t.dom.scrollTop+i,r)},vv=function(t,e){return t.fold((function(t,n,r){return function(t,e,n,r){return Bi(t,e,n+r+"px"),$p(r)}(t,n,e,r)}),(function(t,n){return pv(t,e,n)}))},bv=function(t,e){var n=function(t){var e=Xi(t,"["+Zp+"]");return I(e,av)}(t),r=I(n,(function(t){return vv(t,e)}));return hv(r,Gp)},yv=function(t,e,n,r,o,i){var a,u,c=(a=function(n){return function(t,e,n){var r=Oe(t).dom.defaultView;return Gp((function(o){gv(t,n),gv(e,n),r.scrollTo(0,n),o(n)}))}(t,e,n)},u=ko(jp.pure({})),{start:function(t){var e=jp.nu((function(e){return a(t).get(e)}));u.set(e)},idle:function(t){u.get().get((function(){t()}))}}),s=Ih((function(){c.idle((function(){bv(n,r.pageYOffset).get((function(){var t;(t=zh(i),z.from(t[0]).bind((function(t){var n=t.top-e.dom.scrollTop;return n>r.innerHeight+5||n<-5?z.some({top:n,bottom:n+t.height}):z.none()}))).each((function(t){e.dom.scrollTop=e.dom.scrollTop+t.top})),c.start(0),o.refresh()}))}))}),1e3),l=Hg(de.fromDom(r),"scroll",(function(){r.pageYOffset<0||s.throttle()}));return bv(n,r.pageYOffset).get(b),{unbind:l.unbind}},xv=function(t){var e=t.cWin,n=t.ceBody,r=t.socket,o=t.toolstrip,i=t.contentElement,a=t.keyboardType,u=t.outerWindow,c=t.dropup,s=t.outerBody,l=cv(r,n,o,c),f=a(s,e,We(),i),d=Pg(u,{onChange:h,onReady:l.refresh});d.onAdjustment((function(){l.refresh()}));var m=Hg(de.fromDom(u),"resize",(function(){l.isExpanding()&&l.refresh()})),g=yv(o,r,s,u,l,e),p=function(t,e){var n=t.document,r=de.fromTag("div");wn(r,Oi("unfocused-selections")),Ne(de.fromDom(n.documentElement),r);var o=Hg(r,"touchstart",(function(n){n.prevent(),Ip(t,e),a()})),i=function(t){var e=de.fromTag("span");return ym(e,[Oi("layer-editor"),Oi("unfocused-selection")]),Ri(e,{left:t.left+"px",top:t.top+"px",width:t.width+"px",height:t.height+"px"}),e},a=function(){Re(r)};return{update:function(){a();var e=zh(t),n=I(e,i);Be(r,n)},isActive:function(){return Te(r).length>0},destroy:function(){o.unbind(),He(r)},clear:a}}(e,i),v=function(){p.clear()};return{toEditing:function(){f.toEditing(),v()},toReading:function(){f.toReading()},onToolbarTouch:function(t){f.onToolbarTouch()},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:v,highlightSelection:function(){p.update()},scrollIntoView:function(t,n){!function(t,e,n,r,o){var i=Yp(e,n),a=x(Vp,t);r>i||o>i?mv(e,e.dom.scrollTop-i+o).get(a):r<0&&mv(e,e.dom.scrollTop+r).get(a)}(e,r,c,t,n)},updateToolbarPadding:h,setViewportOffset:function(t){l.setViewportOffset(t),function(t,e){return Gp((function(n){var r=x(fv,t),o=function(e){Bi(t,"top",e+"px")},i=Math.abs(e-r()),a=Math.ceil(i/10);sv.animate(r,e,a,o,(function(){o(e),n(e)}),10)}))}(r,t).get(b)},syncHeight:function(){Bi(i,"height",i.dom.contentWindow.document.body.scrollHeight+"px")},refreshStructure:l.refresh,destroy:function(){l.restore(),d.destroy(),g.unbind(),m.unbind(),f.destroy(),p.destroy(),Hp(We(),Eo)}}},wv=function(t){var e=xr("Getting IosWebapp schema",Ph,t);Bi(e.toolstrip,"width","100%"),Bi(e.container,"position","relative");var n=Dm(Lh((function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()}),e.translate));e.alloy.add(n);var r={show:function(){e.alloy.add(n)},hide:function(){e.alloy.remove(n)}},o=function(t,e){var n=ph(),r=Ka(),o=Ka(),i=Xa(),a=Xa();return{enter:function(){e.hide();var u=de.fromDom(document);gh(t.editor).each((function(e){var c,s;r.set({socketHeight:Ii(t.socket,"height"),iframeHeight:Ii(e.frame,"height"),outerScroll:document.body.scrollTop}),o.set({exclusives:(c=u,s="."+yg,Hg(c,"touchmove",(function(t){ea(t.target,s).filter(Yh).fold((function(){t.prevent()}),h)})))}),wn(t.container,Oi("fullscreen-maximized")),wh(t.container,e.body),n.maximize(),Bi(t.socket,"overflow","scroll"),Bi(t.socket,"-webkit-overflow-scrolling","touch"),Oo(e.body),i.set(xv({cWin:e.win,ceBody:e.body,socket:t.socket,toolstrip:t.toolstrip,dropup:t.dropup.element,contentElement:e.frame,outerBody:t.body,outerWindow:t.win,keyboardType:Lp})),i.run((function(t){t.syncHeight()})),a.set(Fp(e,i,t.toolstrip,t.socket,t.dropup))}))},refreshStructure:function(){i.run((function(t){t.refreshStructure()}))},exit:function(){n.restore(),a.clear(),i.clear(),e.show(),r.on((function(e){e.socketHeight.each((function(e){Bi(t.socket,"height",e)})),e.iframeHeight.each((function(e){Bi(t.editor.getFrame(),"height",e)})),document.body.scrollTop=e.scrollTop})),r.clear(),o.on((function(t){t.exclusives.unbind()})),o.clear(),Sn(t.container,Oi("fullscreen-maximized")),Ch(),bg(t.toolbar),Li(t.socket,"overflow"),Li(t.socket,"-webkit-overflow-scrolling"),Eo(t.editor.getFrame()),gh(t.editor).each((function(t){t.clearSelection()}))}}}(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:h}};var Cv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Sv=function(t,e,n){t.system.broadcastOn([No],{command:e,state:n})},kv=function(t){return function(){var e=function(){t._skinLoaded=!0,t.fire("SkinLoaded")};t.initialized?e():t.on("init",e)}},Ov="toReading",Ev="toEditing",_v=function(t){return{getNotificationManagerImpl:function(){return{open:v({progressBar:{value:h},close:h,text:h,getEl:v(null),moveTo:h,moveRel:h,settings:{}}),close:h,reposition:h,getArgs:v({})}},renderUI:function(){var e=t.getElement(),n=function(t){var e=z.from(function(t){return t.getParam("skin_url")}(t)).getOrThunk((function(){return Cv.baseURL+"/skins/ui/oxide"}));return{content:e+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"}}(t);if(!1===function(t){return!1===t.getParam("skin")}(t)){var r=Mo.DOM.styleSheetLoader;t.contentCSS.push(n.content),r.load(n.ui,kv(t)),t.on("remove",(function(){return r.unload(n.ui)}))}else kv(t)();var o=function(){t.fire("ScrollIntoView")},i=Tt().os.isAndroid()?function(t){var e=Rp({classes:[Oi("android-container")]}),n=Jh(),r=Xa(),o=Qh(r),i=Zh(),a=xp(h,t);return e.add(n.wrapper),e.add(i),e.add(a.component),{system:e,element:e.element,init:function(t){r.set(Uh(t))},exit:function(){r.run((function(t){t.exit(),tg.remove(i,o)}))},setToolbarGroups:function(t){var e=n.createGroups(t);n.setGroups(e)},setContextToolbar:function(t){var e=n.createGroups(t);n.setContextToolbar(e)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(t){np(i,o,t,e.root)},socket:i,dropup:a}}(o):function(t){var e=Rp({classes:[Oi("ios-container")]}),n=Jh(),r=Xa(),o=Qh(r),i=Zh(),a=xp((function(){r.run((function(t){t.refreshStructure()}))}),t);return e.add(n.wrapper),e.add(i),e.add(a.component),{system:e,element:e.element,init:function(t){r.set(wv(t))},exit:function(){r.run((function(t){tg.remove(i,o),t.exit()}))},setToolbarGroups:function(t){var e=n.createGroups(t);n.setGroups(e)},setContextToolbar:function(t){var e=n.createGroups(t);n.setContextToolbar(e)},focusToolbar:function(){n.focus()},restoreToolbar:function(){n.restoreToolbar()},updateMode:function(t){np(i,o,t,e.root)},socket:i,dropup:a}}(o);!function(t,e){Qe(t,e,ze)}(de.fromDom(e),i.system);var a=e.ownerDocument.defaultView,u=Pg(a,{onChange:function(){i.system.broadcastOn([Bo],{width:Fg(a)})},onReady:h}),c=function(e,n,r,o){!1===o&&t.selection.collapse();var a=s(e,n,r);i.setToolbarGroups(!0===o?a.readOnly:a.main),t.setMode(!0===o?"readonly":"design"),t.fire(!0===o?Ov:Ev),i.updateMode(o)},s=function(t,e,n){var r=t.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(n.get())}},l=function(e,n){return t.on(e,n),{unbind:function(){t.off(e)}}};return t.on("init",(function(){i.init({editor:{getFrame:function(){return de.fromDom(t.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:h}},onToReading:function(t){return l(Ov,t)},onToEditing:function(t){return l(Ev,t)},onScrollToCursor:function(e){t.on("ScrollIntoView",(function(t){e(t)}));return{unbind:function(){t.off("ScrollIntoView"),u.destroy()}}},onTouchToolstrip:function(){e()},onTouchContent:function(){var n,r=de.fromDom(t.editorContainer.querySelector("."+Oi("toolbar")));(n=r,To(n).bind((function(t){return i.system.getByDom(t).toOptional()}))).each(ce),i.restoreToolbar(),e()},onTapContent:function(e){var n=e.target;if("img"===ye(n))t.selection.select(n.dom),e.kill();else if("a"===ye(n)){i.system.getByDom(de.fromDom(t.editorContainer)).each((function(t){So.isAlpha(t)&&function(t){var e=document.createElement("a");e.target="_blank",e.href=t.href,e.rel="noreferrer noopener";var n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(n),document.body.removeChild(e)}(n.dom)}))}}},container:de.fromDom(t.editorContainer),socket:de.fromDom(t.contentAreaContainer),toolstrip:de.fromDom(t.editorContainer.querySelector("."+Oi("toolstrip"))),toolbar:de.fromDom(t.editorContainer.querySelector("."+Oi("toolbar"))),dropup:i.dropup,alloy:i.system,translate:h,setReadOnly:function(t){c(m,d,f,t)},readOnlyOnInit:function(){return!1}});var e=function(){i.dropup.disappear((function(){i.system.broadcastOn([Ro],{})}))},n={label:"The first group",scrollable:!1,items:[Ds("back",(function(){t.selection.collapse(),i.exit()}),{},t)]},r={label:"Back to read only",scrollable:!1,items:[Ds("readonly-back",(function(){c(m,d,f,!0)}),{},t)]},o=zg(i,t),a=function(t,e){var n=Dg(t),r={};return G(n,(function(t){var n=!sn(r,t)&&sn(e,t)&&e[t].isSupported()?[e[t].sketch()]:[];return r[t]=!0,n}))}(t,o),s={label:"The extra group",scrollable:!1,items:[]},f=ko([{label:"the action group",scrollable:!0,items:a},s]),d=ko([{label:"The read only mode group",scrollable:!0,items:[]},s]),m=ko({backToMask:[n],backToReadOnly:[r]});!function(t,e){var n=Ze(e.formatter.get());L(n,(function(n){e.formatter.formatChanged(n,(function(e){Sv(t,n,e)}))})),L(["ul","ol"],(function(n){e.selection.selectorChanged(n,(function(e,r){Sv(t,n,e)}))}))}(i,t)})),t.on("remove",(function(){i.exit()})),t.on("detach",(function(){var t,e;t=i.system,e=Te(t.element),L(e,(function(e){t.getByDom(e).each(Ge)})),He(t.element),i.system.destroy()})),{iframeContainer:i.socket.element.dom,editorContainer:i.element.dom}}}};Do.add("mobile",_v)}(),tinymce.IconManager.add("default",{icons:{"accessibility-check":'<svg width="24" height="24"><path d="M12 2a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2c0-1.1.9-2 2-2zm8 7h-5v12c0 .6-.4 1-1 1a1 1 0 01-1-1v-5c0-.6-.4-1-1-1a1 1 0 00-1 1v5c0 .6-.4 1-1 1a1 1 0 01-1-1V9H4a1 1 0 110-2h16c.6 0 1 .4 1 1s-.4 1-1 1z" fill-rule="nonzero"/></svg>',"action-next":'<svg width="24" height="24"><path fill-rule="nonzero" d="M5.7 7.3a1 1 0 00-1.4 1.4l7.7 7.7 7.7-7.7a1 1 0 10-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 001.4-1.4L12 6.6l-7.7 7.7a1 1 0 001.4 1.4L12 9.4l6.3 6.3z"/></svg>',"align-center":'<svg width="24" height="24"><path d="M5 5h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm3 4h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm-3-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0 4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-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 110-2zm0 4h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"align-none":'<svg width="24" height="24"><path d="M14.2 5L13 7H5a1 1 0 110-2h9.2zm4 0h.8a1 1 0 010 2h-2l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h6.8zm4 0H19a1 1 0 010 2h-4.4l1.2-2zm-6.4 4l-1.2 2H5a1 1 0 010-2h4.4zm4 0H19a1 1 0 010 2h-6.8l1.2-2zM7 17l-1.2 2H5a1 1 0 010-2h2zm4 0h8a1 1 0 010 2H9.8l1.2-2zm5.2-13.5l1.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 110-2zm6 4h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 8h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-6-4h14c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2z" fill-rule="evenodd"/></svg>',"arrow-left":'<svg width="24" height="24"><path d="M5.6 13l12 6a1 1 0 001.4-1V6a1 1 0 00-1.4-.9l-12 6a1 1 0 000 1.8z" fill-rule="evenodd"/></svg>',"arrow-right":'<svg width="24" height="24"><path d="M18.5 13l-12 6A1 1 0 015 18V6a1 1 0 011.4-.9l12 6a1 1 0 010 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 01-.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 00-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 01-.7.3 1 1 0 01-.7-.3 1 1 0 01-.3-.7v-1c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3zm0-10a1 1 0 01-.7-.3A1 1 0 0111 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 01-.7.3zm7 4c.3 0 .5.1.7.3.2.2.3.4.3.7 0 .3-.1.5-.3.7a1 1 0 01-.7.3h-1a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h1zM7 12c0 .3-.1.5-.3.7a1 1 0 01-.7.3H5a1 1 0 01-.7-.3A1 1 0 014 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.5l.7.8c.2.1.3.4.3.6 0 .3-.1.6-.3.8a1 1 0 01-.8.3 1 1 0 01-.6-.3l-.8-.7a1 1 0 01-.3-.8c0-.2.1-.5.3-.7a1 1 0 011.4 0zm-10-7l-.7-.8a1 1 0 01-.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 01-.7.3 1 1 0 01-.8-.3zm10 0a1 1 0 01-.8.3 1 1 0 01-.7-.3 1 1 0 01-.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 010 1.4l-.8.8a1 1 0 01-.6.3 1 1 0 01-.8-.3 1 1 0 01-.3-.8c0-.2.1-.5.3-.6l.7-.8zM12 8a4 4 0 013.7 2.4 4 4 0 010 3.2A4 4 0 0112 16a4 4 0 01-3.7-2.4 4 4 0 010-3.2A4 4 0 0112 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 012 2v12a2 2 0 01-2 2h-4v-2h4V8H5v10h4v2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9.4l-2.3 2.3a1 1 0 11-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L13 13.4V20a1 1 0 01-2 0v-6.6z" fill-rule="nonzero"/></svg>',cancel:'<svg width="24" height="24"><path d="M12 4.6a7.4 7.4 0 110 14.8 7.4 7.4 0 010-14.8zM12 3a9 9 0 100 18 9 9 0 000-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 2l1.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 01-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 01-2-2v-5h2zm8-7V4h6a2 2 0 012 2h-8z" opacity=".2"/><path fill-rule="nonzero" d="M13 4v2H5v7H3V6c0-1.1.9-2 2-2h8zm-2.6 14.1l.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 11l-2 2H5v-2h6V6h2z"/><path fill-rule="nonzero" d="M18.4 8l1 1-1.8 1.9 4 4c.5.4.5 1.1 0 1.6l-4.3 4.2a1.2 1.2 0 01-1.6 0l-4.4-4.2c-.4-.5-.4-1.2 0-1.7l7-6.8zm1.6 7l-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 01-.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 01-1 .7h-.2a.7.7 0 01-.7-1l4-12a1 1 0 012 0l4 12a.7.7 0 01-.8 1h-.2a1 1 0 01-1-.7l-.8-2.6zm-.3-1.5l-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.2v-.1-.2l-.6.3H7c-.4 0-.7 0-1-.2a1 1 0 01-.3-.9c0-.3 0-.6.3-.8.3-.2.7-.4 1.2-.4l.6-.2h.3v-.2l-.1-.2a.8.8 0 00-.5-.1 1 1 0 00-.4 0l-.3.4h-1zm2.3.8h-.2l-.2.1-.4.1a1 1 0 00-.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 001.2 0l.2-.8c0-.4 0-.6-.2-.8a.7.7 0 00-.6-.3l-.6.3-.2.8zm6.1-.5c0-.2 0-.3-.2-.4a.8.8 0 00-.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 01-1.3.4c-.5 0-1-.2-1.3-.6a2 2 0 01-.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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1H5a1 1 0 110-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 010-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 010-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 010-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8a1 1 0 010 2h-8a1 1 0 010-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 010-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 010-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 010-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 011.6 1.2l-8 12a1 1 0 01-1.5.1l-5-5a1 1 0 111.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 010-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.3L4 5l3.8 3.7c.3.3.3.8 0 1-.4.4-.9.4-1.2 0L2.2 5.7a.8.8 0 010-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 010-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 010-1.1L6 5 2.2 1.3z" fill-rule="nonzero"/></svg>',"chevron-up":'<svg width="10" height="10"><path d="M8.7 7.8L5 4 1.3 7.8c-.3.3-.8.3-1 0a.8.8 0 010-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.2L13.4 12l3.9 3.8a1 1 0 01-1.5 1.5L12 13.4l-3.8 3.9a1 1 0 01-1.5-1.5l3.9-3.8-3.9-3.8a1 1 0 011.5-1.5l3.8 3.9 3.8-3.9a1 1 0 011.5 1.5z" fill-rule="evenodd"/></svg>',"code-sample":'<svg width="24" height="26"><path d="M7.1 11a2.8 2.8 0 01-.8 2 2.8 2.8 0 01.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 01-.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 01-.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 01-.4-.4v-.8c0-.2.1-.4.4-.4.3 0 .6-.1.8-.4.3-.2.4-.5.4-.8V15a2.8 2.8 0 01.8-2 2.8 2.8 0 01-.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 01-1.1 1c-.4.3-.8.4-1.1.4a.5.5 0 01-.5-.5V17a3 3 0 001-.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 0118 14c0 .5 0 1-.2 1.4 0 .4-.3.9-.5 1.3a6.2 6.2 0 01-3.7 3 5.7 5.7 0 01-3.2 0A5.9 5.9 0 017.6 18a6.2 6.2 0 01-1.4-2.6 6.7 6.7 0 010-2.8c0-.4.1-.9.3-1.3a13.6 13.6 0 012.3-4A20 20 0 0112 4a26.4 26.4 0 013.2 3.4 18.2 18.2 0 012.3 4zm-2 4.5c.4-.7.5-1.4.5-2a7.3 7.3 0 00-1-3.2c.2.6.2 1.2.2 1.9a4.5 4.5 0 01-1.3 3 5.3 5.3 0 01-2.3 1.5 4.9 4.9 0 01-2 .1 4.3 4.3 0 002.4.8 4 4 0 002-.6 4 4 0 001.5-1.5z" fill-rule="evenodd"/></svg>',"color-picker":'<svg width="24" height="24"><path d="M12 3a9 9 0 000 18 1.5 1.5 0 001.1-2.5c-.2-.3-.4-.6-.4-1 0-.8.7-1.5 1.5-1.5H16a5 5 0 005-5c0-4.4-4-8-9-8zm-5.5 9a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3-4a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm5 0a1.5 1.5 0 110-3 1.5 1.5 0 010 3zm3 4a1.5 1.5 0 110-3 1.5 1.5 0 010 3z" fill-rule="nonzero"/></svg>',"color-swatch-remove-color":'<svg width="24" height="24"><path stroke="#000" stroke-width="2" d="M21 3L3 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 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/><path d="M13 10h2a1 1 0 010 2h-2v2a1 1 0 01-2 0v-2H9a1 1 0 010-2h2V8a1 1 0 012 0v2z"/></g></svg>',comment:'<svg width="24" height="24"><path fill-rule="nonzero" d="M9 19l3-2h7c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H5a1 1 0 00-1 1v10c0 .6.4 1 1 1h4v2zm-2 4v-4H5a3 3 0 01-3-3V6a3 3 0 013-3h14a3 3 0 013 3v10a3 3 0 01-3 3h-6.4L7 23z"/></svg>',contrast:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4zm-6 8a6 6 0 006 6V6a6 6 0 00-6 6z" fill-rule="evenodd"/></svg>',copy:'<svg width="24" height="24"><path d="M16 3H6a2 2 0 00-2 2v11h2V5h10V3zm1 4a2 2 0 012 2v10a2 2 0 01-2 2h-7a2 2 0 01-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 01-1-1v-2H7V9H5a1 1 0 110-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 0110.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 012 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 017 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 00-.7.4v.1a2.8 2.8 0 00-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 00.8-.3 2.4 2.4 0 00.7-.7 2.5 2.5 0 00.3-.8 1.5 1.5 0 000-.8 1 1 0 00-.2-.4 1 1 0 00-.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 00-.5.3 1 1 0 00-.2.5v.7a2.5 2.5 0 00.3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 000-.8 2.6 2.6 0 00-.3-.8A2.5 2.5 0 007.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 00-.8.4 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3L9 18V18l.4-.4.2-.4.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2h-.5zm7 0H15a1 1 0 00-.4.3 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4a2.8 2.8 0 00.5.7h.1a2.8 2.8 0 00.8.6l.4.1h.7l.5-.2.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.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 01-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 018.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 010-2c0-.4.3-.7.5-1l6 6 6-6 .5 1a3.3 3.3 0 010 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.2l.1-.4v-.3-.4a1 1 0 00-.2-.5 1 1 0 00-.4-.2 1.6 1.6 0 00-.8 0 2.6 2.6 0 00-.8.3 2.5 2.5 0 00-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 00.8-.3 2.8 2.8 0 001-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 4l.2-.5v-.4-.3a2.6 2.6 0 00-.3-.8 2.4 2.4 0 00-.7-.7 2.5 2.5 0 00-.8-.3 1.5 1.5 0 00-.8 0 1 1 0 00-.4.2 1 1 0 00-.2.5 1.5 1.5 0 000 .7v.4l.3.4.3.4a2.8 2.8 0 00.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 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-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 01-2 2h-7a2 2 0 01-2-2V9c0-1.2.9-2 2-2h7a2 2 0 012 2v2z"/><path d="M17 14h1a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1h-1a1 1 0 010-2h1v-1a1 1 0 012 0v1z"/></g></svg>',"edit-block":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19.8 8.8l-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-.2l1-.9v-.3l-2.2-2.2a.3.3 0 00-.3 0l-1 1L18 8.5zm-1 1l-2.5-2.4-6 6 2.5 2.5 6-6zm-7 7.1l-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 00-2-2H7v2h11v9zM6 17h15a1 1 0 010 2h-1v1a1 1 0 01-2 0v-1H6a2 2 0 01-2-2V7H3a1 1 0 110-2h1V4a1 1 0 112 0v13zm3-5.3l1.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 0119 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 008 19h3zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 00-4 4.5h2.2zm-3.4 0a12 12 0 012.8-4 12 12 0 00-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm4.8 2.6l5.6 4a.5.5 0 010 .8l-5.6 4A.5.5 0 019 16V8a.5.5 0 01.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 00-1 1c0 .6.4 1 1 1zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 00-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 100 16 8 8 0 000-16zm0 14.5a6.5 6.5 0 110-13 6.5 6.5 0 010 13z" fill-rule="nonzero"/></svg>',export:'<svg width="24" height="24"><g fill-rule="nonzero"><path d="M14.4 3L18 7v1h-5V5H7v14h9a1 1 0 012 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 011.4.2l2.4 3.6-2.4 3.6a1 1 0 01-1.7-1v-.2l1.7-2.4-1.6-2.4a1 1 0 01.2-1.4z"/></g></svg>',fill:'<svg width="24" height="26"><path d="M16.6 12l-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 002.2 0l5.5-5.5c.5-.6.5-1.6 0-2.2zM5.2 13L10 8.2l4.8 4.8H5.2zM19 14.5s-2 2.2-2 3.5c0 1.1.9 2 2 2a2 2 0 002-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 00-2 2zm14-2v2h2a2 2 0 00-2-2zm-7 16h2V3h-2v18zm7-6h2v-2h-2v2zm-4-8h2V5h-2v2zm4 12a2 2 0 002-2h-2v2z" fill-rule="nonzero"/></svg>',"flip-vertically":'<svg width="24" height="24"><path d="M5 14v2h2v-2H5zm8 4v2h2v-2h-2zm4-14H7a2 2 0 00-2 2v3h2V6h10v3h2V6a2 2 0 00-2-2zm2 14h-2v2a2 2 0 002-2zM3 11v2h18v-2H3zm6 7v2h2v-2H9zm8-4v2h2v-2h-2zM5 18c0 1.1.9 2 2 2v-2H5z" fill-rule="nonzero"/></svg>',"format-painter":'<svg width="24" height="24"><path d="M18 5V4c0-.5-.4-1-1-1H5a1 1 0 00-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 010 2h-4v11a1 1 0 01-2 0V7H7a1 1 0 110-2h10z"/></svg>',fullscreen:'<svg width="24" height="24"><path d="M15.3 10l-1.2-1.3 2.9-3h-2.3a.9.9 0 110-1.7H19c.5 0 .9.4.9.9v4.4a.9.9 0 11-1.8 0V7l-2.9 3zm0 4l3 3v-2.3a.9.9 0 111.7 0V19c0 .5-.4.9-.9.9h-4.4a.9.9 0 110-1.8H17l-3-2.9 1.3-1.2zM10 15.4l-2.9 3h2.3a.9.9 0 110 1.7H5a.9.9 0 01-.9-.9v-4.4a.9.9 0 111.8 0V17l2.9-3 1.2 1.3zM8.7 10L5.7 7v2.3a.9.9 0 01-1.7 0V5c0-.5.4-.9.9-.9h4.4a.9.9 0 010 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.7l2.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 6h16c.6 0 1 .4 1 1v13c0 .6-.4 1-1 1H4a1 1 0 01-1-1V7c0-.6.4-1 1-1zm6 7a2 2 0 110-4 2 2 0 010 4zM4.5 4h15a.5.5 0 110 1h-15a.5.5 0 010-1zm2-2h11a.5.5 0 110 1h-11a.5.5 0 010-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 01-1-1V4c0-.6.4-1 1-1zm1 2v14h14V5H5zm6.5 11.8V14L9.2 8.7a5.1 5.1 0 00-.4-.8l-.1-.2H8 8v-1l.3-.1.3-.1h.7a1 1 0 01.6.5l.1.3a8.5 8.5 0 01.3.6l1.9 4.6 2-5.2a1 1 0 011-.6.5.5 0 01.5.6L13 14v2.8a.7.7 0 01-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 00-6 9 6.3 6.3 0 001.4 2l1 1a6.3 6.3 0 003.6 1 6.5 6.5 0 006-9 6.3 6.3 0 00-1.4-2l-1-1a6.3 6.3 0 00-3.6-1zM12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 4z"/><path d="M9.6 9.7a.7.7 0 01-.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 00-.8.8.8.8 0 01-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 id="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 012.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 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',image:'<svg width="24" height="24"><path d="M5 15.7l3.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-3l-2.5-2.4-6.4 6.5H19v-4zM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 01-1-1V4c0-.6.4-1 1-1zm6 8a2 2 0 100-4 2 2 0 000 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm-2.6-3.8L6.2 12l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',info:'<svg width="24" height="24"><path d="M12 4a7.8 7.8 0 015.7 2.3A8 8 0 1112 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 001.8-2.9 6.3 6.3 0 00-.1-4.1 5.8 5.8 0 00-3-3.2c-.6-.3-1.3-.5-2.1-.5a5.1 5.1 0 00-3.9 1.8 6.3 6.3 0 00-1.3 6 6.2 6.2 0 001.8 3l1.4.9V20H4v-4l1 2h4v-.5l-2-1L5.4 15A6.5 6.5 0 014 11c0-1 .2-1.9.6-2.7A7 7 0 016.3 6C7.1 5.4 8 5 9 4.5c1-.3 2-.5 3.1-.5a8.8 8.8 0 015.7 2 7 7 0 011.7 2.3 6 6 0 01.2 4.8c-.2.7-.6 1.3-1 1.9a7.6 7.6 0 01-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 100-14 7 7 0 000 14zm0 2a9 9 0 110-18 9 9 0 010 18z"/><path d="M16 12h-3V7c0-.6-.4-1-1-1a1 1 0 00-1 1v7h5c.6 0 1-.4 1-1s-.4-1-1-1z"/></g></svg>',invert:'<svg width="24" height="24"><path d="M18 19.3L16.5 18a5.8 5.8 0 01-3.1 1.9 6.1 6.1 0 01-5.5-1.6A5.8 5.8 0 016 14v-.3l.1-1.2A13.9 13.9 0 017.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 00.2-1v-.2c0-.4 0-.8-.2-1.3l-.5-1.4a14.8 14.8 0 00-3-4.2L12 6a26.1 26.1 0 00-2.2 2.5l-1-1a20.9 20.9 0 012.9-3.3L12 4l1 .8a22.2 22.2 0 014 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.7l-.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 110 18 9 9 0 010-18zm4.3 13.3c-.5 1-1.2 2-2 2.9a7.5 7.5 0 003.2-2.1l-.2-.2a6 6 0 00-1-.6zm-8.6 0c-.5.2-.9.5-1.2.8.9 1 2 1.7 3.2 2a10 10 0 01-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 01-.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.4l-.3.1-1.3.8c.3.8.5 1.6.5 2.6h2.3a7.5 7.5 0 00-1.3-3.5zm-9 0l2 .2V5.5a9 9 0 00-2 2.2zm3.5-2.3V8c.6 0 1.3 0 1.9-.2a9 9 0 00-2-2.3zm-3-.7h-.1c-1.1.4-2.1 1-3 1.8l1.2.7a10 10 0 011.9-2.5zm4.4 0l.1.1a10 10 0 011.8 2.4l1.1-.7a7.5 7.5 0 00-3-1.8z"/></svg>',"line-height":'<svg width="24" height="24"><path d="M21 5a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zm0 4a1 1 0 01.1 2H13a1 1 0 01-.1-2H21zM7 3.6l3.7 3.7a1 1 0 01-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 011.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 011.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 01-1.3 0h-.1a1 1 0 010-1.3v-.1L7 3.6z"/></svg>',line:'<svg width="24" height="24"><path d="M15 9l-8 8H4v-3l8-8 3 3zm1-1l-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 011.4 1.4l-2.1 2a2 2 0 102.7 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2-2a2 2 0 10-2.6-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.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 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 26a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 6zM11 36a2 2 0 100-4 2 2 0 000 4zm0 1a3 3 0 110-6 3 3 0 010 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.8l-1.6 1v-1.1l1.6-1h1.2V17zM33.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.6L34.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 00-.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 00-.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 17l-.5-1.4h-2l-.5 1.4H35l2-6h1.6l2 6h-1.3zm-1.6-4.7l-.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 17l-.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 01-.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 00-.3-.7A1 1 0 0013 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7z" fill-rule="evenodd"/></svg>',ltr:'<svg width="24" height="24"><path d="M11 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 017.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L11 5zM4.4 16.2L6.2 15l-1.8-1.2a1 1 0 011.2-1.6l3 2a1 1 0 010 1.6l-3 2a1 1 0 11-1.2-1.6z" fill-rule="evenodd"/></svg>',"more-drawer":'<svg width="24" height="24"><path d="M6 10a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm12 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2zm-6 0a2 2 0 00-2 2c0 1.1.9 2 2 2a2 2 0 002-2 2 2 0 00-2-2z" fill-rule="nonzero"/></svg>',"new-document":'<svg width="24" height="24"><path d="M14.4 3H7a2 2 0 00-2 2v14c0 1.1.9 2 2 2h10a2 2 0 002-2V7.6L14.4 3zM17 19H7V5h6v4h4v10z" fill-rule="nonzero"/></svg>',"new-tab":'<svg width="24" height="24"><path d="M15 13l2-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 110-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 01-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="M17.8 9.8L15.4 4 20 8.5v7L15.5 20h-7L4 15.5v-7L8.5 4h7l2.3 5.8zm0 0l2.2 5.7-2.3-5.8zM13 17v-2h-2v2h2zm0-4V7h-2v6h2z" fill-rule="evenodd"/></svg>',"ordered-list-rtl":'<svg width="24" height="24"><path d="M6 17h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 010-2zm0-6h8a1 1 0 010 2H6a1 1 0 110-2zm13-1v3.5a.5.5 0 11-1 0V5h-.5a.5.5 0 110-1H19zm-1 8.8l.2.2h1.3a.5.5 0 110 1h-1.6a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2h-1.3a.5.5 0 01-.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 010-1h1.2a.3.3 0 100-.6h-1.3a.4.4 0 110-.8h1.3a.3.3 0 000-.6h-1.2a.5.5 0 110-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 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 110-2zM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 01-.5-.5V5h-.5a.5.5 0 010-1H6zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 01-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 00-.2-.2H4.5a.5.5 0 01-.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 010-1h1.2c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.4a.4.4 0 110-.8h1.3c.2 0 .3-.1.3-.3 0-.2-.1-.3-.3-.3H4.5a.5.5 0 110-1H6c.6 0 1 .4 1 1z" fill-rule="evenodd"/></svg>',orientation:'<svg width="24" height="24"><path d="M7.3 6.4L1 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 010-1.2L13.6.2c.3-.3.9-.3 1.2 0 .3.3.3.8 0 1.1L12 4h1a9 9 0 11-4.3 16.9l1.5-1.5A7 7 0 1013 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 110-2zm5 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm0 4h7c.6 0 1 .4 1 1s-.4 1-1 1h-7a1 1 0 010-2zm-5 4h12a1 1 0 010 2H7a1 1 0 010-2zm1.6-3.8a1 1 0 01-1.2 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 011.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 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h1c.6 0 1 .4 1 1s-.4 1-1 1h-1a1 1 0 010-2zm4 0c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zM7 3v5h10V3c0-.6.4-1 1-1s1 .4 1 1v7H5V3c0-.6.4-1 1-1s1 .4 1 1zM6 22a1 1 0 01-1-1v-7h14v7c0 .6-.4 1-1 1a1 1 0 01-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 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L10 5z"/></svg>',"paste-column-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-column-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v2H4V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-after":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2H9.2A3 3 0 0112 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-row-before":'<svg width="24" height="24"><path fill-rule="evenodd" d="M12 1a3 3 0 012.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-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 0112 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 100 2 1 1 0 000-2z"/></svg>',"paste-text":'<svg width="24" height="24"><path d="M18 9V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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 01-1-1V5H6v13h3V9h9zM9 20H6a2 2 0 01-2-2V5c0-1.1.9-2 2-2h3.2A3 3 0 0112 1a3 3 0 012.8 2H18a2 2 0 012 2v4h1v12H9v-1zm1.5-9.5v9h9v-9h-9zM12 3a1 1 0 00-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.5L8 20H3v-3l3.5-3.5a2 2 0 010-3L14 3l1 1-7.3 7.3a1 1 0 000 1.4l3.6 3.6c.4.4 1 .4 1.4 0L20 9l1 1-7.6 7.6a2 2 0 01-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 01.1 2H13v6a1 1 0 01-2 .1V13H5a1 1 0 01-.1-2H11V5c0-.6.4-1 1-1z"/></svg>',preferences:'<svg width="24" height="24"><path d="M20.1 13.5l-1.9.2a5.8 5.8 0 01-.6 1.5l1.2 1.5c.4.4.3 1 0 1.4l-.7.7a1 1 0 01-1.4 0l-1.5-1.2a6.2 6.2 0 01-1.5.6l-.2 1.9c0 .5-.5.9-1 .9h-1a1 1 0 01-1-.9l-.2-1.9a5.8 5.8 0 01-1.5-.6l-1.5 1.2a1 1 0 01-1.4 0l-.7-.7a1 1 0 010-1.4l1.2-1.5a6.2 6.2 0 01-.6-1.5l-1.9-.2a1 1 0 01-.9-1v-1c0-.5.4-1 .9-1l1.9-.2a5.8 5.8 0 01.6-1.5L5.2 7.3a1 1 0 010-1.4l.7-.7a1 1 0 011.4 0l1.5 1.2a6.2 6.2 0 011.5-.6l.2-1.9c0-.5.5-.9 1-.9h1c.5 0 1 .4 1 .9l.2 1.9a5.8 5.8 0 011.5.6l1.5-1.2a1 1 0 011.4 0l.7.7c.3.4.4 1 0 1.4l-1.2 1.5a6.2 6.2 0 01.6 1.5l1.9.2c.5 0 .9.5.9 1v1c0 .5-.4 1-.9 1zM12 15a3 3 0 100-6 3 3 0 000 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 002.1-2.8 15.7 15.7 0 00-2.1-2.8c-2-2-4.2-3.2-6.7-3.2a9.3 9.3 0 00-6.7 3.2A16.2 16.2 0 003.2 12c0 .2.2.3.3.5zm-2.4-1l.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 012.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 01-2.8-3.7 1 1 0 010-1zm12-3.3a2 2 0 102.7 2.6 4 4 0 11-2.6-2.6z" fill-rule="nonzero"/></svg>',print:'<svg width="24" height="24"><path d="M18 8H6a3 3 0 00-3 3v6h2v3h14v-3h2v-6a3 3 0 00-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 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.8 1.3zm8 0h.9c.4 0 .7-.2.9-.6L19 13V8c0-.6-.4-1-1-1h-4a1 1 0 00-1 1v4c0 .6.4 1 1 1h2l-1.3 2.7a1 1 0 00.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 11-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 111.4-1.4l5 5a1 1 0 010 1.4l-5 5a1 1 0 01-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.1l-1.2-4.7v-.2a1 1 0 011-1l5 .4a1 1 0 11-.2 2l-2.2-.2a7.8 7.8 0 008.4.2 7.5 7.5 0 003.5-6.4 1 1 0 112 0 9.5 9.5 0 01-4.5 8 9.9 9.9 0 01-10.2 0l.4 1.4a1 1 0 11-2 .5zM13.6 7.4c0-.5.5-1 1-.9l2.8.2a8 8 0 00-9.5-1 7.5 7.5 0 00-3.6 7 1 1 0 01-2 0 9.5 9.5 0 014.5-8.6 10 10 0 0110.9.3l-.3-1a1 1 0 012-.5l1.1 4.8a1 1 0 01-1 1.2l-5-.4a1 1 0 01-.9-1z"/></g></svg>',"remove-formatting":'<svg width="24" height="24"><path d="M13.2 6a1 1 0 010 .2l-2.6 10a1 1 0 01-1 .8h-.2a.8.8 0 01-.8-1l2.6-10H8a1 1 0 110-2h9a1 1 0 010 2h-3.8zM5 18h7a1 1 0 010 2H5a1 1 0 010-2zm13 1.5L16.5 18 15 19.5a.7.7 0 01-1-1l1.5-1.5-1.5-1.5a.7.7 0 011-1l1.5 1.5 1.5-1.5a.7.7 0 011 1L17.5 17l1.5 1.5a.7.7 0 01-1 1z" fill-rule="evenodd"/></svg>',remove:'<svg width="24" height="24"><path d="M16 7h3a1 1 0 010 2h-1v9a3 3 0 01-3 3H9a3 3 0 01-3-3V9H5a1 1 0 110-2h3V6a3 3 0 013-3h2a3 3 0 013 3v1zm-2 0V6c0-.6-.4-1-1-1h-2a1 1 0 00-1 1v1h4zm2 2H8v9c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9zm-7 3a1 1 0 012 0v4a1 1 0 01-2 0v-4zm4 0a1 1 0 012 0v4a1 1 0 01-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 119 2l-7 7A.5.5 0 111 8l7-7zM8.1 5.1A.5.5 0 119 6l-3 3A.5.5 0 115 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 01-.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 01-.7.3h-6a1 1 0 01-.7-.3 1 1 0 01-.3-.7c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3.6L6 7.4V11c0 .3-.1.5-.3.7a1 1 0 01-.7.3 1 1 0 01-.7-.3A1 1 0 014 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 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></g></svg>',"rotate-left":'<svg width="24" height="24"><path d="M4.7 10H9a1 1 0 010 2H3a1 1 0 01-1-1V5a1 1 0 112 0v3l2.5-2.4a9.2 9.2 0 0110.8-1.5A9 9 0 0113.4 21c-2.4.1-4.7-.7-6.5-2.2a1 1 0 111.3-1.5 7.2 7.2 0 0011.6-3.7 7 7 0 00-3.5-7.7A7.2 7.2 0 008 7L4.7 10z" fill-rule="nonzero"/></svg>',"rotate-right":'<svg width="24" height="24"><path d="M20 8V5a1 1 0 012 0v6c0 .6-.4 1-1 1h-6a1 1 0 010-2h4.3L16 7A7.2 7.2 0 007.7 6a7 7 0 003 13.1c1.9.1 3.7-.5 5-1.7a1 1 0 011.4 1.5A9.2 9.2 0 012.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 014.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.8-1.8L8 5zm12 11.2a1 1 0 11-1 1.6l-3-2a1 1 0 010-1.6l3-2a1 1 0 111 1.6L18.4 15l1.8 1.2z" fill-rule="evenodd"/></svg>',save:'<svg width="24" height="24"><path d="M5 16h14a2 2 0 012 2v2a2 2 0 01-2 2H5a2 2 0 01-2-2v-2c0-1.1.9-2 2-2zm0 2v2h14v-2H5zm10 0h2v2h-2v-2zm-4-6.4L8.7 9.3a1 1 0 10-1.4 1.4l4 4c.4.4 1 .4 1.4 0l4-4a1 1 0 10-1.4-1.4L13 11.6V4a1 1 0 00-2 0v7.6z" fill-rule="nonzero"/></svg>',search:'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12z" fill-rule="nonzero"/></svg>',"select-all":'<svg width="24" height="24"><path d="M3 5h2V3a2 2 0 00-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2a2 2 0 00-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8a2 2 0 002-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm3.6 10.9L7 12.3a.7.7 0 00-1 1L9.6 17 18 8.6a.7.7 0 000-1 .7.7 0 00-1 0l-7.4 7.3z"/></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 01-.2-.6V8H5a1 1 0 110-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 01-.2-.6V13H5a1 1 0 010-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 01-.2-.6V18H5a1 1 0 010-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 6l4 4-8 9-8-9 4-4h8zm-4 10.2l5.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 010-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 00-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 01-.7-.3 1 1 0 01-.3-.7V5c0-.3.1-.5.3-.7.2-.2.4-.3.7-.3h3v1zm-5 1.5l-.1.7c-.1.2-.3.3-.6.3.3 0 .5.1.6.3l.1.7V10c0 .3-.1.5-.3.7a1 1 0 01-.7.3h-3V4h3c.3 0 .5.1.7.3.2.2.3.4.3.7v1.5zM13 10V8h-2v2h2zm0-3V5h-2v2h2zm3 5l1 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 017 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 010 2H5a1 1 0 010-2z" fill-rule="nonzero"/></g></svg>',subscript:'<svg width="24" height="24"><path d="M10.4 10l4.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 00-.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 01-1.3 1.3l-.6.6h2.6V19z" fill-rule="nonzero"/></svg>',superscript:'<svg width="24" height="24"><path d="M15 9.4L10.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 012 2v8a2 2 0 01-2 2H5a2 2 0 01-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 012 2v7h-8v-2h6V6h-6V4z" opacity=".2"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v7h-8v7H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-8 9H5v5h6v-5zm8-7h-6v5h6V6zm-8 0H5v5h6V6z"/><path d="M18 20l-2.6 1.6.7-3-2.4-2 3.1-.2 1.2-2.9 1.2 2.9 3 .2-2.3 2 .7 3z"/></g></svg>',"table-delete-column":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8l1.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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="M14.4 8.6l1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-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 01-2 0V6h-8v12h8v-1a1 1 0 012 0v2c0 .5-.4 1-.9 1H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H17v2a1 1 0 01-2 .1V13h-2a1 1 0 01-.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 012 2v12a2 2 0 01-2 2H4a1 1 0 01-1-1v-2a1 1 0 012 0v1h8V6H5v1a1 1 0 11-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 01.1 2H9v2a1 1 0 01-2 .1V13H5a1 1 0 01-.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 110 2H5v6h14V6h-1a1 1 0 010-2h2c.6 0 1 .4 1 1v13a2 2 0 01-2 2H5a2 2 0 01-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 010 2h-2v2a1 1 0 01-2 .1V8H9a1 1 0 010-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 01.1 2H13v2a1 1 0 01-2 .1V18H9a1 1 0 01-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 010-2h1v-6H5v6h1a1 1 0 010 2H4a1 1 0 01-1-1V6c0-1.1.9-2 2-2h14a2 2 0 012 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',"table-left-header":'<svg width="24" height="24"><path d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 00-2 2v13c0 1.1.9 2 2 2h12a2 2 0 002-2V6a2 2 0 00-2-2H6zm0 12h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 11h8v3H6v-3zm11 0c.6 0 1 .4 1 1v1a1 1 0 01-2 0v-1c0-.6.4-1 1-1zM6 6h8v3H6V6zm11 0c.6 0 1 .4 1 1v1a1 1 0 11-2 0V7c0-.6.4-1 1-1z"/></svg>',"table-row-numbering":'<svg width="24" height="24"><path d="M18 4a2 2 0 012 2v13a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2h12zm0 12h-8v3h8v-3zM7 16a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8v-3zM7 11a1 1 0 00-1 1v1a1 1 0 002 0v-1c0-.6-.4-1-1-1zm11-5h-8v3h8V6zM7 6a1 1 0 00-1 1v1a1 1 0 102 0V7c0-.6-.4-1-1-1z"/></svg>',"table-row-properties":'<svg width="24" height="24"><path fill-rule="nonzero" d="M19 4a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1l1 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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-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 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6c0-1.1.9-2 2-2h14zM5 14v4h6v-4H5zm14 0h-6v4h6v-4zm0-6h-6v4h6V8zM5 12h6V8H5v4z"/></svg>',template:'<svg width="24" height="24"><path d="M19 19v-1H5v1h14zM9 16v-4a5 5 0 116 0v4h4a2 2 0 012 2v3H3v-3c0-1.1.9-2 2-2h4zm4 0v-5l.8-.6a3 3 0 10-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 111 0V6H15v1.6a8 8 0 11-6 0zm-2.6 5.3a.5.5 0 00.3.6c.3 0 .6 0 .6-.3l.1-.2a5 5 0 013.3-2.8c.3-.1.4-.4.4-.6-.1-.3-.4-.5-.6-.4a6 6 0 00-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 id="tox-icon-text-color__color" d="M3 18h18v3H3z"/><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.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.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"/></g></svg>',toc:'<svg width="24" height="24"><path d="M5 5c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 110-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h11c.6 0 1 .4 1 1s-.4 1-1 1H8a1 1 0 010-2zm0-4c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 110-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm-3 8c.6 0 1 .4 1 1s-.4 1-1 1a1 1 0 010-2zm3 0h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2z" fill-rule="evenodd"/></svg>',translate:'<svg width="24" height="24"><path d="M12.7 14.3l-.3.7-.4.7-2.2-2.2-3.1 3c-.3.4-.8.4-1 0a.7.7 0 010-1l3.1-3A12.4 12.4 0 016.7 9H8a10.1 10.1 0 001.7 2.4c.5-.5 1-1.1 1.4-1.8l.9-2H4.7a.7.7 0 110-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 01-1 2.4 13.5 13.5 0 01-1.7 2.3l1.9 1.8zm4.3-3l2.7 7.3a.5.5 0 01-.4.7 1 1 0 01-1-.7l-.6-1.5h-3.4l-.6 1.5a1 1 0 01-1 .7.5.5 0 01-.4-.7l2.7-7.4a1 1 0 012 0zm-2.2 4.4h2.4L16 12.5l-1.2 3.2z" fill-rule="evenodd"/></svg>',underline:'<svg width="24" height="24"><path d="M16 5c.6 0 1 .4 1 1v5.5a4 4 0 01-.4 1.8l-1 1.4a5.3 5.3 0 01-5.5 1 5 5 0 01-1.6-1c-.5-.4-.8-.9-1.1-1.4a4 4 0 01-.4-1.8V6c0-.6.4-1 1-1s1 .4 1 1v5.5c0 .3 0 .6.2 1l.6.7a3.3 3.3 0 002.2.8 3.4 3.4 0 002.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 010-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 01-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 11-1.4 1.4l-5-5a1 1 0 010-1.4l5-5a1 1 0 011.4 1.4L6.4 8z" fill-rule="nonzero"/></svg>',unlink:'<svg width="24" height="24"><path d="M6.2 12.3a1 1 0 011.4 1.4l-2 2a2 2 0 102.6 2.8l4.8-4.8a1 1 0 000-1.4 1 1 0 111.4-1.3 2.9 2.9 0 010 4L9.6 20a3.9 3.9 0 01-5.5-5.5l2-2zm11.6-.6a1 1 0 01-1.4-1.4l2.1-2a2 2 0 10-2.7-2.8L11 10.3a1 1 0 000 1.4A1 1 0 119.6 13a2.9 2.9 0 010-4L14.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 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 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.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 01-.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 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-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 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-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 012 0v3c0 .6-.4 1-1 1H5a1 1 0 01-1-1v-3a1 1 0 012 0v2h12zM11 6.4L8.7 8.7a1 1 0 01-1.4-1.4l4-4a1 1 0 011.4 0l4 4a1 1 0 11-1.4 1.4L13 6.4V16a1 1 0 01-2 0V6.4z" fill-rule="nonzero"/></svg>',user:'<svg width="24" height="24"><path d="M12 24a12 12 0 110-24 12 12 0 010 24zm-8.7-5.3a11 11 0 0017.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 011.2 1.5l-.1.1-4.1 3-4-3a1 1 0 011-1.7l2 1.5V3c0-.6.4-1 1-1zm0 11.8l4 2.9a1 1 0 01-1 1.7l-2-1.5V21c0 .5-.4 1-.9 1H12a1 1 0 01-1-1v-4l-2 1.3a1 1 0 01-1.2-.1l-.1-.1a1 1 0 01.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 01-2-2h2zm8 0v2h-2v-2h2zm8 0a2 2 0 01-2 2v-2h2zm-4 0v2h-2v-2h2zM15 7a1 1 0 010 2v7a1 1 0 01-2 0V9h-1v7a1 1 0 01-2 0v-4a2.5 2.5 0 01-.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 012 2h-2V3zM9 3v2H7V3h2zm8 0v2h-2V3h2z" fill-rule="evenodd"/></svg>',visualchars:'<svg width="24" height="24"><path d="M10 5h7a1 1 0 010 2h-1v11a1 1 0 01-2 0V7h-2v11a1 1 0 01-2 0v-6c-.5 0-1 0-1.4-.3A3.4 3.4 0 016.8 10a3.3 3.3 0 010-2.8 3.4 3.4 0 011.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 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7c0 .3.1.5.3.7.2.2.4.3.7.3zm.7-3l.3-4a1 1 0 00-.3-.7 1 1 0 00-.7-.3 1 1 0 00-.7.3 1 1 0 00-.3.7l.3 4h1.4z" fill-rule="evenodd"/></svg>',"zoom-in":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-1-9a1 1 0 012 0v6a1 1 0 01-2 0V8zm-2 4a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>',"zoom-out":'<svg width="24" height="24"><path d="M16 17.3a8 8 0 111.4-1.4l4.3 4.4a1 1 0 01-1.4 1.4l-4.4-4.3zm-5-.3a6 6 0 100-12 6 6 0 000 12zm-3-5a1 1 0 010-2h6a1 1 0 010 2H8z" fill-rule="nonzero"/></svg>'}});
|