vendor: 5,200 bytes, lines 1-2
1/*! For license information please see vendor-e073c216.8441e3cefb48ad76b446.js.LICENSE.txt */ 2(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[4465],{95581(){var t=["class","style"],n=["events"],e=["attributes"],o=["primary"],r=["primary"];function i(){"use strict";var t=f(),n=t.m(i),e=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function o(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===e||"GeneratorFunction"===(n.displayName||n.name))}var r={throw:1,return:2,break:3,continue:3};function d(t){var n,e;return function(o){n||(n={stop:function(){return e(o.a,2)},catch:function(){return o.v},abrupt:function(t,n){return e(o.a,r[t],n)},delegateYield:function(t,r,i){return n.resultName=r,e(o.d,u(t),i)},finish:function(t){return e(o.f,t)}},e=function(t,e,r){o.p=n.prev,o.n=n.next;try{return t(e,r)}finally{n.next=o.n}}),n.resultName&&(n[n.resultName]=o.v,n.resultName=void 0),n.sent=o.v,n.next=o.n;try{return t.call(this,n)}finally{o.p=n.prev,o.n=n.next}}}return(i=function(){return{wrap:function(n,e,o,r){return t.w(d(n),e,o,r&&r.reverse())},isGeneratorFunction:o,mark:t.m,awrap:function(t,n){return new m(t,n)},AsyncIterator:l,async:function(t,n,e,r,i){return(o(n)?s:c)(d(t),n,e,r,i)},keys:a,values:u}})()}function u(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],e=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}throw new TypeError(M(t)+" is not iterable")}function a(t){var n=Object(t),e=[];for(var o in n)e.unshift(o);return function t(){for(;e.length;)if((o=e.pop())in n)return t.value=o,t.done=!1,t;return t.done=!0,t}}function c(t,n,e,o,r){var i=s(t,n,e,o,r);return i.next().then(function(t){return t.done?t.value:i.next()})}function s(t,n,e,o,r){return new l(f().w(t,n,e,o),r||Promise)}function l(t,n){function e(o,r,i,u){try{var a=t[o](r),c=a.value;return c instanceof m?n.resolve(c.v).then(function(t){e("next",t,i,u)},function(t){e("throw",t,i,u)}):n.resolve(c).then(function(t){a.value=t,i(a)},function(t){return e("throw",t,i,u)})}catch(t){u(t)}}var o;this.next||(d(l.prototype),d(l.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),d(this,"_invoke",function(t,r,i){function u(){return new n(function(n,o){e(t,i,n,o)})}return o=o?o.then(u,u):u()},!0)}function f(){var t,n,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function i(e,o,r,i){var c=o&&o.prototype instanceof a?o:a,s=Object.create(c.prototype);return d(s,"_invoke",function(e,o,r){var i,a,c,s=0,l=r||[],f=!1,d={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(n,e){return i=n,a=0,c=t,d.n=e,u}};function m(e,o){for(a=e,c=o,n=0;!f&&s&&!r&&n<l.length;n++){var r,i=l[n],m=d.p,g=i[2];e>3?(r=g===o)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=m&&((r=e<2&&m<i[1])?(a=0,d.v=o,d.n=i[1]):m<g&&(r=e<3||i[0]>o||o>g)&&(i[4]=e,i[5]=o,d.n=g,a=0))}if(r||e>1)return u;throw f=!0,o}return function(r,l,g){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&m(l,g),a=l,c=g;(n=a<2?t:c)||!f;){i||(a?a<3?(a>1&&(d.n=-1),m(a,c)):d.n=c:d.v=c);try{if(s=2,i){if(a||(r="next"),n=i[r]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),a=1);i=t}else if((n=(f=d.n<0)?c:e.call(o,d))!==u)break}catch(n){i=t,a=1,c=n}finally{s=1}}return{value:n,done:f}}}(e,r,i),!0),s}var u={};function a(){}function c(){}function s(){}n=Object.getPrototypeOf;var l=[][o]?n(n([][o]())):(d(n={},o,function(){return this}),n),m=s.prototype=a.prototype=Object.create(l);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,d(t,r,"GeneratorFunction")),t.prototype=Object.create(m),t}return c.prototype=s,d(m,"constructor",s),d(s,"constructor",c),c.displayName="GeneratorFunction",d(s,r,"GeneratorFunction"),d(m),d(m,r,"Generator"),d(m,o,function(){return this}),d(m,"toString",function(){return"[object Generator]"}),(f=function(){return{w:i,m:g}})()}function d(t,n,e,o){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}d=function(t,n,e,o){function i(n,e){d(t,n,function(t){return this._invoke(n,e,t)})}n?r?r(t,n,{value:e,enumerable:!o,configurable:!o,writable:!o}):t[n]=e:(i("next",0),i("throw",1),i("return",2))},d(t,n,e,o)}function m(t,n){this.v=t,this.k=n}function g(t,n,e,o,r,i,u){try{var a=t[i](u),c=a.value}catch(t){return void e(t)}a.done?n(c):Promise.resolve(c).then(o,r)}function p(t){return function(){var n=this,e=arguments;return new Promise(function(o,r){var i=t.apply(n,e);function u(t){g(i,o,r,u,a,"next",t)}function a(t){g(i,o,r,u,a,"throw",t)}u(void 0)})}}function h(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var o,r,i,u,a=[],c=!0,s=!1;try{if(i=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;c=!1}else for(;!(c=(o=i.call(e)).done)&&(a.push(o.value),a.length!==n);c=!0);}catch(t){s=!0,r=t}
vendor: 2,944 bytes, line 2
2finally{try{if(!c&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(s)throw r}}return a}}(t,n)||C(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,n,e){if(y())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,n);var r=new(t.bind.apply(t,o));return e&&b(r,e.prototype),r}function b(t,n){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},b(t,n)}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function x(t,n){if(null==t)return{};var e,o,r=function(t,n){if(null==t)return{};var e={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==n.indexOf(o))continue;e[o]=t[o]}return e}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)e=i[o],-1===n.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(r[e]=t[e])}return r}function w(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||C(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 S(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=C(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw i}}}}function C(t,n){if(t){if("string"==typeof t)return k(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?k(t,n):void 0}}function k(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,o=Array(n);e<n;e++)o[e]=t[e];return o}function O(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,o)}return e}function _(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?O(Object(e),!0).forEach(function(n){T(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):O(Object(e)).forEac
2h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function T(t,n,e){return(n=A(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function E(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,A(o.key),o)}}function A(t){var n=function(t,n){if("object"!=M(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!=M(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==M(n)?n:n+""}function M(t){return M="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},M(t)}!function(){"use strict";var u=Object.getPrototypeOf,a=function(t,n,e){var o;return!!e(t,n.prototype)||(null===(o=t.constructor)||void 0===o?void 0:o.name)===n.name},c=function(t){return function(n){return function(t){var n=M(t);return null===t?"null":"object"===n&&Array.isArray(t)?"array":"object"===n&&a(t,String,function(t,n){return n.isPrototypeOf(t)})?"string":n}(n)===t}},s=function(t){return function(n){return M(n)===t}},l=function(t){return function(n){return t===n}},f=c("string"),d=c("object"),m=function(t){return function(t,n){return d(t)&&a(t,n,function(t,n){return u(t)===n})}(t,Object)},g=c("array"),b=l(null),y=s("boolean"),C=l(void 0),k=function(t){return null==t},O=function(t){return!k(t)},A=s("function"),D=s("number"),B=function(t,n){if(g(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return!1;return!0}return!1},I=function(){},F=function(t){return function(){return t()}},R=function(t,n){return function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return t(n.apply(null,o))}},N=function(t){return function(){return t}},L=function(t){return t},z=function(t,n){return t===n};function P(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];return function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];var i=e.concat(o);return t.apply(null,i)}}var V=function(t){return function(n){return!t(n)}},H=function(t){return function(){throw new Error(t)}},U=function(t){return t()},W=N(!1),j=N(!0),G=function(){function t(n,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.tag=n,this.value=e}return function(t,n,e){return n&&E(t.prototype,n),e&&E(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"fold",value:function(t,n){return this.tag?n(this.value):t()}},{key:"isSome",value:function(){return this.tag}},{key:"isNone",value:function(){return!this.tag}},{key:"map",value:function(n){return this.tag?t.some(n(this.value)):t.none()}},{key:"bind",value:function(n){return this.tag?n(this.value):t.none()}},{key:"exists",value:function(t){return this.tag&&t(this.value)}},{key:"forall",value:function(t){return!this.tag||t(this.value)}},{key:"filter",value:function(n){return!this.tag||n(this.value)?this:t.none()}},{key:"getOr",value:function(t){return this.tag?this.value:t}},{key:"or",value:function(t){return this.tag?this:t}},{key:"getOrThunk",value:function(t){return this.tag?this.value:t()}},{key:"orThunk",value:function(t){return this.tag?this:t()}},{key:"getOrDie",value:function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}},{key:"getOrNull",value:function(){return this.tag?this.value:null}},{key:"getOrUndefined",value:function(){return this.value}},{key:"each",value:function(t){this.tag&&t(this.value)}},{key:"toArray",value:function(){return this.tag?[this.value]:[]}},{key:"toString",value:function(){return this.tag?"some(".concat(this.value,")"):"none()"}}],[{key:"some",value:function(n){return new t(!0,n)}},{key:"none",value:function(){return t.singletonNone}},{key:"from",value:function(n){return O(n)?t.some(n):t.none()}}])}();G.singletonNone=new G(!1);
2var q,Y,X=Array.prototype.slice,K=Array.prototype.indexOf,J=Array.prototype.push,$=function(t,n){return K.call(t,n)},Q=function(t,n){return $(t,n)>-1},Z=function(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return!0;return!1},tt=function(t,n){for(var e=[],o=0;o<t;o++)e.push(n(o));return e},nt=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=X.call(t,o,o+n);e.push(r)}return e},et=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o},ot=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e)},rt=function(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r)?e:o).push(u)}return{pass:e,fail:o}},it=function(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o)&&e.push(i)}return e},ut=function(t,n,e){return function(t,n){for(var e=t.length-1;e>=0;e--)n(t[e],e)}(t,function(t,o){e=n(e,t,o)}),e},at=function(t,n,e){return ot(t,function(t,o){e=n(e,t,o)}),e},ct=function(t,n){return function(t,n,e){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(n(i,o))return G.some(i);if(e(i,o))break}return G.none()}(t,n,W)},st=function(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return G.some(e);return G.none()},lt=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!g(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);J.apply(n,t[e])}return n},ft=function(t,n){return lt(et(t,n))},dt=function(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e))return!1;return!0},mt=function(t){var n=X.call(t,0);return n.reverse(),n},gt=function(t,n){return it(t,function(t){return!Q(n,t)})},pt=function(t,n){for(var e={},o=0,r=t.length;o<r;o++){var i=t[o];e[String(i)]=n(i,o)}return e},ht=function(t){return[t]},vt=function(t,n){var e=X.call(t,0);return e.sort(n),e},bt=function(t,n){return n>=0&&n<t.length?G.some(t[n]):G.none()},yt=function(t){return bt(t,0)},xt=function(t){return bt(t,t.length-1)},wt=A(Array.from)?Array.from:function(t){return X.call(t)},St=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return G.none()},Ct=Object.keys,kt=Object.hasOwnProperty,Ot=function(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}},_t=function(t,n){return Tt(t,function(t,e){return{k:e,v:n(t,e)}})},Tt=function(t,n){var e={};return Ot(t,function(t,o){var r=n(t,o);e[r.k]=r.v}),e},Et=function(t){return function(n,e){t[e]=n}},At=function(t,n,e,o){Ot(t,function(t,r){(n(t,r)?e:o)(t,r)})},Mt=function(t,n){var e={};return At(t,n,Et(e),I),e},Dt=function(t,n){var e=[];return Ot(t,function(t,o){e.push(n(t,o))}),e},Bt=function(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return G.some(u)}return G.none()},It=function(t){return Dt(t,L)},Ft=function(t,n){return Rt(t,n)?G.from(t[n]):G.none()},Rt=function(t,n){return kt.call(t,n)},Nt=function(t,n){return Rt(t,n)&&void 0!==t[n]&&null!==t[n]},Lt=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z;return t.exists(function(t){return e(t,n)})},zt=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},Pt=function(t,n,e){return t.isSome()&&n.isSome()?G.some(e(t.getOrDie(),n.getOrDie())):G.none()},Vt=function(t,n){return null!=t?G.some(n(t)):G.none()},Ht=function(t,n){return t?G.some(n):G.none()},Ut=function(t,n,e){return""===n||t.length>=n.length&&t.substr(e,e+n.length)===n},Wt=function(t,n){return Gt(t,n)?function(t,n){return t.substring(n)}(t,n.length):t},jt=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,r=t.indexOf(n,e);return-1!==r&&(!!C(o)||r+n.length<=o)},Gt=function(t,n){return Ut(t,n,0)},qt=function(t,n){return Ut(t,n,t.length-n.length)},Yt=(q=/^\s+|\s+$/g,function(t){return t.replace(q,"")}),Xt=function(t){return t.length>0},Kt=function(t){return!Xt(t)},Jt=function(t){return void 0!==t.style&&A(t.style.getPropertyValue)},$t=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},Qt=function(t,n){var e=(n||document).createElement(t);return $t(e)},Zt=function(t,n){var e=(n||document).createTextNode(t);return $t(e)},tn=$t,nn="undefined"!=typeof window?window:Function("return this;")(),en=function(t,n){return function(t,n){for(var e=null!=n?n:nn,o=0;o<t.length&&null!=e;++o)e=e[t[o]];return e}(t.split("."),n)},on=Object.getPrototypeOf,rn=function(t){return t.dom.nodeName.toLowerCase()},un=function(t){return function(n){return function(t){return t.dom.nodeType}(n)===t}},an=function(t){return cn(t)&&function(t){var n=en("ownerDocument.defaultView",t);return d(t)&&(function(t){return function(t,n){var e=function(t,n){return en(t,n)}(t,n);if(null==e)throw new Error(t+" not available on this browser");return e}("HTMLElement",t)}(n).prototype.isPrototypeOf(t)||/^HTML\w*Element$/.test(on(t).constructor.name))}(t.dom)},cn=un(1),sn=un(3),ln=un(9),fn=un(11),dn=function(t){return function(n){return cn(n)&&rn(n)===t}},mn=function(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var o=e;if(void 0!==o.matches)return o.matches(n);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(n);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(n);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},gn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},pn=function(t,n){var e=void 0===n?document:n.dom;return gn(e)?G.none():G.from(e.querySelector(t)).map(tn)},hn=function(t,n){return t.dom===n.dom},vn=function(t,n){var e=t.dom,o=n.dom;return e!==o&&e.contains(o)},bn=function(t){return tn(t.dom.ownerDocument)},yn=function(t){return ln(t)?t:bn(t)},xn=function(t){return tn(yn(t).dom.documentElement)},wn=function(t){return tn(yn(t).dom.defaultView)},Sn=function(t){return G.from(t.dom.parentNode).map(tn)},Cn=function(t){return G.from(t.dom.parentElement).map(tn)},kn=function(t){return G.from(t.dom.offsetParent).map(tn)},On=function(t){return et(t.dom.childNodes,tn)},_n=function(t,n){var e=t.dom.childNodes;return G.from(e[n]).map(tn)},Tn=function(t){return _n(t,0)},En=function(t,n){return{element:t,offset:n}},An=function(t,n){var e=On(t);return e.length>0&&n<e.length?En(e[n],0):En(t,n)},Mn=function(t){return fn(t)&&O(t.dom.host)},Dn=function(t){return tn(t.dom.getRootNode())},Bn=function(t){return Mn(t)?t:tn(yn(t).dom.body)},In=function(t){var n=Dn(t);
2return Mn(n)?G.some(n):G.none()},Fn=function(t){return tn(t.dom.host)},Rn=function(t){var n=sn(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return In(tn(n)).fold(function(){return r.body.contains(n)},(e=Rn,o=Fn,function(t){return e(o(t))}))},Nn=function(){return Ln(tn(document))},Ln=function(t){var n=t.dom.body;if(null==n)throw new Error("Body is not available yet");return tn(n)},zn=function(t,n,e){if(!(f(e)||y(e)||D(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},Pn=function(t,n,e){zn(t.dom,n,e)},Vn=function(t,n){var e=t.dom;Ot(n,function(t,n){zn(e,n,t)})},Hn=function(t,n){var e=t.dom.getAttribute(n);return null===e?void 0:e},Un=function(t,n){return G.from(Hn(t,n))},Wn=function(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},jn=function(t,n){t.dom.removeAttribute(n)},Gn=function(t,n,e){if(!f(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Jt(t)&&t.style.setProperty(n,e)},qn=function(t,n){Jt(t)&&t.style.removeProperty(n)},Yn=function(t,n,e){var o=t.dom;Gn(o,n,e)},Xn=function(t,n){var e=t.dom;Ot(n,function(t,n){Gn(e,n,t)})},Kn=function(t,n){var e=t.dom;Ot(n,function(t,n){t.fold(function(){qn(e,n)},function(t){Gn(e,n,t)})})},Jn=function(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||Rn(t)?o:$n(e,n)},$n=function(t,n){return Jt(t)?t.style.getPropertyValue(n):""}
2,Qn=function(t,n){var e=t.dom,o=$n(e,n);return G.from(o).filter(function(t){return t.length>0})},Zn=function(t){var n={},e=t.dom;if(Jt(e))for(var o=0;o<e.style.length;o++){var r=e.style.item(o);n[r]=e.style[r]}return n},te=function(t,n,e){var o=Qt(t);return Yn(o,n,e),Qn(o,n).isSome()},ne=function(t,n){var e=t.dom;qn(e,n),Lt(Un(t,"style").map(Yt),"")&&jn(t,"style")},ee=function(t){return t.dom.offsetWidth},oe=function(t,n){var e=function(e){var o=n(e);if(o<=0||null===o){var r=Jn(e,t);return parseFloat(r)||0}return o},o=function(t,n){return at(n,function(n,e){var o=Jn(t,e),r=void 0===o?0:parseInt(o,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!D(e)&&!e.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+e);var o=n.dom;Jt(o)&&(o.style[t]=e+"px")},get:e,getOuter:e,aggregate:o,max:function(t,n,e){var r=o(t,e);return n>r?n-r:0}}},re=oe("height",function(t){var n=t.dom;return Rn(t)?n.getBoundingClientRect().height:n.offsetHeight}),ie=function(t){return re.get(t)},ue=function(t){return re.getOuter(t)},ae=function(t,n){return{left:t,top:n,translate:function(e,o){return ae(t+e,n+o)}}},ce=ae,se=function(t,n){return void 0!==t?t:void 0!==n?n:0},le=function(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return ce(e.offsetLeft,e.offsetTop);var i=se(null==o?void 0:o.pageYOffset,r.scrollTop),u=se(null==o?void 0:o.pageXOffset,r.scrollLeft),a=se(r.clientTop,e.clientTop),c=se(r.clientLeft,e.clientLeft);return fe(t).translate(u-c,i-a)},fe=function(t){var n=t.dom,e=n.ownerDocument.body;return e===n?ce(e.offsetLeft,e.offsetTop):Rn(t)?function(t){var n=t.getBoundingClientRect();return ce(n.left,n.top)}(n):ce(0,0)},de=oe("width",function(t){return t.dom.offsetWidth}),me=function(t){return de.get(t)},ge=function(t){return de.getOuter(t)},pe=function(t){var n,e=!1;return function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];return e||(e=!0,n=t.apply(null,r)),n}},he=function(){return ve(0,0)},ve=function(t,n){return{major:t,minor:n}},be={nu:ve,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?he():function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return ve(o(1),o(2))}(t,e)},unknown:he},ye=function(t,n){var e=String(n).toLowerCase();return ct(t,function(t){return t.search(e)})},xe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,we=function(t){return function(n){return jt(n,t)}},Se=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return jt(t,"edge/")&&jt(t,"chrome")&&jt(t,"safari")&&jt(t,"applewebkit")}},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,xe],search:function(t){return jt(t,"chrome")&&!jt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return jt(t,"msie")||jt(t,"trident")}},{name:"Opera",versionRegexes:[xe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:we("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:we("firefox")},{name:"Safari",versionRegexes:[xe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(jt(t,"safari")||jt(t,"mobile/"))&&jt(t,"applewebkit")}}],Ce=[{name:"Windows",search:we("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return jt(t,"iphone")||jt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:we("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:we("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:we("linux"),versionRegexes:[]},{name:"Solaris",search:we("sunos"),versionRegexes:[]},{name:"FreeBSD",search:we("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:we("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],ke={browsers:N(Se),oses:N(Ce)},Oe="Edge",_e="Chromium",Te="Opera",Ee="Firefox",Ae="Safari",Me=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isEdge:o(Oe),isChromium:o(_e),isIE:o("IE"),isOpera:o(Te),isFirefox:o(Ee),isSafari:o(Ae)}},De=function(){return Me({current:void 0,version:be.unknown()})},Be=Me,Ie=(N(Oe),N(_e),N("IE"),N(Te),N(Ee),N(Ae),"Windows"),Fe="Android",Re="Linux",Ne="macOS",Le="Solaris",ze="FreeBSD",Pe="ChromeOS",Ve=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isWindows:o(Ie),isiOS:o("iOS"),isAndroid:o(Fe),isMacOS:o(Ne),isLinux:o(Re),isSolaris:o(Le),isFreeBSD:o(ze),isChromeOS:o(Pe)}},He=function(){return Ve({current:void 0,version:be.unknown()})},Ue=Ve,We=(N(Ie),N("iOS"),N(Fe),N(Re),N(Ne),N(Le),N(ze),N(Pe),function(t){return window.matchMedia(t).matches}),je=pe(function(){return function(t,n,e){var o=ke.browsers(),r=ke.oses(),i=n.bind(function(t){return function(t,n){return St(n.brands,function(n){var e=n.brand.toLowerCase();return ct(t,function(t){var n;return e===(null===(n=t.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(t){return{current:t.name,version:be.nu(parseInt(n.version,10),0)}})})}(o,t)}).orThunk(function(){return function(t,n){return ye(t,n).map(function(t){var e=be.detect(t.versionRegexes,n);return{current:t.name,version:e}})}(o,t)}).fold(De,Be),u=function(t,n){return ye(t,n).map(function(t){var e=be.detect(t.versionRegexes,n);return{current:t.name,version:e}})}(r,t).fold(He,Ue),a=function(t,n,e,o){var r=t.isiOS()&&!0===/ipad/i.test(e),i=t.isiOS()&&!r,u=t.isiOS()||t.isAndroid(),a=u||o("(pointer:coarse)"),c=r||!i&&u&&o("(min-device-width:768px)"),s=i||u&&!c,l=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(e),f=!s&&!c&&!l;return{isiPad:N(r),isiPhone:N(i),isTablet:N(c),isPhone:N(s),isTouch:N(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:N(l),isDesktop:N(f)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}}(window.navigator.userAgent,G.from(window.navigator.userAgentData),We)}),Ge=function(){return je()},qe=function(t){var n=tn(function(t){if(O(t.target)){var n=tn(t.target);if(cn(n)&&function(t){return O(t.dom.shadowRoot)}(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return yt(e)}}return G.from(t.target)}(t).getOr(t.target)),e=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},r=R(o,e);return function(t,n,e,o,r,i,u){return{target:t,x:n,y:e,stop:o,prevent:r,kill:i,raw:u}}(n,t.clientX,t.clientY,e,o,r,t)},Ye=function(t,n,e,o,r){var i=function(t,n){return function(e){t(e)&&n(qe(e))}}(e,o);return t.dom.addEventListener(n,i,r),{unbind:P(Xe,t,n,i,r)}},Xe=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},Ke=function(t,n){Sn(t).each(function(e){e.dom.insertBefore(n.dom,t.dom)})},Je=function(t,n){var e=function(t){return G.from(t.dom.nextSibling).map(tn)}(t);e.fold(function(){Sn(t).each(function(t){Qe(t,n)})},function(t){Ke(t,n)})},$e=function(t,n){Tn(t).fold(function(){Qe(t,n)},function(e){t.dom.insertBefore(n.dom,e.dom)}
2)},Qe=function(t,n){t.dom.appendChild(n.dom)},Ze=function(t,n){ot(n,function(n){Qe(t,n)})},to=function(t){t.dom.textContent="",ot(On(t),function(t){no(t)})},no=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},eo=function(t){var n=void 0!==t?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return ce(e,o)},oo=function(t,n,e){var o=(void 0!==e?e.dom:document).defaultView;o&&o.scrollTo(t,n)},ro=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},io=function(t){var n=void 0===t?window:t,e=n.document,o=eo(tn(e));return function(t){var n=void 0===t?window:t;return Ge().browser.isFirefox()?G.none():G.from(n.visualViewport)}(n).fold(function(){var t=n.document.documentElement,e=t.clientWidth,r=t.clientHeight;return ro(o.left,o.top,e,r)},function(t){return ro(Math.max(t.pageLeft,o.left),Math.max(t.pageTop,o.top),t.width,t.height)})},uo=function(){return tn(document)},ao=function(t,n){return t.view(n).fold(N([]),function(n){var e=t.owner(n),o=ao(t,e);return[n].concat(o)})},co=Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?G.none():G.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(tn)},owner:function(t){return bn(t)}}),so=function(t){var n=uo(),e=eo(n),o=function(t,n){var e=n.owner(t),o=ao(n,e);return G.some(o)}(t,co);return o.fold(P(le,t),function(n){var o=fe(t),r=ut(n,function(t,n){var e=fe(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return ce(r.left+o.left+e.left,r.top+o.top+e.top)})},lo=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},fo=function(t){var n=le(t),e=ge(t),o=ue(t);return lo(n.left,n.top,e,o)},mo=function(t){var n=so(t),e=ge(t),o=ue(t);return lo(n.left,n.top,e,o)},go=function(t,n){var e=Math.max(t.x,n.x),o=Math.max(t.y,n.y),r=Math.min(t.right,n.right),i=Math.min(t.bottom,n.bottom);return lo(e,o,r-e,i-o)},po=function(){return io(window)},ho=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},vo=function(t){var n=ho(G.none()),e=function(){return n.get().each(t)};return{clear:function(){e(),n.set(G.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(t){e(),n.set(G.some(t))}}},bo=function(){return vo(function(t){return t.unbind()})},yo=function(){var t=vo(I);return _(_({},t),{},{on:function(n){return t.get().each(n)}})},xo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),wo=function(t){var n=function(n){return n(t)},e=N(t),o=function(){return r},r={tag:!0,inner:t,fold:function(n,e){return e(t)},isValue:j,isError:W,map:function(n){return Co.value(n(t))},mapError:o,bind:n,exists:n,forall:n,getOr:e,or:o,getOrThunk:e,orThunk:o,getOrDie:e,each:function(n){n(t)},toOptional:function(){return G.some(t)}};return r},So=function(t){var n=function(){return e},e={tag:!1,inner:t,fold:function(n,e){return n(t)},isValue:W,isError:j,map:n,mapError:function(n){return Co.error(n(t))},bind:n,exists:W,forall:j,getOr:L,or:L,getOrThunk:U,orThunk:U,getOrDie:H(String(t)),each:I,toOptional:G.none};return e},Co={value:wo,error:So,fromOption:function(t,n){return t.fold(function(){return So(n)},wo)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(Y||(Y={}));var ko=function(t,n,e){return t.stype===Y.Error?n(t.serror):e(t.svalue)},Oo=function(t){return{stype:Y.Value,svalue:t}},_o=function(t){return{stype:Y.Error,serror:t}},To=Oo,Eo=_o,Ao=ko,Mo=function(t,n,e,o){return{tag:"field",key:t,newKey:n,presence:e,prop:o}},Do=function(t,n,e){switch(t.tag){case"field":return n(t.key,t.newKey,t.presence,t.prop);case"custom":return e(t.newKey,t.instantiator)}},Bo=function(t){return function(){if(0===arguments.length)throw new Error("Can't merge zero objects");for(var n={},e=0;e<arguments.length;e++){var o=e<0||arguments.length<=e?void 0:arguments[e];for(var r in o)Rt(o,r)&&(n[r]=t(n[r],o[r]))}return n}},Io=Bo(function(t,n){return m(t)&&m(n)?Io(t,n):n}),Fo=Bo(function(t,n){return n}),Ro=function(t){return{tag:"defaultedThunk",process:t}},No=function(t){return Ro(N(t))},Lo=function(t){return{tag:"mergeWithThunk",process:t}},zo=function(t){var n,e=function(t){var n=[],e=[];return ot(t,function(t){ko(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}}(t);return e.errors.length>0?(n=e.errors,R(Eo,lt)(n)):To(e.values)},Po=function(t){return d(t)&&Ct(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Vo=function(t,n){return Eo([{path:t,getErrorInfo:n}])},Ho=function(t){return{extract:function(n,e){return function(t,n){return t.stype===Y.Error?n(t.serror):t}(t(e),function(t){return function(t,n){return Vo(t,N(n))}(n,t)})},toString:N("val")}},Uo=Ho(To),Wo=function(t,n,e,o){return o(Ft(t,n).getOrThunk(function(){return e(t)}))},jo=function(t,n,e,o,r){var i=function(t){return r.extract(n.concat([o]),t)},u=function(t){return t.fold(function(){return To(G.none())},function(t){return function(t,n){return t.stype===Y.Value?{stype:Y.Value,svalue:n(t.svalue)}:t}(r.extract(n.concat([o]),t),G.some)})};switch(t.tag){case"required":return function(t,n,e,o){return Ft(n,e).fold(function(){return function(t,n,e){return Vo(t,function(){return'Could not find valid *required* value for "'+n+'" in '+Po(e)})}(t,e,n)},o)}(n,e,o,i);case"defaultedThunk":return Wo(e,o,t.process,i);case"option":return function(t,n,e){return e(Ft(t,n))}(e,o,u);case"defaultedOptionThunk":return function(t,n,e,o){return o(Ft(t,n).map(function(n){return!0===n?e(t):n}))}(e,o,t.process,u);case"mergeWithThunk":return Wo(e,o,N({}),function(n){var o=Io(t.process(e),n);return i(o)})}},Go=function(t){return{extract:function(n,e){return t().extract(n,e)},toString:function(){return t().toString()}}},qo=function(t){var n=Yo(t),e=ut(t,function(t,n){return Do(n,function(n){return Io(t,T({},n,!0))},N(t))},{});return{extract:function(t,o){var r=y(o)?[]:function(t){return Ct(Mt(t,O))}(o),i=it(r,function(t){return!Nt(e,t)});return 0===i.length?n.extract(t,o):function(t,n){return Vo(t,function(){return"There are unsupported fields: ["+n.join(", ")+"] specified"})}(t,i)},toString:n.toString}},Yo=function(t){return{extract:function(n,e){return function(t,n,e){var o,r={},i=[],u=S(e);try{for(u.s();!(o=u.n()).done;){var a=o.value;Do(a,function(e,o,u,a){var c=jo(u,t,n,e,a);Ao(c,function(t){i.push.apply(i,w(t))},function(t){r[o]=t})},function(t,e){r[t]=e(n)})}}catch(t){u.e(t)}finally{u.f()}return i.length>0?Eo(i):To(r)}(n,e,t)},toString:function(){return"obj{\n"+et(t,function(t){return Do(t,function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},Xo=function(t){return{extract:function(n,e){var o=et(e,function(e,o){return t.extract(n.concat(["["+o+"]"]),e)});return zo(o)},toString:function(){return"array("+t.toString()+")"}}},Ko=function(t,n){var e=void 0!==n?n:L;return{extract:function(n,o){var r,i=[],u=S(t);try{for(u.s();!(r=u.n()).done;){var a=r.value.extract(n,o);if(a.stype===Y.Value)return{stype:Y.Value,svalue:e(a.svalue)};i.push(a)}}catch(t){u.e(t)}finally{u.f()}return zo(i)},toString:function(){return"oneOf("+et(t,function(t){return t.toString()}).join(", ")+")"}}},Jo=R(Xo,Yo),$o=N(Uo),Qo=function(t,n){return Ho(function(e){var o=M(e);return t(e)?To(e):Eo("Expected type: ".concat(n," but got: ").concat(o))})},Zo=Qo(D,"number"),tr=Qo(f,"string"),nr=Qo(y,"boolean"),er=Qo(A,"function"),or=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(n){return or(t[n])});default:return!1}},rr=Ho(function(t){return or(t)?To(t):Eo("Expected value to be acceptable for sending via postMessage")}),ir=function(t,n){return{extract:function(e,o){return Ft(o,t).fold(function(){return function(t,n){return Vo(t,function(){return'Choice schema did not contain choice key: "'+n+'"'})}(e,t)},function(t){return function(t,n,e,o){return Ft(e,o).fold(function(){return function(t,n,e){return Vo(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Po(n)})}(t,e,o)},function(e){return e.extract(t.concat(["branch: "+o]),n)})}(e,o,n,t)})},toString:function(){return"chooseOn("+t+"). Possible values: "+Ct(n)}}}
2,ur=function(t){return Ho(function(n){return t(n).fold(Eo,To)})},ar=function(t,n){return function(t,n){return{extract:function(e,o){var r=Ct(o),i=function(n,e){return Xo(Ho(t)).extract(n,e)}(e,r);return function(t,n){return t.stype===Y.Value?n(t.svalue):t}(i,function(t){var r=et(t,function(t){return Mo(t,t,{tag:"required",process:{}},n)});return Yo(r).extract(e,o)})},toString:function(){return"setOf("+n.toString()+")"}}}(function(n){return t(n).fold(_o,Oo)},n)},cr=function(t,n,e){return o=function(t,n,e){return function(t){return t.stype===Y.Error?{stype:Y.Error,serror:function(t){return{input:e,errors:t}}(t.serror)}:t}(n.extract([t],e))}(t,n,e),ko(o,Co.error,Co.value);var o},sr=function(t){return t.fold(function(t){throw new Error(fr(t))},L)},lr=function(t,n,e){return sr(cr(t,n,e))},fr=function(t){return"Errors: \n"+function(t){var n=t.length>10?t.slice(0,10).concat([{path:[],getErrorInfo:N("... (only showing first ten failures)")}]):t;return et(n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()})}(t.errors).join("\n")+"\n\nInput object: "+Po(t.input)},dr=function(t,n){return ir(t,_t(n,Yo))},mr=function(t,n){return function(t,n){var e=pe(n);return{extract:function(t,n){return e().extract(t,n)},toString:function(){return e().toString()}}}(0,n)},gr=Mo,pr=function(t,n){return{tag:"custom",newKey:t,instantiator:n}},hr=function(t){return ur(function(n){return Q(t,n)?Co.value(n):Co.error('Unsupported value: "'.concat(n,'", choose one of "').concat(t.join(", "),'".'))})},vr=function(t){return gr(t,t,{tag:"required",process:{}},$o())},br=function(t,n){return gr(t,t,{tag:"required",process:{}},n)},yr=function(t){return br(t,tr)},xr=function(t,n){return gr(t,t,{tag:"required",process:{}},hr(n))},wr=function(t){return br(t,er)},Sr=function(t,n){return gr(t,t,{tag:"required",process:{}},Yo(n))},Cr=function(t,n){return gr(t,t,{tag:"required",process:{}},Jo(n))},kr=function(t,n){return gr(t,t,{tag:"required",process:{}},Xo(n))},Or=function(t){return gr(t,t,{tag:"option",process:{}},$o())},_r=function(t,n){return gr(t,t,{tag:"option",process:{}},n)},Tr=function(t){return _r(t,Zo)},Er=function(t){return _r(t,tr)},Ar=function(t,n){return _r(t,hr(n))},Mr=function(t){return _r(t,er)},Dr=function(t,n){return _r(t,Xo(n))},Br=function(t,n){return _r(t,Yo(n))},Ir=function(t,n){return gr(t,t,No(n),$o())},Fr=function(t,n,e){return gr(t,t,No(n),e)},Rr=function(t,n){return Fr(t,n,Zo)},Nr=function(t,n){return Fr(t,n,tr)},Lr=function(t,n,e){return Fr(t,n,hr(e))},zr=function(t,n){return Fr(t,n,nr)},Pr=function(t,n){return Fr(t,n,er)},Vr=function(t,n,e){return Fr(t,n,Xo(e))},Hr=function(t,n,e){return Fr(t,n,Yo(e))},Ur=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],e={};return ot(t,function(o,r){var i=Ct(o);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=o[u];if(void 0!==e[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!g(a))throw new Error("case arguments must be an array");n.push(u),e[u]=function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];var c=o.length;if(c!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+c);return{fold:function(){for(var n=arguments.length,e=new Array(n),i=0;i<n;i++)e[i]=arguments[i];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[r].apply(null,o)},match:function(t){var e=Ct(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));if(!dt(n,function(t){return Q(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[u].apply(null,o)},log:function(t){console.log(t,{constructors:n,constructor:u,params:o})}}}}),e};Ur([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Wr,jr,Gr=function(t,n){return function(t,n){return T({},t,n)}(t,n)},qr=function(t){return function(t){var n={};return ot(t,function(t){n[t.key]=t.value}),n}(t)},Yr=function(t){return A(t)?t:W},Xr=function(t,n,e){for(var o=t.dom,r=Yr(e);o.parentNode;){o=o.parentNode;var i=tn(o),u=n(i);if(u.isSome())return u;if(r(i))break}return G.none()},Kr=function(t,n,e){var o=n(t),r=Yr(e);return o.orThunk(function(){return r(t)?G.none():Xr(t,n,r)})},Jr=function(t,n){return hn(t.element,n.event.target)},$r={can:j,abort:W,run:I},Qr=function(t){if(!Nt(t,"can")&&!Nt(t,"abort")&&!Nt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return _(_({},$r),t)},Zr=N,ti=Zr("touchstart"),ni=Zr("touchmove"),ei=Zr("touchend"),oi=Zr("touchcancel"),ri=Zr("mousedown"),ii=Zr("mousemove"),ui=Zr("mouseout"),ai=Zr("mouseup"),ci=Zr("mouseover"),si=Zr("focusin"),li=Zr("focusout"),fi=Zr("keydown"),di=Zr("keyup"),mi=Zr("input"),gi=Zr("change"),pi=Zr("click"),hi=Zr("transitioncancel"),vi=Zr("transitionend"),bi=Zr("transitionstart"),yi=Zr("selectstart"),xi=function(t){return N("alloy."+t)},wi={tap:xi("tap")},Si=xi("focus"),Ci=xi("blur.post"),ki=xi("paste.post"),Oi=xi("receive"),_i=xi("execute"),Ti=xi("focus.item"),Ei=wi.tap,Ai=xi("longpress"),Mi=xi("sandbox.close"),Di=xi("typeahead.cancel"),Bi=xi("system.init"),Ii=xi("system.touchmove"),Fi=xi("system.touchend"),Ri=xi("system.scroll"),Ni=xi("system.resize"),Li=xi("system.attached"),zi=xi("system.detached"),Pi=xi("system.dismissRequested"),Vi=xi("system.repositionRequested"),Hi=xi("focusmanager.shifted"),Ui=xi("slotcontainer.visibility"),Wi=xi("system.external.element.scroll"),ji=xi("change.tab"),Gi=xi("dismiss.tab"),qi=xi("highlight"),Yi=xi("dehighlight"),Xi=function(t,n){Qi(t,t.element,n,{})},Ki=function(t,n,e){Qi(t,t.element,n,e)},Ji=function(t){Xi(t,_i())},$i=function(t,n,e){Qi(t,n,e,{})},Qi=function(t,n,e,o){var r=_({target:n},o);t.getSystem().triggerEvent(e,n,r)},Zi=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)},tu=function(t){return qr(t)},nu=function(t,n){return{key:t,value:Qr({abort:n})}},eu=function(t){return{key:t,value:Qr({run:function(t,n){n.event.prevent()}})}},ou=function(t,n){return{key:t,value:Qr({run:n})}},ru=function(t,n,e){return{key:t,value:Qr({run:function(t,o){n.apply(void 0,[t,o].concat(e))}})}},iu=function(t){return function(n){return{key:t,value:Qr({run:function(t,e){Jr(t,e)&&n(t,e)}})}}},uu=function(t,n,e){return function(t,n){return ou(t,function(e,o){e.getSystem().getByUid(n).each(function(n){Zi(n,n.element,t,o)})})}(t,n.partUids[e])},au=function(t,n){return ou(t,function(t,e){var o=e.event,r=t.getSystem().getByDom(o.target).getOrThunk(function(){return Kr(o.target,function(n){return t.getSystem().getByDom(n).toOptional()},W).getOr(t)});n(t,r,e)})},cu=function(t){return ou(t,function(t,n){n.cut()})},su=function(t){return ou(t,function(t,n){n.stop()})},lu=function(t,n){return iu(t)(n)},fu=iu(Li()),du=iu(zi()),mu=iu(Bi()),gu=(Wr=_i(),function(t){return ou(Wr,t)}),pu=function(t){return et(t,function(t){return qt(t,"/*")?t.substring(0,t.length-2):t})},hu=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:pu(i)}},t},vu=function(t){return{classes:C(t.classes)?[]:t.classes,attributes:C(t.attributes)?{}:t.attributes,styles:C(t.styles)?{}:t.styles}},bu=function(t,n,e){return mu(function(o,r){e(o,t,n)})},yu=function(t){return{key:t,value:void 0}},xu=function(t,n,e,o,r,i,u){var a=function(t){return Nt(t,e)?t[e]():G.none()},c=_t(r,function(t,n){return function(t,n,e){return function(t,n,e){var o=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:pu(u.slice(0,1).concat(u.slice(3)))}},t}(function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;
2u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:N(t)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+e)},function(t){var e=Array.prototype.slice.call(a,1);return n.apply(void 0,[o,t.config,t.state].concat(e))})},e,n)}(e,t,n)}),s=_(_(_({},_t(i,function(t,n){return hu(t,n)})),c),{},{revoke:P(yu,e),config:function(n){var o=lr(e+"-config",t,n);return{key:e,value:{config:o,me:s,configAsRaw:pe(function(){return lr(e+"-config",t,n)}),initialConfig:n,state:u}}},schema:N(n),exhibit:function(t,n){return Pt(a(t),Ft(o,"exhibit"),function(t,e){return e(n,t.config,t.state)}).getOrThunk(function(){return vu({})})},name:N(e),handlers:function(t){return a(t).map(function(t){return Ft(o,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return s},wu={init:function(){return Su({readState:N("No State required")})}},Su=function(t){return t},Cu=function(t){return qr(t)},ku=qo([vr("fields"),vr("name"),Ir("active",{}),Ir("apis",{}),Ir("state",wu),Ir("extra",{})]),Ou=function(t){var n=lr("Creating behaviour: "+t.name,ku,t);return function(t,n,e,o,r,i){var u,a=qo(t),c=Br(n,[(u=t,_r("config",qo(u)))]);return xu(a,c,n,e,o,r,i)}(n.fields,n.name,n.active,n.apis,n.extra,n.state)},_u=qo([vr("branchKey"),vr("branches"),vr("name"),Ir("active",{}),Ir("apis",{}),Ir("state",wu),Ir("extra",{})]),Tu=function(t){var n=lr("Creating behaviour: "+t.name,_u,t);return function(t,n,e,o,r,i){var u=t,a=Br(n,[_r("config",t)]);return xu(u,a,n,e,o,r,i)}(dr(n.branchKey,n.branches),n.name,n.active,n.apis,n.extra,n.state)},Eu=N(void 0),Au=function(t,n){var e=Hn(t,n);return void 0===e||""===e?[]:e.split(" ")},Mu=function(t){return void 0!==t.dom.classList},Du=function(t){return Au(t,"class")},Bu=function(t,n){return function(t,n,e){var o=Au(t,n).concat([e]);return Pn(t,n,o.join(" ")),!0}(t,"class",n)},Iu=function(t,n){return function(t,n,e){var o=it(Au(t,n),function(t){return t!==e});return o.length>0?Pn(t,n,o.join(" ")):jn(t,n),!1}(t,"class",n)},Fu=function(t,n){Mu(t)?t.dom.classList.add(n):Bu(t,n)},Ru=function(t){0===(Mu(t)?t.dom.classList:Du(t)).length&&jn(t,"class")},Nu=function(t,n){Mu(t)?t.dom.classList.remove(n):Iu(t,n),Ru(t)},Lu=function(t,n){return Mu(t)&&t.dom.classList.contains(n)},zu=function(t,n){ot(n,function(n){Fu(t,n)})},Pu=function(t,n){ot(n,function(n){Nu(t,n)})},Vu=function(t){return Mu(t)?function(t){for(var n=t.dom.classList,e=new Array(n.length),o=0;o<n.length;o++){var r=n.item(o);null!==r&&(e[o]=r)}return e}(t):Du(t)},Hu=function(t,n,e,o,r){var i=function(t){return t+"px"};return{position:t,left:n.map(i),top:e.map(i),right:o.map(i),bottom:r.map(i)}},Uu=function(t,n){Kn(t,function(t){return _(_({},t),{},{position:G.some(t.position)})}(n))},Wu=function(t){return(Lt(Qn(t,"position"),"fixed")?G.none():kn(t)).orThunk(function(){var n=Qt("span");return Sn(t).bind(function(t){Qe(t,n);var e=kn(n);return no(n),e})})},ju=function(t){return Wu(t).map(le).getOrThunk(function(){return ce(0,0)})},Gu=function(t,n){var e=t.element;Fu(e,n.transitionClass),Nu(e,n.fadeOutClass),Fu(e,n.fadeInClass),n.onShow(t)},qu=function(t,n){var e=t.element;Fu(e,n.transitionClass),Nu(e,n.fadeInClass),Fu(e,n.fadeOutClass),n.onHide(t)},Yu=function(t,n){return t.y>=n.y},Xu=function(t,n){return t.bottom<=n.bottom},Ku=function(t,n,e){return{location:"top",leftX:n,topY:e.bounds.y-t.y}},Ju=function(t,n,e){return{location:"bottom",leftX:n,bottomY:t.bottom-e.bounds.bottom}},$u=function(t){return t.box.x-t.win.x},Qu=function(t,n,e){return e.getInitialPos().map(function(e){var o=function(t,n){var e=n.optScrollEnv.fold(N(t.bounds.y),function(n){return n.scrollElmTop+(t.bounds.y-n.currentScrollTop)});return ce(t.bounds.x,e)}(e,n);return{box:lo(o.left,o.top,me(t),ie(t)),location:e.location}})},Zu=function(t,n,e,o,r){var i=function(t,n){var e=n.optScrollEnv.fold(N(t.y),function(n){return t.y+n.currentScrollTop-n.scrollElmTop});return ce(t.x,e)}(n,e),u=lo(i.left,i.top,n.width,n.height);o.setInitialPos({style:Zn(t),position:Jn(t,"position")||"static",bounds:u,location:r.location})},ta=function(t,n,e){return e.getInitialPos().bind(function(o){var r;switch(e.clearInitialPos(),o.position){case"static":return G.some({morph:"static"});case"absolute":var i=Wu(t).getOr(Nn()),u=fo(i),a=null!==(r=i.dom.scrollTop)&&void 0!==r?r:0;return G.some({morph:"absolute",positionCss:Hu("absolute",Ft(o.style,"left").map(function(t){return n.x-u.x}),Ft(o.style,"top").map(function(t){return n.y-u.y+a}),Ft(o.style,"right").map(function(t){return u.right-n.right}),Ft(o.style,"bottom").map(function(t){return u.bottom-n.bottom}))});default:return G.none()}})},na=function(t){switch(t.location){case"top":return G.some({morph:"fixed",positionCss:Hu("fixed",G.some(t.leftX),G.some(t.topY),G.none(),G.none())});case"bottom":return G.some({morph:"fixed",positionCss:Hu("fixed",G.some(t.leftX),G.none(),G.none(),G.some(t.bottomY))});default:return G.none()}},ea=function(t,n,e){e.setDocked(!1),ot(["left","right","top","bottom","position"],function(n){return ne(t.element,n)}),n.onUndocked(t)},oa=function(t,n,e,o){var r="fixed"===o.position;e.setDocked(r),Uu(t.element,o),(r?n.onDocked:n.onUndocked)(t)},ra=function(t,n,e,o){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n.contextual.each(function(n){n.lazyContext(t).each(function(i){var u=function(t,n){return t.y<n.bottom&&t.bottom>n.y}(i,o.bounds);u!==e.isVisible()&&(e.setVisible(u),r&&!u?(zu(t.element,[n.fadeOutClass]),n.onHide(t)):(u?Gu:qu)(t,n))})})},ia=function(t,n,e,o,r){ra(t,n,e,o,!0),oa(t,n,e,r.positionCss)},ua=function(t,n,e){t.getSystem().isConnected()&&function(t,n,e){var o=n.lazyViewport(t);ra(t,n,e,o),function(t,n,e){var o=t.element;return Lt(Qn(o,"position"),"fixed")?function(t,n,e){return function(t,n,e){return Qu(t,n,e).filter(function(t){var o=t.box;return function(t,n,e){return dt(t,function(t){switch(t){case"bottom":return Xu(n,e.bounds);case"top":return Yu(n,e.bounds)}})}(e.getModes(),o,n)}).bind(function(n){var o=n.box;return ta(t,o,e)})}(t,n,e).orThunk(function(){return n.optScrollEnv.bind(function(o){return Qu(t,n,e)}).bind(function(t){var e=t.box,o=t.location,r=po(),i=$u({win:r,box:e}),u="top"===o?Ku(r,i,n):Ju(r,i,n);return na(u)})})}(o,n,e):function(t,n,e){var o=fo(t),r=po(),i=function(t,n,e){var o=n.win,r=n.box,i=$u(n);return St(t,function(t){switch(t){case"bottom":return Xu(r,e.bounds)?G.none():G.some(Ju(o,i,e));case"top":return Yu(r,e.bounds)?G.none():G.some(Ku(o,i,e));default:return G.none()}}).getOr({location:"no-dock"})}(e.getModes(),{win:r,box:o},n);return"top"===i.location||"bottom"===i.location?(Zu(t,o,n,e,i),na(i)):G.none()}(o,n,e)}(t,o,e).each(function(r){!function(t,n,e,o,r){switch(r.morph){case"static":return ea(t,n,e);case"absolute":return oa(t,n,e,r.positionCss);case"fixed":ia(t,n,e,o,r)}}
2(t,n,e,o,r)})}(t,n,e)},aa=function(t,n,e){e.isDocked()&&function(t,n,e){var o=t.element;e.setDocked(!1);var r=n.lazyViewport(t);(function(t,n,e){var o=t.element;return Qu(o,n,e).bind(function(t){var n=t.box;return ta(o,n,e)})})(t,r,e).each(function(o){switch(o.morph){case"static":ea(t,n,e);break;case"absolute":oa(t,n,e,o.positionCss)}}),e.setVisible(!0),n.contextual.each(function(n){Pu(o,[n.fadeInClass,n.fadeOutClass,n.transitionClass]),n.onShow(t)}),ua(t,n,e)}(t,n,e)},ca=function(t){return function(n,e,o){var r=e.lazyViewport(n);(function(t,n,e,o){var r=fo(t),i=po(),u=o(i,$u({win:i,box:r}),n);return"bottom"===u.location||"top"===u.location?(function(t,n,e,o,r){o.getInitialPos().fold(function(){return Zu(t,n,e,o,r)},function(){return I})}(t,r,n,e,u),na(u)):G.none()})(n.element,r,o,t).each(function(t){ia(n,e,o,r,t)})}},sa=ca(Ku),la=ca(Ju),fa=Object.freeze({__proto__:null,refresh:ua,reset:aa,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)},forceDockToTop:sa,forceDockToBottom:la}),da=Object.freeze({__proto__:null,events:function(t,n){return tu([lu(vi(),function(e,o){t.contextual.each(function(t){Lu(e.element,t.transitionClass)&&(Pu(e.element,[t.transitionClass,t.fadeInClass]),(n.isVisible()?t.onShown:t.onHidden)(e)),o.stop()})}),ou(Ri(),function(e,o){ua(e,t,n)}),ou(Wi(),function(e,o){ua(e,t,n)}),ou(Ni(),function(e,o){aa(e,t,n)})])}}),ma=function(t){return t.dom.innerHTML},ga=function(t,n){var e=bn(t).dom,o=tn(e.createDocumentFragment()),r=function(t,n){var e=(n||document).createElement("div");return e.innerHTML=t,On(tn(e))}(n,e);Ze(o,r),to(t),Qe(t,o)},pa=function(t,n){return tn(t.dom.cloneNode(n))},ha=function(t){return function(t){if(Mn(t))return"#shadow-root";var n=function(t){return pa(t,!1)}(t);return function(t){var n=Qt("div"),e=tn(t.dom.cloneNode(!0));return Qe(n,e),ma(n)}(n)}(t)};!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(jr||(jr={}));var va=ho({}),ba=["alloy/data/Fields","alloy/debugging/Debugging"],ya=function(t,n,e){return function(t,n,e){switch(Ft(va.get(),t).orThunk(function(){var n=Ct(va.get());return St(n,function(n){return t.indexOf(n)>-1?G.some(va.get()[n]):G.none()})}).getOr(jr.NORMAL)){case jr.NORMAL:return e(xa());case jr.LOGGING:var o=function(t,n){var e=[],o=(new Date).getTime();return{logEventCut:function(t,n,o){e.push({outcome:"cut",target:n,purpose:o})},logEventStopped:function(t,n,o){e.push({outcome:"stopped",target:n,purpose:o})},logNoParent:function(t,n,o){e.push({outcome:"no-parent",target:n,purpose:o})},logEventNoHandlers:function(t,n){e.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,o){e.push({outcome:"response",purpose:o,target:n})},write:function(){var r=(new Date).getTime();Q(["mousemove","mouseover","mouseout",Bi()],t)||console.log(t,{event:t,time:r-o,target:n.dom,sequence:et(e,function(t){return Q(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+ha(t.target)+")":t.outcome})})}}}(t,n),r=e(o);return o.write(),r;case jr.STOP:return!0}}(t,n,e)},xa=N({logEventCut:I,logEventStopped:I,logNoParent:I,logEventNoHandlers:I,logEventResponse:I,write:I}),wa=N([vr("menu"),vr("selectedMenu")]),Sa=N([vr("item"),vr("selectedItem")]);N(Yo(Sa().concat(wa())));var Ca,ka=N(Yo(Sa())),Oa=Sr("initSize",[vr("numColumns"),vr("numRows")]),_a=function(){return Sr("markers",[vr("backgroundMenu")].concat(wa()).concat(Sa()))},Ta=function(t){return Sr("markers",et(t,vr))},Ea=function(t,n,e){return function(){var t=new Error;if(void 0!==t.stack){var n=t.stack.split("\n");ct(n,function(t){return t.indexOf("alloy")>0&&!Z(ba,function(n){return t.indexOf(n)>-1})}).getOr("unknown")}}(),gr(n,n,e,ur(function(t){return Co.value(function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];return t.apply(void 0,e)})}))},Aa=function(t){return Ea(0,t,No(I))},Ma=function(t){return Ea(0,t,No(G.none))},Da=function(t){return Ea(0,t,{tag:"required",process:{}})},Ba=function(t){return Ea(0,t,{tag:"required",process:{}})},Ia=function(t,n){return pr(t,N(n))},Fa=function(t){return pr(t,L)},Ra=N(Oa),Na=[Br("contextual",[yr("fadeInClass"),yr("fadeOutClass"),yr("transitionClass"),wr("lazyContext"),Aa("onShow"),Aa("onShown"),Aa("onHide"),Aa("onHidden")]),Pr("lazyViewport",function(){return{bounds:po(),optScrollEnv:G.none()}}),Vr("modes",["top","bottom"],tr),Aa("onDocked"),Aa("onUndocked")],La=Ou({fields:Na,name:"docking",active:da,apis:fa,state:Object.freeze({__proto__:null,init:function(t){var n=ho(!1),e=ho(!0),o=yo(),r=ho(t.modes);return Su({isDocked:n.get,setDocked:n.set,getInitialPos:o.get,setInitialPos:o.set,clearInitialPos:o.clear,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: ".concat(n.get(),", visible: ").concat(e.get(),", modes: ").concat(r.get().join(","))}})}})}),za=tu([function(t){return{key:t,value:Qr({can:function(t,n){var e=n.event,o=e.originator,r=e.target;return!function(t,n,e){return hn(n,t.element)&&!hn(n,e)}
2(t,o,r)||(console.warn(Si()+" did not get interpreted by the desired target. \nOriginator: "+ha(o)+"\nTarget: "+ha(r)+"\nCheck the "+Si()+" event handlers"),!1)}})}}(Si())]),Pa=Object.freeze({__proto__:null,events:za}),Va=function(t,n,e,o){var r=t+n;return r>o?e:r<e?o:r},Ha=function(t,n,e){return Math.min(Math.max(t,n),e)},Ua=0,Wa=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9)+ ++Ua+String(n)},ja=N("alloy-id-"),Ga=N("data-alloy-id"),qa=ja(),Ya=Ga(),Xa=function(t,n){Object.defineProperty(t.dom,Ya,{value:n,writable:!0})},Ka=function(t){var n=cn(t)?t.dom[Ya]:null;return G.from(n)},Ja=function(t){return Wa(t)},$a=L,Qa=function(t){var n=function(n){return"The component must be in a context to execute: ".concat(n)+(t?"\n"+ha(t().element)+" is not in context.":"")},e=function(t){return function(){throw new Error(n(t))}},o=function(t){return function(){console.warn(n(t))}};return{debugInfo:N("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:e("build"),buildOrPatch:e("buildOrPatch"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),isConnected:W}},Za=Qa(),tc=Wa("alloy-premade"),nc=function(t){return Object.defineProperty(t.element.dom,tc,{value:t.uid,writable:!0}),Gr(tc,t)},ec=function(t){return Ft(t,tc)},oc=function(t){return function(t,n){var e=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:pu(i.slice(1))}},t}(function(n){for(var e=arguments.length,o=new Array(e>1?e-1:0),r=1;r<e;r++)o[r-1]=arguments[r];return t.apply(void 0,[n.getApis(),n].concat(o))},t)},rc=function(t,n){var e={};return Ot(t,function(t,o){Ot(t,function(t,r){var i=Ft(e,r).getOr([]);e[r]=i.concat([n(o,t)])})}),e},ic=function(t){return t.cHandler},uc=function(t,n){return{name:t,handler:n}},ac=function(t,n){return function(t){var n,e=function(t){var n=[],e=[];return ot(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}(t);return e.errors.length>0?(n=e.errors,Co.error(lt(n))):function(t,n){return 0===t.length?Co.value(n):Co.value(Io(n,Fo.apply(void 0,t)))}(e.values,{})}(Dt(t,function(t,e){return(1===t.length?Co.value(t[0].handler):function(t,n,e){var o=n[e];return o?function(t,n,e,o){try{var r=vt(e,function(e,r){var i=e[n],u=r[n],a=o.indexOf(i),c=o.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(o,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(o,null,2));return a<c?-1:c<a?1:0});return Co.value(r)}catch(t){return Co.error([t])}}("Event: "+e,"name",t,o).map(function(t){return function(t){var n=function(t){return function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];return at(t,function(t,n){return t&&function(t){return t.can}(n).apply(void 0,e)},!0)}}(t),e=function(t){return function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];return at(t,function(t,n){return t||function(t){return t.abort}(n).apply(void 0,e)},!1)}}(t);return{can:n,abort:e,run:function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];ot(t,function(t){t.run.apply(void 0,e)})}}}(et(t,function(t){return t.handler}))}):function(t,n){return Co.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(et(n,function(t){return t.name}),null,2)])}(e,t)}(t,n,e)).map(function(o){var r=function(t){var n=function(t){return A(t)?{can:j,abort:W,run:t}:t}(t);return function(t,e){for(var o=arguments.length,r=new Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];var u=[t,e].concat(r);n.abort.apply(void 0,u)?e.stop():n.can.apply(void 0,u)&&n.run.apply(void 0,u)}}(o),i=t.length>1?it(n[e],function(n){return Z(t,function(t){return t.name===n})}).join(" > "):t[0].name;return Gr(e,function(t,n){return{handler:t,purpose:n}}(r,i))})}))},cc="alloy.base.behaviour",sc=Yo([gr("dom","dom",{tag:"required",process:{}},Yo([vr("tag"),Ir("styles",{}),Ir("classes",[]),Ir("attributes",{}),Or("value"),Or("innerHtml")])),vr("components"),vr("uid"),Ir("events",{}),Ir("apis",{}),gr("eventOrder","eventOrder",(Ca=T(T(T(T(T(T(T(T(T({},_i(),["disabling",cc,"toggling","typeaheadevents"]),Si(),[cc,"focusing","keying"]),Bi(),[cc,"disabling","toggling","representing","tooltipping"]),mi(),[cc,"representing","streaming","invali
2dating"]),zi(),[cc,"representing","item-events","toolbar-button-events","tooltipping"]),ri(),["focusing",cc,"item-type-events"]),ti(),["focusing",cc,"item-type-events"]),ci(),["item-type-events","tooltipping"]),Oi(),["receiving","reflecting","tooltipping"]),Lo(N(Ca))),$o()),Or("domModification")]),lc=function(t){return t.events},fc=function(t){return t.dom.value},dc=function(t,n){if(void 0===n)throw new Error("Value.set was undefined");t.dom.value=n},mc=function(t,n,e){e.fold(function(){return Qe(t,n)},function(t){hn(t,n)||(Ke(t,n),no(t))})},gc=function(t,n,e){var o=et(n,e),r=On(t);return ot(r.slice(o.length),no),o},pc=function(t,n,e,o){var r=_n(t,n),i=o(e,r),u=function(t,n,e){return _n(t,n).map(function(t){if(e.exists(function(n){return!hn(n,t)})){var n=e.map(rn).getOr("span"),o=Qt(n);return Ke(t,o),o}return t})}(t,n,r);return mc(t,i.element,u),i},hc=function(t,n){var e=Ct(t),o=Ct(n),r=gt(o,e),i=function(t){var e={},o={};return At(t,function(t,e){return!Rt(n,e)||t!==n[e]},Et(e),Et(o)),{t:e,f:o}}(t).t;return{toRemove:r,toSet:i}},vc=function(n,e){var o=function(){return m},r=ho(Za),i=sr(function(t){return cr("custom.definition",sc,t)}(n)),u=function(t){var n=function(t){var n=Ft(t,"behaviours").getOr({});return ft(Ct(n),function(t){var e=n[t];return O(e)?[e.me]:[]})}(t);return function(t,n){return function(t,n){var e=et(n,function(t){return Br(t.name(),[vr("config"),Ir("state",wu)])}),o=cr("component.behaviours",Yo(e),t.behaviours).fold(function(n){throw new Error(fr(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},L);return{list:n,data:_t(o,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return N(n)})}}(t,n)}(t,n)}(n),a=function(t){return t.list}(u),c=function(t){return t.data}(u),s=function(t,n,e){var o,r,i,u=_(_({},(o=t).dom),{},{uid:o.uid,domChildren:et(o.components,function(t){return t.element})}),a=function(t){return t.domModification.fold(function(){return vu({})},vu)}(t),c={"alloy.base.modification":a},s=n.length>0?function(t,n,e,o){var r=_({},n);ot(e,function(n){r[n.name()]=n.exhibit(t,o)});var i=rc(r,function(t,n){return{name:t,modification:n}}),u=function(t){return ut(t,function(t,n){return _(_({},n.modification),t)},{})},a=ut(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return vu({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,_(_({},r=u),{},{attributes:_(_({},r.attributes),i.attributes),styles:_(_({},r.styles),i.styles),classes:r.classes.concat(i.classes)})}(i,a,c),l=function(n,e){var o=e.filter(function(t){return rn(t)===n.tag&&!function(t){return t.innerHtml.isSome()&&t.domChildren.length>0}(n)&&!function(t){return Rt(t.dom,tc)}(t)}).bind(function(e){return function(n,e){try{var o=function(n,e){var o=function(t){return at(t.dom.attributes,function(t,n){return t[n.name]=n.value,t},{})}(e),r=(o.class,o.style,x(o,t)),i=hc(n.attributes,r),u=i.toSet,a=i.toRemove,c=Zn(e),s=hc(n.styles,c),l=s.toSet,f=s.toRemove,d=Vu(e),m=gt(d,n.classes),g=gt(n.classes,d);return ot(a,function(t){return jn(e,t)}),Vn(e,u),zu(e,g),Pu(e,m),ot(f,function(t){return ne(e,t)}),Xn(e,l),n.innerHtml.fold(function(){var t=n.domChildren;!function(t,n){gc(t,n,function(n,e){var o=_n(t,e);return mc(t,n,o),n})}(e,t)},function(t){ga(e,t)}),function(){var t=e,o=n.value.getOrUndefined();o!==fc(t)&&dc(t,null!=o?o:"")}(),e}(n,e);return G.some(o)}catch(n){return G.none()}}(n,e)}).getOrThunk(function(){return function(t){var n=Qt(t.tag);Vn(n,t.attributes),zu(n,t.classes),Xn(n,t.styles),t.innerHtml.each(function(t){return ga(n,t)});var e=t.domChildren;return Ze(n,e),t.value.each(function(t){dc(n,t)}),n}(n)});return Xa(o,n.uid),o}(s,e),f=function(t,n,e){var o={"alloy.base.behaviour":lc(t)};return function(t,n,e,o){var r=function(t,n,e){var o=_(_({},e),function(t,n){var e={};return ot(t,function(t){e[t.name()]=t.handlers(n)}),e}(n,t));return rc(o,uc)}(t,e,o);return ac(r,n)}(e,t.eventOrder,n,o).getOrDie()}(i,a,c),d=ho(i.components),m={uid:n.uid,getSystem:r.get,config:function(t){var e=c;return(A(e[t.name()])?e[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(n,null,2))})()},hasConfigured:function(t){return A(c[t.name()])},spec:n,readState:function(t){return c[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return i.apis},connect:function(t){r.set(t)},disconnect:function(){r.set(Qa(o))},element:l,syncComponents:function(){var t=On(l),n=ft(t,function(t){return r.get().getByDom(t).fold(function(){return[]},ht)});d.set(n)},components:d.get,events:f};return m},bc=function(t){var n=Zt(t);return yc({element:n})},yc=function(t){var n=lr("external.component",qo([vr("element"),Or("uid")]),t),e=ho(Qa()),o=n.uid.getOrThunk(function(){return Ja("external")});Xa(n.element,o);var r={uid:o,getSystem:e.get,config:G.none,hasConfigured:W,connect:function(t){e.set(t)},disconnect:function(){e.set(Qa(function(){return r}))},getApis:function(){return{}},element:n.element,spec:t,readState:N("No state"),syncComponents:I,components:N([]),events:{}};return nc(r)},xc=Ja,wc=function(t,e){return ec(t).getOrThunk(function(){return function(t,e){var o=$a(t),r=o.events,i=x(o,n),u=function(t,n){var e=Ft(t,"components").getOr([]);return n.fold(function(){return et(e,Sc)},function(t){return et(e,function(n,e){return wc(n,_n(t,e))})})}(i,e),a=_(_({},i),{},{events:_(_({},Pa),r),components:u});return Co.value(vc(a,e))}(function(t){return Rt(t,"uid")}(t)?t:_({uid:xc("")},t),e).getOrDie()})},Sc=function(t){return wc(t,G.none())}
2,Cc=nc,kc=function(t,n,e,o,r){return t(e,o)?G.some(e):A(r)&&r(e)?G.none():n(e,o,r)},Oc=function(t,n,e){for(var o=t.dom,r=A(e)?e:W;o.parentNode;){o=o.parentNode;var i=tn(o);if(n(i))return G.some(i);if(r(i))break}return G.none()},_c=function(t,n,e){return kc(function(t,n){return n(t)},Oc,t,n,e)},Tc=function(t,n){return ct(t.dom.childNodes,function(t){return n(tn(t))}).map(tn)},Ec=function(t,n,e){return _c(t,n,e).isSome()},Ac=function(t,n,e){return Oc(t,function(t){return mn(t,n)},e)},Mc=function(t,n){return Tc(t,function(t){return mn(t,n)})},Dc=function(t,n){return pn(n,t)},Bc=function(t,n,e){return kc(function(t,n){return mn(t,n)},Ac,t,n,e)},Ic="aria-controls",Fc=function(){var t=Wa(Ic);return{id:t,link:function(n){Pn(n,Ic,t)},unlink:function(t){jn(t,Ic)}}},Rc=function(t,n){return Ec(n,function(n){return hn(n,t.element)},W)||function(t,n){return function(t){return _c(t,function(t){if(!cn(t))return!1;var n=Hn(t,"id");return void 0!==n&&n.indexOf(Ic)>-1}).bind(function(t){var n=Hn(t,"id"),e=Dn(t);return Dc(e,"[".concat(Ic,'="').concat(n,'"]'))})}(n).exists(function(n){return Rc(t,n)})}(t,n)},Nc=function(t,n,e,o,r,i,u){var a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return{x:t,y:n,bubble:e,direction:o,placement:r,restriction:i,label:"".concat(u,"-").concat(r),alwaysFit:a}},Lc=Ur([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),zc=Lc.southeast,Pc=Lc.southwest,Vc=Lc.northeast,Hc=Lc.northwest,Uc=Lc.south,Wc=Lc.north,jc=Lc.east,Gc=Lc.west,qc=function(t,n){return pt(["left","right","top","bottom"],function(e){return Ft(n,e).map(function(n){return function(t,n){switch(n){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,n)})})},Yc="layout",Xc=function(t){return t.x},Kc=function(t,n){return t.x+t.width/2-n.width/2},Jc=function(t,n){return t.x+t.width-n.width},$c=function(t,n){return t.y-n.height},Qc=function(t){return t.y+t.height},Zc=function(t,n){return t.y+t.height/2-n.height/2},ts=function(t,n,e){return Nc(Xc(t),Qc(t),e.southeast(),zc(),"southeast",qc(t,{left:1,top:3}),Yc)},ns=function(t,n,e){return Nc(Jc(t,n),Qc(t),e.southwest(),Pc(),"southwest",qc(t,{right:0,top:3}),Yc)},es=function(t,n,e){return Nc(Xc(t),$c(t,n),e.northeast(),Vc(),"northeast",qc(t,{left:1,bottom:2}),Yc)},os=function(t,n,e){return Nc(Jc(t,n),$c(t,n),e.northwest(),Hc(),"northwest",qc(t,{right:0,bottom:2}),Yc)},rs=function(t,n,e){return Nc(Kc(t,n),$c(t,n),e.north(),Wc(),"north",qc(t,{bottom:2}),Yc)},is=function(t,n,e){return Nc(Kc(t,n),Qc(t),e.south(),Uc(),"south",qc(t,{top:3}),Yc)},us=function(t,n,e){return Nc(function(t){return t.x+t.width}(t),Zc(t,n),e.east(),jc(),"east",qc(t,{left:0}),Yc)},as=function(t,n,e){return Nc(function(t,n){return t.x-n.width}(t,n),Zc(t,n),e.west(),Gc(),"west",qc(t,{right:1}),Yc)},cs=function(){return[ts,ns,es,os,is,rs,us,as]},ss=function(){return[ns,ts,os,es,is,rs,us,as]},ls=function(){return[es,os,ts,ns,rs,is]},fs=function(){return[os,es,ns,ts,rs,is]},ds=function(){return[ts,ns,es,os,is,rs]},ms=function(){return[ns,ts,os,es,is,rs]},gs=Object.freeze({__proto__:null,events:function(t){return tu([ou(Oi(),function(n,e){var o=t.channels,r=Ct(o),i=e,u=function(t,n){return n.universal?t:it(t,function(t){return Q(n.channels,t)})}(r,i);ot(u,function(t){var e=o[t],r=e.schema,u=lr("channel["+t+"] data\nReceiver: "+ha(n.element),r,i.data);e.onReceive(n,u)})})])}}),ps=[br("channels",ar(Co.value,qo([Da("onReceive"),Ir("schema",$o())])))],hs=Ou({fields:ps,name:"receiving",active:gs}),vs=Object.freeze({__proto__:null,exhibit:function(t,n){return vu({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),bs=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.dom.focus({preventScroll:n})},ys=function(t){return t.dom.blur()},xs=function(t){var n=Dn(t).dom;return t.dom===n.activeElement},ws=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uo();return G.from(t.dom.activeElement).map(tn)},Ss=function(t){return ws(Dn(t)).filter(function(n){return t.dom.contains(n.dom)})},Cs=function(t,n){var e=Dn(n),o=ws(e).bind(function(t){var e=function(n){return hn(t,n)};return e(n)?G.some(n):function(t,n){var e=function(t){for(var o=0;o<t.childNodes.length;o++){var r=tn(t.childNodes[o]);if(n(r))return G.some(r);var i=e(t.childNodes[o]);if(i.isSome())return i}return G.none()};return e(t.dom)}(n,e)}),r=t(n);return o.each(function(t){ws(e).filter(function(n){return hn(n,t)}).fold(function(){bs(t)},I)}),r},ks=Ur([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Os=function(t,n,e,o,r,i){var u=n.rect,a=u.x-e,c=u.y-o,s=r-(a+u.width),l=i-(c+u.height),f=G.some(a),d=G.some(c),m=G.some(s),g=G.some(l),p=G.none();return n.direction.fold(function(){return Hu(t,f,d,p,p)},function(){return Hu(t,p,d,m,p)},function(){return Hu(t,f,p,p,g)},function(){return Hu(t,p,p,m,g)},function(){return Hu(t,f,d,p,p)},function(){return Hu(t,f,p,p,g)},function(){return Hu(t,f,d,p,p)},function(){return Hu(t,p,d,m,p)})},_s=function(t,n){return t.fold(function(){var t=n.rect;return Hu("absolute",G.some(t.x),G.some(t.y),G.none(),G.none())},function(t,e,o,r){return Os("absolute",n,t,e,o,r)},function(t,e,o,r){return Os("fixed",n,t,e,o,r)})},Ts=function(t,n){var e=P(so,n),o=t.fold(e,e,function(){var t=eo();return so(n).translate(-t.left,-t.top)}),r=ge(n),i=ue(n);return lo(o.left,o.top,r,i)},Es=function(t,n){return n.fold(function(){return t.fold(po,po,lo)},function(n){return t.fold(N(n),N(n),function(){var e=As(t,n.x,n.y);return lo(e.left,e.top,n.width,n.height)})})},As=function(t,n,e){var o=ce(n,e);return t.fold(N(o),N(o),function(){var t=eo();return o.translate(-t.left,-t.top)})};ks.none;var Ms,Ds=ks.relative,Bs=ks.fixed,Is="data-alloy-placement",Fs=function(t){return Un(t,Is)},Rs=Ur([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Ns=j,Ls=function(t,n,e){return function(t,n,e,o){return Ye(t,n,e,o,!1)}(t,n,Ns,e)},zs=function(t,n,e){return function(t,n,e,o){return Ye(t,n,e,o,!0)}(t,n,Ns,e)},Ps=qe,Vs=["top","bottom","right","left"],Hs="data-alloy-transition-timer",Us=function(t,n){!function(t,n){var e=re.max(t,n,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Yn(t,"max-height",e+"px")}(t,Math.floor(n))},Ws=N(function(t,n){Us(t,n),Xn(t,{"overflow-x":"hidden","overflow-y":"auto"})}),js=N(function(t,n){Us(t,n)}),Gs=function(t,n,e){return void 0===t[n]?e:t[n]},qs=function(t,n,e,o){var r=function(t,n,e,o){ne(n,"max-height"),ne(n,"max-width");var r,i={width:ge(r=n),height:ue(r)};return function(t,n,e,o,r,i){var u=o.width,a=o.height,c=function(n,c,s,l,f){var d=function(t,n,e,o){var r=t.bubble,i=r.offset,u=function(t,n,e){var o=function(o,r){return n[o].map(function(n){var i="top"===o||"bottom"===o,u=i?e.top:e.left,a=("left"===o||"top"===o?Math.max:Math.min)(n,r)+u;return i?Ha(a,t.y,t.bottom):Ha(a,t.x,t.right)}).getOr(r)},r=o("left",t.x),i=o("top",t.y),u=o("right",t.right),a=o("bottom",t.bottom);return lo(r,i,u-r,a-i)}(o,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=lo(a,c,n,e),l=function(t,n){var e=n.x,o=n.y,r=n.right,i=n.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:u>=e&&u<=r&&a>=o&&a<=i,sizeInBounds:c<=r&&c>=e&&s<=i&&s>=o,visibleW:Math.min(l,u>=e?r-u:c-e),visibleH:Math.min(f,a>=o?i-a:s-o)}}(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,p=f&&d,h=p?s:function(t,n){var e=n.x,o=n.y,r=n.right,i=n.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(e,r-c),f=Math.max(o,i-s),d=Ha(u,e,l),m=Ha(a,o,f),g=Math.min(d+c,r)-d,p=Math.min(m+s,i)-m;return lo(d,m,g,p)}(s,u),v=h.width>0&&h.height>0,b=function(t,n,e){var o=N(n.bottom-e.y),r=N(e.bottom-n.y),i=function(t,n,e,o){return t.fold(n,n,o,o,n,o,e,e)}(t,r,r,o),u=N(n.right-e.x),a=N(e.right-n.x),c=function(t,n,e,o){return t.fold(n,o,n,o,e,e,n,o)}(t,a,a,u);return{maxWidth:c,maxHeight:i}}(t.direction,h,o),y=b.maxWidth,x={rect:h,maxHeight:b.maxHeight,maxWidth:y,direction:t.direction,placement:t.placement,classes:{on:r.classesOn,off:r.classesOff},layout:t.label,testY:c};
2return p||t.alwaysFit?Rs.fit(x):Rs.nofit(x,m,g,v)}(n(e,o,r,t,i),u,a,i);return d.fold(N(d),function(t,n,e,o){return(f===o?e>l||n>s:!f&&o)?d:Rs.nofit(c,s,l,f)})};return at(n,function(t,n){var e=P(c,n);return t.fold(N(t),e)},Rs.nofit({rect:e,maxHeight:o.height,maxWidth:o.width,direction:zc(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:e.y},-1,-1,!1)).fold(L,L)}(n,o.preference,t,i,e,o.bounds)}(t,n,e,o);return function(t,n,e){var o=_s(e.origin,n);e.transition.each(function(r){!function(t,n,e,o,r,i){var u=function(t,n,e){return e.exists(function(e){var o=t.mode;return"all"===o||e[o]!==n[o]})}(o,r,i);if(u||function(t,n){return function(t,n){return dt(n,function(n){return Lu(t,n)})}(t,n.classes)}(t,o)){Yn(t,"position",e.position);var a=Ts(n,t),c=_s(n,_(_({},r),{},{rect:a})),s=pt(Vs,function(t){return c[t]});(function(t,n){var e=function(t){return parseFloat(t).toFixed(3)};return Bt(n,function(n,o){return!function(t,n){return Pt(t,n,arguments.length>2&&void 0!==arguments[2]?arguments[2]:z).getOr(t.isNone()&&n.isNone())}(t[o].map(e),n.map(e))}).isSome()})(e,s)&&(Kn(t,s),u&&function(t,n){zu(t,n.classes),Un(t,Hs).each(function(n){clearTimeout(parseInt(n,10)),jn(t,Hs)}),function(t,n){var e,o=bo(),r=bo(),i=function(n){var e,o=null!==(e=n.raw.pseudoElement)&&void 0!==e?e:"";return hn(n.target,t)&&Kt(o)&&Q(Vs,n.raw.propertyName)},u=function(u){if(k(u)||i(u)){o.clear(),r.clear();var a=null==u?void 0:u.raw.type;(k(a)||a===vi())&&(clearTimeout(e),jn(t,Hs),Pu(t,n.classes))}},a=Ls(t,bi(),function(n){i(n)&&(a.unbind(),o.set(Ls(t,vi(),u)),r.set(Ls(t,hi(),u)))}),c=function(t){var n=function(n){var e=Jn(t,n).split(/\s*,\s*/);return it(e,Xt)},e=function(t){if(f(t)&&/^[\d.]+/.test(t)){var n=parseFloat(t);return qt(t,"ms")?n:1e3*n}return 0},o=n("transition-delay"),r=n("transition-duration");return at(r,function(t,n,r){var i=e(o[r])+e(n);return Math.max(t,i)},0)}(t);requestAnimationFrame(function(){e=setTimeout(u,c+17),Pn(t,Hs,e)})}(t,n)}(t,o),ee(t))}else Pu(t,o.classes)}(t,e.origin,o,r,n,e.lastPlacement)}),Uu(t,o)}(n,r,o),function(t,n){!function(t,n){Pn(t,Is,n)}(t,n.placement)}(n,r),function(t,n){var e=n.classes;Pu(t,e.off),zu(t,e.on)}(n,r),function(t,n,e){(0,e.maxHeightFunction)(t,n.maxHeight)}(n,r,o),function(t,n,e){(0,e.maxWidthFunction)(t,n.maxWidth)}(n,r,o),{layout:r.layout,placement:r.placement}},Ys=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Xs=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=t*o,i=n*o,u=function(t){return Ft(e,t).getOr([])},a=function(t,n,e){var o=gt(Ys,e);return{offset:ce(t,n),classesOn:ft(e,u),classesOff:ft(o,u)}};return{southeast:function(){return a(-t,n,["top","alignLeft"])},southwest:function(){return a(t,n,["top","alignRight"])},south:function(){return a(-t/2,n,["top","alignCentre"])},northeast:function(){return a(-t,-n,["bottom","alignLeft"])},northwest:function(){return a(t,-n,["bottom","alignRight"])},north:function(){return a(-t/2,-n,["bottom","alignCentre"])},east:function(){return a(t,-n/2,["valignCentre","left"])},west:function(){return a(-t,-n/2,["valignCentre","right"])},insetNortheast:function(){return a(r,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-r,i,["top","alignRight","inset"])},insetNorth:function(){return a(-r/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(r,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-r,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-r/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-r,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(r,-i/2,["valignCentre","left","inset"])}}},Ks=function(){return Xs(0,0,{})},Js=L,$s=function(t,n){return function(e){return"rtl"===Qs(e)?n:t}},Qs=function(t){return"rtl"===Jn(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(Ms||(Ms={}));var Zs="data-alloy-vertical-dir",tl=function(t){return Ec(t,function(t){return cn(t)&&Hn(t,"data-alloy-vertical-dir")===Ms.BottomToTop})},nl=function(){return Br("layouts",[vr("onLtr"),vr("onRtl"),Or("onBottomLtr"),Or("onBottomRtl")])},el=function(t,n,e,o,r,i,u){var a=u.map(tl).getOr(!1),c=n.layouts.map(function(n){return n.onLtr(t)}),s=n.layouts.map(function(n){return n.onRtl(t)}),l=a?n.layouts.bind(function(n){return n.onBottomLtr.map(function(n){return n(t)})}).or(c).getOr(r):c.getOr(e),f=a?n.layouts.bind(function(n){return n.onBottomRtl.map(function(n){return n(t)})}).or(s).getOr(i):s.getOr(o);return $s(l,f)(t)},ol=[vr("hotspot"),Or("bubble"),Ir("overrides",{}),nl(),Ia("placement",function(t,n,e){var o=n.hotspot,r=Ts(e,o.element),i=el(t.element,n,ds(),ms(),ls(),fs(),G.some(n.hotspot.element));return G.some(Js({anchorBox:r,bubble:n.bubble.getOr(Ks()),overrides:n.overrides,layouts:i}))})],rl=[vr("x"),vr("y"),Ir("height",0),Ir("width",0),Ir("bubble",Ks()),Ir("overrides",{}
2),nl(),Ia("placement",function(t,n,e){var o=As(e,n.x,n.y),r=lo(o.left,o.top,n.width,n.height),i=el(t.element,n,cs(),ss(),cs(),ss(),G.none());return G.some(Js({anchorBox:r,bubble:n.bubble,overrides:n.overrides,layouts:i}))})],il=Ur([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),ul=function(t){return t.fold(L,function(t,n,e){return t.translate(-n,-e)})},al=function(t){return t.fold(L,L)},cl=function(t){return at(t,function(t,n){return t.translate(n.left,n.top)},ce(0,0))},sl=function(t){var n=et(t,al);return cl(n)},ll=il.screen,fl=il.absolute,dl=function(t,n,e){var o=bn(t.element),r=eo(o),i=function(t,n,e){var o=wn(e.root).dom;return G.from(o.frameElement).map(tn).filter(function(n){var e=bn(n),o=bn(t.element);return hn(e,o)}).map(le)}(t,0,e).getOr(r);return fl(i,r.left,r.top)},ml=function(t,n,e,o){var r=ll(ce(t,n));return G.some(function(t,n,e){return{point:t,width:n,height:e}}(r,e,o))},gl=function(t,n,e,o,r){return t.map(function(t){var i,u,a,c=[n,t.point],s=(i=function(){return sl(c)},u=function(){return sl(c)},a=function(){return function(t){var n=et(t,ul);return cl(n)}(c)},o.fold(i,u,a)),l={x:s.left,y:s.top,width:t.width,height:t.height},f=e.showAbove?ls():ds(),d=e.showAbove?fs():ms(),m=el(r,e,f,d,f,d,G.none());return Js({anchorBox:l,bubble:e.bubble.getOr(Ks()),overrides:e.overrides,layouts:m})})},pl=[vr("node"),vr("root"),Or("bubble"),nl(),Ir("overrides",{}),Ir("showAbove",!1),Ia("placement",function(t,n,e){var o=dl(t,0,n);return n.node.filter(Rn).bind(function(r){var i=r.dom.getBoundingClientRect(),u=ml(i.left,i.top,i.width,i.height),a=n.node.getOr(t.element);return gl(u,o,n,e,a)})})],hl=function(t,n,e,o){return{start:t,soffset:n,finish:e,foffset:o}},vl=Ur([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bl=(vl.before,vl.on,vl.after,function(t){return t.fold(L,L,L)}),yl=Ur([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),xl={domRange:yl.domRange,relative:yl.relative,exact:yl.exact,exactFromRange:function(t){return yl.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var n=function(t){return t.match({domRange:function(t){return tn(t.startContainer)},relative:function(t,n){return bl(t)},exact:function(t,n,e,o){return t}})}(t);return wn(n)},range:hl},wl=function(t,n,e){var o,r=t.document.createRange();return o=r,n.fold(function(t){o.setStartBefore(t.dom)},function(t,n){o.setStart(t.dom,n)},function(t){o.setStartAfter(t.dom)}),function(t,n){n.fold(function(n){t.setEndBefore(n.dom)},function(n,e){t.setEnd(n.dom,e)},function(n){t.setEndAfter(n.dom)})}(r,e),r},Sl=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i},Cl=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},kl=Ur([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Ol=function(t,n,e){return n(tn(e.startContainer),e.startOffset,tn(e.endContainer),e.endOffset)},_l=function(t,n){return function(t,n){var e=function(t,n){return n.match({domRange:function(t){return{ltr:N(t),rtl:G.none}},relative:function(n,e){return{ltr:pe(function(){return wl(t,n,e)}),rtl:pe(function(){return G.some(wl(t,e,n))})}},exact:function(n,e,o,r){return{ltr:pe(function(){return Sl(t,n,e,o,r)}),rtl:pe(function(){return G.some(Sl(t,o,r,n,e))})}}})}(t,n);return function(t,n){var e=n.ltr();return e.collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return kl.rtl(tn(t.endContainer),t.endOffset,tn(t.startContainer),t.startOffset)}).getOrThunk(function(){return Ol(0,kl.ltr,e)}):Ol(0,kl.ltr,e)}(0,e)}(t,n).match({ltr:function(n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i},rtl:function(n,e,o,r){var i=t.document.createRange();return i.setStart(o.dom,r),i.setEnd(n.dom,e),i}})};kl.ltr,kl.rtl;var Tl,El=function(t,n,e){return it(function(t,n){for(var e=A(n)?n:W,o=t.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var i=o.parentNode,u=tn(i);if(r.push(u),!0===e(u))break;o=i}return r}(t,e),n)},Al=function(t,n){return function(t,n){var e=void 0===n?document:n.dom;return gn(e)?[]:et(e.querySelectorAll(t),tn)}(n,t)},Ml=function(t){if(t.rangeCount>0){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return G.some(hl(tn(n.startContainer),n.startOffset,tn(e.endContainer),e.endOffset))}return G.none()},Dl=function(t){if(null===t.anchorNode||null===t.focusNode)return Ml(t);var n=tn(t.anchorNode),e=tn(t.focusNode);return function(t,n,e,o){var r=function(t,n,e,o){var r=bn(t).dom.createRange();return r.setStart(t.dom,n),r.setEnd(e.dom,o),r}(t,n,e,o),i=hn(t,e)&&n===o;return r.collapsed&&!i}(n,t.anchorOffset,e,t.focusOffset)?G.some(hl(n,t.anchorOffset,e,t.focusOffset)):Ml(t)},Bl=function(t,n){return function(t){var n=t.getClientRects(),e=n.length>0?n[0]:t.getBoundingClientRect();return e.width>0||e.height>0?G.some(e).map(Cl):G.none()}(_l(t,n))},Il=function(t){var n=function(n){return t(n)?G.from(n.dom.nodeValue):G.none()};return{get:function(e){if(!t(e))throw new Error("Can only get text value of a text node");return n(e).getOr("")},getOption:n,set:function(n,e){if(!t(n))throw new Error("Can only set raw text value of a text node");n.dom.nodeValue=e}}}(sn),Fl=function(t,n){return{element:t,offset:n}},Rl=function(t,n){return sn(t)?Fl(t,n):function(t,n){var e=On(t);if(0===e.length)return Fl(t,n);if(n<e.length)return Fl(e[n],0);var o=e[e.length-1],r=sn(o)?function(t){return Il.get(t)}(o).length:On(o).length;return Fl(o,r)}(t,n)},Nl=function(t){return void 0!==t.foffset},Ll=function(t,n){return n.getSelection.getOrThunk(function(){return function(){return function(t){return function(t){return G.from(t.getSelection())}(t).filter(function(t){return t.rangeCount>0}).bind(Dl)}(t)}})().map(function(t){if(Nl(t)){var n=Rl(t.start,t.soffset),e=Rl(t.finish,t.foffset);return xl.range(n.element,n.offset,e.element,e.offset)}return t})},zl=[Or("getSelection"),vr("root"),Or("bubble"),nl(),Ir("overrides",{}),Ir("showAbove",!1),Ia("placement",function(t,n,e){var o=wn(n.root).dom,r=dl(t,0,n),i=Ll(o,n).bind(function(t){if(Nl(t)){var n=function(t,n){return function(t){var n=t.getBoundingClientRect();return n.width>0||n.height>0?G.some(n).map(Cl):G.none()}(_l(t,n))}(o,xl.exactFromRange(t)).orThunk(function(){var n=Zt("\ufeff");Ke(t.start,n);var e=Bl(o,xl.exact(n,0,n,1));return no(n),e});return n.bind(function(t){return ml(t.left,t.top,t.width,t.height)})}var e=_t(t,function(t){return t.dom.getBoundingClientRect()}),r={left:Math.min(e.firstCell.left,e.lastCell.left),right:Math.max(e.firstCell.right,e.lastCell.right),top:Math.min(e.firstCell.top,e.lastCell.top),bottom:Math.max(e.firstCell.bottom,e.lastCell.bottom)};return ml(r.left,r.top,r.right-r.left,r.bottom-r.top)}),u=Ll(o,n).bind(function(t){return Nl(t)?cn(t.start)?G.some(t.start):Cn(t.start):G.some(t.firstCell)}).getOr(t.element);return gl(i,r,n,e,u)})],Pl="link-layout",Vl=function(t){return t.x+t.width},Hl=function(t,n){return t.x-n.width},Ul=function(t,n){return t.y-n.height+t.height},Wl=function(t){return t.y},jl=function(t,n,e){return Nc(Vl(t),Wl(t),e.southeast(),zc(),"southeast",qc(t,{left:0,top:2}),Pl)},Gl=function(t,n,e){return Nc(Hl(t,n),Wl(t),e.southwest(),Pc(),"southwest",qc(t,{right:1,top:2}),Pl)},ql=function(t,n,e){return Nc(Vl(t),Ul(t,n),e.northeast(),Vc(),"n
2ortheast",qc(t,{left:0,bottom:3}),Pl)},Yl=function(t,n,e){return Nc(Hl(t,n),Ul(t,n),e.northwest(),Hc(),"northwest",qc(t,{right:1,bottom:3}),Pl)},Xl=function(){return[jl,Gl,ql,Yl]},Kl=function(){return[Gl,jl,Yl,ql]},Jl=[vr("item"),nl(),Ir("overrides",{}),Ia("placement",function(t,n,e){var o=Ts(e,n.item.element),r=el(t.element,n,Xl(),Kl(),Xl(),Kl(),G.none());return G.some(Js({anchorBox:o,bubble:Ks(),overrides:n.overrides,layouts:r}))})],$l=dr("type",{selection:zl,node:pl,hotspot:ol,submenu:Jl,makeshift:rl}),Ql=[kr("classes",tr),Lr("mode","all",["all","layout","placement"])],Zl=[Ir("useFixed",W),Or("getBounds")],tf=[br("anchor",$l),Br("transition",Ql)],nf=function(t,n,e,o,r,i){var u=lr("placement.info",Yo(tf),r),a=u.anchor,c=o.element,s=e.get(o.uid);Cs(function(){Yn(c,"position","fixed");var r=Qn(c,"visibility");Yn(c,"visibility","hidden");var l=n.useFixed()?function(){var t=document.documentElement;return Bs(0,0,t.clientWidth,t.clientHeight)}():function(t){var n=le(t.element),e=t.element.dom.getBoundingClientRect();return Ds(n.left,n.top,e.width,e.height)}(t);a.placement(t,a,l).each(function(t){var r=i.orThunk(function(){return n.getBounds.map(U)}),a=function(t,n,e,o,r,i){return function(t,n,e,o,r,i,u,a){var c=Gs(u,"maxHeightFunction",Ws()),s=Gs(u,"maxWidthFunction",I),l=t.anchorBox,f=t.origin,d={bounds:Es(f,i),origin:f,preference:o,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:r,transition:a};return qs(l,n,e,d)}(function(t,n){return function(t,n){return{anchorBox:t,origin:n}}(t,n)}(n.anchorBox,t),o.element,n.bubble,n.layouts,r,e,n.overrides,i)}(l,t,r,o,s,u.transition);e.set(o.uid,a)}),r.fold(function(){ne(c,"visibility")},function(t){Yn(c,"visibility",t)}),Qn(c,"left").isNone()&&Qn(c,"top").isNone()&&Qn(c,"right").isNone()&&Qn(c,"bottom").isNone()&&Lt(Qn(c,"position"),"fixed")&&ne(c,"position")},c)},ef=Object.freeze({__proto__:null,position:function(t,n,e,o,r){var i=G.none();nf(t,n,e,o,r,i)},positionWithinBounds:nf,getMode:function(t,n,e){return n.useFixed()?"fixed":"absolute"},reset:function(t,n,e,o){var r=o.element;ot(["position","left","right","top","bottom"],function(t){return ne(r,t)}),function(t){jn(t,Is)}(r),e.clear(o.uid)}}),of=Ou({fields:Zl,name:"positioning",active:vs,apis:ef,state:Object.freeze({__proto__:null,init:function(){var t={};return Su({readState:function(){return t},clear:function(n){O(n)?delete t[n]:t={}},set:function(n,e){t[n]=e},get:function(n){return Ft(t,n)}})}})}),rf=function(t){return t.getSystem().isConnected()},uf=function(t){Xi(t,zi());var n=t.components();ot(n,uf)},af=function(t){var n=t.components();ot(n,af),Xi(t,Li())},cf=function(t,n){t.getSystem().addToWorld(n),Rn(t.element)&&af(n)},sf=function(t){uf(t),t.getSystem().removeFromWorld(t)},lf=function(t,n){Qe(t.element,n.element)},ff=function(t,n){df(t,n,Qe)},df=function(t,n,e){t.getSystem().addToWorld(n),e(t.element,n.element),Rn(t.element)&&af(n),t.syncComponents()},mf=function(t){uf(t),no(t.element),t.getSystem().removeFromWorld(t)},gf=function(t){var n=Sn(t.element).bind(function(n){return t.getSystem().getByDom(n).toOptional()});mf(t),n.each(function(t){t.syncComponents()})},pf=function(t){var n=t.components();ot(n,mf),to(t.element),t.syncComponents()},hf=function(t,n){bf(t,n,Qe)},vf=function(t,n){bf(t,n,Je)},bf=function(t,n,e){e(t,n.element);var o=On(n.element);ot(o,function(t){n.getByDom(t).each(af)})},yf=function(t){var n=On(t.element);ot(n,function(n){t.getByDom(n).each(uf)}),no(t.element)},xf=function(t,n,e,o){e.get().each(function(n){pf(t)});var r=n.getAttachPoint(t);ff(r,t);var i=t.getSystem().build(o);return ff(t,i),e.set(i),i},wf=function(t,n,e,o){var r=xf(t,n,e,o);return n.onOpen(t,r),r},Sf=function(t,n,e){e.get().each(function(o){pf(t),gf(t),n.onClose(t,o),e.clear()})},Cf=function(t,n,e){return e.isOpen()},kf=function(t,n,e){var o=n.getAttachPoint(t);Yn(t.element,"position",of.getMode(o)),function(t,n,e){Qn(t.element,n).fold(function(){jn(t.element,e)},function(n){Pn(t.element,e,n)}),Yn(t.element,n,"hidden")}(t,"visibility",n.cloakVisibilityAttr)},Of=function(t,n,e){(function(t){return Z(["top","left","right","bottom"],function(n){return Qn(t,n).isSome()})})(t.element)||ne(t.element,"position"),function(t,n,e){Un(t.element,e).fold(function(){return ne(t.element,n)},function(e){return Yn(t.element,n,e)})}(t,"visibility",n.cloakVisibilityAttr)},_f=Object.freeze({__proto__:null,cloak:kf,decloak:Of,open:wf,openWhileCloaked:function(t,n,e,o,r){kf(t,n),wf(t,n,e,o),r(),Of(t,n)},close:Sf,isOpen:Cf,isPartOf:function(t,n,e,o){return Cf(0,0,e)&&e.get().exists(function(e){return n.isPartOf(t,e,o)})},getState:function(t,n,e){return e.get()},setContent:function(t,n,e,o){return e.get().map(function(){return xf(t,n,e,o)})}}),Tf=Object.freeze({__proto__:null,events:function(t,n){return tu([ou(Mi(),function(e,o){Sf(e,t,n)})])}}),Ef=[Aa("onOpen"),Aa("onClose"),vr("isPartOf"),vr("getAttachPoint"),Ir("cloakVisibilityAttr","data-precloak-visibility")],Af=Object.freeze({__proto__:null,init:function(){var t=yo(),n=N("not-implemented");
2return Su({readState:n,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}}),Mf=Ou({fields:Ef,name:"sandboxing",active:Tf,apis:_f,state:Af}),Df=N("dismiss.popups"),Bf=N("reposition.popups"),If=N("mouse.released"),Ff=qo([Ir("isExtraPart",W),Br("fireEventInstead",[Ir("event",Pi())])]),Rf=function(t){var n=lr("Dismissal",Ff,t);return T({},Df(),{schema:qo([vr("target")]),onReceive:function(t,e){Mf.isOpen(t)&&(Mf.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold(function(){return Mf.close(t)},function(n){return Xi(t,n.event)}))}})},Nf=qo([Br("fireEventInstead",[Ir("event",Vi())]),wr("doReposition")]),Lf=function(t){var n=lr("Reposition",Nf,t);return T({},Bf(),{onReceive:function(t){Mf.isOpen(t)&&n.fireEventInstead.fold(function(){return n.doReposition(t)},function(n){return Xi(t,n.event)})}})},zf=function(t,n,e){n.store.manager.onLoad(t,n,e)},Pf=function(t,n,e){n.store.manager.onUnload(t,n,e)},Vf=Object.freeze({__proto__:null,onLoad:zf,onUnload:Pf,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Hf=Object.freeze({__proto__:null,events:function(t,n){var e=t.resetOnDom?[fu(function(e,o){zf(e,t,n)}),du(function(e,o){Pf(e,t,n)})]:[bu(t,n,zf)];return tu(e)}}),Uf=function(){var t=ho(null);return Su({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()}}})},Wf=function(){var t=ho({}),n=ho({});return Su({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:n.get()}},lookup:function(e){return Ft(t.get(),e).orThunk(function(){return Ft(n.get(),e)})},update:function(e){var o=t.get(),r=n.get(),i={},u={};ot(e,function(t){i[t.value]=t,Ft(t,"meta").each(function(n){Ft(n,"text").each(function(n){u[n]=t})})}),t.set(_(_({},o),i)),n.set(_(_({},r),u))},clear:function(){t.set({}),n.set({})}})},jf=Object.freeze({__proto__:null,memory:Uf,dataset:Wf,manual:function(){return Su({readState:I})},init:function(t){return t.store.manager.state(t)}}),Gf=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},qf=[Or("initialValue"),vr("getFallbackEntry"),vr("getDataKey"),vr("setValue"),Ia("manager",{setValue:Gf,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(t,n,e){n.store.initialValue.each(function(o){Gf(t,n,e,o)})},onUnload:function(t,n,e){e.clear()},state:Wf})],Yf=[vr("getValue"),Ir("setValue",I),Or("initialValue"),Ia("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(t,n,e){n.store.initialValue.each(function(e){n.store.setValue(t,e)})},onUnload:I,state:wu.init})],Xf=[Or("initialValue"),Ia("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Uf})],Kf=[Fr("store",{mode:"memory"},dr("mode",{memory:Xf,manual:Yf,dataset:qf})),Aa("onSetValue"),Ir("resetOnDom",!1)],Jf=Ou({fields:Kf,name:"representing",active:Hf,apis:Vf,extra:{setValueFrom:function(t,n){var e=Jf.getValue(n);Jf.setValue(t,e)}},state:jf}),$f=function(t,n){return Hr(t,{},et(n,function(n){return e=n.name(),o="Cannot configure "+n.name()+" for "+t,gr(e,e,{tag:"option",process:{}},Ho(function(t){return Eo("The field: "+e+" is forbidden. "+o)}));var e,o}).concat([pr("dump",L)]))},Qf=function(t){return t.dump},Zf=function(t,n){return _(_({},Cu(n)),t.dump)},td=$f,nd=Zf,ed="placeholder",od=Ur([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),rd=function(t){return Rt(t,"uiType")},id=function(t,n,e,o){return function(t,n,e,o){return rd(e)&&e.uiType===ed?function(t,n,e,o){return t.exists(function(t){return t!==e.owner})?od.single(!0,N(e)):Ft(o,e.name).fold(function(){throw new Error("Unknown placeholder component: "+e.name+"\nKnown: ["+Ct(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(e,null,2))},function(t){return t.replace()})}(t,0,e,o):od.single(!1,N(e))}(t,0,e,o).fold(function(r,i){var u=rd(e)?i(n,e.config,e.validated):i(n),a=Ft(u,"components").getOr([]),c=ft(a,function(e){return id(t,n,e,o)});return[_(_({},u),{},{components:c})]},function(t,o){if(rd(e)){var r=o(n,e.config,e.validated);return e.validated.preprocess.getOr(L)(r)}return o(n)})},ud=od.single,ad=od.multiple,cd=N(ed),sd=Ur([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),ld=Ir("factory",{sketch:L}),fd=Ir("schema",[]),dd=vr("name"),md=gr("pname","pname",Ro(function(t){return"<alloy."+Wa(t.name)+">"}),$o()),gd=pr("schema",function(){return[Or("preprocess")]}),pd=Ir("defaults",N({})),hd=Ir("overrides",N({})),vd=Yo([ld,fd,dd,md,pd,hd]),bd=Yo([ld,fd,dd,pd,hd]),yd=Yo([ld,fd,dd,md,pd,hd]),xd=Yo([ld,gd,dd,vr("unit"),md,pd,hd]),wd=function(t){return t.fold(G.some,G.none,G.some,G.some)}
2,Sd=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Cd=function(t,n){return function(e){var o=lr("Converting part type",n,e);return t(o)}},kd=Cd(sd.required,vd),Od=Cd(sd.external,bd),_d=Cd(sd.optional,yd),Td=Cd(sd.group,xd),Ed=N("entirety"),Ad=Object.freeze({__proto__:null,required:kd,external:Od,optional:_d,group:Td,asNamedPart:wd,name:Sd,asCommon:function(t){return t.fold(L,L,L,L)},original:Ed}),Md=function(t,n,e,o){return Io(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Dd=function(t,n){var e={};return ot(n,function(n){wd(n).each(function(n){var o=Bd(t,n.pname);e[n.name]=function(e){var r=lr("Part: "+n.name+" in "+t,Yo(n.schema),e);return _(_({},o),{},{config:e,validated:r})}})}),e},Bd=function(t,n){return{uiType:cd(),owner:t,name:n}},Id=function(t,n,e){return{uiType:cd(),owner:t,name:n,config:e,validated:{}}},Fd=function(t){return ft(t,function(t){return t.fold(G.none,G.some,G.none,G.none).map(function(t){return Sr(t.name,t.schema.concat([Fa(Ed())]))}).toArray()})},Rd=function(t){return et(t,Sd)},Nd=function(t,n,e){return function(t,n,e){var o={},r={};return ot(e,function(t){t.fold(function(t){o[t.pname]=ud(!0,function(n,e,o){return t.factory.sketch(Md(n,t,e,o))})},function(t){var e=n.parts[t.name];r[t.name]=N(t.factory.sketch(Md(n,t,e[Ed()]),e))},function(t){o[t.pname]=ud(!1,function(n,e,o){return t.factory.sketch(Md(n,t,e,o))})},function(t){o[t.pname]=ad(!0,function(n,e,o){var r=n[t.name];return et(r,function(e){return t.factory.sketch(Io(t.defaults(n,e,o),e,t.overrides(n,e)))})})})}),{internals:N(o),externals:N(r)}}(0,n,e)},Ld=function(t,n,e){return function(t,n,e,o){var r=_t(o,function(t,n){return function(t,n){var e=!1;return{name:N(t),required:function(){return n.fold(function(t,n){return t},function(t,n){return t})},used:function(){return e},replace:function(){if(e)throw new Error("Trying to use the same placeholder more than once: "+t);return e=!0,n}}}(n,t)}),i=function(t,n,e,o){return ft(e,function(e){return id(t,n,e,o)})}(t,n,e,r);return Ot(r,function(e){if(!1===e.used()&&e.required())throw new Error("Placeholder: "+e.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(n.components,null,2))}),i}(G.some(t),n,n.components,e)},zd=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()},Pd=function(t,n,e){return zd(t,n,e).getOrDie("Could not find part: "+e)},Vd=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ot(e,function(t){o[t]=N(i.getByUid(r[t]))}),o},Hd=function(t,n){var e=t.getSystem();return _t(n.partUids,function(t,n){return N(e.getByUid(t))})},Ud=function(t){return Ct(t.partUids)},Wd=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ot(e,function(t){o[t]=N(i.getByUid(r[t]).getOrDie())}),o},jd=function(t,n){var e=Rd(n);return qr(et(e,function(n){return{key:n,value:t+"-"+n}}))},Gd=function(t){return gr("partUids","partUids",Lo(function(n){return jd(n.uid,t)}),$o())},qd=Object.freeze({__proto__:null,generate:Dd,generateOne:Id,schemas:Fd,names:Rd,substitutes:Nd,components:Ld,defaultUids:jd,defaultUidsSchema:Gd,getAllParts:Hd,getAllPartNames:Ud,getPart:zd,getPartOrDie:Pd,getParts:Vd,getPartsOrDie:Wd}),Yd=function(t,n,e,o,r){var i=function(t,n){return(t.length>0?[Sr("parts",t)]:[]).concat([vr("uid"),Ir("dom",{}),Ir("components",[]),Fa("originalSpec"),Ir("debug.sketcher",{})]).concat(n)}(o,r);return lr(t+" [SpecSchema]",qo(i.concat(n)),e)},Xd=function(t,n,e,o,r){var i=Kd(r),u=Fd(e),a=Gd(e),c=Yd(t,n,i,u,[a]),s=Nd(0,c,e);return o(c,Ld(t,c,s.internals()),i,s.externals())},Kd=function(t){return function(t){return Rt(t,"uid")}(t)?t:_(_({},t),{},{uid:Ja("uid")})},Jd=qo([vr("name"),vr("factory"),vr("configFields"),Ir("apis",{}),Ir("extraApis",{})]),$d=qo([vr("name"),vr("factory"),vr("configFields"),vr("partFields"),Ir("apis",{}),Ir("extraApis",{})]),Qd=function(t){var n=lr("Sketcher for "+t.name,Jd,t),e=_t(n.apis,oc),o=_t(n.extraApis,function(t,n){return hu(t,n)});return _(_({name:n.name,configFields:n.configFields,sketch:function(t){return function(t,n,e,o){var r=Kd(o);return e(Yd(t,n,r,[],[]),r)}(n.name,n.configFields,n.factory,t)}},e),o)},Zd=function(t){var n=lr("Sketcher for "+t.name,$d,t),e=Dd(n.name,n.partFields),o=_t(n.apis,oc),r=_t(n.extraApis,function(t,n){return hu(t,n)});return _(_({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Xd(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)},tm=function(t){return dn("input")(t)&&"radio"!==Hn(t,"type")||dn("textarea")(t)},nm=Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),em=[vr("find")],om=Ou({fields:em,name:"composing",apis:nm}),rm=["input","button","textarea","select"],im=function(t,n,e){(n.disabled()?fm:dm)(t,n)},um=function(t,n){return!0===n.useNative&&Q(rm,rn(t.element))},am=function(t){Pn(t.element,"disabled","disabled")},cm=function(t){jn(t.element,"disabled")},sm=function(t){Pn(t.element,"aria-disabled","true")},lm=function(t){Pn(t.element,"aria-disabled","false")},fm=function(t,n,e){n.disableClass.each(function(n){Fu(t.element,n)}),(um(t,n)?am:sm)(t),n.onDisabled(t)},dm=function(t,n,e){n.disableClass.each(function(n){Nu(t.element,n)}),(um(t,n)?cm:lm)(t),n.onEnabled(t)},mm=function(t,n){return um(t,n)?function(t){return Wn(t.element,"disabled")}(t):function(t){return"true"===Hn(t.element,"aria-disabled")}(t)},gm=Object.freeze({__proto__:null,enable:dm,disable:fm,isDisabled:mm,onLoad:im,set:function(t,n,e,o){(o?fm:dm)(t,n)}}),pm=Object.freeze({__proto__:null,exhibit:function(t,n){return vu({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(t,n){return tu([nu(_i(),function(n,e){return mm(n,t)}),bu(t,n,im)])}}),hm=[Pr("disabled",W),Ir("useNative",!0),Or("disableClass"),Aa("onDisabled"),Aa("onEnabled")],vm=Ou({fields:hm,name:"disabling",active:pm,apis:gm}),bm=function(t,n,e,o){var r=Al(t.element,"."+n.highlightClass);ot(r,function(e){Z(o,function(t){return hn(t.element,e)})||(Nu(e,n.highlightClass),t.getSystem().getByDom(e).each(function(e){n.onDehighlight(t,e),Xi(e,Yi())}))})},ym=function(t,n,e,o){bm(t,n,0,[o]),xm(t,n,e,o)||(Fu(o.element,n.highlightClass),n.onHighlight(t,o),Xi(o,qi()))},xm=function(t,n,e,o){return Lu(o.element,n.highlightClass)},wm=function(t,n,e){return Dc(t.element,"."+n.itemClass).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},Sm=function(t,n,e){var o=Al(t.element,"."+n.itemClass);return(o.length>0?G.some(o[o.length-1]):G.none()).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},Cm=function(t,n,e,o){var r=Al(t.element,"."+n.itemClass);return st(r,function(t){return Lu(t,n.highlightClass)}).bind(function(n){var e=Va(n,o,0,r.length-1);return t.getSystem().getByDom(r[e]).toOptional()})},km=function(t,n,e){var o=Al(t.element,"."+n.itemClass);return zt(et(o,function(n){return t.getSystem().getByDom(n).toOptional()}))},Om=Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return bm(t,n,0,[])},dehighlight:function(t,n,e,o){xm(t,n,e,o)&&(Nu(o.element,n.highlightClass),n.onDehighlight(t,o),Xi(o,Yi()))},highlight:ym,highlightFirst:function(t,n,e){wm(t,n).each(function(o){ym(t,n,e,o)})},highlightLast:function(t,n,e){Sm(t,n).each(function(o){ym(t,n,e,o)})},highlightAt:function(t,n,e,o){(function(t,n,e,o){var r=Al(t.element,"."+n.itemClass);return G.from(r[o]).fold(function(){return Co.error(new Error("No element found with index "+o))},t.getSystem().getByDom)})(t,n,0,o).fold(function(t){throw t},function(o){ym(t,n,e,o)})},highlightBy:function(t,n,e,o){var r=km(t,n);ct(r,o).each(function(o){ym(t,n,e,o)})},isHighlighted:xm,getHighlighted:function(t,n,e){return Dc(t.element,"."+n.highlightClass).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},getFirst:wm,getLast:Sm,getPrevious:function(t,n,e){return Cm(t,n,0,-1)},getNext:function(t,n,e){return Cm(t,n,0,1)},getCandidates:km}),_m=[vr("highlightClass"),vr("itemClass"),Aa("onHighlight"),Aa("onDehighlight")],Tm=Ou({fields:_m,name:"highlighting",apis:Om}
2),Em=[8],Am=[9],Mm=[13],Dm=[27],Bm=[32],Im=[37],Fm=[38],Rm=[39],Nm=[40],Lm=function(t,n,e){var o=mt(t.slice(0,n)),r=mt(t.slice(n+1));return ct(o.concat(r),e)},zm=function(t,n,e){var o=mt(t.slice(0,n));return ct(o,e)},Pm=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return ct(r.concat(o),e)},Vm=function(t,n,e){var o=t.slice(n+1);return ct(o,e)},Hm=function(t){return function(n){var e=n.raw;return Q(t,e.which)}},Um=function(t){return function(n){return dt(t,function(t){return t(n)})}},Wm=function(t){return!0===t.raw.shiftKey},jm=function(t){return!0===t.raw.ctrlKey},Gm=V(Wm),qm=function(t,n){return{matches:t,classification:n}},Ym=function(t,n,e){n.exists(function(t){return e.exists(function(n){return hn(n,t)})})||Ki(t,Hi(),{prevFocus:n,newFocus:e})},Xm=function(){var t=function(t){return Ss(t.element)};return{get:t,set:function(n,e){var o=t(n);n.getSystem().triggerFocus(e,n.element);var r=t(n);Ym(n,o,r)}}},Km=function(){var t=function(t){return Tm.getHighlighted(t).map(function(t){return t.element})};return{get:t,set:function(n,e){var o=t(n);n.getSystem().getByDom(e).fold(I,function(t){Tm.highlight(n,t)});var r=t(n);Ym(n,o,r)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(Tl||(Tl={}));var Jm,$m=function(t,n,e,o,r){var i=function(t,n,e,o,r){return(i=e(t,n,o,r),u=n.event,ct(i,function(t){return t.matches(u)}).map(function(t){return t.classification})).bind(function(e){return e(t,n,o,r)});var i,u},u={schema:function(){return t.concat([Ir("focusManager",Xm()),Fr("focusInside","onFocus",ur(function(t){return Q(["onFocus","onEnterOrSpace","onApi"],t)?Co.value(t):Co.error("Invalid value for focusInside")})),Ia("handler",u),Ia("state",n),Ia("sendFocusIn",r)])},processKey:i,toEvents:function(t,n){var u=t.focusInside!==Tl.OnFocusMode?G.none():r(t).map(function(e){return ou(Si(),function(o,r){e(o,t,n),r.stop()})}),a=[ou(fi(),function(o,u){i(o,u,e,t,n).fold(function(){!function(e,o){var i=Hm(Bm.concat(Mm))(o.event);t.focusInside===Tl.OnEnterOrSpaceMode&&i&&Jr(e,o)&&r(t).each(function(r){r(e,t,n),o.stop()})}(o,u)},function(t){u.stop()})}),ou(di(),function(e,r){i(e,r,o,t,n).each(function(t){r.stop()})})];return tu(u.toArray().concat(a))}};return u},Qm=function(t){var n=[Or("onEscape"),Or("onEnter"),Ir("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ir("firstTabstop",0),Ir("useTabstopAt",j),Or("visibilitySelector")].concat([t]),e=function(t,n){var e=t.visibilitySelector.bind(function(t){return Bc(n,t)}).getOr(n);return ie(e)>0},o=function(t,n){return n.focusManager.get(t).bind(function(t){return Bc(t,n.selector)})},r=function(t,n,o){(function(t,n){var o=Al(t.element,n.selector),r=it(o,function(t){return e(n,t)});return G.from(r[n.firstTabstop])})(t,n).each(function(e){n.focusManager.set(t,e)})},i=function(t,n,r,i){var u=Al(t.element,r.selector);return o(t,r).bind(function(n){return st(u,P(hn,n)).bind(function(n){return function(t,n,o,r,i){return i(n,o,function(t){return function(t,n){return e(t,n)&&t.useTabstopAt(n)}(r,t)}).fold(function(){return r.cyclic?G.some(!0):G.none()},function(n){return r.focusManager.set(t,n),G.some(!0)})}(t,u,n,r,i)})})},u=function(t,n,e){var o=e.cyclic?Lm:zm;return i(t,0,e,o)},a=function(t,n,e){var o=e.cyclic?Pm:Vm;return i(t,0,e,o)},c=N([qm(Um([Wm,Hm(Am)]),u),qm(Hm(Am),a),qm(Um([Gm,Hm(Mm)]),function(t,n,e){return e.onEnter.bind(function(e){return e(t,n)})})]),s=N([qm(Hm(Dm),function(t,n,e){return e.onEscape.bind(function(e){return e(t,n)})}),qm(Hm(Am),function(t,n,e){return o(t,e).filter(function(t){return!e.useTabstopAt(t)}).bind(function(o){return(function(t){return function(t){return Sn(t)}(t).bind(Tn).exists(function(n){return hn(n,t)})}(o)?u:a)(t,n,e)})})]);return $m(n,wu.init,c,s,function(){return G.some(r)})},Zm=Qm(pr("cyclic",W)),tg=Qm(pr("cyclic",j)),ng=function(t,n,e){return tm(e)&&Hm(Bm)(n.event)?G.none():function(t,n,e){return $i(t,e,_i()),G.some(!0)}(t,0,e)},eg=function(t,n){return G.some(!0)},og=[Ir("execute",ng),Ir("useSpace",!1),Ir("useEnter",!0),Ir("useControlEnter",!1),Ir("useDown",!1)],rg=function(t,n,e){return e.execute(t,n,t.element)},ig=$m(og,wu.init,function(t,n,e,o){var r=e.useSpace&&!tm(t.element)?Bm:[],i=e.useEnter?Mm:[],u=e.useDown?Nm:[],a=r.concat(i).c
2oncat(u);return[qm(Hm(a),rg)].concat(e.useControlEnter?[qm(Um([jm,Hm(Mm)]),rg)]:[])},function(t,n,e,o){return e.useSpace&&!tm(t.element)?[qm(Hm(Bm),eg)]:[]},function(){return G.none()}),ug=function(){var t=yo();return Su({readState:function(){return t.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set({numRows:n,numColumns:e})},getNumRows:function(){return t.get().map(function(t){return t.numRows})},getNumColumns:function(){return t.get().map(function(t){return t.numColumns})}})},ag=Object.freeze({__proto__:null,flatgrid:ug,init:function(t){return t.state(t)}}),cg=function(t){return function(n,e,o,r){var i=t(n.element);return dg(i,n,e,o,r)}},sg=function(t,n){var e=$s(t,n);return cg(e)},lg=function(t,n){var e=$s(n,t);return cg(e)},fg=function(t){return function(n,e,o,r){return dg(t,n,e,o,r)}},dg=function(t,n,e,o,r){return o.focusManager.get(n).bind(function(e){return t(n.element,e,o,r)}).map(function(t){return o.focusManager.set(n,t),!0})},mg=fg,gg=fg,pg=fg,hg=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},vg=function(t,n,e){var o=Al(t,e);return function(t){return st(t,function(t){return hn(t,n)}).map(function(n){return{index:n,candidates:t}})}(it(o,hg))},bg=function(t,n){return st(t,function(t){return hn(n,t)})},yg=function(t,n,e,o){return o(Math.floor(n/e),n%e).bind(function(n){var o=n.row*e+n.column;return o>=0&&o<t.length?G.some(t[o]):G.none()})},xg=function(t,n,e,o,r){return yg(t,n,o,function(n,i){var u=n===e-1?t.length-n*o:o,a=Va(i,r,0,u-1);return G.some({row:n,column:a})})},wg=function(t,n,e,o,r){return yg(t,n,o,function(n,i){var u=Va(n,r,0,e-1),a=u===e-1?t.length-u*o:o,c=Ha(i,0,a-1);return G.some({row:u,column:c})})},Sg=[vr("selector"),Ir("execute",ng),Ma("onEscape"),Ir("captureTab",!1),Ra()],Cg=function(t,n,e){Dc(t.element,n.selector).each(function(e){n.focusManager.set(t,e)})},kg=function(t){return function(n,e,o,r){return vg(n,e,o.selector).bind(function(n){return t(n.candidates,n.index,r.getNumRows().getOr(o.initSize.numRows),r.getNumColumns().getOr(o.initSize.numColumns))})}},Og=function(t,n,e){return e.captureTab?G.some(!0):G.none()},_g=kg(function(t,n,e,o){return xg(t,n,e,o,-1)}),Tg=kg(function(t,n,e,o){return xg(t,n,e,o,1)}),Eg=kg(function(t,n,e,o){return wg(t,n,e,o,-1)}),Ag=kg(function(t,n,e,o){return wg(t,n,e,o,1)}),Mg=N([qm(Hm(Im),sg(_g,Tg)),qm(Hm(Rm),lg(_g,Tg)),qm(Hm(Fm),mg(Eg)),qm(Hm(Nm),gg(Ag)),qm(Um([Wm,Hm(Am)]),Og),qm(Um([Gm,Hm(Am)]),Og),qm(Hm(Bm.concat(Mm)),function(t,n,e,o){return function(t,n){return n.focusManager.get(t).bind(function(t){return Bc(t,n.selector)})}(t,e).bind(function(o){return e.execute(t,n,o)})})]),Dg=N([qm(Hm(Dm),function(t,n,e){return e.onEscape(t,n)}),qm(Hm(Bm),eg)]),Bg=$m(Sg,ug,Mg,Dg,function(){return G.some(Cg)}),Ig=function(t,n,e,o,r){var i=function(t,n,e){return r(t,n,o,0,e.length-1,e[n],function(n){return o=e[n],"button"===rn(o)&&"disabled"===Hn(o,"disabled")?i(t,n,e):G.from(e[n]);var o})};return vg(t,e,n).bind(function(t){var n=t.index,e=t.candidates;return i(n,n,e)})},Fg=function(t,n,e,o){return Ig(t,n,e,o,function(t,n,e,o,r,i,u){var a=Ha(n+e,o,r);return a===t?G.from(i):u(a)})},Rg=function(t,n,e,o){return Ig(t,n,e,o,function(t,n,e,o,r,i,u){var a=Va(n,e,o,r);return a===t?G.none():u(a)})},Ng=[vr("selector"),Ir("getInitial",G.none),Ir("execute",ng),Ma("onEscape"),Ir("executeOnMove",!1),Ir("allowVertical",!0),Ir("allowHorizontal",!0),Ir("cycles",!0)],Lg=function(t,n,e){return function(t,n){return n.focusManager.get(t).bind(function(t){return Bc(t,n.selector)})}(t,e).bind(function(o){return e.execute(t,n,o)})},zg=function(t,n,e){n.getInitial(t).orThunk(function(){return Dc(t.element,n.selector)}).each(function(e){n.focusManager.set(t,e)})},Pg=function(t,n,e){return(e.cycles?Rg:Fg)(t,e.selector,n,-1)},Vg=function(t,n,e){return(e.cycles?Rg:Fg)(t,e.selector,n,1)},Hg=function(t){return function(n,e,o,r){return t(n,e,o,r).bind(function(){return o.executeOnMove?Lg(n,e,o):G.some(!0)})}},Ug=N([qm(Hm(Bm),eg),qm(Hm(Dm),function(t,n,e){return e.onEscape(t,n)})]),Wg=$m(Ng,wu.init,function(t,n,e,o){var r=w(e.allowHorizontal?Im:[]).concat(e.allowVertical?Fm:[]),i=w(e.allowHorizontal?Rm:[]).concat(e.allowVertical?Nm:[]);return[qm(Hm(r),Hg(sg(Pg,Vg))),qm(Hm(i),Hg(lg(Pg,Vg))),qm(Hm(Mm),Lg),qm(Hm(Bm),Lg)]},Ug,function(){return G.some(zg)}),jg=function(t,n,e){return G.from(t[n]).bind(function(t){return G.from(t[e]).map(function(t){return{rowIndex:n,columnIndex:e,cell:t}})})},Gg=function(t,n,e,o){var r=t[n].length,i=Va(e,o,0,r-1);return jg(t,n,i)},qg=function(t,n,e,o){var r=Va(e,o,0,t.length-1),i=t[r].length,u=Ha(n,0,i-1);return jg(t,r,u)},Yg=function(t,n,e,o){var r=t[n].length,i=Ha(e+o,0,r-1);return jg(t,n,i)},Xg=function(t,n,e,o){var r=Ha(e+o,0,t.length-1),i=t[r].length,u=Ha(n,0,i-1);return jg(t,r,u)},Kg=[Sr("selectors",[vr("row"),vr("cell")]),Ir("cycles",!0),Ir("previousSelector",G.none),Ir("execute",ng)],Jg=function(t,n,e){n.previousSelector(t).orThunk(function(){var e=n.selectors;return Dc(t.element,e.cell)}).each(function(e){n.focusManager.set(t,e)})},$g=function(t,n){return function(e,o,r){var i=r.cycles?t:n;return Bc(o,r.selectors.row).bind(function(t){var n=Al(t,r.selectors.cell);return bg(n,o).bind(function(n){var o=Al(e,r.selectors.row);return bg(o,t).bind(function(t){var e=function(t,n){return et(t,function(t){return Al(t,n.selectors.cell)})}(o,r);return i(e,t,n).map(function(t){return t.cell})})})})}},Qg=$g(function(t,n,e){return Gg(t,n,e,-1)},function(t,n,e){return Yg(t,n,e,-1)}),Zg=$g(function(t,n,e){return Gg(t,n,e,1)},function(t,n,e){return Yg(t,n,e,1)}),tp=$g(function(t,n,e){return qg(t,e,n,-1)},function(t,n,e){return Xg(t,e,n,-1)}),np=$g(function(t,n,e){return qg(t,e,n,1)},function(t,n,e){return Xg(t,e,n,1)}),ep=N([qm(Hm(Im),sg(Qg,Zg)),qm(Hm(Rm),lg(Qg,Zg)),qm(Hm(Fm),mg(tp)),qm(Hm(Nm),gg(np)),qm(Hm(Bm.concat(Mm)),function(t,n,e){return Ss(t.element).bind(function(o){return e.execute(t,n,o)})})]),op=N([qm(Hm(Bm),eg)]),rp=$m(Kg,wu.init,ep,op,function(){return G.some(Jg)}),ip=[vr("selector"),Ir("execute",ng),Ir("moveOnTab",!1)],up=function(t,n,e){return e.focusManager.get(t).bind(function(o){return e.execute(t,n,o)})},ap=function(t,n,e){Dc(t.element,n.selector).each(function(e){n.focusManager.set(t,e)})},cp=function(t,n,e){return Rg(t,e.selector,n,-1)},sp=function(t,n,e){return Rg(t,e.selector,n,1)},lp=N([qm(Hm(Fm),pg(cp)),qm(Hm(Nm),pg(sp)),qm(Um([Wm,Hm(Am)]),function(t,n,e,o){return e.moveOnTab?pg(cp)(t,n,e,o):G.none()}),qm(Um([Gm,Hm(Am)]),function(t,n,e,o){return e.moveOnTab?pg(sp)(t,n,e,o):G.none()}),qm(Hm(Mm),up),qm(Hm(Bm),up)]),fp=N([qm(Hm(Bm),eg)]),dp=$m(ip,wu.init,lp,fp,function(){return G.some(ap)}),mp=[Ma("onSpace"),Ma("onEnter"),Ma("onShiftEnter"),Ma("onLeft"),Ma("onRight"),Ma("onTab"),Ma("onShiftTab"),Ma("onUp"),Ma("onDown"),Ma("onEscape"),Ir("stopSpaceKeyup",!1),Or("focusIn")],gp=$m(mp,wu.init,function(t,n,e){return[qm(Hm(Bm),e.onSpace),qm(Um([Gm,Hm(Mm)]),e.onEnter),qm(Um([Wm,Hm(Mm)]),e.onShiftEnter),qm(Um([Wm,Hm(Am)]),e.onShiftTab),qm(Um([Gm,Hm(Am)]),e.onTab),qm(Hm(Fm),e.onUp),qm(Hm(Nm),e.onDown),qm(Hm(Im),e.onLeft),qm(Hm(Rm),e.onRight),qm(Hm(Bm),e.onSpace)]},function(t,n,e){return[].concat(w(e.stopSpaceKeyup?[qm(Hm(Bm),eg)]:[]),[qm(Hm(Dm),e.onEscape)])},function(t){return t.focusIn}),pp=Zm.schema(),hp=tg.schema(),vp=Wg.schema(),bp=Bg.schema(),yp=rp.schema(),xp=ig.schema(),wp=dp.schema(),Sp=gp.schema(),Cp=Tu({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:pp,cyclic:hp,flow:vp,flatgrid:bp,matrix:yp,execution:xp,menu:wp,special:Sp}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(t,n,e){n.sendFocusIn(n).fold(function(){t.getSystem().triggerFocus(t.element,t.element)},function(o){o(t,n,e)})},setGridSize:function(t,n,e,o,r){!function(t){return Nt(t,"setGridSize")}(e)?console.error("Layout does not support setGridSize"):e.setGridSize(o,r)}},state:ag}),kp=function(t,n){Cs(function(){!function(t,n,e){var o=t.components();!function(t){ot(t.components(),function(t){return no(t.element)}),to(t.element),t.syncComponents()}(t);var r=e(),i=gt(o,r);ot(i,function(n){uf(n),t.getSystem().removeFromWorld(n)}),ot(r,function(n){rf(n)?lf(t,n):(t.getSystem().addToWorld(n),lf(t,n),Rn(t.element)&&af(n))}),t.syncComponents()}(t,0,function(){return et(n,t.getSystem().build)})},t.element)},Op=function(t,n){Cs(function(){!function(e,o){var r=e.components(),i=ft(o,function(t){return ec(t).toArray()});ot(r,function(t){Q(i,t)||sf(t)});var u=function(t,n,e){return gc(t,n,function(n,o){return pc(t,o,n,e)})}(t.element,n,t.getSystem().buildOrPatch),a=gt(r,u);ot(a,function(t){rf(t)&&sf(t)}
2),ot(u,function(t){rf(t)||cf(e,t)}),e.syncComponents()}(t,n)},t.element)},_p=function(t,n,e,o){sf(n);var r=pc(t.element,e,o,t.getSystem().buildOrPatch);cf(t,r),t.syncComponents()},Tp=function(t,n,e){var o=t.getSystem().build(e);df(t,o,n)},Ep=function(t,n,e,o){gf(n),Tp(t,function(t,n){return function(t,n,e){_n(t,e).fold(function(){Qe(t,n)},function(t){Ke(t,n)})}(t,n,e)},o)},Ap=function(t,n){return t.components()},Mp=function(t,n,e,o,r){var i=Ap(t);return G.from(i[o]).map(function(e){return r.fold(function(){return gf(e)},function(r){(n.reuseDom?_p:Ep)(t,e,o,r)}),e})},Dp=Object.freeze({__proto__:null,append:function(t,n,e,o){Tp(t,Qe,o)},prepend:function(t,n,e,o){Tp(t,$e,o)},remove:function(t,n,e,o){var r=Ap(t),i=ct(r,function(t){return hn(o.element,t.element)});i.each(gf)},replaceAt:Mp,replaceBy:function(t,n,e,o,r){var i=Ap(t);return st(i,o).bind(function(e){return Mp(t,n,0,e,r)})},set:function(t,n,e,o){return(n.reuseDom?Op:kp)(t,o)},contents:Ap}),Bp=Ou({fields:[zr("reuseDom",!0)],name:"replacing",apis:Dp}),Ip=function(t,n){var e=function(t,n){var e=tu(n);return Ou({fields:[vr("enabled")],name:t,active:{events:N(e)}})}(t,n);return{key:t,value:{config:{},me:e,configAsRaw:N({}),initialConfig:{},state:wu}}},Fp=function(t,n){n.ignore||(bs(t.element),n.onFocus(t))},Rp=Object.freeze({__proto__:null,focus:Fp,blur:function(t,n){n.ignore||ys(t.element)},isFocused:function(t){return xs(t.element)}}),Np=Object.freeze({__proto__:null,exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return vu(e)},events:function(t){return tu([ou(Si(),function(n,e){Fp(n,t),e.stop()})].concat(t.stopMousedown?[ou(ri(),function(t,n){n.event.prevent()})]:[]))}}),Lp=[Aa("onFocus"),Ir("stopMousedown",!1),Ir("ignore",!1)],zp=Ou({fields:Lp,name:"focusing",active:Np,apis:Rp}),Pp=function(t,n,e,o){var r=e.get();e.set(o),function(t,n,e){n.toggleClass.each(function(n){e.get()?Fu(t.element,n):Nu(t.element,n)})}(t,n,e),function(t,n,e){var o=n.aria;o.update(t,o,e.get())}(t,n,e),r!==o&&n.onToggled(t,o)},Vp=function(t,n,e){Pp(t,n,e,!e.get())},Hp=function(t,n,e){Pp(t,n,e,n.selected)},Up=Object.freeze({__proto__:null,onLoad:Hp,toggle:Vp,isOn:function(t,n,e){return e.get()},on:function(t,n,e){Pp(t,n,e,!0)},off:function(t,n,e){Pp(t,n,e,!1)},set:Pp}),Wp=Object.freeze({__proto__:null,exhibit:function(){return vu({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=Vp,gu(function(t){r(t,e,o)})),u=bu(t,n,Hp);return tu(lt([t.toggleOnExecute?[i]:[],[u]]))}}),jp=function(t,n,e){Pn(t.element,"aria-expanded",e)},Gp=[Ir("selected",!1),Or("toggleClass"),Ir("toggleOnExecute",!0),Aa("onToggled"),Fr("aria",{mode:"none"},dr("mode",{pressed:[Ir("syncWithExpanded",!1),Ia("update",function(t,n,e){Pn(t.element,"aria-pressed",e),n.syncWithExpanded&&jp(t,0,e)})],checked:[Ia("update",function(t,n,e){Pn(t.element,"aria-checked",e)})],expanded:[Ia("update",jp)],selected:[Ia("update",function(t,n,e){Pn(t.element,"aria-selected",e)})],none:[Ia("update",I)]}))],qp=Ou({fields:Gp,name:"toggling",active:Wp,apis:Up,state:{init:function(){var t=ho(!1);return{get:function(){return t.get()},set:function(n){return t.set(n)},clear:function(){return t.set(!1)},readState:function(){return t.get()}}}}}),Yp=function(){var t=function(t,n){n.stop(),Ji(t)};return[ou(pi(),t),ou(Ei(),t),cu(ti()),cu(ri())]},Xp=function(t){return tu(lt([t.map(function(t){return gu(function(n,e){t(n),e.stop()})}).toArray(),Yp()]))},Kp="alloy.item-hover",Jp="alloy.item-focus",$p="alloy.item-toggled",Qp=function(t){(Ss(t.element).isNone()||zp.isFocused(t))&&(zp.isFocused(t)||zp.focus(t),Ki(t,Kp,{item:t}))},Zp=function(t){Ki(t,Jp,{item:t})},th=N(Kp),nh=N(Jp),eh=N($p),oh=function(t){return t.role.fold(function(){return t.toggling.map(function(t){return t.exclusive?"menuitemradio":"menuitemcheckbox"}).getOr("menuitem")},L)},rh=[vr("data"),vr("components"),vr("dom"),Ir("hasSubmenu",!1),Or("toggling"),Or("role"),td("itemBehaviours",[qp,zp,Cp,Jf]),Ir("ignoreFocus",!1),Ir("domModification",{}),Ia("builder",function(t){return{dom:t.dom,domModification:_(_({},t.domModification),{},{attributes:_(_({role:oh(t)},t.domModification.attributes),{},{"aria-haspopup":t.hasSubmenu},t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:nd(t.itemBehaviours,[t.toggling.fold(qp.revoke,function(n){return qp.config(function(t,n){return _(_({aria:{mode:n?"selected":"checked"}},Mt(t,function(t,n){return"exclusive"!==n})),{},{onToggled:function(n,e){A(t.onToggled)&&t.onToggled(n,e),function(t,n){Ki(t,$p,{item:t,state:n})}(n,e)}})}(n,t.role.exists(function(t){return"option"===t})))}),zp.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Zp(t)}}),Cp.config({mode:"execution"}),Jf.config({store:{mode:"memory",initialValue:t.data}}),Ip("item-type-events",[].concat(w(Yp()),[ou(ci(),Qp),ou(Ti(),zp.focus)]))]),components:t.components,eventOrder:t.eventOrder}}),Ir("eventOrder",{})],ih=[vr("dom"),vr("components"),Ia("builder",function(t){return{dom:t.dom,components:t.components,events:tu([su(Ti())])}})],uh=N("item-widget"),ah=N([kd({name:"widget",overrides:function(t){return{behaviours:Cu([Jf.config({store:{mode:"manual",getValue:function(n){return t.data},setValue:I}})])}}})]),ch=[vr("uid"),vr("data"),vr("components"),vr("dom"),Ir("autofocus",!1),Ir("ignoreFocus",!1),td("widgetBehaviours",[Jf,zp,Cp]),Ir("domModification",{}),Gd(ah()),Ia("builder",function(t){var n=Nd(uh(),t,ah()),e=Ld(uh(),t,n.internals()),o=function(n){return zd(n,t,"
2widget").map(function(t){return Cp.focusIn(t),t})},r=function(n,e){return tm(e.event.target)?G.none():t.autofocus?(e.setSource(n.element),G.none()):G.none()};return{dom:t.dom,components:e,domModification:t.domModification,events:tu([gu(function(t,n){o(t).each(function(t){n.stop()})}),ou(ci(),Qp),ou(Ti(),function(n,e){t.autofocus?o(n):zp.focus(n)})]),behaviours:nd(t.widgetBehaviours,[Jf.config({store:{mode:"memory",initialValue:t.data}}),zp.config({ignore:t.ignoreFocus,onFocus:function(t){Zp(t)}}),Cp.config({mode:"special",focusIn:t.autofocus?function(t){o(t)}:Eu(),onLeft:r,onRight:r,onEscape:function(n,e){return zp.isFocused(n)||t.autofocus?t.autofocus?(e.setSource(n.element),G.none()):G.none():(zp.focus(n),G.some(!0))}})])}})],sh=dr("type",{widget:ch,item:rh,separator:ih}),lh=N([Td({factory:{sketch:function(t){var n=lr("menu.spec item",sh,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return Rt(n,"uid")?n:_(_({},n),{},{uid:Ja("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),fh=N([Er("role"),vr("value"),vr("items"),vr("dom"),vr("components"),Ir("eventOrder",{}),$f("menuBehaviours",[Tm,Jf,om,Cp]),Fr("movement",{mode:"menu",moveOnTab:!0},dr("mode",{grid:[Ra(),Ia("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[Ia("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},previousSelector:n.previousSelector,focusManager:t.focusManager}}),vr("rowSelector"),Ir("previousSelector",G.none)],menu:[Ir("moveOnTab",!0),Ia("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),br("markers",ka()),Ir("fakeFocus",!1),Ir("focusManager",Xm()),Aa("onHighlight"),Aa("onDehighlight"),Ir("showMenuRole",!0)]),dh=N("alloy.menu-focus"),mh=Zd({name:"Menu",configFields:fh(),partFields:lh(),factory:function(t,n,e,o){return _({uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Zf(t.menuBehaviours,[Tm.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight,onDehighlight:t.onDehighlight}),Jf.config({store:{mode:"memory",initialValue:t.value}}),om.config({find:G.some}),Cp.config(t.movement.config(t,t.movement))]),events:tu([ou(nh(),function(t,n){var e=n.event;t.getSystem().getByDom(e.target).each(function(e){Tm.highlight(t,e),n.stop(),Ki(t,dh(),{menu:t,item:e})})}),ou(th(),function(t,n){var e=n.event.item;Tm.highlight(t,e)}),ou(eh(),function(t,n){var e=n.event,o=e.item;e.state&&"menuitemradio"===Hn(o.element,"role")&&function(t,n){var e=Al(t.element,'[role="menuitemradio"][aria-checked="true"]');ot(e,function(e){hn(e,n.element)||t.getSystem().getByDom(e).each(function(t){qp.off(t)})})}(t,o)})]),components:n,eventOrder:t.eventOrder},t.showMenuRole?{domModification:{attributes:{role:t.role.getOr("menu")}}}:{})}}),gh=function(t,n,e,o){return Ft(e,o).bind(function(o){return Ft(t,o).bind(function(o){var r=gh(t,n,e,o);return G.some([o].concat(r))})}).getOr([])},ph=function(t){return"prepared"===t.type?G.some(t.menu):G.none()},hh=ph,vh=Wa("tiered-menu-item-highlight"),bh=Wa("tiered-menu-item-dehighlight");!function(t){t[t.HighlightMenuAndItem=0]="HighlightMenuAndItem",t[t.HighlightJustMenu=1]="HighlightJustMenu",t[t.HighlightNone=2]="HighlightNone"}(Jm||(Jm={}));var yh,xh,wh=N("collapse-item"),Sh=Qd({name:"TieredMenu",configFields:[Ba("onExecute"),Ba("onEscape"),Da("onOpenMenu"),Da("onOpenSubmenu"),Aa("onRepositionMenu"),Aa("onCollapseMenu"),Ir("highlightOnOpen",Jm.HighlightMenuAndItem),Sr("data",[vr("primary"),vr("menus"),vr("expansions")]),Ir("fakeFocus",!1),Aa("onHighlightItem"),Aa("onDehighlightItem"),Aa("onHover"),_a(),vr("dom"),Ir("navigateOnHover",!0),Ir("stayInDom",!1),$f("tmenuBehaviours",[Cp,Tm,om,Bp]),Ir("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)},repositionMenus:function(t,n){t.repositionMenus(n)}},factory:function(t,n){var e,o=yo(),r=function(){var t=ho({}),n=ho({}),e=ho({}),o=yo(),r=ho({}),i=function(t){return u(t).bind(ph)},u=function(t){return Ft(n.get(),t)},a=function(n){return Ft(t.get(),n)};return{setMenuBuilt:function(t,e){n.set(_(_({},n.get()),{},T({},t,{type:"prepared",menu:e})))},setContents:function(i,u,a,c){o.set(i),t.set(a),n.set(u),r.set(c);var s=function(t,n){var e={};Ot(t,function(t,n){ot(t,function(t){e[t]=n})});var o=n,r=Tt(n,function(t,n){return{k:t,v:n}}),i=_t(r,function(t,n){return[n].concat(gh(e,o,r,n))});return _t(e,function(t){return Ft(i,t).getOr([t])})}(c,a);e.set(s)},expand:function(n){return Ft(t.get(),n).map(function(t){var o=Ft(e.get(),n).getOr([]);return[t].concat(o)})},refresh:function(t){return Ft(e.get(),t)}
2,collapse:function(t){return Ft(e.get(),t).bind(function(t){return t.length>1?G.some(t.slice(1)):G.none()})},lookupMenu:u,lookupItem:a,otherMenus:function(t){var n=r.get();return gt(Ct(n),t)},getPrimary:function(){return o.get().bind(i)},getMenus:function(){return n.get()},clear:function(){t.set({}),n.set({}),e.set({}),o.clear()},isClear:function(){return o.get().isNone()},getTriggeringPath:function(n,r){var u=it(a(n).toArray(),function(t){return i(t).isSome()});return Ft(e.get(),n).bind(function(n){var e=mt(u.concat(n));return function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(!o.isSome())return G.none();n.push(o.getOrDie())}return G.some(n)}(ft(e,function(n,u){return function(n,e,o){return i(n).bind(function(r){return function(n){return Bt(t.get(),function(t,e){return t===n})}(n).bind(function(t){return e(t).map(function(t){return{triggeredMenu:r,triggeringItem:t,triggeringPath:o}})})})}(n,r,e.slice(0,u+1)).fold(function(){return Lt(o.get(),n)?[]:[G.none()]},function(t){return[G.some(t)]})}))})}}}(),i=function(t){return Jf.getValue(t).value},u=Tm.highlight,a=function(n,e){u(n,e),Tm.getHighlighted(e).orThunk(function(){return Tm.getFirst(e)}).each(function(o){t.fakeFocus?Tm.highlight(e,o):$i(n,o.element,Ti())})},c=function(t,n){return zt(et(n,function(n){return t.lookupMenu(n).bind(function(t){return"prepared"===t.type?G.some(t.menu):G.none()})}))},s=function(n,e,o){var r=c(e,e.otherMenus(o));ot(r,function(e){Pu(e.element,[t.markers.backgroundMenu]),t.stayInDom||Bp.remove(n,e)})},l=function(n,e){var r=function(n){return o.get().getOrThunk(function(){var e={},r=Al(n.element,".".concat(t.markers.item)),u=it(r,function(t){return"true"===Hn(t,"aria-haspopup")});return ot(u,function(t){n.getSystem().getByDom(t).each(function(t){var n=i(t);e[n]=t})}),o.set(e),e})}(n);Ot(r,function(t,n){var o=Q(e,n);Pn(t.element,"aria-expanded",o)})},f=function(n,e,o){return G.from(o[0]).bind(function(r){return e.lookupMenu(r).bind(function(r){if("notbuilt"===r.type)return G.none();var i=r.menu,u=c(e,o.slice(1));return ot(u,function(n){Fu(n.element,t.markers.backgroundMenu)}),Rn(i.element)||Bp.append(n,Cc(i)),Pu(i.element,[t.markers.backgroundMenu]),a(n,i),s(n,e,o),G.some(i)})})};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(e||(e={}));var d=function(n,o){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.HighlightSubmenu;if(o.hasConfigured(vm)&&vm.isDisabled(o))return G.some(o);var a=i(o);return r.expand(a).bind(function(i){return l(n,i),G.from(i[0]).bind(function(a){return r.lookupMenu(a).bind(function(c){var s=function(t,n,e){if("notbuilt"===e.type){var o=t.getSystem().build(e.nbMenu());return r.setMenuBuilt(n,o),o}return e.menu}(n,a,c);return Rn(s.element)||Bp.append(n,Cc(s)),t.onOpenSubmenu(n,o,s,mt(i)),u===e.HighlightSubmenu?(Tm.highlightFirst(s),f(n,r,i)):(Tm.dehighlightAll(s),G.some(o))})})})},m=function(n,e){var o=i(e);return r.collapse(o).bind(function(o){return l(n,o),f(n,r,o).map(function(o){return t.onCollapseMenu(n,e,o),o})})},g=function(n){return function(e,o){return Bc(o.getSource(),".".concat(t.markers.item)).bind(function(t){return e.getSystem().getByDom(t).toOptional().bind(function(t){return n(e,t).map(j)})})}},p=tu([ou(dh(),function(t,n){var e=n.event.item;r.lookupItem(i(e)).each(function(){var e=n.event.menu;Tm.highlight(t,e);var o=i(n.event.item);r.refresh(o).each(function(n){return s(t,r,n)})})}),gu(function(n,o){var r=o.event.target;n.getSystem().getByDom(r).each(function(o){0===i(o).indexOf("collapse-item")&&m(n,o),d(n,o,e.HighlightSubmenu).fold(function(){t.onExecute(n,o)},I)})}),fu(function(n,e){(function(n){var e=function(n,e,o){return _t(o,function(o,r){var i=function(){return mh.sketch(_(_({},o),{},{value:r,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:function(t,n){Ki(t,vh,{menuComp:t,itemComp:n})},onDehighlight:function(t,n){Ki(t,bh,{menuComp:t,itemComp:n})},focusManager:t.fakeFocus?Km():Xm()}))};return r===e?{type:"prepared",menu:n.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})}(n,t.data.primary,t.data.menus),o=_t(t.data.menus,function(t,n){return ft(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})});return r.setContents(t.data.primary,e,t.data.expansions,o),r.getPrimary()})(n).each(function(e){Bp.append(n,Cc(e)),t.onOpenMenu(n,e),t.highlightOnOpen===Jm.HighlightMenuAndItem?a(n,e):t.highlightOnOpen===Jm.HighlightJustMenu&&u(n,e)})}),ou(vh,function(n,e){t.onHighlightItem(n,e.event.menuComp,e.event.itemComp)}),ou(bh,function(n,e){t.onDehighlightItem(n,e.event.menuComp,e.event.itemComp)})].concat(w(t.navigateOnHover?[ou(th(),function(n,o){var u=o.event.item;(function(t,n){var e=i(n);r.refresh(e).bind(function(n){return l(t,n),f(t,r,n)})})(n,u),d(n,u,e.HighlightParent),t.onHover(n,u)})]:[]))),h=function(t){return Tm.getHighlighted(t).bind(Tm.getHighlighted)},v={collapseMenu:function(t){h(t).each(function(n){m(t,n)})},highlightPrimary:function(t){r.getPrimary().each(function(n){a(t,n)})},repositionMenus:function(n){var e=r.getPrimary().bind(function(t){return h(n).bind(function(t){var n=i(t),e=It(r.getMenus()),o=zt(et(e,hh));return r.getTriggeringPath(n,function(t){return function(t,n,e){return St(n,function(t){if(!t.getSystem().isConnected())return G.none();var n=Tm.getCandidates(t);return ct(n,function(t){return i(t)===e})})}(0,o,t)})}).map(function(n){return{primary:t,triggeringPath:n}})});e.fold(function(){(function(t){return G.from(t.components()[0]).filter(function(t){return"menu"===Hn(t.element,"role")})})(n).each(function(e){t.onRepositionMenu(n,e,[])})},function(e){var o=e.primary,r=e.triggeringPath;t.onRepositionMenu(n,o,r)})}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Zf(t.tmenuBehaviours,[Cp.config({mode:"special",onRight:g(function(t,n){return tm(n.element)?G.none():d(t,n,e.HighlightSubmenu)}),onLeft:g(function(t,n){return tm(n.element)?G.none():m(t,n)}),onEscape:g(function(n,e){return m(n,e).orThunk(function(){return t.onEscape(n,e).map(function(){return n})})}),focusIn:function(t,n){r.getPrimary().each(function(n){$i(t,n.element,Ti())})}}),Tm.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),om.config({find:function(t){return Tm.getHighlighted(t)}}),Bp.config({})]),eventOrder:t.eventOrder,apis:v,events:p}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Gr(t,n),expansions:{}}},collapseItem:function(t){return{value:Wa(wh()),meta:{text:t}}}}}),Ch=Qd({name:"InlineView",configFields:[vr("lazySink"),Aa("onShow"),Aa("onHide"),Mr("onEscape"),$f("inl
2ineBehaviours",[Mf,Jf,hs]),Br("fireDismissalEventInstead",[Ir("event",Pi())]),Br("fireRepositionEventInstead",[Ir("event",Vi())]),Ir("getRelated",G.none),Ir("isExtraPart",W),Ir("eventOrder",G.none)],factory:function(t,n){var e=function(n,e,o,r){var i=t.lazySink(n).getOrDie();Mf.openWhileCloaked(n,e,function(){return of.positionWithinBounds(i,n,o,r())}),Jf.setValue(n,G.some({mode:"position",config:o,getBounds:r}))},o=function(n,e,o,r){var i=function(t,n,e,o,r){var i=function(){return t.lazySink(n)},u="horizontal"===o.type?{layouts:{onLtr:function(){return ds()},onRtl:function(){return ms()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return Sh.sketch({dom:{tag:"div"},data:o.data,markers:o.menu.markers,highlightOnOpen:o.menu.highlightOnOpen,fakeFocus:o.menu.fakeFocus,onEscape:function(){return Mf.close(n),t.onEscape.map(function(t){return t(n)}),G.some(!0)},onExecute:function(){return G.some(!0)},onOpenMenu:function(t,n){of.positionWithinBounds(i().getOrDie(),n,e,r())},onOpenSubmenu:function(t,n,e,o){var r=i().getOrDie();of.position(r,e,{anchor:_({type:"submenu",item:n},a(o))})},onRepositionMenu:function(t,n,o){var u=i().getOrDie();of.positionWithinBounds(u,n,e,r()),ot(o,function(t){var n=a(t.triggeringPath);of.position(u,t.triggeredMenu,{anchor:_({type:"submenu",item:t.triggeringItem},n)})})}})}
2(t,n,e,o,r);Mf.open(n,i),Jf.setValue(n,G.some({mode:"menu",menu:i}))},r=function(n){Mf.isOpen(n)&&Jf.getValue(n).each(function(e){switch(e.mode){case"menu":Mf.getState(n).each(Sh.repositionMenus);break;case"position":var o=t.lazySink(n).getOrDie();of.positionWithinBounds(o,n,e.config,e.getBounds())}})},i={setContent:function(t,n){Mf.setContent(t,n)},showAt:function(t,n,o){var r=G.none;e(t,n,o,r)},showWithinBounds:e,showMenuAt:function(t,n,e){o(t,n,e,G.none)},showMenuWithinBounds:o,hide:function(t){Mf.isOpen(t)&&(Jf.setValue(t,G.none()),Mf.close(t))},getContent:function(t){return Mf.getState(t)},reposition:r,isOpen:Mf.isOpen};return{uid:t.uid,dom:t.dom,behaviours:Zf(t.inlineBehaviours,[Mf.config({isPartOf:function(n,e,o){return Rc(e,o)||function(n,e){return t.getRelated(n).exists(function(t){return Rc(t,e)})}(n,o)},getAttachPoint:function(n){return t.lazySink(n).getOrDie()},onOpen:function(n){t.onShow(n)},onClose:function(n){t.onHide(n)}}),Jf.config({store:{mode:"memory",initialValue:G.none()}}),hs.config({channels:_(_({},Rf(_({isExtraPart:n.isExtraPart},t.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Lf(_(_({},t.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{},{doReposition:r})))})]),eventOrder:t.eventOrder,apis:i}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithinBounds:function(t,n,e,o,r){t.showWithinBounds(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},showMenuWithinBounds:function(t,n,e,o,r){t.showMenuWithinBounds(n,e,o,r)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)},reposition:function(t,n){t.reposition(n)}}}),kh=tinymce.util.Tools.resolve("tinymce.util.Delay"),Oh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_h=tinymce.util.Tools.resolve("tinymce.EditorManager"),Th=tinymce.util.Tools.resolve("tinymce.Env");!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(yh||(yh={})),function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(xh||(xh={}));var Eh=function(t){return function(n){return n.options.get(t)}},Ah=function(t){return function(n){return G.from(t(n))}},Mh=function(t){var n=Th.deviceType.isPhone(),e=Th.deviceType.isTablet()||n,o=t.options.register,r=function(t){return f(t)||!1===t},i=function(t){return f(t)||D(t)};o("skin",{processor:function(t){return f(t)||!1===t},default:"oxide"}),o("skin_url",{processor:"string"}),o("height",{processor:i,default:Math.max(t.getElement().offsetHeight,400)}),o("width",{processor:i,default:Oh.DOM.getStyle(t.getElement(),"width")}),o("min_height",{processor:"number",default:100}),o("min_width",{processor:"number"}),o("max_height",{processor:"number"}),o("max_width",{processor:"number"}),o("style_formats",{processor:"object[]"}),o("style_formats_merge",{processor:"boolean",default:!1}),o("style_formats_autohide",{processor:"boolean",default:!1}),o("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),o("font_family_formats",{processor:"string",default:"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"}),o("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),o("font_size_input_default_unit",{processor:"string",default:"pt"}),o("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),o("content_langs",{processor:"object[]"}),o("removed_menuitems",{processor:"string",default:""}),o("menubar",{processor:function(t){return f(t)||y(t)},default:!n}),o("menu",{processor:"object",default:{}}),o("toolbar",{processor:function(t){return y(t)||f(t)||g(t)?{value:t,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."}},default:!0}),tt(9,function(t){o("toolbar"+(t+1),{processor:"string"})}),o("toolbar_mode",{processor:"string",default:e?"scrolling":"floating"}),o("toolbar_groups",{processor:"object",default:{}}),o("toolbar_location",{processor:"string",default:xh.auto}),o("toolbar_persist",{processor:"boolean",default:!1}),o("toolbar_sticky",{processor:"boolean",default:t.inline}),o("toolbar_sticky_offset",{processor:"number",default:0}),o("fixed_toolbar_container",{processor:"string",default:""}),o("fixed_toolbar_container_target",{processor:"object"}),o("ui_mode",{processor:"string",default:"combined"}),o("file_picker_callback",{processor:"function"}),o("file_picker_validator_handler",{processor:"function"}),o("file_picker_types",{processor:"string"}),o("typeahead_urls",{processor:"boolean",default:!0}),o("anchor_top",{processor:r,default:"#top"}),o("anchor_bottom",{processor:r,default:"#bottom"}),o("draggable_modal",{processor:"boolean",default:!1}),o("statusbar",{processor:"boolean",default:!0}),o("elementpath",{processor:"boolean",default:!0}),o("branding",{processor:"boolean",default:!0}),o("promotion",{processor:"boolean",default:!0}),o("resize",{processor:function(t){return"both"===t||y(t)},default:!Th.deviceType.isTouch()}),o("sidebar_show",{processor:"string"}),o("help_accessibility",{processor:"boolean",default:t.hasPlugin("help")}),o("default_font_stack",{processor:"string[]",default:[]})},Dh=Eh("readonly"),Bh=Eh("height"),Ih=Eh("width"),Fh=Ah(Eh("min_width")),Rh=Ah(Eh("min_height")),Nh=Ah(Eh("max_width")),Lh=Ah(Eh("max_height")),zh=Ah(Eh("style_formats")),Ph=Eh("style_formats_merge"),Vh=Eh("style_formats_autohide"),Hh=Eh("content_langs"),Uh=Eh("removed_menuitems"),Wh=Eh("toolbar_mode"),jh=Eh("toolbar_groups"),Gh=E
2h("toolbar_location"),qh=Eh("fixed_toolbar_container"),Yh=Eh("fixed_toolbar_container_target"),Xh=Eh("toolbar_persist"),Kh=Eh("toolbar_sticky_offset"),Jh=Eh("menubar"),$h=Eh("toolbar"),Qh=Eh("file_picker_callback"),Zh=Eh("file_picker_validator_handler"),tv=Eh("font_size_input_default_unit"),nv=Eh("file_picker_types"),ev=Eh("typeahead_urls"),ov=Eh("anchor_top"),rv=Eh("anchor_bottom"),iv=Eh("draggable_modal"),uv=Eh("statusbar"),av=Eh("elementpath"),cv=Eh("branding"),sv=Eh("resize"),lv=Eh("paste_as_text"),fv=Eh("sidebar_show"),dv=Eh("promotion"),mv=Eh("help_accessibility"),gv=Eh("default_font_stack"),pv=function(t){return!1===t.options.get("skin")},hv=function(t){return!1!==t.options.get("menubar")},vv=function(t){var n=t.options.get("skin_url");if(pv(t))return n;if(n)return t.documentBaseURI.toAbsolute(n);var e=t.options.get("skin");return _h.baseURL+"/skins/ui/"+e},bv=function(t){return G.from(t.options.get("skin_url"))},yv=function(t){return t.options.get("line_height_formats").split(" ")},xv=function(t){var n=$h(t),e=f(n),o=g(n)&&n.length>0;return!Sv(t)&&(o||e||!0===n)},wv=function(t){var n=tt(9,function(n){return t.options.get("toolbar"+(n+1))}),e=it(n,f);return Ht(e.length>0,e)},Sv=function(t){return wv(t).fold(function(){var n=$h(t);return B(n,f)&&n.length>0},j)},Cv=function(t){return Gh(t)===xh.bottom},kv=function(t){var n;if(!t.inline)return G.none();var e=null!==(n=qh(t))&&void 0!==n?n:"";if(e.length>0)return Dc(Nn(),e);var o=Yh(t);return O(o)?G.some(tn(o)):G.none()},Ov=function(t){return t.inline&&kv(t).isSome()},_v=function(t){return kv(t).getOrThunk(function(){return Bn(Dn(tn(t.getElement())))})},Tv=function(t){return t.inline&&!hv(t)&&!xv(t)&&!Sv(t)},Ev=function(t){return(t.options.get("toolbar_sticky")||t.inline)&&!Ov(t)&&!Tv(t)},Av=function(t){return!Ov(t)&&"split"===t.options.get("ui_mode")},Mv=function(t){var n=t.options.get("menu");return _t(n,function(t){return _(_({},t),{},{items:t.items})})},Dv=Object.freeze({__proto__:null,get ToolbarMode(){return yh},get ToolbarLocation(){return xh},register:Mh,getSkinUrl:vv,getSkinUrlOption:bv,isReadOnly:Dh,isSkinDisabled:pv,getHeightOption:Bh,getWidthOption:Ih,getMinWidthOption:Fh,getMinHeightOption:Rh,getMaxWidthOption:Nh,getMaxHeightOption:Lh,getUserStyleFormats:zh,shouldMergeStyleFormats:Ph,shouldAutoHideStyleFormats:Vh,getLineHeightFormats:yv,getContentLanguages:Hh,getRemovedMenuItems:Uh,isMenubarEnabled:hv,isMultipleToolbars:Sv,isToolbarEnabled:xv,isToolbarPersist:Xh,getMultipleToolbarsOption:wv,getUiContainer:_v,useFixedContainer:Ov,isSplitUiMode:Av,getToolbarMode:Wh,isDraggableModal:iv,isDistractionFree:Tv,isStickyToolbar:Ev,getStickyToolbarOffset:Kh,getToolbarLocation:Gh,isToolbarLocationBottom:Cv,getToolbarGroups:jh,getMenus:Mv,getMenubar:Jh,getToolbar:$h,getFilePickerCallback:Qh,getFilePickerTypes:nv,useTypeaheadUrls:ev,getAnchorTop:ov,getAnchorBottom:rv,getFilePickerValidatorHandler:Zh,getFontSizeInputDefaultUnit:tv,useStatusBar:uv,useElementPath:av,promotionEnabled:dv,useBranding:cv,getResize:sv,getPasteAsText:lv,getSidebarShow:fv,useHelpAccessibility:mv,getDefaultFontStack:gv}),Bv=["visible","hidden","clip"],Iv=function(t){return Yt(t).length>0&&!Q(Bv,t)},Fv=function(t){if(an(t)){var n=Jn(t,"overflow-x"),e=Jn(t,"overflow-y");return Iv(n)||Iv(e)}return!1},Rv=function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()},Nv=function(t,n){return Av(t)?function(t,n){var e=El(n,Fv),o=0===e.length?In(n).map(Fn).map(function(t){return El(t,Fv)}).getOr([]):e;return yt(o).map(function(n){return{element:n,others:o.slice(1),isFullscreen:function(){return Rv(t)}}})}(t,n):G.none()},Lv=function(t){var n=[].concat(w(et(t.others,fo)),[po()]);return t.isFullscreen()?po():function(t,n){return at(n,function(t,n){return go(t,n)},t)}(fo(t.element),n)},zv=Qd({name:"Button",factory:function(t){var n=Xp(t.action),e=t.dom.tag,o=function(n){return Ft(t.dom,"attributes").bind(function(t){return Ft(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:nd(t.buttonBehaviours,[zp.config({}),Cp.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:"button"===e?_({type:o("type").getOr("button")},o("role").map(function(t){return{role:t}}).getOr({})):{role:t.role.getOr(o("role").getOr("button"))}},eventOrder:t.eventOrder}},configFields:[Ir("uid",void 0),vr("dom"),Ir("components",[]),td("buttonBehaviours",[zp,Cp]),Or("action"),Or("role"),Ir("eventOrder",{})]}),Pv=function(t){var n=function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||e.childNodes.length>1){var o="HTML does not have a single root node";throw console.error(o,t),new Error(o)}return $t(e.childNodes[0])}(t),e=On(n),o=function(t){var n=void 0!==t.dom.attributes?t.dom.attributes:[];return at(n,function(t,n){return"class"===n.name?t:_(_({},t),{},T({},n.name,n.value))},{})}(n),r=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(n),i=0===e.length?{}:{innerHtml:ma(n)};return _({tag:rn(n),classes:r,attributes:o},i)},Vv=function(t){var n=function(t){return void 0!==t.uid}(t)&&Nt(t,"uid")?t.uid:Ja("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return _(_({},t),{},{uid:n})}}},Hv=Object.freeze({__proto__:null,exhibit:function(t,n){return vu({attributes:qr([{key:n.tabAttr,value:"true"}])})}}),Uv=[Ir("tabAttr","data-alloy-tabstop")],Wv=Ou({fields:Uv,name:"tabstopping",active:Hv}),jv=Wa("tooltip.exclusive"),Gv=Wa("tooltip.show"),qv=Wa("tooltip.hide"),Yv=Wa("tooltip.immediateHide"),Xv=Wa("tooltip.immediateShow"),Kv=function(t,n,e){t.getSystem().broadcastOn([jv],{})},Jv=Object.freeze({__proto__:null,hideAllExclusive:Kv,immediateOpenClose:function(t,n,e,o){return Xi(t,o?Xv:Yv)},isEnabled:function(t,n,e){return e.isEnabled()},setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Bp.set(t,o)})},setEnabled:function(t,n,e,o){return e.setEnabled(o)}}),$v=Object.freeze({__proto__:null,events:function(t,n){var e=function(e){n.getTooltip().each(function(o){o.get
2System().isConnected()&&(gf(o),t.onHide(e,o),n.clearTooltip())}),n.clearTimer()},o=function(e){if(!n.isShowing()&&n.isEnabled()){Kv(e);var o=t.lazySink(e).getOrDie(),r=e.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:tu("normal"===t.mode?[ou(ci(),function(t){Xi(e,Gv)}),ou(ui(),function(t){Xi(e,qv)})]:[]),behaviours:Cu([Bp.config({})])});n.setTooltip(r),ff(o,r),t.onShow(e,r),of.position(o,r,{anchor:t.anchor(e)})}},r=function(e){n.getTooltip().each(function(n){var o=t.lazySink(e).getOrDie();of.position(o,n,{anchor:t.anchor(e)})})};return tu(lt([[mu(function(n){t.onSetup(n)}),ou(Gv,function(e){n.resetTimer(function(){o(e)},t.delayForShow())}),ou(qv,function(o){n.resetTimer(function(){e(o)},t.delayForHide())}),ou(Xv,function(t){n.resetTimer(function(){o(t)},0)}),ou(Yv,function(t){n.resetTimer(function(){e(t)},0)}),ou(Oi(),function(t,n){var o=n;o.universal||Q(o.channels,jv)&&e(t)}),du(function(t){e(t)})],function(){switch(t.mode){case"normal":return[ou(si(),function(t){Xi(t,Xv)}),ou(Ci(),function(t){Xi(t,Yv)}),ou(ci(),function(t){Xi(t,Gv)}),ou(ui(),function(t){Xi(t,qv)})];case"follow-highlight":return[ou(qi(),function(t,n){Xi(t,Gv)}),ou(Yi(),function(t){Xi(t,qv)})];case"children-normal":return[ou(si(),function(e,o){Ss(e.element).each(function(i){mn(o.event.target,"[data-mce-tooltip]")&&n.getTooltip().fold(function(){Xi(e,Xv)},function(o){n.isShowing()&&(t.onShow(e,o),r(e))})})}),ou(Ci(),function(t){Ss(t.element).fold(function(){Xi(t,Yv)},I)}),ou(ci(),function(e){Dc(e.element,"[data-mce-tooltip]:hover").each(function(o){n.getTooltip().fold(function(){Xi(e,Gv)},function(o){n.isShowing()&&(t.onShow(e,o),r(e))})})}),ou(ui(),function(t){Dc(t.element,"[data-mce-tooltip]:hover").fold(function(){Xi(t,qv)},I)})];default:return[ou(si(),function(e,o){Ss(e.element).each(function(i){mn(o.event.target,"[data-mce-tooltip]")&&n.getTooltip().fold(function(){Xi(e,Xv)},function(o){n.isShowing()&&(t.onShow(e,o),r(e))})})}),ou(Ci(),function(t){Ss(t.element).fold(function(){Xi(t,Yv)},I)})]}}()]))}}),Qv=[vr("lazySink"),vr("tooltipDom"),Ir("exclusive",!0),Ir("tooltipComponents",[]),Pr("delayForShow",N(300)),Pr("delayForHide",N(300)),Pr("onSetup",I),Lr("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),Ir("anchor",function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:N([is,rs,ts,es,ns,os]),onRtl:N([is,rs,ts,es,ns,os])},bubble:Xs(0,-2,{})}}),Aa("onHide"),Aa("onShow")],Zv=Object.freeze({__proto__:null,init:function(){var t=ho(!0),n=yo(),e=yo(),o=function(){n.on(clearTimeout)},r=N("not-implemented");return Su({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:o,resetTimer:function(t,e){o(),n.set(setTimeout(t,e))},readState:r,isEnabled:function(){return t.get()},setEnabled:function(n){return t.set(n)}})}}),tb=Ou({fields:Qv,name:"tooltipping",active:$v,state:Zv,apis:Jv}),nb=Object.entries,eb=Object.setPrototypeOf,ob=Object.isFrozen,rb=Object.getPrototypeOf,ib=Object.getOwnPropertyDescriptor,ub=Object.freeze,ab=Object.seal,cb=Object.create,sb="undefined"!=typeof Reflect&&Reflect,lb=sb.apply,fb=sb.construct;ub||(ub=function(t){return t}),ab||(ab=function(t){return t}),lb||(lb=function(t,n,e){return t.apply(n,e)}),fb||(fb=function(t,n){return v(t,w(n))});var db,mb=Ob(Array.prototype.forEach),gb=Ob(Array.prototype.pop),pb=Ob(Array.prototype.push),hb=Ob(String.prototype.toLowerCase),vb=Ob(String.prototype.toString),bb=Ob(String.prototype.match),yb=Ob(String.prototype.replace),xb=Ob(String.prototype.indexOf),wb=Ob(String.prototype.trim),Sb=Ob(Object.prototype.hasOwnProperty),Cb=Ob(RegExp.prototype.test),kb=(db=TypeError,function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return fb(db,n)});function Ob(t){return function(n){for(var e=arguments.length,o=new Array(e>1?e-1:0),r=1;r<e;r++)o[r-1]=arguments[r];return lb(t,n,o)}}function _b(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:hb;eb&&eb(t,null);for(var o=n.length;o--;){var r=n[o];if("string"==typeof r){var i=e(r);i!==r&&(ob(n)||(n[o]=i),r=i)}t[r]=!0}return t}function Tb(t){for(var n=0;n<t.length;n++)Sb(t,n)||(t[n]=null);return t}function Eb(t){var n,e=cb(null),o=S(nb(t));try{for(o.s();!(n=o.n()).done;){var r=h(n.value,2),i=r[0],u=r[1];Sb(t,i)&&(Array.isArray(u)?e[i]=Tb(u):u&&"object"==M(u)&&u.constructor===Object?e[i]=Eb(u):e[i]=u)}}catch(t){o.e(t)}finally{o.f()}return e}function Ab(t,n){for(;null!==t;){var e=ib(t,n);if(e){if(e.get)return Ob(e.get);if("function"==typeof e.value)return Ob(e.value)}t=rb(t)}return function(){return null}}var Mb,Db=ub(["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"]),Bb=ub(["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"]),Ib=ub(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Fb=ub(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rb=ub(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Nb=ub(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Lb=ub(["#text"]),zb=ub(["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","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
2spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Pb=ub(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),Vb=ub(["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"]),Hb=ub(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ub=ab(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Wb=ab(/<%[\w\W]*|[\w\W]*%>/gm),jb=ab(/\${[\w\W]*}/gm),Gb=ab(/^data-[\-\w.\u00B7-\uFFFF]/),qb=ab(/^aria-[\-\w]+$/),Yb=ab(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Xb=ab(/^(?:\w+script|data):/i),Kb=ab(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Jb=ab(/^html$/i),$b=ab(/^[a-z][.\w]*(-[.\w]+)+$/i),Qb=Object.freeze({__proto__:null,MUSTACHE_EXPR:Ub,ERB_EXPR:Wb,TMPLIT_EXPR:jb,DATA_ATTR:Gb,ARIA_ATTR:qb,IS_ALLOWED_URI:Yb,IS_SCRIPT_OR_DATA:Xb,ATTR_WHITESPACE:Kb,DOCTYPE_NAME:Jb,CUSTOM_ELEMENT:$b}),Zb=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,e=function(n){return t(n)};if(e.version="3.1.7",e.removed=[],!n||!n.document||9!==n.document.nodeType)return e.isSupported=!1,e;var o=n.document,r=o,i=r.currentScript,u=n.DocumentFragment,a=n.HTMLTemplateElement,c=n.Node,s=n.Element,l=n.NodeFilter,f=n.NamedNodeMap,d=void 0===f?n.NamedNodeMap||n.MozNamedAttrMap:f,m=n.HTMLFormElement,g=n.DOMParser,p=n.trustedTypes,h=s.prototype,v=Ab(h,"cloneNode"),b=Ab(h,"remove"),y=Ab(h,"nextSibling"),x=Ab(h,"childNodes"),S=Ab(h,"parentNode");if("function"==typeof a){var C=o.createElement("template");C.content&&C.content.ownerDocument&&(o=C.content.ownerDocument)}var k,O="",_=o,T=_.implementation,E=_.createNodeIterator,A=_.createDocumentFragment,D=_.getElementsByTagName,B=r.importNode,I={};e.isSupported="function"==typeof nb&&"function"==typeof S&&T&&void 0!==T.createHTMLDocument;var F=Qb.MUSTACHE_EXPR,R=Qb.ERB_EXPR,N=Qb.TMPLIT_EXPR,L=Qb.DATA_ATTR,z=Qb.ARIA_ATTR,P=Qb.IS_SCRIPT_OR_DATA,V=Qb.ATTR_WHITESPACE,H=Qb.CUSTOM_ELEMENT,U=Qb.IS_ALLOWED_URI,W=null,j=_b({},[].concat(w(Db),w(Bb),w(Ib),w(Rb),w(Lb))),G=null,q=_b({},[].concat(w(zb),w(Pb),w(Vb),w(Hb))),Y=Object.seal(cb(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}})),X=null,K=null,J=!0,$=!0,Q=!1,Z=!0,tt=!1,nt=!0,et=!1,ot=!1,rt=!1,it=!1,ut=!1,at=!1,ct=!0,st=!1,lt=!0,ft=!1,dt={},mt=null,gt=_b({},["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"]),pt=null,ht=_b({},["audio","video","img","source","image","track"]),vt=null,bt=_b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",wt="http://www.w3.org/1999/xhtml",St=wt,Ct=!1,kt=null,Ot=_b({},[yt,xt,wt],vb),_t=null,Tt=["application/xhtml+xml","text/html"],Et=null,At=null,Mt=o.createElement("form"),Dt=function(t){return t instanceof RegExp||t instanceof Function},Bt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!At||At!==t){if(t&&"object"==M(t)||(t={}
vendor: 4,507 bytes, line 2
2),t=Eb(t),_t=-1===Tt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Et="application/xhtml+xml"===_t?vb:hb,W=Sb(t,"ALLOWED_TAGS")?_b({},t.ALLOWED_TAGS,Et):j,G=Sb(t,"ALLOWED_ATTR")?_b({},t.ALLOWED_ATTR,Et):q,kt=Sb(t,"ALLOWED_NAMESPACES")?_b({},t.ALLOWED_NAMESPACES,vb):Ot,vt=Sb(t,"ADD_URI_SAFE_ATTR")?_b(Eb(bt),t.ADD_URI_SAFE_ATTR,Et):bt,pt=Sb(t,"ADD_DATA_URI_TAGS")?_b(Eb(ht),t.ADD_DATA_URI_TAGS,Et):ht,mt=Sb(t,"FORBID_CONTENTS")?_b({},t.FORBID_CONTENTS,Et):gt,X=Sb(t,"FORBID_TAGS")?_b({},t.FORBID_TAGS,Et):{},K=Sb(t,"FORBID_ATTR")?_b({},t.FORBID_ATTR,Et):{},dt=!!Sb(t,"USE_PROFILES")&&t.USE_PROFILES,J=!1!==t.ALLOW_ARIA_ATTR,$=!1!==t.ALLOW_DATA_ATTR,Q=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,tt=t.SAFE_FOR_TEMPLATES||!1,nt=!1!==t.SAFE_FOR_XML,et=t.WHOLE_DOCUMENT||!1,it=t.RETURN_DOM||!1,ut=t.RETURN_DOM_FRAGMENT||!1,at=t.RETURN_TRUSTED_TYPE||!1,rt=t.FORCE_BODY||!1,ct=!1!==t.SANITIZE_DOM,st=t.SANITIZE_NAMED_PROPS||!1,lt=!1!==t.KEEP_CONTENT,ft=t.IN_PLACE||!1,U=t.ALLOWED_URI_REGEXP||Yb,St=t.NAMESPACE||wt,Y=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Dt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Dt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Y.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),tt&&($=!1),ut&&(it=!0),dt&&(W=_b({},Lb),G=[],!0===dt.html&&(_b(W,Db),_b(G,zb)),!0===dt.svg&&(_b(W,Bb),_b(G,Pb),_b(G,Hb)),!0===dt.svgFilters&&(_b(W,Ib),_b(G,Pb),_b(G,Hb)),!0===dt.mathMl&&(_b(W,Rb),_b(G,Vb),_b(G,Hb))),t.ADD_TAGS&&(W===j&&(W=Eb(W)),_b(W,t.ADD_TAGS,Et)),t.ADD_ATTR&&(G===q&&(G=Eb(G)),_b(G,t.ADD_ATTR,Et)),t.ADD_URI_SAFE_ATTR&&_b(vt,t.ADD_URI_SAFE_ATTR,Et),t.FORBID_CONTENTS&&(mt===gt&&(mt=Eb(mt)),_b(mt,t.FORBID_CONTENTS,Et)),lt&&(W["#text"]=!0),et&&_b(W,["html","head","body"]),W.table&&(_b(W,["tbody"]),delete X.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw kb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw kb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=t.TRUSTED_TYPES_POLICY,O=k.createHTML("")}else void 0===k&&(k=function(t,n){if("object"!=M(t)||"function"!=typeof t.createPolicy)return null;var e=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(e=n.getAttribute(o));var r="dompurify"+(e?"#"+e:"");try{return t.createPolicy(r,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,i)),null!==k&&"string"==typeof O&&(O=k.createHTML(""));ub&&ub(t),At=t}},It=_b({},["mi","mo","mn","ms","mtext"]),Ft=_b({},["annotation-xml"]),Rt=_b({},["title","style","font","a","script"]),Nt=_b({},[].concat(w(Bb),w(Ib),w(Fb))),Lt=_b({},[].concat(w(Rb),w(Nb))),zt=function(t){pb(e.removed,{element:t});try{S(t).removeChild(t)}catch(n){b(t)}},Pt=function(t,n){try{pb(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(t){pb(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!G[t])if(it||ut)try{zt(n)}catch(t){}else try{n.setAttribute(t,"")}catch(t){}},Vt=function(t){var n=null,e=null;if(rt)t="<remove></remove>"+t;else{var r=bb(t,/^[\r\n\t ]+/);e=r&&r[0]}"application/xhtml+xml"===_t&&St===wt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var i=k?k.createHTML(t):t;if(St===wt)try{n=(new g).parseFromString(i,_t)}catch(t){}if(!n||!n.documentElement){n=T.createDocument(St,"template",null);try{n.documentElement.innerHTML=Ct?O:i}catch(t){}}var u=n.body||n.documentElement;return t&&e&&u.insertBefore(o.createTextNode(e),u.childNodes[0]||null),St===wt?D.call(n,et?"html":"body")[0]:et?n.documentElement:u},Ht=function(t){return E.call(t.ownerDocument||t,t,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Ut=function(t){return t instanceof m&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof d)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}
2,Wt=function(t){return"function"==typeof c&&t instanceof c},jt=function(t,n,o){I[t]&&mb(I[t],function(t){t.call(e,n,o,At)})},Gt=function(t){var n=null;if(jt("beforeSanitizeElements",t,null),Ut(t))return zt(t),!0;var o=Et(t.nodeName);if(jt("uponSanitizeElement",t,{tagName:o,allowedTags:W}),t.hasChildNodes()&&!Wt(t.firstElementChild)&&Cb(/<[/\w]/g,t.innerHTML)&&Cb(/<[/\w]/g,t.textContent))return zt(t),!0;if(7===t.nodeType)return zt(t),!0;if(nt&&8===t.nodeType&&Cb(/<[/\w]/g,t.data))return zt(t),!0;if(!W[o]||X[o]){if(!X[o]&&Yt(o)){if(Y.tagNameCheck instanceof RegExp&&Cb(Y.tagNameCheck,o))return!1;if(Y.tagNameCheck instanceof Function&&Y.tagNameCheck(o))return!1}if(lt&&!mt[o]){var r=S(t)||t.parentNode,i=x(t)||t.childNodes;if(i&&r)for(var u=i.length-1;u>=0;--u){var a=v(i[u],!0);a.__removalCount=(t.__removalCount||0)+1,r.insertBefore(a,y(t))}}return zt(t),!0}return t instanceof s&&!function(t){var n=S(t);n&&n.tagName||(n={namespaceURI:St,tagName:"template"});var e=hb(t.tagName),o=hb(n.tagName);return!!kt[t.namespaceURI]&&(t.namespaceURI===xt?n.namespaceURI===wt?"svg"===e:n.namespaceURI===yt?"svg"===e&&("annotation-xml"===o||It[o]):Boolean(Nt[e]):t.namespaceURI===yt?n.namespaceURI===wt?"math"===e:n.namespaceURI===xt?"math"===e&&Ft[o]:Boolean(Lt[e]):t.namespaceURI===wt?!(n.namespaceURI===xt&&!Ft[o])&&!(n.namespaceURI===yt&&!It[o])&&!Lt[e]&&(Rt[e]||!Nt[e]):!("application/xhtml+xml"!==_t||!kt[t.namespaceURI]))}(t)?(zt(t),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!Cb(/<\/no(script|embed|frames)/i,t.innerHTML)?(tt&&3===t.nodeType&&(n=t.textContent,mb([F,R,N],function(t){n=yb(n,t," ")}),t.textContent!==n&&(pb(e.removed,{element:t.cloneNode()}),t.textContent=n)),jt("afterSanitizeElements",t,null),!1):(zt(t),!0)},qt=function(t,n,e){if(ct&&("id"===n||"name"===n)&&(e in o||e in Mt))return!1;if($&&!K[n]&&Cb(L,n));else if(J&&Cb(z,n));else if(!G[n]||K[n]){if(!(Yt(t)&&(Y.tagNameCheck instanceof RegExp&&Cb(Y.tagNameCheck,t)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(t))&&(Y.attributeNameCheck instanceof RegExp&&Cb(Y.attributeNameCheck,n)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(n))||"is"===n&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&Cb(Y.tagNameCheck,e)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(e))))return!1}else if(vt[n]);else if(Cb(U,yb(e,V,"")));else if("src"!==n&&"xlink:href"!==n&&"href"!==n||"script"===t||0!==xb(e,"data:")||!pt[t])if(Q&&!Cb(P,yb(e,V,"")));else if(e)return!1;return!0},Yt=function(t){return"annotation-xml"!==t&&bb(t,H)},Xt=function(t){jt("beforeSanitizeAttributes",t,null);var n=t.attributes;if(n){for(var o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G},r=n.length,i=function(){var i=n[r],u=i.name,a=i.namespaceURI,c=i.value,s=Et(u),l="value"===u?c:wb(c),f=l;if(o.attrName=s,o.attrValue=l,o.keepAttr=!0,o.forceKeepAttr=void 0,jt("uponSanitizeAttribute",t,o),l=o.attrValue,o.forceKeepAttr)return 0;if(!o.keepAttr)return Pt(u,t),0;if(!Z&&Cb(/\/>/i,l))return Pt(u,t),0;tt&&mb([F,R,N],function(t){l=yb(l,t," ")});var d=Et(t.nodeName);if(qt(d,s,l))if(!st||"id"!==s&&"name"!==s||(Pt(u,t),l="user-content-"+l),nt&&Cb(/((--!?|])>)|<\/(style|title)/i,l))Pt(u,t);else{if(k&&"object"==M(p)&&"function"==typeof p.getAttributeType)if(a);else switch(p.getAttributeType(d,s)){case"TrustedHTML":l=k.createHTML(l);break;case"TrustedScriptURL":l=k.createScriptURL(l)}if(l!==f)try{a?t.setAttributeNS(a,u,l):t.setAttribute(u,l),Ut(t)?zt(t):gb(e.removed)}catch(t){}}else Pt(u,t)};r--;)i();jt("afterSanitizeAttributes",t,null)}},Kt=function t(n){var e=null,o=Ht(n);for(jt("beforeSanitizeShadowDOM",n,null);e=o.nextNode();)jt("uponSanitizeShadowNode",e,null),Gt(e)||(e.content instanceof u&&t(e.content),Xt(e));jt("afterSanitizeShadowDOM",n,null)};return e.sanitize=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,a=null,s=null;if((Ct=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Wt(t)){if("function"!=typeof t.toString)throw kb("toString is not a function");if("string"!=typeof(t=t.toString()))throw kb("dirty is not a string, aborting")}if(!e.isSupported)return t;if(ot||Bt(n),e.removed=[],"string"==typeof t&&(ft=!1),ft){if(t.no
2deName){var l=Et(t.nodeName);if(!W[l]||X[l])throw kb("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)1===(i=(o=Vt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!it&&!tt&&!et&&-1===t.indexOf("<"))return k&&at?k.createHTML(t):t;if(!(o=Vt(t)))return it?null:at?O:""}o&&rt&&zt(o.firstChild);for(var f=Ht(ft?t:o);a=f.nextNode();)Gt(a)||(a.content instanceof u&&Kt(a.content),Xt(a));if(ft)return t;if(it){if(ut)for(s=A.call(o.ownerDocument);o.firstChild;)s.appendChild(o.firstChild);else s=o;return(G.shadowroot||G.shadowrootmode)&&(s=B.call(r,s,!0)),s}var d=et?o.outerHTML:o.innerHTML;return et&&W["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Cb(Jb,o.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+d),tt&&mb([F,R,N],function(t){d=yb(d,t," ")}),k&&at?k.createHTML(d):d},e.setConfig=function(){Bt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ot=!0},e.clearConfig=function(){At=null,ot=!1},e.isValidAttribute=function(t,n,e){At||Bt({});var o=Et(t),r=Et(n);return qt(o,r,e)},e.addHook=function(t,n){"function"==typeof n&&(I[t]=I[t]||[],pb(I[t],n))},e.removeHook=function(t){if(I[t])return gb(I[t])},e.removeHooks=function(t){I[t]&&(I[t]=[])},e.removeAllHooks=function(){I={}},e}(),ty=function(t){return Zb().sanitize(t)},ny=tinymce.util.Tools.resolve("tinymce.util.I18n"),ey={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},oy="temporary-placeholder",ry=function(t){return function(){return Ft(t,oy).getOr("!not found!")}},iy=function(t,n){var e=t.toLowerCase();if(ny.isRtl()){var o=function(t,n){return qt(t,n)?t:function(t,n){return t+n}(t,n)}(e,"-rtl");return Rt(n,o)?o:e}return e},uy=function(t,n){return Ft(n,iy(t,n))},ay=function(t,n){var e=n();return uy(t,e).getOrThunk(ry(e))},cy=function(){return Ip("add-focusable",[fu(function(t){Mc(t.element,"svg").each(function(t){return Pn(t,"focusable","false")})})])},sy=function(t,n,e,o){var r,i,u=function(t){return!!ny.isRtl()&&Rt(ey,t)}(n)?["tox-icon--flip"]:[],a=Ft(e,iy(n,e)).or(o).getOrThunk(ry(e));return{dom:{tag:t.tag,attributes:null!==(r=t.attributes)&&void 0!==r?r:{},classes:t.classes.concat(u),innerHtml:a},behaviours:Cu([].concat(w(null!==(i=t.behaviours)&&void 0!==i?i:[]),[cy()]))}},ly=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:G.none();return sy(n,t,e(),o)},fy={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},dy=Qd({name:"Notification",factory:function(t){var n=Wa("notification-text"),e=Vv({dom:Pv("<p id=".concat(n,">").concat(ty(t.backstageProvider.translate(t.text)),"</p>")),behaviours:Cu([Bp.config({})])}),o=function(t){return{dom:{tag:"div",classes:["tox-bar"],styles:{width:"".concat(t,"%")}}}},r=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:"".concat(t,"%")}}},i=Vv({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[o(0)]},r(0)],behaviours:Cu([Bp.config({})])}),u={updateProgress:function(t,n){t.getSystem().isConnected()&&i.getOpt(t).each(function(t){Bp.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[o(n)]},r(n)])})},updateText:function(t,n){if(t.getSystem().isConnected()){var o=e.get(t);Bp.set(o,[bc(n)])}}},a=lt([t.icon.toArray(),t.level.toArray(),t.level.bind(function(t){return G.from(fy[t])}).toArray()]),c=Vv(zv.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":t.backstageProvider.translate("Close")}},components:[ly("close",{tag:"span",classes:["tox-icon"]},t.iconProvider)],buttonBehaviours:Cu([Wv.config({}),tb.config(_({},t.backstageProvider.tooltips.getConfig({tooltipText:t.backstageProvider.translate("Close")})))]),action:function(n){t.onAction(n)}})),s=function(t,n,e){var o=e(),r=ct(t,function(t){return Rt(o,iy(t,o))});return sy({tag:"div",classes:["tox-notification__icon"]},r.getOr(oy),o,G.none())}(a,0,t.iconProvider),l=[s,{dom:{tag:"div",classes:["tox-notification__body"]},components:[e.asSpec()],behaviours:Cu([Bp.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":n},classes:t.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--".concat(t)]}).getOr(["tox-notification","tox-notification--in"])},behaviours:Cu([Wv.config({}),zp.config({}),Cp.config({mode:"special",onEscape:function(n){return t.onAction(n),G.some(!0)}})]),components:l.concat(t.progress?[i.asSpec()]:[]).concat([c.asSpec()]),apis:u}},configFields:[Or("level"),vr("progress"),Or("icon"),vr("onAction"),vr("text"),vr("iconProvider"),vr("backstageProvider")],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}});!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(Mb||(Mb={}));var my,gy=Mb,py="tox-menu-nav__js",hy="tox-collection__item",vy="tox-swatch",by={normal:py,color:vy},yy="tox-collection__item--enabled",xy="tox-collection__item-icon",wy="tox-collection__item-label",Sy="tox-collection__item-caret",Cy="tox-collection__item--active",ky="tox-collection__item-container",Oy="tox-collection__item-container--row",_y=function(t){return Ft(by,t).getOr(py)},Ty=function(t){return"color"===t?"tox-swatches":"tox-menu"},Ey=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Ty(t),tieredMenu:"tox-tiered-menu"}},Ay=function(t){var n=Ey(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:_y(t)}},My=function(t,n,e){var o=Ey(e);return{tag:"div",classes:lt([[o.menu,"tox-menu-".concat(n,"-column")],t?[o.hasIcons]:[]])}},Dy=[mh.parts.items({})],By=function(t,n,e){var o=Ey(e);return{dom:{tag:"div",classes:lt([[o.tieredMenu]])},markers:Ay(e)}},Iy=N([Or("data"),Ir("inputAttributes",{}),Ir("inputStyles",{}),Ir("tag","input"),Ir("inputClasses",[]),Aa("onSetValue"),Ir("styles",{}),Ir("eventOrder",{}),$f("inputBehaviours",[Jf,zp]),Ir("selectOnFocus",!0)]),Fy=function(t){return Cu([zp.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=fc(n);n.dom.setSelectionRange(0,e.length)}:I})])},Ry=function(t){return _(_({},Fy(t)),Zf(t.inputBehaviours,[Jf.config({store:_(_({mode:"manual"},t.data.map(function(t){return{initialValue:t}}).getOr({})),{},{getValue:function(t){return fc(t.element)},setValue:function(t,n){fc(t.element)!==n&&dc(t.element,n)}}),onSetValue:t.onSetValue})]))},Ny=function(t){return{tag:t.tag,attributes:_({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Ly=Qd({name:"Input",configFields:Iy(),factory:function(t,n){return{uid:t.uid,dom:Ny(t),components:[],behaviours:Ry(t),eventOrder:t.eventOrder}}}),zy=Wa("refetch-trigger-event"),Py=Wa("redirect-menu-item-interaction"),Vy="tox-menu__searcher",Hy=function(t){return Dc(t.element,".".concat(Vy)).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},Uy=Hy,Wy=function(t){return{fetchPattern:Jf.getValue(t),selectionStart:t.element.dom.selectionStart,selectionEnd:t.element.dom.selectionEnd}},jy=function(t){var n=function(t,n){return n.cut(),G.none()},e=function(t,n){var e={interactionEvent:n.event,eventType:n.event.raw.t
2ype};return Ki(t,Py,e),G.some(!0)},o="searcher-events";return{dom:{tag:"div",classes:[hy]},components:[Ly.sketch({inputClasses:[Vy,"tox-textfield"],inputAttributes:_(_({},t.placeholder.map(function(n){return{placeholder:t.i18n(n)}}).getOr({})),{},{type:"search","aria-autocomplete":"list"}),inputBehaviours:Cu([Ip(o,[ou(mi(),function(t){Xi(t,zy)}),ou(fi(),function(t,n){"Escape"===n.event.raw.key&&n.stop()})]),Cp.config({mode:"special",onLeft:n,onRight:n,onSpace:n,onEnter:e,onEscape:e,onUp:e,onDown:e})]),eventOrder:{keydown:[o,Cp.name()]}})]}},Gy="tox-collection--results__js",qy=function(t){var n;return t.dom?_(_({},t),{},{dom:_(_({},t.dom),{},{attributes:_(_({},null!==(n=t.dom.attributes)&&void 0!==n?n:{}),{},{id:Wa("aria-item-search-result-id"),"aria-selected":"false"})})}):t},Yy=function(t,n){return function(e){var o=nt(e,n);return et(o,function(n){return{dom:t,components:n}})}},Xy=function(t,n){var e=[],o=[];return ot(t,function(t,r){n(t,r)?(o.length>0&&e.push(o),o=[],(Rt(t.dom,"innerHtml")||t.components&&t.components.length>0)&&o.push(t)):o.push(t)}),o.length>0&&e.push(o),et(e,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})},Ky=function(t,n,e){return mh.parts.items({preprocess:function(o){var r=et(o,e);return"auto"!==t&&t>1?Yy({tag:"div",classes:["tox-collection__group"]},t)(r):Xy(r,function(t,e){return"separator"===n[e].type})}})},Jy=function(t,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Ky(t,n,L)]}},$y=function(t){return Z(t,function(t){return"icon"in t&&void 0!==t.icon})},Qy=function(t){return console.error(fr(t)),console.log(t),G.none()},Zy=function(t,n,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[mh.parts.items({preprocess:function(t){return Xy(t,function(t,n){return"separator"===i[n].type})}})]});return{value:t,dom:u.dom,components:u.components,items:e}},tx=function(t,n,e,o,r){if("color"===r.menuType){var i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[mh.parts.items({preprocess:"auto"!==t?Yy({tag:"div",classes:["tox-swatches__row"]},t):L})]}]}}(o);return{value:t,dom:i.dom,components:i.components,items:e}}if("normal"===r.menuType&&"auto"===o){var u=Jy(o,e);return{value:t,dom:u.dom,components:u.components,items:e}}if("normal"===r.menuType||"searchable"===r.menuType){var a="searchable"!==r.menuType?Jy(o,e):"search-with-field"===r.searchMode.searchMode?function(t,n,e){var o=Wa("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[jy({i18n:ny.translate,placeholder:e.placeholder}),{dom:{tag:"div",classes:[].concat(w(1===t?["tox-collection--list"]:["tox-collection--grid"]),[Gy]),attributes:{id:o}},components:[Ky(t,n,qy)]}]}}(o,e,r.searchMode):function(t,n){var e=Wa("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",Gy].concat(1===t?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:e}},components:[Ky(t,n,qy)]}}(o,e);return{value:t,dom:a.dom,components:a.components,items:e}}if("listpreview"===r.menuType&&"auto"!==o){var c=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[mh.parts.items({preprocess:Yy({tag:"div",classes:["tox-collection__group"]},t)})]}}(o);return{value:t,dom:c.dom,components:c.components,items:e}}return{value:t,dom:My(n,o,r.menuType),components:Dy,items:e}},nx=yr("type"),ex=yr("name"),ox=yr("label"),rx=yr("text"),ix=yr("title"),ux=yr("icon"),ax=yr("value"),cx=wr("fetch"),sx=wr("getSubmenuItems"),lx=wr("onAction"),fx=wr("onItemAction"),dx=Pr("onSetup",function(){return I}),mx=Er("name"),gx=Er("text"),px=Er("role"),hx=Er("icon"),vx=Er("tooltip"),bx=Er("label"),yx=Er("shortcut"),xx=Mr("select"),wx=zr("active",!1),Sx=zr("borderless",!1),Cx=zr("enabled",!0),kx=zr("primary",!1),Ox=function(t){return Ir("columns",t)},_x=Ir("meta",{}),Tx=Pr("onAction",I),Ex=function(t){return Nr("type",t)},Ax=function(t){return gr("name","name",Ro(function(){return Wa("".concat(t,"-name"))}),tr)},Mx=Yo([nx,gx]),Dx=Yo([Ex("autocompleteitem"),wx,Cx,_x,ax,gx,hx]),Bx=[Cx,vx,hx,gx,dx,Nr("context","mode:design")],Ix=Yo([nx,lx,yx].concat(Bx)),Fx=function(t){return cr("toolbarbutton",Ix,t)}
2,Rx=[wx].concat(Bx),Nx=Yo(Rx.concat([nx,lx,yx])),Lx=function(t){return cr("ToggleButton",Nx,t)},zx=[Pr("predicate",W),Lr("scope","node",["node","editor"]),Lr("position","selection",["node","selection","line"])],Px=Bx.concat([Ex("contextformbutton"),kx,lx,pr("original",L)]),Vx=Rx.concat([Ex("contextformbutton"),kx,lx,pr("original",L)]),Hx=Bx.concat([Ex("contextformbutton")]),Ux=Rx.concat([Ex("contextformtogglebutton")]),Wx=dr("type",{contextformbutton:Px,contextformtogglebutton:Vx}),jx=Yo([Ex("contextform"),Pr("initValue",N("")),bx,kr("commands",Wx),_r("launch",dr("type",{contextformbutton:Hx,contextformtogglebutton:Ux}))].concat(zx)),Gx=Yo([Ex("contexttoolbar"),yr("items")].concat(zx)),qx=[nx,yr("src"),Er("alt"),Vr("classes",[],tr)],Yx=Yo(qx),Xx=[nx,rx,mx,Vr("classes",["tox-collection__item-label"],tr)],Kx=Yo(Xx),Jx=Go(function(){return ir("type",{cardimage:Yx,cardtext:Kx,cardcontainer:$x})}),$x=Yo([nx,Nr("direction","horizontal"),Nr("align","left"),Nr("valign","middle"),kr("items",Jx)]),Qx=[Cx,gx,px,yx,gr("value","value",Ro(function(){return Wa("menuitem-value")}),$o()),_x,Nr("context","mode:design")],Zx=Yo([nx,bx,kr("items",Jx),dx,Tx].concat(Qx)),tw=Yo([nx,wx,hx].concat(Qx)),nw=[nx,yr("fancytype"),Tx],ew=[Ir("initData",{})].concat(nw),ow=[Mr("select"),Hr("initData",{},[zr("allowCustomColors",!0),Nr("storageKey","default"),Dr("colors",$o())])].concat(nw),rw=dr("fancytype",{inserttable:ew,colorswatch:ow}),iw=Yo([nx,dx,Tx,hx].concat(Qx)),uw=Yo([nx,sx,dx,hx].concat(Qx)),aw=Yo([nx,hx,wx,dx,lx].concat(Qx)),cw=function(t,n,e){var o=Al(t.element,"."+e);if(o.length>0){var r=st(o,function(t){var e=t.dom.getBoundingClientRect().top,r=o[0].dom.getBoundingClientRect().top;return Math.abs(e-r)>n}).getOr(o.length);return G.some({numColumns:r,numRows:Math.ceil(o.length/r)})}return G.none()},sw=function(t){return function(t,n){return Cu([Ip(t,n)])}(Wa("unnamed-events"),t)},lw=function(t){return vm.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},fw=function(t){return vm.config({disabled:t})},dw=function(t){return vm.config({disabled:t,disableClass:"tox-tbtn--disabled"})},mw=function(t){return vm.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},gw=function(t,n){var e=t.getApi(n);return function(t){t(e)}},pw=function(t,n){return fu(function(e){gw(t,e)(function(e){var o=t.onSetup(e);A(o)&&n.set(o)})})},hw=function(t,n){return du(function(e){return gw(t,e)(n.get())})},vw="silver.uistate",bw=function(t,n){var e=t.mainUi.outerContainer.element,o=[t.mainUi.mothership].concat(w(t.uiMotherships));"setDisabled"===n&&ot(o,function(t){t.broadcastOn([Df()],{target:e})}),ot(o,function(t){t.broadcastOn([vw],n)})},yw=function(t,n){t.on("init SwitchMode",function(t){bw(n,t.type)}),t.on("NodeChange",function(e){t.ui.isEnabled()?bw(n,e.type):bw(n,"setDisabled")}),Dh(t)&&t.mode.set("readonly")},xw=function(t){return hs.config({channels:T({},vw,{onReceive:function(n,e){if("setDisabled"!==e&&"setEnabled"!==e){var o=t(),r=o.contextType,i=o.shouldDisable;("mode"!==r||Q(["switchmode","init"],e))&&vm.set(n,i)}else vm.set(n,"setDisabled"===e)}})})},ww=function(t,n){return gu(function(e,o){gw(t,e)(t.onAction),t.triggersSubmenu||n!==gy.CLOSE_ON_EXECUTE||(e.getSystem().isConnected()&&Xi(e,Mi()),o.stop())})},Sw=T({},_i(),["disabling","alloy.base.behaviour","toggling","item-events"]),Cw=zt,kw=function(t,n,e,o){var r=ho(I);return{type:"item",dom:n.dom,components:Cw(n.optComponents),data:t.data,eventOrder:Sw,hasSubmenu:t.triggersSubmenu,itemBehaviours:Cu([Ip("item-events",[ww(t,e),pw(t,r),hw(t,r)]),lw(function(){return!t.enabled||o.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return o.checkUiComponentContext(t.context)}),Bp.config({})].concat(t.itemBehaviours))}},Ow=function(t){return{value:t.value,meta:_({text:t.text.getOr("")},t.meta)}},_w=function(t){var n=Th.os.isMacOS()||Th.os.isiOS(),e=n?{alt:"â¥",ctrl:"â",shift:"â§",meta:"â",access:"ââ¥"}:{meta:"Ctrl",access:"Shift+Alt"},o=t.split("+"),r=et(o,function(t){var n=t.toLowerCase().trim();return Rt(e,n)?e[n]:t});return n?r.join(""):r.join("+")},Tw=function(t,n){return ly(t,{tag:"div",classes:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[xy]},n)},Ew=function(t){return{dom:{tag:"div",classes:[wy]},components:[bc(ny.translate(t))]}},Aw=function(t,n){return{dom:{tag:"div",classes:n,innerHtml:t}}},Mw=function(t,n){return{dom:{tag:"div",classes:[wy]},components:[{dom:{tag:t.tag,styles:t.styles},components:[bc(ny.translate(n))]}]}},Dw=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"]},components:[bc(_w(t))]}},Bw=function(t){return Tw("checkmark",t,["tox-collection__item-checkmark"])},Iw=function(t){var n=t.map(function(t){return{attributes:{id:Wa("menu-item"),"aria-label":ny.translate(t)}
2}}).getOr({});return _({tag:"div",classes:[py,hy]},n)},Fw=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:G.none();return"color"===t.presets?function(t,n,e){var o=t.value,r=t.iconContent.map(function(t){return function(t,n,e){var o=n();return uy(t,o).or(e).getOrThunk(ry(o))}(t,n.icons,e)}),i=t.ariaLabel.map(function(t){return{"aria-label":n.translate(t),"data-mce-name":t}}).getOr({});return{dom:function(){var t=vy,n=r.getOr(""),e={tag:"div",attributes:i,classes:[t]};return"custom"===o?_(_({},e),{},{tag:"button",classes:[].concat(w(e.classes),["tox-swatches__picker-btn"]),innerHtml:n}):"remove"===o?_(_({},e),{},{classes:[].concat(w(e.classes),["tox-swatch--remove"]),innerHtml:n}):O(o)?_(_({},e),{},{attributes:_(_({},e.attributes),{},{"data-mce-color":o}),styles:{"background-color":o},innerHtml:n}):e}(),optComponents:[]}}(t,n,o):function(t,n,e,o){var r={tag:"div",classes:[xy]},i=e?t.iconContent.map(function(t){return ly(t,r,n.icons,o)}).orThunk(function(){return G.some({dom:r})}):G.none(),u=t.checkMark,a=G.from(t.meta).fold(function(){return Ew},function(t){return Rt(t,"style")?P(Mw,t.style):Ew}),c=t.htmlContent.fold(function(){return t.textContent.map(a)},function(t){return G.some(Aw(t,[wy]))});return{dom:Iw(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(Dw),u,t.caret]}}(t,n,e,o)},Rw=function(t,n,e){return Ft(t,"tooltipWorker").map(function(t){return[tb.config({lazySink:n.get
2Sink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:js}}},mode:"follow-highlight",onShow:function(n,e){t(function(t){tb.setComponents(n,[yc({element:tn(t)})])})}})]}).getOrThunk(function(){return e.map(function(t){return[tb.config(_(_({},n.providers.tooltips.getConfig({tooltipText:t})),{},{mode:"follow-highlight"}))]}).getOr([])})},Nw=function(t,n){var e=function(t){return Oh.DOM.encode(t)}(ny.translate(t));if(n.length>0){var o=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(n),"gi");return e.replace(o,function(t){return'<span class="tox-autocompleter-highlight">'.concat(t,"</span>")})}return e},Lw=function(t,n){return et(t,function(t){switch(t.type){case"cardcontainer":return function(t,n){var e="vertical"===t.direction?"tox-collection__item-container--column":Oy,o="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[ky,e,o,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:n}}(t,Lw(t.items,n));case"cardimage":return function(t,n,e){return{dom:{tag:"img",classes:n,attributes:{src:t,alt:e.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var e=t.name.exists(function(t){return Q(n.cardText.highlightOn,t)})?G.from(n.cardText.matchText).getOr(""):"";return Aw(Nw(t.text,e),t.classes)}})},zw=Dd(uh(),ah()),Pw=function(t){return{value:Ww(t)}},Vw=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Hw=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Uw=function(t){return Vw.test(t)||Hw.test(t)},Ww=function(t){return Wt(t,"#").toUpperCase()},jw=function(t){var n=t.toString(16);return(1===n.length?"0"+n:n).toUpperCase()},Gw=function(t){var n=jw(t.red)+jw(t.green)+jw(t.blue);return Pw(n)},qw=Math.min,Yw=Math.max,Xw=Math.round,Kw=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,Jw=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,$w=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},Qw=function(t){var n=parseInt(t,10);return n.toString()===t&&n>=0&&n<=255},Zw=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=Yw(0,qw(i,1)),u=Yw(0,qw(u,1)),0===i)return n=e=o=Xw(255*u),$w(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=Xw(255*(n+l)),e=Xw(255*(e+l)),o=Xw(255*(o+l)),$w(n,e,o,1)},tS=function(t){var n=function(t){var n=function(t){var n=t.value.replace(Vw,function(t,n,e,o){return n+n+e+e+o+o});return{value:n}}(t),e=Hw.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e}(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return $w(e,o,r,1)},nS=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return $w(r,i,u,a)},eS=function(t){var n=Kw.exec(t);if(null!==n)return G.some(nS(n[1],n[2],n[3],"1"));var e=Jw.exec(t);return null!==e?G.some(nS(e[1],e[2],e[3],e[4])):G.none()},oS=function(t){return"rgba(".concat(t.red,",").concat(t.green,",").concat(t.blue,",").concat(t.alpha,")")},rS=$w(255,0,0,1),iS=function(t,n){t.dispatch("ResizeContent",n)},uS=function(t,n){t.dispatch("TextColorChange",n)},aS=function(t,n){return t.dispatch("ResolveName",{name:n.nodeName.toLowerCase(),target:n})},cS=function(t,n){return function(){t(),n()}},sS=function(t){return fS(t,"NodeChange",function(n){n.setEnabled(t.selection.isEditable())})},lS=function(t,n){return function(e){var o=sS(t)(e),r=function(t,n){return function(e){var o=bo(),r=function(){e.setActive(t.formatter.match(n));var r=t.formatter.formatChanged(n,e.setActive);o.set(r)};return t.initialized?r():t.once("init",r),function(){t.off("init",r),o.clear()}}}(t,n)(e);return function(){o(),r()}}},fS=function(t,n,e){return function(o){var r=function(){return e(o)},i=function(){e(o),t.on(n,r)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(n,r)}}}
2,dS=function(t){return function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("mceToggleFormat",!1,n.format)})}}},mS=function(t,n){return function(){return t.execCommand(n)}},gS=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),pS={},hS=function(t){return Ft(pS,t).getOrThunk(function(){var n="tinymce-custom-colors-".concat(t),e=gS.getItem(n);if(k(e)){var o=gS.getItem("tinymce-custom-colors");gS.setItem(n,O(o)?o:"[]")}var r=function(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=gS.getItem(t),r=f(o)?JSON.parse(o):[],i=e-(n=r).length<0?n.slice(0,e):n,u=function(t){i.splice(t,1)};return{add:function(n){(function(t,n){var e=$(t,n);return-1===e?G.none():G.some(e)})(i,n).each(u),i.unshift(n),i.length>e&&i.pop(),gS.setItem(t,JSON.stringify(i))},state:function(){return i.slice(0)}}}(n,10);return pS[t]=r,r})},vS=function(t,n){hS(t).add(n)},bS=function(t,n,e){return{hue:t,saturation:n,value:e}},yS=function(t){var n=0,e=0,o=0,r=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?bS(0,0,100*(o=a)):(n=60*((n=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),e=(c-a)/c,o=c,bS(Math.round(n),Math.round(100*e),Math.round(100*o)))},xS=function(t){return Gw(Zw(t))},wS="forecolor",SS="hilitecolor",CS=function(t){for(var n=[],e=0;e<t.length;e+=2)n.push({text:t[e+1],value:t[e],icon:"checkmark",type:"choiceitem"});return n},kS=function(t){return function(n){return n.options.get(t)}},OS="#000000",_S=function(t,n){return n===wS&&t.options.isSet("color_map_foreground")?kS("color_map_foreground")(t):n===SS&&t.options.isSet("color_map_background")?kS("color_map_background")(t):t.options.isSet("color_map_raw")?kS("color_map_raw")(t):kS("color_map")(t)},TS=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";return Math.max(5,Math.ceil(Math.sqrt(_S(t,n).length)))},ES=function(t,n){var e=kS("color_cols")(t),o=TS(t,n);return e===TS(t)?o:e},AS=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";return Math.round(n===wS?kS("color_cols_foreground")(t):n===SS?kS("color_cols_background")(t):kS("color_cols")(t))},MS=kS("custom_colors"),DS=kS("color_default_foreground"),BS=kS("color_default_background"),IS=function(t,n){var e=tn(t.selection.getStart()),o="hilitecolor"===n?Kr(e,function(t){if(cn(t)){var n=Jn(t,"background-color");return Ht(eS(n).exists(function(t){return 0!==t.alpha}),n)}return G.none()}).getOr("rgba(0, 0, 0, 0)"):Jn(e,"color");return eS(o).map(function(t){return"#"+Gw(t).value})},FS=function(t){var n="choiceitem",e={type:n,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:n,text:"Custom color",icon:"color-picker",value:"custom"}]:[e]},RS=function(t,n,e,o){"custom"===e?jS(t)(function(e){e.each(function(e){vS(n,e),t.execCommand("mceApplyTextcolor",n,e),o(e)})},IS(t,n).getOr(OS)):"remove"===e?(o(""),t.execCommand("mceRemoveTextcolor",n)):(o(e),t.execCommand("mceApplyTextcolor",n,e))},NS=function(t,n,e){return t.concat(function(t){return et(hS(t).state(),function(t){return{type:"choiceitem",text:t,icon:"checkmark",value:t}})}(n).concat(FS(e)))},LS=function(t,n,e){return function(o){o(NS(t,n,e))}},zS=function(t,n,e){var o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(o,e)},PS=function(t,n){t.setTooltip(n)},VS=function(t,n){return function(e){var o=IS(t,n);return Lt(o,e.toUpperCase())}},HS=function(t,n,e){if(Kt(e))return"forecolor"===n?"Text color":"Background color";var o="forecolor"===n?"Text color {0}":"Background color {0}",r=NS(_S(t,n),n,!1),i=ct(r,function(t){return t.value===e}).getOr({text:""}).text;return t.translate([o,t.translate(i)])},US=function(t,n,e,o){t.ui.registry.addSplitButton(n,{tooltip:HS(t,e,o.get()),presets:"color",icon:"forecolor"===n?"text-color":"highlight-bg-color",select:VS(t,e),columns:AS(t,e),fetch:LS(_S(t,e),e,MS(t)),onAction:function(n){RS(t,e,o.get(),I)},onItemAction:function(r,i){RS(t,e,i,function(e){o.set(e),uS(t,{name:n,color:e})})},onSetup:function(r){zS(r,n,o.get());var i=function(o){o.name===n&&(zS(r,o.name,o.color),PS(r,HS(t,e,o.color)))};
2return t.on("TextColorChange",i),cS(sS(t)(r),function(){t.off("TextColorChange",i)})}})},WS=function(t,n,e,o,r){t.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",onSetup:function(o){return PS(o,HS(t,e,r.get())),zS(o,n,r.get()),sS(t)(o)},getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",select:VS(t,e),initData:{storageKey:e},onAction:function(o){RS(t,e,o.value,function(e){r.set(e),uS(t,{name:n,color:e})})}}]}})},jS=function(t){return function(n,e){var o=!1,r={colorpicker:e};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:r,onAction:function(t,n){"hex-valid"===n.name&&(o=n.value)},onSubmit:function(e){var r=e.getData().colorpicker;o?(n(G.from(r)),e.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",r]))},onClose:I,onCancel:function(){n(G.none())}})}},GS=function(t,n,e,o,r,i,u,a){var c=$y(n),s=qS(n,e,o,"color"!==r?"normal":"color",i,u,a);return tx(t,c,s,o,{menuType:r})},qS=function(t,n,e,o,r,i,u){return zt(et(t,function(a){return"choiceitem"===a.type?(c=a,cr("choicemenuitem",tw,c)).fold(Qy,function(a){return G.some(function(t,n,e,o,r,i,u){var a=!(arguments.length>7&&void 0!==arguments[7])||arguments[7],c=Fw({presets:e,textContent:n?t.text:G.none(),htmlContent:G.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:G.none(),checkMark:n?G.some(Bw(u.icons)):G.none(),caret:G.none(),value:t.value},u,a),s=t.text.filter(N(!n)).map(function(t){return tb.config(u.tooltips.getConfig({tooltipText:u.translate(t)}))});return Io(kw({context:t.context,data:Ow(t),enabled:t.enabled,getApi:function(t){return{setActive:function(n){qp.set(t,n)},isActive:function(){return qp.isOn(t)},isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)}}},onAction:function(n){return o(t.value)},onSetup:function(t){return t.setActive(r),I},triggersSubmenu:!1,itemBehaviours:w(s.toArray())},c,i,u),{toggling:{toggleClass:yy,toggleOnExecute:!1,selected:t.active,exclusive:!0}})}(a,1===e,o,n,i(a.value),r,u,$y(t)))}):G.none();var c}))},YS=function(t,n){var e=Ay(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group"),previousSelector:function(t){return"color"===n?Dc(t.element,"[aria-checked=true]"):G.none()}}},XS=Wa("cell-over"),KS=Wa("cell-execute"),JS=function(t,n,e){var o=function(e){return Ki(e,KS,{row:t,col:n})},r=function(t,n){n.stop(),o(t)};return Sc({dom:{tag:"div",attributes:{role:"button","aria-label":e}}
2,behaviours:Cu([Ip("insert-table-picker-cell",[ou(ci(),zp.focus),ou(_i(),o),ou(pi(),r),ou(Ei(),r)]),qp.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),zp.config({onFocus:function(e){return Ki(e,XS,{row:t,col:n})}})])})},$S=function(t){return ft(t,function(t){return et(t,Cc)})},QS=function(t,n){return bc("".concat(n,"x").concat(t))},ZS={inserttable:function(t,n){var e=function(t){return function(n,e){return t.shared.providers.translate(["{0} columns, {1} rows",e,n])}}(n),o=function(t){for(var n=[],e=0;e<10;e++){for(var o=[],r=0;r<10;r++){var i=t(e+1,r+1);o.push(JS(e,r,i))}n.push(o)}return n}(e),r=QS(0,0),i=Vv({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[r],behaviours:Cu([Bp.config({})])});return{type:"widget",data:{value:Wa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[zw.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:$S(o).concat(i.asSpec()),behaviours:Cu([Ip("insert-table-picker",[fu(function(t){Bp.set(i.get(t),[r])}),au(XS,function(t,n,e){var r=e.event,u=r.row,a=r.col;(function(t,n,e){for(var o=0;o<10;o++)for(var r=0;r<10;r++)qp.set(t[o][r],o<=n&&r<=e)})(o,u,a),Bp.set(i.get(t),[QS(u+1,a+1)])}),au(KS,function(n,e,o){var r=o.event,i=r.row,u=r.col;Xi(n,Mi()),t.onAction({numRows:i+1,numColumns:u+1})})]),Cp.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,n){var e=function(t,n){var e=t.initData.allowCustomColors&&n.colorinput.hasCustomColors();return t.initData.colors.fold(function(){return NS(n.colorinput.getColors(t.initData.storageKey),t.initData.storageKey,e)},function(t){return t.concat(FS(e))})}(t,n),o=n.colorinput.getColorCols(t.initData.storageKey),r="color",i=_(_({},GS(Wa("menu-value"),e,function(n){t.onAction({value:n})},o,r,gy.CLOSE_ON_EXECUTE,t.select.getOr(W),n.shared.providers)),{},{markers:Ay(r),movement:YS(o,r),showMenuRole:!1});return{type:"widget",data:{value:Wa("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[zw.widget(mh.sketch(i))]}}},tC=function(t){return{type:"separator",dom:{tag:"div",classes:[hy,"tox-collection__group-heading"]},components:t.text.map(bc).toArray()}},nC=Object.freeze({__proto__:null,getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)},getExistingCoupled:function(t,n,e,o){return e.getExisting(t,n,o)}}),eC=[br("others",ar(Co.value,$o()))],oC=Object.freeze({__proto__:null,init:function(){var t={},n=function(n,e){if(0===Ct(n.others).length)throw new Error("Cannot find any known coupled components");return Ft(t,e)},e=N({});return Su({readState:e,getExisting:function(t,e,o){return n(e,o).orThunk(function(){return Ft(e.others,o).getOrDie("No information found for coupled component: "+o),G.none()})},getOrCreate:function(e,o,r){return n(o,r).getOrThunk(function(){var n=Ft(o.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(n);return t[r]=i,i})}})}}),rC=Ou({fields:eC,name:"coupling",apis:nC,state:oC}),iC=function(t){var n=G.none(),e=[],o=function(t){r()?i(t):e.push(t)},r=function(){return n.isSome()},i=function(t){n.each(function(n){setTimeout(function(){t(n)},0)})};return t(function(t){r()||(n=G.some(t),ot(e,i),e=[])}),{get:o,map:function(t){return iC(function(n){o(function(e){n(t(e))})})},isReady:r}},uC={nu:iC,pure:function(t){return iC(function(n){n(t)})}},aC=function(t){setTimeout(function(){throw t},0)},cC=function(t){var n=function(n){t().then(n,aC)};return{map:function(n){return cC(function(){return t().then(n)})},bind:function(n){return cC(function(){return t().then(function(t){return n(t).toPromise()})})},anonBind:function(n){return cC(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return uC.nu(n)},toCached:function(){var n=null;return cC(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},sC=function(t){return cC(function(){return new Promise(t)})},lC=function(t){return cC(function(){return Promise.resolve(t)})},fC=N("sink"),dC=N(_d({name:fC(),overrides:N({dom:{tag:"div"},behaviours:Cu([of.config({useFixed:j})]),events:tu([cu(fi()),cu(ri()),cu(pi())])})})),mC=function(t,n){var e=t.getHotspot(n).getOr(n),o="hotspot",r=t.getAnchorOverrides();return t.layouts.fold(function(){return{type:o,hotspot:e,overrides:r}},function(t){return{type:o,hotspot:e,overrides:r,layouts:t}})},gC=function(t,n,e,o,r,i,u){var a=function(t,n,e,o,r,i,u){var a=function(t,n,e){return(0,t.fetch)(e).map(n)}(t,n,o),c=vC(o,t);return a.map(function(n){return n.bind(function(n){var a=n.menus[n.primary];return G.from(a).each(function(n){t.listRole.each(function(t){n.role=t})}),G.from(Sh.sketch(_(_({},i.menu()),{},{uid:Ja(""),data:n,highlightOnOpen:u,onOpenMenu:function(t,n){var o=c().getOrDie();of.position(o,n,{anchor:e}),Mf.decloak(r)},onOpenSubmenu:function(t,n,e){var o=c().getOrDie();of.position(o,e,{anchor:{type:"submenu",item:n}}),Mf.decloak(r)},onRepositionMenu:function(t,n,o){var r=c().getOrDie();of.position(r,n,{anchor:e}),ot(o,function(t){of.position(r,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})})},onEscape:function(){return zp.focus(o),Mf.close(r),G.some(!0)}})))})})}(t,n,mC(t,e),e,o,r,u);return a.map(function(t){return t.fold(function(){Mf.isOpen(o)&&Mf.close(o)},function(t){Mf.cloak(o),Mf.open(o,t),i(o)}),o})},pC=function(t,n,e,o,r,i,u){return Mf.close(o),lC(o)},hC=function(t,n,e,o,r,i){var u=rC.getCoupled(e,"sandbox");return(Mf.isOpen(u)?pC:gC)(t,n,e,u,o,r,i)},vC=function(t,n){return t.getSystem().getByUid(n.uid+"-"+fC()).map(function(t){return function(){return Co.value(t)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return Co.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},bC=function(t){Mf.getState(t).each(function(t){Sh.repositionMenus(t)})},yC=function(t,n,e){var o=Fc(),r=vC(n,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:o.id}},behaviours:nd(t.sandboxBehaviours,[Jf.config({store:{mode:"memory",initialValue:n}}),Mf.config({onOpen:function(r,i){var u=mC(t,n);o.link(n.element),t.matchWidth&&function(t,n,e){var o=om.getCurrent(n).getOr(n),r=me(t.element);e?Yn(o.element,"min-width",r+"px"):function(t,n){de.set(t,n)}(o.element,r)}(u.hotspot,i,t.useMinWidth),t.onOpen(u,r,i),void 0!==e&&void 0!==e.onOpen&&e.onOpen(r,i)},onClose:function(t,i){o.unlink(n.element),r().getOr(i).element.dom.dis
2patchEvent(new window.FocusEvent("focusout")),void 0!==e&&void 0!==e.onClose&&e.onClose(t,i)},isPartOf:function(t,e,o){return Rc(e,o)||Rc(n,o)},getAttachPoint:function(){return r().getOrDie()}}),om.config({find:function(t){return Mf.getState(t).bind(function(t){return om.getCurrent(t)})}}),hs.config({channels:_(_({},Rf({isExtraPart:W})),Lf({doReposition:bC}))})])}},xC=function(t){var n=rC.getCoupled(t,"sandbox");bC(n)},wC=function(){return[Ir("sandboxClasses",[]),td("sandboxBehaviours",[om,hs,Mf,Jf])]},SC=N([vr("dom"),vr("fetch"),Aa("onOpen"),Ma("onExecute"),Ir("getHotspot",G.some),Ir("getAnchorOverrides",N({})),nl(),$f("dropdownBehaviours",[qp,rC,Cp,zp]),vr("toggleClass"),Ir("eventOrder",{}),Or("lazySink"),Ir("matchWidth",!1),Ir("useMinWidth",!1),Or("role"),Or("listRole")].concat(wC())),CC=N([Od({schema:[_a(),Ir("fakeFocus",!1)],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),dC()]),kC=Zd({name:"Dropdown",configFields:SC(),partFields:CC(),factory:function(t,n,e,o){var r=function(t){Mf.getState(t).each(function(t){Sh.highlightPrimary(t)})},i=function(n,e,r){return hC(t,L,n,o,e,r)},u={expand:function(t){qp.isOn(t)||i(t,I,Jm.HighlightNone).get(I)},open:function(t){qp.isOn(t)||i(t,I,Jm.HighlightMenuAndItem).get(I)},refetch:function(n){return rC.getExistingCoupled(n,"sandbox").fold(function(){return i(n,I,Jm.HighlightMenuAndItem).map(I)},function(e){return gC(t,L,n,e,o,I,Jm.HighlightMenuAndItem).map(I)})},isOpen:qp.isOn,close:function(t){qp.isOn(t)&&i(t,I,Jm.HighlightMenuAndItem).get(I)},repositionMenus:function(t){qp.isOn(t)&&xC(t)}},a=function(t,n){return Ji(t),G.some(!0)};return{uid:t.uid,dom:t.dom,components:n,behaviours:Zf(t.dropdownBehaviours,[qp.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),rC.config({others:{sandbox:function(n){return yC(t,n,{onOpen:function(){return qp.on(n)},onClose:function(){return qp.off(n)}})}}}),Cp.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t,n){if(kC.isOpen(t)){var e=rC.getCoupled(t,"sandbox");r(e)}else kC.open(t);return G.some(!0)},onEscape:function(t,n){return kC.isOpen(t)?(kC.close(t),G.some(!0)):G.none()}}),zp.config({})]),events:Xp(G.some(function(t){i(t,r,Jm.HighlightMenuAndItem).get(I)})),eventOrder:_(_({},t.eventOrder),{},T({},_i(),["disabling","toggling","alloy.base.behaviour"])),apis:u,domModification:{attributes:_(_({"aria-haspopup":t.listRole.getOr("true")},t.role.fold(function(){return{}},function(t){return{role:t}})),"button"===t.dom.tag?{type:Ft(t.dom,"attributes").bind(function(t){return Ft(t,"type")}).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},refetch:function(t,n){return t.refetch(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)},repositionMenus:function(t,n){return t.repositionMenus(n)}}}),OC=function(t,n,e){Uy(t).each(function(t){var o;(function(t,n){Un(n.element,"id").each(function(n){return Pn(t.element,"aria-activedescendant",n)})})(t,e),(Lu((o=n).element,Gy)?G.some(o.element):Dc(o.element,"."+Gy)).each(function(n){Un(n,"id").each(function(n){return Pn(t.element,"aria-controls",n)})})}),Pn(e.element,"aria-selected","true")},_C=function(t,n,e){Pn(e.element,"aria-selected","false")},TC=function(t){return rC.getExistingCoupled(t,"sandbox").bind(Hy).map(Wy).map(function(t){return t.fetchPattern}).getOr("")};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(my||(my={}));var EC,AC,MC=function(t,n,e,o,r,i){var u=$y(n),a=zt(et(n,function(t){var n=function(t){return function(t,n,e,o,r){var i,u=e.shared.providers,a=function(t){return r?_(_({},t),{},{shortcut:G.none(),icon:t.text.isSome()?G.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,cr("menuitem",iw,i)).fold(Qy,function(t){return G.some(function(t,n,e){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=Fw({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:G.none(),ariaLabel:t.text,caret:G.none(),checkMark:G.none(),shortcutContent:t.shortcut},e,o);return kw({context:t.context,data:Ow(t),getApi:function(t){return{isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)}}},enabled:t.enabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)}(a(t),n,u,o))});case"nestedmenuitem":return function(t){return cr("nestedmenuitem",uw,t)}(t).fold(Qy,function(t){return G.some(function(t,n,e){var o,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4]?(o=e.icons,Tw("chevron-down",o,[Sy])):function(t){return Tw("chevron-right",t,[Sy])}(e.icons),u=Fw({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:G.none(),ariaLabel:t.text,caret:G.some(i),checkMark:G.none(),shortcutContent:t.shortcut},e,r);return kw({context:t.context,data:Ow(t),getApi:function(t){return{isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)},setIconFill:function(n,e){Dc(t.element,'svg path[class="'.concat(n,'"], rect[class="').concat(n,'"]')).each(function(t){Pn(t,"fill",e)}
2)},setTooltip:function(n){var o=e.translate(n);Pn(t.element,"aria-label",o)}}},enabled:t.enabled,onAction:I,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n,e)}(a(t),n,u,o,r))});case"togglemenuitem":return function(t){return cr("togglemenuitem",aw,t)}(t).fold(Qy,function(t){return G.some(function(t,n,e){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=Fw({iconContent:t.icon,textContent:t.text,htmlContent:G.none(),ariaLabel:t.text,checkMark:G.some(Bw(e.icons)),caret:G.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return Io(kw({context:t.context,data:Ow(t),enabled:t.enabled,getApi:function(t){return{setActive:function(n){qp.set(t,n)},isActive:function(){return qp.isOn(t)},isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:yy,toggleOnExecute:!1,selected:t.active},role:t.role.getOrUndefined()})}(a(t),n,u,o))});case"separator":return function(t){return cr("separatormenuitem",Mx,t)}(t).fold(Qy,function(t){return G.some(tC(t))});case"fancymenuitem":return function(t){return cr("fancymenuitem",rw,t)}(t).fold(Qy,function(t){return function(t,n){return Ft(ZS,t.fancytype).map(function(e){return e(t,n)})}(t,e)});default:return console.error("Unknown item in general menu",t),G.none()}}(t,e,o,function(t){return r?!Rt(t,"text"):u}(t),r)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(_(_({},t),{},{enabled:!1})):n(t)})),c=function(t){return"no-search"===t.searchMode?{menuType:"normal"}:{menuType:"searchable",searchMode:t}}(i);return(r?Zy:tx)(t,u,a,1,c)},DC=function(t){return Sh.singleData(t.value,t)},BC=function(t){return hl(tn(t.startContainer),t.startOffset,tn(t.endContainer),t.endOffset)},IC=function(t,n){var e=Wa("autocompleter"),o=ho(!1),r=ho(!1),i=yo(),u=Sc(Ch.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:e}},components:[],fireDismissalEventInstead:{},inlineBehaviours:Cu([Ip("dismissAutocompleter",[ou(Pi(),function(){return f()}),ou(qi(),function(n,e){Un(e.event.target,"id").each(function(n){return Pn(tn(t.getBody()),"aria-activedescendant",n)})}
2)])]),lazySink:n.getSink})),a=function(){return Ch.isOpen(u)},c=r.get,s=function(){if(a()){Ch.hide(u),t.dom.remove(e,!1);var n=tn(t.getBody());Un(n,"aria-owns").filter(function(t){return t===e}).each(function(){jn(n,"aria-owns"),jn(n,"aria-activedescendant")})}},l=function(){return Ch.getContent(u).bind(function(t){return bt(t.components(),0)})},f=function(){return t.execCommand("mceAutocompleterClose")},d=function(r){var a=function(e){var r=St(e,function(t){return G.from(t.columns)}).getOr(1);return ft(e,function(e){return function(t,n,e,o,r,i,u){var a=1===o,c=!a||$y(t);return zt(et(t,function(t){switch(t.type){case"separator":return(o=t,cr("Autocompleter.Separator",Mx,o)).fold(Qy,function(t){return G.some(tC(t))});case"cardmenuitem":return function(t){return cr("cardmenuitem",Zx,t)}(t).fold(Qy,function(t){return G.some(function(t,n,e,o){var r={dom:Iw(t.label),optComponents:[G.some({dom:{tag:"div",classes:[ky,Oy]},components:Lw(t.items,o)})]};return kw({context:"mode:design",data:Ow(_({text:G.none()},t)),enabled:t.enabled,getApi:function(t){return{isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){vm.set(t,!n),ot(Al(t.element,"*"),function(e){t.getSystem().getByDom(e).each(function(t){t.hasConfigured(vm)&&vm.set(t,!n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:G.from(o.itemBehaviours).getOr([])},r,n,e.providers)}(_(_({},t),{},{onAction:function(n){t.onAction(n),e(t.value,t.meta)}}),r,i,{itemBehaviours:Rw(t.meta,i,G.none()),cardText:{matchText:n,highlightOn:u}}))});default:return function(t){return cr("Autocompleter.Item",Dx,t)}(t).fold(Qy,function(t){return G.some(function(t,n,e,o,r,i,u){var a=!(arguments.length>7&&void 0!==arguments[7])||arguments[7],c=Fw({presets:o,textContent:G.none(),htmlContent:e?t.text.map(function(t){return Nw(t,n)}):G.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:G.none(),checkMark:G.none(),caret:G.none(),value:t.value},u.providers,a,t.icon),s=t.text.filter(function(t){return!e&&""!==t});return kw({context:"mode:design",data:Ow(t),enabled:t.enabled,getApi:N({}),onAction:function(n){return r(t.value,t.meta)},onSetup:N(I),triggersSubmenu:!1,itemBehaviours:Rw(t,u,s)},c,i,u.providers)}(t,n,a,"normal",e,r,i,c))})}var o}))}(e.items,e.matchText,function(n,r){var u={hide:function(){return f()},reload:function(n){s(),t.execCommand("mceAutocompleterReload",!1,{fetchOptions:n})}};t.execCommand("mceAutocompleterRefreshActiveRange"),i.get().each(function(t){o.set(!0),e.onAction(u,t,n,r),o.set(!1)})},r,gy.BUBBLE_TO_SANDBOX,n,e.highlightOn)})}(r);a.length>0?(function(n,e){var o=St(n,function(t){return G.from(t.columns)}).getOr(1);Ch.showMenuAt(u,{anchor:{type:"selection",getSelection:function(){return i.get().map(BC)},root:tn(t.getBody())}},function(t,n,e,o){var r=YS(n,o),i=Ay(o);return{data:DC(_(_({},t),{},{movement:r,menuBehaviours:sw("auto"!==n?[]:[fu(function(t,n){cw(t,4,i.item).each(function(n){var e=n.numColumns,o=n.numRows;Cp.setGridSize(t,o,e)})})])})),menu:{markers:Ay(o),fakeFocus:e===my.ContentFocus}}}(tx("autocompleter-value",!0,e,o,{menuType:"normal"}),o,my.ContentFocus,"normal")),l().each(Tm.highlightFirst)}(r,a),Pn(tn(t.getBody()),"aria-owns",e),t.inline||m()):s()},m=function(){t.dom.get(e)&&t.dom.remove(e,!1);var n=t.getDoc().documentElement,o=t.selection.getNode(),r=function(t){return pa(t,!0)}(u.element);Xn(r,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:"".concat(o.offsetTop,"px"),left:"".concat(o.offsetLeft,"px")}),t.dom.add(n,r.dom),Dc(r,'[role="menu"]').each(function(t){ne(t,"position"),ne(t,"max-height")})};t.on("AutocompleterStart",function(t){var n=t.lookupData;r.set(!0),o.set(!1),d(n)}),t.on("AutocompleterUpdate",function(t){var n=t.lookupData;return d(n)}),t.on("AutocompleterUpdateActiveRange",function(t){var n=t.range;return i.set(n)}),t.on("AutocompleterEnd",function(){s(),r.set(!1),o.set(!1),i.clear()}),function(t,n){var e=function(t,n){Ki(t,fi(),{raw:n})},o=function(){return t.getMenu().bind(Tm.getHighlighted)};n.on("keydown",function(n){var r=n.which;t.isActive()&&(t.isMenuOpen()?13===r?(o().each(Ji),n.preventDefault()):40===r?(o().fold(function(){t.getMenu().each(Tm.highlightFirst)},function(t){e(t,n)}),n.preventDefault(),n.stopImmediatePropagation()):37!==r&&38!==r&&39!==r||o().each(function(t){e(t,n),n.preventDefault(),n.stopImmediatePropagation()}):13!==r&&38!==r&&40!==r||t.cancelIfNecessary())}),n.on("NodeChange",function(){!t.isActive()||t.isProcessingAction()||n.queryCommandState("mceAutoCompleterInRange")||t.cancelIfNecessary()})}({cancelIfNecessary:f,isMenuOpen:a,isActive:c,isProcessingAction:o.get,getMenu:l},t)},FC=function(t,n,e){return Bc(t,n,e).isSome()},RC=function(t,n){var e=null;return{cancel:function(){null!==e&&(clearTimeout(e),e=null)},schedule:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];e=setTimeout(function(){t.apply(null,r),e=null},n)}}},NC=function(t){var n=t.raw;return void 0===n.touches||1!==n.touches.length?G.none():G.some(n.touches[0])},LC=function(t,n){var e=Ft(t,"target").getOr(n);return ho(e)},zC=Ur([{stopped:[]},{resume:["element"]},{complete:[]}]),PC=function(t,n,e,o,r,i){var u=t(n,o),a=function(t,n){var e=ho(!1),o=ho(!1);return{stop:function(){e.set(!0)},cut:function(){o.set(!0)},isStopped:e.get,isCut:o.get,event:t,setSource:n.set,getSource:n.get}}(e,r);return u.fold(function(){return i.logEventNoHandlers(n,o),zC.complete()},function(t){var e=t.descHandler;return ic(e)(a),a.isStopped()?(i.logEventStopped(n,t.element,e.purpose),zC.stopped()):a.isCut()?(i.logEventCut(n,t.element,e.purpose),zC.complete()):Sn(t.element).fold(function(){return i.logNoParent(n,t.element,e.purpose),zC.complete()},function(o){return i.logEventResponse(n,t.element,e.purpose),zC.resume(o)})})},VC=function(t,n,e,o,r,i){return PC(t,n,e,o,r,i).fold(j,function(o){return VC(t,n,e,o,r,i)},W)},HC=function(t,n,e,o,r){var i=LC(e,o);return VC(t,n,e,o,i,r)},UC=Qd({name:"Container",factory:function(t){var n=t.dom,o=n.attributes,r=x(n,e);return{uid:t.uid,dom:_({tag:"div",attributes:_({role:"presentation"},o)},r),components:t.components,behaviours:Qf(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Ir("components",[]),$f("containerBehaviours",[]),Ir("events",{}),Ir("domModification",{}),Ir("eventOrder",{})]}),WC=function(t){var n=function(n){return Sn(t.element).fold(j,function(t){return hn(n,t)})},e=function(){var t=function(){var t={};return{registerId:function(n,e,o){Ot(o,function(o,r){var i=void 0!==t[r]?t[r]:{};i[e]=function(t,n){return{cHandler:P.apply(void 0,[t.handler].concat(n)),purpose:t.purpose}}(o,n),t[r]=i})},unregisterId:function(n){Ot(t,function(t,e){Rt(t,n)&&delete t[n]})},filterByType:function(n){return Ft(t,n).map(function(t){return Dt(t,function(t,n){return function(t,n){return{id:t,descHandler:n}}(n,t)})}).getOr([])},find:function(n,e,o){return Ft(t,e).bind(function(t){return Kr(o,function(n){return function(t,n){return Ka(n).bind(function(n){return Ft(t,n)}).map(function(t){return function(t,n){return{element:t,descHandler:n}}(n,t)})}(t,n)},n)})}}}(),n={},e=function(e){Ka(e.element).each(function(e){delete n[e],t.unregisterId(e)})};return{find:function(n,e,o){return t.find(n,e,o)},filter:function(n){return t.filterByType(n)},register:function(o){var r=function(t){var n=t.element;return Ka(n).getOrThunk(function(){return function(t,n){var e=Wa(qa+"uid-");return Xa(n,e),e}(0,t.element)})}(o);Nt(n,r)&&function(t,o){var r=n[o];if(r!==t)throw new Error('The tagId "'+o+'" is already used by: '+ha(r.element)+"\nCannot use it for: "+ha(t.element)+"\nThe conflicting element is"+(Rn(r.element)?" ":" not ")+"already in the DOM");e(t)}(o,r);var i=[o];t.registerId(i,r,o.events),n[r]=o},unregister:e,getById:function(t){return Ft(n,t)}}}(),o=function(t,o){return e.find(n,t,o)},r=function(t,n){var e=_({stopBackspace:!0},n),o=function(t){var n=yo(),e=ho(!1),o=RC(function(n){t.triggerEvent(Ai(),n),e.set(!0)},400),r=qr([{key:ti(),value:function(t){return NC(t).each(function(r){o.cancel();var i={x:r.clientX,y:r.clientY,target:t.target};o.schedule(t),e.set(!1),n.set(i)}),G.none()}},{key:ni(),value:function(t){return o.cancel(),NC(t).each(function(t){n.on(function(e){(function(t,n){var e=Math.abs(t.clientX-n.x),o=Math.abs(t.clientY-n.y);return e>5||o>5})(t,e)&&n.clear()})}),G.none()}},{key:ei(),value:function(r){return o.cancel(),n.get().filter(function(t){return hn(t.target,r.target)}).map(function(n){return e.get()?(r.prevent(),!1):t.triggerEvent(Ei(),r)})}}]);return{fireIfReady:function(t,n){return Ft(r,n).bind(function(n){return n(t)})}}}(e),r=et(["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(n){return Ls(t,n,function(t){o.fireIfReady(t,n).each(function(n){n&&t.kill()}),e.triggerEvent(n,t)&&t.kill()})}),i=yo(),u=Ls(t,"paste",function(t){o.fireIfReady(t,"paste").each(function(n){n&&t.kill()}),e.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout(function(){e.triggerEvent(ki(),t)},0))}),a=Ls(t,"keydown",function(t){e.triggerEvent("keydown",t)?t.kill():e.stopBackspace&&function(t){return t.raw.which===Em[0]&&!Q(["input","textarea"],rn(t.target))&&!FC(t.target,'[contenteditable="true"]')}(t)&&t.prevent()}),c=Ls(t,"focusin",function(t){e.triggerEvent("focusin",t)&&t.kill()}),s=yo(),l=Ls(t,"focusout",function(t){e.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout(function(){e.triggerEvent(Ci(),t)},0))});return{unbind:function(){ot(r,function(t){t.unbind()}),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}}(t.element,{triggerEvent:function(t,n){return ya(t,n.target,function(e){return function(t,n,e,o){return HC(t,n,e,e.target,o)}(o,t,n,e)})}}),i={debugInfo:N("real"),triggerEvent:function(t,n,e){ya(t,n,function(r){return HC(o,t,e,n,r)})},triggerFocus:function(t,n){Ka(t).fold(function(){bs(t)},function(e){ya(Si(),t,function(e){return function(t,n,e,o,r){var i=LC(e,o);PC(t,n,e,o,i,r)}(o,Si(),{originator:n,kill:I,prevent:I,target:t},t,e),!1})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element,n.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Sc,buildOrPatch:wc,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:j},u=function(t){t.connect(i),sn(t.element)||(e.register(t),ot(t.components(),u),i.triggerEvent(Bi(),t.element,{target:t.element}))},a=function(t){sn(t.element)||(ot(t.components(),a),e.unregister(t)),t.disconnect()},c=function(n){ff(t,n)},s=function(t){gf(t)},l=function(t){var n=e.filter(Oi());ot(n,function(n){var e=n.descHandler;ic(e)(t)})},f=function(t){l({universal:!0,data:t})},d=function(t,n){l({universal:!1,channels:t,data:n})},m=function(t,n){return function(t,n){var e=function(t){var n=ho(!1);return{stop:function(){n.set(!0)},cut:I,isStopped:n.get,isCut:W,event:t,setSource:H("Cannot set source of a broadcasted event"),getSource:H("Cannot get source of a broadcasted event")}}(n);return ot(t,function(t){var n=t.descHandler;ic(n)(e)}),e.isStopped()}(e.filter(t),n)},g=function(t){return e.getById(t).fold(function(){return Co.error(new Error('Could not find component with uid: "'+t+'" in system.'))},Co.value)},p=function(t){var n=Ka(t).getOr("not found");return g(n)};return u(t),{root:t,element:t.element,destroy:function(){r.unbind(),no(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},jC=N([Ir("prefix","form-field"),$f("fieldBehaviours",[om,Jf])]),GC=N([_d({schema:[vr("dom")],name:"label"}),_d({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[vr("text")],name:"aria-descriptor"}),kd({factory:{sketch:function(t){var n=function(t,n){var e={};return Ot(t,function(t,o){Q(n,o)||(e[o]=t)}),e}(t,["factory"]);return t.factory.sketch(n)}},schema:[vr("factory")],name:"field"})]),qC=Zd({name:"FormField",configFields:jC(),partFields:GC(),factory:function(t,n,e,o){var r=Zf(t.fieldBehaviours,[om.config({find:function(n){return zd(n,t,"field")}}),Jf.config({store:{mode:"manual",getValue:function(t){return om.getCurrent(t).bind(Jf.getValue)},setValue:function(t,n){om.getCurrent(t).each(function(t){Jf.setValue(t,n)})}}})]),i=tu([fu(function(n,e){var o=Vd(n,t,["label","field","aria-descriptor"]);o.field().each(function(n){var e=Wa(t.prefix);o.label().each(function(t){Pn(t.element,"for",e),Pn(n.element,"id",e)}),o["aria-descriptor"]().each(function(e){var o=Wa(t.prefix);Pn(e.element,"id",o),Pn(n.element,"aria-describedby",o)})})})]),u={getField:function(n){return zd(n,t,"field")},getLabel:function(n){return zd(n,t,"label")}};return{uid:t.uid,dom:t.dom,components:n,behaviours:r,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),YC=tinymce.util.Tools.resolve("tinymce.html.Entities"),XC=function(t,n,e,o){var r=KC(t,n,e,o);return qC.sketch(r)},KC=function(t,n,e,o){return{dom:JC(e),components:t.toArray().concat([n]),fieldBehaviours:Cu(o)}},JC=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},$C=function(t,n){return qC.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[bc(n.translate(t))]})},QC=Wa("form-component-change"),ZC=Wa("form-close"),tk=Wa("form-cancel"),nk=Wa("form-action"),ek=Wa("form-submit"),ok=Wa("form-block"),rk=Wa("form-unblock"),ik=Wa("form-tabchange"),uk=Wa("form-resize"),ak=["input","textarea"],ck=function(t){var n=rn(t);return Q(ak,n)},sk=function(t,n){var e=n.getRoot(t).getOr(t.element);Nu(e,n.invalidClass),n.notify.each(function(n){ck(t.element)&&Pn(t.element,"aria-invalid",!1),n.getContainer(t).each(function(t){ga(t,n.validHtml)}),n.onValid(t)})},lk=function(t,n,e,o){var r=n.getRoot(t).getOr(t.element);Fu(r,n.invalidClass),n.notify.each(function(n){ck(t.element)&&Pn(t.element,"aria-invalid",!0),n.getContainer(t).each(function(t){ga(t,o)}),n.onInvalid(t,o)})},fk=function(t,n,e){return n.validator.fold(function(){return lC(Co.value(!0))},function(n){return n.validate(t)})},dk=function(t,n,e){return n.notify.each(function(n){n.onValidate(t)}),fk(t,n).map(function(e){return t.getSystem().isConnected()?e.fold(function(e){return lk(t,n,0,e),Co.error(e)},function(e){return sk(t,n),Co.value(e)}):Co.error("No longer in system")})},mk=Object.freeze({__proto__:null,markValid:sk,markInvalid:lk,query:fk,run:dk,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element);return Lu(e,n.invalidClass)}}),gk=Object.freeze({__proto__:null,events:function(t,n){return t.validator.map(function(n){return tu([ou(n.onEvent,function(n){dk(n,t).get(L)})].concat(n.validateOnLoad?[fu(function(n){dk(n,t).get(I)})]:[]))}).getOr({})}}),pk=[vr("invalidClass"),Ir("getRoot",G.none),Br("notify",[Ir("aria","alert"),Ir("getContainer",G.none),Ir("validHtml",""),Aa("onValid"),Aa("onInvalid"),Aa("onValidate")]),Br("validator",[vr("validate"),Ir("onEvent","input"),Ir("validateOnLoad",!0)])],hk=Ou({fields:pk,name:"invalidating",active:gk,apis:mk,extra:{validation:function(t){return function(n){var e=Jf.getValue(n);return lC(t(e))}}}}),vk=Ou({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return tu([nu(yi(),j)])},exhibit:function(){return vu({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}
2),bk=Wa("color-input-change"),yk=Wa("color-swatch-change"),xk=Wa("color-picker-cancel"),wk=_d({schema:[vr("dom")],name:"label"}),Sk=function(t){return _d({name:t+"-edge",overrides:function(n){return n.model.manager.edgeActions[t].fold(function(){return{}},function(t){return{events:tu([ru(ti(),function(n,e,o){return t(n,o)},[n]),ru(ri(),function(n,e,o){return t(n,o)},[n]),ru(ii(),function(n,e,o){o.mouseIsDown.get()&&t(n,o)},[n])])}})}})},Ck=Sk("top-left"),kk=Sk("top"),Ok=Sk("top-right"),_k=Sk("right"),Tk=Sk("bottom-right"),Ek=Sk("bottom"),Ak=Sk("bottom-left"),Mk=Sk("left"),Dk=kd({name:"thumb",defaults:N({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:tu([uu(ti(),t,"spectrum"),uu(ni(),t,"spectrum"),uu(ei(),t,"spectrum"),uu(ri(),t,"spectrum"),uu(ii(),t,"spectrum"),uu(ai(),t,"spectrum")])}}}),Bk=function(t){return Wm(t.event)},Ik=[wk,Mk,_k,kk,Ek,Ck,Ok,Ak,Tk,Dk,kd({schema:[pr("mouseIsDown",function(){return ho(!1)})],name:"spectrum",overrides:function(t){var n=t.model.manager,e=function(e,o){return n.getValueFromEvent(o).map(function(o){return n.setValueFrom(e,t,o)})};return{behaviours:Cu([Cp.config({mode:"special",onLeft:function(e,o){return n.onLeft(e,t,Bk(o))},onRight:function(e,o){return n.onRight(e,t,Bk(o))},onUp:function(e,o){return n.onUp(e,t,Bk(o))},onDown:function(e,o){return n.onDown(e,t,Bk(o))}}),Wv.config({}),zp.config({})]),events:tu([ou(ti(),e),ou(ni(),e),ou(ri(),e),ou(ii(),function(n,o){t.mouseIsDown.get()&&e(n,o)})])}}})],Fk=N("slider.change.value"),Rk=function(t){var n=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(n)){var e=n;return void 0!==e.touches&&1===e.touches.length?G.some(e.touches[0]).map(function(t){return ce(t.clientX,t.clientY)}):G.none()}var o=n;return void 0!==o.clientX?G.some(o).map(function(t){return ce(t.clientX,t.clientY)}):G.none()},Nk=function(t){return t.model.minX},Lk=function(t){return t.model.minY},zk=function(t){return t.model.minX-1},Pk=function(t){return t.model.minY-1},Vk=function(t){return t.model.maxX},Hk=function(t){return t.model.maxY},Uk=function(t){return t.model.maxX+1},Wk=function(t){return t.model.maxY+1},jk=function(t,n,e){return n(t)-e(t)},Gk=function(t){return jk(t,Vk,Nk)},qk=function(t){return jk(t,Hk,Lk)},Yk=function(t){return Gk(t)/2},Xk=function(t){return qk(t)/2},Kk=function(t,n){return n?t.stepSize*t.speedMultiplier:t.stepSize},Jk=function(t){return t.snapToGrid},$k=function(t){return t.snapStart},Qk=function(t){return t.rounded},Zk=function(t,n){return void 0!==t[n+"-edge"]},tO=function(t){return Zk(t,"left")},nO=function(t){return Zk(t,"right")},eO=function(t){return Zk(t,"top")},oO=function(t){return Zk(t,"bottom")},rO=function(t){return t.model.value.get()},iO=function(t,n){return{x:t,y:n}},uO=function(t,n){Ki(t,Fk(),{value:n})},aO=function(t,n,e,o){return t<n?t:t>e?e:t===n?n-1:Math.max(n,t-o)},cO=function(t,n,e,o){return t>e?t:t<n?n:t===e?e+1:Math.min(e,t+o)},sO=function(t,n,e){return Math.max(n,Math.min(e,t))},lO=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=l?e+1:e;if(r<f)return g;if(r>d)return p;var h=function(t,n,e){return Math.min(e,Math.max(t,n))-n}(r,f,d),v=sO(h/m*o+n,g,p);return u&&v>=n&&v<=e?function(t,n,e,o,r){return r.fold(function(){var r=t-n,i=Math.round(r/o)*o;return sO(n+i,n-1,e+1)},function(n){var r=(t-n)%o,i=Math.round(r/o),u=Math.floor((t-n)/o),a=Math.floor((e-n)/o),c=n+Math.min(a,u+i)*o;return Math.max(n,c)})}(v,n,e,i,a):c?Math.round(v):v},fO=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<n?i?0:s:r>e?u?a:l:(r-n)/o*c},dO="top",mO="right",gO="bottom",pO="left",hO=function(t){return t.element.dom.getBoundingClientRect()},vO=function(t,n){return t[n]},bO=function(t){var n=hO(t);return vO(n,pO)},yO=function(t){var n=hO(t);return vO(n,mO)},xO=function(t){var n=hO(t);return vO(n,dO)},wO=function(t){var n=hO(t);return vO(n,gO)},SO=function(t){var n=hO(t);return vO(n,"width")},CO=function(t){var n=hO(t);return vO(n,"height")},kO=function(t,n,e){return(t+n)/2-e},OO=function(t,n){var e=hO(t),o=hO(n),r=vO(e,pO),i=vO(e,mO),u=vO(o,pO);return kO(r,i,u)},_O=function(t,n){var e=hO(t),o=hO(n),r=vO(e,dO),i=vO(e,gO),u=vO(o,dO);return kO(r,i,u)},TO=function(t,n){Ki(t,Fk(),{value:n})},EO=function(t,n,e){var o={min:Nk(n),max:Vk(n),range:Gk(n),value:e,step:Kk(n),snap:Jk(n),snapStart:$k(n),rounded:Qk(n),hasMinEdge:tO(n),hasMaxEdge:nO(n),minBound:bO(t),maxBound:yO(t),screenRange:SO(t)};return lO(o)},AO=function(t){return function(n,e,o){return function(t,n,e,o){var r=(t>0?cO:aO)(rO(e),Nk(e),Vk(e),Kk(e,o));return TO(n,r),G.some(r)}(t,n,e,o).map(j)}},MO=function(t,n,e,o,r,i){var u=function(t,n,e,o,r){var i=SO(t),u=o.bind(function(n){return G.some(OO(n,t))}).getOr(0),a=r.bind(function(n){return G.some(OO(n,t))}).getOr(i),c={min:Nk(n),max:Vk(n),range:Gk(n),value:e,hasMinEdge:tO(n),hasMaxEdge:nO(n),minBound:bO(t),minOffset:0,maxBound:yO(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return fO(c)}(n,i,e,o,r);return bO(n)-bO(t)+u},DO=AO(-1),BO=AO(1),IO=G.none,FO=G.none,RO={"top-left":G.none(),top:G.none(),"top-right":G.none(),right:G.some(function(t,n){uO(t,Uk(n))}),"bottom-right":G.none(),bottom:G.none(),"bottom-left":G.none(),left:G.some(function(t,n){uO(t,zk(n))})},NO=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=EO(t,n,e);return TO(t,o),o},setToMin:function(t,n){var e=Nk(n);TO(t,e)},setToMax:function(t,n){var e=Vk(n);TO(t,e)},findValueOfOffset:EO,getValueFromEvent:function(t){return Rk(t).map(function(t){return t.left})},findPositionOfValue:MO,setPositionFromValue:function(t,n,e,o){var r=rO(e),i=MO(t,o.getSpectrum(t),r,o.getLeftEdge(t),o.getRightEdge(t),e),u=me(n.element)/2;Yn(n.element,"left",i-u+"px")},onLeft:DO,onRight:BO,onUp:IO,onDown:FO,edgeActions:RO}),LO=function(t,n){Ki(t,Fk(),{value:n})},zO=function(t,n,e){var o={min:Lk(n),max:Hk(n),range:qk(n),value:e,step:Kk(n),snap:Jk(n),snapStart:$k(n),rounded:Qk(n),hasMinEdge:eO(n),hasMaxEdge:oO(n),minBound:xO(t),maxBound:wO(t),screenRange:CO(t)};return lO(o)},PO=function(t){return function(n,e,o){return function(t,n,e,o){var r=(t>0?cO:aO)(rO(e),Lk(e),Hk(e),Kk(e,o));return LO(n,r),G.some(r)}(t,n,e,o).map(j)}},VO=function(t,n,e,o,r,i){var u=function(t,n,e,o,r){var i=CO(t),u=o.bind(function(n){return G.some(_O(n,t))}).getOr(0),a=r.bind(function(n){return G.some(_O(n,t))}).getOr(i),c={min:Lk(n),max:Hk(n),range:qk(n),value:e,hasMinEdge:eO(n),hasMaxEdge:oO(n),minBound:xO(t),minOffset:0,maxBound:wO(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return fO(c)}(n,i,e,o,r);return xO(n)-xO(t)+u},HO=G.none,UO=G.none,WO=PO(-1),jO=PO(1),GO={"top-left":G.none(),top:G.some(function(t,n){uO(t,Pk(n))}),"top-right":G.none(),right:G.none(),"bottom-right":G.none(),bottom:G.some(function(t,n){uO(t,Wk(n))}),"bottom-left":G.none(),left:G.none()},qO=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=zO(t,n,e);return LO(t,o),o},setToMin:function(t,n){var e=Lk(n);LO(t,e)},setToMax:function(t,n){var e=Hk(n);LO(t,e)},findValueOfOffset:zO,getValueFromEvent:function(t){return Rk(t).map(function(t){return t.top})},findPositionOfValue:VO,setPositionFromValue:function(t,n,e,o){var r=rO(e),i=VO(t,o.getSpectrum(t),r,o.getTopEdge(t),o.getBottomEdge(t),e),u=ie(n.element)/2;Yn(n.element,"top",i-u+"px")},onLeft:HO,onRight:UO,onUp:WO,onDown:jO,edgeActions:GO}),YO=function(t,n){Ki(t,Fk(),{value:n})},XO=function(t,n){return{x:t,y:n}},KO=function(t,n){return function(e,o,r){return function(t,n,e,o,r){var i=t>0?cO:aO,u=n?rO(o).x:i(rO(o).x,Nk(o),Vk(o),Kk(o,r)),a=n?i(rO(o).y,Lk(o),Hk(o),Kk(o,r)):rO(o).y;return YO(e,XO(u,a)),G.some(u)}(t,n,e,o,r).map(j)}},JO=KO(-1,!1),$O=KO(1,!1),QO=KO(-1,!0),ZO=KO(1,!0),t_={"top-left":G.some(function(t,n){uO(t,iO(zk(n),Pk(n)))}),top:G.some(function(t,n){uO(t,iO(Yk(n),Pk(n)))}),"top-right":G.some(function(t,n){uO(t,iO(Uk(n),Pk(n)))}),right:G.some(function(t,n){uO(t,iO(Uk(n),Xk(n)))}),"bottom-right":G.some(function(t,n){uO(t,iO(Uk(n),Wk(n)))}),bottom:G.some(function(t,n){uO(t,iO(Yk(n),Wk(n)))}),"bottom-left":G.some(function(t,n){uO(t,iO(zk(n),Wk(n)))}),left:G.some(function(t,n){uO(t,iO(zk(n),Xk(n)))})},n_=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=EO(t,n,e.left),r=zO(t,n,e.top),i=XO(o,r);return YO(t,i),i},setToMin:function(t,n){var e=Nk(n),o=Lk(n);YO(t,XO(e,o))},setToMax:function(t,n){var e=Vk(n),o=Hk(n);YO(t,XO(e,o))},getValueFromEvent:function(t){return Rk(t)},setPositionFromValue:function(t,n,e,o){var r=rO(e),i=MO(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=VO(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=me(n.element)/2,c=ie(n.element)/2;Yn(n.element,"left",i-a+"px"),Yn(n.element,"top",u-c+"px")},onLeft:JO,onRight:$O,onUp:QO,onDown:ZO,edgeActions:t_}),e_=Zd({name:"Slider",configFields:[Ir("stepSize",1),Ir("speedMultiplier",10),Ir("onChange",I),Ir("onChoose",I),Ir("onInit",I),Ir("onDragStart",I),Ir("onDragEnd",I),Ir("snapToGri
2d",!1),Ir("rounded",!0),Or("snapStart"),br("model",dr("mode",{x:[Ir("minX",0),Ir("maxX",100),pr("value",function(t){return ho(t.mode.minX)}),vr("getInitialValue"),Ia("manager",NO)],y:[Ir("minY",0),Ir("maxY",100),pr("value",function(t){return ho(t.mode.minY)}),vr("getInitialValue"),Ia("manager",qO)],xy:[Ir("minX",0),Ir("maxX",100),Ir("minY",0),Ir("maxY",100),pr("value",function(t){return ho({x:t.mode.minX,y:t.mode.minY})}),vr("getInitialValue"),Ia("manager",n_)]})),$f("sliderBehaviours",[Cp,Jf]),pr("mouseIsDown",function(){return ho(!1)})],partFields:Ik,factory:function(t,n,e,o){var r=function(n){return Pd(n,t,"thumb")},i=function(n){return Pd(n,t,"spectrum")},u=function(n){return zd(n,t,"left-edge")},a=function(n){return zd(n,t,"right-edge")},c=function(n){return zd(n,t,"top-edge")},s=function(n){return zd(n,t,"bottom-edge")},l=t.model,f=l.manager,d=function(n,e){f.setPositionFromValue(n,e,t,{getLeftEdge:u,getRightEdge:a,getTopEdge:c,getBottomEdge:s,getSpectrum:i})},m=function(t,n){l.value.set(n);var e=r(t);d(t,e)},g=function(n){var e=t.mouseIsDown.get();t.mouseIsDown.set(!1),e&&zd(n,t,"thumb").each(function(e){var o=l.value.get();t.onChoose(n,e,o)})},p=function(n,e){e.stop(),t.mouseIsDown.set(!0),t.onDragStart(n,r(n))},h=function(n,e){e.stop(),t.onDragEnd(n,r(n)),g(n)},v=function(n){zd(n,t,"spectrum").map(Cp.focusIn)};return{uid:t.uid,dom:t.dom,components:n,behaviours:Zf(t.sliderBehaviours,[Cp.config({mode:"special",focusIn:v}),Jf.config({store:{mode:"manual",getValue:function(t){return l.value.get()},setValue:m}}),hs.config({channels:T({},If(),{onReceive:g})})]),events:tu([ou(Fk(),function(n,e){!function(n,e){m(n,e);var o=r(n);t.onChange(n,o,e),G.some(!0)}(n,e.event.value)}),fu(function(n,e){var o=l.getInitialValue();l.value.set(o);var u=r(n);d(n,u);var a=i(n);t.onInit(n,u,a,l.value.get())}),ou(ti(),p),ou(ei(),h),ou(ri(),function(t,n){v(t),p(t,n)}),ou(ai(),h)]),apis:{resetToMin:function(n){f.setToMin(n,t)},resetToMax:function(n){f.setToMax(n,t)},setValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,n,e){t.setValue(n,e)},resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),o_=Wa("rgb-hex-update"),r_=Wa("slider-update"),i_=Wa("palette-update"),u_="form",a_=[$f("formBehaviours",[Jf])],c_=function(t){return"<alloy.field."+t+">"},s_=function(t,n){return{uid:t.uid,dom:t.dom,components:n,behaviours:Zf(t.formBehaviours,[Jf.config({store:{mode:"manual",getValue:function(n){var e=Hd(n,t);return _t(e,function(t,n){return t().bind(function(t){return e=om.getCurrent(t),o=new Error("Cannot find a current component to extract the value from for form part '".concat(n,"': ")+ha(t.element)),e.fold(function(){return Co.error(o)},Co.value);var e,o}).map(Jf.getValue)})},setValue:function(n,e){Ot(e,function(e,o){zd(n,t,o).each(function(t){om.getCurrent(t).each(function(t){Jf.setValue(t,e)})})})}}})]),apis:{getField:function(n,e){return zd(n,t,e).bind(om.getCurrent)}}}},l_={getField:oc(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var n=function(){var t=[];return{field:function(n,e){return t.push(n),Id(u_,c_(n),e)},record:N(t)}}(),e=t(n),o=n.record(),r=et(o,function(t){return kd({name:t,pname:c_(t)})});return Xd(u_,a_,r,s_,e)}},f_=Wa("valid-input"),d_=Wa("invalid-input"),m_=Wa("validating-input"),g_="colorcustom.rgb.",p_={isEnabled:j,setEnabled:I,immediatelyShow:I,immediatelyHide:I},h_=function(t,n,e,o){var r=Qd({name:"ColourPicker",configFields:[vr("dom"),Ir("onValidHex",I),Ir("onInvalidHex",I)],factory:function(r){var i=function(t,n,e,o,r,i){var u=function(t,n){var e=n.get();t!==e.isEnabled()&&(e.setEnabled(t),t?e.immediatelyShow():e.immediatelyHide())},a=function(e,o,r){return hk.config({invalidClass:n("invalid"),notify:{onValidate:function(t){Ki(t,m_,{type:e})},onValid:function(t){u(!1,r),Ki(t,f_,{type:e,value:Jf.getValue(t)})},onInvalid:function(t){u(!0,r),Ki(t,d_,{type:e,value:Jf.getValue(t)})}},validator:{validate:function(n){var e=Jf.getValue(n),r=o(e)?Co.value(!0):Co.error(t("aria.input.invalid"));return lC(r)}
2,validateOnLoad:!1}})},c=function(e,o,u,c,s){var l=ho(p_),f=t(g_+"range"),d=qC.parts.label({dom:{tag:"label"},components:[bc(u)]}),m=qC.parts.field({data:s,factory:Ly,inputAttributes:_({type:"text","aria-label":c},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:Cu([a(o,e,l),Wv.config({}),tb.config(_({},r({tooltipText:"",onSetup:function(t){l.set({isEnabled:function(){return tb.isEnabled(t)},setEnabled:function(n){return tb.setEnabled(t,n)},immediatelyShow:function(){return tb.immediateOpenClose(t,!0)},immediatelyHide:function(){return tb.immediateOpenClose(t,!1)}}),tb.setEnabled(t,!1)},onShow:function(e,r){tb.setComponents(e,[{dom:{tag:"p",classes:[n("rgb-warning-note")]},components:[bc(t("hex"===o?"colorcustom.rgb.invalidHex":"colorcustom.rgb.invalid"))]}])}})))]),onSetValue:function(t){hk.isInvalid(t)&&hk.run(t).get(I)}}),g=Wa("aria-invalid"),p=Vv(i("invalid",G.some(g),"warning")),h=[d,m,Vv({dom:{tag:"div",classes:[n("invalid-icon")]},components:[p.asSpec()]}).asSpec()],v="hex"!==o?[qC.parts["aria-descriptor"]({text:f}
2)]:[],b=h.concat(v);return{dom:{tag:"div",attributes:{role:"presentation"},classes:[n("rgb-container")]},components:b}},s=function(t,n){var e=n.red,o=n.green,r=n.blue;Jf.setValue(t,{red:e,green:o,blue:r})},l=Vv({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),f=function(t,n){l.getOpt(t).each(function(t){Yn(t.element,"background-color","#"+n.value)})},d=Qd({factory:function(){var r={red:ho(G.some(255)),green:ho(G.some(255)),blue:ho(G.some(255)),hex:ho(G.some("ffffff"))},i=function(t){return r[t].get()},u=function(t,n){r[t].set(n)},a=function(t){var n=t.red,e=t.green,o=t.blue;u("red",G.some(n)),u("green",G.some(e)),u("blue",G.some(o))},d=function(t,n){var e=n.event;"hex"!==e.type?u(e.type,G.none()):o(t)},m=function(t,n){var o=n.event;!function(t){return"hex"===t.type}(o)?function(t,n,e){var o=parseInt(e,10);u(n,G.some(o)),i("red").bind(function(t){return i("green").bind(function(n){return i("blue").map(function(e){return $w(t,n,e,1)})})}).each(function(n){var e=function(t,n){var e=Gw(n);return l_.getField(t,"hex").each(function(n){zp.isFocused(n)||Jf.setValue(t,{hex:e.value})}),e}(t,n);Ki(t,o_,{hex:e}),f(t,e)})}(t,o.type,o.value):function(t,n){e(t);var o=Pw(n);u("hex",G.some(o.value));var r=tS(o);s(t,r),a(r),Ki(t,o_,{hex:o}),f(t,o)}(t,o.value)},g=function(n){return{label:t(g_+n+".label"),description:t(g_+n+".description")}},p=g("red"),h=g("green"),v=g("blue"),b=g("hex");return Io(l_.sketch(function(e){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[e.field("red",qC.sketch(c(Qw,"red",p.label,p.description,255))),e.field("green",qC.sketch(c(Qw,"green",h.label,h.description,255))),e.field("blue",qC.sketch(c(Qw,"blue",v.label,v.description,255))),e.field("hex",qC.sketch(c(Uw,"hex",b.label,b.description,"ffffff"))),l.asSpec()],formBehaviours:Cu([hk.config({invalidClass:n("form-invalid")}),Ip("rgb-form-events",[ou(f_,m),ou(d_,d),ou(m_,d)])])}}),{apis:{updateHex:function(t,n){Jf.setValue(t,{hex:n.value}),function(t,n){var e=tS(n);s(t,e),a(e)}(t,n),f(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}});return d}(t,n,r.onValidHex,r.onInvalidHex,e,o),u=function(t,n){var e=e_.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[n("sv-palette-spectrum")]}}),o=e_.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[n("sv-palette-thumb")],innerHtml:"<div class=".concat(n("sv-palette-inner-thumb"),' role="presentation"></div>')}}),r=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}};return Qd({factory:function(i){var u=N({x:0,y:0}),a=Cu([om.config({find:G.some}),zp.config({})]);return e_.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":t(["Saturation {0}%, Brightness {1}%",0,0])},classes:[n("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[e,o],onChange:function(n,e,o){D(o)||Pn(n.element,"aria-valuetext",t(["Saturation {0}%, Brightness {1}%",Math.floor(o.x),Math.floor(100-o.y)])),Ki(n,i_,{value:o})},onInit:function(t,n,e,o){r(e.element.dom,oS(rS))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,n,e){!function(t,n){var e=t.components()[0].element.dom,o=bS(n,100,100),i=Zw(o);r(e,oS(i))}(n,e)},setThumb:function(n,e,o){!function(n,e){var o=yS(tS(e));e_.setValue(n,{x:o.saturation,y:100-o.value}),Pn(n.element,"aria-valuetext",t(["Saturation {0}%, Brightness {1}%",o.saturation,o.value]))}(e,o)}},extraApis:{}})}(t,n),a={paletteRgba:ho(rS),paletteHue:ho(0)},c=Vv(function(t,n){var e=e_.parts.spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=e_.parts.thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}});return e_.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:N(0)},components:[e,o],sliderBehaviours:Cu([zp.config({})]),onChange:function(t,n,e){Pn(t.element,"aria-valuenow",Math.floor(360-3.6*e)),Ki(t,r_,{value:e})}})}(0,n)),s=Vv(u.sketch({})),l=Vv(i.sketch({})),f=function(t,n,e){s.getOpt(t).each(function(t){u.setHue(t,e)})},d=function(t,n){l.getOpt(t).each(function(t){i.updateHex(t,n)})},m=function(t,n,e){c.getOpt(t).each(function(t){e_.setValue(t,function(t){return 100-t/360*100}(e))})},g=function(t,n){s.getOpt(t).each(function(t){u.setThumb(t,n)})},p=function(t,n,e,o){(function(t,n){var e=tS(t);a.paletteRgba.set(e),a.paletteHue.set(n)})(n,e),ot(o,function(o){o(t,n,e)})};return{uid:r.uid,dom:r.dom,components:[s.asSpec(),c.asSpec(),l.asSpec()],behaviours:Cu([Ip("colour-picker-events",[ou(o_,function(){var t=[f,m,g];return function(n,e){var o=e.event.hex,r=function(t){return yS(tS(t))}(o);p(n,o,r.hue,t)}}()),ou(i_,function(){var t=[d];return function(n,e){var o=e.event.value,r=a.paletteHue.get(),i=bS(r,o.x,100-o.y),u=xS(i);p(n,u,r,t)}}()),ou(r_,function(){var t=[f,d];return function(n,e){var o=function(t){return(100-t)/100*360}(e.event.value),r=a.paletteRgba.get(),i=yS(r),u=bS(o,i.saturation,i.value),
2c=xS(u);p(n,c,o,t)}}())]),om.config({find:function(t){return l.getOpt(t)}}),Cp.config({mode:"acyclic"})])}}});return r},v_=function(){return om.config({find:G.some})},b_=function(t){return om.config({find:function(n){return _n(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},y_=Yo([Ir("preprocess",L),Ir("postprocess",L)]),x_=function(t,n){var e=lr("RepresentingConfigs.memento processors",y_,n);return Jf.config({store:{mode:"manual",getValue:function(n){var o=t.get(n),r=Jf.getValue(o);return e.postprocess(r)},setValue:function(n,o){var r=e.preprocess(o),i=t.get(n);Jf.setValue(i,r)}}})},w_=function(t,n,e){return Jf.config({store:_(_({mode:"manual"},t.map(function(t){return{initialValue:t}}).getOr({})),{},{getValue:n,setValue:e})})},S_=function(t,n,e){return w_(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)})},C_=function(t){return Jf.config({store:{mode:"memory",initialValue:t}})},k_={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red channel","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green channel","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue channel","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.rgb.invalid":"Numbers only, 0 to 255","colorcustom.rgb.invalidHex":"Hexadecimal only, 000000 to FFFFFF","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},O_=tinymce.util.Tools.resolve("tinymce.Resource"),__=function(t){return Rt(t,"init")},T_=tinymce.util.Tools.resolve("tinymce.util.Tools"),E_=Wa("browse.files.event"),A_=function(t,n){var e=null,o=function(){b(e)||(clearTimeout(e),e=null)};return{cancel:o,throttle:function(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];o(),e=setTimeout(function(){e=null,t.apply(null,i)},n)}}},M_=Wa("alloy-fake-before-tabstop"),D_=Wa("alloy-fake-after-tabstop"),B_=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Cu([zp.config({ignore:!0}),Wv.config({})])}},I_=function(t,n){return{dom:{tag:"div",classes:["tox-navobj"].concat(w(t.getOr([])))},components:[B_([M_]),n,B_([D_])],behaviours:Cu([b_(1)])}},F_=function(t,n){Ki(t,fi(),{raw:{which:9,shiftKey:n}})},R_=function(t,n){var e=n.element;Lu(e,M_)?F_(t,!0):Lu(e,D_)&&F_(t,!1)},N_=function(t){return FC(t,["."+M_,"."+D_].join(","),W)},L_=Wa("update-dialog"),z_=Wa("update-title"),P_=Wa("update-body"),V_=Wa("update-footer"),H_=Wa("body-send-message"),U_=Wa("dialog-focus-shifted"),W_=Ge().browser,j_=W_.isSafari(),G_=W_.isFirefox(),q_=j_||G_,Y_=W_.isChromium(),X_=function(t){var n=t.scrollTop,e=t.scrollHeight,o=t.clientHeight;return Math.ceil(n)+o>=e},K_=function(t,n){return t.scrollTo(0,"bottom"===n?99999999:n)},J_=function(t,n,e){var o=t.dom;G.from(o.contentDocument).fold(e,function(t){var e=0,r=function(t,n){var e=t.body;return G.from(!/^<!DOCTYPE (html|HTML)/.test(n)&&(!Y_&&!j_||O(e)&&(0!==e.scrollTop||Math.abs(e.scrollHeight-e.clientHeight)>1))?e:t.documentElement)}(t,n).map(function(t){return e=t.scrollTop,t}).forall(X_),i=function(){var t=o.contentWindow;O(t)&&(r?K_(t,"bottom"):!r&&q_&&0!==e&&K_(t,e))};j_&&o.addEventListener("load",i,{once:!0}),t.open(),t.write(n),t.close(),j_||i()})},$_=Ht(q_,j_?500:200).map(function(t){return function(t,n){var e=null,o=null;return{cancel:function(){b(e)||(clearTimeout(e),e=null,o=null)},throttle:function(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];o=i,b(e)&&(e=setTimeout(function(){var n=o;e=null,o=null,t.apply(null,n)},n))}}}(J_,t)}),Q_=Wa("toolbar.button.execute"),Z_=Wa("common-button-display-events"),tT=T(T(T(T({},_i(),["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"]),Li(),["toolbar-button-events",Z_]),zi(),["toolbar-button-events","dropdown-events","tooltipping"]),ri(),["focusing","alloy.base.behaviour",Z_]),nT=function(t){return Yn(t.element,"width",Jn(t.element,"width"))},eT=function(t,n,e){return ly(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:e},n)},oT=function(t,n){return eT(t,n,[])},rT=function(t,n){return eT(t,n,[Bp.config({})])},iT=function(t,n,e){return{dom:{tag:"span",classes:["".concat(n,"__select-label")]},components:[bc(e.translate(t))],behaviours:Cu([Bp.config({})])}},uT=Wa("update-menu-text"),aT=Wa("update-menu-icon"),cT=function(t,n,e,o){var r=ho(I),i=t.text.map(function(t){return Vv(iT(t,n,e.providers))}),u=t.icon.map(function(t){return Vv(rT(t,e.providers.icons))}),a=function(t,n){var e=Jf.getValue(t);return zp.focus(e),Ki(e,"keydown",{raw:n.event.raw}),kC.close(e),G.some(!0)},c=t.role.fold(function(){return{}},function(t){return{role:t}}),s=G.from(t.listRole).map(function(t){return{listRole:t}}).getOr({}),l=t.ariaLabel.fold(function(){return{}},function(t){return{"aria-label":e.providers.translate(t)}
2}),f=ly("chevron-down",{tag:"div",classes:["".concat(n,"__select-chevron")]},e.providers.icons),d=Wa("common-button-display-events"),m="dropdown-events",g=Vv(kC.sketch(_(_(_(_({},t.uid?{uid:t.uid}:{}),c),s),{},{dom:{tag:"button",classes:[n,"".concat(n,"--select")].concat(et(t.classes,function(t){return"".concat(n,"--").concat(t)})),attributes:_(_({},l),O(o)?{"data-mce-name":o}:{})},components:Cw([u.map(function(t){return t.asSpec()}),i.map(function(t){return t.asSpec()}),G.some(f)]),matchWidth:!0,useMinWidth:!0,onOpen:function(n,e,o){t.searchable&&function(t){Uy(t).each(function(t){return zp.focus(t)})}(o)},dropdownBehaviours:Cu([].concat(w(t.dropdownBehaviours),[fw(function(){return t.disabled||e.providers.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return e.providers.checkUiComponentContext(t.context)}),vk.config({}),Bp.config({})],w(t.tooltip.map(function(t){return tb.config(e.providers.tooltips.getConfig({tooltipText:e.providers.translate(t)}))}).toArray()),[Ip(m,[pw(t,r),hw(t,r)]),Ip(d,[fu(function(n,e){"listbox"!==t.listRole&&nT(n)})]),Ip("update-dropdown-width-variable",[ou(Ni(),function(t,n){return kC.close(t)})]),Ip("menubutton-update-display-text",[ou(uT,function(t,n){i.bind(function(n){return n.getOpt(t)}).each(function(t){Bp.set(t,[bc(e.providers.translate(n.event.text))])})}),ou(aT,function(t,n){u.bind(function(n){return n.getOpt(t)}).each(function(t){Bp.set(t,[rT(n.event.icon,e.providers.icons)])})})])])),eventOrder:Io(tT,T(T({},ri(),["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]),Li(),["toolbar-button-events",tb.name(),m,d])),sandboxBehaviours:Cu([Cp.config({mode:"special",onLeft:a,onRight:a}),Ip("dropdown-sandbox-events",[ou(zy,function(t,n){(function(t){var n=Jf.getValue(t),e=Hy(t).map(Wy);kC.refetch(n).get(function(){var t=rC.getCoupled(n,"sandbox");e.each(function(n){return Hy(t).each(function(t){return function(t,n){Jf.setValue(t,n.fetchPattern),t.element.dom.selectionStart=n.selectionStart,t.element.dom.selectionEnd=n.selectionEnd}(t,n)})})})})(t),n.stop()}),ou(Py,function(t,n){(function(t,n){(function(t){return Mf.getState(t).bind(Tm.getHighlighted).bind(Tm.getHighlighted)})(t).each(function(e){!function(t,n,e,o){var r=_(_({},o),{},{target:n});t.getSystem().triggerEvent(e,n,r)}(t,e.element,n.event.eventType,n.event.interactionEvent)})})(t,n),n.stop()})])]),lazySink:e.getSink,toggleClass:"".concat(n,"--active"),parts:{menu:_(_({},By(0,t.columns,t.presets)),{},{fakeFocus:t.searchable},"listbox"===t.listRole?{}:{onHighlightItem:OC,onCollapseMenu:function(t,n,e){Tm.getHighlighted(e).each(function(n){OC(t,e,n)})},onDehighlightItem:_C})},getAnchorOverrides:function(){return{maxHeightFunction:function(t,n){Ws()(t,n-10)}}},fetch:function(n){return sC(P(t.fetch,n))}})));return g.asSpec()},sT=function(t){return"separator"===t.type},lT={type:"separator"},fT=function(t,n){var e=function(t,n){var e=at(t,function(t,e){return function(t){return f(t)}(e)?""===e?t:"|"===e?t.length>0&&!sT(t[t.length-1])?t.concat([lT]):t:Rt(n,e.toLowerCase())?t.concat([n[e.toLowerCase()]]):t:t.concat([e])},[]);return e.length>0&&sT(e[e.length-1])&&e.pop(),e}(f(t)?t.split(" "):t,n);return ut(e,function(t,e){if(function(t){return Rt(t,"getSubmenuItems")}(e)){var o=function(t){var n=Ft(t,"value").getOrThunk(function(){return Wa("generated-menu-item")});return Io({value:n},t)}(e),r=function(t,n){var e=t.getSubmenuItems(),o=fT(e,n);return{item:t,menus:Io(o.menus,T({},t.value,o.items)),expansions:Io(o.expansions,T({},t.value,t.value))}}(o,n);return{menus:Io(t.menus,r.menus),items:[r.item].concat(w(t.items)),expansions:Io(t.expansions,r.expansions)}}return _(_({},t),{},{items:[e].concat(w(t.items))})},{menus:{},expansions:{},items:[]})},dT=function(t,n,e,o){var r=Wa("primary-menu"),i=fT(t,e.shared.providers.menuItems());if(0===i.items.length)return G.none();var u=function(t){return t.search.fold(function(){return{searchMode:"no-search"}},function(t){return{searchMode:"search-with-field",placeholder:t.placeholder}})}(o),a=MC(r,i.items,n,e,o.isHorizontalMenu,u),c=function(t){return t.search.fold(function(){return{searchMode:"no-search"}},function(t){return{searchMode:"search-with-results"}})}(o),s=_t(i.menus,function(t,o){return MC(o,t,n,e,!1,c)}),l=Io(s,Gr(r,a));return G.from(Sh.tieredData(r,l,i.expansions))},mT=function(t){return!Rt(t,"items")},gT="data-value",pT=function(t,n,e,o,r){return et(e,function(e){return mT(e)?_(_({type:"togglemenuitem"},r?{}:{role:"option"}),{},{text:e.text,value:e.value,active:e.value===o,onAction:function(){Jf.setValue(t,e.value),Ki(t,QC,{name:n}),zp.focus(t)}}):{type:"nestedmenuitem",text:e.text,getSubmenuItems:function(){return pT(t,n,e.items,o,r)}}})},hT=function(t,n){return St(t,function(t){return mT(t)?Ht(t.value===n,t):hT(t.items,n)})},vT=Qd({name:"HtmlSelect",configFields:[vr("options"),$f("selectBehaviours",[zp,Jf]),Ir("selectClasses",[]),Ir("selectAttributes",{}),Or("data")],factory:function(t,n){var e=et(t.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=t.data.map(function(t){return Gr("initialValue",t)}).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:e,behaviours:Zf(t.selectBehaviours,[zp.config({}),Jf.config({store:_({mode:"manual",getValue:function(t){return fc(t.element)},setValue:function(n,e){var o=yt(t.options);ct(t.options,function(t){return t.value===e}).isSome()?dc(n.element,e):-1===n.element.dom.selectedIndex&&""===e&&o.each(function(t){return dc(n.element,t.value)})}},o)})])}}}),bT=N([Ir("field1Name","field1"),Ir("field2Name","field2"),Da("onLockedChange"),Ta(["lockClass"]),Ir("locked",!1),td("coupledFieldBehaviours",[om,Jf])]),yT=function(t,n){return kd({factory:qC,name:t,overrides:function(t){return{fieldBehaviours:Cu([Ip("coupled-input-behaviour",[ou(mi(),function(e){(function(t,n,e){return zd(t,n,e).bind(om.getCurrent)})(e,t,n).each(function(n){zd(e,t,"lock").each(function(o){qp.isOn(o)&&t.onLockedChange(e,n,o)})})})])])}}})},xT=N([yT("field1","field2"),yT("field2","field1"),kd({factory:zv,schema:[vr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Cu([qp.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),wT=Zd({name:"FormCoupledInputs",configFields:bT(),partFields:xT(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:nd(t.coupledFieldBehaviours,[om.config({find:G.some}),Jf.config({store:{mode:"manual",getValue:function(n){var e=Wd(n,t,["field1","field2"]);return T(T({},t.field1Name,Jf.getValue(e.field1())),t.field2Name,Jf.getValue(e.field2()))},setValue:function(n,e){var o=Wd(n,t,["field1","field2"]);Nt(e,t.field1Name)&&Jf.setValue(o.field1(),e[t.field1Name]),Nt(e,t.field2Name)&&Jf.setValue(o.field2(),e[t.field2Name])}}})]),apis:{getField1:function(n){return zd(n,t,"field1")},getField2:function(n){return zd(n,t,"field2")},getLock:function(n){return zd(n,t,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),ST=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==n){var e=parseFloat(n[1]),o=n[2];return Co.value({value:e,unit:o})}return Co.error(t)},CT=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},o=function(t){return Rt(e,t)};return t.unit===n?G.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?G.some(t.value):G.some(t.value/e[t.unit]*e[n]):G.none()},kT=function(t){return G.none()},OT=function(t,n){var e=t.label.map(function(t){return $C(t,n)}),o=[vm.config({disabled:function(){return t.disabled||n.checkUiComponentContext(t.context).shouldDisable}}),xw(function(){return n.checkUiComponentContext(t.context)}),Cp.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return Xi(t,ek),G.some(!0)}}),Ip("textfield-change",[ou(mi(),function(n,e){Ki(n,QC,{name:t.name})}),ou(ki(),function(n,e){Ki(n,QC,{name:t.name})})]),Wv.config({})],r=t.validation.map(function(t){return hk.config({getRoot:function(t){return Cn(t.element)},invalidClass:"tox-invalid",validator:{validate:function(n){var e=Jf.getValue(n),o=t.validator(e);return lC(!0===o?Co.value(e):Co.error(o))},validateOnLoad:t.validateOnLoad}})}).toArray(),i=_(_(_({},t.placeholder.fold(N({}),function(t){return{placeholder:n.translate(t)}
2})),t.inputMode.fold(N({}),function(t){return{inputmode:t}})),{},{"data-mce-name":t.name}),u=qC.parts.field(_(_({tag:!0===t.multiline?"textarea":"input"},t.data.map(function(t){return{data:t}}).getOr({})),{},{inputAttributes:i,inputClasses:[t.classname],inputBehaviours:Cu(lt([o,r])),selectOnFocus:!1,factory:Ly})),a=t.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[u]}:u,c=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),s=[vm.config({disabled:function(){return t.disabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){qC.getField(t).each(vm.disable)},onEnabled:function(t){qC.getField(t).each(vm.enable)}}),xw(function(){return n.checkUiComponentContext(t.context)})];return XC(e,a,c,s)},_T=function(t,n){return n.getAnimationRoot.fold(function(){return t.element},function(n){return n(t)})},TT=function(t){return t.dimension.property},ET=function(t,n){return t.dimension.getDimension(n)},AT=function(t,n){var e=_T(t,n);Pu(e,[n.shrinkingClass,n.growingClass])},MT=function(t,n){Nu(t.element,n.openClass),Fu(t.element,n.closedClass),Yn(t.element,TT(n),"0px"),ee(t.element)},DT=function(t,n){Nu(t.element,n.closedClass),Fu(t.element,n.openClass),ne(t.element,TT(n))},BT=function(t,n,e,o){e.setCollapsed(),Yn(t.element,TT(n),ET(n,t.element)),AT(t,n),MT(t,n),n.onStartShrink(t),n.onShrunk(t)},IT=function(t,n,e,o){var r=o.getOrThunk(function(){return ET(n,t.element)});e.setCollapsed(),Yn(t.element,TT(n),r),ee(t.element);var i=_T(t,n);Nu(i,n.growingClass),Fu(i,n.shrinkingClass),MT(t,n),n.onStartShrink(t)},FT=function(t,n,e){var o=ET(n,t.element);("0px"===o?BT:IT)(t,n,e,G.some(o))},RT=function(t,n,e){var o=_T(t,n),r=Lu(o,n.shrinkingClass),i=ET(n,t.element);DT(t,n);var u=ET(n,t.element);(r?function(){Yn(t.element,TT(n),i),ee(t.element)}:function(){MT(t,n)})(),Nu(o,n.shrinkingClass),Fu(o,n.growingClass),DT(t,n),Yn(t.element,TT(n),u),e.setExpanded(),n.onStartGrow(t)},NT=function(t,n,e){var o=_T(t,n);return!0===Lu(o,n.growingClass)},LT=function(t,n,e){var o=_T(t,n);return!0===Lu(o,n.shrinkingClass)},zT=Object.freeze({__proto__:null,refresh:function(t,n,e){if(e.isExpanded()){ne(t.element,TT(n));var o=ET(n,t.element);Yn(t.element,TT(n),o)}},grow:function(t,n,e){e.isExpanded()||RT(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&FT(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&BT(t,n,e)},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:NT,isShrinking:LT,isTransitioning:function(t,n,e){return NT(t,n)||LT(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?FT:RT)(t,n,e)},disableTransitions:AT,immediateGrow:function(t,n,e){e.isExpanded()||(DT(t,n),Yn(t.element,TT(n),ET(n,t.element)),AT(t,n),e.setExpanded(),n.onStartGrow(t),n.onGrown(t))}}),PT=Object.freeze({__proto__:null,exhibit:function(t,n,e){var o=n.expanded;return vu(o?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Gr(n.dimension.property,"0px")})},events:function(t,n){return tu([lu(vi(),function(e,o){o.event.raw.propertyName===t.dimension.property&&(AT(e,t),n.isExpanded()&&ne(e.element,t.dimension.property),(n.isExpanded()?t.onGrown:t.onShrunk)(e))})])}}),VT=[vr("closedClass"),vr("openClass"),vr("shrinkingClass"),vr("growingClass"),Or("getAnimationRoot"),Aa("onShrunk"),Aa("onStartShrink"),Aa("onGrown"),Aa("onStartGrow"),Ir("expanded",!1),br("dimension",dr("property",{width:[Ia("property","width"),Ia("getDimension",function(t){return me(t)+"px"})],height:[Ia("property","height"),Ia("getDimension",function(t){return ie(t)+"px"})]}))],HT=Ou({fields:VT,name:"sliding",active:PT,apis:zT,state:Object.freeze({__proto__:null,init:function(t){var n=ho(t.expanded);return Su({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:P(n.set,!1),setExpanded:P(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),UT=function(t){return{isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)},setActive:function(n){var e=t.element;n?(Fu(e,"tox-tbtn--enabled"),Pn(e,"aria-pressed",!0)):(Nu(e,"tox-tbtn--enabled"),jn(e,"aria-pressed"))},isActive:function(){return Lu(t.element,"tox-tbtn--enabled")},setText:function(n){Ki(t,uT,{text:n})},setIcon:function(n){return Ki(t,aT,{icon:n})}}},WT=function(t,n,e,o){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments.length>5?arguments[5]:void 0;return cT({text:t.text,icon:t.icon,tooltip:t.tooltip,ariaLabel:t.tooltip,searchable:t.search.isSome(),role:o,fetch:function(n,o){var r={pattern:t.search.isSome()?TC(n):""};t.fetch(function(n){o(dT(n,gy.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:t.search}))},r,UT(n))},onSetup:t.onSetup,getApi:UT,columns:1,presets:"normal",classes:[],dropdownBehaviours:w(r?[Wv.config({})]:[]),context:t.context},n,e.shared,i)},jT=function(t,n,e){var o=function(t){return function(o){var r=!o.isActive();o.setActive(r),t.storage.set(r),e.shared.getSink().each(function(e){n().getOpt(e).each(function(n){bs(n.element),Ki(n,nk,{name:t.name,value:t.storage.get()})})})}}
2,r=function(t){return function(n){n.setActive(t.storage.get())}};return function(n){n(et(t,function(t){var n=t.text.fold(function(){return{}},function(t){return{text:t}});return _(_({type:t.type,active:!1},n),{},{context:t.context,onAction:o(t),onSetup:r(t)})}))}},GT=function(t){return{dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":t}},components:[bc(t)]}},qT=function(t,n,e){t.customStateIcon.each(function(o){return n.push(KT(o,e.shared.providers.icons,t.customStateIconTooltip.fold(function(){return[]},function(t){return[tb.config(e.shared.providers.tooltips.getConfig({tooltipText:t}))]}),["tox-icon-custom-state"],t.customStateIconTooltip.fold(function(){return{}},function(t){return{title:t}})))})},YT=Wa("leaf-label-event-id"),XT=function(t){var n=t.leaf,e=t.onLeafAction,o=t.visible,r=t.treeId,i=t.selectedId,u=t.backstage,a=n.menu.map(function(t){return WT(t,"tox-mbtn",u,G.none(),o)}),c=[GT(n.title)];return qT(n,c,u),a.each(function(t){return c.push(t)}),zv.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:c,role:"treeitem",action:function(t){e(n.id),t.getSystem().broadcastOn(["update-active-item-".concat(r)],{value:n.id})},eventOrder:T({},fi(),[YT,"keying"]),buttonBehaviours:Cu([].concat(w(o?[Wv.config({})]:[]),[qp.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),hs.config({channels:T({},"update-active-item-".concat(r),{onReceive:function(t,e){(e.value===n.id?qp.on:qp.off)(t)}})}),Ip(YT,[fu(function(t,e){i.each(function(e){(e===n.id?qp.on:qp.off)(t)})}),ou(fi(),function(t,n){var e="ArrowLeft"===n.event.raw.code,o="ArrowRight"===n.event.raw.code;e?(Ac(t.element,".tox-tree--directory").each(function(n){t.getSystem().getByDom(n).each(function(t){Mc(n,".tox-tree--directory__label").each(function(n){t.getSystem().getByDom(n).each(zp.focus)})})}),n.stop()):o&&n.stop()})])]))})},KT=function(t,n,e,o,r){return ly(t,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"].concat(o||[]),behaviours:e,attributes:r},n)},JT=Wa("directory-label-event-id"),$T=function(t){var n,e=t.directory,o=t.visible,r=t.noChildren,i=t.backstage,u=e.menu.map(function(t){return WT(t,"tox-mbtn",i,G.none())}),a=[{dom:{tag:"div",classes:["tox-chevron"]},components:[(n=i.shared.providers.icons,KT("chevron-right",n,[]))]},GT(e.title)];qT(e,a,i),u.each(function(t){a.push(t)});var c=function(t){Ac(t.element,".tox-tree--directory").each(function(n){t.getSystem().getByDom(n).each(function(n){var o=!qp.isOn(n);qp.toggle(n),Ki(t,"expand-tree-node",{expanded:o,node:e.id})})})};return zv.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(o?["tox-tree--directory__label--visible"]:[])},components:a,action:c,eventOrder:T({},fi(),[JT,"keying"]),buttonBehaviours:Cu([].concat(w(o?[Wv.config({})]:[]),[Ip(JT,[ou(fi(),function(t,n){var e="ArrowRight"===n.event.raw.code,o="ArrowLeft"===n.event.raw.code;e&&r&&n.stop(),(e||o)&&Ac(t.element,".tox-tree--directory").each(function(r){t.getSystem().getByDom(r).each(function(r){!qp.isOn(r)&&e||qp.isOn(r)&&o?(c(t),n.stop()):o&&!qp.isOn(r)&&(Ac(r.element,".tox-tree--directory").each(function(t){Mc(t,".tox-tree--directory__label").each(function(t){r.getSystem().getByDom(t).each(zp.focus)})}),n.stop())})})})])]))})},QT=function(t){var n=t.children,e=t.onLeafAction,o=t.visible,r=t.treeId,i=t.expandedIds,u=t.selectedId,a=t.backstage;return{dom:{tag:"div",classes:["tox-tree--directory__children"]},components:n.map(function(t){return"leaf"===t.type?XT({leaf:t,selectedId:u,onLeafAction:e,visible:o,treeId:r,backstage:a}):tE({directory:t,expandedIds:i,selectedId:u,onLeafAction:e,labelTabstopping:o,treeId:r,backstage:a})}),behaviours:Cu([HT.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),Bp.config({})])}},ZT=Wa("directory-event-id"),tE=function(t){var n=t.directory,e=t.onLeafAction,o=t.labelTabstopping,r=t.treeId,i=t.backstage,u=t.expandedIds,a=t.selectedId,c=n.children,s=ho(u),l=u.includes(n.id
2);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[$T({directory:n,visible:o,noChildren:0===n.children.length,backstage:i}),QT({children:c,expandedIds:u,selectedId:a,onLeafAction:e,visible:l,treeId:r,backstage:i})],behaviours:Cu([Ip(ZT,[fu(function(t,n){qp.set(t,l)}),ou("expand-tree-node",function(t,n){var e=n.event,o=e.expanded,r=e.node;s.set(o?[].concat(w(s.get()),[r]):s.get().filter(function(t){return t!==r}))})]),qp.config(_(_({},n.children.length>0?{aria:{mode:"expanded"}}:{}),{},{toggleClass:"tox-tree--directory--expanded",onToggled:function(t,n){var o,u=t.components()[1],l=(o=n,c.map(function(t){return"leaf"===t.type?XT({leaf:t,selectedId:a,onLeafAction:e,visible:o,treeId:r,backstage:i}):tE({directory:t,expandedIds:s.get(),selectedId:a,onLeafAction:e,labelTabstopping:o,treeId:r,backstage:i})}));n?HT.grow(u):HT.shrink(u),Bp.set(u,l)}}))])}},nE=Wa("tree-event-id"),eE=Object.freeze({__proto__:null,events:function(t,n){var e=t.stream.streams.setup(t,n);return tu([ou(t.event,e),du(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[ou(t,function(){return n.cancel()})]}).getOr([])))}}),oE=function(t){var n=ho(null);return Su({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})},rE=Object.freeze({__proto__:null,throttle:oE,init:function(t){return t.stream.streams.state(t)}}),iE=[br("stream",dr("mode",{throttle:[vr("delay"),Ir("stopEvent",!0),Ia("streams",{setup:function(t,n){var e=t.stream,o=A_(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:oE})]})),Ir("event","input"),Or("cancelEvent"),Da("onStream")],uE=Ou({fields:iE,name:"streaming",active:eE,state:rE}),aE=function(t,n,e){var o=Jf.getValue(e);Jf.setValue(n,o),sE(n)},cE=function(t,n){var e=t.element,o=fc(e),r=e.dom;"number"!==Hn(e,"type")&&n(r,o)},sE=function(t){cE(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},lE=N("alloy.typeahead.itemexecute"),fE=N([Or("lazySink"),vr("fetch"),Ir("minChars",5),Ir("responseTime",1e3),Aa("onOpen"),Ir("getHotspot",G.some),Ir("getAnchorOverrides",N({})),Ir("layouts",G.none()),Ir("eventOrder",{}),Hr("model",{},[Ir("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),Ir("selectsOver",!0),Ir("populateFromBrowse",!0)]),Aa("onSetValue"),Ma("onExecute"),Aa("onItemExecute"),Ir("inputClasses",[]),Ir("inputAttributes",{}),Ir("inputStyles",{}),Ir("matchWidth",!0),Ir("useMinWidth",!1),Ir("dismissOnBlur",!0),Ta(["openClass"]),Or("initialData"),Or("listRole"),$f("typeaheadBehaviours",[zp,Jf,uE,Cp,qp,rC]),pr("lazyTypeaheadComp",function(){return ho(G.none)}),pr("previewing",function(){return ho(!0)})].concat(Iy()).concat(wC())),dE=N([Od({schema:[_a()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlightItem:function(n,e,o){t.previewing.get()?t.lazyTypeaheadComp.get().each(function(n){(function(t,n,e){if(t.selectsOver){var o=Jf.getValue(n),r=t.getDisplayText(o),i=Jf.getValue(e);return 0===t.getDisplayText(i).indexOf(r)?G.some(function(){aE(0,n,e),function(t,n){cE(t,function(t,e){return t.setSelectionRange(n,e.length)})}(n,r.length)}):G.none()}return G.none()})(t.model,n,o).fold(function(){t.model.selectsOver?(Tm.dehighlight(e,o),t.previewing.set(!0)):t.previewing.set(!1)},function(n){n(),t.previewing.set(!1)})}):t.lazyTypeaheadComp.get().each(function(n){t.model.populateFromBrowse&&aE(t.model,n,o),Un(o.element,"id").each(function(t){return Pn(n.element,"aria-activedescendant",t)})})},onExecute:function(n,e){return t.lazyTypeaheadComp.get().map(function(t){return Ki(t,lE(),{item:e}),!0})},onHover:function(n,e){t.previewing.set(!1),t.lazyTypeaheadComp.get().each(function(n){t.model.populateFromBrowse&&aE(t.model,n,e)})}}}})]),mE=Zd({name:"Typeahead",configFields:fE(),partFields:dE(),factory:function(t,n,e,o){var r=function(n,e,r){t.previewing.set(!1);var i=rC.getCoupled(n,"sandbox");if(Mf.isOpen(i))om.getCurrent(i).each(function(t){Tm.getHighlighted(t).fold(function(){r(t)},function(){Zi(i,t.element,"keydown",e)})});else{gC(t,u(n),n,i,o,function(t){om.getCurrent(t).each(r)},Jm.HighlightMenuAndItem).get(I)}},i=Fy(t),u=function(t){return function(n){return n.map(function(n){var e=It(n.menus),o=ft(e,function(t){return it(t.items,function(t){return"item"===t.type})});return Jf.getState(t).update(et(o,function(t){return t.data})),n})}},a=function(t){return om.getCurrent(t)},c="typeaheadevents",s=[zp.config({}),Jf.config({onSetValue:t.onSetValue,store:_({mode:"dataset",getDataKey:function(t){return fc(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(n,e){dc(n.element,t.model.getDisplayText(e))}},t.initialData.map(function(t){return Gr("initialValue",t)}).getOr({}))}
2),uE.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(n,e){var r=rC.getCoupled(n,"sandbox");if(zp.isFocused(n)&&fc(n.element).length>=t.minChars){var i=a(r).bind(function(t){return Tm.getHighlighted(t).map(Jf.getValue)});t.previewing.set(!0);gC(t,u(n),n,r,o,function(n){a(r).each(function(n){i.fold(function(){t.model.selectsOver&&Tm.highlightFirst(n)},function(t){Tm.highlightBy(n,function(n){return Jf.getValue(n).value===t.value}),Tm.getHighlighted(n).orThunk(function(){return Tm.highlightFirst(n),G.none()})})})},Jm.HighlightJustMenu).get(I)}},cancelEvent:Di()}),Cp.config({mode:"special",onDown:function(t,n){return r(t,n,Tm.highlightFirst),G.some(!0)},onEscape:function(t){var n=rC.getCoupled(t,"sandbox");return Mf.isOpen(n)?(Mf.close(n),G.some(!0)):G.none()},onUp:function(t,n){return r(t,n,Tm.highlightLast),G.some(!0)},onEnter:function(n){var e=rC.getCoupled(n,"sandbox"),o=Mf.isOpen(e);if(o&&!t.previewing.get())return a(e).bind(function(t){return Tm.getHighlighted(t)}).map(function(t){return Ki(n,lE(),{item:t}),!0});var r=Jf.getValue(n);return Xi(n,Di()),t.onExecute(e,n,r),o&&Mf.close(e),G.some(!0)}}),qp.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),rC.config({others:{sandbox:function(n){return yC(t,n,{onOpen:function(){return qp.on(n)},onClose:function(){t.lazyTypeaheadComp.get().each(function(t){return jn(t.element,"aria-activedescendant")}),qp.off(n)}})}}}),Ip(c,[fu(function(n){t.lazyTypeaheadComp.set(G.some(n))}),du(function(n){t.lazyTypeaheadComp.set(G.none())}),gu(function(n){var e=I;hC(t,u(n),n,o,e,Jm.HighlightMenuAndItem).get(I)}),ou(lE(),function(n,e){var o=rC.getCoupled(n,"sandbox");aE(t.model,n,e.event.item),Xi(n,Di()),t.onItemExecute(n,o,e.event.item,Jf.getValue(n)),Mf.close(o),sE(n)})].concat(t.dismissOnBlur?[ou(Ci(),function(t){var n=rC.getCoupled(t,"sandbox");Ss(n.element).isNone()&&Mf.close(n)})]:[]))],l=_(T({},zi(),[Jf.name(),uE.name(),c]),t.eventOrder);return{uid:t.uid,dom:Ny(Io(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:_(_({},i),Zf(t.typeaheadBehaviours,s)),eventOrder:l}}}),gE=function(t){return _(_({},t),{},{toCached:function(){return gE(t.toCached())},bindFuture:function(n){return gE(t.bind(function(t){return t.fold(function(t){return lC(Co.error(t))},function(t){return n(t)})}))},bindResult:function(n){return gE(t.map(function(t){return t.bind(n)}))},mapResult:function(n){return gE(t.map(function(t){return t.map(n)}))},mapError:function(n){return gE(t.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return t.map(function(t){return t.fold(n,e)})},withTimeout:function(n,e){return gE(sC(function(o){var r=!1,i=setTimeout(function(){r=!0,o(Co.error(e()))},n);t.get(function(t){r||(clearTimeout(i),o(t))})}))}})},pE=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,u=arguments.length>6?arguments[6]:void 0,a=n.fold(function(){return{}},function(t){return{action:t}}),c=_({buttonBehaviours:Cu([lw(function(){return!t.enabled||u.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return u.checkUiComponentContext(t.context)}),Wv.config({})].concat(w(i.map(function(t){return tb.config(u.tooltips.getConfig({tooltipText:u.translate(t)}))}).toArray()),[Ip("button press",[eu("click")])]).concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),s=Io(c,{dom:o});return Io(s,{components:r})},hE=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4?arguments[4]:void 0,i={tag:"button",classes:["tox-tbtn"],attributes:_(_({},t.tooltip.map(function(t){return{"aria-label":e.translate(t)}}).getOr({})),{},{"data-mce-name":r})},u=t.icon.map(function(t){return oT(t,e.icons)}),a=Cw([u]);return pE(t,n,o,i,a,t.tooltip,e)},vE=function(t){switch(t){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];default:return["tox-button","tox-button--secondary"]}},bE=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=e.translate(t.text),u=t.icon.map(function(t){return oT(t,e.icons)}),a=[u.getOrThunk(function(){return bc(i)})],c=t.buttonType.getOr(t.primary||t.borderless?"primary":"secondary"),s={tag:"button",classes:[].concat(w(vE(c)),w(u.isSome()?["tox-button--icon"]:[]),w(t.borderless?["tox-button--naked"]:[]),w(r)),attributes:{"aria-label":i,"data-mce-name":t.text}},l=t.icon.map(N(i));return pE(t,n,o,s,a,l,e)},yE=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=bE(t,G.some(n),e,o,r);return zv.sketch(i)},xE=function(t,n){return function(e){"custom"===n?Ki(e,nk,{name:t,value:{}}):"submit"===n?Xi(e,ek):"cancel"===n?Xi(e,tk):console.error("Unknown button type: ",n)}},wE=function(t,n,e){if(function(t,n){return"menu"===n}(0,n)){var o=t,r=_(_({},t),{},{type:"menubutton",search:G.none(),onSetup:function(n){return n.setEnabled(t.enabled),I},fetch:jT(o.items,function(){return i},e)}),i=Vv(WT(r,"tox-tbtn",e,G.none(),!0,t.text.or(t.tooltip).getOrUndefined()));return i.asSpec()}if(function(t,n){return"custom"===n||"cancel"===n||"submit"===n}(0,n)){var u=xE(t.name,n),a=_(_({},t),{},{context:"cancel"===n?"any":t.context,borderless:!1});return yE(a,u,e.shared.providers,[])}if(function(t,n){return"togglebutton"===n}(0,n))return function(t,n,e){var o,r,i=t.icon.map(function(t){return rT(t,n.icons)}).map(Vv),u=t.buttonType.getOr(t.primary?"primary":"secondary"),a=_(_({},t),{},{name:null!==(o=t.name)&&void 0!==o?o:"",primary:"primary"===u,tooltip:t.tooltip,enabled:null!==(r=t.enabled)&&void 0!==r&&r,borderless:!1}),c=a.tooltip.or(t.text).map(function(t){return{"aria-label":n.translate(t)}
2}).getOr({}),s=vE(null!=u?u:"secondary"),l=t.icon.isSome()&&t.text.isSome(),f={tag:"button",classes:[].concat(w(s.concat(t.icon.isSome()?["tox-button--icon"]:[])),w(t.active?["tox-button--enabled"]:[]),w(l?["tox-button--icon-and-text"]:[])),attributes:_(_({},c),O(e)?{"data-mce-name":e}:{})},d=n.translate(t.text.getOr("")),m=bc(d),g=[].concat(w(Cw([i.map(function(t){return t.asSpec()})])),w(t.text.isSome()?[m]:[])),p=pE(a,G.some(function(e){Ki(e,nk,{name:t.name,value:{setIcon:function(t){i.map(function(o){return o.getOpt(e).each(function(e){Bp.set(e,[rT(t,n.icons)])})})}}})}),[],f,g,t.tooltip,n);return zv.sketch(p)}(t,e.shared.providers,t.text.or(t.tooltip).getOrUndefined());throw console.error("Unknown footer button type: ",n),new Error("Unknown footer button type")},SE={type:"separator"},CE=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:I}},kE=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:void 0},onAction:I}},OE=function(t,n){return function(t){return et(t,CE)}(function(t,n){return it(n,function(n){return n.type===t})}(t,n))},_E=function(t){return OE("header",t.targets)},TE=function(t){return OE("anchor",t.targets)},EE=function(t){return G.from(t.anchorTop).map(function(t){return kE("<top>",t)}).toArray()},AE=function(t){return G.from(t.anchorBottom).map(function(t){return kE("<bottom>",t)}).toArray()},ME=function(t,n){var e=t.toLowerCase();return it(n,function(t){var n,o=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text,r=null!==(n=t.value)&&void 0!==n?n:"";return jt(o.toLowerCase(),e)||jt(r.toLowerCase(),e)})},DE=Wa("aria-invalid"),BE=function(t,n){t.dom.checked=n},IE=function(t){return t.dom.checked},FE=function(t){return function(n,e,o,r,i){return Ft(e,"name").fold(function(){return t(e,r,G.none(),i)},function(u){return n.field(u,t(e,r,Ft(o,u),i))})}},RE={bar:FE(function(t,n){return function(t,n){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:et(t.items,n.interpreter)}}(t,n.shared)}),collection:FE(function(t,n,e){return function(t,n,e){var o,r=t.label.map(function(t){return $C(t,n)}),i=n.icons(),u=function(t){return function(n,e){Bc(e.event.target,"[data-collection-item-value]").each(function(o){t(n,e,o,Hn(o,"data-collection-item-value"))})}},a=u(function(e,o,r,i){o.stop(),n.checkUiComponentContext("mode:design").shouldDisable||n.isDisabled()||Ki(e,nk,{name:t.name,value:i})}),c=[ou(ci(),u(function(t,n,e){bs(e,!0)})),ou(pi(),a),ou(Ei(),a),ou(si(),u(function(t,n,e){Dc(t.element,"."+Cy).each(function(t){Nu(t,Cy)}),Fu(e,Cy)})),ou(li(),u(function(t){Dc(t.element,"."+Cy).each(function(t){Nu(t,Cy),ys(t)})})),gu(u(function(n,e,o,r){Ki(n,nk,{name:t.name,value:r})}))],s=function(t,n){return et(Al(t.element,".tox-collection__item"),n)},l=qC.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:L},behaviours:Cu([vm.config({disabled:function(){return n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){s(t,function(t){Fu(t,"tox-collection__item--state-disabled"),Pn(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){Nu(t,"tox-collection__item--state-disabled"),jn(t,"aria-disabled")})}}),xw(function(){return n.checkUiComponentContext(t.context)}),Bp.config({}),tb.config(_(_({},n.tooltips.getConfig({tooltipText:"",onShow:function(t){Dc(t.element,"."+Cy+"[data-mce-tooltip]").each(function(e){Un(e,"data-mce-tooltip").each(function(e){tb.setComponents(t,n.tooltips.getComponents({tooltipText:e}))})})}})),{},{mode:"children-keyboard-focus",anchor:function(t){return{type:"node",node:Dc(t.element,"."+Cy).orThunk(function(){return pn(".tox-collection__item")}),root:t.element,layouts:{onLtr:N([is,rs,ts,es,ns,os]),onRtl:N([is,rs,ts,es,ns,os])},bubble:Xs(0,-2,{})}}})),Jf.config({store:{mode:"memory",initialValue:e.getOr([])},onSetValue:function(e,o){(function(e,o){var r=n.checkUiComponentContext("mode:design").shouldDisable||n.isDisabled()?" tox-collection__item--state-disabled":"",u=et(o,function(n){var e=ny.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'.concat(e,"</div>"):"",u='<div class="tox-collection__item-icon">'.concat(function(t){var n;return null!==(n=i[t])&&void 0!==n?n:t}(n.icon),"</div>"),a={_:" "," - ":" ","-":" "},c=e.replace(/\_| \- |\-/g,function(t){return a[t]});return'<div data-mce-tooltip="'.concat(c,'" class="tox-collection__item').concat(r,'" tabindex="-1" data-collection-item-value="').concat(YC.encodeAllRaw(n.value),'" aria-label="').concat(c,'">
2').concat(u).concat(o,"</div>")}),a="auto"!==t.columns&&t.columns>1?nt(u,t.columns):[u],c=et(a,function(t){return'<div class="tox-collection__group">'.concat(t.join(""),"</div>")});ga(e.element,c.join(""))})(e,o),"auto"===t.columns&&cw(e,5,"tox-collection__item").each(function(t){var n=t.numRows,o=t.numColumns;Cp.setGridSize(e,n,o)}),Xi(e,uk)}}),Wv.config({}),Cp.config((o=t.columns,1===o?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===o?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:".".concat(hy)}})),Ip("collection-events",c)]),eventOrder:T(T({},_i(),["disabling","alloy.base.behaviour","collection-events"]),si(),["collection-events","tooltipping"])});return XC(r,l,["tox-form__group--collection"],[])}(t,n.shared.providers,e)}),alertbanner:FE(function(t,n){return function(t,n){var e=ay(t.icon,n.icons);return UC.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--".concat(t.level)]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:t.url?void 0:e},components:t.url?[zv.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:e,attributes:{title:n.translate(t.iconTooltip)}},action:function(n){return Ki(n,nk,{name:"alert-banner",value:t.url})},buttonBehaviours:Cu([cy()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:n.translate(t.text)}}]})}
2(t,n.shared.providers)}),input:FE(function(t,n,e){return function(t,n,e){return OT({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:!t.enabled,classname:"tox-textfield",validation:G.none(),maximized:t.maximized,data:e,context:t.context},n)}(t,n.shared.providers,e)}),textarea:FE(function(t,n,e){return function(t,n,e){return OT({name:t.name,multiline:!0,label:t.label,inputMode:G.none(),placeholder:t.placeholder,flex:!0,disabled:!t.enabled,classname:"tox-textarea",validation:G.none(),maximized:t.maximized,data:e,context:t.context},n)}(t,n.shared.providers,e)}),label:FE(function(t,n,e,o){return function(t,n,e){var o,r="tox-label",i="center"===t.align?["".concat(r,"--center")]:[],u="end"===t.align?["".concat(r,"--end")]:[],a=Vv({dom:{tag:"label",classes:[r].concat(i,u)},components:[bc(n.providers.translate(t.label))]}),c=et(t.items,n.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[a.asSpec()].concat(w(c)),behaviours:Cu([v_(),Bp.config({}),(o=G.none(),S_(o,ma,ga)),Cp.config({mode:"acyclic"}),Ip("label",[fu(function(n){t.for.each(function(t){e(t).each(function(t){a.getOpt(n).each(function(n){var e,o=null!==(e=Hn(t.element,"id"))&&void 0!==e?e:Wa("form-field");Pn(t.element,"id",o),Pn(n.element,"for",o)})})})})])])}}(t,n.shared,o)}),iframe:(EC=function(t,n,e){return function(t,n,e){var o="tox-dialog__iframe",r=t.transparent?[]:["".concat(o,"--opaque")],i=t.border?["tox-navobj-bordered"]:[],u=_(_(_({},t.label.map(function(t){return{title:t}}).getOr({})),e.map(function(t){return{srcdoc:t}}).getOr({})),t.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}),a=function(t,n){var e=ho(t.getOr(""));return{getValue:function(t){return e.get()},setValue:function(t,o){if(e.get()!==o){var r=t.element,i=function(){return Pn(r,"srcdoc",o)};n?$_.fold(N(J_),function(t){return t.throttle})(r,o,i):i()}e.set(o)}}}(e,t.streamContent),c=t.label.map(function(t){return $C(t,n)}),s=qC.parts.field({factory:{sketch:function(t){return I_(G.from(i),{uid:t.uid,dom:{tag:"iframe",attributes:u,classes:[o].concat(r)},behaviours:Cu([Wv.config({}),zp.config({}),w_(e,a.getValue,a.setValue),hs.config({channels:T({},U_,{onReceive:function(t,n){n.newFocus.each(function(n){Cn(t.element).each(function(e){(hn(t.element,n)?Fu:Nu)(e,"tox-navobj-bordered-focus")})})}})})])})}}});return XC(c,s,["tox-form__group--stretched"],[])}(t,n.shared.providers,e)},function(t,n,e,o,r){var i=Io(n,{source:"dynamic"});return FE(EC)(t,i,e,o,r)}),button:FE(function(t,n){return function(t,n){var e,o,r=xE(t.name,"custom");return e=G.none(),o=qC.parts.field(_({factory:zv},bE(t,G.some(r),n,[C_(""),v_()]))),XC(e,o,[],[])}(t,n.shared.providers)}),checkbox:FE(function(t,n,e){return function(t,n,e){var o=function(t){return t.element.dom.click(),G.some(!0)},r=qC.parts.field({factory:{sketch:L},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Cu([v_(),vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){Cn(t.element).each(function(t){return Fu(t,"tox-checkbox--disabled")})},onEnabled:function(t){Cn(t.element).each(function(t){return Nu(t,"tox-checkbox--disabled")})}}),Wv.config({}),zp.config({}),S_(e,IE,BE),Cp.config({mode:"special",onEnter:o,onSpace:o,stopSpaceKeyup:!0}),Ip("checkbox-events",[ou(gi(),function(n,e){Ki(n,QC,{name:t.name})})])])}),i=qC.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[bc(n.translate(t.label))],behaviours:Cu([vk.config({})])}),u=function(t){return ly("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},n.icons)},a=Vv({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return qC.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,a.asSpec(),i],fieldBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),xw(function(){return n.checkUiComponentContext(t.context)})])})}(t,n.shared.providers,e)}),colorinput:FE(function(t,n,e){return function(t,n,e,o){var r=qC.parts.field({factory:Ly,inputClasses:["tox-textfield"],data:o,onSetValue:function(t){return hk.run(t).get(I)},inputBehaviours:Cu([vm.config({disabled:function(){return n.providers.isDisabled()||n.providers.checkUiComponentContext(t.context).shouldDisable}}),xw(function(){return n.providers.checkUiComponentContext(t.context)}),Wv.config({}
2),hk.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Cn(t.element)},notify:{onValid:function(t){var n=Jf.getValue(t);Ki(t,bk,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Jf.getValue(t);if(0===n.length)return lC(Co.value(!0));var e=Qt("span");Yn(e,"background-color",n);var o=Qn(e,"background-color").fold(function(){return Co.error("blah")},function(t){return Co.value(n)});return lC(o)}}})]),selectOnFocus:!1}),i=t.label.map(function(t){return $C(t,n.providers)}),u=function(t,n){Ki(t,yk,{value:n})},a=Vv(function(t,n){return kC.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:Cu([fw(function(){return n.providers.isDisabled()||n.providers.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return n.providers.checkUiComponentContext(t.context)}),vk.config({}),Wv.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:n.getSink,fetch:function(e){return sC(function(n){return t.fetch(n)}).map(function(o){return G.from(DC(Io(GS(Wa("menu-value"),o,function(n){t.onItemAction(e,n)},t.columns,t.presets,gy.CLOSE_ON_EXECUTE,W,n.providers),{movement:YS(t.columns,t.presets)})))})},parts:{menu:By(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[ns,ts,is]},onLtr:function(){return[ts,ns,is]}},components:[],fetch:LS(e.getColors(t.storageKey),t.storageKey,e.hasCustomColors()),columns:e.getColorCols(t.storageKey),presets:"color",onItemAction:function(n,o){a.getOpt(n).each(function(n){"custom"===o?e.colorPicker(function(e){e.fold(function(){return Xi(n,xk)},function(e){u(n,e),vS(t.storageKey,e)})},"#ffffff"):u(n,"remove"===o?"":o)})},context:t.context},n));return qC.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:i.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:Cu([Ip("form-field-events",[ou(bk,function(n,e){a.getOpt(n).each(function(t){Yn(t.element,"background-color",e.event.color)}),Ki(n,QC,{name:t.name})}),ou(yk,function(t,n){qC.getField(t).each(function(e){Jf.setValue(e,n.event.value),om.getCurrent(t).each(zp.focus)})}),ou(xk,function(t,n){qC.getField(t).each(function(n){om.getCurrent(t).each(zp.focus)})})])])})}(t,n.shared,n.colorinput,e)}),colorpicker:FE(function(t,n,e){return function(t,n,e){var o=function(t){return"tox-"+t},r=h_(function(t){return function(n){return f(n)?t.translate(k_[n]):t.translate(n)}}(n),o,n.tooltips.getConfig,function(t,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t;return ly(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:_({title:n.translate(o),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))},n.icons)}),i=Vv(r.sketch({dom:{tag:"div",classes:[o("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Ki(t,nk,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Ki(t,nk,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:Cu([w_(e,function(t){var n=i.get(t);return om.getCurrent(n).bind(function(t){return Jf.getValue(t).hex}).map(function(t){return"#"+Wt(t,"#")}).getOr("")},function(t,n){var e=G.from(/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n)).bind(function(t){return bt(t,1)}),o=i.get(t);om.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Jf.setValue(t,{hex:e.getOr("")}),l_.getField(t,"hex").each(function(t){Xi(t,mi())})})}),v_()])}}(0,n.shared.providers,e)}),dropzone:FE(function(t,n,e){return function(t,n,e){var o=function(t,n){n.stop()},r=function(t){return function(n,e){ot(t,function(t){t(n,e)})}},i=Vv({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Cu([Ip("input-file-events",[cu(pi()),cu(Ei())])])}),u=t.label.map(function(t){return $C(t,n)}),a=qC.parts.field({factory:zv,dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[bc(n.translate("Browse for an image")),i.asSpec()],action:function(t){i.get(t).element.dom.click()},buttonBehaviours:Cu([v_(),C_(e.getOr([])),Wv.config({}),fw(function(){return n.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return n.checkUiComponentContext(t.context)})])}),c={dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Cu([vm.config({disabled:function(){return n.checkUiComponentContext(t.context).shouldDisable}}),xw(function(){return n.checkUiComponentContext(t.context)}),qp.config({toggleClass:"dragenter",toggleOnExecute:!1}),Ip("dropzone-events",[ou("dragenter",r([o,qp.toggle])),ou("dragleave",r([o,qp.toggle])),ou("dragover",o),ou("drop",r([o,function(t,n){var e;if(!vm.isDisabled(t)){var o=n.event.raw;Ki(t,E_,{files:null===(e=o.dataTransfer)||void 0===e?void 0:e.files})}}])),ou(gi(),function(t,n){var e=n.event.raw.target;Ki(t,E_,{files:e.files})})])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[bc(n.translate("Drop an image here"))]},a]}]};return XC(u,c,["tox-form__group--stretched"],[Ip("handle-files",[ou(E_,function(e,o){qC.getField(e).each(function(e){var r,i;r=e,(i=o.event.files)&&(Jf.setValue(r,function(t,n){var e=T_.explode(n.getOption("images_file_types"));return it(wt(t),function(t){return Z(e,function(n){return qt(t.name.toLowerCase(),".".concat(n.toLowerCase()))})})}(i,n)),Ki(r,QC,{name:t.name}))})})])])}
2(t,n.shared.providers,e)}),grid:FE(function(t,n){return function(t,n){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--".concat(t.columns,"col")]},components:et(t.items,n.interpreter)}}(t,n.shared)}),listbox:FE(function(t,n,e){return function(t,n,e){var o=Z(t.items,function(t){return!mT(t)}),r=n.shared.providers,i=e.bind(function(n){return hT(t.items,n)}).orThunk(function(){return yt(t.items).filter(mT)}),u=t.label.map(function(t){return $C(t,r)}),a=qC.parts.field({dom:{},factory:{sketch:function(e){return cT(_(_({context:t.context,uid:e.uid,text:i.map(function(t){return t.text}),icon:G.none(),tooltip:G.none(),role:Ht(!o,"combobox")},o?{}:{listRole:"listbox"}),{},{ariaLabel:t.label,fetch:function(e,r){var i=pT(e,t.name,t.items,Jf.getValue(e),o);r(dT(i,gy.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:G.none()}))},onSetup:N(I),getApi:N({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Wv.config({}),w_(i.map(function(t){return t.value}),function(t){return Hn(t.element,gT)},function(n,e){hT(t.items,e).each(function(t){Pn(n.element,gT,t.value),Ki(n,uT,{text:t.text})})})]}),"tox-listbox",n.shared)}}}),c={dom:{tag:"div",classes:["tox-listboxfield"]},components:[a]};return qC.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:lt([u.toArray(),[c]]),fieldBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){qC.getField(t).each(vm.disable)},onEnabled:function(t){qC.getField(t).each(vm.enable)}})])})}(t,n,e)}),selectbox:FE(function(t,n,e){return function(t,n,e){var o=et(t.items,function(t){return{text:n.translate(t.text),value:t.value}}),r=t.label.map(function(t){return $C(t,n)}),i=qC.parts.field(_(_({dom:{}},e.map(function(t){return{data:t}}).getOr({})),{},{selectAttributes:{size:t.size},options:o,factory:vT,selectBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),Wv.config({}),Ip("selectbox-change",[ou(gi(),function(n,e){Ki(n,QC,{name:t.name})})])])})),u=t.size>1?G.none():G.some(ly("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},n.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:lt([[i],u.toArray()])};return qC.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:lt([r.toArray(),[a]]),fieldBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){qC.getField(t).each(vm.disable)},onEnabled:function(t){qC.getField(t).each(vm.enable)}}),xw(function(){return n.checkUiComponentContext(t.context)})])})}(t,n.shared.providers,e)}),sizeinput:FE(function(t,n){return function(t,n){var e=kT,o=Wa("ratio-event"),r=function(t){return ly(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},n.icons)},i=t.label.getOr("Constrain proportions"),u=n.translate(i),a=wT.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":u,"data-mce-name":i}},components:[r("lock"),r("unlock")],buttonBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),xw(function(){return n.checkUiComponentContext(t.context)}),Wv.config({}),tb.config(n.tooltips.getConfig({tooltipText:u}))])}),c=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},s=function(e){return qC.parts.field({factory:Ly,inputClasses:["tox-textfield"],inputBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),xw(function(){return n.checkUiComponentContext(t.context)}),Wv.config({}),Ip("size-input-events",[ou(si(),function(t,n){Ki(t,o,{isField1:e})}),ou(gi(),function(n,e){Ki(n,QC,{name:t.name})})])]),selectOnFocus:!1})},l=function(t){return{dom:{tag:"label",classes:["tox-label"]},components:[bc(n.translate(t))]}},f=wT.parts.field1(c([qC.parts.label(l("Width")),s(!0)])),d=wT.parts.field2(c([qC.parts.label(l("Height")),s(!1)]));return wT.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[f,d,c([l("Â "),a])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,n,o){ST(Jf.getValue(t)).each(function(t){e(t).each(function(t){Jf.setValue(n,function(t){var n,e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},o=t.value.toFixed((n=t.unit)in e?e[n]:1);return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+t.unit}(t))})})},coupledFieldBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){wT.getField1(t).bind(qC.getField).each(vm.disable),wT.getField2(t).bind(qC.getField).each(vm.disable),wT.getLock(t).each(vm.disable)},onEnabled:function(t){wT.getField1(t).bind(qC.getField).each(vm.enable),wT.getField2(t).bind(qC.getField).each(vm.enable),wT.getLock(t).each(vm.enable)}}),xw(function(){return n.checkUiComponentContext("mode:design")}
2),Ip("size-input-events2",[ou(o,function(t,n){var o=n.event.isField1,r=o?wT.getField1(t):wT.getField2(t),i=o?wT.getField2(t):wT.getField1(t),u=r.map(Jf.getValue).getOr(""),a=i.map(Jf.getValue).getOr("");e=function(t,n){var e=ST(t).toOptional(),o=ST(n).toOptional();return Pt(e,o,function(t,n){return CT(t,n.unit).map(function(t){return n.value/t}).map(function(t){return e=t,o=n.unit,function(t){return CT(t,o).map(function(t){return{value:t*e,unit:o}})};var e,o}).getOr(kT)}).getOr(kT)}(u,a)})])])})}(t,n.shared.providers)}),slider:FE(function(t,n,e){return function(t,n,e){var o=e_.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[bc(n.translate(t.label))]}),r=e_.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),i=e_.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return e_.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:t.min,maxX:t.max,getInitialValue:N(e.getOrThunk(function(){return(Math.abs(t.max)-Math.abs(t.min))/2}))},components:[o,r,i],sliderBehaviours:Cu([v_(),zp.config({})]),onChoose:function(n,e,o){Ki(n,QC,{name:t.name,value:o})},onChange:function(n,e,o){Ki(n,QC,{name:t.name,value:o})}})}
2(t,n.shared.providers,e)}),urlinput:FE(function(t,n,e){return function(t,n,e,o){var r=n.shared.providers,i=function(n){var o=Jf.getValue(n);e.addToHistory(o.value,t.filetype)},u=_(_({},o.map(function(t){return{initialData:t}}).getOr({})),{},{dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":DE,type:"url"},minChars:0,responseTime:0,fetch:function(o){var r=function(t,n,e){var o,r,i=Jf.getValue(n),u=null!==(r=null===(o=null==i?void 0:i.meta)||void 0===o?void 0:o.text)&&void 0!==r?r:i.value;return e.getLinkInformation().fold(function(){return[]},function(n){var o,r=ME(u,function(t){return et(t,function(t){return kE(t,t)})}(e.getHistory(t)));return"file"===t?(o=[r,ME(u,_E(n)),ME(u,lt([EE(n),TE(n),AE(n)]))],at(o,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(SE,n)},[])):r})}(t.filetype,o,e),i=dT(r,gy.BUBBLE_TO_SANDBOX,n,{isHorizontalMenu:!1,search:G.none()});return lC(i)},getHotspot:function(t){return m.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(hk)&&hk.run(t).get(I)},typeaheadBehaviours:Cu([].concat(w(e.getValidationHandler().map(function(n){return hk.config({getRoot:function(t){return Cn(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){s.getOpt(t).each(function(t){Pn(t.element,"title",r.translate(n))})}},validator:{validate:function(e){var o=Jf.getValue(e);return function(t){return gE(sC(t))}(function(e){n({type:t.filetype,url:o.value},function(t){if("invalid"===t.status){var n=Co.error(t.message);e(n)}else{var o=Co.value(t.message);e(o)}})})},validateOnLoad:!1}})}).toArray()),[vm.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable}}),Wv.config({}),Ip("urlinput-events",[ou(mi(),function(n){var e=fc(n.element),o=e.trim();o!==e&&dc(n.element,o),"file"===t.filetype&&Ki(n,QC,{name:t.name})}),ou(gi(),function(n){Ki(n,QC,{name:t.name}),i(n)}),ou(ki(),function(n){Ki(n,QC,{name:t.name}),i(n)})])])),eventOrder:T({},mi(),["streaming","urlinput-events","invalidating"]),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:By(0,0,"normal")},onExecute:function(t,n,e){Ki(n,ek,{})},onItemExecute:function(n,e,o,r){i(n),Ki(n,QC,{name:t.name})}}),a=qC.parts.field(_(_({},u),{},{factory:mE})),c=t.label.map(function(t){return $C(t,r)}),s=Vv(function(t,n){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t;return ly(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:_({title:r.translate(e),"aria-live":"polite"},n.fold(function(){return{}},function(t){return{id:t}}))},r.icons)}("invalid",G.some(DE),"warning")),l=Vv({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),f=e.getUrlPicker(t.filetype),d=Wa("browser.url.event"),m=Vv({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:Cu([vm.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable}})])}),g=Vv(yE({context:t.context,name:t.name,icon:G.some("browse"),text:t.picker_text.or(t.label).getOr(""),enabled:t.enabled,primary:!1,buttonType:G.none(),borderless:!0},function(t){return Xi(t,d)},r,[],["tox-browse-url"]));return qC.sketch({dom:JC([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:lt([[m.asSpec()],f.map(function(){return g.asSpec()}).toArray()])}]),fieldBehaviours:Cu([vm.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){qC.getField(t).each(vm.disable),g.getOpt(t).each(vm.disable)},onEnabled:function(t){qC.getField(t).each(vm.enable),g.getOpt(t).each(vm.enable)}}),xw(function(){return r.checkUiComponentContext(t.context)}),Ip("url-input-events",[ou(d,function(n){om.getCurrent(n).each(function(e){var o=Jf.getValue(e),r=_({fieldname:t.name},o);f.each(function(o){o(r).get(function(o){Jf.setValue(e,o),Ki(n,QC,{name:t.name})})})})})])])})}(t,n,n.urlinput,e)}),customeditor:FE(function(t){var n=yo(),e=Vv({dom:{tag:t.tag}}),o=yo(),r=!__(t)&&t.onFocus.isSome()?[zp.config({onFocus:function(n){t.onFocus.each(function(t){t(n.element.dom)}
2)}}),Wv.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Cu([Ip("custom-editor-events",[fu(function(r){e.getOpt(r).each(function(e){(__(t)?t.init(e.element.dom):O_.load(t.scriptId,t.scriptUrl).then(function(n){return n(e.element.dom,t.settings)})).then(function(t){o.on(function(n){t.setValue(n)}),o.clear(),n.set(t)})})})]),w_(G.none(),function(){return n.get().fold(function(){return o.get().getOr("")},function(t){return t.getValue()})},function(t,e){n.get().fold(function(){return o.set(e)},function(t){return t.setValue(e)})}),v_()].concat(r)),components:[e.asSpec()]}}),htmlpanel:FE(function(t,n){return function(t,n){var e=["tox-form__group"].concat(w(t.stretched?["tox-form__group--stretched"]:[])),o=Ip("htmlpanel",[fu(function(n){t.onInit(n.element.dom)})]);return"presentation"===t.presets?UC.sketch({dom:{tag:"div",classes:e,innerHtml:t.html},containerBehaviours:Cu([tb.config(_(_({},n.tooltips.getConfig({tooltipText:"",onShow:function(t){Dc(t.element,"[data-mce-tooltip]:hover").orThunk(function(){return Ss(t.element)}).each(function(e){Un(e,"data-mce-tooltip").each(function(e){tb.setComponents(t,n.tooltips.getComponents({tooltipText:e}))})})}})),{},{mode:"children-normal",anchor:function(t){return{type:"node",node:Dc(t.element,"[data-mce-tooltip]:hover").orThunk(function(){return Ss(t.element).filter(function(t){return Un(t,"data-mce-tooltip").isSome()})}),root:t.element,layouts:{onLtr:N([is,rs,ts,es,ns,os]),onRtl:N([is,rs,ts,es,ns,os])},bubble:Xs(0,-2,{})}}})),o])}):UC.sketch({dom:{tag:"div",classes:e,innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:Cu([Wv.config({}),zp.config({}),o])})}(t,n.shared.providers)}),imagepreview:FE(function(t,n,e){return function(t,n){var e=ho(n.getOr({url:""})),o=Vv({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:n.map(function(t){return{src:t.url}}).getOr({})}}),r=Vv({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[o.asSpec()]}),i={};
2t.height.each(function(t){return i.height=t});var u=n.map(function(t){return{url:t.url,zoom:G.from(t.zoom),cachedWidth:G.from(t.cachedWidth),cachedHeight:G.from(t.cachedHeight)}});return{dom:{tag:"div",classes:["tox-imagepreview"],styles:i,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:Cu([v_(),w_(u,function(){return e.get()},function(t,n){var i={url:n.url};n.zoom.each(function(t){return i.zoom=t}),n.cachedWidth.each(function(t){return i.cachedWidth=t}),n.cachedHeight.each(function(t){return i.cachedHeight=t}),e.set(i);var u=function(){var n=i.cachedWidth,e=i.cachedHeight,o=i.zoom;if(!C(n)&&!C(e)){if(C(o)){var u=function(t,n,e){var o=me(t),r=ie(t);return Math.min(o/n,r/e,1)}(t.element,n,e);i.zoom=u}var a=function(t,n,e,o,r){var i=e*r,u=o*r,a=Math.max(0,t/2-i/2),c=Math.max(0,n/2-u/2);return{left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px"}}(me(t.element),ie(t.element),n,e,i.zoom);r.getOpt(t).each(function(t){Xn(t.element,a)})}};o.getOpt(t).each(function(e){var o,r=e.element;n.url!==Hn(r,"src")&&(Pn(r,"src",n.url),Nu(t.element,"tox-imagepreview__loaded")),u(),(o=r,new Promise(function(t,n){var e=function(){i(),t(o)},r=[Ls(o,"load",e),Ls(o,"error",function(){i(),n("Unable to load data from image: "+o.dom.src)})],i=function(){return ot(r,function(t){return t.unbind()})};o.dom.complete&&e()})).then(function(n){t.getSystem().isConnected()&&(Fu(t.element,"tox-imagepreview__loaded"),i.cachedWidth=n.dom.naturalWidth,i.cachedHeight=n.dom.naturalHeight,u())})})})])}}(t,e)}),table:FE(function(t,n){return function(t,n){var e,o,r=function(t){return{dom:{tag:"td",innerHtml:n.translate(t)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(o=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:et(o,function(t){return{dom:{tag:"th",innerHtml:n.translate(t)}}})}]}),(e=t.cells,{dom:{tag:"tbody"},components:et(e,function(t){return{dom:{tag:"tr"},components:et(t,r)}})})],behaviours:Cu([Wv.config({}),zp.config({})])}}(t,n.shared.providers)}),tree:FE(function(t,n){return function(t,n){var e=t.onLeafAction.getOr(I),o=t.onToggleExpand.getOr(I),r=t.defaultExpandedIds,i=ho(r),u=ho(t.defaultSelectedId),a=Wa("tree-id"),c=function(o,r){return t.items.map(function(t){return"leaf"===t.type?XT({leaf:t,selectedId:o,onLeafAction:e,visible:!0,treeId:a,backstage:n}):tE({directory:t,selectedId:o,onLeafAction:e,expandedIds:r,labelTabstopping:!0,treeId:a,backstage:n})})};return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:c(u.get(),i.get()),behaviours:Cu([Cp.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),Ip(nE,[ou("expand-tree-node",function(t,n){var e=n.event,r=e.expanded,u=e.node;i.set(r?[].concat(w(i.get()),[u]):i.get().filter(function(t){return t!==u})),o(i.get(),{expanded:r,node:u})})]),hs.config({channels:T({},"update-active-item-".concat(a),{onReceive:function(t,n){u.set(G.some(n.value)),Bp.set(t,c(G.some(n.value),i.get()))}})}),Bp.config({})])}}(t,n)}),panel:FE(function(t,n){return function(t,n){return{dom:{tag:"div",classes:t.classes},components:et(t.items,n.shared.interpreter)}}(t,n)})},NE={field:function(t,n){return n},record:N([])},LE=function(t,n,e,o,r){var i=Io(o,{shared:{interpreter:function(n){return zE(t,n,e,i,r)}}});return zE(t,n,e,i,r)},zE=function(t,n,e,o,r){return Ft(RE,n.type).fold(function(){return console.error('Unknown factory type "'.concat(n.type,'", defaulting to container: '),n),n},function(i){return i(t,n,e,o,r)})},PE=function(t,n,e,o){return zE(NE,t,n,e,o)},VE="layout-inset",HE=function(t){return t.x},UE=function(t,n){return t.x+t.width/2-n.width/2},WE=function(t,n){return t.x+t.width-n.width},jE=function(t){return t.y},GE=function(t,n){return t.y+t.height-n.height},qE=function(t,n){return t.y+t.height/2-n.height/2},YE=function(t,n,e){return Nc(WE(t,n),GE(t,n),e.insetSouthwest(),Hc(),"southwest",qc(t,{right:0,bottom:3}),VE)},XE=function(t,n,e){return Nc(HE(t),GE(t,n),e.insetSoutheast(),Vc(),"southeast",qc(t,{left:1,bottom:3}),VE)},KE=function(t,n,e){return Nc(WE(t,n),jE(t),e.insetNorthwest(),Pc(),"northwest",qc(t,{right:0,top:2}),VE)},JE=function(t,n,e){return Nc(HE(t),jE(t),e.insetNortheast(),zc(),"northeast",qc(t,{left:1,top:2}),VE)},$E=function(t,n,e){return Nc(UE(t,n),jE(t),e.insetNorth(),Uc(),"north",qc(t,{top:2}),VE)},QE=function(t,n,e){return Nc(UE(t,n),GE(t,n),e.insetSouth(),Wc(),"south",qc(t,{bottom:3}),VE)},ZE=function(t,n,e){return Nc(WE(t,n),qE(t,n),e.insetEast(),Gc(),"east",qc(t,{right:0}),VE)},tA=function(t,n,e){return Nc(HE(t),qE(t,n),e.insetWest(),jc(),"west",qc(t,{left:1}),VE)},nA=function(t){switch(t){case"north":return $E;case"northeast":return JE;case"northwest":return KE;case"south":return QE;case"southeast":return XE;case"southwest":return YE;case"east":return ZE;case"west":return tA}},eA=function(t,n,e,o,r){return Fs(o).map(nA).getOr($E)(t,n,e,o,r)},oA=function(t){switch(t){case"north":return QE;case"northeast":return XE;case"northwest":return YE;case"south":return $E;case"southeast":return JE;case"southwest":return KE;case"east":return tA;case"west":return ZE}},rA=function(t,n,e,o,r){return Fs(o).map(oA).getOr($E)(t,n,e,o,r)},iA={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},uA=function(t,n,e){var o={maxHeightFunction:js()};return function(){return e()?{type:"node",root:Bn(Dn(t())),node:G.from(t()),bubble:Xs(12,12,iA),layouts:{onRtl:function(){return[JE]},onLtr:function(){return[KE]}},overrides:o}:{type:"hotspot",hotspot:n(),bubble:Xs(-12,12,iA),layouts:{onRtl:function(){return[ts,ns,is]},onLtr:function(){return[ns,ts,is]}},overrides:o}}},aA=function(t,n,e,o){var r={maxHeightFunction:js()};return function(){return o()?{type:"node",root:Bn(Dn(n())),node:G.from(n()),bubble:Xs(12,12,iA),layouts:{onRtl:function(){return[$E]},onLtr:function(){return[$E]}},overrides:r}:t?{type:"node",root:Bn(Dn(n())),node:G.from(n()),bubble:Xs(0,-ue(n()),iA),layouts:{onRtl:function(){return[rs]},onLtr:function(){return[rs]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:Xs(0,0,iA),layouts:{onRtl:function(){return[rs]},onLtr:function(){return[rs]}},overrides:r}}},cA=function(t,n,e){return function(){return e()?{type:"node",root:Bn(Dn(t())),node:G.from(t()),layouts:{onRtl:function(){return[$E]},onLtr:function(){return[$E]}}}:{type:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[is]},onLtr:function(){return[is]}}}}},sA=function(t,n){return function(){return{type:"selection",root:n(),getSelection:function(){var n=t.selection.getRng(),e=t.model.table.getSelectedCells();if(e.length>1){var o=e[0],r=e[e.length-1],i={firstCell:tn(o),lastCell:tn(r)};return G.some(i)}return G.some(xl.range(tn(n.startContainer),n.startOffset,tn(n.endContainer),n.endOffset))}}}},lA=function(t){return function(n){return{type:"node",root:t(),node:n}}},fA=function(t,n,e,o){var r=Ov(t),i=function(){return tn(t.getBody())},u=function(){return tn(t.getContentAreaContainer())},a=function(){return r||!o()};return{inlineDialog:uA(u,n,a),inlineBottomDialog:aA(t.inline,u,e,a),banner:cA(u,n,a),cursor:sA(t,i),node:lA(i)}},dA=function(t){return function(n,e){jS(t)(n,e)}},mA=function(t){return function(){return MS(t)}},gA=function(t){return function(n){return _S(t,n)}}
2,pA=function(t){return function(n){return AS(t,n)}},hA=function(t){return function(){return iv(t)}},vA=function(t){return Nt(t,"items")},bA=function(t){return Nt(t,"format")},yA=[{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"}]}],xA=function(t){return at(t,function(t,n){if(Rt(n,"items")){var e=xA(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(Rt(n,"inline")||function(t){return Rt(t,"block")}(n)||function(t){return Rt(t,"selector")}(n)){var o="custom-".concat(f(n.name)?n.name:n.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return _(_({},t),{},{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},wA=function(t){return zh(t).map(function(n){var e=function(t,n){var e=xA(n),o=function(n){ot(n,function(n){t.formatter.has(n.name)||t.formatter.register(n.name,n.format)})};return t.formatter?o(e.customFormats):t.on("init",function(){o(e.customFormats)}),e.formats}(t,n);return Ph(t)?yA.concat(e):e}).getOr(yA)},SA=function(t,n,e){return _(_({},t),{},{type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)})},CA=function(t,n,e,o){var r=function(n){return et(n,function(n){return vA(n)?function(t){var n=r(t.items);return _(_({},t),{},{type:"submenu",getStyleItems:N(n)})}(n):bA(n)?function(t){return SA(t,e,o)}(n):function(t){var n=Ct(t);return 1===n.length&&Q(n,"title")}(n)?_(_({},n),{},{type:"separator"}):function(n){var r=f(n.name)?n.name:Wa(n.title),i="custom-".concat(r),u=_(_({},n),{},{type:"formatter",format:i,isSelected:e(i),getStylePreview:o(i)});return t.formatter.register(r,u),u}(n)})};return r(n)},kA=function(t){var n=0,e=function(t){return[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[bc(t.tooltipText)]}]};return{getConfig:function(o){return{delayForShow:function(){return n>0?60:300},delayForHide:N(300),exclusive:!0,lazySink:t,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]}
2,tooltipComponents:e(o),onShow:function(t,e){n++,o.onShow&&o.onShow(t,e)},onHide:function(t,e){n--,o.onHide&&o.onHide(t,e)},onSetup:o.onSetup}},getComponents:e}},OA=T_.trim,_A=function(t){return function(n){if(function(t){return O(t)&&1===t.nodeType}(n)){if(n.contentEditable===t)return!0;if(n.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},TA=_A("true"),EA=_A("false"),AA=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},MA=function(t){return t.innerText||t.textContent},DA=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&IA(t)},BA=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},IA=function(t){return function(t){for(var n=t;n=n.parentNode;){var e=n.contentEditable;if(e&&"inherit"!==e)return TA(n)}return!1}(t)&&!EA(t)},FA=function(t){return BA(t)&&IA(t)},RA=function(t){var n,e=function(t){return t.id?t.id:Wa("h")}(t);return AA("header",null!==(n=MA(t))&&void 0!==n?n:"","#"+e,function(t){return BA(t)?parseInt(t.nodeName.substr(1),10):0}(t),function(){t.id=e})},NA=function(t){var n=t.id||t.name,e=MA(t);return AA("anchor",e||"#"+n,"#"+n,0,I)},LA=function(t){return OA(t.title).length>0},zA=function(t){var n=function(t){var n=et(Al(tn(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),function(t){return t.dom});return n}(t);return it(function(t){return et(it(t,FA),RA)}(n).concat(function(t){return et(it(t,DA),NA)}(n)),LA)},PA="tinymce-url-history",VA=function(t){return f(t)&&/^https?/.test(t)},HA=function(t){return d(t)&&Bt(t,function(t){return!(g(n=t)&&n.length<=5&&dt(n,VA));var n}).isNone()},UA=function(){var t,n=gS.getItem(PA);if(null===n)return{};try{t=JSON.parse(n)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+PA+" was not valid JSON",n),{};throw n}return HA(t)?t:(console.log("Local storage "+PA+" was not valid format",t),{})},WA=function(t){var n=UA();return Ft(n,t).getOr([])},jA=function(t,n){if(VA(t)){var e=UA(),o=Ft(e,n).getOr([]),r=it(o,function(n){return n!==t});e[n]=[t].concat(r).slice(0,5),function(t){if(!HA(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));gS.setItem(PA,JSON.stringify(t))}(e)}},GA=function(t){return!!t},qA=function(t){return _t(T_.makeMap(t,/[, ]/),GA)},YA=function(t){return G.from(Qh(t))},XA=function(t){return G.from(t).filter(f).getOrUndefined()},KA=function(t){return{getHistory:WA,addToHistory:jA,getLinkInformation:function(){return function(t){return ev(t)?G.some({targets:zA(t.getBody()),anchorTop:XA(ov(t)),anchorBottom:XA(rv(t))}):G.none()}(t)},getValidationHandler:function(){return function(t){return G.from(Zh(t))}(t)},getUrlPicker:function(n){return function(t,n){return function(t,n){var e=function(t){var n=G.from(nv(t)).filter(GA).map(qA);return YA(t).fold(W,function(t){return n.fold(j,function(t){return Ct(t).length>0&&t})})}(t);return y(e)?e?YA(t):G.none():e[n]?YA(t):G.none()}(t,n).map(function(e){return function(o){return sC(function(r){var i=_({filetype:n,fieldname:o.fieldname},G.from(o.meta).getOr({}));e.call(t,function(t,n){if(!f(t))throw new Error("Expected value to be string");if(void 0!==n&&!d(n))throw new Error("Expected meta to be a object");r({value:t,meta:n})},o.value,i)})}})}(t,n)}}},JA=qd,$A=Ad,QA=N([Ir("shell",!1),vr("makeItem"),Ir("setupItem",I),td("listBehaviours",[Bp])]),ZA=_d({name:"items",overrides:function(){return{behaviours:Cu([Bp.config({})])}}}),tM=N([ZA]),nM=Zd({name:N("CustomList")(),configFields:QA(),partFields:tM(),factory:function(t,n,e,o){var r=t.shell?{behaviours:[Bp.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:r.components,behaviours:Zf(t.listBehaviours,r.behaviours),apis:{setItems:function(n,e){var o;(o=n,t.shell?G.some(o):zd(o,t,"items")).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(o){var r=Bp.contents(o),i=e.length,u=i-r.length,a=u>0?tt(u,function(){return t.makeItem()}):[],c=r.slice(i);ot(c,function(t){return Bp.remove(o,t)}
2),ot(a,function(t){return Bp.append(o,t)});var s=Bp.contents(o);ot(s,function(o,r){t.setupItem(n,o,e[r],r)})})}}}},apis:{setItems:function(t,n,e){t.setItems(n,e)}}}),eM=N([vr("dom"),Ir("shell",!0),$f("toolbarBehaviours",[Bp])]),oM=N([_d({name:"groups",overrides:function(){return{behaviours:Cu([Bp.config({})])}}})]),rM=Zd({name:"Toolbar",configFields:eM(),partFields:oM(),factory:function(t,n,e,o){var r=t.shell?{behaviours:[Bp.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:r.components,behaviours:Zf(t.toolbarBehaviours,r.behaviours),apis:{setGroups:function(n,e){var o;(o=n,t.shell?G.some(o):zd(o,t,"groups")).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){Bp.set(t,e)})},refresh:I},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),iM=I,uM=W,aM=N([]),cM=Object.freeze({__proto__:null,setup:iM,isDocked:uM,getBehaviours:aM}),sM=N(Wa("toolbar-height-change")),lM={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},fM="tox-tinymce--toolbar-sticky-on",dM="tox-tinymce--toolbar-sticky-off",mM=function(t,n){return Q(La.getModes(t),n)},gM=function(t){var n=t.element;Cn(n).each(function(e){var o="padding-"+La.getModes(t)[0];if(La.isDocked(t)){var r=me(e);Yn(n,"width",r+"px"),Yn(e,o,function(t){return ue(t)+(parseInt(Jn(t,"margin-top"),10)||0)+(parseInt(Jn(t,"margin-bottom"),10)||0)}(n)+"px")}else ne(n,"width"),ne(e,o)})},pM=function(t,n){n?(Nu(t,lM.fadeOutClass),zu(t,[lM.transitionClass,lM.fadeInClass])):(Nu(t,lM.fadeInClass),zu(t,[lM.fadeOutClass,lM.transitionClass]))},hM=function(t,n){var e=tn(t.getContainer());n?(Fu(e,fM),Nu(e,dM)):(Fu(e,dM),Nu(e,fM))},vM=function(t,n){var e=yo(),o=n.getSink,r=function(t){o().each(function(n){return t(n.element)})},i=function(n){t.inline||gM(n),hM(t,La.isDocked(n)),n.getSystem().broadcastOn([Bf()],{}),o().each(function(t){return t.getSystem().broadcastOn([Bf()],{})})},u=t.inline?[]:[hs.config({channels:T({},sM(),{onReceive:gM})})];return[zp.config({}),La.config({contextual:_({lazyContext:function(n){var e=ue(n.element),o=t.inline?t.getContentAreaContainer():t.getContainer();return G.from(o).map(function(o){var r=fo(tn(o));return Nv(t,n.element).fold(function(){var t=r.height-e,o=r.y+(mM(n,"top")?0:e);return lo(r.x,o,r.width,t)},function(t){var o=go(r,Lv(t)),i=mM(n,"top")?o.y:o.y+e;return lo(o.x,i,o.width,o.height-e)})})},onShow:function(){r(function(t){return pM(t,!0)})},onShown:function(t){r(function(t){return Pu(t,[lM.transitionClass,lM.fadeInClass])}),e.get().each(function(n){(function(t,n){var e=bn(n);ws(e).filter(function(t){return!hn(n,t)}).filter(function(n){return hn(n,tn(e.dom.body))||vn(t,n)}).each(function(){return bs(n)})})(t.element,n),e.clear()})},onHide:function(t){(function(t,n){return Ss(t).orThunk(function(){return n().toOptional().bind(function(t){return Ss(t.element)})})})(t.element,o).fold(e.clear,e.set),r(function(t){return pM(t,!1)})},onHidden:function(){r(function(t){return Pu(t,[lM.transitionClass])})}},lM),lazyViewport:function(n){return Nv(t,n.element).fold(function(){var e=po(),o=Kh(t),r=e.y+(mM(n,"top")&&!Rv(t)?o:0),i=e.height-(mM(n,"bottom")?o:0);return{bounds:lo(e.x,r,e.width,i),optScrollEnv:G.none()}},function(t){return{bounds:Lv(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:le(t.element).top})}})},modes:[n.header.getDockingMode()],onDocked:i,onUndocked:i})].concat(u)},bM=Object.freeze({__proto__:null,setup:function(t,n,e){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){e().each(La.reset)}),t.on("ResizeWindow ResizeEditor",function(){e().each(gM)}),t.on("SkinLoaded",function(){e().each(function(t){La.isDocked(t)?La.reset(t):La.refresh(t)})}),t.on("FullscreenStateChanged",function(){e().each(La.reset)})),t.on("AfterScrollIntoView",function(t){e().each(function(n){La.refresh(n);var e=n.element;
2hg(e)&&function(t,n){var e=bn(n),o=wn(n).dom.innerHeight,r=eo(e),i=tn(t.elm),u=mo(i),a=ie(i),c=u.y,s=c+a,l=le(n),f=ie(n),d=l.top,m=d+f,g=Math.abs(d-r.top)<2,p=Math.abs(m-(r.top+o))<2;if(g&&c<m)oo(r.left,c-f,e);else if(p&&s>d){var h=c-o+a+f;oo(r.left,h,e)}}(t,e)})}),t.on("PostRender",function(){hM(t,!1)})},isDocked:function(t){return t().map(La.isDocked).getOr(!1)},getBehaviours:vM}),yM=Yo([nx,br("items",Ko([Jo([ex,kr("items",tr)]),tr]))].concat(Bx)),xM=[Er("text"),Er("tooltip"),Er("icon"),Fr("search",!1,Ko([nr,Yo([Er("placeholder")])],function(t){return y(t)?t?G.some({placeholder:G.none()}):G.none():G.some(t)})),wr("fetch"),Pr("onSetup",function(){return I}),Nr("context","mode:design")],wM=Yo([nx].concat(xM)),SM=function(t){return cr("menubutton",wM,t)},CM=Yo([nx,vx,hx,gx,xx,cx,dx,Lr("presets","normal",["normal","color","listpreview"]),Ox(1),lx,fx,Nr("context","mode:design")]),kM=Qd({factory:function(t,n){var e={focus:Cp.focusIn,setMenus:function(t,e){var o=et(e,function(t){var e={type:"menubutton",text:t.text,fetch:function(n){n(t.getItems())},context:"any"},o=SM(e).mapError(function(t){return fr(t)}).getOrDie();return WT(o,"tox-mbtn",n.backstage,G.some("menuitem"))});Bp.set(t,o)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:Cu([Bp.config({}),Ip("menubar-events",[fu(function(n){t.onSetup(n)}),ou(ci(),function(t,n){Dc(t.element,".tox-mbtn--active").each(function(e){Bc(n.event.target,".tox-mbtn").each(function(n){hn(e,n)||t.getSystem().getByDom(e).each(function(e){t.getSystem().getByDom(n).each(function(t){kC.expand(t),kC.close(e),zp.focus(t)})})})})}),ou(Hi(),function(t,n){n.event.prevFocus.bind(function(n){return t.getSystem().getByDom(n).toOptional()}).each(function(e){n.event.newFocus.bind(function(n){return t.getSystem().getByDom(n).toOptional()}).each(function(t){kC.isOpen(e)&&(kC.expand(t),kC.close(e))})})})]),Cp.config({mode:"flow",selector:".tox-mbtn",onEscape:function(n){return t.onEscape(n),G.some(!0)}}),Wv.config({})]),apis:e,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[vr("dom"),vr("uid"),vr("onEscape"),vr("backstage"),Ir("onSetup",I)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),OM="container",_M=[$f("slotBehaviours",[])],TM=function(t){return"<alloy.field."+t+">"},EM=function(t,n){var e=function(n){return Ud(t)},o=function(n,e){return function(o,r){return zd(o,t,r).map(function(t){return n(t,r)}).getOr(e)}},r=function(t,n){return"true"!==Hn(t.element,"aria-hidden")},i=o(r,!1),u=o(function(t,n){if(r(t)){var e=t.element;Yn(e,"display","none"),Pn(e,"aria-hidden","true"),Ki(t,Ui(),{name:n,visible:!1})}}),a=function(t){return function(n,e){ot(e,function(e){return t(n,e)})}}(u),c=o(function(t,n){if(!r(t)){var e=t.element;ne(e,"display"),jn(e,"aria-hidden"),Ki(t,Ui(),{name:n,visible:!0})}}),s={getSlotNames:e,getSlot:function(n,e){return zd(n,t,e)},isShowing:i,hideSlot:u,hideAllSlots:function(t){return a(t,e())},showSlot:c};return{uid:t.uid,dom:t.dom,components:n,behaviours:Qf(t.slotBehaviours),apis:s}},AM=_(_({},_t({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},function(t){return oc(t)})),{},{sketch:function(t){var n=function(){var t=[];return{slot:function(n,e){return t.push(n),Id(OM,TM(n),e)},record:N(t)}}(),e=t(n),o=n.record(),r=et(o,function(t){return kd({name:t,pname:TM(t)})});return Xd(OM,_M,r,EM,e)}}),MM=Yo([hx,vx,Pr("onShow",I),Pr("onHide",I),dx]),DM=function(t){return{element:function(){return t.element.dom}}},BM=function(t,n){var e=et(Ct(n),function(t){var e=n[t],o=sr(function(t){return cr("sidebar",MM,t)}(e));return{name:t,getApi:DM,onSetup:o.onSetup,onShow:o.onShow,onHide:o.onHide}});return et(e,function(n){var o=ho(I);return t.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:sw([pw(n,o),hw(n,o),ou(Ui(),function(t,n){var o=n.event,r=ct(e,function(t){return t.name===o.name});r.each(function(n){(o.visible?n.onShow:n.onHide)(n.getApi(t))})})])})})},IM=function(t){return AM.sketch(function(n){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:BM(n,t),slotBehaviours:sw([fu(function(t){return AM.hideAllSlots(t)})])}})},FM=function(t,n){Pn(t,"role",n)},RM=function(t){return om.getCurrent(t).bind(function(t){return HT.isGrowing(t)||HT.hasGrown(t)?om.getCurrent(t).bind(function(t){return ct(AM.getSlotNames(t),function(n){return AM.isShowing(t,n)})}):G.none()})},NM=Wa("FixSizeEvent"),LM=Wa("AutoSizeEvent"),zM=Object.freeze({__proto__:null,block:function(t,n,e,o){Pn(t.element,"aria-busy",!0);var r=n.getRoot(t).getOr(t),i=Cu([Cp.config({mode:"special",onTab:function(){return G.some(!0)},onShiftTab:function(){return G.some(!0)}}),zp.config({})]),u=o(r,i),a=r.getSystem().build(u);Bp.append(r,Cc(a)),a.hasConfigured(Cp)&&n.focus&&Cp.focusIn(a),e.isBlocked()||n.onBlock(t),e.blockWith(function(){return Bp.remove(r,a)})},unblock:function(t,n,e){jn(t.element,"aria-busy"),e.isBlocked()&&n.onUnblock(t),e.clear()},isBlocked:function(t,n,e){return e.isBlocked()}}),PM=[Pr("getRoot",G.none),zr("focus",!0),Aa("onBlock"),Aa("onUnblock")],VM=Ou({fields:PM,name:"blocking",apis:zM,state:Object.freeze({__proto__:null,init:function(){var t=vo(function(t){return t.destroy()});return Su({readState:t.isSet,blockWith:function(n){t.set({destroy:n})},clear:t.clear,isBlocked:t.isSet})}})}),HM=function(t){return om.getCurrent(t).each(function(t){return bs(t.element,!0)})},UM=function(t,n,e){var o=ho(!1),r=yo(),i=function(e){var r;o.get()&&(!function(t){return"focusin"===t.type}(r=e)||!(r.composed?yt(r.composedPath()):G.from(r.target)).map(tn).filter(cn).exists(function(t){return Lu(t,"mce-pastebin")}))&&(e.preventDefault(),HM(n()),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 u=function(r){r!==o.get()&&(o.set(r),function(t,n,e,o){var r=n.element;if(function(t,n){var e="tabindex",o="data-mce-".concat(e);G.from(t.iframeElement).map(tn).each(function(t){n?(Un(t,e).each(function(n){return Pn(t,o,n)}),Pn(t,e,-1)):(jn(t,e),Un(t,o).each(function(n){Pn(t,e,n),jn(t,o)}))})}(t,e),e)VM.block(n,function(t){return function(n,e){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Pv('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(o)),ne(r,"display"),jn(r,"aria-hidden"),t.hasFocus()&&HM(n);else{var i=om.getCurrent(n).exists(function(t){return xs(t.element)});VM.unblock(n),Yn(r,"display","none"),Pn(r,"aria-hidden","true"),i&&t.focu
2s()}}(t,n(),r,e.providers),function(t,n){t.dispatch("AfterProgressState",{state:n})}(t,r))};t.on("ProgressState",function(n){if(r.on(clearTimeout),D(n.time)){var e=kh.setEditorTimeout(t,function(){return u(n.state)},n.time);r.set(e)}else u(n.state),r.clear()})},WM=function(t,n,e){return{within:t,extra:n,withinWidth:e}},jM=function(t,n,e){var o=at(t,function(t,n){return function(t,n){var o=e(t);return G.some({element:t,start:n,finish:n+o,width:o})}(n,t.len).fold(N(t),function(n){return{len:n.finish,list:t.list.concat([n])}})},{len:0,list:[]}).list,r=it(o,function(t){return t.finish<=n}),i=ut(r,function(t,n){return t+n.width},0);return{within:r,extra:o.slice(r.length),withinWidth:i}},GM=function(t){return et(t,function(t){return t.element})},qM=function(t,n){var e=et(n,function(t){return Cc(t)});rM.setGroups(t,e)},YM=function(t,n,e){var o=n.builtGroups.get();if(0!==o.length){var r=Pd(t,n,"primary"),i=rC.getCoupled(t,"overflowGroup");Yn(r.element,"visibility","hidden");var u=o.concat([i]),a=St(u,function(t){return Ss(t.element).bind(function(n){return t.getSystem().getByDom(n).toOptional()})});e([]),qM(r,u);var c=function(t,n,e,o){var r=function(t,n,e){var o=jM(n,t,e);return 0===o.extra.length?G.some(o):G.none()}(t,n,e).getOrThunk(function(){return jM(n,t-e(o),e)}),i=r.within,u=r.extra,a=r.withinWidth;return 1===u.length&&u[0].width<=e(o)?function(t,n,e){var o=GM(t.concat(n));return WM(o,[],e)}(i,u,a):u.length>=1?function(t,n,e,o){var r=GM(t).concat([e]);return WM(r,GM(n),o)}(i,u,o,a):function(t,n,e){return WM(GM(t),[],e)}(i,0,a)}(me(r.element),n.builtGroups.get(),function(t){return Math.ceil(t.element.dom.getBoundingClientRect().width)},i);0===c.extra.length?(Bp.remove(r,i),e([])):(qM(r,c.within),e(c.extra)),ne(r.element,"visibility"),ee(r.element),a.each(zp.focus)}},XM=N([$f("splitToolbarBehaviours",[rC]),pr("builtGroups",function(){return ho([])})]),KM=N([Ta(["overflowToggledClass"]),Mr("getOverflowBounds"),vr("lazySink"),pr("overflowGroups",function(){return ho([])}),Aa("onOpened"),Aa("onClosed")].concat(XM())),JM=N([kd({factory:rM,schema:eM(),name:"primary"}),Od({schema:eM(),name:"overflow"}),Od({name:"overflow-button"}),Od({name:"overflow-group"})]),$M=N(function(t,n){!function(t,n){var e=de.max(t,n,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Yn(t,"max-width",e+"px")}(t,Math.floor(n))}),QM=N([Ta(["toggledClass"]),vr("lazySink"),wr("fetch"),Mr("getBounds"),Br("fireDismissalEventInstead",[Ir("event",Pi())]),nl(),Aa("onToggled")]),ZM=N([Od({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Cu([qp.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:t.onToggled})])}}}),Od({factory:rM,schema:eM(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:Cu([Cp.config({mode:"cyclic",onEscape:function(n){return zd(n,t,"button").each(zp.focus),G.none()}})])}}})]),tD=yo(),nD=function(t,n){var e=rC.getCoupled(t,"toolbarSandbox");Mf.isOpen(e)?Mf.close(e):Mf.open(e,n.toolbar())},eD=function(t,n,e,o){var r=e.getBounds.map(function(t){return t()}),i=e.lazySink(t).getOrDie();of.positionWithinBounds(i,n,{anchor:{type:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:$M()}}},r)},oD=function(t,n,e,o,r){rM.setGroups(n,r),eD(t,n,e,o),qp.on(t)},rD=Zd({name:"FloatingToolbarButton",factory:function(t,n,e,o){return _(_({},zv.sketch(_(_({},o.button()),{},{action:function(t){nD(t,o)},buttonBehaviours:nd({dump:o.button().buttonBehaviours},[rC.config({others:{toolbarSandbox:function(n){return function(t,n,e){var o=Fc();return{dom:{tag:"div",attributes:{id:o.id}},behaviours:Cu([Cp.config({mode:"special",onEscape:function(t){return Mf.close(t),G.some(!0)}}),Mf.config({onOpen:function(r,i){var u=tD.get().getOr(!1);e.fetch().get(function(r){oD(t,i,e,n.layouts,r),o.link(t.element),u||Cp.focusIn(i)})},onClose:function(){qp.off(t),tD.get().getOr(!1)||zp.focus(t),o.unlink(t.element)},isPartOf:function(n,e,o){return Rc(e,o)||Rc(t,o)},getAttachPoint:function(){return e.lazySink(t).getOrDie()}}),hs.config({channels:_(_({},Rf(_({isExtraPart:W},e.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Lf({doReposition:function(){Mf.getState(rC.getCoupled(t,"toolbarSandbox")).each(function(o){eD(t,o,e,n.layouts)})}}))})])}}(n,e,t)}}})])}))),{},{apis:{setGroups:function(n,o){Mf.getState(rC.getCoupled(n,"toolbarSandbox")).each(function(r){oD(n,r,t,e.layouts,o)})},reposition:function(n){Mf.getState(rC.getCoupled(n,"toolbarSandbox")).each(function(o){eD(n,o,t,e.layouts)})},toggle:function(t){nD(t,o)},toggleWithoutFocusing:function(t){!function(t,n){tD.set(!0),nD(t,n),tD.clear()}(t,o)},getToolbar:function(t){return Mf.getState(rC.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Mf.isOpen(rC.getCoupled(t,"toolbarSandbox"))}}})},configFields:QM(),partFields:ZM(),apis:{setGroups:function(t,n,e){t.setGroups(n,e)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},toggleWithoutFocusing:function(t,n){t.toggleWithoutFocusing(n)},getToolbar:function(t,n){return t.getToolbar(n)},isOpen:function(t,n){return t.isOpen(n)}}}),iD=N([vr("items"),Ta(["itemSelector"]),$f("tgroupBehaviours",[Cp])]),uD=N([Td({name:"items",unit:"item"})]),aD=Zd({name:"ToolbarGroup",configFields:iD(),partFields:uD(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Zf(t.tgroupBehaviours,[Cp.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),cD=function(t){return et(t,function(t){return Cc(t)})},sD=function(t,n,e){YM(t,e,function(o){e.overflowGroups.set(o),n.getOpt(t).each(function(t){rD.setGroups(t,cD(o))})})},lD=Zd({name:"SplitFloatingToolbar",configFields:KM(),partFields:JM(),factory:function(t,n,e,o){var r=Vv(rD.sketch({fetch:function(){return sC(function(n){n(cD(t.overflowGroups.get()))})}
2,layouts:{onLtr:function(){return[ns,ts]},onRtl:function(){return[ts,ns]},onBottomLtr:function(){return[os,es]},onBottomRtl:function(){return[es,os]}},getBounds:e.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()},onToggled:function(n,e){return t[e?"onOpened":"onClosed"](n)}}));return{uid:t.uid,dom:t.dom,components:n,behaviours:Zf(t.splitToolbarBehaviours,[rC.config({others:{overflowGroup:function(){return aD.sketch(_(_({},o["overflow-group"]()),{},{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(n,e){t.builtGroups.set(et(e,n.getSystem().build)),sD(n,r,t)},refresh:function(n){return sD(n,r,t)},toggle:function(t){r.getOpt(t).each(function(t){rD.toggle(t)})},toggleWithoutFocusing:function(t){r.getOpt(t).each(rD.toggleWithoutFocusing)},isOpen:function(t){return r.getOpt(t).map(rD.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){rD.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(rD.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},toggleWithoutFocusing:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),fD=N([Ta(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Aa("onOpened"),Aa("onClosed")].concat(XM())),dD=N([kd({factory:rM,schema:eM(),name:"primary"}),kd({factory:rM,schema:eM(),name:"overflow",overrides:function(t){return{toolbarBehaviours:Cu([HT.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(n){zd(n,t,"overflow-button").each(function(t){qp.off(t)}),t.onClosed(n)},onGrown:function(n){t.onOpened(n)},onStartGrow:function(n){zd(n,t,"overflow-button").each(qp.on)}}),Cp.config({mode:"acyclic",onEscape:function(n){return zd(n,t,"overflow-button").each(zp.focus),G.some(!0)}})])}}}),Od({name:"overflow-button",overrides:function(t){return{buttonBehaviours:Cu([qp.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Od({name:"overflow-group"})]),mD=function(t,n,e){zd(t,n,"overflow-button").each(function(o){zd(t,n,"overflow").each(function(r){if(gD(t,n),HT.hasShrunk(r)){var i=n.onOpened;n.onOpened=function(t){e||Cp.focusIn(r),i(t),n.onOpened=i}}else{var u=n.onClosed;n.onClosed=function(t){e||zp.focus(o),u(t),n.onClosed=u}}HT.toggleGrow(r)})})},gD=function(t,n){zd(t,n,"overflow").each(function(e){YM(t,n,function(t){var n=et(t,function(t){return Cc(t)});rM.setGroups(e,n)}),zd(t,n,"overflow-button").each(function(t){HT.hasGrown(e)&&qp.on(t)}),HT.refresh(e)})},pD=Zd({name:"SplitSlidingToolbar",configFields:fD(),partFields:dD(),factory:function(t,n,e,o){var r="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:n,behaviours:Zf(t.splitToolbarBehaviours,[rC.config({others:{overflowGroup:function(t){return aD.sketch(_(_({},o["overflow-group"]()),{},{items:[zv.sketch(_(_({},o["overflow-button"]()),{},{action:function(n){Xi(t,r)}}))]}))}}}),Ip("toolbar-toggle-events",[ou(r,function(n){mD(n,t,!1)})])]),apis:{setGroups:function(n,e){(function(n,e){var o=et(e,n.getSystem().build);t.builtGroups.set(o)})(n,e),gD(n,t)},refresh:function(n){return gD(n,t)},toggle:function(n){mD(n,t,!1)},toggleWithoutFocusing:function(n){mD(n,t,!0)},isOpen:function(n){return function(t,n){return zd(t,n,"overflow").map(HT.hasGrown).getOr(!1)}(n,t)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)}}}),hD=function(t){return{dom:_({tag:"div",classes:["tox-toolbar__group"]},t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}})),components:[aD.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]), .tox-number-input:not([disabled])"},tgroupBehaviours:Cu([Wv.config({}),zp.config({})])}},vD=function(t){return aD.sketch(hD(t))},bD=function(t,n){var e=fu(function(n){var e=et(t.initGroups,vD);rM.setGroups(n,e)});return Cu([mw(function(){return t.providers.checkUiComponentContext("any").shouldDisable}),xw(function(){return t.providers.checkUiComponentContext("any")}),Cp.config({mode:n,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Ip("toolbar-events",[e])])},yD=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":hD({title:G.none(),items:[]}),"overflow-button":hE({context:"any",name:"more",icon:G.some("more-drawer"),enabled:!0,tooltip:G.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:G.none(),borderless:!1},G.none(),t.providers,[],"overflow-button")},splitToolbarBehaviours:bD(t,n)}},xD=function(t){var n=yD(t),e=lD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return lD.sketch(_(_({},n),{},{lazySink:t.getSink,getOverflowBounds:function(){var n=t.moreDrawerData.lazyHeader().element,e=mo(n),o=xn(n),r=mo(o),i=Math.max(o.dom.scrollHeight,r.height);return lo(e.x+4,r.y,e.width-8,i)},parts:_(_({},n.parts),{},{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[e],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(n){return t.onToggled(n,!0)},onClosed:function(n){return t.onToggled(n,!1)}}))},wD=function(t){var n=pD.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=pD.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=yD(t);return pD.sketch(_(_({},o),{},{components:[n,e],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(n){n.getSystem().broadcastOn([sM()],{type:"opened"}),t.onToggled(n,!0)},onClosed:function(n){n.getSystem().broadcastOn([sM()],{type:"closed"}),t.onToggled(n,!1)}}))},SD=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return rM.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===yh.scrolling?["tox-toolbar--scrolling"]:[])},components:[rM.parts.groups({})],toolbarBehaviours:bD(t,n)})},CD=[gx,hx,Er("tooltip"),Lr("buttonType","secondary",["primary","secondary"]),zr("borderless",!1),wr("onAction"),Nr("context","mode:design")],kD={button:[].concat(CD,[rx,xr("type",["button"])]),togglebutton:[].concat(CD,[zr("active",!1),xr("type",["togglebutton"])])},OD=[xr("type",["group"]),Vr("buttons",[],dr("type",kD))],_D=dr("type",_(_({},kD),{},{group:OD})),TD=Yo([Vr("buttons",[],_D),wr("onShow"),wr("onHide")]),ED=function(t,n){return function(t,n,e,o,r){var i,u,a="togglebutton"===t.type,c=t.icon.map(function(t){return rT(t,n.icons)}).map(Vv),s=_(_({},t),{},{name:a?t.text.getOr(t.icon.getOr("")):null!==(i=t.text)&&void 0!==i?i:t.icon.getOr(""),primary:"primary"===t.buttonType,buttonType:G.from(t.buttonType),tooltip:t.tooltip,icon:t.icon,enabled:!0,borderless:t.borderless}),l=vE(null!==(u=t.buttonType)&&void 0!==u?u:"secondary"),f=a?t.text.map(n.translate):G.some(n.translate(t.text)),d=f.map(bc),m=s.tooltip.or(f).map(function(t){return{"aria-label":n.translate(t)}
2}).getOr({}),g=c.map(function(t){return t.asSpec()}),p=Cw([g,d]),h=t.icon.isSome()&&d.isSome(),v={tag:"button",classes:(e=(o=(r=l.concat.apply(l,w(t.icon.isSome()&&!h?["tox-button--icon"]:[]))).concat.apply(r,w(h?["tox-button--icon-and-text"]:[]))).concat.apply(o,w(t.borderless?["tox-button--naked"]:[]))).concat.apply(e,w("togglebutton"===t.type&&t.active?["tox-button--enabled"]:[])),attributes:m},b=pE(s,G.some(function(e){var o=function(t){c.map(function(o){return o.getOpt(e).each(function(e){Bp.set(e,[rT(t,n.icons)])})})};return a?t.onAction({setIcon:o,setActive:function(t){var n=e.element;t?(Fu(n,"tox-button--enabled"),Pn(n,"aria-pressed",!0)):(Nu(n,"tox-button--enabled"),jn(n,"aria-pressed"))},isActive:function(){return Lu(e.element,"tox-button--enabled")},focus:function(){return bs(e.element)}}):"button"===t.type?t.onAction({setIcon:o}):void 0}),[],v,p,t.tooltip,n);return zv.sketch(b)}(t,n)},AD=Ge().deviceType,MD=AD.isPhone(),DD=AD.isTablet(),BD=Zd({name:"silver.View",configFields:[vr("viewConfig")],partFields:[_d({factory:{sketch:function(t){var n=!1,e=et(t.buttons,function(e){return"group"===e.type?(n=!0,function(t,n){return{dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:et(t.buttons,function(t){return ED(t,n)})}}(e,t.providers)):ED(e,t.providers)});return{uid:t.uid,dom:{tag:"div",classes:[n?"tox-view__toolbar":"tox-view__header"].concat(w(MD||DD?["tox-view--mobile","tox-view--scrolling"]:[]))},behaviours:Cu([zp.config({}),Cp.config({mode:"flow",selector:"button, .tox-button",focusInside:Tl.OnEnterOrSpaceMode})]),components:n?e:[UC.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),UC.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:e})]}}},schema:[vr("buttons"),vr("providers")],name:"header"}),_d({factory:{sketch:function(t){return{uid:t.uid,behaviours:Cu([zp.config({}),Wv.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}}}},schema:[],name:"pane"})],factory:function(t,n,e,o){var r={getPane:function(n){return JA.getPart(n,t,"pane")},getOnShow:function(n){return t.viewConfig.onShow},getOnHide:function(n){return t.viewConfig.onHide}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Cu([zp.config({}),Cp.config({mode:"cyclic",focusInside:Tl.OnEnterOrSpaceMode})]),apis:r}},apis:{getPane:function(t,n){return t.getPane(n)},getOnShow:function(t,n){return t.getOnShow(n)},getOnHide:function(t,n){return t.getOnHide(n)}}}),ID=function(t,n,e){return Dt(n,function(n,o){var r=sr(cr("view",TD,n));return t.slot(o,BD.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[].concat(w(r.buttons.length>0?[BD.parts.header({buttons:r.buttons,providers:e})]:[]),[BD.parts.pane({})])}))})},FD=function(t,n){return AM.sketch(function(e){return{dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:ID(e,t,n),slotBehaviours:sw([fu(function(t){return AM.hideAllSlots(t)})])}})},RD=function(t){return ct(AM.getSlotNames(t),function(n){return AM.isShowing(t,n)})},ND=function(t,n,e){AM.getSlot(t,n).each(function(t){BD.getPane(t).each(function(n){var o;e(t)((o=n.element.dom,{getContainer:N(o)}))})})},LD=Qd({factory:function(t,n){var e={setViews:function(t,e){Bp.set(t,[FD(e,n.backstage.shared.providers)])},whichView:function(t){return om.getCurrent(t).bind(RD)},toggleView:function(t,n,e,o){return om.getCurrent(t).exists(function(r){var i=RD(r),u=i.exists(function(t){return o===t}),a=AM.getSlot(r,o).isSome();return a&&(AM.hideAllSlots(r),u?(function(t){var n=t.element;Yn(n,"display","none"),Pn(n,"aria-hidden","true")}(t),n()):(e(),function(t){var n=t.element;ne(n,"display"),jn(n,"aria-hidden")}(t),AM.showSlot(r,o),function(t,n){ND(t,n,BD.getOnShow)}(r,o)),i.each(function(t){return function(t,n){return ND(t,n,BD.getOnHide)}(r,t)})),a})}};return{uid:t.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:Cu([Bp.config({}),om.config({find:function(t){var n=Bp.contents(t);return yt(n)}})]),apis:e}},name:"silver.ViewWrapper",configFields:[vr("backstage")],apis:{setViews:function(t,n,e){return t.setViews(n,e)},toggleView:function(t,n,e,o,r){return t.toggleView(n,e,o,r)},whichView:function(t,n){return t.whichView(n)}}}),zD=$A.optional({factory:kM,name:"menubar",schema:[vr("backstage")]}),PD=$A.optional({factory:{sketch:function(t){return nM.sketch({uid:t.uid,dom:t.dom,listBehaviours:Cu([Cp.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return SD({type:t.type,uid:Wa("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),G.some(!0)}})},setupItem:function(t,n,e,o){rM.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[vr("dom"),vr("onEscape")]}),VD=$A.optional({factory:{sketch:function(t){var n=function(t){return t.type===yh.sliding?wD:t.type===yh.floating?xD:SD}(t);return n({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),G.some(!0)},onToggled:function(n,e){return t.onToolbarToggled(e)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}}
2,name:"toolbar",schema:[vr("dom"),vr("onEscape"),vr("getSink")]}),HD=$A.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?vM:aM;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:Cu(e(n,t.sharedBackstage))}}},name:"header",schema:[vr("dom")]}),UD=$A.optional({factory:{sketch:function(t){return{uid:t.uid,dom:t.dom,components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:"â¡ï¸Upgrade"}}]}}},name:"promotion",schema:[vr("dom")]}),WD=$A.optional({name:"socket",schema:[vr("dom")]}),jD=$A.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Cu([Wv.config({}),zp.config({}),HT.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){om.getCurrent(t).each(AM.hideAllSlots),Xi(t,LM)},onGrown:function(t){Xi(t,LM)},onStartGrow:function(t){Ki(t,NM,{width:Qn(t.element,"width").getOr("")})},onStartShrink:function(t){Ki(t,NM,{width:me(t.element)+"px"})}}),Bp.config({}),om.config({find:function(t){var n=Bp.contents(t);return yt(n)}})])}],behaviours:Cu([b_(0),Ip("sidebar-sliding-events",[ou(NM,function(t,n){Yn(t.element,"width",n.event.width)}),ou(LM,function(t,n){ne(t.element,"width")})])])}}},name:"sidebar",schema:[vr("dom")]}),GD=$A.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Cu([Bp.config({}),VM.config({focus:!1}),om.config({find:function(t){return yt(t.components())}})]),components:[]}}},name:"throbber",schema:[vr("dom")]}),qD=$A.optional({factory:LD,name:"viewWrapper",schema:[vr("backstage")]}),YD=$A.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:t.components}}},name:"editorContainer",schema:[]}),XD=Zd({name:"OuterContainer",factory:function(t,n,e){var o=!1,r=function(t){(function(t,n){return function(t){var e=t.dom;return e.parentNode?Tc(tn(e.parentNode),function(e){return!hn(t,e)&&mn(e,n)}):G.none()}(t)})(t,".tox-statusbar").each(function(t){"none"===Jn(t,"display")&&"true"===Hn(t,"aria-hidden")?(ne(t,"display"),jn(t,"aria-hidden")):(Yn(t,"display","none"),Pn(t,"aria-hidden","true"))})},i={getSocket:function(n){return JA.getPart(n,t,"socket")},setSidebar:function(n,e,o){JA.getPart(n,t,"sidebar").each(function(t){return function(t,n,e){om.getCurrent(t).each(function(o){Bp.set(o,[IM(n)]);var r=null==e?void 0:e.toLowerCase();f(r)&&Rt(n,r)&&om.getCurrent(o).each(function(n){AM.showSlot(n,r),HT.immediateGrow(o),ne(o.element,"width"),FM(t.element,"region")})})}(t,e,o)})},toggleSidebar:function(n,e){JA.getPart(n,t,"sidebar").each(function(t){return function(t,n){om.getCurrent(t).each(function(e){om.getCurrent(e).each(function(o){HT.hasGrown(e)?AM.isShowing(o,n)?(HT.shrink(e),FM(t.element,"presentation")):(AM.hideAllSlots(o),AM.showSlot(o,n),FM(t.element,"region")):(AM.hideAllSlots(o),AM.showSlot(o,n),HT.grow(e),FM(t.element,"region"))})})}(t,e)})},whichSidebar:function(n){return JA.getPart(n,t,"sidebar").bind(RM).getOrNull()},getHeader:function(n){return JA.getPart(n,t,"header")},getToolbar:function(n){return JA.getPart(n,t,"toolbar")},setToolbar:function(n,e){JA.getPart(n,t,"toolbar").each(function(t){var n=et(e,vD);t.getApis().setGroups(t,n)})},setToolbars:function(n,e){JA.getPart(n,t,"multiple-toolbar").each(function(t){var n=et(e,function(t){return et(t,vD)});nM.setItems(t,n)})},refreshToolbar:function(n){JA.getPart(n,t,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(n){JA.getPart(n,t,"toolbar").each(function(t){Vt(t.getApis().toggle,function(n){return n(t)})})},toggleToolbarDrawerWithoutFocusing:function(n){JA.getPart(n,t,"toolbar").each(function(t){Vt(t.getApis().toggleWithoutFocusing,function(n){return n(t)})})},isToolbarDrawerToggled:function(n){return JA.getPart(n,t,"toolbar").bind(function(t){return G.from(t.getApis().isOpen).map(function(n){return n(t)})}).getOr(!1)},getThrobber:function(n){return JA.getPart(n,t,"throbber")},focusToolbar:function(n){JA.getPart(n,t,"toolbar").orThunk(function(){return JA.getPart(n,t,"multiple-toolbar")}).each(function(t){Cp.focusIn(t)})},setMenubar:function(n,e){JA.getPart(n,t,"menubar").each(function(t){kM.setMenus(t,e)})},focusMenubar:function(n){JA.getPart(n,t,"menubar").each(function(t){kM.focus(t)})}
2,setViews:function(n,e){JA.getPart(n,t,"viewWrapper").each(function(t){LD.setViews(t,e)})},toggleView:function(n,e){return JA.getPart(n,t,"viewWrapper").exists(function(t){return LD.toggleView(t,function(){return i.showMainView(n)},function(){return i.hideMainView(n)},e)})},whichView:function(n){return JA.getPart(n,t,"viewWrapper").bind(LD.whichView).getOrNull()},hideMainView:function(n){(o=i.isToolbarDrawerToggled(n))&&i.toggleToolbarDrawer(n),JA.getPart(n,t,"editorContainer").each(function(t){var n=t.element;r(n),Yn(n,"display","none"),Pn(n,"aria-hidden","true")})},showMainView:function(n){o&&i.toggleToolbarDrawer(n),JA.getPart(n,t,"editorContainer").each(function(t){var n=t.element;r(n),ne(n,"display"),jn(n,"aria-hidden")})}};return{uid:t.uid,dom:t.dom,components:n,apis:i,behaviours:t.behaviours}},configFields:[vr("dom"),vr("behaviours")],partFields:[HD,zD,VD,PD,WD,jD,UD,GD,qD,YD],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e,o){t.setSidebar(n,e,o)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){t.setToolbar(n,e)},setToolbars:function(t,n,e){t.setToolbars(n,e)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},toggleToolbarDrawer:function(t,n){t.toggleToolbarDrawer(n)},toggleToolbarDrawerWithoutFocusing:function(t,n){t.toggleToolbarDrawerWithoutFocusing(n)},isToolbarDrawerToggled:function(t,n){return t.isToolbarDrawerToggled(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)},setViews:function(t,n,e){t.setViews(n,e)},toggleView:function(t,n,e){return t.toggleView(n,e)},whichView:function(t,n){return t.whichView(n)}}}),KD={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},JD=function(t){return t.split(" ")},$D=function(t,n){var e=_(_({},KD),n.menus),o=Ct(n.menus).length>0,r=void 0===n.menubar||!0===n.menubar?JD("file edit view insert format tools table help"):JD(!1===n.menubar?"":n.menubar),i=it(r,function(t){var e=Rt(KD,t);return o?e||Ft(n.menus,t).exists(function(t){return Rt(t,"items")}):e}),u=et(i,function(o){var r=e[o];return function(t,n,e){var o=Uh(e).split(/[ ,]/);return{text:t.title,getItems:function(){return ft(t.items,function(t){var e=t.toLowerCase();return 0===e.trim().length||Z(o,function(t){return t===e})?[]:"separator"===e||"|"===e?[{type:"separator"}]:n.menuItems[e]?[n.menuItems[e]]:[]})}}}({title:r.title,items:JD(r.items)},n,t)});return it(u,function(t){return t.getItems().length>0&&Z(t.getItems(),function(t){return f(t)||"separator"!==t.type})})},QD=function(t,n,e){return t.on("remove",function(){return e.unload(n)}),e.load(n)},ZD=function(t,n,e,o){return t.on("remove",function(){return o.unloadRawCss(n)}),o.loadRawCss(n,e)},tB=function(){var t=p(i().mark(function t(n,e){var o,r,u;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o="ui/"+bv(n).getOr("default")+"/skin.css",r=tinymce.Resource.get(o),f(r)){t.next=4;break}return u=n.editorManager.suffix,t.abrupt("return",QD(n,e+"/skin".concat(u,".css"),n.ui.styleSheetLoader));case 4:ZD(n,o,r,n.ui.styleSheetLoader);case 5:case"end":return t.stop()}},t)}));return function(n,e){return t.apply(this,arguments)}}(),nB=function(){var t=p(i().mark(function t(n,e){var o,r,u,a;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=tn(n.getElement()),!In(o).isSome()){t.next=6;break}if(r="ui/"+bv(n).getOr("default")+"/skin.shadowdom.css",u=tinymce.Resource.get(r),f(u)){t.next=5;break}return a=n.editorManager.suffix,t.abrupt("return",QD(n,e+"/skin.shadowdom".concat(a,".css"),Oh.DOM.styleSheetLoader));case 5:ZD(n,r,u,Oh.DOM.styleSheetLoader);case 6:case"end":return t.stop()}},t)}));return function(n,e){return t.apply(this,arguments)}}(),eB=function(t,n){return(e=p(i().mark(function t(n,e){var o,r;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=function(){var t=vv(e),o=e.editorManager.suffix;t&&e.contentCSS.push(t+(n?"/content.inline":"/content")+"".concat(o,".css"))},bv(e).fold(o,function(t){var r="ui/"+t+(n?"/content.inline":"/content")+".css",i=tinymce.Resource.get(r);f(i)?ZD(e,r,i,e.ui.styleSheetLoader):o()}),r=vv(e),pv(e)||!f(r)){t.next=5;break}return t.abrupt("return",Promise.all([tB(e,r),nB(e,r)]).then());case 5:case"end":return t.stop()}},t)})),function(t,n){return e.apply(this,arguments)})(t,n).then(function(t){var n=function(){t._skinLoaded=!0,function(t){t.dispatch("SkinLoaded")}(t)};return function(){t.initialized?n():t.on("init",n)}}(n),function(t){return function(){return function(t){t.dispatch("SkinLoadError",{message:"Skin could not be loaded"})}(t)}}(n));var e},oB=P(eB,!1),rB=P(eB,!0),iB=function(t,n,e){return Kt(e)?t.translate(n):t.translate([n,t.translate(e)])},uB=function(t,n){var e=function(e,r,i,u){var a=t.shared.providers.translate(e.title);if("separator"===e.type)return G.some({type:"separator",text:a});if("submenu"===e.type){var c=ft(e.getStyleItems(),function(t){return o(t,r,u)});return 0===r&&c.length<=0?G.none():G.some({type:"nestedmenuitem",text:a,enabled:c.length>0,getSubmenuItems:function(){return ft(e.getStyleItems(),function(t){return o(t,r,u)})}})}return G.some(_({type:"togglemenuitem",text:a,icon:e.icon,active:e.isSelected(u),enabled:!i,onAction:n.onAction(e)},e.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})))},o=function(t,o,r){var i="formatter"===t.type&&n.isInvalid(t);return 0===o?i?[]:e(t,o,!1,r).toArray():e(t,o,i,r).toArray()},r=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return ft(t,function(t){return o(t,r,e)}
2)};return{validateItems:r,getFetch:function(t,n){return function(e,o){var i=n(),u=r(i);o(dT(u,gy.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:G.none()}))}}}},aB=function(t,n){var e=n.dataset,o="basic"===e.type?function(){return et(e.data,function(t){return SA(t,n.isSelectedFor,n.getPreviewFor)})}:e.getData;return{items:uB(t,n),getStyleItems:o}},cB=function(t,n,e,o,r,i){var u=aB(n,e),a=u.items,c=u.getStyleItems,s=ho(e.tooltip);return cT({context:"mode:design",text:e.icon.isSome()?G.none():e.text,icon:e.icon,ariaLabel:G.some(e.tooltip),tooltip:G.none(),role:G.none(),fetch:a.getFetch(n,c),onSetup:function(n){var i=function(e){return n.setTooltip(iB(t,o(e.value),e.value))};return t.on(r,i),cS(fS(t,"NodeChange",function(n){var o=n.getComponent();e.updateText(o),vm.set(n.getComponent(),!t.selection.isEditable())})(n),function(){return t.off(r,i)})},getApi:function(t){return{getComponent:N(t),setTooltip:function(e){var o=n.shared.providers.translate(e);Pn(t.element,"aria-label",o),s.set(e)}}},columns:1,presets:"normal",classes:e.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[tb.config(_({},n.shared.providers.tooltips.getConfig({tooltipText:n.shared.providers.translate(e.tooltip),onShow:function(t){if(e.tooltip!==s.get()){var o=n.shared.providers.translate(s.get());tb.setComponents(t,n.shared.providers.tooltips.getComponents({tooltipText:o}))}}})))]},"tox-tbtn",n.shared,i)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(AC||(AC={}));var sB,lB=function(t,n,e){var o,r=(o=function(t,n){return n===AC.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.options.get(n),e),et(o,function(t){var n=t,e=t,o=t.split("=");return o.length>1&&(n=o[0],e=o[1]),{title:n,format:e}}));return{type:"basic",data:r}},fB=N("Alignment {0}"),dB="left",mB=[{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"}],gB=function(t){var n={type:"basic",data:mB};return{tooltip:iB(t,fB(),dB),text:G.none(),icon:G.some("align-left"),isSelectedFor:function(n){return function(){return t.formatter.match(n)}},getCurrentValue:G.none,getPreviewFor:function(t){return G.none},onAction:function(n){return function(){return ct(mB,function(t){return t.format===n.format}).each(function(n){return t.execCommand(n.command)})}},updateText:function(n){var e=ct(mB,function(n){return t.formatter.match(n.format)}).fold(N(dB),function(t){return t.title.toLowerCase()});Ki(n,aT,{icon:"align-".concat(e)}),function(t,n){t.dispatch("AlignTextUpdate",n)}(t,{value:e})},dataset:n,shouldHide:!1,isInvalid:function(n){return!t.formatter.canApply(n.format)}}},pB=function(t,n){var e=n(),o=et(e,function(t){return t.format});return G.from(t.formatter.closest(o)).bind(function(t){return ct(e,function(n){return n.format===t})})},hB=N("Block {0}"),vB="Paragraph",bB=function(t){var n=lB(t,"block_formats",AC.SemiColon);return{tooltip:iB(t,hB(),vB),text:G.some(vB),icon:G.none(),isSelectedFor:function(n){return function(){return t.formatter.match(n)}},getCurrentValue:G.none,getPreviewFor:function(n){return function(){var e=t.formatter.get(n);return e?G.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(n))}):G.none()}},onAction:dS(t),updateText:function(e){var o=pB(t,function(){return n.data}).fold(N(vB),function(t){return t.title});Ki(e,uT,{text:o}),function(t,n){t.dispatch("BlocksTextUpdate",n)}(t,{value:o})},dataset:n,shouldHide:!1,isInvalid:function(n){return!t.formatter.canApply(n.format)}}},yB=N("Font {0}"),xB="System Font",wB=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],SB=function(t){var n=t.split(/\s*,\s*/);return et(n,function(t){return t.replace(/^['"]+|['"]+$/g,"")})},CB=function(t,n){return n.length>0&&dt(n,function(n){return t.indexOf(n.toLowerCase())>-1})},kB=function(t){var n=function(){var n=function(t){return t?SB(t)[0]:""},o=t.queryCommandValue("FontName"),r=e.data,i=o?o.toLowerCase():"",u=gv(t),a=ct(r,function(t){var e=t.format;return e.toLowerCase()===i||n(e).toLowerCase()===n(i).toLowerCase()}).orThunk(function(){return Ht(function(t,n){if(0===t.indexOf("-apple-system")||n.length>0){var e=SB(t.toLowerCase());return CB(e,wB)||CB(e,n)}return!1}(i,u),{title:xB,format:i})});return{matchOpt:a,font:o}},e=lB(t,"font_family_formats",AC.SemiColon);return{tooltip:iB(t,yB(),xB),text:G.some(xB),icon:G.none(),isSelectedFor:function(t){return function(n){return n.exists(function(n){return n.format===t})}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return G.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}}
2,onAction:function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontName",!1,n.format)})}},updateText:function(e){var o=n(),r=o.matchOpt,i=o.font,u=r.fold(N(i),function(t){return t.title});Ki(e,uT,{text:u}),function(t,n){t.dispatch("FontFamilyTextUpdate",n)}(t,{value:u})},dataset:e,shouldHide:!1,isInvalid:W}},OB={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:[""]},_B=function(){var t="[0-9]+",n="[eE][+-]?"+t,e=function(t){return"(?:".concat(t,")?")},o=["Infinity",t+"\\."+e(t)+e(n),"\\."+t+e(n),t+e(n)].join("|");return new RegExp("^([+-]?(?:".concat(o,"))(.*)$"))}(),TB=function(t,n){return G.from(_B.exec(t)).bind(function(t){var e=Number(t[1]),o=t[2];return function(t,n){return Z(n,function(n){return Z(OB[n],function(n){return t===n})})}(o,n)?G.some({value:e,unit:o}):G.none()})},EB={tab:N(9),escape:N(27),enter:N(13),backspace:N(8),delete:N(46),left:N(37),up:N(38),right:N(39),down:N(40),space:N(32),home:N(36),end:N(35),pageUp:N(33),pageDown:N(34)},AB=N("Font size {0}"),MB="12pt",DB={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},BB={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},IB=function(t){var n=function(){var n=G.none(),e=o.data,r=t.queryCommandValue("FontSize");if(r)for(var i=function(){var t=function(t,n){return/[0-9.]+px$/.test(t)?function(t,n){var e=Math.pow(10,n);return Math.round(t*e)/e}(72*parseInt(t,10)/96,n||0)+"pt":Ft(BB,t).getOr(t)}(r,u),o=function(t){return Ft(DB,t).getOr("")}(t);n=ct(e,function(n){return n.format===r||n.format===t||n.format===o})},u=3;n.isNone()&&u>=0;u--)i();return{matchOpt:n,size:r}},e=N(G.none),o=lB(t,"font_size_formats",AC.Space);return{tooltip:iB(t,AB(),MB),text:G.some(MB),icon:G.none(),isSelectedFor:function(t){return function(n){return n.exists(function(n){return n.format===t})}},getPreviewFor:e,getCurrentValue:function(){return n().matchOpt},onAction:function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontSize",!1,n.format)})}},updateText:function(e){var o=n(),r=o.matchOpt,i=o.size,u=r.fold(N(i),function(t){return t.title});Ki(e,uT,{text:u}),function(t,n){t.dispatch("FontSizeTextUpdate",n)}(t,{value:u})},dataset:o,shouldHide:!1,isInvalid:W}},FB=function(t){return Kt(t)?"Formats":"Format {0}"},RB=function(t,n){var e="Formats";return{tooltip:iB(t,FB(""),""),text:G.some(e),icon:G.none(),isSelectedFor:function(n){return function(){return t.formatter.match(n)}},getCurrentValue:G.none,getPreviewFor:function(n){return function(){var e=t.formatter.get(n);return void 0!==e?G.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(n))}):G.none()}},onAction:dS(t),updateText:function(n){var o=function(t){return vA(t)?ft(t.items,o):bA(t)?[{title:t.title,format:t.format}]:[]},r=ft(wA(t),o),i=pB(t,N(r)).fold(N({title:e,tooltipLabel:""}),function(t){return{title:t.title,tooltipLabel:t.title}});Ki(n,uT,{text:i.title}),function(t,n){t.dispatch("StylesTextUpdate",n)}(t,{value:i.tooltipLabel})},shouldHide:Vh(t),isInvalid:function(n){return!t.formatter.canApply(n.format)},dataset:n}},NB=N([vr("toggleClass"),vr("fetch"),Da("onExecute"),Ir("getHotspot",G.some),Ir("getAnchorOverrides",N({})),nl(),Da("onItemExecute"),Or("lazySink"),vr("dom"),Aa("onOpen"),$f("splitDropdownBehaviours",[rC,Cp,zp]),Ir("matchWidth",!1),Ir("useMinWidth",!1),Ir("eventOrder",{}),Or("role"),Or("listRole")].concat(wC())),LB=kd({factory:zv,schema:[vr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Cu([zp.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(t.uid).each(Ji)},buttonBehaviours:Cu([qp.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),zB=kd({factory:zv,schema:[vr("dom")],name:"button",defaults:function(){return{buttonBehaviours:Cu([zp.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(t.uid).each(function(e){t.onExecute(e,n)})}}}}),PB=N([LB,zB,_d({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[vr("text")],name:"aria-descriptor"}),Od({schema:[_a()],name:"menu",defaults:function(t){return{onExecute:function(n,e){n.getSystem().getByUid(t.uid).each(function(o){t.onItemExecute(o,n,e)})}}}}),dC()]),VB=Zd({name:"SplitDropdown",configFields:NB(),partFields:PB(),factory:function(t,n,e,o){var r=function(t){om.getCurrent(t).each(function(t){Tm.highlightFirst(t),Cp.focusIn(t)})},i=function(n){hC(t,L,n,o,r,Jm.HighlightMenuAndItem).get(I)},u=function(n){var e=Pd(n,t,"button");return Ji(e),G.some(!0)},a=_(_({},tu([fu(function(n,e){zd(n,t,"aria-descriptor").each(function(t){var e=Wa("aria");Pn(t.element,"id",e),Pn(n.element,"aria-describedby",e)})})])),Xp(G.some(i))),c={repositionMenus:function(t){qp.isOn(t)&&xC(t)}};return{uid:t.uid,dom:t.dom,components:n,apis:c,eventOrder:_(_({},t.eventOrder),{},T({},_i(),["disabling","toggling","alloy.base.behaviour"])),events:a,behaviours:Zf(t.splitDropdownBehaviours,[rC.config({others:{sandbox:function(n){var e=Pd(n,t,"arrow");return yC(t,n,{onOpen:function(){qp.on(e),qp.on(n)},onClose:function(){qp.off(e),qp.off(n)}})}}}),Cp.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),G.some(!0)}}),zp.config({}
2),qp.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,n){return t.repositionMenus(n)}}}),HB=function(t){return{isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)},setText:function(n){return Ki(t,uT,{text:n})},setIcon:function(n){return Ki(t,aT,{icon:n})}}},UB=function(t){return{setActive:function(n){qp.set(t,n)},isActive:function(){return qp.isOn(t)},isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)},setText:function(n){return Ki(t,uT,{text:n})},setIcon:function(n){return Ki(t,aT,{icon:n})}}},WB=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t)}}).getOr({})},jB=Wa("focus-button"),GB=function(t,n,e,o,r,i,u){var a=n.map(function(t){return Vv(iT(t,"tox-tbtn",r))}),c=t.map(function(t){return Vv(rT(t,r.icons))});return{dom:{tag:"button",classes:["tox-tbtn"].concat(n.isSome()?["tox-tbtn--select"]:[]),attributes:_(_({},WB(e,r)),O(u)?{"data-mce-name":u}:{})},components:Cw([c.map(function(t){return t.asSpec()}),a.map(function(t){return t.asSpec()})]),eventOrder:T(T({},ri(),["focusing","alloy.base.behaviour",Z_]),Li(),[Z_,"toolbar-group-button-events"]),buttonBehaviours:Cu([mw(function(){return r.checkUiComponentContext(i).shouldDisable}),xw(function(){return r.checkUiComponentContext(i)}),Ip(Z_,[fu(function(t,n){return nT(t)}),ou(uT,function(t,n){a.bind(function(n){return n.getOpt(t)}).each(function(t){Bp.set(t,[bc(r.translate(n.event.text))])})}),ou(aT,function(t,n){c.bind(function(n){return n.getOpt(t)}).each(function(t){Bp.set(t,[rT(n.event.icon,r.icons)])})}
2),ou(ri(),function(t,n){n.event.prevent(),Xi(t,jB)})])].concat(o.getOr([])))}},qB=function(t,n,e,o){var r,i,u=ho(I),a=GB(t.icon,t.text,t.tooltip,G.none(),e,t.context,o);return zv.sketch({dom:a.dom,components:a.components,eventOrder:tT,buttonBehaviours:_(_({},Cu([Ip("toolbar-button-events",[(i={onAction:t.onAction,getApi:n.getApi},gu(function(t,n){gw(i,t)(function(n){Ki(t,Q_,{buttonApi:n}),i.onAction(n)})})),pw(n,u),hw(n,u)])].concat(w(t.tooltip.map(function(n){return tb.config(e.tooltips.getConfig({tooltipText:e.translate(n)+t.shortcut.map(function(t){return" (".concat(_w(t),")")}).getOr("")}))}).toArray()),[mw(function(){return!t.enabled||e.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return e.checkUiComponentContext(t.context)})]).concat(n.toolbarButtonBehaviours))),{},T({},Z_,null===(r=a.buttonBehaviours)||void 0===r?void 0:r[Z_]))})},YB=function(t,n,e,o){return qB(t,{toolbarButtonBehaviours:e.length>0?[Ip("toolbarButtonWith",e)]:[],getApi:HB,onSetup:t.onSetup},n,o)},XB=function(t,n,e,o){return qB(t,{toolbarButtonBehaviours:[Bp.config({}),qp.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(e.length>0?[Ip("toolbarToggleButtonWith",e)]:[]),getApi:UB,onSetup:t.onSetup},n,o)},KB=function(t,n,e){return function(o){return sC(function(t){return n.fetch(t)}).map(function(r){return G.from(DC(Io(GS(Wa("menu-value"),r,function(e){n.onItemAction(t(o),e)},n.columns,n.presets,gy.CLOSE_ON_EXECUTE,n.select.getOr(W),e),{movement:YS(n.columns,n.presets),menuBehaviours:sw("auto"!==n.columns?[]:[fu(function(t,e){cw(t,4,_y(n.presets)).each(function(n){var e=n.numRows,o=n.numColumns;Cp.setGridSize(t,e,o)})})])})))})}},JB=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],$B=function(t,n){return function(e,o,r,i){var u=t(e).mapError(function(t){return fr(t)}).getOrDie();return n(u,o,r,i)}},QB={button:$B(Fx,function(t,n,e,o){return function(t,n,e){return YB(t,n,[],e)}(t,n.shared.providers,o)}),togglebutton:$B(Lx,function(t,n,e,o){return function(t,n,e){return XB(t,n,[],e)}(t,n.shared.providers,o)}),menubutton:$B(SM,function(t,n,e,o){return WT(t,"tox-tbtn",n,G.none(),!1,o)}),splitbutton:$B(function(t){return cr("SplitButton",CM,t)},function(t,n,e,o){return function(t,n,e){var o=ho(t.tooltip.getOr("")),r=function(t){return{isEnabled:function(){return!vm.isDisabled(t)},setEnabled:function(n){return vm.set(t,!n)},setIconFill:function(n,e){Dc(t.element,'svg path[class="'.concat(n,'"], rect[class="').concat(n,'"]')).each(function(t){Pn(t,"fill",e)})},setActive:function(n){Pn(t.element,"aria-pressed",n),Dc(t.element,"span").each(function(e){t.getSystem().getByDom(e).each(function(t){return qp.set(t,n)})})},isActive:function(){return Dc(t.element,"span").exists(function(n){return t.getSystem().getByDom(n).exists(qp.isOn)})},setText:function(n){return Dc(t.element,"span").each(function(e){return t.getSystem().getByDom(e).each(function(t){return Ki(t,uT,{text:n})})})},setIcon:function(n){return Dc(t.element,"span").each(function(e){return t.getSystem().getByDom(e).each(function(t){return Ki(t,aT,{icon:n})})})},setTooltip:function(e){var r=n.providers.translate(e);Pn(t.element,"aria-label",r),o.set(e)}}},i=ho(I),u={getApi:r,onSetup:t.onSetup};return VB.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:_(_({"aria-pressed":!1},WB(t.tooltip,n.providers)),O(e)?{"data-mce-name":e}:{})},onExecute:function(n){var e=r(n);e.isEnabled()&&t.onAction(e)},onItemExecute:function(t,n,e){},splitDropdownBehaviours:Cu([Ip("split-dropdown-events",[fu(function(t,n){return nT(t)}),ou(jB,zp.focus),pw(u,i),hw(u,i)]),dw(function(){return n.providers.isDisabled()||n.providers.checkUiComponentContext(t.context).shouldDisable}),xw(function(){return n.providers.checkUiComponentContext(t.context)}
2),vk.config({})].concat(w(t.tooltip.map(function(t){return tb.config(_({},n.providers.tooltips.getConfig({tooltipText:n.providers.translate(t),onShow:function(e){if(o.get()!==t){var r=n.providers.translate(o.get());tb.setComponents(e,n.providers.tooltips.getComponents({tooltipText:r}))}}})))}).toArray()))),eventOrder:T(T({},Li(),["alloy.base.behaviour","split-dropdown-events","tooltipping"]),zi(),["split-dropdown-events","tooltipping"]),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:KB(r,t,n.providers),parts:{menu:By(0,t.columns,t.presets)},components:[VB.parts.button(GB(t.icon,t.text,G.none(),G.some([qp.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1}),mw(W),xw(N({contextType:"any",shouldDisable:!1}))]),n.providers,t.context)),VB.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:ay("chevron-down",n.providers.icons)},buttonBehaviours:Cu([dw(W),xw(N({contextType:"any",shouldDisable:!1}))])}),VB.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(t,n.shared,o)}),grouptoolbarbutton:$B(function(t){return cr("GroupToolbarButton",yM,t)},function(t,n,e,o){var r=e.ui.registry.getAll().buttons,i=T({},Zs,n.shared.header.isPositionedAtTop()?Ms.TopToBottom:Ms.BottomToTop);if(Wh(e)===yh.floating)return function(t,n,e,o,r){var i=n.shared,u=ho(I),a={toolbarButtonBehaviours:[],getApi:HB,onSetup:t.onSetup},c=[Ip("toolbar-group-button-events",[pw(a,u),hw(a,u)])];return rD.sketch({lazySink:i.getSink,fetch:function(){return sC(function(n){n(et(e(t.items),vD))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:GB(t.icon,t.text,t.tooltip,G.some(c),i.providers,t.context,r),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:o}}}})}(t,n,function(t){return tI(e,{buttons:r,toolbar:t,allowToolbarGroups:!1},n,G.none())},i,o);throw new Error("Toolbar groups are only supported when using floating toolbar mode")})},ZB={styles:function(t,n){var e=_({type:"advanced"},n.styles);return cB(t,n,RB(t,e),FB,"StylesTextUpdate","styles")},fontsize:function(t,n){return cB(t,n,IB(t),AB,"FontSizeTextUpdate","fontsize")},fontsizeinput:function(t,n){return function(t,n,e,o){var r=G.none(),i=fS(t,"NodeChange SwitchMode",function(n){var o=n.getComponent();r=G.some(o),e.updateInputValue(o),vm.set(o,!t.selection.isEditable())}),u=function(t){return{getComponent:N(t)}},a=ho(I),c=Wa("custom-number-input-events"),s=function(t,n,o){var i=r.map(function(t){return Jf.getValue(t)}).getOr(""),u=e.getNewValue(i,t),a=i.length-"".concat(u).length,c=r.map(function(t){return t.element.dom.selectionStart-a}),s=r.map(function(t){return t.element.dom.selectionEnd-a});e.onAction(u,o),r.each(function(t){Jf.setValue(t,u),n&&(c.each(function(n){return t.element.dom.selectionStart=n}),s.each(function(n){return t.element.dom.selectionEnd=n}))})},l=function(t,n){return s(function(t,n){return t-n},t,n)},f=function(t,n){return s(function(t,n){return t+n},t,n)},d=function(t){return Cn(t.element).fold(G.none,function(t){return bs(t),G.some(!0)})},m=function(t){return xs(t.element)?(Tn(t.element).each(function(t){return bs(t)}),G.some(!0)):G.none()},g=function(e,o,r,i){var a=ho(I),c=n.shared.providers.translate(r),s=Wa("altExecuting"),l=fS(t,"NodeChange SwitchMode",function(n){vm.set(n.getComponent(),!t.selection.isEditable())}),f=function(t){vm.isDisabled(t)||e(!0)};return zv.sketch({dom:{tag:"button",attributes:{"aria-label":c,"data-mce-name":o},classes:i.concat(o)},components:[oT(o,n.shared.providers.icons)],buttonBehaviours:Cu([vm.config({}),tb.config(n.shared.providers.tooltips.getConfig({tooltipText:c})),Ip(s,[pw({onSetup:l,getApi:u},a),hw({getApi:u},a),ou(fi(),function(t,n){n.event.raw.keyCode!==EB.space()&&n.event.raw.keyCode!==EB.enter()||vm.isDisabled(t)||e(!1)}),ou(pi(),f),ou(ei(),f)])]),eventOrder:T(T(T(T(T({},fi(),[s,"keying"]),pi(),[s,"alloy.base.behaviour"]),ei(),[s,"alloy.base.behaviour"]),Li(),["alloy.base.behaviour",s,"tooltipping"]),zi(),[s,"tooltipping"])})},p=Vv(g(function(t){return l(!1,t)},"minus","Decrease font size",[])),h=Vv(g(function(t){return f(!1,t)},"plus","Increase font size",[])),v=Vv({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[Ly.sketch({inputBehaviours:Cu([vm.config({}),Ip(c,[pw({onSetup:i,getApi:u},a),hw({getApi:u},a)]),Ip("input-update-display-text",[ou(uT,function(t,n){Jf.setValue(t,n.event.text)}),ou(li(),function(t){e.onAction(Jf.getValue(t))}),ou(gi(),function(t){e.onAction(Jf.getValue(t))})]),Cp.config({mode:"special",onEnter:function(t){return s(L,!0,!0),G.some(!0)},onEscape:d,onUp:function(t){return f(!0,!1),G.some(!0)},onDown:function(t){return l(!0,!1),G.some(!0)},onLeft:function(t,n){return n.cut(),G.none()},onRight:function(t,n){return n.cut(),G.none()}})])})],behaviours:Cu([zp.config({}),Cp.config({mode:"special",onEnter:m,onSpace:m,onEscape:d}),Ip("input-wrapper-events",[ou(ci(),function(t){ot([p,h],function(n){var e=tn(n.get(t).element.dom);xs(e)&&ys(e)})})])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:_({}
2,O(o)?{"data-mce-name":o}:{})},components:[p.asSpec(),v.asSpec(),h.asSpec()],behaviours:Cu([zp.config({}),Cp.config({mode:"flow",focusInside:Tl.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:function(t){return xs(t.element)?G.none():(bs(t.element),G.some(!0))}})])}}(t,n,function(t){var n=function(){return t.queryCommandValue("FontSize")};return{updateInputValue:function(t){return Ki(t,uT,{text:n()})},onAction:function(n,e){return t.execCommand("FontSize",!1,n,{skip_focus:!e})},getNewValue:function(e,o){TB(e,["unsupportedLength","empty"]);var r=n(),i=TB(e,["unsupportedLength","empty"]).or(TB(r,["unsupportedLength","empty"])),u=i.map(function(t){return t.value}).getOr(16),a=tv(t),c=i.map(function(t){return t.unit}).filter(function(t){return""!==t}).getOr(a),s=o(u,function(t){var n;return null!==(n={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[t])&&void 0!==n?n:{step:1}}(c).step),l="".concat(function(t){return t>=0}(s)?s:u).concat(c);return l!==r&&function(t,n){t.dispatch("FontSizeInputTextUpdate",n)}(t,{value:l}),l}}}(t),"fontsizeinput")},fontfamily:function(t,n){return cB(t,n,kB(t),yB,"FontFamilyTextUpdate","fontfamily")},blocks:function(t,n){return cB(t,n,bB(t),hB,"BlocksTextUpdate","blocks")},align:function(t,n){return cB(t,n,gB(t),fB,"AlignTextUpdate","align")}},tI=function(t,n,e,o){var r=function(t){var n=t.toolbar,e=t.buttons;return!1===n?[]:void 0===n||!0===n?function(t){var n=et(JB,function(n){var e=it(n.items,function(n){return Rt(t,n)||Rt(ZB,n)});return{name:n.name,items:e}});return it(n,function(t){return t.items.length>0})}(e):f(n)?function(t){var n=t.split("|");return et(n,function(t){return{items:t.trim().split(" ")}})}(n):function(t){return B(t,function(t){return Rt(t,"name")&&Rt(t,"items")})}(n)?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}(n),i=et(r,function(r){var i=ft(r.items,function(r){return 0===r.trim().length?[]:function(t,n,e,o,r,i){return Ft(n,e.toLowerCase()).orThunk(function(){return i.bind(function(t){return St(t,function(t){return Ft(n,t+e.toLowerCase())})})}).fold(function(){return Ft(ZB,e.toLowerCase()).map(function(n){return n(t,r)})},function(n){return"grouptoolbarbutton"!==n.type||o?function(t,n,e,o){return Ft(QB,t.type).fold(function(){return console.error("skipping button defined by",t),G.none()},function(r){return G.some(r(t,n,e,o))})}(n,r,t,e.toLowerCase()):(console.warn("Ignoring the '".concat(e,"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.")),G.none())})}(t,n.buttons,r,n.allowToolbarGroups,e,o).toArray()});return{title:G.from(t.translate(r.name)),items:i}});return it(i,function(t){return t.items.length>0})},nI=function(t,n,e,o){var r=n.mainUi.outerContainer,i=e.toolbar,u=e.buttons;if(B(i,f)){var a=i.map(function(n){var r={toolbar:n,buttons:u,allowToolbarGroups:e.allowToolbarGroups};return tI(t,r,o,G.none())});XD.setToolbars(r,a)}else XD.setToolbar(r,tI(t,e,o,G.none()))},eI=Ge(),oI=eI.os.isiOS()&&eI.os.version.major<=12,rI=Object.freeze({__proto__:null,render:function(t,n,e,o,r){var i=n.mainUi,u=n.uiMotherships,a=ho(0),c=i.outerContainer;oB(t);var s=tn(r.targetNode),l=Bn(Dn(s));vf(s,i.mothership),function(t,n,e){Av(t)&&vf(e.mainUi.mothership.element,e.popupUi.mothership),hf(n,e.dialogUi.mothership)}(t,l,n),t.on("PostRender",function(){XD.setSidebar(c,e.sidebar,fv(t))}),t.on("SkinLoaded",function(){nI(t,n,e,o),a.set(t.getWin().innerWidth),XD.setMenubar(c,$D(t,e)),XD.setViews(c,e.views),function(t,n){var e=n.uiMotherships,o=t.dom,r=t.getWin(),i=t.getDoc().documentElement,u=ho(ce(r.innerWidth,r.innerHeight)),a=ho(ce(i.offsetWidth,i.offsetHeight)),c=function(){var n=u.get();n.left===r.innerWidth&&n.top===r.innerHeight||(u.set(ce(r.innerWidth,r.innerHeight)),iS(t))},s=function(){var n=t.getDoc().documentElement,e=a.get();e.left===n.offsetWidth&&e.top===n.offsetHeight||(a.set(ce(n.offsetWidth,n.offsetHeight)),iS(t))},l=function(n){!function(t,n){t.dispatch("ScrollContent",n)}(t,n)};o.bind(r,"resize",c),o.bind(r,"scroll",l);var f=zs(tn(t.getBody()),"load",s);t.on("hide",function(){ot(e,function(t){Yn(t.element,"display","none")})}),t.on("show",function(){ot(e,function(t){ne(t.element,"display")})}),t.on("NodeChange",s),t.on("remove",function(){f.unbind(),o.unbind(r,"resize",c),o.unbind(r,"scroll",l),r=null})}(t,n)});var f=XD.getSocket(c).getOrDie("Could not find expected socket element");
2if(oI){Xn(f.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var d=function(t){var n=null;return{cancel:function(){b(n)||(clearTimeout(n),n=null)},throttle:function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];b(n)&&(n=setTimeout(function(){n=null,t.apply(null,o)},20))}}}(function(){t.dispatch("ScrollContent")}),m=Ls(f.element,"scroll",d.throttle);t.on("remove",m.unbind)}yw(t,n),t.addCommand("ToggleSidebar",function(n,e){XD.toggleSidebar(c,e),function(t){t.dispatch("ToggleSidebar")}(t)}),t.addQueryValueHandler("ToggleSidebar",function(){var t;return null!==(t=XD.whichSidebar(c))&&void 0!==t?t:""}),t.addCommand("ToggleView",function(n,e){if(XD.toggleView(c,e)){var o=c.element;i.mothership.broadcastOn([Df()],{target:o}),ot(u,function(t){t.broadcastOn([Df()],{target:o})}),b(XD.whichView(c))&&(t.focus(),t.nodeChanged(),XD.refreshToolbar(c)),function(t){t.dispatch("ToggleView")}(t)}}),t.addQueryValueHandler("ToggleView",function(){var t;return null!==(t=XD.whichView(c))&&void 0!==t?t:""});var g=Wh(t);g!==yh.sliding&&g!==yh.floating||t.on("ResizeWindow ResizeEditor ResizeContent",function(){var e=t.getWin().innerWidth;e!==a.get()&&(XD.refreshToolbar(n.mainUi.outerContainer),a.set(e))});var p={setEnabled:function(t){bw(n,t?"setEnabled":"setDisabled")},isEnabled:function(){return!vm.isDisabled(c)}};return{iframeContainer:f.element.dom,editorContainer:c.element.dom,api:p}}}),iI=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?G.some(parseInt(""+t,10)):G.none()},uI=function(t){return D(t)?t+"px":t},aI=function(t,n,e){var o=n.filter(function(n){return t<n}),r=e.filter(function(n){return t>n});return o.or(r).getOr(t)},cI=function(t){var n=Ih(t),e=Fh(t),o=Nh(t);return iI(n).map(function(t){return aI(t,e,o)})},sI=Dv.ToolbarLocation,lI=Dv.ToolbarMode,fI=function(t,n){var e=fo(t);return{pos:n?e.y:e.bottom,bounds:e}},dI=Object.freeze({__proto__:null,render:function(t,n,e,o,r){var i=n.mainUi,u=yo(),a=tn(r.targetNode),c=function(t,n,e,o,r){var i=e.mainUi,u=e.uiMotherships,a=Oh.DOM,c=Ov(t),s=Ev(t),l=Nh(t).or(cI(t)),f=o.shared.header,d=f.isPositionedAtTop,m=Wh(t),g=m===lI.sliding||m===lI.floating,p=ho(!1),h=function(){return p.get()&&!t.removed},v=function(t){return g?t.fold(N(0),function(t){return t.components().length>1?ie(t.components()[1].element):0}):0},b=function(){ot(u,function(t){t.broadcastOn([Bf()],{})})},y=function(e){if(h()){c||r.on(function(t){var e=l.getOrThunk(function(){return io().width-fe(n).left-10});Yn(t.element,"max-width",e+"px")});var o=eo(),u=!(c||c||!(le(i.outerContainer.element).left+ge(i.outerContainer.element)>=window.innerWidth-40||Qn(i.outerContainer.element,"width").isSome())||(Yn(i.outerContainer.element,"position","absolute"),Yn(i.outerContainer.element,"left","0px"),ne(i.outerContainer.element,"width"),0));if(g&&XD.refreshToolbar(i.outerContainer),!c){var a=eo(),f=Ht(o.left!==a.left,o);(function(e,o){r.on(function(r){var u=XD.getToolbar(i.outerContainer),a=v(u),c=fo(n),s=function(t,n){return Av(t)?Wu(n):G.none()}(t,i.outerContainer.element),l=s.fold(function(){return c.x},function(t){var n=fo(t);return hn(t,Nn())?c.x:c.x-n.x}),f=Ht(e,Math.ceil(i.outerContainer.element.dom.getBoundingClientRect().width)).filter(function(t){return t>150}).map(function(t){var n=o.getOr(eo()),e=window.innerWidth-(l-n.left),r=Math.max(Math.min(t,e),150);return e<t&&Yn(i.outerContainer.element,"width",r+"px"),{width:r+"px"}}).getOr({width:"max-content"}),m={position:"absolute",left:Math.round(l)+"px",top:s.fold(function(){return d()?Math.max(c.y-ie(r.element)+a,0):c.bottom},function(t){var n,e=fo(t),o=null!==(n=t.dom.scrollTop)&&void 0!==n?n:0,i=hn(t,Nn())?Math.max(c.y-ie(r.element)+a,0):c.y-e.y+o-ie(r.element)+a;return d()?i:c.bottom})+"px"};Xn(i.outerContainer.element,_(_({},m),f))})})(u,f),f.each(function(t){oo(t.left,a.top)})}s&&r.on(e),b()}},x=function(){return!(c||!s||!h())&&r.get().exists(function(e){var o,u=f.getDockingMode(),a=function(e){switch(Gh(t)){case sI.auto:var o=XD.getToolbar(i.outerContainer),r=v(o),u=ie(e.element)-r,a=fo(n);if(a.y>u)return"top";var c=xn(n),s=Math.max(c.dom.scrollHeight,ie(c));return a.bottom<s-u||po().bottom<a.bottom-u?"bottom":"top";case sI.bottom:return"bottom";case sI.top:default:return"top"}}(e);return a!==u&&(o=a,r.on(function(t){La.setModes(t,[o]),f.setDockingMode(o);var n=d()?Ms.TopToBottom:Ms.BottomToTop;Pn(t.element,Zs,n)}),!0)})};return{isVisible:h,isPositionedAtTop:d,show:function(){p.set(!0),Yn(i.outerContainer.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),ot(u,function(t){ne(t.element,"display")}),x(),Av(t)?y(function(t){return La.isDocked(t)?La.reset(t):La.refresh(t)}):y(La.refresh)},hide:function(){p.set(!1),Yn(i.outerContainer.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus"),ot(u,function(t){Yn(t.element,"display","none")})},update:y,updateMode:function(){x()&&y(La.reset)},repositionPopups:b}}(t,a,n,o,u),s=Xh(t);rB(t);var l=function(){if(u.isSet())c.show();else{u.set(XD.getHeader(i.outerContainer).getOrDie());var r=_v(t);Av(t)?(vf(a,i.mothership),vf(a,n.popupUi.mothership)):hf(r,i.mothership),hf(r,n.dialogUi.mothership);var l=function(){nI(t,n,e,o),XD.setMenubar(i.outerContainer,$D(t,e)),c.show(),function(t,n,e,o){var r=ho(fI(n,e.isPositionedAtTop())),i=function(o){var i=fI(n,e.isPositionedAtTop()),u=i.pos,a=i.bounds,c=r.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;r.set({pos:u,bounds:a}),f&&iS(t,o),e.isVisible()&&(s!==u?e.update(La.reset):f&&(e.updateMode(),e.repositionPopups()))};o||(t.on("activate",e.show),t.on("deactivate",e.hide)),t.on("SkinLoaded ResizeWindow",function(){return e.update(La.reset)}),t.on("NodeChange keydown",function(t){requestAnimationFrame(function(){return i(t)})});var u=0,a=A_(function(){return e.update(La.refresh)},33);t.on("ScrollWindow",function(){var t=eo().left;t!==u&&(u=t,a.throttle()),e.updateMode()}),Av(t)&&t.on("ElementScroll",function(t){e.update(La.refresh)});var c=bo();c.set(zs(tn(t.getBody()),"load",function(t){return i(t.raw)})),t.on("remove",function(){c.clear()})}(t,a,c,s),t.nodeChanged()};s?t.once("SkinLoaded",l):l()}};t.on("show",l),t.on("hide",c.hide),s||(t.on("focus",l),t.on("blur",c.hide)),t.on("init",function(){(t.hasFocus()||s)&&l()}),yw(t,n);var f={show:l,hide:c.hide,setEnabled:function(t){bw(n,t?"setEnabled":"setDisabled")},isEnabled:function(){return!vm.isDisabled(i.outerContainer)}};return{editorContainer:i.outerContainer.element.dom,api:f}}}),mI="contexttoolbar-hide",gI=function(t,n){return ou(Q_,function(e,o){var r=function(t){return{hide:function(){return Xi(t,Mi())},getValue:function(){return Jf.getValue(t)}}}(t.get(e));n.onAction(r,o.event.buttonApi)})},pI=function(t,n,e){return n.bottom-t.y>=e&&t.bottom-n.y>=e},hI=function(t){var n=function(t){var n=t.getBoundingClientRect();if(n.height<=0&&n.width<=0){var e=An(tn(t.startContainer),t.startOffset).element;return(sn(e)?Sn(e):G.some(e)).filter(cn).map(function(t){return t.dom.getBoundingClientRect()}).getOr(n)}return n}(t.selection.getRng());if(t.inline){var e=eo();return lo(e.left+n.left,e.top+n.top,n.width,n.height)}var o=mo(tn(t.getBody()));return lo(o.x+n.left,o.y+n.top,n.width,n.height)},vI=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=io(window),i=fo(tn(t.getContentAreaContainer())),u=hv(t)||xv(t)||Sv(t),a=function(t,n,e){var o=Math.max(t.x+e,n.x);return{x:o,width:Math.min(t.right-e,n.right)-o}}(i,r,o),c=a.x,s=a.width;if(t.inline&&!u)return lo(c,r.y,s,r.height);var l=function(t,n,e,o,r,i){var u=tn(t.getContainer()),a=Dc(u,".tox-editor-header").getOr(u),c=fo(a),s=c.y>=n.bottom,l=o&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,e.y),bottom:e.bottom};
2if(t.inline&&!l)return{y:e.y,bottom:Math.min(c.y-i,e.bottom)};var f="line"===r?fo(u):n;return l?{y:Math.max(c.bottom+i,e.y),bottom:Math.min(f.bottom-i,e.bottom)}:{y:Math.max(f.y+i,e.y),bottom:Math.min(c.y-i,e.bottom)}}(t,i,r,n.header.isPositionedAtTop(),e,o),f=l.y,d=l.bottom;return lo(c,f,s,d-f)},bI={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"]},yI={maxHeightFunction:js(),maxWidthFunction:$M()},xI=function(t){return"node"===t},wI=function(t,n,e,o){var r=function(n){return function(o,r,i,u,a){return _(_({},function(t,n,e,o,r){var i=hI(t),u=o.lastElement().exists(function(t){return hn(e,t)});return function(t,n){var e=t.selection.getRng(),o=An(tn(e.startContainer),e.startOffset);return e.startContainer===e.endContainer&&e.startOffset===e.endOffset-1&&hn(o.element,n)}(t,e)?u?eA:$E:u?function(t,e){var r=Qn(t,"position");Yn(t,"position",e);var u=pI(i,fo(n),-20)&&!o.isReposition()?rA:eA;return r.each(function(n){return Yn(t,"position",n)}),u}(n,o.getMode()):("fixed"===o.getMode()?r.y+eo().top:r.y)+(ie(n)+12)<=i.y?$E:QE}(t,u,n,e,a)(_(_({},o),{},{y:a.y,height:a.height}),r,i,u,a)),{},{alwaysFit:!0})}},i=function(t){return xI(o)?[r(t)]:[]};return n?{onLtr:function(t){return[is,ts,ns,es,os,rs].concat(i(t))},onRtl:function(t){return[is,ns,ts,os,es,rs].concat(i(t))}}:{onLtr:function(t){return[rs,is,es,ts,os,ns].concat(i(t))},onRtl:function(t){return[rs,is,os,ns,es,ts].concat(i(t))}}},SI=function(t,n){var e=it(n,function(n){return n.predicate(t.dom)}),o=rt(e,function(t){return"contexttoolbar"===t.type});return{contextToolbars:o.pass,contextForms:o.fail}},CI=Wa("forward-slide"),kI=Wa("backward-slide"),OI=Wa("change-slide-event"),_I="tox-pop--resizing",TI="tox-pop--transition",EI=function(t,n,e,i){var u=i.backstage,a=u.shared,c=Ge().deviceType.isTouch,s=yo(),l=yo(),f=yo(),d=Sc(function(t){var n=ho([]);return Ch.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){n.set([]),Ch.getContent(t).each(function(t){ne(t.element,"visibility")}),Nu(t.element,_I),ne(t.element,"width")},inlineBehaviours:Cu([Ip("context-toolbar-events",[lu(vi(),function(t,n){"width"===n.event.raw.propertyName&&(Nu(t.element,_I),ne(t.element,"width"))}),ou(OI,function(t,n){var e=t.element;ne(e,"width");var o=me(e);Ch.setContent(t,n.event.contents),Fu(e,_I);var r=me(e);Yn(e,"width",o+"px"),Ch.getContent(t).each(function(t){n.event.focus.bind(function(t){return bs(t),Ss(e)}).orThunk(function(){return Cp.focusIn(t),ws(Dn(e))})}),setTimeout(function(){Yn(t.element,"width",r+"px")},0)}),ou(CI,function(t,e){Ch.getContent(t).each(function(e){n.set(n.get().concat([{bar:e,focus:ws(Dn(t.element))}]))}),Ki(t,OI,{contents:e.event.forwardContents,focus:G.none()})}),ou(kI,function(t,e){xt(n.get()).each(function(e){n.set(n.get().slice(0,n.get().length-1)),Ki(t,OI,{contents:Cc(e.bar),focus:e.focus})})})]),Cp.config({mode:"special",onEscape:function(e){return xt(n.get()).fold(function(){return t.onEscape()},function(t){return Xi(e,kI),G.some(!0)})}})]),lazySink:function(){return Co.value(t.sink)}})}({sink:e,onEscape:function(){return t.focus(),G.some(!0)}})),m=function(){var n=f.get().getOr("node"),e=xI(n)?1:0;return vI(t,a,n,e)},g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var n=m(),e=Lt(f.get(),"node")?function(t,n){return n.filter(function(t){return Rn(t)&&an(t)}).map(mo).getOrThunk(function(){return hI(t)})}(t,s.get()):hI(t);return n.height<=0||!pI(e,n,.01)}return!0},h=function(){s.clear(),l.clear(),f.clear(),Ch.hide(d)},v=function(){if(Ch.isOpen(d)){var t=d.element;ne(t,"display"),p()?Yn(t,"display","none"):(l.set(0),Ch.reposition(d))}},b=function(n){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[n],behaviours:Cu([Cp.config({mode:"acyclic"}),Ip("pop-dialog-wrap-events",[fu(function(n){t.shortcuts.add("ctrl+F9","focus statusbar",function(){return Cp.focusIn(n)})}),du(function(n){t.shortcuts.remove("ctrl+F9")})])])}},y=pe(function(){return function(t,n){var e={},o=[],r=[],i={},u={},a=Ct(t);return ot(a,function(a){var c=t[a];"contextform"===c.type?function(t,a){var c=sr(cr("ContextForm",jx,a));e[t]=c,c.launch.map(function(e){i["form:"+t]=_(_({},a.launch),{},{type:"contextformtogglebutton"===e.type?"togglebutton":"button",onAction:function(){n(c)}})}),"editor"===c.scope?r.push(c):o.push(c),u[t]=c}(a,c):"contexttoolbar"===c.type&&function(t,n){var e;(e=n,cr("ContextToolbar",Gx,e)).each(function(e){"editor"===n.scope?r.push(e):o.push(e),u[t]=e})}(a,c)}),{forms:e,inNodeScope:o,inEditorScope:r,lookupTable:u,formNavigators:i}}(n,function(t){var n=w([t]);Ki(d,CI,{forwardContents:b(n)})})}),w=function(n){var e=_(_({},t.ui.registry.getAll().buttons),y().formNavigators),u=Wh(t)===yh.scrolling?yh.scrolling:yh.default,c=lt(et(n,function(n){return"contexttoolbar"===n.type?function(n,e){return tI(t,{buttons:n,toolbar:e.items,allowToolbarGroups:!1},i.backstage,G.some(["form:"]))}
2(e,n):function(t,n){return function(t,n){var e=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),i=Vv(Ly.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:e,selectOnFocus:!0,inputBehaviours:Cu([vm.config({disabled:function(){return n.checkUiComponentContext("mode:design").shouldDisable}}),xw(function(){return n.checkUiComponentContext("mode:design")}),Cp.config({mode:"special",onEnter:function(t){return u.findPrimary(t).map(function(t){return Ji(t),!0})},onLeft:function(t,n){return n.cut(),G.none()},onRight:function(t,n){return n.cut(),G.none()}})])})),u=function(t,n,e){var i=et(n,function(n){return Vv(function(t,n,e){return function(t){return"contextformtogglebutton"===t.type}(n)?function(t,n,e){var r=n.original,i=(r.primary,x(r,o)),u=sr(Lx(_(_({},i),{},{type:"togglebutton",onAction:I})));return XB(u,e,[gI(t,n)])}(t,n,e):function(t,n,e){var o=n.original,i=(o.primary,x(o,r)),u=sr(Fx(_(_({},i),{},{type:"button",onAction:I})));return YB(u,e,[gI(t,n)])}(t,n,e)}(t,n,e))});return{asSpecs:function(){return et(i,function(t){return t.asSpec()})},findPrimary:function(t){return St(n,function(n,e){return n.primary?G.from(i[e]).bind(function(n){return n.getOpt(t)}).filter(V(vm.isDisabled)):G.none()})}}}(i,t.commands,n);return[{title:G.none(),items:[i.asSpec()]},{title:G.none(),items:u.asSpecs()}]}(t,n)}(n,a.providers)}));return SD({type:u,uid:Wa("context-toolbar"),initGroups:c,onEscape:G.none,cyclicKeying:!0,providers:a.providers})},S=function(n,o){if(k.cancel(),g()){var r=w(n),i=n[0].position,u=function(n,o){var r="node"===n?a.anchors.node(o):a.anchors.cursor(),i=function(t,n,e,o){return"line"===n?{bubble:Xs(12,0,bI),layouts:{onLtr:function(){return[us]},onRtl:function(){return[as]}},overrides:yI}:{bubble:Xs(0,12,bI,1/12),layouts:wI(t,e,o,n),overrides:yI}}(t,n,c(),{lastElement:s.get,isReposition:function(){return Lt(l.get(),0)},getMode:function(){return of.getMode(e)}});return Io(r,i)}(i,o);f.set(i),l.set(1);var h=d.element;ne(h,"display"),function(t){return Lt(Pt(t,s.get(),hn),!0)}(o)||(Nu(h,TI),of.reset(e,d)),Ch.showWithinBounds(d,b(r),{anchor:u,transition:{classes:[TI],mode:"placement"}},function(){return G.some(m())}),o.fold(s.clear,s.set),p()&&Yn(h,"display","none")}},C=!1,k=A_(function(){!t.hasFocus()||t.removed||C||(Lu(d.element,TI)?k.throttle():function(t,n){var e=tn(n.getBody()),o=function(t){return hn(t,e)},r=tn(n.selection.getNode());return function(t){return!o(t)&&!vn(e,t)}(r)?G.none():function(t,n,e){var o=SI(t,n);if(o.contextForms.length>0)return G.some({elem:t,toolbars:[o.contextForms[0]]});var r=SI(t,e);if(r.contextForms.length>0)return G.some({elem:t,toolbars:[r.contextForms[0]]});if(o.contextToolbars.length>0||r.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var n=function(n){return Z(t,function(t){return t.position===n})},e=function(n){return it(t,function(t){return t.position===n})},o=n("selection"),r=n("node");if(o||r){if(r&&o){var i=e("node"),u=et(e("selection"),function(t){return _(_({},t),{},{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return G.some({elem:t,toolbars:i})}return G.none()}(r,t.inNodeScope,t.inEditorScope).orThunk(function(){return function(t,n,e){return t(n)?G.none():Xr(n,function(t){if(cn(t)){var n=SI(t,e.inNodeScope),o=n.contextToolbars,r=n.contextForms,i=r.length>0?r:function(t){if(t.length<=1)return t;var n=function(n){return ct(t,function(t){return t.position===n})};return n("selection").orThunk(function(){return n("node")}).orThunk(function(){return n("line")}).map(function(t){return t.position}).fold(function(){return[]},function(n){return it(t,function(t){return t.position===n})})}(o);return i.length>0?G.some({elem:t,toolbars:i}):G.none()}return G.none()},t)}(o,r,t)})}(y(),t).fold(h,function(t){S(t.toolbars,G.some(t.elem))}))},17);t.on("init",function(){t.on("remove",h),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",v),t.on("click keyup focus SetContent",k.throttle),t.on(mI,h),t.on("contexttoolbar-sh
2ow",function(n){var e=y();Ft(e.lookupTable,n.toolbarKey).each(function(e){S([e],Ht(n.target!==t,n.target)),Ch.getContent(d).each(Cp.focusIn)})}),t.on("focusout",function(n){kh.setEditorTimeout(t,function(){Ss(e.element).isNone()&&Ss(d.element).isNone()&&h()},0)}),t.on("SwitchMode",function(){t.mode.isReadOnly()&&h()}),t.on("ExecCommand",function(t){"toggleview"===t.command.toLowerCase()&&h()}),t.on("AfterProgressState",function(n){n.state?h():t.hasFocus()&&k.throttle()}),t.on("dragstart",function(){C=!0}),t.on("dragend drop",function(){C=!1}),t.on("NodeChange",function(t){Ss(d.element).fold(k.throttle,I)})})},AI=function(t,n){var e=function(){var e=n.getOptions(t),o=n.getCurrent(t).map(n.hash),r=yo();return et(e,function(e){return{type:"togglemenuitem",text:n.display(e),onSetup:function(i){var u=function(t){t&&(r.on(function(t){return t.setActive(!1)}),r.set(i)),i.setActive(t)};u(Lt(o,n.hash(e)));var a=n.watcher(t,e,u);return function(){r.clear(),a()}},onAction:function(){return n.setCurrent(t,e)}}})};t.ui.registry.addMenuButton(n.name,{tooltip:n.text,icon:n.icon,fetch:function(t){return t(e())},onSetup:n.onToolbarSetup}),t.ui.registry.addNestedMenuItem(n.name,{type:"nestedmenuitem",text:n.text,getSubmenuItems:e,onSetup:n.onMenuSetup})},MI=function(t){return fS(t,"NodeChange",function(n){n.setEnabled(t.queryCommandState("outdent")&&t.selection.isEditable())})},DI=function(t,n){return function(e){e.setActive(n.get());var o=function(t){n.set(t.state),e.setActive(t.state)};return t.on("PastePlainTextToggle",o),cS(function(){return t.off("PastePlainTextToggle",o)},sS(t)(e))}},BI=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},II=function(t,n){return fS(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(e){e.setEnabled(!t.mode.isReadOnly()&&t.undoManager[n]())})},FI=function(t){return fS(t,"VisualAid",function(n){n.setActive(t.hasVisual)})},RI=function(t,n){(function(t){ot([{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(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onAction:mS(t,n.cmd),onSetup:lS(t,n.name)})}),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:sS(t),onAction:mS(t,"JustifyNone")})})(t),function(t){(function(t){(function(t){T_.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(n,e){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onSetup:lS(t,n.name),onAction:BI(t,n.name),shortcut:n.shortcut})});for(var n=1;n<=6;n++){var e="h"+n,o="Access+".concat(n);t.ui.registry.addToggleButton(e,{text:e.toUpperCase(),tooltip:"Heading "+n,onSetup:lS(t,e),onAction:BI(t,e),shortcut:o})}})(t),function(t){T_.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy",context:"any"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],function(n){t.ui.registry.addButton(n.name,{tooltip:n.text,icon:n.icon,onAction:mS(t,n.action),shortcut:n.shortcut,context:n.context})}),T_.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],function(n){t.ui.registry.addButton(n.name,{tooltip:n.text,icon:n.icon,onSetup:sS(t),onAction:mS(t,n.action)})})}(t),function(t){T_.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onAction:mS(t,n.action),onSetup:lS(t,n.name)})})}(t)})(t),function(t){T_.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],function(n){t.ui.registry.addMenuItem(n.name,{text:n.text,icon:n.icon,shortcut:n.shortcut,onAction:mS(t,n.action),context:n.context})}),T_.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"}
2,{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],function(n){t.ui.registry.addMenuItem(n.name,{text:n.text,icon:n.icon,shortcut:n.shortcut,onSetup:sS(t),onAction:mS(t,n.action)})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:sS(t),onAction:BI(t,"code")})}(t)}(t),function(t,n){(function(t,n){var e=aB(n,gB(t));t.ui.registry.addNestedMenuItem("align",{text:n.shared.providers.translate("Align"),onSetup:sS(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})})(t,n),function(t,n){var e=aB(n,kB(t));t.ui.registry.addNestedMenuItem("fontfamily",{text:n.shared.providers.translate("Fonts"),onSetup:sS(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n),function(t,n){var e=_({type:"advanced"},n.styles),o=aB(n,RB(t,e));t.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:sS(t),getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}})}(t,n),function(t,n){var e=aB(n,bB(t));t.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:sS(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n),function(t,n){var e=aB(n,IB(t));t.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:sS(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n)}(t,n),function(t){(function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:II(t,"hasUndo"),onAction:mS(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:II(t,"hasRedo"),onAction:mS(t,"redo")})})(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:II(t,"hasUndo"),onAction:mS(t,"undo"),shortcut:"Meta+Z"}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:II(t,"hasRedo"),onAction:mS(t,"redo"),shortcut:"Meta+Y"})}(t)}(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",function(n,e){!function(t,n,e){t.undoManager.transact(function(){t.focus(),t.formatter.apply(n,{value:e}),t.nodeChanged()})}(t,n,e)}),t.addCommand("mceRemoveTextcolor",function(n){!function(t,n){t.undoManager.transact(function(){t.focus(),t.formatter.remove(n,{value:null},void 0,!0),t.nodeChanged()})}(t,n)})}(t);var n=DS(t),e=BS(t),o=ho(n),r=ho(e);US(t,"forecolor","forecolor",o),US(t,"backcolor","hilitecolor",r),WS(t,"forecolor","forecolor","Text color",o),WS(t,"backcolor","hilitecolor","Background color",r)}(t),function(t){(function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:mS(t,"mceToggleVisualAid"),context:"any"})})(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:FI(t),onAction:mS(t,"mceToggleVisualAid"),context:"any"})}(t)}(t),function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:MI(t),onAction:mS(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:sS(t),onAction:mS(t,"indent")})}(t)}(t),function(t){AI(t,function(t){return{name:"lineheight",text:"Line height",icon:"line-height",getOptions:yv,hash:function(t){return function(t){return TB(t,["fixed","relative","empty"]).map(function(t){return t.value+t.unit})}(t).getOr(t)},display:L,watcher:function(t,n,e){return t.formatter.formatChanged("lineheight",e,!1,{value:n}).unbind},getCurrent:function(t){return G.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,n){return t.execCommand("LineHeight",!1,n)},onToolbarSetup:sS(t),onMenuSetup:sS(t)}}(t)),function(t){return G.from(Hh(t)).map(function(n){return{name:"language",text:"Language",icon:"language",getOptions:N(n),hash:function(t){return C(t.customCode)?t.code:"".concat(t.code,"/").concat(t.customCode)},display:function(t){return t.title},watcher:function(t,n,e){var o;return t.formatter.formatChanged("lang",e,!1,{value:n.code,customValue:null!==(o=n.customCode)&&void 0!==o?o:null}).unbind},getCurrent:function(t){var n=tn(t.selection.getNode());return Kr(n,function(t){return G.some(t).filter(cn).bind(function(t){return Un(t,"lang").map(function(n){return{code:n,customCode:Un(t,"data-mce-lang").getOrUndefined(),title:""}})})})},setCurrent:function(t,n){return t.execCommand("Lang",!1,n)},onToolbarSetup:function(n){var e=bo();return n.setActive(t.formatter.match("lang",{},void 0,!0)),e.set(t.formatter.formatChanged("lang",n.setActive,!0)),cS(e.clear,sS(t)(n))},onMenuSetup:sS(t)}})}(t).each(function(n){return AI(t,n)})}(t),function(t){var n=ho(lv(t)),e=function(){return t.execCommand("mceTogglePlainTextPaste")};t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:e,onSetup:DI(t,n)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:e,onSetup:DI(t,n)})}(t),function(t){t.ui.registry.addContext("editable",function(){return t.selection.isEditable()}),t.ui.registry.addContext("mode",function(n){return t.mode.get()===n}),t.ui.registry.addContext("any",j),t.ui.registry.addContext("formatting",function(n){return t.formatter.canApply(n)}),t.ui.registry.addContext("insert",function(n){return t.schema.isValidChild(t.selection.getNode().tagName,n)})}(t)},NI=function(t){return f(t)?t.split(/[ ,]/):t},LI=function(t){return function(n){return n.options.get(t)}},zI=LI("contextmenu_never_use_native"),PI=LI("contextmenu_avoid_overlap"),VI=function(t){var n=t.ui.registry.getAll().contextMenus,e=t.options.get("contextmenu");return t.options.isSet("contextmenu")?e:it(e,function(t){return Rt(n,t)})},HI=function(t,n){return{type:"makeshift",x:t,y:n}},UI=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},WI=function(t){return{type:"selection",root:tn(t.selection.getNode())}},jI=function(t,n,e){switch(e){case"node":return function(t){return{type:"node",node:G.some(tn(t.selection.getNode())),root:tn(t.getBody())}}(t);case"point":return function(t,n){return"contextmenu"===n.type||"longpress"===n.type?t.inline?function(t){if(UI(t)){var n=t.touches[0];return HI(n.pageX,n.pageY)}return HI(t.pageX,t.pageY)}(n):function(t,n){var e=Oh.DOM.getPos(t);return function(t,n,e){return HI(t.x+n,t.y+e)}(n,e.x,e.y)}(t.getContentAreaContainer(),function(t){if(UI(t)){var n=t.touches[0];return HI(n.clientX,n.clientY)}return HI(t.clientX,t.clientY)}(n)):WI(t)}(t,n);case"selection":return WI(t)}},GI=function(t,n,e,o,r,i){var u=e(),a=jI(t,n,i);dT(u,gy.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:G.none()}).map(function(t){n.preventDefault(),Ch.showMenuAt(r,{anchor:a},{menu:{markers:Ay("normal")},data:t})})},qI={onLtr:function(){return[is,ts,ns,es,os,rs,$E,QE,JE,XE,KE,YE]},onRtl:function(){return[is,ns,ts,os,es,rs,$E,QE,KE,YE,JE,XE]}},YI={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"]},XI=function(t,n,e,o,r,i){var u=Ge(),a=u.os.isiOS(),c=u.os.isMacOS(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=e();!function(t,n,e,o,r,i,u){var a=function(t,n,e){var o=jI(t,n,e);return _({bubble:Xs(0,"point"===e?12:0,YI),layouts:qI,overrides:{maxWidthFunction:$M(),maxHeightFunction:js()}},o)}(t,n,i);dT(e,gy.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!0,search:G.none()}).map(function(e){n.preventDefault();var c=u?Jm.HighlightMenuAndItem:Jm.HighlightNone;Ch.showMenuWithinBounds(r,{anchor:a},{menu:{markers:Ay("normal"),highlightOnOpen:c},data:e,type:"horizontal"},function(){return G.some(vI(t,o.shared,"node"===i?"node":"selection"))}
2),t.dispatch(mI)})}(t,n,u,o,r,i,!(s||a||c&&l))};if((c||a)&&"node"!==i){var d=function(){(function(t){var n=t.selection.getRng(),e=function(){kh.setEditorTimeout(t,function(){t.selection.setRng(n)},10),i()};t.once("touchend",e);var o=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",o,!0);var r=function(){return i()};t.once("longpresscancel",r);var i=function(){t.off("touchend",e),t.off("longpresscancel",r),t.off("mousedown",o)}})(t),f()};!function(t,n){var e=t.selection;if(e.isCollapsed()||n.touches.length<1)return!1;var o=n.touches[0],r=e.getRng();return Bl(t.getWin(),xl.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}(t,n)?(t.once("selectionchange",d),t.once("touchend",function(){return t.off("selectionchange",d)})):d()}else f()},KI=function(t){return f(t)?"|"===t:"separator"===t.type},JI={type:"separator"},$I=function(t){var n=function(t){return{text:t.text,icon:t.icon,enabled:t.enabled,shortcut:t.shortcut}};if(f(t))return t;switch(t.type){case"separator":return JI;case"submenu":return _(_({type:"nestedmenuitem"},n(t)),{},{getSubmenuItems:function(){var n=t.getSubmenuItems();return f(n)?n:et(n,$I)}});default:var e=t;return _(_({type:"menuitem"},n(e)),{},{onAction:F(e.onAction)})}},QI=function(t,n){if(0===n.length)return t;var e=xt(t).filter(function(t){return!KI(t)}).fold(function(){return[]},function(t){return[JI]});return t.concat(e).concat(n).concat([JI])},ZI=function(t,n){return!function(t){return"longpress"===t.type||Rt(t,"touches")}(n)&&(2!==n.button||n.target===t.getBody()&&""===n.pointerType)},tF=function(t,n){return ZI(t,n)?t.selection.getStart(!0):n.target},nF=function(t,n,e){var o=Ge().deviceType.isTouch,r=Sc(Ch.sketch({dom:{tag:"div"},lazySink:n,onEscape:function(){return t.focus()},onShow:function(){return e.setContextMenuState(!0)},onHide:function(){return e.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:Cu([Ip("dismissContextMenu",[ou(Pi(),function(n,e){Mf.close(n),t.focus()})])])})),i=function(){return Ch.hide(r)},u=function(n){if(zI(t)&&n.preventDefault(),!function(t,n){return n.ctrlKey&&!zI(t)}(t,n)&&!function(t){return 0===VI(t).length}(t)){var i=function(t,n){var e=PI(t),o=ZI(t,n)?"selection":"point";if(Xt(e)){var r=tF(t,n);return FC(tn(r),e)?"node":o}return o}(t,n);(o()?XI:GI)(t,n,function(){var e=tF(t,n),o=t.ui.registry.getAll(),r=VI(t);return function(t,n,e){var o=at(n,function(n,o){return Ft(t,o.toLowerCase()).map(function(t){var o=t.update(e);if(f(o)&&Xt(Yt(o)))return QI(n,o.split(" "));if(g(o)&&o.length>0){var r=et(o,$I);return QI(n,r)}return n}).getOrThunk(function(){return n.concat([o])})},[]);return o.length>0&&KI(o[o.length-1])&&o.pop(),o}(o.contextMenus,r,e)},e,r,i)}};t.on("init",function(){var n="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(n,i),t.on("longpress contextmenu",u)})},eF=Ur([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),oF=function(t){return function(n){return n.translate(-t.left,-t.top)}},rF=function(t){return function(n){return n.translate(t.left,t.top)}},iF=function(t){return function(n,e){return at(t,function(t,n){return n(t)},ce(n,e))}},uF=function(t,n,e){return t.fold(iF([rF(e),oF(n)]),iF([oF(n)]),iF([]))},aF=function(t,n,e){return t.fold(iF([rF(e)]),iF([]),iF([rF(n)]))},cF=function(t,n,e){return t.fold(iF([]),iF([oF(e)]),iF([rF(n),oF(e)]))},sF=function(t,n,e){var o=t.fold(function(t,n){return{position:G.some("absolute"),left:G.some(t+"px"),top:G.some(n+"px")}},function(t,n){return{position:G.some("absolute"),left:G.some(t-e.left+"px"),top:G.some(n-e.top+"px")}},function(t,n){return{position:G.some("fixed"),left:G.some(t+"px"),top:G.some(n+"px")}});return _({right:G.none(),bottom:G.none()},o)},lF=function(t,n,e,o){var r=function(t,r){return function(i,u){var a=t(n,e,o);return r(i.getOr(a.left),u.getOr(a.top))}};return t.fold(r(cF,fF),r(aF,dF),r(uF,mF))},fF=eF.offset,dF=eF.absolute,mF=eF.fixed,gF=function(t,n){var e=Hn(t,n);return C(e)?NaN:parseInt(e,10)},pF=function(t,n,e,o){return St(t,function(t){var r=t.sensor,i=function(t,n,e,o,r,i){var u=aF(t,r,i),a=aF(n,r,i);return Math.abs(u.left-a.left)<=e&&Math.abs(u.top-a.top)<=o}(n,r,t.range.left,t.range.top,e,o);return i?G.some({output:lF(t.output,n,e,o),extra:t.extra}):G.none()})},hF=function(t,n,e,o,r){var i=n.getSnapPoints(t);return pF(i,e,o,r).orThunk(function(){var t=at(i,function(t,n){var i=n.sensor,u=function(t,n,e,o,r,i){var u=aF(t,r,i),a=aF(n,r,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return ce(c,s)}(e,i,n.range.left,n.range.top,o,r);return t.deltas.fold(function(){return{deltas:G.some(u),snap:G.some(n)}},function(e){return(u.left+u.top)/2<=(e.left+e.top)/2?{deltas:G.some(u),snap:G.some(n)}:t})},{deltas:G.none(),snap:G.none()});return t.snap.map(function(t){return{output:lF(t.output,e,o,r),extra:t.extra}})})},vF=function(t,n,e,o,r){var i=n.getSnapPoints(t);return pF(i,e,o,r)},bF=Object.freeze({__proto__:null,snapTo:function(t,n,e,o){var r=n.getTarget(t.element);if(n.repositionTarget){var i=bn(t.element),u=eo(i),a=ju(r),c=function(t,n,e){return{coord:lF(t.output,t.output,n,e),extra:t.extra}}(o,u,a),s=sF(c.coord,0,a);Kn(r,s)}}}),yF="data-initial-z-index",xF=function(t,n){t.getSystem().addToGui(n),function(t){Sn(t.element).filter(cn).each(function(n){Qn(n,"z-index").each(function(t){Pn(n,yF,t)}),Yn(n,"z-index",Jn(t.element,"z-index"))})}(n)},wF=function(t){(function(t){Sn(t.element).filter(cn).each(function(t){Un(t,yF).fold(function(){return ne(t,"z-index")},function(n){return Yn(t,"z-index",n)}),jn(t,yF)})})(t),t.getSystem().removeFromGui(t)},SF=function(t,n,e){return t.getSystem().build(UC.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[n]},events:e}))},CF=Br("snaps",[vr("getSnapPoints"),Aa("onSensor"),vr("leftAttr"),vr("topAttr"),Ir("lazyViewport",po),Ir("mustSnap",!1)]),kF=[Ir("useFixed",W),vr("blockerClass"),Ir("getTarget",L),Ir("onDrag",I),Ir("repositionTarget",!0),Ir("onDrop",I),Pr("getBounds",po),CF],OF=function(t,n){return{bounds:t.getBounds(),height:ue(n.element),width:ge(n.element)}},_F=function(t,n,e,o,r){var i=e.update(o,r),u=e.getStartData().getOrThunk(function(){return OF(n,t)});i.each(function(e){!function(t,n,e,o){var r=n.getTarget(t.element);if(n.repositionTarget){var i=bn(t.element),u=eo(i),a=ju(r),c=function(t){return(n=Qn(t,"left"),e=Qn(t,"top"),o=Qn(t,"position"),n.isSome()&&e.isSome()&&o.isSome()?G.some(function(t,n,e){return("fixed"===e?mF:fF)(parseInt(t,10),parseInt(n,10))}(n.getOrDie(),e.getOrDie(),o.getOrDie())):G.none()).getOrThunk(function(){var n=le(t);return dF(n.left,n.top)});var n,e,o}(r),s=function(t,n,e,o,r,i,u){return function(t,n,e,o,r){var i=r.boun
2ds,u=aF(n,e,o),a=Ha(u.left,i.x,i.x+i.width-r.width),c=Ha(u.top,i.y,i.y+i.height-r.height),s=dF(a,c);return n.fold(function(){var t=cF(s,e,o);return fF(t.left,t.top)},N(s),function(){var t=uF(s,e,o);return mF(t.left,t.top)})}(0,n.fold(function(){var t,n,u,a=(t=e,n=i.left,u=i.top,t.fold(function(t,e){return fF(t+n,e+u)},function(t,e){return dF(t+n,e+u)},function(t,e){return mF(t+n,e+u)})),c=uF(a,o,r);return mF(c.left,c.top)},function(n){var u=function(t,n,e,o,r,i){var u=function(t,n,e,o){return function(t,n){var e=t.element,o=gF(e,n.leftAttr),r=gF(e,n.topAttr);return isNaN(o)||isNaN(r)?G.none():G.some(ce(o,r))}(t,n).fold(function(){return e},function(t){return mF(t.left+o.left,t.top+o.top)})}(t,n,e,o),a=n.mustSnap?hF(t,n,u,r,i):vF(t,n,u,r,i),c=uF(u,r,i);return function(t,n,e){var o=t.element;Pn(o,n.leftAttr,e.left+"px"),Pn(o,n.topAttr,e.top+"px")}(t,n,c),a.fold(function(){return{coord:mF(c.left,c.top),extra:G.none()}},function(t){return{coord:t.output,extra:t.extra}})}(t,n,e,i,o,r);return u.extra.each(function(e){n.onSensor(t,e)}),u.coord}),o,r,u)}(t,n.snaps,c,u,a,o,e),l=sF(s,0,a);Kn(r,l)}n.onDrag(t,r,o)}(t,n,u,e)})},TF=function(t,n,e,o){n.each(wF),e.snaps.each(function(n){!function(t,n){!function(t,n){var e=t.element;jn(e,n.leftAttr),jn(e,n.topAttr)}(t,n)}(t,n)});var r=e.getTarget(t.element);o.reset(),e.onDrop(t,r)},EF=function(t){return function(n,e){var o=function(t){e.setStartData(OF(n,t))};return tu([ou(Ri(),function(t){e.getStartData().each(function(){return o(t)})})].concat(w(t(n,e,o))))}},AF=Object.freeze({__proto__:null,getData:function(t){return G.from(ce(t.x,t.y))},getDelta:function(t,n){return ce(n.left-t.left,n.top-t.top)}}),MF=function(t,n,e){return[ou(ri(),function(o,r){if(0===r.event.raw.button){r.stop();var i=function(){return TF(o,G.some(c),t,n)},u=RC(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(e){u.cancel(),_F(o,t,n,AF,e)}},c=SF(o,t.blockerClass,function(t){return tu([ou(ri(),t.forceDrop),ou(ai(),t.drop),ou(ii(),function(n,e){t.move(e.event)}),ou(ui(),t.delayDrop)])}(a));e(o),xF(o,c)}})]},DF=[].concat(kF,[Ia("dragger",{handlers:EF(MF)})]),BF=Object.freeze({__proto__:null,getData:function(t){var n=t.raw.touches;return 1===n.length?function(t){var n=t[0];return G.some(ce(n.clientX,n.clientY))}(n):G.none()},getDelta:function(t,n){return ce(n.left-t.left,n.top-t.top)}}),IF=function(t,n,e){var o=yo(),r=function(e){TF(e,o.get(),t,n),o.clear()};return[ou(ti(),function(i,u){u.stop();var a=function(){return r(i)},c={drop:a,delayDrop:I,forceDrop:a,move:function(e){_F(i,t,n,BF,e)}},s=SF(i,t.blockerClass,function(t){return tu([ou(ti(),t.forceDrop),ou(ei(),t.drop),ou(oi(),t.drop),ou(ni(),function(n,e){t.move(e.event)})])}(c));o.set(s),e(i),xF(i,s)}),ou(ni(),function(e,o){o.stop(),_F(e,t,n,BF,o.event)}),ou(ei(),function(t,n){n.stop(),r(t)}),ou(oi(),r)]},FF=DF,RF=[].concat(kF,[Ia("dragger",{handlers:EF(IF)})]),NF=[].concat(kF,[Ia("dragger",{handlers:EF(function(t,n,e){return[].concat(w(MF(t,n,e)),w(IF(t,n,e)))})})]),LF=Object.freeze({__proto__:null,mouse:FF,touch:RF,mouseOrTouch:NF}),zF=Object.freeze({__proto__:null,init:function(){var t=G.none(),n=G.none(),e=N({});return Su({readState:e,reset:function(){t=G.none(),n=G.none()},update:function(n,e){return n.getData(e).bind(function(e){return function(n,e){var o=t.map(function(t){return n.getDelta(t,e)});return t=G.some(e),o}(n,e)})},getStartData:function(){return n},setStartData:function(t){n=G.some(t)}})}}),PF=Tu({branchKey:"mode",branches:LF,name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:G.from(t.extra)}}},state:zF,apis:bF}),VF=function(t,n,e,o,r,i){return t.fold(function(){return PF.snap({sensor:dF(e-20,o-20),range:ce(r,i),output:dF(G.some(e),G.some(o)),extra:{td:n}})},function(t){var r=e-20,i=o-20,u=t.element.dom.getBoundingClientRect();return PF.snap({sensor:dF(r,i),range:ce(40,40),output:dF(G.some(e-u.width/2),G.some(o-u.height/2)),extra:{td:n}})})},HF=function(t,n,e){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,o){var r=o.td;(function(t,n){return t.exists(function(t){return hn(t,n)})})(n.get(),r)||(n.set(r),e(r))},mustSnap:!0}},UF=function(t){return Vv(zv.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Cu([PF.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),vk.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(sB||(sB={}));var WF=function(t,n,e){var o=tn(t.getContainer()),r=function(t,n,e,o,r){var i={height:aI(o+n.top,Rh(t),Lh(t))};return e===sB.Both&&(i.width=aI(r+n.left,Fh(t),Nh(t))),i}(t,n,e,ie(o),me(o));Ot(r,function(t,n){D(t)&&Yn(o,n,uI(t))}),function(t){t.dispatch("ResizeEditor")}(t)},jF=function(t,n,e,o){var r=ce(20*e,20*o);return WF(t,r,n),G.some(!0)},GF=function(t,n){var e=function(){var e=[],o=mv(t),r=av(t),i=cv(t)||t.hasPlugin("wordcount");return r&&e.push(function(t,n,e){var o,r=null!==(o=n.delimiter)&&void 0!==o?o:"âº";return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Cu([Cp.config({mode:"flow",selector:"div[role=button]"}),vm.config({disabled:e.isDisabled}),xw(function(){return e.checkUiComponentContext("any")}),Wv.config({}),Bp.config({}),Ip("elementPathEvents",[fu(function(n,o){t.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Cp.focusIn(n)}),t.on("NodeChange",function(o){var i=function(n){for(var e,o=[],r=n.length;r-- >0;){var i=n[r];if(1===i.nodeType&&"BR"!==(e=i).nodeName&&!e.getAttribute("data-mce-bogus")&&"bookmark"!==e.getAttribute("data-mce-type")){var u=aS(t,i);if(u.isDefaultPrevented()||o.push({name:u.name,element:i}),u.isPropagationStopped())break}}return o}(o.parents),u=i.length>0?at(i,function(n,o,i){var u=function(n,o,r){return zv.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r}}
2,components:[bc(n)],action:function(n){t.focus(),t.selection.select(o),t.nodeChanged()},buttonBehaviours:Cu([tb.config(_({},e.tooltips.getConfig({tooltipText:e.translate(["Select the {0} element",o.nodeName.toLowerCase()]),onShow:function(t,n){!function(t,n){var e=G.from(Hn(t,"id")).getOrThunk(function(){var t=Wa("aria");return Pn(n,"id",t),t});Pn(t,"aria-describedby",e)}(t.element,n.element)},onHide:function(t){var n;n=t.element,jn(n,"aria-describedby")}}))),fw(e.isDisabled),xw(function(){return e.checkUiComponentContext("any")})])})}(o.name,o.element,i);return 0===i?n.concat([u]):n.concat([{dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[bc(" ".concat(r," "))]},u])},[]):[];Bp.set(n,u)})})])]),components:[]}}(t,{},n)),o&&e.push(function(){var t=_w("Alt+0");return{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[bc(ny.translate(["Press {0} for help",t]))]}}()),i&&e.push(function(){var e=[];return t.hasPlugin("wordcount")&&e.push(function(t,n){var e=function(t,e,o){return Bp.set(t,[bc(n.translate(["{0} "+o,e[o]]))])};return zv.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Cu([fw(n.isDisabled),xw(function(){return n.checkUiComponentContext("any")}),Wv.config({}),Bp.config({}),Jf.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Ip("wordcount-events",[gu(function(t){var n=Jf.getValue(t),o="words"===n.mode?"characters":"words";Jf.setValue(t,{mode:o,count:n.count}),e(t,n.count,o)}),fu(function(n){t.on("wordCountUpdate",function(t){var o=Jf.getValue(n).mode;Jf.setValue(n,{mode:o,count:t.wordCount}),e(n,t.wordCount,o)})})])]),eventOrder:T({},_i(),["disabling","alloy.base.behaviour","wordcount-events"])})}(t,n)),cv(t)&&e.push({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":t.translate(["Build with {0}","TinyMCE"])},innerHtml:t.translate(["Build with {0}",'<svg height="16" viewBox="0 0 80 16" width="80" xmlns="http://www.w3.org/2000/svg"><g opacity=".8"><path d="m80 3.537v-2.202h-7.976v11.585h7.976v-2.25h-5.474v-2.621h4.812v-2.069h-4.812v-2.443zm-10.647 6.929c-.493.217-1.13.337-1.864.337s-1.276-.156-1.805-.47a3.732 3.732 0 0 1 -1.3-1.298c-.324-.554-.48-1.191-.48-1.877s.156-1.335.48-1.877a3.635 3.635 0 0 1 1.3-1.299 3.466 3.466 0 0 1 1.805-.481c.65 0 .914.06 1.263.18.36.12.698.277.986.47.289.192.578.384.842.6l.12.085v-2.586l-.023-.024c-.385-.35-.855-.614-1.384-.818-.53-.205-1.155-.313-1.877-.313-.721 0-1.6.144-2.333.445a5.773 5.773 0 0 0 -1.937 1.251 5.929 5.929 0 0 0 -1.324 1.9c-.324.735-.48 1.565-.48 2.455s.156 1.72.48 2.454c.325.734.758 1.383 1.324 1.913.553.53 1.215.938 1.937 1.25a6.286 6.286 0 0 0 2.333.434c.819 0 1.384-.108 1.961-.313.59-.216 1.083-.505 1.468-.866l.024-.024v-2.49l-.12.096c-.41.337-.878.626-1.396.866zm-14.869-4.15-4.8-5.04-.024-.025h-.902v11.67h2.502v-6.847l2.827 3.08.385.409.397-.41 2.791-3.067v6.845h2.502v-11.679h-.902l-4.788 5.052z"/><path clip-rule="evenodd" d="m15.543 5.137c0-3.032-2.466-5.113-4.957-5.137-.36 0-.745.024-1.094.096-.157.024-3.85.758-3.85.758-3.032.602-4.62 2.466-4.704 4.788-.024.89-.024 4.27-.024 4.27.036 3.165 2.406 5.138 5.017 5.126.337 0 1.119-.109 1.287-.145.144-.024.385-.084.746-.144.661-.12 1.684-.325 3.067-.602 2.37-.409 4.103-2.009 4.44-4.33.156-1.023.084-4.692.084-4.692zm-3.213 3.308-2.346.457v2.31l-5.859 1.143v-5.75l2.346-.458v3.441l3.513-.686v-3.44l-3.513.685v-2.297l5.859-1.143v5.75zm20.09-3.296-.083-1.023h-2.13v8.794h2.346v-4.884c0-1.107.95-1.985 2.057-1.997 1.095 0 1.901.89 1.901 1.997v4.884h2.346v-5.245c-.012-2.105-1.588-3.777-3.67-3.765a3.764 3.764 0 0 0 -2.778 1.25l.012-.011zm-6.014-4.102 2.346-.458v2.298l-2.346.457z" fill-rule="evenodd"/><path d="m28.752 4.126h-2.346v8.794h2.346z"/><path clip-rule="evenodd" d="m43.777 15.483 4.043-11.357h-2.418l-1.54 4.355-.445 1.324-.36-1.324-1.54-4.355h-2.418l3.151 8.794-1.083 3.08zm-21.028-5.51c0 .722.541 1.034.878 1.034s.638-.048.95-.144l.518 1.708c-.217.145-.879.518-2.13.518a2.565 2.565 0 0 1 -2.562-2.587c-.024-1.
2082-.024-2.49 0-4.21h-1.54v-2.142h1.54v-1.912l2.346-.458v2.37h2.201v2.142h-2.2v3.693-.012z" fill-rule="evenodd"/></g></svg>\n'.trim()])},behaviours:Cu([zp.config({})])}]}),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:e}}()),e.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"].concat(w(function(){var t="tox-statusbar__text-container--flex-start",n="tox-statusbar__text-container--flex-end";if(o){var e="tox-statusbar__text-container-3-cols";return i||r?i&&!r?[e,n]:[e,t]:[e,"tox-statusbar__text-container--space-around"]}return[i&&!r?n:t]}()))},components:e}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var o=e(),r=function(t,n){var e=function(t){var n=sv(t);return!1===n?sB.None:"both"===n?sB.Both:sB.Vertical}(t);if(e===sB.None)return G.none();var o=e===sB.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return G.some(ly("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{"aria-label":n.translate(o),"data-mce-name":"resize-handle"},behaviours:[PF.config({mode:"mouse",repositionTarget:!1,onDrag:function(n,o,r){return WF(t,r,e)},blockerClass:"tox-blocker"}),Cp.config({mode:"special",onLeft:function(){return jF(t,e,-1,0)},onRight:function(){return jF(t,e,1,0)},onUp:function(){return jF(t,e,0,-1)},onDown:function(){return jF(t,e,0,1)}}),Wv.config({}),zp.config({}),tb.config(n.tooltips.getConfig({tooltipText:n.translate("Resize")}))]},n.icons))}(t,n);return o.concat(r.toArray())}()}},qF=function(t,n){return n.get().getOrDie("UI for ".concat(t," has not been rendered"))},YF=function(t,n){var e=t.inline,o=e?dI:rI,r=Ev(t)?bM:cM,i=function(){var t=yo(),n=yo(),e=yo();return{dialogUi:t,popupUi:n,mainUi:e,getUiMotherships:function(){var e=t.get().map(function(t){return t.mothership}),o=n.get().map(function(t){return t.mothership});return e.fold(function(){return o.toArray()},function(t){return o.fold(function(){return[t]},function(n){return hn(t.element,n.element)?[t]:[t,n]})})},lazyGetInOuterOrDie:function(t,n){return function(){return e.get().bind(function(t){return n(t.outerContainer)}).getOrDie("Could not find ".concat(t," element in OuterContainer"))}}}}(),u=yo(),a=yo(),c=yo(),s=Ge().deviceType.isTouch()?["tox-platform-touch"]:[],l=Cv(t),f=Wh(t),d=Vv({dom:{tag:"div",classes:["tox-anchorbar"]}}),m=Vv({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),g=function(){return i.mainUi.get().map(function(t){return t.outerContainer}).bind(XD.getHeader)},p=i.lazyGetInOuterOrDie("anchor bar",d.getOpt),v=i.lazyGetInOuterOrDie("bottom anchor bar",m.getOpt),b=i.lazyGetInOuterOrDie("toolbar",XD.getToolbar),y=i.lazyGetInOuterOrDie("throbber",XD.getThrobber),x=function(t,n,e,o){var r=ho(!1),i=function(t){var n=ho(Cv(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===n.get()},getDockingMode:n.get,setDockingMode:n.set}}(n),u={icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:ny.translate,isDisabled:function(){return!n.ui.isEnabled()},getOption:n.options.get,tooltips:kA(t.dialog),checkUiComponentContext:function(t){var e=h(t.split(":"),2),o=e[0],r=e[1],i=void 0===r?"":r,u=n.ui.registry.getAll().contexts;return{contextType:o,shouldDisable:!Ft(u,o).fold(function(){return Ft(u,"mode").map(function(t){return t("design")}).getOr(!1)},function(t){return"!"===i.charAt(0)?!t(i.slice(1)):t(i)})}}},a=KA(n),c=function(t){var n=function(n){return function(){return t.formatter.match(n)}},e=function(n){return function(){var e=t.formatter.get(n);return void 0!==e?G.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(n))}):G.none()}},o=ho([]),r=ho([]),i=ho(!1);return t.on("PreInit",function(r){var i=wA(t),u=CA(t,i,n,e);o.set(u)}),t.on("addStyleModifications",function(o){var u=CA(t,o.items,n,e);r.set(u),i.set(o.replace)}),{getData:function(){var t=i.get()?[]:o.get(),n=r.get();return t.concat(n)}}}(n),s=function(t){return{colorPicker:dA(t),hasCustomColors:mA(t),getColors:gA(t),getColorCols:pA(t)}}(n),l=function(t){return{isDraggableModal:hA(t)}}(n),f={shared:{providers:u,anchors:fA(n,e,o,i.isPositionedAtTop),header:i},urlinput:a,styles:c,colorinput:s,dialog:l,isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}},d=function(t){return G.none()},m=_(_({},f),{},{shared:_(_({},f.shared),{},{interpreter:function(t){return PE(t,{},m,d)},getSink:t.popup})}),g=_(_({},f),{},{shared:_(_({},f.shared),{},{interpreter:function(t){return PE(t,{},g,d)},getSink:t.dialog})});return{popup:m,dialog:g}}({popup:function(){return Co.fromOption(i.popupUi.get().map(function(t){return t.sink}),"(popup) UI has not been rendered")},dialog:function(){return Co.fromOption(i.dialogUi.get().map(function(t){return t.sink}),"UI has not been rendered")}},t,p,v),S=function(){var n=function(){var n={attributes:T({},Zs,l?Ms.BottomToTop:Ms.TopToBottom)},e=XD.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:x.popup,onEscape:function(){t.focus()}}),o=XD.parts.toolbar(_({dom:{tag:"div",classes:["tox-toolbar"]},getSink:x.popup.shared.getSink,providers:x.popup.shared.providers,onEscape:function(){t.focus()},onToolbarToggled:function(n){!function(t,n){t.dispatch("ToggleToolbarDrawer",{state:n})}(t,n)},type:f,lazyToolbar:b,lazyHeader:function(){return g().getOrDie("Could not find header element")}},n)),r=XD.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:x.popup.shared.providers,onEscape:function(){t.focus()},type:f}),i=Sv(t),u=xv(t),a=hv(t),c=dv(t),s=XD.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}}),m=i||u||a,p=c?[s,e]:[e];
2return XD.parts.header({dom:_({tag:"div",classes:["tox-editor-header"].concat(m?[]:["tox-editor-header--empty"])},n),components:lt([a?p:[],i?[r]:u?[o]:[],Ov(t)?[]:[d.asSpec()]]),sticky:Ev(t),editor:t,sharedBackstage:x.popup.shared})}(),o={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[XD.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),XD.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}})]},r=XD.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:x.popup}),i=XD.parts.viewWrapper({backstage:x.popup}),a=uv(t)&&!e?G.some(GF(t,x.popup.shared.providers)):G.none(),c=lt([l?[]:[n],e?[]:[o],l?[n]:[]]),p=XD.parts.editorContainer({components:lt([c,e?[]:[m.asSpec()]])}),h=Tv(t),v=_(_({role:"application"},ny.isRtl()?{dir:"rtl"}:{}),h?{"aria-hidden":"true"}:{}),y=Sc(XD.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(e?["tox-tinymce-inline"]:[]).concat(l?["tox-tinymce--toolbar-bottom"]:[]).concat(s),styles:_({visibility:"hidden"},h?{opacity:"0",border:"0"}:{}),attributes:v},components:[p].concat(w(e?[]:[i].concat(w(a.toArray()))),[r]),behaviours:Cu([xw(function(){return x.popup.shared.providers.checkUiComponentContext("any")}),vm.config({disableClass:"tox-tinymce--disabled"}),Cp.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"})])})),S=WC(y);return u.set(S),{mothership:S,outerContainer:y}},C=function(n){var e=uI(function(t){var n=function(t){var n=Bh(t),e=Rh(t),o=Lh(t);return iI(n).map(function(t){return aI(t,e,o)})}(t);return n.getOr(Bh(t))}(t)),o=uI(function(t){return cI(t).getOr(Ih(t))}(t));return t.inline||(te("div","width",o)&&Yn(n.element,"width",o),te("div","height",e)?Yn(n.element,"height",e):Yn(n.element,"height","400px")),e};return{popups:{backstage:x.popup,getMothership:function(){return qF("popups",c)}},dialogs:{backstage:x.dialog,getMothership:function(){return qF("dialogs",a)}},renderUI:function(){var e=S(),u=function(){var n=_v(t),e=hn(Nn(),n)&&"grid"===Jn(n,"display"),o={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(s),attributes:_({},ny.isRtl()?{dir:"rtl"}:{})},behaviours:Cu([of.config({useFixed:function(){return r.isDocked(g)}})])},i={dom:{styles:{width:document.body.clientWidth+"px"}},events:tu([ou(Ni(),function(t){Yn(t.element,"width",document.body.clientWidth+"px")})])},u=Sc(Io(o,e?i:{})),c=WC(u);return a.set(c),{sink:u,mothership:c}}(),l=Av(t)?function(){var t={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(s),attributes:_({},ny.isRtl()?{dir:"rtl"}:{})},behaviours:Cu([of.config({useFixed:function(){return r.isDocked(g)},getBounds:function(){return n.getPopupSinkBounds()}})])},e=Sc(t),o=WC(e);return c.set(o),{sink:e,mothership:o}}():function(t){return c.set(t.mothership),t}(u);return i.dialogUi.set(u),i.popupUi.set(l),i.mainUi.set(e),function(n){var e=n.mainUi,i=n.popupUi,u=n.uiMotherships;_t(jh(t),function(n,e){t.ui.registry.addGroupToolbarButton(e,n)});var a,c=t.ui.registry.getAll(),s=c.buttons,l=c.menuItems,d=c.contextToolbars,m=c.sidebars,p=c.views,h=wv(t),v={menuItems:l,menus:Mv(t),menubar:Jh(t),toolbar:h.getOrThunk(function(){return $h(t)}),allowToolbarGroups:f===yh.floating,buttons:s,sidebar:m,views:p};a=e.outerContainer,t.addShortcut("alt+F9","focus menubar",function(){XD.focusMenubar(a)}),t.addShortcut("alt+F10","focus toolbar",function(){XD.focusToolbar(a)}),t.addCommand("ToggleToolbarDrawer",function(t,n){(null==n?void 0:n.skipFocus)?XD.toggleToolbarDrawerWithoutFocusing(a):XD.toggleToolbarDrawer(a)}),t.addQueryStateHandler("ToggleToolbarDrawer",function(){return XD.isToolbarDrawerToggled(a)}),function(t,n,e){var o=function(t,o){ot([n].concat(w(e)),function(n){n.broadcastEvent(t,o)})},r=function(t,o){ot([n].concat(w(e)),function(n){n.broadcastOn([t],o)})},i=function(t){return r(Df(),{target:t.target})},u=uo(),a=Ls(u,"touchstart",i),c=Ls(u,"touchmove",function(t){return o(Ii(),t)}),s=Ls(u,"touchend",function(t){return o(Fi(),t)}),l=Ls(u,"mousedown",i),f=Ls(u,"mouseup",function(t){0===t.raw.button&&r(If(),{target:t.target})}),d=function(t){return r(Df(),{target:tn(t.target)})},m=function(t){0===t.button&&r(If(),{target:tn(t.target)})},g=function(){ot(t.editorManager.get(),function(n){t!==n&&n.dispatch("DismissPopups",{relatedTarget:t})})},p=function(t){return o(Ri(),Ps(t))},h=function(t){r(Bf(),{}),o(Ni(),Ps(t))},v=Dn(tn(t.getElement())),b=zs(v,"scroll",function(e){requestAnimationFrame(function(){if(null!=t.getContainer()){var r=Nv(t,n.element).map(function(t){return[t.element].concat(w(t.others
2))}).getOr([]);Z(r,function(t){return hn(t,e.target)})&&(t.dispatch("ElementScroll",{target:e.target.dom}),o(Wi(),e))}})}),y=function(){return r(Bf(),{})},x=function(n){n.state&&r(Df(),{target:tn(t.getContainer())})},S=function(t){r(Df(),{target:tn(t.relatedTarget.getContainer())})},C=function(n){return t.dispatch("focusin",n)},k=function(n){return t.dispatch("focusout",n)};t.on("PostRender",function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",p),t.on("ResizeWindow",h),t.on("ResizeEditor",y),t.on("AfterProgressState",x),t.on("DismissPopups",S),ot([n].concat(w(e)),function(t){t.element.dom.addEventListener("focusin",C),t.element.dom.addEventListener("focusout",k)})}),t.on("remove",function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",p),t.off("ResizeWindow",h),t.off("ResizeEditor",y),t.off("AfterProgressState",x),t.off("DismissPopups",S),ot([n].concat(w(e)),function(t){t.element.dom.removeEventListener("focusin",C),t.element.dom.removeEventListener("focusout",k)}),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind(),b.unbind()}),t.on("detach",function(){ot([n].concat(w(e)),yf),ot([n].concat(w(e)),function(t){return t.destroy()})})}(t,e.mothership,u),r.setup(t,x.popup.shared,g),RI(t,x.popup),nF(t,x.popup.shared.getSink,x.popup),function(t){var n=t.ui.registry.getAll().sidebars;ot(Ct(n),function(e){var o=n[e],r=function(){return Lt(G.from(t.queryCommandValue("ToggleSidebar")),e)};t.ui.registry.addToggleButton(e,{icon:o.icon,tooltip:o.tooltip,onAction:function(n){t.execCommand("ToggleSidebar",!1,e),n.setActive(r())},onSetup:function(n){n.setActive(r());var e=function(){return n.setActive(r())};return t.on("ToggleSidebar",e),function(){t.off("ToggleSidebar",e)}},context:"any"})})}(t),UM(t,y,x.popup.shared),EI(t,d,i.sink,{backstage:x.popup}),function(t,n){var e=ho([]),o=ho([]),r=ho(!1),i=yo(),u=yo(),a=function(t){var e=mo(t);return VF(f.getOpt(n),t,e.x,e.y,e.width,e.height)},c=function(t){var e=mo(t);return VF(d.getOpt(n),t,e.right,e.bottom,e.width,e.height)},s=HF(function(){return et(e.get(),function(t){return a(t)})},i,function(n){u.get().each(function(e){t.dispatch("TableSelectorChange",{start:n,finish:e})})}),l=HF(function(){return et(o.get(),function(t){return c(t)})},u,function(n){i.get().each(function(e){t.dispatch("TableSelectorChange",{start:e,finish:n})})}),f=UF(s),d=UF(l),m=Sc(f.asSpec()),g=Sc(d.asSpec()),p=function(n,e,o,r){var i=o(e);PF.snapTo(n,i),function(n,e){var o=e.dom.getBoundingClientRect();ne(n.element,"display");var i=wn(tn(t.getBody())).dom.innerHeight,u=o[r]<0,a=function(t,n){return t[r]>n}(o,i);(u||a)&&Yn(n.element,"display","none")}(n,e)},h=function(t){return p(m,t,a,"top")},v=function(t){return p(g,t,c,"bottom")};if(Ge().deviceType.isTouch()){var b=function(t){return et(t,tn)};t.on("TableSelectionChange",function(t){r.get()||(ff(n,m),ff(n,g),r.set(!0));var a=tn(t.start),c=tn(t.finish);i.set(a),u.set(c),G.from(t.otherCells).each(function(t){e.set(b(t.upOrLeftCells)),o.set(b(t.downOrRightCells)),h(a),v(c)})}),t.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),t.on("TableSelectionClear",function(){r.get()&&(gf(m),gf(g),r.set(!1)),i.clear(),u.clear()})}}(t,i.sink);var b={targetNode:t.getElement(),height:C(e.outerContainer)};return o.render(t,n,v,x.popup,b)}({popupUi:l,dialogUi:u,mainUi:e,uiMotherships:i.getUiMotherships()})}}},XF=N([vr("lazySink"),Or("dragBlockClass"),Pr("getBounds",po),Ir("useTabstopAt",j),Ir("firstTabstop",0),Ir("eventOrder",{}),$f("modalBehaviours",[Cp]),Ma("onExecute"),Ba("onEscape")]),KF={sketch:L},JF=N([_d({name:"draghandle",overrides:function(t,n){return{behaviours:Cu([PF.config({mode:"mouse",getTarget:function(t){return Ac(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(n,null,2)).message),getBounds:t.getDragBounds})])}}}),kd({schema:[vr("dom")],name:"title"}),kd({factory:KF,schema:[vr("dom")],name:"close"}),kd({factory:KF,schema:[vr("dom")],name:"body"}),_d({factory:KF,schema:[vr("dom")],name:"footer"}),Od({factory:{sketch:function(t,n){return _(_({},t),{},{dom:n.dom,components:n.components})}},schema:[Ir("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ir("components",[])],name:"blocker"}
2)]),$F=Zd({name:"ModalDialog",configFields:XF(),partFields:JF(),factory:function(t,n,e,o){var r=yo(),i=Wa("modal-events"),u=_(_({},t.eventOrder),{},T({},Li(),[i].concat(t.eventOrder["alloy.system.attached"]||[]))),a=Ge();return{uid:t.uid,dom:t.dom,components:n,apis:{show:function(n){r.set(n);var e=t.lazySink(n).getOrDie(),i=o.blocker(),u=e.getSystem().build(_(_({},i),{},{components:i.components.concat([Cc(n)]),behaviours:Cu([zp.config({}),Ip("dialog-blocker-events",[lu(si(),function(){VM.isBlocked(n)||Cp.focusIn(n)})])])}));ff(e,u),Cp.focusIn(n)},hide:function(t){r.clear(),Sn(t.element).each(function(n){t.getSystem().getByDom(n).each(function(t){gf(t)})})},getBody:function(n){return Pd(n,t,"body")},getFooter:function(n){return zd(n,t,"footer")},setIdle:function(t){VM.unblock(t)},setBusy:function(t,n){VM.block(t,n)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Zf(t.modalBehaviours,[Bp.config({}),Cp.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt,firstTabstop:t.firstTabstop}),VM.config({getRoot:r.get}),Ip(i,[fu(function(n){var e=Pd(n,t,"title").element,o=function(t){return t.dom.textContent}(e);a.os.isMacOS()&&O(o)?Pn(n.element,"aria-label",o):function(t,n){var e=Un(t,"id").fold(function(){var t=Wa("dialog-label");return Pn(n,"id",t),t},L);Pn(t,"aria-labelledby",e)}(n.element,e)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),QF=Yo([nx,ex].concat(Qx)),ZF=nr,tR=[Ax("button"),hx,Lr("align","end",["start","end"]),kx,Cx,Ar("buttonType",["primary","secondary"]),Nr("context","mode:design")],nR=[].concat(tR,[rx]),eR=[xr("type",["submit","cancel","custom"])].concat(w(nR)),oR=[xr("type",["menu"]),gx,vx,hx,kr("items",QF)].concat(tR),rR=[].concat(tR,[xr("type",["togglebutton"]),vx,hx,gx,zr("active",!1)]),iR=dr("type",{submit:eR,cancel:eR,custom:eR,menu:oR,togglebutton:rR}),uR=[nx,rx,xr("level",["info","warn","error","success"]),ux,Ir("url","")],aR=Yo(uR),cR=[nx,rx,Cx,Ax("button"),hx,Sx,Ar("buttonType",["primary","secondary","toolbar"]),kx,Nr("context","mode:design")],sR=Yo(cR),lR=[nx,ex],fR=lR.concat([bx]),dR=lR.concat([ox,Cx,Nr("context","mode:design")]),mR=Yo(dR),gR=nr,pR=fR.concat([Ox("auto"),Nr("context","mode:design")]),hR=Yo(pR),vR=Jo([ax,rx,ux]),bR=fR.concat([Nr("storageKey","default"),Nr("context","mode:design")]),yR=Yo(bR),xR=tr,wR=Yo(fR),SR=tr,CR=lR.concat([Nr("tag","textarea"),yr("scriptId"),yr("scriptUrl"),Mr("onFocus"),Fr("settings",void 0,rr)]),kR=lR.concat([Nr("tag","textarea"),wr("init")]),OR=ur(function(t){return cr("customeditor.old",qo(kR),t).orThunk(function(){return cr("customeditor.new",qo(CR),t)})}),_R=tr,TR=fR.concat([Nr("context","mode:design")]),ER=Yo(TR),AR=Xo(Uo),MR=function(t){return[nx,br("columns",Zo),t]},DR=[nx,yr("html"),Lr("presets","presentation",["presentation","document"]),Pr("onInit",I),zr("stretched",!1)],BR=Yo(DR),IR=fR.concat([zr("border",!1),zr("sandboxed",!0),zr("streamContent",!1),zr("transparent",!0)]),FR=Yo(IR),RR=tr,NR=Yo(lR.concat([Er("height")])),LR=Yo([yr("url"),Tr("zoom"),Tr("cachedWidth"),Tr("cachedHeight")]),zR=fR.concat([Er("inputMode"),Er("placeholder"),zr("maximized",!1),Cx,Nr("context","mode:design")]),PR=Yo(zR),VR=tr,HR=function(t){return[nx,ox,t,Lr("align","start",["start","center","end"]),Er("for")]},UR=[rx,ax],WR=[rx,kr("items",mr(0,function(){return jR}))],jR=Ko([Yo(UR),Yo(WR)]),GR=fR.concat([kr("items",jR),Cx,Nr("context","mode:design")]),qR=Yo(GR),YR=tr,XR=fR.concat([Cr("items",[rx,ax]),Rr("size",1),Cx,Nr("context","mode:design")]),KR=Yo(XR),JR=tr,$R=fR.concat([zr("constrain",!0),Cx,Nr("context","mode:design")]),QR=Yo($R),ZR=Yo([yr("width"),yr("height")]),tN=lR.concat([ox,Rr("min",0),Rr("max",0)]),nN=Yo(tN),eN=Zo,oN=[nx,kr("header",tr),kr("cells",Xo(tr))],rN=Yo(oN),iN=fR.concat([Er("placeholder"),zr("maximized",!1),Cx,Nr("context","mode:design")]),uN=Yo(iN),aN=tr,cN=[xr("type",["directory","leaf"]),ix,yr("id"),_r("menu",wM),Er("customStateIcon"),Er("customStateIconTooltip")],sN=Yo(cN),lN=cN.concat([kr("children",mr(0,function(){return ir("type",{directory:fN,leaf:sN})}))]),fN=Yo(lN),dN=ir("type",{directory:fN,leaf:sN}),mN=[nx,kr("items",dN),Mr("onLeafAction"),Mr("onToggleExpand"),Vr("defaultExpandedIds",[],tr),Er("defaultSelectedId")],gN=Yo(mN),pN=fR.concat([Lr("filetype","file",["image","media","file"]),Cx,Er("picker_text"),Nr("context","mode:design")]),hN=Yo(pN),vN=Yo([ax,_x]),bN=function(t){return gr("items","items",{tag:"required",process:{}},Xo(ur(function(n){return cr("Checking item of ".concat(t),yN,n).fold(function(t){return Co.error(fr(t))},function(t){return Co.value(t)})})))},yN=Go(function(){return ir("type",{alertbanner:aR,bar:Yo((t=bN("bar"),[nx,t])),button:sR,checkbox:mR,colorinput:yR,colorpicker:wR,dropzone:ER,grid:Yo(MR(bN("grid"))),iframe:FR,input
2:PR,listbox:qR,selectbox:KR,sizeinput:QR,slider:nN,textarea:uN,urlinput:hN,customeditor:OR,htmlpanel:BR,imagepreview:NR,collection:hR,label:Yo(HR(bN("label"))),table:rN,tree:gN,panel:wN});var t}),xN=[nx,Ir("classes",[]),kr("items",yN)],wN=Yo(xN),SN=[Ax("tab"),ix,kr("items",yN)],CN=[nx,Cr("tabs",SN)],kN=Yo(CN),ON=nR,_N=iR,TN=Yo([yr("title"),br("body",ir("type",{panel:wN,tabpanel:kN})),Nr("size","normal"),Vr("buttons",[],_N),Ir("initialData",{}),Pr("onAction",I),Pr("onChange",I),Pr("onSubmit",I),Pr("onClose",I),Pr("onCancel",I),Pr("onTabChange",I)]),EN=Yo([xr("type",["cancel","custom"])].concat(w(ON))),AN=Yo([yr("title"),yr("url"),Tr("height"),Tr("width"),Dr("buttons",EN),Pr("onAction",I),Pr("onCancel",I),Pr("onClose",I),Pr("onMessage",I)]),MN=function(t){return d(t)?[t].concat(ft(It(t),MN)):g(t)?ft(t,MN):[]},DN=function(t){return f(t.type)&&f(t.name)},BN={checkbox:gR,colorinput:xR,colorpicker:SR,dropzone:AR,input:VR,iframe:RR,imagepreview:LR,selectbox:JR,sizeinput:ZR,slider:eN,listbox:YR,size:ZR,textarea:aN,urlinput:vN,customeditor:_R,collection:vR,togglemenuitem:ZF},IN=function(t){var n=function(t){return it(MN(t),DN)}(t),e=ft(n,function(t){return function(t){return G.from(BN[t.type])}(t).fold(function(){return[]},function(n){return[br(t.name,n)]})});return Yo(e)},FN=function(t){var n;return{internalDialog:sr(cr("dialog",TN,t)),dataValidator:IN(t),initialData:null!==(n=t.initialData)&&void 0!==n?n:{}}},RN={open:function(t,n){var e=FN(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(sr(cr("dialog",AN,n)))},redial:function(t){return FN(t)}},NN=Object.freeze({__proto__:null,events:function(t,n){var e=function(e,o){t.updateState.each(function(t){var r=t(e,o);n.set(r)}),t.renderComponents.each(function(r){var i=r(o,n.get());(t.reuseDom?Op:kp)(e,i)})};return tu([ou(Oi(),function(n,o){var r=o;if(!r.universal){var i=t.channel;Q(r.channels,i)&&e(n,r.data)}}),fu(function(n,o){t.initialData.each(function(t){e(n,t)})})])}}),LN=Object.freeze({__proto__:null,getState:function(t,n,e){return e}}),zN=[vr("channel"),Or("renderComponents"),Or("updateState"),Or("initialData"),zr("reuseDom",!0)],PN=Ou({fields:zN,name:"reflecting",active:NN,apis:LN,state:Object.freeze({__proto__:null,init:function(){var t=ho(G.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(G.none())}}}})}),VN=function(t){var n=[],e={};return Ot(t,function(t,o){t.fold(function(){n.push(o)},function(t){e[o]=t})}),n.length>0?Co.error(n):Co.value(e)},HN=function(t,n,e,o){var r,i=Vv(l_.sketch(function(r){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:et(t.items,function(t){return LE(r,t,n,e,o)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[i.asSpec()]}],behaviours:Cu([Cp.config({mode:"acyclic",useTabstopAt:V(N_)}),(r=i,om.config({find:r.getOpt})),x_(i,{postprocess:function(t){return VN(t).fold(function(t){return console.error(t),{}},L)}}),Ip("dialog-body-panel",[ou(si(),function(t,n){t.getSystem().broadcastOn([U_],{newFocus:G.some(n.event.target)})})])])}},UN=Qd({name:"TabButton",configFields:[Ir("uid",void 0),vr("value"),gr("dom","dom",Lo(function(){return{attributes:{role:"tab",id:Wa("aria"),"aria-selected":"false"}}}),$o()),Or("action"),Ir("domModification",{}),$f("tabButtonBehaviours",[zp,Cp,Jf]),vr("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:Xp(t.action),behaviours:Zf(t.tabButtonBehaviours,[zp.config({}),Cp.config({mode:"execution",useSpace:!0,useEnter:!0}),Jf.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),WN=N([vr("tabs"),vr("dom"),Ir("clickToDismiss",!1),$f("tabbarBehaviours",[Tm,Cp]),Ta(["tabClass","selectedClass"])]),jN=Td({factory:UN,name:"tabs",unit:"tab",overrides:function(t){var n=function(t,n){Tm.dehighlight(t,n),Ki(t,Gi(),{tabbar:t,button:n})},e=function(t,n){Tm.highlight(t,n),Ki(t,ji(),{tabbar:t,button:n})};return{action:function(o){var r=o.getSystem().getByUid(t.uid).getOrDie(),i=Tm.isHighlighted(r,o);(i&&t.clickToDismiss?n:i?I:e)(r,o)},domModification:{classes:[t.markers.tabClass]}}}}),GN=N([jN]),qN=Zd({name:"Tabbar",configFields:WN(),partFields:GN(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Zf(t.tabbarBehaviours,[Tm.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){Pn(n.element,"aria-selected","true")},onDehighlight:function(t,n){Pn(n.element,"aria-selected","false")}}),Cp.config({mode:"flow",getInitial:function(t){return Tm.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}
2),YN=Qd({name:"Tabview",configFields:[$f("tabviewBehaviours",[Bp])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:Zf(t.tabviewBehaviours,[Bp.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),XN=N([Ir("selectFirst",!0),Aa("onChangeTab"),Aa("onDismissTab"),Ir("tabs",[]),$f("tabSectionBehaviours",[])]),KN=kd({factory:qN,schema:[vr("dom"),Sr("markers",[vr("tabClass"),vr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),JN=kd({factory:YN,name:"tabview"}),$N=N([KN,JN]),QN=Zd({name:"TabSection",configFields:XN(),partFields:$N(),factory:function(t,n,e,o){var r=function(n,e){zd(n,t,"tabbar").each(function(t){e(t).each(Ji)})};return{uid:t.uid,dom:t.dom,components:n,behaviours:Qf(t.tabSectionBehaviours),events:tu(lt([t.selectFirst?[fu(function(t,n){r(t,Tm.getFirst)})]:[],[ou(ji(),function(n,e){!function(n){var e=Jf.getValue(n);zd(n,t,"tabview").each(function(o){ct(t.tabs,function(t){return t.value===e}).each(function(e){var r=e.view();Un(n.element,"id").each(function(t){Pn(o.element,"aria-labelledby",t)}),Bp.set(o,r),t.onChangeTab(o,n,r)})})}(e.event.button)}),ou(Gi(),function(n,e){var o=e.event.button;t.onDismissTab(n,o)})]])),apis:{getViewItems:function(n){return zd(n,t,"tabview").map(function(t){return Bp.contents(t)}).getOr([])},showTab:function(t,n){r(t,function(t){var e=Tm.getCandidates(t);return ct(e,function(t){return Jf.getValue(t)===n}).filter(function(n){return!Tm.isHighlighted(t,n)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),ZN=function(t,n){Yn(t,"height",n+"px"),Yn(t,"flex-basis",n+"px")},tL=function(t,n,e){Ac(t,'[role="dialog"]').each(function(t){Dc(t,'[role="tablist"]').each(function(o){e.get().map(function(e){return Yn(n,"height","0"),Yn(n,"flex-basis","0"),Math.min(e,function(t,n,e){var o,r=xn(t).dom,i=Ac(t,".tox-dialog-wrap").getOr(t);o="fixed"===Jn(i,"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight);var u=ie(n),a=n.dom.offsetLeft>=e.dom.offsetLeft+me(e)?Math.max(ie(e),u):u,c=parseInt(Jn(t,"margin-top"),10)||0,s=parseInt(Jn(t,"margin-bottom"),10)||0;return o-(ie(t)+c+s-a)}(t,n,o))}).each(function(t){ZN(n,t)})})})},nL=function(t){return Dc(t,'[role="tabpanel"]')},eL="send-data-to-section",oL="send-data-to-view",rL=function(t,n,e,o){var r=ho({}),i=function(t){var n=Jf.getValue(t),e=VN(n).getOr({}),o=r.get(),i=Io(o,e);r.set(i)},u=function(t){var n=r.get();Jf.setValue(t,n)},a=ho(null),c=et(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[bc(e.shared.providers.translate(t.title))],view:function(){return[l_.sketch(function(r){return{dom:{tag:"div",classes:["tox-form"]},components:et(t.items,function(t){return LE(r,t,n,e,o)}),formBehaviours:Cu([Cp.config({mode:"acyclic",useTabstopAt:V(N_)}),Ip("TabView.form.events",[fu(u),du(i)]),hs.config({channels:qr([{key:eL,value:{onReceive:i}},{key:oL,value:{onReceive:u}}])})])}})]}}}),s=function(t){var n=yo(),e=[fu(function(e){var o=e.element;nL(o).each(function(r){Yn(r,"visibility","hidden"),e.getSystem().getByDom(r).toOptional().each(function(e){var o=function(t,n,e){return et(t,function(o,r){Bp.set(e,t[r].view());var i=n.dom.getBoundingClientRect();return Bp.set(e,[]),i.height})}(t,r,e),i=function(t){return yt(vt(t,function(t,n){return t>n?-1:t<n?1:0}))}(o);i.fold(n.clear,n.set)}),tL(o,r,n),ne(r,"visibility"),function(t,n){yt(t).each(function(t){return QN.showTab(n,t.value)})}(t,e),requestAnimationFrame(function(){tL(o,r,n)})})}),ou(Ni(),function(t){var e=t.element;nL(e).each(function(t){tL(e,t,n)})}),ou(uk,function(t,e){var o=t.element;nL(o).each(function(t){var e=ws(Dn(t));Yn(t,"visibility","hidden");var r=Qn(t,"height").map(function(t){return parseInt(t,10)});ne(t,"height"),ne(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;r.forall(function(t){return i>t})?(n.set(i),tL(o,t,n)):r.each(function(n){ZN(t,n)}),ne(t,"visibility"),e.each(bs)})})];return{extraEvents:e,selectFirst:!1}}(c);return QN.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Jf.getValue(n);Ki(t,ik,{name:o,oldName:a.get()}),a.set(o)},tabs:c,components:[QN.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[qN.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Cu([Wv.config({})])}),QN.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:Cu([Ip("tabpanel",s.extraEvents),Cp.config({mode:"acyclic"}),om.config({find:function(t){return yt(QN.getViewItems(t))}}),w_(G.none(),function(t){return t.getSystem().broadcastOn([eL],{}),r.get()},function(t,n){r.set(n),t.getSystem().broadcastOn([oL],{})})])})},iL=function(t,n,e,o,r,i){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:_(_({},e.map(function(t){return{id:t}}).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:Cu([b_(0),PN.config({channel:"".concat(P_,"-").concat(n),updateState:function(t,n){return G.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){var n=t.body;return"tabpanel"===n.type?[rL(n,t.initialData,o,i)]:[HN(n,t.initialData,o,i)]},initialData:t})])}},uL=Th.deviceType.isTouch(),aL=function(t,n){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,n]}},cL=function(t,n){return $F.parts.close(zv.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:Cu([Wv.config({})])}))},sL=function(){return $F.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},lL=function(t,n){return $F.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Pv("<p>".concat(ty(n.translate(t)),"</p>"))}]}]})},fL=function(t){return $F.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},dL=function(t,n){return[UC.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),UC.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]}
2,components:n})]},mL=function(t){var n="tox-dialog",e=n+"-wrap",o=e+"__backdrop",r=n+"__disable-scroll";return $F.sketch({lazySink:t.lazySink,onEscape:function(n){return t.onEscape(n),G.some(!0)},useTabstopAt:function(t){return!N_(t)},firstTabstop:t.firstTabstop,dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:_({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(w(t.footer.toArray())),parts:{blocker:{dom:Pv('<div class="'.concat(e,'"></div>')),components:[{dom:{tag:"div",classes:uL?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:e,modalBehaviours:Cu([zp.config({}),Ip("dialog-events",t.dialogEvents.concat([lu(si(),function(t,n){VM.isBlocked(t)||Cp.focusIn(t)}),ou(Hi(),function(t,n){t.getSystem().broadcastOn([U_],{newFocus:n.event.newFocus})})])),Ip("scroll-lock",[fu(function(){Fu(Nn(),r)}),du(function(){Nu(Nn(),r)})])].concat(w(t.extraBehaviours))),eventOrder:_(T(T(T({},_i(),["dialog-events"]),Li(),["scroll-lock","dialog-events","alloy.base.behaviour"]),zi(),["alloy.base.behaviour","dialog-events","scroll-lock"]),t.eventOrder)})},gL=function(t){return zv.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:Cu([Wv.config({}),tb.config(t.tooltips.getConfig({tooltipText:t.translate("Close")}))]),components:[ly("close",{tag:"span",classes:["tox-icon"]},t.icons)],action:function(t){Xi(t,tk)}})},pL=function(t,n,e,o){return{dom:{tag:"h1",classes:["tox-dialog__title"],attributes:_({},e.map(function(t){return{id:t}}).getOr({}))},components:[],behaviours:Cu([PN.config({channel:"".concat(z_,"-").concat(n),initialData:t,renderComponents:function(t){return[bc(o.translate(t.title))]}})])}},hL=function(){return{dom:Pv('<div class="tox-dialog__draghandle"></div>')}},vL=function(t,n,e){return function(t,n,e){var o=$F.parts.title(pL(t,n,G.none(),e)),r=$F.parts.draghandle(hL()),i=$F.parts.close(gL(e)),u=[o].concat(t.draggable?[r]:[]).concat([i]);return UC.sketch({dom:Pv('<div class="tox-dialog__header"></div>'),components:u})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},n,e.shared.providers)},bL=function(t,n,e,o){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"".concat(o.getOr(0),"px"),position:"absolute"}},behaviours:n,components:[{dom:Pv('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},yL=function(t,n,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){var o=Dc(t().element,".tox-dialog__header").map(function(t){return ie(t)});$F.setBusy(t(),function(t,r){return bL(e.message,r,n,o)})},onUnblock:function(){$F.setIdle(t())}}},xL="tox-dialog--fullscreen",wL="tox-dialog--width-lg",SL="tox-dialog--width-md",CL=function(t){switch(t){case"large":return G.some(wL);case"medium":return G.some(SL);default:return G.none()}},kL=function(t,n){var e=tn(n.element.dom);Lu(e,xL)||(Pu(e,[wL,SL]),CL(t).each(function(t){return Fu(e,t)}))},OL=function(t,n){var e=tn(t.element.dom),o=Vu(e),r=ct(o,function(t){return t===wL||t===SL}).or(CL(n));!function(t,n){ot(n,function(n){!function(t,n){Mu(t)?t.dom.classList.toggle(n):function(t,n){Q(Du(t),n)?Iu(t,n):Bu(t,n)}(t,n);Ru(t)}(t,n)})}(e,[xL].concat(w(r.toArray())))},_L=function(t,n,e){return Sc(mL(_(_({},t),{},{firstTabstop:1,lazySink:e.shared.getSink,extraBehaviours:[C_({})].concat(w(t.extraBehaviours)),onEscape:function(t){Xi(t,tk)},dialogEvents:n,eventOrder:T(T(T({},Oi(),[PN.name(),hs.name()]),Li(),["scroll-lock",PN.name(),"messages","dialog-events","alloy.base.behaviour"]),zi(),["alloy.base.behaviour","dialog-events","messages",PN.name(),"scroll-lock"])})))},TL=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return et(t,function(t){return"menu"===t.type?function(t){var e=et(t.items,function(t){var e=Ft(n,t.name).getOr(ho(!1));return _(_({},t),{},{storage:e})});return _(_({},t),{},{items:e})}(t):t})},EL=function(t){return at(t,function(t,n){return"menu"===n.type?at(n.items,function(t,n){return t[n.name]=n.storage,t},t):t},{})},AL=function(t,n){return[au(si(),R_),t(ZC,function(t,e,o,r){xs(r.element)&&ws(Dn(r.element)).each(ys),n.onClose(),e.onClose()}),t(tk,function(t,n,e,o){n.onCancel(t),Xi(o,ZC)}),ou(rk,function(t,e){return n.onUnblock()}),ou(ok,function(t,e){return n.onBlock(e.event)})]},ML=function(t,n,e){var o=function(n,e){return ou(n,function(n,o){r(n,function(r,i){e(t(),r,o.event,n)})})},r=function(t,n){PN.getState(t).get().each(function(e){n(e.internalDialog,t)})};return[].concat(w(AL(o,n)),[o(ek,function(t,n){return n.onSubmit(t)}),o(QC,function(t,n,e){n.onChange(t,{name:e.name})}),o(nk,function(t,n,o,r){var i=function(){return r.getSystem().isConnected()?Cp.focusIn(r):void 0},u=function(t){return Wn(t,"disabled")||Un(t,"aria-disabled").exists(function(t){return"true"===t})},a=Dn(r.element),c=ws(a);n.onAction(t,{name:o.name,value:o.value}),ws(a).fold(i,function(t){u(t)||c.exists(function(n){return vn(t,n)&&u(n)})?i():e().toOptional().filter(function(n){return!vn(n.element,t)}).each(i)})}),o(ik,function(t,n,e){n.onTabChange(t,{newTabName:e.name,oldTabName:e.oldName})}),du(function(n){var e=t();Jf.setValue(n,e.getData())})])},DL=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=rt(e,function(t){return"start"===t.align}),r=function(t,n){return UC.sketch({dom:{tag:"div",classes:["tox-dialog__footer-".concat(t)]},components:et(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},BL=function(t,n,e){return{dom:Pv('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Cu([PN.config({channel:"".concat(V_,"-").concat(n),initialData:t,updateState:function(t,n){var o=et(n.buttons,function(t){var n=Vv(function(t,n){return wE(t,t.type,n)}(t,e));return{name:t.name,align:t.align,memento:n}});return G.some({lookupByName:function(n){return function(t,n,e){return ct(n,function(t){return t.name===e}).bind(function(n){return n.memento.getOpt(t)})}(t,o,n)},footerButtons:o})},renderComponents:DL})])}},IL=function(t,n,e){return $F.parts.footer(BL(t,n,e))},FL=function(t,n){if(t.getRoot().getSystem().isConnected()){var e=om.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return l_.getField(e,n).orThunk(function(){return t.getFooter().bind(function(t){return PN.getState(t).get()}).bind(function(t){return t.lookupByName(n)})})}return G.none()},RL=function(t,n,e){var o=function(n){var e=t.getRoot();e.getSystem().isConnected()&&n(e)}
2,r={getData:function(){var n=t.getRoot(),o=n.getSystem().isConnected()?t.getFormWrapper():n;return _(_({},Jf.getValue(o)),_t(e,function(t){return t.get()}))},setData:function(n){o(function(o){var i=r.getData(),u=Io(i,n),a=function(t,n){var e=t.getRoot();return PN.getState(e).get().map(function(t){return sr(cr("data",t.dataValidator,n))}).getOr(n)}(t,u),c=t.getFormWrapper();Jf.setValue(c,a),Ot(e,function(t,n){Rt(u,n)&&t.set(u[n])})})},setEnabled:function(n,e){FL(t,n).each(e?vm.enable:vm.disable)},focus:function(n){FL(t,n).each(zp.focus)},block:function(t){if(!f(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");o(function(n){Ki(n,ok,{message:t})})},unblock:function(){o(function(t){Xi(t,rk)})},showTab:function(n){o(function(e){var o=t.getBody();PN.getState(o).get().exists(function(t){return t.isTabPanel()})&&om.getCurrent(o).each(function(t){QN.showTab(t,n)})})},redial:function(i){o(function(o){var u=t.getId(),a=n(i),c=TL(a.internalDialog.buttons,e);o.getSystem().broadcastOn(["".concat(L_,"-").concat(u)],a),o.getSystem().broadcastOn(["".concat(z_,"-").concat(u)],a.internalDialog),o.getSystem().broadcastOn(["".concat(P_,"-").concat(u)],a.internalDialog),o.getSystem().broadcastOn(["".concat(V_,"-").concat(u)],_(_({},a.internalDialog),{},{buttons:c})),r.setData(a.initialData)})},close:function(){o(function(t){Xi(t,ZC)})},toggleFullscreen:t.toggleFullscreen};return r},NL=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,i=Wa("dialog"),u=Wa("dialog-label"),a=Wa("dialog-content"),c=t.internalDialog,s=ho(c.size),l=CL(s.get()).toArray(),f=Vv(function(t,n,e,o){return UC.sketch({dom:Pv('<div class="tox-dialog__header"></div>'),components:[pL(t,n,G.some(e),o),hL(),gL(o)],containerBehaviours:Cu([PF.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Bc(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:c.title,draggable:!0},i,u,e.shared.providers)),d=Vv(function(t,n,e,o,r){return iL(t,n,G.some(e),o,r,function(t){return FL(y,t)})}({body:c.body,initialData:c.initialData},i,a,e,o)),m=TL(c.buttons),g=EL(m),p=Ht(0!==m.length,Vv(function(t,n,e){return BL(t,n,e)}({buttons:m},i,e))),h=ML(function(){return x},{onBlock:function(t){VM.block(b,function(n,o){var r=f.getOpt(b).map(function(t){return ie(t.element)});return bL(t.message,o,e.shared.providers,r)})},onUnblock:function(){VM.unblock(b)},onClose:function(){return n.closeWindow()}},e.shared.getSink),v=Ge().os,b=Sc({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"].concat(w(l)),attributes:_({role:"dialog"},v.isMacOS()?{"aria-label":c.title}:{"aria-labelledby":u})},eventOrder:T(T(T({},Oi(),[PN.name(),hs.name()]),_i(),["execute-on-form"]),Li(),["reflecting","execute-on-form"]),behaviours:Cu([Cp.config({mode:"cyclic",onEscape:function(t){return Xi(t,ZC),G.some(!0)},useTabstopAt:function(t){return!N_(t)&&("button"!==rn(t)||"disabled"!==Hn(t,"disabled"))},firstTabstop:1}),PN.config({channel:"".concat(L_,"-").concat(i),updateState:function(t,n){return s.set(n.internalDialog.size),kL(n.internalDialog.size,t),r(),G.some(n)},initialData:t}),zp.config({}),Ip("execute-on-form",h.concat([lu(si(),function(t,n){Cp.focusIn(t)}),ou(Hi(),function(t,n){t.getSystem().broadcastOn([U_],{newFocus:n.event.newFocus})})])),VM.config({getRoot:function(){return G.some(b)}}),Bp.config({}),C_({})]),components:[f.asSpec(),d.asSpec()].concat(w(p.map(function(t){return t.asSpec()}).toArray()))}),y={getId:N(i),getRoot:N(b),getFooter:function(){return p.map(function(t){return t.get(b)})},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return om.getCurrent(t).getOr(t)},toggleFullscreen:function(){OL(b,s.get())}},x=RL(y,n.redial,g);return{dialog:b,instanceApi:x}},LL=tinymce.util.Tools.resolve("tinymce.util.URI"),zL=["insertContent","setContent","execCommand","close","block","unblock"],PL=function(t){return d(t)&&-1!==zL.indexOf(t.mceAction)},VL=function(t,n,e,o){var r=Wa("dialog"),i=vL(t.title,r,o),u=function(t){var n={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[I_(G.none(),{dom:{tag:"iframe",attributes:{src:t.url}},behaviours:Cu([Wv.config({}),zp.config({})])})]}],behaviours:Cu([Cp.config({mode:"acyclic",useTabstopAt:V(N_)})])};return $F.parts.body(n)}(t),a=t.buttons.bind(function(t){return 0===t.length?G.none():G.some(IL({buttons:t},r,o))}),c=function(t,n){var e=function(t,n){return ou(t,function(t,e){o(t,function(o,r){n(b,o,e.event,t)})})},o=function(t,n){PN.getState(t).get().each(function(e){n(e,t)})};return[].concat(w(AL(e,n)),[e(nk,function(t,n,e){n.onAction(t,{name:e.name})})])}(0,yL(function(){return v},o.shared.providers,n)),s=_(_({},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"}})),l=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],m=new LL(t.url,{base_uri:new LL(window.location.href)}),g="".concat(m.protocol,"://").concat(m.host).concat(m.port?":"+m.port:""),p=bo(),h=[PN.config({channel:"".concat(L_,"-").concat(r),updateState:function(t,n){return G.some(n)},initialData:t}),Ip("messages",[fu(function(){var n=Ls(tn(window),"message",function(n){if(m.isSameOrigin(new LL(n.raw.origin))){var o=n.raw.data;PL(o)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!y(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;
2case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(e,b,o):function(t){return!PL(t)&&d(t)&&Rt(t,"mceAction")}(o)&&t.onMessage(b,o)}});p.set(n)}),du(p.clear)]),hs.config({channels:T({},H_,{onReceive:function(t,n){Dc(t.element,"iframe").each(function(t){var e=t.dom.contentWindow;O(e)&&e.postMessage(n,g)})}})})],v=_L({id:r,header:i,body:u,footer:a,extraClasses:l,extraBehaviours:h,extraStyles:s},c,o),b=function(t){var n=function(n){t.getSystem().isConnected()&&n(t)};return{block:function(t){if(!f(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Ki(n,ok,{message:t})})},unblock:function(){n(function(t){Xi(t,rk)})},close:function(){n(function(t){Xi(t,ZC)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([H_],t)})}}}(v);return{dialog:v,instanceApi:b}},HL=function(t,n){return sr(cr("data",n,t))},UL=function(t){return FC(t,".tox-alert-dialog")||FC(t,".tox-confirm-dialog")},WL=function(t,n,e){return n&&e?[]:[La.config({contextual:{lazyContext:function(){return G.some(fo(tn(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:function(n){return Nv(t,n.element).map(function(t){return{bounds:Lv(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:le(t.element).top})}}).getOrThunk(function(){return{bounds:po(),optScrollEnv:G.none()}})}})]},jL=function(t){var n=t.editor,e=Ev(n),o=function(t){var n=t.shared;return{open:function(e,o){var r=function(){$F.hide(c),o()},i=Vv(wE({context:"any",name:"close-alert",text:"OK",primary:!0,buttonType:G.some("primary"),align:"end",enabled:!0,icon:G.none()},"cancel",t)),u=sL(),a=cL(r,n.providers),c=Sc(mL({lazySink:function(){return n.getSink()},header:aL(u,a),body:lL(e,n.providers),footer:G.some(fL(dL([],[i.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[ou(tk,r)],eventOrder:{}}));$F.show(c);var s=i.get(c);zp.focus(s)}}}(t.backstages.dialog),r=function(t){var n=t.shared;return{open:function(e,o){var r=function(t){$F.hide(s),o(t)},i=Vv(wE({context:"any",name:"yes",text:"Yes",primary:!0,buttonType:G.some("primary"),align:"end",enabled:!0,icon:G.none()},"submit",t)),u=wE({context:"any",name:"no",text:"No",primary:!1,buttonType:G.some("secondary"),align:"end",enabled:!0,icon:G.none()},"cancel",t),a=sL(),c=cL(function(){return r(!1)},n.providers),s=Sc(mL({lazySink:function(){return n.getSink()},header:aL(a,c),body:lL(e,n.providers),footer:G.some(fL(dL([],[u,i.asSpec()]))),onEscape:function(){return r(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[ou(tk,function(){return r(!1)}),ou(ek,function(){return r(!0)})],eventOrder:{}}));$F.show(s);var l=i.get(s);zp.focus(l)}}}(t.backstages.dialog),i=function(n,e){return RN.open(function(n,o,r){var i=o,u=function(t,n,e){var o=Wa("dialog"),r=t.internalDialog,i=vL(r.title,o,e),u=ho(r.size),a=CL(u.get()).toArray(),c=function(t,n,e){var o=iL(t,n,G.none(),e,!1,function(t){return FL(p,t)});return $F.parts.body(o)}({body:r.body,initialData:r.initialData},o,e),s=TL(r.buttons),l=EL(s),f=Ht(0!==s.length,IL({buttons:s},o,e)),d=ML(function(){return h},yL(function(){return g},e.shared.providers,n),e.shared.getSink),m={id:o,header:i,body:c,footer:f,extraClasses:a,extraBehaviours:[PN.config({channel:"".concat(L_,"-").concat(o),updateState:function(t,n){return u.set(n.internalDialog.size),kL(n.internalDialog.size,t),G.some(n)},initialData:t})],extraStyles:{}},g=_L(m,d,e),p={getId:N(o),getRoot:N(g),getBody:function(){return $F.getBody(g)},getFooter:function(){return $F.getFooter(g)},getFormWrapper:function(){var t=$F.getBody(g);return om.getCurrent(t).getOr(t)},toggleFullscreen:function(){OL(g,u.get())}},h=RL(p,n.redial,l);return{dialog:g,instanceApi:h}}({dataValidator:r,initialData:i,internalDialog:n},{redial:RN.redial,closeWindow:function(){$F.hide(u.dialog),e(u.instanceApi)}},t.backstages.dialog);return $F.show(u.dialog),u.instanceApi.setData(i),u.instanceApi},n)},u=function(o,r,i,u){return RN.open(function(o,a,c){var s=HL(a,c),l=yo(),f=t.backstages.popup.shared.header.isPositionedAtTop(),d=function(){return l.on(function(t){Ch.reposition(t),e&&f||La.refresh(t)})},m=NL({dataValidator:c,initialData:s,internalDialog:o},{redial:RN.redial,closeWindow:function(){l.on(Ch.hide),n.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},t.backstages.popup,u.ariaAttrs,d),g=Sc(Ch.sketch(_(_({lazySink:t.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:u.persistent?{event:"doNotDismissYet"}:{}},f?{}:{fireRepositionEventInstead:{}}),{},{inlineBehaviours:Cu([Ip("window-manager-inline-events",[ou(Pi(),function(t,n){Xi(m.dialog,tk)})])].concat(w(WL(n,e,f)))),isExtraPart:function(t,n){return UL(n)}})));
2return l.set(g),Ch.showWithinBounds(g,Cc(m.dialog),{anchor:r},function(){var t=n.inline?Nn():tn(n.getContainer()),e=fo(t);return G.some(e)}),e&&f||(La.refresh(g),n.on("ResizeEditor",d)),m.instanceApi.setData(s),Cp.focusIn(m.dialog),m.instanceApi},o)},a=function(e,o,r,i){return RN.open(function(e,u,a){var c=HL(u,a),s=yo(),l=t.backstages.popup.shared.header.isPositionedAtTop(),f=function(){return s.on(function(t){Ch.reposition(t),La.refresh(t)})},d=NL({dataValidator:a,initialData:c,internalDialog:e},{redial:RN.redial,closeWindow:function(){s.on(Ch.hide),n.off("ResizeEditor ScrollWindow ElementScroll",f),s.clear(),r(d.instanceApi)}},t.backstages.popup,i.ariaAttrs,f),m=Sc(Ch.sketch(_(_({lazySink:t.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:i.persistent?{event:"doNotDismissYet"}:{}},l?{}:{fireRepositionEventInstead:{}}),{},{inlineBehaviours:Cu([Ip("window-manager-inline-events",[ou(Pi(),function(t,n){Xi(d.dialog,tk)})]),La.config({contextual:{lazyContext:function(){return G.some(fo(tn(n.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:function(t){return Nv(n,t.element).map(function(t){return{bounds:Lv(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:le(t.element).top})}}).getOrThunk(function(){return{bounds:po(),optScrollEnv:G.none()}})}})]),isExtraPart:function(t,n){return UL(n)}})));return s.set(m),Ch.showWithinBounds(m,Cc(d.dialog),{anchor:o},function(){return t.backstages.popup.shared.getSink().toOptional().bind(function(t){var e=Nv(n,t.element).map(function(t){return Lv(t)}).getOr(po()),o=fo(tn(n.getContentAreaContainer())),r=go(o,e);return G.some(lo(r.x,r.y,r.width,r.height-15))})}),La.refresh(m),n.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",f),d.instanceApi.setData(c),Cp.focusIn(d.dialog),d.instanceApi},e)};return{open:function(n,e,o){if(!C(e)){if("toolbar"===e.inline)return u(n,t.backstages.popup.shared.anchors.inlineDialog(),o,e);if("bottom"===e.inline)return a(n,t.backstages.popup.shared.anchors.inlineBottomDialog(),o,e);if("cursor"===e.inline)return u(n,t.backstages.popup.shared.anchors.cursor(),o,e)}return i(n,o)},openUrl:function(e,o){return function(e,o){return RN.openUrl(function(e){var r=VL(e,{closeWindow:function(){$F.hide(r.dialog),o(r.instanceApi)}},n,t.backstages.dialog);return $F.show(r.dialog),r.instanceApi},e)}(e,o)},alert:function(t,n){o.open(t,n)},close:function(t){t.close()},confirm:function(t,n){r.open(t,n)}}},GL=function(t){Mh(t),function(t){var n=t.options.register,e=function(t){return B(t,f)?{value:(n=t,CS(n.map(function(t,n){return n%2==0?"#"+function(t){return(n=t,Uw(n)?G.some({value:Ww(n)}):G.none()).orThunk(function(){return eS(t).map(Gw)}).getOrThunk(function(){var n=document.createElement("canvas");n.height=1,n.width=1;var e=n.getContext("2d");e.clearRect(0,0,n.width,n.height),e.fillStyle="#FFFFFF",e.fillStyle=t,e.fillRect(0,0,1,1);var o=e.getImageData(0,0,1,1).data,r=o[0],i=o[1],u=o[2],a=o[3];return Gw($w(r,i,u,a))});var n}(t).value:t}))),valid:!0}:{valid:!1,message:"Must be an array of strings."};var n},o=function(t){return D(t)&&t>0?{value:t,valid:!0}:{valid:!1,message:"Must be a positive number."}};n("color_map",{processor:e,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),n("color_map_raw",{processor:function(t){return B(t,f)?{value:CS(t),valid:!0}:{valid:!1,message:"Must be an array of strings."}}}),n("color_map_background",{processor:e}),n("color_map_foreground",{processor:e}),n("color_cols",{processor:o,default:TS(t)}),n("color_cols_foreground",{processor:o,default:ES(t,wS)}),n("color_cols_background",{processor:o,default:ES(t,SS)}),n("custom_colors",{processor:"boolean",default:!0}),n("color_default_foreground",{processor:"string",default:OS}),n("color_default_background",{processor:"string",default:OS})}(t),function(t){var n=t.options.register;n("contextmenu_avoid_overlap",{processor:"string",default:""}),n("contextmenu_never_use_native",{processor:"boolean",default:!1}),n("contextmenu",{processor:function(t){return!1===t?{value:[],valid:!0}:f(t)||B(t,f)?{value:NI(t),valid:!0}:{valid:!1,message:"Must be false or a string."}},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})}(t)};xo.add("silver",function(t){GL(t);var n=function(){return po()},e=YF(t,{getPopupSinkBounds:function(){return n()}}),o=e.dialogs,r=e.popups,i=e.renderUI;IC(t,r.backstage.shared);var u=jL({editor:t,backstages:{popup:r.backstage,dialog:o.backstage}}
2),a=yo();return{renderUI:function(){var e=i();return Nv(t,r.getMothership().element).each(function(t){n=function(){return Lv(t)}}),e},getWindowManagerImpl:N(u),getNotificationManagerImpl:function(){return function(t,n,e,o){var r=n.backstage.shared,i=function(){return tn(""===t.queryCommandValue("ToggleView")?t.getContentAreaContainer():t.getContainer())},u=function(){var t=fo(i());return G.some(t)},a=function(t){u().each(function(n){ot(t,function(t){ne(t.element,"width"),me(t.element)>n.width&&Yn(t.element,"width",n.width+"px")})})};return{open:function(n,c,s){var l=function(){o.on(function(n){c();var e=s();(function(t){Bp.remove(t,f),v()})(n),function(n,e){0===On(n.element).length?function(n,e){Ch.hide(n),o.clear(),e&&t.focus()}(n,e):function(t,n){n&&Cp.focusIn(t)}(n,e)}(n,e)})},f=Sc(dy.sketch({text:n.text,level:Q(["success","error","warning","warn","info"],n.type)?n.type:void 0,progress:!0===n.progressBar,icon:n.icon,onAction:l,iconProvider:r.providers.icons,backstageProvider:r.providers}));if(o.isSet()){var d=Cc(f);o.on(function(t){Bp.append(t,d),Ch.reposition(t),La.refresh(t),a(t.components())})}else{var m=Sc(Ch.sketch(_(_({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}),{},{inlineBehaviours:Cu([Cp.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),Bp.config({})].concat(w(Ev(t)&&!r.header.isPositionedAtTop()?[]:[La.config({contextual:{lazyContext:function(){return G.some(fo(i()))},fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:function(n){return Nv(t,n.element).map(function(t){return{bounds:Lv(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:le(t.element).top})}}).getOrThunk(function(){return{bounds:po(),optScrollEnv:G.none()}})}})])))}))),g=Cc(f),p={maxHeightFunction:js()},h=_(_({},r.anchors.banner()),{},{overrides:p});o.set(m),e.add(m),Ch.showWithinBounds(m,g,{anchor:h},u)}D(n.timeout)&&n.timeout>0&&kh.setEditorTimeout(t,function(){l()},n.timeout);var v=function(){o.on(function(t){Ch.reposition(t),La.refresh(t),a(t.components())})};return{close:l,reposition:v,text:function(t){dy.updateText(f,t)},settings:n,getEl:function(){return f.element.dom},progressBar:{value:function(t){dy.updateProgress(f,t)}}}},close:function(t){t.close()},getArgs:function(t){return t.settings}}}(t,{backstage:r.backstage},r.getMothership(),a)}}})}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.