1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-447a22cc"],{"030f":function(e,t,n){(function(e){!function(t){"use strict";var n=function(){},r=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t.apply(null,n))}},o=function(e){return function(){return e}},i=function(e){return e};function a(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}function u(e){return function(){throw new Error(e)}}var c=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},s=o(!1),l=o(!0),f=tinymce.util.Tools.resolve("tinymce.ThemeManager"),d=function(){return(d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function m(e,t){var n={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function h(){return p}it={fold:function(e,t){return e()},is:s,isSome:s,isNone:l,getOr:y,getOrThunk:b,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(void 0),or:y,orThunk:b,map:h,each:n,bind:h,exists:s,forall:l,filter:h,equals:v,equals_:v,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(it);var p=it;function v(e){return e.isNone()}function b(e){return e()}function y(e){return e}function w(e){function t(){return i}function n(t){return t(e)}var r=o(e),i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:l,isNone:s,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return w(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?i:p},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(s,(function(t){return n(e,t)}))}};return i}function x(e){return{is:function(t){return e===t},isValue:l,isError:s,getOr:o(e),getOrThunk:o(e),getOrDie:o(e),or:function(t){return x(e)},orThunk:function(t){return x(e)},fold:function(t,n){return n(e)},map:function(t){return x(t(e))},mapError:function(t){return x(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return ye.some(e)}}}function C(e){return{is:s,isValue:s,isError:l,getOr:i,getOrThunk:function(e){return e()},getOrDie:function(){return u(String(e))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(t,n){return t(e)},map:function(t){return C(e)},mapError:function(t){return C(t(e))},each:n,bind:function(t){return C(e)},exists:s,forall:l,toOption:ye.none}}function S(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}}function k(e,t){for(var n=[],r=0;r<e.length;r+=t){var o=Ne.call(e,r,r+t);n.push(o)}return n}function T(e){return[e]}function E(e,t){for(var n=Ke(e),r=0,o=n.length;r<o;r++){var i=n[r],a=e[i];if(t(a,i,e))return ye.some(a)}return ye.none()}function O(e){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var r={},o=0;o<t.length;o++){var i,a=t[o];for(i in a)at.call(a,i)&&(r[i]=e(r[i],a[i]))}return r}}function N(e){var t,n=!1;return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=!0,t=e.apply(null,r)),t}}function A(e){return st.defaultedThunk(o(e))}function D(e,t){return n=t,r={},Ze(e,(function(e,t){Re(n,t)||(r[t]=e)})),r;var n,r}function _(e){return gt(e)}function R(e,t){return n=e,r=t,function(e){return ot(e,n)?e[n]:r};var n,r}function B(e,t,n){return e.stype===be.Error?t(e.serror):n(e.svalue)}function M(e){return{stype:be.Value,svalue:e}}function P(e){return{stype:be.Error,serror:e}}function z(e){return r(kt.serror,Ue)(e)}function I(e,t,n){return ht(t,n).fold((function(){return r=n,o=t,Dt(e,(function(){return'Could not find valid *strict* value for "'+r+'" in '+Nt(o)}));var r,o}),kt.svalue)}function L(e,t,n){return t=ht(e,t).fold((function(){return n(e)}),i),kt.svalue(t)}function F(e,t){return{extract:function(n,r,o){var a=Ke(o),u=(u=n,a=a,It(Mt(e)).extract(u,i,a));return kt.bind(u,(function(e){return e=Me(e,(function(e){return Rt.field(e,e,lt(),t)})),zt(e).extract(n,r,o)}))},toString:function(){return"setOf("+t.toString()+")"},toDsl:function(){return Et.setOf(e,t)}}}function H(e,t){return{extract:function(n,r,o){return yt(o,e).fold((function(){return _t(n,e)}),(function(e){return Ut(n,r,o,t,e)}))},toString:function(){return"chooseOn("+e+"). Possible values: "+Ke(t)},toDsl:function(){return Et.choiceOf(e,t)}}}function V(e,t){return F((function(t){return kt.fromResult(e(t))}),t)}function U(e,t){return H(e,Qe(t,zt))}function j(e,t){return Mt((function(n){var r=typeof n;return e(n)?kt.svalue(n):kt.serror("Expected type: "+t+" but got: "+r)}))}function W(e){function t(e,t){for(var n=e.next();!n.done;){if(!t(n.value))return!1;n=e.next()}return!0}if(Object(e)!==e)return!0;switch({}.toString.call(e).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(e).every((function(t){return W(e[t])}));case"Map":return t(e.keys(),W)&&t(e.values(),W);case"Set":return t(e.keys(),W);default:return!1}}function q(e){return qt((function(t){return Re(e,t)?we.value(t):we.error('Unsupported value: "'+t+'", choose one of "'+e.join(", ")+'".')}))}function $(e){return an(e,en)}function G(e,t){return Vt(e,e,lt(),q(t))}function X(e){return an(e,nn)}function Y(e,t){return Vt(e,e,lt(),zt(t))}function K(e,t){return Vt(e,e,lt(),Ft(t))}function J(e,t){return Vt(e,e,lt(),It(t))}function Z(e){return Vt(e,e,ft(),Lt())}function Q(e){return un(e,Qt)}function ee(e){return un(e,en)}function te(e){return un(e,nn)}function ne(e,t){return fn(e,t,Qt)}function re(e,t){return fn(e,t,en)}function oe(e,t,n){return fn(e,t,q(n))}function ie(e,t){return fn(e,t,tn)}function ae(e,t){return fn(e,t,nn)}function ue(e,t,n){return fn(e,t,zt(n))}function ce(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:o(e)}}function se(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}function le(e,t){var n=pn(e,t);return n?vn(r(1),r(2)):{major:0,minor:0};function r(e){return Number(t.replace(n,"$"+e))}}function fe(){return vn(0,0)}function de(e){var t=e.current;return{current:t,version:e.version,isEdge:En(wn,t),isChrome:En(xn,t),isIE:En(Cn,t),isOpera:En(Sn,t),isFirefox:En(kn,t),isSafari:En(Tn,t)}}function me(e){var t=e.current;return{current:t,version:e.version,isWindows:zn(An,t),isiOS:zn(Dn,t),isAndroid:zn(_n,t),isOSX:zn(Bn,t),isLinux:zn(Rn,t),isSolaris:zn(Mn,t),isFreeBSD:zn(Pn,t)}}function ge(e,t){var n=String(t).toLowerCase();return He(e,(function(e){return e.search(n)}))}function he(e){return function(t){return Vn(t,e)}}function pe(e){return e.nodeType!==Kn&&e.nodeType!==Jn||0===e.childElementCount}function ve(e){var t,n,r,o;return n=function(e){return e.can},r=t=e,o=function(e){return e.abort},or({can:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return Fe(t,(function(t,r){return t&&n(r).apply(void 0,e)}),!0)},abort:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Fe(r,(function(t,n){return t||o(n).apply(void 0,e)}),!1)},run:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];Pe(e,(function(e){e.run.apply(void 0,t)}))}})}var be,ye={some:w,none:h,from:function(e){return null==e?p:w(e)}},we={value:x,error:C,fromOption:function(e,t){return e.fold((function(){return C(t)}),x)}},xe=S("string"),Ce=S("object"),Se=S("array"),ke=S("boolean"),Te=S("function"),Ee=S("number"),Oe=function(e,t){if(Se(e)){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n]))return!1;return!0}return!1},Ne=Array.prototype.slice,Ae=Array.prototype.indexOf,De=Array.prototype.push,_e=function(e,t){return Ae.call(e,t)},Re=function(e,t){return-1<_e(e,t)},Be=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return!0;return!1},Me=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},Pe=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},ze=function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n)},Ie=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},Le=function(e,t,n){return ze(e,(function(e){n=t(n,e)})),n},Fe=function(e,t,n){return Pe(e,(function(e){n=t(n,e)})),n},He=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return ye.some(o)}return ye.none()},Ve=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n))return ye.some(n);return ye.none()},Ue=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Se(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);De.apply(t,e[n])}return t},je=function(e,t){return e=Me(e,t),Ue(e)},We=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n))return!1;return!0},qe=function(e){return e=Ne.call(e,0),e.reverse(),e},$e=function(e,t){return Ie(e,(function(e){return!Re(t,e)}))},Ge=function(e){return 0===e.length?ye.none():ye.some(e[0])},Xe=function(e){return 0===e.length?ye.none():ye.some(e[e.length-1])},Ye=Te(Array.from)?Array.from:function(e){return Ne.call(e)},Ke=Object.keys,Je=Object.hasOwnProperty,Ze=function(e,t){for(var n=Ke(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i)}},Qe=function(e,t){return et(e,(function(e,n){return{k:n,v:t(e,n)}}))},et=function(e,t){var n={};return Ze(e,(function(e,r){e=t(e,r),n[e.k]=e.v})),n},tt=function(e,t){var n=[];return Ze(e,(function(e,r){n.push(t(e,r))})),n},nt=function(e){return tt(e,(function(e){return e}))},rt=function(e,t){return ot(e,t)?ye.from(e[t]):ye.none()},ot=function(e,t){return Je.call(e,t)},it=function(e){if(!Se(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");var n=[],r={};return Pe(e,(function(o,i){var a=Ke(o);if(1!==a.length)throw new Error("one and only one name per case");var u=a[0],c=o[u];if(void 0!==r[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry)");if(!Se(c))throw new Error("case arguments must be an array");n.push(u),r[u]=function(){var r=arguments.length;if(r!==c.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+c.length+" ("+c+"), got "+r);for(var o=new Array(r),a=0;a<o.length;a++)o[a]=arguments[a];return{fold:function(){if(arguments.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+arguments.length);return arguments[i].apply(null,o)},match:function(e){var t=Ke(e);if(n.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+t.join(","));if(We(n,(function(e){return Re(t,e)})))return e[u].apply(null,o);throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+n.join(", "))},log:function(e){t.console.log(e,{constructors:n,constructor:u,params:o})}}}})),r},at=Object.prototype.hasOwnProperty,ut=O((function(e,t){return Ce(e)&&Ce(t)?ut(e,t):t})),ct=O((function(e,t){return t})),st=it([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),lt=st.strict,ft=st.asOption,dt=st.defaultedThunk,mt=st.mergeWithThunk,gt=function(e){return function(t){return ot(t,e)?ye.from(t[e]):ye.none()}},ht=function(e,t){return gt(t)(e)},pt=function(e,t){return ot(e,t)&&void 0!==e[t]&&null!==e[t]},vt=function(e,t){var n={};return n[e]=t,n},bt=function(e){var t={};return Pe(e,(function(e){t[e.key]=e.value})),t},yt=(it([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(e,t){return ht(e,t)}),wt=function(e,t){return vt(e,t)},xt=function(e){return bt(e)},Ct=function(e,t){n=[],r=[],Pe(e,(function(e){e.fold((function(e){n.push(e)}),(function(e){r.push(e)}))}));var n,r,o;e={errors:n,values:r};return 0<e.errors.length?(o=e.errors,we.error(Ue(o))):(o=t,0===(t=e.values).length?we.value(o):we.value(ut(o,ct.apply(void 0,t))))},St=function(e,t){return pt(e,t)},kt=((jt=be=be||{})[jt.Error=0]="Error",jt[jt.Value=1]="Value",{fromResult:function(e){return e.fold(P,M)},toResult:function(e){return B(e,we.error,we.value)},svalue:M,partition:function(e){var t=[],n=[];return Pe(e,(function(e){B(e,(function(e){return n.push(e)}),(function(e){return t.push(e)}))})),{values:t,errors:n}},serror:P,bind:function(e,t){return e.stype===be.Value?t(e.svalue):e},bindError:function(e,t){return e.stype===be.Error?t(e.serror):e},map:function(e,t){return e.stype===be.Value?{stype:be.Value,svalue:t(e.svalue)}:e},mapError:function(e,t){return e.stype===be.Error?{stype:be.Error,serror:t(e.serror)}:e},fold:B}),Tt={consolidateObj:function(e,t){e=kt.partition(e);return 0<e.errors.length?z(e.errors):(e=e.values,t=t,0<e.length?kt.svalue(ut(t,ct.apply(void 0,e))):kt.svalue(t))},consolidateArr:function(e){return e=kt.partition(e),0<e.errors.length?z(e.errors):kt.svalue(e.values)}},Et=it([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Ot=it([{field:["name","presence","type"]},{state:["name"]}]),Nt=function(e){return Ce(e)&&100<Ke(e).length?" removed due to size":JSON.stringify(e,null,2)},At=function(e){return e=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,Me(e,(function(e){return"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()}))},Dt=function(e,t){return kt.serror([{path:e,getErrorInfo:t}])},_t=function(e,t){return Dt(e,(function(){return'Choice schema did not contain choice key: "'+t+'"'}))},Rt=it([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),Bt=function(e,t,n,r){return n.fold((function(n,i,a,u){function c(t){return t=u.extract(e.concat([n]),r,t),kt.map(t,(function(e){return vt(i,r(e))}))}function s(t){return t.fold((function(){var e=vt(i,r(ye.none()));return kt.svalue(e)}),(function(t){return t=u.extract(e.concat([n]),r,t),kt.map(t,(function(e){return vt(i,r(ye.some(e)))}))}))}return a.fold((function(){return kt.bind(I(e,t,n),c)}),(function(e){return kt.bind(L(t,n,e),c)}),(function(){return kt.bind(kt.svalue(ht(t,n)),s)}),(function(e){return kt.bind(function(e,t,n){return t=ht(e,t).map((function(t){return!0===t?n(e):t})),kt.svalue(t)}(t,n,e),s)}),(function(e){var r=e(t);e=kt.map(L(t,n,o({})),(function(e){return ut(r,e)}));return kt.bind(e,c)}))}),(function(e,n){return n=n(t),kt.svalue(vt(e,r(n)))}))},Mt=function(e){return{extract:function(t,n,r){return kt.bindError(e(r,n),(function(e){return n=e,Dt(t,(function(){return n}));var n}))},toString:function(){return"val"},toDsl:function(){return Et.itemOf(e)}}},Pt=function(e){var t=zt(e),n=Le(e,(function(e,t){return t.fold((function(t){return ut(e,wt(t,!0))}),o(e))}),{});return{extract:function(e,r,o){var i,a,u=ke(o)?[]:(u=Ke(i=o),Ie(u,(function(e){return St(i,e)}))),c=Ie(u,(function(e){return!St(n,e)}));return 0===c.length?t.extract(e,r,o):(a=c,Dt(e,(function(){return"There are unsupported fields: ["+a.join(", ")+"] specified"})))},toString:t.toString,toDsl:t.toDsl}},zt=function(e){return{extract:function(t,n,r){var o=t,i=r,a=(t=e,n);return t=Me(e,(function(e){return Bt(o,i,e,a)})),Tt.consolidateObj(t,{})},toString:function(){return"obj{\n"+Me(e,(function(e){return e.fold((function(e,t,n,r){return e+" -> "+r.toString()}),(function(e,t){return"state("+e+")"}))})).join("\n")+"}"},toDsl:function(){return Et.objOf(Me(e,(function(e){return e.fold((function(e,t,n,r){return Ot.field(e,n,r)}),(function(e,t){return Ot.state(e)}))})))}}},It=function(e){return{extract:function(t,n,r){return r=Me(r,(function(r,o){return e.extract(t.concat(["["+o+"]"]),n,r)})),Tt.consolidateArr(r)},toString:function(){return"array("+e.toString()+")"},toDsl:function(){return Et.arrOf(e)}}},Lt=o(Mt(kt.svalue)),Ft=r(It,zt),Ht=Rt.state,Vt=Rt.field,Ut=function(e,t,n,r,o){return yt(r,o).fold((function(){return t=r,n=o,Dt(e,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Nt(t)}));var t,n}),(function(r){return r.extract(e.concat(["branch: "+o]),t,n)}))},jt=Mt(kt.svalue),Wt=function(e){return{extract:function(t,n,r){return e().extract(t,n,r)},toString:function(){return e().toString()},toDsl:function(){return e().toDsl()}}},qt=function(e){return Mt((function(t){return e(t).fold(kt.serror,kt.svalue)}))},$t=function(e,t,n,r){return t=t.extract([e],n,r),kt.mapError(t,(function(e){return{input:r,errors:e}}))},Gt=function(e,t,n){return kt.toResult($t(e,t,i,n))},Xt=function(e){return e.fold((function(e){throw new Error(Kt(e))}),i)},Yt=function(e,t,n){return Xt(Gt(e,t,n))},Kt=function(e){return"Errors: \n"+At(e.errors)+"\n\nInput object: "+Nt(e.input)},Jt=H,Zt=o(jt),Qt=j(Ee,"number"),en=j(xe,"string"),tn=j(ke,"boolean"),nn=j(Te,"function"),rn=Mt((function(e){return W(e)?kt.svalue(e):kt.serror("Expected value to be acceptable for sending via postMessage")})),on=function(e){return Vt(e,e,lt(),Lt())},an=function(e,t){return Vt(e,e,lt(),t)},un=function(e,t){return Vt(e,e,ft(),t)},cn=function(e,t){return un(e,zt(t))},sn=function(e,t){return un(e,Pt(t))},ln=function(e,t){return Vt(e,e,A(t),Lt())},fn=function(e,t,n){return Vt(e,e,A(t),n)},dn=function(e,t){return Ht(e,t)},mn=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return mn(n)}}},gn={fromHtml:function(e,n){if(n=(n||t.document).createElement("div"),n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw t.console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return ce(n.childNodes[0])},fromTag:function(e,n){return n=(n||t.document).createElement(e),ce(n)},fromText:function(e,n){return n=(n||t.document).createTextNode(e),ce(n)},fromDom:ce,fromPoint:function(e,t,n){return e=e.dom(),ye.from(e.elementFromPoint(t,n)).map(ce)}},hn=function(e,n){return se(e,n,t.Node.DOCUMENT_POSITION_CONTAINED_BY)},pn=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}},vn=function(e,t){return{major:e,minor:t}},bn=function(e,t){return t=String(t).toLowerCase(),0===e.length?fe():le(e,t)},yn=fe,wn="Edge",xn="Chrome",Cn="IE",Sn="Opera",kn="Firefox",Tn="Safari",En=function(e,t){return function(){return t===e}},On=function(){return de({current:void 0,version:yn()})},Nn=de,An=(o(wn),o(xn),o(Cn),o(Sn),o(kn),o(Tn),"Windows"),Dn="iOS",_n="Android",Rn="Linux",Bn="OSX",Mn="Solaris",Pn="FreeBSD",zn=function(e,t){return function(){return t===e}},In=function(){return me({current:void 0,version:yn()})},Ln=me,Fn=(o(An),o(Dn),o(_n),o(Rn),o(Bn),o(Mn),o(Pn),function(e,t){return ge(e,t).map((function(e){var n=bn(e.versionRegexes,t);return{current:e.name,version:n}}))}),Hn=function(e,t){return ge(e,t).map((function(e){var n=bn(e.versionRegexes,t);return{current:e.name,version:n}}))},Vn=function(e,t){return-1!==e.indexOf(t)},Un=function(e,t){return n=t,t=(e=e).length-t.length,""===n||!(e.length<n.length)&&e.substr(t,t+n.length)===n;var n},jn=function(e){return e.replace(/^\s+|\s+$/g,"")},Wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,qn=(Wn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Vn(e,"edge/")&&Vn(e,"chrome")&&Vn(e,"safari")&&Vn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Wn],search:function(e){return Vn(e,"chrome")&&!Vn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Vn(e,"msie")||Vn(e,"trident")}},{name:"Opera",versionRegexes:[Wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:he("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:he("firefox")},{name:"Safari",versionRegexes:[Wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Vn(e,"safari")||Vn(e,"mobile/"))&&Vn(e,"applewebkit")}}],[{name:"Windows",search:he("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Vn(e,"iphone")||Vn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:he("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:he("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:he("linux"),versionRegexes:[]},{name:"Solaris",search:he("sunos"),versionRegexes:[]},{name:"FreeBSD",search:he("freebsd"),versionRegexes:[]}]),$n={browsers:o(Wn),oses:o(qn)},Gn=mn(function(e,t){var n,r,i,a,u,c=$n.browsers(),s=$n.oses(),l=(c=Fn(c,e).fold(On,Nn),s=Hn(s,e).fold(In,Ln),r=c,e=e,t=t,l=(n=s).isiOS()&&!0===/ipad/i.test(e),i=n.isiOS()&&!l,a=n.isiOS()||n.isAndroid(),u=a||t("(pointer:coarse)"),t=l||!i&&a&&t("(min-device-width:768px)"),a=i||a&&!t,r=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(e),e=!a&&!t&&!r,{isiPad:o(l),isiPhone:o(i),isTablet:o(t),isPhone:o(a),isTouch:o(u),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:o(r),isDesktop:o(e)});return{browser:c,os:s,deviceType:l}}(t.navigator.userAgent,(function(e){return t.window.matchMedia(e).matches}))),Xn=function(){return Gn.get()},Yn=(Wn=(t.Node.ATTRIBUTE_NODE,t.Node.CDATA_SECTION_NODE,t.Node.COMMENT_NODE,t.Node.DOCUMENT_NODE),qn=(t.Node.DOCUMENT_TYPE_NODE,t.Node.DOCUMENT_FRAGMENT_NODE,t.Node.ELEMENT_NODE),t.Node.TEXT_NODE),Kn=(t.Node.PROCESSING_INSTRUCTION_NODE,t.Node.ENTITY_REFERENCE_NODE,t.Node.ENTITY_NODE,t.Node.NOTATION_NODE,qn),Jn=Wn,Zn=function(e,t){if(e=e.dom(),e.nodeType!==Kn)return!1;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Qn=function(e,n){return n=void 0===n?t.document:n.dom(),pe(n)?[]:Me(n.querySelectorAll(e),gn.fromDom)},er=function(e,n){return n=void 0===n?t.document:n.dom(),pe(n)?ye.none():ye.from(n.querySelector(e)).map(gn.fromDom)},tr=function(e,t){return e.dom()===t.dom()},nr=Xn().browser.isIE()?function(e,t){return hn(e.dom(),t.dom())}:function(e,t){return e=e.dom(),t=t.dom(),e!==t&&e.contains(t)},rr=function(e,t){return tr(e.element(),t.event().target())},or=function(e){if(St(e,"can")||St(e,"abort")||St(e,"run"))return Yt("Extracting event.handler",Pt([ln("can",o(!0)),ln("abort",o(!1)),ln("run",n)]),e);throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!")},ir=o("touchstart"),ar=o("touchmove"),ur=o("touchend"),cr=o("mousedown"),sr=o("mousemove"),lr=o("mouseout"),fr=o("mouseup"),dr=o("mouseover"),mr=o("focusin"),gr=o("focusout"),hr=o("keydown"),pr=o("keyup"),vr=o("input"),br=o("change"),yr=o("click"),wr=o("transitionend"),xr=o("selectstart"),Cr=(Wn={tap:o("alloy.tap")},o("alloy.focus")),Sr=o("alloy.blur.post"),kr=o("alloy.paste.post"),Tr=o("alloy.receive"),Er=o("alloy.execute"),Or=o("alloy.focus.item"),Nr=Wn.tap,Ar=Xn().deviceType.isTouch()?Wn.tap:yr,Dr=o("alloy.longpress"),_r=o("alloy.sandbox.close"),Rr=o("alloy.typeahead.cancel"),Br=o("alloy.system.init"),Mr=o("alloy.system.touchmove"),Pr=o("alloy.system.touchend"),zr=o("alloy.system.scroll"),Ir=o("alloy.system.resize"),Lr=o("alloy.system.attached"),Fr=o("alloy.system.detached"),Hr=o("alloy.system.dismissRequested"),Vr=(Wn=o("alloy.system.repositionRequested"),o("alloy.focusmanager.shifted")),Ur=o("alloy.slotcontainer.visibility"),jr=o("alloy.change.tab"),Wr=o("alloy.dismiss.tab"),qr=o("alloy.highlight"),$r=o("alloy.dehighlight"),Gr=function(e,t){Jr(e,e.element(),t,{})},Xr=function(e,t,n){Jr(e,e.element(),t,n)},Yr=function(e){Gr(e,Er())},Kr=function(e,t,n){Jr(e,t,n,{})},Jr=function(e,t,n,r){r=d({target:t},r),e.getSystem().triggerEvent(n,t,Qe(r,o))},Zr=function(e,t,n,r){e.getSystem().triggerEvent(n,t,r.event())};function Qr(e,t,n,r,o){return e(n,r)?ye.some(n):Te(o)&&o(n)?ye.none():t(n,r,o)}function eo(e){return function(t){return t.dom().nodeType===e}}function to(e,t,n){for(var r=e.dom(),i=Te(n)?n:o(!1);r.parentNode;){r=r.parentNode;var a=gn.fromDom(r);if(t(a))return ye.some(a);if(i(a))break}return ye.none()}function no(e,t){return{key:e,value:or({abort:t})}}function ro(e){return{key:e,value:or({run:function(e,t){t.event().prevent()}})}}function oo(e,t,n){return{key:e,value:or({run:function(e){t.apply(void 0,[e].concat(n))}})}}function io(e,t,n){var r,o;t=t.partUids[n];return o=t,Xo(r=e,(function(e,t){e.getSystem().getByUid(o).each((function(e){Zr(e,e.element(),r,t)}))}))}function ao(e){return Xo(e,(function(e,t){t.cut()}))}function uo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(e.length!==t.length)throw new Error('Wrong number of arguments to struct. Expected "['+e.length+']", got '+t.length+" arguments");var r={};return Pe(e,(function(e,n){r[e]=o(t[n])})),r}}function co(e,t){if(!Se(t))throw new Error("The "+e+" fields must be an array. Was: "+t+".");Pe(t,(function(t){if(!xe(t))throw new Error("The value "+t+" in the "+e+" fields was not a string.")}))}function so(e,t){var n,r=e.concat(t);if(0===r.length)throw new Error("You must specify at least one required or optional field.");return co("required",e),co("optional",t),n=ni(r),He(n,(function(e,t){return t<n.length-1&&e===n[t+1]})).each((function(e){throw new Error("The field: "+e+" occurs more than once in the combined fields: ["+n.join(", ")+"].")})),function(n){var i=Ke(n);if(!We(e,(function(e){return Re(i,e)})))throw a=i,new Error("All required keys ("+ni(e).join(", ")+") were not specified. Specified keys were: "+ni(a).join(", ")+".");var a=Ie(i,(function(e){return!Re(r,e)}));if(0<a.length)throw new Error("Unsupported keys for object: "+ni(a).join(", "));var u={};return Pe(e,(function(e){u[e]=o(n[e])})),Pe(t,(function(e){u[e]=o(Object.prototype.hasOwnProperty.call(n,e)?ye.some(n[e]):ye.none())})),u}}function lo(e){return gn.fromDom(e.dom().ownerDocument.defaultView)}function fo(e,t){si(e).fold((function(){mi(e,t)}),(function(n){e.dom().insertBefore(t.dom(),n.dom())}))}function mo(e){var t=ui(e);0<t.length&&gi(e,t),vi(e)}function go(e){return e.dom().innerHTML}function ho(e,t){var n=ri(e).dom(),r=gn.fromDom(n.createDocumentFragment());t=li(t,n);hi(r,t),pi(e),mi(e,r)}function po(e){var t=e;return t=ki(e),bi(t)}function vo(e,t){return e=Oi(Ni+e),Di(t,e),e}function bo(e){function t(t){return function(){throw new Error("The component must be in a context to send: "+t+"\n"+po(e().element())+" is not in context.")}}return{debugInfo:o("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:o(!1)}}function yo(e,t){var n=e.toString(),r=n.indexOf(")")+1,o=n.indexOf("("),i=n.substring(o+1,r-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:t,parameters:Pi(i)}},e}function wo(e){return wt(Ii,e)}function xo(e){return zi((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.apply(void 0,[t.getApis()].concat([t].concat(n)))}),e)}function Co(e,t){var n={};return Ze(e,(function(e,r){Ze(e,(function(e,o){var i=R(o,[])(n);n[o]=i.concat([t(r,e)])}))})),n}function So(e){return{classes:void 0!==e.classes?e.classes:[],attributes:void 0!==e.attributes?e.attributes:{},styles:void 0!==e.styles?e.styles:{}}}function ko(e,t,n,r){function o(e){return Le(e,(function(e,t){return d(d({},t.modification),e)}),{})}var i=d({},t),a=(t=(Pe(n,(function(t){i[t.name()]=t.exhibit(e,r)})),Co(i,(function(e,t){return{name:e,modification:t}}))),n=Le(t.classes,(function(e,t){return t.modification.concat(e)}),[]),o(t.attributes));t=o(t.styles);return So({classes:n,attributes:a,styles:t})}function To(e,t){return{name:o(e),handler:o(t)}}function Eo(e,t,n){var r,o;n=d(d({},n),(r=e,o={},Pe(t,(function(e){o[e.name()]=e.handlers(r)})),o));return Co(n,To)}function Oo(e,t,n,r){var o;e=Eo(e,n,r);return o=t,n=tt(e,(function(e,t){return(1===e.length?we.value(e[0].handler()):qi(e,o,t)).map((function(n){n=Wi(n);var r=1<e.length?Ie(o[t],(function(t){return Be(e,(function(e){return e.name()===t}))})).join(" > "):e[0].name();return wt(t,Vi(n,r))}))})),Ct(n,{})}function No(e){return Gt("custom.definition",zt([Vt("dom","dom",lt(),zt([on("tag"),ln("styles",{}),ln("classes",[]),ln("attributes",{}),Z("value"),Z("innerHtml")])),on("components"),on("uid"),ln("events",{}),ln("apis",{}),Vt("eventOrder","eventOrder",st.mergeWithThunk(o({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]})),Zt()),Z("domModification")]),e)}function Ao(e,t){return void 0===(e=xi(e,t))||""===e?[]:e.split(" ")}function Do(e,n){var r=e.dom(),o=t.window.getComputedStyle(r).getPropertyValue(n);return null===(e=""!==o||Vo(e)?o:aa(r,n))?void 0:e}function _o(e,t,n){return e=gn.fromTag(e),oa(e,t,n),ua(e,t).isSome()}function Ro(e){var t,n=gn.fromTag(e.tag),r=(r=e.attributes,t=n.dom(),Ze(r,(function(e,n){yi(t,n,e)})),Qi(n,e.classes),ia(n,e.styles),e.innerHtml.each((function(e){return ho(n,e)})),e.domChildren);return hi(n,r),e.value.each((function(e){fa(n,e)})),e.uid,Di(n,e.uid),n}function Bo(e,t){return n=e,t=Me(e=t,(function(e){return cn(e.name(),[on("config"),ln("state",Fi)])})),t=Gt("component.behaviours",zt(t),n.behaviours).fold((function(e){throw new Error(Kt(e)+"\nComplete spec:\n"+JSON.stringify(n,null,2))}),(function(e){return e})),{list:e,data:Qe(t,(function(e){var t=e.map((function(e){return{config:e.config,state:e.state.init(e.config)}}));return function(){return t}}))};var n}function Mo(e){t=R("behaviours",{})(n=e),n=Ie(Ke(t),(function(e){return void 0!==t[e]}));var t,n=Me(n,(function(e){return t[e].me}));return Bo(e,n)}function Po(e,t,n){var r=d(d({},(r=e).dom),{uid:r.uid,domChildren:Me(r.components,(function(e){return e.element()}))});e=e.domModification.fold((function(){return So({})}),So),n=0<t.length?ko(n,{"alloy.base.modification":e},t,r):e;return t=n,d(d({},e=r),{attributes:d(d({},e.attributes),t.attributes),styles:d(d({},e.styles),t.styles),classes:e.classes.concat(t.classes)})}function zo(e){function t(){return f}var n,r=mn(Mi),i=Xt(No(e)),a=(c=Mo(e)).list,u=c.data,c=Po(i,a,u),s=Ro(c),l=(c=(c=u,n={"alloy.base.behaviour":i.events},Oo(c,i.eventOrder,a,n).getOrDie()),mn(i.components)),f={getSystem:r.get,config:function(t){var n=u;return(Te(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(e){return Te(u[e.name()])},spec:o(e),readState:function(e){return u[e]().map((function(e){return e.state.readState()})).getOr("not enabled")},getApis:function(){return i.apis},connect:function(e){r.set(e)},disconnect:function(){r.set(bo(t))},element:o(s),syncComponents:function(){var e=ui(s);e=je(e,(function(e){return r.get().getByDom(e).fold((function(){return[]}),(function(e){return[e]}))}));l.set(e)},components:l.get,events:o(c)};return f}void 0!==t.window?t.window:Function("return this;")();var Io,Lo=function(e){return e.dom().nodeName.toLowerCase()},Fo=eo(qn),Ho=eo(Yn),Vo=function(e){return e=Ho(e)?e.dom().parentNode:e.dom(),null!=e&&e.ownerDocument.body.contains(e)},Uo=N((function(){return jo(gn.fromDom(t.document))})),jo=function(e){if(e=e.dom().body,null==e)throw new Error("Body is not available yet");return gn.fromDom(e)},Wo=function(e,t,n){return Qr((function(e,t){return t(e)}),to,e,t,n)},qo=function(e,t){function n(e){for(var r=0;r<e.childNodes.length;r++){var o=gn.fromDom(e.childNodes[r]);if(t(o))return ye.some(o);if(o=n(e.childNodes[r]),o.isSome())return o}return ye.none()}return n(e.dom())},$o=function(e,t,n){return Wo(e,(function(e){return t(e).isSome()}),n).bind(t)},Go=function(e){return xt(e)},Xo=function(e,t){return{key:e,value:or({run:t})}},Yo=function(e){return function(t){return{key:e,value:or({run:function(e,n){rr(e,n)&&t(e,n)}})}}},Ko=function(e,t){return Xo(e,(function(e,n){var r=n.event(),i=e.getSystem().getByDom(r.target()).fold((function(){return $o(r.target(),(function(t){return e.getSystem().getByDom(t).toOption()}),o(!1)).getOr(e)}),(function(e){return e}));t(e,i,n)}))},Jo=function(e,t){return Yo(e)(t)},Zo=Yo(Lr()),Qo=Yo(Fr()),ei=Yo(Br()),ti=(Io=Er(),function(e){return Xo(Io,e)}),ni=function(e){return e.slice(0).sort()},ri=function(e){return gn.fromDom(e.dom().ownerDocument)},oi=function(e){return gn.fromDom(e.dom().ownerDocument.documentElement)},ii=function(e){return ye.from(e.dom().parentNode).map(gn.fromDom)},ai=function(e){return ye.from(e.dom().offsetParent).map(gn.fromDom)},ui=function(e){return Me(e.dom().childNodes,gn.fromDom)},ci=function(e,t){return e=e.dom().childNodes,ye.from(e[t]).map(gn.fromDom)},si=function(e){return ci(e,0)},li=(uo("element","offset"),function(e,n){return n=(n||t.document).createElement("div"),n.innerHTML=e,ui(gn.fromDom(n))}),fi=function(e,t){ii(e).each((function(n){n.dom().insertBefore(t.dom(),e.dom())}))},di=function(e,t){ye.from(e.dom().nextSibling).map(gn.fromDom).fold((function(){ii(e).each((function(e){mi(e,t)}))}),(function(e){fi(e,t)}))},mi=function(e,t){e.dom().appendChild(t.dom())},gi=function(e,t){Pe(t,(function(t){fi(e,t)}))},hi=function(e,t){Pe(t,(function(t){mi(e,t)}))},pi=function(e){e.dom().textContent="",Pe(ui(e),(function(e){vi(e)}))},vi=function(e){e=e.dom(),null!==e.parentNode&&e.parentNode.removeChild(e)},bi=function(e){var t=gn.fromTag("div");e=gn.fromDom(e.dom().cloneNode(!0));return mi(t,e),go(t)},yi=function(e,n,r){if(!(xe(r)||ke(r)||Ee(r)))throw t.console.error("Invalid call to Attr.set. Key ",n,":: Value ",r,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,r+"")},wi=function(e,t,n){yi(e.dom(),t,n)},xi=function(e,t){return e=e.dom().getAttribute(t),null===e?void 0:e},Ci=function(e,t){return e=e.dom(),!(!e||!e.hasAttribute)&&e.hasAttribute(t)},Si=function(e,t){e.dom().removeAttribute(t)},ki=function(e){return t=!1,gn.fromDom(e.dom().cloneNode(t));var t},Ti=(qn=Go([{key:Cr(),value:or({can:function(e,n){var r,o,i=n.event().originator();n=n.event().target();return o=n,!(tr(r=i,e.element())&&!tr(r,o))||(t.console.warn(Cr()+" did not get interpreted by the desired target. \nOriginator: "+po(i)+"\nTarget: "+po(n)+"\nCheck the "+Cr()+" event handlers"),!1)}})}]),Object.freeze({events:qn})),Ei=0,Oi=function(e){var t=(new Date).getTime();return e+"_"+Math.floor(1e9*Math.random())+ ++Ei+String(t)},Ni=(Yn=o("alloy-id-"),qn=o("data-alloy-id"),Yn()),Ai=qn(),Di=function(e,t){Object.defineProperty(e.dom(),Ai,{value:t,writable:!0})},_i=function(e){return e=Fo(e)?e.dom()[Ai]:null,ye.from(e)},Ri=function(e){return Oi(e)},Bi=i,Mi=bo(),Pi=function(e){return Me(e,(function(e){return Un(e,"/*")?e.substring(0,e.length-"/*".length):e}))},zi=function(e,t){t=t.toString();var n=t.indexOf(")")+1,r=t.indexOf("("),o=t.substring(r+1,n-1).split(/,\s*/);return e.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Pi(o.slice(1))}},e},Ii=Oi("alloy-premade"),Li=function(e){return yt(e,Ii)},Fi={init:function(){return Hi({readState:function(){return"No State required"}})}},Hi=function(e){return e},Vi=function(e,t){return{handler:e,purpose:o(t)}},Ui=function(e,t){return{cHandler:e,purpose:o(t)}},ji=function(e){return e.cHandler},Wi=function(e){var t=Te(e=e)?{can:o(!0),abort:o(!1),run:e}:e;return function(e,n){for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];e=[e,n].concat(r),t.abort.apply(void 0,e)?n.stop():t.can.apply(void 0,e)&&t.run.apply(void 0,e)}},qi=function(e,t,n){return t=t[n],t?function(e,t,n,r){n=n.slice(0);try{var o=n.sort((function(n,o){n=n[t](),o=o[t]();var i=r.indexOf(n),a=r.indexOf(o);if(-1===i)throw new Error("The ordering for "+e+" does not have an entry for "+n+".\nOrder specified: "+JSON.stringify(r,null,2));if(-1===a)throw new Error("The ordering for "+e+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(r,null,2));return i<a?-1:a<i?1:0}));return we.value(o)}catch(n){return we.error([n])}}("Event: "+n,"name",e,t).map((function(e){return e=Me(e,(function(e){return e.handler()})),ve(e)})):we.error(["The event ("+n+') 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(Me(e,(function(e){return e.name()})),null,2)])},$i=function(e){return void 0!==e.dom().classList},Gi=function(e,t){var n="class";return t=Ao(e,n).concat([t]),wi(e,n,t.join(" ")),!0},Xi=function(e,t){return n=t,0<(r=Ie(Ao(t=e,e="class"),(function(e){return e!==n}))).length?wi(t,e,r.join(" ")):Si(t,e),!1;var n,r},Yi=function(e,t){$i(e)?e.dom().classList.add(t):Gi(e,t)},Ki=function(e){0===($i(e)?e.dom().classList:Ao(e,"class")).length&&Si(e,"class")},Ji=function(e,t){$i(e)?e.dom().classList.remove(t):Xi(e,t),Ki(e)},Zi=function(e,t){return $i(e)&&e.dom().classList.contains(t)},Qi=function(e,t){Pe(t,(function(t){Yi(e,t)}))},ea=function(e,t){Pe(t,(function(t){Ji(e,t)}))},ta=function(e){return void 0!==e.style&&Te(e.style.getPropertyValue)},na=function(e,n,r){if(!xe(r))throw t.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",e),new Error("CSS value must be a string: "+r);ta(e)&&e.style.setProperty(n,r)},ra=function(e,t){ta(e)&&e.style.removeProperty(t)},oa=function(e,t,n){e=e.dom(),na(e,t,n)},ia=function(e,t){var n=e.dom();Ze(t,(function(e,t){na(n,t,e)}))},aa=function(e,t){return ta(e)?e.style.getPropertyValue(t):""},ua=function(e,t){return e=e.dom(),e=aa(e,t),ye.from(e).filter((function(e){return 0<e.length}))},ca=function(e,t){var n=e.dom();ra(n,t),Ci(e,"style")&&""===jn(xi(e,"style"))&&Si(e,"style")},sa=function(e){return e.dom().offsetWidth},la=function(e){return e.dom().value},fa=function(e,t){if(void 0===t)throw new Error("Value.set was undefined");e.dom().value=t},da=function(e){e=Bi(e);var t=e.events,n=(e=m(e,["events"]),function(e){return e=R("components",[])(e),Me(e,pa)}(e));e=d(d({},e),{events:d(d({},Ti),t),components:n});return we.value(zo(e))},ma=function(e){return e=gn.fromText(e),ga({element:e})},ga=function(e){var t=Yt("external.component",Pt([on("element"),Z("uid")]),e),r=mn(bo()),i=(t.uid.each((function(e){Di(t.element,e)})),{getSystem:r.get,config:ye.none,hasConfigured:o(!1),connect:function(e){r.set(e)},disconnect:function(){r.set(bo((function(){return i})))},getApis:function(){return{}},element:o(t.element),spec:o(e),readState:o("No state"),syncComponents:n,components:o([]),events:o({})});return wo(i)},ha=Ri,pa=function(e){return Li(e).fold((function(){var t=e.hasOwnProperty("uid")?e:d({uid:ha("")},e);return da(t).getOrDie()}),(function(e){return e}))},va=wo;function ba(e,t){function n(n){var r=t(n);return r<=0||null===r?(n=Do(n,e),parseFloat(n)||0):r}function r(e,t){return Fe(t,(function(t,n){return n=Do(e,n),n=void 0===n?0:parseInt(n,10),isNaN(n)?t:t+n}),0)}return{set:function(t,n){if(!Ee(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);t=t.dom(),ta(t)&&(t.style[e]=n+"px")},get:n,getOuter:n,aggregate:r,max:function(e,t,n){return e=r(e,n),e<t?t-e:0}}}function ya(e,t){return{left:o(e),top:o(t),translate:function(n,r){return ya(e+n,t+r)}}}function wa(e,t){return e.view(t).fold(o([]),(function(t){var n=e.owner(t);n=wa(e,n);return[t].concat(n)}))}function xa(){return Y("markers",[on("backgroundMenu")].concat(_u()).concat(Ru()))}function Ca(e){return Y("markers",Me(e,on))}function Sa(e,t,n){return Nu(),Vt(t,t,n,qt((function(e){return we.value((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)}))})))}function ka(e){return Sa(0,e,A(n))}function Ta(e){return Sa(0,e,A(ye.none))}function Ea(e){return Sa(0,e,lt())}function Oa(e){return Sa(0,e,lt())}function Na(e){return dn(e,i)}function Aa(e,t){return e.y()+e.height()/2-t.height()/2}function Da(e,t,n){return ei((function(r,o){n(r,e,t)}))}function _a(e,t,n){var r,i,a,u,c,s;return r=function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var u=[r].concat(i);return r.config({name:o(e)}).fold((function(){throw new Error("We could not find any behaviour configuration for: "+e+". Using API: "+n)}),(function(e){var n=Array.prototype.slice.call(u,1);return t.apply(void 0,[r,e.config,e.state].concat(n))}))},i=n,a=(a=t).toString(),u=a.indexOf(")")+1,c=a.indexOf("("),s=a.substring(c+1,u-1).split(/,\s*/),r.toFunctionAnnotation=function(){return{name:i,parameters:Pi(s.slice(0,1).concat(s.slice(3)))}},r}function Ra(e){return{key:e,value:void 0}}function Ba(e){var t,n,r,o,i,a;e=Yt("Creating behaviour: "+e.name,uc,e);return t=e.fields,n=e.name,r=e.active,o=e.apis,i=e.extra,e=e.state,a=Pt(t),t=cn(n,[sn("config",t)]),ic(a,t,n,r,o,i,e)}function Ma(e){var t,n,r,o,i,a;e=Yt("Creating behaviour: "+e.name,cc,e);return t=U(e.branchKey,e.branches),n=e.name,r=e.active,o=e.apis,i=e.extra,e=e.state,t=cn(n,[un("config",a=t)]),ic(a,t,n,r,o,i,e)}function Pa(e,t){var r=ri(t),o=mc(r).bind((function(e){function n(t){return tr(e,t)}return n(t)?ye.some(t):qo(t,n)}));e=e(t);o.each((function(e){mc(r).filter((function(t){return tr(t,e)})).fold((function(){dc(e)}),n)}))}function za(){return pc(0,0,{})}function Ia(e,t,n,r,o,i){n=t.x()-n,r=t.y()-r,o-=n+t.width(),i-=r+t.height();var a,u,c,s,l=ye.some(n),f=ye.some(r),d=ye.some(o),m=ye.some(i),g=ye.none();return n=t.direction(),r=function(){return bc(e,l,f,g,g)},o=function(){return bc(e,g,f,d,g)},i=function(){return bc(e,l,g,g,m)},t=function(){return bc(e,g,g,d,m)},a=function(){return bc(e,l,f,g,g)},u=function(){return bc(e,l,g,g,m)},c=function(){return bc(e,l,f,g,g)},s=function(){return bc(e,g,f,d,g)},n.fold(r,o,i,t,a,u,c,s)}function La(e,t){var n=a(cu,t),r=(e=e.fold(n,n,(function(){var e=ou();return cu(t).translate(-e.left(),-e.top())})),n=ru(t),Ka(t));return fu(e.left(),e.top(),n,r)}function Fa(e,t,n){var r=Ja(t,n);return e.fold(o(r),o(r),(function(){var e=ou();return r.translate(-e.left(),-e.top())}))}function Ha(){return cn("layouts",[on("onLtr"),on("onRtl")])}function Va(e,t,n,r){return n=t.layouts.map((function(t){return t.onLtr(e)})).getOr(n),t=t.layouts.map((function(t){return t.onRtl(e)})).getOr(r),xc(n,t)(e)}function Ua(e,t,n){var r,o;e=e.document.createRange();return r=e,t.fold((function(e){r.setStartBefore(e.dom())}),(function(e,t){r.setStart(e.dom(),t)}),(function(e){r.setStartAfter(e.dom())})),o=e,n.fold((function(e){o.setEndBefore(e.dom())}),(function(e,t){o.setEnd(e.dom(),t)}),(function(e){o.setEndAfter(e.dom())})),e}function ja(e,t,n,r,o){return(e=e.document.createRange()).setStart(t.dom(),n),e.setEnd(r.dom(),o),e}function Wa(e){return{left:o(e.left),top:o(e.top),right:o(e.right),bottom:o(e.bottom),width:o(e.width),height:o(e.height)}}function qa(e,t,n){return t(gn.fromDom(n.startContainer),n.startOffset,gn.fromDom(n.endContainer),n.endOffset)}function $a(e,t){n=e;var n,r;e=t.match({domRange:function(e){return{ltr:o(e),rtl:ye.none}},relative:function(e,t){return{ltr:N((function(){return Ua(n,e,t)})),rtl:N((function(){return ye.some(Ua(n,t,e))}))}},exact:function(e,t,r,o){return{ltr:N((function(){return ja(n,e,t,r,o)})),rtl:N((function(){return ye.some(ja(n,r,o,e,t))}))}}});return(r=(t=e).ltr()).collapsed?t.rtl().filter((function(e){return!1===e.collapsed})).map((function(e){return Dc.rtl(gn.fromDom(e.endContainer),e.endOffset,gn.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return qa(0,Dc.ltr,r)})):qa(0,Dc.ltr,r)}var Ga,Xa=ba("height",(function(e){var t=e.dom();return Vo(e)?t.getBoundingClientRect().height:t.offsetHeight})),Ya=function(e){return Xa.get(e)},Ka=function(e){return Xa.getOuter(e)},Ja=ya,Za=function(e,t){return void 0!==e?e:void 0!==t?t:0},Qa=function(e){var t=e.dom().ownerDocument,n=t.body,r=t.defaultView;t=t.documentElement;if(n===e.dom())return Ja(n.offsetLeft,n.offsetTop);var o=Za(r.pageYOffset,t.scrollTop),i=(r=Za(r.pageXOffset,t.scrollLeft),Za(t.clientTop,n.clientTop));t=Za(t.clientLeft,n.clientLeft);return eu(e).translate(r-t,o-i)},eu=function(e){var t=e.dom(),n=t.ownerDocument.body;return n===t?Ja(n.offsetLeft,n.offsetTop):Vo(e)?(n=t,n=n.getBoundingClientRect(),Ja(n.left,n.top)):Ja(0,0)},tu=ba("width",(function(e){return e.dom().offsetWidth})),nu=function(e){return tu.get(e)},ru=function(e){return tu.getOuter(e)},ou=(Xn().browser.isSafari(),function(e){e=void 0!==e?e.dom():t.document;var n=e.body.scrollLeft||e.documentElement.scrollLeft;e=e.body.scrollTop||e.documentElement.scrollTop;return Ja(n,e)}),iu=function(e,t,n,r){return{x:o(e),y:o(t),width:o(n),height:o(r),right:o(e+n),bottom:o(t+r)}},au=function(e){e=void 0===e?t.window:e;var n,r=e.visualViewport;return void 0!==r?iu(r.pageLeft,r.pageTop,r.width,r.height):(r=gn.fromDom(e.document),e=e.document.documentElement,r=ou(r),n=e.clientWidth,e=e.clientHeight,iu(r.left(),r.top(),n,e))},uu=Object.freeze({view:function(e){return(e.dom()===t.document?ye.none():ye.from(e.dom().defaultView.frameElement)).map(gn.fromDom)},owner:function(e){return ri(e)}}),cu=function(e){var n=gn.fromDom(t.document),r=ou(n);return function(e,t){return e=t.owner(e),t=wa(t,e),ye.some(t)}(e,uu).fold(a(Qa,e),(function(t){var n=eu(e);t=Le(t,(function(e,t){return t=eu(t),{left:e.left+t.left(),top:e.top+t.top()}}),{left:0,top:0});return Ja(t.left+n.left()+r.left(),t.top+n.top()+r.top())}))},su=uo("point","width","height"),lu=uo("x","y","width","height"),fu=function(e,t,n,r){return{x:o(e),y:o(t),width:o(n),height:o(r),right:o(e+n),bottom:o(t+r)}},du=function(e){var t=Qa(e),n=ru(e);e=Ka(e);return fu(t.left(),t.top(),n,e)},mu=function(e){var t=cu(e),n=ru(e);e=Ka(e);return fu(t.left(),t.top(),n,e)},gu=function(){return au(t.window)},hu=function(e,t,n){return Wo(e,t,n).isSome()},pu=function(e,t,n){return to(e,(function(e){return Zn(e,t)}),n)},vu=function(e,t){return er(t,e)},bu=function(e,t,n){return Qr(Zn,pu,e,t,n)},yu=function(){var e=Oi("aria-owns");return{id:o(e),link:function(t){wi(t,"aria-owns",e)},unlink:function(e){Si(e,"aria-owns")}}},wu=function(e,t){return Wo(t,(function(e){return!!Fo(e)&&(e=xi(e,"id"),void 0!==e&&-1<e.indexOf("aria-owns"))})).bind((function(e){var t=xi(e,"id");e=ri(e);return vu(e,'[aria-owns="'+t+'"]')})).exists((function(t){return xu(e,t)}))},xu=function(e,t){return hu(t,(function(t){return tr(t,e.element())}),o(!1))||wu(e,t)},Cu=function(e){for(var t=[],n=function(e){t.push(e)},r=0;r<e.length;r++)e[r].each(n);return t},Su=function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return ye.none()},ku=function(e,t,n){return e.isSome()&&t.isSome()?ye.some(n(e.getOrDie(),t.getOrDie())):ye.none()},Tu="unknown",Eu=((Yn=Ga=Ga||{})[Yn.STOP=0]="STOP",Yn[Yn.NORMAL=1]="NORMAL",Yn[Yn.LOGGING=2]="LOGGING",mn({})),Ou=["alloy/data/Fields","alloy/debugging/Debugging"],Nu=function(){var e=new Error;return void 0!==e.stack?(e=e.stack.split("\n"),He(e,(function(e){return 0<e.indexOf("alloy")&&!Be(Ou,(function(t){return-1<e.indexOf(t)}))})).getOr(Tu)):Tu},Au=function(e,n,r){var o,i,a,u;switch(yt(Eu.get(),e).orThunk((function(){var t=Ke(Eu.get());return Su(t,(function(t){return-1<e.indexOf(t)?ye.some(Eu.get()[t]):ye.none()}))})).getOr(Ga.NORMAL)){case Ga.NORMAL:return r(Du());case Ga.LOGGING:o=e,i=n,a=[],u=(new Date).getTime();var c={logEventCut:function(e,t,n){a.push({outcome:"cut",target:t,purpose:n})},logEventStopped:function(e,t,n){a.push({outcome:"stopped",target:t,purpose:n})},logNoParent:function(e,t,n){a.push({outcome:"no-parent",target:t,purpose:n})},logEventNoHandlers:function(e,t){a.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(e,t,n){a.push({outcome:"response",purpose:n,target:t})},write:function(){var e=(new Date).getTime();Re(["mousemove","mouseover","mouseout",Br()],o)||t.console.log(o,{event:o,time:e-u,target:i.dom(),sequence:Me(a,(function(e){return Re(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+po(e.target)+")":e.outcome}))})}},s=r(c);return c.write(),s;case Ga.STOP:return!0}},Du=o({logEventCut:n,logEventStopped:n,logNoParent:n,logEventNoHandlers:n,logEventResponse:n,write:n}),_u=o([on("menu"),on("selectedMenu")]),Ru=o([on("item"),on("selectedItem")]),Bu=(qn=(o(zt(Ru().concat(_u()))),o(zt(Ru()))),Yn=Y("initSize",[on("numColumns"),on("numRows")]),function(e,t){return dn(e,o(t))}),Mu=(Yn=o(Yn),uo("x","y","bubble","direction","label")),Pu=it([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),zu=Pu.southeast,Iu=Pu.southwest,Lu=Pu.northeast,Fu=Pu.northwest,Hu=Pu.south,Vu=Pu.north,Uu=Pu.east,ju=Pu.west,Wu=function(e){return e.x()},qu=function(e,t){return e.x()+e.width()/2-t.width()/2},$u=function(e,t){return e.x()+e.width()-t.width()},Gu=function(e,t){return e.y()-t.height()},Xu=function(e){return e.y()+e.height()},Yu=function(e,t,n){return Mu(Wu(e),Xu(e),n.southeast(),zu(),"layout-se")},Ku=function(e,t,n){return Mu($u(e,t),Xu(e),n.southwest(),Iu(),"layout-sw")},Ju=function(e,t,n){return Mu(Wu(e),Gu(e,t),n.northeast(),Lu(),"layout-ne")},Zu=function(e,t,n){return Mu($u(e,t),Gu(e,t),n.northwest(),Fu(),"layout-nw")},Qu=function(e,t,n){return Mu(qu(e,t),Gu(e,t),n.north(),Vu(),"layout-n")},ec=function(e,t,n){return Mu(qu(e,t),Xu(e),n.south(),Hu(),"layout-s")},tc=function(e,t,n){return Mu((r=e).x()+r.width(),Aa(e,t),n.east(),Uu(),"layout-e");var r},nc=function(e,t,n){return Mu((r=t,e.x()-r.width()),Aa(e,t),n.west(),ju(),"layout-w");var r},rc=function(){return[Yu,Ku,Ju,Zu,ec,Qu]},oc=function(){return[Ku,Yu,Zu,Ju,ec,Qu]},ic=function(e,t,n,r,o,i,u){function c(e){return St(e,n)?e[n]():ye.none()}o=Qe(o,(function(e,t){return _a(n,e,t)})),i=Qe(i,yo);var s=d(d(d({},i),o),{revoke:a(Ra,n),config:function(t){var r=Yt(n+"-config",e,t);return{key:n,value:{config:r,me:s,configAsRaw:N((function(){return Yt(n+"-config",e,t)})),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(e,t){return c(e).bind((function(e){return yt(r,"exhibit").map((function(n){return n(t,e.config,e.state)}))})).getOr(So({}))},name:function(){return n},handlers:function(e){return c(e).map((function(e){return R("events",(function(e,t){return{}}))(r)(e.config,e.state)})).getOr({})}});return s},ac=function(e){return xt(e)},uc=Pt([on("fields"),on("name"),ln("active",{}),ln("apis",{}),ln("state",Fi),ln("extra",{})]),cc=Pt([on("branchKey"),on("branches"),on("name"),ln("active",{}),ln("apis",{}),ln("state",Fi),ln("extra",{})]),sc=o(void 0),lc=(Pu=Object.freeze({events:function(e){return Go([Xo(Tr(),(function(t,n){var r,o=e.channels,i=Ke(o);i=i,i=(r=n).universal()?i:Ie(i,(function(e){return Re(r.channels(),e)}));Pe(i,(function(e){var r=o[e],i=r.schema;e=Yt("channel["+e+"] data\nReceiver: "+po(t.element()),i,n.data());r.onReceive(t,e)}))}))])}}),[an("channels",V(we.value,Pt([Ea("onReceive"),ln("schema",Zt())])))]),fc=Ba({fields:lc,name:"receiving",active:Pu}),dc=(lc=Object.freeze({exhibit:function(e,t){return So({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),function(e){e.dom().focus()}),mc=function(e){return e=void 0!==e?e.dom():t.document,ye.from(e.activeElement).map(gn.fromDom)},gc=function(e){return mc(ri(e)).filter((function(t){return e.dom().contains(t.dom())}))},hc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],pc=function(e,t,n){function r(e){return yt(n,e).getOr([])}function o(e,t,n){var o=$e(hc,n);return{offset:function(){return Ja(e,t)},classesOn:function(){return je(n,r)},classesOff:function(){return je(o,r)}}}return{southeast:function(){return o(-e,t,["top","alignLeft"])},southwest:function(){return o(e,t,["top","alignRight"])},south:function(){return o(-e/2,t,["top","alignCentre"])},northeast:function(){return o(-e,-t,["bottom","alignLeft"])},northwest:function(){return o(e,-t,["bottom","alignRight"])},north:function(){return o(-e/2,-t,["bottom","alignCentre"])},east:function(){return o(e,-t/2,["valignCentre","left"])},west:function(){return o(-e,-t/2,["valignCentre","right"])},innerNorthwest:function(){return o(-e,t,["top","alignRight"])},innerNortheast:function(){return o(e,t,["top","alignLeft"])},innerNorth:function(){return o(-e/2,t,["top","alignCentre"])},innerSouthwest:function(){return o(-e,-t,["bottom","alignRight"])},innerSoutheast:function(){return o(e,-t,["bottom","alignLeft"])},innerSouth:function(){return o(-e/2,-t,["bottom","alignCentre"])},innerWest:function(){return o(e,-t/2,["valignCentre","right"])},innerEast:function(){return o(-e,-t/2,["valignCentre","left"])}}},vc=so(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),bc=uo("position","left","top","right","bottom"),yc=(Pu=it([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Pu.relative),wc=Pu.fixed,xc=function(e,t){return function(n){return"rtl"===Cc(n)?t:e}},Cc=function(e){return"rtl"===Do(e,"direction")?"rtl":"ltr"},Sc=(Pu=[on("hotspot"),Z("bubble"),ln("overrides",{}),Ha(),Bu("placement",(function(e,t,n){var r=t.hotspot;n=La(n,r.element()),r=Va(e.element(),t,rc(),oc());return ye.some({anchorBox:n,bubble:t.bubble.getOr(za()),overrides:t.overrides,layouts:r,placer:ye.none()})}))],[on("x"),on("y"),ln("height",0),ln("width",0),ln("bubble",za()),ln("overrides",{}),Ha(),Bu("placement",(function(e,t,n){return n=Fa(n,t.x,t.y),n=fu(n.left(),n.top(),t.width,t.height),e=Va(e.element(),t,[Yu,Ku,Ju,Zu,ec,Qu,tc,nc],[Ku,Yu,Zu,Ju,ec,Qu,tc,nc]),ye.some({anchorBox:n,bubble:t.bubble,overrides:t.overrides,layouts:e,placer:ye.none()})}))]),kc={create:uo("start","soffset","finish","foffset")},Tc=it([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Ec={before:Tc.before,on:Tc.on,after:Tc.after,cata:function(e,t,n,r){return e.fold(t,n,r)},getStart:function(e){return e.fold(i,i,i)}},Oc=it([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Nc={domRange:Oc.domRange,relative:Oc.relative,exact:Oc.exact,exactFromRange:function(e){return Oc.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){return e=e.match({domRange:function(e){return gn.fromDom(e.startContainer)},relative:function(e,t){return Ec.getStart(e)},exact:function(e,t,n,r){return e}}),lo(e)},range:kc.create},Ac=function(e){var t=e.getClientRects();t=0<t.length?t[0]:e.getBoundingClientRect();return 0<t.width||0<t.height?ye.some(t).map(Wa):ye.none()},Dc=it([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),_c=function(e,t){return $a(e,t).match({ltr:function(t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom(),n),i.setEnd(r.dom(),o),i},rtl:function(t,n,r,o){var i=e.document.createRange();return i.setStart(r.dom(),o),i.setEnd(t.dom(),n),i}})};Rc=Ho;var Rc,Bc,Mc={get:function(e){if(Rc(e))return Pc(e).getOr("");throw new Error("Can only get "+Bc+" value of a "+Bc+" node")},getOption:Pc,set:function(e,t){if(!Rc(e))throw new Error("Can only set raw "+Bc+" value of a "+Bc+" node");e.dom().nodeValue=t}};function Pc(e){return Rc(e)?ye.from(e.dom().nodeValue):ye.none()}function zc(e){return Mc.get(e)}function Ic(e){return Mc.getOption(e)}function Lc(e){return Ic(e).filter((function(e){return 0!==e.trim().length||-1<e.indexOf(" ")})).isSome()||Re(As,Lo(e))}function Fc(e,t,n,r){c=t,o=n,i=r,(a=ri(u=e).dom().createRange()).setStart(u.dom(),c),a.setEnd(o.dom(),i);var o,i,a,u=a,c=tr(e,n)&&t===r;return u.collapsed&&!c}function Hc(e){var t=gn.fromDom(e.anchorNode),n=gn.fromDom(e.focusNode);return Fc(t,e.anchorOffset,n,e.focusOffset)?ye.some(kc.create(t,e.anchorOffset,n,e.focusOffset)):0<(t=e).rangeCount?(n=t.getRangeAt(0),t=t.getRangeAt(t.rangeCount-1),ye.some(kc.create(gn.fromDom(n.startContainer),n.startOffset,gn.fromDom(t.endContainer),t.endOffset))):ye.none()}function Vc(e,t){return e=_c(e,t),Ac(e)}function Uc(e){return e=Me(e,Ps),zs(e)}function jc(e,t,n){var r=ri(e.element());r=ou(r),e=Fs(e,t,n).getOr(r);return Ls(e,r.left(),r.top())}function Wc(e,t){return t.getSelection.getOrThunk((function(){return function(){return Rs(e)}}))().map((function(e){var t=js(e.start(),e.soffset());e=js(e.finish(),e.foffset());return Nc.range(t.element(),t.offset(),e.element(),e.offset())}))}function qc(e){return e.x()+e.width()}function $c(e,t){return e.x()-t.width()}function Gc(e,t){return e.y()-t.height()+e.height()}function Xc(e,t,n,r){var i=e.x(),a=e.y(),u=e.bubble().offset().left(),c=e.bubble().offset().top(),s=r.y(),l=r.bottom(),f=r.x(),d=r.right();a+=c;c=i+u,i=a,u=t,t=n,r=(n=r).x(),h=n.y(),y=n.width(),g=n.height(),m=h<=i,p=(b=r<=c)&&m,v=c+u<=r+y&&i+t<=h+g,b=Math.abs(Math.min(u,b?r+y-c:r-(c+u))),y=Math.abs(Math.min(t,m?h+g-i:h-(i+t)));u=(r={originInBounds:p,sizeInBounds:v,limitX:el(c,n.x(),n.right()),limitY:el(i,n.y(),n.bottom()),deltaW:b,deltaH:y}).originInBounds;var m=r.sizeInBounds,g=r.limitX,h=r.limitY,p=(t=r.deltaW,r.deltaH),v=o(h+p-s),b=(c=o(l-h),i=e.direction().fold(c,c,v,v,c,v,c,c),n=o(g+t-f),o(d-g)),y=e.direction().fold(b,n,b,n,b,b,b,n);r=vc({x:g,y:h,width:t,height:p,maxHeight:i,maxWidth:y,direction:e.direction(),classes:{on:e.bubble().classesOn(),off:e.bubble().classesOff()},label:e.label(),candidateYforTest:a});return u&&m?tl.fit(r):tl.nofit(r,t,p)}function Yc(e,t,n,r,o){function u(e,i,a,u){return e=e(t,n,r),Xc(e,c,s,o).fold(tl.fit,(function(e,t,n){return u<n||a<t?tl.nofit(e,t,n):tl.nofit(i,a,u)}))}var c=n.width(),s=n.height();return Fe(e,(function(e,t){return t=a(u,t),e.fold(tl.fit,t)}),tl.nofit(vc({x:t.x(),y:t.y(),width:n.width(),height:n.height(),maxHeight:n.height(),maxWidth:n.width(),direction:zu(),classes:{on:[],off:[]},label:"none",candidateYforTest:t.y()}),-1,-1)).fold(i,i)}function Kc(e,t){t=Math.floor(t),t=Xa.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),oa(e,"max-height",t+"px")}function Jc(e,t,n){return void 0===e[t]?n:e[t]}function Zc(e,t,n,r,o){t=Zs(n.anchorBox,t),ll(t,o.element(),n.bubble,n.layouts,r,n.overrides)}function Qc(e,t,n,r,o,i){return i=i.map(du),fl(e,t,n,r,o,i)}function es(e,t){var n=e.components();pl(e),n=$e(n,t);Pe(n,(function(t){ml(t),e.getSystem().removeFromWorld(t)})),Pe(t,(function(t){t.getSystem().isConnected()?hl(e,t):(e.getSystem().addToWorld(t),hl(e,t),Vo(e.element())&&gl(t)),e.syncComponents()}))}function ts(e,t){Cl(e,t,mi)}function ns(e){var t=ui(e.element());Pe(t,(function(t){e.getByDom(t).each(ml)})),vi(e.element())}function rs(e,t,n,r){return n.get().each((function(t){xl(e)})),t=t.getAttachPoint(e),vl(t,e),t=e.getSystem().build(r),vl(e,t),n.set(t),t}function os(e,t,n,r){return n=rs(e,t,n,r),t.onOpen(e,n),n}function is(e,t,n){n.get().each((function(r){xl(e),wl(e),t.onClose(e,r),n.clear()}))}function as(e,t,n){return n.isOpen()}function us(e,t,n){var r,o,i=t.getAttachPoint(e);oa(e.element(),"position",dl.getMode(i)),r=e,i="visibility",o=t.cloakVisibilityAttr,e="hidden",ua(r.element(),i).fold((function(){Si(r.element(),o)}),(function(e){wi(r.element(),o,e)})),oa(r.element(),i,e)}function cs(e,t,n){var r,o;r=e.element(),Be(["top","left","right","bottom"],(function(e){return ua(r,e).isSome()}))||ca(e.element(),"position"),e=e,o="visibility",t=t.cloakVisibilityAttr,Ci(e.element(),t)?(t=xi(e.element(),t),oa(e.element(),o,t)):ca(e.element(),o)}function ss(e,t,n){t.store.manager.onLoad(e,t,n)}function ls(e,t,n){t.store.manager.onUnload(e,t,n)}function fs(){var e=mn(null);return Hi({set:e.set,get:e.get,isNotSet:function(){return null===e.get()},clear:function(){e.set(null)},readState:function(){return{mode:"memory",value:e.get()}}})}function ds(){var e=mn({}),t=mn({});return Hi({readState:function(){return{mode:"dataset",dataByValue:e.get(),dataByText:t.get()}},lookup:function(n){return yt(e.get(),n).orThunk((function(){return yt(t.get(),n)}))},update:function(n){var r=e.get(),o=t.get(),i={},a={};Pe(n,(function(e){i[e.value]=e,yt(e,"meta").each((function(t){yt(t,"text").each((function(t){a[t]=e}))}))})),e.set(d(d({},r),i)),t.set(d(d({},o),a))},clear:function(){e.set({}),t.set({})}})}function ms(e,t,n,r){var o=t.store;n.update([r]),o.setValue(e,r),t.onSetValue(e,r)}function gs(e,t){return ue(e,{},Me(t,(function(t){return n=t.name(),r="Cannot configure "+t.name()+" for "+e,Vt(n,n,ft(),Mt((function(e){return kt.serror("The field: "+n+" is forbidden. "+r)})));var n,r})).concat([dn("dump",i)]))}function hs(e,t,n,r){return n.uiType===Pl?(a=n,u=r,(i=e).exists((function(e){return e!==a.owner}))?zl.single(!0,o(a)):yt(u,a.name).fold((function(){throw new Error("Unknown placeholder component: "+a.name+"\nKnown: ["+Ke(u)+"]\nNamespace: "+i.getOr("none")+"\nSpec: "+JSON.stringify(a,null,2))}),(function(e){return e.replace()}))):zl.single(!1,o(n));var i,a,u}function ps(e,t,n,r){return hs(e,0,n,r).fold((function(o,i){i=i(t,n.config,n.validated);var a=yt(i,"components").getOr([]);a=je(a,(function(n){return ps(e,t,n,r)}));return[d(d({},i),{components:a})]}),(function(e,r){return r=r(t,n.config,n.validated),n.validated.preprocess.getOr(i)(r)}))}function vs(e){return e.fold(ye.some,ye.none,ye.some,ye.some)}function bs(e){function t(e){return e.name}return e.fold(t,t,t,t)}function ys(e,t){return function(n){return n=Yt("Converting part type",t,n),e(n)}}function ws(e,t){var n={};return Pe(t,(function(t){vs(t).each((function(t){r=e,o=t.pname;var r,o,i={uiType:Vl(),owner:r,name:o};n[t.name]=function(n){var r=Yt("Part: "+t.name+" in "+e,zt(t.schema),n);return d(d({},i),{config:n,validated:r})}}))})),n}function xs(e,t,n){return{uiType:Vl(),owner:e,name:t,config:n,validated:{}}}function Cs(e){return Me(e,bs)}function Ss(e,t,n){return Ql(e,t,n).getOrDie("Could not find part: "+n)}function ks(e,t,n){var r={},i=t.partUids,a=e.getSystem();return Pe(n,(function(e){r[e]=o(a.getByUid(i[e]))})),r}function Ts(e,t,n){var r={},i=t.partUids,a=e.getSystem();return Pe(n,(function(e){r[e]=o(a.getByUid(i[e]).getOrDie())})),r}function Es(e,t){return t=Cs(t),xt(Me(t,(function(t){return{key:t,value:e+"-"+t}})))}function Os(e,t,n,r,o){o=of(o);var i=Kl(n),a=nf(n);t=rf(e,t,o,i,[a]),i=Jl(e,t,n);return r(t,Zl(e,t,i.internals()),o,i.externals())}var Ns=function(e){return"img"===Lo(e)?1:Ic(e).fold((function(){return ui(e).length}),(function(e){return e.length}))},As=["img","br"],Ds=function(e){return t=Lc,(n=function(e){for(var r=ui(e),o=r.length-1;0<=o;o--){var i=r[o];if(t(i))return ye.some(i);if(i=n(i),i.isSome())return i}return ye.none()})(e);var t,n},_s=(Bc="text",document.caretPositionFromPoint||document.caretRangeFromPoint,function(e,t){return Qn(t,e)}),Rs=function(e){return ye.from(e.getSelection()).filter((function(e){return 0<e.rangeCount})).bind(Hc)},Bs=uo("element","offset"),Ms=(Tc=it([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),function(e){return e.fold((function(e){return e}),(function(e,t,n){return e.translate(-t,-n)}))}),Ps=function(e){return e.fold((function(e){return e}),(function(e,t,n){return e}))},zs=function(e){return Fe(e,(function(e,t){return e.translate(t.left(),t.top())}),Ja(0,0))},Is=Tc.screen,Ls=Tc.absolute,Fs=function(e,t,n){return n=lo(n.root).dom(),ye.from(n.frameElement).map(gn.fromDom).filter((function(t){t=ri(t);var n=ri(e.element());return tr(t,n)})).map(Qa)},Hs=function(e,t,n,r){var o=e,i=t,a=n,u=r;e<0&&(o=0,a=n+e),t<0&&(i=0,u=r+t),n=Is(Ja(o,i));return ye.some(su(n,a,u))},Vs=function(e,t,n,r,o){return e.map((function(e){var i=[t,e.point()],a=(a=function(){return Uc(i)},u=function(){return Uc(i)},c=function(){var e=i;return e=Me(i,Ms),zs(e)},r.fold(a,u,c)),u=lu(a.left(),a.top(),e.width(),e.height()),c=Va(o,n,n.showAbove?[Ju,Zu,Yu,Ku,Qu,ec]:[Yu,Ku,Ju,Zu,ec,ec],n.showAbove?[Zu,Ju,Ku,Yu,Qu,ec]:[Ku,Yu,Zu,Ju,ec,Qu]);return{anchorBox:u,bubble:n.bubble.getOr(za()),overrides:n.overrides,layouts:c,placer:ye.none()}}))},Us=uo("element","offset"),js=function(e,t){return Ho(e)?Us(e,t):(t=t,0===(n=ui(e=e)).length?Bs(e,t):t<n.length?Bs(n[t],0):(e=n[n.length-1],t=(Ho(e)?zc:ui)(e).length,Bs(e,t)));var n},Ws=(Tc=[Z("getSelection"),on("root"),Z("bubble"),Ha(),ln("overrides",{}),ln("showAbove",!1),Bu("placement",(function(e,t,n){var r=lo(t.root).dom(),o=jc(e,n,t),i=Wc(r,t).bind((function(e){return Vc(r,Nc.exactFromRange(e)).orThunk((function(){var t=gn.fromText("\ufeff");return fi(e.start(),t),Vc(r,Nc.exact(t,0,t,1)).map((function(e){return vi(t),e}))})).bind((function(e){return Hs(e.left(),e.top(),e.width(),e.height())}))}));e=Wc(r,t).bind((function(e){return Fo(e.start())?ye.some(e.start()):ii(e.start())})).getOr(e.element());return Vs(i,o,t,n,e)}))],[on("node"),on("root"),Z("bubble"),Ha(),ln("overrides",{}),ln("showAbove",!1),Bu("placement",(function(e,t,n){var r=jc(e,n,t);return t.node.bind((function(o){o=o.dom().getBoundingClientRect(),o=Hs(o.left,o.top,o.width,o.height);var i=t.node.getOr(e.element());return Vs(o,r,t,n,i)}))}))]),qs=function(e,t,n){return Mu(qc(e),e.y(),n.southeast(),zu(),"link-layout-se")},$s=function(e,t,n){return Mu($c(e,t),e.y(),n.southwest(),Iu(),"link-layout-sw")},Gs=function(e,t,n){return Mu(qc(e),Gc(e,t),n.northeast(),Lu(),"link-layout-ne")},Xs=function(e,t,n){return Mu($c(e,t),Gc(e,t),n.northwest(),Fu(),"link-layout-nw")},Ys=[on("item"),Ha(),ln("overrides",{}),Bu("placement",(function(e,t,n){return n=La(n,t.item.element()),e=Va(e.element(),t,[qs,$s,Gs,Xs],[$s,qs,Xs,Gs]),ye.some({anchorBox:n,bubble:za(),overrides:t.overrides,layouts:e,placer:ye.none()})}))],Ks=U("anchor",{selection:Tc,node:Ws,hotspot:Pu,submenu:Ys,makeshift:Sc}),Js=uo("anchorBox","origin"),Zs=function(e,t){return Js(e,t)},Qs=function(e,t,n,r){return e+=t,r<e?n:e<n?r:e},el=function(e,t,n){return e<=t?t:n<=e?n:e},tl=it([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),nl=function(e,t,n,r){return ca(t,"max-height"),ca(t,"max-width"),t={width:o(ru(t=t)),height:o(Ka(t))},Yc(r.preference(),e,t,n,r.bounds())},rl=function(e,t){t=t.classes(),ea(e,t.off),Qi(e,t.on)},ol=function(e,t,n){n.maxHeightFunction()(e,t.maxHeight())},il=function(e,t,n){n.maxWidthFunction()(e,t.maxWidth())},al=function(e,t,n){function r(e){return e+"px"}n=n.origin(),o=t;var o,i;t=n.fold((function(){return bc("absolute",ye.some(o.x()),ye.some(o.y()),ye.none(),ye.none())}),(function(e,t,n,r){return Ia("absolute",o,e,t,n,r)}),(function(e,t,n,r){return Ia("fixed",o,e,t,n,r)}));n=e,e={position:ye.some(t.position()),left:t.left().map(r),top:t.top().map(r),right:t.right().map(r),bottom:t.bottom().map(r)},i=n.dom(),Ze(e,(function(e,t){e.fold((function(){ra(i,t)}),(function(e){na(i,t,e)}))}))},ul=o((function(e,t){Kc(e,t),ia(e,{"overflow-x":"hidden","overflow-y":"auto"})})),cl=o((function(e,t){Kc(e,t)})),sl=so(["bounds","origin","preference","maxHeightFunction","maxWidthFunction"],[]),ll=function(e,t,r,o,i,a){var u,c=Jc(a,"maxHeightFunction",ul()),s=(a=Jc(a,"maxWidthFunction",n),e.anchorBox());e=e.origin(),i=sl({bounds:(u=e,i.fold((function(){return u.fold(gu,gu,fu)}),(function(e){return u.fold(e,e,(function(){var t=e(),n=Fa(u,t.x(),t.y());return fu(n.left(),n.top(),t.width(),t.height())}))}))),origin:e,preference:o,maxHeightFunction:c,maxWidthFunction:a});c=nl(s,e=t,r,o=i),al(e,c,o),rl(e,c),ol(e,c,o),il(e,c,o)},fl=function(e,n,r,i,a,u){var c=Yt("positioning anchor.info",Ks,i);Pa((function(){oa(a.element(),"position","fixed");var r,i=ua(a.element(),"visibility"),s=(oa(a.element(),"visibility","hidden"),n.useFixed()?(r=t.document.documentElement,wc(0,0,r.clientWidth,r.clientHeight)):(l=Qa((r=e).element()),r=r.element().dom().getBoundingClientRect(),yc(l.left(),l.top(),r.width,r.height))),l=c.placement,f=u.map(o).or(n.getBounds);l(e,c,s).each((function(t){t.placer.getOr(Zc)(e,s,t,f,a)})),i.fold((function(){ca(a.element(),"visibility")}),(function(e){oa(a.element(),"visibility",e)})),ua(a.element(),"left").isNone()&&ua(a.element(),"top").isNone()&&ua(a.element(),"right").isNone()&&ua(a.element(),"bottom").isNone()&&ua(a.element(),"position").is("fixed")&&ca(a.element(),"position")}),a.element())},dl=(Tc=Object.freeze({position:function(e,t,n,r,o){Qc(e,t,n,r,o,ye.none())},positionWithin:Qc,positionWithinBounds:fl,getMode:function(e,t,n){return t.useFixed()?"fixed":"absolute"}}),Ws=[ln("useFixed",s),Z("getBounds")],Ba({fields:Ws,name:"positioning",active:lc,apis:Tc})),ml=function(e){Gr(e,Fr()),e=e.components(),Pe(e,ml)},gl=function(e){var t=e.components();Pe(t,gl),Gr(e,Lr())},hl=function(e,t){mi(e.element(),t.element())},pl=function(e){Pe(e.components(),(function(e){return vi(e.element())})),pi(e.element()),e.syncComponents()},vl=function(e,t){bl(e,t,mi)},bl=function(e,t,n){e.getSystem().addToWorld(t),n(e.element(),t.element()),Vo(e.element())&&gl(t),e.syncComponents()},yl=function(e){ml(e),vi(e.element()),e.getSystem().removeFromWorld(e)},wl=function(e){var t=ii(e.element()).bind((function(t){return e.getSystem().getByDom(t).toOption()}));yl(e),t.each((function(e){e.syncComponents()}))},xl=function(e){var t=e.components();Pe(t,yl),pi(e.element()),e.syncComponents()},Cl=function(e,t,n){n(e,t.element()),n=ui(t.element()),Pe(n,(function(e){t.getByDom(e).each(gl)}))},Sl=(Pu=Object.freeze({cloak:us,decloak:cs,open:os,openWhileCloaked:function(e,t,n,r,o){us(e,t),os(e,t,n,r),o(),cs(e,t)},close:is,isOpen:as,isPartOf:function(e,t,n,r){return as(0,0,n)&&n.get().exists((function(n){return t.isPartOf(e,n,r)}))},getState:function(e,t,n){return n.get()},setContent:function(e,t,n,r){return n.get().map((function(){return rs(e,t,n,r)}))}}),Ys=Object.freeze({events:function(e,t){return Go([Xo(_r(),(function(n,r){is(n,e,t)}))])}}),Sc=[ka("onOpen"),ka("onClose"),on("isPartOf"),on("getAttachPoint"),ln("cloakVisibilityAttr","data-precloak-visibility")],Ba({fields:Sc,name:"sandboxing",active:Ys,apis:Pu,state:Object.freeze({init:function(){var e=mn(ye.none()),t=o("not-implemented");return Hi({readState:t,isOpen:function(){return e.get().isSome()},clear:function(){e.set(ye.none())},set:function(t){e.set(ye.some(t))},get:function(t){return e.get()}})}})})),kl=o("dismiss.popups"),Tl=o("reposition.popups"),El=o("mouse.released"),Ol=Pt([ln("isExtraPart",o(!1)),cn("fireEventInstead",[ln("event",Hr())])]),Nl=function(e){var t=Yt("Dismissal",Ol,e);e={};return e[kl()]={schema:Pt([on("target")]),onReceive:function(e,n){!Sl.isOpen(e)||Sl.isPartOf(e,n.target)||t.isExtraPart(e,n.target)||t.fireEventInstead.fold((function(){return Sl.close(e)}),(function(t){return Gr(e,t.event)}))}},e},Al=Pt([ln("isExtraPart",o(!1)),cn("fireEventInstead",[ln("event",Wn())]),X("doReposition")]),Dl=function(e){var t=Yt("Reposition",Al,e);e={};return e[Tl()]={onReceive:function(e){Sl.isOpen(e)&&t.fireEventInstead.fold((function(){return t.doReposition(e)}),(function(t){return Gr(e,t.event)}))}},e},_l=(Ws=Object.freeze({onLoad:ss,onUnload:ls,setValue:function(e,t,n,r){t.store.manager.setValue(e,t,n,r)},getValue:function(e,t,n){return t.store.manager.getValue(e,t,n)},getState:function(e,t,n){return n}}),lc=Object.freeze({events:function(e,t){var n=e.resetOnDom?[Zo((function(n,r){ss(n,e,t)})),Qo((function(n,r){ls(n,e,t)}))]:[Da(e,t,ss)];return Go(n)}}),Tc=Object.freeze({memory:fs,dataset:ds,manual:function(){return Hi({readState:function(){}})},init:function(e){return e.store.manager.state(e)}}),Sc=[Z("initialValue"),on("getFallbackEntry"),on("getDataKey"),on("setValue"),Bu("manager",{setValue:ms,getValue:function(e,t,n){var r=t.store,o=r.getDataKey(e);return n.lookup(o).fold((function(){return r.getFallbackEntry(o)}),(function(e){return e}))},onLoad:function(e,t,n){t.store.initialValue.each((function(r){ms(e,t,n,r)}))},onUnload:function(e,t,n){n.clear()},state:ds})],Ys=[on("getValue"),ln("setValue",n),Z("initialValue"),Bu("manager",{setValue:function(e,t,n,r){t.store.setValue(e,r),t.onSetValue(e,r)},getValue:function(e,t,n){return t.store.getValue(e)},onLoad:function(e,t,n){t.store.initialValue.each((function(n){t.store.setValue(e,n)}))},onUnload:n,state:Fi.init})],Pu=[Z("initialValue"),Bu("manager",{setValue:function(e,t,n,r){n.set(r),t.onSetValue(e,r)},getValue:function(e,t,n){return n.get()},onLoad:function(e,t,n){t.store.initialValue.each((function(e){n.isNotSet()&&n.set(e)}))},onUnload:function(e,t,n){n.clear()},state:fs})],Pu=[fn("store",{mode:"memory"},U("mode",{memory:Pu,manual:Ys,dataset:Sc})),ka("onSetValue"),ln("resetOnDom",!1)],Ba({fields:Pu,name:"representing",active:lc,apis:Ws,extra:{setValueFrom:function(e,t){t=_l.getValue(t),_l.setValue(e,t)}},state:Tc})),Rl=function(e){return e.dump},Bl=function(e,t){return d(d({},e.dump),ac(t))},Ml={field:gs,augment:Bl,get:Rl},Pl="placeholder",zl=it([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Il=function(e,t,n,r){return je(n,(function(n){return ps(e,t,n,r)}))},Ll=function(e,t){var n=!1;return{name:o(e),required:function(){return t.fold((function(e,t){return e}),(function(e,t){return e}))},used:function(){return n},replace:function(){if(!0===n)throw new Error("Trying to use the same placeholder more than once: "+e);return n=!0,t}}},Fl=zl.single,Hl=zl.multiple,Vl=o(Pl),Ul=(Ys=it([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Sc=ln("factory",{sketch:i}),Pu=ln("schema",[]),lc=on("name"),Ws=Vt("pname","pname",dt((function(e){return"<alloy."+Oi(e.name)+">"})),Zt()),Tc=dn("schema",(function(){return[Z("preprocess")]})),ln("defaults",o({}))),jl=ln("overrides",o({})),Wl=zt([Sc,Pu,lc,Ws,Ul,jl]),ql=zt([Sc,Pu,lc,Ul,jl]),$l=(Pu=zt([Sc,Pu,lc,Ws,Ul,jl]),Sc=zt([Sc,Tc,lc,on("unit"),Ws,Ul,jl]),ys(Ys.required,Wl)),Gl=(Tc=ys(Ys.external,ql),ys(Ys.optional,Pu)),Xl=(lc=ys(Ys.group,Sc),o("entirety")),Yl=(Ws=Object.freeze({required:$l,external:Tc,optional:Gl,group:lc,asNamedPart:vs,name:bs,asCommon:function(e){return e.fold(i,i,i,i)},original:Xl}),function(e,t,n,r){return ut(t.defaults(e,n,r),n,{uid:e.partUids[t.name]},t.overrides(e,n,r))}),Kl=function(e){return je(e,(function(e){return e.fold(ye.none,ye.some,ye.none,ye.none).map((function(e){return Y(e.name,e.schema.concat([Na(Xl())]))})).toArray()}))},Jl=function(e,t,n){return r=t,i={},a={},Pe(n,(function(e){e.fold((function(e){i[e.pname]=Fl(!0,(function(t,n,r){return e.factory.sketch(Yl(t,e,n,r))}))}),(function(e){var t=r.parts[e.name];a[e.name]=o(e.factory.sketch(Yl(r,e,t[Xl()]),t))}),(function(e){i[e.pname]=Fl(!1,(function(t,n,r){return e.factory.sketch(Yl(t,e,n,r))}))}),(function(e){i[e.pname]=Hl(!0,(function(t,n,r){var o=t[e.name];return Me(o,(function(n){return e.factory.sketch(ut(e.defaults(t,n,r),n,e.overrides(t,n)))}))}))}))})),{internals:o(i),externals:o(a)};var r,i,a},Zl=function(e,t,n){var r=ye.some(e),o=t;e=t.components,t=n;return t=Qe(t,(function(e,t){return Ll(t,e)})),e=Il(r,o,e,t),Ze(t,(function(e){if(!1===e.used()&&e.required())throw new Error("Placeholder: "+e.name()+" was not found in components list\nNamespace: "+r.getOr("none")+"\nComponents: "+JSON.stringify(o.components,null,2))})),e},Ql=function(e,t,n){return t=t.partUids[n],e.getSystem().getByUid(t).toOption()},ef=function(e,t){var n=e.getSystem();return Qe(t.partUids,(function(e,t){return o(n.getByUid(e))}))},tf=function(e){return Ke(e.partUids)},nf=function(e){return Vt("partUids","partUids",mt((function(t){return Es(t.uid,e)})),Zt())},rf=(Ul=Object.freeze({generate:ws,generateOne:xs,schemas:Kl,names:Cs,substitutes:Jl,components:Zl,defaultUids:Es,defaultUidsSchema:nf,getAllParts:ef,getAllPartNames:tf,getPart:Ql,getPartOrDie:Ss,getParts:ks,getPartsOrDie:Ts}),function(e,t,n,r,o){return o=o,r=(0<(r=r).length?[Y("parts",r)]:[]).concat([on("uid"),ln("dom",{}),ln("components",[]),Na("originalSpec"),ln("debug.sketcher",{})]).concat(o),Yt(e+" [SpecSchema]",Pt(r.concat(t)),n)}),of=function(e){return e.hasOwnProperty("uid")?e:d(d({},e),{uid:Ri("uid")})};function af(e){var t=Yt("Sketcher for "+e.name,Td,e),n=(e=Qe(t.apis,xo),Qe(t.extraApis,yo));return d(d({name:o(t.name),partFields:o([]),configFields:o(t.configFields),sketch:function(e){var n=t.name,r=t.configFields,o=t.factory;return e=of(e),o(rf(n,r,e,[],[]),e)}},e),n)}function uf(e){var t=Yt("Sketcher for "+e.name,Ed,e),n=(e=ws(t.name,t.partFields),Qe(t.apis,xo)),r=Qe(t.extraApis,yo);return d(d({name:o(t.name),partFields:o(t.partFields),configFields:o(t.configFields),sketch:function(e){return Os(t.name,t.configFields,t.partFields,t.factory,e)},parts:o(e)},n),r)}function cf(e){return"input"===Lo(e)&&"radio"!==xi(e,"type")||"textarea"===Lo(e)}function sf(e,t,n,r){var o=_s(e.element(),"."+t.highlightClass);Pe(o,(function(n){Be(r,(function(e){return e.element()===n}))||(Ji(n,t.highlightClass),e.getSystem().getByDom(n).each((function(n){t.onDehighlight(e,n),Gr(n,$r())})))}))}function lf(e,t,n,r){sf(e,t,0,[r]),ff(0,t,0,r)||(Yi(r.element(),t.highlightClass),t.onHighlight(e,r),Gr(r,qr()))}function ff(e,t,n,r){return Zi(r.element(),t.highlightClass)}function df(e,t,n){return vu(e.element(),"."+t.itemClass).bind((function(t){return e.getSystem().getByDom(t).toOption()}))}function mf(e,t,n){return(0<(t=_s(e.element(),"."+t.itemClass)).length?ye.some(t[t.length-1]):ye.none()).bind((function(t){return e.getSystem().getByDom(t).toOption()}))}function gf(e,t,n,r){var o=_s(e.element(),"."+t.itemClass);return Ve(o,(function(e){return Zi(e,t.highlightClass)})).bind((function(t){return t=Qs(t,r,0,o.length-1),e.getSystem().getByDom(o[t]).toOption()}))}function hf(e,t,n){return t=_s(e.element(),"."+t.itemClass),Cu(Me(t,(function(t){return e.getSystem().getByDom(t).toOption()})))}function pf(e,t,n){var r=qe(e.slice(0,t));e=qe(e.slice(t+1));return He(r.concat(e),n)}function vf(e,t,n){return e=qe(e.slice(0,t)),He(e,n)}function bf(e,t,n){var r=e.slice(0,t);e=e.slice(t+1);return He(e.concat(r),n)}function yf(e,t,n){return e=e.slice(t+1),He(e,n)}function wf(e){return function(t){return We(e,(function(e){return e(t)}))}}function xf(e){return!0===e.raw().shiftKey}function Cf(e){return!0===e.raw().ctrlKey}function Sf(e,t){return{matches:e,classification:t}}function kf(e,t,n,r,o){function i(e,t,n,r,o){return n=n(e,t,r,o),Bd(n,t.event()).bind((function(n){return n(e,t,r,o)}))}var a={schema:function(){return e.concat([ln("focusManager",Pd()),fn("focusInside","onFocus",qt((function(e){return Re(["onFocus","onEnterOrSpace","onApi"],e)?we.value(e):we.error("Invalid value for focusInside")}))),Bu("handler",a),Bu("state",t),Bu("sendFocusIn",o)])},processKey:i,toEvents:function(e,t){var a=e.focusInside!==Sd.OnFocusMode?ye.none():o(e).map((function(n){return Xo(Cr(),(function(r,o){n(r,e,t),o.stop()}))}));return Go(a.toArray().concat([Xo(hr(),(function(r,a){i(r,a,n,e,t).fold((function(){var n,i,u;n=r,i=a,u=_d(Dd().concat(Ad()))(i.event()),e.focusInside===Sd.OnEnterOrSpaceMode&&u&&rr(n,i)&&o(e).each((function(r){r(n,e,t),i.stop()}))}),(function(e){a.stop()}))})),Xo(pr(),(function(n,o){i(n,o,r,e,t).each((function(e){o.stop()}))}))]))}};return a}function Tf(e){function t(e,t){(function(e,t){return e=_s(e.element(),t.selector),e=Ie(e,(function(e){return r(t,e)})),ye.from(e[t.firstTabstop])})(e,t).each((function(n){t.focusManager.set(e,n)}))}function n(e,t,n,r){var o=_s(e.element(),n.selector);return i(e,n).bind((function(t){return Ve(o,a(tr,t)).bind((function(t){return u(e,o,t,n,r)}))}))}e=[Z("onEscape"),Z("onEnter"),ln("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),ln("firstTabstop",0),ln("useTabstopAt",o(!0)),Z("visibilitySelector")].concat([e]);var r=function(e,t){return e=e.visibilitySelector.bind((function(e){return bu(t,e)})).getOr(t),0<Ya(e)},i=function(e,t){return t.focusManager.get(e).bind((function(e){return bu(e,t.selector)}))},u=function(e,t,n,o,i){return i(t,n,(function(e){return r(t=o,e=e)&&t.useTabstopAt(e);var t})).fold((function(){return o.cyclic?ye.some(!0):ye.none()}),(function(t){return o.focusManager.set(e,t),ye.some(!0)}))},c=o([Sf(wf([xf,_d([9])]),(function(e,t,r,o){var i=r.cyclic?pf:vf;return n(e,0,r,i)})),Sf(_d([9]),(function(e,t,r,o){var i=r.cyclic?bf:yf;return n(e,0,r,i)})),Sf(_d([27]),(function(e,t,n,r){return n.onEscape.bind((function(n){return n(e,t)}))})),Sf(wf([Rd,_d(Ad())]),(function(e,t,n,r){return n.onEnter.bind((function(n){return n(e,t)}))}))]),s=o([]);return kf(e,Fi.init,c,s,(function(){return ye.some(t)}))}function Ef(e,t,n){return cf(n)&&_d(Dd())(t.event())?ye.none():(Kr(e,n,Er()),ye.some(!0))}function Of(e,t){return ye.some(!0)}function Nf(e,t,n){return n.execute(e,t,e.element())}function Af(e){var t=mn(ye.none());return Hi({readState:function(){return t.get().map((function(e){return{numRows:e.numRows(),numColumns:e.numColumns()}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(e,n){t.set(ye.some({numRows:o(e),numColumns:o(n)}))},getNumRows:function(){return t.get().map((function(e){return e.numRows()}))},getNumColumns:function(){return t.get().map((function(e){return e.numColumns()}))}})}function Df(e){return function(t,n,r,o){var i=e(t.element());return Id(i,t,n,r,o)}}function _f(e,t){return e=xc(e,t),Df(e)}function Rf(e,t){return t=xc(t,e),Df(t)}function Bf(e){return function(t,n,r,o){return Id(e,t,n,r,o)}}function Mf(e,t){return Ve(e,(function(e){return tr(t,e)}))}function Pf(e,t,n,r,i){return jd(e,t,r,(function(t,a){var u=t===n-1?e.length-t*r:r;a=Qs(a,i,0,u-1);return ye.some({row:o(t),column:o(a)})}))}function zf(e,t,n,r,i){return jd(e,t,r,(function(t,a){t=Qs(t,i,0,n-1);var u=t===n-1?e.length-t*r:r;a=el(a,0,u-1);return ye.some({row:o(t),column:o(a)})}))}function If(e,t,n){vu(e.element(),t.selector).each((function(n){t.focusManager.set(e,n)}))}function Lf(e){return function(t,n,r,o){return Ud(t,n,r.selector).bind((function(t){return e(t.candidates(),t.index(),o.getNumRows().getOr(r.initSize.numRows),o.getNumColumns().getOr(r.initSize.numColumns))}))}}function Ff(e,t,n,r){return n.captureTab?ye.some(!0):ye.none()}function Hf(e,t){t.getInitial(e).orThunk((function(){return vu(e.element(),t.selector)})).each((function(n){t.focusManager.set(e,n)}))}function Vf(e,t,n){return Yd(e,n.selector,t,-1)}function Uf(e,t,n){return Yd(e,n.selector,t,1)}function jf(e){return function(t,n,r){return e(t,n,r).bind((function(){return r.executeOnMove?Jd(t,n,r):ye.some(!0)}))}}function Wf(e,t,n,r){return n.onEscape(e,t)}function qf(e,t,n,r){var o=e[t].length;n=Qs(n,r,0,o-1);return Qd(e,t,n)}function $f(e,t,n,r){return n=Qs(n,r,0,e.length-1),r=e[n].length,t=el(t,0,r-1),Qd(e,n,t)}function Gf(e,t,n,r){var o=e[t].length;n=el(n+r,0,o-1);return Qd(e,t,n)}function Xf(e,t,n,r){return n=el(n+r,0,e.length-1),r=e[n].length,t=el(t,0,r-1),Qd(e,n,t)}function Yf(e,t){t.previousSelector(e).orThunk((function(){var n=t.selectors;return vu(e.element(),n.cell)})).each((function(n){t.focusManager.set(e,n)}))}function Kf(e,t){return function(n,r,o){var i=o.cycles?e:t;return bu(r,o.selectors.row).bind((function(e){var t=_s(e,o.selectors.cell);return Mf(t,r).bind((function(t){var r=_s(n,o.selectors.row);return Mf(r,e).bind((function(e){n=o;var n,a=Me(r,(function(e){return _s(e,n.selectors.cell)}));return i(a,e,t).map((function(e){return e.cell()}))}))}))}))}}function Jf(e,t,n){return n.focusManager.get(e).bind((function(r){return n.execute(e,t,r)}))}function Zf(e,t){vu(e.element(),t.selector).each((function(n){t.focusManager.set(e,n)}))}function Qf(e,t,n){return Yd(e,n.selector,t,-1)}function ed(e,t,n){return Yd(e,n.selector,t,1)}function td(e,t,n,r){r=e.getSystem().build(r),bl(e,r,n)}function nd(e,t,n,r){e=rd(e),He(e,(function(e){return tr(r.element(),e.element())})).each(wl)}function rd(e,t){return e.components()}function od(e,t,n,r,o){var i=rd(e);return ye.from(i[r]).map((function(t){return nd(e,0,0,t),o.each((function(t){td(e,0,(function(e,t){var n,o;o=t,ci(n=e,r).fold((function(){mi(n,o)}),(function(e){fi(e,o)}))}),t)})),t}))}function id(e,t){t.ignore||(dc(e.element()),t.onFocus(e))}function ad(e,t,n){(t=t.aria).update(e,t,n.get())}function ud(e,t,n){t.toggleClass.each((function(t){(n.get()?Yi:Ji)(e.element(),t)}))}function cd(e,t,n){sd(e,t,n,!n.get())}function sd(e,t,n,r){(r?um:cm)(e,t,n)}function ld(e,t,n){sd(e,t,n,t.selected)}function fd(e,t,n){wi(e.element(),"aria-expanded",n)}function dd(e){(gc(e.element()).isNone()||am.isFocused(e))&&(am.isFocused(e)||am.focus(e),Xr(e,lm,{item:e}))}function md(e){Xr(e,fm,{item:e})}function gd(){return"item-widget"}function hd(e){return"prepared"===e.type?ye.some(e.menu):ye.none()}function pd(e,t,n,r,o){function i(){return e.lazySink(t)}function a(e){return 2===e.length?u:{}}var u="horizontal"===r.type?{layouts:{onLtr:function(){return rc()},onRtl:function(){return oc()}}}:{};return Sm.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,onEscape:function(){return Sl.close(t),e.onEscape.map((function(e){return e(t)})),ye.some(!0)},onExecute:function(){return ye.some(!0)},onOpenMenu:function(e,t){dl.positionWithinBounds(i().getOrDie(),n,t,o())},onOpenSubmenu:function(e,t,n,r){var o=i().getOrDie();dl.position(o,d({anchor:"submenu",item:t},a(r)),n)},onRepositionMenu:function(e,t,r){var u=i().getOrDie();dl.positionWithinBounds(u,n,t,o()),Pe(r,(function(e){var t=a(e.triggeringPath);dl.position(u,d({anchor:"submenu",item:e.triggeringItem},t),e.triggeredMenu)}))}})}function vd(e,t){return e.x()+e.width()/2-t.width()/2}function bd(e,t){return e.x()+e.width()-t.width()}function yd(e,t){return e.y()+e.height()-t.height()}function wd(e,t,n){return Mu(e.x(),yd(e,t),n.innerSoutheast(),zu(),"layout-se")}function xd(e,t,n){return Mu(bd(e,t),yd(e,t),n.innerSouthwest(),Iu(),"layout-sw")}function Cd(e){function t(e,t){t.stop(),Yr(e)}var n=Xn().deviceType.isTouch()?[Xo(Nr(),t)]:[Xo(yr(),t),Xo(cr(),(function(e,t){t.cut()}))];return Go(Ue([e.map((function(e){return Xo(Er(),(function(t,n){e(t),n.stop()}))})).toArray(),n]))}var Sd,kd,Td=Pt([on("name"),on("factory"),on("configFields"),ln("apis",{}),ln("extraApis",{})]),Ed=Pt([on("name"),on("factory"),on("configFields"),on("partFields"),ln("apis",{}),ln("extraApis",{})]),Od=(jl=Object.freeze({getCurrent:function(e,t,n){return t.find(e)}}),Wl=[on("find")],Ba({fields:Wl,name:"composing",apis:jl})),Nd=(ql=Object.freeze({dehighlightAll:function(e,t,n){return sf(e,t,0,[])},dehighlight:function(e,t,n,r){ff(0,t,0,r)&&(Ji(r.element(),t.highlightClass),t.onDehighlight(e,r),Gr(r,$r()))},highlight:lf,highlightFirst:function(e,t,n){df(e,t).each((function(r){lf(e,t,n,r)}))},highlightLast:function(e,t,n){mf(e,t).each((function(r){lf(e,t,n,r)}))},highlightAt:function(e,t,n,r){var o,i;i=t,o=r,i=_s((r=e).element(),"."+i.itemClass),ye.from(i[o]).fold((function(){return we.error("No element found with index "+o)}),r.getSystem().getByDom).fold((function(e){throw new Error(e)}),(function(r){lf(e,t,n,r)}))},highlightBy:function(e,t,n,r){var o=hf(e,t);He(o,r).each((function(r){lf(e,t,n,r)}))},isHighlighted:ff,getHighlighted:function(e,t,n){return vu(e.element(),"."+t.highlightClass).bind((function(t){return e.getSystem().getByDom(t).toOption()}))},getFirst:df,getLast:mf,getPrevious:function(e,t,n){return gf(e,t,0,-1)},getNext:function(e,t,n){return gf(e,t,0,1)},getCandidates:hf}),Pu=[on("highlightClass"),on("itemClass"),ka("onHighlight"),ka("onDehighlight")],Ba({fields:Pu,name:"highlighting",apis:ql})),Ad=function(){return[13]},Dd=function(){return[32]},_d=function(e){return function(t){return t=t.raw(),Re(e,t.which)}},Rd=c(xf),Bd=function(e,t){return He(e,(function(e){return e.matches(t)})).map((function(e){return e.classification}))},Md=function(e,t,n){t.exists((function(e){return n.exists((function(t){return tr(t,e)}))}))||Xr(e,Vr(),{prevFocus:t,newFocus:n})},Pd=function(){function e(e){return gc(e.element())}return{get:e,set:function(t,n){var r=e(t);t.getSystem().triggerFocus(n,t.element()),n=e(t);Md(t,r,n)}}},zd=function(){function e(e){return Nd.getHighlighted(e).map((function(e){return e.element()}))}return{get:e,set:function(t,r){var o=e(t);t.getSystem().getByDom(r).fold(n,(function(e){Nd.highlight(t,e)})),r=e(t);Md(t,o,r)}}},Id=(Sc=((Ys=Sd=Sd||{}).OnFocusMode="onFocus",Ys.OnEnterOrSpaceMode="onEnterOrSpace",Ys.OnApiMode="onApi",Tf(dn("cyclic",o(!1)))),Wl=Tf(dn("cyclic",o(!0))),jl=[ln("execute",Ef),ln("useSpace",!1),ln("useEnter",!0),ln("useControlEnter",!1),ln("useDown",!1)],Pu=kf(jl,Fi.init,(function(e,t,n,r){e=n.useSpace&&!cf(e.element())?Dd():[];var o=n.useEnter?Ad():[],i=n.useDown?[40]:[];e=e.concat(o).concat(i);return[Sf(_d(e),Nf)].concat(n.useControlEnter?[Sf(wf([Cf,_d(Ad())]),Nf)]:[])}),(function(e,t,n,r){return n.useSpace&&!cf(e.element())?[Sf(_d(Dd()),Of)]:[]}),(function(){return ye.none()})),ql=Object.freeze({flatgrid:Af,init:function(e){return e.state(e)}}),function(e,t,n,r,o){return r.focusManager.get(t).bind((function(n){return e(t.element(),n,r,o)})).map((function(e){return r.focusManager.set(t,e),!0}))}),Ld=(Ys=Bf,jl=Bf,Bf),Fd=function(e){e=e.dom();return!((e=e).offsetWidth<=0&&e.offsetHeight<=0)},Hd=so(["index","candidates"],[]),Vd=function(e,t){return Ve(e,t).map((function(t){return Hd({index:t,candidates:e})}))},Ud=function(e,t,n){return t=a(tr,t),e=_s(e,n),n=Ie(e,Fd),Vd(n,t)},jd=function(e,t,n,r){return r(Math.floor(t/n),t%n).bind((function(t){return t=t.row()*n+t.column(),0<=t&&t<e.length?ye.some(e[t]):ye.none()}))},Wd=[on("selector"),ln("execute",Ef),Ta("onEscape"),ln("captureTab",!1),Yn()],qd=Lf((function(e,t,n,r){return Pf(e,t,n,r,-1)})),$d=Lf((function(e,t,n,r){return Pf(e,t,n,r,1)})),Gd=Lf((function(e,t,n,r){return zf(e,t,n,r,-1)})),Xd=Lf((function(e,t,n,r){return zf(e,t,n,r,1)})),Yd=(qd=o([Sf(_d([37]),_f(qd,$d)),Sf(_d([39]),Rf(qd,$d)),Sf(_d([38]),Ys(Gd)),Sf(_d([40]),jl(Xd)),Sf(wf([xf,_d([9])]),Ff),Sf(wf([Rd,_d([9])]),Ff),Sf(_d([27]),(function(e,t,n,r){return n.onEscape(e,t)})),Sf(_d(Dd().concat(Ad())),(function(e,t,n,r){return(o=n).focusManager.get(e).bind((function(e){return bu(e,o.selector)})).bind((function(r){return n.execute(e,t,r)}));var o}))]),$d=o([Sf(_d(Dd()),Of)]),Gd=kf(Wd,Af,qd,$d,(function(){return ye.some(If)})),function(e,t,n,r){function o(e,t,n){var i;return(t=Qs(t,r,0,n.length-1))===e?ye.none():(i=n[t],"button"===Lo(i)&&"disabled"===xi(i,"disabled")?o(e,t,n):ye.from(n[t]))}return Ud(e,n,t).bind((function(e){var t=e.index();e=e.candidates();return o(t,t,e)}))}),Kd=(Xd=[on("selector"),ln("getInitial",ye.none),ln("execute",Ef),Ta("onEscape"),ln("executeOnMove",!1),ln("allowVertical",!0)],function(e,t){return t.focusManager.get(e).bind((function(e){return bu(e,t.selector)}))}),Jd=function(e,t,n){return Kd(e,n).bind((function(r){return n.execute(e,t,r)}))},Zd=(Wd=o([Sf(_d(Dd()),Of)]),qd=kf(Xd,Fi.init,(function(e,t,n,r){var o=[37].concat(n.allowVertical?[38]:[]);n=[39].concat(n.allowVertical?[40]:[]);return[Sf(_d(o),jf(_f(Vf,Uf))),Sf(_d(n),jf(Rf(Vf,Uf))),Sf(_d(Ad()),Jd),Sf(_d(Dd()),Jd),Sf(_d([27]),Wf)]}),Wd,(function(){return ye.some(Hf)})),so(["rowIndex","columnIndex","cell"],[])),Qd=function(e,t,n){return ye.from(e[t]).bind((function(e){return ye.from(e[n]).map((function(e){return Zd({rowIndex:t,columnIndex:n,cell:e})}))}))},em=($d=[Y("selectors",[on("row"),on("cell")]),ln("cycles",!0),ln("previousSelector",ye.none),ln("execute",Ef)],Xd=Kf((function(e,t,n){return qf(e,t,n,-1)}),(function(e,t,n){return Gf(e,t,n,-1)})),Wd=Kf((function(e,t,n){return qf(e,t,n,1)}),(function(e,t,n){return Gf(e,t,n,1)})),Kf((function(e,t,n){return $f(e,n,t,-1)}),(function(e,t,n){return Xf(e,n,t,-1)}))),tm=Kf((function(e,t,n){return $f(e,n,t,1)}),(function(e,t,n){return Xf(e,n,t,1)})),nm=(Xd=o([Sf(_d([37]),_f(Xd,Wd)),Sf(_d([39]),Rf(Xd,Wd)),Sf(_d([38]),Ys(em)),Sf(_d([40]),jl(tm)),Sf(_d(Dd().concat(Ad())),(function(e,t,n){return gc(e.element()).bind((function(r){return n.execute(e,t,r)}))}))]),Wd=o([Sf(_d(Dd()),Of)]),Ys=kf($d,Fi.init,Xd,Wd,(function(){return ye.some(Yf)})),em=[on("selector"),ln("execute",Ef),ln("moveOnTab",!1)],jl=o([Sf(_d([38]),Ld(Qf)),Sf(_d([40]),Ld(ed)),Sf(wf([xf,_d([9])]),(function(e,t,n){return n.moveOnTab?Ld(Qf)(e,t,n):ye.none()})),Sf(wf([Rd,_d([9])]),(function(e,t,n){return n.moveOnTab?Ld(ed)(e,t,n):ye.none()})),Sf(_d(Ad()),Jf),Sf(_d(Dd()),Jf)]),tm=o([Sf(_d(Dd()),Of)]),$d=kf(em,Fi.init,jl,tm,(function(){return ye.some(Zf)})),Xd=[Ta("onSpace"),Ta("onEnter"),Ta("onShiftEnter"),Ta("onLeft"),Ta("onRight"),Ta("onTab"),Ta("onShiftTab"),Ta("onUp"),Ta("onDown"),Ta("onEscape"),ln("stopSpaceKeyup",!1),Z("focusIn")],Wd=kf(Xd,Fi.init,(function(e,t,n){return[Sf(_d(Dd()),n.onSpace),Sf(wf([Rd,_d(Ad())]),n.onEnter),Sf(wf([xf,_d(Ad())]),n.onShiftEnter),Sf(wf([xf,_d([9])]),n.onShiftTab),Sf(wf([Rd,_d([9])]),n.onTab),Sf(_d([38]),n.onUp),Sf(_d([40]),n.onDown),Sf(_d([37]),n.onLeft),Sf(_d([39]),n.onRight),Sf(_d(Dd()),n.onSpace),Sf(_d([27]),n.onEscape)]}),(function(e,t,n){return n.stopSpaceKeyup?[Sf(_d(Dd()),Of)]:[]}),(function(e){return e.focusIn})),em=Sc.schema(),jl=Wl.schema(),tm=qd.schema(),Xd=Gd.schema(),Sc=Ys.schema(),Wl=Pu.schema(),qd=$d.schema(),Gd=Wd.schema(),Ma({branchKey:"mode",branches:Object.freeze({acyclic:em,cyclic:jl,flow:tm,flatgrid:Xd,matrix:Sc,execution:Wl,menu:qd,special:Gd}),name:"keying",active:{events:function(e,t){return e.handler.toEvents(e,t)}},apis:{focusIn:function(e,t,n){t.sendFocusIn(t).fold((function(){e.getSystem().triggerFocus(e.element(),e.element())}),(function(r){r(e,t,n)}))},setGridSize:function(e,n,r,o,i){St(r,"setGridSize")?r.setGridSize(o,i):t.console.error("Layout does not support setGridSize")}},state:ql})),rm=Ba({fields:[],name:"replacing",apis:Object.freeze({append:function(e,t,n,r){td(e,0,mi,r)},prepend:function(e,t,n,r){td(e,0,fo,r)},remove:nd,replaceAt:od,replaceBy:function(e,t,n,r,o){var i=rd(e);return Ve(i,r).bind((function(t){return od(e,0,0,t,o)}))},set:function(e,t,n,r){Pa((function(){var t=Me(r,e.getSystem().build);es(e,t)}),e.element())},contents:rd})}),om=function(e,t){return t=Go(t),Ba({fields:[on("enabled")],name:e,active:{events:o(t)}})},im=function(e,t){return{key:e,value:{config:{},me:om(e,t),configAsRaw:o({}),initialConfig:{},state:Fi}}},am=(Ys=Object.freeze({focus:id,blur:function(e,t){t.ignore||e.element().dom().blur()},isFocused:function(e){return e=e.element(),t=ri(e).dom(),e.dom()===t.activeElement;var t}}),Pu=Object.freeze({exhibit:function(e,t){return t=t.ignore?{}:{attributes:{tabindex:"-1"}},So(t)},events:function(e){return Go([Xo(Cr(),(function(t,n){id(t,e),n.stop()}))].concat(e.stopMousedown?[Xo(cr(),(function(e,t){t.event().prevent()}))]:[]))}}),$d=[ka("onFocus"),ln("stopMousedown",!1),ln("ignore",!1)],Ba({fields:$d,name:"focusing",active:Pu,apis:Ys})),um=function(e,t,n){n.set(!0),ud(e,t,n),ad(e,t,n)},cm=function(e,t,n){n.set(!1),ud(e,t,n),ad(e,t,n)},sm=(Wd=Object.freeze({onLoad:ld,toggle:cd,isOn:function(e,t,n){return n.get()},on:um,off:cm,set:sd}),em=Object.freeze({exhibit:function(e,t,n){return So({})},events:function(e,t){n=e,r=t,o=cd;var n,r,o,i=ti((function(e){o(e,n,r)}));t=Da(e,t,ld);return Go(Ue([e.toggleOnExecute?[i]:[],[t]]))}}),jl=[ln("selected",!1),Z("toggleClass"),ln("toggleOnExecute",!0),fn("aria",{mode:"none"},U("mode",{pressed:[ln("syncWithExpanded",!1),Bu("update",(function(e,t,n){wi(e.element(),"aria-pressed",n),t.syncWithExpanded&&fd(e,0,n)}))],checked:[Bu("update",(function(e,t,n){wi(e.element(),"aria-checked",n)}))],expanded:[Bu("update",fd)],selected:[Bu("update",(function(e,t,n){wi(e.element(),"aria-selected",n)}))],none:[Bu("update",n)]}))],Ba({fields:jl,name:"toggling",active:em,apis:Wd,state:(kd=!1,{init:function(){var e=mn(kd);return{get:function(){return e.get()},set:function(t){return e.set(t)},clear:function(){return e.set(kd)},readState:function(){return e.get()}}}})})),lm="alloy.item-hover",fm="alloy.item-focus",dm=o(lm),mm=o(fm),gm=(tm=[on("data"),on("components"),on("dom"),ln("hasSubmenu",!1),Z("toggling"),Ml.field("itemBehaviours",[sm,am,nm,_l]),ln("ignoreFocus",!1),ln("domModification",{}),Bu("builder",(function(e){return{dom:e.dom,domModification:d(d({},e.domModification),{attributes:d(d(d({role:e.toggling.isSome()?"menuitemcheckbox":"menuitem"},e.domModification.attributes),{"aria-haspopup":e.hasSubmenu}),e.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Ml.augment(e.itemBehaviours,[e.toggling.fold(sm.revoke,(function(e){return sm.config(d({aria:{mode:"checked"}},e))})),am.config({ignore:e.ignoreFocus,stopMousedown:e.ignoreFocus,onFocus:function(e){md(e)}}),nm.config({mode:"execution"}),_l.config({store:{mode:"memory",initialValue:e.data}}),im("item-type-events",[Xo(Ar(),Yr),ao(cr()),Xo(dr(),dd),Xo(Or(),am.focus)])]),components:e.components,eventOrder:e.eventOrder}})),ln("eventOrder",{})],Xd=[on("dom"),on("components"),Bu("builder",(function(e){return{dom:e.dom,components:e.components,events:Go([(e=Or(),Xo(e,(function(e,t){t.stop()})))])}}))],o([$l({name:"widget",overrides:function(e){return{behaviours:ac([_l.config({store:{mode:"manual",getValue:function(t){return e.data},setValue:function(){}}})])}}})])),hm=(Sc=[on("uid"),on("data"),on("components"),on("dom"),ln("autofocus",!1),ln("ignoreFocus",!1),Ml.field("widgetBehaviours",[_l,am,nm]),ln("domModification",{}),nf(gm()),Bu("builder",(function(e){function t(t){return Ql(t,e,"widget").map((function(e){return nm.focusIn(e),e}))}function n(t,n){return cf(n.event().target())||e.autofocus&&n.setSource(t.element()),ye.none()}var r=Jl(gd(),e,gm());r=Zl(gd(),e,r.internals());return{dom:e.dom,components:r,domModification:e.domModification,events:Go([ti((function(e,n){t(e).each((function(e){n.stop()}))})),Xo(dr(),dd),Xo(Or(),(function(n,r){e.autofocus?t(n):am.focus(n)}))]),behaviours:Ml.augment(e.widgetBehaviours,[_l.config({store:{mode:"memory",initialValue:e.data}}),am.config({ignore:e.ignoreFocus,onFocus:function(e){md(e)}}),nm.config({mode:"special",focusIn:e.autofocus?function(e){t(e)}:sc(),onLeft:n,onRight:n,onEscape:function(t,n){return am.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element()),ye.none()):(am.focus(t),ye.some(!0))}})])}}))],U("type",{widget:Sc,item:tm,separator:Xd})),pm=(Wl=o([lc({factory:{sketch:function(e){return e=Yt("menu.spec item",hm,e),e.builder(e)}},name:"items",unit:"item",defaults:function(e,t){return t.hasOwnProperty("uid")?t:d(d({},t),{uid:Ri("item")})},overrides:function(e,t){return{type:t.type,ignoreFocus:e.fakeFocus,domModification:{classes:[e.markers.item]}}}})]),qd=o([on("value"),on("items"),on("dom"),on("components"),ln("eventOrder",{}),gs("menuBehaviours",[Nd,_l,Od,nm]),fn("movement",{mode:"menu",moveOnTab:!0},U("mode",{grid:[Yn(),Bu("config",(function(e,t){return{mode:"flatgrid",selector:"."+e.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:e.focusManager}}))],matrix:[Bu("config",(function(e,t){return{mode:"matrix",selectors:{row:t.rowSelector,cell:"."+e.markers.item},focusManager:e.focusManager}})),on("rowSelector")],menu:[ln("moveOnTab",!0),Bu("config",(function(e,t){return{mode:"menu",selector:"."+e.markers.item,moveOnTab:t.moveOnTab,focusManager:e.focusManager}}))]})),an("markers",qn()),ln("fakeFocus",!1),ln("focusManager",Pd()),ka("onHighlight")]),o("alloy.menu-focus")),vm=uf({name:"Menu",configFields:qd(),partFields:Wl(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Bl(e.menuBehaviours,[Nd.config({highlightClass:e.markers.selectedItem,itemClass:e.markers.item,onHighlight:e.onHighlight}),_l.config({store:{mode:"memory",initialValue:e.value}}),Od.config({find:ye.some}),nm.config(e.movement.config(e,e.movement))]),events:Go([Xo(mm(),(function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each((function(n){Nd.highlight(e,n),t.stop(),Xr(e,pm(),{menu:e,item:n})}))})),Xo(dm(),(function(e,t){t=t.event().item(),Nd.highlight(e,t)}))]),components:t,eventOrder:e.eventOrder,domModification:{attributes:{role:"menu"}}}}}),bm=function(e){return et(e,(function(e,t){return{k:e,v:t}}))},ym=function(e,t,n,r){return yt(n,r).bind((function(r){return yt(e,r).bind((function(r){var o=ym(e,t,n,r);return ye.some([r].concat(o))}))})).getOr([])},wm=function(){function e(e){return yt(t.get(),e)}var t=mn({}),n=mn({}),r=mn({}),o=mn(ye.none()),i=mn({}),a=function(e){return E(t.get(),(function(t,n){return t===e}))},u=function(e){return c(e).bind(hd)},c=function(e){return yt(n.get(),e)};return{setMenuBuilt:function(e,t){var r;n.set(d(d({},n.get()),((r={})[e]={type:"prepared",menu:t},r)))},setContents:function(e,a,u,c){o.set(ye.some(e)),t.set(u),n.set(a),i.set(c),e=u,s={},Ze(c,(function(e,t){Pe(e,(function(e){s[e]=t}))})),f=bm(l=e),d=Qe(f,(function(e,t){return[t].concat(ym(s,l,f,t))}));var s,l,f,d;a=Qe(s,(function(e){return yt(d,e).getOr([e])}));r.set(a)},expand:function(e){return yt(t.get(),e).map((function(t){var n=yt(r.get(),e).getOr([]);return[t].concat(n)}))},refresh:function(e){return yt(r.get(),e)},collapse:function(e){return yt(r.get(),e).bind((function(e){return 1<e.length?ye.some(e.slice(1)):ye.none()}))},lookupMenu:c,lookupItem:e,otherMenus:function(e){var t=i.get();return $e(Ke(t),e)},getPrimary:function(){return o.get().bind(u)},getMenus:function(){return n.get()},clear:function(){t.set({}),n.set({}),r.set({}),o.set(ye.none())},isClear:function(){return o.get().isNone()},getTriggeringPath:function(t,n){var i=Ie(e(t).toArray(),(function(e){return u(e).isSome()}));return yt(r.get(),t).bind((function(e){for(var t=qe(i.concat(e)),r=je(t,(function(e,r){return i=e,c=n,s=t.slice(0,r+1),u(i).bind((function(e){return a(i).bind((function(t){return c(t).map((function(t){return{triggeredMenu:e,triggeringItem:t,triggeringPath:s}}))}))})).fold((function(){return o.get().is(e)?[]:[ye.none()]}),(function(e){return[ye.some(e)]}));var i,c,s})),c=[],s=0;s<r.length;s++){var l=r[s];if(!l.isSome())return ye.none();c.push(l.getOrDie())}return ye.some(c)}))}}},xm=hd,Cm=o("collapse-item"),Sm=af({name:"TieredMenu",configFields:[Oa("onExecute"),Oa("onEscape"),Ea("onOpenMenu"),Ea("onOpenSubmenu"),Ea("onRepositionMenu"),ka("onCollapseMenu"),ln("highlightImmediately",!0),Y("data",[on("primary"),on("menus"),on("expansions")]),ln("fakeFocus",!1),ka("onHighlight"),ka("onHover"),xa(),on("dom"),ln("navigateOnHover",!0),ln("stayInDom",!1),gs("tmenuBehaviours",[nm,Nd,Od,rm]),ln("eventOrder",{})],apis:{collapseMenu:function(e,t){e.collapseMenu(t)},highlightPrimary:function(e,t){e.highlightPrimary(t)},repositionMenus:function(e,t){e.repositionMenus(t)}},factory:function(e,t){function n(t){n=t,r=e.data.primary,t=e.data.menus;t=Qe(t,(function(t,o){function i(){return vm.sketch(d(d({dom:t.dom},t),{value:o,items:t.items,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:e.onHighlight,focusManager:(e.fakeFocus?zd:Pd)()}))}return o===r?{type:"prepared",menu:n.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}));var n,r,o=Qe(e.data.menus,(function(e,t){return je(e.items,(function(e){return"separator"===e.type?[]:[e.data.value]}))}));return f.setContents(e.data.primary,t,e.data.expansions,o),f.getPrimary()}function r(e,t){e=v(e),Ze(e,(function(e,n){n=Re(t,n),wi(e.element(),"aria-expanded",n)}))}function o(t,n,r){return ye.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){var i;return"notbuilt"===o.type?ye.none():(o=o.menu,i=h(n,r.slice(1)),Pe(i,(function(t){Yi(t.element(),e.markers.backgroundMenu)})),Vo(o.element())||rm.append(t,va(o)),ea(o.element(),[e.markers.backgroundMenu]),g(t,o),p(t,n,r),ye.some(o))}))}))}function i(t,n,i){void 0===i&&(i=s.HighlightSubmenu);var a=m(n);return f.expand(a).bind((function(a){return r(t,a),ye.from(a[0]).bind((function(r){return f.lookupMenu(r).bind((function(u){c=t,l=r;var c,l="notbuilt"===(u=u).type?(c=c.getSystem().build(u.nbMenu()),f.setMenuBuilt(l,c),c):u.menu;return Vo(l.element())||rm.append(t,va(l)),e.onOpenSubmenu(t,n,l,qe(a)),i===s.HighlightSubmenu?(Nd.highlightFirst(l),o(t,f,a)):(Nd.dehighlightAll(l),ye.some(n))}))}))}))}function a(t,n){var i=m(n);return f.collapse(i).bind((function(i){return r(t,i),o(t,f,i).map((function(r){return e.onCollapseMenu(t,n,r),r}))}))}function u(t){return function(n,r){return bu(r.getSource(),"."+e.markers.item).bind((function(e){return n.getSystem().getByDom(e).toOption().bind((function(e){return t(n,e).map((function(){return!0}))}))}))}}function c(e){return Nd.getHighlighted(e).bind(Nd.getHighlighted)}var s,l=mn(ye.none()),f=wm(),m=function(e){return _l.getValue(e).value},g=function(e,t){Nd.highlight(e,t),Nd.getHighlighted(t).orThunk((function(){return Nd.getFirst(t)})).each((function(t){Kr(e,t.element(),Or())}))},h=function(e,t){return Cu(Me(t,(function(t){return e.lookupMenu(t).bind((function(e){return"prepared"===e.type?ye.some(e.menu):ye.none()}))})))},p=function(t,n,r){n=h(n,n.otherMenus(r)),Pe(n,(function(n){ea(n.element(),[e.markers.backgroundMenu]),e.stayInDom||rm.remove(t,n)}))},v=function(t){return l.get().getOrThunk((function(){var n={},r=_s(t.element(),"."+e.markers.item);r=Ie(r,(function(e){return"true"===xi(e,"aria-haspopup")}));return Pe(r,(function(e){t.getSystem().getByDom(e).each((function(e){var t=m(e);n[t]=e}))})),l.set(ye.some(n)),n}))},b=((b=s=s||{})[b.HighlightSubmenu=0]="HighlightSubmenu",b[b.HighlightParent=1]="HighlightParent",Go([Xo(pm(),(function(e,t){var n=t.event().item();f.lookupItem(m(n)).each((function(){var n=t.event().menu();Nd.highlight(e,n),n=m(t.event().item());f.refresh(n).each((function(t){return p(e,f,t)}))}))})),ti((function(t,n){n=n.event().target(),t.getSystem().getByDom(n).each((function(n){0===m(n).indexOf("collapse-item")&&a(t,n),i(t,n,s.HighlightSubmenu).fold((function(){e.onExecute(t,n)}),(function(){}))}))})),Zo((function(t,r){n(t).each((function(n){rm.append(t,va(n)),e.onOpenMenu(t,n),e.highlightImmediately&&g(t,n)}))}))].concat(e.navigateOnHover?[Xo(dm(),(function(t,n){n=n.event().item();var a=t,u=n;u=m(n),f.refresh(u).bind((function(e){return r(a,e),o(a,f,e)})),i(t,n,s.HighlightParent),e.onHover(t,n)}))]:[]))),y={collapseMenu:function(e){c(e).each((function(t){a(e,t)}))},highlightPrimary:function(e){f.getPrimary().each((function(t){g(e,t)}))},repositionMenus:function(t){f.getPrimary().bind((function(e){return c(t).bind((function(e){e=m(e);var t=nt(f.getMenus()),n=Cu(Me(t,xm));return f.getTriggeringPath(e,(function(e){return t=e,Su(n,(function(e){return e.getSystem().isConnected()?(e=Nd.getCandidates(e),He(e,(function(e){return m(e)===t}))):ye.none()}));var t}))})).map((function(t){return{primary:e,triggeringPath:t}}))})).fold((function(){ye.from(t.components()[0]).filter((function(e){return"menu"===xi(e.element(),"role")})).each((function(n){e.onRepositionMenu(t,n,[])}))}),(function(n){var r=n.primary;n=n.triggeringPath;e.onRepositionMenu(t,r,n)}))}};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:Bl(e.tmenuBehaviours,[nm.config({mode:"special",onRight:u((function(e,t){return cf(t.element())?ye.none():i(e,t,s.HighlightSubmenu)})),onLeft:u((function(e,t){return cf(t.element())?ye.none():a(e,t)})),onEscape:u((function(t,n){return a(t,n).orThunk((function(){return e.onEscape(t,n).map((function(){return t}))}))})),focusIn:function(e,t){f.getPrimary().each((function(t){Kr(e,t.element(),Or())}))}}),Nd.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),Od.config({find:function(e){return Nd.getHighlighted(e)}}),rm.config({})]),eventOrder:e.eventOrder,apis:y,events:b}},extraApis:{tieredData:function(e,t,n){return{primary:e,menus:t,expansions:n}},singleData:function(e,t){return{primary:e,menus:wt(e,t),expansions:{}}},collapseItem:function(e){return{value:Oi(Cm()),meta:{text:e}}}}}),km=af({name:"InlineView",configFields:[on("lazySink"),ka("onShow"),ka("onHide"),te("onEscape"),gs("inlineBehaviours",[Sl,_l,fc]),cn("fireDismissalEventInstead",[ln("event",Hr())]),cn("fireRepositionEventInstead",[ln("event",Wn())]),ln("getRelated",ye.none),ln("eventOrder",ye.none)],factory:function(e,t){function n(e,t,n,r){a(e,t,n,(function(){return r.map((function(e){return du(e)}))}))}function r(t,n,r,o){n=pd(e,t,n,r,o),Sl.open(t,n),_l.setValue(t,ye.some({mode:"menu",menu:n}))}function i(t){Sl.isOpen(t)&&_l.getValue(t).each((function(n){switch(n.mode){case"menu":Sl.getState(t).each((function(e){Sm.repositionMenus(e)}));break;case"position":var r=e.lazySink(t).getOrDie();dl.positionWithinBounds(r,n.anchor,t,n.getBounds())}}))}var a=function(t,n,r,o){var i=e.lazySink(t).getOrDie();Sl.openWhileCloaked(t,r,(function(){return dl.positionWithinBounds(i,n,t,o())})),_l.setValue(t,ye.some({mode:"position",anchor:n,getBounds:o}))},u={setContent:function(e,t){Sl.setContent(e,t)},showAt:function(e,t,r){n(e,t,r,ye.none())},showWithin:n,showWithinBounds:a,showMenuAt:function(e,t,n){r(e,t,n,(function(){return ye.none()}))},showMenuWithinBounds:r,hide:function(e){_l.setValue(e,ye.none()),Sl.close(e)},getContent:function(e){return Sl.getState(e)},reposition:i,isOpen:Sl.isOpen};return{uid:e.uid,dom:e.dom,behaviours:Bl(e.inlineBehaviours,[Sl.config({isPartOf:function(t,n,r){return xu(n,r)||(o=r,e.getRelated(t).exists((function(e){return xu(e,o)})));var o},getAttachPoint:function(t){return e.lazySink(t).getOrDie()},onOpen:function(t){e.onShow(t)},onClose:function(t){e.onHide(t)}}),_l.config({store:{mode:"memory",initialValue:ye.none()}}),fc.config({channels:d(d({},Nl(d({isExtraPart:o(!1)},e.fireDismissalEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})))),Dl(d(d({isExtraPart:o(!1)},e.fireRepositionEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})),{doReposition:i})))})]),eventOrder:e.eventOrder,apis:u}},apis:{showAt:function(e,t,n,r){e.showAt(t,n,r)},showWithin:function(e,t,n,r,o){e.showWithin(t,n,r,o)},showWithinBounds:function(e,t,n,r,o){e.showWithinBounds(t,n,r,o)},showMenuAt:function(e,t,n,r){e.showMenuAt(t,n,r)},showMenuWithinBounds:function(e,t,n,r,o){e.showMenuWithinBounds(t,n,r,o)},hide:function(e,t){e.hide(t)},isOpen:function(e,t){return e.isOpen(t)},getContent:function(e,t){return e.getContent(t)},setContent:function(e,t,n){e.setContent(t,n)},reposition:function(e,t){e.reposition(t)}}}),Tm=function(e,t,n){return Mu(e.x(),e.y(),n.innerNortheast(),Lu(),"layout-ne")},Em=function(e,t,n){return Mu(bd(e,t),e.y(),n.innerNorthwest(),Fu(),"layout-nw")},Om=function(e,t,n){return Mu(vd(e,t),e.y(),n.innerNorth(),Vu(),"layout-n")},Nm=function(e,t,n){return Mu(vd(e,t),yd(e,t),n.innerSouth(),Hu(),"layout-s")},Am=af({name:"Button",factory:function(e){function t(t){return yt(e.dom,"attributes").bind((function(e){return yt(e,t)}))}var n=Cd(e.action),r=e.dom.tag;return{uid:e.uid,dom:e.dom,components:e.components,events:n,behaviours:Ml.augment(e.buttonBehaviours,[am.config({}),nm.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:"button"===r?(n=t("type").getOr("button"),r=t("role").map((function(e){return{role:e}})).getOr({}),d({type:n},r)):{role:t("role").getOr("button")}},eventOrder:e.eventOrder}},configFields:[ln("uid",void 0),on("dom"),ln("components",[]),Ml.field("buttonBehaviours",[am,nm]),Z("action"),Z("role"),ln("eventOrder",{})]}),Dm=function(e){var t=void 0!==e.uid&&St(e,"uid")?e.uid:Ri("memento");return{get:function(e){return e.getSystem().getByUid(t).getOrDie()},getOpt:function(e){return e.getSystem().getByUid(t).toOption()},asSpec:function(){return d(d({},e),{uid:t})}}},_m=function(e){return ye.from(e()["temporary-placeholder"]).getOr("!not found!")},Rm=function(e,t){return ye.from(t()[e]).getOrThunk((function(){return _m(t)}))},Bm=function(e,t,n){return ye.from(t()[e]).or(n).getOrThunk((function(){return _m(t)}))},Mm={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Pm=af({name:"Notification",factory:function(e){function t(e){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+e+"%"}}}}function n(e){return{dom:{tag:"div",classes:["tox-text"],innerHtml:e+"%"}}}var r,o=Dm({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:ac([rm.config({})])}),i=Dm({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[t(0)]},n(0)],behaviours:ac([rm.config({})])}),a={updateProgress:function(e,r){e.getSystem().isConnected()&&i.getOpt(e).each((function(e){rm.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[t(r)]},n(r)])}))},updateText:function(e,t){e.getSystem().isConnected()&&(e=o.get(e),rm.set(e,[ma(t)]))}},u=Ue([e.icon.toArray(),e.level.toArray(),e.level.bind((function(e){return ye.from(Mm[e])})).toArray()]);return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map((function(e){return["tox-notification","tox-notification--in","tox-notification--"+e]})).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(r=e.iconProvider,Su(u,(function(e){return ye.from(r()[e])})).getOrThunk((function(){return _m(r)})))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:ac([rm.config({})])}].concat(e.progress?[i.asSpec()]:[]).concat(Am.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:Rm("close",e.iconProvider),attributes:{"aria-label":e.translationProvider("Close")}}}],action:function(t){e.onAction(t)}})),apis:a}},configFields:[Z("level"),on("progress"),on("icon"),on("onAction"),on("text"),on("iconProvider"),on("translationProvider")],apis:{updateProgress:function(e,t,n){e.updateProgress(t,n)},updateText:function(e,t,n){e.updateText(t,n)}}}),zm=tinymce.util.Tools.resolve("tinymce.util.Delay");function Im(e,t,n){var r=t.backstage;return{open:function(e,o){function i(){o(),km.hide(u)}var a=pa(Pm.sketch({text:e.text,level:Re(["success","error","warning","warn","info"],e.type)?e.type:void 0,progress:!0===e.progressBar,icon:ye.from(e.icon),onAction:i,iconProvider:r.shared.providers.icons,translationProvider:r.shared.providers.translate})),u=pa(km.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:t.backstage.shared.getSink,fireDismissalEventInstead:{}}));return n.add(u),0<e.timeout&&zm.setTimeout((function(){i()}),e.timeout),{close:i,moveTo:function(e,t){km.showAt(u,{anchor:"makeshift",x:e,y:t},va(a))},moveRel:function(e,n){var r;"banner"!==n?(r=function(e){switch(e){case"bc-bc":return Nm;case"tc-tc":return Om;case"tc-bc":return Qu;default:return ec}}(n),n={anchor:"node",root:Uo(),node:ye.some(gn.fromDom(e)),layouts:{onRtl:function(){return[r]},onLtr:function(){return[r]}}},km.showAt(u,n,va(a))):km.showAt(u,t.backstage.shared.anchors.banner(),va(a))},text:function(e){Pm.updateText(a,e)},settings:e,getEl:function(){return a.element().dom()},progressBar:{value:function(e){Pm.updateProgress(a,e)}}}},close:function(e){e.close()},reposition:function(e){var t;Pe(e,(function(e){return e.moveTo(0,0)})),0<(t=e).length&&(Ge(t).each((function(e){return e.moveRel(null,"banner")})),Pe(t,(function(e,n){0<n&&e.moveRel(t[n-1].getEl(),"bc-tc")})))},getArgs:function(e){return e.settings}}}function Lm(e,n){var r=null;return{cancel:function(){null!==r&&(t.clearTimeout(r),r=null)},throttle:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];null!==r&&t.clearTimeout(r),r=t.setTimeout((function(){e.apply(null,o),r=null}),n)}}}function Fm(e,n,r,o,i,a){function u(){return a.fold(lg.aborted,lg.edge)}function c(){var t=i();return t?Fm(e,t,ye.none(),o,i,ye.some(n)):u()}var s,l;return l=n,(s=e).isBlock(l)||Re(["BR","IMG","HR","INPUT"],l.nodeName)||"false"===s.getContentEditable(l)?u():n.nodeType!==t.Node.TEXT_NODE?c():(s=n.textContent,o(fg,n,s,r).fold(lg.aborted,c,lg.success))}function Hm(e,t,n,r,o){return o=new sg(t,o||e.getRoot()),Fm(e,t,ye.some(n),r,o.prev,ye.none())}function Vm(e,t,n,r){return void 0===r&&(r=0),mg(gn.fromDom(t.startContainer)).fold((function(){return pg(e,t,n,r)}),(function(t){var r=e.createRng();return r.selectNode(t.dom()),ye.some({range:r,text:hg(r,n),triggerChar:n})}))}function Um(e,t){return{element:e,offset:t}}function jm(e){var n;return e.nodeType===t.Node.TEXT_NODE?Um(e,e.data.length):0<(n=e.childNodes).length?jm(n[n.length-1]):Um(e,n.length)}function Wm(e,n){var r=e.childNodes;return 0<r.length&&n<r.length?Wm(r[n],0):0<r.length&&e.nodeType===t.Node.ELEMENT_NODE&&r.length===n?jm(r[r.length-1]):Um(e,n)}function qm(e,t){return ac([im(e,t)])}function $m(e,t,n){e.getSystem().broadcastOn([zg],{})}function Gm(e){e=gn.fromHtml(e);var t=ui(e),n=function(e){return e=void 0!==e.dom().attributes?e.dom().attributes:[],Fe(e,(function(e,t){return"class"===t.name?e:d(d({},e),((e={})[t.name]=t.value,e))}),{})}(e),r=Array.prototype.slice.call(e.dom().classList,0);t=0===t.length?{}:{innerHtml:go(e)};return d({tag:Lo(e),classes:r,attributes:n},t)}function Xm(e){return{dom:{tag:"div",classes:[$g],innerHtml:e}}}function Ym(e){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Qg(e)}}}function Km(e){return{dom:{tag:"div",classes:[$g,Yg],innerHtml:Rm("checkmark",e)}}}function Jm(e,t,n,r){void 0===r&&(r=ye.none());var o=Hg.isRtl()&&e.iconContent.exists((function(e){return Re(ih,e)})),i=e.iconContent.map((function(e){return Hg.isRtl()&&Re(oh,e)?e+"-rtl":e})).map((function(e){return Bm(e,t.icons,r)})),u=ye.from(e.meta).fold((function(){return eh}),(function(e){return ot(e,"style")?a(th,e.style):eh}));return"color"===e.presets?nh(e.ariaLabel,e.value,i,t):rh(e,i,n,u,o)}function Zm(e,t,n){t.disabled&&og(e,t)}function Qm(e,t){return!0===t.useNative&&Re(ah,Lo(e.element()))}function eg(e){wi(e.element(),"disabled","disabled")}function tg(e){Si(e.element(),"disabled")}function ng(e){wi(e.element(),"aria-disabled","true")}function rg(e){wi(e.element(),"aria-disabled","false")}function og(e,t,n){t.disableClass.each((function(t){Yi(e.element(),t)})),(Qm(e,t)?eg:ng)(e),t.onDisabled(e)}function ig(e,t,n){t.disableClass.each((function(t){Ji(e.element(),t)})),(Qm(e,t)?tg:rg)(e),t.onEnabled(e)}function ag(e,t){return Qm(e,t)?Ci(e.element(),"disabled"):"true"===xi(e.element(),"aria-disabled")}function ug(e,t,r){var o=mn(n);return{type:"item",dom:t.dom,components:hh(t.optComponents),data:e.data,eventOrder:gh,hasSubmenu:e.triggersSubmenu,itemBehaviours:ac([im("item-events",[mh(e,r),lh(e,o),fh(e,o)]),ch.item(e.disabled),rm.config({})].concat(e.itemBehaviours))}}function cg(e){return{value:e.value,meta:ct({text:e.text.getOr("")},e.meta)}}var sg=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),lg=it([{aborted:[]},{edge:["element"]},{success:["info"]}]),fg=it([{abort:[]},{kontinue:[]},{finish:["info"]}]),dg="[data-mce-autocompleter]",mg=function(e){return bu(e,dg)},gg=/[\u00a0 \t\r\n]/,hg=function(e,t){return e.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},pg=function(e,t,n,r){return void 0===r&&(r=0),(o=t).collapsed&&3===o.startContainer.nodeType?Hm(e,t.startContainer,t.startOffset,(function(e,o,i,a){var u=a.getOr(i.length);return function(e,t,n,r){for(var o=t-1;0<=o;o--){var i=e.charAt(o);if(gg.test(i))return ye.none();if(i===n)break}return-1===o||t-o<r?ye.none():ye.some(e.substring(o+1,t))}(i,u,n,1).fold((function(){return i.match(gg)?e.abort():e.kontinue()}),(function(a){var c=t.cloneRange();return c.setStart(o,u-a.length-1),c.setEnd(t.endContainer,t.endOffset),i.length<r?e.abort():e.finish({text:hg(c,n),range:c,triggerChar:n})}))})).fold(ye.none,ye.none,ye.some):ye.none();var o},vg=function(e,t){function n(e,t){Xr(e,hr(),{raw:t})}t.on("keypress compositionend",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel),t.on("keydown",(function(t){function r(){return e.getView().bind(Nd.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(r().each(Yr),t.preventDefault()):40===t.which?(r().fold((function(){e.getView().each(Nd.highlightFirst)}),(function(e){n(e,t)})),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||r().each((function(e){n(e,t),t.preventDefault(),t.stopImmediatePropagation()})):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())})),t.on("NodeChange",(function(t){e.isActive()&&!e.isProcessingAction()&&mg(gn.fromDom(t.element)).isNone()&&e.cancelIfNecessary()}))},bg=tinymce.util.Tools.resolve("tinymce.util.Promise"),yg=function(e){function t(e,t,n,r){return 0===(r=r.getOr(n.length))?e.kontinue():e.finish(/\s/.test(n.charAt(r-1)))}return function(n){return n=Wm(n.startContainer,n.startOffset),Hm(e,n.element,n.offset,t).fold(o(!0),o(!0),i)}},wg=function(e,t,n){return Su(n.triggerChars,(function(n){return Vm(e,t,n)}))},xg=function(e,t,n,r){void 0===r&&(r={});t=t();var o=e.selection.getRng().startContainer.nodeValue;t=Ie(t.lookupByChar(n.triggerChar),(function(t){return n.text.length>=t.minChars&&t.matches.getOrThunk((function(){return yg(e.dom)}))(n.range,o,n.text)}));return 0===t.length?ye.none():(t=bg.all(Me(t,(function(e){return e.fetch(n.text,e.maxResults,r).then((function(t){return{matchText:n.text,items:t,columns:e.columns,onAction:e.onAction}}))}))),ye.some({lookupData:t,context:n}))},Cg=zt([$("type"),ee("text")]),Sg=zt([dn("type",(function(){return"autocompleteitem"})),dn("active",(function(){return!1})),dn("disabled",(function(){return!1})),ln("meta",{}),$("value"),ee("text"),ee("icon")]),kg=zt([$("type"),$("ch"),ne("minChars",1),ln("columns",1),ne("maxResults",10),te("matches"),X("fetch"),X("onAction")]),Tg=function(e){return Gt("Autocompleter.Separator",Cg,e)},Eg=function(e){return Gt("Autocompleter.Item",Sg,e)},Og=function(e){return Gt("Autocompleter",kg,e)},Ng=function(e){var t={};return Pe(e,(function(e){t[e]={}})),Ke(t)},Ag=(Gd=[ie("disabled",!1),ee("text"),ee("shortcut"),Vt("value","value",dt((function(){return Oi("menuitem-value")})),Zt()),ln("meta",{})],zt([$("type"),ae("onSetup",(function(){return n})),ae("onAction",n),ee("icon")].concat(Gd))),Dg=zt([$("type"),X("getSubmenuItems"),ae("onSetup",(function(){return n})),ee("icon")].concat(Gd)),_g=zt([$("type"),ie("active",!1),ae("onSetup",(function(){return n})),X("onAction")].concat(Gd)),Rg=zt([$("type"),ie("active",!1),ee("icon")].concat(Gd)),Bg=zt([$("type"),G("fancytype",["inserttable","colorswatch"]),ae("onAction",n)]),Mg=function(e,t,n){var r=_s(e.element(),"."+n);return 0<r.length?(e=Ve(r,(function(e){e=e.dom().getBoundingClientRect().top;var n=r[0].dom().getBoundingClientRect().top;return Math.abs(e-n)>t})).getOr(r.length),ye.some({numColumns:e,numRows:Math.ceil(r.length/e)})):ye.none()},Pg={namedEvents:qm,unnamedEvents:function(e){return qm(Oi("unnamed-events"),e)}},zg=(ql=[on("lazySink"),on("tooltipDom"),ln("exclusive",!0),ln("tooltipComponents",[]),ln("delay",300),oe("mode","normal",["normal","follow-highlight"]),ln("anchor",(function(e){return{anchor:"hotspot",hotspot:e,layouts:{onLtr:o([ec,Qu,Yu,Ju,Ku,Zu]),onRtl:o([ec,Qu,Yu,Ju,Ku,Zu])}}})),ka("onHide"),ka("onShow")],$d=Object.freeze({init:function(){function e(){n.get().each((function(e){t.clearTimeout(e)}))}var n=mn(ye.none()),r=mn(ye.none()),i=o("not-implemented");return Hi({getTooltip:function(){return r.get()},isShowing:function(){return r.get().isSome()},setTooltip:function(e){r.set(ye.some(e))},clearTooltip:function(){r.set(ye.none())},clearTimer:e,resetTimer:function(r,o){e(),n.set(ye.some(t.setTimeout((function(){r()}),o)))},readState:i})}}),Oi("tooltip.exclusive")),Ig=Oi("tooltip.show"),Lg=Oi("tooltip.hide"),Fg=Ba({fields:ql,name:"tooltipping",active:Object.freeze({events:function(e,t){function n(n){t.getTooltip().each((function(r){wl(r),e.onHide(n,r),t.clearTooltip()})),t.clearTimer()}return Go(Ue([[Xo(Ig,(function(n){t.resetTimer((function(){var r,o,i;r=n,t.isShowing()||($m(r),o=e.lazySink(r).getOrDie(),i=r.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Go("normal"===e.mode?[Xo(dr(),(function(e){Gr(r,Ig)})),Xo(lr(),(function(e){Gr(r,Lg)}))]:[]),behaviours:ac([rm.config({})])}),t.setTooltip(i),vl(o,i),e.onShow(r,i),dl.position(o,e.anchor(r),i))}),e.delay)})),Xo(Lg,(function(r){t.resetTimer((function(){n(r)}),e.delay)})),Xo(Tr(),(function(e,t){Re(t.channels(),zg)&&n(e)})),Qo((function(e){n(e)}))],"normal"===e.mode?[Xo(mr(),(function(e){Gr(e,Ig)})),Xo(Sr(),(function(e){Gr(e,Lg)})),Xo(dr(),(function(e){Gr(e,Ig)})),Xo(lr(),(function(e){Gr(e,Lg)}))]:[Xo(qr(),(function(e,t){Gr(e,Ig)})),Xo($r(),(function(e){Gr(e,Lg)}))]]))}}),state:$d,apis:Object.freeze({hideAllExclusive:$m,setComponents:function(e,t,n,r){n.getTooltip().each((function(e){e.getSystem().isConnected()&&rm.set(e,r)}))}})}),Hg=tinymce.util.Tools.resolve("tinymce.util.I18n"),Vg="tox-menu-nav__js",Ug="tox-collection__item",jg="tox-swatch",Wg={normal:Vg,color:jg},qg="tox-collection__item--enabled",$g="tox-collection__item-icon",Gg="tox-collection__item-label",Xg="tox-collection__item-caret",Yg="tox-collection__item-checkmark",Kg="tox-collection__item--active",Jg=function(e){return yt(Wg,e).getOr(Vg)},Zg=tinymce.util.Tools.resolve("tinymce.Env"),Qg=function(e){var t=Zg.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"};e=e.split("+"),e=Me(e,(function(e){var n=e.toLowerCase().trim();return ot(t,n)?t[n]:e}));return Zg.mac?e.join(""):e.join("+")},eh=function(e){return{dom:{tag:"div",classes:[Gg]},components:[ma(Hg.translate(e))]}},th=function(e,t){return{dom:{tag:"div",classes:[Gg]},components:[{dom:{tag:e.tag,attributes:{style:e.styleAttr}},components:[ma(Hg.translate(t))]}]}},nh=function(e,t,n,r){var o;return{dom:(o=jg,n=n.getOr(""),e=e.map((function(e){return' title="'+r.translate(e)+'"'})).getOr(""),Gm("custom"===t?'<button class="'+o+' tox-swatches__picker-btn"'+e+">"+n+"</button>":"remove"===t?'<div class="'+o+' tox-swatch--remove"'+e+">"+n+"</div>":'<div class="'+o+'" style="background-color: '+t+'" data-mce-color="'+t+'"'+e+"></div>")),optComponents:[]}},rh=function(e,t,n,r,o){n=n?e.checkMark.orThunk((function(){return t.or(ye.some("")).map(Xm)})):ye.none();var i=e.ariaLabel.map((function(e){return{attributes:{title:Hg.translate(e)}}})).getOr({});return{dom:ct({tag:"div",classes:[Vg,Ug].concat(o?["tox-collection__item-icon-rtl"]:[])},i),optComponents:[n,e.htmlContent.fold((function(){return e.textContent.map(r)}),(function(e){return ye.some({dom:{tag:"div",classes:[Gg],innerHtml:e}})})),e.shortcutContent.map(Ym),e.caret]}},oh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],ih=["list-bull-circle","list-bull-default","list-bull-square"],ah=["input","button","textarea","select"],uh=(Pu=Object.freeze({enable:ig,disable:og,isDisabled:ag,onLoad:Zm,set:function(e,t,n,r){(r?og:ig)(e,t,n)}}),Ys=Object.freeze({exhibit:function(e,t,n){return So({classes:t.disabled?t.disableClass.map(T).getOr([]):[]})},events:function(e,t){return Go([no(Er(),(function(t,n){return ag(t,e)})),Da(e,t,Zm)])}}),jl=[ln("disabled",!1),ln("useNative",!0),Z("disableClass"),ka("onDisabled"),ka("onEnabled")],Ba({fields:jl,name:"disabling",active:Ys,apis:Pu})),ch={item:function(e){return uh.config({disabled:e,disableClass:"tox-collection__item--state-disabled"})},button:function(e){return uh.config({disabled:e})},splitButton:function(e){return uh.config({disabled:e,disableClass:"tox-tbtn--disabled"})},toolbarButton:function(e){return uh.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1})}},sh=function(e,t){var n=e.getApi(t);return function(e){e(n)}},lh=function(e,t){return Zo((function(n){sh(e,n)((function(n){n=e.onSetup(n),null!=n&&t.set(n)}))}))},fh=function(e,t){return Qo((function(n){return sh(e,n)(t.get())}))},dh=((em=oy=oy||{})[em.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",em[em.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX",oy),mh=function(e,t){return ti((function(n,r){sh(e,n)(e.onAction),e.triggersSubmenu||t!==dh.CLOSE_ON_EXECUTE||(Gr(n,_r()),r.stop())}))},gh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},hh=function(e){return je(e,(function(e){return e.toArray()}))},ph=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),vh=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},bh=function(e){return ph.DOM.encode(e)},yh=o(ws(gd(),gm())),wh=Oi("cell-over"),xh=Oi("cell-execute"),Ch=function(e,t,n){function r(n){return Xr(n,xh,{row:e,col:t})}var o;return pa({dom:{tag:"div",attributes:((o={role:"button"})["aria-labelledby"]=n,o)},behaviours:ac([im("insert-table-picker-cell",[Xo(dr(),am.focus),Xo(Er(),r),Xo(Ar(),r)]),sm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),am.config({onFocus:function(n){return Xr(n,wh,{row:e,col:t})}})])})};function Sh(e){return _h.test(e)||Rh.test(e)}function kh(e){var t=parseInt(e,10);return t.toString()===e&&0<=t&&t<=255}function Th(e){e=Bh(e);var t=parseInt(e[1],16),n=parseInt(e[2],16);e=parseInt(e[3],16);return Vh(t,n,e,1)}function Eh(e,t,n,r){return e=parseInt(e,10),t=parseInt(t,10),n=parseInt(n,10),r=parseFloat(r),Vh(e,t,n,r)}function Oh(e){return"rgba("+e.red()+","+e.green()+","+e.blue()+","+e.alpha()+")"}var Nh,Ah,Dh=function(e){return{value:o(e)}},_h=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Rh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Bh=function(e){return e=function(e){return e=e.value().replace(_h,(function(e,t,n,r){return t+t+n+n+r+r})),{value:o(e)}}(e),e=Rh.exec(e.value()),null===e?["FFFFFF","FF","FF","FF"]:e},Mh=function(e){return e=e.toString(16),1===e.length?"0"+e:e},Ph=function(e){return e=Mh(e.red())+Mh(e.green())+Mh(e.blue()),Dh(e)},zh=Math.min,Ih=Math.max,Lh=Math.round,Fh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Hh=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Vh=function(e,t,n,r){return{red:o(e),green:o(t),blue:o(n),alpha:o(r)}},Uh=function(e){var t,n,r,o=(e.hue()||0)%360,i=e.saturation()/100;e=e.value()/100,i=Ih(0,zh(i,1)),e=Ih(0,zh(e,1));if(0===i)return t=n=r=Lh(255*e),Vh(t,n,r,1);o/=60;var a=e*i,u=a*(1-Math.abs(o%2-1));i=e-a;switch(Math.floor(o)){case 0:t=a,n=u,r=0;break;case 1:t=u,n=a,r=0;break;case 2:t=0,n=a,r=u;break;case 3:t=0,n=u,r=a;break;case 4:t=u,n=0,r=a;break;case 5:t=a,n=0,r=u;break;default:t=n=r=0}return t=Lh(255*(t+i)),n=Lh(255*(n+i)),r=Lh(255*(r+i)),Vh(t,n,r,1)},jh=function(e){if("transparent"===e)return ye.some(Vh(0,0,0,0));var t=Fh.exec(e);return null!==t?ye.some(Eh(t[1],t[2],t[3],"1")):(t=Hh.exec(e),null!==t?ye.some(Eh(t[1],t[2],t[3],t[4])):ye.none())},Wh=o(Vh(255,0,0,1)),qh=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),$h="tinymce-custom-colors",Gh="choiceitem",Xh=[{type:Gh,text:"Light Green",value:"#BFEDD2"},{type:Gh,text:"Light Yellow",value:"#FBEEB8"},{type:Gh,text:"Light Red",value:"#F8CAC6"},{type:Gh,text:"Light Purple",value:"#ECCAFA"},{type:Gh,text:"Light Blue",value:"#C2E0F4"},{type:Gh,text:"Green",value:"#2DC26B"},{type:Gh,text:"Yellow",value:"#F1C40F"},{type:Gh,text:"Red",value:"#E03E2D"},{type:Gh,text:"Purple",value:"#B96AD9"},{type:Gh,text:"Blue",value:"#3598DB"},{type:Gh,text:"Dark Turquoise",value:"#169179"},{type:Gh,text:"Orange",value:"#E67E23"},{type:Gh,text:"Dark Red",value:"#BA372A"},{type:Gh,text:"Dark Purple",value:"#843FA1"},{type:Gh,text:"Dark Blue",value:"#236FA1"},{type:Gh,text:"Light Gray",value:"#ECF0F1"},{type:Gh,text:"Medium Gray",value:"#CED4D9"},{type:Gh,text:"Gray",value:"#95A5A6"},{type:Gh,text:"Dark Gray",value:"#7E8C8D"},{type:Gh,text:"Navy Blue",value:"#34495E"},{type:Gh,text:"Black",value:"#000000"},{type:Gh,text:"White",value:"#ffffff"}],Yh=(void 0===(Nh=10)&&(Nh=10),Wd=qh.getItem($h),Wd=xe(Wd)?JSON.parse(Wd):[],Ah=Nh-(Wd=Wd).length<0?Wd.slice(0,Nh):Wd,{add:function(e){(function(e,t){return e=_e(e,t),-1===e?ye.none():ye.some(e)})(Ah,e).each(Kh),Ah.unshift(e),Ah.length>Nh&&Ah.pop(),qh.setItem($h,JSON.stringify(Ah))},state:function(){return Ah.slice(0)}});function Kh(e){Ah.splice(e,1)}function Jh(e){for(var n=[],r=t.document.createElement("canvas"),o=(r.height=1,r.width=1,r.getContext("2d")),i=function(e,t){return t/=255,("0"+Math.round(e*t+255*(1-t)).toString(16)).slice(-2).toUpperCase()},a=0;a<e.length;a+=2)n.push({text:e[a+1],value:function(e){if(/^[0-9A-Fa-f]{6}$/.test(e))return"#"+e.toUpperCase();o.clearRect(0,0,r.width,r.height),o.fillStyle="#FFFFFF",o.fillStyle=e,o.fillRect(0,0,1,1);e=o.getImageData(0,0,1,1).data;var t=e[0],n=e[1],a=e[2];e=e[3];return"#"+i(t,e)+i(n,e)+i(a,e)}(e[a]),type:"choiceitem"});return n}function Zh(e){return e.getParam("color_map")}function Qh(e){return Math.max(5,Math.ceil(Math.sqrt(e)))}function ep(e,t){return e.concat(cp.getCurrentColors().concat((n={type:e="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},t?[n,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[n])));var n}function tp(e,t,n,r,o){e.ui.registry.addSplitButton(t,{tooltip:r,presets:"color",icon:"forecolor"===t?"text-color":"highlight-bg-color",select:function(t){return ye.from(lp(e,n)).bind((function(e){return jh(e).map((function(e){return e=Ph(e).value(),Vn(t.toLowerCase(),e)}))})).getOr(!1)},columns:mp(e),fetch:hp(cp.getColors(e),cp.hasCustomColors(e)),onAction:function(t){null!==o.get()&&gp(e,n,o.get(),(function(){}))},onItemAction:function(r,i){gp(e,n,i,(function(n){o.set(n),sp.fireTextColorChange(e,{name:t,color:n})}))},onSetup:function(n){function r(e){e.name===t&&pp(n,e.name,e.color)}return null!==o.get()&&pp(n,t,o.get()),e.on("TextColorChange",r),function(){e.off("TextColorChange",r)}}})}function np(e,t,r,o){e.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){gp(e,r,t.value,n)}}]}})}function rp(e){return function(t,n){function r(e){var t=e.getData();o(ye.from(t.colorpicker)),e.close()}var o;o=t,e.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{colorpicker:n},onAction:function(e,t){"hex-valid"===t.name&&(t.value?e.enable("ok"):e.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(ye.none())}})}}function op(e,t){return function(n){return n=k(n,t),Me(n,(function(t){return{dom:e,components:t}}))}}function ip(e,t){var n=[],r=[];return Pe(e,(function(e,o){t(e,o)?(0<r.length&&n.push(r),r=[],ot(e.dom,"innerHtml")&&r.push(e)):r.push(e)})),0<r.length&&n.push(r),Me(n,(function(e){return{dom:{tag:"div",classes:["tox-collection__group"]},components:e}}))}function ap(e){return void 0!==e.icon||"togglemenuitem"===e.type||"choicemenuitem"===e.type}function up(e,t,n,r,o){i=n;var i,a={dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[vm.parts().items({preprocess:function(e){return ip(e,(function(e,t){return"separator"===i[t].type}))}})]};return{value:e,dom:a.dom,components:a.components,items:n}}var cp={mapColors:Jh,getColorCols:function(e,t){return e.getParam("color_cols",t,"number")},hasCustomColors:function(e){return!1!==e.getParam("custom_colors")},getColorMap:Zh,getColors:function(e){return e=Zh(e),void 0!==e?Jh(e):Xh},getCurrentColors:function(){return Me(Yh.state(),(function(e){return{type:Gh,text:e,value:e}}))},addColor:function(e){Yh.add(e)}},sp={fireSkinLoaded:function(e){return e.fire("SkinLoaded")},fireResizeEditor:function(e){return e.fire("ResizeEditor")},fireScrollContent:function(e,t){return e.fire("ScrollContent",t)},fireBeforeRenderUI:function(e){return e.fire("BeforeRenderUI")},fireResizeContent:function(e,t){return e.fire("ResizeContent",t)},fireTextColorChange:function(e,t){return e.fire("TextColorChange",t)}},lp=function(e,t){var n;return e.dom.getParents(e.selection.getStart(),(function(e){(e=e.style["forecolor"===t?"color":"background-color"])&&(n=n||e)})),n},fp=function(e,t,n){e.undoManager.transact((function(){e.focus(),e.formatter.apply(t,{value:n}),e.nodeChanged()}))},dp=function(e,t){e.undoManager.transact((function(){e.focus(),e.formatter.remove(t,{value:null},null,!0),e.nodeChanged()}))},mp=function(e){var t=cp.getColors(e);t=Qh(t.length);return cp.getColorCols(e,t)},gp=function(e,t,n,r){"custom"===n?rp(e)((function(n){n.each((function(n){cp.addColor(n),e.execCommand("mceApplyTextcolor",t,n),r(n)}))}),"#000000"):"remove"===n?(r(""),e.execCommand("mceRemoveTextcolor",t)):(r(n),e.execCommand("mceApplyTextcolor",t,n))},hp=function(e,t){return function(n){n(ep(e,t))}},pp=function(e,t,n){t="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",n=n,e.setIconFill(t,n),e.setIconStroke(t,n)},vp=function(e){(t=e).addCommand("mceApplyTextcolor",(function(e,n){fp(t,e,n)})),t.addCommand("mceRemoveTextcolor",(function(e){dp(t,e)}));var t,n=mn(null),r=mn(null);tp(e,"forecolor","forecolor","Text color",n),tp(e,"backcolor","hilitecolor","Background color",r),np(e,"forecolor","forecolor","Text color"),np(e,"backcolor","hilitecolor","Background color")},bp=ep,yp=hp,wp=rp,xp=mp,Cp=function(e){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[vm.parts().items({preprocess:"auto"!==e?op({tag:"div",classes:["tox-swatches__row"]},e):i})]}]}},Sp=function(e){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[vm.parts().items({preprocess:op({tag:"div",classes:["tox-collection__group"]},e)})]}},kp=function(e,t,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[vm.parts().items({preprocess:function(n){return"auto"!==e&&1<e?op({tag:"div",classes:["tox-collection__group"]},e)(n):ip(n,(function(e,n){return"separator"===t[n].type}))}})]}},Tp=function(e){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===e?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}},Ep=function(e){var t=Tp(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:Jg(e)}},Op=function(e,t,n){return n=Tp(n),{tag:"div",classes:Ue([[n.menu,"tox-menu-"+t+"-column"],e?[n.hasIcons]:[]])}},Np=[vm.parts().items({})],Ap=function(e,t,n){var r=Tp(n);return{dom:{tag:"div",classes:Ue([[r.tieredMenu]])},markers:Ep(n)}},Dp=function(e){return Be(e,ap)},_p=function(e){return t.console.error(Kt(e)),t.console.log(e),ye.none()},Rp=function(e,t,n,r,o){var i;return"color"===o?{value:e,dom:(i=Cp(r)).dom,components:i.components,items:n}:"normal"===o&&"auto"===r?{value:e,dom:(i=kp(r,n)).dom,components:i.components,items:n}:"normal"===o&&1===r?{value:e,dom:(i=kp(1,n)).dom,components:i.components,items:n}:"normal"===o?{value:e,dom:(i=kp(r,n)).dom,components:i.components,items:n}:"listpreview"===o&&"auto"!==r?{value:e,dom:(i=Sp(r)).dom,components:i.components,items:n}:{value:e,dom:Op(t,r,o),components:Np,items:n}},Bp=function(e,t,n,r,o,i,a,u){var c=Dp(t);t=Mp(t,n,r,"color"!==o?"normal":"color",i,a,u);return Rp(e,c,t,r,o)},Mp=function(e,t,n,r,o,i,a){return Cu(Me(e,(function(e){return"choiceitem"===e.type?Gt("choicemenuitem",Rg,e).fold(_p,(function(u){return ye.some(function(e,t,n,r,o,i,a){return n=Jm({presets:n,textContent:t?e.text:ye.none(),htmlContent:ye.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:ye.none(),checkMark:t?ye.some(Km(a.icons)):ye.none(),caret:ye.none(),value:e.value},a,!0),ut(ug({data:cg(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){sm.set(e,t)},isActive:function(){return sm.isOn(e)},isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)}}},onAction:function(t){return r(e.value)},onSetup:function(e){return e.setActive(o),function(){}},triggersSubmenu:!1,itemBehaviours:[]},n,i),{toggling:{toggleClass:qg,toggleOnExecute:!1,selected:e.active}})}(u,1===n,r,t,i(e.value),o,a))})):ye.none()})))},Pp=function(e,t){var n=Ep(t);return 1===e?{mode:"menu",moveOnTab:!0}:"auto"===e?{mode:"grid",selector:"."+n.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group")}};function zp(e){return void 0!==e.icon||"togglemenuitem"===e.type||"choicemenuitem"===e.type}function Ip(e,n,r,o,i){function a(e){return i?d(d({},e),{shortcut:ye.none(),icon:e.text.isSome()?ye.none():e.icon}):e}var u=r.shared.providers;switch(e.type){case"menuitem":return Gt("menuitem",Ag,e).fold(_p,(function(e){return ye.some($p(a(e),n,u,o))}));case"nestedmenuitem":return Gt("nestedmenuitem",Dg,e).fold(_p,(function(e){return ye.some(Gp(a(e),n,u,o,i))}));case"togglemenuitem":return Gt("togglemenuitem",_g,e).fold(_p,(function(e){return ye.some(Xp(a(e),n,u))}));case"separator":return Gt("separatormenuitem",Cg,e).fold(_p,(function(e){return ye.some(qp(e))}));case"fancymenuitem":return Gt("fancymenuitem",Bg,e).fold(_p,(function(e){return Yp(a(e),r)}));default:return t.console.error("Unknown item in general menu",e),ye.none()}}function Lp(e){function t(){e.stopPropagation()}function n(){e.preventDefault()}var i,a,u,c,s,l=gn.fromDom(e.target),f=r(n,t);return i=e.clientX,a=e.clientY,u=t,c=n,f=f,s=e,{target:o(l),x:o(i),y:o(a),stop:u,prevent:c,kill:f,raw:o(s)}}function Fp(e,t,n,r,o){function i(e){u(e)&&c(Lp(e))}var u,c;return u=n,c=r,e.dom().addEventListener(t,i,o),{unbind:a(Hp,e,t,i,o)}}function Hp(e,t,n,r){e.dom().removeEventListener(t,n,r)}function Vp(e,t,n){return bu(e,t,n).isSome()}var Up,jp={inserttable:function(e){var t=Oi("size-label"),n=function(e,t,n){for(var r=[],o=0;o<t;o++){for(var i=[],a=0;a<n;a++)i.push(Ch(o,a,e));r.push(i)}return r}(t,10,10),r=Dm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[ma("0x0")],behaviours:ac([rm.config({})])});return{type:"widget",data:{value:Oi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[yh().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:je(n,(function(e){return Me(e,va)})).concat(r.asSpec()),behaviours:ac([im("insert-table-picker",[Ko(wh,(function(e,t,o){for(var i=o.event().row(),a=(o=o.event().col(),n),u=i,c=o,s=10,l=10,f=0;f<s;f++)for(var d=0;d<l;d++)sm.set(a[f][d],f<=u&&d<=c);rm.set(r.get(e),[ma(o+1+"x"+(i+1))])})),Ko(xh,(function(t,n,r){e.onAction({numRows:r.event().row()+1,numColumns:r.event().col()+1}),Gr(t,_r())}))]),nm.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(e,t){var n=bp(t.colorinput.getColors(),t.colorinput.hasCustomColors()),r=t.colorinput.getColorCols();n=Bp(Oi("menu-value"),n,(function(t){e.onAction({value:t})}),r,"color",dh.CLOSE_ON_EXECUTE,(function(){return!1}),t.shared.providers),t=ut(d(d({},n),{markers:Ep("color"),movement:Pp(r,"color")}));return{type:"widget",data:{value:Oi("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[yh().widget(vm.sketch(t))]}}},Wp=function(e,t,n,r,o,i,a,u){void 0===u&&(u=!0);var c;r=Jm({presets:r,textContent:ye.none(),htmlContent:n?e.text.map((function(e){var n=t;return e=Hg.translate(e),e=bh(e),0<n.length?(n=new RegExp(vh(n),"gi"),e.replace(n,(function(e){return'<span class="tox-autocompleter-highlight">'+e+"</span>"}))):e})):ye.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:ye.none(),checkMark:ye.none(),caret:ye.none(),value:e.value},a.providers,u,e.icon);return ug({data:cg(e),disabled:e.disabled,getApi:function(){return{}},onAction:function(t){return o(e.value,e.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:(n=e.meta,c=a,rt(n,"tooltipWorker").map((function(e){return[Fg.config({lazySink:c.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(e){return{anchor:"submenu",item:e,overrides:{maxHeightFunction:cl}}},mode:"follow-highlight",onShow:function(t,n){e((function(e){Fg.setComponents(t,[ga({element:gn.fromDom(e)})])}))}})]})).getOr([]))},r,i)},qp=function(e){return e=e.text.fold((function(){return{}}),(function(e){return{innerHtml:e}})),{type:"separator",dom:d({tag:"div",classes:[Ug,"tox-collection__group-heading"]},e),components:[]}},$p=function(e,t,n,r){return void 0===r&&(r=!0),n=Jm({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:ye.none(),ariaLabel:e.text,caret:ye.none(),checkMark:ye.none(),shortcutContent:e.shortcut},n,r),ug({data:cg(e),getApi:function(e){return{isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)}}},disabled:e.disabled,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},n,t)},Gp=function(e,t,r,o,i){return void 0===o&&(o=!0),i=(i=void 0!==i&&i)?(i=r.icons,{dom:{tag:"div",classes:[Xg],innerHtml:Rm("chevron-down",i)}}):(i=r.icons,{dom:{tag:"div",classes:[Xg],innerHtml:Rm("chevron-right",i)}}),i=Jm({presets:"normal",iconContent:e.icon,textContent:e.text,htmlContent:ye.none(),ariaLabel:e.text,caret:ye.some(i),checkMark:ye.none(),shortcutContent:e.shortcut},r,o),ug({data:cg(e),getApi:function(e){return{isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)}}},disabled:e.disabled,onAction:n,onSetup:e.onSetup,triggersSubmenu:!0,itemBehaviours:[]},i,t)},Xp=function(e,t,n){return n=Jm({iconContent:ye.none(),textContent:e.text,htmlContent:ye.none(),ariaLabel:e.text,checkMark:ye.some(Km(n.icons)),caret:ye.none(),shortcutContent:e.shortcut,presets:"normal",meta:e.meta},n,!0),ut(ug({data:cg(e),disabled:e.disabled,getApi:function(e){return{setActive:function(t){sm.set(e,t)},isActive:function(){return sm.isOn(e)},isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)}}},onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:[]},n,t),{toggling:{toggleClass:qg,toggleOnExecute:!1,selected:e.active}})},Yp=function(e,t){return n=jp,r=e.fancytype,(Object.prototype.hasOwnProperty.call(n,r)?ye.some(n[r]):ye.none()).map((function(n){return n(e,t)}));var n,r},Kp=((Sc=Up=Up||{})[Sc.ContentFocus=0]="ContentFocus",Sc[Sc.UiFocus=1]="UiFocus",function(e){return Be(e,zp)}),Jp=function(e,t,n,r,o){var i=Kp(t);t=Cu(Me(t,(function(e){function t(e){return Ip(e,n,r,a(e),o)}var a=function(e){return o?!e.hasOwnProperty("text"):i};return"nestedmenuitem"===e.type&&e.getSubmenuItems().length<=0?t(ct(e,{disabled:!0})):t(e)})));return(o?up:Rp)(e,i,t,1,"normal")},Zp=function(e){return Sm.singleData(e.value,e)},Qp=function(e,n){function r(r,o){var i=Su(o,(function(e){return ye.from(e.columns)})).getOr(1);return je(o,(function(o){var a,u,s,l,m,h,p=o.items;return p=p,a=o.matchText,u=function(n,i){var a=e.selection.getRng();Vm(e.dom,a,r).fold((function(){return t.console.error("Lost context. Cursor probably moved")}),(function(e){e=e.range;var t={hide:function(){d()},reload:function(e){f(),g(e)}};c.set(!0),o.onAction(t,e,n,i),c.set(!1)}))},s=dh.BUBBLE_TO_SANDBOX,l=n,h=!(m=1===i)||Kp(p),Cu(Me(p,(function(e){return"separator"===e.type?Tg(e).fold(_p,(function(e){return ye.some(qp(e))})):Eg(e).fold(_p,(function(e){return ye.some(Wp(e,a,m,"normal",u,s,l,h))}))})))}))}function o(t){var n,r,o;l()||(r=e,o=t.range,n=mg(gn.fromDom(r.selection.getNode())).getOrThunk((function(){var e=gn.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',r.getDoc());return mi(e,gn.fromDom(o.extractContents())),o.insertNode(e.dom()),ii(e).each((function(e){return e.dom().normalize()})),Ds(e).map((function(e){r.selection.setCursorLocation(e.dom(),Ns(e))})),e})),u.set(ye.some({triggerChar:t.triggerChar,element:n,matchLength:t.text.length})),c.set(!1))}function i(t,n,r,o){t.matchLength=n.text.length;var i,a,u;n=Su(r,(function(e){return ye.from(e.columns)})).getOr(1);km.showAt(s,{anchor:"node",root:gn.fromDom(e.getBody()),node:ye.from(t.element)},vm.sketch((r=Rp("autocompleter-value",!0,o,n,"normal"),t=n,o=Up.ContentFocus,n="normal",i=(o===Up.ContentFocus?zd:Pd)(),a=Pp(t,n),u=Ep(n),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:a,fakeFocus:o===Up.ContentFocus,focusManager:i,menuBehaviours:Pg.unnamedEvents("auto"!==t?[]:[Zo((function(e,t){Mg(e,4,u.item).each((function(t){var n=t.numColumns;t=t.numRows;nm.setGridSize(e,t,n)}))}))])}))),km.getContent(s).each(Nd.highlightFirst)}function a(t){return u.get().map((function(n){return Vm(e.dom,e.selection.getRng(),n.triggerChar).bind((function(n){return xg(e,m,n,t)}))})).getOrThunk((function(){return t=e,r=(n=m)(),o=t.selection.getRng(),wg(t.dom,o,r).bind((function(e){return xg(t,n,e)}));var t,n,r,o}))}var u=mn(ye.none()),c=mn(!1),s=pa(km.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ac([im("dismissAutocompleter",[Xo(Hr(),(function(){return d()}))])]),lazySink:n.getSink})),l=function(){return u.get().isSome()},f=function(){l()&&km.hide(s)},d=function(){var t;l()&&(t=u.get().map((function(e){return e.element})),mg(t.getOr(gn.fromDom(e.selection.getNode()))).each(mo),f(),u.set(ye.none()),c.set(!1))},m=N((function(){return t=(t=e).ui.registry.getAll().popups,t=Qe(t,(function(e){return Og(e).fold((function(e){throw new Error(Kt(e))}),(function(e){return e}))})),n=Ng(tt(t,(function(e){return e.ch}))),r=nt(t),{dataset:t,triggerChars:n,lookupByChar:function(e){return Ie(r,(function(t){return t.ch===e}))}};var t,n,r})),g=function(e){a(e).fold(d,(function(e){o(e.context),e.lookupData.then((function(t){u.get().map((function(n){var o,a=e.context;n.triggerChar===a.triggerChar&&(0<(o=r(a.triggerChar,t)).length?i(n,a,t,o):(10<=a.text.length-n.matchLength?d:f)())}))}))}))},h={onKeypress:Lm((function(e){27!==e.which&&g()}),50),cancelIfNecessary:d,isMenuOpen:function(){return km.isOpen(s)},isActive:l,isProcessingAction:c.get,getView:function(){return km.getContent(s)}};vg(h,e)},ev=function(e,t,n,r){return Fp(e,t,n,r,!1)},tv=o(!0),nv=function(e,t,n){return ev(e,t,tv,n)},rv=function(e,t,n){return Fp(e,t,tv,n,!0)},ov=Lp;function iv(e,n){var r=null;return{cancel:function(){null!==r&&(t.clearTimeout(r),r=null)},schedule:function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];r=t.setTimeout((function(){e.apply(null,o),r=null}),n)}}}function av(e){return void 0===(e=e.raw()).touches||1!==e.touches.length?ye.none():ye.some(e.touches[0])}function uv(e){var t=mn(ye.none()),n=mn(!1),r=iv((function(t){e.triggerEvent(Dr(),t),n.set(!0)}),400),i=xt([{key:ir(),value:function(e){return av(e).each((function(i){r.cancel(),i={x:o(i.clientX),y:o(i.clientY),target:e.target},r.schedule(e),n.set(!1),t.set(ye.some(i))})),ye.none()}},{key:ar(),value:function(e){return r.cancel(),av(e).each((function(e){t.get().each((function(n){var r,o;r=e,n=n,o=Math.abs(r.clientX-n.x()),r=Math.abs(r.clientY-n.y()),(5<o||5<r)&&t.set(ye.none())}))})),ye.none()}},{key:ur(),value:function(o){return r.cancel(),t.get().filter((function(e){return tr(e.target(),o.target())})).map((function(t){return n.get()?(o.prevent(),!1):e.triggerEvent(Nr(),o)}))}}]);return{fireIfReady:function(e,t){return yt(i,t).bind((function(t){return t(e)}))}}}function cv(e,t,n,r,i,a){e=e(t,r);var u,c,s=(n=n,i=i,u=mn(!1),c=mn(!1),{stop:function(){u.set(!0)},cut:function(){c.set(!0)},isStopped:u.get,isCut:c.get,event:o(n),setSource:i.set,getSource:i.get});return e.fold((function(){return a.logEventNoHandlers(t,r),mv.complete()}),(function(e){var n=e.descHandler();return ji(n)(s),s.isStopped()?(a.logEventStopped(t,e.element(),n.purpose()),mv.stopped()):s.isCut()?(a.logEventCut(t,e.element(),n.purpose()),mv.complete()):ii(e.element()).fold((function(){return a.logNoParent(t,e.element(),n.purpose()),mv.complete()}),(function(r){return a.logEventResponse(t,e.element(),n.purpose()),mv.resume(r)}))}))}var sv=Xn().browser.isFirefox(),lv=Pt([X("triggerEvent"),ln("stopBackspace",!0)]),fv=function(e,n){var r,o=Yt("Getting GUI events settings",lv,n),i=(n=Xn().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],uv(o)),a=Me(n.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(t){return nv(e,t,(function(e){i.fireIfReady(e,t).each((function(t){t&&e.kill()})),o.triggerEvent(t,e)&&e.kill()}))})),u=mn(ye.none()),c=nv(e,"paste",(function(e){i.fireIfReady(e,"paste").each((function(t){t&&e.kill()})),o.triggerEvent("paste",e)&&e.kill(),u.set(ye.some(t.setTimeout((function(){o.triggerEvent(kr(),e)}),0)))})),s=nv(e,"keydown",(function(e){var t;o.triggerEvent("keydown",e)?e.kill():!0!==o.stopBackspace||8!==(t=e).raw().which||Re(["input","textarea"],Lo(t.target()))||Vp(t.target(),'[contenteditable="true"]')||e.prevent()})),l=(n=e,r=function(e){o.triggerEvent("focusin",e)&&e.kill()},sv?rv(n,"focus",r):nv(n,"focusin",r)),f=mn(ye.none()),d=(n=e,r=function(e){o.triggerEvent("focusout",e)&&e.kill(),f.set(ye.some(t.setTimeout((function(){o.triggerEvent(Sr(),e)}),0)))},sv?rv(n,"blur",r):nv(n,"focusout",r));return{unbind:function(){Pe(a,(function(e){e.unbind()})),s.unbind(),l.unbind(),d.unbind(),c.unbind(),u.get().each(t.clearTimeout),f.get().each(t.clearTimeout)}}},dv=function(e,t){return e=yt(e,"target").map((function(e){return e()})).getOr(t),mn(e)},mv=it([{stopped:[]},{resume:["element"]},{complete:[]}]),gv=function(e,t,n,r,o,i){return cv(e,t,n,r,o,i).fold((function(){return!0}),(function(r){return gv(e,t,n,r,o,i)}),(function(){return!1}))},hv=function(e,t,n,r,o){var i=dv(n,r);return cv(e,t,n,r,i,o)},pv=function(e,t,r){t=t,i=mn(!1);var i,a={stop:function(){i.set(!0)},cut:n,isStopped:i.get,isCut:o(!1),event:o(t),setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")};return Pe(e,(function(e){e=e.descHandler(),ji(e)(a)})),a.isStopped()},vv=function(e,t,n,r){var o=n.target();return bv(e,t,n,o,r)},bv=function(e,t,n,r,o){var i=dv(n,r);return gv(e,t,n,r,i,o)},yv=uo("element","descHandler");function wv(){var e={};return{registerId:function(t,n,r){Ze(r,(function(r,o){var i=void 0!==e[o]?e[o]:{};i[n]=Ui(a.apply(void 0,[(r=r).handler].concat(t)),r.purpose()),e[o]=i}))},unregisterId:function(t){Ze(e,(function(e,n){e.hasOwnProperty(t)&&delete e[t]}))},filterByType:function(t){return yt(e,t).map((function(e){return tt(e,(function(e,t){return e=e,{id:o(t),descHandler:o(e)}}))})).getOr([])},find:function(t,n,r){var o=_(n)(e);return $o(r,(function(e){return t=o,_i(n=e).fold((function(){return ye.none()}),(function(e){return e=_(e),t.bind(e).map((function(e){return yv(n,e)}))}));var t,n}),t)}}}function xv(){var e=wv(),t={},n=function(n){_i(n.element()).each((function(n){delete t[n],e.unregisterId(n)}))};return{find:function(t,n,r){return e.find(t,n,r)},filter:function(t){return e.filterByType(t)},register:function(r){i=(o=r).element();var o,i=_i(i).fold((function(){return vo("uid-",o.element())}),(function(e){return e}));if(St(t,i)){var a=r,u=i,c=t[u];if(c!==a)throw new Error('The tagId "'+u+'" is already used by: '+po(c.element())+"\nCannot use it for: "+po(a.element())+"\nThe conflicting element is"+(Vo(c.element())?" ":" not ")+"already in the DOM");n(a)}e.registerId([r],i,r.events()),t[i]=r},unregister:n,getById:function(e){return _(e)(t)}}}function Cv(e){function t(t){return ii(e.element()).fold((function(){return!0}),(function(e){return tr(t,e)}))}function r(e,n){return a.find(t,e,n)}function i(e){var t=a.filter(Tr());Pe(t,(function(t){t=t.descHandler(),ji(t)(e)}))}var a=xv(),u=fv(e.element(),{triggerEvent:function(e,t){return Au(e,t.target(),(function(n){return vv(r,e,t,n)}))}}),c={debugInfo:o("real"),triggerEvent:function(e,t,n){Au(e,t,(function(o){bv(r,e,n,t,o)}))},triggerFocus:function(e,t){_i(e).fold((function(){dc(e)}),(function(i){Au(Cr(),e,(function(i){hv(r,Cr(),{originator:o(t),kill:n,prevent:n,target:o(e)},e,i)}))}))},triggerEscape:function(e,t){c.triggerEvent("keydown",e.element(),t.event())},getByUid:function(e){return p(e)},getByDom:function(e){return v(e)},build:pa,addToGui:function(e){f(e)},removeFromGui:function(e){d(e)},addToWorld:function(e){s(e)},removeFromWorld:function(e){l(e)},broadcast:function(e){m(e)},broadcastOn:function(e,t){g(e,t)},broadcastEvent:function(e,t){h(e,t)},isConnected:o(!0)},s=function(e){e.connect(c),Ho(e.element())||(a.register(e),Pe(e.components(),s),c.triggerEvent(Br(),e.element(),{target:o(e.element())}))},l=function(e){Ho(e.element())||(Pe(e.components(),l),a.unregister(e)),e.disconnect()},f=function(t){vl(e,t)},d=function(e){wl(e)},m=function(e){i({universal:o(!0),data:o(e)})},g=function(e,t){i({universal:o(!1),channels:o(e),data:o(t)})},h=function(e,t){return e=a.filter(e),pv(e,t)},p=function(e){return a.getById(e).fold((function(){return we.error(new Error('Could not find component with uid: "'+e+'" in system.'))}),we.value)},v=function(e){return e=_i(e).getOr("not found"),p(e)};return s(e),{root:o(e),element:e.element,destroy:function(){u.unbind(),vi(e.element())},add:f,remove:d,getByUid:p,getByDom:v,addToWorld:s,removeFromWorld:l,broadcast:m,broadcastOn:g,broadcastEvent:h}}function Sv(e){return ye.from(e.settings.min_width).filter(Ee)}function kv(e){return ye.from(e.settings.min_height).filter(Ee)}function Tv(e){return e.getParam("toolbar_drawer","","string")}function Ev(e){return(e.getParam("toolbar_sticky",!1,"boolean")||e.inline)&&!Db(e)&&!_b(e)}function Ov(e){return{tag:e.tag,attributes:d({type:"text"},e.inputAttributes),styles:e.inputStyles,classes:e.inputClasses}}function Nv(e){function n(e){r()?a(e):i.push(e)}function r(){return o.isSome()}var o=ye.none(),i=[],a=function(e){o.each((function(n){t.setTimeout((function(){e(n)}),0)}))};return e((function(e){o=ye.some(e),Pe(i,a),i=[]})),{get:n,map:function(e){return Nv((function(t){n((function(n){t(e(n))}))}))},isReady:r}}function Av(e){return e=Lo(e),Re(Yb,e)}function Dv(e,t){var n=t.getRoot(e).getOr(e.element());Ji(n,t.invalidClass),t.notify.each((function(t){Av(e.element())&&wi(e.element(),"aria-invalid",!1),t.getContainer(e).each((function(e){ho(e,t.validHtml)})),t.onValid(e)}))}function _v(e,t,n,r){var o=t.getRoot(e).getOr(e.element());Yi(o,t.invalidClass),t.notify.each((function(t){Av(e.element())&&wi(e.element(),"aria-invalid",!0),t.getContainer(e).each((function(e){ho(e,r)})),t.onInvalid(e,r)}))}function Rv(e,t,n){return t.validator.fold((function(){return Xb.pure(we.value(!0))}),(function(t){return t.validate(e)}))}function Bv(e,t,n){return t.notify.each((function(t){t.onValidate(e)})),Rv(e,t).map((function(n){return e.getSystem().isConnected()?n.fold((function(n){return _v(e,t,0,n),we.error(n)}),(function(n){return Dv(e,t),we.value(n)})):we.error("No longer in system")}))}function Mv(e,t,n,r,o,i){var a=ny.getCoupled(n,"sandbox");return(Sl.isOpen(a)?cy:uy)(e,t,n,a,r,o,i)}function Pv(e,t,n){var r=yu(),i=ly(t,e);return{dom:{tag:"div",classes:e.sandboxClasses,attributes:{id:r.id(),role:"listbox"}},behaviours:Ml.augment(e.sandboxBehaviours,[_l.config({store:{mode:"memory",initialValue:t}}),Sl.config({onOpen:function(o,i){var a=iy(e,t);r.link(t.element()),e.matchWidth&&sy(a.hotspot,i,e.useMinWidth),e.onOpen(a,o,i),void 0!==n&&void 0!==n.onOpen&&n.onOpen(o,i)},onClose:function(e,o){r.unlink(t.element()),void 0!==n&&void 0!==n.onClose&&n.onClose(e,o)},isPartOf:function(e,n,r){return xu(n,r)||xu(t,r)},getAttachPoint:function(){return i().getOrDie()}}),Od.config({find:function(e){return Sl.getState(e).bind((function(e){return Od.getCurrent(e)}))}}),fc.config({channels:d(d({},Nl({isExtraPart:o(!1)})),Dl({isExtraPart:o(!1),doReposition:fy}))})])}}function zv(e){e=ny.getCoupled(e,"sandbox"),fy(e)}function Iv(){return[ln("sandboxClasses",[]),Ml.field("sandboxBehaviours",[Od,fc,Sl,_l])]}function Lv(e,t,n){function r(e,t){Xr(e,hy,{value:t})}var o,i,a=Vb.parts().field({factory:jb,inputClasses:["tox-textfield"],onSetValue:function(e){return Kb.run(e).get((function(){}))},inputBehaviours:ac([Jb.config({}),Kb.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(e){return ii(e.element())},notify:{onValid:function(e){var t=_l.getValue(e);Xr(e,gy,{color:t})}},validator:{validateOnLoad:!1,validate:function(e){var t=_l.getValue(e);return 0===t.length?Xb.pure(we.value(!0)):(e=gn.fromTag("span"),oa(e,"background-color",t),e=ua(e,"background-color").fold((function(){return we.error("blah")}),(function(e){return we.value(t)})),Xb.pure(e))}}})]),selectOnFocus:!1}),u=e.label.map((function(e){return ty(e,t.providers)})),c=Dm((o={dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:ye.some({onRtl:function(){return[Yu]},onLtr:function(){return[Ku]}}),components:[],fetch:yp(n.getColors(),n.hasCustomColors()),columns:n.getColorCols(),presets:"color",onItemAction:function(e,t){c.getOpt(e).each((function(e){"custom"===t?n.colorPicker((function(t){t.fold((function(){return Gr(e,py)}),(function(t){r(e,t),cp.addColor(t)}))}),"#ffffff"):r(e,"remove"===t?"":t)}))}},i=t,dy.sketch({dom:o.dom,components:o.components,toggleClass:"mce-active",dropdownBehaviours:ac([my.config({}),Jb.config({})]),layouts:o.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:i.getSink,fetch:function(e){return Xb.nu((function(e){return o.fetch(e)})).map((function(t){return ye.from(Zp(ut(Bp(Oi("menu-value"),t,(function(t){o.onItemAction(e,t)}),o.columns,o.presets,dh.CLOSE_ON_EXECUTE,(function(){return!1}),i.providers),{movement:Pp(o.columns,o.presets)})))}))},parts:{menu:Ap(!1,1,o.presets)}})));return Vb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[a,c.asSpec()]}]),fieldBehaviours:ac([im("form-field-events",[Xo(gy,(function(t,n){c.getOpt(t).each((function(e){oa(e.element(),"background-color",n.event().color())})),Xr(t,Rb,{name:e.name})})),Xo(hy,(function(e,t){Vb.getField(e).each((function(n){_l.setValue(n,t.event().value()),Od.getCurrent(e).each(am.focus)}))})),Xo(py,(function(e,t){Vb.getField(e).each((function(t){Od.getCurrent(e).each(am.focus)}))}))])])})}function Fv(e){return Gl({name:e+"-edge",overrides:function(t){return t.model.manager.edgeActions[e].fold((function(){return{}}),(function(e){var n=Go([oo(ir(),e,[t])]),r=Go([oo(cr(),e,[t]),oo(sr(),(function(t,n){n.mouseIsDown.get()&&e(t,n)}),[t])]);return{events:xy?n:r}}))}})}function Hv(e){return e=e.event().raw(),Cy?void 0!==e.touches&&1===e.touches.length?ye.some(e.touches[0]).map((function(e){return Ja(e.clientX,e.clientY)})):ye.none():void 0!==e.clientX?ye.some(e).map((function(e){return Ja(e.clientX,e.clientY)})):ye.none()}function Vv(e){return e.model.minX-1}function Uv(e){return e.model.minY-1}function jv(e){return e.model.maxX+1}function Wv(e){return e.model.maxY+1}function qv(e,t,n){return t(e)-n(e)}function $v(e){return Ny(e)/2}function Gv(e){return Ay(e)/2}function Xv(e,t){return void 0!==e[t+"-edge"]}function Yv(e){return{x:o(e)}}function Kv(e){return{y:o(e)}}function Jv(e,t){return{x:o(e),y:o(t)}}function Zv(e,t){Xr(e,Sy(),{value:t})}function Qv(e,t,n){return Math.max(t,Math.min(n,e))}function eb(e,t,n){return n={min:ky(t),max:Ey(t),range:Ny(t),value:n,step:Dy(t),snap:_y(t),snapStart:Ry(t),rounded:By(t),hasMinEdge:My(t),hasMaxEdge:Py(t),minBound:Gy(e),maxBound:Xy(e),screenRange:Jy(e)},Vy(n)}function tb(e){return function(t,n){return function(e,t,n){return e=(0<e?Hy:Fy)(Ly(n).x(),ky(n),Ey(n),Dy(n)),tw(t,nw(e)),ye.some(e)}(e,t,n).map((function(){return!0}))}}function nb(e,t,n,r,o,i){i=i,n=n,r=r,o=o,u=Jy(a=t),r=r.bind((function(e){return ye.some(Qy(e,a))})).getOr(0),o=o.bind((function(e){return ye.some(Qy(e,a))})).getOr(u),n={min:ky(i),max:Ey(i),range:Ny(i),value:n,hasMinEdge:My(i),hasMaxEdge:Py(i),minBound:Gy(a),minOffset:0,maxBound:Xy(a),maxOffset:u,centerMinEdge:r,centerMaxEdge:o};var a,u;i=Uy(n);return Gy(t)-Gy(e)+i}function rb(e,t,n){return n={min:Ty(t),max:Oy(t),range:Ay(t),value:n,step:Dy(t),snap:_y(t),snapStart:Ry(t),rounded:By(t),hasMinEdge:zy(t),hasMaxEdge:Iy(t),minBound:Yy(e),maxBound:Ky(e),screenRange:Zy(e)},Vy(n)}function ob(e){return function(t,n){return function(e,t,n){return e=(0<e?Hy:Fy)(Ly(n).y(),Ty(n),Oy(n),Dy(n)),rw(t,ow(e)),ye.some(e)}(e,t,n).map((function(){return!0}))}}function ib(e,t,n,r,o,i){i=i,n=n,r=r,o=o,u=Zy(a=t),r=r.bind((function(e){return ye.some(ew(e,a))})).getOr(0),o=o.bind((function(e){return ye.some(ew(e,a))})).getOr(u),n={min:Ty(i),max:Oy(i),range:Ay(i),value:n,hasMinEdge:zy(i),hasMaxEdge:Iy(i),minBound:Yy(a),minOffset:0,maxBound:Ky(a),maxOffset:u,centerMinEdge:r,centerMaxEdge:o};var a,u;i=Uy(n);return Yy(t)-Yy(e)+i}function ab(e,t){return function(n,r){return n=n,r=r,o=0<(o=e)?Hy:Fy,a=(i=t)?Ly(r).x():o(Ly(r).x(),ky(r),Ey(r),Dy(r)),i=i?o(Ly(r).y(),Ty(r),Oy(r),Dy(r)):Ly(r).y(),iw(n,aw(a,i)),ye.some(a).map((function(){return!0}));var o,i,a}}function ub(e){return"<alloy.field."+e+">"}function cb(e,t,n){return{uid:e.uid,dom:e.dom,components:t,behaviours:Bl(e.formBehaviours,[_l.config({store:{mode:"manual",getValue:function(t){return t=ef(t,e),Qe(t,(function(e,t){return e().bind((function(e){return e=Od.getCurrent(e),fw(e,"missing current")})).map(_l.getValue)}))},setValue:function(t,n){Ze(n,(function(n,r){Ql(t,e,r).each((function(e){Od.getCurrent(e).each((function(e){_l.setValue(e,n)}))}))}))}}})]),apis:{getField:function(t,n){return Ql(t,e,n).bind(Od.getCurrent)}}}}function sb(e){return kw(e)}function lb(e,t,n){return _l.config(ut({store:{mode:"manual",getValue:t,setValue:n}},e.map((function(e){return{store:{initialValue:e}}})).getOr({})))}function fb(e,t,n){return lb(e,(function(e){return t(e.element())}),(function(e,t){return n(e.element(),t)}))}function db(e,t){function n(e,t){t.stop()}function r(e){return function(t,n){Pe(e,(function(e){e(t,n)}))}}function o(e,t){uh.isDisabled(e)||(t=t.event().raw(),a(e,t.dataTransfer.files))}function i(e,t){t=t.event().raw().target.files,a(e,t)}var a=function(t,n){var r;_l.setValue(t,(n=n,r=new RegExp("("+Nw.split(/\s*,\s*/).join("|")+")$","i"),Ie(Ye(n),(function(e){return r.test(e.name)})))),Xr(t,Rb,{name:e.name})},u=Dm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ac([im("input-file-events",[ao(Ar())])])}),c=e.label.map((function(e){return ty(e,t)})),s=Vb.parts().field({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ac([Ow.memory([]),ww(),uh.config({}),sm.config({toggleClass:"dragenter",toggleOnExecute:!1}),im("dropzone-events",[Xo("dragenter",r([n,sm.toggle])),Xo("dragleave",r([n,sm.toggle])),Xo("dragover",n),Xo("drop",r([n,o])),Xo(br(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Am.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[u.asSpec()],action:function(e){u.get(e).element().dom().click()},buttonBehaviours:ac([Jb.config({})])})]}]}}}});return Zb(c,s,["tox-form__group--stretched"],[])}function mb(e){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:ac([am.config({ignore:!0}),Jb.config({})])}}function gb(e,t){Xr(e,hr(),{raw:{which:9,shiftKey:t}})}function hb(e,t){var n,r,o=Rw&&e.sandboxed,i=d(d({},e.label.map((function(e){return{title:e}})).getOr({})),o?{sandbox:"allow-scripts allow-same-origin"}:{}),a=(n=o,r=mn(""),{getValue:function(e){return r.get()},setValue:function(e,t){n?wi(e.element(),"srcdoc",t):(wi(e.element(),"src","javascript:''"),(e=e.element().dom().contentWindow.document).open(),e.write(t),e.close()),r.set(t)}});o=e.label.map((function(e){return ty(e,t)})),e=Vb.parts().field({factory:{sketch:function(e){return _w.craft({uid:e.uid,dom:{tag:"iframe",attributes:i},behaviours:ac([Jb.config({}),am.config({}),Ow.withComp(ye.none(),a.getValue,a.setValue)])})}}});return Zb(o,e,["tox-form__group--stretched"],[])}var pb,vb,bb,yb,wb,xb,Cb=af({name:"Container",factory:function(e){var t=e.dom,n=t.attributes;t=m(t,["attributes"]);return{uid:e.uid,dom:d({tag:"div",attributes:d({role:"presentation"},n)},t),components:e.components,behaviours:Rl(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},configFields:[ln("components",[]),gs("containerBehaviours",[]),ln("events",{}),ln("domModification",{}),ln("eventOrder",{})]}),Sb=tinymce.util.Tools.resolve("tinymce.EditorManager"),kb=function(e){return e.getParam("readonly",!1,"boolean")},Tb=function(e){return!1!==e.getParam("menubar",!0,"boolean")},Eb=function(e){var t=e.getParam("toolbar",!0),n=!0===t,r=xe(t);t=Se(t)&&0<t.length;return!Nb(e)&&(t||r||n)},Ob=function(e){var t=Ke(e.settings);t=Ie(t,(function(e){return/^toolbar([1-9])$/.test(e)})),t=Me(t,(function(t){return e.getParam(t,!1,"string")})),t=Ie(t,(function(e){return"string"==typeof e}));return 0<t.length?ye.some(t):ye.none()},Nb=function(e){return Ob(e).fold((function(){return 0<e.getParam("toolbar",[],"string[]").length}),(function(){return!0}))},Ab=((tm=pb=pb||{}).default="",tm.floating="floating",tm.sliding="sliding",function(e){var t=e.getParam("fixed_toolbar_container","","string");return 0<t.length&&e.inline?vu(Uo(),t):ye.none()}),Db=function(e){return e.inline&&Ab(e).isSome()},_b=function(e){return e.inline&&!Tb(e)&&!Eb(e)&&!Nb(e)},Rb=Oi("form-component-change"),Bb=Oi("form-close"),Mb=Oi("form-cancel"),Pb=Oi("form-action"),zb=Oi("form-submit"),Ib=Oi("form-block"),Lb=Oi("form-unblock"),Fb=Oi("form-tabchange"),Hb=Oi("form-resize"),Vb=(Xd=o([ln("prefix","form-field"),gs("fieldBehaviours",[Od,_l])]),Yn=o([Gl({schema:[on("dom")],name:"label"}),Gl({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[on("text")],name:"aria-descriptor"}),$l({factory:{sketch:function(e){var t=D(e,["factory"]);return e.factory.sketch(t)}},schema:[on("factory")],name:"field"})]),uf({name:"FormField",configFields:Xd(),partFields:Yn(),factory:function(e,t,n,r){var o=Bl(e.fieldBehaviours,[Od.config({find:function(t){return Ql(t,e,"field")}}),_l.config({store:{mode:"manual",getValue:function(e){return Od.getCurrent(e).bind(_l.getValue)},setValue:function(e,t){Od.getCurrent(e).each((function(e){_l.setValue(e,t)}))}}})]),i=Go([Zo((function(t,n){var r=ks(t,e,["label","field","aria-descriptor"]);r.field().each((function(t){var n=Oi(e.prefix);r.label().each((function(e){wi(e.element(),"for",n),wi(t.element(),"id",n)})),r["aria-descriptor"]().each((function(n){var r=Oi(e.prefix);wi(n.element(),"id",r),wi(t.element(),"aria-describedby",r)}))}))}))]);return{uid:e.uid,dom:e.dom,components:t,behaviours:o,events:i,apis:{getField:function(t){return Ql(t,e,"field")},getLabel:function(t){return Ql(t,e,"label")}}}},apis:{getField:function(e,t){return e.getField(t)},getLabel:function(e,t){return e.getLabel(t)}}})),Ub=(qn=o([Z("data"),ln("inputAttributes",{}),ln("inputStyles",{}),ln("tag","input"),ln("inputClasses",[]),ka("onSetValue"),ln("styles",{}),ln("eventOrder",{}),gs("inputBehaviours",[_l,am]),ln("selectOnFocus",!0)]),function(e){return ac([am.config({onFocus:!1===e.selectOnFocus?n:function(e){e=e.element();var t=la(e);e.dom().setSelectionRange(0,t.length)}})])}),jb=af({name:"Input",configFields:qn(),factory:function(e,t){return{uid:e.uid,dom:Ov(e),components:[],behaviours:d(d({},Ub(n=e)),Bl(n.inputBehaviours,[_l.config({store:{mode:"manual",initialValue:n.data.getOr(void 0),getValue:function(e){return la(e.element())},setValue:function(e,t){la(e.element())!==t&&fa(e.element(),t)}},onSetValue:n.onSetValue})])),eventOrder:e.eventOrder};var n}}),Wb=(qd={},Wl={exports:qd},bb=qd,yb=Wl,wb=vb=void 0,function(t){"object"==typeof bb&&void 0!==yb?yb.exports=t():"function"==typeof vb&&vb.amd?vb([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}((function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var c="function"==typeof wb&&wb;if(!u&&c)return c(a,!0);if(i)return i(a,!0);throw(u=new Error("Cannot find module '"+a+"'")).code="MODULE_NOT_FOUND",u}c=n[a]={exports:{}},t[a][0].call(c.exports,(function(e){return o(t[a][1][e]||e)}),c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof wb&&wb,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){var r,o;t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return(r=setTimeout)(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}var c,s=[],l=!1,f=-1;function d(){l&&c&&(l=!1,c.length?s=c.concat(s):f=-1,s.length&&m())}function m(){if(!l){for(var e=u(d),t=(l=!0,s.length);t;){for(c=s,s=[];++f<t;)c&&c[f].run();f=-1,t=s.length}c=null,l=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return(o=clearTimeout)(t);try{o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function h(){}t.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new g(e,t)),1!==s.length||l||u(m)},g.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=h,t.addListener=h,t.once=h,t.off=h,t.removeListener=h,t.removeAllListeners=h,t.emit=h,t.prependListener=h,t.prependOnceListener=h,t.listeners=function(e){return[]},t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],2:[function(e,t,n){(function(e){function n(){}function r(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0===e._state?e._deferreds.push(t):(e._handled=!0,r._immediateFn((function(){var n,r=1===e._state?t.onFulfilled:t.onRejected;if(null===r)(1===e._state?i:a)(t.promise,e._value);else{try{n=r(e._value)}catch(n){return void a(t.promise,n)}i(t.promise,n)}})))}function i(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof r)return e._state=3,e._value=t,void u(e);if("function"==typeof n)return void s((o=n,i=t,function(){o.apply(i,arguments)}),e)}e._state=1,e._value=t,u(e)}catch(t){a(e,t)}var o,i}function a(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&r._immediateFn((function(){e._handled||r._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function c(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function s(e,t){var n=!1;try{e((function(e){n||(n=!0,i(t,e))}),(function(e){n||(n=!0,a(t,e))}))}catch(e){if(n)return;n=!0,a(t,e)}}var l,f;l=this,f=setTimeout,r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new c(e,t,r)),r},r.all=function(e){var t=Array.prototype.slice.call(e);return new r((function(e,n){if(0===t.length)return e([]);for(var r=t.length,o=0;o<t.length;o++)!function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),n)}t[i]=a,0==--r&&e(t)}catch(a){n(a)}}(o,t[o])}))},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r((function(t){t(e)}))},r.reject=function(e){return new r((function(t,n){n(e)}))},r.race=function(e){return new r((function(t,n){for(var r=0,o=e.length;r<o;r++)e[r].then(t,n)}))},r._immediateFn="function"==typeof e?function(t){e(t)}:function(e){f(e,0)},r._unhandledRejectionFn=function(e){},r._setImmediateFn=function(e){r._immediateFn=e},r._setUnhandledRejectionFn=function(e){r._unhandledRejectionFn=e},void 0!==t&&t.exports?t.exports=r:l.Promise||(l.Promise=r)}).call(this,e("timers").setImmediate)},{timers:3}],3:[function(e,t,n){(function(t,r){var o=e("process/browser.js").nextTick,i=Function.prototype.apply,a=Array.prototype.slice,u={},c=0;function s(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new s(i.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new s(i.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=c++,r=!(arguments.length<2)&&a.call(arguments,1);return u[t]=!0,o((function(){u[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof r?r:function(e){delete u[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(e,t,n){e=e("promise-polyfill");var r="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:r.Promise||e}},{"promise-polyfill":2}]},{},[4])(4)})),Wl.exports.boltExport),qb={nu:Nv,pure:function(e){return Nv((function(t){t(e)}))}},$b=function(e){t.setTimeout((function(){throw e}),0)},Gb=function(e){function t(t){e().then(t,$b)}return{map:function(t){return Gb((function(){return e().then(t)}))},bind:function(t){return Gb((function(){return e().then((function(e){return t(e).toPromise()}))}))},anonBind:function(t){return Gb((function(){return e().then((function(){return t.toPromise()}))}))},toLazy:function(){return qb.nu(t)},toCached:function(){var t=null;return Gb((function(){return t=null===t?e():t}))},toPromise:e,get:t}},Xb={nu:function(e){return Gb((function(){return new Wb(e)}))},pure:function(e){return Gb((function(){return Wb.resolve(e)}))}},Yb=["input","textarea"],Kb=(Wn=Object.freeze({markValid:Dv,markInvalid:_v,query:Rv,run:Bv,isInvalid:function(e,t){return e=t.getRoot(e).getOr(e.element()),Zi(e,t.invalidClass)}}),ql=Object.freeze({events:function(e,t){return e.validator.map((function(t){return Go([Xo(t.onEvent,(function(t){Bv(t,e).get(i)}))].concat(t.validateOnLoad?[Zo((function(t){Bv(t,e).get(n)}))]:[]))})).getOr({})}}),$d=[on("invalidClass"),ln("getRoot",ye.none),cn("notify",[ln("aria","alert"),ln("getContainer",ye.none),ln("validHtml",""),ka("onValid"),ka("onInvalid"),ka("onValidate")]),cn("validator",[on("validate"),ln("onEvent","input"),ln("validateOnLoad",!0)])],Ba({fields:$d,name:"invalidating",active:ql,apis:Wn,extra:{validation:function(e){return function(t){return t=_l.getValue(t),Xb.pure(e(t))}}}})),Jb=(jl=Object.freeze({exhibit:function(e,t){return So({attributes:xt([{key:t.tabAttr,value:"true"}])})}}),Ys=[ln("tabAttr","data-alloy-tabstop")],Ba({fields:Ys,name:"tabstopping",active:jl})),Zb=function(e,t,n,r){return e=Qb(e,t,n,r),Vb.sketch(e)},Qb=function(e,t,n,r){return{dom:ey(n),components:e.toArray().concat([t]),fieldBehaviours:ac(r)}},ey=function(e){return{tag:"div",classes:["tox-form__group"].concat(e)}},ty=function(e,t){return Vb.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}})},ny=(Pu=Object.freeze({getCoupled:function(e,t,n,r){return n.getOrCreate(e,t,r)}}),em=[an("others",V(we.value,Zt()))],Ba({fields:em,name:"coupling",apis:Pu,state:Object.freeze({init:function(e){var t={},n=o({});return Hi({readState:n,getOrCreate:function(e,n,r){var o=Ke(n.others);if(o)return yt(t,r).getOrThunk((function(){var o=yt(n.others,r).getOrDie("No information found for coupled component: "+r)(e);o=e.getSystem().build(o);return t[r]=o}));throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(o,null,2))}})}})})),ry=o("sink"),oy=o(Gl({name:ry(),overrides:o({dom:{tag:"div"},behaviours:ac([dl.config({useFixed:l})]),events:Go([ao(hr()),ao(cr()),ao(yr())])})})),iy=((Wd=xb=xb||{})[Wd.HighlightFirst=0]="HighlightFirst",Wd[Wd.HighlightNone=1]="HighlightNone",function(e,t){var n=e.getHotspot(t).getOr(t),r=e.getAnchorOverrides();return e.layouts.fold((function(){return{anchor:"hotspot",hotspot:n,overrides:r}}),(function(e){return{anchor:"hotspot",hotspot:n,overrides:r,layouts:e}}))}),ay=function(e,t,n,r,o,i,a){t=t;t=(0,e.fetch)(r).map(t);var u=ly(r,e);return t.map((function(e){return e.bind((function(e){return ye.from(Sm.sketch(d(d({},i.menu()),{uid:Ri(""),data:e,highlightImmediately:a===xb.HighlightFirst,onOpenMenu:function(e,t){var r=u().getOrDie();dl.position(r,n,t),Sl.decloak(o)},onOpenSubmenu:function(e,t,n){var r=u().getOrDie();dl.position(r,{anchor:"submenu",item:t},n),Sl.decloak(o)},onRepositionMenu:function(e,t,r){var o=u().getOrDie();dl.position(o,n,t),Pe(r,(function(e){dl.position(o,{anchor:"submenu",item:e.triggeringItem},e.triggeredMenu)}))},onEscape:function(){return am.focus(r),Sl.close(o),ye.some(!0)}})))}))}))},uy=function(e,t,n,r,o,i,a){var u=iy(e,n);return ay(e,t,u,n,r,o,a).map((function(e){return e.fold((function(){Sl.isOpen(r)&&Sl.close(r)}),(function(e){Sl.cloak(r),Sl.open(r,e),i(r)})),r}))},cy=function(e,t,n,r,o,i,a){return Sl.close(r),Xb.pure(r)},sy=function(e,t,n){t=Od.getCurrent(t).getOr(t),e=nu(e.element()),n?oa(t.element(),"min-width",e+"px"):(n=t.element(),tu.set(n,e))},ly=function(e,t){return e.getSystem().getByUid(t.uid+"-"+ry()).map((function(e){return function(){return we.value(e)}})).getOrThunk((function(){return t.lazySink.fold((function(){return function(){return we.error(new Error("No internal sink is specified, nor could an external sink be found"))}}),(function(t){return function(){return t(e)}}))}))},fy=function(e){Sl.getState(e).each((function(e){Sm.repositionMenus(e)}))},dy=(Sc=o([on("dom"),on("fetch"),ka("onOpen"),Ta("onExecute"),ln("getHotspot",ye.some),ln("getAnchorOverrides",o({})),ln("layouts",ye.none()),gs("dropdownBehaviours",[sm,ny,nm,am]),on("toggleClass"),ln("eventOrder",{}),Z("lazySink"),ln("matchWidth",!1),ln("useMinWidth",!1),Z("role")].concat(Iv())),tm=o([Tc({schema:[xa()],name:"menu",defaults:function(e){return{onExecute:e.onExecute}}}),oy()]),uf({name:"Dropdown",configFields:Sc(),partFields:tm(),factory:function(e,t,r,o){function i(e){Sl.getState(e).each((function(e){Sm.highlightPrimary(e)}))}function a(e,t){return Yr(e),ye.some(!0)}var u,c={expand:function(t){sm.isOn(t)||Mv(e,(function(e){return e}),t,o,n,xb.HighlightNone).get(n)},open:function(t){sm.isOn(t)||Mv(e,(function(e){return e}),t,o,n,xb.HighlightFirst).get(n)},isOpen:sm.isOn,close:function(t){sm.isOn(t)&&Mv(e,(function(e){return e}),t,o,n,xb.HighlightFirst).get(n)},repositionMenus:function(e){sm.isOn(e)&&zv(e)}};return{uid:e.uid,dom:e.dom,components:t,behaviours:Bl(e.dropdownBehaviours,[sm.config({toggleClass:e.toggleClass,aria:{mode:"expanded"}}),ny.config({others:{sandbox:function(t){return Pv(e,t,{onOpen:function(){sm.on(t)},onClose:function(){sm.off(t)}})}}}),nm.config({mode:"special",onSpace:a,onEnter:a,onDown:function(e,t){var n;return dy.isOpen(e)?(n=ny.getCoupled(e,"sandbox"),i(n)):dy.open(e),ye.some(!0)},onEscape:function(e,t){return dy.isOpen(e)?(dy.close(e),ye.some(!0)):ye.none()}}),am.config({})]),events:Cd(ye.some((function(t){Mv(e,(function(e){return e}),t,o,i,xb.HighlightFirst).get(n)}))),eventOrder:d(d({},e.eventOrder),((t={})[Er()]=["disabling","toggling","alloy.base.behaviour"],t)),apis:c,domModification:{attributes:d(d({"aria-haspopup":"true"},e.role.fold((function(){return{}}),(function(e){return{role:e}}))),"button"===e.dom.tag?{type:(u="type",yt(e.dom,"attributes").bind((function(e){return yt(e,u)})).getOr("button"))}:{})}}},apis:{open:function(e,t){return e.open(t)},expand:function(e,t){return e.expand(t)},close:function(e,t){return e.close(t)},isOpen:function(e,t){return e.isOpen(t)},repositionMenus:function(e,t){return e.repositionMenus(t)}}})),my=Ba({fields:[],name:"unselecting",active:Object.freeze({events:function(e){return Go([no(xr(),o(!0))])},exhibit:function(e,t){return So({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),gy=Oi("color-input-change"),hy=Oi("color-swatch-change"),py=Oi("color-picker-cancel"),vy=function(e,t,n){return{hue:o(e),saturation:o(t),value:o(n)}},by=o(Oi("rgb-hex-update")),yy=o(Oi("slider-update")),wy=o(Oi("palette-update")),xy=Xn().deviceType.isTouch(),Cy=(Xd=Gl({schema:[on("dom")],name:"label"}),Yn=Fv("top-left"),qd=Fv("top"),Wl=Fv("top-right"),$d=Fv("right"),ql=Fv("bottom-right"),Wn=Fv("bottom"),Ys=Fv("bottom-left"),jl=[Xd,Fv("left"),$d,qd,Wn,Yn,Wl,Ys,ql,$l({name:"thumb",defaults:o({dom:{styles:{position:"absolute"}}}),overrides:function(e){return{events:Go([io(ir(),e,"spectrum"),io(ar(),e,"spectrum"),io(ur(),e,"spectrum"),io(cr(),e,"spectrum"),io(sr(),e,"spectrum"),io(fr(),e,"spectrum")])}}}),$l({schema:[dn("mouseIsDown",(function(){return mn(!1)}))],name:"spectrum",overrides:function(e){function t(t,r){return n.getValueFromEvent(r).map((function(r){return n.setValueFrom(t,e,r)}))}var n=e.model.manager,r=Go([Xo(ir(),t),Xo(ar(),t)]),o=Go([Xo(cr(),t),Xo(sr(),(function(n,r){e.mouseIsDown.get()&&t(n,r)}))]);return{behaviours:ac(xy?[]:[nm.config({mode:"special",onLeft:function(t){return n.onLeft(t,e)},onRight:function(t){return n.onRight(t,e)},onUp:function(t){return n.onUp(t,e)},onDown:function(t){return n.onDown(t,e)}}),am.config({})]),events:xy?r:o}}})],Xn().deviceType.isTouch()),Sy=o("slider.change.value"),ky=function(e){return e.model.minX},Ty=function(e){return e.model.minY},Ey=function(e){return e.model.maxX},Oy=function(e){return e.model.maxY},Ny=function(e){return qv(e,Ey,ky)},Ay=function(e){return qv(e,Oy,Ty)},Dy=function(e){return e.stepSize},_y=function(e){return e.snapToGrid},Ry=function(e){return e.snapStart},By=function(e){return e.rounded},My=function(e){return Xv(e,"left")},Py=function(e){return Xv(e,"right")},zy=function(e){return Xv(e,"top")},Iy=function(e){return Xv(e,"bottom")},Ly=function(e){return e.model.value.get()},Fy=function(e,t,n,r){return e<t?e:n<e?n:e===t?t-1:Math.max(t,e-r)},Hy=function(e,t,n,r){return n<e?e:e<t?t:e===n?n+1:Math.min(n,e+r)},Vy=function(e){var t,n,r,o,i=e.min,a=e.max,u=e.range,c=e.value,s=e.step,l=e.snap,f=e.snapStart,d=e.rounded,m=e.hasMinEdge,g=e.hasMaxEdge,h=e.minBound,p=e.maxBound;e=e.screenRange,m=m?i-1:i,g=g?a+1:a;return c<h?m:p<c?g:(h=h,p=Math.min(p,Math.max(c,h))-h,c=Qv(p/e*u+i,m,g),l&&i<=c&&c<=a?(t=c,n=i,r=a,o=s,f.fold((function(){var e=Math.round((t-n)/o)*o;return Qv(n+e,n-1,r+1)}),(function(e){var n=Math.round((t-e)%o/o),i=Math.floor((t-e)/o),a=Math.floor((r-e)/o);a=Math.min(a,i+n);return Math.max(e,e+a*o)}))):d?Math.round(c):c)},Uy=function(e){var t=e.min,n=e.max,r=e.range,o=e.value,i=e.hasMinEdge,a=e.hasMaxEdge,u=e.maxBound,c=e.maxOffset,s=e.centerMinEdge;e=e.centerMaxEdge;return o<t?i?0:s:n<o?a?u:e:(o-t)/r*c},jy="top",Wy="left",qy=function(e){return e.element().dom().getBoundingClientRect()},$y=function(e,t){return e[t]},Gy=function(e){return e=qy(e),$y(e,Wy)},Xy=function(e){return e=qy(e),$y(e,"right")},Yy=function(e){return e=qy(e),$y(e,jy)},Ky=function(e){return e=qy(e),$y(e,"bottom")},Jy=function(e){return e=qy(e),$y(e,"width")},Zy=function(e){return e=qy(e),$y(e,"height")},Qy=function(e,t){return e=qy(e),t=qy(t),($y(e,Wy)+$y(e,"right"))/2-$y(t,Wy)},ew=function(e,t){return e=qy(e),t=qy(t),($y(e,jy)+$y(e,"bottom"))/2-$y(t,jy)},tw=function(e,t){Xr(e,Sy(),{value:t})},nw=function(e){return{x:o(e)}},rw=(em=tb(-1),Pu=tb(1),Wd=ye.none,Sc=ye.none,tm={"top-left":ye.none(),top:ye.none(),"top-right":ye.none(),right:ye.some((function(e,t){Zv(e,Yv(jv(t)))})),"bottom-right":ye.none(),bottom:ye.none(),"bottom-left":ye.none(),left:ye.some((function(e,t){Zv(e,Yv(Vv(t)))}))},Xd=Object.freeze({setValueFrom:function(e,t,n){return t=eb(e,t,n),n=nw(t),tw(e,n),t},setToMin:function(e,t){t=ky(t),tw(e,nw(t))},setToMax:function(e,t){t=Ey(t),tw(e,nw(t))},findValueOfOffset:eb,getValueFromEvent:function(e){return Hv(e).map((function(e){return e.left()}))},findPositionOfValue:nb,setPositionFromValue:function(e,t,n,r){var o=Ly(n);o=nb(e,r.getSpectrum(e),o.x(),r.getLeftEdge(e),r.getRightEdge(e),n),r=nu(t.element())/2;oa(t.element(),"left",o-r+"px")},onLeft:em,onRight:Pu,onUp:Wd,onDown:Sc,edgeActions:tm}),function(e,t){Xr(e,Sy(),{value:t})}),ow=function(e){return{y:o(e)}},iw=($d=ye.none,qd=ye.none,Wn=ob(-1),Yn=ob(1),Wl={"top-left":ye.none(),top:ye.some((function(e,t){Zv(e,Kv(Uv(t)))})),"top-right":ye.none(),right:ye.none(),"bottom-right":ye.none(),bottom:ye.some((function(e,t){Zv(e,Kv(Wv(t)))})),"bottom-left":ye.none(),left:ye.none()},Ys=Object.freeze({setValueFrom:function(e,t,n){return t=rb(e,t,n),n=ow(t),rw(e,n),t},setToMin:function(e,t){t=Ty(t),rw(e,ow(t))},setToMax:function(e,t){t=Oy(t),rw(e,ow(t))},findValueOfOffset:rb,getValueFromEvent:function(e){return Hv(e).map((function(e){return e.top()}))},findPositionOfValue:ib,setPositionFromValue:function(e,t,n,r){var o=Ly(n);o=ib(e,r.getSpectrum(e),o.y(),r.getTopEdge(e),r.getBottomEdge(e),n),r=Ya(t.element())/2;oa(t.element(),"top",o-r+"px")},onLeft:$d,onRight:qd,onUp:Wn,onDown:Yn,edgeActions:Wl}),function(e,t){Xr(e,Sy(),{value:t})}),aw=function(e,t){return{x:o(e),y:o(t)}},uw=(ql=Hv,em=ab(-1,!1),Pu=ab(1,!1),Wd=ab(-1,!0),Sc=ab(1,!0),tm={"top-left":ye.some((function(e,t){Zv(e,Jv(Vv(t),Uv(t)))})),top:ye.some((function(e,t){Zv(e,Jv($v(t),Uv(t)))})),"top-right":ye.some((function(e,t){Zv(e,Jv(jv(t),Uv(t)))})),right:ye.some((function(e,t){Zv(e,Jv(jv(t),Gv(t)))})),"bottom-right":ye.some((function(e,t){Zv(e,Jv(jv(t),Wv(t)))})),bottom:ye.some((function(e,t){Zv(e,Jv($v(t),Wv(t)))})),"bottom-left":ye.some((function(e,t){Zv(e,Jv(Vv(t),Wv(t)))})),left:ye.some((function(e,t){Zv(e,Jv(Vv(t),Gv(t)))}))},$d=Object.freeze({setValueFrom:function(e,t,n){var r=eb(e,t,n.left());t=rb(e,t,n.top()),n=aw(r,t);return iw(e,n),n},setToMin:function(e,t){var n=ky(t);t=Ty(t);iw(e,aw(n,t))},setToMax:function(e,t){var n=Ey(t);t=Oy(t);iw(e,aw(n,t))},getValueFromEvent:ql,setPositionFromValue:function(e,t,n,r){var o=Ly(n),i=nb(e,r.getSpectrum(e),o.x(),r.getLeftEdge(e),r.getRightEdge(e),n);o=ib(e,r.getSpectrum(e),o.y(),r.getTopEdge(e),r.getBottomEdge(e),n),r=nu(t.element())/2,e=Ya(t.element())/2;oa(t.element(),"left",i-r+"px"),oa(t.element(),"top",o-e+"px")},onLeft:em,onRight:Pu,onUp:Wd,onDown:Sc,edgeActions:tm}),qd=Xn().deviceType.isTouch(),Wn=[ln("stepSize",1),ln("onChange",n),ln("onChoose",n),ln("onInit",n),ln("onDragStart",n),ln("onDragEnd",n),ln("snapToGrid",!1),ln("rounded",!0),Z("snapStart"),an("model",U("mode",{x:[ln("minX",0),ln("maxX",100),dn("value",(function(e){return mn(e.mode.minX)})),on("getInitialValue"),Bu("manager",Xd)],y:[ln("minY",0),ln("maxY",100),dn("value",(function(e){return mn(e.mode.minY)})),on("getInitialValue"),Bu("manager",Ys)],xy:[ln("minX",0),ln("maxX",100),ln("minY",0),ln("maxY",100),dn("value",(function(e){return mn({x:o(e.mode.minX),y:o(e.mode.minY)})})),on("getInitialValue"),Bu("manager",$d)]})),gs("sliderBehaviours",[nm,_l])].concat(qd?[]:[dn("mouseIsDown",(function(){return mn(!1)}))]),Xn().deviceType.isTouch()),cw=uf({name:"Slider",configFields:Wn,partFields:jl,factory:function(e,t,n,r){function i(t){return Ss(t,e,"thumb")}function a(t,n){g.setPositionFromValue(t,n,e,{getLeftEdge:s,getRightEdge:l,getTopEdge:f,getBottomEdge:d,getSpectrum:c})}function u(t,n){m.value.set(n);var r=i(t);return a(t,r),e.onChange(t,r,n),ye.some(!0)}var c=function(t){return Ss(t,e,"spectrum")},s=function(t){return Ql(t,e,"left-edge")},l=function(t){return Ql(t,e,"right-edge")},f=function(t){return Ql(t,e,"top-edge")},d=function(t){return Ql(t,e,"bottom-edge")},m=e.model,g=m.manager,h=[Xo(ir(),(function(t,n){e.onDragStart(t,i(t))})),Xo(ur(),(function(t,n){e.onDragEnd(t,i(t))}))],p=[Xo(cr(),(function(t,n){n.stop(),e.onDragStart(t,i(t)),e.mouseIsDown.set(!0)})),Xo(fr(),(function(t,n){e.onDragEnd(t,i(t))}))];h=uw?h:p;return{uid:e.uid,dom:e.dom,components:t,behaviours:Bl(e.sliderBehaviours,Ue([uw?[]:[nm.config({mode:"special",focusIn:function(t){return Ql(t,e,"spectrum").map(nm.focusIn).map(o(!0))}})],[_l.config({store:{mode:"manual",getValue:function(e){return m.value.get()}}}),fc.config({channels:{"mouse.released":{onReceive:function(t,n){function r(){Ql(t,e,"thumb").each((function(n){var r=m.value.get();e.onChoose(t,n,r)}))}var o;uw?r():(o=e.mouseIsDown.get(),e.mouseIsDown.set(!1),o&&r())}}}})]])),events:Go([Xo(Sy(),(function(e,t){u(e,t.event().value())})),Zo((function(t,n){var r=m.getInitialValue(),o=(r=(m.value.set(r),i(t)),a(t,r),c(t));e.onInit(t,r,o,m.value.get())}))].concat(h)),apis:{resetToMin:function(t){g.setToMin(t,e)},resetToMax:function(t){g.setToMax(t,e)},changeValue:u,refresh:a},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(e,t){e.resetToMin(t)},resetToMax:function(e,t){e.resetToMax(t)},refresh:function(e,t){e.refresh(t)}}}),sw=function(e,t){var n=cw.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=cw.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return cw.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:o({y:o(0)})},components:[n,r],sliderBehaviours:ac([am.config({})]),onChange:function(e,t,n){Xr(e,yy(),{value:n})}})},lw=[gs("formBehaviours",[_l])],fw=function(e,t){return e.fold((function(){return we.error(t)}),we.value)},dw={getField:xo((function(e,t,n){return e.getField(t,n)})),sketch:function(e){t=[];var t,n={field:function(e,n){return t.push(e),xs("form",ub(e),n)},record:function(){return t}};e=e(n),n=n.record(),n=Me(n,(function(e){return $l({name:e,pname:ub(e)})}));return Os("form",lw,n,cb,e)}},mw=Oi("valid-input"),gw=Oi("invalid-input"),hw=Oi("validating-input"),pw="colorcustom.rgb.",vw=function(e,t,r,i){function a(r,o,i,a,u){var c=e(pw+"range");i=[Vb.parts().label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),Vb.parts().field({data:u,factory:jb,inputAttributes:d({type:"text"},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[t("textfield")],inputBehaviours:ac([s(o,r),Jb.config({})]),onSetValue:function(e){Kb.isInvalid(e)&&Kb.run(e).get(n)}})],a="hex"!==o?[Vb.parts()["aria-descriptor"]({text:c})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:i.concat(a)}}function u(e,t){var n=t.red(),r=t.green();t=t.blue();_l.setValue(e,{red:n,green:r,blue:t})}function c(e,t){l.getOpt(e).each((function(e){oa(e.element(),"background-color","#"+t.value())}))}var s=function(n,r){return Kb.config({invalidClass:t("invalid"),notify:{onValidate:function(e){Xr(e,hw,{type:n})},onValid:function(e){Xr(e,mw,{type:n,value:_l.getValue(e)})},onInvalid:function(e){Xr(e,gw,{type:n,value:_l.getValue(e)})}},validator:{validate:function(t){return t=_l.getValue(t),t=r(t)?we.value(!0):we.error(e("aria.input.invalid")),Xb.pure(t)},validateOnLoad:!1}})},l=Dm({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return af({factory:function(){function n(e){return g[e]().get()}function s(e,t){"hex"!==(t=t.event()).type()?h(t.type(),ye.none()):i(e)}function f(e,t,n){n=parseInt(n,10),h(t,ye.some(n)),p().each((function(t){var n,r;n=e,r=Ph(t),dw.getField(n,"hex").each((function(e){am.isFocused(e)||_l.setValue(n,{hex:r.value()})})),c(e,r)}))}function d(e,t){var n,o,i;"hex"===(t=t.event()).type()?(n=e,o=t.value(),r(n),i=Dh(o),h("hex",ye.some(o)),o=Th(i),u(n,o),v(o),Xr(n,by(),{hex:i}),c(n,i)):f(e,t.type(),t.value())}function m(t){return{label:e(pw+t+".label"),description:e(pw+t+".description")}}var g={red:o(mn(ye.some(255))),green:o(mn(ye.some(255))),blue:o(mn(ye.some(255))),hex:o(mn(ye.some("ffffff")))},h=function(e,t){g[e]().set(t)},p=function(){return n("red").bind((function(e){return n("green").bind((function(t){return n("blue").map((function(n){return Vh(e,t,n,1)}))}))}))},v=function(e){var t=e.red(),n=e.green();e=e.blue();h("red",ye.some(t)),h("green",ye.some(n)),h("blue",ye.some(e))},b=m("red"),y=m("green"),w=m("blue"),x=m("hex");return ut(dw.sketch((function(n){return{dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[n.field("red",Vb.sketch(a(kh,"red",b.label,b.description,255))),n.field("green",Vb.sketch(a(kh,"green",y.label,y.description,255))),n.field("blue",Vb.sketch(a(kh,"blue",w.label,w.description,255))),n.field("hex",Vb.sketch(a(Sh,"hex",x.label,x.description,"ffffff"))),l.asSpec()],formBehaviours:ac([Kb.config({invalidClass:t("form-invalid")}),im("rgb-form-events",[Xo(mw,d),Xo(gw,s),Xo(hw,s)])])}})),{apis:{updateHex:function(e,t){_l.setValue(e,{hex:t.value()});var n=e,r=t;r=Th(r),u(n,r),v(r),c(e,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(e,t,n){e.updateHex(t,n)}},extraApis:{}})},bw=function(e,t){function n(e,t){var n=e.width,r=e.height;null!==(e=e.getContext("2d"))&&(e.fillStyle=t,e.fillRect(0,0,n,r),(t=e.createLinearGradient(0,0,n,0)).addColorStop(0,"rgba(255,255,255,1)"),t.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=t,e.fillRect(0,0,n,r),(t=e.createLinearGradient(0,0,0,r)).addColorStop(0,"rgba(0,0,0,0)"),t.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=t,e.fillRect(0,0,n,r))}var r=cw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),i=cw.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:"<div class="+t("sv-palette-inner-thumb")+' role="presentation"></div>'}});return af({factory:function(e){var a=o({x:o(0),y:o(0)}),u=ac([Od.config({find:ye.some}),am.config({})]);return cw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:a},rounded:!1,components:[r,i],onChange:function(e,t,n){Xr(e,wy(),{value:n})},onInit:function(e,t,r,o){n(r.element().dom(),Oh(Wh()))},sliderBehaviours:u})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(e,t,r){var o=t;o=t.components()[0].element().dom(),n(o,Oh(r))}},extraApis:{}})},yw=function(e,t){return af({name:"ColourPicker",configFields:[on("dom"),ln("onValidHex",n),ln("onInvalidHex",n)],factory:function(n){function r(e,t){d.getOpt(e).each((function(e){var n=Th(t);f.paletteRgba().set(n),l.setRgba(e,n)}))}function i(e,t){m.getOpt(e).each((function(e){s.updateHex(e,t)}))}function a(e,t,n){Pe(n,(function(n){n(e,t)}))}var u,c,s=vw(e,t,n.onValidHex,n.onInvalidHex),l=bw(e,t),f={paletteRgba:o(mn(Wh()))},d=Dm(l.sketch({})),m=Dm(s.sketch({}));return{uid:n.uid,dom:n.dom,components:[d.asSpec(),sw(e,t),m.asSpec()],behaviours:ac([im("colour-picker-events",[Xo(wy(),(c=[i],function(e,t){t=t.event().value();var n=function(e){var t=0,n=e.red()/255,r=e.green()/255,o=(e=e.blue()/255,Math.min(n,Math.min(r,e))),i=Math.max(n,Math.max(r,e));if(o===i)return vy(0,0,100*(t=o));var a=n===o?3:e===o?1:5,u=(i-o)/i;t=i;return vy(Math.round(60*(a-(n===o?r-e:e===o?n-r:e-n)/(i-o))),Math.round(100*u),Math.round(100*t))}(f.paletteRgba().get());n=vy(n.hue(),t.x(),100-t.y()),t=Uh(n),n=Ph(t);a(e,n,c)})),Xo(yy(),(u=[r,i],function(e,t){t=function(e){return e=vy((100-e)/100*360,100,100),e=Uh(e),Ph(e)}(t.event().value().y()),a(e,t,u)}))]),Od.config({find:function(e){return m.getOpt(e)}}),nm.config({mode:"acyclic"})])}}})},ww=function(){return Od.config({find:ye.some})},xw=function(e){return Od.config({find:e.getOpt})},Cw=function(e){return Od.config({find:function(t){return ci(t.element(),e).bind((function(e){return t.getSystem().getByDom(e).toOption()}))}})},Sw={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},kw=function(e){return Sw[e]},Tw=tinymce.util.Tools.resolve("tinymce.Resource"),Ew=zt([ln("preprocess",i),ln("postprocess",i)]),Ow={memento:function(e,t){var n=Yt("RepresentingConfigs.memento processors",Ew,t);return _l.config({store:{mode:"manual",getValue:function(t){return t=e.get(t),t=_l.getValue(t),n.postprocess(t)},setValue:function(t,r){r=n.preprocess(r),t=e.get(t),_l.setValue(t,r)}}})},withElement:fb,withComp:lb,domValue:function(e){return fb(e,la,fa)},domHtml:function(e){return fb(e,go,ho)},memory:function(e){return _l.config({store:{mode:"memory",initialValue:e}})}},Nw=".jpg,.jpeg,.png,.gif",Aw=Oi("alloy-fake-before-tabstop"),Dw=Oi("alloy-fake-after-tabstop"),_w={isPseudoStop:function(e){return Vp(e,["."+Aw,"."+Dw].join(","),o(!1))},onFocus:function(e,t){t=t.element(),Zi(t,Aw)?gb(e,!0):Zi(t,Dw)&&gb(e,!1)},craft:function(e){return{dom:{tag:"div",classes:["tox-navobj"]},components:[mb([Aw]),e,mb([Dw])],behaviours:ac([Cw(1)])}}},Rw=!(Xn().browser.isIE()||Xn().browser.isEdge());function Bw(e,n){return zw(t.document.createElement("canvas"),e,n)}function Mw(e){var t=Bw(e.width,e.height);return Pw(t).drawImage(e,0,0),t}function Pw(e){return e.getContext("2d")}function zw(e,t,n){return e.width=t,e.height=n,e}function Iw(e){return e.naturalWidth||e.width}function Lw(e){return e.naturalHeight||e.height}var Fw,Hw,Vw=window.Promise||(Fw=Uw.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){t.setTimeout(e,1)},Hw=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Uw.prototype.catch=function(e){return this.then(null,e)},Uw.prototype.then=function(e,t){var n=this;return new Uw((function(r,o){Ww.call(n,new Xw(e,t,r,o))}))},Uw.all=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Array.prototype.slice.call(1===e.length&&Hw(e[0])?e[0]:e);return new Uw((function(e,t){if(0===n.length)return e([]);for(var r=n.length,o=0;o<n.length;o++)!function o(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,(function(e){o(i,e)}),t)}n[i]=a,0==--r&&e(n)}catch(a){t(a)}}(o,n[o])}))},Uw.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Uw?e:new Uw((function(t){t(e)}))},Uw.reject=function(e){return new Uw((function(t,n){n(e)}))},Uw.race=function(e){return new Uw((function(t,n){for(var r=0,o=e;r<o.length;r++)o[r].then(t,n)}))},Uw);function Uw(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],Yw(e,jw(qw,this),jw($w,this))}function jw(e,t){return function(){return e.apply(t,arguments)}}function Ww(e){var t=this;null===this._state?this._deferreds.push(e):Fw((function(){var n,r=t._state?e.onFulfilled:e.onRejected;if(null===r)(t._state?e.resolve:e.reject)(t._value);else{try{n=r(t._value)}catch(n){return void e.reject(n)}e.resolve(n)}}))}function qw(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void Yw(jw(t,e),jw(qw,this),jw($w,this))}this._state=!0,this._value=e,Gw.call(this)}catch(e){$w.call(this,e)}}function $w(e){this._state=!1,this._value=e,Gw.call(this)}function Gw(){for(var e=0,t=this._deferreds;e<t.length;e++){var n=t[e];Ww.call(this,n)}this._deferreds=[]}function Xw(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function Yw(e,t,n){var r=!1;try{e((function(e){r||(r=!0,t(e))}),(function(e){r||(r=!0,n(e))}))}catch(e){if(r)return;r=!0,n(e)}}function Kw(e){return new Vw((function(n,r){(function(e){if(e=e.split(","),!(n=/data:([^;]+)/.exec(e[0])))return ye.none();for(var n=n[1],r=(e=e[1],t.atob(e)),o=r.length,i=Math.ceil(o/1024),a=new Array(i),u=0;u<i;++u){for(var c=1024*u,s=Math.min(1024+c,o),l=new Array(s-c),f=c,d=0;f<s;++d,++f)l[d]=r[f].charCodeAt(0);a[u]=new Uint8Array(l)}return ye.some(new t.Blob(a,{type:n}))})(e).fold((function(){r("uri is not base64: "+e)}),n)}))}function Jw(e,n,r){return n=n||"image/png",t.HTMLCanvasElement.prototype.toBlob?new Vw((function(t,o){e.toBlob((function(e){e?t(e):o()}),n,r)})):Kw(e.toDataURL(n,r))}function Zw(e){return n=e,new Vw((function(e,r){var o=t.URL.createObjectURL(n),i=new t.Image,a=function(){i.removeEventListener("load",u),i.removeEventListener("error",c)};function u(){a(),e(i)}function c(){a(),r("Unable to load data of type "+n.type+": "+o)}i.addEventListener("load",u),i.addEventListener("error",c),i.src=o,i.complete&&u()})).then((function(e){t.URL.revokeObjectURL(e.src);var n=Bw(Iw(e),Lw(e));return Pw(n).drawImage(e,0,0),n}));var n}function Qw(e,t,n){var r=t.type;function i(t,n){return e.then((function(e){return e.toDataURL(t||"image/png",n)}))}return{getType:o(r),toBlob:function(){return Vw.resolve(t)},toDataURL:function(){return n},toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then((function(e){return Jw(e,t,n)}))},toAdjustedDataURL:i,toAdjustedBase64:function(e,t){return i(e,t).then((function(e){return e.split(",")[1]}))},toCanvas:function(){return e.then(Mw)}}}function ex(e){return n=e,new Vw((function(e){var r=new t.FileReader;r.onloadend=function(){e(r.result)},r.readAsDataURL(n)})).then((function(t){return Qw(Zw(e),e,t)}));var n}function tx(e,t){return Jw(e,t).then((function(t){return Qw(Vw.resolve(e),t,e.toDataURL())}))}var nx=ex;function rx(e,t,n){return e="string"==typeof e?parseFloat(e):e,n<e?e=n:e<t&&(e=t),e}function ox(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}var ix=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function ax(e,t){for(var n=[],r=new Array(25),o=0;o<5;o++){for(var i=0;i<5;i++)n[i]=t[i+5*o];for(i=0;i<5;i++){for(var a=0,u=0;u<5;u++)a+=e[i+5*u]*n[u];r[i+5*o]=a}}return r}function ux(e,t){return e.toCanvas().then((function(n){var r=e.getType(),o=t,i=Pw(n);return o=function(e,t){for(var n,r,o,i,a=e.data,u=t[0],c=t[1],s=t[2],l=t[3],f=t[4],d=t[5],m=t[6],g=t[7],h=t[8],p=t[9],v=t[10],b=t[11],y=t[12],w=t[13],x=t[14],C=t[15],S=t[16],k=t[17],T=t[18],E=t[19],O=0;O<a.length;O+=4)n=a[O],r=a[O+1],o=a[O+2],i=a[O+3],a[O]=n*u+r*c+o*s+i*l+f,a[O+1]=n*d+r*m+o*g+i*h+p,a[O+2]=n*v+r*b+o*y+i*w+x,a[O+3]=n*C+r*S+o*k+i*T+E;return e}(i.getImageData(0,0,n.width,n.height),o),i.putImageData(o,0,0),tx(n,r)}))}function cx(e,t){return e.toCanvas().then((function(n){return n=n,r=e.getType(),o=t,i=Pw(n),a=i.getImageData(0,0,n.width,n.height),u=i.getImageData(0,0,n.width,n.height),u=function(e,t,n){function r(e,t,n){return n<e?e=n:e<t&&(e=t),e}for(var o=Math.round(Math.sqrt(n.length)),i=Math.floor(o/2),a=e.data,u=t.data,c=e.width,s=e.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,h=0;h<o;h++)for(var p=0;p<o;p++){var v=r(f+p-i,0,c-1),b=(v=4*(r(l+h-i,0,s-1)*c+v),n[h*o+p]);d+=a[v]*b,m+=a[1+v]*b,g+=a[2+v]*b}var y=4*(l*c+f);u[y]=r(d,0,255),u[1+y]=r(m,0,255),u[2+y]=r(g,0,255)}return t}(a,u,o),i.putImageData(u,0,0),tx(n,r);var r,o,i,a,u}))}function sx(e){return function(t,n){return ux(t,e(ox(),n))}}lx=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1];var lx,fx,dx,mx=function(e){return ux(e,lx)},gx=sx((function(e,t){return ax(e,[1,0,0,0,t=rx(255*t,-255,255),0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])})),hx=sx((function(e,t){var n;return t=rx(t,-1,1),ax(e,[(n=(t*=100)<0?127+t/100*127:127*(n=0===(n=t%1)?ix[t]:ix[Math.floor(t)]*(1-n)+ix[Math.floor(t)+1]*n)+127)/127,0,0,0,.5*(127-n),0,n/127,0,0,.5*(127-n),0,0,n/127,0,.5*(127-n),0,0,0,1,0,0,0,0,0,1])})),px=(fx=[0,-1,0,-1,5,-1,0,-1,0],function(e){return cx(e,fx)}),vx=(dx=function(e,t){return 255*Math.pow(e/255,1-t)},function(e,t){return e.toCanvas().then((function(n){return bx(n,e.getType(),t)}))});function bx(e,t,n){for(var r=Pw(e),o=new Array(256),i=0;i<o.length;i++)o[i]=dx(i,n);var a=function(e,t){for(var n=e.data,r=0;r<n.length;r+=4)n[r]=t[n[r]],n[r+1]=t[n[r+1]],n[r+2]=t[n[r+2]];return e}(r.getImageData(0,0,e.width,e.height),o);return r.putImageData(a,0,0),tx(e,t)}function yx(e,t,n){var r,o,i,a=Iw(e),u=Lw(e),c=(a=t/a,u=n/u,!1);(a<.5||2<a)&&(a=a<.5?.5:2,c=!0),(u<.5||2<u)&&(u=u<.5?.5:2,c=!0),r=e,o=a,i=u,e=new Vw((function(e){var t=Iw(r),n=Lw(r),a=Math.floor(t*o),u=Math.floor(n*i),c=Bw(a,u);Pw(c).drawImage(r,0,0,t,n,0,0,a,u),e(c)}));return c?e.then((function(e){return yx(e,t,n)})):e}function wx(e,t){return e.toCanvas().then((function(n){var r=e.getType(),o=t,i=Bw(n.width,n.height),a=Pw(i),u=0,c=0;return 90!==(o=o<0?360+o:o)&&270!==o||zw(i,i.height,i.width),90!==o&&180!==o||(u=i.width),270!==o&&180!==o||(c=i.height),a.translate(u,c),a.rotate(o*Math.PI/180),a.drawImage(n,0,0),tx(i,r)}))}function xx(e,t){return e.toCanvas().then((function(n){var r=e.getType(),o=t,i=Bw(n.width,n.height),a=Pw(i);return"v"===o?(a.scale(1,-1),a.drawImage(n,0,-i.height)):(a.scale(-1,1),a.drawImage(n,-i.width,0)),tx(i,r)}))}function Cx(e,t,n,r,o){return e.toCanvas().then((function(i){var a=e.getType(),u=t,c=n,s=r;return Pw(s=Bw(s,o)).drawImage(i,-u,-c),tx(s,a)}))}function Sx(e,t){return d({dom:{tag:"span",innerHtml:e,classes:["tox-icon","tox-tbtn__icon-wrap"]}},t)}function kx(e){return"separator"===e.type}function Tx(e,t,n,r){var o=Oi("primary-menu");if(0===(e=nC(e,n.shared.providers.menuItems())).items.length)return ye.none();r=Jp(o,e.items,t,n,r);var i=Qe(e.menus,(function(e,r){return Jp(r,e,t,n,!1)}));i=ut(i,wt(o,r));return ye.from(Sm.tieredData(o,i,e.expansions))}function Ex(e){return{isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)},setActive:function(t){var n=e.element();t?(Yi(n,"tox-tbtn--enabled"),wi(n,"aria-pressed",!0)):(Ji(n,"tox-tbtn--enabled"),Si(n,"aria-pressed"))},isActive:function(){return Zi(e.element(),"tox-tbtn--enabled")}}}function Ox(e,t,n,r){return Jx({text:e.text,icon:e.icon,tooltip:e.tooltip,role:r,fetch:function(t){e.fetch((function(e){t(Tx(e,dh.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:e.onSetup,getApi:Ex,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Jb.config({})]},t,n.shared)}function Nx(e,t,n){return function(r){r(Me(e,(function(e){var r,o,i=e.text.fold((function(){return{}}),(function(e){return{text:e}}));return d(d({type:e.type},i),{onAction:function(e){n.shared.getSink().each((function(e){t().getOpt(e).each((function(e){dc(e.element()),Xr(e,Pb,{name:o.name,value:o.storage.get()})}))}));var r=!e.isActive();e.setActive(r),o.storage.set(r)},onSetup:(r=o=e,function(e){e.setActive(r.storage.get())})})})))}}function Ax(e,t,n,r){void 0===r&&(r=[]);var o={tag:"button",classes:["tox-tbtn"],attributes:e.tooltip.map((function(e){return{"aria-label":n.translate(e),title:n.translate(e)}})).getOr({})},i=e.icon.map((function(e){return Wx(e,n.icons)}));i=hh([i]);return rC(e,t,r,o,i)}function Dx(e,n){return function(r){"custom"===n?Xr(r,Pb,{name:e,value:{}}):"submit"===n?Gr(r,zb):"cancel"===n?Gr(r,Mb):t.console.error("Unknown button type: ",n)}}function _x(e,t){var n,r=Dx(e.name,"custom");return n=ye.none(),e=Vb.parts().field(d({factory:Am},iC(e,ye.some(r),t,[Ow.memory(""),ww()]))),Zb(n,e,[],[])}function Rx(e,t){return $l({factory:Vb,name:e,overrides:function(e){return{fieldBehaviours:ac([im("coupled-input-behaviour",[Xo(vr(),(function(n){Ql(n,e,t).bind(Od.getCurrent).each((function(t){Ql(n,e,"lock").each((function(r){sm.isOn(r)&&e.onLockedChange(n,t,r)}))}))}))])])}}})}function Bx(e,t){function r(e,n,r,o){return Dm(aC({name:e,text:e,disabled:r,primary:o,icon:ye.none(),borderless:!1},n,t))}function i(e,n,r,o){return Dm(oC({name:e,icon:ye.some(e),tooltip:ye.some(n),disabled:o,primary:!1,borderless:!1},r,t))}function a(e,t){e.map((function(e){e=e.get(t),e.hasConfigured(uh)&&uh.disable(e)}))}function u(e,t){e.map((function(e){e=e.get(t),e.hasConfigured(uh)&&uh.enable(e)}))}function c(e,t){x(e),w(e,gC.transform(),{transform:t}),C(e)}function s(e){return function(){X.getOpt(e).each((function(e){rm.set(e,[G])}))}}function l(e,t){x(e),w(e,gC.transformApply(),{transform:t,swap:s(e)}),C(e)}function f(){return Dm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ac([uh.config({})])})}function d(e,t){return function(n){return e(n,t)}}function m(e,t){t=t,x(e=e),w(e,gC.tempTransform(),{transform:t}),C(e)}function g(e,n,r,i,a){e=cw.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}});var u=cw.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),c=cw.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Dm(cw.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:a,getInitialValue:o({x:o(i)})},components:[e,u,c],sliderBehaviours:ac([am.config({})]),onChoose:n}))}function h(e,t,n,r,o){e=e,t=t,n=n,r=r,o=o;var i=[S(),z(e,t,n,r,o),k()];return Cb.sketch({dom:b,components:i.map((function(e){return e.asSpec()})),containerBehaviours:ac([im("image-tools-filter-panel-buttons-events",[Xo(hC.disable(),(function(e,t){a(i,e)})),Xo(hC.enable(),(function(e,t){u(i,e)}))])])})}function p(e){return g(e,(function(e,t,n){var r=V.getOpt(e),o=j.getOpt(e),i=U.getOpt(e);r.each((function(t){o.each((function(n){i.each((function(r){var o,i,a,u=_l.getValue(t).x()/100,s=(r=_l.getValue(r).x()/100,_l.getValue(n).x()/100);o=u,i=r,a=s,c(e,(function(e){return Ix(e,o,i,a)}))}))}))}))}),0,100,200)}function v(e,t,n){return function(r){w(r,gC.swap(),{transform:t,swap:function(){X.getOpt(r).each((function(t){rm.set(t,[e]),n(t)}))}})}}var b={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},y=n,w=function(e,t,n){Xr(e,t,n)},x=function(e){return Gr(e,hC.disable())},C=function(e){return Gr(e,hC.enable())},S=function(){return r("Back",(function(e){return w(e,gC.back(),{swap:s(e)})}),!1,!1)},k=function(){return r("Apply",(function(e){return w(e,gC.apply(),{swap:s(e)})}),!0,!0)},T=[S(),f(),r("Apply",(function(t){l(t,(function(t){var n=e.getRect();return Vx(t,n.x,n.y,n.w,n.h)})),e.hideCrop()}),!1,!0)],E=Cb.sketch({dom:b,components:T.map((function(e){return e.asSpec()})),containerBehaviours:ac([im("image-tools-crop-buttons-events",[Xo(hC.disable(),(function(e,t){a(T,e)})),Xo(hC.enable(),(function(e,t){u(T,e)}))])])}),O=Dm(mC({name:"size",label:ye.none(),constrain:!0,disabled:!1},t)),N=[S(),f(),O,f(),r("Apply",(function(e){O.getOpt(e).each((function(t){t=_l.getValue(t);var n,r,o=parseInt(t.width,10);t=parseInt(t.height,10);n=o,r=t,l(e,(function(e){return Ux(e,n,r)}))}))}),!1,!0)],A=Cb.sketch({dom:b,components:N.map((function(e){return e.asSpec()})),containerBehaviours:ac([im("image-tools-resize-buttons-events",[Xo(hC.disable(),(function(e,t){a(N,e)})),Xo(hC.enable(),(function(e,t){u(N,e)}))])])}),D=d(Hx,"h"),_=d(Hx,"v"),R=d(jx,-90),B=d(jx,90),M=[S(),f(),i("flip-horizontally","Flip horizontally",(function(e){m(e,D)}),!1),i("flip-vertically","Flip vertically",(function(e){m(e,_)}),!1),i("rotate-left","Rotate counterclockwise",(function(e){m(e,R)}),!1),i("rotate-right","Rotate clockwise",(function(e){m(e,B)}),!1),f(),k()],P=Cb.sketch({dom:b,components:M.map((function(e){return e.asSpec()})),containerBehaviours:ac([im("image-tools-fliprotate-buttons-events",[Xo(hC.disable(),(function(e,t){a(M,e)})),Xo(hC.enable(),(function(e,t){u(M,e)}))])])}),z=function(e,t,n,r,o){return g(e,(function(e,n,r){r=d(t,r.x()/100),c(e,r)}),n,r,o)},I=[S(),f(),k()],L=(I=Cb.sketch({dom:b,components:I.map((function(e){return e.asSpec()}))}),h("Brightness",Lx,-100,0,100)),F=h("Contrast",Fx,-100,0,100),H=h("Gamma",zx,-100,0,100),V=p("R"),U=p("G"),j=p("B"),W=[S(),V,U,j,k()],q=(W=Cb.sketch({dom:b,components:W.map((function(e){return e.asSpec()}))}),ye.some(Px)),$=ye.some(Mx),G=(E=[i("crop","Crop",v(E,ye.none(),(function(t){e.showCrop()})),!1),i("resize","Resize",v(A,ye.none(),(function(t){O.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width;n=n.height;_l.setValue(t,{width:r,height:n})}))})),!1),i("orientation","Orientation",v(P,ye.none(),y),!1),i("brightness","Brightness",v(L,ye.none(),y),!1),i("sharpen","Sharpen",v(I,q,y),!1),i("contrast","Contrast",v(F,ye.none(),y),!1),i("color-levels","Color levels",v(W,ye.none(),y),!1),i("gamma","Gamma",v(H,ye.none(),y),!1),i("invert","Invert",v(I,$,y),!1)],Cb.sketch({dom:b,components:E.map((function(e){return e.asSpec()}))})),X=(A=Cb.sketch({dom:{tag:"div"},components:[G],containerBehaviours:ac([rm.config({})])}),Dm(A));return{memContainer:X,getApplyButton:function(e){return X.getOpt(e).map((function(e){return e=e.components()[0],e.components()[e.components().length-1]}))}}}var Mx=function(e){return mx(e)},Px=function(e){return px(e)},zx=function(e,t){return vx(e,t)},Ix=function(e,t,n,r){return ux(e,(e=ox(),n=n,r=r,ax(e,[rx(t,0,2),0,0,0,0,0,n=rx(n,0,2),0,0,0,0,0,r=rx(r,0,2),0,0,0,0,0,1,0,0,0,0,0,1])))},Lx=function(e,t){return gx(e,t)},Fx=function(e,t){return hx(e,t)},Hx=xx,Vx=Cx,Ux=function(e,t,n){return o=t,i=n,(r=e).toCanvas().then((function(e){return yx(e,o,i).then((function(e){return tx(e,r.getType())}))}));var r,o,i},jx=wx,Wx=function(e,t){return Sx(Rm(e,t),{})},qx=function(e,t){return Sx(Rm(e,t),{behaviours:ac([rm.config({})])})},$x=function(e,t,n){return{dom:{tag:"span",innerHtml:n.translate(e),classes:[t+"__select-label"]},behaviours:ac([rm.config({})])}},Gx=Oi("toolbar.button.execute"),Xx={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},Yx=Oi("update-menu-text"),Kx=Oi("update-menu-icon"),Jx=function(e,t,r){function o(e,t){return e=_l.getValue(e),am.focus(e),Xr(e,"keydown",{raw:t.event().raw()}),dy.close(e),ye.some(!0)}var i=mn(n),a=e.text.map((function(e){return Dm($x(e,t,r.providers))})),u=e.icon.map((function(e){return Dm(qx(e,r.providers.icons))})),c=e.role.fold((function(){return{}}),(function(e){return{role:e}})),s=e.tooltip.fold((function(){return{}}),(function(e){return e=r.providers.translate(e),{title:e,"aria-label":e}}));return Dm(dy.sketch(d(d({},c),{dom:{tag:"button",classes:[t,t+"--select"].concat(Me(e.classes,(function(e){return t+"--"+e}))),attributes:d({},s)},components:hh([u.map((function(e){return e.asSpec()})),a.map((function(e){return e.asSpec()})),ye.some({dom:{tag:"div",classes:[t+"__select-chevron"],innerHtml:Rm("chevron-down",r.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ac(g(e.dropdownBehaviours,[ch.button(e.disabled),my.config({}),rm.config({}),im("dropdown-events",[lh(e,i),fh(e,i)]),im("menubutton-update-display-text",[Xo(Yx,(function(e,t){a.bind((function(t){return t.getOpt(e)})).each((function(e){rm.set(e,[ma(r.providers.translate(t.event().text()))])}))})),Xo(Kx,(function(e,t){u.bind((function(t){return t.getOpt(e)})).each((function(e){rm.set(e,[qx(t.event().icon(),r.providers.icons)])}))}))])])),eventOrder:ut(Xx,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ac([nm.config({mode:"special",onLeft:o,onRight:o})]),lazySink:r.getSink,toggleClass:t+"--active",parts:{menu:Ap(!1,e.columns,e.presets)},fetch:function(){return Xb.nu(e.fetch)}}))).asSpec()},Zx={type:"separator"},Qx=function(e,t){return e=Fe(e,(function(e,n){return xe(n)?""===n?e:"|"===n?0<e.length&&!kx(e[e.length-1])?e.concat([Zx]):e:ot(t,n.toLowerCase())?e.concat([t[n.toLowerCase()]]):e:e.concat([n])}),[]),0<e.length&&kx(e[e.length-1])&&e.pop(),e},eC=function(e,t){return ot(e,"getSubmenuItems")?(t=t,r=(n=e).getSubmenuItems(),r=nC(r,t),{item:n,menus:ut(r.menus,wt(n.value,r.items)),expansions:ut(r.expansions,wt(n.value,n.value))}):{item:e,menus:{},expansions:{}};var n,r},tC=function(e){var t;return kx(e)?e:(t=yt(e,"value").getOrThunk((function(){return Oi("generated-menu-item")})),ut({value:t},e))},nC=function(e,t){return e=Qx(xe(e)?e.split(" "):e,t),Le(e,(function(e,n){return n=tC(n),n=eC(n,t),{menus:ut(e.menus,n.menus),items:[n.item].concat(e.items),expansions:ut(e.expansions,n.expansions)}}),{menus:{},expansions:{},items:[]})},rC=function(e,t,n,r,o){return void 0===n&&(n=[]),t=t.fold((function(){return{}}),(function(e){return{action:e}})),e=d({buttonBehaviours:ac([ch.button(e.disabled),Jb.config({}),im("button press",[ro("click"),ro("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},t),n=ut(e,{dom:r}),ut(n,{components:o})},oC=function(e,t,n,r){return void 0===r&&(r=[]),e=Ax(e,ye.some(t),n,r),Am.sketch(e)},iC=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(e.text),a=e.icon?e.icon.map((function(e){return Wx(e,n.icons)})):ye.none(),u=a.isSome()?hh([a]):[],c=a.isSome()?{}:{innerHtml:i};a=g(e.primary||e.borderless?["tox-button"]:["tox-button","tox-button--secondary"],a.isSome()?["tox-button--icon"]:[],e.borderless?["tox-button--naked"]:[],o),o=d(d({tag:"button",classes:a},c),{attributes:{title:i}});return rC(e,t,r,o,u)},aC=function(e,t,n,r,o){return void 0===r&&(r=[]),void 0===o&&(o=[]),e=iC(e,ye.some(t),n,r,o),Am.sketch(e)},uC=function(e,n,r){var o,i,a;return"menu"===n?(a=d(d({},a=e),{fetch:Nx(a.items,(function(){return o}),r)}),(o=Dm(Ox(a,"tox-tbtn",r,ye.none()))).asSpec()):"custom"===(a=n)||"cancel"===a||"submit"===a?(i=Dx(e.name,n),e=d(d({},e),{borderless:!1}),aC(e,i,r.shared.providers,[])):void t.console.error("Unknown footer button type: ",n)},cC=(Yn=o([ln("field1Name","field1"),ln("field2Name","field2"),Ea("onLockedChange"),Ca(["lockClass"]),ln("locked",!1),Ml.field("coupledFieldBehaviours",[Od,_l])]),Wl=o([Rx("field1","field2"),Rx("field2","field1"),$l({factory:Am,schema:[on("dom")],name:"lock",overrides:function(e){return{buttonBehaviours:ac([sm.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])}}})]),uf({name:"FormCoupledInputs",configFields:Yn(),partFields:Wl(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:Ml.augment(e.coupledFieldBehaviours,[Od.config({find:ye.some}),_l.config({store:{mode:"manual",getValue:function(t){t=Ts(t,e,["field1","field2"]);var n={};return n[e.field1Name]=_l.getValue(t.field1()),n[e.field2Name]=_l.getValue(t.field2()),n},setValue:function(t,n){t=Ts(t,e,["field1","field2"]),St(n,e.field1Name)&&_l.setValue(t.field1(),n[e.field1Name]),St(n,e.field2Name)&&_l.setValue(t.field2(),n[e.field2Name])}}})]),apis:{getField1:function(t){return Ql(t,e,"field1")},getField2:function(t){return Ql(t,e,"field2")},getLock:function(t){return Ql(t,e,"lock")}}}},apis:{getField1:function(e,t){return e.getField1(t)},getField2:function(e,t){return e.getField2(t)},getLock:function(e,t){return e.getLock(t)}}})),sC=function(e){var t,n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(e);return null!==n?(t=parseFloat(n[1]),n=n[2],we.value({value:t,unit:n})):we.error(e)},lC=function(e,t){function n(e){return Object.prototype.hasOwnProperty.call(r,e)}var r={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1};return e.unit===t?ye.some(e.value):n(e.unit)&&n(t)?r[e.unit]===r[t]?ye.some(e.value):ye.some(e.value/r[e.unit]*r[t]):ye.none()},fC=function(e){return ye.none()},dC=function(e,t){return function(n){return lC(n,t).map((function(n){return{value:n*e,unit:t}}))}},mC=function(e,t){function n(e){return{dom:{tag:"div",classes:["tox-form__group"]},components:e}}function r(t){return Vb.parts().field({factory:jb,inputClasses:["tox-textfield"],inputBehaviours:ac([uh.config({disabled:e.disabled}),Jb.config({}),im("size-input-events",[Xo(mr(),(function(e,n){Xr(e,a,{isField1:t})})),Xo(br(),(function(t,n){Xr(t,Rb,{name:e.name})}))])]),selectOnFocus:!1})}function o(e){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}}}var i=fC,a=Oi("ratio-event"),u=cC.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(e.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:Rm("lock",t.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:Rm("unlock",t.icons)}}],buttonBehaviours:ac([ch.button(e.disabled),Jb.config({})])}),c=cC.parts().field1(n([Vb.parts().label(o("Width")),r(!0)])),s=cC.parts().field2(n([Vb.parts().label(o("Height")),r(!1)]));return cC.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,n([o(" "),u])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(e,t,n){sC(_l.getValue(e)).each((function(e){i(e).each((function(e){var n,r;_l.setValue(t,(r={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},(r=-1!==(r=(e=e).value.toFixed((n=e.unit)in r?r[n]:1)).indexOf(".")?r.replace(/\.?0*$/,""):r)+e.unit))}))}))},coupledFieldBehaviours:ac([uh.config({disabled:e.disabled,onDisabled:function(e){cC.getField1(e).bind(Vb.getField).each(uh.disable),cC.getField2(e).bind(Vb.getField).each(uh.disable),cC.getLock(e).each(uh.disable)},onEnabled:function(e){cC.getField1(e).bind(Vb.getField).each(uh.enable),cC.getField2(e).bind(Vb.getField).each(uh.enable),cC.getLock(e).each(uh.enable)}}),im("size-input-events2",[Xo(a,(function(e,t){t=t.event().isField1();var n=t?cC.getField1(e):cC.getField2(e);t=t?cC.getField2(e):cC.getField1(e),e=n.map(_l.getValue).getOr(""),n=t.map(_l.getValue).getOr("");i=function(e,t){return e=sC(e).toOption(),t=sC(t).toOption(),ku(e,t,(function(e,t){return lC(e,t.unit).map((function(e){return t.value/e})).map((function(e){return dC(e,t.unit)})).getOr(fC)})).getOr(fC)}(e,n)}))])])})},gC={undo:o(Oi("undo")),redo:o(Oi("redo")),zoom:o(Oi("zoom")),back:o(Oi("back")),apply:o(Oi("apply")),swap:o(Oi("swap")),transform:o(Oi("transform")),tempTransform:o(Oi("temp-transform")),transformApply:o(Oi("transform-apply"))},hC=(ql=o("save-state"),em=o("disable"),Pu=o("enable"),{formActionEvent:Pb,saveState:ql,disable:em,enable:Pu}),pC=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),vC=tinymce.util.Tools.resolve("tinymce.geom.Rect"),bC=tinymce.util.Tools.resolve("tinymce.util.Observable"),yC=tinymce.util.Tools.resolve("tinymce.util.Tools"),wC=tinymce.util.Tools.resolve("tinymce.util.VK");function xC(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function CC(e,n){var r,o,i,a,u=n.document||t.document,c=(n=n||{},u.getElementById(n.handle||e)),s=(e=function(e){f=u,d=Math.max,m=f.documentElement,f=f.body,v=d(m.scrollWidth,f.scrollWidth),p=d(m.clientWidth,f.clientWidth),b=d(m.offsetWidth,f.offsetWidth),g=d(m.scrollHeight,f.scrollHeight),h=d(m.clientHeight,f.clientHeight);var f,d,m,g,h,p,v,b={width:v<b?p:v,height:g<d(m.offsetHeight,f.offsetHeight)?h:g};xC(e),e.preventDefault(),o=e.button,p=c,i=e.screenX,a=e.screenY,v=t.window.getComputedStyle?t.window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,r=pC("<div></div>").css({position:"absolute",top:0,left:0,width:b.width,height:b.height,zIndex:2147483647,opacity:1e-4,cursor:v}).appendTo(u.body),pC(u).on("mousemove touchmove",s).on("mouseup touchend",l),n.start(e)},function(e){if(xC(e),e.button!==o)return l(e);e.deltaX=e.screenX-i,e.deltaY=e.screenY-a,e.preventDefault(),n.drag(e)}),l=function(e){xC(e),pC(u).off("mousemove touchmove",s).off("mouseup touchend",l),r.remove(),n.stop&&n.stop(e)};this.destroy=function(){pC(c).off()},pC(c).on("mousedown touchstart",e)}function SC(e){function t(e,t){s.getOpt(e).each((function(e){var n=o.get(),u=nu(e.element()),c=Ya(e.element()),s=t.dom().naturalWidth*n,l=t.dom().naturalHeight*n,f=Math.max(0,u/2-s/2),d=Math.max(0,c/2-l/2),m={left:f.toString()+"px",top:d.toString()+"px",width:s.toString()+"px",height:l.toString()+"px",position:"absolute"};ia(t,m),r.getOpt(e).each((function(e){ia(e.element(),m)})),i.get().each((function(e){var t=a.get();e.setRect({x:t.x*n+f,y:t.y*n+d,w:t.w*n,h:t.h*n}),e.setClampRect({x:f,y:d,w:s,h:l}),e.setViewPortRect({x:0,y:0,w:u,h:c})}))}))}function n(e,n){var r=gn.fromTag("img");return wi(r,"src",n),EC(r.dom()).then((function(){return s.getOpt(e).map((function(e){var n,i=ga({element:r}),c=(i=(rm.replaceAt(e,1,ye.some(i)),u.get()),{x:0,y:0,w:r.dom().naturalWidth,h:r.dom().naturalHeight}),l=(u.set(c),vC.inflate(c,-20,-20));return a.set(l),i.w===c.w&&i.h===c.h||(n=r,s.getOpt(e).each((function(e){var t=nu(e.element()),r=(e=Ya(e.element()),n.dom().naturalWidth),i=n.dom().naturalHeight;t=Math.min(t/r,e/i);1<=t?o.set(1):o.set(t)}))),t(e,r),r}))}))}var r=Dm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),o=mn(1),i=mn(ye.none()),a=mn({x:0,y:0,w:1,h:1}),u=mn({x:0,y:0,w:1,h:1}),c=Cb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[r.asSpec(),{dom:{tag:"img",attributes:{src:e}}},{dom:{tag:"div"},behaviours:ac([im("image-panel-crop-events",[Zo((function(e){s.getOpt(e).each((function(e){e=e.element().dom(),e=TC.create({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},e,(function(){})),e.toggleVisibility(!1),e.on("updateRect",(function(e){e=e.rect;var t=o.get();e={x:Math.round(e.x/t),y:Math.round(e.y/t),w:Math.round(e.w/t),h:Math.round(e.h/t)};a.set(e)})),i.set(ye.some(e))}))}))])])}],containerBehaviours:ac([rm.config({}),im("image-panel-events",[Zo((function(t){n(t,e)}))])])}),s=Dm(c);return{memContainer:s,updateSrc:n,zoom:function(e,n){var r=o.get();n=0<n?Math.min(2,r+.1):Math.max(.1,r-.1);o.set(n),s.getOpt(e).each((function(e){var n=e.components()[1].element();t(e,n)}))},showCrop:function(){i.get().each((function(e){e.toggleVisibility(!0)}))},hideCrop:function(){i.get().each((function(e){e.toggleVisibility(!1)}))},getRect:function(){return a.get()},getMeasurements:function(){var e=u.get();return{width:e.w,height:e.h}}}}var kC=0,TC={create:function(e,t,n,r,o){function i(e,t){return{x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}}var a,u,c="tox-",s="tox-crid-"+kC++,l=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],f=["top","right","bottom","left"],d=function(e,t){return{x:t.x-e.x,y:t.y-e.y,w:t.w,h:t.h}};function m(t,r,o,i){var u=r.x,c=r.y,s=r.w;r=r.h;u+=o*t.deltaX,c+=i*t.deltaY,s+=o*t.deltaW,r+=i*t.deltaH,e=vC.clamp({x:u,y:c,w:s=s<20?20:s,h:r=r<20?20:r},n,"move"===t.name),o=d(n,e),a.fire("updateRect",{rect:o}),p(o)}function g(e){function n(e,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),pC("#"+s+"-"+e,r).css({left:t.x,top:t.y,width:t.w,height:t.h})}yC.each(l,(function(t){pC("#"+s+"-"+t.name,r).css({left:e.w*t.xMul+e.x,top:e.h*t.yMul+e.y})})),n("top",{x:t.x,y:t.y,w:t.w,h:e.y-t.y}),n("right",{x:e.x+e.w,y:e.y,w:t.w-e.x-e.w+t.x,h:e.h}),n("bottom",{x:t.x,y:e.y+e.h,w:t.w,h:t.h-e.y-e.h+t.y}),n("left",{x:t.x,y:e.y,w:e.x-t.x,h:e.h}),n("move",e)}function h(t){g(e=t)}function p(e){h(i(n,e))}return pC('<div id="'+s+'" class="'+c+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(r),yC.each(f,(function(e){pC("#"+s,r).append('<div id="'+s+"-"+e+'"class="'+c+'croprect-block" style="display: none" data-mce-bogus="all">')})),yC.each(l,(function(e){pC("#"+s,r).append('<div id="'+s+"-"+e.name+'" class="'+c+"croprect-handle "+c+"croprect-handle-"+e.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+e.label+'" aria-grabbed="false" title="'+e.label+'">')})),u=yC.map(l,(function(t){var n;return new CC(s,{document:r.ownerDocument,handle:s+"-"+t.name,start:function(){n=e},drag:function(e){m(t,n,e.deltaX,e.deltaY)}})})),g(e),pC(r).on("focusin focusout",(function(e){pC(e.target).attr("aria-grabbed","focus"===e.type?"true":"false")})),pC(r).on("keydown",(function(t){var n;function r(e,t,r,o,i){e.stopPropagation(),e.preventDefault(),m(n,r,o,i)}switch(yC.each(l,(function(e){if(t.target.id===s+"-"+e.name)return n=e,!1})),t.keyCode){case wC.LEFT:r(t,0,e,-10,0);break;case wC.RIGHT:r(t,0,e,10,0);break;case wC.UP:r(t,0,e,0,-10);break;case wC.DOWN:r(t,0,e,0,10);break;case wC.ENTER:case wC.SPACEBAR:t.preventDefault(),o()}})),a=yC.extend({toggleVisibility:function(e){var t=yC.map(l,(function(e){return"#"+s+"-"+e.name})).concat(yC.map(f,(function(e){return"#"+s+"-"+e}))).join(",");e?pC(t,r).show():pC(t,r).hide()},setClampRect:function(t){n=t,g(e)},setRect:h,getInnerRect:function(){return d(n,e)},setInnerRect:p,setViewPortRect:function(n){t=n,g(e)},destroy:function(){yC.each(u,(function(e){e.destroy()})),u=[]}},bC)}},EC=function(e){return new bg((function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)}))},OC=function(e,t,n,r,o){return oC({name:e,icon:ye.some(t),disabled:n,tooltip:ye.some(e),primary:!1,borderless:!1},r,o)},NC=function(e,t){t?uh.enable(e):uh.disable(e)};function AC(){var e=[],t=-1;function n(){return 0<t}function r(){return-1!==t&&t<e.length-1}return{data:e,add:function(n){var r=e.splice(++t);return e.push(n),{state:n,removed:r}},undo:function(){if(0<t)return e[--t]},redo:function(){if(r())return e[++t]},canUndo:n,canRedo:r}}function DC(e){function n(e){a.set(e)}function r(e){return{blob:e,url:t.URL.createObjectURL(e)}}function o(){u.get().each(s),u.set(ye.none())}function i(e){e=r(e);var t=(n(e),c.add(e).removed);return yC.each(t,s),e.url}var a=mn(e),u=mn(ye.none()),c=AC(),s=(c.add(e),function(e){t.URL.revokeObjectURL(e.url)});return{getBlobState:function(){return a.get()},setBlobState:n,addBlobState:i,getTempState:function(){return u.get().fold((function(){return a.get()}),(function(e){return e}))},updateTempState:function(e){return e=r(e),o(),u.set(ye.some(e)),e.url},addTempState:function(e){return e=r(e),u.set(ye.some(e)),e.url},applyTempState:function(e){return u.get().fold((function(){}),(function(t){i(t.blob),e()}))},destroyTempState:o,undo:function(){var e=c.undo();return n(e),e.url},redo:function(){var e=c.redo();return n(e),e.url},getHistoryStates:function(){return{undoEnabled:c.canUndo(),redoEnabled:c.canRedo()}}}}function _C(e,r){function o(e){return e.toBlob()}function i(e,t,n){var r=c.getBlobState().blob;m(e,r,t,(function(e){return c.updateTempState(e)}),n)}var a,u,c=DC(e.currentState),s=function(e){var t=c.getHistoryStates();p.updateButtonUndoStates(e,t.undoEnabled,t.redoEnabled),Xr(e,hC.formActionEvent,{name:hC.saveState(),value:t.undoEnabled})},l=function(e){Xr(e,hC.formActionEvent,{name:hC.disable(),value:{}})},f=function(e){v.getApplyButton(e).each((function(e){uh.enable(e)})),Xr(e,hC.formActionEvent,{name:hC.enable(),value:{}})},d=function(e,t){return l(e),h.updateSrc(e,t)},m=function(e,n,r,i,a){return l(e),nx(n).then(r).then(o).then(i).then((function(t){return d(e,t).then((function(t){return s(e),a(),f(e),t}))})).catch((function(n){return t.console.log(n),f(e),n}))},g=function(e){var t=c.getBlobState().url;return c.destroyTempState(),s(e),t},h=SC(e.currentState.url),p=(a=Dm(OC("Undo","undo",!0,(function(e){Xr(e,gC.undo(),{direction:1})}),e=r)),u=Dm(OC("Redo","redo",!0,(function(e){Xr(e,gC.redo(),{direction:1})}),e)),{container:Cb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[a.asSpec(),u.asSpec(),OC("Zoom in","zoom-in",!1,(function(e){Xr(e,gC.zoom(),{direction:1})}),e),OC("Zoom out","zoom-out",!1,(function(e){Xr(e,gC.zoom(),{direction:-1})}),e)]}),updateButtonUndoStates:function(e,t,n){a.getOpt(e).each((function(e){NC(e,t)})),u.getOpt(e).each((function(e){NC(e,n)}))}}),v=Bx(h,r);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[v.memContainer.asSpec(),h.memContainer.asSpec(),p.container],behaviours:ac([_l.config({store:{mode:"manual",getValue:function(){return c.getBlobState()}}}),im("image-tools-events",[Xo(gC.undo(),(function(e,t){var n=c.undo();d(e,n).then((function(t){f(e),s(e)}))})),Xo(gC.redo(),(function(e,t){var n=c.redo();d(e,n).then((function(t){f(e),s(e)}))})),Xo(gC.zoom(),(function(e,t){t=t.event().direction(),h.zoom(e,t)})),Xo(gC.back(),(function(e,t){var n;e=g(n=e),d(n,e).then((function(e){f(n)})),t.event().swap()(),h.hideCrop()})),Xo(gC.apply(),(function(e,t){c.applyTempState((function(){g(e),t.event().swap()()}))})),Xo(gC.transform(),(function(e,t){return i(e,t.event().transform(),n)})),Xo(gC.tempTransform(),(function(e,t){var r;e=e,t=t.event().transform(),r=c.getTempState().blob,m(e,r,t,(function(e){return c.addTempState(e)}),n)})),Xo(gC.transformApply(),(function(e,t){var n,r;n=e,e=t.event().transform(),t=t.event().swap(),r=c.getBlobState().blob,m(n,r,e,(function(e){return e=c.addBlobState(e),g(n),e}),t)})),Xo(gC.swap(),(function(e,t){p.updateButtonUndoStates(e,!1,!1);var n=t.event().transform(),r=t.event().swap();n.fold((function(){r()}),(function(t){i(e,t,r)}))}))]),ww()])}}function RC(e,t){var n=e.label.map((function(e){return ty(e,t)})),r=[uh.config({disabled:e.disabled}),nm.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(e){return Gr(e,zb),ye.some(!0)}}),im("textfield-change",[Xo(vr(),(function(t,n){Xr(t,Rb,{name:e.name})})),Xo(kr(),(function(t,n){Xr(t,Rb,{name:e.name})}))]),Jb.config({})],i=e.validation.map((function(e){return Kb.config({getRoot:function(e){return ii(e.element())},invalidClass:"tox-invalid",validator:{validate:function(t){t=_l.getValue(t);var n=e.validator(t);return Xb.pure(!0===n?we.value(t):we.error(n))},validateOnLoad:e.validateOnLoad}})})).toArray(),a=e.placeholder.fold(o({}),(function(e){return{placeholder:t.translate(e)}})),u=e.inputMode.fold(o({}),(function(e){return{inputmode:e}}));a=d(d({},a),u),u=Vb.parts().field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:ac(Ue([r,i])),selectOnFocus:!1,factory:jb}),a=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),r=[uh.config({disabled:e.disabled,onDisabled:function(e){Vb.getField(e).each(uh.disable)},onEnabled:function(e){Vb.getField(e).each(uh.enable)}})];return Zb(n,u,a,r)}function BC(e){var t=mn(null);return Hi({readState:function(){return{timer:null!==t.get()?"set":"unset"}},setTimer:function(e){t.set(e)},cancel:function(){var e=t.get();null!==e&&e.cancel()}})}function MC(e,t,n){n=_l.getValue(n),_l.setValue(t,n),PC(t)}function PC(e){lT(e,(function(e,t){return e.setSelectionRange(t.length,t.length)}))}function zC(e,t,n){var r,o;return e.selectsOver?(o=_l.getValue(t),r=e.getDisplayText(o),o=_l.getValue(n),0===e.getDisplayText(o).indexOf(r)?ye.some((function(){var e;MC(0,t,n),e=r.length,lT(t,(function(t,n){return t.setSelectionRange(e,n.length)}))})):ye.none()):ye.none()}function IC(e){return mT(Xb.nu(e))}function LC(e){return{type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:function(){}}}function FC(e,t){return{type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:function(){}}}function HC(e,t){return n=e,e=Ie(t,(function(e){return e.type===n})),Me(e,LC);var n}function VC(e,t,r){function o(t){t=_l.getValue(t),r.addToHistory(t.value,e.filetype)}var i,a,u,c=t.shared.providers,s=Vb.parts().field({factory:dT,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":ST,type:"url"},minChars:0,responseTime:0,fetch:function(n){o=e.filetype,n=n,i=r,n=_l.getValue(n),a=void 0!==n.meta.text?n.meta.text:n.value;var o,i,a;n=i.getLinkInformation().fold((function(){return[]}),(function(e){var t=CT(a,wT(i.getHistory(o)));return"file"===o?xT([t,CT(a,pT(e)),CT(a,Ue([bT(e),vT(e),yT(e)]))]):t})),n=Tx(n,dh.BUBBLE_TO_SANDBOX,t,!1);return Xb.pure(n)},getHotspot:function(e){return p.getOpt(e)},onSetValue:function(e,t){e.hasConfigured(Kb)&&Kb.run(e).get(n)},typeaheadBehaviours:ac(Ue([r.getValidationHandler().map((function(t){return Kb.config({getRoot:function(e){return ii(e.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(e,t){f.getOpt(e).each((function(e){wi(e.element(),"title",c.translate(t))}))}},validator:{validate:function(n){var r=_l.getValue(n);return gT((function(n){t({type:e.filetype,url:r.value},(function(e){var t;"invalid"===e.status?(t=we.error(e.message),n(t)):(t=we.value(e.message),n(t))}))}))},validateOnLoad:!1}})})).toArray(),[uh.config({disabled:e.disabled}),Jb.config({}),im("urlinput-events",Ue(["file"===e.filetype?[Xo(vr(),(function(t){Xr(t,Rb,{name:e.name})}))]:[],[Xo(br(),(function(t){Xr(t,Rb,{name:e.name}),o(t)})),Xo(kr(),(function(t){Xr(t,Rb,{name:e.name}),o(t)}))]]))]])),eventOrder:((s={})[vr()]=["streaming","urlinput-events","invalidating"],s),model:{getDisplayText:function(e){return e.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:Ap(!1,1,"normal")},onExecute:function(e,t,n){Xr(t,zb,{})},onItemExecute:function(t,n,r,i){o(t),Xr(t,Rb,{name:e.name})}}),l=e.label.map((function(e){return ty(e,c)})),f=Dm((m="invalid",i=ye.some(ST),void 0===u&&(u=m),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+m],innerHtml:Rm(a=void 0===(a="warning")?m:a,c.icons),attributes:d({title:c.translate(u),"aria-live":"polite"},i.fold((function(){return{}}),(function(e){return{id:e}})))}})),m=Dm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[f.asSpec()]}),g=r.getUrlPicker(e.filetype),h=Oi("browser.url.event"),p=Dm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[s,m.asSpec()],behaviours:ac([uh.config({disabled:e.disabled})])}),v=Dm(aC({name:e.name,icon:ye.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(e){return Gr(e,h)}),c,[],["tox-browse-url"]));return Vb.sketch({dom:ey([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:Ue([[p.asSpec()],g.map((function(){return v.asSpec()})).toArray()])}]),fieldBehaviours:ac([uh.config({disabled:e.disabled,onDisabled:function(e){Vb.getField(e).each(uh.disable),v.getOpt(e).each(uh.disable)},onEnabled:function(e){Vb.getField(e).each(uh.enable),v.getOpt(e).each(uh.enable)}}),im("url-input-events",[Xo(h,(function(t){Od.getCurrent(t).each((function(n){var r=_l.getValue(n);g.each((function(o){o(r).get((function(r){_l.setValue(n,r),Xr(t,Rb,{name:e.name})}))}))}))}))])])})}function UC(e,t){function n(e){return e.element().dom().click(),ye.some(!0)}function r(e){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e],innerHtml:Rm("checked"===e?"selected":"unselected",t.icons)}}}var o=_l.config({store:{mode:"manual",getValue:function(e){return e.element().dom().checked},setValue:function(e,t){e.element().dom().checked=t}}}),a=(o=Vb.parts().field({factory:{sketch:i},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ac([ww(),uh.config({disabled:e.disabled}),Jb.config({}),am.config({}),o,nm.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),im("checkbox-events",[Xo(br(),(function(t,n){Xr(t,Rb,{name:e.name})}))])])}),Vb.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:t.translate(e.label)},behaviours:ac([my.config({})])})),u=Dm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[r("checked"),r("unchecked")]});return Vb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,u.asSpec(),a],fieldBehaviours:ac([uh.config({disabled:e.disabled,disableClass:"tox-checkbox--disabled",onDisabled:function(e){Vb.getField(e).each(uh.disable)},onEnabled:function(e){Vb.getField(e).each(uh.enable)}})])})}function jC(e,t){function n(e){return function(t,n){bu(n.event().target(),"[data-collection-item-value]").each((function(n){e(t,n,xi(n,"data-collection-item-value"))}))}}var r,o=e.label.map((function(e){return ty(e,t)})),a=[Xo(dr(),n((function(e,t){dc(t)}))),Xo(Ar(),n((function(t,n,r){Xr(t,Pb,{name:e.name,value:r})}))),Xo(mr(),n((function(e,t,n){vu(e.element(),"."+Kg).each((function(e){Ji(e,Kg)})),Yi(t,Kg)}))),Xo(gr(),n((function(e,t,n){vu(e.element(),"."+Kg).each((function(e){Ji(e,Kg)}))}))),ti(n((function(t,n,r){Xr(t,Pb,{name:e.name,value:r})})))],u=Vb.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:i},behaviours:ac([rm.config({}),_l.config({store:{mode:"memory",initialValue:[]},onSetValue:function(t,n){var r=t;n=Me(n,(function(t){var n=Hg.translate(t.text),r=1===e.columns?'<div class="tox-collection__item-label">'+n+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",i={_:" "," - ":" ","-":" "};n=n.replace(/\_| \- |\-/g,(function(e){return i[e]}));return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(t=t.value)?""":t)+'" title="'+n+'" aria-label="'+n+'">'+o+r+"</div>"})),n=1<e.columns&&"auto"!==e.columns?k(n,e.columns):[n],n=Me(n,(function(e){return'<div class="tox-collection__group">'+e.join("")+"</div>"})),ho(r.element(),n.join("")),"auto"===e.columns&&Mg(t,5,"tox-collection__item").each((function(e){var n=e.numRows;e=e.numColumns;nm.setGridSize(t,n,e)})),Gr(t,Hb)}}),Jb.config({}),nm.config((u=e.columns,r="normal",1===u?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===u?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===r?".tox-swatches__row":".tox-collection__group",cell:"color"===r?"."+jg:"."+Ug}})),im("collection-events",a)])});return Zb(o,u,["tox-form__group--collection"],[])}function WC(e,t){function n(e){return{dom:{tag:"tr"},components:Me(e,o)}}var r,o=function(e){return{dom:{tag:"td",innerHtml:t.translate(e)}}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(r=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:Me(r,(function(e){return{dom:{tag:"th",innerHtml:t.translate(e)}}}))}]}),(r=e.cells,{dom:{tag:"tbody"},components:Me(r,n)})],behaviours:ac([Jb.config({}),am.config({})])}}function qC(e){return function(t,n,r){return yt(n,"name").fold((function(){return e(n,r)}),(function(o){return t.field(o,e(n,r))}))}}function $C(e,t,n){var r=ut(n,{shared:{interpreter:function(t){return GC(e,t,r)}}});return GC(e,t,r)}function GC(e,n,r){return yt(kT,n.type).fold((function(){return t.console.error('Unknown factory type "'+n.type+'", defaulting to container: ',n),n}),(function(t){return t(e,n,r)}))}function XC(e){return Fe(e,(function(e,t){var n;return ot(t,"items")?(n=XC(t.items),{customFormats:e.customFormats.concat(n.customFormats),formats:e.formats.concat([{title:t.title,items:n.formats}])}):ot(t,"inline")||ot(t,"block")||ot(t,"selector")?(n="custom-"+t.title.toLowerCase(),{customFormats:e.customFormats.concat([{name:n,format:t}]),formats:e.formats.concat([{title:t.title,format:n,icon:t.icon}])}):d(d({},e),{formats:e.formats.concat(t)})}),{customFormats:[],formats:[]})}function YC(e,t){function n(t){Pe(t,(function(t){e.formatter.has(t.name)||e.formatter.register(t.name,t.format)}))}var r=XC(t);return e.formatter?n(r.customFormats):e.on("init",(function(){n(r.customFormats)})),r.formats}function KC(e,t,n){return t={type:"formatter",isSelected:t(e.format),getStylePreview:n(e.format)},ut(e,t)}function JC(e,t,n,r){function i(t){return Me(t,(function(t){var a,u,c,s=Ke(t);return St(t,"items")?(a=i(t.items),ut((u=t,c={type:"submenu",isSelected:o(!1),getStylePreview:function(){return ye.none()}},ut(u,c)),{getStyleItems:function(){return a}})):St(t,"format")?KC(t,n,r):1===s.length&&Re(s,"title")?ut(t,{type:"separator"}):(c=Oi((u=t).title),s={type:"formatter",format:c,isSelected:n(c),getStylePreview:r(c)},u=ut(u,s),e.formatter.register(c,u),u)}))}return i(t)}function ZC(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}}function QC(e,t,n,r,o){return{type:e,title:t,url:n,level:r,attach:o}}function eS(e){return e.innerText||e.textContent}function tS(e){return e&&/^(H[1-6])$/.test(e.nodeName)}function nS(e){return LT(e)&&!IT(e)}function rS(e){return 0<PT(e.title).length}function oS(e){return xe(e)&&/^https?/.test(e)}function iS(e){return Ce(e)&&E(e,(function(e){return!(Se(e=e)&&e.length<=5&&We(e,oS))})).isNone()}function aS(){var e,n=t.localStorage.getItem(qT);if(null===n)return{};try{e=JSON.parse(n)}catch(e){if(e instanceof SyntaxError)return t.console.log("Local storage "+qT+" was not valid JSON",e),{};throw e}return iS(e)?e:(t.console.log("Local storage "+qT+" was not valid format",e),{})}function uS(e){var t=aS();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:[]}function cS(e,n){if(oS(e)){var r=aS(),o=Object.prototype.hasOwnProperty.call(r,n)?r[n]:[];o=Ie(o,(function(t){return t!==e})),n=(r[n]=[e].concat(o).slice(0,5),r);if(!iS(n))throw new Error("Bad format for history:\n"+JSON.stringify(n));t.localStorage.setItem(qT,JSON.stringify(n))}}function sS(e){return!!e}function lS(e){return Qe(yC.makeMap(e,/[, ]/),sS)}function fS(e,t,n){return e=e,t=t,e=($T.call(e,t)?ye.some(e[t]):ye.none()).getOr(n),xe(e)?ye.some(e):ye.none()}function dS(e){return ye.some(e.file_picker_callback).filter(Te)}function mS(e,t){n=e,i=ye.some(n.file_picker_types).filter(sS),r=ye.some(n.file_browser_callback_types).filter(sS),o=i.or(r).map(lS);var n,r,o,i=dS(n).fold((function(){return!1}),(function(e){return o.fold((function(){return!0}),(function(e){return 0<Ke(e).length&&e}))}));return ke(i)?i?dS(e):ye.none():i[t]?dS(e):ye.none()}function gS(e,t,n){r=function(e,t){var r=n(e);return ye.some({element:o(e),start:o(t),finish:o(t+r),width:o(r)})};e=Fe(e,(function(e,t){return r(t,e.len).fold(o(e),(function(t){return{len:t.finish(),list:e.list.concat([t])}}))}),{len:0,list:[]}).list;var r,i=Ie(e,(function(e){return e.finish()<=t})),a=Le(i,(function(e,t){return e+t.width()}),0);e=e.slice(i.length);return{within:o(i),extra:o(e),withinWidth:o(a)}}function hS(e){return Me(e,(function(e){return e.element()}))}function pS(e,t,n,r){var o,i,a,u=(s=function(e,t,n){return t=gS(t,e,n),0===t.extra().length?ye.some(t):ye.none()}(e,t,n).getOrThunk((function(){return gS(t,e-n(r),n)}))).within(),c=s.extra(),s=s.withinWidth();return 1===c.length&&c[0].width()<=n(r)?(i=s,o=hS((o=u).concat(c)),KT(o,[],i)):1<=c.length?(o=c,i=r,c=s,a=hS(a=u).concat([i]),KT(a,hS(o),c)):(a=s,KT(hS(u),[],a))}function vS(e,t){t=Me(t,(function(e){return va(e)})),YT.setGroups(e,t)}function bS(e,t,n,r,o){var i="alloy.toolbar.toggle";return{uid:e.uid,dom:e.dom,components:t,behaviours:Bl(e.splitToolbarBehaviours,[ny.config({others:d(d({},o.coupling),{overflowGroup:function(e){return ZT.sketch(d(d({},r["overflow-group"]()),{items:[Am.sketch(d(d({},r["overflow-button"]()),{action:function(t){Gr(e,i)}}))]}))}})}),im("toolbar-toggle-events",[Xo(i,(function(e){o.apis.toggle(e)}))])]),apis:d({setGroups:function(t,n){var r=n;r=Me(n,t.getSystem().build),e.builtGroups.set(r),o.apis.refresh(t)},getMoreButton:function(t){return Ql(t,e,"overflow-button")}},o.apis),domModification:{attributes:{role:"group"}}}}function yS(e,t,n){var r=aE(t,e.element());("0px"===r?lE:fE)(e,t,n,ye.some(r))}function wS(e,t,n){var r=oE(e,t),o=Zi(r,t.shrinkingClass),i=aE(t,e.element()),a=(sE(e,t),aE(t,e.element()));(o?function(){oa(e.element(),iE(t),i),sa(e.element())}:function(){cE(e,t)})(),Ji(r,t.shrinkingClass),Yi(r,t.growingClass),sE(e,t),oa(e.element(),iE(t),a),n.setExpanded(),t.onStartGrow(e)}function xS(e,t,n){return e=oE(e,t),!0===Zi(e,t.growingClass)}function CS(e,t,n){return e=oE(e,t),!0===Zi(e,t.shrinkingClass)}function SS(e,t){e.on("init",(function(){e.readonly&&bE(t,!0)})),e.on("SwitchMode",(function(){return bE(t,e.readonly)})),kb(e)&&e.setMode("readonly")}function kS(e){var t;return fc.config({channels:((t={})[pE]={schema:vE,onReceive:function(t,n){e(t).each((function(e){var t,r;t=e,r=n.readonly,Qn("*",t.element()).forEach((function(e){t.getSystem().getByDom(e).each((function(e){e.hasConfigured(uh)&&uh.set(e,r)}))}))}))}},t)})}function TS(e){var t=e.title.fold((function(){return{}}),(function(e){return{attributes:{title:e}}}));return{dom:d({tag:"div",classes:["tox-toolbar__group"]},t),components:[ZT.parts().items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ac([Jb.config({}),am.config({})])}}function ES(e){return ZT.sketch(TS(e))}function OS(e){var t=xE(e,rE.getOverflow),n=rE.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return rE.sketch(d(d({},t),{lazySink:e.getSink,getAnchor:function(){return e.backstage.shared.anchors.toolbarOverflow()},getOverflowBounds:function(){var t=e.moreDrawerData.lazyHeader().element(),n=mu(t);t=oi(t),t=mu(t);return fu(n.x()+4,t.y(),n.width()-8,t.height())},parts:d(d({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"]}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))}function NS(e){var t=hE.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=hE.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}});e=xE(e,hE.getOverflow);return hE.sketch(d(d({},e),{components:[t,n],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(e){e.getSystem().broadcastOn([yE()],{type:"opened"})},onClosed:function(e){e.getSystem().broadcastOn([yE()],{type:"closed"})}}))}function AS(e){var t=e.cyclicKeying?"cyclic":"acyclic";return YT.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[YT.parts().groups({})],toolbarBehaviours:wE(e,t,o(ye.none()))})}function DS(e){return Gt("toolbarbutton",CE,e)}function _S(e){return Gt("menubutton",SE,e)}function RS(e){return Gt("ToggleButton",TE,e)}function BS(e,t,n,r,o,i){function a(e){return Hg.isRtl()&&Re(ME,e)?e+"-rtl":e}var u=Hg.isRtl()&&e.exists((function(e){return Re(PE,e)}));return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]).concat(u?["tox-tbtn__icon-rtl"]:[]),attributes:RE(n,i)},components:hh([e.map((function(e){return Wx(a(e),i.icons)})),t.map((function(e){return $x(e,"tox-tbtn",i)}))]),eventOrder:((u={})[cr()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ac([im("common-button-display-events",[Xo(cr(),(function(e,t){t.event().prevent(),Gr(e,BE)}))])].concat(r.map((function(n){return NE.config({channel:n,initialData:{icon:e,text:t},renderComponents:function(e,t){return hh([e.icon.map((function(e){return Wx(a(e),i.icons)})),e.text.map((function(e){return $x(e,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}}function MS(e,t,n){return zE(e,{toolbarButtonBehaviours:[].concat(0<n.length?[im("toolbarButtonWith",n)]:[]),getApi:DE,onSetup:e.onSetup},t)}function PS(e,t,n){return ut(zE(e,{toolbarButtonBehaviours:[rm.config({}),sm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<n.length?[im("toolbarToggleButtonWith",n)]:[]),getApi:_E,onSetup:e.onSetup},t))}function zS(e,t){function r(e){return{isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)},setIconFill:function(t,n){vu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each((function(e){wi(e,"fill",n)}))},setIconStroke:function(t,n){vu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each((function(e){wi(e,"stroke",n)}))},setActive:function(t){wi(e.element(),"aria-pressed",t),vu(e.element(),"span").each((function(n){e.getSystem().getByDom(n).each((function(e){return sm.set(e,t)}))}))},isActive:function(){return vu(e.element(),"span").exists((function(t){return e.getSystem().getByDom(t).exists(sm.isOn)}))}}}var o,i,a,u=Oi("channel-update-split-dropdown-display"),c=mn(n),s={getApi:r,onSetup:e.onSetup};return AE.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:ct({"aria-pressed":!1},RE(e.tooltip,t.providers))},onExecute:function(t){e.onAction(r(t))},onItemExecute:function(e,t,n){},splitDropdownBehaviours:ac([ch.splitButton(!1),im("split-dropdown-events",[Xo(BE,am.focus),lh(s,c),fh(s,c)]),my.config({})]),eventOrder:((s={})[Lr()]=["alloy.base.behaviour","split-dropdown-events"],s),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=r,i=e,a=t.providers,function(e){return Xb.nu((function(e){return i.fetch(e)})).map((function(t){return ye.from(Zp(ut(Bp(Oi("menu-value"),t,(function(t){i.onItemAction(o(e),t)}),i.columns,i.presets,dh.CLOSE_ON_EXECUTE,i.select.getOr((function(){return!1})),a),{movement:Pp(i.columns,i.presets),menuBehaviours:Pg.unnamedEvents("auto"!==i.columns?[]:[Zo((function(e,t){Mg(e,4,Jg(i.presets)).each((function(t){var n=t.numRows;t=t.numColumns;nm.setGridSize(e,n,t)}))}))])})))}))}),parts:{menu:Ap(!1,e.columns,e.presets)},components:[AE.parts().button(BS(e.icon,e.text,ye.none(),ye.some(u),ye.some([sm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),AE.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Rm("chevron-down",t.providers.icons)}}),AE.parts()["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})}function IS(e,t){return Xo(Gx,(function(n,r){var o;n=e.get(n),o=n,n={hide:function(){return Gr(o,_r())},getValue:function(){return _l.getValue(o)}};t.onAction(n,r.event().buttonApi())}))}function LS(e,t){var n=Math.max(t.x(),e.x());e=e.right()-n,t=t.width()-(n-t.x());return{x:n,width:Math.min(e,t)}}function FS(e,n){var r=au(t.window),o=du(gn.fromDom(e.getContentAreaContainer()));return e.inline&&!n?ye.some(VE(e,o,r)):e.inline?ye.some(HE(e,o,r)):ye.some(FE(e,o,r))}function HS(e,t){return Su(t,(function(t){return t.predicate(e.dom())?ye.some({toolbarApi:t,elem:e}):ye.none()}))}function VS(e,t){return function(n){function r(){n.setActive(e.formatter.match(t));var r=e.formatter.formatChanged(t,n.setActive).unbind;o.set(ye.some(r))}var o=mn(ye.none());return e.initialized?r():e.on("init",r),function(){return o.get().each((function(e){return e()}))}}}function US(e,t,n){function r(e,t,r){var o="formatter"===e.type&&n.isInvalid(e);return 0===t?o?[]:i(e,t,!1,r).toArray():i(e,t,o,r).toArray()}function o(e){var t=n.getCurrentValue(),o=n.shouldHide?0:1;return je(e,(function(e){return r(e,o,t)}))}var i=function(e,o,i,a){var u,c=t.shared.providers.translate(e.title);return"separator"===e.type?ye.some({type:"separator",text:c}):"submenu"===e.type?(u=je(e.getStyleItems(),(function(e){return r(e,o,a)})),0===o&&u.length<=0?ye.none():ye.some({type:"nestedmenuitem",text:c,disabled:u.length<=0,getSubmenuItems:function(){return je(e.getStyleItems(),(function(e){return r(e,o,a)}))}})):ye.some(d({type:"togglemenuitem",text:c,active:e.isSelected(a),disabled:i,onAction:n.onAction(e)},e.getStylePreview().fold((function(){return{}}),(function(e){return{meta:{style:e}}}))))};return{validateItems:o,getFetch:function(e,t){return function(n){var r=t();r=o(r);n(Tx(r,dh.CLOSE_ON_EXECUTE,e,!1))}}}}function jS(e,t,r){var o=(i=YE(e,t,r)).items,i=i.getStyleItems;return Jx({text:r.icon.isSome()?ye.none():ye.some(""),icon:r.icon,tooltip:ye.from(r.tooltip),role:ye.none(),fetch:o.getFetch(t,i),onSetup:function(t){return r.setInitialValue.each((function(e){return e(t.getComponent())})),r.nodeChangeHandler.map((function(n){var r=n(t.getComponent());return e.on("NodeChange",r),function(){e.off("NodeChange",r)}})).getOr(n)},getApi:function(e){return{getComponent:function(){return e}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)}function WS(e,t){return function(n,r){return n=e(n).mapError((function(e){return Kt(e)})).getOrDie(),t(n,r)}}function qS(e){return function(t){return t.translate(-e.left(),-e.top())}}function $S(e){return function(t){return t.translate(e.left(),e.top())}}function GS(e){return function(t,n){return Fe(e,(function(e,t){return t(e)}),Ja(t,n))}}function XS(e,t,n){return e.fold(GS([$S(n),qS(t)]),GS([qS(t)]),GS([]))}function YS(e,t,n){return e.fold(GS([$S(n)]),GS([]),GS([$S(t)]))}function KS(e,t,n){return e.fold(GS([]),GS([qS(n)]),GS([$S(t),qS(n)]))}function JS(e,t){var n=e.element();Yi(n,t.transitionClass),Ji(n,t.fadeOutClass),Yi(n,t.fadeInClass),t.onShow(e)}function ZS(e,t){var n=e.element();Yi(n,t.transitionClass),Ji(n,t.fadeInClass),Yi(n,t.fadeOutClass),t.onHide(e)}function QS(e,t,n){return We(e,(function(e){switch(e){case"bottom":return r=n,t.bottom()<=r.bottom();case"top":return r=n,t.y()>=r.y()}var r}))}function ek(e,t){return Ci(e,t)?ye.some(parseInt(xi(e,t),10)):ye.none()}function tk(e,t){return ek(e,t.leftAttr).bind((function(n){return ek(e,t.topAttr).map((function(t){var r=nu(e),o=Ya(e);return fu(n,t,r,o)}))}))}function nk(e,t,n){var r=xi(e,t.positionAttr);switch(Si(e=e,(t=t).leftAttr),Si(e,t.topAttr),Si(e,t.positionAttr),r){case"static":return ye.some(LO.static());case"absolute":return ye.some(LO.absolute(n.x(),n.y()));default:return ye.none()}}function rk(e,t,n,r,o){var i,a,u,c=du(e);return QS(t.modes,c,n)?ye.none():(u=Do(e,"position"),e=e,t=t,i=c.x(),a=c.y(),u=u,wi(e,t.leftAttr,i),wi(e,t.topAttr,a),wi(e,t.positionAttr,u),i=zO(c.x(),c.y()),a=XS(i,r,o),e=zO(n.x(),n.y()),t=XS(e,r,o),u=c.y()<=n.y()?t.top():t.top()+n.height()-c.height(),ye.some(LO.fixed(a.left(),u)))}function ok(e,t,r){var o,i,a;r.isDocked()&&(i=t,t=r,a=(o=e).element(),t.setDocked(!1),HO(o,i).each((function(e){e.fold((function(){return VO(o,i)}),(function(e,t){var n=ri(a),r=(n=ou(n),DO(a));UO(o,i,n,r,zO(e,t))}),n)})),t.setVisible(!0),i.contextual.each((function(e){ea(a,[e.fadeInClass,e.fadeOutClass,e.transitionClass]),e.onShow(o)})),WO(o,i,t))}function ik(e){var t=e.element();ii(t).each((function(n){var r;qO.isDocked(e)?(r=nu(n),oa(t,"width",r+"px"),r=Ka(t),oa(n,"padding-top",r+"px")):(ca(t,"width"),ca(n,"padding-top"))}))}function ak(e,t){t?(Ji(e,$O.fadeOutClass),Qi(e,[$O.transitionClass,$O.fadeInClass])):(Ji(e,$O.fadeInClass),Qi(e,[$O.fadeOutClass,$O.transitionClass]))}function uk(e,t){e=gn.fromDom(e.getContainer()),t?(Yi(e,GO),Ji(e,XO)):(Yi(e,XO),Ji(e,GO))}function ck(e,t){function n(e){t().each((function(t){return e(t.element())}))}function r(n){e.inline||ik(n),uk(e,qO.isDocked(n)),n.getSystem().broadcastOn([Tl()],{}),t().each((function(e){return e.getSystem().broadcastOn([Tl()],{})}))}var o,i=mn(ye.none());return[qO.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",positionAttr:"data-dock-pos",contextual:d({lazyContext:function(t){t=Ka(t.element());var n=e.inline?e.getContentAreaContainer():e.getContainer();n=du(gn.fromDom(n)),t=n.height()-t;return ye.some(fu(n.x(),n.y(),n.width(),t))},onShow:function(){n((function(e){return ak(e,!0)}))},onShown:function(e){n((function(e){return ea(e,[$O.transitionClass,$O.fadeInClass])})),i.get().each((function(t){var n,r,o;n=e.element(),o=ri(r=t),mc(o).filter((function(e){return!tr(r,e)})).filter((function(e){return tr(e,gn.fromDom(o.dom().body))||nr(n,e)})).each((function(){return dc(r)})),i.set(ye.none())}))},onHide:function(e){var r;i.set((e=e.element(),r=t,gc(e).orThunk((function(){return r().toOption().bind((function(e){return gc(e.element())}))})))),n((function(e){return ak(e,!1)}))},onHidden:function(){n((function(e){return ea(e,[$O.transitionClass])}))}},$O),modes:["top"],onDocked:r,onUndocked:r}),am.config({}),fc.config({channels:((o={})[yE()]={onReceive:function(e){ik(e)}},o)})]}function sk(e){return"<alloy.field."+e+">"}function lk(e,t,n){function r(t){return tf(e)}function o(t,n){return void 0===n&&(n=void 0),function(r,o){return Ql(r,e,o).map((function(e){return t(e,o)})).getOr(n)}}function i(e,t){return"true"!==xi(e.element(),"aria-hidden")}var a,u=o(i,!1),c=o((function(e,t){var n;i(e)&&(n=e.element(),oa(n,"display","none"),wi(n,"aria-hidden","true"),Xr(e,Ur(),{name:t,visible:!1}))})),s=function(e,t){Pe(t,(function(t){return a(e,t)}))},l=o((function(e,t){var n;i(e)||(n=e.element(),ca(n,"display"),Si(n,"aria-hidden"),Xr(e,Ur(),{name:t,visible:!0}))}));u={getSlotNames:r,getSlot:function(t,n){return Ql(t,e,n)},isShowing:u,hideSlot:a=c,hideAllSlots:function(e){return s(e,r())},showSlot:l};return{uid:e.uid,dom:e.dom,components:t,behaviours:Rl(e.slotBehaviours),apis:u}}function fk(e){return{element:function(){return e.element().dom()}}}function dk(e,t){var r=Me(Ke(t),(function(e){var n=t[e];n=Xt(Gt("sidebar",nN,n));return{name:e,getApi:fk,onSetup:n.onSetup,onShow:n.onShow,onHide:n.onHide}}));return Me(r,(function(t){var o=mn(n);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Pg.unnamedEvents([lh(t,o),fh(t,o),Xo(Ur(),(function(e,t){var n=t.event();He(r,(function(e){return e.name===n.name()})).each((function(t){(n.visible()?t.onShow:t.onHide)(t.getApi(e))}))}))])})}))}function mk(e){return Od.getCurrent(e).bind((function(e){return dE.isGrowing(e)||dE.hasGrown(e)?Od.getCurrent(e).bind((function(e){return He(tN.getSlotNames(e),(function(t){return tN.isShowing(e,t)}))})):ye.none()}))}function gk(e,t,n){function r(e){e!==o.get()&&(aN(t(),e,n.providers),o.set(e))}var o=mn(!1),i=mn(ye.none());e.on("ProgressState",(function(t){var n;i.get().each(zm.clearTimeout),Ee(t.time)?(n=zm.setEditorTimeout(e,(function(){return r(t.state)}),t.time),i.set(ye.some(n))):(r(t.state),i.set(ye.none()))}))}function hk(e,t){var n=ct(sN,t.menus),r=0<Ke(t.menus).length,o=void 0===t.menubar||!0===t.menubar?fN(cN):fN(!1===t.menubar?"":t.menubar);o=Ie(o,(function(e){return r&&t.menus.hasOwnProperty(e)&&t.menus[e].hasOwnProperty("items")||sN.hasOwnProperty(e)})),o=Me(o,(function(r){return r=n[r],lN({title:r.title,items:fN(r.items)},t,e)}));return Ie(o,(function(e){return 0<e.getItems().length&&Be(e.getItems(),(function(e){return"separator"!==e.type}))}))}function pk(e,t){n=(i=t).settings,r=n.skin,n=n.skin_url,!1!==r&&(r=r||"oxide",n=n?i.documentBaseURI.toAbsolute(n):Sb.baseURL+"/skins/ui/"+r);var n,r,o,i=n;i&&(o=i+"/skin.min.css",t.contentCSS.push(i+(e?"/content.inline":"/content")+".min.css")),!1===t.getParam("skin")==0&&o?ph.DOM.styleSheetLoader.load(o,dN(t)):dN(t)()}function vk(e,t,n,r){t=t.outerContainer;var o=n.toolbar,i=n.buttons;Oe(o,xe)?(o=o.map((function(t){return wO(e,{toolbar:t,buttons:i},{backstage:r},ye.none())})),uN.setToolbars(t,o)):uN.setToolbar(t,wO(e,n,{backstage:r},ye.none()))}function bk(e){function t(t){var n=e.getDoc().documentElement,o=i.get(),u=a.get();o.left()!==r.innerWidth||o.top()!==r.innerHeight?(i.set(Ja(r.innerWidth,r.innerHeight)),sp.fireResizeContent(e,t)):u.left()===n.offsetWidth&&u.top()===n.offsetHeight||(a.set(Ja(n.offsetWidth,n.offsetHeight)),sp.fireResizeContent(e,t))}function n(t){return sp.fireScrollContent(e,t)}var r=e.getWin(),o=e.getDoc().documentElement,i=mn(Ja(r.innerWidth,r.innerHeight)),a=mn(Ja(o.offsetWidth,o.offsetHeight)),u=(hN.bind(r,"resize",t),hN.bind(r,"scroll",n),rv(gn.fromDom(e.getBody()),"load",t));e.on("remove",(function(){u.unbind(),hN.unbind(r,"resize",t),hN.unbind(r,"scroll",n)}))}function yk(e,t){return{anchor:"makeshift",x:e,y:t}}function wk(e){return"longpress"===e.type||0===e.type.indexOf("touch")}function xk(e,t){var n;e=ph.DOM.getPos(e);return n=e.x,e=e.y,yk(t.x+n,t.y+e)}function Ck(e,t){return"contextmenu"===t.type?e.inline?wk(n=t)?(r=n.touches[0],yk(r.pageX,r.pageY)):yk(n.pageX,n.pageY):xk(e.getContentAreaContainer(),wk(r=t)?(n=r.touches[0],yk(n.clientX,n.clientY)):yk(r.clientX,r.clientY)):Sk(e);var n,r}function Sk(e){return{anchor:"selection",root:gn.fromDom(e.selection.getNode())}}function kk(e){return{anchor:"node",node:ye.some(gn.fromDom(e.selection.getNode())),root:gn.fromDom(e.getBody())}}function Tk(e){function t(){zm.setEditorTimeout(e,(function(){e.selection.setRng(o)}),10),i()}function n(e){e.preventDefault(),e.stopImmediatePropagation()}function r(){return i()}var o=e.selection.getRng(),i=(e.once("touchend",t),e.on("mousedown",n,!0),e.once("longpresscancel",r),function(){e.off("touchend",t),e.off("longpresscancel",r),e.off("mousedown",n)})}function Ek(e,t,n,r,o,i){var a=Tb(e)||Eb(e)||Nb(e),u=function(e,t){return t=(t?kk:Sk)(e),d({bubble:pc(0,12,PN),layouts:MN,overrides:{maxWidthFunction:OT(),maxHeightFunction:cl()}},t)}(e,i);Tx(n,dh.CLOSE_ON_EXECUTE,r,!0).map((function(n){t.preventDefault(),km.showMenuWithinBounds(o,u,{menu:{markers:Ep("normal")},data:n,type:"horizontal"},(function(){return FS(e,a)})),e.fire(XT)}))}function Ok(e){return xe(e)?"|"===e:"separator"===e.type}function Nk(e){if(xe(e))return e;switch(e.type){case"separator":return FN;case"submenu":return{type:"nestedmenuitem",text:e.text,icon:e.icon,getSubmenuItems:function(){var t=e.getSubmenuItems();return xe(t)?t:Me(t,Nk)}};default:return{type:"menuitem",text:e.text,icon:e.icon,onAction:(t=e.onAction,function(){return t()})}}var t}function Ak(e,t){if(0===t.length)return e;var n=Xe(e).filter((function(e){return!Ok(e)})).fold((function(){return[]}),(function(e){return[FN]}));return e.concat(n).concat(t).concat([FN])}function Dk(e,t,n){function r(e){return km.hide(a)}function o(t){var r,o="longpress"===t.type;LN.shouldNeverUseNative(e)&&t.preventDefault(),VN(e,t)||LN.isContextMenuDisabled(e)||(r=!o&&(2!==t.button||t.target===e.getBody()),(i()?zN:BN)(e,t,(function(){var n=r?e.selection.getStart(!0):t.target,o=e.ui.registry.getAll(),i=LN.getContextMenu(e);return HN(o.contextMenus,i,n)}),n,a,r))}var i=Xn().deviceType.isTouch,a=pa(km.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return e.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ac([im("dismissContextMenu",[Xo(Hr(),(function(t,n){Sl.close(t),e.focus()}))])])}));e.on("init",(function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(i()?"":"ResizeWindow");e.on(t,r),e.on(i()?"longpress":"longpress contextmenu",o)}))}function _k(e,t,n,r){return t=t,e=(e=e).element(),o=parseInt(xi(e,t.leftAttr),10),e=parseInt(xi(e,t.topAttr),10),(isNaN(o)||isNaN(e)?ye.none():ye.some(Ja(o,e))).fold((function(){return n}),(function(e){return IO(e.left()+r.left(),e.top()+r.top())}));var o}function Rk(e,t,n,r,i,a){n=_k(e,t,n,r);var u,c,s,l,f=t.mustSnap?(u=n,c=i,s=a,l=t.getSnapPoints(e),XN(l,u,c,s).orThunk((function(){return Fe(l,(function(e,t){var n=t.sensor(),r=RO(u,n,t.range().left(),t.range().top(),c,s);return e.deltas.fold((function(){return{deltas:ye.some(r),snap:ye.some(t)}}),(function(n){return(r.left()+r.top())/2<=(n.left()+n.top())/2?{deltas:ye.some(r),snap:ye.some(t)}:e}))}),{deltas:ye.none(),snap:ye.none()}).snap.map((function(e){return{output:o(MO(e.output(),u,c,s)),extra:e.extra}}))}))):(r=n,m=i,g=a,f=t.getSnapPoints(e),XN(f,r,m,g)),d=XS(n,i,a),m=t,g=d;return r=(r=e).element(),wi(r,m.leftAttr,g.left()+"px"),wi(r,m.topAttr,g.top()+"px"),f.fold((function(){return{coord:IO(d.left(),d.top()),extra:ye.none()}}),(function(e){return{coord:e.output(),extra:e.extra()}}))}function Bk(e,t){GN(e,t)}function Mk(e,t){return{bounds:e.getBounds(),height:Ka(t.element()),width:ru(t.element()),comp:t}}function Pk(e,t,n,r){var o,i,a,u=t.getTarget(e.element());t.repositionTarget&&(o=ri(e.element()),o=ou(o),i=DO(u),a=YN(u),a=KN(e,t.snaps,a,o,i,r,n),n=BO(a,o,i),ia(u,n)),t.onDrag(e,u,r)}function zk(e,t,n,r){var o=e+t;e=n.filter((function(e){return o<e})),t=r.filter((function(e){return e<o}));return e.or(t).getOr(o)}function Ik(e,t,n,r,o){var i={};return i.height=zk(r,t.top(),kv(e),ye.from(e.getParam("max_height")).filter(Ee)),n===uT.Both&&(i.width=zk(o,t.left(),Sv(e),ye.from(e.getParam("max_width")).filter(Ee))),i}function Lk(e,t){var n,r,o,i=function(){var e=Hg.translate(["Powered by {0}","Tiny"]);return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+e+'">'+e+"</a>"}}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(r=[],e.getParam("elementpath",!0,"boolean")&&r.push(tA.renderElementPath(e,{})),Vn(e.settings.plugins,"wordcount")&&r.push(nA(e,t)),e.getParam("branding",!0,"boolean")&&r.push(i()),r=0<r.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[],o=!Vn((i=e).settings.plugins,"autoresize"),(o=!1===(i=i.getParam("resize",o))?uT.None:"both"===i?uT.Both:uT.Vertical)!==uT.None&&r.push((n=o,{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:Rm("resize-handle",t.icons)},behaviours:ac([QN.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,r,o){eA(e,o,n)},blockerClass:"tox-blocker"})])})),r)}}function Fk(e){return void 0===e.touches||1!==e.touches.length?ye.none():ye.some(e.touches[0])}function Hk(e){return[$("type"),an("columns",Qt),e]}function Vk(e){return Vt("items","items",lt(),It(qt((function(t){return Gt("Checking item of "+e,AA,t).fold((function(e){return we.error(Kt(e))}),(function(e){return we.value(e)}))}))))}function Uk(e){return Ce(e)?[e].concat(je(nt(e),Uk)):Se(e)?je(e,Uk):[]}function jk(e){return xe(e.type)&&xe(e.name)}function Wk(e){return{internalDialog:Xt(Gt("dialog",_A,e)),dataValidator:function(e){return e=MA(e),e=je(e,(function(e){return BA(e).fold((function(){return[]}),(function(t){return[an(e.name,t)]}))})),zt(e)}(e),initialData:e.initialData}}function qk(e){var t=[],n={};return Ze(e,(function(e,r){e.fold((function(){t.push(r)}),(function(e){n[r]=e}))})),0<t.length?we.error(t):we.value(n)}function $k(e){return Ge(function(e,t){return e=Ne.call(e,0),e.sort(t),e}(e,(function(e,t){return t<e?-1:e<t?1:0})))}function Gk(e,n,r){pu(e,'[role="dialog"]').each((function(o){r.get().map((function(r){return oa(n,"height","0"),Math.min(r,(r=e,a=pu(i=o,".tox-dialog-wrap").getOr(i),(a="fixed"===Do(a,"position")?Math.max(t.document.documentElement.clientHeight,t.window.innerHeight):Math.max(t.document.documentElement.offsetHeight,t.document.documentElement.scrollHeight))-(i.dom().getBoundingClientRect().height-r.dom().getBoundingClientRect().height)));var i,a})).each((function(e){oa(n,"height",e+"px")}))}))}function Xk(e){var t;return t=mn(ye.none()),{smartTabHeight:{extraEvents:[Zo((function(n){vu(n.element(),'[role="tabpanel"]').each((function(r){var o;oa(r,"visibility","hidden"),n.getSystem().getByDom(r).toOption().each((function(n){i=r,a=n;var o,i,a;n=Me(o=e,(function(e,t){return rm.set(a,o[t].view()),t=i.dom().getBoundingClientRect(),rm.set(a,[]),t.height})),n=$k(n);t.set(n)})),Gk(n.element(),r,t),ca(r,"visibility"),o=n,Ge(e).each((function(e){return LA.showTab(o,e.value)})),zm.requestAnimationFrame((function(){Gk(n.element(),r,t)}))}))})),Xo(Ir(),(function(e){vu(e.element(),'[role="tabpanel"]').each((function(n){Gk(e.element(),n,t)}))})),Xo(Hb,(function(e,n){vu(e.element(),'[role="tabpanel"]').each((function(n){var r=mc(),o=(oa(n,"visibility","hidden"),ua(n,"height").map((function(e){return parseInt(e,10)}))),i=(ca(n,"height"),n.dom().getBoundingClientRect().height);o.forall((function(e){return e<i}))?(t.set(ye.from(i)),Gk(e.element(),n,t)):o.each((function(e){oa(n,"height",e+"px")})),ca(n,"visibility"),r.each(dc)}))}))],selectFirst:!1},naiveTabHeight:{extraEvents:[],selectFirst:!0}}}function Yk(e,t){function n(e){e=_l.getValue(e),e=qk(e).getOr({});var t=o.get();t=ut(t,e);o.set(t)}function r(e){var t=o.get();_l.setValue(e,t)}var o=mn({}),i=mn(null),a=(e=Me(e.tabs,(function(e){return{value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:t.shared.providers.translate(e.title)},view:function(){return[dw.sketch((function(o){return{dom:{tag:"div",classes:["tox-form"]},components:Me(e.items,(function(e){return $C(o,e,t)})),formBehaviours:ac([nm.config({mode:"acyclic",useTabstopAt:c(_w.isPseudoStop)}),im("TabView.form.events",[Zo(r),Qo(n)]),fc.config({channels:xt([{key:FA,value:{onReceive:n}},{key:HA,value:{onReceive:r}}])})])}}))]}}})),Xk(e).smartTabHeight);return LA.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(e,t,n){t=_l.getValue(t),Xr(e,Fb,{name:t,oldName:i.get()}),i.set(t)},tabs:e,components:[LA.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[IA.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ac([Jb.config({})])}),LA.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:ac([im("tabpanel",a.extraEvents),nm.config({mode:"acyclic"}),Od.config({find:function(e){return Ge(LA.getViewItems(e))}}),_l.config({store:{mode:"manual",getValue:function(e){return e.getSystem().broadcastOn([FA],{}),o.get()},setValue:function(e,t){o.set(t),e.getSystem().broadcastOn([HA],{})}}})])})}function Kk(e,n,r,o){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:d(d({},n.map((function(e){return{id:e}})).getOr({})),o?{"aria-live":"polite"}:{})},components:[],behaviours:ac([Cw(0),NE.config({channel:jA,updateState:function(e,t){return ye.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},renderComponents:function(e){return"tabpanel"!==e.body.type?[(n=e.body,o=r,{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[(i=Dm(dw.sketch((function(e){return{dom:{tag:"div",classes:["tox-form"].concat(n.classes)},components:Me(n.items,(function(t){return $C(e,t,o)}))}})))).asSpec()]}],behaviours:ac([nm.config({mode:"acyclic",useTabstopAt:c(_w.isPseudoStop)}),xw(i),Ow.memento(i,{postprocess:function(e){return qk(e).fold((function(e){return t.console.error(e),{}}),(function(e){return e}))}})])})]:[Yk(e.body,r)];var n,o,i},initialData:e})])}}function Jk(e,t){return[Ko(mr(),_w.onFocus),e(Bb,(function(e,n){t.onClose(),n.onClose()})),e(Mb,(function(e,t,n,r){t.onCancel(e),Gr(r,Bb)})),Xo(Lb,(function(e,n){return t.onUnblock()})),Xo(Ib,(function(e,n){return t.onBlock(n.event())}))]}function Zk(e,t){function n(e,t){return Cb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+e]},components:Me(t,(function(e){return e.memento.asSpec()}))})}return t=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o)?n:r).push(a)}return{pass:n,fail:r}}(t.map((function(e){return e.footerButtons})).getOr([]),(function(e){return"start"===e.align})),[n("start",t.pass),n("end",t.fail)]}function Qk(e,t){return{dom:Gm('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ac([NE.config({channel:WA,initialData:e,updateState:function(e,n){var r=Me(n.buttons,(function(e){var n=Dm(uC(e,e.type,t));return{name:e.name,align:e.align,memento:n}}));return ye.some({lookupByName:function(e,t){return n=e,o=t,He(r,(function(e){return e.name===o})).bind((function(e){return e.memento.getOpt(n)}));var n,o},footerButtons:r})},renderComponents:Zk})])}}function eT(e,t){var n;return e.getRoot().getSystem().isConnected()?(n=Od.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper()),dw.getField(n,t).fold((function(){var r=e.getFooter();return NE.getState(r).get().bind((function(e){return e.lookupByName(n,t)}))}),(function(e){return ye.some(e)}))):ye.none()}function tT(e){return Am.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),title:e.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(e){Gr(e,Mb)}})}function nT(e,t,n){function r(e){return[ma(n.translate(e.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:d({},t.map((function(e){return{id:e}})).getOr({}))},components:r(e),behaviours:ac([NE.config({channel:UA,renderComponents:r})])}}function rT(){return{dom:Gm('<div class="tox-dialog__draghandle"></div>')}}function oT(e){var t=e.backstage.shared;return{open:function(n,r){function o(e){sA.hide(u),r(e)}var i=Dm(uC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:ye.none()},"submit",e.backstage)),a=uC({name:"no",text:"No",primary:!0,align:"end",disabled:!1,icon:ye.none()},"cancel",e.backstage),u=pa(wD({lazySink:function(){return t.getSink()},headerOverride:ye.some(mD),partSpecs:{title:pD(),close:hD((function(){o(!1)}),t.providers),body:vD(n,t.providers),footer:bD(yD([],[a,i.asSpec()]))},onCancel:function(){return o(!1)},onSubmit:function(){return o(!0)},extraClasses:["tox-confirm-dialog"]}));sA.show(u),n=i.get(u);am.focus(n)}}}var iT,aT,uT,cT=af({name:"HtmlSelect",configFields:[on("options"),gs("selectBehaviours",[am,_l]),ln("selectClasses",[]),ln("selectAttributes",{}),Z("data")],factory:function(e,t){var n=Me(e.options,(function(e){return{dom:{tag:"option",value:e.value,innerHtml:e.text}}})),r=e.data.map((function(e){return wt("initialValue",e)})).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Bl(e.selectBehaviours,[am.config({}),_l.config({store:d({mode:"manual",getValue:function(e){return la(e.element())},setValue:function(t,n){He(e.options,(function(e){return e.value===n})).isSome()&&fa(t.element(),n)}},r)})])}}}),sT=(Wd=Object.freeze({events:function(e,t){var n=e.stream.streams.setup(e,t);return Go([Xo(e.event,n),Qo((function(){return t.cancel()}))].concat(e.cancelEvent.map((function(e){return[Xo(e,(function(){return t.cancel()}))]})).getOr([])))}}),Sc=Object.freeze({throttle:BC,init:function(e){return e.stream.streams.state(e)}}),tm=[an("stream",U("mode",{throttle:[on("delay"),ln("stopEvent",!0),Bu("streams",{setup:function(e,t){var n=e.stream,r=Lm(e.onStream,n.delay);return t.setTimer(r),function(e,t){r.throttle(e,t),n.stopEvent&&t.stop()}},state:BC})]})),ln("event","input"),Z("cancelEvent"),Ea("onStream")],Ba({fields:tm,name:"streaming",active:Wd,state:Sc})),lT=function(e,t){e=e.element();var n=la(e),r=e.dom();"number"!==xi(e,"type")&&t(r,n)},fT=o("alloy.typeahead.itemexecute"),dT=(Xd=o([Z("lazySink"),on("fetch"),ln("minChars",5),ln("responseTime",1e3),ka("onOpen"),ln("getHotspot",ye.some),ln("getAnchorOverrides",o({})),ln("layouts",ye.none()),ln("eventOrder",{}),ue("model",{},[ln("getDisplayText",(function(e){return void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value})),ln("selectsOver",!0),ln("populateFromBrowse",!0)]),ka("onSetValue"),Ta("onExecute"),ka("onItemExecute"),ln("inputClasses",[]),ln("inputAttributes",{}),ln("inputStyles",{}),ln("matchWidth",!0),ln("useMinWidth",!1),ln("dismissOnBlur",!0),Ca(["openClass"]),Z("initialData"),gs("typeaheadBehaviours",[am,_l,sT,nm,sm,ny]),dn("previewing",(function(){return mn(!0)}))].concat(qn()).concat(Iv())),Ys=o([Tc({schema:[xa()],name:"menu",overrides:function(e){return{fakeFocus:!0,onHighlight:function(t,n){e.previewing.get()?t.getSystem().getByUid(e.uid).each((function(r){zC(e.model,r,n).fold((function(){return Nd.dehighlight(t,n)}),(function(e){return e()}))})):t.getSystem().getByUid(e.uid).each((function(t){e.model.populateFromBrowse&&MC(e.model,t,n)})),e.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(e.uid).toOption().map((function(e){return Xr(e,fT(),{item:n}),!0}))},onHover:function(t,n){e.previewing.set(!1),t.getSystem().getByUid(e.uid).each((function(t){e.model.populateFromBrowse&&MC(e.model,t,n)}))}}}})]),uf({name:"Typeahead",configFields:Xd(),partFields:Ys(),factory:function(e,t,r,o){function i(t,r,i){e.previewing.set(!1);var u=ny.getCoupled(t,"sandbox");Sl.isOpen(u)?Od.getCurrent(u).each((function(e){Nd.getHighlighted(e).fold((function(){i(e)}),(function(){Zr(u,e.element(),"keydown",r)}))})):uy(e,a(t),t,u,o,(function(e){Od.getCurrent(e).each(i)}),xb.HighlightFirst).get(n)}function a(e){return function(t){return t.map((function(t){var n=nt(t.menus);n=je(n,(function(e){return Ie(e.items,(function(e){return"item"===e.type}))}));return _l.getState(e).update(Me(n,(function(e){return e.data}))),t}))}}var u=Ub(e),c=[am.config({}),_l.config({onSetValue:e.onSetValue,store:d({mode:"dataset",getDataKey:function(e){return la(e.element())},getFallbackEntry:function(e){return{value:e,meta:{}}},setValue:function(t,n){fa(t.element(),e.model.getDisplayText(n))}},e.initialData.map((function(e){return wt("initialValue",e)})).getOr({}))}),sT.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(t,r){var i,u=ny.getCoupled(t,"sandbox");am.isFocused(t)&&la(t.element()).length>=e.minChars&&(i=Od.getCurrent(u).bind((function(e){return Nd.getHighlighted(e).map(_l.getValue)})),e.previewing.set(!0),uy(e,a(t),t,u,o,(function(t){Od.getCurrent(u).each((function(t){i.fold((function(){e.model.selectsOver&&Nd.highlightFirst(t)}),(function(e){Nd.highlightBy(t,(function(t){return _l.getValue(t).value===e.value})),Nd.getHighlighted(t).orThunk((function(){return Nd.highlightFirst(t),ye.none()}))}))}))}),xb.HighlightFirst).get(n))},cancelEvent:Rr()}),nm.config({mode:"special",onDown:function(e,t){return i(e,t,Nd.highlightFirst),ye.some(!0)},onEscape:function(e){return e=ny.getCoupled(e,"sandbox"),Sl.isOpen(e)?(Sl.close(e),ye.some(!0)):ye.none()},onUp:function(e,t){return i(e,t,Nd.highlightLast),ye.some(!0)},onEnter:function(t){var n,r=ny.getCoupled(t,"sandbox"),o=Sl.isOpen(r);return o&&!e.previewing.get()?Od.getCurrent(r).bind((function(e){return Nd.getHighlighted(e)})).map((function(e){return Xr(t,fT(),{item:e}),!0})):(n=_l.getValue(t),Gr(t,Rr()),e.onExecute(r,t,n),o&&Sl.close(r),ye.some(!0))}}),sm.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),ny.config({others:{sandbox:function(t){return Pv(e,t,{onOpen:function(){return sm.on(t)},onClose:function(){return sm.off(t)}})}}}),im("typeaheadevents",[ti((function(t){Mv(e,a(t),t,o,n,xb.HighlightFirst).get(n)})),Xo(fT(),(function(t,n){var r=ny.getCoupled(t,"sandbox");MC(e.model,t,n.event().item()),Gr(t,Rr()),e.onItemExecute(t,r,n.event().item(),_l.getValue(t)),Sl.close(r),PC(t)}))].concat(e.dismissOnBlur?[Xo(Sr(),(function(e){e=ny.getCoupled(e,"sandbox"),gc(e.element()).isNone()&&Sl.close(e)}))]:[]))];return{uid:e.uid,dom:Ov(ut(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:d(d({},u),Bl(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}}})),mT=function(e){return d(d({},e),{toCached:function(){return mT(e.toCached())},bindFuture:function(t){return mT(e.bind((function(e){return e.fold((function(e){return Xb.pure(we.error(e))}),(function(e){return t(e)}))})))},bindResult:function(t){return mT(e.map((function(e){return e.bind(t)})))},mapResult:function(t){return mT(e.map((function(e){return e.map(t)})))},mapError:function(t){return mT(e.map((function(e){return e.mapError(t)})))},foldResult:function(t,n){return e.map((function(e){return e.fold(t,n)}))},withTimeout:function(n,r){return mT(Xb.nu((function(o){var i=!1,a=t.setTimeout((function(){i=!0,o(we.error(r()))}),n);e.get((function(e){i||(t.clearTimeout(a),o(e))}))})))}})},gT=IC,hT={type:"separator"},pT=function(e){return HC("header",e.targets)},vT=function(e){return HC("anchor",e.targets)},bT=function(e){return ye.from(e.anchorTop).map((function(e){return FC("<top>",e)})).toArray()},yT=function(e){return ye.from(e.anchorBottom).map((function(e){return FC("<bottom>",e)})).toArray()},wT=function(e){return Me(e,(function(e){return FC(e,e)}))},xT=function(e){return Fe(e,(function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(hT,t)}),[])},CT=function(e,t){var n=e.toLowerCase();return Ie(t,(function(e){var t=(void 0!==e.meta&&void 0!==e.meta.text?e.meta:e).text;return Vn(t.toLowerCase(),n)||Vn(e.value.toLowerCase(),n)}))},ST=Oi("aria-invalid"),kT={bar:qC((function(e,t){return t=t.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:Me(e.items,t.interpreter)}})),collection:qC((function(e,t){return jC(e,t.shared.providers)})),alertbanner:qC((function(e,t){return n=e,e=t.shared.providers,Cb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+n.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[Am.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Rm(n.icon,e.icons),attributes:{title:e.translate(n.iconTooltip)}},action:function(e){Xr(e,Pb,{name:"alert-banner",value:n.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:e.translate(n.text)}}]});var n})),input:qC((function(e,t){return e=e,t=t.shared.providers,RC({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:ye.none(),maximized:e.maximized},t)})),textarea:qC((function(e,t){return e=e,t=t.shared.providers,RC({name:e.name,multiline:!0,label:e.label,inputMode:ye.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:ye.none(),maximized:e.maximized},t)})),label:qC((function(e,t){return e=e,t=t.shared,n={dom:{tag:"label",innerHtml:t.providers.translate(e.label),classes:["tox-label"]}},e=Me(e.items,t.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[n].concat(e),behaviours:ac([ww(),rm.config({}),Ow.domHtml(ye.none()),nm.config({mode:"acyclic"})])};var n})),iframe:(iT=function(e,t){return hb(e,t.shared.providers)},function(e,t,n){return t=ut(t,{source:"dynamic"}),qC(iT)(e,t,n)}),button:qC((function(e,t){return _x(e,t.shared.providers)})),checkbox:qC((function(e,t){return UC(e,t.shared.providers)})),colorinput:qC((function(e,t){return Lv(e,t.shared,t.colorinput)})),colorpicker:qC((function(e){function n(e){return"tox-"+e}var r=yw(sb,n),o=Dm(r.sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(e){Xr(e,Pb,{name:"hex-valid",value:!0})},onInvalidHex:function(e){Xr(e,Pb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[o.asSpec()],behaviours:ac([_l.config({store:{mode:"manual",getValue:function(e){return e=o.get(e),Od.getCurrent(e).bind((function(e){return _l.getValue(e).hex})).map((function(e){return"#"+e})).getOr("")},setValue:function(e,n){var r=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n);n=o.get(e);Od.getCurrent(n).fold((function(){t.console.log("Can not find form")}),(function(e){_l.setValue(e,{hex:ye.from(r[1]).getOr("")}),dw.getField(e,"hex").each((function(e){Gr(e,vr())}))}))}}}),ww()])}})),dropzone:qC((function(e,t){return db(e,t.shared.providers)})),grid:qC((function(e,t){return t=t.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:Me(e.items,t.interpreter)}})),selectbox:qC((function(e,t){return n=e,r=t.shared.providers,e=Me(n.items,(function(e){return{text:r.translate(e.text),value:e.value}})),t=n.label.map((function(e){return ty(e,r)})),e=Vb.parts().field({dom:{},selectAttributes:{size:n.size},options:e,factory:cT,selectBehaviours:ac([uh.config({disabled:n.disabled}),Jb.config({}),im("selectbox-change",[Xo(br(),(function(e,t){Xr(e,Rb,{name:n.name})}))])])}),o=1<n.size?ye.none():ye.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:Rm("chevron-down",r.icons)}}),e={dom:{tag:"div",classes:["tox-selectfield"]},components:Ue([[e],o.toArray()])},Vb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:Ue([t.toArray(),[e]]),fieldBehaviours:ac([uh.config({disabled:n.disabled,onDisabled:function(e){Vb.getField(e).each(uh.disable)},onEnabled:function(e){Vb.getField(e).each(uh.enable)}})])});var n,r,o})),sizeinput:qC((function(e,t){return mC(e,t.shared.providers)})),urlinput:qC((function(e,t){return VC(e,t,t.urlinput)})),customeditor:qC((function(e){var t=mn(ye.none()),n=Dm({dom:{tag:e.tag}}),r=mn(ye.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ac([im("editor-foo-events",[Zo((function(o){n.getOpt(o).each((function(n){(Object.prototype.hasOwnProperty.call(e,"init")?e.init(n.element().dom()):Tw.load(e.scriptId,e.scriptUrl).then((function(t){return t(n.element().dom(),e.settings)}))).then((function(e){r.get().each((function(t){e.setValue(t)})),r.set(ye.none()),t.set(ye.some(e))}))}))}))]),_l.config({store:{mode:"manual",getValue:function(){return t.get().fold((function(){return r.get().getOr("")}),(function(e){return e.getValue()}))},setValue:function(e,n){t.get().fold((function(){r.set(ye.some(n))}),(function(e){return e.setValue(n)}))}}}),ww()]),components:[n.asSpec()]}})),htmlpanel:qC((function(e){return"presentation"===e.presets?Cb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html}}):Cb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:ac([Jb.config({}),am.config({})])})})),imagetools:qC((function(e,t){return _C(e,t.shared.providers)})),table:qC((function(e,t){return WC(e,t.shared.providers)})),panel:qC((function(e,t){return{dom:{tag:"div",classes:e.classes},components:Me(e.items,t.shared.interpreter)}}))},TT={field:function(e,t){return t}},ET=function(e,t){return GC(TT,e,t)},OT=o((function(e,t){t=Math.floor(t),t=tu.max(e,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]),oa(e,"max-width",t+"px")})),NT={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},AT={getAnchors:function(e,t,n){function r(){return gn.fromDom(e.getBody())}var o,i,a,u,c,s,l,f,d=Db(e);return{toolbar:d?function(){return{anchor:"node",root:l(),node:ye.from(l()),bubble:pc(-12,-12,NT),layouts:{onRtl:function(){return[Tm]},onLtr:function(){return[Em]}},overrides:{maxHeightFunction:cl()}}}:function(){return{anchor:"hotspot",hotspot:f(),bubble:pc(-12,12,NT),layouts:{onRtl:function(){return[Yu]},onLtr:function(){return[Ku]}},overrides:{maxHeightFunction:cl()}}},toolbarOverflow:(s=n,function(){return{anchor:"hotspot",hotspot:s(),overrides:{maxWidthFunction:OT()},layouts:{onRtl:function(){return[Yu,Ku]},onLtr:function(){return[Ku,Yu]}}}}),banner:(c=f=t,d?function(){return{anchor:"node",root:u(),node:ye.from(u()),layouts:{onRtl:function(){return[Om]},onLtr:function(){return[Om]}}}}:function(){return{anchor:"hotspot",hotspot:c(),layouts:{onRtl:function(){return[ec]},onLtr:function(){return[ec]}}}}),cursor:(i=e,function(){return{anchor:"selection",root:a(),getSelection:function(){var e=i.selection.getRng();return ye.some(Nc.range(gn.fromDom(e.startContainer),e.startOffset,gn.fromDom(e.endContainer),e.endOffset))}}}),node:(o=a=u=l=r,function(e){return{anchor:"node",root:o(),node:e}})}}},DT=function(e){return{colorPicker:function(e,t){wp(o)(e,t)},hasCustomColors:function(){return cp.hasCustomColors(r)},getColors:function(){return cp.getColors(n)},getColorCols:(t=n=r=o=e,function(){return xp(t)})};var t,n,r,o},_T=function(e){return{isDraggableModal:(t=e,function(){return t.getParam("draggable_modal",!1,"boolean")})};var t},RT=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strike-through",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],BT=function(e){return ye.from(e.getParam("style_formats")).filter(Se).map((function(t){return t=YC(e,t),e.getParam("style_formats_merge",!1,"boolean")?RT.concat(t):t})).getOr(RT)},MT=function(e){function t(t){return function(){return e.formatter.match(t)}}function n(t){return function(){var n=e.formatter.get(t);return void 0!==n?ye.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:e.formatter.getCssText(t)}):ye.none()}}function r(e){var t=e.items;return void 0!==t&&0<t.length?je(t,r):[e.format]}var o=mn([]),i=mn([]),a=mn([]),u=mn([]),c=mn(!1);return e.on("init",(function(){var a=BT(e);a=JC(e,a,t,n);o.set(a),i.set(je(a,r))})),e.on("addStyleModifications",(function(o){var i=JC(e,o.items,t,n);a.set(i),c.set(o.replace),u.set(je(i,r))})),{getData:function(){var e=c.get()?[]:o.get(),t=a.get();return e.concat(t)},getFlattenedKeys:function(){var e=c.get()?[]:i.get(),t=u.get();return e.concat(t)}}},PT=yC.trim,zT=ZC("true"),IT=ZC("false"),LT=function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return zT(e)}return!1},FT=function(e,t){return Me(_s(gn.fromDom(t),e),(function(e){return e.dom()}))},HT=function(e){return(t=e)&&"A"===t.nodeName&&void 0!==(t.id||t.name)&&nS(e);var t},VT=function(e){return tS(e)&&nS(e)},UT=function(e){var t,n=e.id||Oi("h");return QC("header",eS(e),"#"+n,tS(t=e)?parseInt(t.nodeName.substr(1),10):0,(function(){e.id=n}))},jT=function(e){var t=e.id||e.name;e=eS(e);return QC("anchor",e||"#"+t,"#"+t,0,n)},WT=function(e){return e=FT("h1,h2,h3,h4,h5,h6,a:not([href])",e),Ie(Me(Ie(e,VT),UT).concat(Me(Ie(e,HT),jT)),rS)},qT="tinymce-url-history",$T=Object.prototype.hasOwnProperty,GT=function(e){return{getHistory:uS,addToHistory:cS,getLinkInformation:function(){return!1===(t=e).settings.typeahead_urls?ye.none():ye.some({targets:WT(t.getBody()),anchorTop:fS(t.settings,"anchor_top","#top").getOrUndefined(),anchorBottom:fS(t.settings,"anchor_bottom","#bottom").getOrUndefined()});var t},getValidationHandler:function(){return t=e,ye.from(t.settings.file_picker_validator_handler).filter(Te).orThunk((function(){return ye.from(t.settings.filepicker_validator_handler).filter(Te)}));var t},getUrlPicker:function(t){return r=t,mS((n=e).settings,r).map((function(e){return function(t){return Xb.nu((function(o){var i=yC.extend({filetype:r},ye.from(t.meta).getOr({}));e.call(n,(function(e,t){if(!xe(e))throw new Error("Expected value to be string");if(void 0!==t&&!Ce(t))throw new Error("Expected meta to be a object");o({value:e,meta:t})}),t.value,i)}))}}));var n,r}}},XT="contexttoolbar-hide",YT=($d=o([on("dom"),ln("shell",!0),gs("toolbarBehaviours",[rm])]),qd=o([Gl({name:"groups",overrides:function(e){return{behaviours:ac([rm.config({})])}}})]),uf({name:"Toolbar",configFields:$d(),partFields:qd(),factory:function(e,n,r,o){return n=e.shell?{behaviours:[rm.config({})],components:[]}:{behaviours:[],components:n},{uid:e.uid,dom:e.dom,components:n.components,behaviours:Bl(e.toolbarBehaviours,n.behaviours),apis:{setGroups:function(n,r){n=n,(e.shell?ye.some(n):Ql(n,e,"groups")).fold((function(){throw t.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(e){rm.set(e,r)}))}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(e,t,n){e.setGroups(t,n)}}})),KT=uo("within","extra","withinWidth"),JT=function(e,t,n,r){var o,i=Ss(e,t,"primary"),a=Ql(e,t,"overflow-button"),u=(e=ny.getCoupled(e,"overflowGroup"),oa(i.element(),"visibility","hidden"),o=a,n.bind((function(e){return gc(e.element()).bind((function(t){return e.getSystem().getByDom(t).toOption()}))})).orThunk((function(){return o.filter(am.isFocused)}))),c=(t=(n.each((function(e){YT.setGroups(e,[])})),t.builtGroups.get()),vS(i,t.concat([e])),nu(i.element())),s=pS(c,t,(function(e){return nu(e.element())}),e);0===s.extra().length?(rm.remove(i,e),n.each((function(e){YT.setGroups(e,[])}))):(vS(i,s.within()),n.each((function(e){vS(e,s.extra())}))),ca(i.element(),"visibility"),sa(i.element()),n.each((function(e){a.each((function(t){return sm.set(t,r(e))})),u.each(am.focus)}))},ZT=(Wn=o([on("items"),Ca(["itemSelector"]),gs("tgroupBehaviours",[nm])]),jl=o([lc({name:"items",unit:"item"})]),uf({name:"ToolbarGroup",configFields:Wn(),partFields:jl(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:Bl(e.tgroupBehaviours,[nm.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}})),QT=(Yn=o([gs("splitToolbarBehaviours",[ny]),dn("builtGroups",(function(){return mn([])}))]),Wl=o([Ca(["overflowToggledClass"]),on("getAnchor"),te("getOverflowBounds"),on("lazySink")].concat(Yn())),ql=o([$l({factory:YT,schema:$d(),name:"primary"}),Tc({factory:YT,schema:$d(),name:"overflow",overrides:function(e){return{toolbarBehaviours:ac([nm.config({mode:"cyclic",onEscape:function(t){return Ql(t,e,"overflow-button").each(am.focus),ye.none()}})])}}}),Tc({name:"overflow-button",overrides:function(e){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ac([sm.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Tc({name:"overflow-group"})]),function(e){return e.getSystem().isConnected()}),eE=function(e,t,n){var r=t.lazySink(e).getOrDie();e=t.getAnchor(e),t=t.getOverflowBounds.map((function(e){return e()}));dl.positionWithinBounds(r,e,n,t)},tE=function(e,t){var n=Sl.getState(ny.getCoupled(e,"sandbox"));JT(e,t,n,QT),n.each((function(n){return eE(e,t,n)}))},nE=function(e,t){Sl.getState(ny.getCoupled(e,"sandbox")).each((function(n){return eE(e,t,n)}))},rE=uf({name:"SplitFloatingToolbar",configFields:Wl(),partFields:ql(),factory:function(e,t,n,r){return bS(e,t,0,r,{coupling:{sandbox:function(t){return n=t,r=e,{dom:{tag:"div",attributes:{id:(i=yu()).id()}},behaviours:ac([nm.config({mode:"special",onEscape:function(e){return Sl.close(e),ye.some(!0)}}),Sl.config({onOpen:function(e,t){tE(n,r),Ql(n,r,"overflow-button").each((function(e){sm.on(e),i.link(e.element())})),nm.focusIn(t)},onClose:function(){Ql(n,r,"overflow-button").each((function(e){sm.off(e),am.focus(e),i.unlink(e.element())}))},isPartOf:function(e,t,r){return xu(t,r)||xu(n,r)},getAttachPoint:function(){return r.lazySink(n).getOrDie()}}),fc.config({channels:d({},Dl({isExtraPart:o(!1),doReposition:function(){return nE(n,r)}}))})])};var n,r,i}},apis:{refresh:function(t){return tE(t,e)},toggle:function(e){var t=r;e=ny.getCoupled(e,"sandbox"),Sl.isOpen(e)?Sl.close(e):Sl.open(e,t.overflow())},getOverflow:function(e){return Sl.getState(ny.getCoupled(e,"sandbox"))},reposition:function(t){return nE(t,e)}}})},apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)},reposition:function(e,t){e.reposition(t)},getMoreButton:function(e,t){return e.getMoreButton(t)},getOverflow:function(e,t){return e.getOverflow(t)},toggle:function(e,t){e.toggle(t)}}}),oE=function(e,t){return t.getAnimationRoot.fold((function(){return e.element()}),(function(t){return t(e)}))},iE=function(e){return e.dimension.property},aE=function(e,t){return e.dimension.getDimension(t)},uE=function(e,t){e=oE(e,t),ea(e,[t.shrinkingClass,t.growingClass])},cE=function(e,t){Ji(e.element(),t.openClass),Yi(e.element(),t.closedClass),oa(e.element(),iE(t),"0px"),sa(e.element())},sE=function(e,t){Ji(e.element(),t.closedClass),Yi(e.element(),t.openClass),ca(e.element(),iE(t))},lE=function(e,t,n,r){n.setCollapsed(),oa(e.element(),iE(t),aE(t,e.element())),sa(e.element()),uE(e,t),cE(e,t),t.onStartShrink(e),t.onShrunk(e)},fE=function(e,t,n,r){r=r.getOrThunk((function(){return aE(t,e.element())})),n.setCollapsed(),oa(e.element(),iE(t),r),sa(e.element()),n=oE(e,t),Ji(n,t.growingClass),Yi(n,t.shrinkingClass),cE(e,t),t.onStartShrink(e)},dE=(em=Object.freeze({refresh:function(e,t,n){n.isExpanded()&&(ca(e.element(),iE(t)),n=aE(t,e.element()),oa(e.element(),iE(t),n))},grow:function(e,t,n){n.isExpanded()||wS(e,t,n)},shrink:function(e,t,n){n.isExpanded()&&yS(e,t,n)},immediateShrink:function(e,t,n){n.isExpanded()&&lE(e,t,n)},hasGrown:function(e,t,n){return n.isExpanded()},hasShrunk:function(e,t,n){return n.isCollapsed()},isGrowing:xS,isShrinking:CS,isTransitioning:function(e,t,n){return!0===xS(e,t)||!0===CS(e,t)},toggleGrow:function(e,t,n){(n.isExpanded()?yS:wS)(e,t,n)},disableTransitions:uE}),Pu=Object.freeze({exhibit:function(e,t){var n=t.expanded;return So(n?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:wt(t.dimension.property,"0px")})},events:function(e,t){return Go([Jo(wr(),(function(n,r){r.event().raw().propertyName===e.dimension.property&&(uE(n,e),t.isExpanded()&&ca(n.element(),e.dimension.property),(t.isExpanded()?e.onGrown:e.onShrunk)(n))}))])}}),tm=[on("closedClass"),on("openClass"),on("shrinkingClass"),on("growingClass"),Z("getAnimationRoot"),ka("onShrunk"),ka("onStartShrink"),ka("onGrown"),ka("onStartGrow"),ln("expanded",!1),an("dimension",U("property",{width:[Bu("property","width"),Bu("getDimension",(function(e){return nu(e)+"px"}))],height:[Bu("property","height"),Bu("getDimension",(function(e){return Ya(e)+"px"}))]}))],Ba({fields:tm,name:"sliding",active:Pu,apis:em,state:Object.freeze({init:function(e){var t=mn(e.expanded);return Hi({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:a(t.set,!1),setExpanded:a(t.set,!0),readState:function(){return"expanded: "+t.get()}})}})})),mE=(Wd=o([Ca(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),ka("onOpened"),ka("onClosed")].concat(Yn())),Sc=o([$l({factory:YT,schema:$d(),name:"primary"}),$l({factory:YT,schema:$d(),name:"overflow",overrides:function(e){return{toolbarBehaviours:ac([dE.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:function(t){Ql(t,e,"overflow-button").each((function(e){sm.off(e),am.focus(e)})),e.onClosed(t)},onGrown:function(t){nm.focusIn(t),e.onOpened(t)},onStartGrow:function(t){Ql(t,e,"overflow-button").each(sm.on)}}),nm.config({mode:"acyclic",onEscape:function(t){return Ql(t,e,"overflow-button").each(am.focus),ye.some(!0)}})])}}}),Tc({name:"overflow-button",overrides:function(e){return{buttonBehaviours:ac([sm.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Tc({name:"overflow-group"})]),function(e){return dE.hasGrown(e)}),gE=function(e,t){var n=Ql(e,t,"overflow");JT(e,t,n,mE),n.each(dE.refresh)},hE=uf({name:"SplitSlidingToolbar",configFields:Wd(),partFields:Sc(),factory:function(e,t,n,r){return bS(e,t,0,r,{coupling:{},apis:{refresh:function(t){return gE(t,e)},toggle:function(t){var n,r;Ql(n=t,r=e,"overflow").each((function(e){gE(n,r),dE.toggleGrow(e)}))},getOverflow:function(t){return Ql(t,e,"overflow")}}})},apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)},getMoreButton:function(e,t){return e.getMoreButton(t)},getOverflow:function(e,t){return e.getOverflow(t)},toggle:function(e,t){e.toggle(t)}}}),pE="silver.readonly",vE=zt([an("readonly",tn)]),bE=function(e,t){var n,r,o=e.outerContainer;n=t,r=(e=e).outerContainer.element(),n&&(e.mothership.broadcastOn([kl()],{target:r}),e.uiMothership.broadcastOn([kl()],{target:r})),e.mothership.broadcastOn([pE],{readonly:n}),e.uiMothership.broadcastOn([pE],{readonly:n}),Qn("*",o.element()).forEach((function(e){o.getSystem().getByDom(e).each((function(e){e.hasConfigured(uh)&&uh.set(e,t)}))}))},yE=o(Oi("toolbar-height-change")),wE=function(e,t,n){var r=Zo((function(t){var n=Me(e.initGroups,ES);YT.setGroups(t,n)}));return ac([nm.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),im("toolbar-events",[r]),kS(n)])},xE=function(e,t){var n=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":TS({title:ye.none(),items:[]}),"overflow-button":Ax({name:"more",icon:ye.some("more-drawer"),disabled:!1,tooltip:ye.some("More..."),primary:!1,borderless:!1},ye.none(),e.backstage.shared.providers)},splitToolbarBehaviours:wE(e,n,t)}},CE=(qn=[ie("disabled",!1),ee("tooltip"),ee("icon"),ee("text"),ae("onSetup",(function(){return n}))],zt([$("type"),X("onAction")].concat(qn))),SE=(Xd=[ee("text"),ee("tooltip"),ee("icon"),X("fetch"),ae("onSetup",(function(){return n}))],zt(g([$("type")],Xd))),kE=zt([$("type"),ee("tooltip"),ee("icon"),ee("text"),te("select"),X("fetch"),ae("onSetup",(function(){return n})),oe("presets","normal",["normal","color","listpreview"]),ln("columns",1),X("onAction"),X("onItemAction")]),TE=(Ys=[ie("active",!1)].concat(qn),zt(Ys.concat([$("type"),X("onAction")]))),EE=(qd=[ae("predicate",(function(){return!1})),oe("scope","node",["node","editor"]),oe("position","selection",["node","selection","line"])],Wn=qn.concat([ln("type","contextformbutton"),ln("primary",!1),X("onAction"),dn("original",i)]),jl=Ys.concat([ln("type","contextformbutton"),ln("primary",!1),X("onAction"),dn("original",i)]),Wl=qn.concat([ln("type","contextformbutton")]),ql=Ys.concat([ln("type","contextformtogglebutton")]),tm=U("type",{contextformbutton:Wn,contextformtogglebutton:jl}),zt([ln("type","contextform"),ae("initValue",(function(){return""})),ee("label"),J("commands",tm),un("launch",U("type",{contextformbutton:Wl,contextformtogglebutton:ql}))].concat(qd))),OE=zt([ln("type","contexttoolbar"),$("items")].concat(qd)),NE=(Pu=Object.freeze({getState:function(e,t,n){return n}}),em=Object.freeze({events:function(e,t){function n(n,r){e.updateState.each((function(e){e=e(n,r),t.set(e)})),e.renderComponents.each((function(e){e=e(r,t.get()),e=Me(e,n.getSystem().build),es(n,e)}))}return Go([Xo(Tr(),(function(t,r){var o=e.channel;Re(r.channels(),o)&&n(t,r.data())})),Zo((function(t,r){e.initialData.each((function(e){n(t,e)}))}))])}}),Yn=Object.freeze({init:function(e){var t=mn(ye.none());return{readState:function(){return t.get().fold((function(){return"none"}),(function(e){return e}))},get:function(){return t.get()},set:function(e){return t.set(e)},clear:function(){return t.set(ye.none())}}}}),$d=[on("channel"),Z("renderComponents"),Z("updateState"),Z("initialData")],Ba({fields:$d,name:"reflecting",active:em,apis:Pu,state:Yn})),AE=(Wd=o([on("toggleClass"),on("fetch"),Ea("onExecute"),ln("getHotspot",ye.some),ln("getAnchorOverrides",o({})),ln("layouts",ye.none()),Ea("onItemExecute"),Z("lazySink"),on("dom"),ka("onOpen"),gs("splitDropdownBehaviours",[ny,nm,am]),ln("matchWidth",!1),ln("useMinWidth",!1),ln("eventOrder",{}),Z("role")].concat(Iv())),Sc=$l({factory:Am,schema:[on("dom")],name:"arrow",defaults:function(e){return{buttonBehaviours:ac([am.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(Yr)},buttonBehaviours:ac([sm.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])}}}),Xd=$l({factory:Am,schema:[on("dom")],name:"button",defaults:function(e){return{buttonBehaviours:ac([am.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each((function(n){e.onExecute(n,t)}))}}}}),qn=o([Sc,Xd,Gl({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[on("text")],name:"aria-descriptor"}),Tc({schema:[xa()],name:"menu",defaults:function(e){return{onExecute:function(t,n){t.getSystem().getByUid(e.uid).each((function(r){e.onItemExecute(r,t,n)}))}}}}),oy()]),uf({name:"SplitDropdown",configFields:Wd(),partFields:qn(),factory:function(e,t,r,o){function i(e){Od.getCurrent(e).each((function(e){Nd.highlightFirst(e),nm.focusIn(e)}))}function a(t){Mv(e,(function(e){return e}),t,o,i,xb.HighlightFirst).get(n)}function u(t){return t=Ss(t,e,"button"),Yr(t),ye.some(!0)}var c=ct(Go([Zo((function(t,n){Ql(t,e,"aria-descriptor").each((function(e){var n=Oi("aria");wi(e.element(),"id",n),wi(t.element(),"aria-describedby",n)}))}))]),Cd(ye.some(a)));return{uid:e.uid,dom:e.dom,components:t,apis:{repositionMenus:function(e){sm.isOn(e)&&zv(e)}},eventOrder:d(d({},e.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:c,behaviours:Bl(e.splitDropdownBehaviours,[ny.config({others:{sandbox:function(t){var n=Ss(t,e,"arrow");return Pv(e,t,{onOpen:function(){sm.on(n),sm.on(t)},onClose:function(){sm.off(n),sm.off(t)}})}}}),nm.config({mode:"special",onSpace:u,onEnter:u,onDown:function(e){return a(e),ye.some(!0)}}),am.config({}),sm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(e,t){return e.repositionMenus(t)}}})),DE=function(e){return{isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)}}},_E=function(e){return{setActive:function(t){sm.set(e,t)},isActive:function(){return sm.isOn(e)},isDisabled:function(){return uh.isDisabled(e)},setDisabled:function(t){return uh.set(e,t)}}},RE=function(e,t){return e.map((function(e){return{"aria-label":t.translate(e),title:t.translate(e)}})).getOr({})},BE=Oi("focus-button"),ME=["checklist","ordered-list"],PE=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],zE=function(e,t,r){var o,i=mn(n);r=BS(e.icon,e.text,e.tooltip,ye.none(),ye.none(),r);return Am.sketch({dom:r.dom,components:r.components,eventOrder:Xx,buttonBehaviours:ac([im("toolbar-button-events",[(o={onAction:e.onAction,getApi:t.getApi},ti((function(e,t){sh(o,e)((function(t){Xr(e,Gx,{buttonApi:t}),o.onAction(t)}))}))),lh(t,i),fh(t,i)]),ch.toolbarButton(e.disabled)].concat(t.toolbarButtonBehaviours))})},IE=function(e,t,n){var r,o,i,a;n={backstage:{shared:{providers:n}}};return"contextformtogglebutton"===t.type?(r=e,i=n,(a=(o=t).original).primary,a=m(a,["primary"]),a=Xt(RS(d(d({},a),{type:"togglebutton",onAction:function(){}}))),PS(a,i.backstage.shared.providers,[IS(r,o)])):(a=e,i=n,(o=(r=t).original).primary,o=m(o,["primary"]),o=Xt(DS(d(d({},o),{type:"button",onAction:function(){}}))),MS(o,i.backstage.shared.providers,[IS(a,r)]))},LE=function(e,t){var n,r,o,i,a=e.label.fold((function(){return{}}),(function(e){return{"aria-label":e}})),u=(a=Dm(jb.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:e.initValue(),inputAttributes:a,selectOnFocus:!0,inputBehaviours:ac([nm.config({mode:"special",onEnter:function(e){return u.findPrimary(e).map((function(e){return Yr(e),!0}))},onLeft:function(e,t){return t.cut(),ye.none()},onRight:function(e,t){return t.cut(),ye.none()}})])})),n=a,r=e.commands,o=t.shared.providers,i=Me(r,(function(e){return Dm(IE(n,e,o))})),{asSpecs:function(){return Me(i,(function(e){return e.asSpec()}))},findPrimary:function(e){return Su(r,(function(t,n){return t.primary?ye.from(i[n]).bind((function(t){return t.getOpt(e)})).filter(c(uh.isDisabled)):ye.none()}))}});return AS({uid:Oi("context-toolbar"),initGroups:[{title:ye.none(),items:[a.asSpec()]},{title:ye.none(),items:u.asSpecs()}],onEscape:ye.none,cyclicKeying:!0,backstage:t,getSink:function(){return we.error("")}})},FE=function(e,t,n){var r=LS(t,n),o=r.x,i=(r=r.width,e=gn.fromDom(e.getContainer()),vu(e,".tox-editor-header").getOr(e));e=du(e),i=du(i),t=Math.max(n.y(),t.y(),i.bottom()),i=e.bottom()-t,e=n.height()-(t-n.y()),n=Math.min(i,e);return fu(o,t,r,n)},HE=function(e,t,n){var r=LS(t,n),o=r.x,i=(r=r.width,e=gn.fromDom(e.getContainer()),e=vu(e,".tox-editor-header").getOr(e),e=du(e),n.height());n=n.y();return e.y()>=t.bottom()?(t=Math.min(i+n,e.y()),fu(o,n,r,t-n)):(t=Math.max(n,e.bottom()),fu(o,t,r,i-(t-n)))},VE=function(e,t,n){t=LS(t,n);var r=t.x;t=t.width;return fu(r,n.y(),t,n.height())},UE=function(e,t){function n(e){return e.dom()===t.getBody()}var r=gn.fromDom(t.selection.getNode());return HS(r,e.inNodeScope).orThunk((function(){return HS(r,e.inEditorScope).orThunk((function(){for(var t=function(t){return HS(t,e.inNodeScope)},i=n,a=r.dom(),u=Te(i)?i:o(!1);a.parentNode;){a=a.parentNode;var c=gn.fromDom(a),s=t(c);if(s.isSome())return s;if(u(c))break}return ye.none()}))}))},jE=function(e,t){function n(e,n){var r=Xt(Gt("ContextForm",EE,n));(o[e]=r).launch.map((function(o){u["form:"+e]=d(d({},n.launch),{type:"contextformtogglebutton"===o.type?"togglebutton":"button",onAction:function(){t(r)}})})),("editor"===r.scope?a:i).push(r),c[e]=r}function r(e,t){Gt("ContextToolbar",OE,t).each((function(n){("editor"===t.scope?a:i).push(n),c[e]=n}))}var o={},i=[],a=[],u={},c={},s=Ke(e);return Pe(s,(function(t){var o=e[t];"contextform"===o.type?n(t,o):"contexttoolbar"===o.type&&r(t,o)})),{forms:o,inNodeScope:i,inEditorScope:a,lookupTable:c,formNavigators:u}},WE=Oi("forward-slide"),qE=Oi("backward-slide"),$E=Oi("change-slide-event"),GE="tox-pop--resizing",XE=function(e){return function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))}}},YE=function(e,t,n){var r=n.dataset,o="basic"===r.type?function(){return Me(r.data,(function(e){return KC(e,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:US(0,t,n),getStyleItems:o}},KE=function(e){return{type:"basic",data:e}},JE=((Ys=aT=aT||{})[Ys.SemiColon=0]="SemiColon",Ys[Ys.Space=1]="Space",function(e,t,n,r){return e=yt(e.settings,t).getOr(n),t=e,n=r===aT.SemiColon?t.replace(/;$/,"").split(";"):t.split(" "),{type:"basic",data:Me(n,(function(e){var t=e,n=e;e=e.split("=");return 1<e.length&&(t=e[0],n=e[1]),{title:t,format:n}}))}}),ZE=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],QE=function(e){function t(t){var n=He(ZE,(function(t){return e.formatter.match(t.format)})).fold((function(){return"left"}),(function(e){return e.title.toLowerCase()}));Xr(t,Kx,{icon:"align-"+n})}var n=ye.some((function(e){return function(){return t(e)}})),r=ye.some(t),i=KE(ZE);return{tooltip:"Align",icon:ye.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:o(ye.none()),getPreviewFor:function(e){return function(){return ye.none()}},onAction:XE(e),setInitialValue:r,nodeChangeHandler:n,dataset:i,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},eO="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",tO=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],nO=function(e){return e=e.split(/\s*,\s*/),Me(e,(function(e){return e.replace(/^['"]+|['"]+$/g,"")}))},rO=function(e){var t;return 0===e.indexOf("-apple-system")&&(t=nO(e.toLowerCase()),We(tO,(function(e){return-1<t.indexOf(e.toLowerCase())})))},oO=function(e){function t(){function t(e){return e?nO(e)[0]:""}var n=e.queryCommandValue("FontName"),r=i.data,o=n?n.toLowerCase():"";return{matchOpt:He(r,(function(e){return e=e.format,e.toLowerCase()===o||t(e).toLowerCase()===t(o).toLowerCase()})).orThunk((function(){return rO(o)?ye.from({title:"System Font",format:o}):ye.none()})),font:n}}function n(e){var n=(o=t()).matchOpt,r=o.font,o=n.fold((function(){return r}),(function(e){return e.title}));Xr(e,Yx,{text:o})}var r=ye.some((function(e){return function(){return n(e)}})),o=ye.some(n),i=JE(e,"font_formats",eO,aT.SemiColon);return{tooltip:"Fonts",icon:ye.none(),isSelectedFor:function(e){return function(t){return t.exists((function(t){return t.format===e}))}},getCurrentValue:function(){return t().matchOpt},getPreviewFor:function(e){return function(){return ye.some({tag:"div",styleAttr:-1===e.indexOf("dings")?"font-family:"+e:""})}},onAction:function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("FontName",!1,t.format)}))}},setInitialValue:o,nodeChangeHandler:r,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},iO="8pt 10pt 12pt 14pt 18pt 24pt 36pt",aO={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},uO=function(e,t){return/[0-9.]+px$/.test(e)?function(e,t){return t=Math.pow(10,t),Math.round(e*t)/t}(72*parseInt(e,10)/96,t||0)+"pt":e},cO=function(e){return rt(aO,e).getOr("")},sO=function(e){function t(){var t=ye.none(),n=u.data,r=e.queryCommandValue("FontSize");if(r)for(var o=3;t.isNone()&&0<=o;o--)!function(e){var o=uO(r,e),i=cO(o);t=He(n,(function(e){return e.format===r||e.format===o||e.format===i}))}(o);return{matchOpt:t,px:r}}function n(e){var n=(o=t()).matchOpt,r=o.px,o=n.fold((function(){return r}),(function(e){return e.title}));Xr(e,Yx,{text:o})}var r=o(o(ye.none())),i=ye.some((function(e){return function(){return n(e)}})),a=ye.some(n),u=JE(e,"fontsize_formats",iO,aT.Space);return{tooltip:"Font sizes",icon:ye.none(),isSelectedFor:function(e){return function(t){return t.exists((function(t){return t.format===e}))}},getPreviewFor:r,getCurrentValue:function(){return t().matchOpt},onAction:function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("FontSize",!1,t.format)}))}},setInitialValue:a,nodeChangeHandler:i,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},lO=function(e,t,n){var r=t();return Su(n,(function(t){return He(r,(function(n){return e.formatter.matchNode(t,n.format)}))})).orThunk((function(){return e.formatter.match("p")?ye.some({title:"Paragraph",format:"p"}):ye.none()}))},fO=function(e){var t=e.selection.getStart(!0)||e.getBody();return e.dom.getParents(t,(function(){return!0}),e.getBody())},dO="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",mO=function(e){function t(t,n){t=lO(e,(function(){return i.data}),t).fold((function(){return"Paragraph"}),(function(e){return e.title})),Xr(n,Yx,{text:t})}var n=ye.some((function(e){return function(n){return t(n.parents,e)}})),r=ye.some((function(n){var r=fO(e);t(r,n)})),i=JE(e,"block_formats",dO,aT.SemiColon);return{tooltip:"Blocks",icon:ye.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:o(ye.none()),getPreviewFor:function(t){return function(){var n=e.formatter.get(t);return ye.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:e.formatter.getCssText(t)})}},onAction:XE(e),setInitialValue:r,nodeChangeHandler:n,dataset:i,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},gO=function(e,t){function n(t,n){function r(e){var t=e.items;return void 0!==t&&0<t.length?je(t,r):[{title:e.title,format:e.format}]}var o=je(BT(e),r);t=lO(e,(function(){return o}),t).fold((function(){return"Paragraph"}),(function(e){return e.title}));Xr(n,Yx,{text:t})}var r=ye.some((function(e){return function(t){return n(t.parents,e)}})),i=ye.some((function(t){var r=fO(e);n(r,t)}));return{tooltip:"Formats",icon:ye.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:o(ye.none()),getPreviewFor:function(t){return function(){var n=e.formatter.get(t);return void 0!==n?ye.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:e.formatter.getCssText(t)}):ye.none()}},onAction:XE(e),setInitialValue:i,nodeChangeHandler:r,shouldHide:e.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!e.formatter.canApply(t.format)},dataset:t}},hO=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],pO={button:WS(DS,(function(e,t){return t=t.backstage.shared.providers,MS(e,t,[])})),togglebutton:WS(RS,(function(e,t){return t=t.backstage.shared.providers,PS(e,t,[])})),menubutton:WS(_S,(function(e,t){return Ox(e,"tox-tbtn",t.backstage,ye.none())})),splitbutton:WS((function(e){return Gt("SplitButton",kE,e)}),(function(e,t){return zS(e,t.backstage.shared)})),styleSelectButton:function(e,t){return e=e,t=t.backstage,n=d({type:"advanced"},t.styleselect),jS(e,t,gO(e,n));var n},fontsizeSelectButton:function(e,t){return t=t.backstage,jS(e,t,sO(e))},fontSelectButton:function(e,t){return t=t.backstage,jS(e,t,oO(e))},formatButton:function(e,t){return t=t.backstage,jS(e,t,mO(e))},alignMenuButton:function(e,t){return t=t.backstage,jS(e,t,QE(e))}},vO={styleselect:pO.styleSelectButton,fontsizeselect:pO.fontsizeSelectButton,fontselect:pO.fontSelectButton,formatselect:pO.formatButton,align:pO.alignMenuButton},bO=function(e){var n,r=e.toolbar;e=e.buttons;return!1===r?[]:void 0===r||!0===r?(n=e,e=Me(hO,(function(e){var t=Ie(e.items,(function(e){return ot(n,e)||ot(vO,e)}));return{name:e.name,items:t}})),Ie(e,(function(e){return 0<e.items.length}))):xe(r)?(e=(e=r).split("|"),Me(e,(function(e){return{items:e.trim().split(" ")}}))):Oe(r,(function(e){return ot(e,"name")&&ot(e,"items")}))?r:(t.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},yO=function(e,n,r,o,i){return rt(n,r.toLowerCase()).orThunk((function(){return i.bind((function(e){return Su(e,(function(e){return rt(n,e+r.toLowerCase())}))}))})).fold((function(){return rt(vO,r.toLowerCase()).map((function(t){return t(e,o)})).orThunk((function(){return ye.none()}))}),(function(e){return r=o,rt(pO,(n=e).type).fold((function(){return t.console.error("skipping button defined by",n),ye.none()}),(function(e){return ye.some(e(n,r))}));var n,r}))},wO=function(e,t,n,r){var o=bO(t);o=Me(o,(function(o){var i=je(o.items,(function(o){return 0===o.trim().length?[]:yO(e,t.buttons,o,n,r).toArray()}));return{title:ye.from(e.translate(o.name)),items:i}}));return Ie(o,(function(e){return 0<e.items.length}))},xO=12,CO={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"]},SO={maxHeightFunction:cl(),maxWidthFunction:OT()},kO={onLtr:function(){return[Qu,ec,Ju,Yu,Zu,Ku,Om,Nm,Tm,wd,Em,xd]},onRtl:function(){return[Qu,ec,Zu,Ku,Ju,Yu,Om,Nm,Em,xd,Tm,wd]}},TO={onLtr:function(){return[ec,Yu,Ku,Ju,Zu,Qu,Om,Nm,Tm,wd,Em,xd]},onRtl:function(){return[ec,Ku,Yu,Zu,Ju,Qu,Om,Nm,Em,xd,Tm,wd]}},EO=function(e,t,n,r){function o(){return FS(e,p)}function i(){if(g()&&r.backstage.isContextMenuOpen())return 1;var t=y.get().map((function(e){return e.getBoundingClientRect()})).getOrThunk((function(){return e.selection.getRng().getBoundingClientRect()})),n=lo(gn.fromDom(e.getBody())).dom().innerHeight,o=t.bottom<0;n=t.top>n;return o||n||v(t)}function a(){km.hide(h)}function u(){b.get().each((function(e){var t=h.element();ca(t,"display"),i()?oa(t,"display","none"):dl.positionWithinBounds(n,e,h,o())}))}function c(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ac([nm.config({mode:"acyclic"}),im("pop-dialog-wrap-events",[Zo((function(t){e.shortcuts.add("ctrl+F9","focus statusbar",(function(){return nm.focusIn(t)}))})),Qo((function(t){e.shortcuts.remove("ctrl+F9")}))])])}}function s(e,t){t="node"===e?r.backstage.shared.anchors.node(t):r.backstage.shared.anchors.cursor();return ut(t,(t=e,e=g(),"line"===t?{bubble:pc(xO,0,CO),layouts:{onLtr:function(){return[tc]},onRtl:function(){return[nc]}},overrides:SO}:{bubble:pc(0,xO,CO),layouts:e?TO:kO,overrides:SO}))}function l(){var t=x();UE(t,e).fold((function(){b.set(ye.none()),km.hide(h)}),(function(e){S(e.toolbarApi,ye.some(e.elem.dom()))}))}function f(e){k(),w.set(e)}var d,m,g=Xn().deviceType.isTouch,h=pa((d={sink:n,onEscape:function(){return e.focus(),ye.some(!0)}},m=mn([]),km.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(e){m.set([]),km.getContent(e).each((function(e){ca(e.element(),"visibility")})),Ji(e.element(),GE),ca(e.element(),"width")},inlineBehaviours:ac([im("context-toolbar-events",[Jo(wr(),(function(e,t){km.getContent(e).each((function(e){})),Ji(e.element(),GE),ca(e.element(),"width")})),Xo($E,(function(e,t){ca(e.element(),"width");var n=nu(e.element()),r=(km.setContent(e,t.event().contents()),Yi(e.element(),GE),nu(e.element()));oa(e.element(),"width",n+"px"),km.getContent(e).each((function(n){t.event().focus().bind((function(t){return dc(t),gc(e.element())})).orThunk((function(){return nm.focusIn(n),mc()}))})),zm.setTimeout((function(){oa(e.element(),"width",r+"px")}),0)})),Xo(WE,(function(e,t){km.getContent(e).each((function(e){m.set(m.get().concat([{bar:e,focus:mc()}]))})),Xr(e,$E,{contents:t.event().forwardContents(),focus:ye.none()})})),Xo(qE,(function(e,t){Xe(m.get()).each((function(t){m.set(m.get().slice(0,m.get().length-1)),Xr(e,$E,{contents:va(t.bar),focus:t.focus})}))}))]),nm.config({mode:"special",onEscape:function(e){return Xe(m.get()).fold((function(){return d.onEscape()}),(function(t){return Gr(e,qE),ye.some(!0)}))}})]),lazySink:function(){return we.value(d.sink)}}))),p=Tb(e)||Eb(e)||Nb(e),v=function(t){var n,r=vu(gn.fromDom(e.getContainer()),".tox-editor-header").getOrDie(),o="fixed"===Do(r,"position");return!(!p||!o)&&(o=r.dom().getBoundingClientRect(),e.inline?t.bottom<o.bottom:(r=ou(),n=mu(gn.fromDom(e.getBody())),t.bottom+(n.y()-r.top())<o.bottom))},b=mn(ye.none()),y=mn(ye.none()),w=mn(null),x=N((function(){return jE(t,(function(e){e=C(e),Xr(h,WE,{forwardContents:c(e)})}))})),C=function(t){var n=e.ui.registry.getAll().buttons,o=x();return"contexttoolbar"===t.type?(n=ct(n,o.formNavigators),n=wO(e,{buttons:n,toolbar:t.items},r,ye.some(["form:"])),AS({uid:Oi("context-toolbar"),initGroups:n,onEscape:ye.none,cyclicKeying:!0,backstage:r.backstage,getSink:function(){return we.error("")}})):LE(t,r.backstage)},S=(e.on("contexttoolbar-show",(function(t){var n=x();yt(n.lookupTable,t.toolbarKey).each((function(n){S(n,t.target===e?ye.none():ye.some(t)),km.getContent(h).each(nm.focusIn)}))})),function(e,t){var n,a;k(),g()&&r.backstage.isContextMenuOpen()||(n=C(e),a=t.map(gn.fromDom),e=s(e.position,a),b.set(ye.some(e)),y.set(t),a=h.element(),ca(a,"display"),km.showWithinBounds(h,e,c(n),o),i()&&oa(a,"display","none"))}),k=function(){var e=w.get();null!==e&&(zm.clearTimeout(e),w.set(null))};e.on("init",(function(){e.on(XT,a),e.on("ScrollContent ScrollWindow longpress",u),e.on("click keyup SetContent ObjectResized ResizeEditor",(function(t){f(zm.setEditorTimeout(e,l,0))})),e.on("focusout",(function(t){zm.setEditorTimeout(e,(function(){gc(n.element()).isNone()&&gc(h.element()).isNone()&&(b.set(ye.none()),km.hide(h))}),0)})),e.on("SwitchMode",(function(){e.readonly&&(b.set(ye.none()),km.hide(h))})),e.on("NodeChange",(function(t){gc(h.element()).fold((function(){f(zm.setEditorTimeout(e,l,0))}),(function(e){}))}))}))},OO=function(e,n,r){function o(e){Pe([n,r],(function(t){t.broadcastOn([kl()],{target:gn.fromDom(e.target)})}))}function i(e){0===e.button&&Pe([n,r],(function(t){t.broadcastOn([El()],{target:gn.fromDom(e.target)})}))}function a(e){var t=ov(e);Pe([n,r],(function(e){e.broadcastEvent(zr(),t)}))}function u(e){var t=ov(e);Pe([n,r],(function(e){e.broadcastOn([Tl()],{}),e.broadcastEvent(Ir(),t)}))}function c(){Pe([n,r],(function(e){e.broadcastOn([Tl()],{})}))}var s=nv(gn.fromDom(t.document),"mousedown",(function(e){Pe([n,r],(function(t){t.broadcastOn([kl()],{target:e.target()})}))})),l=nv(gn.fromDom(t.document),"touchstart",(function(e){Pe([n,r],(function(t){t.broadcastOn([kl()],{target:e.target()})}))})),f=nv(gn.fromDom(t.document),"touchmove",(function(e){Pe([n,r],(function(t){t.broadcastEvent(Mr(),e)}))})),d=nv(gn.fromDom(t.document),"touchend",(function(e){Pe([n,r],(function(t){t.broadcastEvent(Pr(),e)}))})),m=nv(gn.fromDom(t.document),"mouseup",(function(e){0===e.raw().button&&Pe([n,r],(function(t){t.broadcastOn([El()],{target:e.target()})}))}));e.on("PostRender",(function(){e.on("mousedown",o),e.on("touchstart",o),e.on("mouseup",i),e.on("ScrollWindow",a),e.on("ResizeWindow",u),e.on("ResizeEditor",c)})),e.on("remove",(function(){e.off("mousedown",o),e.off("touchstart",o),e.off("mouseup",i),e.off("ScrollWindow",a),e.off("ResizeWindow",u),e.off("ResizeEditor",c),s.unbind(),l.unbind(),f.unbind(),d.unbind(),m.unbind()})),e.on("detach",(function(){ns(n),ns(r),n.destroy(),r.destroy()}))},NO=(Wn=o([ln("shell",!1),on("makeItem"),ln("setupItem",n),Ml.field("listBehaviours",[rm])]),jl=Gl({name:"items",overrides:function(e){return{behaviours:ac([rm.config({})])}}}),tm=o([jl]),uf({name:o("CustomList")(),configFields:Wn(),partFields:tm(),factory:function(e,n,r,o){return n=e.shell?{behaviours:[rm.config({})],components:[]}:{behaviours:[],components:n},{uid:e.uid,dom:e.dom,components:n.components,behaviours:Bl(e.listBehaviours,n.behaviours),apis:{setItems:function(n,r){var o;o=n,(e.shell?ye.some(o):Ql(o,e,"items")).fold((function(){throw t.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(t){var o=rm.contents(t),i=r.length,a=i-o.length;a=0<a?function(e,t){for(var n=[],r=0;r<e;r++)n.push(t(r));return n}(a,(function(){return e.makeItem()})):[],o=o.slice(i),Pe(o,(function(e){return rm.remove(t,e)})),Pe(a,(function(e){return rm.append(t,e)})),i=rm.contents(t);Pe(i,(function(t,o){e.setupItem(n,t,r[o],o)}))}))}}}},apis:{setItems:function(e,t,n){e.setItems(t,n)}}})),AO=Ul,DO=(Wl=Ws,function(e){return(ua(e,"position").is("fixed")?ye.none():ai(e)).orThunk((function(){var t=gn.fromTag("span"),n=(fi(e,t),ai(t));return vi(t),n})).map(Qa).getOrThunk((function(){return Ja(0,0)}))}),_O=it([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),RO=function(e,t,n,r,o,i){return e=YS(e,o,i),t=YS(t,o,i),o=Math.abs(e.left()-t.left()),i=Math.abs(e.top()-t.top()),Ja(o,i)},BO=function(e,t,n){return e.fold((function(e,t){return{position:"absolute",left:e+"px",top:t+"px"}}),(function(e,t){return{position:"absolute",left:e-n.left()+"px",top:t-n.top()+"px"}}),(function(e,t){return{position:"fixed",left:e+"px",top:t+"px"}}))},MO=function(e,t,n,r){function o(e,o){return function(i,a){var u=e(t,n,r);return o(i.getOr(u.left()),a.getOr(u.top()))}}return e.fold(o(KS,_O.offset),o(YS,_O.absolute),o(XS,_O.fixed))},PO=_O.offset,zO=_O.absolute,IO=_O.fixed,LO=it([{static:[]},{absolute:["x","y"]},{fixed:["x","y"]}]),FO=function(e,t,n,r,o){var i,a,u;e=e.element();return ua(e,"position").is("fixed")?(u=n,tk(i=e,a=t).filter((function(e){return QS(a.modes,e,u)})).bind((function(e){return nk(i,a,e)}))):rk(e,t,n,r,o)},HO=function(e,t){var n=e.element();return tk(n,t).bind((function(e){return nk(n,t,e)}))},VO=function(e,t){Pe(["left","top","position"],(function(t){return ca(e.element(),t)})),t.onUndocked(e)},UO=function(e,t,n,r,o){o=BO(o,n,r),ia(e.element(),o),("fixed"===o.position?t.onDocked:t.onUndocked)(e)},jO=function(e,t,n,r,o){void 0===o&&(o=!1),t.contextual.each((function(t){t.lazyContext(e).each((function(i){a=r;var a;i=(i=i).y()<a.bottom()&&i.bottom()>a.y();i!==n.isVisible()&&(n.setVisible(i),o&&!i?(Qi(e.element(),[t.fadeOutClass]),t.onHide(e)):(i?JS:ZS)(e,t))}))}))},WO=function(e,t,n){var r,o,i,a,u,c,s;e.getSystem().isConnected()&&(r=e,i=n,a=(o=t).lazyViewport(r),e=r.element(),n=ri(e),u=ou(n),c=DO(e),(s=i.isDocked())&&jO(r,o,i,a),FO(r,o,a,u,c).each((function(e){i.setDocked(!s),e.fold((function(){return VO(r,o)}),(function(e,t){return UO(r,o,u,c,zO(e,t))}),(function(e,t){jO(r,o,i,a,!0),UO(r,o,u,c,IO(e,t))}))})))},qO=(ql=Object.freeze({refresh:WO,reset:ok,isDocked:function(e,t,n){return n.isDocked()}}),qd=Object.freeze({events:function(e,t){return Go([Jo(wr(),(function(n,r){e.contextual.each((function(e){Zi(n.element(),e.transitionClass)&&(ea(n.element(),[e.transitionClass,e.fadeInClass]),(t.isVisible()?e.onShown:e.onHidden)(n)),r.stop()}))})),Xo(zr(),(function(n,r){WO(n,e,t)})),Xo(Ir(),(function(n,r){ok(n,e,t)}))])}}),$d=[cn("contextual",[$("fadeInClass"),$("fadeOutClass"),$("transitionClass"),X("lazyContext"),ka("onShow"),ka("onShown"),ka("onHide"),ka("onHidden")]),ae("lazyViewport",gu),$("leftAttr"),$("topAttr"),$("positionAttr"),fn("modes",["top","bottom"],It(en)),ka("onDocked"),ka("onUndocked")],Ba({fields:$d,name:"docking",active:qd,apis:ql,state:Object.freeze({init:function(){var e=mn(!1),t=mn(!0);return Hi({isDocked:function(){return e.get()},setDocked:function(t){return e.set(t)},isVisible:function(){return t.get()},setVisible:function(e){return t.set(e)},readState:function(){return"docked: "+e.get()+", visible: "+t.get()}})}})})),$O={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},GO="tox-tinymce--toolbar-sticky-on",XO="tox-tinymce--toolbar-sticky-off",YO=Object.freeze({setup:function(e,t){e.inline||(e.on("ResizeWindow ResizeEditor ResizeContent",(function(){t().each(ik)})),e.on("SkinLoaded",(function(){t().each(qO.reset)}))),e.on("PostRender",(function(){uk(e,!1)}))},isDocked:function(e){return e().map(qO.isDocked).getOr(!1)},getBehaviours:ck}),KO=(em=n,Pu=s,o([])),JO=Object.freeze({setup:em,isDocked:Pu,getBehaviours:KO}),ZO=af({factory:function(e,t){var n={focus:nm.focusIn,setMenus:function(e,n){n=Me(n,(function(e){var n={type:"menubutton",text:e.text,fetch:function(t){t(e.getItems())}};n=_S(n).mapError((function(e){return Kt(e)})).getOrDie();return Ox(n,"tox-mbtn",t.backstage,ye.some("menuitem"))})),rm.set(e,n)}};return{uid:e.uid,dom:e.dom,components:[],behaviours:ac([rm.config({}),im("menubar-events",[Zo((function(t){e.onSetup(t)})),Xo(dr(),(function(e,t){vu(e.element(),".tox-mbtn--active").each((function(n){bu(t.event().target(),".tox-mbtn").each((function(t){tr(n,t)||e.getSystem().getByDom(n).each((function(n){e.getSystem().getByDom(t).each((function(e){dy.expand(e),dy.close(n),am.focus(e)}))}))}))}))})),Xo(Vr(),(function(e,t){t.event().prevFocus().bind((function(t){return e.getSystem().getByDom(t).toOption()})).each((function(n){t.event().newFocus().bind((function(t){return e.getSystem().getByDom(t).toOption()})).each((function(e){dy.isOpen(n)&&(dy.expand(e),dy.close(n))}))}))}))]),nm.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return e.onEscape(t),ye.some(!0)}}),Jb.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[on("dom"),on("uid"),on("onEscape"),on("backstage"),ln("onSetup",n)],apis:{focus:function(e,t){e.focus(t)},setMenus:function(e,t,n){e.setMenus(t,n)}}}),QO="container",eN=[gs("slotBehaviours",[])],tN=(Yn=Qe({getSlotNames:function(e,t){return e.getSlotNames(t)},getSlot:function(e,t,n){return e.getSlot(t,n)},isShowing:function(e,t,n){return e.isShowing(t,n)},hideSlot:function(e,t,n){return e.hideSlot(t,n)},hideAllSlots:function(e,t){return e.hideAllSlots(t)},showSlot:function(e,t,n){return e.showSlot(t,n)}},xo),d(d({},Yn),{sketch:function(e){t=[];var t,n={slot:function(e,n){return t.push(e),xs(QO,sk(e),n)},record:function(){return t}};e=e(n),n=n.record(),n=Me(n,(function(e){return $l({name:e,pname:sk(e)})}));return Os(QO,eN,n,lk,e)}})),nN=zt([ee("icon"),ee("tooltip"),ae("onShow",n),ae("onHide",n),ae("onSetup",(function(){return n}))]),rN=function(e){return tN.sketch((function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:dk(t,e),slotBehaviours:Pg.unnamedEvents([Zo((function(e){return tN.hideAllSlots(e)}))])}}))},oN=Oi("FixSizeEvent"),iN=Oi("AutoSizeEvent"),aN=function(e,t,n){var r=e.element();!0===t?(rm.set(e,[{dom:{tag:"div",attributes:{"aria-label":n.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:Gm('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ac([nm.config({mode:"special",onTab:function(){return ye.some(!0)},onShiftTab:function(){return ye.some(!0)}}),am.config({})])}]),ca(r,"display"),Si(r,"aria-hidden")):(rm.set(e,[]),oa(r,"display","none"),wi(r,"aria-hidden","true"))},uN=(Sc=Wl.optional({factory:ZO,name:"menubar",schema:[on("backstage")]}),Xd=Wl.optional({factory:{sketch:function(e){return NO.sketch({uid:e.uid,dom:e.dom,listBehaviours:ac([nm.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return AS({uid:Oi("multiple-toolbar-item"),backstage:e.backstage,cyclicKeying:!1,getSink:e.getSink,initGroups:[],onEscape:function(){return ye.none()}})},setupItem:function(e,t,n,r){YT.setGroups(t,n)},shell:!0})}},name:"multiple-toolbar",schema:[on("dom"),on("onEscape")]}),oy=Wl.optional({factory:{sketch:function(e){var t;return((t=e).split===pb.sliding?NS:t.split===pb.floating?OS:AS)({uid:e.uid,onEscape:function(){return e.onEscape(),ye.some(!0)},cyclicKeying:!1,initGroups:[],getSink:e.getSink,backstage:e.backstage,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader}})}},name:"toolbar",schema:[on("dom"),on("onEscape"),on("getSink")]}),Wd=Wl.optional({factory:{sketch:function(e){var t=e.editor,n=e.sticky?ck:KO;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:ac(n(t,e.getSink))}}},name:"header",schema:[on("dom")]}),qn=Wl.optional({name:"socket",schema:[on("dom")]}),Ys=Wl.optional({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ac([Jb.config({}),am.config({}),dE.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(e){Od.getCurrent(e).each(tN.hideAllSlots),Gr(e,iN)},onGrown:function(e){Gr(e,iN)},onStartGrow:function(e){Xr(e,oN,{width:ua(e.element(),"width").getOr("")})},onStartShrink:function(e){Xr(e,oN,{width:nu(e.element())+"px"})}}),rm.config({}),Od.config({find:function(e){return e=rm.contents(e),Ge(e)}})])}],behaviours:ac([Cw(0),im("sidebar-sliding-events",[Xo(oN,(function(e,t){oa(e.element(),"width",t.event().width())})),Xo(iN,(function(e,t){ca(e.element(),"width")}))])])}}},name:"sidebar",schema:[on("dom")]}),jl=Wl.optional({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ac([rm.config({})]),components:[]}}},name:"throbber",schema:[on("dom")]}),uf({name:"OuterContainer",factory:function(e,t,n){return{uid:e.uid,dom:e.dom,components:t,apis:{getSocket:function(t){return AO.getPart(t,e,"socket")},setSidebar:function(t,n){AO.getPart(t,e,"sidebar").each((function(e){var t;t=n,Od.getCurrent(e).each((function(e){return rm.set(e,[rN(t)])}))}))},toggleSidebar:function(t,n){AO.getPart(t,e,"sidebar").each((function(e){var t;t=n,Od.getCurrent(e).each((function(e){Od.getCurrent(e).each((function(n){dE.hasGrown(e)?tN.isShowing(n,t)?dE.shrink(e):(tN.hideAllSlots(n),tN.showSlot(n,t)):(tN.hideAllSlots(n),tN.showSlot(n,t),dE.grow(e))}))}))}))},whichSidebar:function(t){return AO.getPart(t,e,"sidebar").bind(mk).getOrNull()},getHeader:function(t){return AO.getPart(t,e,"header")},getToolbar:function(t){return AO.getPart(t,e,"toolbar")},setToolbar:function(t,n){AO.getPart(t,e,"toolbar").each((function(e){e.getApis().setGroups(e,n)}))},setToolbars:function(t,n){AO.getPart(t,e,"multiple-toolbar").each((function(e){NO.setItems(e,n)}))},refreshToolbar:function(t){AO.getPart(t,e,"toolbar").each((function(e){return e.getApis().refresh(e)}))},getMoreButton:function(t){return AO.getPart(t,e,"toolbar").bind((function(e){return e.getApis().getMoreButton(e)}))},getThrobber:function(t){return AO.getPart(t,e,"throbber")},focusToolbar:function(t){AO.getPart(t,e,"toolbar").orThunk((function(){return AO.getPart(t,e,"multiple-toolbar")})).each((function(e){nm.focusIn(e)}))},setMenubar:function(t,n){AO.getPart(t,e,"menubar").each((function(e){ZO.setMenus(e,n)}))},focusMenubar:function(t){AO.getPart(t,e,"menubar").each((function(e){ZO.focus(e)}))}},behaviours:e.behaviours}},configFields:[on("dom"),on("behaviours")],partFields:[Wd,Sc,oy,Xd,qn,Ys,jl],apis:{getSocket:function(e,t){return e.getSocket(t)},setSidebar:function(e,t,n){e.setSidebar(t,n)},toggleSidebar:function(e,t,n){e.toggleSidebar(t,n)},whichSidebar:function(e,t){return e.whichSidebar(t)},getHeader:function(e,t){return e.getHeader(t)},getToolbar:function(e,t){return e.getToolbar(t)},setToolbar:function(e,t,n){n=Me(n,ES),e.setToolbar(t,n)},setToolbars:function(e,t,n){n=Me(n,(function(e){return Me(e,ES)})),e.setToolbars(t,n)},getMoreButton:function(e,t){return e.getMoreButton(t)},refreshToolbar:function(e,t){return e.refreshToolbar(t)},getThrobber:function(e,t){return e.getThrobber(t)},setMenubar:function(e,t,n){e.setMenubar(t,n)},focusMenubar:function(e,t){e.focusMenubar(t)},focusToolbar:function(e,t){e.focusToolbar(t)}}})),cN="file edit view insert format tools table help",sN={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},lN=function(e,t,n){var r=n.getParam("removed_menuitems","").split(/[ ,]/);return{text:e.title,getItems:function(){return je(e.items,(function(e){var n=e.toLowerCase();return 0===n.trim().length||Be(r,(function(e){return e===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:t.menuItems[n]?[t.menuItems[n]]:[]}))}}},fN=function(e){return"string"==typeof e?e.split(" "):e},dN=function(e){function t(){e._skinLoaded=!0,sp.fireSkinLoaded(e)}return function(){e.initialized?t():e.on("init",t)}},mN=a(pk,!1),gN=a(pk,!0),hN=ph.DOM,pN=(Wn=Xn(),Wn.os.isiOS()&&Wn.os.version.major<=12),vN={render:function(e,n,r,o,i){var a,u,c,s=mn(0),l=(i=(mN(e),i=gn.fromDom(i.targetNode),l=n.mothership,Cl(i,l,di),ts(Uo(),n.uiMothership),e.on("PostRender",(function(){vk(e,n,r,o),s.set(e.getWin().innerWidth),uN.setMenubar(n.outerContainer,hk(e,r)),uN.setSidebar(n.outerContainer,r.sidebar),bk(e)})),uN.getSocket(n.outerContainer).getOrDie("Could not find expected socket element")),!0===pN&&(ia(i.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"}),a=function(){e.fire("ScrollContent")},u=20,c=null,l={cancel:function(){null!==c&&(t.clearTimeout(c),c=null)},throttle:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];null===c&&(c=t.setTimeout((function(){a.apply(null,e),c=null}),u))}},nv(i.element(),"scroll",l.throttle)),SS(e,n),e.addCommand("ToggleSidebar",(function(t,r){uN.toggleSidebar(n.outerContainer,r),e.fire("ToggleSidebar")})),e.addQueryValueHandler("ToggleSidebar",(function(){return uN.whichSidebar(n.outerContainer)})),Tv(e));return l!==pb.sliding&&l!==pb.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(function(){var t=e.getWin().innerWidth;t!==s.get()&&(uN.refreshToolbar(n.outerContainer),s.set(t))})),{iframeContainer:i.element().dom(),editorContainer:n.outerContainer.element().dom()}}},bN={render:function(e,t,n,r,o){function i(){oa(t.outerContainer.element(),"display","flex"),s.addClass(e.getBody(),"mce-edit-focus"),ca(t.uiMothership.element(),"display"),h()}function a(){t.outerContainer&&(oa(t.outerContainer.element(),"display","none"),s.removeClass(e.getBody(),"mce-edit-focus")),oa(t.uiMothership.element(),"display","none")}function u(){var o;c?i():(c=uN.getHeader(t.outerContainer).getOrDie(),o=Ab(e).getOr(Uo()),ts(o,t.mothership),ts(o,t.uiMothership),vk(e,t,n,r),uN.setMenubar(t.outerContainer,hk(e,n)),i(),e.on("activate",i),e.on("deactivate",a),e.on("NodeChange SkinLoaded ResizeWindow",(function(){e.hidden||h(!0)})),e.nodeChanged())}var c,s=ph.DOM,l=Db(e),f=Ev(e),d=gn.fromDom(o.targetNode),m=(o=Tv(e),o===pb.sliding||o===pb.floating),g=(gN(e),function(e){e=m?e.fold((function(){return 0}),(function(e){return 1<e.components().length?Ya(e.components()[1].element()):0})):0;var n=Qa(d);e=n.top()-Ya(c.element())+e;ia(t.outerContainer.element(),{position:"absolute",top:Math.round(e)+"px",left:Math.round(n.left())+"px"})}),h=function(e){var n;void 0===e&&(e=!1),m&&uN.refreshToolbar(t.outerContainer),l||(n=uN.getToolbar(t.outerContainer),g(n)),f&&(e?qO.reset(c):qO.refresh(c))};return e.on("focus",u),e.on("blur hide",a),e.on("init",(function(){e.hasFocus()&&u()})),SS(e,t),{editorContainer:t.outerContainer.element().dom()}}},yN=function(e){yC.each([{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(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return e.execCommand(t.cmd)},icon:t.icon,onSetup:VS(e,t.name)})}));var t="alignnone",n="No alignment",r="JustifyNone",o="align-none";e.ui.registry.addButton(t,{tooltip:n,onAction:function(){return e.execCommand(r)},icon:o})},wN=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},xN=function(e){yC.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:VS(e,t.name),onAction:wN(e,t.name)})}));for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:VS(e,n),onAction:wN(e,n)})}},CN=function(e){yC.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(t){e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)}})}))},SN=function(e){yC.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)},onSetup:VS(e,t.name)})}))},kN=function(e){var t,n;xN(t=e),CN(t),SN(t),n=e,yC.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(e){n.ui.registry.addMenuItem(e.name,{text:e.text,icon:e.icon,shortcut:e.shortcut,onAction:function(){return n.execCommand(e.action)}})})),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:wN(n,"code")})},TN=function(e,t,n){function r(){return!!t.undoManager&&t.undoManager[n]()}function o(){e.setDisabled(t.readonly||!r())}return e.setDisabled(!r()),t.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o),function(){return t.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",o)}},EN=function(e){var t,n;(t=e).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(e){return TN(e,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(e){return TN(e,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}}),(n=e).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(e){return TN(e,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(e){return TN(e,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}})},ON=function(e,t){function n(t){e.setActive(t.hasVisual)}return e.setActive(t.hasVisual),t.on("VisualAid",n),function(){return t.off("VisualAid",n)}},NN=function(e){var t,n;(t=e).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return t.execCommand("mceToggleVisualAid")}}),(n=e).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(e){return ON(e,n)},onAction:function(){n.execCommand("mceToggleVisualAid")}})},AN=function(e,t){function n(){e.setDisabled(!t.queryCommandState("outdent"))}return e.setDisabled(!t.queryCommandState("outdent")),t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},DN=function(e){var t;(t=e).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(e){return AN(e,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})},_N=function(e,t){var n,r,o,i,a,u,c,s;n=YE(o=e,a=t,QE(o)),o.ui.registry.addNestedMenuItem("align",{text:a.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}}),r=YE(o=e,a=t,oO(o)),o.ui.registry.addNestedMenuItem("fontformats",{text:a.shared.providers.translate("Fonts"),getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}}),o=e,c=d({type:"advanced"},(a=t).styleselect),i=YE(o,a,gO(o,c)),o.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return i.items.validateItems(i.getStyleItems())}}),u=YE(a=e,t,mO(a)),a.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return u.items.validateItems(u.getStyleItems())}}),s=YE(c=e,t,sO(c)),c.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return s.items.validateItems(s.getStyleItems())}})},RN=function(e,t){yN(e),kN(e),_N(e,t),EN(e),vp(e),NN(e),DN(e)},BN=function(e,t,n,r,o,i){n=n();var a,u=(e=e,a=t,i?kk(e):Ck(e,a));Tx(n,dh.CLOSE_ON_EXECUTE,r,!1).map((function(e){t.preventDefault(),km.showMenuAt(o,u,{menu:{markers:Ep("normal")},data:e})}))},MN={onLtr:function(){return[ec,Yu,Ku,Ju,Zu,Qu,Om,Nm,Tm,wd,Em,xd]},onRtl:function(){return[ec,Ku,Yu,Zu,Ju,Qu,Om,Nm,Em,xd,Tm,wd]}},PN={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"]},zN=function(e,t,n,r,o,i){function a(){var a=n();Ek(e,t,a,r,o,i)}var u,c,s=Xn(),l=s.os.isiOS(),f=s.os.isOSX();s=s.os.isAndroid();!f&&!l||i?(s&&!i&&e.selection.setCursorLocation(t.target,0),a()):(u=function(){Tk(e),a()},f=t,(s=(l=e).selection).isCollapsed()||f.touches.length<1||(c=f.touches[0],f=s.getRng(),!Vc(l.getWin(),Nc.domRange(f)).exists((function(e){return e.left()<=c.clientX&&e.right()>=c.clientX&&e.top()<=c.clientY&&e.bottom()>=c.clientY})))?(e.once("selectionchange",u),e.once("touchend",(function(){return e.off("selectionchange",u)}))):u())},IN=function(e){return"string"==typeof e?e.split(/[ ,]/):e},LN={shouldNeverUseNative:function(e){return e.settings.contextmenu_never_use_native||!1},getContextMenu:function(e){return t="contextmenu",n="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(e=e).ui.registry.getAll().contextMenus,rt(e.settings,t).map(IN).getOrThunk((function(){return Ie(IN(n),(function(e){return ot(r,e)}))}));var t,n,r},isContextMenuDisabled:function(e){return!1===e.getParam("contextmenu")}},FN={type:"separator"},HN=function(e,t,n){return t=Fe(t,(function(t,r){var o;return ot(e,r)?(o=e[r].update(n),xe(o)?Ak(t,o.split(" ")):0<o.length?(o=Me(o,Nk),Ak(t,o)):t):t.concat([r])}),[]),0<t.length&&Ok(t[t.length-1])&&t.pop(),t},VN=function(e,t){return t.ctrlKey&&!LN.shouldNeverUseNative(e)},UN=function(e){return/^[0-9\.]+(|px)$/i.test(""+e)?ye.some(parseInt(e,10)):ye.none()},jN=function(e){return Ee(e)?e+"px":e},WN="data-initial-z-index",qN=function(e){ii(e.element()).filter(Fo).each((function(e){var t=xi(e,WN);Ci(e,WN)?oa(e,"z-index",t):ca(e,"z-index"),Si(e,WN)}))},$N=function(e){ii(e.element()).filter(Fo).each((function(t){ua(t,"z-index").each((function(e){wi(t,WN,e)})),oa(t,"z-index",Do(e.element(),"z-index"))}))},GN=function(e,t){e=e.element(),Si(e,t.leftAttr),Si(e,t.topAttr)},XN=function(e,t,n,r){return Su(e,(function(e){var i=e.sensor();return function(e,t,n,r,o,i){return e=YS(e,o,i),t=YS(t,o,i),Math.abs(e.left()-t.left())<=n&&Math.abs(e.top()-t.top())<=r}(t,i,e.range().left(),e.range().top(),n,r)?ye.some({output:o(MO(e.output(),t,n,r)),extra:e.extra}):ye.none()}))},YN=function(e){return ua(e,"left").bind((function(t){return ua(e,"top").bind((function(n){return ua(e,"position").map((function(e){return("fixed"===e?IO:PO)(parseInt(t,10),parseInt(n,10))}))}))})).getOrThunk((function(){var t=Qa(e);return zO(t.left(),t.top())}))},KN=function(e,t,n,r,o,i,a){var u,c,s,l,f,d;t=t.fold((function(){a=n,e=i.left(),t=i.top();var e,t,a=a.fold((function(n,r){return _O.offset(n+e,r+t)}),(function(n,r){return _O.absolute(n+e,r+t)}),(function(n,r){return _O.fixed(n+e,r+t)}));a=XS(a,r,o);return IO(a.left(),a.top())}),(function(t){var a=Rk(e,t,n,i,r,o);return a.extra.each((function(n){t.onSensor(e,n)})),a.coord}));return t=t,u=r,c=o,s=(a=a).bounds,l=YS(t,u,c),f=el(l.left(),s.x(),s.x()+s.width()-a.width),l=el(l.top(),s.y(),s.y()+s.height()-a.height),d=zO(f,l),t.fold((function(){var e=KS(d,u,c);return PO(e.left(),e.top())}),(function(){return d}),(function(){var e=XS(d,u,c);return IO(e.left(),e.top())}))},JN=(tm=cn("snaps",[on("getSnapPoints"),ka("onSensor"),on("leftAttr"),on("topAttr"),ln("lazyViewport",gu),ln("mustSnap",!1)]),Object.freeze({getData:function(e){return ye.from(Ja(e.x(),e.y()))},getDelta:function(e,t){return Ja(t.left()-e.left(),t.top()-e.top())}})),ZN=(Ul=[ln("useFixed",s),on("blockerClass"),ln("getTarget",i),ln("onDrag",n),ln("repositionTarget",!0),ka("onDrop"),ae("getBounds",gu),tm,Bu("dragger",{handlers:function(e,t){function n(n){t.setStartData(Mk(e,n))}return Go([Xo(zr(),n),Xo(cr(),(function(r,o){var i,a,u,c;0===o.event().raw().button&&(o.stop(),o={drop:function(){u()},delayDrop:function(){c.schedule()},forceDrop:function(){u()},move:function(n){c.cancel();n=t.update(JN,n);var o=t.getStartData().getOrThunk((function(){return Mk(e,r)}));n.each((function(t){Pk(r,e,o,t)}))}},i=r.getSystem().build(Cb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[e.blockerClass]},events:(a=o,Go([Xo(cr(),a.forceDrop),Xo(fr(),a.drop),Xo(sr(),(function(e,t){a.move(t.event())})),Xo(lr(),a.delayDrop)]))})),c=iv(u=function(){qN(n=i),n.getSystem().removeFromGui(n),e.snaps.each((function(e){Bk(r,e)}));var n=e.getTarget(r.element());t.reset(),e.onDrop(r,n)},200),n(r),o=i,r.getSystem().addToGui(o),$N(o))}))])}})],Object.freeze({getData:function(e){e=e.raw().touches;return 1===e.length?(e=e[0],ye.some(Ja(e.clientX,e.clientY))):ye.none()},getDelta:function(e,t){return Ja(t.left()-e.left(),t.top()-e.top())}})),QN=(Ws=[ln("useFixed",s),ln("getTarget",i),ln("onDrag",n),ln("repositionTarget",!0),ln("onDrop",n),ae("getBounds",gu),tm,Bu("dragger",{handlers:function(e,t){function n(n){t.setStartData(Mk(e,n))}return Go([Xo(zr(),n),Xo(ir(),(function(e,t){n(e),t.stop()})),Xo(Mr(),(function(n,r){t.getStartData().each((function(o){var i;tr(o.comp.element(),n.element())&&(r.stop(),o=t.update(ZN,r.event()),i=t.getStartData().getOrThunk((function(){return Mk(e,n)})),o.each((function(t){Pk(n,e,i,t)})))}))})),Xo(Pr(),(function(n,r){t.getStartData().each((function(r){tr(r.comp.element(),n.element())&&(e.snaps.each((function(e){Bk(n,e)})),r=e.getTarget(n.element()),t.reset(),e.onDrop(n,r))}))}))])}})],it=Object.freeze({init:function(){var e=ye.none(),t=ye.none(),n=o({});return Hi({readState:n,reset:function(){e=ye.none(),t=ye.none()},update:function(t,n){return t.getData(n).bind((function(n){return r=t,o=n,n=e.map((function(e){return r.getDelta(e,o)})),e=ye.some(o),n;var r,o}))},getStartData:function(){return t},setStartData:function(e){t=ye.some(e)}})}}),$d=Object.freeze({snapTo:function(e,t,n,r){var o,i,a=t.getTarget(e.element());t.repositionTarget&&(t=ri(e.element()),e=ou(t),t=DO(a),o=e,i=t,o={coord:MO((r=r).output(),r.output(),o,i),extra:r.extra()},i=BO(o.coord,e,t),ia(a,i))}}),Ma({branchKey:"mode",branches:Object.freeze({mouse:Ul,touch:Ws}),name:"dragging",active:{events:function(e,t){return e.dragger.handlers(e,t)}},extra:{snap:so(["sensor","range","output"],["extra"])},state:it,apis:$d})),eA=((qd=uT=uT||{})[qd.None=0]="None",qd[qd.Both=1]="Both",qd[qd.Vertical=2]="Vertical",function(e,t,n){var r=gn.fromDom(e.getContainer());t=Ik(e,t,n,Ya(r),nu(r));Ze(t,(function(e,t){return oa(r,t,jN(e))})),sp.fireResizeEditor(e)}),tA={renderElementPath:function(e,t){return t.delimiter||(t.delimiter="»"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ac([nm.config({mode:"flow",selector:"div[role=button]"}),Jb.config({}),rm.config({}),im("elementPathEvents",[Zo((function(n,r){e.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return nm.focusIn(n)})),e.on("NodeChange",(function(r){var o;r=function(t){for(var n=[],r=t.length;0<r--;){var o=t[r];if(1===o.nodeType&&!function(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}(o)){var i=e.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n}(r.parents);0<r.length&&rm.set(n,(r=Me((r=r)||[],(function(t,n){return Am.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":n,"tab-index":-1,"aria-level":n+1},innerHtml:t.name},action:function(n){e.focus(),e.selection.select(t.element),e.nodeChanged()}})})),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+t.delimiter+" "}},Fe(r.slice(1),(function(e,t){return e.push(o),e.push(t),e}),[r[0]])))}))}))])]),components:[]}}},nA=function(e,t){function n(e,n,r){rm.set(e,[ma(t.translate(["{0} "+r,n[r]]))])}var r;return Am.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ac([Jb.config({}),rm.config({}),_l.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),im("wordcount-events",[Xo(Ar(),(function(e){var t=_l.getValue(e),r="words"===t.mode?"characters":"words";_l.setValue(e,{mode:r,count:t.count}),n(e,t.count,r)})),Zo((function(t){e.on("wordCountUpdate",(function(e){var r=_l.getValue(t).mode;_l.setValue(t,{mode:r,count:e.wordCount}),n(t,e.wordCount,r)}))}))])]),eventOrder:((r={})[Ar()]=["wordcount-events","alloy.base.behaviour"],r)})},rA=Xn(),oA=function(e,t){function n(e){var n=mu(e);return f.getOpt(t).fold((function(){return QN.snap({sensor:zO(n.x()-20,n.y()-20),range:Ja(n.width(),n.height()),output:zO(ye.some(n.x()),ye.some(n.y())),extra:{td:e}})}),(function(t){var r=n.x()-20,o=n.y()-20;t=t.element().dom().getBoundingClientRect();return QN.snap({sensor:zO(r,o),range:Ja(40,40),output:zO(ye.some(n.x()-t.width/2),ye.some(n.y()-t.height/2)),extra:{td:e}})}))}function r(e){var n=mu(e);return d.getOpt(t).fold((function(){return QN.snap({sensor:zO(n.x()-20,n.y()-20),range:Ja(n.width(),n.height()),output:zO(ye.some(n.right()),ye.some(n.bottom())),extra:{td:e}})}),(function(t){var r=n.right()-20,o=n.bottom()-20;t=t.element().dom().getBoundingClientRect();return QN.snap({sensor:zO(r,o),range:Ja(40,40),output:zO(ye.some(n.right()-t.width/2),ye.some(n.bottom()-t.height/2)),extra:{td:e}})}))}function o(t,n,r,o){n=n.dom().getBoundingClientRect();var i=(ca(t.element(),"display"),lo(gn.fromDom(e.getBody())).dom().innerHeight);r=r(n),o=o(n,i);(r||o)&&oa(t.element(),"display","none")}function i(e){var t=n(e);QN.snapTo(m,t),o(m,e,(function(e){return e.top<0}),(function(e,t){return e.top>t}))}function a(e){var t=r(e);QN.snapTo(g,t),o(g,e,(function(e){return e.bottom<0}),(function(e,t){return e.bottom>t}))}var u=mn([]),c=mn([]),s={getSnapPoints:function(){return Me(u.get(),n)},leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,n){p.set(n.td),e.fire("tableselectorchange",{start:p.get(),finish:v.get()})},mustSnap:!0},l={getSnapPoints:function(){return Me(c.get(),r)},leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,n){v.set(n.td),e.fire("tableselectorchange",{start:p.get(),finish:v.get()})},mustSnap:!0},f=Dm(Am.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ac([QN.config(rA.deviceType.isTouch()?{mode:"touch",snaps:s}:{mode:"mouse",blockerClass:"blocker",snaps:s}),my.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"]}})),d=Dm(Am.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ac([QN.config(rA.deviceType.isTouch()?{mode:"touch",snaps:l}:{mode:"mouse",blockerClass:"blocker",snaps:l}),my.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"]}})),m=pa(f.asSpec()),g=pa(d.asSpec()),h=mn(!1),p=mn(null),v=mn(null);rA.deviceType.isTouch()&&(e.on("tableselectionchange",(function(e){h.get()||(vl(t,m),vl(t,g),h.set(!0)),p.set(e.start),v.set(e.finish),e.otherCells.each((function(t){u.set(t.upOrLeftCells),c.set(t.downOrRightCells),i(e.start),a(e.finish)}))})),e.on("resize ScrollContent",(function(){var e;e=p.get(),i(e),e=v.get(),a(e)})),e.on("tableselectionclear",(function(){h.get()&&(wl(m),wl(g),h.set(!1))})))},iA=5,aA=function(e){var t=mn(ye.none()),n=mn(!1),r=Lm((function(t){e.fire("longpress",d(d({},t),{type:"longpress"})),n.set(!0)}),400);e.on("touchstart",(function(e){Fk(e).each((function(i){r.cancel(),i={x:o(i.clientX),y:o(i.clientY),target:o(e.target)},r.throttle(e),n.set(!1),t.set(ye.some(i))}))}),!0),e.on("touchmove",(function(o){r.cancel(),Fk(o).each((function(r){t.get().each((function(o){var i,a;i=r,o=o,a=Math.abs(i.clientX-o.x()),i=Math.abs(i.clientY-o.y()),(iA<a||iA<i)&&(t.set(ye.none()),n.set(!1),e.fire("longpresscancel"))}))}))}),!0),e.on("touchend touchcancel",(function(e){r.cancel(),"touchend"===e.type&&n.get()&&t.get().filter((function(t){return t.target().isEqualNode(e.target)})).map((function(){e.preventDefault()}))}),!0)},uA=function(e){function n(){return h.bind(uN.getHeader)}function r(){return we.value(y)}function o(){return h.bind((function(e){return uN.getMoreButton(e)})).getOrDie("Could not find more button element")}function i(){return h.bind((function(e){return uN.getThrobber(e)})).getOrDie("Could not find throbber element")}function a(t){var n=ph.DOM,r=(n=e.getParam("width",n.getStyle(t,"width")),t=e.getParam("height",Math.max(e.getElement().offsetHeight,200)),Sv(e)),o=kv(e),i=(n=UN(n).bind((function(e){return jN(r.map((function(t){return Math.max(e,t)})))})).getOr(jN(n)),t=UN(t).bind((function(e){return o.map((function(t){return Math.max(e,t)}))})).getOr(t),n=jN(n),e.inline?"max-width":"width");return _o("div",i,n)&&oa(_.element(),i,n),e.inline||(i=jN(t),_o("div","height",i)?oa(_.element(),"height",i):oa(_.element(),"height","200px")),t}var u,c,s,l,f=e.inline,m=f?bN:vN,g=Ev(e)?YO:JO,h=ye.none(),p=Xn(),v=p.browser.isIE()?["tox-platform-ie"]:[],b=(p=p.deviceType.isTouch()?["tox-platform-touch"]:[],Hg.isRtl()?{attributes:{dir:"rtl"}}:{}),y=pa({dom:d({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(v).concat(p)},b),behaviours:ac([dl.config({useFixed:function(){return g.isDocked(n)}})])}),w=Dm({dom:{tag:"div",classes:["tox-anchorbar"]}}),x=(u=y,c=e,b=function(){return h.bind((function(e){return w.getOpt(e)})).getOrDie("Could not find a anchor bar element")},C=o,s=mn(!1),l={shared:{providers:{icons:function(){return c.ui.registry.getAll().icons},menuItems:function(){return c.ui.registry.getAll().menuItems},translate:Hg.translate},interpreter:function(e){return ET(e,l)},anchors:AT.getAnchors(c,b,C),getSink:function(){return we.value(u)}},urlinput:GT(c),styleselect:MT(c),colorinput:DT(c),dialog:_T(c),isContextMenuOpen:function(){return s.get()},setContextMenuState:function(e){return s.set(e)}}),C=(b=uN.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:x,onEscape:function(){e.focus()}}),Tv),S=uN.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:r,backstage:x,onEscape:function(){e.focus()},split:C(e),lazyToolbar:function(){return h.bind((function(e){return uN.getToolbar(e)})).getOrDie("Could not find more toolbar element")},lazyMoreButton:o,lazyHeader:function(){return n().getOrDie("Could not find header element")}}),k=uN.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},onEscape:function(){}}),T=uN.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),E=uN.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),O=uN.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:x}),N=e.getParam("statusbar",!0,"boolean")&&!f?ye.some(Lk(e,x.shared.providers)):ye.none(),A=(T={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[T,E]},E=Nb(e),Eb(e)),D=Tb(e),_=(C=C(e)!==pb.default,D=uN.parts().header({dom:{tag:"div",classes:["tox-editor-header"]},components:Ue([D?[b]:[],E?(C&&t.console.warn("Toolbar drawer cannot be applied when multiple toolbars are active"),[k]):A?[S]:[],Db(e)?[]:[w.asSpec()]]),sticky:Ev(e),editor:e,getSink:r}),b=Ue([[D],f?[]:[T]]),E=Ue([[{dom:{tag:"div",classes:["tox-editor-container"]},components:b}],f?[]:N.toArray(),[O]]),C=_b(e),k=d(d({role:"application"},Hg.isRtl()?{dir:"rtl"}:{}),C?{"aria-hidden":"true"}:{}),pa(uN.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(f?["tox-tinymce-inline"]:[]).concat(p).concat(v),styles:d({visibility:"hidden"},C?{opacity:"0",border:"0"}:{}),attributes:k},components:E,behaviours:ac([nm.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"})])}))),R=(h=ye.some(_),e.shortcuts.add("alt+F9","focus menubar",(function(){uN.focusMenubar(_)})),e.shortcuts.add("alt+F10","focus toolbar",(function(){uN.focusToolbar(_)})),Cv(_)),B=Cv(y);return OO(e,R,B),aA(e),{mothership:R,uiMothership:B,backstage:x,renderUI:function(){g.setup(e,n),RN(e,x),Dk(e,r,x),o=(t=e).ui.registry.getAll().sidebars,Pe(Ke(o),(function(e){function n(){return ye.from(t.queryCommandValue("ToggleSidebar")).is(e)}var r=o[e];t.ui.registry.addToggleButton(e,{icon:r.icon,tooltip:r.tooltip,onAction:function(r){t.execCommand("ToggleSidebar",!1,e),r.setActive(n())},onSetup:function(e){function r(){return e.setActive(n())}return t.on("ToggleSidebar",r),function(){t.off("ToggleSidebar",r)}}})})),gk(e,i,x.shared);var t,o,u=e.ui.registry.getAll(),c=u.buttons,s=u.menuItems,l=u.contextToolbars,f=(u=u.sidebars,Ob(e));s={menuItems:s,menus:e.settings.menu?Qe(e.settings.menu,(function(e){return ct(e,{items:e.items})})):{},menubar:e.settings.menubar,toolbar:f.getOrThunk((function(){return e.getParam("toolbar",!0)})),buttons:c,sidebar:u},EO(e,l,y,{backstage:x}),oA(e,y),f=e.getElement(),c=a(f),u={mothership:R,uiMothership:B,outerContainer:_};return m.render(e,u,s,x,{targetNode:f,height:c})},getUi:function(){return{channels:{broadcastAll:B.broadcast,broadcastOn:B.broadcastOn,register:function(){}}}}}},cA=function(e,t){var n=ye.from(xi(e,"id")).fold((function(){var e=Oi("dialog-label");return wi(t,"id",e),e}),i);wi(e,"aria-labelledby",n)},sA=(ql=o([on("lazySink"),Z("dragBlockClass"),ae("getBounds",gu),ln("useTabstopAt",o(!0)),ln("eventOrder",{}),gs("modalBehaviours",[nm]),Ta("onExecute"),Oa("onEscape")]),em={sketch:i},Pu=o([Gl({name:"draghandle",overrides:function(e,t){return{behaviours:ac([QN.config({mode:"mouse",getTarget:function(e){return pu(e,'[role="dialog"]').getOr(e)},blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])}}}),$l({schema:[on("dom")],name:"title"}),$l({factory:em,schema:[on("dom")],name:"close"}),$l({factory:em,schema:[on("dom")],name:"body"}),Gl({factory:em,schema:[on("dom")],name:"footer"}),Tc({factory:{sketch:function(e,t){return d(d({},e),{dom:t.dom,components:t.components})}},schema:[ln("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),ln("components",[])],name:"blocker"})]),uf({name:"ModalDialog",configFields:ql(),partFields:Pu(),factory:function(e,t,n,r){var o=Oi("alloy.dialog.busy"),a=Oi("alloy.dialog.idle"),u=ac([nm.config({mode:"special",onTab:function(){return ye.some(!0)},onShiftTab:function(){return ye.some(!0)}}),am.config({})]),c=Oi("modal-events"),s=d(d({},e.eventOrder),{"alloy.system.attached":[c].concat(e.eventOrder["alloy.system.attached"]||[])});return{uid:e.uid,dom:e.dom,components:t,apis:{show:function(t){var n=e.lazySink(t).getOrDie(),i=mn(ye.none()),c=r.blocker();c=n.getSystem().build(d(d({},c),{components:c.components.concat([va(t)]),behaviours:ac([im("dialog-blocker-events",[Xo(a,(function(e,n){Ci(t.element(),"aria-busy")&&(Si(t.element(),"aria-busy"),i.get().each((function(e){return rm.remove(t,e)})))})),Xo(o,(function(e,n){wi(t.element(),"aria-busy","true"),n=n.event().getBusySpec(),i.get().each((function(e){rm.remove(t,e)})),n=n(t,u),e=e.getSystem().build(n),i.set(ye.some(e)),rm.append(t,va(e)),e.hasConfigured(nm)&&nm.focusIn(e)}))])])}));vl(n,c),nm.focusIn(t)},hide:function(e){ii(e.element()).each((function(t){e.getSystem().getByDom(t).each((function(e){wl(e)}))}))},getBody:function(t){return Ss(t,e,"body")},getFooter:function(t){return Ss(t,e,"footer")},setIdle:function(e){Gr(e,a)},setBusy:function(e,t){Xr(e,o,{getBusySpec:t})}},eventOrder:s,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Bl(e.modalBehaviours,[rm.config({}),nm.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt}),im(c,[Zo((function(t){var n,r;cA(t.element(),Ss(t,e,"title").element()),n=t.element(),r=Ss(t,e,"body").element(),t=ye.from(xi(n,"id")).fold((function(){var e=Oi("dialog-describe");return wi(r,"id",e),e}),i),wi(n,"aria-describedby",t)}))])])}},apis:{show:function(e,t){e.show(t)},hide:function(e,t){e.hide(t)},getBody:function(e,t){return e.getBody(t)},getFooter:function(e,t){return e.getFooter(t)},setBusy:function(e,t,n){e.setBusy(t,n)},setIdle:function(e,t){e.setIdle(t)}}})),lA=(Yn=[$("type"),$("text"),G("level",["info","warn","error","success"]),$("icon"),ln("url","")],zt(Yn)),fA=(Wl=[$("type"),$("text"),ie("disabled",!1),ie("primary",!1),Vt("name","name",dt((function(){return Oi("button-name")})),en),ee("icon"),ie("borderless",!1)],zt(Wl)),dA=(Wd=[$("type"),$("name"),$("label"),ie("disabled",!1)],zt(Wd)),mA=(Sc=tn,oy=[$("type"),$("name")],Xd=oy.concat([ee("label")]),zt(Xd)),gA=(qn=en,zt(Xd)),hA=(Ys=en,zt(Xd)),pA=(jl=It(jt),Wn=Xd.concat([ie("sandboxed",!0)]),zt(Wn)),vA=(tm=en,Ul=Xd.concat([ee("inputMode"),ee("placeholder"),ie("maximized",!1),ie("disabled",!1)]),zt(Ul)),bA=(Ws=en,it=Xd.concat([K("items",[$("text"),$("value")]),ne("size",1),ie("disabled",!1)]),zt(it)),yA=($d=en,qd=Xd.concat([ie("constrain",!0),ie("disabled",!1)]),zt(qd)),wA=(em=zt([$("width"),$("height")]),Tc=Xd.concat([ee("placeholder"),ie("maximized",!1),ie("disabled",!1)]),zt(Tc)),xA=(ql=en,Pu=Xd.concat([oe("filetype","file",["image","media","file"]),ln("disabled",!1)]),zt(Pu)),CA=(Yn=zt([$("value"),ln("meta",{})]),oy.concat([re("tag","textarea"),$("scriptId"),$("scriptUrl"),fn("settings",void 0,rn)])),SA=oy.concat([re("tag","textarea"),X("init")]),kA=qt((function(e){return Gt("customeditor.old",Pt(SA),e).orThunk((function(){return Gt("customeditor.new",Pt(CA),e)}))})),TA=(Wl=en,Wd=[$("type"),$("html"),oe("presets","presentation",["presentation","document"])],zt(Wd)),EA=(jt=Xd.concat([an("currentState",zt([on("blob"),$("url")]))]),zt(jt)),OA=(Wn=Xd.concat([ln("columns","auto")]),zt(Wn)),NA=(it=(Ul=[$("value"),$("text"),$("icon")],Ft(Ul)),qd=[$("type"),J("header",en),J("cells",It(en))],zt(qd)),AA=Wt((function(){return Jt("type",{alertbanner:lA,bar:zt((e=Vk("bar"),[$("type"),e])),button:fA,checkbox:dA,colorinput:mA,colorpicker:gA,dropzone:hA,grid:zt(Hk(Vk("grid"))),iframe:pA,input:vA,selectbox:bA,sizeinput:yA,textarea:wA,urlinput:xA,customeditor:kA,htmlpanel:TA,imagetools:EA,collection:OA,label:zt((e=Vk("label"),[$("type"),$("label"),e])),table:NA,panel:DA});var e})),DA=(Tc=[$("type"),ln("classes",[]),J("items",AA)],zt(Tc)),_A=(Pu=[Vt("name","name",dt((function(){return Oi("tab-name")})),en),$("title"),J("items",AA)],rn=[$("type"),K("tabs",Pu)],oy=zt(rn),Wd=zt([$("type"),$("name"),ie("active",!1)].concat(Gd)),jt=tn,Xd=[Vt("name","name",dt((function(){return Oi("button-name")})),en),ee("icon"),oe("align","end",["start","end"]),ie("primary",!1),ie("disabled",!1)],Wn=g(Xd,[$("text")]),Ul=g([G("type",["submit","cancel","custom"])],Wn),qd=g([G("type",["menu"]),ee("text"),ee("tooltip"),ee("icon"),J("items",Wd),ae("onSetup",(function(){return n}))],Xd),Wt=Wn,Tc=U("type",{submit:Ul,cancel:Ul,custom:Ul,menu:qd}),zt([$("title"),an("body",Jt("type",{panel:DA,tabpanel:oy})),re("size","normal"),J("buttons",Tc),ln("initialData",{}),ae("onAction",n),ae("onChange",n),ae("onSubmit",n),ae("onClose",n),ae("onCancel",n),ln("onTabChange",n)])),RA={checkbox:Sc,colorinput:qn,colorpicker:Ys,dropzone:jl,input:Ws,iframe:tm,sizeinput:em,selectbox:$d,size:em,textarea:ql,urlinput:Yn,customeditor:Wl,collection:it,togglemenuitem:jt},BA=function(e){return ye.from(RA[e.type])},MA=function(e){return Ie(Uk(e),jk)},PA=(Pu=zt(g([G("type",["cancel","custom"])],Wt)),zt([$("title"),$("url"),Q("height"),Q("width"),un("buttons",It(Pu)),ae("onAction",n),ae("onCancel",n),ae("onClose",n),ae("onMessage",n)])),zA={open:function(e,t){return t=Wk(t),e(t.internalDialog,t.initialData,t.dataValidator)},openUrl:function(e,t){return e(Xt(Gt("dialog",PA,t)))},redial:Wk},IA=(rn=af({name:"TabButton",configFields:[ln("uid",void 0),on("value"),Vt("dom","dom",mt((function(e){return{attributes:{role:"tab",id:Oi("aria"),"aria-selected":"false"}}})),Zt()),Z("action"),ln("domModification",{}),gs("tabButtonBehaviours",[am,nm,_l]),on("view")],factory:function(e,t){return{uid:e.uid,dom:e.dom,components:e.components,events:Cd(e.action),behaviours:Bl(e.tabButtonBehaviours,[am.config({}),nm.config({mode:"execution",useSpace:!0,useEnter:!0}),_l.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification}}}),Gd=o([on("tabs"),on("dom"),ln("clickToDismiss",!1),gs("tabbarBehaviours",[Nd,nm]),Ca(["tabClass","selectedClass"])]),dt=lc({factory:rn,name:"tabs",unit:"tab",overrides:function(e,t){function r(e,t){Nd.dehighlight(e,t),Xr(e,Wr(),{tabbar:e,button:t})}function o(e,t){Nd.highlight(e,t),Xr(e,jr(),{tabbar:e,button:t})}return{action:function(t){var i=t.getSystem().getByUid(e.uid).getOrDie(),a=Nd.isHighlighted(i,t);(a&&e.clickToDismiss?r:a?n:o)(i,t)},domModification:{classes:[e.markers.tabClass]}}}}),Wd=o([dt]),uf({name:"Tabbar",configFields:Gd(),partFields:Wd(),factory:function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Bl(e.tabbarBehaviours,[Nd.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:function(e,t){wi(t.element(),"aria-selected","true")},onDehighlight:function(e,t){wi(t.element(),"aria-selected","false")}}),nm.config({mode:"flow",getInitial:function(e){return Nd.getHighlighted(e).map((function(e){return e.element()}))},selector:"."+e.markers.tabClass,executeOnMove:!0})])}}})),LA=(Xd=af({name:"Tabview",configFields:[gs("tabviewBehaviours",[rm])],factory:function(e,t){return{uid:e.uid,dom:e.dom,behaviours:Bl(e.tabviewBehaviours,[rm.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),Wn=o([ln("selectFirst",!0),ka("onChangeTab"),ka("onDismissTab"),ln("tabs",[]),gs("tabSectionBehaviours",[])]),Ul=$l({factory:IA,schema:[on("dom"),Y("markers",[on("tabClass"),on("selectedClass")])],name:"tabbar",defaults:function(e){return{tabs:e.tabs}}}),qd=$l({factory:Xd,name:"tabview"}),oy=o([Ul,qd]),uf({name:"TabSection",configFields:Wn(),partFields:oy(),factory:function(e,t,n,r){function o(t,n){Ql(t,e,"tabbar").each((function(e){n(e).each(Yr)}))}return{uid:e.uid,dom:e.dom,components:t,behaviours:Rl(e.tabSectionBehaviours),events:Go(Ue([e.selectFirst?[Zo((function(e,t){o(e,Nd.getFirst)}))]:[],[Xo(jr(),(function(t,n){var r,o;n=n.event().button();r=n,o=_l.getValue(r),Ql(r,e,"tabview").each((function(t){He(e.tabs,(function(e){return e.value===o})).each((function(n){n=n.view(),wi(t.element(),"aria-labelledby",xi(r.element(),"id")),rm.set(t,n),e.onChangeTab(t,r,n)}))}))})),Xo(Wr(),(function(t,n){n=n.event().button(),e.onDismissTab(t,n)}))]])),apis:{getViewItems:function(t){return Ql(t,e,"tabview").map((function(e){return rm.contents(e)})).getOr([])},showTab:function(e,t){o(e,(function(e){var n=Nd.getCandidates(e);return He(n,(function(e){return _l.getValue(e)===t})).filter((function(t){return!Nd.isHighlighted(e,t)}))}))}}}},apis:{getViewItems:function(e,t){return e.getViewItems(t)},showTab:function(e,t,n){e.showTab(t,n)}}})),FA="send-data-to-section",HA="send-data-to-view",VA=Oi("update-dialog"),UA=Oi("update-title"),jA=Oi("update-body"),WA=Oi("update-footer"),qA=Oi("body-send-message"),$A=function(e,t,n,r){return Kk(e,ye.some(t),n,r)},GA=function(e,t){return e=Kk(e,ye.none(),t,!1),sA.parts().body(e)},XA=function(e){return e={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[_w.craft({dom:{tag:"iframe",attributes:{src:e.url}},behaviours:ac([Jb.config({}),am.config({})])})]}],behaviours:ac([nm.config({mode:"acyclic",useTabstopAt:c(_w.isPseudoStop)})])},sA.parts().body(e)},YA={initUrlDialog:function(e,t){function n(t,n){return Xo(t,(function(t,r){var o,i;o=t,i=function(o,i){n(e(),o,r.event(),t)},NE.getState(o).get().each((function(e){i(e,o)}))}))}return g(Jk(n,t),[n(Pb,(function(e,t,n){t.onAction(e,{name:n.name()})}))])},initDialog:function(e,t){function n(t,n){return Xo(t,(function(t,r){var o,i;o=t,i=function(o,i){n(e(),o,r.event(),t)},NE.getState(o).get().each((function(e){i(e.internalDialog,o)}))}))}return g(Jk(n,t),[n(zb,(function(e,t){t.onSubmit(e)})),n(Rb,(function(e,t,n){t.onChange(e,{name:n.name()})})),n(Pb,(function(e,t,n,r){function o(){nm.focusIn(r)}var i=mc();t.onAction(e,{name:n.name(),value:n.value()}),mc().fold((function(){o()}),(function(e){(!nr(r.element(),e)||Ci(e,"disabled")||nr(e,i.getOrNull())&&Ci(i.getOrDie(),"disabled"))&&o()}))})),n(Fb,(function(e,t,n){t.onTabChange(e,{newTabName:n.name(),oldTabName:n.oldName()})})),Qo((function(t){var n=e();_l.setValue(t,n.getData())}))])}},KA=Qk,JA=function(e,t){return sA.parts().footer(Qk(e,t))},ZA=function(e,t,n){function r(t){var n=e.getRoot();n.getSystem().isConnected()&&t(n)}var o={getData:function(){var t=e.getRoot(),r=(t=t.getSystem().isConnected()?e.getFormWrapper():t,t=_l.getValue(t),Qe(n,(function(e){return e.get()})));return d(d({},t),r)},setData:function(t){r((function(r){var i=o.getData(),a=ct(i,t),u=(i=function(e,t){return e=e.getRoot(),NE.getState(e).get().map((function(e){return Xt(Gt("data",e.dataValidator,t))})).getOr(t)}(e,a),e.getFormWrapper());_l.setValue(u,i),Ze(n,(function(e,t){ot(a,t)&&e.set(a[t])}))}))},disable:function(t){eT(e,t).each(uh.disable)},enable:function(t){eT(e,t).each(uh.enable)},focus:function(t){eT(e,t).each(am.focus)},block:function(e){if(!xe(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(t){Xr(t,Ib,{message:e})}))},unblock:function(){r((function(e){Gr(e,Lb)}))},showTab:function(t){r((function(n){var r=e.getBody();NE.getState(r).get().exists((function(e){return e.isTabPanel()}))&&Od.getCurrent(r).each((function(e){LA.showTab(e,t)}))}))},redial:function(e){r((function(n){var r=t(e);n.getSystem().broadcastOn([VA],r),n.getSystem().broadcastOn([UA],r.internalDialog),n.getSystem().broadcastOn([jA],r.internalDialog),n.getSystem().broadcastOn([WA],r.internalDialog),o.setData(r.initialData)}))},close:function(){r((function(e){Gr(e,Bb)}))}};return o},QA=function(e,t,n){return Cb.sketch({dom:Gm('<div class="tox-dialog__header"></div>'),components:[nT(e,ye.some(t),n),rT(),tT(n)],containerBehaviours:ac([QN.config({mode:"mouse",blockerClass:"blocker",getTarget:function(e){return bu(e,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})},eD=Zg.deviceType.isTouch(),tD=function(e,t){return e={title:t.shared.providers.translate(e),draggable:t.dialog.isDraggableModal()},t=t.shared.providers,n=sA.parts().title(nT(e,ye.none(),t)),r=sA.parts().draghandle(rT()),t=sA.parts().close(tT(t)),n=[n].concat(e.draggable?[r]:[]).concat([t]),Cb.sketch({dom:Gm('<div class="tox-dialog__header"></div>'),components:n});var n,r},nD=function(e,t){return{onClose:function(){return t.closeWindow()},onBlock:function(t){sA.setBusy(e(),(function(e,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:Gm('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}))},onUnblock:function(){sA.setIdle(e())}}},rD=function(e,t,n,r){return pa(sA.sketch({lazySink:r.shared.getSink,onEscape:function(e){return Gr(e,Mb),ye.some(!0)},useTabstopAt:function(e){return!_w.isPseudoStop(e)},modalBehaviours:ac(g([NE.config({channel:VA,updateState:function(e,t){return ye.some(t)},initialData:t}),Ow.memory({}),am.config({}),im("execute-on-form",n.concat([Jo(mr(),(function(e,t){nm.focusIn(e)}))])),im("scroll-lock",[Zo((function(){Yi(Uo(),"tox-dialog__disable-scroll")})),Qo((function(){Ji(Uo(),"tox-dialog__disable-scroll")}))])],e.extraBehaviours)),eventOrder:((r={})[Er()]=["execute-on-form"],r[Tr()]=["reflecting","receiving"],r[Lr()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Fr()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses),styles:d({position:"relative"},e.extraStyles)},components:g([e.header,e.body],e.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:Gm('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:eD?["tox-dialog-wrap__backdrop","tox-dialog-wrap__backdrop--opaque"]:["tox-dialog-wrap__backdrop"]}}]}}}))},oD=function(e){return Me(e,(function(e){return"menu"===e.type?(n=Me((t=e).items,(function(e){var t=mn(!1);return d(d({},e),{storage:t})})),d(d({},t),{items:n})):e;var t,n}))},iD=function(e){return Fe(e,(function(e,t){return"menu"===t.type?Fe(t.items,(function(e,t){return e[t.name]=t.storage,e}),e):e}),{})},aD=tinymce.util.Tools.resolve("tinymce.util.URI"),uD=function(e){function t(t){e.getSystem().isConnected()&&t(e)}return{block:function(e){if(!xe(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t((function(t){Xr(t,Ib,{message:e})}))},unblock:function(){t((function(e){Gr(e,Lb)}))},close:function(){t((function(e){Gr(e,Bb)}))},sendMessage:function(e){t((function(t){t.getSystem().broadcastOn([qA],e)}))}}},cD=["insertContent","setContent","execCommand","close","block","unblock"],sD=function(e){return Ce(e)&&-1!==cD.indexOf(e.mceAction)},lD=function(e){return!sD(e)&&Ce(e)&&ot(e,"mceAction")},fD=function(e,t,n){switch(n.mceAction){case"insertContent":e.insertContent(n.content);break;case"setContent":e.setContent(n.content);break;case"execCommand":var r=!!ke(n.ui)&&n.ui;e.execCommand(n.cmd,r,n.value);break;case"close":t.close();break;case"block":t.block(n.message);break;case"unblock":t.unblock()}},dD=Zg.deviceType.isTouch(),mD={dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]}},gD={dom:{tag:"div",classes:["tox-dialog__header"]}},hD=function(e,t){return sA.parts().close(Am.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:ac([Jb.config({})])}))},pD=function(){return sA.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},vD=function(e,t){return sA.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Gm("<p>"+t.translate(e)+"</p>")}]}]})},bD=function(e){return sA.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e})},yD=function(e,t){return[Cb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),Cb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]},wD=function(e){return sA.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),ye.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[ut(e.headerOverride.getOr(gD),{components:[e.partSpecs.title,e.partSpecs.close]}),e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:Gm('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:dD?["tox-dialog-wrap__backdrop","tox-dialog-wrap__backdrop--opaque"]:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:ac([im("basic-dialog-events",[Xo(Mb,(function(t,n){e.onCancel()})),Xo(zb,(function(t,n){e.onSubmit()}))])])})},xD=function(e){function r(e,t,n,r){return zA.open((function(e,o,i){function s(){return C.on((function(e){qO.refresh(e)}))}o=Xt(Gt("data",i,o));var l,f,d,m,h,p,v,b,y,w,x,C=(l=mn(ye.none()),{clear:function(){l.set(ye.none())},set:function(e){l.set(ye.some(e))},isSet:function(){return l.get().isSome()},on:function(e){l.get().each(e)}}),S=(i={dataValidator:i,initialData:o,internalDialog:e},f={redial:zA.redial,closeWindow:function(){C.on(km.hide),u.off("ResizeEditor",s),C.clear(),n(S.instanceApi)}},e=a,d=r,m=Oi("dialog-label"),k=Oi("dialog-content"),h=Dm(QA({title:i.internalDialog.title,draggable:!0},m,e.shared.providers)),p=Dm($A({body:i.internalDialog.body},k,e,d)),d=oD(i.internalDialog.buttons),v=iD(d),b=Dm(KA({buttons:d},e)),d=YA.initDialog((function(){return w}),{onBlock:function(){},onUnblock:function(){},onClose:function(){return f.closeWindow()}}),y=pa({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((e={role:"dialog"})["aria-labelledby"]=m,e["aria-describedby"]=""+k,e)},eventOrder:((m={})[Tr()]=[NE.name(),fc.name()],m[Er()]=["execute-on-form"],m[Lr()]=["reflecting","execute-on-form"],m),behaviours:ac([nm.config({mode:"cyclic",onEscape:function(e){return Gr(e,Bb),ye.some(!0)},useTabstopAt:function(e){return!_w.isPseudoStop(e)&&("button"!==Lo(e)||"disabled"!==xi(e,"disabled"))}}),NE.config({channel:VA,updateState:function(e,t){return ye.some(t)},initialData:i}),am.config({}),im("execute-on-form",d.concat([Jo(mr(),(function(e,t){nm.focusIn(e)}))])),Ow.memory({})]),components:[h.asSpec(),p.asSpec(),b.asSpec()]}),w=ZA({getRoot:function(){return y},getFooter:function(){return b.get(y)},getBody:function(){return p.get(y)},getFormWrapper:function(){var e=p.get(y);return Od.getCurrent(e).getOr(e)}},f.redial,v),{dialog:y,instanceApi:w}),k=pa(km.sketch({lazySink:a.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:ac(g([im("window-manager-inline-events",[Xo(Hr(),(function(e,t){Gr(S.dialog,Mb)}))])],(x=u,c?[]:[qO.config({contextual:{lazyContext:function(){return ye.some(du(gn.fromDom(x.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},leftAttr:"data-dock-left",topAttr:"data-dock-top",positionAttr:"data-dock-pos",modes:["top"],lazyViewport:function(){var e=gu(),t=vu(gn.fromDom(x.getContainer()),".tox-editor-header").getOrDie();t=mu(t),t=Math.max(e.y(),t.bottom());return fu(e.x(),t,e.width(),e.bottom()-t)}})])))}));return C.set(k),km.showWithin(k,t,va(S.dialog),ye.some(Uo())),c||(qO.refresh(k),u.on("ResizeEditor",s)),S.instanceApi.setData(o),nm.focusIn(S.dialog),S.instanceApi}),e)}var o,i,a=e.backstage,u=e.editor,c=Ev(u),s=(i=(o=e).backstage.shared,{open:function(e,t){function r(){sA.hide(u),t()}var a=Dm(uC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:ye.none()},"cancel",o.backstage)),u=pa(wD({lazySink:function(){return i.getSink()},headerOverride:ye.some(mD),partSpecs:{title:pD(),close:hD((function(){r()}),i.providers),body:vD(e,i.providers),footer:bD(yD([],[a.asSpec()]))},onCancel:r,onSubmit:n,extraClasses:["tox-alert-dialog"]}));sA.show(u),e=a.get(u);am.focus(e)}}),l=oT(e);return{open:function(e,t,n){return void 0!==t&&"toolbar"===t.inline?r(e,a.shared.anchors.toolbar(),n,t.ariaAttrs):void 0!==t&&"cursor"===t.inline?r(e,a.shared.anchors.cursor(),n,t.ariaAttrs):(o=n,zA.open((function(e,t,n){r={redial:zA.redial,closeWindow:function(){sA.hide(g.dialog),o(g.instanceApi)}},i=a,e=tD((n={dataValidator:n,initialData:t,internalDialog:e}).internalDialog.title,i),u=GA({body:n.internalDialog.body},i),c=oD(n.internalDialog.buttons),s=iD(c),c=JA({buttons:c},i),l=YA.initDialog((function(){return m}),nD((function(){return d}),r)),f="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],e={header:e,body:u,footer:ye.some(c),extraClasses:f,extraBehaviours:[],extraStyles:{}},d=rD(e,n,l,i),m=ZA({getRoot:function(){return d},getBody:function(){return sA.getBody(d)},getFooter:function(){return sA.getFooter(d)},getFormWrapper:function(){var e=sA.getBody(d);return Od.getCurrent(e).getOr(e)}},r.redial,s);var r,i,u,c,s,l,f,d,m,g={dialog:d,instanceApi:m};return sA.show(g.dialog),g.instanceApi.setData(t),g.instanceApi}),e));var o},openUrl:function(e,n){return r=n,zA.openUrl((function(e){o={closeWindow:function(){sA.hide(w.dialog),r(w.instanceApi)}},i=u,c=a,e=tD((n=e).title,c),s=XA(n),l=n.buttons.bind((function(e){return 0===e.length?ye.none():ye.some(JA({buttons:e},c))})),o=YA.initUrlDialog((function(){return y}),nD((function(){return b}),o)),f=d(d({},n.height.fold((function(){return{}}),(function(e){return{height:e+"px","max-height":e+"px"}}))),n.width.fold((function(){return{}}),(function(e){return{width:e+"px","max-width":e+"px"}}))),m=n.width.isNone()&&n.height.isNone()?["tox-dialog--width-lg"]:[],g=new aD(n.url,{base_uri:new aD(t.window.location.href)}),h=g.protocol+"://"+g.host+(g.port?":"+g.port:""),p=mn(ye.none()),v=[im("messages",[Zo((function(){var e=nv(gn.fromDom(t.window),"message",(function(e){g.isSameOrigin(new aD(e.raw().origin))&&(e=e.raw().data,sD(e)?fD(i,y,e):lD(e)&&n.onMessage(y,e))}));p.set(ye.some(e))})),Qo((function(){p.get().each((function(e){return e.unbind()}))}))]),fc.config({channels:((v={})[qA]={onReceive:function(e,t){vu(e.element(),"iframe").each((function(e){e.dom().contentWindow.postMessage(t,h)}))}},v)})],b=rD({header:e,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:f},n,o,c),y=uD(b);var n,o,i,c,s,l,f,m,g,h,p,v,b,y,w={dialog:b,instanceApi:y};return sA.show(w.dialog),w.instanceApi}),e);var r},alert:function(e,t){s.open(e,(function(){t()}))},close:function(e){e.close()},confirm:function(e,t){l.open(e,(function(e){t(e)}))}}};f.add("silver",(function(e){var t=uA(e),n=t.uiMothership,r=t.backstage,i=t.renderUI;t=t.getUi,Qp(e,r.shared),e=xD({editor:e,backstage:r});return{renderUI:i,getWindowManagerImpl:o(e),getNotificationManagerImpl:function(){return Im(0,{backstage:r},n)},ui:t()}}))}(window)}).call(this,n("c8ba"))},"0335":function(e,t,n){n("0f58")},"07d1":function(e,t,n){n("94ce")},"07d7":function(e,t,n){n("a8b8")},"080b":function(e,t){!function(){"use strict";function e(){return'<img src="'+n.transparentSrc+'" class="'+i()+'" data-mce-resize="false" data-mce-placeholder />'}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),r=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},o=function(e){return e.getParam("pagebreak_split_block",!1)},i=function(){return"mce-pagebreak"},a=function(t){var n=r(t),i=new RegExp(n.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(function(e){return"\\"+e})),"gi");t.on("BeforeSetContent",(function(t){t.content=t.content.replace(i,e())})),t.on("PreInit",(function(){t.serializer.addNodeFilter("img",(function(e){for(var r,i,a=e.length;a--;)(i=(r=e[a]).attr("class"))&&-1!==i.indexOf("mce-pagebreak")&&(i=r.parent,t.schema.getBlockElements()[i.name]&&o(t)?(i.type=3,i.value=n,i.raw=!0,r.remove()):(r.type=3,r.value=n,r.raw=!0))}))}))},u=e,c=i,s=function(e){e.addCommand("mcePageBreak",(function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+u()+"</p>"):e.insertContent(u())}))},l=function(e){e.on("ResolveName",(function(t){"IMG"===t.target.nodeName&&e.dom.hasClass(t.target,c())&&(t.name="pagebreak")}))},f=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};t.add("pagebreak",(function(e){s(e),f(e),a(e),l(e)}))}()},"0902":function(e,t,n){n("88b6")},"09cf":function(e,t){!function(e){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",(function(){e.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")}))}(window)},"0a9d":function(e,t,n){n("69a4")},"0efa":function(e,t,n){n("4bdc")},"0f58":function(e,t){!function(){"use strict";function e(){}function t(e){return function(){return e}}var n=tinymce.util.Tools.resolve("tinymce.PluginManager");function r(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function o(e,t){return l.each(t,(function(t,n){"function"==typeof t&&(t=t(n)),e=e.replace(new RegExp("\\{\\$"+n+"\\}","g"),t)})),e}function i(e,t){var n=e.dom,r=d.getTemplateReplaceValues(e);l.each(n.select("*",t),(function(e){l.each(r,(function(t,o){n.hasClass(e,o)&&"function"==typeof r[o]&&r[o](e)}))}))}function a(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)}function u(){return v}var c=t(!1),s=t(!0),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),d={getCreationDateClasses:function(e){return e.getParam("template_cdate_classes","cdate")},getModificationDateClasses:function(e){return e.getParam("template_mdate_classes","mdate")},getSelectedContentClasses:function(e){return e.getParam("template_selected_content_classes","selcontent")},getPreviewReplaceValues:function(e){return e.getParam("template_preview_replace_values")},getTemplateReplaceValues:function(e){return e.getParam("template_replace_values")},getTemplates:function(e){return e.templates},getCdateFormat:function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},getMdateFormat:function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))}},m=function(e,t,n){var o="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),a="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" ");return n=n||new Date,(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",r(n.getMonth()+1,2))).replace("%d",r(n.getDate(),2))).replace("%H",""+r(n.getHours(),2))).replace("%M",""+r(n.getMinutes(),2))).replace("%S",""+r(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(a[n.getMonth()]))).replace("%A",""+e.translate(i[n.getDay()]))).replace("%a",""+e.translate(o[n.getDay()]))).replace("%%","%")},g={createTemplateList:function(e,t){return function(){var n=d.getTemplates(e);"function"==typeof n?n(t):"string"==typeof n?f.send({url:n,success:function(e){t(JSON.parse(e))}}):t(n)}},replaceTemplateValues:o,replaceVals:i,insertTemplate:function(e,t,n){var r,u=e.dom,c=e.selection.getContent();n=o(n,d.getTemplateReplaceValues(e)),n=u.create("div",null,n),(r=u.select(".mceTmpl",n))&&0<r.length&&(n=u.create("div",null)).appendChild(r[0].cloneNode(!0)),l.each(u.select("*",n),(function(t){a(t,d.getCreationDateClasses(e).replace(/\s+/g,"|"))&&(t.innerHTML=m(e,d.getCdateFormat(e))),a(t,d.getModificationDateClasses(e).replace(/\s+/g,"|"))&&(t.innerHTML=m(e,d.getMdateFormat(e))),a(t,d.getSelectedContentClasses(e).replace(/\s+/g,"|"))&&(t.innerHTML=c)})),i(e,n),e.execCommand("mceInsertContent",!1,n.innerHTML),e.addVisual()}},h=function(e){e.addCommand("mceInsertTemplate",function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.concat(n);return e.apply(null,o)}}(g.insertTemplate,e))},p=function(e){e.on("PreProcess",(function(t){var n=e.dom,r=d.getMdateFormat(e);l.each(n.select("div",t.node),(function(t){n.hasClass(t,"mceTmpl")&&(l.each(n.select("*",t),(function(t){n.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=m(e,r))})),g.replaceVals(e,t))}))}))},v=(T={fold:function(e,t){return e()},is:c,isSome:c,isNone:s,getOr:w,getOrThunk:y,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:t(null),getOrUndefined:t(void 0),or:w,orThunk:y,map:u,each:e,bind:u,exists:c,forall:s,filter:u,equals:b,equals_:b,toArray:function(){return[]},toString:t("none()")},Object.freeze&&Object.freeze(T),T);function b(e){return e.isNone()}function y(e){return e()}function w(e){return e}function x(e){function n(){return i}function r(t){return t(e)}var o=t(e),i={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:s,isNone:c,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(t){return x(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?i:v},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(c,(function(t){return n(e,t)}))}};return i}function C(e){return function(t){D.open(e,t)}}var S,k={some:x,none:u,from:function(e){return null==e?v:x(e)}},T=(S="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===S}),E=(Array.prototype.slice,T(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),O=Object.hasOwnProperty,N=function(e,t){return O.call(e,t)?k.from(e[t]):k.none()},A={'"':""","<":"<",">":">","&":"&","'":"'"},D={open:function(e,t){function n(e){for(var t=e,n=function(e){return{text:e.text,value:e.text}},r=t.length,o=new Array(r),i=0;i<r;i++){var a=t[i];o[i]=n(a,i)}return o}var r=function(e,t){for(var n=e,r=function(e){return e.text===t},o=0,i=n.length;o<i;o++){var a=n[o];if(r(a,o))return k.some(a)}return k.none()},o=function(e){return new E((function(t,n){e.value.url.fold((function(){return t(e.value.content.getOr(""))}),(function(e){return f.send({url:e,success:function(e){t(e)},error:function(e){n(e)}})}))}))};(t&&0!==t.length?k.from(l.map(t,(function(e,t){function n(e){return void 0!==e.url}return{selected:0===t,text:e.title,value:{url:n(e)?k.from(e.url):k.none(),content:n(e)?k.none():k.from(e.content),description:e.description}}}))):(t=e.translate("No templates defined."),e.notificationManager.open({text:t,type:"info"}),k.none())).each((function(t){function i(t,n,r){o=e,-1===(r=r).indexOf("<html>")&&(i="",l.each(o.contentCSS,(function(e){i+='<link type="text/css" rel="stylesheet" href="'+o.documentBaseURI.toAbsolute(e)+'">'})),-1!==(s=o.settings.body_class||"").indexOf("=")&&(s=(s=o.getParam("body_class","","hash"))[o.id]||""),c=o.dom.encode,f=(f=o.getBody().dir)?' dir="'+c(f)+'"':"",r="<!DOCTYPE html><html><head>"+i+'</head><body class="'+c(s)+'"'+f+">"+r+"</body></html>");var o,i,c=g.replaceTemplateValues(r,d.getPreviewReplaceValues(o)),s=[{type:"selectbox",name:"template",label:"Templates",items:a},{type:"htmlpanel",html:'<p aria-live="polite">'+n.value.description.replace(/["'<>&]/g,(function(e){return N(A,e).getOr(e)}))+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],f={template:n.text,preview:c};t.unblock(),t.redial(u(s,f)),t.focus("template")}var a=n(t),u=function(n,a){return{title:"Insert Template",size:"large",body:{type:"panel",items:n},initialData:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){var n=t.getData();r(s,n.template).each((function(n){o(n).then((function(n){g.insertTemplate(e,!1,n),t.close()}))}))},onChange:(u=s=t,c=i,function(e,t){"template"===t.name&&(t=e.getData().template,r(u,t).each((function(t){e.block("Loading..."),o(t).then((function(n){c(e,t,n),e.unblock()}))})))})};var u,c,s},c=e.windowManager.open(u([],{template:"",preview:""}));c.block("Loading..."),o(t[0]).then((function(e){i(c,t[0],e)}))}))}},_=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:g.createTemplateList(e.settings,C(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:g.createTemplateList(e.settings,C(e))})};n.add("template",(function(e){_(e),h(e),p(e)}))}()},"169f":function(e,t){!function(){"use strict";function e(e){return function(t){for(var n=0;n<t.length;n++)i(t[n])&&t[n].attr("contenteditable",e)}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n={isValidId:function(e){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(e)},getId:function(e){var t=e.selection.getNode();return"A"===t.tagName&&""===e.dom.getAttrib(t,"href")?t.getAttribute("id")||t.getAttribute("name"):""},insert:function(e,t){var n=e.selection.getNode();"A"===n.tagName&&""===e.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=t,e.undoManager.add()):(e.focus(),e.selection.collapse(!0),e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:t})))}},r=function(e){var t=n.getId(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(t){var r,o;r=e,o=t.getData().id,(n.isValidId(o)?(n.insert(r,o),1):(r.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),0))&&t.close()}})},o=function(e){e.addCommand("mceAnchor",(function(){r(e)}))},i=function(e){return!e.attr("href")&&(e.attr("id")||e.attr("name"))&&!e.firstChild},a=function(t){t.on("PreInit",(function(){t.parser.addNodeFilter("a",e("false")),t.serializer.addNodeFilter("a",e(null))}))},u=function(e){e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return e.execCommand("mceAnchor")},onSetup:function(t){return e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return e.execCommand("mceAnchor")}})};t.add("anchor",(function(e){a(e),o(e),u(e)}))}()},2401:function(e,t){!function(e){"use strict";function t(){}function n(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}}function r(){return c}var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return function(){return e}},a=i(!1),u=i(!0),c=(ht={fold:function(e,t){return e()},is:a,isSome:a,isNone:u,getOr:f,getOrThunk:l,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:f,orThunk:l,map:r,each:t,bind:r,exists:a,forall:u,filter:r,equals:s,equals_:s,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(ht),ht);function s(e){return e.isNone()}function l(e){return e()}function f(e){return e}function d(e){function t(){return o}function n(t){return t(e)}var r=i(e),o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:u,isNone:a,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return d(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?o:c},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(a,(function(t){return n(e,t)}))}};return o}function m(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}}function g(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function h(e,t,n){return g(e,(function(e){n=t(n,e)})),n}function p(e){return 0===e.length?De():Ae(e[0])}function v(e){return 0===e.length?De():Ae(e[e.length-1])}function b(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)}function y(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return y(n)}}}function w(e,t){var n=We(e,t);return n?qe(r(1),r(2)):{major:0,minor:0};function r(e){return Number(t.replace(n,"$"+e))}}function x(){return qe(0,0)}function C(e){var t=e.current;return{current:t,version:e.version,isEdge:et(Xe,t),isChrome:et(Ye,t),isIE:et(Ke,t),isOpera:et(Je,t),isFirefox:et(Ze,t),isSafari:et(Qe,t)}}function S(e){var t=e.current;return{current:t,version:e.version,isWindows:lt(rt,t),isiOS:lt(ot,t),isAndroid:lt(it,t),isOSX:lt(ut,t),isLinux:lt(at,t),isSolaris:lt(ct,t),isFreeBSD:lt(st,t)}}function k(e,t){var n=String(t).toLowerCase();return Ve(e,(function(e){return e.search(n)}))}function T(e,t){return-1!==e.indexOf(t)}function E(e){return function(t){return T(t,e)}}function O(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:i(e)}}function N(e,t){return e.dom()===t.dom()}function A(e,t,n){return e.isSome()&&t.isSome()?Ae(n(e.getOrDie(),t.getOrDie())):De()}function D(e){return _e(e.dom().parentNode).map(yt)}function _(e,t){return e=e.dom().childNodes,_e(e[t]).map(yt)}function R(e){return _(e,0)}function B(e){return _(e,e.dom().childNodes.length-1)}function M(e,t){D(e).each((function(n){n.dom().insertBefore(t.dom(),e.dom())}))}function P(e,t){e.dom().appendChild(t.dom())}function z(e,t){g(t,(function(t){P(e,t)}))}function I(e){null!==(e=e.dom()).parentNode&&e.parentNode.removeChild(e)}function L(e){return e&&"BR"===e.nodeName}function F(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",Rt(e,t))}function H(e){var t=e.selection.getSelectedBlocks();return Dt.grep(function(e,t){return t=Dt.map(t,(function(t){var n=e.dom.getParent(t,"li,dd,dt",Rt(e,t));return n||t})),At.unique(t)}(e,t),(function(e){return _t.isListItemNode(e)}))}function V(e,t){var n,r,o,i,a=e.dom,u=e.schema.getBlockElements(),c=a.createFragment();if((o=e.settings.forced_root_block?e.settings.forced_root_block:o)&&((r=a.create(o)).tagName===e.settings.forced_root_block&&a.setAttribs(r,e.settings.forced_root_block_attrs),_t.isBlock(t.firstChild,u)||c.appendChild(r)),t)for(;n=t.firstChild;){var s=n.nodeName;i||"SPAN"===s&&"bookmark"===n.getAttribute("data-mce-type")||(i=!0),_t.isBlock(n,u)?(c.appendChild(n),r=null):o?(r||(r=a.create(o),c.appendChild(r)),r.appendChild(n)):c.appendChild(n)}return e.settings.forced_root_block?i||r.appendChild(a.create("br",{"data-mce-bogus":"1"})):c.appendChild(a.create("br")),c}function U(e){return e.dom().nodeName.toLowerCase()}function j(e){return e.dom().nodeType===Oe}function W(t,n){for(var r=t.dom(),o=n,i=function(t,n){var o=r;if(!(Re(t)||Me(t)||ze(t)))throw e.console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",o),new Error("Attribute value was not simple");o.setAttribute(n,t+"")},a=Et(o),u=0,c=a.length;u<c;u++){var s=a[u];i(o[s],s)}}function q(e){return h(e.dom().attributes,(function(e,t){return e[t.name]=t.value,e}),{})}function $(t,n,r){if(!Re(r))throw e.console.error("Invalid call to CSS.set. Property ",n,":: Value ",r,":: Element ",t),new Error("CSS value must be a string: "+r);var o;void 0!==(o=t).style&&Pe(o.style.getPropertyValue)&&t.style.setProperty(n,r)}function G(e){return t=!0,yt(e.dom().cloneNode(t));var t}function X(e,t){t=function(e,t){return t=bt(t),e=q(e),W(t,e),t}(e,t);var n=(M(e,t),Ot(e));return z(t,n),I(e),t}function Y(e,t){P(e.item,t.list)}function K(e,t,n){for(var r=[],o=0;o<n;o++)r.push(function(e,t){return t={list:bt(t,e),item:bt("li",e)},P(t.list,t.item),t}(e,t.listType));return r}function J(e,t){for(var n=0;n<e.length-1;n++){r=void 0;var r=e[n].item,o="list-style-type",i="none";r=r.dom(),$(r,o,i)}v(e).each((function(e){W(e.list,t.listAttributes),W(e.item,t.itemAttributes),z(e.item,t.content)}))}function Z(e,t,n){return t=t.slice(0,n.depth),v(t).each((function(t){var r,o=function(e,t,n){return e=bt("li",e),W(e,t),z(e,n),e}(e,n.itemAttributes,n.content);o=o,P((r=t).list,o),r.item=o,r=n,U((o=t).list)!==r.listType&&(o.list=X(o.list,r.listType)),W(o.list,r.listAttributes)})),t}function Q(e,t,n){for(var r=e=K(e,n,n.depth-t.length),o=1;o<r.length;o++)Y(r[o-1],r[o]);return J(e,n),n=e,A(v(t),p(n),Y),t.concat(e)}function ee(e){return R(e).map(Ht).getOr(!1)}function te(e){return 0<e.depth}function ne(e){return e.isSelected}function re(e){var t=Ot(e);e=B(e).map(Ht).getOr(!1)?t.slice(0,-1):t;return Fe(e,G)}function oe(e){g(e,(function(t,n){(function(e,t){for(var n=e[t].depth,r=t-1;0<=r;r--){if(e[r].depth===n)return Ae(e[r]);if(e[r].depth<n)break}return De()})(e,n).each((function(e){var n;e=e,(n=t).listType=e.listType,n.listAttributes=Ut({},e.listAttributes)}))}))}function ie(t,n){return Fe(n,(function(n){n=n.content,r=(o||e.document).createDocumentFragment(),g(n,(function(e){r.appendChild(e.dom())}));var r,o=yt(r);return yt(V(t,o.dom()))}))}function ae(e,t){return oe(t),function(e,t){return t=h(t,(function(t,n){return(n.depth>t.length?Q:Z)(e,t,n)}),[]),p(t).map((function(e){return e.list}))}(e.contentDocument,t).toArray()}function ue(e,t){g(He(e,ne),(function(e){var n=e;switch(t){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}))}function ce(e){return e=Fe(zt(e),yt),A(Ve(e,n(ee)),Ve(function(e){return e=Ie.call(e,0),e.reverse(),e}(e),n(ee)),(function(e,t){return{start:e,end:t}}))}function se(e,t,n){t=t,r=ce(e),o=y(!1);var r,o;t=Fe(t,(function(e){return{sourceList:e,entries:Wt(0,r,o,e)}}));g(t,(function(t){ue(t.entries,n),r=e,i=t.entries;var r,o,i=Ue(function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],c=t(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}(i,te),(function(e){return(p(e).map(te).getOr(!1)?ae:ie)(r,e)}));g(i,(function(t){Nt(e,"Indent"===n?"IndentList":"OutdentList",t.dom())})),o=t.sourceList,g(i,(function(e){M(o,e)})),I(t.sourceList)}))}function le(e){Ct(e,"dt")&&X(e,"dd")}function fe(e,t,n){g(n,"Indent"===t?le:function(t){var n,r;n=e,Ct(r=t,"dd")?X(r,"dt"):Ct(r,"dt")&&D(r).each((function(e){return $t(n,e.dom(),r.dom())}))})}function de(e,t){if(_t.isTextNode(e))return{container:e,offset:t};var n=St.getNode(e,t);return _t.isTextNode(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:n.previousSibling&&_t.isTextNode(n.previousSibling)?{container:n.previousSibling,offset:n.previousSibling.data.length}:n.nextSibling&&_t.isTextNode(n.nextSibling)?{container:n.nextSibling,offset:0}:{container:e,offset:t}}function me(e,t){Dt.each(t,(function(t,n){e.setAttribute(n,t)}))}function ge(e,t,n,r){var o=t[n?"startContainer":"endContainer"];t=t[n?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(t,o.childNodes.length-1)]||o),!n&&_t.isBr(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(_t.isTextBlock(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function he(e,t,n){return an(t,n)&&un(e,t,n)&&cn(t,n)}function pe(e,t){var n,r=t.parentNode;"LI"===r.nodeName&&r.firstChild===t&&((n=r.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),_t.isEmpty(e,r)&&gn.remove(r)):gn.setStyle(r,"listStyleType","none")),_t.isListNode(r)&&(n=r.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)}function ve(e,t,n,r){var o=t.startContainer;t=t.startOffset;if(_t.isTextNode(o)&&(n?t<o.data.length:0<t))return o;var i=e.schema.getNonEmptyElements(),a=(1===o.nodeType&&(o=St.getNode(o,t)),new kt(o,r));for(n&&_t.isBogusBr(e.dom,o)&&a.next();o=a[n?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(i[o.nodeName])return o;if(_t.isTextNode(o)&&0<o.data.length)return o}}function be(e,t){return 1===(t=t.childNodes).length&&!_t.isListNode(t[0])&&e.isBlock(t[0])}function ye(e,t,n){var r,o,i=be(e,n)?n.firstChild:n;if(be(n=e,o=t)&&n.remove(o.firstChild,!0),!_t.isEmpty(e,t,!0))for(;r=t.firstChild;)i.appendChild(r)}function we(e,t,n){var r,o=t.parentNode;_t.isChildOfBody(e,t)&&_t.isChildOfBody(e,n)&&(_t.isListNode(n.lastChild)&&(r=n.lastChild),o===n.lastChild&&_t.isBr(o.previousSibling)&&e.remove(o.previousSibling),(o=n.lastChild)&&_t.isBr(o)&&t.hasChildNodes()&&e.remove(o),_t.isEmpty(e,n,!0)&&e.$(n).empty(),ye(e,t,n),r&&n.appendChild(r),o=xt(yt(n),yt(t))?e.getParents(t,_t.isListNode,n):[],e.remove(t),g(o,(function(t){_t.isEmpty(e,t)&&t!==e.getRoot()&&e.remove(t)})))}function xe(e,t,n,r){var o,i,a,u=e.dom;u.isEmpty(r)?(i=n,a=r,(o=e).dom.$(a).empty(),we(o.dom,i,a),o.selection.setCursorLocation(a)):(i=en.createBookmark(t),we(u,n,r),e.selection.setRng(en.resolveBookmark(i)))}function Ce(e,t){var n=e.dom,r=e.selection,o=r.getStart(),i=(o=It(e,o),n.getParent(r.getStart(),"LI",o));if(i){var a=i.parentNode;if(a===e.getBody()&&_t.isEmpty(n,a))return!0;var u=Gt(r.getRng()),c=n.getParent(ve(e,u,t,o),"LI",o);if(c&&c!==i)return e.undoManager.transact((function(){var n,r,o,a;t?xe(e,u,c,i):_t.isFirstChild(i)?Kt(e):(n=e,r=u,o=i,a=c,r=en.createBookmark(u),we(n.dom,o,a),o=en.resolveBookmark(r),n.selection.setRng(o))})),!0;if(!c&&!t&&0===u.startOffset&&0===u.endOffset)return e.undoManager.transact((function(){Jt(e)})),!0}return!1}function Se(e,t){var n=e.dom,r=e.selection.getStart(),o=It(e,r),i=n.getParent(r,n.isBlock,o);if(i&&n.isEmpty(i)){r=Gt(e.selection.getRng());var a=n.getParent(ve(e,r,t,o),"LI",o);if(a)return e.undoManager.transact((function(){var r=n,u=i,c=o;c=r.getParent(u.parentNode,r.isBlock,c),r.remove(u),c&&r.isEmpty(c)&&r.remove(c),mn(n,a.parentNode),e.selection.select(a,!0),e.selection.collapse(t)})),!0}return!1}function ke(e,t){return e.selection.isCollapsed()?pn(e,t):vn(e)}function Te(e,t){return function(){var n=e.dom.getParent(e.selection.getStart(),"UL,OL,DL");return n&&n.nodeName===t}}function Ee(e,t){return function(n){function r(e){var r=-1!==(r=kn(e.parents,_t.isTableCellNode))?e.parents.slice(0,r):e.parents;e=Dt.grep(r,_t.isListNode);n.setActive(0<e.length&&e[0].nodeName===t&&!tn(e[0]))}return e.on("NodeChange",r),function(){return e.off("NodeChange",r)}}}var Oe,Ne,Ae=d,De=r,_e=function(e){return null==e?c:d(e)},Re=m("string"),Be=m("array"),Me=m("boolean"),Pe=m("function"),ze=m("number"),Ie=Array.prototype.slice,Le=Array.prototype.push,Fe=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},He=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r)&&n.push(i)}return n},Ve=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n))return Ae(o)}return De()},Ue=function(e,t){for(var n=Fe(e,t),r=[],o=0,i=n.length;o<i;++o){if(!Be(n[o]))throw new Error("Arr.flatten item "+o+" was not an array, input: "+n);Le.apply(r,n[o])}return r},je=(Pe(Array.from)&&Array.from,function(t,n){return b(t,n,e.Node.DOCUMENT_POSITION_CONTAINED_BY)}),We=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}},qe=function(e,t){return{major:e,minor:t}},$e=function(e,t){return t=String(t).toLowerCase(),0===e.length?x():w(e,t)},Ge=x,Xe="Edge",Ye="Chrome",Ke="IE",Je="Opera",Ze="Firefox",Qe="Safari",et=function(e,t){return function(){return t===e}},tt=function(){return C({current:void 0,version:Ge()})},nt=C,rt=(i(Xe),i(Ye),i(Ke),i(Je),i(Ze),i(Qe),"Windows"),ot="iOS",it="Android",at="Linux",ut="OSX",ct="Solaris",st="FreeBSD",lt=function(e,t){return function(){return t===e}},ft=function(){return S({current:void 0,version:Ge()})},dt=S,mt=(i(rt),i(ot),i(it),i(at),i(ut),i(ct),i(st),function(e,t){return k(e,t).map((function(e){var n=$e(e.versionRegexes,t);return{current:e.name,version:n}}))}),gt=function(e,t){return k(e,t).map((function(e){var n=$e(e.versionRegexes,t);return{current:e.name,version:n}}))},ht=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,pt=(ht=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return T(e,"edge/")&&T(e,"chrome")&&T(e,"safari")&&T(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ht],search:function(e){return T(e,"chrome")&&!T(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return T(e,"msie")||T(e,"trident")}},{name:"Opera",versionRegexes:[ht,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:E("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:E("firefox")},{name:"Safari",versionRegexes:[ht,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(T(e,"safari")||T(e,"mobile/"))&&T(e,"applewebkit")}}],[{name:"Windows",search:E("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return T(e,"iphone")||T(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:E("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:E("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:E("linux"),versionRegexes:[]},{name:"Solaris",search:E("sunos"),versionRegexes:[]},{name:"FreeBSD",search:E("freebsd"),versionRegexes:[]}]),vt={browsers:i(ht),oses:i(pt)},bt=(ht=y(function(e,t){var n,r,o,a,u,c=vt.browsers(),s=vt.oses(),l=(c=mt(c,e).fold(tt,nt),s=gt(s,e).fold(ft,dt),r=c,e=e,t=t,l=(n=s).isiOS()&&!0===/ipad/i.test(e),o=n.isiOS()&&!l,a=n.isiOS()||n.isAndroid(),u=a||t("(pointer:coarse)"),t=l||!o&&a&&t("(min-device-width:768px)"),a=o||a&&!t,r=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(e),e=!a&&!t&&!r,{isiPad:i(l),isiPhone:i(o),isTablet:i(t),isPhone:i(a),isTouch:i(u),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:i(r),isDesktop:i(e)});return{browser:c,os:s,deviceType:l}}(e.navigator.userAgent,(function(t){return e.window.matchMedia(t).matches}))),function(t,n){return n=(n||e.document).createElement(t),O(n)}),yt=O,wt=(pt=(e.Node.ATTRIBUTE_NODE,e.Node.CDATA_SECTION_NODE,e.Node.COMMENT_NODE,e.Node.DOCUMENT_NODE,e.Node.DOCUMENT_TYPE_NODE,e.Node.DOCUMENT_FRAGMENT_NODE,e.Node.ELEMENT_NODE),e.Node.TEXT_NODE,e.Node.PROCESSING_INSTRUCTION_NODE,e.Node.ENTITY_REFERENCE_NODE,e.Node.ENTITY_NODE,e.Node.NOTATION_NODE,pt),xt=ht.get().browser.isIE()?function(e,t){return je(e.dom(),t.dom())}:function(e,t){return e=e.dom(),t=t.dom(),e!==t&&e.contains(t)},Ct=function(e,t){if(e=e.dom(),e.nodeType!==wt)return!1;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},St=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),kt=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Tt=tinymce.util.Tools.resolve("tinymce.util.VK"),Et=Object.keys,Ot=function(e){return Fe(e.dom().childNodes,yt)},Nt=(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(e,t,n){return e.fire("ListMutation",{action:t,element:n})}),At=(void 0!==e.window?e.window:Function("return this;")(),tinymce.util.Tools.resolve("tinymce.dom.DomQuery")),Dt=tinymce.util.Tools.resolve("tinymce.util.Tools"),_t={isTextNode:function(e){return e&&3===e.nodeType},isListNode:function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},isOlUlNode:function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},isDlItemNode:function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},isListItemNode:function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},isTableCellNode:function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},isBr:L,isFirstChild:function(e){return e.parentNode.firstChild===e},isLastChild:function(e){return e.parentNode.lastChild===e},isTextBlock:function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},isBlock:function(e,t){return e&&e.nodeName in t},isBogusBr:function(e,t){return!!L(t)&&!(!e.isBlock(t.nextSibling)||L(t.previousSibling))},isEmpty:function(e,t,n){var r=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&r},isChildOfBody:function(e,t){return e.isChildOf(t,e.getRoot())}},Rt=function(e,t){return t=e.dom.getParents(t,"TD,TH"),0<t.length?t[0]:e.getBody()},Bt=function(e,t){return e=e.dom.getParents(t,"ol,ul",Rt(e,t)),v(e)},Mt=F,Pt=function(e){var t,n,r=F(e);e=e.selection.getSelectedBlocks();return n=e,(t=r)&&1===n.length&&n[0]===t?Dt.grep(r.querySelectorAll("ol,ul,dl"),(function(e){return _t.isListNode(e)})):Dt.grep(e,(function(e){return _t.isListNode(e)&&r!==e}))},zt=H,It=Rt,Lt=function(e){return He(H(e),_t.isDlItemNode)},Ft=function(e){r=Bt(n=e,n.selection.getStart()),n=He(n.selection.getSelectedBlocks(),_t.isOlUlNode);var t,n,r=r.toArray().concat(n);return t=e,n=Fe(r,(function(e){return Bt(t,e).getOr(e)})),At.unique(n)},Ht=(Oe=pt,function(e){return Ct(e,"OL,UL")}),Vt=Object.prototype.hasOwnProperty,Ut=(Ne=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o,i=e[r];for(o in i)Vt.call(i,o)&&(n[o]=Ne(n[o],i[o]))}return n}),jt=function(e,t,n,r){return R(r).filter(Ht).fold((function(){t.each((function(e){N(e.start,r)&&n.set(!0)})),o=r,i=e,a=n.get();var o,i,a,u=D(o).filter(j).map((function(e){return{depth:i,isSelected:a,content:re(o),itemAttributes:q(o),listAttributes:q(e),listType:U(e)}})),c=(t.each((function(e){N(e.end,r)&&n.set(!1)})),B(r).filter(Ht).map((function(r){return Wt(e,t,n,r)})).getOr([]));return u.toArray().concat(c)}),(function(r){return Wt(e,t,n,r)}))},Wt=function(e,t,n,r){return Ue(Ot(r),(function(r){return(Ht(r)?Wt:jt)(e+1,t,n,r)}))},qt=(ht=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ht.DOM),$t=function(e,t,n){var r,o,i=qt.select('span[data-mce-type="bookmark"]',t),a=V(e,n),u=qt.createRng();for(u.setStartAfter(n),u.setEndAfter(t),r=(u=u.extractContents()).firstChild;r;r=r.firstChild)if("LI"===r.nodeName&&e.dom.isEmpty(r)){qt.remove(r);break}e.dom.isEmpty(u)||qt.insertAfter(u,t),qt.insertAfter(a,t),_t.isEmpty(e.dom,n.parentNode)&&(o=n.parentNode,Dt.each(i,(function(e){o.parentNode.insertBefore(e,n.parentNode)})),qt.remove(o)),qt.remove(n),_t.isEmpty(e.dom,t)&&qt.remove(t)},Gt=function(e){var t=e.cloneRange(),n=de(e.startContainer,e.startOffset);t.setStart(n.container,n.offset),n=de(e.endContainer,e.endOffset);return t.setEnd(n.container,n.offset),t},Xt=function(e,t){var n,r=Fe(Ft(e),yt),o=Fe(Lt(e),yt),i=!1;return(r.length||o.length)&&(n=e.selection.getBookmark(),se(e,r,t),fe(e,t,o),e.selection.moveToBookmark(n),e.selection.setRng(Gt(e.selection.getRng())),e.nodeChanged(),i=!0),i},Yt=function(e){return Xt(e,"Indent")},Kt=function(e){return Xt(e,"Outdent")},Jt=function(e){return Xt(e,"Flatten")},Zt=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Qt=ht.DOM,en={createBookmark:function(e){function t(t){var r,o=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"];1===o.nodeType&&(r=Qt.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),t?o.insertBefore(r,o.childNodes[i]):Qt.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),n[t?"startContainer":"endContainer"]=o,n[t?"startOffset":"endOffset"]=i}var n={};return t(!0),e.collapsed||t(),n},resolveBookmark:function(e){function t(t){var n,r=n=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"];r&&(1===r.nodeType&&(o=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(r),r=r.parentNode,Qt.remove(n),!r.hasChildNodes()&&Qt.isBlock(r)&&r.appendChild(Qt.create("br"))),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=o)}t(!0),t();var n=Qt.createRng();return n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),Gt(n)}},tn=function(e){return/\btox\-/.test(e.className)},nn=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},rn=function(e,t,n){var r,o=e,i=t,a=n;a=a["list-style-type"]||null,o.setStyle(i,"list-style-type",a),o=e,me(i=t,(r=n)["list-attributes"]),Dt.each(o.select("li",i),(function(e){me(e,r["list-item-attributes"])}))},on=function(e,t,n){void 0===n&&(n={});var r,o=e.selection.getRng(!0),i="LI",a=It(e,e.selection.getStart(!0)),u=e.dom;"false"!==u.getContentEditable(e.selection.getNode())&&("DL"===(t=t.toUpperCase())&&(i="DT"),r=en.createBookmark(o),Dt.each(function(e,t,n){for(var r,o=[],i=e.dom,a=ge(e,t,!0,n),u=ge(e,t,!1,n),c=[],s=a;s&&(c.push(s),s!==u);s=s.nextSibling);return Dt.each(c,(function(t){if(_t.isTextBlock(e,t))return o.push(t),void(r=null);if(i.isBlock(t)||_t.isBr(t))return _t.isBr(t)&&i.remove(t),void(r=null);var a=t.nextSibling;Zt.isBookmarkNode(t)&&(_t.isTextBlock(e,a)||!a&&t.parentNode===n)?r=null:(r||(r=i.create("p"),t.parentNode.insertBefore(r,t),o.push(r)),r.appendChild(t))})),o}(e,o,a),(function(r){var o,a,c,s=r.previousSibling;s&&_t.isListNode(s)&&s.nodeName===t&&function(e,t,n){return e=e.getStyle(t,"list-style-type"),t=n?n["list-style-type"]:"",e===(null===t?"":t)}(u,s,n)?(o=s,r=u.rename(r,i),s.appendChild(r)):(o=u.create(t),r.parentNode.insertBefore(o,r),o.appendChild(r),r=u.rename(r,i)),a=u,c=r,s=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],Dt.each(s,(function(e){var t;return a.setStyle(c,((t={})[e]="",t))})),rn(u,o,n),sn(e.dom,o)})),e.selection.setRng(en.resolveBookmark(r)))},an=function(e,t){return e&&t&&_t.isListNode(e)&&e.nodeName===t.nodeName},un=function(e,t,n){return e.getStyle(t,"list-style-type",!0)===e.getStyle(n,"list-style-type",!0)},cn=function(e,t){return e.className===t.className},sn=function(e,t){var n,r=t.nextSibling;if(he(e,t,r)){for(;n=r.firstChild;)t.appendChild(n);e.remove(r)}if(r=t.previousSibling,he(e,t,r)){for(;n=r.lastChild;)t.insertBefore(n,t.firstChild);e.remove(r)}},ln=function(e,t,n,r){var o;t.nodeName!==n?(o=e.dom.rename(t,n),rn(e.dom,o,r),Nt(e,nn(n),o)):(rn(e.dom,t,r),Nt(e,nn(n),t))},fn=function(e){return"list-style-type"in e},dn=function(e,t,n){var r,o,i,a,u,c=Mt(e),s=Pt(e);n=n||{},c&&0<s.length?(r=e,s=s,i=t,a=n,(o=c).nodeName!==i||fn(a)?(u=en.createBookmark(r.selection.getRng(!0)),Dt.each([o].concat(s),(function(e){ln(r,e,i,a)})),r.selection.setRng(en.resolveBookmark(u))):Jt(r)):(o=t,s=n,(u=c)!==(t=e).getBody()&&(u?u.nodeName!==o||fn(s)||tn(u)?(n=en.createBookmark(t.selection.getRng(!0)),rn(t.dom,u,s),c=t.dom.rename(u,o),sn(t.dom,c),t.selection.setRng(en.resolveBookmark(n)),Nt(t,nn(o),c)):Jt(t):(on(t,o,s),Nt(t,nn(o),u))))},mn=sn,gn=ht.DOM,hn=function(e,t){Dt.each(Dt.grep(e.select("ol,ul",t)),(function(t){pe(e,t)}))},pn=function(e,t){return Ce(e,t)||Se(e,t)},vn=function(e){var t=e.selection.getStart(),n=It(e,t);return!!(e.dom.getParent(t,"LI,DT,DD",n)||0<zt(e).length)&&(e.undoManager.transact((function(){e.execCommand("Delete"),hn(e.dom,e.getBody())})),!0)},bn=function(e){e.on("keydown",(function(t){t.keyCode===Tt.BACKSPACE?ke(e,!1)&&t.preventDefault():t.keyCode===Tt.DELETE&&ke(e,!0)&&t.preventDefault()}))},yn=ke,wn=function(e){return{backspaceDelete:function(t){yn(e,t)}}},xn=function(e){e.on("BeforeExecCommand",(function(t){t=t.command.toLowerCase(),"indent"===t?Yt(e):"outdent"===t&&Kt(e)})),e.addCommand("InsertUnorderedList",(function(t,n){dn(e,"UL",n)})),e.addCommand("InsertOrderedList",(function(t,n){dn(e,"OL",n)})),e.addCommand("InsertDefinitionList",(function(t,n){dn(e,"DL",n)})),e.addCommand("RemoveList",(function(){Jt(e)})),e.addQueryStateHandler("InsertUnorderedList",Te(e,"UL")),e.addQueryStateHandler("InsertOrderedList",Te(e,"OL")),e.addQueryStateHandler("InsertDefinitionList",Te(e,"DL"))},Cn=function(e){return e.getParam("lists_indent_on_tab",!0)},Sn=function(e){var t;Cn(e)&&(t=e).on("keydown",(function(e){e.keyCode!==Tt.TAB||Tt.metaKeyPressed(e)||t.undoManager.transact((function(){(e.shiftKey?Kt:Yt)(t)&&e.preventDefault()}))})),bn(e)},kn=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},Tn=function(e){function t(t){return function(){return e.execCommand(t)}}!function(e,t){return e=e.settings.plugins||"",-1!==Dt.inArray(e.split(/[ ,]/),t)}(e,"advlist")&&(e.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:t("InsertOrderedList"),onSetup:Ee(e,"OL")}),e.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:t("InsertUnorderedList"),onSetup:Ee(e,"UL")}))};o.add("lists",(function(e){return Sn(e),Tn(e),xn(e),wn(e)}))}(window)},"24e8":function(e,t){!function(){"use strict";function e(e,t){return t<0&&(t=0),3===e.nodeType&&(e=e.data.length)<t?e:t}function t(t,n,r){1!==n.nodeType||n.hasChildNodes()?t.setStart(n,e(n,r)):t.setStartBefore(n)}function n(t,n,r){1!==n.nodeType||n.hasChildNodes()?t.setEnd(n,e(n,r)):t.setEndAfter(n)}var r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},a=function(e){return e.getParam("default_link_target",!1)},u=function(e,r,o){var u,c,s,l,f,d,m=i(e),g=a(e);if("A"!==e.selection.getNode().tagName){if((u=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(d=u.endContainer.previousSibling)){if(!u.endContainer.firstChild||!u.endContainer.firstChild.nextSibling)return;d=u.endContainer.firstChild.nextSibling}if(l=d.length,t(u,d,l),n(u,d,l),u.endOffset<5)return;c=u.endOffset,s=d}else{if(3!==(s=u.endContainer).nodeType&&s.firstChild){for(;3!==s.nodeType&&s.firstChild;)s=s.firstChild;3===s.nodeType&&(t(u,s,0),n(u,s,s.nodeValue.length))}c=1===u.endOffset?2:u.endOffset-1-r}for(l=c;t(u,s,2<=c?c-2:0),n(u,s,1<=c?c-1:0),--c," "!==(f=u.toString())&&""!==f&&160!==f.charCodeAt(0)&&0<=c-2&&f!==o;);(d=u.toString())===o||" "===d||160===d.charCodeAt(0)?(t(u,s,c),n(u,s,l),c+=1):(0===u.startOffset?t(u,s,0):t(u,s,c),n(u,s,l)),"."===(r=u.toString()).charAt(r.length-1)&&n(u,s,l-1),(l=(r=u.toString().trim()).match(m))&&("www."===l[1]?l[1]="http://www.":/@$/.test(l[1])&&!/^mailto:/.test(l[1])&&(l[1]="mailto:"+l[1]),r=e.selection.getBookmark(),e.selection.setRng(u),e.execCommand("createlink",!1,l[1]+l[2]),!1!==g&&e.dom.setAttrib(e.selection.getNode(),"target",g),e.selection.moveToBookmark(r),e.nodeChanged())}},c=function(e){var t;e.on("keydown",(function(t){13===t.keyCode&&u(e,-1,"")})),o.browser.isIE()?e.on("focus",(function(){if(!t){t=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}})):(e.on("keypress",(function(t){41===t.keyCode&&u(e,-1,"(")})),e.on("keyup",(function(t){32===t.keyCode&&u(e,0,"")})))};r.add("autolink",(function(e){c(e)}))}()},2519:function(e,t){!function(){"use strict";var e=function(t){function n(){return r}var r=t;return{get:n,set:function(e){r=e},clone:function(){return e(r)}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},r=tinymce.util.Tools.resolve("tinymce.util.Tools");function o(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function i(e,t){var n=[],o=r.toArray(e.getBody().getElementsByTagName("span"));if(o.length)for(var i=0;i<o.length;i++){var a=d(o[i]);null!==a&&a.length&&a===t.toString()&&n.push(o[i])}return n}function a(e,t,n,r,o){n=(n=n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")).replace(/\s/g,"[^\\S\\r\\n]"),n=o?"\\b"+n+"\\b":n;var i=m(e,t,new RegExp(n,r?"g":"gi"));return i&&(e=h(e,t,!0),t.set({index:e,count:i,text:n,matchCase:r,wholeWord:o})),i}function u(e,t,o,i,a){var u,c,s,l,f=t.get(),m=f.index,h=m;for(i=!1!==i,s=e.getBody(),c=r.grep(r.toArray(s.getElementsByTagName("span")),y),u=0;u<c.length;u++){var w=d(c[u]),x=l=parseInt(w,10);if(a||x===f.index){for(o.length?(c[u].firstChild.nodeValue=o,g(c[u])):p(e.dom,c[u]);c[++u];){if((x=parseInt(d(c[u]),10))!==l){u--;break}p(e.dom,c[u])}i&&h--}else m<l&&c[u].setAttribute("data-mce-index",String(l-1))}return t.set(n(n({},f),{count:a?0:f.count-1,index:h})),(i?v:b)(e,t),!a&&0<t.get().count}function c(e,t,o){for(var i,a,u=t.get(),c=r.toArray(e.getBody().getElementsByTagName("span")),s=0;s<c.length;s++){var l=d(c[s]);null!==l&&l.length&&(l===u.index.toString()&&(i=i||c[s].firstChild,a=c[s].firstChild),g(c[s]))}if(t.set(n(n({},u),{index:-1,count:0,text:""})),i&&a)return(t=e.dom.createRng()).setStart(i,0),t.setEnd(a,a.data.length),!1!==o&&e.selection.setRng(t),t}function s(e){return function(){return e}}function l(){return S}var f={findAndReplaceDOMText:function(e,t,n,r,i){var a,u,c,s,l,f,d,m,g=[],h=0;function p(e,t){if(t=t||0,!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");var n=e.index;if(0<t){if(t=e[t],!t)throw new Error("Invalid capture group");n+=e[0].indexOf(t),e[0]=t}return[n,n+e[0].length,[e[0]]]}if(c=t.ownerDocument,s=i.getBlockElements(),l=i.getWhiteSpaceElements(),f=i.getShortEndedElements(),u=function e(t){var n;if(3===t.nodeType)return t.data;if(l[t.nodeName]&&!s[t.nodeName])return"";if(n="",o(t))return"\n";if((s[t.nodeName]||f[t.nodeName])&&(n+="\n"),t=t.firstChild)for(;n+=e(t),t=t.nextSibling;);return n}(t)){if(e.global)for(;a=e.exec(u);)g.push(p(a,r));else a=u.match(e),g.push(p(a,r));if(g.length){h=g.length;var v,b,y,w,x=t,C=g,S=(m="function"!=typeof(i=n)?(d=i.nodeType?i:c.createElement(i),function(e,t){var n=d.cloneNode(!1);return n.setAttribute("data-mce-index",t),e&&n.appendChild(c.createTextNode(e)),n}):i,function(e){var t,n=e.startNode,r=e.endNode,o=e.matchIndex;if(n===r)return t=(u=n).parentNode,0<e.startNodeIndex&&(i=c.createTextNode(u.data.substring(0,e.startNodeIndex)),t.insertBefore(i,u)),g=m(e.match[0],o),t.insertBefore(g,u),e.endNodeIndex<u.length&&(a=c.createTextNode(u.data.substring(e.endNodeIndex)),t.insertBefore(a,u)),u.parentNode.removeChild(u),g;for(var i=c.createTextNode(n.data.substring(0,e.startNodeIndex)),a=c.createTextNode(r.data.substring(e.endNodeIndex)),u=m(n.data.substring(e.startNodeIndex),o),s=0,l=e.innerNodes.length;s<l;++s){var f=e.innerNodes[s],d=m(f.data,o);f.parentNode.replaceChild(d,f)}var g=m(r.data.substring(0,e.endNodeIndex),o);return(t=n.parentNode).insertBefore(i,n),t.insertBefore(u,n),t.removeChild(n),(t=r.parentNode).insertBefore(g,r),t.insertBefore(a,r),t.removeChild(r),g}),k=[],T=0,E=x,O=C.shift(),N=0;e:for(;;){if((s[E.nodeName]||f[E.nodeName]||o(E))&&T++,3===E.nodeType&&(!b&&E.length+T>=O[1]?(b=E,w=O[1]-T):v&&k.push(E),!v&&E.length+T>O[0]&&(v=E,y=O[0]-T),T+=E.length),v&&b){if(E=S({startNode:v,startNodeIndex:y,endNode:b,endNodeIndex:w,innerNodes:k,match:O[2],matchIndex:N}),T-=b.length-w,b=v=null,k=[],N++,!(O=C.shift()))break}else if(l[E.nodeName]&&!s[E.nodeName]||!E.firstChild){if(E.nextSibling){E=E.nextSibling;continue}}else if(!o(E)){E=E.firstChild;continue}for(;;){if(E.nextSibling){E=E.nextSibling;break}if(E.parentNode===x)break e;E=E.parentNode}}}return h}}},d=function(e){return e=e.getAttribute("data-mce-index"),"number"==typeof e?""+e:e},m=function(e,t,n){var r,o=e.dom.create("span",{"data-mce-bogus":1});return o.className="mce-match-marker",r=e.getBody(),c(e,t,!1),f.findAndReplaceDOMText(n,r,o,!1,e.schema)},g=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},h=function(e,t,n){t=t.get();var r=t.index,o=e.dom;(n=!1!==n)?r+1===t.count?r=0:r++:r-1==-1?r=t.count-1:r--,o.removeClass(i(e,t.index),"mce-match-marker-selected"),n=i(e,r);return n.length?(o.addClass(i(e,r),"mce-match-marker-selected"),e.selection.scrollIntoView(n[0]),r):-1},p=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},v=function(e,t){e=h(e,t,!0),t.set(n(n({},t.get()),{index:e}))},b=function(e,t){e=h(e,t,!1),t.set(n(n({},t.get()),{index:e}))},y=function(e){return e=d(e),null!==e&&0<e.length},w=function(e,t){return{done:function(n){return c(e,t,n)},find:function(n,r,o){return a(e,t,n,r,o)},next:function(){return v(e,t)},prev:function(){return b(e,t)},replace:function(n,r,o){return u(e,t,n,r,o)}}},x=s(!1),C=s(!0),S=(_={fold:function(e,t){return e()},is:x,isSome:x,isNone:C,getOr:E,getOrThunk:T,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(void 0),or:E,orThunk:T,map:l,each:function(){},bind:l,exists:x,forall:C,filter:l,equals:k,equals_:k,toArray:function(){return[]},toString:s("none()")},Object.freeze&&Object.freeze(_),_);function k(e){return e.isNone()}function T(e){return e()}function E(e){return e}function O(e){function t(){return o}function n(t){return t(e)}var r=s(e),o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:C,isNone:x,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return O(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?o:S},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(x,(function(t){return n(e,t)}))}};return o}function N(e,t){return function(){R.open(e,t)}}var A,D={some:O,none:l,from:function(e){return null==e?S:O(e)}},_=(A="function",function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(e)===A}),R=(Array.prototype.slice,_(Array.from)&&Array.from,{open:function(t,n){o=e(D.none());var o,i={clear:function(){o.set(D.none())},set:function(e){o.set(D.some(e))},isSet:function(){return o.get().isSome()},on:function(e){o.get().each(e)}},s=(t.undoManager.add(),r.trim(t.selection.getContent({format:"text"})));function l(e){(1<n.get().count?e.enable:e.disable)("next"),(1<n.get().count?e.enable:e.disable)("prev")}function f(e,t){t=t?e.disable:e.enable;for(var n=["replace","replaceall","prev","next"],r=t,o=0,i=n.length;o<i;o++)r(n[o],o)}function d(e){c(t,n,!1),f(e,!0),l(e)}function m(e){var r,o=e.getData(),i=n.get();o.findtext.length?(i.text===o.findtext&&i.matchCase===o.matchcase&&i.wholeWord===o.wholewords?v(t,n):((i=a(t,n,o.findtext,o.matchcase,o.wholewords))<=0&&(r=e,t.windowManager.alert("Could not find the specified string.",(function(){r.focus("findtext")}))),f(e,0===i)),l(e)):d(e)}var g=n.get();s={findtext:s,replacetext:"",wholewords:g.wholeWord,matchcase:g.matchCase};i.set(t.windowManager.open({title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:s,onChange:function(e,t){"findtext"===t.name&&0<n.get().count&&d(e)},onAction:function(e,r){var o=e.getData();switch(r.name){case"find":m(e);break;case"replace":(u(t,n,o.replacetext)?l:d)(e);break;case"replaceall":u(t,n,o.replacetext,!0,!0),d(e);break;case"prev":b(t,n),l(e);break;case"next":v(t,n),l(e)}},onSubmit:m,onClose:function(){t.focus(),c(t,n),t.undoManager.add()}},{inline:"toolbar"}))}}),B=function(e,t){e.addCommand("SearchReplace",(function(){R.open(e,t)}))},M=function(e,t){e.ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:N(e,t),icon:"search"}),e.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:N(e,t),icon:"search"}),e.shortcuts.add("Meta+F","",N(e,t))};t.add("searchreplace",(function(t){var n=e({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1});return B(t,n),M(t,n),w(t,n)}))}()},"2b07":function(e,t,n){n("dbbc")},"2d33":function(e,t,n){n("303c")},"2fec":function(e,t,n){n("24e8")},"303c":function(e,t){!function(e){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",(function(){e.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")}))}(window)},3154:function(e,t,n){n("f034")},"34de":function(e,t,n){n("09cf")},"365e":function(e,t,n){n("cf08")},3699:function(e,t){!function(){"use strict";function e(e){return function(){return e}}function t(){return a}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=e(!1),i=e(!0),a=(A={fold:function(e,t){return e()},is:o,isSome:o,isNone:i,getOr:s,getOrThunk:c,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:e(null),getOrUndefined:e(void 0),or:s,orThunk:c,map:t,each:function(){},bind:t,exists:o,forall:i,filter:t,equals:u,equals_:u,toArray:function(){return[]},toString:e("none()")},Object.freeze&&Object.freeze(A),A);function u(e){return e.isNone()}function c(e){return e()}function s(e){return e}function l(t){function n(){return c}function r(e){return e(t)}var u=e(t),c={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:i,isNone:o,getOr:u,getOrThunk:u,getOrDie:u,getOrNull:u,getOrUndefined:u,or:n,orThunk:n,map:function(e){return l(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?c:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(o,(function(e){return n(t,e)}))}};return c}function f(e){return function(t){return function(e){if(null===e)return"null";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t}(t)===e}}function d(e){return function(t){return t?t.style[e].replace(/px$/,""):""}}function m(e){return function(t,n){t&&(t.style[e]=/^[0-9.]+$/.test(t=n)?t+"px":t)}}function g(e){return U.getAttrib(e,"data-ephox-embed-iri")}function h(e,t){for(var n=e.regex.exec(t),r=e.url,o=0;o<n.length;o++)!function(e){r=r.replace("$"+e,(function(){return n[e]||""}))}(o);return r.replace(/\?$/,"")}function p(e,t,n){return new W((function(r,o){function i(n){return n.html&&(ae[e.source1]=n),r({url:e.source1,html:n.html||t(e)})}ae[e.source1]?i(ae[e.source1]):n({url:e.source1},i,o)}))}function v(e){return function(t){return ie(e,t)}}function b(e){var t=M(e,{source1:e.source1.value,source2:z(e,"source2").bind((function(e){return z(e,"value")})).getOr(""),poster:z(e,"poster").bind((function(e){return z(e,"value")})).getOr("")});return z(e,"dimensions").each((function(e){_(["width","height"],(function(n){z(e,n).each((function(e){return t[n]=e}))}))})),t}function y(e,t){return function(n){var o,i;O(n.url)&&0<n.url.trim().length&&(o=n.html,i=le(t,o),i=r(r({},i),{source1:n.url,embed:o}),e.setData(ce(i)))}}function w(e,t){var n=t.name,r=new pe("img",1);return r.shortEnded=!0,C(e,t,r),r.attr({width:t.attr("width")||"300",height:t.attr("height")||("audio"===n?"30":"150"),style:t.attr("style"),src:ve.transparentSrc,"data-mce-object":n,class:"mce-object mce-object-"+n}),r}function x(e,t){var n=t.name,r=new pe("span",1);return r.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":n,class:"mce-preview-object mce-object-"+n}),C(e,t,r),(e=new pe(n,1)).attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),class:t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"}),(n=new pe("span",1)).attr("class","mce-shim"),r.append(e),r.append(n),r}function C(e,t,n){for(var r,o,i=t.attributes,a=i.length;a--;)r=i[a].name,o=i[a].value,"width"!==r&&"height"!==r&&"style"!==r&&("data"!==r&&"src"!==r||(o=e.convertURL(o,r)),n.attr("data-mce-p-"+r,o));(t=t.firstChild&&t.firstChild.value)&&(n.attr("data-mce-html",escape(be.sanitize(e,t))),n.firstChild=null)}function S(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||ye(e))return 1}var k,T=t,E=function(e){return null==e?a:l(e)},O=f("string"),N=f("array"),A=f("function"),D=(Array.prototype.slice,Array.prototype.push),_=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)},R=(A(Array.from)&&Array.from,function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return R(n)}}}),B=Object.prototype.hasOwnProperty,M=(k=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o,i=e[r];for(o in i)B.call(i,o)&&(n[o]=k(n[o],i[o]))}return n}),P=Object.hasOwnProperty,z=function(e,t){return P.call(e,t)?E(e[t]):T()},I={getScripts:function(e){return e.getParam("media_scripts")},getAudioTemplateCallback:function(e){return e.getParam("audio_template_callback")},getVideoTemplateCallback:function(e){return e.getParam("video_template_callback")},hasLiveEmbeds:function(e){return e.getParam("media_live_embeds",!0)},shouldFilterHtml:function(e){return e.getParam("media_filter_html",!0)},getUrlResolver:function(e){return e.getParam("media_url_resolver")},hasAltSource:function(e){return e.getParam("media_alt_source",!0)},hasPoster:function(e){return e.getParam("media_poster",!0)},hasDimensions:function(e){return e.getParam("media_dimensions",!0)}},L=tinymce.util.Tools.resolve("tinymce.util.Tools"),F=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),H=(A=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),{getMaxWidth:d("maxWidth"),getMaxHeight:d("maxHeight"),setMaxWidth:m("maxWidth"),setMaxHeight:m("maxHeight")}),V=function(e,t){if(e)for(var n=0;n<e.length;n++)if(-1!==t.indexOf(e[n].filter))return e[n]},U=A.DOM,j=function(e,t){var n,r,o;return function(e){return e=U.createFragment(e),""!==g(e.firstChild)}(t)?(r=t,r=U.createFragment(r).firstChild,{type:"ephox-embed-iri",source1:g(r),source2:"",poster:"",width:H.getMaxWidth(r),height:H.getMaxHeight(r)}):(n=e,r=t,F({validate:!(o={}),allow_conditional_comments:!0,start:function(e,t){if(o.source1||"param"!==e||(o.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(o.type||(o.type=e),o=L.extend(t.map,o)),"script"===e){var r=V(n,t.map.src);if(!r)return;o={type:"script",source1:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(o.source1?o.source2||(o.source2=t.map.src):o.source1=t.map.src),"img"!==e||o.poster||(o.poster=t.map.src)}}).parse(r),o.source1=o.source1||o.src||o.data,o.source2=o.source2||"",o.poster=o.poster||"",o)},W=tinymce.util.Tools.resolve("tinymce.util.Promise"),q={guess:function(e){return e={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()],e||""}},$=tinymce.util.Tools.resolve("tinymce.html.Writer"),G=tinymce.util.Tools.resolve("tinymce.html.Schema"),X=A.DOM,Y=function(e,t){var n,r,o,i;for(n in t)if(o=""+t[n],e.map[n])for(r=e.length;r--;)(i=e[r]).name===n&&(o?(e.map[n]=o,i.value=o):(delete e.map[n],e.splice(r,1)));else o&&(e.push({name:n,value:o}),e.map[n]=o)},K=function(e){var t=$();return F(t).parse(e),t.getContent()},J={updateHtml:function(e,t,n){var r,o,i,a,u,c,s;return function(e){return e=X.createFragment(e),""!==X.getAttrib(e.firstChild,"data-ephox-embed-iri")}(e)?(r=e,o=t,r=X.createFragment(r).firstChild,H.setMaxWidth(r,o.width),H.setMaxHeight(r,o.height),K(r.outerHTML)):(o=e,i=t,a=n,c=$(),F({validate:!1,allow_conditional_comments:!(s=0),comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,n){switch(e){case"video":case"object":case"embed":case"img":case"iframe":void 0!==i.height&&void 0!==i.width&&Y(t,{width:i.width,height:i.height})}if(a)switch(e){case"video":Y(t,{poster:i.poster,src:""}),i.source2&&Y(t,{src:""});break;case"iframe":Y(t,{src:i.source1});break;case"source":if(++s<=2&&(Y(t,{src:i["source"+s],type:i["source"+s+"mime"]}),!i["source"+s]))return;break;case"img":if(!i.poster)return;u=!0}c.start(e,t,n)},end:function(e){if("video"===e&&a)for(var t,n=1;n<=2;n++)i["source"+n]&&((t=[]).map={},s<n&&(Y(t,{src:i["source"+n],type:i["source"+n+"mime"]}),c.start("source",t,!0)));var r;i.poster&&"object"===e&&a&&!u&&((r=[]).map={},Y(r,{src:i.poster,width:i.width,height:i.height}),c.start("img",r,!0)),c.end(e)}},G({})).parse(o),c.getContent())}},Z=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"
|