/** * 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.0.11 (2019-07-04) */ !function(H){"use strict";var tt=function(){},p=function(e,o){return function(){for(var t=[],n=0;n "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return Zt.objOf(F(a,function(t){return t.fold(function(t,n,e,o){return tn.field(t,e,o)},function(t,n){return tn.state(t)})}))}}},hn=function(r){return{extract:function(e,o,t){var n=F(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return Qt(n)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return Zt.arrOf(r)}}},vn=function(a,c){return{extract:function(e,o,r){var t,n,i=ut(r),u=(t=e,n=i,hn(mn(a)).extract(t,d,n));return Xt(u,function(t){var n=F(t,function(t){return sn.field(t,t,Ct(),c)});return pn(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return Zt.setOf(a,c)}}},bn=nt(mn(Ut)),yn=p(hn,pn),xn=sn.state,wn=sn.field,Sn=function(e,n,o,r,i){return Ft(r,i).fold(function(){return t=r,n=i,cn(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+an(t)});var t,n},function(t){return pn(t).extract(e.concat(["branch: "+i]),n,o)})},Cn=function(r,i){return{extract:function(n,e,o){return Ft(o,r).fold(function(){return t=r,cn(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return Sn(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+ut(i)},toDsl:function(){return Zt.choiceOf(r,i)}}},kn=mn(Ut),On=function(n){return mn(function(t){return n(t).fold(Gt,Ut)})},En=function(n,t){return vn(function(t){return Lt(n(t))},t)},Tn=function(t,n,e){return jt((o=t,r=d,i=e,u=n.extract([o],r,i),Kt(u,function(t){return{input:i,errors:t}})));var o,r,i,u},Bn=function(t){return t.fold(function(t){throw new Error(Dn(t))},d)},An=function(t,n,e){return Bn(Tn(t,n,e))},Dn=function(t){return"Errors: \n"+(n=t.errors,e=10 ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+an(t.input);var n,e},_n=function(t,n){return Cn(t,n)},Mn=nt(kn),Fn=function(e,o){return mn(function(t){var n=typeof t;return e(t)?Ut(t):Gt("Expected type: "+o+" but got: "+n)})},In=Fn(U,"number"),Rn=Fn(L,"string"),Vn=Fn(O,"boolean"),Nn=Fn(E,"function"),Hn=function(n){return On(function(t){return D(n,t)?z.value(t):z.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Pn=function(t){return wn(t,t,Ct(),bn())},zn=function(t,n){return wn(t,t,Ct(),n)},Ln=function(t){return zn(t,Rn)},jn=function(t,n){return wn(t,t,Ct(),Hn(n))},Un=function(t){return zn(t,Nn)},Wn=function(t,n){return wn(t,t,Ct(),pn(n))},Gn=function(t,n){return wn(t,t,Ct(),yn(n))},Xn=function(t,n){return wn(t,t,Ct(),hn(n))},Yn=function(t){return wn(t,t,kt(),bn())},qn=function(t,n){return wn(t,t,kt(),n)},Kn=function(t){return qn(t,In)},$n=function(t){return qn(t,Rn)},Jn=function(t){return qn(t,Nn)},Qn=function(t,n){return qn(t,pn(n))},Zn=function(t,n){return wn(t,t,St(n),bn())},te=function(t,n,e){return wn(t,t,St(n),e)},ne=function(t,n){return te(t,n,In)},ee=function(t,n){return te(t,n,Rn)},oe=function(t,n,e){return te(t,n,Hn(e))},re=function(t,n){return te(t,n,Vn)},ie=function(t,n){return te(t,n,Nn)},ue=function(t,n,e){return te(t,n,pn(e))},ae=function(t,n){return xn(t,n)},ce=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return ce(e())}}},se=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:nt(t)}},fe={fromHtml:function(t,n){var e=(n||H.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1 "):o[0].name();return It(r,{handler:n,purpose:nt(e)})})});return Vt(n,{})},Di=function(t){return Tn("custom.definition",pn([wn("dom","dom",Ct(),pn([Pn("tag"),Zn("styles",{}),Zn("classes",[]),Zn("attributes",{}),Yn("value"),Yn("innerHtml")])),Pn("components"),Pn("uid"),Zn("events",{}),Zn("apis",{}),wn("eventOrder","eventOrder",(n={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},wt.mergeWithThunk(nt(n))),Mn()),Yn("domModification")]),t);var n},_i=function(t,n){var e=qr(t,n);return e===undefined||""===e?[]:e.split(" ")},Mi=function(t){return t.dom().classList!==undefined},Fi=function(t,n){return r=n,i=_i(e=t,o="class").concat([r]),Xr(e,o,i.join(" ")),!0;var e,o,r,i},Ii=function(t,n){return r=n,0<(i=I(_i(e=t,o="class"),function(t){return t!==r})).length?Xr(e,o,i.join(" ")):$r(e,o),!1;var e,o,r,i},Ri=function(t,n){Mi(t)?t.dom().classList.add(n):Fi(t,n)},Vi=function(t){0===(Mi(t)?t.dom().classList:_i(t,"class")).length&&$r(t,"class")},Ni=function(t,n){Mi(t)?t.dom().classList.remove(n):Ii(t,n);Vi(t)},Hi=function(t,n){return Mi(t)&&t.dom().classList.contains(n)},Pi=function(n,t){W(t,function(t){Ri(n,t)})},zi=function(n,t){W(t,function(t){Ni(n,t)})},Li=function(t){return t.style!==undefined&&E(t.style.getPropertyValue)},ji=function(t,n,e){if(!L(e))throw H.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Li(t)&&t.style.setProperty(n,e)},Ui=function(t,n){Li(t)&&t.style.removeProperty(n)},Wi=function(t,n,e){var o=t.dom();ji(o,n,e)},Gi=function(t,n){var e=t.dom();ct(n,function(t,n){ji(e,n,t)})},Xi=function(t,n){var e=t.dom(),o=H.window.getComputedStyle(e).getPropertyValue(n),r=""!==o||or(t)?o:Yi(e,n);return null===r?undefined:r},Yi=function(t,n){return Li(t)?t.style.getPropertyValue(n):""},qi=function(t,n){var e=t.dom(),o=Yi(e,n);return et.from(o).filter(function(t){return 0=t.left&&n<=t.right&&e>=t.top&&e<=t.bottom};var Fc=function B_(e,o){var r=function(t){return e(t)?et.from(t.dom().nodeValue):et.none()},t=Pe.detect().browser,n=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(n){return et.none()}}:r;return{get:function(t){if(!e(t))throw new Error("Can only get "+o+" value of a "+o+" node");return n(t).getOr("")},getOption:n,set:function(t,n){if(!e(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=n}}}(nr,"text"),Ic=function(t){return Fc.get(t)},Rc=function(t){return Fc.getOption(t)},Vc=function(e,o,t,n,r){var i=function(t){var n=e.dom().createRange();return n.setStart(o.dom(),t),n.collapse(!0),n},u=Ic(o).length,a=function(t,n,e,o,r){if(0===r)return 0;if(n===o)return r-1;for(var i=o,u=1;u"}),Mn()),xf=ae("schema",function(){return[Yn("preprocess")]}),wf=Zn("defaults",nt({})),Sf=Zn("overrides",nt({})),Cf=pn([hf,vf,bf,yf,wf,Sf]),kf=pn([hf,vf,bf,wf,Sf]),Of=pn([hf,vf,bf,yf,wf,Sf]),Ef=pn([hf,xf,bf,Pn("unit"),yf,wf,Sf]),Tf=function(t){return t.fold(et.some,et.none,et.some,et.some)},Bf=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Af=function(e,o){return function(t){var n=An("Converting part type",o,t);return e(n)}},Df=Af(pf.required,Cf),_f=Af(pf.external,kf),Mf=Af(pf.optional,Of),Ff=Af(pf.group,Ef),If=nt("entirety"),Rf=/* */Object.freeze({required:Df,external:_f,optional:Mf,group:Ff,asNamedPart:Tf,name:Bf,asCommon:function(t){return t.fold(d,d,d,d)},original:If}),Vf=function(t,n,e,o){return bt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Nf=function(r,t){var n={};return W(t,function(t){Tf(t).each(function(e){var o=Hf(r,e.pname);n[e.name]=function(t){var n=An("Part: "+e.name+" in "+r,pn(e.schema),t);return P({},o,{config:t,validated:n})}})}),n},Hf=function(t,n){return{uiType:gf(),owner:t,name:n}},Pf=function(t,n,e){return{uiType:gf(),owner:t,name:n,config:e,validated:{}}},zf=function(t){return K(t,function(t){return t.fold(et.none,et.some,et.none,et.none).map(function(t){return Wn(t.name,t.schema.concat([Nu(If())]))}).toArray()})},Lf=function(t){return F(t,Bf)},jf=function(t,n,e){return o=n,i={},r={},W(e,function(t){t.fold(function(o){i[o.pname]=df(!0,function(t,n,e){return o.factory.sketch(Vf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=nt(t.factory.sketch(Vf(o,t,n[If()]),n))},function(o){i[o.pname]=df(!1,function(t,n,e){return o.factory.sketch(Vf(t,o,n,e))})},function(r){i[r.pname]=mf(!0,function(n,t,e){var o=n[r.name];return F(o,function(t){return r.factory.sketch(bt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:nt(i),externals:nt(r)};var o,i,r},Uf=function(t,n,e){return lf(et.some(t),n,n.components,e)},Wf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},Gf=function(t,n,e){return Wf(t,n,e).getOrDie("Could not find part: "+e)},Xf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return W(e,function(t){o[t]=i.getByUid(r[t])}),st(o,nt)},Yf=function(t,n){var e=t.getSystem();return st(n.partUids,function(t,n){return nt(e.getByUid(t))})},qf=function(t){return ut(t.partUids)},Kf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return W(e,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),st(o,nt)},$f=function(n,t){var e=Lf(t);return Rt(F(e,function(t){return{key:t,value:n+"-"+t}}))},Jf=function(n){return wn("partUids","partUids",Et(function(t){return $f(t.uid,n)}),Mn())},Qf=/* */Object.freeze({generate:Nf,generateOne:Pf,schemas:zf,names:Lf,substitutes:jf,components:Uf,defaultUids:$f,defaultUidsSchema:Jf,getAllParts:Yf,getAllPartNames:qf,getPart:Wf,getPartOrDie:Gf,getParts:Xf,getPartsOrDie:Kf}),Zf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Wn("parts",i)]:[]).concat([Pn("uid"),Zn("dom",{}),Zn("components",[]),Nu("originalSpec"),Zn("debug.sketcher",{})]).concat(u));return An(t+" [SpecSchema]",gn(a.concat(n)),e)},tl=function(t,n,e,o,r){var i=nl(r),u=zf(e),a=Jf(e),c=Zf(t,n,i,u,[a]),s=jf(0,c,e);return o(c,Uf(t,c,s.internals()),i,s.externals())},nl=function(t){return t.hasOwnProperty("uid")?t:P({},t,{uid:fi("uid")})};var el,ol,rl=gn([Pn("name"),Pn("factory"),Pn("configFields"),Zn("apis",{}),Zn("extraApis",{})]),il=gn([Pn("name"),Pn("factory"),Pn("configFields"),Pn("partFields"),Zn("apis",{}),Zn("extraApis",{})]),ul=function(t){var i=An("Sketcher for "+t.name,rl,t),n=st(i.apis,bi),e=st(i.extraApis,function(t,n){return pi(t,n)});return P({name:nt(i.name),partFields:nt([]),configFields:nt(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=nl(t),o(Zf(n,e,r,[],[]),r);var n,e,o,r}},n,e)},al=function(t){var n=An("Sketcher for "+t.name,il,t),e=Nf(n.name,n.partFields),o=st(n.apis,bi),r=st(n.extraApis,function(t,n){return pi(t,n)});return P({name:nt(n.name),partFields:nt(n.partFields),configFields:nt(n.configFields),sketch:function(t){return tl(n.name,n.configFields,n.partFields,n.factory,t)},parts:nt(e)},o,r)},cl=function(t){return"input"===Qo(t)&&"radio"!==qr(t,"type")||"textarea"===Qo(t)},sl=/* */Object.freeze({getCurrent:function(t,n,e){return n.find(t)}}),fl=[Pn("find")],ll=Xu({fields:fl,name:"composing",apis:sl}),dl=function(t,n,e,o){var r=t+n;return o',e.getDoc());return Hr(t,fe.fromDom(n.extractContents())),n.insertNode(t.dom()),_r(t).each(function(t){return t.dom().normalize()}),Uc(t).map(function(t){var n;e.selection.setCursorLocation(t.dom(),"img"===Qo(n=t)?1:Rc(n).fold(function(){return Fr(n).length},function(t){return t.length}))}),t})},Hg=function(t){return mu(t,"[data-mce-autocompleter]")},Pg=/[\u00a0 \t\r\n]/,zg=function(t,n){return t.toString().substring(n.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Lg=function(t,u,a,c){if(void 0===c&&(c=0),!(n=u).collapsed||3!==n.startContainer.nodeType)return et.none();var n;return Vg(t,u.startContainer,u.startOffset,function(e,o,r,t){var i=t.getOr(r.length);return function(t,n,e,o){var r;for(r=n-1;0<=r;r--){var i=t.charAt(r);if(Pg.test(i))return et.none();if(i===e)break}return-1===r||n-r=t.minChars&&t.matches.getOrThunk(function(){return e=n.dom,o=function(t,n,e,o){var r=o.getOr(e.length);return 0===r?t.kontinue():t.finish(/\s/.test(e.charAt(r-1)))},function(t){var n=Yg(t.startContainer,t.startOffset);return Vg(e,n.element,n.offset,o).fold(nt(!0),nt(!0),d)};var e,o})(e.range,r,e.text)});if(0===i.length)return et.none();var u=Wg.all(F(i,function(n){return n.fetch(e.text,n.maxResults).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return et.some({lookupData:u,context:e})},$g=pn([ae("type",function(){return"autocompleteitem"}),ae("active",function(){return!1}),ae("disabled",function(){return!1}),Zn("meta",{}),Ln("value"),$n("text"),$n("icon")]),Jg=pn([Ln("type"),Ln("ch"),ne("minChars",1),Zn("columns",1),ne("maxResults",10),Jn("matches"),Un("fetch"),Un("onAction")]),Qg=function(t){var n,e,o=t.ui.registry.getAll().popups,r=st(o,function(t){return(n=t,Tn("Autocompleter",Jg,n)).fold(function(t){throw new Error(Dn(t))},function(t){return t});var n}),i=(n=lt(r,function(t){return t.ch}),e={},W(n,function(t){e[t]={}}),ut(e)),u=dt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return I(u,function(t){return t.ch===n})}}},Zg=[re("disabled",!1),$n("text"),$n("shortcut"),wn("value","value",Ot(function(){return oi("menuitem-value")}),Mn()),Zn("meta",{})],tp=pn([Ln("type"),ie("onSetup",function(){return tt}),ie("onAction",tt),$n("icon")].concat(Zg)),np=pn([Ln("type"),Un("getSubmenuItems"),ie("onSetup",function(){return tt}),$n("icon")].concat(Zg)),ep=pn([Ln("type"),re("active",!1),ie("onSetup",function(){return tt}),Un("onAction")].concat(Zg)),op=pn([Ln("type"),re("active",!1),$n("icon")].concat(Zg)),rp=pn([Ln("type"),$n("text")]),ip=pn([Ln("type"),jn("fancytype",["inserttable","colorswatch"]),ie("onAction",tt)]),up=function(t,o,n){var r=$c(t.element(),"."+n);if(0o}).getOr(r.length);return et.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return et.none()},ap=function(t,n){return Wu([rg(t,n)])},cp=function(t){return ap(oi("unnamed-events"),t)},sp=[Pn("lazySink"),Pn("tooltipDom"),Zn("exclusive",!0),Zn("tooltipComponents",[]),Zn("delay",300),oe("mode","normal",["normal","follow-highlight"]),Zn("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:nt([sc,cc,rc,uc,ic,ac]),onRtl:nt([sc,cc,rc,uc,ic,ac])}}}),Mu("onHide"),Mu("onShow")],fp=/* */Object.freeze({init:function(){var e=ce(et.none()),n=ce(et.none()),o=function(){e.get().each(function(t){H.clearTimeout(t)})},t=nt("not-implemented");return xi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(et.some(t))},clearTooltip:function(){n.set(et.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(et.some(H.setTimeout(function(){t()},n)))},readState:t})}}),lp=oi("tooltip.exclusive"),dp=oi("tooltip.show"),mp=oi("tooltip.hide"),gp=function(t,n,e){t.getSystem().broadcastOn([lp],{})},pp=/* */Object.freeze({hideAllExclusive:gp,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&wm.set(t,o)})}}),hp=Xu({fields:sp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Vs(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return fr(q([[mr(dp,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){gp(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:fr("normal"===o.mode?[mr(io(),function(t){zo(n,dp)}),mr(oo(),function(t){zo(n,mp)})]:[]),behaviours:Wu([wm.config({})])});r.setTooltip(e),Fs(t,e),o.onShow(n,e),Ds.position(t,o.anchor(n),e)}}(t)},o.delay)}),mr(mp,function(t){r.resetTimer(function(){e(t)},o.delay)}),mr(xo(),function(t,n){D(n.channels(),lp)&&e(t)}),Sr(function(t){e(t)})],"normal"===o.mode?[mr(uo(),function(t){zo(t,dp)}),mr(bo(),function(t){zo(t,mp)}),mr(io(),function(t){zo(t,dp)}),mr(oo(),function(t){zo(t,mp)})]:[mr(Ho(),function(t,n){zo(t,dp)}),mr(Po(),function(t){zo(t,mp)})]]))}}),state:fp,apis:pp}),vp=function(t){var n,e,o,r=fe.fromHtml(t),i=Fr(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],V(e,function(t,n){var e;return"class"===n.name?t:P({},t,((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:Ur(r)};return P({tag:Qo(r),classes:a,attributes:u},c)},bp=tinymce.util.Tools.resolve("tinymce.util.I18n"),yp="tox-menu-nav__js",xp="tox-collection__item",wp="tox-swatch",Sp={normal:yp,color:wp},Cp="tox-collection__item--enabled",kp="tox-collection__item-icon",Op="tox-collection__item-label",Ep="tox-collection__item--active",Tp=function(t){return Ft(Sp,t).getOr(yp)},Bp=tinymce.util.Tools.resolve("tinymce.Env"),Ap=function(t){var e=Bp.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),o=F(n,function(t){var n=t.toLowerCase().trim();return gt(e,n)?e[n]:t});return Bp.mac?o.join(""):o.join("+")},Dp=function(t){return{dom:{tag:"div",classes:[kp],innerHtml:t}}},_p=function(t){return{dom:{tag:"div",classes:[Op]},components:[uu(bp.translate(t))]}},Mp=function(t,n){return{dom:{tag:"div",classes:[Op]},components:[{dom:{tag:t.tag,attributes:{style:t.styleAttr}},components:[uu(bp.translate(n))]}]}},Fp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Ap(t)}}},Ip=function(t){return{dom:{tag:"div",classes:[kp,"tox-collection__item-checkmark"],innerHtml:kg("checkmark",t)}}},Rp=function(t,n,e,o,r){var i=e?t.checkMark.orThunk(function(){return n.or(et.some("")).map(Dp)}):et.none(),u=t.ariaLabel.map(function(t){return{attributes:{title:bp.translate(t)}}}).getOr({});return{dom:yt({tag:"div",classes:[yp,xp].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,t.htmlContent.fold(function(){return t.textContent.map(o)},function(t){return et.some({dom:{tag:"div",classes:[Op],innerHtml:t}})}),t.shortcutContent.map(Fp),t.caret]}},Vp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Np=["list-bull-circle","list-bull-default","list-bull-square"],Hp=function(t,r,n,i){void 0===i&&(i=et.none());var e,o,u,a,c,s,f,l=bp.isRtl()&&t.iconContent.exists(function(t){return D(Np,t)}),d=(e=t.iconContent,e.map(function(t){return bp.isRtl()&&D(Vp,t)?t+"-rtl":t})).map(function(t){return n=t,e=r.icons,o=i,et.from(e()[n]).or(o).getOrThunk(function(){return Cg(e)});var n,e,o}),m=et.from(t.meta).fold(function(){return _p},function(t){return gt(t,"style")?g(Mp,t.style):_p});return"color"===t.presets?(o=t.ariaLabel,u=t.value,a=r,{dom:(c=wp,s=d.getOr(""),f=o.map(function(t){return' title="'+a.translate(t)+'"'}).getOr(""),vp("custom"===u?'":"remove"===u?'
"+s+"
":'
")),optComponents:[]}):Rp(t,d,n,m,l)},Pp=["input","button","textarea"],zp=function(t,n,e){n.disabled&&Xp(t,n)},Lp=function(t){return D(Pp,Qo(t.element()))},jp=function(t){Xr(t.element(),"disabled","disabled")},Up=function(t){$r(t.element(),"disabled")},Wp=function(t){Xr(t.element(),"aria-disabled","true")},Gp=function(t){Xr(t.element(),"aria-disabled","false")},Xp=function(n,t,e){t.disableClass.each(function(t){Ri(n.element(),t)}),(Lp(n)?jp:Wp)(n)},Yp=function(n,t,e){t.disableClass.each(function(t){Ni(n.element(),t)}),(Lp(n)?Up:Gp)(n)},qp=function(t){return Lp(t)?Kr(t.element(),"disabled"):"true"===qr(t.element(),"aria-disabled")},Kp=/* */Object.freeze({enable:Yp,disable:Xp,isDisabled:qp,onLoad:zp,set:function(t,n,e,o){(o?Xp:Yp)(t,n,e)}}),$p=/* */Object.freeze({exhibit:function(t,n,e){return Si({classes:n.disabled?n.disableClass.map(Z).getOr([]):[]})},events:function(t,n){return fr([lr(wo(),function(t,n){return qp(t)}),Pu(t,n,zp)])}}),Jp=[Zn("disabled",!1),Yn("disableClass")],Qp=Xu({fields:Jp,name:"disabling",active:$p,apis:Kp}),Zp=function(t){return Qp.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},th=function(t){return Qp.config({disabled:t})},nh=function(t){return Qp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},eh=function(t,n){var e=t.getApi(n);return function(t){t(e)}},oh=function(e,o){return wr(function(t){eh(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},rh=function(n,e){return Sr(function(t){return eh(n,t)(e.get())})};(Dg=Ag||(Ag={}))[Dg.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Dg[Dg.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var ih=Ag,uh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},ah=function(t){return K(t,function(t){return t.toArray()})},ch=function(t,n,e){var o,r,i=ce(tt);return{type:"item",dom:n.dom,components:ah(n.optComponents),data:t.data,eventOrder:uh,hasSubmenu:t.triggersSubmenu,itemBehaviours:Wu([rg("item-events",[(o=t,r=e,kr(function(t,n){eh(o,t)(o.onAction),o.triggersSubmenu||r!==ih.CLOSE_ON_EXECUTE||(zo(t,Eo()),n.stop())})),oh(t,i),rh(t,i)]),Zp(t.disabled),wm.config({})].concat(t.itemBehaviours))}},sh=function(t){return{value:t.value,meta:yt({text:t.text.getOr("")},t.meta)}},fh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),lh=function(t,n){var e,o=bp.translate(t),r=(e=o,fh.DOM.encode(e));if(0'+t+""})}return r},dh=nt(Nf("item-widget",ag())),mh=oi("cell-over"),gh=oi("cell-execute"),ph=function(n,e,t){var o,r=function(t){return Lo(t,gh,{row:n,col:e})};return su({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:Wu([rg("insert-table-picker-cell",[mr(io(),Pm.focus),mr(wo(),r),mr(ko(),r)]),Jm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Pm.config({onFocus:function(t){return Lo(t,mh,{row:n,col:e})}})])})};var hh=function(t){return{value:nt(t)}},vh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,bh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,yh=function(t){return vh.test(t)||bh.test(t)},xh=function(t){var n,e=(n=t.value().replace(vh,function(t,n,e,o){return n+n+e+e+o+o}),{value:nt(n)}),o=bh.exec(e.value());return null===o?["FFFFFF","FF","FF","FF"]:o},wh=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},Sh=function(t){var n=wh(t.red())+wh(t.green())+wh(t.blue());return hh(n)},Ch=Math.min,kh=Math.max,Oh=Math.round,Eh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Th=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Bh=function(t,n,e,o){return{red:nt(t),green:nt(n),blue:nt(e),alpha:nt(o)}},Ah=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},Dh=function(t){var n,e,o,r=(t.hue()||0)%360,i=t.saturation()/100,u=t.value()/100;if(i=kh(0,Ch(i,1)),u=kh(0,Ch(u,1)),0===i)return n=e=o=Oh(255*u),Bh(n,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:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=Oh(255*(n+f)),e=Oh(255*(e+f)),o=Oh(255*(o+f)),Bh(n,e,o,1)},_h=function(t){var n=xh(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return Bh(e,o,r,1)},Mh=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return Bh(r,i,u,a)},Fh=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},Ih=nt(Bh(255,0,0,1)),Rh=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Vh="tinymce-custom-colors";var Nh="choiceitem",Hh=[{type:Nh,text:"Light Green",value:"#BFEDD2"},{type:Nh,text:"Light Yellow",value:"#FBEEB8"},{type:Nh,text:"Light Red",value:"#F8CAC6"},{type:Nh,text:"Light Purple",value:"#ECCAFA"},{type:Nh,text:"Light Blue",value:"#C2E0F4"},{type:Nh,text:"Green",value:"#2DC26B"},{type:Nh,text:"Yellow",value:"#F1C40F"},{type:Nh,text:"Red",value:"#E03E2D"},{type:Nh,text:"Purple",value:"#B96AD9"},{type:Nh,text:"Blue",value:"#3598DB"},{type:Nh,text:"Dark Turquoise",value:"#169179"},{type:Nh,text:"Orange",value:"#E67E23"},{type:Nh,text:"Dark Red",value:"#BA372A"},{type:Nh,text:"Dark Purple",value:"#843FA1"},{type:Nh,text:"Dark Blue",value:"#236FA1"},{type:Nh,text:"Light Gray",value:"#ECF0F1"},{type:Nh,text:"Medium Gray",value:"#CED4D9"},{type:Nh,text:"Gray",value:"#95A5A6"},{type:Nh,text:"Dark Gray",value:"#7E8C8D"},{type:Nh,text:"Navy Blue",value:"#34495E"},{type:Nh,text:"Black",value:"#000000"},{type:Nh,text:"White",value:"#ffffff"}],Ph=function A_(r){void 0===r&&(r=10);var t,n=Rh.getItem(Vh),e=L(n)?JSON.parse(n):[],i=r-(t=e).length<0?t.slice(0,r):t,u=function(t){i.splice(t,1)};return{add:function(t){var n,e,o;(n=i,e=t,o=A(n,e),-1===o?et.none():et.some(o)).each(u),i.unshift(t),i.length>r&&i.pop(),Rh.setItem(Vh,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),zh=function(t){var n=[],u=H.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(t,n){var e=n/255;return("0"+Math.round(t*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=t,a.fillRect(0,0,1,1);var n=a.getImageData(0,0,1,1).data,e=n[0],o=n[1],r=n[2],i=n[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;o=r.minChars){var o=ll.getCurrent(e).bind(function(t){return kl.getHighlighted(t).map(Im.getValue)});r.previewing.set(!0),Xb(r,u(t),t,e,i,function(t){ll.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&kl.highlightFirst(t)},function(n){kl.highlightBy(t,function(t){return Im.getValue(t).value===n.value}),kl.getHighlighted(t).orThunk(function(){return kl.highlightFirst(t),et.none()})})})},gb.HighlightFirst).get(tt)}},cancelEvent:To()}),hm.config({mode:"special",onDown:function(t,n){return e(t,n,kl.highlightFirst),et.some(!0)},onEscape:function(t){var n=Fb.getCoupled(t,"sandbox");return Ks.isOpen(n)?(Ks.close(n),et.some(!0)):et.none()},onUp:function(t,n){return e(t,n,kl.highlightLast),et.some(!0)},onEnter:function(n){var t=Fb.getCoupled(n,"sandbox"),e=Ks.isOpen(t);if(e&&!r.previewing.get())return ll.getCurrent(t).bind(function(t){return kl.getHighlighted(t)}).map(function(t){return Lo(n,iy(),{item:t}),!0});var o=Im.getValue(n);return zo(n,To()),r.onExecute(t,n,o),e&&Ks.close(t),et.some(!0)}}),Jm.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Fb.config({others:{sandbox:function(t){return Jb(r,t,{onOpen:function(){return Jm.on(t)},onClose:function(){return Jm.off(t)}})}}}),rg("typeaheadevents",[kr(function(t){var n=tt;qb(r,u(t),t,i,n,gb.HighlightFirst).get(tt)}),mr(iy(),function(t,n){var e=Fb.getCoupled(t,"sandbox");Qb(r.model,t,n.event().item()),zo(t,To()),r.onItemExecute(t,e,n.event().item(),Im.getValue(t)),Ks.close(e),ty(t)})].concat(r.dismissOnBlur?[mr(bo(),function(t){var n=Fb.getCoupled(t,"sandbox");Nl(n.element()).isNone()&&Ks.close(n)})]:[]))];return{uid:r.uid,dom:ry(bt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:P({},o,of(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),fy=function(t,n,e){var o=dy(t,n,e);return Db.sketch(o)},ly=function(t,n){return fy(t,n,[])},dy=function(t,n,e){return{dom:my(e),components:t.toArray().concat([n])}},my=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},gy=function(t,n){return Db.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},py=function(t){return"separator"===t.type},hy={type:"separator"},vy=function(t,e){var n=V(t,function(t,n){return L(n)?""===n?t:"|"===n?0"},Rw=function(o,t,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:of(o.formBehaviours,[Im.config({store:{mode:"manual",getValue:function(t){var n=Yf(t,o);return st(n,function(t,n){return t().bind(function(t){var n,e=ll.getCurrent(t);return n="missing current",e.fold(function(){return z.error(n)},z.value)}).map(Im.getValue)})},setValue:function(e,t){ct(t,function(n,t){Wf(e,o,t).each(function(t){ll.getCurrent(t).each(function(t){Im.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Wf(t,o,n).bind(ll.getCurrent)}}}},Vw={getField:bi(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),Pf("form",Iw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=F(r,function(t){return Df({name:t,pname:Iw(t)})});return tl("form",Fw,i,Rw,o)}},Nw=oi("valid-input"),Hw=oi("invalid-input"),Pw=oi("validating-input"),zw="colorcustom.rgb.",Lw=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(zw+"range"),c=[Db.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Db.parts().field({data:r,factory:wy,inputAttributes:P({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:Wu([(i=n,u=t,_y.config({invalidClass:m("invalid"),notify:{onValidate:function(t){Lo(t,Pw,{type:i})},onValid:function(t){Lo(t,Nw,{type:i,value:Im.getValue(t)})},onInvalid:function(t){Lo(t,Hw,{type:i,value:Im.getValue(t)})}},validator:{validate:function(t){var n=Im.getValue(t),e=u(n)?z.value(!0):z.error(d("aria.input.invalid"));return jb.pure(e)},validateOnLoad:!1}})),Iy.config({})]),onSetValue:function(t){_y.isInvalid(t)&&_y.run(t).get(tt)}})],s="hex"!==n?[Db.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red(),o=n.green(),r=n.blue();Im.setValue(t,{red:e,green:o,blue:r})},b=Sg({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Wi(t.element(),"background-color","#"+n.value())})};return ul({factory:function(){var e={red:nt(ce(et.some(255))),green:nt(ce(et.some(255))),blue:nt(ce(et.some(255))),hex:nt(ce(et.some("ffffff")))},o=function(t){return e[t]().get()},i=function(t,n){e[t]().set(n)},r=function(t){var n=t.red(),e=t.green(),o=t.blue();i("red",et.some(n)),i("green",et.some(e)),i("blue",et.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),et.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,et.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return Bh(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=Sh(t),Vw.getField(n,"hex").each(function(t){Pm.isFocused(t)||Im.setValue(n,{hex:e.value()})}),e);y(r,o)})},a=function(t,n){var e=n.event();"hex"===e.type()?function(t,n){g(t);var e=hh(n);i("hex",et.some(n));var o=_h(e);v(t,o),r(o),Lo(t,Wy(),{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(zw+t+".label"),description:d(zw+t+".description")}},c=t("red"),s=t("green"),f=t("blue"),l=t("hex");return bt(Vw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",Db.sketch(h(Ah,"red",c.label,c.description,255))),t.field("green",Db.sketch(h(Ah,"green",s.label,s.description,255))),t.field("blue",Db.sketch(h(Ah,"blue",f.label,f.description,255))),t.field("hex",Db.sketch(h(yh,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:Wu([_y.config({invalidClass:m("form-invalid")}),rg("rgb-form-events",[mr(Nw,a),mr(Hw,n),mr(Pw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Im.setValue(t,{hex:n.value()}),e=t,o=_h(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},jw=function(t,o){var r=_w.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=_w.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}}),u=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}};return ul({factory:function(t){var n=nt({x:nt(0),y:nt(0)}),e=Wu([ll.config({find:et.some}),Pm.config({})]);return _w.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){Lo(t,Xy(),{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),Fh(Ih()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,Fh(o))}},extraApis:{}})},Uw=function(c,s){return ul({name:"ColourPicker",configFields:[Pn("dom"),Zn("onValidHex",tt),Zn("onInvalidHex",tt)],factory:function(t){var a,v,e=Lw(c,s,t.onValidHex,t.onInvalidHex),o=jw(c,s),b={paletteRgba:nt(ce(Ih()))},n=Sg(o.sketch({})),r=Sg(e.sketch({})),i=function(t,e){n.getOpt(t).each(function(t){var n=_h(e);b.paletteRgba().set(n),o.setRgba(t,n)})},u=function(t,n){r.getOpt(t).each(function(t){e.updateHex(t,n)})},y=function(n,e,t){W(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[n.asSpec(),Mw(c,s),r.asSpec()],behaviours:Wu([rg("colour-picker-events",[mr(Xy(),(v=[u],function(t,n){var e,o,r,i,u,a,c,s,f,l=n.event().value(),d=b.paletteRgba().get(),m=(i=r=0,u=(e=d).red()/255,a=e.green()/255,c=e.blue()/255,s=Math.min(u,Math.min(a,c)),f=Math.max(u,Math.max(a,c)),s===f?Uy(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(f-s)),o=(f-s)/f,i=f,Uy(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=Uy(m.hue(),l.x(),100-l.y()),p=Dh(g),h=Sh(p);y(t,h,v)})),mr(Gy(),(a=[i,u],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=Uy((100-e)/100*360,100,100),r=Dh(o),Sh(r));y(t,u,a)}))]),ll.config({find:function(t){return r.getOpt(t)}}),hm.config({mode:"acyclic"})])}}})},Ww=function(){return ll.config({find:et.some})},Gw=function(t){return ll.config({find:t.getOpt})},Xw=function(t){return ll.config({find:function(n){return Ir(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},Yw={"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"},qw=function(t){return Yw[t]},Kw=pn([Zn("preprocess",d),Zn("postprocess",d)]),$w=function(t,n,e){return Im.config(bt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},Jw=function(t,n,e){return $w(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},Qw=function(r,t){var i=An("RepresentingConfigs.memento processors",Kw,t);return Im.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Im.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Im.setValue(o,e)}}})},Zw=$w,tS=function(t){return Jw(t,Ur,Wr)},nS=function(t){return Im.config({store:{mode:"memory",initialValue:t}})},eS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){W(t,function(t){t(n,e)})}},i=function(t,n){if(!Qp.isDisabled(t)){var e=n.event().raw();a(t,e.dataTransfer.files)}},u=function(t,n){var e=n.event().raw().target.files;a(t,e)},a=function(t,n){var e,o;Im.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),I(it(e),function(t){return o.test(t.name)}))),Lo(t,yb,{name:r.name})},c=Sg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Wu([rg("input-file-events",[br(ko())])])}),t=r.label.map(function(t){return gy(t,n)}),s=Db.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Wu([nS([]),Ww(),Qp.config({}),Jm.config({toggleClass:"dragenter",toggleOnExecute:!1}),rg("dropzone-events",[mr("dragenter",o([e,Jm.toggle])),mr("dragleave",o([e,Jm.toggle])),mr("dragover",e),mr("drop",o([e,i])),mr(lo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},wg.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:Wu([Iy.config({})])})]}]}}}});return fy(t,s,["tox-form__group--stretched"])},oS=oi("alloy-fake-before-tabstop"),rS=oi("alloy-fake-after-tabstop"),iS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Wu([Pm.config({ignore:!0}),Iy.config({})])}},uS=function(t,n){Lo(t,co(),{raw:{which:9,shiftKey:n}})},aS=function(t){return jv(t,["."+oS,"."+rS].join(","),nt(!1))},cS=function(t,n){var e=n.element();Hi(e,oS)?uS(t,!0):Hi(e,rS)&&uS(t,!1)},sS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[iS([oS]),t,iS([rS])],behaviours:Wu([Xw(1)])}},fS=!(Pe.detect().browser.isIE()||Pe.detect().browser.isEdge()),lS=function(t,n){var o,r,e=fS&&t.sandboxed,i=P({},t.label.map(function(t){return{title:t}}).getOr({}),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=ce(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)Xr(t.element(),"srcdoc",n);else{Xr(t.element(),"src","javascript:''");var e=t.element().dom().contentWindow.document;e.open(),e.write(n),e.close()}r.set(n)}}),a=t.label.map(function(t){return gy(t,n)}),c=Db.parts().field({factory:{sketch:function(t){return sS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:Wu([Iy.config({}),Pm.config({}),Zw(et.none(),u.getValue,u.setValue)])})}}});return fy(a,c,["tox-form__group--stretched"])};function dS(t,n){return pS(H.document.createElement("canvas"),t,n)}function mS(t){var n=dS(t.width,t.height);return gS(n).drawImage(t,0,0),n}function gS(t){return t.getContext("2d")}function pS(t,n,e){return t.width=n,t.height=e,t}var hS={atob:function(t){return on.getOrDie("atob")(t)},requestAnimationFrame:function(t){on.getOrDie("requestAnimationFrame")(t)}};function vS(t){return t.naturalWidth||t.width}function bS(t){return t.naturalHeight||t.height}var yS=window.Promise?window.Promise:function(){var i=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,o(r,this),o(a,this))},t=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){H.setTimeout(t,1)};function o(t,n){return function(){return t.apply(n,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function u(o){var r=this;null!==this._state?t(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var n;try{n=t(r._value)}catch(e){return void o.reject(e)}o.resolve(n)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(o(n,t),o(r,this),o(a,this))}this._state=!0,this._value=t,c.call(this)}catch(e){a.call(this,e)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,n=this._deferreds;t").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),SC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(TC(t),t.button!==u)return a(t);t.deltaX=t.screenX-f,t.deltaY=t.screenY-l,t.preventDefault(),r.drag(t)},a=function(t){TC(t),SC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){SC(m).off()},SC(m).on("mousedown touchstart",n)}var AC=0;var DC=function(n){var f=Sg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=ce(1),d=ce(et.none()),m=ce({x:0,y:0,w:1,h:1}),c=ce({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=l.get(),o=ca(t.element()),r=la(t.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),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};Gi(s,n),f.getOpt(t).each(function(t){Gi(t.element(),n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=fe.fromTag("img");return Xr(a,"src",n),(e=a.dom(),new Wg(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)})).then(function(){return g.getOpt(t).map(function(t){var n=au({element:a});wm.replaceAt(t,1,et.some(n));var e=c.get(),o={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};c.set(o);var r,u,i=CC.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=ca(t.element()),e=la(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(n/o,e/r);1<=i?l.set(1):l.set(i)})),s(t,a),a})})},t=ab.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:Wu([rg("image-panel-crop-events",[wr(function(t){g.getOpt(t).each(function(t){var n=function S(s,e,f,o,r){var l,u,n,i,a="tox-",c="tox-crid-"+AC++;function d(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function m(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=CC.clamp({x:r,y:i,w:u,h:a},f,"move"===t.name),c=d(f,c),l.fire("updateRect",{rect:c}),h(c)}function g(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),SC("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}OC.each(u,function(t){SC("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function p(t){g(s=t)}function h(t){p(function e(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}}(f,t))}return u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],function v(){SC('
').appendTo(o),OC.each(i,function(t){SC("#"+c,o).append(''),components:[],behaviours:Wu([vE.config({channel:JD,initialData:t,updateState:function(t,n){var r=F(n.buttons,function(t){var n,e,o=Sg((e=i,uC(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return et.some({lookupByName:function(t,n){return e=t,o=n,N(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:o_})])}},i_=function(t,n){return NA.parts().footer(r_(t,n))},u_=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=ll.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Vw.getField(o,e).fold(function(){var t=n.getFooter();return vE.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return et.some(t)})}return et.none()},a_=function(c,o){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},s={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t;return Im.getValue(n)},setData:function(a){t(function(t){var n,e,o=s.getData(),r=yt(o,a),i=(n=r,e=c.getRoot(),vE.getState(e).get().map(function(t){return Bn(Tn("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Im.setValue(u,i)})},disable:function(t){u_(c,t).each(Qp.disable)},enable:function(t){u_(c,t).each(Qp.enable)},focus:function(t){u_(c,t).each(Pm.focus)},block:function(n){if(!L(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){Lo(t,kb,{message:n})})},unblock:function(){t(function(t){zo(t,Ob)})},showTab:function(e){t(function(t){var n=c.getBody();vE.getState(n).get().exists(function(t){return t.isTabPanel()})&&ll.getCurrent(n).each(function(t){jD.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([qD],n),t.getSystem().broadcastOn([KD],n.internalDialog),t.getSystem().broadcastOn([$D],n.internalDialog),t.getSystem().broadcastOn([JD],n.internalDialog),s.setData(n.initialData)})},close:function(){t(function(t){zo(t,xb)})}};return s},c_=function(t){return wg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:''}}],action:function(t){zo(t,wb)}})},s_=function(t,n,e){var o=function(t){return[uu(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:P({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:Wu([vE.config({channel:KD,renderComponents:o})])}},f_=function(t,n){return e={title:n.shared.providers.translate(t),draggable:!0},o=n.shared.providers,r=NA.parts().title(s_(e,et.none(),o)),i=NA.parts().draghandle({dom:vp('
')}),u=NA.parts().close(c_(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),ab.sketch({dom:vp('
'),components:a});var e,o,r,i,u,a},l_=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){NA.setBusy(t(),function(t,n){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:n,components:[{dom:vp('
')}]}})},onUnblock:function(){NA.setIdle(t())}}},d_=function(t,n,e,o){var r;return su(NA.sketch({lazySink:o.shared.getSink,onEscape:function(t){return zo(t,wb),et.some(!0)},useTabstopAt:function(t){return!aS(t)&&("button"!==Qo(t)||"disabled"!==qr(t,"disabled"))},modalBehaviours:Wu([vE.config({channel:qD,updateState:function(t,n){return et.some(n)},initialData:n}),nS({}),Pm.config({}),rg("execute-on-form",e.concat([xr(uo(),function(t,n){hm.focusIn(t)})])),rg("scroll-lock",[wr(function(){Ri(rr(),"tox-dialog__disable-scroll")}),Sr(function(){Ni(rr(),"tox-dialog__disable-scroll")})])].concat(t.extraBehaviours)),eventOrder:(r={},r[wo()]=["execute-on-form"],r[xo()]=["reflecting","receiving"],r[_o()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Mo()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(t.extraClasses),styles:P({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(t.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:vp('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}}))},m_=function(t,n,e){var o,r,i,u=f_(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=ZD(o,et.none(),r,!1),NA.parts().body(i)),c=i_({buttons:t.internalDialog.buttons},e.shared.providers),s=e_(function(){return m},l_(function(){return d},n)),f="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],l={header:u,body:a,footer:et.some(c),extraClasses:f,extraBehaviours:[],extraStyles:{}},d=d_(l,t,s,e),m=a_({getRoot:function(){return d},getBody:function(){return NA.getBody(d)},getFooter:function(){return NA.getFooter(d)},getFormWrapper:function(){var t=NA.getBody(d);return ll.getCurrent(t).getOr(t)}},n.redial);return{dialog:d,instanceApi:m}},g_=tinymce.util.Tools.resolve("tinymce.util.URI"),p_=["insertContent","setContent","execCommand","close","block","unblock"],h_=function(t){return k(t)&&-1!==p_.indexOf(t.mceAction)},v_=function(o,t,r,n){var e,i,u,a,c=f_(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[sS({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:Wu([Iy.config({}),Pm.config({})])})]}],behaviours:Wu([hm.config({mode:"acyclic",useTabstopAt:x(aS)})])},NA.parts().body(i)),f=o.buttons.bind(function(t){return 0===t.length?et.none():et.some(i_({buttons:t},n.shared.providers))}),l=n_(function(){return y},l_(function(){return b},t)),d=P({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}}),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),m=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],g=new g_(o.url,{base_uri:new g_(H.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=ce(et.none()),v=[rg("messages",[wr(function(){var t=zv(fe.fromDom(H.window),"message",function(t){if(g.isSameOrigin(new g_(t.raw().origin))){var n=t.raw().data;h_(n)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!O(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,y,n):!h_(e=n)&&k(e)&>(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(et.some(t))}),Sr(function(){h.get().each(function(t){return t.unbind()})})]),Qu.config({channels:(e={},e[QD]={onReceive:function(t,n){du(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=d_({header:c,body:s,footer:f,extraClasses:m,extraBehaviours:v,extraStyles:d},o,l,n),y=(u=b,a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!L(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){Lo(t,kb,{message:n})})},unblock:function(){a(function(t){zo(t,Ob)})},close:function(){a(function(t){zo(t,xb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([QD],n)})}});return{dialog:b,instanceApi:y}},b_=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p=oi("dialog-label"),h=oi("dialog-content"),v=Sg((u={title:t.internalDialog.title,draggable:!0},a=p,c=e.shared.providers,ab.sketch({dom:vp('
'),components:[s_(u,et.some(a),c),c_(c)],containerBehaviours:Wu([yA.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return mu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),b=Sg((s={body:t.internalDialog.body},f=h,l=e,d=o,ZD(s,et.some(f),l,d))),y=Sg((m={buttons:t.internalDialog.buttons},g=e.shared.providers,r_(m,g))),x=e_(function(){return S},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}}),w=su({dom:{tag:"div",classes:["tox-dialog"],attributes:(r={role:"dialog"},r["aria-labelledby"]=p,r["aria-describedby"]=""+h,r)},eventOrder:(i={},i[xo()]=[vE.name(),Qu.name()],i[wo()]=["execute-on-form"],i[_o()]=["reflecting","execute-on-form"],i),behaviours:Wu([hm.config({mode:"cyclic",onEscape:function(t){return zo(t,xb),et.some(!0)},useTabstopAt:function(t){return!aS(t)&&("button"!==Qo(t)||"disabled"!==qr(t,"disabled"))}}),vE.config({channel:qD,updateState:function(t,n){return et.some(n)},initialData:t}),rg("execute-on-form",x),nS({})]),components:[v.asSpec(),b.asSpec(),y.asSpec()]}),S=a_({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return b.get(w)},getFormWrapper:function(){var t=b.get(w);return ll.getCurrent(t).getOr(t)}},n.redial);return{dialog:w,instanceApi:S}},y_={dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]}},x_={dom:{tag:"div",classes:["tox-dialog__header"]}},w_=function(t,n){return NA.parts().close(wg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:Wu([Iy.config({})])}))},S_=function(){return NA.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},C_=function(t,n){return NA.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:vp("

"+n.translate(t)+"

")}]}]})},k_=function(t){return NA.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},O_=function(t,n){return[ab.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),ab.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},E_=function(e){return NA.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),et.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[bt(e.headerOverride.getOr(x_),{components:[e.partSpecs.title,e.partSpecs.close]}),e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:vp('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:Wu([rg("basic-dialog-events",[mr(wb,function(t,n){e.onCancel()}),mr(Cb,function(t,n){e.onSubmit()})])])})},T_=function(s){var u,a,e=(u=s.backstage.shared,{open:function(t,n){var e=function(){NA.hide(r),n()},o=Sg(uC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:et.none()},"cancel",u.providers)),r=su(E_({lazySink:function(){return u.getSink()},headerOverride:et.some(y_),partSpecs:{title:S_(),close:w_(function(){e()},u.providers),body:C_(t,u.providers),footer:k_(O_([],[o.asSpec()]))},onCancel:function(){return e()},onSubmit:tt,extraClasses:["tox-alert-dialog"]}));NA.show(r);var i=o.get(r);Pm.focus(i)}}),o=(a=s.backstage.shared,{open:function(t,n){var e=function(t){NA.hide(i),n(t)},o=Sg(uC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:et.none()},"submit",a.providers)),r=uC({name:"no",text:"No",primary:!0,align:"end",disabled:!1,icon:et.none()},"cancel",a.providers),i=su(E_({lazySink:function(){return a.getSink()},headerOverride:et.some(y_),partSpecs:{title:S_(),close:w_(function(){e(!1)},a.providers),body:C_(t,a.providers),footer:k_(O_([],[r,o.asSpec()]))},onCancel:function(){return e(!1)},onSubmit:function(){return e(!0)},extraClasses:["tox-confirm-dialog"]}));NA.show(i);var u=o.get(i);Pm.focus(u)}}),r=function(t,e){return DD.openUrl(function(t){var n=v_(t,{closeWindow:function(){NA.hide(n.dialog),e(n.instanceApi)}},s.editor,s.backstage);return NA.show(n.dialog),n.instanceApi},t)},i=function(t,i){return DD.open(function(t,n,e){var o=n,r=m_({dataValidator:e,initialData:o,internalDialog:t},{redial:DD.redial,closeWindow:function(){NA.hide(r.dialog),i(r.instanceApi)}},s.backstage);return NA.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},c=function(t,u,a,c){return DD.open(function(t,n,e){var o=Bn(Tn("data",e,n)),r=b_({dataValidator:e,initialData:o,internalDialog:t},{redial:DD.redial,closeWindow:function(){yg.hide(i),a(r.instanceApi)}},s.backstage,c),i=su(yg.sketch({lazySink:s.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:Wu([rg("window-manager-inline-events",[mr(Fo(),function(t,n){zo(r.dialog,wb)})])])}));return yg.showAt(i,u,fu(r.dialog)),r.instanceApi.setData(o),hm.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?c(t,s.backstage.shared.anchors.toolbar(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?c(t,s.backstage.shared.anchors.cursor(),e,n.ariaAttrs):i(t,e)},openUrl:function(t,n){return r(t,n)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};!function N_(){e.add("silver",function(t){var n=MA(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;Rv(t,o.shared);var u=T_({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:nt(u),getNotificationManagerImpl:function(){return Bg(t,{backstage:o},e)},ui:i()}})}()}(window);