|
@@ -4,6 +4,6 @@
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.3.0 (2020-05-21)
|
7
|
+
* Version: 5.3.2 (2020-06-10)
|
8
8
|
*/
|
9
|
-
!function(nt){"use strict";var Z=function(){},d=function(e,o){return function(){for(var t=[],n=0;n "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},fn=function(r){return{extract:function(e,o,t){var n=V(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return tn(n)},toString:function(){return"array("+r.toString()+")"}}},dn=function(a,c){return{extract:function(e,o,r){var t,n,i=lt(r),u=(t=e,n=i,fn(cn(a)).extract(t,ct,n));return Ht(u,function(t){var n=V(t,function(t){return on.field(t,t,Ut(),c)});return ln(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"}}},mn=at(cn(It)),gn=d(fn,ln),pn=on.state,hn=on.field,vn=function(e,n,o,r,i){return bt(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 bt(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: "+lt(i)}}},yn=cn(It),xn=function(t){return gn(t)},wn=function(o){return{extract:function(t,n,e){return o().extract(t,n,e)},toString:function(){return o().toString()}}},Sn=function(n){return cn(function(t){return n(t).fold(Vt,It)})},kn=function(n,t){return dn(function(t){return At(n(t))},t)},Cn=function(t,n,e){return Ft((o=t,r=ct,i=e,u=n.extract([o],r,i),Nt(u,function(t){return{input:i,errors:t}})));var o,r,i,u},On=function(t){return t.fold(function(t){throw new Error(Tn(t))},ct)},_n=function(t,n,e){return On(Cn(t,n,e))},Tn=function(t){return"Errors: \n"+(n=t.errors,e=10 ")+")\n"+t.getErrorInfo()}).join("\n"))+"\n\nInput object: "+nn(t.input);var n,e},En=function(t,n){return bn(t,n)},Bn=function(t,n){return bn(t,dt(n,ln))},Dn=at(yn),Mn=function(e,o){return cn(function(t){var n=typeof t;return e(t)?It(t):Vt("Expected type: "+o+" but got: "+n)})},An=Mn(rt,"number"),Fn=Mn(S,"string"),In=Mn(O,"boolean"),Rn=Mn(T,"function"),Vn=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 Vn(n[t])});case"Map":return t(n.keys(),Vn)&&t(n.values(),Vn);case"Set":return t(n.keys(),Vn);default:return!1}},Hn=cn(function(t){return Vn(t)?It(t):Vt("Expected value to be acceptable for sending via postMessage")}),Pn=function(n){return Sn(function(t){return F(n,t)?ot.value(t):ot.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},zn=function(t){return hn(t,t,Ut(),mn())},Nn=function(t,n){return hn(t,t,Ut(),n)},Ln=function(t){return Nn(t,Fn)},jn=function(t,n){return hn(t,t,Ut(),Pn(n))},Un=function(t){return Nn(t,Rn)},Wn=function(t,n){return hn(t,t,Ut(),ln(n))},Gn=function(t,n){return hn(t,t,Ut(),gn(n))},Xn=function(t,n){return hn(t,t,Ut(),fn(n))},Yn=function(t){return hn(t,t,Wt(),mn())},qn=function(t,n){return hn(t,t,Wt(),n)},Kn=function(t){return qn(t,An)},Jn=function(t){return qn(t,Fn)},$n=function(t){return qn(t,Rn)},Qn=function(t,n){return qn(t,ln(n))},Zn=function(t,n){return hn(t,t,jt(n),mn())},te=function(t,n,e){return hn(t,t,jt(n),e)},ne=function(t,n){return te(t,n,An)},ee=function(t,n){return te(t,n,Fn)},oe=function(t,n,e){return te(t,n,Pn(e))},re=function(t,n){return te(t,n,In)},ie=function(t,n){return te(t,n,Rn)},ue=function(t,n,e){return te(t,n,ln(e))},ae=function(t,n){return pn(t,n)},ce=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},se=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:at(t)}},le={fromHtml:function(t,n){var e=(n||nt.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1=o.length&&e.substr(r,r+o.length)===o?t.substring(0,t.length-"/*".length):t;var n,e,o,r})},Qr=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:$r(i)}},t},Zr=Nr("alloy-premade"),ti=function(t){return Kt(Zr,t)},ni=function(o){return t=function(t){for(var n=[],e=1;e "):o[0].name();return Kt(r,{handler:n,purpose:at(e)})})});return $t(n,{})},mi=function(t){return Cn("custom.definition",ln([hn("dom","dom",Ut(),ln([zn("tag"),Zn("styles",{}),Zn("classes",[]),Zn("attributes",{}),Yn("value"),Yn("innerHtml")])),zn("components"),zn("uid"),Zn("events",{}),Zn("apis",{}),hn("eventOrder","eventOrder",Lt.mergeWithThunk(at({"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"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting"]})),Dn()),Yn("domModification")]),t)},gi=function(t,n){var e=Dr(t,n);return e===undefined||""===e?[]:e.split(" ")},pi=function(t){return t.dom().classList!==undefined},hi=function(t,n){return r=n,i=gi(e=t,o="class").concat([r]),Br(e,o,i.join(" ")),!0;var e,o,r,i},vi=function(t,n){return r=n,0<(i=P(gi(e=t,o="class"),function(t){return t!==r})).length?Br(e,o,i.join(" ")):Fr(e,o),!1;var e,o,r,i},bi=function(t,n){pi(t)?t.dom().classList.add(n):hi(t,n)},yi=function(t){0===(pi(t)?t.dom().classList:gi(t,"class")).length&&Fr(t,"class")},xi=function(t,n){pi(t)?t.dom().classList.remove(n):vi(t,n);yi(t)},wi=function(t,n){return pi(t)&&t.dom().classList.contains(n)},Si=function(n,t){it(t,function(t){bi(n,t)})},ki=function(n,t){it(t,function(t){xi(n,t)})},Ci=function(t){return t.style!==undefined&&T(t.style.getPropertyValue)},Oi=function(t){var n=Tr(t)?t.dom().parentNode:t.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)},_i=function(){return Ti(le.fromDom(nt.document))},Ti=function(t){var n=t.dom().body;if(null===n||n===undefined)throw new Error("Body is not available yet");return le.fromDom(n)},Ei=function(t,n,e){if(!S(e))throw nt.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Ci(t)&&t.style.setProperty(n,e)},Bi=function(t,n){Ci(t)&&t.style.removeProperty(n)},Di=function(t,n,e){var o=t.dom();Ei(o,n,e)},Mi=function(t,n){var e=t.dom();ft(n,function(t,n){Ei(e,n,t)})},Ai=function(t,n){var e=t.dom();ft(n,function(t,n){t.fold(function(){Bi(e,n)},function(t){Ei(e,n,t)})})},Fi=function(t,n){var e=t.dom(),o=nt.window.getComputedStyle(e).getPropertyValue(n);return""!==o||Oi(t)?o:Ii(e,n)},Ii=function(t,n){return Ci(t)?t.style.getPropertyValue(n):""},Ri=function(t,n){var e=t.dom(),o=Ii(e,n);return st.from(o).filter(function(t){return 0"}),Dn()),Pl=ae("schema",function(){return[Yn("preprocess")]}),zl=Zn("defaults",at({})),Nl=Zn("overrides",at({})),Ll=ln([Il,Rl,Vl,Hl,zl,Nl]),jl=ln([Il,Rl,Vl,zl,Nl]),Ul=ln([Il,Rl,Vl,Hl,zl,Nl]),Wl=ln([Il,Pl,Vl,zn("unit"),Hl,zl,Nl]),Gl=function(t){return t.fold(st.some,st.none,st.some,st.some)},Xl=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Yl=function(e,o){return function(t){var n=_n("Converting part type",o,t);return e(n)}},ql=Yl(Fl.required,Ll),Kl=Yl(Fl.external,jl),Jl=Yl(Fl.optional,Ul),$l=Yl(Fl.group,Wl),Ql=at("entirety"),Zl=/* */Object.freeze({__proto__:null,required:ql,external:Kl,optional:Jl,group:$l,asNamedPart:Gl,name:Xl,asCommon:function(t){return t.fold(ct,ct,ct,ct)},original:Ql}),tf=function(t,n,e,o){return Ct(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},nf=function(r,t){var n={};return it(t,function(t){Gl(t).each(function(e){var o=ef(r,e.pname);n[e.name]=function(t){var n=_n("Part: "+e.name+" in "+r,ln(e.schema),t);return et(et({},o),{config:t,validated:n})}})}),n},ef=function(t,n){return{uiType:Al(),owner:t,name:n}},of=function(t,n,e){return{uiType:Al(),owner:t,name:n,config:e,validated:{}}},rf=function(t){return U(t,function(t){return t.fold(st.none,st.some,st.none,st.none).map(function(t){return Wn(t.name,t.schema.concat([ea(Ql())]))}).toArray()})},uf=function(t){return V(t,Xl)},af=function(t,n,e){return o=n,i={},r={},it(e,function(t){t.fold(function(o){i[o.pname]=Dl(!0,function(t,n,e){return o.factory.sketch(tf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=at(t.factory.sketch(tf(o,t,n[Ql()]),n))},function(o){i[o.pname]=Dl(!1,function(t,n,e){return o.factory.sketch(tf(t,o,n,e))})},function(r){i[r.pname]=Ml(!0,function(n,t,e){var o=n[r.name];return V(o,function(t){return r.factory.sketch(Ct(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:at(i),externals:at(r)};var o,i,r},cf=function(t,n,e){return Bl(st.some(t),n,n.components,e)},sf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},lf=function(t,n,e){return sf(t,n,e).getOrDie("Could not find part: "+e)},ff=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return it(e,function(t){o[t]=at(i.getByUid(r[t]))}),o},df=function(t,n){var e=t.getSystem();return dt(n.partUids,function(t,n){return at(e.getByUid(t))})},mf=function(t){return lt(t.partUids)},gf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return it(e,function(t){o[t]=at(i.getByUid(r[t]).getOrDie())}),o},pf=function(n,t){var e=uf(t);return Jt(V(e,function(t){return{key:t,value:n+"-"+t}}))},hf=function(n){return hn("partUids","partUids",Xt(function(t){return pf(t.uid,n)}),Dn())},vf=/* */Object.freeze({__proto__:null,generate:nf,generateOne:of,schemas:rf,names:uf,substitutes:af,components:cf,defaultUids:pf,defaultUidsSchema:hf,getAllParts:df,getAllPartNames:mf,getPart:sf,getPartOrDie:lf,getParts:ff,getPartsOrDie:gf}),bf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Wn("parts",i)]:[]).concat([zn("uid"),Zn("dom",{}),Zn("components",[]),ea("originalSpec"),Zn("debug.sketcher",{})]).concat(u));return _n(t+" [SpecSchema]",sn(a.concat(n)),e)},yf=function(t,n,e,o,r){var i=xf(r),u=rf(e),a=hf(e),c=bf(t,n,i,u,[a]),s=af(0,c,e);return o(c,cf(t,c,s.internals()),i,s.externals())},xf=function(t){return yt(t,"uid")?t:et(et({},t),{uid:Yr("uid")})};var wf,Sf,kf=sn([zn("name"),zn("factory"),zn("configFields"),Zn("apis",{}),Zn("extraApis",{})]),Cf=sn([zn("name"),zn("factory"),zn("configFields"),zn("partFields"),Zn("apis",{}),Zn("extraApis",{})]),Of=function(t){var i=_n("Sketcher for "+t.name,kf,t),n=dt(i.apis,ni),e=dt(i.extraApis,function(t,n){return Qr(t,n)});return et(et({name:at(i.name),configFields:at(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=xf(t),o(bf(n,e,r,[],[]),r);var n,e,o,r}},n),e)},_f=function(t){var n=_n("Sketcher for "+t.name,Cf,t),e=nf(n.name,n.partFields),o=dt(n.apis,ni),r=dt(n.extraApis,function(t,n){return Qr(t,n)});return et(et({name:at(n.name),partFields:at(n.partFields),configFields:at(n.configFields),sketch:function(t){return yf(n.name,n.configFields,n.partFields,n.factory,t)},parts:at(e)},o),r)},Tf=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o',e.getDoc());return vr(t,le.fromDom(n.extractContents())),n.insertNode(t.dom()),lr(t).each(function(t){return t.dom().normalize()}),Xc(t,Gc).map(function(t){var n;e.selection.setCursorLocation(t.dom(),"img"===Cr(n=t)?1:Uc(n).fold(function(){return dr(n).length},function(t){return t.length}))}),t})},np=function(t){return Au(t,"[data-mce-autocompleter]")},ep=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},op=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},rp=function(t,n){return t.substring(n.length)},ip=function(t,o,r,i){if(void 0===i&&(i=0),!(n=o).collapsed||3!==n.startContainer.nodeType)return st.none();var n,e=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return Zg(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){var o;for(o=n-1;0<=o;o--){var r=t.charAt(o);if(op(r))return st.none();if(r===e)break}return st.some(o)}(e,n,r).getOr(n)},e).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return st.none();var e=ep(n);return 0!==e.lastIndexOf(r)||rp(e,r).length =t.minChars&&t.matches.getOrThunk(function(){return dp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=cp.all(V(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 st.some({lookupData:a,context:e})},pp=ln([Ln("type"),Jn("text")]),hp=ln([ae("type",function(){return"autocompleteitem"}),ae("active",function(){return!1}),ae("disabled",function(){return!1}),Zn("meta",{}),Ln("value"),Jn("text"),Jn("icon")]),vp=ln([Ln("type"),Ln("ch"),ne("minChars",1),Zn("columns",1),ne("maxResults",10),$n("matches"),Un("fetch"),Un("onAction")]),bp=function(t){var n,e,o=t.ui.registry.getAll().popups,r=dt(o,function(t){return Cn("Autocompleter",vp,t).fold(function(t){throw new Error(Tn(t))},function(t){return t})}),i=(n=pt(r,function(t){return t.ch}),e={},it(n,function(t){e[t]={}}),lt(e)),u=vt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return P(u,function(t){return t.ch===n})}}},yp=[re("disabled",!1),Jn("text"),Jn("shortcut"),hn("value","value",Gt(function(){return Nr("menuitem-value")}),Dn()),Zn("meta",{})],xp=ln([Ln("type"),ie("onSetup",function(){return Z}),ie("onAction",Z),Jn("icon")].concat(yp)),wp=ln([Ln("type"),Un("getSubmenuItems"),ie("onSetup",function(){return Z}),Jn("icon")].concat(yp)),Sp=ln([Ln("type"),Jn("icon"),re("active",!1),ie("onSetup",function(){return Z}),Un("onAction")].concat(yp)),kp=ln([Ln("type"),re("active",!1),Jn("icon")].concat(yp)),Cp=ln([Ln("type"),jn("fancytype",["inserttable","colorswatch"]),ie("onAction",Z)]),Op=function(t,o,n){var r=Yc(t.element(),"."+n);if(0o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},_p=function(t,n){return za([Lm(t,n)])},Tp=function(t){return _p(Nr("unnamed-events"),t)},Ep=[zn("lazySink"),zn("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:at([_a,Oa,wa,ka,Sa,Ca]),onRtl:at([_a,Oa,wa,ka,Sa,Ca])}}}),$u("onHide"),$u("onShow")],Bp=/* */Object.freeze({__proto__:null,init:function(){var e=ce(st.none()),n=ce(st.none()),o=function(){e.get().each(function(t){nt.clearTimeout(t)})},t=at("not-implemented");return oi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(st.some(t))},clearTooltip:function(){n.set(st.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(st.some(nt.setTimeout(function(){t()},n)))},readState:t})}}),Dp=Nr("tooltip.exclusive"),Mp=Nr("tooltip.show"),Ap=Nr("tooltip.hide"),Fp=function(t,n,e){t.getSystem().broadcastOn([Dp],{})},Ip=/* */Object.freeze({__proto__:null,hideAllExclusive:Fp,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Nm.set(t,o)})}}),Rp=La({fields:Ep,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Ps(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return Yo(ut([[Jo(Mp,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){Fp(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:Yo("normal"===o.mode?[Jo(ro(),function(t){Lo(n,Mp)}),Jo(eo(),function(t){Lo(n,Ap)})]:[]),behaviours:za([Nm.config({})])});r.setTooltip(e),Rs(t,e),o.onShow(n,e),Ds.position(t,o.anchor(n),e)}}(t)},o.delay)}),Jo(Ap,function(t){r.resetTimer(function(){e(t)},o.delay)}),Jo(yo(),function(t,n){F(n.channels(),Dp)&&e(t)}),rr(function(t){e(t)})],"normal"===o.mode?[Jo(io(),function(t){Lo(t,Mp)}),Jo(vo(),function(t){Lo(t,Ap)}),Jo(ro(),function(t){Lo(t,Mp)}),Jo(eo(),function(t){Lo(t,Ap)})]:[Jo(zo(),function(t,n){Lo(t,Mp)}),Jo(No(),function(t){Lo(t,Ap)})]]))}}),state:Bp,apis:Ip}),Vp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Hp="tox-menu-nav__js",Pp="tox-collection__item",zp="tox-swatch",Np={normal:Hp,color:zp},Lp="tox-collection__item--enabled",jp="tox-collection__item-label",Up="tox-collection__item-caret",Wp="tox-collection__item--active",Gp=function(t){return bt(Np,t).getOr(Hp)},Xp=tinymce.util.Tools.resolve("tinymce.Env"),Yp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},qp=function(t){return{dom:{tag:"div",classes:[jp]},components:[Yi(Vp.translate(t))]}},Kp=function(t,n){return{dom:{tag:"div",classes:[jp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(Vp.translate(n))]}]}},Jp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(n=t,e=Xp.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},o=n.split("+"),r=V(o,function(t){var n=t.toLowerCase().trim();return yt(e,n)?e[n]:t}),Xp.mac?r.join(""):r.join("+"))}};var n,e,o,r},$p=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:Gg("checkmark",t)}}},Qp=function(t,n,e,o,r){var i=e?n.or(st.some("")).map(Yp):st.none(),u=t.checkMark,a=t.ariaLabel.map(function(t){return{attributes:{title:Vp.translate(t)}}}).getOr({});return{dom:et({tag:"div",classes:[Hp,Pp].concat(r?["tox-collection__item-icon-rtl"]:[])},a),optComponents:[i,t.htmlContent.fold(function(){return t.textContent.map(o)},function(t){return st.some({dom:{tag:"div",classes:[jp],innerHtml:t}})}),t.shortcutContent.map(Jp),u,t.caret]}},Zp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],th=["list-bull-circle","list-bull-default","list-bull-square"],nh=function(t,r,n,i){void 0===i&&(i=st.none());var e,o,u,a,c,s=Vp.isRtl()&&t.iconContent.exists(function(t){return F(th,t)}),l=t.iconContent.map(function(t){return Vp.isRtl()&&F(Zp,t)?t+"-rtl":t}).map(function(t){return n=t,e=r.icons,o=i,st.from(e()[n]).or(o).getOrThunk(function(){return Wg(e)});var n,e,o}),f=st.from(t.meta).fold(function(){return qp},function(t){return yt(t,"style")?g(Kp,t.style):qp});return"color"===t.presets?(e=t.ariaLabel,o=t.value,u=r,{dom:(a=l.getOr(""),c={tag:"div",attributes:e.map(function(t){return{title:u.translate(t)}}).getOr({}),classes:["tox-swatch"]},et(et({},c),"custom"===o?{tag:"button",classes:b(c.classes,["tox-swatches__picker-btn"]),innerHtml:a}:"remove"===o?{classes:b(c.classes,["tox-swatch--remove"]),innerHtml:a}:{attributes:et(et({},c.attributes),{"data-mce-color":o}),styles:{"background-color":o}})),optComponents:[]}):Qp(t,l,n,f,s)},eh=["input","button","textarea","select"],oh=function(t,n,e){(n.disabled()?sh:lh)(t,n,e)},rh=function(t,n){return!0===n.useNative&&F(eh,Cr(t.element()))},ih=function(t){Br(t.element(),"disabled","disabled")},uh=function(t){Fr(t.element(),"disabled")},ah=function(t){Br(t.element(),"aria-disabled","true")},ch=function(t){Br(t.element(),"aria-disabled","false")},sh=function(n,t,e){t.disableClass.each(function(t){bi(n.element(),t)}),(rh(n,t)?ih:ah)(n),t.onDisabled(n)},lh=function(n,t,e){t.disableClass.each(function(t){xi(n.element(),t)}),(rh(n,t)?uh:ch)(n),t.onEnabled(n)},fh=function(t,n){return rh(t,n)?Ar(t.element(),"disabled"):"true"===Dr(t.element(),"aria-disabled")},dh=/* */Object.freeze({__proto__:null,enable:lh,disable:sh,isDisabled:fh,onLoad:oh,set:function(t,n,e,o){(o?sh:lh)(t,n,e)}}),mh=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return ii({classes:n.disabled?n.disableClass.map(Y).getOr([]):[]})},events:function(e,t){return Yo([qo(xo(),function(t,n){return fh(t,e)}),Ia(e,t,oh)])}}),gh=[ie("disabled",c),Zn("useNative",!0),Yn("disableClass"),$u("onDisabled"),$u("onEnabled")],ph=La({fields:gh,name:"disabling",active:mh,apis:dh}),hh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),vh=tinymce.util.Tools.resolve("tinymce.EditorManager"),bh=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},yh=function(t){return t.getParam("width",hh.DOM.getStyle(t.getElement(),"width"))},xh=function(t){return st.from(t.settings.min_width).filter(rt)},wh=function(t){return st.from(t.settings.min_height).filter(rt)},Sh=function(t){return st.from(t.getParam("max_width")).filter(rt)},kh=function(t){return st.from(t.getParam("max_height")).filter(rt)},Ch=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Oh=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=S(n),r=C(n)&&0'+t+""})}return r},ov=at(nf(pg(),hg())),rv=Nr("cell-over"),iv=Nr("cell-execute"),uv=function(n,e,t){var o,r=function(t){return jo(t,iv,{row:n,col:e})},i=function(t,n){n.stop(),r(t)};return Ji({dom:{tag:"div",attributes:((o={role:"button"})["aria-labelledby"]=t,o)},behaviours:za([Lm("insert-table-picker-cell",[Jo(ro(),Xm.focus),Jo(xo(),r),Jo(fo(),i),Jo(So(),i)]),rg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Xm.config({onFocus:function(t){return jo(t,rv,{row:n,col:e})}})])})},av=function(t){return{value:t}},cv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,sv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,lv=function(t){return cv.test(t)||sv.test(t)},fv=function(t){var n={value:t.value.replace(cv,function(t,n,e,o){return n+n+e+e+o+o})},e=sv.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},dv=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},mv=function(t){var n=dv(t.red)+dv(t.green)+dv(t.blue);return av(n)},gv=Math.min,pv=Math.max,hv=Math.round,vv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,bv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,yv=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},xv=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},wv=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=pv(0,gv(i,1)),u=pv(0,gv(u,1)),0===i)return n=e=o=hv(255*u),yv(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=hv(255*(n+l)),e=hv(255*(e+l)),o=hv(255*(o+l)),yv(n,e,o,1)},Sv=function(t){var n=fv(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return yv(e,o,r,1)},kv=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return yv(r,i,u,a)},Cv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Ov=yv(255,0,0,1),_v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Tv="tinymce-custom-colors";var Ev="choiceitem",Bv=[{type:Ev,text:"Light Green",value:"#BFEDD2"},{type:Ev,text:"Light Yellow",value:"#FBEEB8"},{type:Ev,text:"Light Red",value:"#F8CAC6"},{type:Ev,text:"Light Purple",value:"#ECCAFA"},{type:Ev,text:"Light Blue",value:"#C2E0F4"},{type:Ev,text:"Green",value:"#2DC26B"},{type:Ev,text:"Yellow",value:"#F1C40F"},{type:Ev,text:"Red",value:"#E03E2D"},{type:Ev,text:"Purple",value:"#B96AD9"},{type:Ev,text:"Blue",value:"#3598DB"},{type:Ev,text:"Dark Turquoise",value:"#169179"},{type:Ev,text:"Orange",value:"#E67E23"},{type:Ev,text:"Dark Red",value:"#BA372A"},{type:Ev,text:"Dark Purple",value:"#843FA1"},{type:Ev,text:"Dark Blue",value:"#236FA1"},{type:Ev,text:"Light Gray",value:"#ECF0F1"},{type:Ev,text:"Medium Gray",value:"#CED4D9"},{type:Ev,text:"Gray",value:"#95A5A6"},{type:Ev,text:"Dark Gray",value:"#7E8C8D"},{type:Ev,text:"Navy Blue",value:"#34495E"},{type:Ev,text:"Black",value:"#000000"},{type:Ev,text:"White",value:"#ffffff"}],Dv=function zF(e){void 0===e&&(e=10);var t,n=_v.getItem(Tv),o=S(n)?JSON.parse(n):[],r=e-(t=o).length<0?t.slice(0,e):t,i=function(t){r.splice(t,1)};return{add:function(t){var n;(-1===(n=A(r,t))?st.none():st.some(n)).each(i),r.unshift(t),r.length>e&&r.pop(),_v.setItem(Tv,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Mv=function(t){return!1!==t.getParam("custom_colors")},Av=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=nt.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"},Ww=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:wl(o.formBehaviours,[bl.config({store:{mode:"manual",getValue:function(t){var n=df(t,o);return dt(n,function(t,r){return t().bind(function(t){var n,e,o=Mf.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+Vr(t.element())),n.fold(function(){return ot.error(e)},ot.value)}).map(bl.getValue)})},setValue:function(e,t){ft(t,function(n,t){sf(e,o,t).each(function(t){Mf.getCurrent(t).each(function(t){bl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return sf(t,o,n).bind(Mf.getCurrent)}}}},Gw={getField:ni(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),of("form",Uw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return ql({name:t,pname:Uw(t)})});return yf("form",jw,i,Ww,o)}},Xw=Nr("valid-input"),Yw=Nr("invalid-input"),qw=Nr("validating-input"),Kw="colorcustom.rgb.",Jw=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(Kw+"range"),c=[ey.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),ey.parts().field({data:r,factory:uy,inputAttributes:et({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:za([(i=n,u=t,Ty.config({invalidClass:m("invalid"),notify:{onValidate:function(t){jo(t,qw,{type:i})},onValid:function(t){jo(t,Xw,{type:i,value:bl.getValue(t)})},onInvalid:function(t){jo(t,Yw,{type:i,value:bl.getValue(t)})}},validator:{validate:function(t){var n=bl.getValue(t),e=u(n)?ot.value(!0):ot.error(d("aria.input.invalid"));return vy(e)},validateOnLoad:!1}})),Dy.config({})]),onSetValue:function(t){Ty.isInvalid(t)&&Ty.run(t).get(Z)}})],s="hex"!==n?[ey.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;bl.setValue(t,{red:e,green:o,blue:r})},b=Ug({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Di(t.element(),"background-color","#"+n.value)})};return Of({factory:function(){var e={red:ce(st.some(255)),green:ce(st.some(255)),blue:ce(st.some(255)),hex:ce(st.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",st.some(n)),i("green",st.some(e)),i("blue",st.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),st.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,st.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return yv(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=mv(t),Gw.getField(n,"hex").each(function(t){Xm.isFocused(t)||bl.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=av(n);i("hex",st.some(n));var o=Sv(e);v(t,o),r(o),jo(t,ix,{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(Kw+t+".label"),description:d(Kw+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return Ct(Gw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",ey.sketch(h(xv,"red",c.label,c.description,255))),t.field("green",ey.sketch(h(xv,"green",s.label,s.description,255))),t.field("blue",ey.sketch(h(xv,"blue",l.label,l.description,255))),t.field("hex",ey.sketch(h(lv,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:za([Ty.config({invalidClass:m("form-invalid")}),Lm("rgb-form-events",[Jo(Xw,a),Jo(Yw,n),Jo(qw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;bl.setValue(t,{hex:n.value}),e=t,o=Sv(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},$w=function(t,o){var r=Lw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Lw.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 Of({factory:function(t){var n=at({x:at(0),y:at(0)}),e=za([Mf.config({find:st.some}),Xm.config({})]);return Lw.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){jo(t,ax,{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),Cv(Ov))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,Cv(o))}},extraApis:{}})},Qw=function(f,d){return Of({name:"ColourPicker",configFields:[zn("dom"),Zn("onValidHex",Z),Zn("onInvalidHex",Z)],factory:function(t){var a,v,n,e,o,r=Jw(f,d,t.onValidHex,t.onInvalidHex),i=$w(0,d),b={paletteRgba:ce(Ov)},u=Ug(i.sketch({})),c=Ug(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=Sv(e);b.paletteRgba.set(n),i.setRgba(t,n)})},l=function(t,n){c.getOpt(t).each(function(t){r.updateHex(t,n)})},y=function(n,e,t){it(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=Lw.parts().spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Lw.parts().thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),Lw.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:at(0)})},components:[e,o],sliderBehaviours:za([Xm.config({})]),onChange:function(t,n,e){jo(t,ux,{value:e})}})),c.asSpec()],behaviours:za([Lm("colour-picker-events",[Jo(ax,(v=[l],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?rx(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,rx(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=rx(m.hue,f.x(),100-f.y()),p=wv(g),h=mv(p);y(t,h,v)})),Jo(ux,(a=[s,l],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=rx((100-e)/100*360,100,100),r=wv(o),mv(r));y(t,u,a)}))]),Mf.config({find:function(t){return c.getOpt(t)}}),Rm.config({mode:"acyclic"})])}}})},Zw=function(){return Mf.config({find:st.some})},tS=function(t){return Mf.config({find:t.getOpt})},nS=function(t){return Mf.config({find:function(n){return mr(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},eS={"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"},oS=function(t){return eS[t]},rS=tinymce.util.Tools.resolve("tinymce.Resource"),iS=ln([Zn("preprocess",ct),Zn("postprocess",ct)]),uS=function(t,n,e){return bl.config(Ct({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},aS=function(t,n,e){return uS(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},cS=function(r,t){var i=_n("RepresentingConfigs.memento processors",iS,t);return bl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=bl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);bl.setValue(o,e)}}})},sS=uS,lS=function(t){return aS(t,Sr,kr)},fS=function(t){return bl.config({store:{mode:"memory",initialValue:t}})},dS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){it(t,function(t){t(n,e)})}},i=function(t,n){if(!ph.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;bl.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),P($(e),function(t){return o.test(t.name)}))),jo(t,Gb,{name:r.name})},c=Ug({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:za([Lm("input-file-events",[nr(fo()),nr(So())])])}),t=r.label.map(function(t){return Iy(t,n)}),s=ey.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:za([fS([]),Zw(),ph.config({}),rg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Lm("dropzone-events",[Jo("dragenter",o([e,rg.toggle])),Jo("dragleave",o([e,rg.toggle])),Jo("dragover",e),Jo("drop",o([e,i])),Jo(lo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},jg.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:za([Dy.config({}),Gh(n.isReadOnly),Uh()])})]}]}}}});return My(t,s,["tox-form__group--stretched"],[])},mS=Nr("alloy-fake-before-tabstop"),gS=Nr("alloy-fake-after-tabstop"),pS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:za([Xm.config({ignore:!0}),Dy.config({})])}},hS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[pS([mS]),t,pS([gS])],behaviours:za([nS(1)])}},vS=function(t,n){jo(t,ao(),{raw:{which:9,shiftKey:n}})},bS=function(t,n){var e=n.element();wi(e,mS)?vS(t,!0):wi(e,gS)&&vS(t,!1)},yS=function(t){return Sb(t,["."+mS,"."+gS].join(","),at(!1))},xS=!(Pe().browser.isIE()||Pe().browser.isEdge()),wS=function(t,n){var o,r,e=xS&&t.sandboxed,i=et(et({},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)Br(t.element(),"srcdoc",n);else{Br(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 Iy(t,n)}),c=ey.parts().field({factory:{sketch:function(t){return hS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:za([Dy.config({}),Xm.config({}),sS(st.none(),u.getValue,u.setValue)])})}}});return My(a,c,["tox-form__group--stretched"],[])};function SS(t,n){return OS(nt.document.createElement("canvas"),t,n)}function kS(t){var n=SS(t.width,t.height);return CS(n).drawImage(t,0,0),n}function CS(t){return t.getContext("2d")}function OS(t,n,e){return t.width=n,t.height=e,t}function _S(t){return t.naturalWidth||t.width}function TS(t){return t.naturalHeight||t.height}var ES,BS,DS,MS=window.Promise?window.Promise:(BS=(ES=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=[],PS(t,AS(IS,this),AS(RS,this))}).immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){nt.setTimeout(t,1)},DS=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},ES.prototype["catch"]=function(t){return this.then(null,t)},ES.prototype.then=function(e,o){var r=this;return new ES(function(t,n){FS.call(r,new HS(e,o,t,n))})},ES.all=function(){for(var t=[],n=0;n ").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),oC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(cC(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){cC(t),oC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){oC(m).off()},oC(m).on("mousedown touchstart",n)}var lC=0,fC=function(s,e,l,o,r){var f,n,i,u="tox-",a="tox-crid-"+lC++,c=[{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"];var d=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},m=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function g(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=rC.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=m(l,c),f.fire("updateRect",{rect:c}),v(c)}function p(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),oC("#"+a+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}uC.each(c,function(t){oC("#"+a+"-"+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 h(t){p(s=t)}function v(t){h(d(l,t))}return function b(){oC('').appendTo(o),uC.each(i,function(t){oC("#"+a,o).append(' ')}),uC.each(c,function(t){oC("#"+a,o).append(' ')}),n=uC.map(c,function t(n){var e;return new sC(a,{document:o.ownerDocument,handle:a+"-"+n.name,start:function(){e=s},drag:function(t){g(n,e,t.deltaX,t.deltaY)}})}),p(s),oC(o).on("focusin focusout",function(t){oC(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),oC(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),g(i,e,o,r)}switch(uC.each(c,function(t){if(n.target.id===a+"-"+t.name)return i=t,!1}),n.keyCode){case aC.LEFT:t(n,0,s,-10,0);break;case aC.RIGHT:t(n,0,s,10,0);break;case aC.UP:t(n,0,s,0,-10);break;case aC.DOWN:t(n,0,s,0,10);break;case aC.ENTER:case aC.SPACEBAR:n.preventDefault(),r()}})}(),f=uC.extend({toggleVisibility:function y(t){var n;n=uC.map(c,function(t){return"#"+a+"-"+t.name}).concat(uC.map(i,function(t){return"#"+a+"-"+t})).join(","),t?oC(n,o).show():oC(n,o).hide()},setClampRect:function x(t){l=t,p(s)},setRect:h,getInnerRect:function(){return m(l,s)},setInnerRect:v,setViewPortRect:function w(t){e=t,p(s)},destroy:function t(){uC.each(n,function(t){t.destroy()}),n=[]}},iC)},dC=function(n){var l=Ug({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=ce(1),d=ce(st.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=f.get(),o=cu(t.element()),r=tu(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"};Mi(s,n),l.getOpt(t).each(function(t){Mi(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=le.fromTag("img");return Br(a,"src",n),e=a.dom(),new cp(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=qi({element:a});Nm.replaceAt(t,1,st.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=rC.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=cu(t.element()),e=tu(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=Ub.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:za([Lm("image-panel-crop-events",[or(function(t){g.getOpt(t).each(function(t){var n=t.element().dom(),e=fC({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},n,function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var n=t.rect,e=f.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(st.some(e))})})])])}],containerBehaviours:za([Nm.config({}),Lm("image-panel-events",[or(function(t){e(t,n)})])])}),g=Ug(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=f.get(),o=0 =r.minChars){var o=Mf.getCurrent(e).bind(function(t){return jf.getHighlighted(t).map(bl.getValue)});r.previewing.set(!0);Ly(r,u(t),t,e,i,function(t){Mf.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&jf.highlightFirst(t)},function(n){jf.highlightBy(t,function(t){return bl.getValue(t).value===n.value}),jf.getHighlighted(t).orThunk(function(){return jf.highlightFirst(t),st.none()})})})},sy.HighlightFirst).get(Z)}},cancelEvent:Oo()}),Rm.config({mode:"special",onDown:function(t,n){return e(t,n,jf.highlightFirst),st.some(!0)},onEscape:function(t){var n=Hy.getCoupled(t,"sandbox");return Qs.isOpen(n)?(Qs.close(n),st.some(!0)):st.none()},onUp:function(t,n){return e(t,n,jf.highlightLast),st.some(!0)},onEnter:function(n){var t=Hy.getCoupled(n,"sandbox"),e=Qs.isOpen(t);if(e&&!r.previewing.get())return Mf.getCurrent(t).bind(function(t){return jf.getHighlighted(t)}).map(function(t){return jo(n,FC(),{item:t}),!0});var o=bl.getValue(n);return Lo(n,Oo()),r.onExecute(t,n,o),e&&Qs.close(t),st.some(!0)}}),rg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Hy.config({others:{sandbox:function(t){return Yy(r,t,{onOpen:function(){return rg.on(t)},onClose:function(){return rg.off(t)}})}}}),Lm("typeaheadevents",[ur(function(t){var n=Z;Uy(r,u(t),t,i,n,sy.HighlightFirst).get(Z)}),Jo(FC(),function(t,n){var e=Hy.getCoupled(t,"sandbox");BC(r.model,t,n.event().item()),Lo(t,Oo()),r.onItemExecute(t,e,n.event().item(),bl.getValue(t)),Qs.close(e),MC(t)})].concat(r.dismissOnBlur?[Jo(vo(),function(t){var n=Hy.getCoupled(t,"sandbox");$a(n.element()).isNone()&&Qs.close(n)})]:[]))];return{uid:r.uid,dom:iy(Ct(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:et(et({},o),wl(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),HC=function(i){return et(et({},i),{toCached:function(){return HC(i.toCached())},bindFuture:function(n){return HC(i.bind(function(t){return t.fold(function(t){return vy(ot.error(t))},function(t){return n(t)})}))},bindResult:function(n){return HC(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return HC(i.map(function(t){return t.map(n)}))},mapError:function(n){return HC(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return HC(hy(function(n){var e=!1,o=nt.setTimeout(function(){e=!0,n(ot.error(r()))},t);i.get(function(t){e||(nt.clearTimeout(o),n(t))})}))}})},PC=function(t){return HC(hy(t))},zC=PC,NC={type:"separator"},LC=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},jC=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:undefined},onAction:function(){}}},UC=function(t,n){return o=t,e=P(n,function(t){return t.type===o}),V(e,LC);var e,o},WC=function(t,n){var e=t.toLowerCase();return P(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return Ee(n.toLowerCase(),e)||Ee(t.value.toLowerCase(),e)})},GC=function(u,t,a){var n=bl.getValue(t),c=n.meta.text!==undefined?n.meta.text:n.value;return a.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i=WC(c,(n=a.getHistory(u),V(n,function(t){return jC(t,t)})));return"file"===u?(e=[i,WC(c,UC("header",t.targets)),WC(c,ut([(r=t,st.from(r.anchorTop).map(function(t){return jC("",t)}).toArray()),UC("anchor",t.targets),(o=t,st.from(o.anchorBottom).map(function(t){return jC("",t)}).toArray())]))],N(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(NC,n)},[])):i})},XC=Nr("aria-invalid"),YC=function(r,o,i){var t,n,e,u,a,c=o.shared.providers,s=function(t){var n=bl.getValue(t);i.addToHistory(n.value,r.filetype)},l=ey.parts().field({factory:VC,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":XC,type:"url"},minChars:0,responseTime:0,fetch:function(t){var n=GC(r.filetype,t,i),e=Dk(n,$h.BUBBLE_TO_SANDBOX,o,!1);return vy(e)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(Ty)&&Ty.run(t).get(Z)},typeaheadBehaviours:za(ut([i.getValidationHandler().map(function(e){return Ty.config({getRoot:function(t){return lr(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){d.getOpt(t).each(function(t){Br(t.element(),"title",c.translate(n))})}},validator:{validate:function(t){var n=bl.getValue(t);return zC(function(o){e({type:r.filetype,url:n.value},function(t){if("invalid"===t.status){var n=ot.error(t.message);o(n)}else{var e=ot.value(t.message);o(e)}})})},validateOnLoad:!1}})}).toArray(),[ph.config({disabled:function(){return r.disabled||c.isReadOnly()}}),Dy.config({}),Lm("urlinput-events",ut(["file"===r.filetype?[Jo(so(),function(t){jo(t,Gb,{name:r.name})})]:[],[Jo(lo(),function(t){jo(t,Gb,{name:r.name}),s(t)}),Jo(bo(),function(t){jo(t,Gb,{name:r.name}),s(t)})]]))]])),eventOrder:((t={})[so()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:o.shared.getSink,parts:{menu:Yv(0,0,"normal")},onExecute:function(t,n,e){jo(n,Kb,{})},onItemExecute:function(t,n,e,o){s(t),jo(t,Gb,{name:r.name})}}),f=r.label.map(function(t){return Iy(t,c)}),d=Ug((n="invalid",e=st.some(XC),void 0===(u="warning")&&(u=n),void 0===a&&(a=n),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],innerHtml:Gg(u,c.icons),attributes:et({title:c.translate(a),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}})),m=Ug({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=i.getUrlPicker(r.filetype),p=Nr("browser.url.event"),h=Ug({dom:{tag:"div",classes:["tox-control-wrap"]},components:[l,m.asSpec()],behaviours:za([ph.config({disabled:function(){return r.disabled||c.isReadOnly()}})])}),v=Ug(Pk({name:r.name,icon:st.some("browse"),text:r.label.getOr(""),disabled:r.disabled,primary:!1,borderless:!0},function(t){return Lo(t,p)},c,[],["tox-browse-url"]));return ey.sketch({dom:Fy([]),components:f.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:ut([[h.asSpec()],g.map(function(){return v.asSpec()}).toArray()])}]),fieldBehaviours:za([ph.config({disabled:function(){return r.disabled||c.isReadOnly()},onDisabled:function(t){ey.getField(t).each(ph.disable),v.getOpt(t).each(ph.disable)},onEnabled:function(t){ey.getField(t).each(ph.enable),v.getOpt(t).each(ph.enable)}}),Uh(),Lm("url-input-events",[Jo(p,function(o){Mf.getCurrent(o).each(function(n){var t=bl.getValue(n),e=et({fieldname:r.name},t);g.each(function(t){t(e).get(function(t){bl.setValue(n,t),jo(o,Gb,{name:r.name})})})})})])])})},qC=function(a,c){var t,n,e=a.label.map(function(t){return Iy(t,c)}),o=function(o){return function(n,e){Au(e.event().target(),"[data-collection-item-value]").each(function(t){o(n,e,t,Dr(t,"data-collection-item-value"))})}},r=function(t,n){var e=V(n,function(t){var n,e=Vp.translate(t.text),o=1===a.columns?''+e+" ":"",r=''+t.icon+" ",i={_:" "," - ":" ","-":" "},u=e.replace(/\_| \- |\-/g,function(t){return i[t]});return''+r+o+" "}),o=1'+t.join("")+""});kr(t.element(),r.join(""))},i=o(function(t,n,e,o){n.stop(),c.isReadOnly()||jo(t,qb,{name:a.name,value:o})}),u=[Jo(ro(),o(function(t,n,e){Ka(e)})),Jo(fo(),i),Jo(So(),i),Jo(io(),o(function(t,n,e){Mu(t.element(),"."+Wp).each(function(t){xi(t,Wp)}),bi(e,Wp)})),Jo(uo(),o(function(t){Mu(t.element(),"."+Wp).each(function(t){xi(t,Wp)})})),ur(o(function(t,n,e,o){jo(t,qb,{name:a.name,value:o})}))],s=function(t,n){return V(Yc(t.element(),".tox-collection__item"),n)},l=ey.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==a.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:ct},behaviours:za([ph.config({disabled:c.isReadOnly,onDisabled:function(t){s(t,function(t){bi(t,"tox-collection__item--state-disabled"),Br(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){xi(t,"tox-collection__item--state-disabled"),Fr(t,"aria-disabled")})}}),Uh(),Nm.config({}),bl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){r(o,t),"auto"===a.columns&&Op(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;Rm.setGridSize(o,n,e)}),Lo(o,Zb)}}),Dy.config({}),Rm.config((t=a.columns,n="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===n?".tox-swatches__row":".tox-collection__group",cell:"color"===n?"."+zp:"."+Pp}})),Lm("collection-events",u)]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","collection-events"]}});return My(e,l,["tox-form__group--collection"],[])},KC=function(r){return function(n,e,o){return bt(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},JC={bar:KC(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(e.items,o.interpreter)};var e,o}),collection:KC(function(t,n){return qC(t,n.shared.providers)}),alertbanner:KC(function(t,n){return e=t,o=n.shared.providers,Ub.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[jg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Gg(e.icon,o.icons),attributes:{title:o.translate(e.iconTooltip)}},action:function(t){jo(t,qb,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:KC(function(t,n){return e=t,o=n.shared.providers,kC({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:st.none(),maximized:e.maximized},o);var e,o}),textarea:KC(function(t,n){return e=t,o=n.shared.providers,kC({name:e.name,multiline:!0,label:e.label,inputMode:st.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:st.none(),maximized:e.maximized},o);var e,o}),label:KC(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=V(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:za([Zw(),Nm.config({}),lS(st.none()),Rm.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(hC=function(t,n){return wS(t,n.shared.providers)},function(t,n,e){var o=Ct(n,{source:"dynamic"});return KC(hC)(t,o,e)}),button:KC(function(t,n){return Lk(t,n.shared.providers)}),checkbox:KC(function(t,n){return e=t,o=n.shared.providers,r=bl.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,n){t.element().dom().checked=n}}}),i=function(t){return t.element().dom().click(),st.some(!0)},u=ey.parts().field({factory:{sketch:ct},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:za([Zw(),ph.config({disabled:function(){return e.disabled||o.isReadOnly()}}),Dy.config({}),Xm.config({}),r,Rm.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),Lm("checkbox-events",[Jo(lo(),function(t,n){jo(t,Gb,{name:e.name})})])])}),a=ey.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:za([Zy.config({})])}),s=Ug({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Gg("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),ey.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a],fieldBehaviours:za([ph.config({disabled:function(){return e.disabled||o.isReadOnly()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){ey.getField(t).each(ph.disable)},onEnabled:function(t){ey.getField(t).each(ph.enable)}}),Uh()])});var e,o,r,i,u,a,c,s}),colorinput:KC(function(t,n){return ox(t,n.shared,n.colorinput)}),colorpicker:KC(function(t){var n=function(t){return"tox-"+t},e=Qw(oS,n),r=Ug(e.sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){jo(t,qb,{name:"hex-valid",value:!0})},onInvalidHex:function(t){jo(t,qb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:za([bl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return Mf.getCurrent(n).bind(function(t){return bl.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);Mf.getCurrent(o).fold(function(){nt.console.log("Can not find form")},function(t){bl.setValue(t,{hex:st.from(e[1]).getOr("")}),Gw.getField(t,"hex").each(function(t){Lo(t,so())})})}}}),Zw()])}}),dropzone:KC(function(t,n){return dS(t,n.shared.providers)}),grid:KC(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:V(e.items,o.interpreter)};var e,o}),selectbox:KC(function(t,n){return e=t,o=n.shared.providers,r=V(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return Iy(t,o)}),u=ey.parts().field({dom:{},selectAttributes:{size:e.size},options:r,factory:SC,selectBehaviours:za([ph.config({disabled:function(){return e.disabled||o.isReadOnly()}}),Dy.config({}),Lm("selectbox-change",[Jo(lo(),function(t,n){jo(t,Gb,{name:e.name})})])])}),a=1 .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:za([Dy.config({}),Xm.config({})])}},F_=function(t){return UO.sketch(A_(t))},I_=function(e,t){var n=or(function(t){var n=V(e.initGroups,F_);XO.setGroups(t,n)});return za([Yh(e.providers.isReadOnly),Uh(),Rm.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),Lm("toolbar-events",[n])])},R_=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":A_({title:st.none(),items:[]}),"overflow-button":Rk({name:"more",icon:st.some("more-drawer"),disabled:!1,tooltip:st.some("More..."),primary:!1,borderless:!1},st.none(),t.providers)},splitToolbarBehaviours:I_(t,n)}},V_=function(i){var t=R_(i),n=l_.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return l_.sketch(et(et({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element(),n=Su(t),e=cr(t),o=Su(e),r=Math.max(e.dom().scrollHeight,o.height);return xu(n.x+4,o.y,n.width-8,r)},parts:et(et({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},H_=function(t){var n=D_.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=D_.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=R_(t);return D_.sketch(et(et({},o),{components:[n,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([M_()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([M_()],{type:"closed"})}}))},P_=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return XO.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===Kg.scrolling?["tox-toolbar--scrolling"]:[])},components:[XO.parts().groups({})],toolbarBehaviours:I_(t,n)})},z_=[re("disabled",!1),Jn("tooltip"),Jn("icon"),Jn("text"),ie("onSetup",function(){return Z})],N_=ln([Ln("type"),Un("onAction")].concat(z_)),L_=function(t){return Cn("toolbarbutton",N_,t)},j_=[Jn("text"),Jn("tooltip"),Jn("icon"),Un("fetch"),ie("onSetup",function(){return Z})],U_=ln(b([Ln("type")],j_)),W_=function(t){return Cn("menubutton",U_,t)},G_=ln([Ln("type"),Jn("tooltip"),Jn("icon"),Jn("text"),$n("select"),Un("fetch"),ie("onSetup",function(){return Z}),oe("presets","normal",["normal","color","listpreview"]),Zn("columns",1),Un("onAction"),Un("onItemAction")]),X_=[re("active",!1)].concat(z_),Y_=ln(X_.concat([Ln("type"),Un("onAction")])),q_=function(t){return Cn("ToggleButton",Y_,t)},K_=ln([Ln("type"),Nn("items",(vC=[xn([Ln("name"),Xn("items",Fn)]),Fn],{extract:function(t,n,e){for(var o=[],r=0,i=vC;r=n.bottom,c=o&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,e.y),bottom:e.bottom};if(t.inline&&!c)return{y:e.y,bottom:Math.min(u.y,e.bottom)};var s=wu(r);return c?{y:Math.max(u.bottom,e.y),bottom:Math.min(s.bottom,e.bottom)}:{y:Math.max(s.y,e.y),bottom:Math.min(u.y,e.bottom)}}(t,c,a,n.header.isPositionedAtTop()),g=m.y,p=m.bottom;return xu(f,g,d,p-g)},DT=function(n,t){var e=P(t,function(t){return t.predicate(n.dom())}),o=H(e,function(t){return"contexttoolbar"===t.type});return{contextToolbars:o.pass,contextForms:o.fail}},MT=function(t,n,e){var o=DT(t,n);if(0=n.y}var n,e})},EE=function(n,t){return t.getInitialPosition().map(function(t){return xu(t.bounds.x,t.bounds.y,cu(n),tu(n))})},BE=function(t,n,e){e.setInitialPosition(st.some({style:function(t){var n={},e=t.dom();if(Ci(e))for(var o=0;oe.y);o!==u.isVisible()&&(u.setVisible(o),c&&!o?(Si(i.element(),[r.fadeOutClass]),r.onHide(i)):(o?OE:_E)(i,r))})})},RE=function(n,e,t){var o,r,i=n.element();t.setDocked(!1),o=t,r=n.element(),EE(r,o).bind(function(t){return DE(r,t,o)}).each(function(t){t.fold(function(){return AE(n,e)},function(t){return FE(n,e,t)},Z)}),t.setVisible(!0),e.contextual.each(function(t){ki(i,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(n)}),VE(n,e,t)},VE=function(t,n,e){var o,r,i,u,a;t.getSystem().isConnected()&&(o=t,i=e,u=(r=n).lazyViewport(o),(a=i.isDocked())&&IE(o,r,i,u),ME(o,u,i).each(function(t){i.setDocked(!a),t.fold(function(){return AE(o,r)},function(t){return FE(o,r,t)},function(t){IE(o,r,i,u,!0),FE(o,r,t)})}))},HE=function(t,n,e){e.isDocked()&&RE(t,n,e)},PE=/* */Object.freeze({__proto__:null,refresh:VE,reset:HE,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)}}),zE=/* */Object.freeze({__proto__:null,events:function(o,r){return Yo([er(mo(),function(n,e){o.contextual.each(function(t){wi(n.element(),t.transitionClass)&&(ki(n.element(),[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(n));e.stop()})}),Jo(Bo(),function(t,n){VE(t,o,r)}),Jo(Do(),function(t,n){HE(t,o,r)})])}}),NE=[Qn("contextual",[Ln("fadeInClass"),Ln("fadeOutClass"),Ln("transitionClass"),Un("lazyContext"),$u("onShow"),$u("onShown"),$u("onHide"),$u("onHidden")]),ie("lazyViewport",ku),te("modes",["top","bottom"],fn(Fn)),$u("onDocked"),$u("onUndocked")],LE=La({fields:NE,name:"docking",active:zE,apis:PE,state:/* */Object.freeze({__proto__:null,init:function(t){var n=ce(!1),e=ce(!0),o=ce(st.none()),r=ce(t.modes);return oi({isDocked:n.get,setDocked:n.set,getInitialPosition:o.get,setInitialPosition:o.set,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+n.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}})}),jE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},UE="tox-tinymce--toolbar-sticky-on",WE="tox-tinymce--toolbar-sticky-off",GE=function(r){var i=r.element();lr(i).each(function(t){var n,e="padding-"+LE.getModes(r)[0];if(LE.isDocked(r)){var o=cu(t);Di(i,"width",o+"px"),Di(t,e,nu(n=i)+(parseInt(Fi(n,"margin-top"),10)||0)+(parseInt(Fi(n,"margin-bottom"),10)||0)+"px")}else Hi(i,"width"),Hi(t,e)})},XE=function(t,n){n?(xi(t,jE.fadeOutClass),Si(t,[jE.transitionClass,jE.fadeInClass])):(xi(t,jE.fadeInClass),Si(t,[jE.fadeOutClass,jE.transitionClass]))},YE=function(t,n){var e=le.fromDom(t.getContainer());n?(bi(e,UE),xi(e,WE)):(bi(e,WE),xi(e,UE))},qE=function(c,t){var n,i=ce(st.none()),o=t.getSink,u=function(n){o().each(function(t){return n(t.element())})},e=function(t){c.inline||GE(t),YE(c,LE.isDocked(t)),t.getSystem().broadcastOn([tl()],{}),o().each(function(t){return t.getSystem().broadcastOn([tl()],{})})},r=c.inline?[]:[Ya.config({channels:((n={})[M_()]={onReceive:GE},n)})];return b([Xm.config({}),LE.config({contextual:et({lazyContext:function(t){var n,e,o=nu(t.element()),r=c.inline?c.getContentAreaContainer():c.getContainer(),i=wu(le.fromDom(r)),u=i.height-o,a=i.y+(n=t,e="top",F(LE.getModes(n),e)?0:o);return st.some(xu(i.x,a,i.width,u))},onShow:function(){u(function(t){return XE(t,!0)})},onShown:function(r){u(function(t){return ki(t,[jE.transitionClass,jE.fadeInClass])}),i.get().each(function(t){var n,e,o;n=r.element(),o=ar(e=t),Ja(o).filter(function(t){return!Le(e,t)}).filter(function(t){return Le(t,le.fromDom(o.dom().body))||Ue(n,t)}).each(function(){return Ka(e)}),i.set(st.none())})},onHide:function(t){var n,e;i.set((n=t.element(),e=o,$a(n).orThunk(function(){return e().toOption().bind(function(t){return $a(t.element())})}))),u(function(t){return XE(t,!1)})},onHidden:function(){u(function(t){return ki(t,[jE.transitionClass])})}},jE),modes:[t.header.getDockingMode()],onDocked:e,onUndocked:e})],r)},KE=/* */Object.freeze({__proto__:null,setup:function(t,n,o){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){o().each(LE.reset)}),t.on("ResizeWindow ResizeEditor",function(){o().each(GE)}),t.on("SkinLoaded",function(){o().each(function(t){LE.isDocked(t)?LE.reset(t):LE.refresh(t)})}),t.on("FullscreenStateChanged",function(){o().each(LE.reset)})),t.on("AfterScrollIntoView",function(e){o().each(function(t){LE.refresh(t);var n=t.element();Bd(n)&&function(t,n){var e=ar(n),o=e.dom().defaultView.innerHeight,r=mu(e),i=le.fromDom(t.elm),u=Su(i),a=tu(i),c=u.y,s=c+a,l=iu(n),f=tu(n),d=l.top(),m=d+f,g=Math.abs(d-r.top())<2,p=Math.abs(m-(r.top()+o))<2;if(g&&c"},rB=function(r,t){var e,n=function(t){return mf(r)},o=function(e,o){return function(t,n){return sf(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},i=function(t,n){return"true"!==Dr(t.element(),"aria-hidden")},u=o(i,!1),a=o(function(t,n){if(i(t)){var e=t.element();Di(e,"display","none"),Br(e,"aria-hidden","true"),jo(t,Vo(),{name:n,visible:!1})}}),c=function(n,t){it(t,function(t){return e(n,t)})},s=o(function(t,n){if(!i(t)){var e=t.element();Hi(e,"display"),Fr(e,"aria-hidden"),jo(t,Vo(),{name:n,visible:!0})}}),l={getSlotNames:n,getSlot:function(t,n){return sf(t,r,n)},isShowing:u,hideSlot:e=a,hideAllSlots:function(t){return c(t,n())},showSlot:s};return{uid:r.uid,dom:r.dom,components:t,behaviours:xl(r.slotBehaviours),apis:l}},iB=dt({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},function(t){return ni(t)}),uB=et(et({},iB),{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),of(nB,oB(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return ql({name:t,pname:oB(t)})});return yf(nB,eB,i,rB,o)}}),aB=ln([Jn("icon"),Jn("tooltip"),ie("onShow",Z),ie("onHide",Z),ie("onSetup",function(){return Z})]),cB=function(t){return{element:function(){return t.element().dom()}}},sB=function(e,o){var r=V(lt(o),function(t){var n=o[t],e=On(Cn("sidebar",aB,n));return{name:t,getApi:cB,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return V(r,function(t){var n=ce(Z);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Tp([Kh(t,n),Jh(t,n),Jo(Vo(),function(n,t){var e=t.event();L(r,function(t){return t.name===e.name()}).each(function(t){(e.visible()?t.onShow:t.onHide)(t.getApi(n))})})])})})},lB=function(t,e){Mf.getCurrent(t).each(function(t){return Nm.set(t,[(n=e,uB.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:sB(t,n),slotBehaviours:Tp([or(function(t){return uB.hideAllSlots(t)})])}}))]);var n})},fB=function(t){return Mf.getCurrent(t).bind(function(t){return __.isGrowing(t)||__.hasGrown(t)?Mf.getCurrent(t).bind(function(n){return L(uB.getSlotNames(n),function(t){return uB.isShowing(n,t)})}):st.none()})},dB=Nr("FixSizeEvent"),mB=Nr("AutoSizeEvent"),gB=function(t){var n,e,o,r=le.fromHtml(t),i=dr(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],N(e,function(t,n){var e;return"class"===n.name?t:et(et({},t),((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:Sr(r)};return et({tag:Cr(r),classes:a,attributes:u},c)},pB=function(t,n,e){var o=t.element();!0===n?(Nm.set(t,[{dom:{tag:"div",attributes:{"aria-label":e.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:gB('')}],behaviours:za([Rm.config({mode:"special",onTab:function(){return st.some(!0)},onShiftTab:function(){return st.some(!0)}}),Xm.config({})])}]),Hi(o,"display"),Fr(o,"aria-hidden")):(Nm.set(t,[]),Di(o,"display","none"),Br(o,"aria-hidden","true"))},hB=vE.optional({factory:tB,name:"menubar",schema:[zn("backstage")]}),vB=vE.optional({factory:{sketch:function(t){return wE.sketch({uid:t.uid,dom:t.dom,listBehaviours:za([Rm.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return P_({type:t.type,uid:Nr("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return st.none()}})},setupItem:function(t,n,e,o){XO.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[zn("dom"),zn("onEscape")]}),bB=vE.optional({factory:{sketch:function(t){var n;return((n=t).type===Kg.sliding?H_:n.type===Kg.floating?V_:P_)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),st.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[zn("dom"),zn("onEscape"),zn("getSink")]}),yB=vE.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?qE:QE;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:za(e(n,t.sharedBackstage))}}},name:"header",schema:[zn("dom")]}),xB=vE.optional({name:"socket",schema:[zn("dom")]}),wB=vE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:za([Dy.config({}),Xm.config({}),__.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){Mf.getCurrent(t).each(uB.hideAllSlots),Lo(t,mB)},onGrown:function(t){Lo(t,mB)},onStartGrow:function(t){jo(t,dB,{width:Ri(t.element(),"width").getOr("")})},onStartShrink:function(t){jo(t,dB,{width:cu(t.element())+"px"})}}),Nm.config({}),Mf.config({find:function(t){var n=Nm.contents(t);return K(n)}})])}],behaviours:za([nS(0),Lm("sidebar-sliding-events",[Jo(dB,function(t,n){Di(t.element(),"width",n.event().width())}),Jo(mB,function(t,n){Hi(t.element(),"width")})])])}}},name:"sidebar",schema:[zn("dom")]}),SB=vE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:za([Nm.config({})]),components:[]}}},name:"throbber",schema:[zn("dom")]}),kB=_f({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return hE.getPart(t,e,"socket")},setSidebar:function(t,n){hE.getPart(t,e,"sidebar").each(function(t){return lB(t,n)})},toggleSidebar:function(t,o){hE.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void Mf.getCurrent(n).each(function(n){Mf.getCurrent(n).each(function(t){__.hasGrown(n)?uB.isShowing(t,e)?__.shrink(n):(uB.hideAllSlots(t),uB.showSlot(t,e)):(uB.hideAllSlots(t),uB.showSlot(t,e),__.grow(n))})});var n,e})},whichSidebar:function(t){return hE.getPart(t,e,"sidebar").bind(fB).getOrNull()},getHeader:function(t){return hE.getPart(t,e,"header")},getToolbar:function(t){return hE.getPart(t,e,"toolbar")},setToolbar:function(t,n){hE.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(t,n){hE.getPart(t,e,"multiple-toolbar").each(function(t){wE.setItems(t,n)})},refreshToolbar:function(t){hE.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},getThrobber:function(t){return hE.getPart(t,e,"throbber")},focusToolbar:function(t){hE.getPart(t,e,"toolbar").orThunk(function(){return hE.getPart(t,e,"multiple-toolbar")}).each(function(t){Rm.focusIn(t)})},setMenubar:function(t,n){hE.getPart(t,e,"menubar").each(function(t){tB.setMenus(t,n)})},focusMenubar:function(t){hE.getPart(t,e,"menubar").each(function(t){tB.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[zn("dom"),zn("behaviours")],partFields:[yB,hB,bB,vB,xB,wB,SB],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=V(e,function(t){return F_(t)});t.setToolbar(n,o)},setToolbars:function(t,n,e){var o=V(e,function(t){return V(t,F_)});t.setToolbars(n,o)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),CB={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},OB=function(t){return"string"==typeof t?t.split(" "):t},_B=function(i,u){var a=et(et({},CB),u.menus),n=0o)return"top";var i=cr(c),u=Math.max(i.dom().scrollHeight,tu(i));return r.bottom=o.clientX&&t.top()<=o.clientY&&t.bottom()>=o.clientY})}(n,e)?(n.once("selectionchange",d),n.once("touchend",function(){return n.off("selectionchange",d)})):d()}},fD=function(t){return"string"==typeof t?t.split(/[ ,]/):t},dD=function(t){return t.settings.contextmenu_never_use_native||!1},mD=function(t){return e="contextmenu",o="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,bt(n.settings,e).map(fD).getOrThunk(function(){return P(fD(o),function(t){return yt(r,t)})});var n,e,o,r},gD=function(t){return S(t)?"|"===t:"separator"===t.type},pD={type:"separator"},hD=function(n){if(S(n))return n;switch(n.type){case"separator":return pD;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return S(t)?t:V(t,hD)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:(t=n.onAction,function(){return t()})}}var t},vD=function(t,n){if(0===n.length)return t;var e=J(t).filter(function(t){return!gD(t)}).fold(function(){return[]},function(t){return[pD]});return t.concat(e).concat(n).concat([pD])},bD=function(c,t,o){var r=Pe().deviceType.isTouch,i=Ji(Bg.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return c.focus()},onShow:function(){return o.setContextMenuState(!0)},onHide:function(){return o.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:za([Lm("dismissContextMenu",[Jo(Fo(),function(t,n){Qs.close(t),c.focus()})])])})),n=function(t){return Bg.hide(i)},e=function(u){if(dD(c)&&u.preventDefault(),t=c,(!u.ctrlKey||dD(t))&&!1!==c.getParam("contextmenu")){var t,n,e,a=(n=c,"longpress"!==(e=u).type&&(2!==e.button||e.target===n.getBody()&&""===e.pointerType));(r()?lD:uD)(c,u,function(){var r,i,t,n=a?c.selection.getStart(!0):u.target,e=c.ui.registry.getAll(),o=mD(c);return r=e.contextMenus,i=n,0<(t=N(o,function(t,n){if(yt(r,n)){var e=r[n].update(i);if(S(e))return vD(t,e.split(" "));if(0n})},h=function(t){return p(m,t,n,"top")},v=function(t){return p(g,t,a,"bottom")};Pe().deviceType.isTouch()&&(c.on("TableSelectionChange",function(n){t.get()||(Rs(e,m),Rs(e,g),t.set(!0)),i.set(st.some(n.start)),u.set(st.some(n.finish)),n.otherCells.each(function(t){o.set(t.upOrLeftCells),r.set(t.downOrRightCells),h(n.start),v(n.finish)})}),c.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),c.on("TableSelectionClear",function(){t.get()&&(Ps(m),Ps(g),t.set(!1)),i.set(st.none()),u.set(st.none())}))};(LT=NT=NT||{})[LT.None=0]="None",LT[LT.Both=1]="Both",LT[LT.Vertical=2]="Vertical";var lM,fM=function(t,n,e){var o,r,i,u,a,c,s=le.fromDom(t.getContainer()),l=(o=t,r=n,i=e,u=tu(s),a=cu(s),(c={}).height=LB(u+r.top(),wh(o),kh(o)),i===NT.Both&&(c.width=LB(a+r.left(),xh(o),Sh(o))),c);ft(l,function(t,n){return Di(s,n,NB(t))}),t.fire("ResizeEditor")},dM=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},mM=function(i,u,a){u.delimiter||(u.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:za([Rm.config({mode:"flow",selector:"div[role=button]"}),ph.config({disabled:a.isReadOnly}),Uh(),Dy.config({}),Nm.config({}),Lm("elementPathEvents",[or(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Rm.focusIn(r)}),i.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0'+n+""}}),0=e.dom().offsetLeft+cu(e)?Math.max(tu(e),u):u,c=parseInt(Fi(t,"margin-top"),10)||0,s=parseInt(Fi(t,"margin-bottom"),10)||0;return o-(tu(t)+c+s-a)}(e,o,n))}).each(function(t){KA(o,t)})})})},$A=function(t){return Mu(t,'[role="tabpanel"]')},QA=function(a){var c;return{smartTabHeight:(c=ce(st.none()),{extraEvents:[or(function(t){var e=t.element();$A(e).each(function(u){var n;Di(u,"visibility","hidden"),t.getSystem().getByDom(u).toOption().each(function(t){var o,r,i,n=(r=u,i=t,V(o=a,function(t,n){Nm.set(i,o[n].view());var e=r.dom().getBoundingClientRect();return Nm.set(i,[]),e.height})),e=K(q(n,function(t,n){return n"+n.translate(t)+"")}]}]})},dF=function(t){return yM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},mF=function(t,n){return[Ub.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Ub.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},gF=function(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return yM.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),st.some(!0)},useTabstopAt:function(t){return!yS(t)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:et({position:"relative"},n.extraStyles)},components:b([n.header,n.body],n.footer.toArray()),parts:{blocker:{dom:gB(''),components:[{dom:{tag:"div",classes:aF?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:za(b([Xm.config({}),Lm("dialog-events",n.dialogEvents.concat([er(io(),function(t,n){Rm.focusIn(t)})])),Lm("scroll-lock",[or(function(){bi(_i(),i)}),rr(function(){xi(_i(),i)})])],n.extraBehaviours)),eventOrder:et(((t={})[xo()]=["dialog-events"],t[Mo()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[Ao()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})},pF=function(t){return jg.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){Lo(t,Yb)}})},hF=function(t,n,e){var o=function(t){return[Yi(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:et({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:za([cT.config({channel:eF,renderComponents:o})])}},vF=function(){return{dom:gB('')}},bF=function(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=yM.parts().title(hF(e,st.none(),o)),i=yM.parts().draghandle(vF()),u=yM.parts().close(pF(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Ub.sketch({dom:gB(''),components:a});var e,o,r,i,u,a},yF=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){yM.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:gB('')}]}})},onUnblock:function(){yM.setIdle(t())}}},xF=function(t,n,e,o){var r;return Ji(gF(et(et({},t),{lazySink:o.shared.getSink,extraBehaviours:b([cT.config({channel:nF,updateState:function(t,n){return st.some(n)},initialData:n}),fS({})],t.extraBehaviours),onEscape:function(t){Lo(t,Yb)},dialogEvents:e,eventOrder:((r={})[yo()]=["reflecting","receiving"],r[Mo()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[Ao()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))},wF=function(t){return V(t,function(t){return"menu"===t.type?(e=V((n=t).items,function(t){var n=ce(!1);return et(et({},t),{storage:n})}),et(et({},n),{items:e})):t;var n,e})},SF=function(t){return N(t,function(t,n){return"menu"!==n.type?t:N(n.items,function(t,n){return t[n.name]=n.storage,t},t)},{})},kF=function(t,e){return[tr(io(),bS),t(Xb,function(t,n){e.onClose(),n.onClose()}),t(Yb,function(t,n,e,o){n.onCancel(t),Lo(o,Xb)}),Jo($b,function(t,n){return e.onUnblock()}),Jo(Jb,function(t,n){return e.onBlock(n.event())})]},CF=function(i,t){var n=function(t,r){return Jo(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){cT.getState(n).get().each(function(t){e(t,n)})};return b(kF(n,t),[n(qb,function(t,n,e){n.onAction(t,{name:e.name()})})])},OF=function(i,t,a){var n=function(t,r){return Jo(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){cT.getState(n).get().each(function(t){e(t.internalDialog,n)})};return b(kF(n,t),[n(Kb,function(t,n){return n.onSubmit(t)}),n(Gb,function(t,n,e){n.onChange(t,{name:e.name()})}),n(qb,function(t,n,e,o){var r=function(){return Rm.focusIn(o)},i=function(t){return Ar(t,"disabled")||Mr(t,"aria-disabled").exists(function(t){return"true"===t})},u=Ja();n.onAction(t,{name:e.name(),value:e.value()}),Ja().fold(r,function(n){i(n)||u.exists(function(t){return Ue(n,t)&&i(t)})?r():a().toOption().filter(function(t){return!Ue(t.element(),n)}).each(r)})}),n(Qb,function(t,n,e){n.onTabChange(t,{newTabName:e.name(),oldTabName:e.oldName()})}),rr(function(t){var n=i();bl.setValue(t,n.getData())})])},_F=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=H(e,function(t){return"start"===t.align}),r=function(t,n){return Ub.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},TF=function(t,i){return{dom:gB(''),components:[],behaviours:za([cT.config({channel:rF,initialData:t,updateState:function(t,n){var r=V(n.buttons,function(t){var n,e,o=Ug((e=i,Nk(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return st.some({lookupByName:function(t,n){return e=t,o=n,L(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:_F})])}},EF=function(t,n){return yM.parts().footer(TF(t,n))},BF=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=Mf.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Gw.getField(o,e).fold(function(){var t=n.getFooter();return cT.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return st.some(t)})}return st.none()},DF=function(c,o,s){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},l={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t,e=bl.getValue(n),o=dt(s,function(t){return t.get()});return et(et({},e),o)},setData:function(a){t(function(t){var n,e,o=l.getData(),r=et(et({},o),a),i=(n=r,e=c.getRoot(),cT.getState(e).get().map(function(t){return On(Cn("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();bl.setValue(u,i),ft(s,function(t,n){yt(r,n)&&t.set(r[n])})})},disable:function(t){BF(c,t).each(ph.disable)},enable:function(t){BF(c,t).each(ph.enable)},focus:function(t){BF(c,t).each(Xm.focus)},block:function(n){if(!S(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){jo(t,Jb,{message:n})})},unblock:function(){t(function(t){Lo(t,$b)})},showTab:function(e){t(function(t){var n=c.getBody();cT.getState(n).get().exists(function(t){return t.isTabPanel()})&&Mf.getCurrent(n).each(function(t){qA.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([nF],n),t.getSystem().broadcastOn([eF],n.internalDialog),t.getSystem().broadcastOn([oF],n.internalDialog),t.getSystem().broadcastOn([rF],n.internalDialog),l.setData(n.initialData)})},close:function(){t(function(t){Lo(t,Xb)})}};return l},MF=function(t,n,e){var o,r,i,u=bF(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=uF(o,st.none(),r,!1),yM.parts().body(i)),c=wF(t.internalDialog.buttons),s=SF(c),l=EF({buttons:c},e),f=OF(function(){return p},yF(function(){return g},n),e.shared.getSink),d="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],m={header:u,body:a,footer:st.some(l),extraClasses:d,extraBehaviours:[],extraStyles:{}},g=xF(m,t,f,e),p=DF({getRoot:function(){return g},getBody:function(){return yM.getBody(g)},getFooter:function(){return yM.getFooter(g)},getFormWrapper:function(){var t=yM.getBody(g);return Mf.getCurrent(t).getOr(t)}},n.redial,s);return{dialog:g,instanceApi:p}},AF=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m=Nr("dialog-label"),g=Nr("dialog-content"),p=Ug((u={title:t.internalDialog.title,draggable:!0},a=m,c=e.shared.providers,Ub.sketch({dom:gB(''),components:[hF(u,st.some(a),c),vF(),pF(c)],containerBehaviours:za([iM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Au(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),h=Ug((s={body:t.internalDialog.body},l=g,f=e,d=o,uF(s,st.some(l),f,d))),v=wF(t.internalDialog.buttons),b=SF(v),y=Ug(TF({buttons:v},e)),x=OF(function(){return S},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}},e.shared.getSink),w=Ji({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((r={role:"dialog"})["aria-labelledby"]=m,r["aria-describedby"]=""+g,r)},eventOrder:((i={})[yo()]=[cT.name(),Ya.name()],i[xo()]=["execute-on-form"],i[Mo()]=["reflecting","execute-on-form"],i),behaviours:za([Rm.config({mode:"cyclic",onEscape:function(t){return Lo(t,Xb),st.some(!0)},useTabstopAt:function(t){return!yS(t)&&("button"!==Cr(t)||"disabled"!==Dr(t,"disabled"))}}),cT.config({channel:nF,updateState:function(t,n){return st.some(n)},initialData:t}),Xm.config({}),Lm("execute-on-form",x.concat([er(io(),function(t,n){Rm.focusIn(t)})])),fS({})]),components:[p.asSpec(),h.asSpec(),y.asSpec()]}),S=DF({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return h.get(w)},getFormWrapper:function(){var t=h.get(w);return Mf.getCurrent(t).getOr(t)}},n.redial,b);return{dialog:w,instanceApi:S}},FF=tinymce.util.Tools.resolve("tinymce.util.URI"),IF=["insertContent","setContent","execCommand","close","block","unblock"],RF=function(t){return k(t)&&-1!==IF.indexOf(t.mceAction)},VF=function(o,t,r,n){var e,i,u,a,c=bF(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[hS({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:za([Dy.config({}),Xm.config({})])})]}],behaviours:za([Rm.config({mode:"acyclic",useTabstopAt:x(yS)})])},yM.parts().body(i)),l=o.buttons.bind(function(t){return 0===t.length?st.none():st.some(EF({buttons:t},n))}),f=CF(function(){return y},yF(function(){return b},t)),d=et(et({},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 FF(o.url,{base_uri:new FF(nt.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=ce(st.none()),v=[Lm("messages",[or(function(){var t=yb(le.fromDom(nt.window),"message",function(t){if(g.isSameOrigin(new FF(t.raw().origin))){var n=t.raw().data;RF(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):!RF(e=n)&&k(e)&&yt(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(st.some(t))}),rr(function(){h.get().each(function(t){return t.unbind()})})]),Ya.config({channels:((e={})[iF]={onReceive:function(t,n){Mu(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=xF({header:c,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:d},o,f,n),y=(a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!S(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){jo(t,Jb,{message:n})})},unblock:function(){a(function(t){Lo(t,$b)})},close:function(){a(function(t){Lo(t,Xb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([iF],n)})}});return{dialog:u=b,instanceApi:y}},HF=function(t){var c,s,l,f,p=t.backstage,h=t.editor,v=Ph(h),e=(s=(c=t).backstage.shared,{open:function(t,n){var e=function(){yM.hide(u),n()},o=Ug(Nk({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:st.none()},"cancel",c.backstage)),r=lF(),i=sF(e,s.providers),u=Ji(gF({lazySink:function(){return s.getSink()},header:cF(r,i),body:fF(t,s.providers),footer:st.some(dF(mF([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Jo(Yb,e)],eventOrder:{}}));yM.show(u);var a=o.get(u);Xm.focus(a)}}),o=(f=(l=t).backstage.shared,{open:function(t,n){var e=function(t){yM.hide(a),n(t)},o=Ug(Nk({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:st.none()},"submit",l.backstage)),r=Nk({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:st.none()},"cancel",l.backstage),i=lF(),u=sF(function(){return e(!1)},f.providers),a=Ji(gF({lazySink:function(){return f.getSink()},header:cF(i,u),body:fF(t,f.providers),footer:st.some(dF(mF([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Jo(Yb,function(){return e(!1)}),Jo(Kb,function(){return e(!0)})],eventOrder:{}}));yM.show(a);var c=o.get(a);Xm.focus(c)}}),r=function(t,e){return VA.openUrl(function(t){var n=VF(t,{closeWindow:function(){yM.hide(n.dialog),e(n.instanceApi)}},h,p);return yM.show(n.dialog),n.instanceApi},t)},i=function(t,i){return VA.open(function(t,n,e){var o=n,r=MF({dataValidator:e,initialData:o,internalDialog:t},{redial:VA.redial,closeWindow:function(){yM.hide(r.dialog),i(r.instanceApi)}},p);return yM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},u=function(t,d,m,g){return VA.open(function(t,n,e){var o,r,i,u=On(Cn("data",e,n)),a=(o=ce(st.none()),{clear:function(){o.set(st.none())},set:function(t){o.set(st.some(t))},isSet:function(){return o.get().isSome()},on:function(t){o.get().each(t)}}),c=p.shared.header.isPositionedAtTop(),s=function(){return a.on(function(t){Bg.reposition(t),LE.refresh(t)})},l=AF({dataValidator:e,initialData:u,internalDialog:t},{redial:VA.redial,closeWindow:function(){a.on(Bg.hide),h.off("ResizeEditor",s),a.clear(),m(l.instanceApi)}},p,g),f=Ji(Bg.sketch(et(et({lazySink:p.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},c?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:za(b([Lm("window-manager-inline-events",[Jo(Fo(),function(t,n){Lo(l.dialog,Yb)})])],(r=h,i=c,v&&i?[]:[LE.config({contextual:{lazyContext:function(){return st.some(wu(le.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]))),isExtraPart:function(t,n){return Sb(e=n,".tox-alert-dialog")||Sb(e,".tox-confirm-dialog");var e}})));return a.set(f),Bg.showWithin(f,d,$i(l.dialog),st.some(_i())),v&&c||(LE.refresh(f),h.on("ResizeEditor",s)),l.instanceApi.setData(u),Rm.focusIn(l.dialog),l.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?u(t,p.shared.anchors.inlineDialog(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?u(t,p.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 XF(){t.add("silver",function(t){var n=pM(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;vb(t,o.shared);var u=HF({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:at(u),getNotificationManagerImpl:function(){return qg(0,{backstage:o},e)},ui:i()}})}()}(window);
|
9
|
+
!function(nt){"use strict";var Z=function(){},d=function(e,o){return function(){for(var t=[],n=0;n "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},fn=function(r){return{extract:function(e,o,t){var n=V(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return tn(n)},toString:function(){return"array("+r.toString()+")"}}},dn=function(a,c){return{extract:function(e,o,r){var t,n,i=lt(r),u=(t=e,n=i,fn(cn(a)).extract(t,ct,n));return Ht(u,function(t){var n=V(t,function(t){return on.field(t,t,Ut(),c)});return ln(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"}}},mn=at(cn(It)),gn=d(fn,ln),pn=on.state,hn=on.field,vn=function(e,n,o,r,i){return bt(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 bt(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: "+lt(i)}}},yn=cn(It),xn=function(t){return gn(t)},wn=function(o){return{extract:function(t,n,e){return o().extract(t,n,e)},toString:function(){return o().toString()}}},Sn=function(n){return cn(function(t){return n(t).fold(Vt,It)})},kn=function(n,t){return dn(function(t){return At(n(t))},t)},Cn=function(t,n,e){return Ft((o=t,r=ct,i=e,u=n.extract([o],r,i),Nt(u,function(t){return{input:i,errors:t}})));var o,r,i,u},On=function(t){return t.fold(function(t){throw new Error(Tn(t))},ct)},_n=function(t,n,e){return On(Cn(t,n,e))},Tn=function(t){return"Errors: \n"+(n=t.errors,e=10 ")+")\n"+t.getErrorInfo()}).join("\n"))+"\n\nInput object: "+nn(t.input);var n,e},En=function(t,n){return bn(t,n)},Bn=function(t,n){return bn(t,dt(n,ln))},Dn=at(yn),Mn=function(e,o){return cn(function(t){var n=typeof t;return e(t)?It(t):Vt("Expected type: "+o+" but got: "+n)})},An=Mn(rt,"number"),Fn=Mn(S,"string"),In=Mn(O,"boolean"),Rn=Mn(T,"function"),Vn=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 Vn(n[t])});case"Map":return t(n.keys(),Vn)&&t(n.values(),Vn);case"Set":return t(n.keys(),Vn);default:return!1}},Hn=cn(function(t){return Vn(t)?It(t):Vt("Expected value to be acceptable for sending via postMessage")}),Pn=function(n){return Sn(function(t){return F(n,t)?ot.value(t):ot.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},zn=function(t){return hn(t,t,Ut(),mn())},Nn=function(t,n){return hn(t,t,Ut(),n)},Ln=function(t){return Nn(t,Fn)},jn=function(t,n){return hn(t,t,Ut(),Pn(n))},Un=function(t){return Nn(t,Rn)},Wn=function(t,n){return hn(t,t,Ut(),ln(n))},Gn=function(t,n){return hn(t,t,Ut(),gn(n))},Xn=function(t,n){return hn(t,t,Ut(),fn(n))},Yn=function(t){return hn(t,t,Wt(),mn())},qn=function(t,n){return hn(t,t,Wt(),n)},Kn=function(t){return qn(t,An)},Jn=function(t){return qn(t,Fn)},$n=function(t){return qn(t,Rn)},Qn=function(t,n){return qn(t,ln(n))},Zn=function(t,n){return hn(t,t,jt(n),mn())},te=function(t,n,e){return hn(t,t,jt(n),e)},ne=function(t,n){return te(t,n,An)},ee=function(t,n){return te(t,n,Fn)},oe=function(t,n,e){return te(t,n,Pn(e))},re=function(t,n){return te(t,n,In)},ie=function(t,n){return te(t,n,Rn)},ue=function(t,n,e){return te(t,n,ln(e))},ae=function(t,n){return pn(t,n)},ce=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},se=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:at(t)}},le={fromHtml:function(t,n){var e=(n||nt.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1=o.length&&e.substr(r,r+o.length)===o?t.substring(0,t.length-"/*".length):t;var n,e,o,r})},Qr=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:$r(i)}},t},Zr=Nr("alloy-premade"),ti=function(t){return Kt(Zr,t)},ni=function(o){return t=function(t){for(var n=[],e=1;e "):o[0].name();return Kt(r,{handler:n,purpose:at(e)})})});return $t(n,{})},mi=function(t){return Cn("custom.definition",ln([hn("dom","dom",Ut(),ln([zn("tag"),Zn("styles",{}),Zn("classes",[]),Zn("attributes",{}),Yn("value"),Yn("innerHtml")])),zn("components"),zn("uid"),Zn("events",{}),Zn("apis",{}),hn("eventOrder","eventOrder",Lt.mergeWithThunk(at({"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"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting","tooltipping"]})),Dn()),Yn("domModification")]),t)},gi=function(t,n){var e=Dr(t,n);return e===undefined||""===e?[]:e.split(" ")},pi=function(t){return t.dom().classList!==undefined},hi=function(t,n){return r=n,i=gi(e=t,o="class").concat([r]),Br(e,o,i.join(" ")),!0;var e,o,r,i},vi=function(t,n){return r=n,0<(i=P(gi(e=t,o="class"),function(t){return t!==r})).length?Br(e,o,i.join(" ")):Fr(e,o),!1;var e,o,r,i},bi=function(t,n){pi(t)?t.dom().classList.add(n):hi(t,n)},yi=function(t){0===(pi(t)?t.dom().classList:gi(t,"class")).length&&Fr(t,"class")},xi=function(t,n){pi(t)?t.dom().classList.remove(n):vi(t,n);yi(t)},wi=function(t,n){return pi(t)&&t.dom().classList.contains(n)},Si=function(n,t){it(t,function(t){bi(n,t)})},ki=function(n,t){it(t,function(t){xi(n,t)})},Ci=function(t){return t.style!==undefined&&T(t.style.getPropertyValue)},Oi=function(t){var n=Tr(t)?t.dom().parentNode:t.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)},_i=function(){return Ti(le.fromDom(nt.document))},Ti=function(t){var n=t.dom().body;if(null===n||n===undefined)throw new Error("Body is not available yet");return le.fromDom(n)},Ei=function(t,n,e){if(!S(e))throw nt.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Ci(t)&&t.style.setProperty(n,e)},Bi=function(t,n){Ci(t)&&t.style.removeProperty(n)},Di=function(t,n,e){var o=t.dom();Ei(o,n,e)},Mi=function(t,n){var e=t.dom();ft(n,function(t,n){Ei(e,n,t)})},Ai=function(t,n){var e=t.dom();ft(n,function(t,n){t.fold(function(){Bi(e,n)},function(t){Ei(e,n,t)})})},Fi=function(t,n){var e=t.dom(),o=nt.window.getComputedStyle(e).getPropertyValue(n);return""!==o||Oi(t)?o:Ii(e,n)},Ii=function(t,n){return Ci(t)?t.style.getPropertyValue(n):""},Ri=function(t,n){var e=t.dom(),o=Ii(e,n);return st.from(o).filter(function(t){return 0"}),Dn()),Pl=ae("schema",function(){return[Yn("preprocess")]}),zl=Zn("defaults",at({})),Nl=Zn("overrides",at({})),Ll=ln([Il,Rl,Vl,Hl,zl,Nl]),jl=ln([Il,Rl,Vl,zl,Nl]),Ul=ln([Il,Rl,Vl,Hl,zl,Nl]),Wl=ln([Il,Pl,Vl,zn("unit"),Hl,zl,Nl]),Gl=function(t){return t.fold(st.some,st.none,st.some,st.some)},Xl=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Yl=function(e,o){return function(t){var n=_n("Converting part type",o,t);return e(n)}},ql=Yl(Fl.required,Ll),Kl=Yl(Fl.external,jl),Jl=Yl(Fl.optional,Ul),$l=Yl(Fl.group,Wl),Ql=at("entirety"),Zl=/* */Object.freeze({__proto__:null,required:ql,external:Kl,optional:Jl,group:$l,asNamedPart:Gl,name:Xl,asCommon:function(t){return t.fold(ct,ct,ct,ct)},original:Ql}),tf=function(t,n,e,o){return Ct(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},nf=function(r,t){var n={};return it(t,function(t){Gl(t).each(function(e){var o=ef(r,e.pname);n[e.name]=function(t){var n=_n("Part: "+e.name+" in "+r,ln(e.schema),t);return et(et({},o),{config:t,validated:n})}})}),n},ef=function(t,n){return{uiType:Al(),owner:t,name:n}},of=function(t,n,e){return{uiType:Al(),owner:t,name:n,config:e,validated:{}}},rf=function(t){return U(t,function(t){return t.fold(st.none,st.some,st.none,st.none).map(function(t){return Wn(t.name,t.schema.concat([ea(Ql())]))}).toArray()})},uf=function(t){return V(t,Xl)},af=function(t,n,e){return o=n,i={},r={},it(e,function(t){t.fold(function(o){i[o.pname]=Dl(!0,function(t,n,e){return o.factory.sketch(tf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=at(t.factory.sketch(tf(o,t,n[Ql()]),n))},function(o){i[o.pname]=Dl(!1,function(t,n,e){return o.factory.sketch(tf(t,o,n,e))})},function(r){i[r.pname]=Ml(!0,function(n,t,e){var o=n[r.name];return V(o,function(t){return r.factory.sketch(Ct(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:at(i),externals:at(r)};var o,i,r},cf=function(t,n,e){return Bl(st.some(t),n,n.components,e)},sf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},lf=function(t,n,e){return sf(t,n,e).getOrDie("Could not find part: "+e)},ff=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return it(e,function(t){o[t]=at(i.getByUid(r[t]))}),o},df=function(t,n){var e=t.getSystem();return dt(n.partUids,function(t,n){return at(e.getByUid(t))})},mf=function(t){return lt(t.partUids)},gf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return it(e,function(t){o[t]=at(i.getByUid(r[t]).getOrDie())}),o},pf=function(n,t){var e=uf(t);return Jt(V(e,function(t){return{key:t,value:n+"-"+t}}))},hf=function(n){return hn("partUids","partUids",Xt(function(t){return pf(t.uid,n)}),Dn())},vf=/* */Object.freeze({__proto__:null,generate:nf,generateOne:of,schemas:rf,names:uf,substitutes:af,components:cf,defaultUids:pf,defaultUidsSchema:hf,getAllParts:df,getAllPartNames:mf,getPart:sf,getPartOrDie:lf,getParts:ff,getPartsOrDie:gf}),bf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Wn("parts",i)]:[]).concat([zn("uid"),Zn("dom",{}),Zn("components",[]),ea("originalSpec"),Zn("debug.sketcher",{})]).concat(u));return _n(t+" [SpecSchema]",sn(a.concat(n)),e)},yf=function(t,n,e,o,r){var i=xf(r),u=rf(e),a=hf(e),c=bf(t,n,i,u,[a]),s=af(0,c,e);return o(c,cf(t,c,s.internals()),i,s.externals())},xf=function(t){return yt(t,"uid")?t:et(et({},t),{uid:Yr("uid")})};var wf,Sf,kf=sn([zn("name"),zn("factory"),zn("configFields"),Zn("apis",{}),Zn("extraApis",{})]),Cf=sn([zn("name"),zn("factory"),zn("configFields"),zn("partFields"),Zn("apis",{}),Zn("extraApis",{})]),Of=function(t){var i=_n("Sketcher for "+t.name,kf,t),n=dt(i.apis,ni),e=dt(i.extraApis,function(t,n){return Qr(t,n)});return et(et({name:at(i.name),configFields:at(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=xf(t),o(bf(n,e,r,[],[]),r);var n,e,o,r}},n),e)},_f=function(t){var n=_n("Sketcher for "+t.name,Cf,t),e=nf(n.name,n.partFields),o=dt(n.apis,ni),r=dt(n.extraApis,function(t,n){return Qr(t,n)});return et(et({name:at(n.name),partFields:at(n.partFields),configFields:at(n.configFields),sketch:function(t){return yf(n.name,n.configFields,n.partFields,n.factory,t)},parts:at(e)},o),r)},Tf=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o',e.getDoc());return vr(t,le.fromDom(n.extractContents())),n.insertNode(t.dom()),lr(t).each(function(t){return t.dom().normalize()}),Xc(t,Gc).map(function(t){var n;e.selection.setCursorLocation(t.dom(),"img"===Cr(n=t)?1:Uc(n).fold(function(){return dr(n).length},function(t){return t.length}))}),t})},np=function(t){return Au(t,"[data-mce-autocompleter]")},ep=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},op=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},rp=function(t,n){return t.substring(n.length)},ip=function(t,o,r,i){if(void 0===i&&(i=0),!(n=o).collapsed||3!==n.startContainer.nodeType)return st.none();var n,e=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return Zg(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){var o;for(o=n-1;0<=o;o--){var r=t.charAt(o);if(op(r))return st.none();if(r===e)break}return st.some(o)}(e,n,r).getOr(n)},e).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return st.none();var e=ep(n);return 0!==e.lastIndexOf(r)||rp(e,r).length =t.minChars&&t.matches.getOrThunk(function(){return dp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=cp.all(V(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 st.some({lookupData:a,context:e})},pp=ln([Ln("type"),Jn("text")]),hp=ln([ae("type",function(){return"autocompleteitem"}),ae("active",function(){return!1}),ae("disabled",function(){return!1}),Zn("meta",{}),Ln("value"),Jn("text"),Jn("icon")]),vp=ln([Ln("type"),Ln("ch"),ne("minChars",1),Zn("columns",1),ne("maxResults",10),$n("matches"),Un("fetch"),Un("onAction")]),bp=function(t){var n,e,o=t.ui.registry.getAll().popups,r=dt(o,function(t){return Cn("Autocompleter",vp,t).fold(function(t){throw new Error(Tn(t))},function(t){return t})}),i=(n=pt(r,function(t){return t.ch}),e={},it(n,function(t){e[t]={}}),lt(e)),u=vt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return P(u,function(t){return t.ch===n})}}},yp=[re("disabled",!1),Jn("text"),Jn("shortcut"),hn("value","value",Gt(function(){return Nr("menuitem-value")}),Dn()),Zn("meta",{})],xp=ln([Ln("type"),ie("onSetup",function(){return Z}),ie("onAction",Z),Jn("icon")].concat(yp)),wp=ln([Ln("type"),Un("getSubmenuItems"),ie("onSetup",function(){return Z}),Jn("icon")].concat(yp)),Sp=ln([Ln("type"),Jn("icon"),re("active",!1),ie("onSetup",function(){return Z}),Un("onAction")].concat(yp)),kp=ln([Ln("type"),re("active",!1),Jn("icon")].concat(yp)),Cp=ln([Ln("type"),jn("fancytype",["inserttable","colorswatch"]),ie("onAction",Z)]),Op=function(t,o,n){var r=Yc(t.element(),"."+n);if(0o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},_p=function(t,n){return za([Lm(t,n)])},Tp=function(t){return _p(Nr("unnamed-events"),t)},Ep=[zn("lazySink"),zn("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:at([_a,Oa,wa,ka,Sa,Ca]),onRtl:at([_a,Oa,wa,ka,Sa,Ca])}}}),$u("onHide"),$u("onShow")],Bp=/* */Object.freeze({__proto__:null,init:function(){var e=ce(st.none()),n=ce(st.none()),o=function(){e.get().each(function(t){nt.clearTimeout(t)})},t=at("not-implemented");return oi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(st.some(t))},clearTooltip:function(){n.set(st.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(st.some(nt.setTimeout(function(){t()},n)))},readState:t})}}),Dp=Nr("tooltip.exclusive"),Mp=Nr("tooltip.show"),Ap=Nr("tooltip.hide"),Fp=function(t,n,e){t.getSystem().broadcastOn([Dp],{})},Ip=/* */Object.freeze({__proto__:null,hideAllExclusive:Fp,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Nm.set(t,o)})}}),Rp=La({fields:Ep,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Ps(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return Yo(ut([[Jo(Mp,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){Fp(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:Yo("normal"===o.mode?[Jo(ro(),function(t){Lo(n,Mp)}),Jo(eo(),function(t){Lo(n,Ap)})]:[]),behaviours:za([Nm.config({})])});r.setTooltip(e),Rs(t,e),o.onShow(n,e),Ds.position(t,o.anchor(n),e)}}(t)},o.delay)}),Jo(Ap,function(t){r.resetTimer(function(){e(t)},o.delay)}),Jo(yo(),function(t,n){F(n.channels(),Dp)&&e(t)}),rr(function(t){e(t)})],"normal"===o.mode?[Jo(io(),function(t){Lo(t,Mp)}),Jo(vo(),function(t){Lo(t,Ap)}),Jo(ro(),function(t){Lo(t,Mp)}),Jo(eo(),function(t){Lo(t,Ap)})]:[Jo(zo(),function(t,n){Lo(t,Mp)}),Jo(No(),function(t){Lo(t,Ap)})]]))}}),state:Bp,apis:Ip}),Vp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Hp="tox-menu-nav__js",Pp="tox-collection__item",zp="tox-swatch",Np={normal:Hp,color:zp},Lp="tox-collection__item--enabled",jp="tox-collection__item-label",Up="tox-collection__item-caret",Wp="tox-collection__item--active",Gp=function(t){return bt(Np,t).getOr(Hp)},Xp=tinymce.util.Tools.resolve("tinymce.Env"),Yp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},qp=function(t){return{dom:{tag:"div",classes:[jp]},components:[Yi(Vp.translate(t))]}},Kp=function(t,n){return{dom:{tag:"div",classes:[jp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(Vp.translate(n))]}]}},Jp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(n=t,e=Xp.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},o=n.split("+"),r=V(o,function(t){var n=t.toLowerCase().trim();return yt(e,n)?e[n]:t}),Xp.mac?r.join(""):r.join("+"))}};var n,e,o,r},$p=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:Gg("checkmark",t)}}},Qp=function(t,n,e,o,r){var i=e?n.or(st.some("")).map(Yp):st.none(),u=t.checkMark,a=t.ariaLabel.map(function(t){return{attributes:{title:Vp.translate(t)}}}).getOr({});return{dom:et({tag:"div",classes:[Hp,Pp].concat(r?["tox-collection__item-icon-rtl"]:[])},a),optComponents:[i,t.htmlContent.fold(function(){return t.textContent.map(o)},function(t){return st.some({dom:{tag:"div",classes:[jp],innerHtml:t}})}),t.shortcutContent.map(Jp),u,t.caret]}},Zp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],th=["list-bull-circle","list-bull-default","list-bull-square"],nh=function(t,r,n,i){void 0===i&&(i=st.none());var e,o,u,a,c,s=Vp.isRtl()&&t.iconContent.exists(function(t){return F(th,t)}),l=t.iconContent.map(function(t){return Vp.isRtl()&&F(Zp,t)?t+"-rtl":t}).map(function(t){return n=t,e=r.icons,o=i,st.from(e()[n]).or(o).getOrThunk(function(){return Wg(e)});var n,e,o}),f=st.from(t.meta).fold(function(){return qp},function(t){return yt(t,"style")?g(Kp,t.style):qp});return"color"===t.presets?(e=t.ariaLabel,o=t.value,u=r,{dom:(a=l.getOr(""),c={tag:"div",attributes:e.map(function(t){return{title:u.translate(t)}}).getOr({}),classes:["tox-swatch"]},et(et({},c),"custom"===o?{tag:"button",classes:b(c.classes,["tox-swatches__picker-btn"]),innerHtml:a}:"remove"===o?{classes:b(c.classes,["tox-swatch--remove"]),innerHtml:a}:{attributes:et(et({},c.attributes),{"data-mce-color":o}),styles:{"background-color":o}})),optComponents:[]}):Qp(t,l,n,f,s)},eh=["input","button","textarea","select"],oh=function(t,n,e){(n.disabled()?sh:lh)(t,n,e)},rh=function(t,n){return!0===n.useNative&&F(eh,Cr(t.element()))},ih=function(t){Br(t.element(),"disabled","disabled")},uh=function(t){Fr(t.element(),"disabled")},ah=function(t){Br(t.element(),"aria-disabled","true")},ch=function(t){Br(t.element(),"aria-disabled","false")},sh=function(n,t,e){t.disableClass.each(function(t){bi(n.element(),t)}),(rh(n,t)?ih:ah)(n),t.onDisabled(n)},lh=function(n,t,e){t.disableClass.each(function(t){xi(n.element(),t)}),(rh(n,t)?uh:ch)(n),t.onEnabled(n)},fh=function(t,n){return rh(t,n)?Ar(t.element(),"disabled"):"true"===Dr(t.element(),"aria-disabled")},dh=/* */Object.freeze({__proto__:null,enable:lh,disable:sh,isDisabled:fh,onLoad:oh,set:function(t,n,e,o){(o?sh:lh)(t,n,e)}}),mh=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return ii({classes:n.disabled?n.disableClass.map(Y).getOr([]):[]})},events:function(e,t){return Yo([qo(xo(),function(t,n){return fh(t,e)}),Ia(e,t,oh)])}}),gh=[ie("disabled",c),Zn("useNative",!0),Yn("disableClass"),$u("onDisabled"),$u("onEnabled")],ph=La({fields:gh,name:"disabling",active:mh,apis:dh}),hh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),vh=tinymce.util.Tools.resolve("tinymce.EditorManager"),bh=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},yh=function(t){return t.getParam("width",hh.DOM.getStyle(t.getElement(),"width"))},xh=function(t){return st.from(t.settings.min_width).filter(rt)},wh=function(t){return st.from(t.settings.min_height).filter(rt)},Sh=function(t){return st.from(t.getParam("max_width")).filter(rt)},kh=function(t){return st.from(t.getParam("max_height")).filter(rt)},Ch=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Oh=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=S(n),r=C(n)&&0'+t+""})}return r},ov=at(nf(pg(),hg())),rv=Nr("cell-over"),iv=Nr("cell-execute"),uv=function(n,e,t){var o,r=function(t){return jo(t,iv,{row:n,col:e})},i=function(t,n){n.stop(),r(t)};return Ji({dom:{tag:"div",attributes:((o={role:"button"})["aria-labelledby"]=t,o)},behaviours:za([Lm("insert-table-picker-cell",[Jo(ro(),Xm.focus),Jo(xo(),r),Jo(fo(),i),Jo(So(),i)]),rg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Xm.config({onFocus:function(t){return jo(t,rv,{row:n,col:e})}})])})},av=function(t){return{value:t}},cv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,sv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,lv=function(t){return cv.test(t)||sv.test(t)},fv=function(t){var n={value:t.value.replace(cv,function(t,n,e,o){return n+n+e+e+o+o})},e=sv.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},dv=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},mv=function(t){var n=dv(t.red)+dv(t.green)+dv(t.blue);return av(n)},gv=Math.min,pv=Math.max,hv=Math.round,vv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,bv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,yv=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},xv=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},wv=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=pv(0,gv(i,1)),u=pv(0,gv(u,1)),0===i)return n=e=o=hv(255*u),yv(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=hv(255*(n+l)),e=hv(255*(e+l)),o=hv(255*(o+l)),yv(n,e,o,1)},Sv=function(t){var n=fv(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return yv(e,o,r,1)},kv=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return yv(r,i,u,a)},Cv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Ov=yv(255,0,0,1),_v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Tv="tinymce-custom-colors";var Ev="choiceitem",Bv=[{type:Ev,text:"Light Green",value:"#BFEDD2"},{type:Ev,text:"Light Yellow",value:"#FBEEB8"},{type:Ev,text:"Light Red",value:"#F8CAC6"},{type:Ev,text:"Light Purple",value:"#ECCAFA"},{type:Ev,text:"Light Blue",value:"#C2E0F4"},{type:Ev,text:"Green",value:"#2DC26B"},{type:Ev,text:"Yellow",value:"#F1C40F"},{type:Ev,text:"Red",value:"#E03E2D"},{type:Ev,text:"Purple",value:"#B96AD9"},{type:Ev,text:"Blue",value:"#3598DB"},{type:Ev,text:"Dark Turquoise",value:"#169179"},{type:Ev,text:"Orange",value:"#E67E23"},{type:Ev,text:"Dark Red",value:"#BA372A"},{type:Ev,text:"Dark Purple",value:"#843FA1"},{type:Ev,text:"Dark Blue",value:"#236FA1"},{type:Ev,text:"Light Gray",value:"#ECF0F1"},{type:Ev,text:"Medium Gray",value:"#CED4D9"},{type:Ev,text:"Gray",value:"#95A5A6"},{type:Ev,text:"Dark Gray",value:"#7E8C8D"},{type:Ev,text:"Navy Blue",value:"#34495E"},{type:Ev,text:"Black",value:"#000000"},{type:Ev,text:"White",value:"#ffffff"}],Dv=function zF(e){void 0===e&&(e=10);var t,n=_v.getItem(Tv),o=S(n)?JSON.parse(n):[],r=e-(t=o).length<0?t.slice(0,e):t,i=function(t){r.splice(t,1)};return{add:function(t){var n;(-1===(n=A(r,t))?st.none():st.some(n)).each(i),r.unshift(t),r.length>e&&r.pop(),_v.setItem(Tv,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Mv=function(t){return!1!==t.getParam("custom_colors")},Av=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=nt.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"},Ww=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:wl(o.formBehaviours,[bl.config({store:{mode:"manual",getValue:function(t){var n=df(t,o);return dt(n,function(t,r){return t().bind(function(t){var n,e,o=Mf.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+Vr(t.element())),n.fold(function(){return ot.error(e)},ot.value)}).map(bl.getValue)})},setValue:function(e,t){ft(t,function(n,t){sf(e,o,t).each(function(t){Mf.getCurrent(t).each(function(t){bl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return sf(t,o,n).bind(Mf.getCurrent)}}}},Gw={getField:ni(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),of("form",Uw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return ql({name:t,pname:Uw(t)})});return yf("form",jw,i,Ww,o)}},Xw=Nr("valid-input"),Yw=Nr("invalid-input"),qw=Nr("validating-input"),Kw="colorcustom.rgb.",Jw=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(Kw+"range"),c=[ey.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),ey.parts().field({data:r,factory:uy,inputAttributes:et({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:za([(i=n,u=t,Ty.config({invalidClass:m("invalid"),notify:{onValidate:function(t){jo(t,qw,{type:i})},onValid:function(t){jo(t,Xw,{type:i,value:bl.getValue(t)})},onInvalid:function(t){jo(t,Yw,{type:i,value:bl.getValue(t)})}},validator:{validate:function(t){var n=bl.getValue(t),e=u(n)?ot.value(!0):ot.error(d("aria.input.invalid"));return vy(e)},validateOnLoad:!1}})),Dy.config({})]),onSetValue:function(t){Ty.isInvalid(t)&&Ty.run(t).get(Z)}})],s="hex"!==n?[ey.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;bl.setValue(t,{red:e,green:o,blue:r})},b=Ug({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Di(t.element(),"background-color","#"+n.value)})};return Of({factory:function(){var e={red:ce(st.some(255)),green:ce(st.some(255)),blue:ce(st.some(255)),hex:ce(st.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",st.some(n)),i("green",st.some(e)),i("blue",st.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),st.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,st.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return yv(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=mv(t),Gw.getField(n,"hex").each(function(t){Xm.isFocused(t)||bl.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=av(n);i("hex",st.some(n));var o=Sv(e);v(t,o),r(o),jo(t,ix,{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(Kw+t+".label"),description:d(Kw+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return Ct(Gw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",ey.sketch(h(xv,"red",c.label,c.description,255))),t.field("green",ey.sketch(h(xv,"green",s.label,s.description,255))),t.field("blue",ey.sketch(h(xv,"blue",l.label,l.description,255))),t.field("hex",ey.sketch(h(lv,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:za([Ty.config({invalidClass:m("form-invalid")}),Lm("rgb-form-events",[Jo(Xw,a),Jo(Yw,n),Jo(qw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;bl.setValue(t,{hex:n.value}),e=t,o=Sv(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},$w=function(t,o){var r=Lw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Lw.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 Of({factory:function(t){var n=at({x:at(0),y:at(0)}),e=za([Mf.config({find:st.some}),Xm.config({})]);return Lw.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){jo(t,ax,{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),Cv(Ov))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,Cv(o))}},extraApis:{}})},Qw=function(f,d){return Of({name:"ColourPicker",configFields:[zn("dom"),Zn("onValidHex",Z),Zn("onInvalidHex",Z)],factory:function(t){var a,v,n,e,o,r=Jw(f,d,t.onValidHex,t.onInvalidHex),i=$w(0,d),b={paletteRgba:ce(Ov)},u=Ug(i.sketch({})),c=Ug(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=Sv(e);b.paletteRgba.set(n),i.setRgba(t,n)})},l=function(t,n){c.getOpt(t).each(function(t){r.updateHex(t,n)})},y=function(n,e,t){it(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=Lw.parts().spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Lw.parts().thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),Lw.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:at(0)})},components:[e,o],sliderBehaviours:za([Xm.config({})]),onChange:function(t,n,e){jo(t,ux,{value:e})}})),c.asSpec()],behaviours:za([Lm("colour-picker-events",[Jo(ax,(v=[l],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?rx(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,rx(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=rx(m.hue,f.x(),100-f.y()),p=wv(g),h=mv(p);y(t,h,v)})),Jo(ux,(a=[s,l],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=rx((100-e)/100*360,100,100),r=wv(o),mv(r));y(t,u,a)}))]),Mf.config({find:function(t){return c.getOpt(t)}}),Rm.config({mode:"acyclic"})])}}})},Zw=function(){return Mf.config({find:st.some})},tS=function(t){return Mf.config({find:t.getOpt})},nS=function(t){return Mf.config({find:function(n){return mr(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},eS={"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"},oS=function(t){return eS[t]},rS=tinymce.util.Tools.resolve("tinymce.Resource"),iS=ln([Zn("preprocess",ct),Zn("postprocess",ct)]),uS=function(t,n,e){return bl.config(Ct({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},aS=function(t,n,e){return uS(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},cS=function(r,t){var i=_n("RepresentingConfigs.memento processors",iS,t);return bl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=bl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);bl.setValue(o,e)}}})},sS=uS,lS=function(t){return aS(t,Sr,kr)},fS=function(t){return bl.config({store:{mode:"memory",initialValue:t}})},dS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){it(t,function(t){t(n,e)})}},i=function(t,n){if(!ph.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;bl.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),P($(e),function(t){return o.test(t.name)}))),jo(t,Gb,{name:r.name})},c=Ug({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:za([Lm("input-file-events",[nr(fo()),nr(So())])])}),t=r.label.map(function(t){return Iy(t,n)}),s=ey.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:za([fS([]),Zw(),ph.config({}),rg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Lm("dropzone-events",[Jo("dragenter",o([e,rg.toggle])),Jo("dragleave",o([e,rg.toggle])),Jo("dragover",e),Jo("drop",o([e,i])),Jo(lo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},jg.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:za([Dy.config({}),Gh(n.isReadOnly),Uh()])})]}]}}}});return My(t,s,["tox-form__group--stretched"],[])},mS=Nr("alloy-fake-before-tabstop"),gS=Nr("alloy-fake-after-tabstop"),pS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:za([Xm.config({ignore:!0}),Dy.config({})])}},hS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[pS([mS]),t,pS([gS])],behaviours:za([nS(1)])}},vS=function(t,n){jo(t,ao(),{raw:{which:9,shiftKey:n}})},bS=function(t,n){var e=n.element();wi(e,mS)?vS(t,!0):wi(e,gS)&&vS(t,!1)},yS=function(t){return Sb(t,["."+mS,"."+gS].join(","),at(!1))},xS=!(Pe().browser.isIE()||Pe().browser.isEdge()),wS=function(t,n){var o,r,e=xS&&t.sandboxed,i=et(et({},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)Br(t.element(),"srcdoc",n);else{Br(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 Iy(t,n)}),c=ey.parts().field({factory:{sketch:function(t){return hS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:za([Dy.config({}),Xm.config({}),sS(st.none(),u.getValue,u.setValue)])})}}});return My(a,c,["tox-form__group--stretched"],[])};function SS(t,n){return OS(nt.document.createElement("canvas"),t,n)}function kS(t){var n=SS(t.width,t.height);return CS(n).drawImage(t,0,0),n}function CS(t){return t.getContext("2d")}function OS(t,n,e){return t.width=n,t.height=e,t}function _S(t){return t.naturalWidth||t.width}function TS(t){return t.naturalHeight||t.height}var ES,BS,DS,MS=window.Promise?window.Promise:(BS=(ES=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=[],PS(t,AS(IS,this),AS(RS,this))}).immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){nt.setTimeout(t,1)},DS=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},ES.prototype["catch"]=function(t){return this.then(null,t)},ES.prototype.then=function(e,o){var r=this;return new ES(function(t,n){FS.call(r,new HS(e,o,t,n))})},ES.all=function(){for(var t=[],n=0;n ").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),oC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(cC(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){cC(t),oC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){oC(m).off()},oC(m).on("mousedown touchstart",n)}var lC=0,fC=function(s,e,l,o,r){var f,n,i,u="tox-",a="tox-crid-"+lC++,c=[{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"];var d=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},m=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function g(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=rC.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=m(l,c),f.fire("updateRect",{rect:c}),v(c)}function p(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),oC("#"+a+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}uC.each(c,function(t){oC("#"+a+"-"+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 h(t){p(s=t)}function v(t){h(d(l,t))}return function b(){oC('').appendTo(o),uC.each(i,function(t){oC("#"+a,o).append(' ')}),uC.each(c,function(t){oC("#"+a,o).append(' ')}),n=uC.map(c,function t(n){var e;return new sC(a,{document:o.ownerDocument,handle:a+"-"+n.name,start:function(){e=s},drag:function(t){g(n,e,t.deltaX,t.deltaY)}})}),p(s),oC(o).on("focusin focusout",function(t){oC(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),oC(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),g(i,e,o,r)}switch(uC.each(c,function(t){if(n.target.id===a+"-"+t.name)return i=t,!1}),n.keyCode){case aC.LEFT:t(n,0,s,-10,0);break;case aC.RIGHT:t(n,0,s,10,0);break;case aC.UP:t(n,0,s,0,-10);break;case aC.DOWN:t(n,0,s,0,10);break;case aC.ENTER:case aC.SPACEBAR:n.preventDefault(),r()}})}(),f=uC.extend({toggleVisibility:function y(t){var n;n=uC.map(c,function(t){return"#"+a+"-"+t.name}).concat(uC.map(i,function(t){return"#"+a+"-"+t})).join(","),t?oC(n,o).show():oC(n,o).hide()},setClampRect:function x(t){l=t,p(s)},setRect:h,getInnerRect:function(){return m(l,s)},setInnerRect:v,setViewPortRect:function w(t){e=t,p(s)},destroy:function t(){uC.each(n,function(t){t.destroy()}),n=[]}},iC)},dC=function(n){var l=Ug({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=ce(1),d=ce(st.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=f.get(),o=cu(t.element()),r=tu(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"};Mi(s,n),l.getOpt(t).each(function(t){Mi(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=le.fromTag("img");return Br(a,"src",n),e=a.dom(),new cp(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=qi({element:a});Nm.replaceAt(t,1,st.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=rC.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=cu(t.element()),e=tu(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=Ub.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:za([Lm("image-panel-crop-events",[or(function(t){g.getOpt(t).each(function(t){var n=t.element().dom(),e=fC({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},n,function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var n=t.rect,e=f.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(st.some(e))})})])])}],containerBehaviours:za([Nm.config({}),Lm("image-panel-events",[or(function(t){e(t,n)})])])}),g=Ug(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=f.get(),o=0 =r.minChars){var o=Mf.getCurrent(e).bind(function(t){return jf.getHighlighted(t).map(bl.getValue)});r.previewing.set(!0);Ly(r,u(t),t,e,i,function(t){Mf.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&jf.highlightFirst(t)},function(n){jf.highlightBy(t,function(t){return bl.getValue(t).value===n.value}),jf.getHighlighted(t).orThunk(function(){return jf.highlightFirst(t),st.none()})})})},sy.HighlightFirst).get(Z)}},cancelEvent:Oo()}),Rm.config({mode:"special",onDown:function(t,n){return e(t,n,jf.highlightFirst),st.some(!0)},onEscape:function(t){var n=Hy.getCoupled(t,"sandbox");return Qs.isOpen(n)?(Qs.close(n),st.some(!0)):st.none()},onUp:function(t,n){return e(t,n,jf.highlightLast),st.some(!0)},onEnter:function(n){var t=Hy.getCoupled(n,"sandbox"),e=Qs.isOpen(t);if(e&&!r.previewing.get())return Mf.getCurrent(t).bind(function(t){return jf.getHighlighted(t)}).map(function(t){return jo(n,FC(),{item:t}),!0});var o=bl.getValue(n);return Lo(n,Oo()),r.onExecute(t,n,o),e&&Qs.close(t),st.some(!0)}}),rg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Hy.config({others:{sandbox:function(t){return Yy(r,t,{onOpen:function(){return rg.on(t)},onClose:function(){return rg.off(t)}})}}}),Lm("typeaheadevents",[ur(function(t){var n=Z;Uy(r,u(t),t,i,n,sy.HighlightFirst).get(Z)}),Jo(FC(),function(t,n){var e=Hy.getCoupled(t,"sandbox");BC(r.model,t,n.event().item()),Lo(t,Oo()),r.onItemExecute(t,e,n.event().item(),bl.getValue(t)),Qs.close(e),MC(t)})].concat(r.dismissOnBlur?[Jo(vo(),function(t){var n=Hy.getCoupled(t,"sandbox");$a(n.element()).isNone()&&Qs.close(n)})]:[]))];return{uid:r.uid,dom:iy(Ct(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:et(et({},o),wl(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),HC=function(i){return et(et({},i),{toCached:function(){return HC(i.toCached())},bindFuture:function(n){return HC(i.bind(function(t){return t.fold(function(t){return vy(ot.error(t))},function(t){return n(t)})}))},bindResult:function(n){return HC(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return HC(i.map(function(t){return t.map(n)}))},mapError:function(n){return HC(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return HC(hy(function(n){var e=!1,o=nt.setTimeout(function(){e=!0,n(ot.error(r()))},t);i.get(function(t){e||(nt.clearTimeout(o),n(t))})}))}})},PC=function(t){return HC(hy(t))},zC=PC,NC={type:"separator"},LC=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},jC=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:undefined},onAction:function(){}}},UC=function(t,n){return o=t,e=P(n,function(t){return t.type===o}),V(e,LC);var e,o},WC=function(t,n){var e=t.toLowerCase();return P(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return Ee(n.toLowerCase(),e)||Ee(t.value.toLowerCase(),e)})},GC=function(u,t,a){var n=bl.getValue(t),c=n.meta.text!==undefined?n.meta.text:n.value;return a.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i=WC(c,(n=a.getHistory(u),V(n,function(t){return jC(t,t)})));return"file"===u?(e=[i,WC(c,UC("header",t.targets)),WC(c,ut([(r=t,st.from(r.anchorTop).map(function(t){return jC("",t)}).toArray()),UC("anchor",t.targets),(o=t,st.from(o.anchorBottom).map(function(t){return jC("",t)}).toArray())]))],N(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(NC,n)},[])):i})},XC=Nr("aria-invalid"),YC=function(r,o,i){var t,n,e,u,a,c=o.shared.providers,s=function(t){var n=bl.getValue(t);i.addToHistory(n.value,r.filetype)},l=ey.parts().field({factory:VC,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":XC,type:"url"},minChars:0,responseTime:0,fetch:function(t){var n=GC(r.filetype,t,i),e=Dk(n,$h.BUBBLE_TO_SANDBOX,o,!1);return vy(e)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(Ty)&&Ty.run(t).get(Z)},typeaheadBehaviours:za(ut([i.getValidationHandler().map(function(e){return Ty.config({getRoot:function(t){return lr(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){d.getOpt(t).each(function(t){Br(t.element(),"title",c.translate(n))})}},validator:{validate:function(t){var n=bl.getValue(t);return zC(function(o){e({type:r.filetype,url:n.value},function(t){if("invalid"===t.status){var n=ot.error(t.message);o(n)}else{var e=ot.value(t.message);o(e)}})})},validateOnLoad:!1}})}).toArray(),[ph.config({disabled:function(){return r.disabled||c.isReadOnly()}}),Dy.config({}),Lm("urlinput-events",ut(["file"===r.filetype?[Jo(so(),function(t){jo(t,Gb,{name:r.name})})]:[],[Jo(lo(),function(t){jo(t,Gb,{name:r.name}),s(t)}),Jo(bo(),function(t){jo(t,Gb,{name:r.name}),s(t)})]]))]])),eventOrder:((t={})[so()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:o.shared.getSink,parts:{menu:Yv(0,0,"normal")},onExecute:function(t,n,e){jo(n,Kb,{})},onItemExecute:function(t,n,e,o){s(t),jo(t,Gb,{name:r.name})}}),f=r.label.map(function(t){return Iy(t,c)}),d=Ug((n="invalid",e=st.some(XC),void 0===(u="warning")&&(u=n),void 0===a&&(a=n),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],innerHtml:Gg(u,c.icons),attributes:et({title:c.translate(a),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}})),m=Ug({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=i.getUrlPicker(r.filetype),p=Nr("browser.url.event"),h=Ug({dom:{tag:"div",classes:["tox-control-wrap"]},components:[l,m.asSpec()],behaviours:za([ph.config({disabled:function(){return r.disabled||c.isReadOnly()}})])}),v=Ug(Pk({name:r.name,icon:st.some("browse"),text:r.label.getOr(""),disabled:r.disabled,primary:!1,borderless:!0},function(t){return Lo(t,p)},c,[],["tox-browse-url"]));return ey.sketch({dom:Fy([]),components:f.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:ut([[h.asSpec()],g.map(function(){return v.asSpec()}).toArray()])}]),fieldBehaviours:za([ph.config({disabled:function(){return r.disabled||c.isReadOnly()},onDisabled:function(t){ey.getField(t).each(ph.disable),v.getOpt(t).each(ph.disable)},onEnabled:function(t){ey.getField(t).each(ph.enable),v.getOpt(t).each(ph.enable)}}),Uh(),Lm("url-input-events",[Jo(p,function(o){Mf.getCurrent(o).each(function(n){var t=bl.getValue(n),e=et({fieldname:r.name},t);g.each(function(t){t(e).get(function(t){bl.setValue(n,t),jo(o,Gb,{name:r.name})})})})})])])})},qC=function(a,c){var t,n,e=a.label.map(function(t){return Iy(t,c)}),o=function(o){return function(n,e){Au(e.event().target(),"[data-collection-item-value]").each(function(t){o(n,e,t,Dr(t,"data-collection-item-value"))})}},r=function(t,n){var e=V(n,function(t){var n,e=Vp.translate(t.text),o=1===a.columns?''+e+" ":"",r=''+t.icon+" ",i={_:" "," - ":" ","-":" "},u=e.replace(/\_| \- |\-/g,function(t){return i[t]});return''+r+o+" "}),o=1'+t.join("")+""});kr(t.element(),r.join(""))},i=o(function(t,n,e,o){n.stop(),c.isReadOnly()||jo(t,qb,{name:a.name,value:o})}),u=[Jo(ro(),o(function(t,n,e){Ka(e)})),Jo(fo(),i),Jo(So(),i),Jo(io(),o(function(t,n,e){Mu(t.element(),"."+Wp).each(function(t){xi(t,Wp)}),bi(e,Wp)})),Jo(uo(),o(function(t){Mu(t.element(),"."+Wp).each(function(t){xi(t,Wp)})})),ur(o(function(t,n,e,o){jo(t,qb,{name:a.name,value:o})}))],s=function(t,n){return V(Yc(t.element(),".tox-collection__item"),n)},l=ey.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==a.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:ct},behaviours:za([ph.config({disabled:c.isReadOnly,onDisabled:function(t){s(t,function(t){bi(t,"tox-collection__item--state-disabled"),Br(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){xi(t,"tox-collection__item--state-disabled"),Fr(t,"aria-disabled")})}}),Uh(),Nm.config({}),bl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){r(o,t),"auto"===a.columns&&Op(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;Rm.setGridSize(o,n,e)}),Lo(o,Zb)}}),Dy.config({}),Rm.config((t=a.columns,n="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===n?".tox-swatches__row":".tox-collection__group",cell:"color"===n?"."+zp:"."+Pp}})),Lm("collection-events",u)]),eventOrder:{"alloy.execute":["disabling","alloy.base.behaviour","collection-events"]}});return My(e,l,["tox-form__group--collection"],[])},KC=function(r){return function(n,e,o){return bt(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},JC={bar:KC(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(e.items,o.interpreter)};var e,o}),collection:KC(function(t,n){return qC(t,n.shared.providers)}),alertbanner:KC(function(t,n){return e=t,o=n.shared.providers,Ub.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[jg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Gg(e.icon,o.icons),attributes:{title:o.translate(e.iconTooltip)}},action:function(t){jo(t,qb,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:KC(function(t,n){return e=t,o=n.shared.providers,kC({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:st.none(),maximized:e.maximized},o);var e,o}),textarea:KC(function(t,n){return e=t,o=n.shared.providers,kC({name:e.name,multiline:!0,label:e.label,inputMode:st.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:st.none(),maximized:e.maximized},o);var e,o}),label:KC(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=V(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:za([Zw(),Nm.config({}),lS(st.none()),Rm.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(hC=function(t,n){return wS(t,n.shared.providers)},function(t,n,e){var o=Ct(n,{source:"dynamic"});return KC(hC)(t,o,e)}),button:KC(function(t,n){return Lk(t,n.shared.providers)}),checkbox:KC(function(t,n){return e=t,o=n.shared.providers,r=bl.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,n){t.element().dom().checked=n}}}),i=function(t){return t.element().dom().click(),st.some(!0)},u=ey.parts().field({factory:{sketch:ct},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:za([Zw(),ph.config({disabled:function(){return e.disabled||o.isReadOnly()}}),Dy.config({}),Xm.config({}),r,Rm.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),Lm("checkbox-events",[Jo(lo(),function(t,n){jo(t,Gb,{name:e.name})})])])}),a=ey.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:za([Zy.config({})])}),s=Ug({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:Gg("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),ey.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a],fieldBehaviours:za([ph.config({disabled:function(){return e.disabled||o.isReadOnly()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){ey.getField(t).each(ph.disable)},onEnabled:function(t){ey.getField(t).each(ph.enable)}}),Uh()])});var e,o,r,i,u,a,c,s}),colorinput:KC(function(t,n){return ox(t,n.shared,n.colorinput)}),colorpicker:KC(function(t){var n=function(t){return"tox-"+t},e=Qw(oS,n),r=Ug(e.sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){jo(t,qb,{name:"hex-valid",value:!0})},onInvalidHex:function(t){jo(t,qb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:za([bl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return Mf.getCurrent(n).bind(function(t){return bl.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);Mf.getCurrent(o).fold(function(){nt.console.log("Can not find form")},function(t){bl.setValue(t,{hex:st.from(e[1]).getOr("")}),Gw.getField(t,"hex").each(function(t){Lo(t,so())})})}}}),Zw()])}}),dropzone:KC(function(t,n){return dS(t,n.shared.providers)}),grid:KC(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:V(e.items,o.interpreter)};var e,o}),selectbox:KC(function(t,n){return e=t,o=n.shared.providers,r=V(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return Iy(t,o)}),u=ey.parts().field({dom:{},selectAttributes:{size:e.size},options:r,factory:SC,selectBehaviours:za([ph.config({disabled:function(){return e.disabled||o.isReadOnly()}}),Dy.config({}),Lm("selectbox-change",[Jo(lo(),function(t,n){jo(t,Gb,{name:e.name})})])])}),a=1 .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:za([Dy.config({}),Xm.config({})])}},F_=function(t){return UO.sketch(A_(t))},I_=function(e,t){var n=or(function(t){var n=V(e.initGroups,F_);XO.setGroups(t,n)});return za([Yh(e.providers.isReadOnly),Uh(),Rm.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),Lm("toolbar-events",[n])])},R_=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":A_({title:st.none(),items:[]}),"overflow-button":Rk({name:"more",icon:st.some("more-drawer"),disabled:!1,tooltip:st.some("More..."),primary:!1,borderless:!1},st.none(),t.providers)},splitToolbarBehaviours:I_(t,n)}},V_=function(i){var t=R_(i),n=l_.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return l_.sketch(et(et({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element(),n=Su(t),e=cr(t),o=Su(e),r=Math.max(e.dom().scrollHeight,o.height);return xu(n.x+4,o.y,n.width-8,r)},parts:et(et({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},H_=function(t){var n=D_.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=D_.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=R_(t);return D_.sketch(et(et({},o),{components:[n,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([M_()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([M_()],{type:"closed"})}}))},P_=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return XO.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===Kg.scrolling?["tox-toolbar--scrolling"]:[])},components:[XO.parts().groups({})],toolbarBehaviours:I_(t,n)})},z_=[re("disabled",!1),Jn("tooltip"),Jn("icon"),Jn("text"),ie("onSetup",function(){return Z})],N_=ln([Ln("type"),Un("onAction")].concat(z_)),L_=function(t){return Cn("toolbarbutton",N_,t)},j_=[Jn("text"),Jn("tooltip"),Jn("icon"),Un("fetch"),ie("onSetup",function(){return Z})],U_=ln(b([Ln("type")],j_)),W_=function(t){return Cn("menubutton",U_,t)},G_=ln([Ln("type"),Jn("tooltip"),Jn("icon"),Jn("text"),$n("select"),Un("fetch"),ie("onSetup",function(){return Z}),oe("presets","normal",["normal","color","listpreview"]),Zn("columns",1),Un("onAction"),Un("onItemAction")]),X_=[re("active",!1)].concat(z_),Y_=ln(X_.concat([Ln("type"),Un("onAction")])),q_=function(t){return Cn("ToggleButton",Y_,t)},K_=ln([Ln("type"),Nn("items",(vC=[xn([Ln("name"),Xn("items",Fn)]),Fn],{extract:function(t,n,e){for(var o=[],r=0,i=vC;r=n.bottom,c=o&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,e.y),bottom:e.bottom};if(t.inline&&!c)return{y:e.y,bottom:Math.min(u.y,e.bottom)};var s=wu(r);return c?{y:Math.max(u.bottom,e.y),bottom:Math.min(s.bottom,e.bottom)}:{y:Math.max(s.y,e.y),bottom:Math.min(u.y,e.bottom)}}(t,c,a,n.header.isPositionedAtTop()),g=m.y,p=m.bottom;return xu(f,g,d,p-g)},DT=function(n,t){var e=P(t,function(t){return t.predicate(n.dom())}),o=H(e,function(t){return"contexttoolbar"===t.type});return{contextToolbars:o.pass,contextForms:o.fail}},MT=function(t,n,e){var o=DT(t,n);if(0=n.y}var n,e})},EE=function(n,t){return t.getInitialPosition().map(function(t){return xu(t.bounds.x,t.bounds.y,cu(n),tu(n))})},BE=function(t,n,e){e.setInitialPosition(st.some({style:function(t){var n={},e=t.dom();if(Ci(e))for(var o=0;oe.y);o!==u.isVisible()&&(u.setVisible(o),c&&!o?(Si(i.element(),[r.fadeOutClass]),r.onHide(i)):(o?OE:_E)(i,r))})})},RE=function(n,e,t){var o,r,i=n.element();t.setDocked(!1),o=t,r=n.element(),EE(r,o).bind(function(t){return DE(r,t,o)}).each(function(t){t.fold(function(){return AE(n,e)},function(t){return FE(n,e,t)},Z)}),t.setVisible(!0),e.contextual.each(function(t){ki(i,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(n)}),VE(n,e,t)},VE=function(t,n,e){var o,r,i,u,a;t.getSystem().isConnected()&&(o=t,i=e,u=(r=n).lazyViewport(o),(a=i.isDocked())&&IE(o,r,i,u),ME(o,u,i).each(function(t){i.setDocked(!a),t.fold(function(){return AE(o,r)},function(t){return FE(o,r,t)},function(t){IE(o,r,i,u,!0),FE(o,r,t)})}))},HE=function(t,n,e){e.isDocked()&&RE(t,n,e)},PE=/* */Object.freeze({__proto__:null,refresh:VE,reset:HE,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)}}),zE=/* */Object.freeze({__proto__:null,events:function(o,r){return Yo([er(mo(),function(n,e){o.contextual.each(function(t){wi(n.element(),t.transitionClass)&&(ki(n.element(),[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(n));e.stop()})}),Jo(Bo(),function(t,n){VE(t,o,r)}),Jo(Do(),function(t,n){HE(t,o,r)})])}}),NE=[Qn("contextual",[Ln("fadeInClass"),Ln("fadeOutClass"),Ln("transitionClass"),Un("lazyContext"),$u("onShow"),$u("onShown"),$u("onHide"),$u("onHidden")]),ie("lazyViewport",ku),te("modes",["top","bottom"],fn(Fn)),$u("onDocked"),$u("onUndocked")],LE=La({fields:NE,name:"docking",active:zE,apis:PE,state:/* */Object.freeze({__proto__:null,init:function(t){var n=ce(!1),e=ce(!0),o=ce(st.none()),r=ce(t.modes);return oi({isDocked:n.get,setDocked:n.set,getInitialPosition:o.get,setInitialPosition:o.set,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+n.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}})}),jE={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},UE="tox-tinymce--toolbar-sticky-on",WE="tox-tinymce--toolbar-sticky-off",GE=function(r){var i=r.element();lr(i).each(function(t){var n,e="padding-"+LE.getModes(r)[0];if(LE.isDocked(r)){var o=cu(t);Di(i,"width",o+"px"),Di(t,e,nu(n=i)+(parseInt(Fi(n,"margin-top"),10)||0)+(parseInt(Fi(n,"margin-bottom"),10)||0)+"px")}else Hi(i,"width"),Hi(t,e)})},XE=function(t,n){n?(xi(t,jE.fadeOutClass),Si(t,[jE.transitionClass,jE.fadeInClass])):(xi(t,jE.fadeInClass),Si(t,[jE.fadeOutClass,jE.transitionClass]))},YE=function(t,n){var e=le.fromDom(t.getContainer());n?(bi(e,UE),xi(e,WE)):(bi(e,WE),xi(e,UE))},qE=function(c,t){var n,i=ce(st.none()),o=t.getSink,u=function(n){o().each(function(t){return n(t.element())})},e=function(t){c.inline||GE(t),YE(c,LE.isDocked(t)),t.getSystem().broadcastOn([tl()],{}),o().each(function(t){return t.getSystem().broadcastOn([tl()],{})})},r=c.inline?[]:[Ya.config({channels:((n={})[M_()]={onReceive:GE},n)})];return b([Xm.config({}),LE.config({contextual:et({lazyContext:function(t){var n,e,o=nu(t.element()),r=c.inline?c.getContentAreaContainer():c.getContainer(),i=wu(le.fromDom(r)),u=i.height-o,a=i.y+(n=t,e="top",F(LE.getModes(n),e)?0:o);return st.some(xu(i.x,a,i.width,u))},onShow:function(){u(function(t){return XE(t,!0)})},onShown:function(r){u(function(t){return ki(t,[jE.transitionClass,jE.fadeInClass])}),i.get().each(function(t){var n,e,o;n=r.element(),o=ar(e=t),Ja(o).filter(function(t){return!Le(e,t)}).filter(function(t){return Le(t,le.fromDom(o.dom().body))||Ue(n,t)}).each(function(){return Ka(e)}),i.set(st.none())})},onHide:function(t){var n,e;i.set((n=t.element(),e=o,$a(n).orThunk(function(){return e().toOption().bind(function(t){return $a(t.element())})}))),u(function(t){return XE(t,!1)})},onHidden:function(){u(function(t){return ki(t,[jE.transitionClass])})}},jE),modes:[t.header.getDockingMode()],onDocked:e,onUndocked:e})],r)},KE=/* */Object.freeze({__proto__:null,setup:function(t,n,o){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){o().each(LE.reset)}),t.on("ResizeWindow ResizeEditor",function(){o().each(GE)}),t.on("SkinLoaded",function(){o().each(function(t){LE.isDocked(t)?LE.reset(t):LE.refresh(t)})}),t.on("FullscreenStateChanged",function(){o().each(LE.reset)})),t.on("AfterScrollIntoView",function(e){o().each(function(t){LE.refresh(t);var n=t.element();Bd(n)&&function(t,n){var e=ar(n),o=e.dom().defaultView.innerHeight,r=mu(e),i=le.fromDom(t.elm),u=Su(i),a=tu(i),c=u.y,s=c+a,l=iu(n),f=tu(n),d=l.top(),m=d+f,g=Math.abs(d-r.top())<2,p=Math.abs(m-(r.top()+o))<2;if(g&&c"},rB=function(r,t){var e,n=function(t){return mf(r)},o=function(e,o){return function(t,n){return sf(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},i=function(t,n){return"true"!==Dr(t.element(),"aria-hidden")},u=o(i,!1),a=o(function(t,n){if(i(t)){var e=t.element();Di(e,"display","none"),Br(e,"aria-hidden","true"),jo(t,Vo(),{name:n,visible:!1})}}),c=function(n,t){it(t,function(t){return e(n,t)})},s=o(function(t,n){if(!i(t)){var e=t.element();Hi(e,"display"),Fr(e,"aria-hidden"),jo(t,Vo(),{name:n,visible:!0})}}),l={getSlotNames:n,getSlot:function(t,n){return sf(t,r,n)},isShowing:u,hideSlot:e=a,hideAllSlots:function(t){return c(t,n())},showSlot:s};return{uid:r.uid,dom:r.dom,components:t,behaviours:xl(r.slotBehaviours),apis:l}},iB=dt({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},function(t){return ni(t)}),uB=et(et({},iB),{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),of(nB,oB(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return ql({name:t,pname:oB(t)})});return yf(nB,eB,i,rB,o)}}),aB=ln([Jn("icon"),Jn("tooltip"),ie("onShow",Z),ie("onHide",Z),ie("onSetup",function(){return Z})]),cB=function(t){return{element:function(){return t.element().dom()}}},sB=function(e,o){var r=V(lt(o),function(t){var n=o[t],e=On(Cn("sidebar",aB,n));return{name:t,getApi:cB,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return V(r,function(t){var n=ce(Z);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Tp([Kh(t,n),Jh(t,n),Jo(Vo(),function(n,t){var e=t.event();L(r,function(t){return t.name===e.name()}).each(function(t){(e.visible()?t.onShow:t.onHide)(t.getApi(n))})})])})})},lB=function(t,e){Mf.getCurrent(t).each(function(t){return Nm.set(t,[(n=e,uB.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:sB(t,n),slotBehaviours:Tp([or(function(t){return uB.hideAllSlots(t)})])}}))]);var n})},fB=function(t){return Mf.getCurrent(t).bind(function(t){return __.isGrowing(t)||__.hasGrown(t)?Mf.getCurrent(t).bind(function(n){return L(uB.getSlotNames(n),function(t){return uB.isShowing(n,t)})}):st.none()})},dB=Nr("FixSizeEvent"),mB=Nr("AutoSizeEvent"),gB=function(t){var n,e,o,r=le.fromHtml(t),i=dr(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],N(e,function(t,n){var e;return"class"===n.name?t:et(et({},t),((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:Sr(r)};return et({tag:Cr(r),classes:a,attributes:u},c)},pB=function(t,n,e){var o=t.element();!0===n?(Nm.set(t,[{dom:{tag:"div",attributes:{"aria-label":e.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:gB('')}],behaviours:za([Rm.config({mode:"special",onTab:function(){return st.some(!0)},onShiftTab:function(){return st.some(!0)}}),Xm.config({})])}]),Hi(o,"display"),Fr(o,"aria-hidden")):(Nm.set(t,[]),Di(o,"display","none"),Br(o,"aria-hidden","true"))},hB=vE.optional({factory:tB,name:"menubar",schema:[zn("backstage")]}),vB=vE.optional({factory:{sketch:function(t){return wE.sketch({uid:t.uid,dom:t.dom,listBehaviours:za([Rm.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return P_({type:t.type,uid:Nr("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return st.none()}})},setupItem:function(t,n,e,o){XO.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[zn("dom"),zn("onEscape")]}),bB=vE.optional({factory:{sketch:function(t){var n;return((n=t).type===Kg.sliding?H_:n.type===Kg.floating?V_:P_)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),st.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[zn("dom"),zn("onEscape"),zn("getSink")]}),yB=vE.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?qE:QE;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:za(e(n,t.sharedBackstage))}}},name:"header",schema:[zn("dom")]}),xB=vE.optional({name:"socket",schema:[zn("dom")]}),wB=vE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:za([Dy.config({}),Xm.config({}),__.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){Mf.getCurrent(t).each(uB.hideAllSlots),Lo(t,mB)},onGrown:function(t){Lo(t,mB)},onStartGrow:function(t){jo(t,dB,{width:Ri(t.element(),"width").getOr("")})},onStartShrink:function(t){jo(t,dB,{width:cu(t.element())+"px"})}}),Nm.config({}),Mf.config({find:function(t){var n=Nm.contents(t);return K(n)}})])}],behaviours:za([nS(0),Lm("sidebar-sliding-events",[Jo(dB,function(t,n){Di(t.element(),"width",n.event().width())}),Jo(mB,function(t,n){Hi(t.element(),"width")})])])}}},name:"sidebar",schema:[zn("dom")]}),SB=vE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:za([Nm.config({})]),components:[]}}},name:"throbber",schema:[zn("dom")]}),kB=_f({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return hE.getPart(t,e,"socket")},setSidebar:function(t,n){hE.getPart(t,e,"sidebar").each(function(t){return lB(t,n)})},toggleSidebar:function(t,o){hE.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void Mf.getCurrent(n).each(function(n){Mf.getCurrent(n).each(function(t){__.hasGrown(n)?uB.isShowing(t,e)?__.shrink(n):(uB.hideAllSlots(t),uB.showSlot(t,e)):(uB.hideAllSlots(t),uB.showSlot(t,e),__.grow(n))})});var n,e})},whichSidebar:function(t){return hE.getPart(t,e,"sidebar").bind(fB).getOrNull()},getHeader:function(t){return hE.getPart(t,e,"header")},getToolbar:function(t){return hE.getPart(t,e,"toolbar")},setToolbar:function(t,n){hE.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(t,n){hE.getPart(t,e,"multiple-toolbar").each(function(t){wE.setItems(t,n)})},refreshToolbar:function(t){hE.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},getThrobber:function(t){return hE.getPart(t,e,"throbber")},focusToolbar:function(t){hE.getPart(t,e,"toolbar").orThunk(function(){return hE.getPart(t,e,"multiple-toolbar")}).each(function(t){Rm.focusIn(t)})},setMenubar:function(t,n){hE.getPart(t,e,"menubar").each(function(t){tB.setMenus(t,n)})},focusMenubar:function(t){hE.getPart(t,e,"menubar").each(function(t){tB.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[zn("dom"),zn("behaviours")],partFields:[yB,hB,bB,vB,xB,wB,SB],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=V(e,function(t){return F_(t)});t.setToolbar(n,o)},setToolbars:function(t,n,e){var o=V(e,function(t){return V(t,F_)});t.setToolbars(n,o)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),CB={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},OB=function(t){return"string"==typeof t?t.split(" "):t},_B=function(i,u){var a=et(et({},CB),u.menus),n=0o)return"top";var i=cr(c),u=Math.max(i.dom().scrollHeight,tu(i));return r.bottom=o.clientX&&t.top()<=o.clientY&&t.bottom()>=o.clientY})}(n,e)?(n.once("selectionchange",d),n.once("touchend",function(){return n.off("selectionchange",d)})):d()}},fD=function(t){return"string"==typeof t?t.split(/[ ,]/):t},dD=function(t){return t.settings.contextmenu_never_use_native||!1},mD=function(t){return e="contextmenu",o="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,bt(n.settings,e).map(fD).getOrThunk(function(){return P(fD(o),function(t){return yt(r,t)})});var n,e,o,r},gD=function(t){return S(t)?"|"===t:"separator"===t.type},pD={type:"separator"},hD=function(n){if(S(n))return n;switch(n.type){case"separator":return pD;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return S(t)?t:V(t,hD)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:(t=n.onAction,function(){return t()})}}var t},vD=function(t,n){if(0===n.length)return t;var e=J(t).filter(function(t){return!gD(t)}).fold(function(){return[]},function(t){return[pD]});return t.concat(e).concat(n).concat([pD])},bD=function(c,t,o){var r=Pe().deviceType.isTouch,i=Ji(Bg.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return c.focus()},onShow:function(){return o.setContextMenuState(!0)},onHide:function(){return o.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:za([Lm("dismissContextMenu",[Jo(Fo(),function(t,n){Qs.close(t),c.focus()})])])})),n=function(t){return Bg.hide(i)},e=function(u){if(dD(c)&&u.preventDefault(),t=c,(!u.ctrlKey||dD(t))&&!1!==c.getParam("contextmenu")){var t,n,e,a=(n=c,"longpress"!==(e=u).type&&(2!==e.button||e.target===n.getBody()&&""===e.pointerType));(r()?lD:uD)(c,u,function(){var r,i,t,n=a?c.selection.getStart(!0):u.target,e=c.ui.registry.getAll(),o=mD(c);return r=e.contextMenus,i=n,0<(t=N(o,function(t,n){if(yt(r,n)){var e=r[n].update(i);if(S(e))return vD(t,e.split(" "));if(0n})},h=function(t){return p(m,t,n,"top")},v=function(t){return p(g,t,a,"bottom")};Pe().deviceType.isTouch()&&(c.on("TableSelectionChange",function(n){t.get()||(Rs(e,m),Rs(e,g),t.set(!0)),i.set(st.some(n.start)),u.set(st.some(n.finish)),n.otherCells.each(function(t){o.set(t.upOrLeftCells),r.set(t.downOrRightCells),h(n.start),v(n.finish)})}),c.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),c.on("TableSelectionClear",function(){t.get()&&(Ps(m),Ps(g),t.set(!1)),i.set(st.none()),u.set(st.none())}))};(LT=NT=NT||{})[LT.None=0]="None",LT[LT.Both=1]="Both",LT[LT.Vertical=2]="Vertical";var lM,fM=function(t,n,e){var o,r,i,u,a,c,s=le.fromDom(t.getContainer()),l=(o=t,r=n,i=e,u=tu(s),a=cu(s),(c={}).height=LB(u+r.top(),wh(o),kh(o)),i===NT.Both&&(c.width=LB(a+r.left(),xh(o),Sh(o))),c);ft(l,function(t,n){return Di(s,n,NB(t))}),t.fire("ResizeEditor")},dM=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},mM=function(i,u,a){u.delimiter||(u.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:za([Rm.config({mode:"flow",selector:"div[role=button]"}),ph.config({disabled:a.isReadOnly}),Uh(),Dy.config({}),Nm.config({}),Lm("elementPathEvents",[or(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Rm.focusIn(r)}),i.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0'+n+""}}),0=e.dom().offsetLeft+cu(e)?Math.max(tu(e),u):u,c=parseInt(Fi(t,"margin-top"),10)||0,s=parseInt(Fi(t,"margin-bottom"),10)||0;return o-(tu(t)+c+s-a)}(e,o,n))}).each(function(t){KA(o,t)})})})},$A=function(t){return Mu(t,'[role="tabpanel"]')},QA=function(a){var c;return{smartTabHeight:(c=ce(st.none()),{extraEvents:[or(function(t){var e=t.element();$A(e).each(function(u){var n;Di(u,"visibility","hidden"),t.getSystem().getByDom(u).toOption().each(function(t){var o,r,i,n=(r=u,i=t,V(o=a,function(t,n){Nm.set(i,o[n].view());var e=r.dom().getBoundingClientRect();return Nm.set(i,[]),e.height})),e=K(q(n,function(t,n){return n"+n.translate(t)+"")}]}]})},dF=function(t){return yM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},mF=function(t,n){return[Ub.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Ub.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},gF=function(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return yM.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),st.some(!0)},useTabstopAt:function(t){return!yS(t)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:et({position:"relative"},n.extraStyles)},components:b([n.header,n.body],n.footer.toArray()),parts:{blocker:{dom:gB(''),components:[{dom:{tag:"div",classes:aF?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:za(b([Xm.config({}),Lm("dialog-events",n.dialogEvents.concat([er(io(),function(t,n){Rm.focusIn(t)})])),Lm("scroll-lock",[or(function(){bi(_i(),i)}),rr(function(){xi(_i(),i)})])],n.extraBehaviours)),eventOrder:et(((t={})[xo()]=["dialog-events"],t[Mo()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[Ao()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})},pF=function(t){return jg.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){Lo(t,Yb)}})},hF=function(t,n,e){var o=function(t){return[Yi(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:et({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:za([cT.config({channel:eF,renderComponents:o})])}},vF=function(){return{dom:gB('')}},bF=function(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=yM.parts().title(hF(e,st.none(),o)),i=yM.parts().draghandle(vF()),u=yM.parts().close(pF(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Ub.sketch({dom:gB(''),components:a});var e,o,r,i,u,a},yF=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){yM.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:gB('')}]}})},onUnblock:function(){yM.setIdle(t())}}},xF=function(t,n,e,o){var r;return Ji(gF(et(et({},t),{lazySink:o.shared.getSink,extraBehaviours:b([cT.config({channel:nF,updateState:function(t,n){return st.some(n)},initialData:n}),fS({})],t.extraBehaviours),onEscape:function(t){Lo(t,Yb)},dialogEvents:e,eventOrder:((r={})[yo()]=["reflecting","receiving"],r[Mo()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[Ao()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))},wF=function(t){return V(t,function(t){return"menu"===t.type?(e=V((n=t).items,function(t){var n=ce(!1);return et(et({},t),{storage:n})}),et(et({},n),{items:e})):t;var n,e})},SF=function(t){return N(t,function(t,n){return"menu"!==n.type?t:N(n.items,function(t,n){return t[n.name]=n.storage,t},t)},{})},kF=function(t,e){return[tr(io(),bS),t(Xb,function(t,n){e.onClose(),n.onClose()}),t(Yb,function(t,n,e,o){n.onCancel(t),Lo(o,Xb)}),Jo($b,function(t,n){return e.onUnblock()}),Jo(Jb,function(t,n){return e.onBlock(n.event())})]},CF=function(i,t){var n=function(t,r){return Jo(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){cT.getState(n).get().each(function(t){e(t,n)})};return b(kF(n,t),[n(qb,function(t,n,e){n.onAction(t,{name:e.name()})})])},OF=function(i,t,a){var n=function(t,r){return Jo(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){cT.getState(n).get().each(function(t){e(t.internalDialog,n)})};return b(kF(n,t),[n(Kb,function(t,n){return n.onSubmit(t)}),n(Gb,function(t,n,e){n.onChange(t,{name:e.name()})}),n(qb,function(t,n,e,o){var r=function(){return Rm.focusIn(o)},i=function(t){return Ar(t,"disabled")||Mr(t,"aria-disabled").exists(function(t){return"true"===t})},u=Ja();n.onAction(t,{name:e.name(),value:e.value()}),Ja().fold(r,function(n){i(n)||u.exists(function(t){return Ue(n,t)&&i(t)})?r():a().toOption().filter(function(t){return!Ue(t.element(),n)}).each(r)})}),n(Qb,function(t,n,e){n.onTabChange(t,{newTabName:e.name(),oldTabName:e.oldName()})}),rr(function(t){var n=i();bl.setValue(t,n.getData())})])},_F=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=H(e,function(t){return"start"===t.align}),r=function(t,n){return Ub.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},TF=function(t,i){return{dom:gB(''),components:[],behaviours:za([cT.config({channel:rF,initialData:t,updateState:function(t,n){var r=V(n.buttons,function(t){var n,e,o=Ug((e=i,Nk(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return st.some({lookupByName:function(t,n){return e=t,o=n,L(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:_F})])}},EF=function(t,n){return yM.parts().footer(TF(t,n))},BF=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=Mf.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return Gw.getField(o,e).fold(function(){var t=n.getFooter();return cT.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return st.some(t)})}return st.none()},DF=function(c,o,s){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},l={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t,e=bl.getValue(n),o=dt(s,function(t){return t.get()});return et(et({},e),o)},setData:function(a){t(function(t){var n,e,o=l.getData(),r=et(et({},o),a),i=(n=r,e=c.getRoot(),cT.getState(e).get().map(function(t){return On(Cn("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();bl.setValue(u,i),ft(s,function(t,n){yt(r,n)&&t.set(r[n])})})},disable:function(t){BF(c,t).each(ph.disable)},enable:function(t){BF(c,t).each(ph.enable)},focus:function(t){BF(c,t).each(Xm.focus)},block:function(n){if(!S(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){jo(t,Jb,{message:n})})},unblock:function(){t(function(t){Lo(t,$b)})},showTab:function(e){t(function(t){var n=c.getBody();cT.getState(n).get().exists(function(t){return t.isTabPanel()})&&Mf.getCurrent(n).each(function(t){qA.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([nF],n),t.getSystem().broadcastOn([eF],n.internalDialog),t.getSystem().broadcastOn([oF],n.internalDialog),t.getSystem().broadcastOn([rF],n.internalDialog),l.setData(n.initialData)})},close:function(){t(function(t){Lo(t,Xb)})}};return l},MF=function(t,n,e){var o,r,i,u=bF(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=uF(o,st.none(),r,!1),yM.parts().body(i)),c=wF(t.internalDialog.buttons),s=SF(c),l=EF({buttons:c},e),f=OF(function(){return p},yF(function(){return g},n),e.shared.getSink),d="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],m={header:u,body:a,footer:st.some(l),extraClasses:d,extraBehaviours:[],extraStyles:{}},g=xF(m,t,f,e),p=DF({getRoot:function(){return g},getBody:function(){return yM.getBody(g)},getFooter:function(){return yM.getFooter(g)},getFormWrapper:function(){var t=yM.getBody(g);return Mf.getCurrent(t).getOr(t)}},n.redial,s);return{dialog:g,instanceApi:p}},AF=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m=Nr("dialog-label"),g=Nr("dialog-content"),p=Ug((u={title:t.internalDialog.title,draggable:!0},a=m,c=e.shared.providers,Ub.sketch({dom:gB(''),components:[hF(u,st.some(a),c),vF(),pF(c)],containerBehaviours:za([iM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Au(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),h=Ug((s={body:t.internalDialog.body},l=g,f=e,d=o,uF(s,st.some(l),f,d))),v=wF(t.internalDialog.buttons),b=SF(v),y=Ug(TF({buttons:v},e)),x=OF(function(){return S},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}},e.shared.getSink),w=Ji({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((r={role:"dialog"})["aria-labelledby"]=m,r["aria-describedby"]=""+g,r)},eventOrder:((i={})[yo()]=[cT.name(),Ya.name()],i[xo()]=["execute-on-form"],i[Mo()]=["reflecting","execute-on-form"],i),behaviours:za([Rm.config({mode:"cyclic",onEscape:function(t){return Lo(t,Xb),st.some(!0)},useTabstopAt:function(t){return!yS(t)&&("button"!==Cr(t)||"disabled"!==Dr(t,"disabled"))}}),cT.config({channel:nF,updateState:function(t,n){return st.some(n)},initialData:t}),Xm.config({}),Lm("execute-on-form",x.concat([er(io(),function(t,n){Rm.focusIn(t)})])),fS({})]),components:[p.asSpec(),h.asSpec(),y.asSpec()]}),S=DF({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return h.get(w)},getFormWrapper:function(){var t=h.get(w);return Mf.getCurrent(t).getOr(t)}},n.redial,b);return{dialog:w,instanceApi:S}},FF=tinymce.util.Tools.resolve("tinymce.util.URI"),IF=["insertContent","setContent","execCommand","close","block","unblock"],RF=function(t){return k(t)&&-1!==IF.indexOf(t.mceAction)},VF=function(o,t,r,n){var e,i,u,a,c=bF(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[hS({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:za([Dy.config({}),Xm.config({})])})]}],behaviours:za([Rm.config({mode:"acyclic",useTabstopAt:x(yS)})])},yM.parts().body(i)),l=o.buttons.bind(function(t){return 0===t.length?st.none():st.some(EF({buttons:t},n))}),f=CF(function(){return y},yF(function(){return b},t)),d=et(et({},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 FF(o.url,{base_uri:new FF(nt.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=ce(st.none()),v=[Lm("messages",[or(function(){var t=yb(le.fromDom(nt.window),"message",function(t){if(g.isSameOrigin(new FF(t.raw().origin))){var n=t.raw().data;RF(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):!RF(e=n)&&k(e)&&yt(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(st.some(t))}),rr(function(){h.get().each(function(t){return t.unbind()})})]),Ya.config({channels:((e={})[iF]={onReceive:function(t,n){Mu(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=xF({header:c,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:d},o,f,n),y=(a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!S(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){jo(t,Jb,{message:n})})},unblock:function(){a(function(t){Lo(t,$b)})},close:function(){a(function(t){Lo(t,Xb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([iF],n)})}});return{dialog:u=b,instanceApi:y}},HF=function(t){var c,s,l,f,p=t.backstage,h=t.editor,v=Ph(h),e=(s=(c=t).backstage.shared,{open:function(t,n){var e=function(){yM.hide(u),n()},o=Ug(Nk({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:st.none()},"cancel",c.backstage)),r=lF(),i=sF(e,s.providers),u=Ji(gF({lazySink:function(){return s.getSink()},header:cF(r,i),body:fF(t,s.providers),footer:st.some(dF(mF([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Jo(Yb,e)],eventOrder:{}}));yM.show(u);var a=o.get(u);Xm.focus(a)}}),o=(f=(l=t).backstage.shared,{open:function(t,n){var e=function(t){yM.hide(a),n(t)},o=Ug(Nk({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:st.none()},"submit",l.backstage)),r=Nk({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:st.none()},"cancel",l.backstage),i=lF(),u=sF(function(){return e(!1)},f.providers),a=Ji(gF({lazySink:function(){return f.getSink()},header:cF(i,u),body:fF(t,f.providers),footer:st.some(dF(mF([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Jo(Yb,function(){return e(!1)}),Jo(Kb,function(){return e(!0)})],eventOrder:{}}));yM.show(a);var c=o.get(a);Xm.focus(c)}}),r=function(t,e){return VA.openUrl(function(t){var n=VF(t,{closeWindow:function(){yM.hide(n.dialog),e(n.instanceApi)}},h,p);return yM.show(n.dialog),n.instanceApi},t)},i=function(t,i){return VA.open(function(t,n,e){var o=n,r=MF({dataValidator:e,initialData:o,internalDialog:t},{redial:VA.redial,closeWindow:function(){yM.hide(r.dialog),i(r.instanceApi)}},p);return yM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},u=function(t,d,m,g){return VA.open(function(t,n,e){var o,r,i,u=On(Cn("data",e,n)),a=(o=ce(st.none()),{clear:function(){o.set(st.none())},set:function(t){o.set(st.some(t))},isSet:function(){return o.get().isSome()},on:function(t){o.get().each(t)}}),c=p.shared.header.isPositionedAtTop(),s=function(){return a.on(function(t){Bg.reposition(t),LE.refresh(t)})},l=AF({dataValidator:e,initialData:u,internalDialog:t},{redial:VA.redial,closeWindow:function(){a.on(Bg.hide),h.off("ResizeEditor",s),a.clear(),m(l.instanceApi)}},p,g),f=Ji(Bg.sketch(et(et({lazySink:p.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},c?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:za(b([Lm("window-manager-inline-events",[Jo(Fo(),function(t,n){Lo(l.dialog,Yb)})])],(r=h,i=c,v&&i?[]:[LE.config({contextual:{lazyContext:function(){return st.some(wu(le.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]))),isExtraPart:function(t,n){return Sb(e=n,".tox-alert-dialog")||Sb(e,".tox-confirm-dialog");var e}})));return a.set(f),Bg.showWithin(f,d,$i(l.dialog),st.some(_i())),v&&c||(LE.refresh(f),h.on("ResizeEditor",s)),l.instanceApi.setData(u),Rm.focusIn(l.dialog),l.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?u(t,p.shared.anchors.inlineDialog(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?u(t,p.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 XF(){t.add("silver",function(t){var n=pM(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;vb(t,o.shared);var u=HF({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:at(u),getNotificationManagerImpl:function(){return qg(0,{backstage:o},e)},ui:i()}})}()}(window);
|