/** * 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.4 (2019-12-11) */ !function(v){"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 se.objOf(S(o,function(n){return n.fold(function(n,t,e,o){return fe.field(n,e,o)},function(n,t){return fe.state(n)})}))}}},me=nn(Yn(ne)),ge=i(Kn,de),pe=le.state,he=le.field,ve=Yn(ne),be=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},ye=function(n){return"Errors: \n"+function(n){var t=10 ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+jn(n.input)},xe=nn(ve),we=ut(mn,"number"),Se=ut(cn,"string"),Ce=ut(ln,"boolean"),ke=ut(dn,"function"),Oe=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 Oe(t[n])});case"Map":return n(t.keys(),Oe)&&n(t.values(),Oe);case"Set":return n(t.keys(),Oe);default:return!1}},Te=Yn(function(n){return Oe(n)?ne(n):ee("Expected value to be acceptable for sending via postMessage")}),Ee=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return Ee(t())}}},De=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||v.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,{})},ru=function(n,t){return ci(n)?n.style.getPropertyValue(t):""},iu=function(n){var t=ot("external.component",qn([ct("element"),ht("uid")]),n),e=Ee(zr());t.uid.each(function(n){qi(t.element,n)});var o={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(zr(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return jr(o)},uu=Pr,au=function(t){return function(n){return Nn(n,Zi)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:N({uid:uu("")},t);return Oi(n).getOrDie()},function(n){return n})},cu=jr;function su(o,r){function n(n){var t=r(n);if(t<=0||null===t){var e=mi(n,o);return parseFloat(e)||0}return t}function i(r,n){return O(n,function(n,t){var e=mi(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();ci(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 za=Ee({}),La=["alloy/data/Fields","alloy/debugging/Debugging"],ja=nn({logEventCut:Z,logEventStopped:Z,logNoParent:Z,logEventNoHandlers:Z,logEventResponse:Z,write:Z}),Ua=nn([ct("menu"),ct("selectedMenu")]),Wa=nn([ct("item"),ct("selectedItem")]),Ga=(nn(de(Wa().concat(Ua()))),nn(de(Wa()))),Xa=mt("initSize",[ct("numColumns"),ct("numRows")]),Ya=nn(Xa),qa=lr("x","y","bubble","direction","label"),Ka=En([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ja=Ka.southeast,$a=Ka.southwest,Qa=Ka.northeast,Za=Ka.northwest,nc=Ka.south,tc=Ka.north,ec=Ka.east,oc=Ka.west,rc=function(n,t,e){return qa(ea(n,t),ra(n,t),e.north(),tc(),"layout-n")},ic=function(n,t,e){return qa(ea(n,t),ia(n),e.south(),nc(),"layout-s")},uc=function(e,n,o,r,t,i,u){function a(n){return $(n,o)?n[o]():on.none()}var c=P(t,function(n,t){return va(o,n,t)}),s=P(i,function(n,t){return Lr(n,t)}),f=N(N(N({},s),c),{revoke:d(ba,o),config:function(n){var t=ot(o+"-config",e,n);return{key:o,value:{config:t,me:f,configAsRaw:L(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(Gr({}))},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},ac=qn([ct("fields"),ct("name"),St("active",{}),St("apis",{}),St("state",nu),St("extra",{})]),cc=qn([ct("branchKey"),ct("branches"),ct("name"),St("active",{}),St("apis",{}),St("state",nu),St("extra",{})]),sc=nn(undefined),fc=/* */Object.freeze({events:function(t){return tr([rr(Oo(),function(r,i){var u=t.channels,n=function(n,t){return t.universal()?n:C(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: "+Nr(r.element()),e,i.data());t.onReceive(r,o)})})])}}),lc=[st("channels",nt(an.value,qn([$u("onReceive"),St("schema",xe())])))],dc=xa({fields:lc,name:"receiving",active:fc}),mc=/* */Object.freeze({exhibit:function(n,t){return Gr({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),gc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],pc=gr(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),hc=lr("position","left","top","right","bottom"),vc=En([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),bc=function(n,t,e){var o=Ru(t,e);return n.fold(nn(o),nn(o),function(){var n=hu();return o.translate(-n.left(),-n.top())})},yc=vc.relative,xc=vc.fixed,wc=function(n){return"rtl"===mi(n,"direction")?"rtl":"ltr"},Sc=[ct("hotspot"),ht("bubble"),St("overrides",{}),Ma(),Zu("placement",function(n,t,e){var o=t.hotspot,r=Ba(e,o.element()),i=Fa(n.element(),t,ma(),ga());return on.some(Aa({anchorBox:r,bubble:t.bubble.getOr(Ea()),overrides:t.overrides,layouts:i,placer:on.none()}))})],Cc=[ct("x"),ct("y"),St("height",0),St("width",0),St("bubble",Ea()),St("overrides",{}),Ma(),Zu("placement",function(n,t,e){var o=bc(e,t.x,t.y),r=xu(o.left(),o.top(),t.width,t.height),i=Fa(n.element(),t,[aa,ca,sa,fa,ic,rc,la,da],[ca,aa,fa,sa,ic,rc,la,da]);return on.some(Aa({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:on.none()}))})],kc={create:lr("start","soffset","finish","foffset")},Oc=En([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Tc=(Oc.before,Oc.on,Oc.after,function(n){return n.fold(l,l,l)}),Ec=En([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Dc={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(n){return Ec.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 Tc(n)},exact:function(n,t,e,o){return n}})}(n);return vr(t)},range:kc.create},Bc=En([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function Ac(n){return uf.get(n)}function _c(n){return uf.getOption(n)}function Mc(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=Ac(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"}),xe()),gl=At("schema",function(){return[ht("preprocess")]}),pl=St("defaults",nn({})),hl=St("overrides",nn({})),vl=de([fl,ll,dl,ml,pl,hl]),bl=de([fl,ll,dl,pl,hl]),yl=de([fl,ll,dl,ml,pl,hl]),xl=de([fl,gl,dl,ct("unit"),ml,pl,hl]),wl=Ls(sl.required,vl),Sl=Ls(sl.external,bl),Cl=Ls(sl.optional,yl),kl=Ls(sl.group,xl),Ol=nn("entirety"),Tl=/* */Object.freeze({required:wl,external:Sl,optional:Cl,group:kl,asNamedPart:Ps,name:zs,asCommon:function(n){return n.fold(l,l,l,l)},original:Ol}),El=function(n,t){return{uiType:cl(),owner:n,name:t}},Dl=/* */Object.freeze({generate:Us,generateOne:Ws,schemas:Gs,names:Xs,substitutes:Ys,components:qs,defaultUids:tf,defaultUidsSchema:ef,getAllParts:Qs,getAllPartNames:Zs,getPart:Ks,getPartOrDie:Js,getParts:$s,getPartsOrDie:nf}),Bl=function(n){return n.hasOwnProperty("uid")?n:N(N({},n),{uid:Pr("uid")})};function Al(n){var t=ot("Sketcher for "+n.name,Jl,n),e=P(t.apis,Ur),o=P(t.extraApis,function(n,t){return Lr(n,t)});return N(N({name:nn(t.name),partFields:nn([]),configFields:nn(t.configFields),sketch:function(n){return function(n,t,e,o){var r=Bl(o);return e(of(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}function _l(n){var t=ot("Sketcher for "+n.name,$l,n),e=Us(t.name,t.partFields),o=P(t.apis,Ur),r=P(t.extraApis,function(n,t){return Lr(n,t)});return N(N({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){return rf(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function Ml(n){return"input"===Ko(n)&&"radio"!==Mr(n,"type")||"textarea"===Ko(n)}function Fl(e,o,n,r){var t=Lc(e.element(),"."+o.highlightClass);bn(t,function(t){x(r,function(n){return n.element()===t})||(ri(t,o.highlightClass),e.getSystem().getByDom(t).each(function(n){o.onDehighlight(e,n),Yt(n,Xo())}))})}function Il(n,t,e,o){Fl(n,t,0,[o]),td(n,t,e,o)||(ei(o.element(),t.highlightClass),t.onHighlight(n,o),Yt(o,Go()))}function Rl(e,t,n,o){var r=Lc(e.element(),"."+t.itemClass);return E(r,function(n){return ii(n,t.highlightClass)}).bind(function(n){var t=us(n,o,0,r.length-1);return e.getSystem().getByDom(r[t]).toOption()})}function Vl(n,t,e){var o=A(n.slice(0,t)),r=A(n.slice(t+1));return T(o.concat(r),e)}function Nl(n,t,e){var o=A(n.slice(0,t));return T(o,e)}function Hl(n,t,e){var o=n.slice(0,t),r=n.slice(t+1);return T(r.concat(o),e)}function Pl(n,t,e){var o=n.slice(t+1);return T(o,e)}function zl(e){return function(n){var t=n.raw();return vn(e,t.which)}}function Ll(n){return function(t){return B(n,function(n){return n(t)})}}function jl(n){return!0===n.raw().shiftKey}function Ul(n){return!0===n.raw().ctrlKey}function Wl(n,t){return{matches:n,classification:t}}function Gl(n,t,e){t.exists(function(t){return e.exists(function(n){return jt(n,t)})})||qt(n,Lo(),{prevFocus:t,newFocus:e})}function Xl(){function r(n){return ka(n.element())}return{get:r,set:function(n,t){var e=r(n);n.getSystem().triggerFocus(t,n.element());var o=r(n);Gl(n,e,o)}}}function Yl(){function r(n){return cd.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){cd.highlight(t,n)});var o=r(t);Gl(t,e,o)}}}var ql,Kl,Jl=qn([ct("name"),ct("factory"),ct("configFields"),St("apis",{}),St("extraApis",{})]),$l=qn([ct("name"),ct("factory"),ct("configFields"),ct("partFields"),St("apis",{}),St("extraApis",{})]),Ql=/* */Object.freeze({getCurrent:function(n,t,e){return t.find(n)}}),Zl=[ct("find")],nd=xa({fields:Zl,name:"composing",apis:Ql}),td=function(n,t,e,o){return ii(o.element(),t.highlightClass)},ed=function(n,t,e,o){var r=Lc(n.element(),"."+t.itemClass);return on.from(r[o]).fold(function(){return an.error("No element found with index "+o)},n.getSystem().getByDom)},od=function(t,n,e){return Ou(t.element(),"."+n.itemClass).bind(function(n){return t.getSystem().getByDom(n).toOption()})},rd=function(t,n,e){var o=Lc(t.element(),"."+n.itemClass);return(0',t.getDoc());return Pi(n,Be.fromDom(e.extractContents())),e.insertNode(n.dom()),br(n).each(function(n){return n.dom().normalize()}),Rc(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===Ko(n)?1:_c(n).fold(function(){return xr(n).length},function(n){return n.length})}(n))}),n})}function np(n,t){return n.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function tp(n,u,a,c){return void 0===c&&(c=0),function(n){return n.collapsed&&3===n.startContainer.nodeType}(u)?Qg(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(Vp.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 ap(n,t){return ya([Jd(n,t)])}function cp(n,t,e){n.getSystem().broadcastOn([nh],{})}function sp(n){var t=Be.fromHtml(n),e=xr(t),o=function(n){var t=n.dom().attributes!==undefined?n.dom().attributes:[];return O(t,function(n,t){var e;return"class"===t.name?n:N(N({},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:Dr(t)};return N({tag:Ko(t),classes:r,attributes:o},i)}function fp(n){return Nn(sh,n).getOr(uh)}function lp(n){return{dom:{tag:"div",classes:[lh],innerHtml:n}}}function dp(n){return{dom:{tag:"div",classes:[dh]},components:[Ti(ih.translate(n))]}}function mp(n,t){return{dom:{tag:"div",classes:[dh]},components:[{dom:{tag:n.tag,attributes:{style:n.styleAttr}},components:[Ti(ih.translate(t))]}]}}function gp(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:hh(n)}}}function pp(n){return{dom:{tag:"div",classes:[lh,"tox-collection__item-checkmark"],innerHtml:xm("checkmark",n)}}}function hp(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(on.some("")).map(lp)}):on.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:ih.translate(n)}}}).getOr({});return{dom:An({tag:"div",classes:[uh,ah].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:[dh],innerHtml:n}}}(n))}),n.shortcutContent.map(gp),n.caret]}}function vp(n,t,e,o){void 0===o&&(o=on.none());var r=ih.isRtl()&&n.iconContent.exists(function(n){return vn(bh,n)}),i=n.iconContent.map(function(n){return ih.isRtl()&&vn(vh,n)?n+"-rtl":n}).map(function(n){return function(n,t,e){return on.from(t()[n]).or(e).getOrThunk(function(){return ym(t)})}(n,t.icons,o)}),u=on.from(n.meta).fold(function(){return dp},function(n){return Tn(n,"style")?d(mp,n.style):dp});return"color"===n.presets?function(n,t,e,o){var r,i,u;return{dom:(r=ch,i=e.getOr(""),u=n.map(function(n){return' title="'+o.translate(n)+'"'}).getOr(""),sp("custom"===t?'":"remove"===t?'
"+i+"
":'
")),optComponents:[]}}(n.ariaLabel,n.value,i,t):hp(n,i,e,u,r)}function bp(n,t,e){t.disabled&&xh(n,t)}function yp(n,t){return!0===t.useNative&&vn(yh,Ko(n.element()))}function xp(n){_r(n.element(),"disabled","disabled")}function wp(n){Ir(n.element(),"disabled")}function Sp(n){_r(n.element(),"aria-disabled","true")}function Cp(n){_r(n.element(),"aria-disabled","false")}function kp(t,n,e){n.disableClass.each(function(n){ri(t.element(),n)}),(yp(t,n)?wp:Cp)(t),n.onEnabled(t)}function Op(n,t){return yp(n,t)?function(n){return Fr(n.element(),"disabled")}(n):function(n){return"true"===Mr(n.element(),"aria-disabled")}(n)}function Tp(n,t){var e=n.getApi(t);return function(n){n(e)}}function Ep(e,o){return Ri(function(n){Tp(e,n)(function(n){var t=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}function Dp(t,e){return Vi(function(n){return Tp(t,n)(e.get())})}var Bp,Ap,_p=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Mp=En([{aborted:[]},{edge:["element"]},{success:["info"]}]),Fp=En([{abort:[]},{kontinue:[]},{finish:["info"]}]),Ip=function(t,e,n,o,r,i){function u(){return i.fold(Mp.aborted,Mp.edge)}function a(){var n=r();return n?Ip(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===v.Node.TEXT_NODE}(e)){var c=e.textContent;return o(Fp,e,c,n).fold(Mp.aborted,function(){return a()},Mp.success)}return a()},Rp=function(n){return Tu(n,"[data-mce-autocompleter]")},Vp=/[\u00a0 \t\r\n]/,Np=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);function o(n,t){qt(n,go(),{raw:t})}n.on("keydown",function(t){function n(){return e.getView().bind(cd.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(Kt),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(cd.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()&&Rp(Be.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},Hp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Pp=function(n){if(function(n){return n.nodeType===v.Node.TEXT_NODE}(n))return op(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=zp(n.startContainer,n.startOffset);return Qg(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=Hp.all(S(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})},jp=de([ft("type"),yt("text")]),Up=de([At("type",function(){return"autocompleteitem"}),At("active",function(){return!1}),At("disabled",function(){return!1}),St("meta",{}),ft("value"),yt("text"),yt("icon")]),Wp=de([ft("type"),ft("ch"),kt("minChars",1),St("columns",1),kt("maxResults",10),xt("matches"),dt("fetch"),dt("onAction")]),Gp=[Et("disabled",!1),yt("text"),yt("shortcut"),he("value","value",In(function(){return Hr("menuitem-value")}),xe()),St("meta",{})],Xp=de([ft("type"),Dt("onSetup",function(){return Z}),Dt("onAction",Z),yt("icon")].concat(Gp)),Yp=de([ft("type"),dt("getSubmenuItems"),Dt("onSetup",function(){return Z}),yt("icon")].concat(Gp)),qp=de([ft("type"),Et("active",!1),Dt("onSetup",function(){return Z}),dt("onAction")].concat(Gp)),Kp=de([ft("type"),Et("active",!1),yt("icon")].concat(Gp)),Jp=de([ft("type"),lt("fancytype",["inserttable","colorswatch"]),Dt("onAction",Z)]),$p=function(n){return ap(Hr("unnamed-events"),n)},Qp=[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([ic,rc,aa,sa,ca,fa]),onRtl:nn([ic,rc,aa,sa,ca,fa])}}}),Ku("onHide"),Ku("onShow")],Zp=/* */Object.freeze({init:function(){function e(){o.get().each(function(n){v.clearTimeout(n)})}var o=Ee(on.none()),t=Ee(on.none()),n=nn("not-implemented");return tu({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(v.setTimeout(function(){n()},t)))},readState:n})}}),nh=Hr("tooltip.exclusive"),th=Hr("tooltip.show"),eh=Hr("tooltip.hide"),oh=/* */Object.freeze({hideAllExclusive:cp,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&gg.set(n,o)})}}),rh=xa({fields:Qp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){function e(t){r.getTooltip().each(function(n){ys(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}return tr(H([[rr(th,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){cp(t);var n=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:tr("normal"===o.mode?[rr(fo(),function(n){Yt(t,th)}),rr(co(),function(n){Yt(t,eh)})]:[]),behaviours:ya([gg.config({})])});r.setTooltip(e),vs(n,e),o.onShow(t,e),_f.position(n,o.anchor(t),e)}}(n)},o.delay)}),rr(eh,function(n){r.resetTimer(function(){e(n)},o.delay)}),rr(Oo(),function(n,t){vn(t.channels(),nh)&&e(n)}),Vi(function(n){e(n)})],"normal"===o.mode?[rr(lo(),function(n){Yt(n,th)}),rr(Co(),function(n){Yt(n,eh)}),rr(fo(),function(n){Yt(n,th)}),rr(co(),function(n){Yt(n,eh)})]:[rr(Go(),function(n,t){Yt(n,th)}),rr(Xo(),function(n){Yt(n,eh)})]]))}}),state:Zp,apis:oh}),ih=tinymce.util.Tools.resolve("tinymce.util.I18n"),uh="tox-menu-nav__js",ah="tox-collection__item",ch="tox-swatch",sh={normal:uh,color:ch},fh="tox-collection__item--enabled",lh="tox-collection__item-icon",dh="tox-collection__item-label",mh="tox-collection__item-caret",gh="tox-collection__item--active",ph=tinymce.util.Tools.resolve("tinymce.Env"),hh=function(n){var e=ph.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},t=n.split("+"),o=S(t,function(n){var t=n.toLowerCase().trim();return Tn(e,t)?e[t]:n});return ph.mac?o.join(""):o.join("+")},vh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],bh=["list-bull-circle","list-bull-default","list-bull-square"],yh=["input","button","textarea","select"],xh=function(t,n,e){n.disableClass.each(function(n){ei(t.element(),n)}),(yp(t,n)?xp:Sp)(t),n.onDisabled(t)},wh=/* */Object.freeze({enable:kp,disable:xh,isDisabled:Op,onLoad:bp,set:function(n,t,e,o){(o?xh:kp)(n,t,e)}}),Sh=/* */Object.freeze({exhibit:function(n,t,e){return Gr({classes:t.disabled?t.disableClass.map(M).getOr([]):[]})},events:function(e,n){return tr([er(To(),function(n,t){return Op(n,e)}),pa(e,n,bp)])}}),Ch=[St("disabled",!1),St("useNative",!0),ht("disableClass"),Ku("onDisabled"),Ku("onEnabled")],kh=xa({fields:Ch,name:"disabling",active:Sh,apis:wh}),Oh=function(n){return kh.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Th=function(n){return kh.config({disabled:n})},Eh=function(n){return kh.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Dh=function(n){return kh.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(Ap=Bp=Bp||{})[Ap.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Ap[Ap.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";function Bh(n){return D(n,function(n){return n.toArray()})}function Ah(n,t,e){var o=Ee(Z);return{type:"item",dom:t.dom,components:Bh(t.optComponents),data:n.data,eventOrder:Rh,hasSubmenu:n.triggersSubmenu,itemBehaviours:ya([Jd("item-events",[function(e,o){return Hi(function(n,t){Tp(e,n)(e.onAction),e.triggersSubmenu||o!==Ih.CLOSE_ON_EXECUTE||(Yt(n,Ao()),t.stop())})}(n,e),Ep(n,o),Dp(n,o)]),Oh(n.disabled),gg.config({})].concat(n.itemBehaviours))}}function _h(n){return{value:n.value,meta:An({text:n.text.getOr("")},n.meta)}}function Mh(n,t){var e=function(n){return Vh.DOM.encode(n)}(ih.translate(n));if(0'+n+""})}return e}function Fh(t,e,n){function o(n){return qt(n,Ph,{row:t,col:e})}var r;return au({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:ya([Jd("insert-table-picker-cell",[rr(fo(),bg.focus),rr(To(),o),rr(Xt(),function(n,t){t.stop(),o(n)})]),kg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),bg.config({onFocus:function(n){return qt(n,Hh,{row:t,col:e})}})])})}var Ih=Bp,Rh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Vh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Nh=nn(Us("item-widget",_g())),Hh=Hr("cell-over"),Ph=Hr("cell-execute");function zh(n){return{value:nn(n)}}function Lh(n){return $h.test(n)||Qh.test(n)}function jh(n){var t=function(n){var t=n.value().replace($h,function(n,t,e,o){return t+t+e+e+o+o});return{value:nn(t)}}(n),e=Qh.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e}function Uh(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function Wh(n){var t=Uh(n.red())+Uh(n.green())+Uh(n.blue());return zh(t)}function Gh(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}function Xh(n){var t=parseInt(n,10);return t.toString()===n&&0<=t&&t<=255}function Yh(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=nv(0,Zh(i,1)),u=nv(0,Zh(u,1)),0===i)return t=e=o=tv(255*u),Gh(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=tv(255*(t+f)),e=tv(255*(e+f)),o=tv(255*(o+f)),Gh(t,e,o,1)}function qh(n){var t=jh(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return Gh(e,o,r,1)}function Kh(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return Gh(r,i,u,a)}function Jh(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}var $h=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Qh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Zh=Math.min,nv=Math.max,tv=Math.round,ev=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ov=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,rv=nn(Gh(255,0,0,1)),iv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),uv="tinymce-custom-colors";function av(n){var t=[],u=v.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(),iv.setItem(uv,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Fv=function(n,t){return n.getParam("color_cols",t,"number")},Iv=function(n){return!1!==n.getParam("custom_colors")},Rv=function(n){var t=cv(n);return t!==undefined?av(t):_v},Vv=function(){return S(Mv.state(),function(n){return{type:Av,text:n,value:n}})},Nv=function(n){Mv.add(n)},Hv=function(n){return n.fire("SkinLoaded")},Pv=function(n){return n.fire("ResizeEditor")},zv=function(n,t){return n.fire("ScrollContent",t)},Lv=function(n,t){return n.fire("ResizeContent",t)},jv=function(n,t){return n.fire("TextColorChange",t)},Uv=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())}})}},Wv={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=Ee(null),e=Ee(null);hv(n,"forecolor","forecolor","Text color",t),hv(n,"backcolor","hilitecolor","Background color",e),vv(n,"forecolor","forecolor","Text color"),vv(n,"backcolor","hilitecolor","Background color")},getColors:mv,getFetch:gv,colorPickerDialog:Uv,getCurrentColor:sv,getColorCols:lv,calcCols:fv},Gv=[Ng.parts().items({})],Xv=function(n,e,o,r,i,u,a){return Bu(S(n,function(t){return"choiceitem"===t.type?function(n){return tt("choicemenuitem",Kp,n)}(t).fold(Ov,function(n){return on.some(function(t,n,e,o,r,i,u){var a=vp({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(pp(u.icons)):on.none(),caret:on.none(),value:t.value},u,!0);return Bn(Ah({data:_h(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){kg.set(t,n)},isActive:function(){return kg.isOn(t)},isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.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:fh,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):on.none()}))};var Yv,qv,Kv={inserttable:function aI(o){var n=Hr("size-label"),i=function(n,t,e){for(var o=[],r=0;r"}function hw(n){return function(n){return BS[n]}(n)}function vw(n,t,e){return nl.config(Bn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}function bw(n,t,e){return vw(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})}function yw(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(!kh.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){nl.setValue(n,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return C(xn(n),function(n){return t.test(n.name)})}(t)),qt(n,ay,{name:e.name})},c=bm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ya([Jd("input-file-events",[sr(Xt())])])}),n=e.label.map(function(n){return Ay(n,t)}),s=by.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ya([RS([]),TS(),kh.config({}),kg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Jd("dropzone-events",[rr("dragenter",r([o,kg.toggle])),rr("dragleave",r([o,kg.toggle])),rr("dragover",o),rr("drop",r([o,i])),rr(vo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Xg.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:ya([Xy.config({})])})]}]}}}});return By(n,s,["tox-form__group--stretched"],[])}function xw(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:ya([bg.config({ignore:!0}),Xy.config({})])}}function ww(n,t){qt(n,go(),{raw:{which:9,shiftKey:t}})}function Sw(n,t){var e=LS&&n.sandboxed,o=N(N({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){var r=Ee("");return{getValue:function(n){return r.get()},setValue:function(n,t){if(o)_r(n.element(),"srcdoc",t);else{_r(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 Ay(n,t)}),u=by.parts().field({factory:{sketch:function(n){return zS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:ya([Xy.config({}),bg.config({}),FS(on.none(),r.getValue,r.setValue)])})}}});return By(i,u,["tox-form__group--stretched"],[])}var Cw=function(t,n){return t.getSystem().getByUid(n.uid+"-"+Qy()).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)}})})},kw=nn([ct("dom"),ct("fetch"),Ku("onOpen"),Ju("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),Is("dropdownBehaviours",[kg,$y,dg,bg]),ct("toggleClass"),St("eventOrder",{}),ht("lazySink"),St("matchWidth",!1),St("useMinWidth",!1),ht("role")].concat(cx())),Ow=nn([Sl({schema:[Xu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Zy()]),Tw=_l({name:"Dropdown",configFields:kw(),partFields:Ow(),factory:function(t,n,e,o){function r(n){Lf.getState(n).each(function(n){jg.highlightPrimary(n)})}function i(n,t){return Kt(n),on.some(!0)}var u,a,c={expand:function(n){kg.isOn(n)||ox(t,function(n){return n},n,o,Z,_y.HighlightNone).get(Z)},open:function(n){kg.isOn(n)||ox(t,function(n){return n},n,o,Z,_y.HighlightFirst).get(Z)},isOpen:kg.isOn,close:function(n){kg.isOn(n)&&ox(t,function(n){return n},n,o,Z,_y.HighlightFirst).get(Z)},repositionMenus:function(n){kg.isOn(n)&&ax(n)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Vs(t.dropdownBehaviours,[kg.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(n){return ux(t,n,{onOpen:function(){kg.on(n)},onClose:function(){kg.off(n)}})}}}),dg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(Tw.isOpen(n)){var e=$y.getCoupled(n,"sandbox");r(e)}else Tw.open(n);return on.some(!0)},onEscape:function(n,t){return Tw.isOpen(n)?(Tw.close(n),on.some(!0)):on.none()}}),bg.config({})]),events:im(on.some(function(n){ox(t,function(n){return n},n,o,r,_y.HighlightFirst).get(Z)})),eventOrder:N(N({},t.eventOrder),(u={},u[To()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:N(N({"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)}}}),Ew=xa({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return tr([er(xo(),nn(!0))])},exhibit:function(n,t){return Gr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Dw=Hr("color-input-change"),Bw=Hr("color-swatch-change"),Aw=Hr("color-picker-cancel"),_w=nn(Hr("rgb-hex-update")),Mw=nn(Hr("slider-update")),Fw=nn(Hr("palette-update")),Iw=Ht().deviceType.isTouch(),Rw=Cl({schema:[ct("dom")],name:"label"}),Vw=lx("top-left"),Nw=lx("top"),Hw=lx("top-right"),Pw=lx("right"),zw=lx("bottom-right"),Lw=lx("bottom"),jw=lx("bottom-left"),Uw=[Rw,lx("left"),Pw,Nw,Lw,Vw,Hw,jw,zw,wl({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:tr([ar(eo(),n,"spectrum"),ar(oo(),n,"spectrum"),ar(ro(),n,"spectrum"),ar(uo(),n,"spectrum"),ar(ao(),n,"spectrum"),ar(so(),n,"spectrum")])}}}),wl({schema:[At("mouseIsDown",function(){return Ee(!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=tr([rr(eo(),o),rr(oo(),o)]),t=tr([rr(uo(),o),rr(ao(),function(n,t){e.mouseIsDown.get()&&o(n,t)})]);return{behaviours:ya(Iw?[]:[dg.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)}}),bg.config({})]),events:Iw?n:t}}})],Ww=Ht().deviceType.isTouch(),Gw=nn("slider.change.value"),Xw="left",Yw=iw(-1),qw=iw(1),Kw=on.none,Jw=on.none,$w={"top-left":on.none(),top:on.none(),"top-right":on.none(),right:on.some(function(n,t){Px(n,Vx(yx(t)))}),"bottom-right":on.none(),bottom:on.none(),"bottom-left":on.none(),left:on.some(function(n,t){Px(n,Vx(px(t)))})},Qw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=rw(n,t,e),r=ow(o);return ew(n,r),o},setToMin:function(n,t){var e=mx(t);ew(n,ow(e))},setToMax:function(n,t){var e=vx(t);ew(n,ow(e))},findValueOfOffset:rw,getValueFromEvent:function(n){return dx(n).map(function(n){return n.left()})},findPositionOfValue:uw,setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=uw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=gu(t.element())/2;li(t.element(),"left",i-u+"px")},onLeft:Yw,onRight:qw,onUp:Kw,onDown:Jw,edgeActions:$w}),Zw=on.none,nS=on.none,tS=fw(-1),eS=fw(1),oS={"top-left":on.none(),top:on.some(function(n,t){Px(n,Nx(hx(t)))}),"top-right":on.none(),right:on.none(),"bottom-right":on.none(),bottom:on.some(function(n,t){Px(n,Nx(xx(t)))}),"bottom-left":on.none(),left:on.none()},rS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=sw(n,t,e),r=cw(o);return aw(n,r),o},setToMin:function(n,t){var e=gx(t);aw(n,cw(e))},setToMax:function(n,t){var e=bx(t);aw(n,cw(e))},findValueOfOffset:sw,getValueFromEvent:function(n){return dx(n).map(function(n){return n.top()})},findPositionOfValue:lw,setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=lw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=fu(t.element())/2;li(t.element(),"top",i-u+"px")},onLeft:Zw,onRight:nS,onUp:tS,onDown:eS,edgeActions:oS}),iS=gw(-1,!1),uS=gw(1,!1),aS=gw(-1,!0),cS=gw(1,!0),sS={"top-left":on.some(function(n,t){Px(n,Hx(px(t),hx(t)))}),top:on.some(function(n,t){Px(n,Hx(kx(t),hx(t)))}),"top-right":on.some(function(n,t){Px(n,Hx(yx(t),hx(t)))}),right:on.some(function(n,t){Px(n,Hx(yx(t),Ox(t)))}),"bottom-right":on.some(function(n,t){Px(n,Hx(yx(t),xx(t)))}),bottom:on.some(function(n,t){Px(n,Hx(kx(t),xx(t)))}),"bottom-left":on.some(function(n,t){Px(n,Hx(px(t),xx(t)))}),left:on.some(function(n,t){Px(n,Hx(px(t),Ox(t)))})},fS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=rw(n,t,e.left()),r=sw(n,t,e.top()),i=mw(o,r);return dw(n,i),i},setToMin:function(n,t){var e=mx(t),o=gx(t);dw(n,mw(e,o))},setToMax:function(n,t){var e=vx(t),o=bx(t);dw(n,mw(e,o))},getValueFromEvent:function(n){return dx(n)},setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=uw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=lw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=gu(t.element())/2,c=fu(t.element())/2;li(t.element(),"left",i-a+"px"),li(t.element(),"top",u-c+"px")},onLeft:iS,onRight:uS,onUp:aS,onDown:cS,edgeActions:sS}),lS=Ht().deviceType.isTouch(),dS=[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 Ee(n.mode.minX)}),ct("getInitialValue"),Zu("manager",Qw)],y:[St("minY",0),St("maxY",100),At("value",function(n){return Ee(n.mode.minY)}),ct("getInitialValue"),Zu("manager",rS)],xy:[St("minX",0),St("maxX",100),St("minY",0),St("maxY",100),At("value",function(n){return Ee({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),ct("getInitialValue"),Zu("manager",fS)]})),Is("sliderBehaviours",[dg,nl])].concat(lS?[]:[At("mouseIsDown",function(){return Ee(!1)})]),mS=Ht().deviceType.isTouch(),gS=_l({name:"Slider",configFields:dS,partFields:Uw,factory:function(i,n,t,e){function u(n){return Js(n,i,"thumb")}function a(n){return Js(n,i,"spectrum")}function o(n){return Ks(n,i,"left-edge")}function r(n){return Ks(n,i,"right-edge")}function c(n){return Ks(n,i,"top-edge")}function s(n){return Ks(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=[rr(eo(),function(n,t){i.onDragStart(n,u(n))}),rr(ro(),function(n,t){i.onDragEnd(n,u(n))})],p=[rr(uo(),function(n,t){t.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),rr(so(),function(n,t){i.onDragEnd(n,u(n))})],h=mS?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:Vs(i.sliderBehaviours,H([mS?[]:[dg.config({mode:"special",focusIn:function(n){return Ks(n,i,"spectrum").map(dg.focusIn).map(nn(!0))}})],[nl.config({store:{mode:"manual",getValue:function(n){return d.value.get()}}}),dc.config({channels:{"mouse.released":{onReceive:function(e,n){function t(){Ks(e,i,"thumb").each(function(n){var t=d.value.get();i.onChoose(e,n,t)})}if(mS)t();else{var o=i.mouseIsDown.get();i.mouseIsDown.set(!1),o&&t()}}}}})]])),events:tr([rr(Gw(),function(n,t){l(n,t.event().value())}),Ri(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)}}}),pS=function(n,t){var e=gS.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=gS.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return gS.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:ya([bg.config({})]),onChange:function(n,t,e){qt(n,Mw(),{value:e})}})},hS=[Is("formBehaviours",[nl])],vS=function(o,n,t){return{uid:o.uid,dom:o.dom,components:n,behaviours:Vs(o.formBehaviours,[nl.config({store:{mode:"manual",getValue:function(n){var t=Qs(n,o);return P(t,function(n,t){return n().bind(function(n){return function(n,t){return n.fold(function(){return an.error(t)},an.value)}(nd.getCurrent(n),"missing current")}).map(nl.getValue)})},setValue:function(e,n){Cn(n,function(t,n){Ks(e,o,n).each(function(n){nd.getCurrent(n).each(function(n){nl.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){return Ks(n,o,t).bind(nd.getCurrent)}}}},bS={getField:Ur(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var e,t=(e=[],{field:function(n,t){return e.push(n),Ws("form",pw(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=S(r,function(n){return wl({name:n,pname:pw(n)})});return rf("form",hS,i,vS,o)}},yS=Hr("valid-input"),xS=Hr("invalid-input"),wS=Hr("validating-input"),SS="colorcustom.rgb.",CS=function(d,m,g,p){function h(n,t,e,o,r){var i=d(SS+"range"),u=[by.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),by.parts().field({data:r,factory:xy,inputAttributes:N({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ya([function(t,o){return Uy.config({invalidClass:m("invalid"),notify:{onValidate:function(n){qt(n,wS,{type:t})},onValid:function(n){qt(n,yS,{type:t,value:nl.getValue(n)})},onInvalid:function(n){qt(n,xS,{type:t,value:nl.getValue(n)})}},validator:{validate:function(n){var t=nl.getValue(n),e=o(t)?an.value(!0):an.error(d("aria.input.invalid"));return Hy(e)},validateOnLoad:!1}})}(t,n),Xy.config({})]),onSetValue:function(n){Uy.isInvalid(n)&&Uy.run(n).get(Z)}})],a="hex"!==t?[by.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();nl.setValue(n,{red:e,green:o,blue:r})}function b(n,t){y.getOpt(n).each(function(n){li(n.element(),"background-color","#"+t.value())})}var y=bm({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return Al({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 Gh(e,t,n,1)})})}).each(function(n){var t=function(t,n){var e=Wh(n);return bS.getField(t,"hex").each(function(n){bg.isFocused(n)||nl.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=zh(t);i("hex",on.some(t));var o=qh(e);v(n,o),a(o),qt(n,_w(),{hex:e}),b(n,e)}(n,e.value())}function n(n){return{label:d(SS+n+".label"),description:d(SS+n+".description")}}var u={red:nn(Ee(on.some(255))),green:nn(Ee(on.some(255))),blue:nn(Ee(on.some(255))),hex:nn(Ee(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 Bn(bS.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",by.sketch(h(Xh,"red",c.label,c.description,255))),n.field("green",by.sketch(h(Xh,"green",s.label,s.description,255))),n.field("blue",by.sketch(h(Xh,"blue",f.label,f.description,255))),n.field("hex",by.sketch(h(Lh,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:ya([Uy.config({invalidClass:m("form-invalid")}),Jd("rgb-form-events",[rr(yS,e),rr(xS,t),rr(wS,t)])])}}),{apis:{updateHex:function(n,t){nl.setValue(n,{hex:t.value()}),function(n,t){var e=qh(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:{}})},kS=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=gS.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=gS.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}});return Al({factory:function(n){var t=nn({x:nn(0),y:nn(0)}),e=ya([nd.config({find:on.some}),bg.config({})]);return gS.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){qt(n,Fw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),Jh(rv()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();r(e,Jh(t))}(t,e)}},extraApis:{}})},OS=function(l,d){return Al({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=qh(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=CS(l,d,n.onValidHex,n.onInvalidHex),i=kS(l,d),s={paletteRgba:nn(Ee(rv()))},u=bm(i.sketch({})),f=bm(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),pS(l,d),f.asSpec()],behaviours:ya([Jd("colour-picker-events",[rr(Fw(),(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?fx(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,fx(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=fx(o.hue(),e.x(),100-e.y()),i=Yh(r),u=Wh(i);a(n,u,c)})),rr(Mw(),(o=[t,e],function(n,t){var e=function(n){var t=fx((100-n)/100*360,100,100),e=Yh(t);return Wh(e)}(t.event().value().y());a(n,e,o)}))]),nd.config({find:function(n){return f.getOpt(n)}}),dg.config({mode:"acyclic"})])}}})},TS=function(){return nd.config({find:on.some})},ES=function(n){return nd.config({find:n.getOpt})},DS=function(n){return nd.config({find:function(t){return wr(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},BS={"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"},AS=tinymce.util.Tools.resolve("tinymce.Resource"),_S=de([St("preprocess",l),St("postprocess",l)]),MS=function(r,n){var i=ot("RepresentingConfigs.memento processors",_S,n);return nl.config({store:{mode:"manual",getValue:function(n){var t=r.get(n),e=nl.getValue(t);return i.postprocess(e)},setValue:function(n,t){var e=i.preprocess(t),o=r.get(n);nl.setValue(o,e)}}})},FS=vw,IS=function(n){return bw(n,Dr,Br)},RS=function(n){return nl.config({store:{mode:"memory",initialValue:n}})},VS=Hr("alloy-fake-before-tabstop"),NS=Hr("alloy-fake-after-tabstop"),HS=function(n){return db(n,["."+VS,"."+NS].join(","),nn(!1))},PS=function(n,t){var e=t.element();ii(e,VS)?ww(n,!0):ii(e,NS)&&ww(n,!1)},zS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[xw([VS]),n,xw([NS])],behaviours:ya([DS(1)])}},LS=!(Ht().browser.isIE()||Ht().browser.isEdge());function jS(n,t){return GS(v.document.createElement("canvas"),n,t)}function US(n){var t=jS(n.width,n.height);return WS(t).drawImage(n,0,0),t}function WS(n){return n.getContext("2d")}function GS(n,t,e){return n.width=t,n.height=e,n}function XS(n){return n.naturalWidth||n.width}function YS(n){return n.naturalHeight||n.height}var qS,KS,JS=window.Promise?window.Promise:(qS=$S.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},KS=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},$S.prototype["catch"]=function(n){return this.then(null,n)},$S.prototype.then=function(e,o){var r=this;return new $S(function(n,t){ZS.call(r,new oC(e,o,n,t))})},$S.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),Sk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(Ek(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){Ek(n),Sk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){Sk(m).off()},Sk(m).on("mousedown touchstart",t)}function Bk(t){function u(n,s){c.getOpt(n).each(function(n){var e=l.get(),o=gu(n.element()),r=fu(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"};di(s,t),f.getOpt(n).each(function(n){di(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 _r(i,"src",t),function(e){return new Hp(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=iu({element:i});gg.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=Ck.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=gu(n.element()),e=fu(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=bm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=Ee(1),d=Ee(on.none()),m=Ee({x:0,y:0,w:1,h:1}),a=Ee({x:0,y:0,w:1,h:1}),n=Gb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ya([Jd("image-panel-crop-events",[Ri(function(n){c.getOpt(n).each(function(n){var t=n.element().dom(),e=Fk({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:ya([gg.config({}),Jd("image-panel-events",[Ri(function(n){e(n,t)})])])}),c=bm(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){var e=l.get(),o=0').appendTo(o),Ok.each(i,function(n){Sk("#"+a,o).append(''),components:[],behaviours:ya([LE.config({channel:$F,initialData:n,updateState:function(n,t){var e=S(t.buttons,function(n){var t=bm(function(n,t){return ZC(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 T(n,function(n){return n.name===e}).bind(function(n){return n.memento.getOpt(t)})}(n,e,t)},footerButtons:e})},renderComponents:L_})])}}function U_(n,t){return SM.parts().footer(j_(n,t))}function W_(t,e){if(t.getRoot().getSystem().isConnected()){var o=nd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return bS.getField(o,e).fold(function(){var n=t.getFooter();return LE.getState(n).get().bind(function(n){return n.lookupByName(o,e)})},function(n){return on.some(n)})}return on.none()}function G_(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=nl.getValue(t),o=P(a,function(n){return n.get()});return N(N({},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 LE.getState(e).get().map(function(n){return et(tt("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();nl.setValue(r,o),Cn(a,function(n,t){Tn(e,t)&&n.set(e[t])})})},disable:function(n){W_(u,n).each(kh.disable)},enable:function(n){W_(u,n).each(kh.enable)},focus:function(n){W_(u,n).each(bg.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){qt(n,dy,{message:t})})},unblock:function(){n(function(n){Yt(n,my)})},showTab:function(e){n(function(n){var t=u.getBody();LE.getState(t).get().exists(function(n){return n.isTabPanel()})&&nd.getCurrent(t).each(function(n){GF.showTab(n,e)})})},redial:function(e){n(function(n){var t=o(e);n.getSystem().broadcastOn([qF],t),n.getSystem().broadcastOn([KF],t.internalDialog),n.getSystem().broadcastOn([JF],t.internalDialog),n.getSystem().broadcastOn([$F],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){Yt(n,cy)})}};return c}function X_(n,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[n,t]}}function Y_(n,t){return SM.parts().close(Xg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:ya([Xy.config({})])}))}function q_(){return SM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function K_(n,t){return SM.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:sp("

"+t.translate(n)+"

")}]}]})}function J_(n){return SM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})}function $_(n,t){return[Gb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),Gb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]}function Q_(t){var n,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return SM.sketch({lazySink:t.lazySink,onEscape:function(n){return t.onEscape(n),on.some(!0)},useTabstopAt:function(n){return!HS(n)},dom:{tag:"div",classes:[e].concat(t.extraClasses),styles:N({position:"relative"},t.extraStyles)},components:g([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:sp('
'),components:[{dom:{tag:"div",classes:tI?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ya(g([bg.config({}),Jd("dialog-events",t.dialogEvents.concat([fr(lo(),function(n,t){dg.focusIn(n)})])),Jd("scroll-lock",[Ri(function(){ei(Mi(),i)}),Vi(function(){ri(Mi(),i)})])],t.extraBehaviours)),eventOrder:N((n={},n[To()]=["dialog-events"],n[No()]=["scroll-lock","dialog-events","alloy.base.behaviour"],n[Ho()]=["alloy.base.behaviour","dialog-events","scroll-lock"],n),t.eventOrder)})}function Z_(n){return Xg.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){Yt(n,sy)}})}function nM(n,t,e){function o(n){return[Ti(e.translate(n.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:N({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:ya([LE.config({channel:KF,renderComponents:o})])}}function tM(){return{dom:sp('
')}}function eM(n,t){return function(n,t){var e=SM.parts().title(nM(n,on.none(),t)),o=SM.parts().draghandle(tM()),r=SM.parts().close(Z_(t)),i=[e].concat(n.draggable?[o]:[]).concat([r]);return Gb.sketch({dom:sp('
'),components:i})}({title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},t.shared.providers)}function oM(n,t){return{onClose:function(){return t.closeWindow()},onBlock:function(e){SM.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:sp('
')}]}})},onUnblock:function(){SM.setIdle(n())}}}function rM(n,t,e,o){var r;return au(Q_(N(N({},n),{lazySink:o.shared.getSink,extraBehaviours:g([LE.config({channel:qF,updateState:function(n,t){return on.some(t)},initialData:t}),RS({})],n.extraBehaviours),onEscape:function(n){Yt(n,sy)},dialogEvents:e,eventOrder:(r={},r[Oo()]=["reflecting","receiving"],r[No()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[Ho()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))}function iM(n){return S(n,function(n){return"menu"===n.type?function(n){var t=S(n.items,function(n){var t=Ee(!1);return N(N({},n),{storage:t})});return N(N({},n),{items:t})}(n):n})}function uM(n){return O(n,function(n,t){return"menu"!==t.type?n:O(t.items,function(n,t){return n[t.name]=t.storage,n},n)},{})}function aM(n,t,e){var o=eM(n.internalDialog.title,e),r=function(n,t){var e=P_(n,on.none(),t,!1);return SM.parts().body(e)}({body:n.internalDialog.body},e),i=iM(n.internalDialog.buttons),u=uM(i),a=U_({buttons:i},e),c=nI(function(){return d},oM(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=rM(f,n,c,e),d=G_({getRoot:function(){return l},getBody:function(){return SM.getBody(l)},getFooter:function(){return SM.getFooter(l)},getFormWrapper:function(){var n=SM.getBody(l);return nd.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}function cM(n,t,e,o){var r,i,u=Hr("dialog-label"),a=Hr("dialog-content"),c=bm(function(n,t,e){return Gb.sketch({dom:sp('
'),components:[nM(n,on.some(t),e),tM(),Z_(e)],containerBehaviours:ya([S_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return Tu(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=bm(function(n,t,e,o){return P_(n,on.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=iM(n.internalDialog.buttons),l=uM(f),d=bm(function(n,t){return j_(n,t)}({buttons:f},e)),m=nI(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}}),g=au({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[Oo()]=[LE.name(),dc.name()],i[To()]=["execute-on-form"],i[No()]=["reflecting","execute-on-form"],i),behaviours:ya([dg.config({mode:"cyclic",onEscape:function(n){return Yt(n,cy),on.some(!0)},useTabstopAt:function(n){return!HS(n)&&("button"!==Ko(n)||"disabled"!==Mr(n,"disabled"))}}),LE.config({channel:qF,updateState:function(n,t){return on.some(t)},initialData:n}),bg.config({}),Jd("execute-on-form",m.concat([fr(lo(),function(n,t){dg.focusIn(n)})])),RS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=G_({getRoot:function(){return g},getFooter:function(){return d.get(g)},getBody:function(){return s.get(g)},getFormWrapper:function(){var n=s.get(g);return nd.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}function sM(n){return sn(n)&&-1!==oI.indexOf(n.mceAction)}function fM(e,n,o,t){var r,i=eM(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:[zS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:ya([Xy.config({}),bg.config({})])})]}],behaviours:ya([dg.config({mode:"acyclic",useTabstopAt:b(HS)})])};return SM.parts().body(t)}(e),a=e.buttons.bind(function(n){return 0===n.length?on.none():on.some(U_({buttons:n},t))}),c=ZF(function(){return h},oM(function(){return p},n)),s=N(N({},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 eI(e.url,{base_uri:new eI(v.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=Ee(on.none()),g=[Jd("messages",[Ri(function(){var n=fb(Be.fromDom(v.window),"message",function(n){if(l.isSameOrigin(new eI(n.raw().origin))){var t=n.raw().data;sM(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!sM(n)&&sn(n)&&Tn(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(on.some(n))}),Vi(function(){m.get().each(function(n){return n.unbind()})})]),dc.config({channels:(r={},r[QF]={onReceive:function(n,t){Ou(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=rM({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){qt(n,dy,{message:t})})},unblock:function(){n(function(n){Yt(n,my)})},close:function(){n(function(n){Yt(n,cy)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([QF],t)})}}}(p);return{dialog:p,instanceApi:h}}var lM,dM,mM,gM,pM,hM=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ya([dg.config({mode:"flow",selector:"div[role=button]"}),Xy.config({}),gg.config({}),Jd("elementPathEvents",[Ri(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return dg.focusIn(e)}),i.on("NodeChange",function(n){var t=function(n){for(var t=[],e=n.length;0