/** * 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.15 (2019-09-02) */ !function(M){"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(P(a,function(t){return t.fold(function(t,n,e,o){return tn.field(t,e,o)},function(t,n){return tn.state(t)})}))}}},fn=function(r){return{extract:function(e,o,t){var n=P(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)}}},dn=function(a,c){return{extract:function(e,o,r){var t,n,i=ut(r),u=(t=e,n=i,fn(cn(a)).extract(t,d,n));return Xt(u,function(t){var n=P(t,function(t){return on.field(t,t,kt(),c)});return ln(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return Zt.setOf(a,c)}}},mn=nt(cn(Ut)),gn=p(fn,ln),pn=on.state,hn=on.field,vn=function(e,n,o,r,i){return Mt(r,i).fold(function(){return t=r,n=i,en(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+nn(t)});var t,n},function(t){return t.extract(e.concat(["branch: "+i]),n,o)})},bn=function(r,i){return{extract:function(n,e,o){return Mt(o,r).fold(function(){return t=r,en(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return vn(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+ut(i)},toDsl:function(){return Zt.choiceOf(r,i)}}},yn=cn(Ut),xn=function(o){return{extract:function(t,n,e){return o().extract(t,n,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},wn=function(n){return cn(function(t){return n(t).fold(Gt,Ut)})},Sn=function(n,t){return dn(function(t){return Lt(n(t))},t)},kn=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},Cn=function(t){return t.fold(function(t){throw new Error(Tn(t))},d)},On=function(t,n,e){return Cn(kn(t,n,e))},Tn=function(t){return"Errors: \n"+(n=t.errors,e=10 ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+nn(t.input);var n,e},En=function(t,n){return bn(t,n)},Bn=function(t,n){return bn(t,st(n,ln))},_n=nt(yn),Dn=function(e,o){return cn(function(t){var n=typeof t;return e(t)?Ut(t):Gt("Expected type: "+o+" but got: "+n)})},An=Dn(V,"number"),Fn=Dn(C,"string"),Mn=Dn(E,"boolean"),In=Dn(B,"function"),Rn=function(n){var t=function(t,n){for(var e=t.next();!e.done;){if(!n(e.value))return!1;e=t.next()}return!0};if(Object(n)!==n)return!0;switch({}.toString.call(n).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(n).every(function(t){return Rn(n[t])});case"Map":return t(n.keys(),Rn)&&t(n.values(),Rn);case"Set":return t(n.keys(),Rn);default:return!1}},Vn=cn(function(t){return Rn(t)?Ut(t):Gt("Expected value to be acceptable for sending via postMessage")}),Nn=function(n){return wn(function(t){return F(n,t)?R.value(t):R.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Hn=function(t){return hn(t,t,kt(),mn())},Pn=function(t,n){return hn(t,t,kt(),n)},zn=function(t){return Pn(t,Fn)},Ln=function(t,n){return hn(t,t,kt(),Nn(n))},jn=function(t){return Pn(t,In)},Un=function(t,n){return hn(t,t,kt(),ln(n))},Wn=function(t,n){return hn(t,t,kt(),gn(n))},Gn=function(t,n){return hn(t,t,kt(),fn(n))},Xn=function(t){return hn(t,t,Ct(),mn())},Yn=function(t,n){return hn(t,t,Ct(),n)},qn=function(t){return Yn(t,An)},Kn=function(t){return Yn(t,Fn)},Jn=function(t){return Yn(t,In)},$n=function(t,n){return Yn(t,ln(n))},Qn=function(t,n){return hn(t,t,St(n),mn())},Zn=function(t,n,e){return hn(t,t,St(n),e)},te=function(t,n){return Zn(t,n,An)},ne=function(t,n){return Zn(t,n,Fn)},ee=function(t,n,e){return Zn(t,n,Nn(e))},oe=function(t,n){return Zn(t,n,Mn)},re=function(t,n){return Zn(t,n,In)},ie=function(t,n,e){return Zn(t,n,ln(e))},ue=function(t,n){return pn(t,n)},ae=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return ae(e())}}},ce=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:nt(t)}},se={fromHtml:function(t,n){var e=(n||M.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1 "):o[0].name();return It(r,{handler:n,purpose:nt(e)})})});return Vt(n,{})},Ei=function(t){return kn("custom.definition",ln([hn("dom","dom",kt(),ln([Hn("tag"),Qn("styles",{}),Qn("classes",[]),Qn("attributes",{}),Xn("value"),Xn("innerHtml")])),Hn("components"),Hn("uid"),Qn("events",{}),Qn("apis",{}),hn("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))),_n()),Xn("domModification")]),t);var n},Bi=function(t,n){var e=Gr(t,n);return e===undefined||""===e?[]:e.split(" ")},_i=function(t){return t.dom().classList!==undefined},Di=function(t,n){return r=n,i=Bi(e=t,o="class").concat([r]),Ur(e,o,i.join(" ")),!0;var e,o,r,i},Ai=function(t,n){return r=n,0<(i=L(Bi(e=t,o="class"),function(t){return t!==r})).length?Ur(e,o,i.join(" ")):Yr(e,o),!1;var e,o,r,i},Fi=function(t,n){_i(t)?t.dom().classList.add(n):Di(t,n)},Mi=function(t){0===(_i(t)?t.dom().classList:Bi(t,"class")).length&&Yr(t,"class")},Ii=function(t,n){_i(t)?t.dom().classList.remove(n):Ai(t,n);Mi(t)},Ri=function(t,n){return _i(t)&&t.dom().classList.contains(n)},Vi=function(n,t){z(t,function(t){Fi(n,t)})},Ni=function(n,t){z(t,function(t){Ii(n,t)})},Hi=function(t){return t.style!==undefined&&B(t.style.getPropertyValue)},Pi=function(t,n,e){if(!C(e))throw M.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Hi(t)&&t.style.setProperty(n,e)},zi=function(t,n){Hi(t)&&t.style.removeProperty(n)},Li=function(t,n,e){var o=t.dom();Pi(o,n,e)},ji=function(t,n){var e=t.dom();ct(n,function(t,n){Pi(e,n,t)})},Ui=function(t,n){var e=t.dom(),o=M.window.getComputedStyle(e).getPropertyValue(n),r=""!==o||nr(t)?o:Wi(e,n);return null===r?undefined:r},Wi=function(t,n){return Hi(t)?t.style.getPropertyValue(n):""},Gi=function(t,n){var e=t.dom(),o=Wi(e,n);return et.from(o).filter(function(t){return 0=t.left&&n<=t.right&&e>=t.top&&e<=t.bottom};var yc=function sF(e,o){var n=function(t){return e(t)?et.from(t.dom().nodeValue):et.none()};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}}}(tr,"text"),xc=function(t){return yc.get(t)},wc=function(t){return yc.getOption(t)},Sc=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=xc(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"}),_n()),pl=ue("schema",function(){return[Xn("preprocess")]}),hl=Qn("defaults",nt({})),vl=Qn("overrides",nt({})),bl=ln([fl,dl,ml,gl,hl,vl]),yl=ln([fl,dl,ml,hl,vl]),xl=ln([fl,dl,ml,gl,hl,vl]),wl=ln([fl,pl,ml,Hn("unit"),gl,hl,vl]),Sl=function(t){return t.fold(et.some,et.none,et.some,et.some)},kl=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Cl=function(e,o){return function(t){var n=On("Converting part type",o,t);return e(n)}},Ol=Cl(ll.required,bl),Tl=Cl(ll.external,yl),El=Cl(ll.optional,xl),Bl=Cl(ll.group,wl),_l=nt("entirety"),Dl=/* */Object.freeze({required:Ol,external:Tl,optional:El,group:Bl,asNamedPart:Sl,name:kl,asCommon:function(t){return t.fold(d,d,d,d)},original:_l}),Al=function(t,n,e,o){return bt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Fl=function(r,t){var n={};return z(t,function(t){Sl(t).each(function(e){var o=Ml(r,e.pname);n[e.name]=function(t){var n=On("Part: "+e.name+" in "+r,ln(e.schema),t);return I({},o,{config:t,validated:n})}})}),n},Ml=function(t,n){return{uiType:sl(),owner:t,name:n}},Il=function(t,n,e){return{uiType:sl(),owner:t,name:n,config:e,validated:{}}},Rl=function(t){return K(t,function(t){return t.fold(et.none,et.some,et.none,et.none).map(function(t){return Un(t.name,t.schema.concat([Iu(_l())]))}).toArray()})},Vl=function(t){return P(t,kl)},Nl=function(t,n,e){return o=n,i={},r={},z(e,function(t){t.fold(function(o){i[o.pname]=al(!0,function(t,n,e){return o.factory.sketch(Al(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=nt(t.factory.sketch(Al(o,t,n[_l()]),n))},function(o){i[o.pname]=al(!1,function(t,n,e){return o.factory.sketch(Al(t,o,n,e))})},function(r){i[r.pname]=cl(!0,function(n,t,e){var o=n[r.name];return P(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},Hl=function(t,n,e){return ul(et.some(t),n,n.components,e)},Pl=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},zl=function(t,n,e){return Pl(t,n,e).getOrDie("Could not find part: "+e)},Ll=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return z(e,function(t){o[t]=nt(i.getByUid(r[t]))}),o},jl=function(t,n){var e=t.getSystem();return st(n.partUids,function(t,n){return nt(e.getByUid(t))})},Ul=function(t){return ut(t.partUids)},Wl=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return z(e,function(t){o[t]=nt(i.getByUid(r[t]).getOrDie())}),o},Gl=function(n,t){var e=Vl(t);return Rt(P(e,function(t){return{key:t,value:n+"-"+t}}))},Xl=function(n){return hn("partUids","partUids",Tt(function(t){return Gl(t.uid,n)}),_n())},Yl=/* */Object.freeze({generate:Fl,generateOne:Il,schemas:Rl,names:Vl,substitutes:Nl,components:Hl,defaultUids:Gl,defaultUidsSchema:Xl,getAllParts:jl,getAllPartNames:Ul,getPart:Pl,getPartOrDie:zl,getParts:Ll,getPartsOrDie:Wl}),ql=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Un("parts",i)]:[]).concat([Hn("uid"),Qn("dom",{}),Qn("components",[]),Iu("originalSpec"),Qn("debug.sketcher",{})]).concat(u));return On(t+" [SpecSchema]",sn(a.concat(n)),e)},Kl=function(t,n,e,o,r){var i=Jl(r),u=Rl(e),a=Xl(e),c=ql(t,n,i,u,[a]),s=Nl(0,c,e);return o(c,Hl(t,c,s.internals()),i,s.externals())},Jl=function(t){return t.hasOwnProperty("uid")?t:I({},t,{uid:ai("uid")})};var $l,Ql,Zl=sn([Hn("name"),Hn("factory"),Hn("configFields"),Qn("apis",{}),Qn("extraApis",{})]),tf=sn([Hn("name"),Hn("factory"),Hn("configFields"),Hn("partFields"),Qn("apis",{}),Qn("extraApis",{})]),nf=function(t){var i=On("Sketcher for "+t.name,Zl,t),n=st(i.apis,pi),e=st(i.extraApis,function(t,n){return di(t,n)});return I({name:nt(i.name),partFields:nt([]),configFields:nt(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=Jl(t),o(ql(n,e,r,[],[]),r);var n,e,o,r}},n,e)},ef=function(t){var n=On("Sketcher for "+t.name,tf,t),e=Fl(n.name,n.partFields),o=st(n.apis,pi),r=st(n.extraApis,function(t,n){return di(t,n)});return I({name:nt(n.name),partFields:nt(n.partFields),configFields:nt(n.configFields),sketch:function(t){return Kl(n.name,n.configFields,n.partFields,n.factory,t)},parts:nt(e)},o,r)},of=function(t){return"input"===$o(t)&&"radio"!==Gr(t,"type")||"textarea"===$o(t)},rf=/* */Object.freeze({getCurrent:function(t,n,e){return n.find(t)}}),uf=[Hn("find")],af=Uu({fields:uf,name:"composing",apis:rf}),cf=function(t,n,e,o){var r=t+n;return o',e.getDoc());return Rr(t,se.fromDom(n.extractContents())),n.insertNode(t.dom()),Br(t).each(function(t){return t.dom().normalize()}),Ec(t).map(function(t){var n;e.selection.setCursorLocation(t.dom(),"img"===$o(n=t)?1:wc(n).fold(function(){return Dr(n).length},function(t){return t.length}))}),t})},Mg=function(t){return lu(t,"[data-mce-autocompleter]")},Ig=/[\u00a0 \t\r\n]/,Rg=function(t,n){return t.toString().substring(n.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Vg=function(t,u,a,c){if(void 0===c&&(c=0),!(n=u).collapsed||3!==n.startContainer.nodeType)return et.none();var n;return Ag(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(Ig.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=jg(t.startContainer,t.startOffset);return Ag(e,n.element,n.offset,o).fold(nt(!0),nt(!0),d)};var e,o})(e.range,i,e.text)});if(0===u.length)return et.none();var a=Pg.all(P(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return et.some({lookupData:a,context:e})},Gg=ln([zn("type"),Kn("text")]),Xg=ln([ue("type",function(){return"autocompleteitem"}),ue("active",function(){return!1}),ue("disabled",function(){return!1}),Qn("meta",{}),zn("value"),Kn("text"),Kn("icon")]),Yg=ln([zn("type"),zn("ch"),te("minChars",1),Qn("columns",1),te("maxResults",10),Jn("matches"),jn("fetch"),jn("onAction")]),qg=function(t){var n,e,o=t.ui.registry.getAll().popups,r=st(o,function(t){return(n=t,kn("Autocompleter",Yg,n)).fold(function(t){throw new Error(Tn(t))},function(t){return t});var n}),i=(n=ft(r,function(t){return t.ch}),e={},z(n,function(t){e[t]={}}),ut(e)),u=dt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return L(u,function(t){return t.ch===n})}}},Kg=[oe("disabled",!1),Kn("text"),Kn("shortcut"),hn("value","value",Ot(function(){return ti("menuitem-value")}),_n()),Qn("meta",{})],Jg=ln([zn("type"),re("onSetup",function(){return tt}),re("onAction",tt),Kn("icon")].concat(Kg)),$g=ln([zn("type"),jn("getSubmenuItems"),re("onSetup",function(){return tt}),Kn("icon")].concat(Kg)),Qg=ln([zn("type"),oe("active",!1),re("onSetup",function(){return tt}),jn("onAction")].concat(Kg)),Zg=ln([zn("type"),oe("active",!1),Kn("icon")].concat(Kg)),tp=ln([zn("type"),Ln("fancytype",["inserttable","colorswatch"]),re("onAction",tt)]),np=function(t,o,n){var r=Ic(t.element(),"."+n);if(0o}).getOr(r.length);return et.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return et.none()},ep=function(t,n){return Lu([Dm(t,n)])},op=function(t){return ep(ti("unnamed-events"),t)},rp=[Hn("lazySink"),Hn("tooltipDom"),Qn("exclusive",!0),Qn("tooltipComponents",[]),Qn("delay",300),ee("mode","normal",["normal","follow-highlight"]),Qn("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:nt([ja,La,Na,Pa,Ha,za]),onRtl:nt([ja,La,Na,Pa,Ha,za])}}}),_u("onHide"),_u("onShow")],ip=/* */Object.freeze({init:function(){var e=ae(et.none()),n=ae(et.none()),o=function(){e.get().each(function(t){M.clearTimeout(t)})},t=nt("not-implemented");return vi({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(M.setTimeout(function(){t()},n)))},readState:t})}}),up=ti("tooltip.exclusive"),ap=ti("tooltip.show"),cp=ti("tooltip.hide"),sp=function(t,n,e){t.getSystem().broadcastOn([up],{})},lp=/* */Object.freeze({hideAllExclusive:sp,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&hm.set(t,o)})}}),fp=Uu({fields:rp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Fs(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return cr(q([[fr(ap,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){sp(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:cr("normal"===o.mode?[fr(ro(),function(t){Po(n,ap)}),fr(eo(),function(t){Po(n,cp)})]:[]),behaviours:Lu([hm.config({})])});r.setTooltip(e),_s(t,e),o.onShow(n,e),Ts.position(t,o.anchor(n),e)}}(t)},o.delay)}),fr(cp,function(t){r.resetTimer(function(){e(t)},o.delay)}),fr(yo(),function(t,n){F(n.channels(),up)&&e(t)}),yr(function(t){e(t)})],"normal"===o.mode?[fr(io(),function(t){Po(t,ap)}),fr(vo(),function(t){Po(t,cp)}),fr(ro(),function(t){Po(t,ap)}),fr(eo(),function(t){Po(t,cp)})]:[fr(No(),function(t,n){Po(t,ap)}),fr(Ho(),function(t){Po(t,cp)})]]))}}),state:ip,apis:lp}),dp=function(t){var n,e,o,r=se.fromHtml(t),i=Dr(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],U(e,function(t,n){var e;return"class"===n.name?t:I({},t,((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:zr(r)};return I({tag:$o(r),classes:a,attributes:u},c)},mp=tinymce.util.Tools.resolve("tinymce.util.I18n"),gp="tox-menu-nav__js",pp="tox-collection__item",hp="tox-swatch",vp={normal:gp,color:hp},bp="tox-collection__item--enabled",yp="tox-collection__item-icon",xp="tox-collection__item-label",wp="tox-collection__item--active",Sp=function(t){return Mt(vp,t).getOr(gp)},kp=tinymce.util.Tools.resolve("tinymce.Env"),Cp=function(t){var e=kp.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),o=P(n,function(t){var n=t.toLowerCase().trim();return gt(e,n)?e[n]:t});return kp.mac?o.join(""):o.join("+")},Op=function(t){return{dom:{tag:"div",classes:[yp],innerHtml:t}}},Tp=function(t){return{dom:{tag:"div",classes:[xp]},components:[ou(mp.translate(t))]}},Ep=function(t,n){return{dom:{tag:"div",classes:[xp]},components:[{dom:{tag:t.tag,attributes:{style:t.styleAttr}},components:[ou(mp.translate(n))]}]}},Bp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Cp(t)}}},_p=function(t){return{dom:{tag:"div",classes:[yp,"tox-collection__item-checkmark"],innerHtml:yg("checkmark",t)}}},Dp=function(t,n,e,o,r){var i=e?t.checkMark.orThunk(function(){return n.or(et.some("")).map(Op)}):et.none(),u=t.ariaLabel.map(function(t){return{attributes:{title:mp.translate(t)}}}).getOr({});return{dom:yt({tag:"div",classes:[gp,pp].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:[xp],innerHtml:t}})}),t.shortcutContent.map(Bp),t.caret]}},Ap=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Fp=["list-bull-circle","list-bull-default","list-bull-square"],Mp=function(t,r,n,i){void 0===i&&(i=et.none());var e,o,u,a,c,s,l,f=mp.isRtl()&&t.iconContent.exists(function(t){return F(Fp,t)}),d=(e=t.iconContent,e.map(function(t){return mp.isRtl()&&F(Ap,t)?t+"-rtl":t})).map(function(t){return n=t,e=r.icons,o=i,et.from(e()[n]).or(o).getOrThunk(function(){return bg(e)});var n,e,o}),m=et.from(t.meta).fold(function(){return Tp},function(t){return gt(t,"style")?g(Ep,t.style):Tp});return"color"===t.presets?(o=t.ariaLabel,u=t.value,a=r,{dom:(c=hp,s=d.getOr(""),l=o.map(function(t){return' title="'+a.translate(t)+'"'}).getOr(""),dp("custom"===u?'":"remove"===u?'
"+s+"
":'
")),optComponents:[]}):Dp(t,d,n,m,f)},Ip=["input","button","textarea","select"],Rp=function(t,n,e){n.disabled&&Lp(t,n)},Vp=function(t,n){return!0===n.useNative&&F(Ip,$o(t.element()))},Np=function(t){Ur(t.element(),"disabled","disabled")},Hp=function(t){Yr(t.element(),"disabled")},Pp=function(t){Ur(t.element(),"aria-disabled","true")},zp=function(t){Ur(t.element(),"aria-disabled","false")},Lp=function(n,t,e){t.disableClass.each(function(t){Fi(n.element(),t)}),(Vp(n,t)?Np:Pp)(n),t.onDisabled(n)},jp=function(n,t,e){t.disableClass.each(function(t){Ii(n.element(),t)}),(Vp(n,t)?Hp:zp)(n),t.onEnabled(n)},Up=function(t,n){return Vp(t,n)?Xr(t.element(),"disabled"):"true"===Gr(t.element(),"aria-disabled")},Wp=/* */Object.freeze({enable:jp,disable:Lp,isDisabled:Up,onLoad:Rp,set:function(t,n,e,o){(o?Lp:jp)(t,n,e)}}),Gp=/* */Object.freeze({exhibit:function(t,n,e){return yi({classes:n.disabled?n.disableClass.map(Z).getOr([]):[]})},events:function(e,t){return cr([sr(xo(),function(t,n){return Up(t,e)}),Vu(e,t,Rp)])}}),Xp=[Qn("disabled",!1),Qn("useNative",!0),Xn("disableClass"),_u("onDisabled"),_u("onEnabled")],Yp=Uu({fields:Xp,name:"disabling",active:Gp,apis:Wp}),qp=function(t){return Yp.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Kp=function(t){return Yp.config({disabled:t})},Jp=function(t){return Yp.config({disabled:t,disableClass:"tox-tbtn--disabled"})},$p=function(t){return Yp.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Qp=function(t,n){var e=t.getApi(n);return function(t){t(e)}},Zp=function(e,o){return br(function(t){Qp(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},th=function(n,e){return yr(function(t){return Qp(n,t)(e.get())})};(Og=Cg||(Cg={}))[Og.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Og[Og.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var nh=Cg,eh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},oh=function(t){return K(t,function(t){return t.toArray()})},rh=function(t,n,e){var o,r,i=ae(tt);return{type:"item",dom:n.dom,components:oh(n.optComponents),data:t.data,eventOrder:eh,hasSubmenu:t.triggersSubmenu,itemBehaviours:Lu([Dm("item-events",[(o=t,r=e,wr(function(t,n){Qp(o,t)(o.onAction),o.triggersSubmenu||r!==nh.CLOSE_ON_EXECUTE||(Po(t,Oo()),n.stop())})),Zp(t,i),th(t,i)]),qp(t.disabled),hm.config({})].concat(t.itemBehaviours))}},ih=function(t){return{value:t.value,meta:yt({text:t.text.getOr("")},t.meta)}},uh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ah=function(t,n){var e,o=mp.translate(t),r=(e=o,uh.DOM.encode(e));if(0'+t+""})}return r},ch=nt(Fl("item-widget",eg())),sh=ti("cell-over"),lh=ti("cell-execute"),fh=function(n,e,t){var o,r=function(t){return zo(t,lh,{row:n,col:e})};return uu({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:Lu([Dm("insert-table-picker-cell",[fr(ro(),Rm.focus),fr(xo(),r),fr(ko(),r)]),Ym.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Rm.config({onFocus:function(t){return zo(t,sh,{row:n,col:e})}})])})};var dh=function(t){return{value:nt(t)}},mh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,gh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ph=function(t){return mh.test(t)||gh.test(t)},hh=function(t){var n,e=(n=t.value().replace(mh,function(t,n,e,o){return n+n+e+e+o+o}),{value:nt(n)}),o=gh.exec(e.value());return null===o?["FFFFFF","FF","FF","FF"]:o},vh=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},bh=function(t){var n=vh(t.red())+vh(t.green())+vh(t.blue());return dh(n)},yh=Math.min,xh=Math.max,wh=Math.round,Sh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,kh=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Ch=function(t,n,e,o){return{red:nt(t),green:nt(n),blue:nt(e),alpha:nt(o)}},Oh=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},Th=function(t){var n,e,o,r=(t.hue()||0)%360,i=t.saturation()/100,u=t.value()/100;if(i=xh(0,yh(i,1)),u=xh(0,yh(u,1)),0===i)return n=e=o=wh(255*u),Ch(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=wh(255*(n+l)),e=wh(255*(e+l)),o=wh(255*(o+l)),Ch(n,e,o,1)},Eh=function(t){var n=hh(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return Ch(e,o,r,1)},Bh=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return Ch(r,i,u,a)},_h=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},Dh=nt(Ch(255,0,0,1)),Ah=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Fh="tinymce-custom-colors";var Mh="choiceitem",Ih=[{type:Mh,text:"Light Green",value:"#BFEDD2"},{type:Mh,text:"Light Yellow",value:"#FBEEB8"},{type:Mh,text:"Light Red",value:"#F8CAC6"},{type:Mh,text:"Light Purple",value:"#ECCAFA"},{type:Mh,text:"Light Blue",value:"#C2E0F4"},{type:Mh,text:"Green",value:"#2DC26B"},{type:Mh,text:"Yellow",value:"#F1C40F"},{type:Mh,text:"Red",value:"#E03E2D"},{type:Mh,text:"Purple",value:"#B96AD9"},{type:Mh,text:"Blue",value:"#3598DB"},{type:Mh,text:"Dark Turquoise",value:"#169179"},{type:Mh,text:"Orange",value:"#E67E23"},{type:Mh,text:"Dark Red",value:"#BA372A"},{type:Mh,text:"Dark Purple",value:"#843FA1"},{type:Mh,text:"Dark Blue",value:"#236FA1"},{type:Mh,text:"Light Gray",value:"#ECF0F1"},{type:Mh,text:"Medium Gray",value:"#CED4D9"},{type:Mh,text:"Gray",value:"#95A5A6"},{type:Mh,text:"Dark Gray",value:"#7E8C8D"},{type:Mh,text:"Navy Blue",value:"#34495E"},{type:Mh,text:"Black",value:"#000000"},{type:Mh,text:"White",value:"#ffffff"}],Rh=function lF(r){void 0===r&&(r=10);var t,n=Ah.getItem(Fh),e=C(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(),Ah.setItem(Fh,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Vh=function(t){var n=[],u=M.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=af.getCurrent(e).bind(function(t){return xf.getHighlighted(t).map(_m.getValue)});r.previewing.set(!0),Zb(r,u(t),t,e,i,function(t){af.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&xf.highlightFirst(t)},function(n){xf.highlightBy(t,function(t){return _m.getValue(t).value===n.value}),xf.getHighlighted(t).orThunk(function(){return xf.highlightFirst(t),et.none()})})})},Lb.HighlightFirst).get(tt)}},cancelEvent:To()}),fm.config({mode:"special",onDown:function(t,n){return e(t,n,xf.highlightFirst),et.some(!0)},onEscape:function(t){var n=Mb.getCoupled(t,"sandbox");return Gs.isOpen(n)?(Gs.close(n),et.some(!0)):et.none()},onUp:function(t,n){return e(t,n,xf.highlightLast),et.some(!0)},onEnter:function(n){var t=Mb.getCoupled(n,"sandbox"),e=Gs.isOpen(t);if(e&&!r.previewing.get())return af.getCurrent(t).bind(function(t){return xf.getHighlighted(t)}).map(function(t){return zo(n,dy(),{item:t}),!0});var o=_m.getValue(n);return Po(n,To()),r.onExecute(t,n,o),e&&Gs.close(t),et.some(!0)}}),Ym.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Mb.config({others:{sandbox:function(t){return ry(r,t,{onOpen:function(){return Ym.on(t)},onClose:function(){return Ym.off(t)}})}}}),Dm("typeaheadevents",[wr(function(t){var n=tt;ny(r,u(t),t,i,n,Lb.HighlightFirst).get(tt)}),fr(dy(),function(t,n){var e=Mb.getCoupled(t,"sandbox");iy(r.model,t,n.event().item()),Po(t,To()),r.onItemExecute(t,e,n.event().item(),_m.getValue(t)),Gs.close(e),ay(t)})].concat(r.dismissOnBlur?[fr(vo(),function(t){var n=Mb.getCoupled(t,"sandbox");Mf(n.element()).isNone()&&Gs.close(n)})]:[]))];return{uid:r.uid,dom:fy(bt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:I({},o,Zs(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),vy=function(t,n,e,o){var r=yy(t,n,e,o);return Db.sketch(r)},by=function(t,n){return vy(t,n,[],[])},yy=function(t,n,e,o){return{dom:xy(e),components:t.toArray().concat([n]),fieldBehaviours:Lu(o)}},xy=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},wy=function(t,n){return Db.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},Sy=function(t){return"separator"===t.type},ky={type:"separator"},Cy=function(t,e){var n=U(t,function(t,n){return C(n)?""===n?t:"|"===n?0"},jw=function(o,t,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:Zs(o.formBehaviours,[_m.config({store:{mode:"manual",getValue:function(t){var n=jl(t,o);return st(n,function(t,n){return t().bind(function(t){var n,e=af.getCurrent(t);return n="missing current",e.fold(function(){return R.error(n)},R.value)}).map(_m.getValue)})},setValue:function(e,t){ct(t,function(n,t){Pl(e,o,t).each(function(t){af.getCurrent(t).each(function(t){_m.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Pl(t,o,n).bind(af.getCurrent)}}}},Uw={getField:pi(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),Il("form",Lw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=P(r,function(t){return Ol({name:t,pname:Lw(t)})});return Kl("form",zw,i,jw,o)}},Ww=ti("valid-input"),Gw=ti("invalid-input"),Xw=ti("validating-input"),Yw="colorcustom.rgb.",qw=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(Yw+"range"),c=[Db.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Db.parts().field({data:r,factory:By,inputAttributes:I({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:Lu([(i=n,u=t,Hy.config({invalidClass:m("invalid"),notify:{onValidate:function(t){zo(t,Xw,{type:i})},onValid:function(t){zo(t,Ww,{type:i,value:_m.getValue(t)})},onInvalid:function(t){zo(t,Gw,{type:i,value:_m.getValue(t)})}},validator:{validate:function(t){var n=_m.getValue(t),e=u(n)?R.value(!0):R.error(d("aria.input.invalid"));return Kb(e)},validateOnLoad:!1}})),Ly.config({})]),onSetValue:function(t){Hy.isInvalid(t)&&Hy.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();_m.setValue(t,{red:e,green:o,blue:r})},b=vg({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Li(t.element(),"background-color","#"+n.value())})};return nf({factory:function(){var e={red:nt(ae(et.some(255))),green:nt(ae(et.some(255))),blue:nt(ae(et.some(255))),hex:nt(ae(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 Ch(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=bh(t),Uw.getField(n,"hex").each(function(t){Rm.isFocused(t)||_m.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=dh(n);i("hex",et.some(n));var o=Eh(e);v(t,o),r(o),zo(t,$y(),{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(Yw+t+".label"),description:d(Yw+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return bt(Uw.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(Oh,"red",c.label,c.description,255))),t.field("green",Db.sketch(h(Oh,"green",s.label,s.description,255))),t.field("blue",Db.sketch(h(Oh,"blue",l.label,l.description,255))),t.field("hex",Db.sketch(h(ph,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:Lu([Hy.config({invalidClass:m("form-invalid")}),Dm("rgb-form-events",[fr(Ww,a),fr(Gw,n),fr(Xw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;_m.setValue(t,{hex:n.value()}),e=t,o=Eh(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},Kw=function(t,o){var r=Hw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Hw.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 nf({factory:function(t){var n=nt({x:nt(0),y:nt(0)}),e=Lu([af.config({find:et.some}),Rm.config({})]);return Hw.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){zo(t,Zy(),{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),_h(Dh()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,_h(o))}},extraApis:{}})},Jw=function(c,s){return nf({name:"ColourPicker",configFields:[Hn("dom"),Qn("onValidHex",tt),Qn("onInvalidHex",tt)],factory:function(t){var a,v,e=qw(c,s,t.onValidHex,t.onInvalidHex),o=Kw(c,s),b={paletteRgba:nt(ae(Dh()))},n=vg(o.sketch({})),r=vg(e.sketch({})),i=function(t,e){n.getOpt(t).each(function(t){var n=Eh(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){z(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[n.asSpec(),Pw(c,s),r.asSpec()],behaviours:Lu([Dm("colour-picker-events",[fr(Zy(),(v=[u],function(t,n){var e,o,r,i,u,a,c,s,l,f=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)),l=Math.max(u,Math.max(a,c)),s===l?Jy(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)/(l-s)),o=(l-s)/l,i=l,Jy(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=Jy(m.hue(),f.x(),100-f.y()),p=Th(g),h=bh(p);y(t,h,v)})),fr(Qy(),(a=[i,u],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=Jy((100-e)/100*360,100,100),r=Th(o),bh(r));y(t,u,a)}))]),af.config({find:function(t){return r.getOpt(t)}}),fm.config({mode:"acyclic"})])}}})},$w=function(){return af.config({find:et.some})},Qw=function(t){return af.config({find:t.getOpt})},Zw=function(t){return af.config({find:function(n){return Ar(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},tS={"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"},nS=function(t){return tS[t]},eS=tinymce.util.Tools.resolve("tinymce.Resource"),oS=ln([Qn("preprocess",d),Qn("postprocess",d)]),rS=function(t,n,e){return _m.config(bt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},iS=function(t,n,e){return rS(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},uS=function(r,t){var i=On("RepresentingConfigs.memento processors",oS,t);return _m.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=_m.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);_m.setValue(o,e)}}})},aS=rS,cS=function(t){return iS(t,zr,Lr)},sS=function(t){return _m.config({store:{mode:"memory",initialValue:t}})},lS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){z(t,function(t){t(n,e)})}},i=function(t,n){if(!Yp.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;_m.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),L(it(e),function(t){return o.test(t.name)}))),zo(t,yb,{name:r.name})},c=vg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Lu([Dm("input-file-events",[hr(ko())])])}),t=r.label.map(function(t){return wy(t,n)}),s=Db.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Lu([sS([]),$w(),Yp.config({}),Ym.config({toggleClass:"dragenter",toggleOnExecute:!1}),Dm("dropzone-events",[fr("dragenter",o([e,Ym.toggle])),fr("dragleave",o([e,Ym.toggle])),fr("dragover",e),fr("drop",o([e,i])),fr(lo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},hg.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:Lu([Ly.config({})])})]}]}}}});return vy(t,s,["tox-form__group--stretched"],[])},fS=ti("alloy-fake-before-tabstop"),dS=ti("alloy-fake-after-tabstop"),mS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Lu([Rm.config({ignore:!0}),Ly.config({})])}},gS=function(t,n){zo(t,ao(),{raw:{which:9,shiftKey:n}})},pS=function(t){return Hv(t,["."+fS,"."+dS].join(","),nt(!1))},hS=function(t,n){var e=n.element();Ri(e,fS)?gS(t,!0):Ri(e,dS)&&gS(t,!1)},vS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[mS([fS]),t,mS([dS])],behaviours:Lu([Zw(1)])}},bS=!(Ne.detect().browser.isIE()||Ne.detect().browser.isEdge()),yS=function(t,n){var o,r,e=bS&&t.sandboxed,i=I({},t.label.map(function(t){return{title:t}}).getOr({}),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=ae(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)Ur(t.element(),"srcdoc",n);else{Ur(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 wy(t,n)}),c=Db.parts().field({factory:{sketch:function(t){return vS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:Lu([Ly.config({}),Rm.config({}),aS(et.none(),u.getValue,u.setValue)])})}}});return vy(a,c,["tox-form__group--stretched"],[])};function xS(t,n){return kS(M.document.createElement("canvas"),t,n)}function wS(t){var n=xS(t.width,t.height);return SS(n).drawImage(t,0,0),n}function SS(t){return t.getContext("2d")}function kS(t,n,e){return t.width=n,t.height=e,t}function CS(t){return t.naturalWidth||t.width}function OS(t){return t.naturalHeight||t.height}var TS=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=[],l(t,o(r,this),o(a,this))},t=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){M.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 l(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),Vk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(Lk(t),t.button!==u)return a(t);t.deltaX=t.screenX-l,t.deltaY=t.screenY-f,t.preventDefault(),r.drag(t)},a=function(t){Lk(t),Vk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){Vk(m).off()},Vk(m).on("mousedown touchstart",n)}var Uk=0;var Wk=function(n){var l=vg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=ae(1),d=ae(et.none()),m=ae({x:0,y:0,w:1,h:1}),c=ae({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=f.get(),o=aa(t.element()),r=ra(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"};ji(s,n),l.getOpt(t).each(function(t){ji(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=se.fromTag("img");return Ur(a,"src",n),(e=a.dom(),new Pg(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=ru({element:a});hm.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=Nk.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=aa(t.element()),e=ra(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(n/o,e/r);1<=i?f.set(1):f.set(i)})),s(t,a),a})})},t=ob.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:Lu([Dm("image-panel-crop-events",[br(function(t){g.getOpt(t).each(function(t){var n=function S(s,e,l,o,r){var f,u,n,i,a="tox-",c="tox-crid-"+Uk++;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=Nk.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=d(l,c),f.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),Vk("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}Pk.each(u,function(t){Vk("#"+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}}(l,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(){Vk('
').appendTo(o),Pk.each(i,function(t){Vk("#"+c,o).append(''),components:[],behaviours:Lu([IT.config({channel:AA,initialData:t,updateState:function(t,n){var r=P(n.buttons,function(t){var n,e,o=vg((e=i,xk(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,W(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:NA})])}},PA=function(t,n){return J_.parts().footer(HA(t,n))},zA=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=af.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Uw.getField(o,e).fold(function(){var t=n.getFooter();return IT.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return et.some(t)})}return et.none()},LA=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 _m.getValue(n)},setData:function(a){t(function(t){var n,e,o=s.getData(),r=yt(o,a),i=(n=r,e=c.getRoot(),IT.getState(e).get().map(function(t){return Cn(kn("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();_m.setValue(u,i)})},disable:function(t){zA(c,t).each(Yp.disable)},enable:function(t){zA(c,t).each(Yp.enable)},focus:function(t){zA(c,t).each(Rm.focus)},block:function(n){if(!C(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){zo(t,Cb,{message:n})})},unblock:function(){t(function(t){Po(t,Ob)})},showTab:function(e){t(function(t){var n=c.getBody();IT.getState(n).get().exists(function(t){return t.isTabPanel()})&&af.getCurrent(n).each(function(t){SA.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([BA],n),t.getSystem().broadcastOn([_A],n.internalDialog),t.getSystem().broadcastOn([DA],n.internalDialog),t.getSystem().broadcastOn([AA],n.internalDialog),s.setData(n.initialData)})},close:function(){t(function(t){Po(t,xb)})}};return s},jA=function(t){return hg.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){Po(t,wb)}})},UA=function(t,n,e){var o=function(t){return[ou(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:I({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:Lu([IT.config({channel:_A,renderComponents:o})])}},WA=function(){return{dom:dp('
')}},GA=function(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=J_.parts().title(UA(e,et.none(),o)),i=J_.parts().draghandle(WA()),u=J_.parts().close(jA(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),ob.sketch({dom:dp('
'),components:a});var e,o,r,i,u,a},XA=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){J_.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:dp('
')}]}})},onUnblock:function(){J_.setIdle(t())}}},YA=function(t,n,e,o){var r;return uu(J_.sketch({lazySink:o.shared.getSink,onEscape:function(t){return Po(t,wb),et.some(!0)},useTabstopAt:function(t){return!pS(t)},modalBehaviours:Lu([IT.config({channel:BA,updateState:function(t,n){return et.some(n)},initialData:n}),sS({}),Rm.config({}),Dm("execute-on-form",e.concat([vr(io(),function(t,n){fm.focusIn(t)})])),Dm("scroll-lock",[br(function(){Fi(er(),"tox-dialog__disable-scroll")}),yr(function(){Ii(er(),"tox-dialog__disable-scroll")})])].concat(t.extraBehaviours)),eventOrder:(r={},r[xo()]=["execute-on-form"],r[yo()]=["reflecting","receiving"],r[Do()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Ao()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(t.extraClasses),styles:I({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(t.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:dp('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}}))},qA=function(t,n,e){var o,r,i,u=GA(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=MA(o,et.none(),r,!1),J_.parts().body(i)),c=PA({buttons:t.internalDialog.buttons},e),s=VA(function(){return m},XA(function(){return d},n)),l="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:u,body:a,footer:et.some(c),extraClasses:l,extraBehaviours:[],extraStyles:{}},d=YA(f,t,s,e),m=LA({getRoot:function(){return d},getBody:function(){return J_.getBody(d)},getFooter:function(){return J_.getFooter(d)},getFormWrapper:function(){var t=J_.getBody(d);return af.getCurrent(t).getOr(t)}},n.redial);return{dialog:d,instanceApi:m}},KA=tinymce.util.Tools.resolve("tinymce.util.URI"),JA=["insertContent","setContent","execCommand","close","block","unblock"],$A=function(t){return O(t)&&-1!==JA.indexOf(t.mceAction)},QA=function(o,t,r,n){var e,i,u,a,c=GA(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[vS({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:Lu([Ly.config({}),Rm.config({})])})]}],behaviours:Lu([fm.config({mode:"acyclic",useTabstopAt:x(pS)})])},J_.parts().body(i)),l=o.buttons.bind(function(t){return 0===t.length?et.none():et.some(PA({buttons:t},n))}),f=RA(function(){return y},XA(function(){return b},t)),d=I({},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 KA(o.url,{base_uri:new KA(M.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=ae(et.none()),v=[Dm("messages",[br(function(){var t=Vv(se.fromDom(M.window),"message",function(t){if(g.isSameOrigin(new KA(t.raw().origin))){var n=t.raw().data;$A(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=!!E(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):!$A(e=n)&&O(e)&>(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(et.some(t))}),yr(function(){h.get().each(function(t){return t.unbind()})})]),Ku.config({channels:(e={},e[FA]={onReceive:function(t,n){su(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=YA({header:c,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:d},o,f,n),y=(u=b,a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!C(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){zo(t,Cb,{message:n})})},unblock:function(){a(function(t){Po(t,Ob)})},close:function(){a(function(t){Po(t,xb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([FA],n)})}});return{dialog:b,instanceApi:y}},ZA=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m,g=ti("dialog-label"),p=ti("dialog-content"),h=vg((u={title:t.internalDialog.title,draggable:!0},a=g,c=e.shared.providers,ob.sketch({dom:dp('
'),components:[UA(u,et.some(a),c),WA(),jA(c)],containerBehaviours:Lu([I_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return lu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),v=vg((s={body:t.internalDialog.body},l=p,f=e,d=o,MA(s,et.some(l),f,d))),b=vg((m={buttons:t.internalDialog.buttons},HA(m,e))),y=VA(function(){return w},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}}),x=uu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=g,r["aria-describedby"]=""+p,r)},eventOrder:(i={},i[yo()]=[IT.name(),Ku.name()],i[xo()]=["execute-on-form"],i[Do()]=["reflecting","execute-on-form"],i),behaviours:Lu([fm.config({mode:"cyclic",onEscape:function(t){return Po(t,xb),et.some(!0)},useTabstopAt:function(t){return!pS(t)&&("button"!==$o(t)||"disabled"!==Gr(t,"disabled"))}}),IT.config({channel:BA,updateState:function(t,n){return et.some(n)},initialData:t}),Rm.config({}),Dm("execute-on-form",y.concat([vr(io(),function(t,n){fm.focusIn(t)})])),sS({})]),components:[h.asSpec(),v.asSpec(),b.asSpec()]}),w=LA({getRoot:function(){return x},getFooter:function(){return b.get(x)},getBody:function(){return v.get(x)},getFormWrapper:function(){var t=v.get(x);return af.getCurrent(t).getOr(t)}},n.redial);return{dialog:x,instanceApi:w}},tF={dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]}},nF={dom:{tag:"div",classes:["tox-dialog__header"]}},eF=function(t,n){return J_.parts().close(hg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:Lu([Ly.config({})])}))},oF=function(){return J_.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},rF=function(t,n){return J_.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:dp("

"+n.translate(t)+"

")}]}]})},iF=function(t){return J_.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},uF=function(t,n){return[ob.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),ob.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},aF=function(e){return J_.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(nF),{components:[e.partSpecs.title,e.partSpecs.close]}),e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:dp('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:Lu([Dm("basic-dialog-events",[fr(wb,function(t,n){e.onCancel()}),fr(kb,function(t,n){e.onSubmit()})])])})},cF=function(s){var u,a,c,l,e=(a=(u=s).backstage.shared,{open:function(t,n){var e=function(){J_.hide(r),n()},o=vg(xk({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:et.none()},"cancel",u.backstage)),r=uu(aF({lazySink:function(){return a.getSink()},headerOverride:et.some(tF),partSpecs:{title:oF(),close:eF(function(){e()},a.providers),body:rF(t,a.providers),footer:iF(uF([],[o.asSpec()]))},onCancel:function(){return e()},onSubmit:tt,extraClasses:["tox-alert-dialog"]}));J_.show(r);var i=o.get(r);Rm.focus(i)}}),o=(l=(c=s).backstage.shared,{open:function(t,n){var e=function(t){J_.hide(i),n(t)},o=vg(xk({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:et.none()},"submit",c.backstage)),r=xk({name:"no",text:"No",primary:!0,align:"end",disabled:!1,icon:et.none()},"cancel",c.backstage),i=uu(aF({lazySink:function(){return l.getSink()},headerOverride:et.some(tF),partSpecs:{title:oF(),close:eF(function(){e(!1)},l.providers),body:rF(t,l.providers),footer:iF(uF([],[r,o.asSpec()]))},onCancel:function(){return e(!1)},onSubmit:function(){return e(!0)},extraClasses:["tox-confirm-dialog"]}));J_.show(i);var u=o.get(i);Rm.focus(u)}}),r=function(t,e){return lA.openUrl(function(t){var n=QA(t,{closeWindow:function(){J_.hide(n.dialog),e(n.instanceApi)}},s.editor,s.backstage);return J_.show(n.dialog),n.instanceApi},t)},i=function(t,i){return lA.open(function(t,n,e){var o=n,r=qA({dataValidator:e,initialData:o,internalDialog:t},{redial:lA.redial,closeWindow:function(){J_.hide(r.dialog),i(r.instanceApi)}},s.backstage);return J_.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},f=function(t,u,a,c){return lA.open(function(t,n,e){var o=Cn(kn("data",e,n)),r=ZA({dataValidator:e,initialData:o,internalDialog:t},{redial:lA.redial,closeWindow:function(){gg.hide(i),a(r.instanceApi)}},s.backstage,c),i=uu(gg.sketch({lazySink:s.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:Lu([Dm("window-manager-inline-events",[fr(Fo(),function(t,n){Po(r.dialog,wb)})])])}));return gg.showAt(i,u,au(r.dialog)),r.instanceApi.setData(o),fm.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?f(t,s.backstage.shared.anchors.toolbar(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?f(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 bF(){e.add("silver",function(t){var n=G_(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;Av(t,o.shared);var u=cF({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:nt(u),getNotificationManagerImpl:function(){return kg(t,{backstage:o},e)},ui:i()}})}()}(window);