/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.1.1 (2019-10-28) */ !function(H){"use strict";function Z(){}function i(e,o){return function(){for(var n=[],t=0;t "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return ce.objOf(w(o,function(n){return n.fold(function(n,t,e,o){return se.field(n,e,o)},function(n,t){return se.state(n)})}))}}},de=nn(Yn(Zt)),me=i(Kn,le),ge=fe.state,pe=fe.field,he=Yn(Zt),ve=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},be=function(n){return"Errors: \n"+function(n){var t=10 ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+jn(n.input)},ye=nn(he),xe=ut(mn,"number"),we=ut(cn,"string"),Se=ut(ln,"boolean"),Ce=ut(dn,"function"),ke=function(t){function n(n,t){for(var e=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0}if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every(function(n){return ke(t[n])});case"Map":return n(t.keys(),ke)&&n(t.values(),ke);case"Set":return n(t.keys(),ke);default:return!1}},Oe=Yn(function(n){return ke(n)?Zt(n):te("Expected value to be acceptable for sending via postMessage")}),Te=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return Te(t())}}},Ee=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:nn(n)}},Be={fromHtml:function(n,t){var e=(t||H.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1 "):o[0].name();return q(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});return J(t,{})},eu=function(n,t){return ui(n)?n.style.getPropertyValue(t):""},ou=function(n){var t=ot("external.component",qn([ct("element"),ht("uid")]),n),e=Te(Hr());t.uid.each(function(n){Xi(t.element,n)});var o={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Hr(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return zr(o)},ru=Nr,iu=function(t){return function(n){return Nn(n,$i)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:P({uid:ru("")},t);return Ci(n).getOrDie()},function(n){return n})},uu=zr;function au(o,r){function n(n){var t=r(n);if(t<=0||null===t){var e=li(n,o);return parseFloat(e)||0}return t}function i(r,n){return k(n,function(n,t){var e=li(r,t),o=e===undefined?0:parseInt(e,10);return isNaN(o)?n:n+o},0)}return{set:function(n,t){if(!mn(t)&&!t.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+t);var e=n.dom();ui(e)&&(e.style[o]=t+"px")},get:n,getOuter:n,aggregate:i,max:function(n,t,e){var o=i(n,e);return o=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}var Ha=Te({}),Pa=["alloy/data/Fields","alloy/debugging/Debugging"],za=nn({logEventCut:Z,logEventStopped:Z,logNoParent:Z,logEventNoHandlers:Z,logEventResponse:Z,write:Z}),La=nn([ct("menu"),ct("selectedMenu")]),ja=nn([ct("item"),ct("selectedItem")]),Ua=(nn(le(ja().concat(La()))),nn(le(ja()))),Wa=mt("initSize",[ct("numColumns"),ct("numRows")]),Ga=nn(Wa),Xa=fr("x","y","bubble","direction","label"),Ya=En([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),qa=Ya.southeast,Ka=Ya.southwest,Ja=Ya.northeast,$a=Ya.northwest,Qa=Ya.south,Za=Ya.north,nc=Ya.east,tc=Ya.west,ec=function(n,t,e){return Xa(na(n,t),ea(n,t),e.north(),Za(),"layout-n")},oc=function(n,t,e){return Xa(na(n,t),oa(n),e.south(),Qa(),"layout-s")},rc=function(e,n,o,r,t,i,u){function a(n){return $(n,o)?n[o]():on.none()}var c=L(t,function(n,t){return pa(o,n,t)}),s=L(i,function(n,t){return Pr(n,t)}),f=P(P(P({},s),c),{revoke:d(ha,o),config:function(n){var t=ot(o+"-config",e,n);return{key:o,value:{config:t,me:f,configAsRaw:N(function(){return ot(o+"-config",e,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,e){return a(n).bind(function(t){return Nn(r,"exhibit").map(function(n){return n(e,t.config,t.state)})}).getOr(Ur({}))},name:function(){return o},handlers:function(n){return a(n).map(function(n){return Y("events",function(n,t){return{}})(r)(n.config,n.state)}).getOr({})}});return f},ic=qn([ct("fields"),ct("name"),St("active",{}),St("apis",{}),St("state",Qi),St("extra",{})]),uc=qn([ct("branchKey"),ct("branches"),ct("name"),St("active",{}),St("apis",{}),St("state",Qi),St("extra",{})]),ac=nn(undefined),cc=/* */Object.freeze({events:function(t){return nr([or(Co(),function(r,i){var u=t.channels,n=function(n,t){return t.universal()?n:S(n,function(n){return vn(t.channels(),n)})}(wn(u),i);bn(n,function(n){var t=u[n],e=t.schema,o=ot("channel["+n+"] data\nReceiver: "+Rr(r.element()),e,i.data());t.onReceive(r,o)})})])}}),sc=[st("channels",nt(an.value,qn([Ku("onReceive"),St("schema",ye())])))],fc=ba({fields:sc,name:"receiving",active:cc}),lc=/* */Object.freeze({exhibit:function(n,t){return Ur({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),dc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],mc=mr(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),gc=fr("position","left","top","right","bottom"),pc=En([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),hc=function(n,t,e){var o=Fu(t,e);return n.fold(nn(o),nn(o),function(){var n=gu();return o.translate(-n.left(),-n.top())})},vc=pc.relative,bc=pc.fixed,yc=function(n){return"rtl"===li(n,"direction")?"rtl":"ltr"},xc=[ct("hotspot"),ht("bubble"),St("overrides",{}),Aa(),$u("placement",function(n,t,e){var o=t.hotspot,r=Ea(e,o.element()),i=_a(n.element(),t,la(),da());return on.some(Ba({anchorBox:r,bubble:t.bubble.getOr(Oa()),overrides:t.overrides,layouts:i,placer:on.none()}))})],wc=[ct("x"),ct("y"),St("height",0),St("width",0),St("bubble",Oa()),St("overrides",{}),Aa(),$u("placement",function(n,t,e){var o=hc(e,t.x,t.y),r=bu(o.left(),o.top(),t.width,t.height),i=_a(n.element(),t,[ia,ua,aa,ca,oc,ec,sa,fa],[ua,ia,ca,aa,oc,ec,sa,fa]);return on.some(Ba({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:on.none()}))})],Sc={create:fr("start","soffset","finish","foffset")},Cc=En([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),kc=(Cc.before,Cc.on,Cc.after,function(n){return n.fold(l,l,l)}),Oc=En([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Tc={domRange:Oc.domRange,relative:Oc.relative,exact:Oc.exact,exactFromRange:function(n){return Oc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var t=function(n){return n.match({domRange:function(n){return Be.fromDom(n.startContainer)},relative:function(n,t){return kc(n)},exact:function(n,t,e,o){return n}})}(n);return pr(t)},range:Sc.create},Ec=En([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function Bc(n){return of.get(n)}function Dc(n){return of.getOption(n)}function Ac(e,o,n,t,r){function i(n){var t=e.dom().createRange();return t.setStart(o.dom(),n),t.collapse(!0),t}var u=Bc(o).length,a=function(n,t,e,o,r){if(0===r)return 0;if(t===o)return r-1;for(var i=o,u=1;u"}),ye()),dl=At("schema",function(){return[ht("preprocess")]}),ml=St("defaults",nn({})),gl=St("overrides",nn({})),pl=le([cl,sl,fl,ll,ml,gl]),hl=le([cl,sl,fl,ml,gl]),vl=le([cl,sl,fl,ll,ml,gl]),bl=le([cl,dl,fl,ct("unit"),ll,ml,gl]),yl=Ps(al.required,pl),xl=Ps(al.external,hl),wl=Ps(al.optional,vl),Sl=Ps(al.group,bl),Cl=nn("entirety"),kl=/* */Object.freeze({required:yl,external:xl,optional:wl,group:Sl,asNamedPart:Ns,name:Hs,asCommon:function(n){return n.fold(l,l,l,l)},original:Cl}),Ol=function(n,t){return{uiType:ul(),owner:n,name:t}},Tl=/* */Object.freeze({generate:Ls,generateOne:js,schemas:Us,names:Ws,substitutes:Gs,components:Xs,defaultUids:Zs,defaultUidsSchema:nf,getAllParts:Js,getAllPartNames:$s,getPart:Ys,getPartOrDie:qs,getParts:Ks,getPartsOrDie:Qs}),El=function(n){return n.hasOwnProperty("uid")?n:P(P({},n),{uid:Nr("uid")})};function Bl(n){var t=ot("Sketcher for "+n.name,ql,n),e=L(t.apis,Lr),o=L(t.extraApis,function(n,t){return Pr(n,t)});return P(P({name:nn(t.name),partFields:nn([]),configFields:nn(t.configFields),sketch:function(n){return function(n,t,e,o){var r=El(o);return e(tf(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}function Dl(n){var t=ot("Sketcher for "+n.name,Kl,n),e=Ls(t.name,t.partFields),o=L(t.apis,Lr),r=L(t.extraApis,function(n,t){return Pr(n,t)});return P(P({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){return ef(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function Al(n){return"input"===qo(n)&&"radio"!==Ar(n,"type")||"textarea"===qo(n)}function _l(e,o,n,r){var t=Pc(e.element(),"."+o.highlightClass);bn(t,function(t){y(r,function(n){return n.element()===t})||(ei(t,o.highlightClass),e.getSystem().getByDom(t).each(function(n){o.onDehighlight(e,n),Xt(n,Go())}))})}function Ml(n,t,e,o){_l(n,t,0,[o]),Zl(n,t,e,o)||(ni(o.element(),t.highlightClass),t.onHighlight(n,o),Xt(o,Wo()))}function Fl(e,t,n,o){var r=Pc(e.element(),"."+t.itemClass);return T(r,function(n){return oi(n,t.highlightClass)}).bind(function(n){var t=rs(n,o,0,r.length-1);return e.getSystem().getByDom(r[t]).toOption()})}function Il(n,t,e){var o=D(n.slice(0,t)),r=D(n.slice(t+1));return O(o.concat(r),e)}function Rl(n,t,e){var o=D(n.slice(0,t));return O(o,e)}function Vl(n,t,e){var o=n.slice(0,t),r=n.slice(t+1);return O(r.concat(o),e)}function Nl(n,t,e){var o=n.slice(t+1);return O(o,e)}function Hl(e){return function(n){var t=n.raw();return vn(e,t.which)}}function Pl(n){return function(t){return B(n,function(n){return n(t)})}}function zl(n){return!0===n.raw().shiftKey}function Ll(n){return!0===n.raw().ctrlKey}function jl(n,t){return{matches:n,classification:t}}function Ul(n,t,e){t.exists(function(t){return e.exists(function(n){return jt(n,t)})})||Yt(n,zo(),{prevFocus:t,newFocus:e})}function Wl(){function r(n){return Sa(n.element())}return{get:r,set:function(n,t){var e=r(n);n.getSystem().triggerFocus(t,n.element());var o=r(n);Ul(n,e,o)}}}function Gl(){function r(n){return ud.getHighlighted(n).map(function(n){return n.element()})}return{get:r,set:function(t,n){var e=r(t);t.getSystem().getByDom(n).fold(Z,function(n){ud.highlight(t,n)});var o=r(t);Ul(t,e,o)}}}var Xl,Yl,ql=qn([ct("name"),ct("factory"),ct("configFields"),St("apis",{}),St("extraApis",{})]),Kl=qn([ct("name"),ct("factory"),ct("configFields"),ct("partFields"),St("apis",{}),St("extraApis",{})]),Jl=/* */Object.freeze({getCurrent:function(n,t,e){return t.find(n)}}),$l=[ct("find")],Ql=ba({fields:$l,name:"composing",apis:Jl}),Zl=function(n,t,e,o){return oi(o.element(),t.highlightClass)},nd=function(n,t,e,o){var r=Pc(n.element(),"."+t.itemClass);return on.from(r[o]).fold(function(){return an.error("No element found with index "+o)},n.getSystem().getByDom)},td=function(t,n,e){return Cu(t.element(),"."+n.itemClass).bind(function(n){return t.getSystem().getByDom(n).toOption()})},ed=function(t,n,e){var o=Pc(t.element(),"."+n.itemClass);return(0',t.getDoc());return Ni(n,Be.fromDom(e.extractContents())),e.insertNode(n.dom()),hr(n).each(function(n){return n.dom().normalize()}),Fc(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===qo(n)?1:Dc(n).fold(function(){return br(n).length},function(n){return n.length})}(n))}),n})}function $g(n,t){return n.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function Qg(n,u,a,c){return void 0===c&&(c=0),function(n){return n.collapsed&&3===n.startContainer.nodeType}(u)?Kg(n,u.startContainer,u.startOffset,function(e,o,r,n){var i=n.getOr(r.length);return function(n,t,e,o){var r;for(r=t-1;0<=r;r--){var i=n.charAt(r);if(Fp.test(i))return on.none();if(i===e)break}return-1===r||t-ro}).getOr(r.length);return on.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return on.none()}function rp(n,t){return va([qd(n,t)])}function ip(n,t,e){n.getSystem().broadcastOn([$p],{})}function up(n){var t=Be.fromHtml(n),e=br(t),o=function(n){var t=n.dom().attributes!==undefined?n.dom().attributes:[];return k(t,function(n,t){var e;return"class"===t.name?n:P(P({},n),((e={})[t.name]=t.value,e))},{})}(t),r=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(t),i=0===e.length?{}:{innerHtml:Tr(t)};return P({tag:qo(t),classes:r,attributes:o},i)}function ap(n){return Nn(uh,n).getOr(oh)}function cp(n){return{dom:{tag:"div",classes:[ch],innerHtml:n}}}function sp(n){return{dom:{tag:"div",classes:[sh]},components:[ki(eh.translate(n))]}}function fp(n,t){return{dom:{tag:"div",classes:[sh]},components:[{dom:{tag:n.tag,attributes:{style:n.styleAttr}},components:[ki(eh.translate(t))]}]}}function lp(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:mh(n)}}}function dp(n){return{dom:{tag:"div",classes:[ch,"tox-collection__item-checkmark"],innerHtml:vm("checkmark",n)}}}function mp(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(on.some("")).map(cp)}):on.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:eh.translate(n)}}}).getOr({});return{dom:An({tag:"div",classes:[oh,rh].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return on.some(function(n){return{dom:{tag:"div",classes:[sh],innerHtml:n}}}(n))}),n.shortcutContent.map(lp),n.caret]}}function gp(n,t,e,o){void 0===o&&(o=on.none());var r=eh.isRtl()&&n.iconContent.exists(function(n){return vn(ph,n)}),i=n.iconContent.map(function(n){return eh.isRtl()&&vn(gh,n)?n+"-rtl":n}).map(function(n){return function(n,t,e){return on.from(t()[n]).or(e).getOrThunk(function(){return hm(t)})}(n,t.icons,o)}),u=on.from(n.meta).fold(function(){return sp},function(n){return Tn(n,"style")?d(fp,n.style):sp});return"color"===n.presets?function(n,t,e,o){var r,i,u;return{dom:(r=ih,i=e.getOr(""),u=n.map(function(n){return' title="'+o.translate(n)+'"'}).getOr(""),up("custom"===t?'":"remove"===t?'
"+i+"
":'
")),optComponents:[]}}(n.ariaLabel,n.value,i,t):mp(n,i,e,u,r)}function pp(n,t,e){t.disabled&&vh(n,t)}function hp(n,t){return!0===t.useNative&&vn(hh,qo(n.element()))}function vp(n){Dr(n.element(),"disabled","disabled")}function bp(n){Mr(n.element(),"disabled")}function yp(n){Dr(n.element(),"aria-disabled","true")}function xp(n){Dr(n.element(),"aria-disabled","false")}function wp(t,n,e){n.disableClass.each(function(n){ei(t.element(),n)}),(hp(t,n)?bp:xp)(t),n.onEnabled(t)}function Sp(n,t){return hp(n,t)?function(n){return _r(n.element(),"disabled")}(n):function(n){return"true"===Ar(n.element(),"aria-disabled")}(n)}function Cp(n,t){var e=n.getApi(t);return function(n){n(e)}}function kp(e,o){return Fi(function(n){Cp(e,n)(function(n){var t=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}function Op(t,e){return Ii(function(n){return Cp(t,n)(e.get())})}var Tp,Ep,Bp=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Dp=En([{aborted:[]},{edge:["element"]},{success:["info"]}]),Ap=En([{abort:[]},{kontinue:[]},{finish:["info"]}]),_p=function(t,e,n,o,r,i){function u(){return i.fold(Dp.aborted,Dp.edge)}function a(){var n=r();return n?_p(t,n,on.none(),o,r,on.some(e)):u()}if(function(n,t){return n.isBlock(t)||vn(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===n.getContentEditable(t)}(t,e))return u();if(function(n){return n.nodeType===H.Node.TEXT_NODE}(e)){var c=e.textContent;return o(Ap,e,c,n).fold(Dp.aborted,function(){return a()},Dp.success)}return a()},Mp=function(n){return ku(n,"[data-mce-autocompleter]")},Fp=/[\u00a0 \t\r\n]/,Ip=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);function o(n,t){Yt(n,lo(),{raw:t})}n.on("keydown",function(t){function n(){return e.getView().bind(ud.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(qt),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(ud.highlightFirst)},function(n){o(n,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||n().each(function(n){o(n,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())}),n.on("NodeChange",function(n){e.isActive()&&!e.isProcessingAction()&&Mp(Be.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},Rp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Vp=function(n){if(function(n){return n.nodeType===H.Node.TEXT_NODE}(n))return np(n,n.data.length);var t=n.childNodes;return 0=n.minChars&&n.matches.getOrThunk(function(){return function(e){function o(n,t,e,o){var r=o.getOr(e.length);return 0===r?n.kontinue():n.finish(/\s/.test(e.charAt(r-1)))}return function(n){var t=Np(n.startContainer,n.startOffset);return Kg(e,t.element,t.offset,o).fold(nn(!0),nn(!0),l)}}(t.dom)})(e.range,i,e.text)});if(0===u.length)return on.none();var a=Rp.all(w(u,function(t){return t.fetch(e.text,t.maxResults,o).then(function(n){return{matchText:e.text,items:n,columns:t.columns,onAction:t.onAction}})}));return on.some({lookupData:a,context:e})},Pp=le([ft("type"),yt("text")]),zp=le([At("type",function(){return"autocompleteitem"}),At("active",function(){return!1}),At("disabled",function(){return!1}),St("meta",{}),ft("value"),yt("text"),yt("icon")]),Lp=le([ft("type"),ft("ch"),kt("minChars",1),St("columns",1),kt("maxResults",10),xt("matches"),dt("fetch"),dt("onAction")]),jp=[Et("disabled",!1),yt("text"),yt("shortcut"),pe("value","value",In(function(){return Vr("menuitem-value")}),ye()),St("meta",{})],Up=le([ft("type"),Bt("onSetup",function(){return Z}),Bt("onAction",Z),yt("icon")].concat(jp)),Wp=le([ft("type"),dt("getSubmenuItems"),Bt("onSetup",function(){return Z}),yt("icon")].concat(jp)),Gp=le([ft("type"),Et("active",!1),Bt("onSetup",function(){return Z}),dt("onAction")].concat(jp)),Xp=le([ft("type"),Et("active",!1),yt("icon")].concat(jp)),Yp=le([ft("type"),lt("fancytype",["inserttable","colorswatch"]),Bt("onAction",Z)]),qp=function(n){return rp(Vr("unnamed-events"),n)},Kp=[ct("lazySink"),ct("tooltipDom"),St("exclusive",!0),St("tooltipComponents",[]),St("delay",300),Tt("mode","normal",["normal","follow-highlight"]),St("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:nn([oc,ec,ia,aa,ua,ca]),onRtl:nn([oc,ec,ia,aa,ua,ca])}}}),Yu("onHide"),Yu("onShow")],Jp=/* */Object.freeze({init:function(){function e(){o.get().each(function(n){H.clearTimeout(n)})}var o=Te(on.none()),t=Te(on.none()),n=nn("not-implemented");return Zi({getTooltip:function(){return t.get()},isShowing:function(){return t.get().isSome()},setTooltip:function(n){t.set(on.some(n))},clearTooltip:function(){t.set(on.none())},clearTimer:e,resetTimer:function(n,t){e(),o.set(on.some(H.setTimeout(function(){n()},t)))},readState:n})}}),$p=Vr("tooltip.exclusive"),Qp=Vr("tooltip.show"),Zp=Vr("tooltip.hide"),nh=/* */Object.freeze({hideAllExclusive:ip,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&lg.set(n,o)})}}),th=ba({fields:Kp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){function e(t){r.getTooltip().each(function(n){vs(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}return nr(z([[or(Qp,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){ip(t);var n=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:nr("normal"===o.mode?[or(co(),function(n){Xt(t,Qp)}),or(uo(),function(n){Xt(t,Zp)})]:[]),behaviours:va([lg.config({})])});r.setTooltip(e),ps(n,e),o.onShow(t,e),Df.position(n,o.anchor(t),e)}}(n)},o.delay)}),or(Zp,function(n){r.resetTimer(function(){e(n)},o.delay)}),or(Co(),function(n,t){vn(t.channels(),$p)&&e(n)}),Ii(function(n){e(n)})],"normal"===o.mode?[or(so(),function(n){Xt(n,Qp)}),or(wo(),function(n){Xt(n,Zp)}),or(co(),function(n){Xt(n,Qp)}),or(uo(),function(n){Xt(n,Zp)})]:[or(Wo(),function(n,t){Xt(n,Qp)}),or(Go(),function(n){Xt(n,Zp)})]]))}}),state:Jp,apis:nh}),eh=tinymce.util.Tools.resolve("tinymce.util.I18n"),oh="tox-menu-nav__js",rh="tox-collection__item",ih="tox-swatch",uh={normal:oh,color:ih},ah="tox-collection__item--enabled",ch="tox-collection__item-icon",sh="tox-collection__item-label",fh="tox-collection__item-caret",lh="tox-collection__item--active",dh=tinymce.util.Tools.resolve("tinymce.Env"),mh=function(n){var e=dh.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},t=n.split("+"),o=w(t,function(n){var t=n.toLowerCase().trim();return Tn(e,t)?e[t]:n});return dh.mac?o.join(""):o.join("+")},gh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],ph=["list-bull-circle","list-bull-default","list-bull-square"],hh=["input","button","textarea","select"],vh=function(t,n,e){n.disableClass.each(function(n){ni(t.element(),n)}),(hp(t,n)?vp:yp)(t),n.onDisabled(t)},bh=/* */Object.freeze({enable:wp,disable:vh,isDisabled:Sp,onLoad:pp,set:function(n,t,e,o){(o?vh:wp)(n,t,e)}}),yh=/* */Object.freeze({exhibit:function(n,t,e){return Ur({classes:t.disabled?t.disableClass.map(_).getOr([]):[]})},events:function(e,n){return nr([tr(ko(),function(n,t){return Sp(n,e)}),ma(e,n,pp)])}}),xh=[St("disabled",!1),St("useNative",!0),ht("disableClass"),Yu("onDisabled"),Yu("onEnabled")],wh=ba({fields:xh,name:"disabling",active:yh,apis:bh}),Sh=function(n){return wh.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Ch=function(n){return wh.config({disabled:n})},kh=function(n){return wh.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Oh=function(n){return wh.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(Ep=Tp=Tp||{})[Ep.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Ep[Ep.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";function Th(n){return E(n,function(n){return n.toArray()})}function Eh(n,t,e){var o=Te(Z);return{type:"item",dom:t.dom,components:Th(t.optComponents),data:n.data,eventOrder:Mh,hasSubmenu:n.triggersSubmenu,itemBehaviours:va([qd("item-events",[function(e,o){return Vi(function(n,t){Cp(e,n)(e.onAction),e.triggersSubmenu||o!==_h.CLOSE_ON_EXECUTE||(Xt(n,Do()),t.stop())})}(n,e),kp(n,o),Op(n,o)]),Sh(n.disabled),lg.config({})].concat(n.itemBehaviours))}}function Bh(n){return{value:n.value,meta:An({text:n.text.getOr("")},n.meta)}}function Dh(n,t){var e=function(n){return Fh.DOM.encode(n)}(eh.translate(n));if(0'+n+""})}return e}function Ah(t,e,n){function o(n){return Yt(n,Vh,{row:t,col:e})}var r;return iu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:va([qd("insert-table-picker-cell",[or(co(),pg.focus),or(ko(),o),or(Eo(),o)]),wg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),pg.config({onFocus:function(n){return Yt(n,Rh,{row:t,col:e})}})])})}var _h=Tp,Mh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Fh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Ih=nn(Ls("item-widget",Bg())),Rh=Vr("cell-over"),Vh=Vr("cell-execute");function Nh(n){return{value:nn(n)}}function Hh(n){return qh.test(n)||Kh.test(n)}function Ph(n){var t=function(n){var t=n.value().replace(qh,function(n,t,e,o){return t+t+e+e+o+o});return{value:nn(t)}}(n),e=Kh.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e}function zh(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function Lh(n){var t=zh(n.red())+zh(n.green())+zh(n.blue());return Nh(t)}function jh(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}function Uh(n){var t=parseInt(n,10);return t.toString()===n&&0<=t&&t<=255}function Wh(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=$h(0,Jh(i,1)),u=$h(0,Jh(u,1)),0===i)return t=e=o=Qh(255*u),jh(t,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:t=c,e=s,o=0;break;case 1:t=s,e=c,o=0;break;case 2:t=0,e=c,o=s;break;case 3:t=0,e=s,o=c;break;case 4:t=s,e=0,o=c;break;case 5:t=c,e=0,o=s;break;default:t=e=o=0}return t=Qh(255*(t+f)),e=Qh(255*(e+f)),o=Qh(255*(o+f)),jh(t,e,o,1)}function Gh(n){var t=Ph(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return jh(e,o,r,1)}function Xh(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return jh(r,i,u,a)}function Yh(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}var qh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Kh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Jh=Math.min,$h=Math.max,Qh=Math.round,Zh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,nv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,tv=nn(jh(255,0,0,1)),ev=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),ov="tinymce-custom-colors";function rv(n){var t=[],u=H.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(n,t){var e=t/255;return("0"+Math.round(n*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=n,a.fillRect(0,0,1,1);var t=a.getImageData(0,0,1,1).data,e=t[0],o=t[1],r=t[2],i=t[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;ot&&r.pop(),ev.setItem(ov,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Av=function(n,t){return n.getParam("color_cols",t,"number")},_v=function(n){return!1!==n.getParam("custom_colors")},Mv=function(n){var t=iv(n);return t!==undefined?rv(t):Bv},Fv=function(){return w(Dv.state(),function(n){return{type:Ev,text:n,value:n}})},Iv=function(n){Dv.add(n)},Rv=function(n){return n.fire("SkinLoaded")},Vv=function(n){return n.fire("ResizeEditor")},Nv=function(n,t){return n.fire("ScrollContent",t)},Hv=function(n,t){return n.fire("ResizeContent",t)},Pv=function(n,t){return n.fire("TextColorChange",t)},zv=function(i){return function(n,t){var e,o={colorpicker:t},r=(e=n,function(n){var t=n.getData();e(on.from(t.colorpicker)),n.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(n,t){"hex-valid"===t.name&&(t.value?n.enable("ok"):n.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){n(on.none())}})}},Lv={register:function(n){!function(e){e.addCommand("mceApplyTextcolor",function(n,t){!function(n,t,e){n.undoManager.transact(function(){n.focus(),n.formatter.apply(t,{value:e}),n.nodeChanged()})}(e,n,t)}),e.addCommand("mceRemoveTextcolor",function(n){!function(n,t){n.undoManager.transact(function(){n.focus(),n.formatter.remove(t,{value:null},null,!0),n.nodeChanged()})}(e,n)})}(n);var t=Te(null),e=Te(null);mv(n,"forecolor","forecolor","Text color",t),mv(n,"backcolor","hilitecolor","Background color",e),gv(n,"forecolor","forecolor","Text color"),gv(n,"backcolor","hilitecolor","Background color")},getColors:fv,getFetch:lv,colorPickerDialog:zv,getCurrentColor:uv,getColorCols:cv,calcCols:av},jv=[Ig.parts().items({})],Uv=function(n,e,o,r,i,u,a){return Eu(w(n,function(t){return"choiceitem"===t.type?function(n){return tt("choicemenuitem",Xp,n)}(t).fold(Sv,function(n){return on.some(function(t,n,e,o,r,i,u){var a=gp({presets:e,textContent:n?t.text:on.none(),htmlContent:on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:on.none(),checkMark:n?on.some(dp(u.icons)):on.none(),caret:on.none(),value:t.value},u,!0);return Dn(Eh({data:Bh(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){wg.set(t,n)},isActive:function(){return wg.isOn(t)},isDisabled:function(){return wh.isDisabled(t)},setDisabled:function(n){return wh.set(t,n)}}},onAction:function(n){return o(t.value)},onSetup:function(n){return n.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:ah,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):on.none()}))};var Wv,Gv,Xv={inserttable:function WF(o){var n=Vr("size-label"),i=function(n,t,e){for(var o=[],r=0;r"}function aw(n){return function(n){return xS[n]}(n)}function cw(n,t,e){return Qf.config(Dn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}function sw(n,t,e){return cw(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})}function fw(e,t){function o(n,t){t.stop()}function r(n){return function(t,e){bn(n,function(n){n(t,e)})}}function i(n,t){if(!wh.isDisabled(n)){var e=t.event().raw();a(n,e.dataTransfer.files)}}function u(n,t){var e=t.event().raw().target.files;a(n,e)}var a=function(n,t){Qf.setValue(n,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return S(xn(n),function(n){return t.test(n.name)})}(t)),Yt(n,Qb,{name:e.name})},c=pm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:va([qd("input-file-events",[cr(Eo())])])}),n=e.label.map(function(n){return wy(n,t)}),s=sy.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:va([TS([]),vS(),wh.config({}),wg.config({toggleClass:"dragenter",toggleOnExecute:!1}),qd("dropzone-events",[or("dragenter",r([o,wg.toggle])),or("dragleave",r([o,wg.toggle])),or("dragover",o),or("drop",r([o,i])),or(po(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Ug.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(n){c.get(n).element().dom().click()},buttonBehaviours:va([Ny.config({})])})]}]}}}});return xy(n,s,["tox-form__group--stretched"],[])}function lw(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:va([pg.config({ignore:!0}),Ny.config({})])}}function dw(n,t){Yt(n,lo(),{raw:{which:9,shiftKey:t}})}function mw(n,t){var e=MS&&n.sandboxed,o=P(P({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){var r=Te("");return{getValue:function(n){return r.get()},setValue:function(n,t){if(o)Dr(n.element(),"srcdoc",t);else{Dr(n.element(),"src","javascript:''");var e=n.element().dom().contentWindow.document;e.open(),e.write(t),e.close()}r.set(t)}}}(e),i=n.label.map(function(n){return wy(n,t)}),u=sy.parts().field({factory:{sketch:function(n){return _S({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:va([Ny.config({}),pg.config({}),kS(on.none(),r.getValue,r.setValue)])})}}});return xy(i,u,["tox-form__group--stretched"],[])}var gw=function(t,n){return t.getSystem().getByUid(n.uid+"-"+Uy()).map(function(n){return function(){return an.value(n)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return an.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},pw=nn([ct("dom"),ct("fetch"),Yu("onOpen"),qu("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),Ms("dropdownBehaviours",[wg,jy,sg,pg]),ct("toggleClass"),St("eventOrder",{}),ht("lazySink"),St("matchWidth",!1),St("useMinWidth",!1),ht("role")].concat(Zy())),hw=nn([xl({schema:[Wu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Wy()]),vw=Dl({name:"Dropdown",configFields:pw(),partFields:hw(),factory:function(t,n,e,o){function r(n){Pf.getState(n).each(function(n){Pg.highlightPrimary(n)})}function i(n,t){return qt(n),on.some(!0)}var u,a,c={expand:function(n){wg.isOn(n)||qy(t,function(n){return n},n,o,Z,Sy.HighlightNone).get(Z)},open:function(n){wg.isOn(n)||qy(t,function(n){return n},n,o,Z,Sy.HighlightFirst).get(Z)},isOpen:wg.isOn,close:function(n){wg.isOn(n)&&qy(t,function(n){return n},n,o,Z,Sy.HighlightFirst).get(Z)},repositionMenus:function(n){wg.isOn(n)&&Qy(n)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Is(t.dropdownBehaviours,[wg.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),jy.config({others:{sandbox:function(n){return $y(t,n,{onOpen:function(){wg.on(n)},onClose:function(){wg.off(n)}})}}}),sg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(vw.isOpen(n)){var e=jy.getCoupled(n,"sandbox");r(e)}else vw.open(n);return on.some(!0)},onEscape:function(n,t){return vw.isOpen(n)?(vw.close(n),on.some(!0)):on.none()}}),pg.config({})]),events:gm(on.some(function(n){qy(t,function(n){return n},n,o,r,Sy.HighlightFirst).get(Z)})),eventOrder:P(P({},t.eventOrder),(u={},u[ko()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:P(P({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(n){return{role:n}})),"button"===t.dom.tag?{type:(a="type",Nn(t.dom,"attributes").bind(function(n){return Nn(n,a)})).getOr("button")}:{})}}},apis:{open:function(n,t){return n.open(t)},expand:function(n,t){return n.expand(t)},close:function(n,t){return n.close(t)},isOpen:function(n,t){return n.isOpen(t)},repositionMenus:function(n,t){return n.repositionMenus(t)}}}),bw=ba({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return nr([tr(bo(),nn(!0))])},exhibit:function(n,t){return Ur({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),yw=Vr("color-input-change"),xw=Vr("color-swatch-change"),ww=Vr("color-picker-cancel"),Sw=nn(Vr("rgb-hex-update")),Cw=nn(Vr("slider-update")),kw=nn(Vr("palette-update")),Ow=Ht().deviceType.isTouch(),Tw=wl({schema:[ct("dom")],name:"label"}),Ew=ex("top-left"),Bw=ex("top"),Dw=ex("top-right"),Aw=ex("right"),_w=ex("bottom-right"),Mw=ex("bottom"),Fw=ex("bottom-left"),Iw=[Tw,ex("left"),Aw,Bw,Mw,Ew,Dw,Fw,_w,yl({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:nr([ur(to(),n,"spectrum"),ur(eo(),n,"spectrum"),ur(oo(),n,"spectrum"),ur(ro(),n,"spectrum"),ur(io(),n,"spectrum"),ur(ao(),n,"spectrum")])}}}),yl({schema:[At("mouseIsDown",function(){return Te(!1)})],name:"spectrum",overrides:function(e){function o(t,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(t,e,n)})}var r=e.model.manager,n=nr([or(to(),o),or(eo(),o)]),t=nr([or(ro(),o),or(io(),function(n,t){e.mouseIsDown.get()&&o(n,t)})]);return{behaviours:va(Ow?[]:[sg.config({mode:"special",onLeft:function(n){return r.onLeft(n,e)},onRight:function(n){return r.onRight(n,e)},onUp:function(n){return r.onUp(n,e)},onDown:function(n){return r.onDown(n,e)}}),pg.config({})]),events:Ow?n:t}}})],Rw=Ht().deviceType.isTouch(),Vw=nn("slider.change.value"),Nw="left",Hw=Jx(-1),Pw=Jx(1),zw=on.none,Lw=on.none,jw={"top-left":on.none(),top:on.none(),"top-right":on.none(),right:on.some(function(n,t){Ax(n,Ex(fx(t)))}),"bottom-right":on.none(),bottom:on.none(),"bottom-left":on.none(),left:on.some(function(n,t){Ax(n,Ex(ux(t)))})},Uw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=Kx(n,t,e),r=qx(o);return Yx(n,r),o},setToMin:function(n,t){var e=rx(t);Yx(n,qx(e))},setToMax:function(n,t){var e=cx(t);Yx(n,qx(e))},findValueOfOffset:Kx,getValueFromEvent:function(n){return ox(n).map(function(n){return n.left()})},findPositionOfValue:$x,setPositionFromValue:function(n,t,e,o){var r=Tx(e),i=$x(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=du(t.element())/2;si(t.element(),"left",i-u+"px")},onLeft:Hw,onRight:Pw,onUp:zw,onDown:Lw,edgeActions:jw}),Ww=on.none,Gw=on.none,Xw=tw(-1),Yw=tw(1),qw={"top-left":on.none(),top:on.some(function(n,t){Ax(n,Bx(ax(t)))}),"top-right":on.none(),right:on.none(),"bottom-right":on.none(),bottom:on.some(function(n,t){Ax(n,Bx(lx(t)))}),"bottom-left":on.none(),left:on.none()},Kw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=nw(n,t,e),r=Zx(o);return Qx(n,r),o},setToMin:function(n,t){var e=ix(t);Qx(n,Zx(e))},setToMax:function(n,t){var e=sx(t);Qx(n,Zx(e))},findValueOfOffset:nw,getValueFromEvent:function(n){return ox(n).map(function(n){return n.top()})},findPositionOfValue:ew,setPositionFromValue:function(n,t,e,o){var r=Tx(e),i=ew(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=cu(t.element())/2;si(t.element(),"top",i-u+"px")},onLeft:Ww,onRight:Gw,onUp:Xw,onDown:Yw,edgeActions:qw}),Jw=iw(-1,!1),$w=iw(1,!1),Qw=iw(-1,!0),Zw=iw(1,!0),nS={"top-left":on.some(function(n,t){Ax(n,Dx(ux(t),ax(t)))}),top:on.some(function(n,t){Ax(n,Dx(px(t),ax(t)))}),"top-right":on.some(function(n,t){Ax(n,Dx(fx(t),ax(t)))}),right:on.some(function(n,t){Ax(n,Dx(fx(t),hx(t)))}),"bottom-right":on.some(function(n,t){Ax(n,Dx(fx(t),lx(t)))}),bottom:on.some(function(n,t){Ax(n,Dx(px(t),lx(t)))}),"bottom-left":on.some(function(n,t){Ax(n,Dx(ux(t),lx(t)))}),left:on.some(function(n,t){Ax(n,Dx(ux(t),hx(t)))})},tS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=Kx(n,t,e.left()),r=nw(n,t,e.top()),i=rw(o,r);return ow(n,i),i},setToMin:function(n,t){var e=rx(t),o=ix(t);ow(n,rw(e,o))},setToMax:function(n,t){var e=cx(t),o=sx(t);ow(n,rw(e,o))},getValueFromEvent:function(n){return ox(n)},setPositionFromValue:function(n,t,e,o){var r=Tx(e),i=$x(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=ew(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=du(t.element())/2,c=cu(t.element())/2;si(t.element(),"left",i-a+"px"),si(t.element(),"top",u-c+"px")},onLeft:Jw,onRight:$w,onUp:Qw,onDown:Zw,edgeActions:nS}),eS=Ht().deviceType.isTouch(),oS=[St("stepSize",1),St("onChange",Z),St("onChoose",Z),St("onInit",Z),St("onDragStart",Z),St("onDragEnd",Z),St("snapToGrid",!1),St("rounded",!0),ht("snapStart"),st("model",it("mode",{x:[St("minX",0),St("maxX",100),At("value",function(n){return Te(n.mode.minX)}),ct("getInitialValue"),$u("manager",Uw)],y:[St("minY",0),St("maxY",100),At("value",function(n){return Te(n.mode.minY)}),ct("getInitialValue"),$u("manager",Kw)],xy:[St("minX",0),St("maxX",100),St("minY",0),St("maxY",100),At("value",function(n){return Te({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),ct("getInitialValue"),$u("manager",tS)]})),Ms("sliderBehaviours",[sg,Qf])].concat(eS?[]:[At("mouseIsDown",function(){return Te(!1)})]),rS=Ht().deviceType.isTouch(),iS=Dl({name:"Slider",configFields:oS,partFields:Iw,factory:function(i,n,t,e){function u(n){return qs(n,i,"thumb")}function a(n){return qs(n,i,"spectrum")}function o(n){return Ys(n,i,"left-edge")}function r(n){return Ys(n,i,"right-edge")}function c(n){return Ys(n,i,"top-edge")}function s(n){return Ys(n,i,"bottom-edge")}function f(n,t){m.setPositionFromValue(n,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function l(n,t){d.value.set(t);var e=u(n);return f(n,e),i.onChange(n,e,t),on.some(!0)}var d=i.model,m=d.manager,g=[or(to(),function(n,t){i.onDragStart(n,u(n))}),or(oo(),function(n,t){i.onDragEnd(n,u(n))})],p=[or(ro(),function(n,t){t.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),or(ao(),function(n,t){i.onDragEnd(n,u(n))})],h=rS?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:Is(i.sliderBehaviours,z([rS?[]:[sg.config({mode:"special",focusIn:function(n){return Ys(n,i,"spectrum").map(sg.focusIn).map(nn(!0))}})],[Qf.config({store:{mode:"manual",getValue:function(n){return d.value.get()}}}),fc.config({channels:{"mouse.released":{onReceive:function(e,n){function t(){Ys(e,i,"thumb").each(function(n){var t=d.value.get();i.onChoose(e,n,t)})}if(rS)t();else{var o=i.mouseIsDown.get();i.mouseIsDown.set(!1),o&&t()}}}}})]])),events:nr([or(Vw(),function(n,t){l(n,t.event().value())}),Fi(function(n,t){var e=d.getInitialValue();d.value.set(e);var o=u(n);f(n,o);var r=a(n);i.onInit(n,o,r,d.value.get())})].concat(h)),apis:{resetToMin:function(n){m.setToMin(n,i)},resetToMax:function(n){m.setToMax(n,i)},changeValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),uS=function(n,t){var e=iS.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=iS.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return iS.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nn({y:nn(0)})},components:[e,o],sliderBehaviours:va([pg.config({})]),onChange:function(n,t,e){Yt(n,Cw(),{value:e})}})},aS=[Ms("formBehaviours",[Qf])],cS=function(o,n,t){return{uid:o.uid,dom:o.dom,components:n,behaviours:Is(o.formBehaviours,[Qf.config({store:{mode:"manual",getValue:function(n){var t=Js(n,o);return L(t,function(n,t){return n().bind(function(n){return function(n,t){return n.fold(function(){return an.error(t)},an.value)}(Ql.getCurrent(n),"missing current")}).map(Qf.getValue)})},setValue:function(e,n){Cn(n,function(t,n){Ys(e,o,n).each(function(n){Ql.getCurrent(n).each(function(n){Qf.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){return Ys(n,o,t).bind(Ql.getCurrent)}}}},sS={getField:Lr(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var e,t=(e=[],{field:function(n,t){return e.push(n),js("form",uw(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=w(r,function(n){return yl({name:n,pname:uw(n)})});return ef("form",aS,i,cS,o)}},fS=Vr("valid-input"),lS=Vr("invalid-input"),dS=Vr("validating-input"),mS="colorcustom.rgb.",gS=function(d,m,g,p){function h(n,t,e,o,r){var i=d(mS+"range"),u=[sy.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),sy.parts().field({data:r,factory:ly,inputAttributes:P({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:va([function(t,o){return Iy.config({invalidClass:m("invalid"),notify:{onValidate:function(n){Yt(n,dS,{type:t})},onValid:function(n){Yt(n,fS,{type:t,value:Qf.getValue(n)})},onInvalid:function(n){Yt(n,lS,{type:t,value:Qf.getValue(n)})}},validator:{validate:function(n){var t=Qf.getValue(n),e=o(t)?an.value(!0):an.error(d("aria.input.invalid"));return Dy(e)},validateOnLoad:!1}})}(t,n),Ny.config({})]),onSetValue:function(n){Iy.isInvalid(n)&&Iy.run(n).get(Z)}})],a="hex"!==t?[sy.parts()["aria-descriptor"]({text:i})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:u.concat(a)}}function v(n,t){var e=t.red(),o=t.green(),r=t.blue();Qf.setValue(n,{red:e,green:o,blue:r})}function b(n,t){y.getOpt(n).each(function(n){si(n.element(),"background-color","#"+t.value())})}var y=pm({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return Bl({factory:function(){function r(n){return u[n]().get()}function i(n,t){u[n]().set(t)}function t(n,t){var e=t.event();"hex"!==e.type()?i(e.type(),on.none()):p(n)}function o(e,n,t){var o=parseInt(t,10);i(n,on.some(o)),r("red").bind(function(e){return r("green").bind(function(t){return r("blue").map(function(n){return jh(e,t,n,1)})})}).each(function(n){var t=function(t,n){var e=Lh(n);return sS.getField(t,"hex").each(function(n){pg.isFocused(n)||Qf.setValue(t,{hex:e.value()})}),e}(e,n);b(e,t)})}function e(n,t){var e=t.event();!function(n){return"hex"===n.type()}(e)?o(n,e.type(),e.value()):function(n,t){g(n);var e=Nh(t);i("hex",on.some(t));var o=Gh(e);v(n,o),a(o),Yt(n,Sw(),{hex:e}),b(n,e)}(n,e.value())}function n(n){return{label:d(mS+n+".label"),description:d(mS+n+".description")}}var u={red:nn(Te(on.some(255))),green:nn(Te(on.some(255))),blue:nn(Te(on.some(255))),hex:nn(Te(on.some("ffffff")))},a=function(n){var t=n.red(),e=n.green(),o=n.blue();i("red",on.some(t)),i("green",on.some(e)),i("blue",on.some(o))},c=n("red"),s=n("green"),f=n("blue"),l=n("hex");return Dn(sS.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",sy.sketch(h(Uh,"red",c.label,c.description,255))),n.field("green",sy.sketch(h(Uh,"green",s.label,s.description,255))),n.field("blue",sy.sketch(h(Uh,"blue",f.label,f.description,255))),n.field("hex",sy.sketch(h(Hh,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:va([Iy.config({invalidClass:m("form-invalid")}),qd("rgb-form-events",[or(fS,e),or(lS,t),or(dS,t)])])}}),{apis:{updateHex:function(n,t){Qf.setValue(n,{hex:t.value()}),function(n,t){var e=Gh(t);v(n,e),a(e)}(n,t),b(n,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}})},pS=function(n,o){function r(n,t){var e=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}}var i=iS.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=iS.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}});return Bl({factory:function(n){var t=nn({x:nn(0),y:nn(0)}),e=va([Ql.config({find:on.some}),pg.config({})]);return iS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:t},rounded:!1,components:[i,u],onChange:function(n,t,e){Yt(n,kw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),Yh(tv()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();r(e,Yh(t))}(t,e)}},extraApis:{}})},hS=function(l,d){return Bl({name:"ColourPicker",configFields:[ct("dom"),St("onValidHex",Z),St("onInvalidHex",Z)],factory:function(n){function t(n,e){u.getOpt(n).each(function(n){var t=Gh(e);s.paletteRgba().set(t),i.setRgba(n,t)})}function e(n,t){f.getOpt(n).each(function(n){r.updateHex(n,t)})}function a(t,e,n){bn(n,function(n){n(t,e)})}var o,c,r=gS(l,d,n.onValidHex,n.onInvalidHex),i=pS(l,d),s={paletteRgba:nn(Te(tv()))},u=pm(i.sketch({})),f=pm(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),uS(l,d),f.asSpec()],behaviours:va([qd("colour-picker-events",[or(kw(),(c=[e],function(n,t){var e=t.event().value(),o=function(n){var t,e=0,o=0,r=n.red()/255,i=n.green()/255,u=n.blue()/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?tx(0,0,100*(o=a)):(e=60*((e=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),t=(c-a)/c,o=c,tx(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=tx(o.hue(),e.x(),100-e.y()),i=Wh(r),u=Lh(i);a(n,u,c)})),or(Cw(),(o=[t,e],function(n,t){var e=function(n){var t=tx((100-n)/100*360,100,100),e=Wh(t);return Lh(e)}(t.event().value().y());a(n,e,o)}))]),Ql.config({find:function(n){return f.getOpt(n)}}),sg.config({mode:"acyclic"})])}}})},vS=function(){return Ql.config({find:on.some})},bS=function(n){return Ql.config({find:n.getOpt})},yS=function(n){return Ql.config({find:function(t){return yr(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},xS={"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"},wS=tinymce.util.Tools.resolve("tinymce.Resource"),SS=le([St("preprocess",l),St("postprocess",l)]),CS=function(r,n){var i=ot("RepresentingConfigs.memento processors",SS,n);return Qf.config({store:{mode:"manual",getValue:function(n){var t=r.get(n),e=Qf.getValue(t);return i.postprocess(e)},setValue:function(n,t){var e=i.preprocess(t),o=r.get(n);Qf.setValue(o,e)}}})},kS=cw,OS=function(n){return sw(n,Tr,Er)},TS=function(n){return Qf.config({store:{mode:"memory",initialValue:n}})},ES=Vr("alloy-fake-before-tabstop"),BS=Vr("alloy-fake-after-tabstop"),DS=function(n){return sb(n,["."+ES,"."+BS].join(","),nn(!1))},AS=function(n,t){var e=t.element();oi(e,ES)?dw(n,!0):oi(e,BS)&&dw(n,!1)},_S=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[lw([ES]),n,lw([BS])],behaviours:va([yS(1)])}},MS=!(Ht().browser.isIE()||Ht().browser.isEdge());function FS(n,t){return VS(H.document.createElement("canvas"),n,t)}function IS(n){var t=FS(n.width,n.height);return RS(t).drawImage(n,0,0),t}function RS(n){return n.getContext("2d")}function VS(n,t,e){return n.width=t,n.height=e,n}function NS(n){return n.naturalWidth||n.width}function HS(n){return n.naturalHeight||n.height}var PS,zS,LS=window.Promise?window.Promise:(PS=jS.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){H.setTimeout(n,1)},zS=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},jS.prototype["catch"]=function(n){return this.then(null,n)},jS.prototype.then=function(e,o){var r=this;return new jS(function(n,t){WS.call(r,new qS(e,o,n,t))})},jS.all=function(){for(var n=[],t=0;t").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),mk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(bk(n),n.button!==u)return a(n);n.deltaX=n.screenX-f,n.deltaY=n.screenY-l,n.preventDefault(),r.drag(n)},a=function(n){bk(n),mk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){mk(m).off()},mk(m).on("mousedown touchstart",t)}function xk(t){function u(n,s){c.getOpt(n).each(function(n){var e=l.get(),o=du(n.element()),r=cu(n.element()),i=s.dom().naturalWidth*e,u=s.dom().naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),t={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};fi(s,t),f.getOpt(n).each(function(n){fi(n.element(),t)}),d.get().each(function(n){var t=m.get();n.setRect({x:t.x*e+a,y:t.y*e+c,w:t.w*e,h:t.h*e}),n.setClampRect({x:a,y:c,w:i,h:u}),n.setViewPortRect({x:0,y:0,w:o,h:r})})})}function e(n,t){var i=Be.fromTag("img");return Dr(i,"src",t),function(e){return new Rp(function(n){var t=function(){e.removeEventListener("load",t),n(e)};e.complete?n(e):e.addEventListener("load",t)})}(i.dom()).then(function(){return c.getOpt(n).map(function(n){var t=ou({element:i});lg.replaceAt(n,1,on.some(t));var e=a.get(),o={x:0,y:0,w:i.dom().naturalWidth,h:i.dom().naturalHeight};a.set(o);var r=gk.inflate(o,-20,-20);return m.set(r),e.w===o.w&&e.h===o.h||function(n,u){c.getOpt(n).each(function(n){var t=du(n.element()),e=cu(n.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(t/o,e/r);1<=i?l.set(1):l.set(i)})}(n,i),u(n,i),i})})}var f=pm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=Te(1),d=Te(on.none()),m=Te({x:0,y:0,w:1,h:1}),a=Te({x:0,y:0,w:1,h:1}),n=Hb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:va([qd("image-panel-crop-events",[Fi(function(n){c.getOpt(n).each(function(n){var t=n.element().dom(),e=kk({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,function(){});e.toggleVisibility(!1),e.on("updateRect",function(n){var t=n.rect,e=l.get(),o={x:Math.round(t.x/e),y:Math.round(t.y/e),w:Math.round(t.w/e),h:Math.round(t.h/e)};m.set(o)}),d.set(on.some(e))})})])])}],containerBehaviours:va([lg.config({}),qd("image-panel-events",[Fi(function(n){e(n,t)})])])}),c=pm(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){var e=l.get(),o=0').appendTo(o),hk.each(i,function(n){mk("#"+a,o).append(''),components:[],behaviours:va([ME.config({channel:IF,initialData:n,updateState:function(n,t){var e=w(t.buttons,function(n){var t=pm(function(n,t){return WC(n,n.type,t)}(n,o));return{name:n.name,align:n.align,memento:t}});return on.some({lookupByName:function(n,t){return function(t,n,e){return O(n,function(n){return n.name===e}).bind(function(n){return n.memento.getOpt(t)})}(n,e,t)},footerButtons:e})},renderComponents:w_})])}}function C_(n,t){return iM.parts().footer(S_(n,t))}function k_(t,e){if(t.getRoot().getSystem().isConnected()){var o=Ql.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return sS.getField(o,e).fold(function(){var n=t.getFooter();return ME.getState(n).get().bind(function(n){return n.lookupByName(o,e)})},function(n){return on.some(n)})}return on.none()}function O_(u,o,a){function n(n){var t=u.getRoot();t.getSystem().isConnected()&&n(t)}var c={getData:function(){var n=u.getRoot(),t=n.getSystem().isConnected()?u.getFormWrapper():n,e=Qf.getValue(t),o=L(a,function(n){return n.get()});return P(P({},e),o)},setData:function(i){n(function(n){var t=c.getData(),e=An(t,i),o=function(n,t){var e=n.getRoot();return ME.getState(e).get().map(function(n){return et(tt("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();Qf.setValue(r,o),Cn(a,function(n,t){Tn(e,t)&&n.set(e[t])})})},disable:function(n){k_(u,n).each(wh.disable)},enable:function(n){k_(u,n).each(wh.enable)},focus:function(n){k_(u,n).each(pg.focus)},block:function(t){if(!cn(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Yt(n,oy,{message:t})})},unblock:function(){n(function(n){Xt(n,ry)})},showTab:function(e){n(function(n){var t=u.getBody();ME.getState(t).get().exists(function(n){return n.isTabPanel()})&&Ql.getCurrent(t).each(function(n){BF.showTab(n,e)})})},redial:function(e){n(function(n){var t=o(e);n.getSystem().broadcastOn([_F],t),n.getSystem().broadcastOn([MF],t.internalDialog),n.getSystem().broadcastOn([FF],t.internalDialog),n.getSystem().broadcastOn([IF],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){Xt(n,Zb)})}};return c}function T_(n,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[n,t]}}function E_(n,t){return iM.parts().close(Ug.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:va([Ny.config({})])}))}function B_(){return iM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function D_(n,t){return iM.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:up("

"+t.translate(n)+"

")}]}]})}function A_(n){return iM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})}function __(n,t){return[Hb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),Hb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]}function M_(t){var n,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return iM.sketch({lazySink:t.lazySink,onEscape:function(n){return t.onEscape(n),on.some(!0)},useTabstopAt:function(n){return!DS(n)},dom:{tag:"div",classes:[e].concat(t.extraClasses),styles:P({position:"relative"},t.extraStyles)},components:g([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:up('
'),components:[{dom:{tag:"div",classes:HF?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:va(g([pg.config({}),qd("dialog-events",t.dialogEvents.concat([sr(so(),function(n,t){sg.focusIn(n)})])),qd("scroll-lock",[Fi(function(){ni(Ai(),i)}),Ii(function(){ei(Ai(),i)})])],t.extraBehaviours)),eventOrder:P((n={},n[ko()]=["dialog-events"],n[Vo()]=["scroll-lock","dialog-events","alloy.base.behaviour"],n[No()]=["alloy.base.behaviour","dialog-events","scroll-lock"],n),t.eventOrder)})}function F_(n){return Ug.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close"),title:n.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:''}}],action:function(n){Xt(n,ny)}})}function I_(n,t,e){function o(n){return[ki(e.translate(n.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:P({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:va([ME.config({channel:MF,renderComponents:o})])}}function R_(){return{dom:up('
')}}function V_(n,t){return function(n,t){var e=iM.parts().title(I_(n,on.none(),t)),o=iM.parts().draghandle(R_()),r=iM.parts().close(F_(t)),i=[e].concat(n.draggable?[o]:[]).concat([r]);return Hb.sketch({dom:up('
'),components:i})}({title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},t.shared.providers)}function N_(n,t){return{onClose:function(){return t.closeWindow()},onBlock:function(e){iM.setBusy(n(),function(n,t){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:up('
')}]}})},onUnblock:function(){iM.setIdle(n())}}}function H_(n,t,e,o){var r;return iu(M_(P(P({},n),{lazySink:o.shared.getSink,extraBehaviours:g([ME.config({channel:_F,updateState:function(n,t){return on.some(t)},initialData:t}),TS({})],n.extraBehaviours),onEscape:function(n){Xt(n,ny)},dialogEvents:e,eventOrder:(r={},r[Co()]=["reflecting","receiving"],r[Vo()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[No()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))}function P_(n){return w(n,function(n){return"menu"===n.type?function(n){var t=w(n.items,function(n){var t=Te(!1);return P(P({},n),{storage:t})});return P(P({},n),{items:t})}(n):n})}function z_(n){return k(n,function(n,t){return"menu"!==t.type?n:k(t.items,function(n,t){return n[t.name]=t.storage,n},n)},{})}function L_(n,t,e){var o=V_(n.internalDialog.title,e),r=function(n,t){var e=y_(n,on.none(),t,!1);return iM.parts().body(e)}({body:n.internalDialog.body},e),i=P_(n.internalDialog.buttons),u=z_(i),a=C_({buttons:i},e),c=NF(function(){return d},N_(function(){return l},t)),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:on.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=H_(f,n,c,e),d=O_({getRoot:function(){return l},getBody:function(){return iM.getBody(l)},getFooter:function(){return iM.getFooter(l)},getFormWrapper:function(){var n=iM.getBody(l);return Ql.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}function j_(n){return sn(n)&&-1!==zF.indexOf(n.mceAction)}function U_(e,n,o,t){var r,i=V_(e.title,t),u=function(n){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[_S({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:va([Ny.config({}),pg.config({})])})]}],behaviours:va([sg.config({mode:"acyclic",useTabstopAt:v(DS)})])};return iM.parts().body(t)}(e),a=e.buttons.bind(function(n){return 0===n.length?on.none():on.some(C_({buttons:n},t))}),c=VF(function(){return h},N_(function(){return p},n)),s=P(P({},e.height.fold(function(){return{}},function(n){return{height:n+"px","max-height":n+"px"}})),e.width.fold(function(){return{}},function(n){return{width:n+"px","max-width":n+"px"}})),f=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],l=new PF(e.url,{base_uri:new PF(H.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=Te(on.none()),g=[qd("messages",[Fi(function(){var n=ab(Be.fromDom(H.window),"message",function(n){if(l.isSameOrigin(new PF(n.raw().origin))){var t=n.raw().data;j_(t)?function(n,t,e){switch(e.mceAction){case"insertContent":n.insertContent(e.content);break;case"setContent":n.setContent(e.content);break;case"execCommand":var o=!!ln(e.ui)&&e.ui;n.execCommand(e.cmd,o,e.value);break;case"close":t.close();break;case"block":t.block(e.message);break;case"unblock":t.unblock()}}(o,h,t):function(n){return!j_(n)&&sn(n)&&Tn(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(on.some(n))}),Ii(function(){m.get().each(function(n){return n.unbind()})})]),fc.config({channels:(r={},r[RF]={onReceive:function(n,t){Cu(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=H_({header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},e,c,t),h=function(t){function n(n){t.getSystem().isConnected()&&n(t)}return{block:function(t){if(!cn(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Yt(n,oy,{message:t})})},unblock:function(){n(function(n){Xt(n,ry)})},close:function(){n(function(n){Xt(n,Zb)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([RF],t)})}}}(p);return{dialog:p,instanceApi:h}}function W_(n,t,e,o){var r,i,u=Vr("dialog-label"),a=Vr("dialog-content"),c=pm(function(n,t,e){return Hb.sketch({dom:up('
'),components:[I_(n,on.some(t),e),R_(),F_(e)],containerBehaviours:va([r_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return ku(n,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:n.internalDialog.title,draggable:!0},u,e.shared.providers)),s=pm(function(n,t,e,o){return y_(n,on.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=P_(n.internalDialog.buttons),l=z_(f),d=pm(function(n,t){return S_(n,t)}({buttons:f},e)),m=NF(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}}),g=iu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=u,r["aria-describedby"]=""+a,r)},eventOrder:(i={},i[Co()]=[ME.name(),fc.name()],i[ko()]=["execute-on-form"],i[Vo()]=["reflecting","execute-on-form"],i),behaviours:va([sg.config({mode:"cyclic",onEscape:function(n){return Xt(n,Zb),on.some(!0)},useTabstopAt:function(n){return!DS(n)&&("button"!==qo(n)||"disabled"!==Ar(n,"disabled"))}}),ME.config({channel:_F,updateState:function(n,t){return on.some(t)},initialData:n}),pg.config({}),qd("execute-on-form",m.concat([sr(so(),function(n,t){sg.focusIn(n)})])),TS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=O_({getRoot:function(){return g},getFooter:function(){return d.get(g)},getBody:function(){return s.get(g)},getFormWrapper:function(){var n=s.get(g);return Ql.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}var G_,X_,Y_,q_,K_,J_=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:va([sg.config({mode:"flow",selector:"div[role=button]"}),Ny.config({}),lg.config({}),qd("elementPathEvents",[Fi(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return sg.focusIn(e)}),i.on("NodeChange",function(n){var t=function(n){for(var t=[],e=n.length;0t})},v=function(n){var t=o(n);r_.snapTo(d,t);r(d,n,function(n){return n.bottom<0},function(n,t){return n.bottom>t})};$_.deviceType.isTouch()&&(c.on("tableselectionchange",function(t){m.get()||(ps(n,l),ps(n,d),m.set(!0)),g.set(t.start),p.set(t.finish),t.otherCells.each(function(n){i.set(n.upOrLeftCells),u.set(n.downOrRightCells),h(t.start),v(t.finish)})}),c.on("resize ScrollContent",function(){!function(){var n=g.get();h(n)}(),function(){var n=p.get();v(n)}()}),c.on("tableselectionclear",function(){m.get()&&(vs(l),vs(d),m.set(!1))}))},Z_=function(e){var o=Te(on.none()),r=Te(!1),i=qg(function(n){e.fire("longpress",P(P({},n),{type:"longpress"})),r.set(!0)},400);e.on("touchstart",function(e){s_(e).each(function(n){i.cancel();var t={x:nn(n.clientX),y:nn(n.clientY),target:nn(e.target)};i.throttle(e),r.set(!1),o.set(on.some(t))})},!0),e.on("touchmove",function(n){i.cancel(),s_(n).each(function(t){o.get().each(function(n){!function(n,t){var e=Math.abs(n.clientX-t.x()),o=Math.abs(n.clientY-t.y());return 5