(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-585e5a2b"],{"030f":function(e,t,n){(function(e){(function(){"use strict";var t=function(e){var t=typeof e;return null===e?"null":"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},n=function(e){return function(n){return t(n)===e}},r=function(e){return function(t){return typeof t===e}},o=function(e){return function(t){return e===t}},i=n("string"),a=n("object"),c=n("array"),u=o(null),s=r("boolean"),l=o(void 0),f=function(e){return null===e||void 0===e},d=function(e){return!f(e)},m=r("function"),g=r("number"),p=function(e,t){if(c(e)){for(var n=0,r=e.length;n-1},U=function(e,t){for(var n=0,r=e.length;n=0;n--){var r=e[n];t(r,n)}},X=function(e,t){for(var n=[],r=[],o=0,i=e.length;o=0&&t=t.length&&e.substr(n,n+t.length)===t},Fe=function(e,t){return Ue(e,t)?Ie(e,t.length):e},je=function(e,t){return qe(e,t)?e:Le(e,t)},Ve=function(e,t){return-1!==e.indexOf(t)},Ue=function(e,t){return He(e,t,0)},qe=function(e,t){return He(e,t,e.length-t.length)},We=function(e){return function(t){return t.replace(e,"")}},$e=We(/^\s+|\s+$/g),Ge=function(e){return e.length>0},Ke=function(e){return!Ge(e)},Xe=function(e){return void 0!==e.style&&m(e.style.getPropertyValue)},Ye=function(e,t){var n=t||document,r=n.createElement("div");if(r.innerHTML=e,!r.hasChildNodes()||r.childNodes.length>1)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return Ze(r.childNodes[0])},Je=function(e,t){var n=t||document,r=n.createElement(e);return Ze(r)},Qe=function(e,t){var n=t||document,r=n.createTextNode(e);return Ze(r)},Ze=function(e){if(null===e||void 0===e)throw new Error("Node cannot be null or undefined");return{dom:e}},et=function(e,t,n){return P.from(e.dom.elementFromPoint(t,n)).map(Ze)},tt={fromHtml:Ye,fromTag:Je,fromText:Qe,fromDom:Ze,fromPoint:et};"undefined"!==typeof window?window:Function("return this;")();var nt,rt=9,ot=11,it=1,at=3,ct=function(e){var t=e.dom.nodeName;return t.toLowerCase()},ut=function(e){return e.dom.nodeType},st=function(e){return function(t){return ut(t)===e}},lt=st(it),ft=st(at),dt=st(rt),mt=st(ot),gt=function(e){var t,n=!1;return function(){for(var r=[],o=0;o0&&t0}))},er=function(e){var t={},n=e.dom;if(Xe(n))for(var r=0;rr?t-r:0;return o};return{set:n,get:r,getOuter:o,aggregate:i,max:a}},ir=or("height",(function(e){var t=e.dom;return Pn(e)?t.getBoundingClientRect().height:t.offsetHeight})),ar=function(e){return ir.get(e)},cr=function(e){return ir.getOuter(e)},ur=function(e,t){var n=["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"],r=ir.max(e,t,n);Kn(e,"max-height",r+"px")},sr=function(e,t){var n=function(n,r){return sr(e+n,t+r)};return{left:e,top:t,translate:n}},lr=sr,fr=function(e){var t=e.getBoundingClientRect();return lr(t.left,t.top)},dr=function(e,t){return void 0!==e?e:void 0!==t?t:0},mr=function(e){var t=e.dom.ownerDocument,n=t.body,r=t.defaultView,o=t.documentElement;if(n===e.dom)return lr(n.offsetLeft,n.offsetTop);var i=dr(null===r||void 0===r?void 0:r.pageYOffset,o.scrollTop),a=dr(null===r||void 0===r?void 0:r.pageXOffset,o.scrollLeft),c=dr(o.clientTop,n.clientTop),u=dr(o.clientLeft,n.clientLeft);return gr(e).translate(a-u,i-c)},gr=function(e){var t=e.dom,n=t.ownerDocument,r=n.body;return r===t?lr(r.offsetLeft,r.offsetTop):Pn(e)?fr(t):lr(0,0)},pr=or("width",(function(e){return e.dom.offsetWidth})),hr=function(e,t){return pr.set(e,t)},vr=function(e){return pr.get(e)},yr=function(e){return pr.getOuter(e)},br=function(e,t){var n=["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"],r=pr.max(e,t,n);Kn(e,"max-width",r+"px")},wr=function(e,t,n,r,o,i,a){return{target:e,x:t,y:n,stop:r,prevent:o,kill:i,raw:a}},kr=function(e){var t=tt.fromDom(Rn(e).getOr(e.target)),n=function(){return e.stopPropagation()},r=function(){return e.preventDefault()},o=y(r,n);return wr(t,e.clientX,e.clientY,n,r,o,e)},_r=function(e,t){return function(n){e(n)&&t(kr(n))}},xr=function(e,t,n,r,o){var i=_r(n,r);return e.dom.addEventListener(t,i,o),{unbind:x(Sr,e,t,i,o)}},Cr=function(e,t,n,r){return xr(e,t,n,r,!1)},zr=function(e,t,n,r){return xr(e,t,n,r,!0)},Sr=function(e,t,n,r){e.dom.removeEventListener(t,n,r)},Tr=function(e,t){var n=vn(e);n.each((function(n){n.dom.insertBefore(t.dom,e.dom)}))},Or=function(e,t){var n=wn(e);n.fold((function(){var n=vn(e);n.each((function(e){Ar(e,t)}))}),(function(e){Tr(e,t)}))},Er=function(e,t){var n=xn(e);n.fold((function(){Ar(e,t)}),(function(n){e.dom.insertBefore(t.dom,n.dom)}))},Ar=function(e,t){e.dom.appendChild(t.dom)},Dr=function(e,t,n){_n(e,n).fold((function(){Ar(e,t)}),(function(e){Tr(e,t)}))},Mr=function(e,t){G(t,(function(t){Tr(e,t)}))},Nr=function(e,t){G(t,(function(t){Ar(e,t)}))},Rr=function(e){e.dom.textContent="",G(kn(e),(function(e){Br(e)}))},Br=function(e){var t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},Pr=function(e){var t=kn(e);t.length>0&&Mr(e,t),Br(e)},Lr=function(e){var t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,r=t.body.scrollTop||t.documentElement.scrollTop;return lr(n,r)},Ir=function(e,t,n){var r=void 0!==n?n.dom:document,o=r.defaultView;o&&o.scrollTo(e,t)},Hr=function(e){var t=void 0===e?window:e;return tn().browser.isFirefox()?P.none():P.from(t["visualViewport"])},Fr=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},jr=function(e){var t=void 0===e?window:e,n=t.document,r=Lr(tt.fromDom(n));return Hr(t).fold((function(){var e=t.document.documentElement,n=e.clientWidth,o=e.clientHeight;return Fr(r.left,r.top,n,o)}),(function(e){return Fr(Math.max(e.pageLeft,r.left),Math.max(e.pageTop,r.top),e.width,e.height)}))},Vr=function(e,t){var n=e.view(t);return n.fold(w([]),(function(t){var n=e.owner(t),r=Vr(e,n);return[t].concat(r)}))},Ur=function(e,t){var n=t.owner(e),r=Vr(t,n);return P.some(r)},qr=function(e){var t,n=e.dom===document?P.none():P.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement);return n.map(tt.fromDom)},Wr=function(e){return mn(e)},$r=Object.freeze({__proto__:null,view:qr,owner:Wr}),Gr=function(e){var t=tt.fromDom(document),n=Lr(t),r=Ur(e,$r);return r.fold(x(mr,e),(function(t){var r=gr(e),o=J(t,(function(e,t){var n=gr(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return lr(o.left+r.left+n.left,o.top+r.top+n.top)}))},Kr=function(e,t,n){return{point:e,width:t,height:n}},Xr=function(e,t,n,r){return{x:e,y:t,width:n,height:r}},Yr=function(e,t,n,r){return{x:e,y:t,width:n,height:r,right:e+n,bottom:t+r}},Jr=function(e){var t=mr(e),n=yr(e),r=cr(e);return Yr(t.left,t.top,n,r)},Qr=function(e){var t=Gr(e),n=yr(e),r=cr(e);return Yr(t.left,t.top,n,r)},Zr=function(){return jr(window)},eo=function(e){var t=function(t){return eo(e)},n=function(t){return eo(e)},r=function(t){return eo(t(e))},o=function(t){return eo(e)},i=function(t){t(e)},a=function(t){return t(e)},c=function(t,n){return n(e)},u=function(t){return t(e)},s=function(t){return t(e)},l=function(){return P.some(e)};return{isValue:T,isError:S,getOr:w(e),getOrThunk:w(e),getOrDie:w(e),or:t,orThunk:n,fold:c,map:r,mapError:o,each:i,bind:a,exists:u,forall:s,toOptional:l}},to=function(e){var t=function(e){return e()},n=function(){return z(String(e))()},r=k,o=function(e){return e()},i=function(t){return to(e)},a=function(t){return to(t(e))},c=function(t){return to(e)},u=function(t,n){return t(e)};return{isValue:S,isError:T,getOr:k,getOrThunk:t,getOrDie:n,or:r,orThunk:o,fold:u,map:i,mapError:a,each:h,bind:c,exists:S,forall:T,toOptional:P.none}},no=function(e,t){return e.fold((function(){return to(t)}),eo)},ro={value:eo,error:to,fromOption:no};(function(e){e[e["Error"]=0]="Error",e[e["Value"]=1]="Value"})(nt||(nt={}));var oo=function(e,t,n){return e.stype===nt.Error?t(e.serror):n(e.svalue)},io=function(e){var t=[],n=[];return G(e,(function(e){oo(e,(function(e){return n.push(e)}),(function(e){return t.push(e)}))})),{values:t,errors:n}},ao=function(e,t){return e.stype===nt.Error?{stype:nt.Error,serror:t(e.serror)}:e},co=function(e,t){return e.stype===nt.Value?{stype:nt.Value,svalue:t(e.svalue)}:e},uo=function(e,t){return e.stype===nt.Value?t(e.svalue):e},so=function(e,t){return e.stype===nt.Error?t(e.serror):e},lo=function(e){return{stype:nt.Value,svalue:e}},fo=function(e){return{stype:nt.Error,serror:e}},mo=function(e){return oo(e,ro.error,ro.value)},go=function(e){return e.fold(fo,lo)},po={fromResult:go,toResult:mo,svalue:lo,partition:io,serror:fo,bind:uo,bindError:so,map:co,mapError:ao,fold:oo},ho=function(e,t,n,r){return{tag:"field",key:e,newKey:t,presence:n,prop:r}},vo=function(e,t){return{tag:"custom",newKey:e,instantiator:t}},yo=function(e,t,n){switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return n(e.newKey,e.instantiator)}},bo=function(e,t){return t},wo=function(e,t){var n=a(e)&&a(t);return n?_o(e,t):t},ko=function(e){return function(){for(var t=[],n=0;n0?po.svalue(_o(t,xo.apply(void 0,e))):po.svalue(t)},Do=function(e){return y(po.serror,ne)(e)},Mo=function(e,t){var n=po.partition(e);return n.errors.length>0?Do(n.errors):Ao(n.values,t)},No=function(e){var t=po.partition(e);return t.errors.length>0?Do(t.errors):po.svalue(t.values)},Ro={consolidateObj:Mo,consolidateArr:No},Bo=function(e){return a(e)&&pe(e).length>100?" removed due to size":JSON.stringify(e,null,2)},Po=function(e){var t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e;return $(t,(function(e){return"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()}))},Lo=function(e,t){return po.serror([{path:e,getErrorInfo:t}])},Io=function(e,t,n){return Lo(e,(function(){return'Could not find valid *required* value for "'+t+'" in '+Bo(n)}))},Ho=function(e,t){return Lo(e,(function(){return'Choice schema did not contain choice key: "'+t+'"'}))},Fo=function(e,t,n){return Lo(e,(function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Bo(t)}))},jo=function(e,t){return Lo(e,(function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"}))},Vo=function(e,t){return Lo(e,w(t))},Uo=function(e){var t=function(t,n){return po.bindError(e(n),(function(e){return Vo(t,e)}))},n=w("val");return{extract:t,toString:n}},qo=Uo(po.svalue),Wo=function(e,t,n,r){return Se(t,n).fold((function(){return Io(e,n,t)}),r)},$o=function(e,t,n,r){var o=Se(e,t).getOrThunk((function(){return n(e)}));return r(o)},Go=function(e,t,n){return n(Se(e,t))},Ko=function(e,t,n,r){var o=Se(e,t).map((function(t){return!0===t?n(e):t}));return r(o)},Xo=function(e,t,n,r,o){var i=function(e){return o.extract(t.concat([r]),e)},a=function(e){return e.fold((function(){return po.svalue(P.none())}),(function(e){var n=o.extract(t.concat([r]),e);return po.map(n,P.some)}))};switch(e.tag){case"required":return Wo(t,n,r,i);case"defaultedThunk":return $o(n,r,e.process,i);case"option":return Go(n,r,a);case"defaultedOptionThunk":return Ko(n,r,e.process,a);case"mergeWithThunk":return $o(n,r,w({}),(function(t){var r=_o(e.process(n),t);return i(r)}))}},Yo=function(e,t,n){for(var r={},o=[],i=0,a=n;i0?po.serror(o):po.svalue(r)},Jo=function(e){var t=function(t,n){return e().extract(t,n)},n=function(){return e().toString()};return{extract:t,toString:n}},Qo=function(e){return pe(_e(e,d))},Zo=function(e){var t=ei(e),n=J(e,(function(e,t){return yo(t,(function(t){var n;return _o(e,(n={},n[t]=!0,n))}),w(e))}),{}),r=function(e,r){var o=s(r)?[]:Qo(r),i=Y(o,(function(e){return!Oe(n,e)}));return 0===i.length?t.extract(e,r):jo(e,i)};return{extract:r,toString:t.toString}},ei=function(e){var t=function(t,n){return Yo(t,n,e)},n=function(){var t=$(e,(function(e){return yo(e,(function(e,t,n,r){return e+" -> "+r.toString()}),(function(e,t){return"state("+e+")"}))}));return"obj{\n"+t.join("\n")+"}"};return{extract:t,toString:n}},ti=function(e){var t=function(t,n){var r=$(n,(function(n,r){return e.extract(t.concat(["["+r+"]"]),n)}));return Ro.consolidateArr(r)},n=function(){return"array("+e.toString()+")"};return{extract:t,toString:n}},ni=function(e){var t=function(t,n){for(var r=[],o=0,i=e;o0?ha(n.errors):pa(n.values,t)},ya=function(e){return m(e)?e:S},ba=function(e,t,n){var r=e.dom,o=ya(n);while(r.parentNode){r=r.parentNode;var i=tt.fromDom(r),a=t(i);if(a.isSome())return a;if(o(i))break}return P.none()},wa=function(e,t,n){var r=t(e),o=ya(n);return r.orThunk((function(){return o(e)?P.none():ba(e,t,o)}))},ka=function(e,t){return sn(e.element,t.event.target)},_a={can:T,abort:S,run:h},xa=function(e){if(!Oe(e,"can")&&!Oe(e,"abort")&&!Oe(e,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(e,null,2)+" does not have can, abort, or run!");return E(E({},_a),e)},Ca=function(e,t){return function(){for(var n=[],r=0;r1?Y(t[n],(function(t){return U(e,(function(e){return e.name===t}))})).join(" > "):e[0].name;return ma(n,Ru(o,i))}))}));return va(n,{})},$u="alloy.base.behaviour",Gu=ei([Si("dom","dom",Co(),ei([Ei("tag"),Ki("styles",{}),Ki("classes",[]),Ki("attributes",{}),Fi("value"),Fi("innerHtml")])),Ei("components"),Ei("uid"),Ki("events",{}),Ki("apis",{}),Si("eventOrder","eventOrder",Eo((ca={},ca[tc()]=["disabling",$u,"toggling","typeaheadevents"],ca[Ja()]=[$u,"focusing","keying"],ca[cc()]=[$u,"disabling","toggling","representing"],ca[Va()]=[$u,"representing","streaming","invalidating"],ca[mc()]=[$u,"representing","item-events","tooltipping"],ca[Na()]=["focusing",$u,"item-type-events"],ca[Ea()]=["focusing",$u,"item-type-events"],ca[La()]=["item-type-events","tooltipping"],ca[ec()]=["receiving","reflecting","tooltipping"],ca)),ai()),Fi("domModification")]),Ku=function(e){return wi("custom.definition",Gu,e)},Xu=function(e){return E(E({},e.dom),{uid:e.uid,domChildren:$(e.components,(function(e){return e.element}))})},Yu=function(e){return e.domModification.fold((function(){return Au({})}),Au)},Ju=function(e){return e.events},Qu=function(e,t){var n=Vn(e,t);return void 0===n||""===n?[]:n.split(" ")},Zu=function(e,t,n){var r=Qu(e,t),o=r.concat([n]);return Fn(e,t,o.join(" ")),!0},es=function(e,t,n){var r=Y(Qu(e,t),(function(e){return e!==n}));return r.length>0?Fn(e,t,r.join(" ")):Wn(e,t),!1},ts=function(e){return void 0!==e.dom.classList},ns=function(e){return Qu(e,"class")},rs=function(e,t){return Zu(e,"class",t)},os=function(e,t){return es(e,"class",t)},is=function(e,t){ts(e)?e.dom.classList.add(t):rs(e,t)},as=function(e){var t=ts(e)?e.dom.classList:ns(e);0===t.length&&Wn(e,"class")},cs=function(e,t){if(ts(e)){var n=e.dom.classList;n.remove(t)}else os(e,t);as(e)},us=function(e,t){return ts(e)&&e.dom.classList.contains(t)},ss=function(e,t){G(t,(function(t){is(e,t)}))},ls=function(e,t){G(t,(function(t){cs(e,t)}))},fs=function(e,t){return oe(t,(function(t){return us(e,t)}))},ds=function(e){return e.dom.value},ms=function(e,t){if(void 0===t)throw new Error("Value.set was undefined");e.dom.value=t},gs=function(e){var t=tt.fromTag(e.tag);jn(t,e.attributes),ss(t,e.classes),Xn(t,e.styles),e.innerHtml.each((function(e){return Kc(t,e)}));var n=e.domChildren;return Nr(t,n),e.value.each((function(e){ms(t,e)})),e.uid,lu(t,e.uid),t},ps=function(e){var t=Se(e,"behaviours").getOr({});return re(pe(t),(function(e){var n=t[e];return d(n)?[n.me]:[]}))},hs=function(e,t){return Su(e,t)},vs=function(e){var t=ps(e);return hs(e,t)},ys=function(e,t,n){var r=Xu(e),o=Yu(e),i={"alloy.base.modification":o},a=t.length>0?Mu(n,i,t,r):o;return Du(r,a)},bs=function(e,t,n){var r={"alloy.base.behaviour":Ju(e)};return ju(n,e.eventOrder,t,r).getOrDie()},ws=function(e){var t=function(){return b},n=oa(pu),r=ki(Ku(e)),o=vs(e),i=Tu(o),a=Ou(o),c=ys(r,i,a),u=gs(c),s=bs(r,i,a),l=oa(r.components),f=function(e){n.set(e)},d=function(){n.set(gu(t))},g=function(){var e=kn(u),t=re(e,(function(e){return n.get().getByDom(e).fold((function(){return[]}),ue)}));l.set(t)},p=function(t){var n=a,r=m(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))};return r()},h=function(e){return m(a[e.name()])},v=function(){return r.apis},y=function(e){return a[e]().map((function(e){return e.state.readState()})).getOr("not enabled")},b={uid:e.uid,getSystem:n.get,config:p,hasConfigured:h,spec:e,readState:y,getApis:v,connect:f,disconnect:d,element:u,syncComponents:g,components:l.get,events:s};return b},ks=function(e){var t=Se(e,"components").getOr([]);return $(t,Ts)},_s=function(e){var t=mu(e),n=t.events,r=A(t,["events"]),o=ks(r),i=E(E({},r),{events:E(E({},nu),n),components:o});return ro.value(ws(i))},xs=function(e){var t=tt.fromText(e);return Cs({element:t})},Cs=function(e){var t=_i("external.component",Zo([Ei("element"),Fi("uid")]),e),n=oa(gu()),r=function(e){n.set(e)},o=function(){n.set(gu((function(){return a})))},i=t.uid.getOrThunk((function(){return du("external")}));lu(t.element,i);var a={uid:i,getSystem:n.get,config:P.none,hasConfigured:S,connect:r,disconnect:o,getApis:function(){return{}},element:t.element,spec:e,readState:w("No state"),syncComponents:h,components:w([]),events:{}};return ku(a)},zs=du,Ss=function(e){return Te(e,"uid")},Ts=function(e){return _u(e).getOrThunk((function(){var t=Ss(e)?e:E({uid:zs("")},e);return _s(t).getOrDie()}))},Os=ku;function Es(e,t,n,r,o){return e(n,r)?P.some(n):m(o)&&o(n)?P.none():t(n,r,o)}var As,Ds=function(e,t,n){var r=e.dom,o=m(n)?n:S;while(r.parentNode){r=r.parentNode;var i=tt.fromDom(r);if(t(i))return P.some(i);if(o(i))break}return P.none()},Ms=function(e,t,n){var r=function(e,t){return t(e)};return Es(r,Ds,e,t,n)},Ns=function(e,t){var n=function(e){return t(tt.fromDom(e))},r=ee(e.dom.childNodes,n);return r.map(tt.fromDom)},Rs=function(e,t){var n=function(e){for(var r=0;r-1}));return t.bind((function(e){var t=Vn(e,"id"),n=En(e);return Is(n,'[aria-owns="'+t+'"]')}))},js=function(){var e=ou("aria-owns"),t=function(t){Fn(t,"aria-owns",e)},n=function(e){Wn(e,"aria-owns")};return{id:e,link:t,unlink:n}},Vs=function(e,t){return Fs(t).exists((function(t){return Us(e,t)}))},Us=function(e,t){return Bs(t,(function(t){return sn(t,e.element)}),S)||Vs(e,t)},qs="unknown";(function(e){e[e["STOP"]=0]="STOP",e[e["NORMAL"]=1]="NORMAL",e[e["LOGGING"]=2]="LOGGING"})(As||(As={}));var Ws=oa({}),$s=function(e,t){var n=[],r=(new Date).getTime();return{logEventCut:function(e,t,r){n.push({outcome:"cut",target:t,purpose:r})},logEventStopped:function(e,t,r){n.push({outcome:"stopped",target:t,purpose:r})},logNoParent:function(e,t,r){n.push({outcome:"no-parent",target:t,purpose:r})},logEventNoHandlers:function(e,t){n.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(e,t,r){n.push({outcome:"response",purpose:r,target:t})},write:function(){var o=(new Date).getTime();V(["mousemove","mouseover","mouseout",cc()],e)||console.log(e,{event:e,time:o-r,target:t.dom,sequence:$(n,(function(e){return V(["cut","stopped","response"],e.outcome)?"{"+e.purpose+"} "+e.outcome+" at ("+Zc(e.target)+")":e.outcome}))})}}},Gs=function(e,t,n){var r=Se(Ws.get(),e).orThunk((function(){var t=pe(Ws.get());return ge(t,(function(t){return e.indexOf(t)>-1?P.some(Ws.get()[t]):P.none()}))})).getOr(As.NORMAL);switch(r){case As.NORMAL:return n(Qs());case As.LOGGING:var o=$s(e,t),i=n(o);return o.write(),i;case As.STOP:return!0}},Ks=["alloy/data/Fields","alloy/debugging/Debugging"],Xs=function(){var e=new Error;if(void 0!==e.stack){var t=e.stack.split("\n");return ee(t,(function(e){return e.indexOf("alloy")>0&&!U(Ks,(function(t){return e.indexOf(t)>-1}))})).getOr(qs)}return qs},Ys={logEventCut:h,logEventStopped:h,logNoParent:h,logEventNoHandlers:h,logEventResponse:h,write:h},Js=function(e,t,n){return Gs(e,t,n)},Qs=w(Ys),Zs=w([Ei("menu"),Ei("selectedMenu")]),el=w([Ei("item"),Ei("selectedItem")]);w(ei(el().concat(Zs())));var tl=w(ei(el())),nl=Li("initSize",[Ei("numColumns"),Ei("numRows")]),rl=function(){return Ai("markers",tl())},ol=function(){return Li("markers",[Ei("backgroundMenu")].concat(Zs()).concat(el()))},il=function(e){return Li("markers",$(e,Ei))},al=function(e,t,n){return Xs(),Si(t,t,n,vi((function(e){return ro.value((function(){for(var t=[],n=0;nr?n:o=n&&a<=o,m=c>=r&&c<=i,g=d&&m,p=u<=o&&u>=n,h=s<=i&&s>=r,v=p&&h,y=Math.min(l,a>=n?o-a:u-n),b=Math.min(f,c>=r?i-c:s-r);return{originInBounds:g,sizeInBounds:v,visibleW:y,visibleH:b}},Yf=function(e,t){var n=t.x,r=t.y,o=t.right,i=t.bottom,a=e.x,c=e.y,u=e.width,s=e.height,l=Math.max(n,o-u),f=Math.max(r,i-s),d=Ol(a,n,l),m=Ol(c,r,f),g=Math.min(d+u,o)-d,p=Math.min(m+s,i)-m;return Yr(d,m,g,p)},Jf=function(e,t,n){var r=w(t.bottom-n.y),o=w(n.bottom-t.y),i=vl(e,o,o,r),a=w(t.right-n.x),c=w(n.right-t.x),u=yl(e,c,c,a);return{maxWidth:u,maxHeight:i}},Qf=function(e,t,n,r){var o=e.bubble,i=o.offset,a=Dl(r,e.restriction,i),c=e.x+i.left,u=e.y+i.top,s=Yr(c,u,t,n),l=Xf(s,a),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,p=f&&d,h=p?s:Yf(s,a),v=h.width>0&&h.height>0,y=Jf(e.direction,h,r),b=y.maxWidth,w=y.maxHeight,k={rect:h,maxHeight:w,maxWidth:b,direction:e.direction,placement:e.placement,classes:{on:o.classesOn,off:o.classesOff},layout:e.label,testY:u};return p||e.alwaysFit?Kf.fit(k):Kf.nofit(k,m,g,v)},Zf=function(e,t,n,r,o,i){var a=r.width,c=r.height,u=function(t,u,s,l,f){var d=t(n,r,o,e,i),m=Qf(d,a,c,i);return m.fold(w(m),(function(e,t,n,r){var o=f===r?n>l||t>s:!f&&r;return o?m:Kf.nofit(u,s,l,f)}))},s=Q(t,(function(e,t){var n=x(u,t);return e.fold(w(e),n)}),Kf.nofit({rect:n,maxHeight:r.height,maxWidth:r.width,direction:bl(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return s.fold(k,k)},ed=function(e){var t=oa(P.none()),n=function(){return t.get().each(e)},r=function(){n(),t.set(P.none())},o=function(){return t.get().isSome()},i=function(){return t.get()},a=function(e){n(),t.set(P.some(e))};return{clear:r,isSet:o,get:i,set:a}},td=function(){return ed((function(e){return e.destroy()}))},nd=function(){return ed((function(e){return e.unbind()}))},rd=function(){var e=td(),t=function(t){return e.get().each(t)};return E(E({},e),{run:t})},od=function(){var e=ed(h),t=function(t){return e.get().each(t)};return E(E({},e),{on:t})},id=T,ad=function(e,t,n){return Cr(e,t,id,n)},cd=function(e,t,n){return zr(e,t,id,n)},ud=kr,sd=["top","bottom","right","left"],ld="data-alloy-transition-timer",fd=function(e,t){return fs(e,t.classes)},dd=function(e,t,n){return n.exists((function(n){var r=e.mode;return"all"===r||n[r]!==t[r]}))},md=function(e,t){var n=function(e){return parseFloat(e).toFixed(3)};return Ce(t,(function(t,r){var o=e[r].map(n),i=t.map(n);return!Ae(o,i)})).isSome()},gd=function(e){var t=function(t){var n=Jn(e,t),r=i(n)?n.split(/\s*,\s*/):[];return Y(r,Ge)},n=function(e){if(i(e)&&/^[\d.]+/.test(e)){var t=parseFloat(e);return qe(e,"ms")?t:1e3*t}return 0},r=t("transition-delay"),o=t("transition-duration");return Q(o,(function(e,t,o){var i=n(r[o])+n(t);return Math.max(e,i)}),0)},pd=function(e,t){var n,r=nd(),o=nd(),i=function(t){var n,r=null!==(n=t.raw.pseudoElement)&&void 0!==n?n:"";return sn(t.target,e)&&Ke(r)&&V(sd,t.raw.propertyName)},a=function(a){if(f(a)||i(a)){r.clear(),o.clear();var c=null===a||void 0===a?void 0:a.raw.type;(f(c)||c===$a())&&(clearTimeout(n),Wn(e,ld),ls(e,t.classes))}},c=function(){r.set(ad(e,$a(),a)),o.set(ad(e,Wa(),a))};if("ontransitionstart"in e.dom)var u=ad(e,Ga(),(function(e){i(e)&&(u.unbind(),c())}));else c();var s=gd(e);requestAnimationFrame((function(){n=setTimeout(a,s+17),Fn(e,ld,n)}))},hd=function(e,t){ss(e,t.classes),Un(e,ld).each((function(t){clearTimeout(parseInt(t,10)),Wn(e,ld)})),pd(e,t)},vd=function(e,t,n,r,o,i){var a=dd(r,o,i);if(a||fd(e,r)){Kn(e,"position",n.position);var c=Bf(t,e),u=Rf(t,E(E({},o),{rect:c})),s=ce(sd,(function(e){return u[e]}));md(n,s)&&(Yn(e,s),a&&hd(e,r),rr(e))}else ls(e,r.classes)},yd=function(e){return{width:yr(e),height:cr(e)}},bd=function(e,t,n,r){nr(t,"max-height"),nr(t,"max-width");var o=yd(t);return Zf(t,r.preference,e,o,n,r.bounds)},wd=function(e,t){var n=t.classes;ls(e,n.off),ss(e,n.on)},kd=function(e,t,n){var r=n.maxHeightFunction;r(e,t.maxHeight)},_d=function(e,t,n){var r=n.maxWidthFunction;r(e,t.maxWidth)},xd=function(e,t,n){var r=Rf(n.origin,t);n.transition.each((function(o){vd(e,n.origin,r,o,t,n.lastPlacement)})),Df(e,r)},Cd=function(e,t){Wf(e,t.placement)},zd=function(e,t){ur(e,Math.floor(t))},Sd=w((function(e,t){zd(e,t),Xn(e,{"overflow-x":"hidden","overflow-y":"auto"})})),Td=w((function(e,t){zd(e,t)})),Od=function(e,t,n){return void 0===e[t]?n:e[t]},Ed=function(e,t,n,r,o,i,a,c){var u=Od(a,"maxHeightFunction",Sd()),s=Od(a,"maxWidthFunction",h),l=e.anchorBox,f=e.origin,d={bounds:Pf(f,i),origin:f,preference:r,maxHeightFunction:u,maxWidthFunction:s,lastPlacement:o,transition:c};return Ad(l,t,n,d)},Ad=function(e,t,n,r){var o=bd(e,t,n,r);return xd(t,o,r),Cd(t,o),wd(t,o),kd(t,o,r),_d(t,o,r),{layout:o.layout,placement:o.placement}},Dd=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Md=function(e,t,n,r){void 0===r&&(r=1);var o=e*r,i=t*r,a=function(e){return Se(n,e).getOr([])},c=function(e,t,n){var r=ae(Dd,n);return{offset:lr(e,t),classesOn:re(n,a),classesOff:re(r,a)}};return{southeast:function(){return c(-e,t,["top","alignLeft"])},southwest:function(){return c(e,t,["top","alignRight"])},south:function(){return c(-e/2,t,["top","alignCentre"])},northeast:function(){return c(-e,-t,["bottom","alignLeft"])},northwest:function(){return c(e,-t,["bottom","alignRight"])},north:function(){return c(-e/2,-t,["bottom","alignCentre"])},east:function(){return c(e,-t/2,["valignCentre","left"])},west:function(){return c(-e,-t/2,["valignCentre","right"])},insetNortheast:function(){return c(o,i,["top","alignLeft","inset"])},insetNorthwest:function(){return c(-o,i,["top","alignRight","inset"])},insetNorth:function(){return c(-o/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return c(o,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return c(-o,-i,["bottom","alignRight","inset"])},insetSouth:function(){return c(-o/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return c(-o,-i/2,["valignCentre","right","inset"])},insetWest:function(){return c(o,-i/2,["valignCentre","left","inset"])}}},Nd=function(){return Md(0,0,{})},Rd=k,Bd=function(e,t){return function(n){return"rtl"===Pd(n)?t:e}},Pd=function(e){return"rtl"===Jn(e,"direction")?"rtl":"ltr"};(function(e){e["TopToBottom"]="toptobottom",e["BottomToTop"]="bottomtotop"})(Hf||(Hf={}));var Ld="data-alloy-vertical-dir",Id=function(e){return Bs(e,(function(e){return lt(e)&&Vn(e,"data-alloy-vertical-dir")===Hf.BottomToTop}))},Hd=function(){return $i("layouts",[Ei("onLtr"),Ei("onRtl"),Fi("onBottomLtr"),Fi("onBottomRtl")])},Fd=function(e,t,n,r,o,i,a){var c=a.map(Id).getOr(!1),u=t.layouts.map((function(t){return t.onLtr(e)})),s=t.layouts.map((function(t){return t.onRtl(e)})),l=c?t.layouts.bind((function(t){return t.onBottomLtr.map((function(t){return t(e)}))})).or(u).getOr(o):u.getOr(n),f=c?t.layouts.bind((function(t){return t.onBottomRtl.map((function(t){return t(e)}))})).or(s).getOr(i):s.getOr(r),d=Bd(l,f);return d(e)},jd=function(e,t,n){var r=t.hotspot,o=Bf(n,r.element),i=Fd(e.element,t,Zl(),ef(),Jl(),Ql(),P.some(t.hotspot.element));return P.some(Rd({anchorBox:o,bubble:t.bubble.getOr(Nd()),overrides:t.overrides,layouts:i,placer:P.none()}))},Vd=[Ei("hotspot"),Fi("bubble"),Ki("overrides",{}),Hd(),fl("placement",jd)],Ud=function(e,t,n){var r=Lf(n,t.x,t.y),o=Yr(r.left,r.top,t.width,t.height),i=Fd(e.element,t,Xl(),Yl(),Xl(),Yl(),P.none());return P.some(Rd({anchorBox:o,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:P.none()}))},qd=[Ei("x"),Ei("y"),Ki("height",0),Ki("width",0),Ki("bubble",Nd()),Ki("overrides",{}),Hd(),fl("placement",Ud)],Wd=aa.generate([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),$d=function(e){return e.fold(k,(function(e,t,n){return e.translate(-t,-n)}))},Gd=function(e){return e.fold(k,k)},Kd=function(e){return Q(e,(function(e,t){return e.translate(t.left,t.top)}),lr(0,0))},Xd=function(e){var t=$(e,$d);return Kd(t)},Yd=function(e){var t=$(e,Gd);return Kd(t)},Jd=Wd.screen,Qd=Wd.absolute,Zd=function(e,t,n){var r=hn(n.root).dom,o=function(t){var n=mn(t),r=mn(e.element);return sn(n,r)};return P.from(r.frameElement).map(tt.fromDom).filter(o).map(mr)},em=function(e,t,n){var r=mn(e.element),o=Lr(r),i=Zd(e,t,n).getOr(o);return Qd(i,o.left,o.top)},tm=function(e,t,n,r){var o=Jd(lr(e,t));return P.some(Kr(o,n,r))},nm=function(e,t,n,r,o){return e.map((function(e){var i=[t,e.point],a=If(r,(function(){return Yd(i)}),(function(){return Yd(i)}),(function(){return Xd(i)})),c=Xr(a.left,a.top,e.width,e.height),u=n.showAbove?Jl():Zl(),s=n.showAbove?Ql():ef(),l=Fd(o,n,u,s,u,s,P.none());return Rd({anchorBox:c,bubble:n.bubble.getOr(Nd()),overrides:n.overrides,layouts:l,placer:P.none()})}))},rm=function(e,t,n){var r=em(e,n,t);return t.node.filter(Pn).bind((function(o){var i=o.dom.getBoundingClientRect(),a=tm(i.left,i.top,i.width,i.height),c=t.node.getOr(e.element);return nm(a,r,t,n,c)}))},om=[Ei("node"),Ei("root"),Fi("bubble"),Hd(),Ki("overrides",{}),Ki("showAbove",!1),fl("placement",rm)],im="\ufeff",am=" ",cm=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},um={create:cm},sm=aa.generate([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),lm=function(e,t,n,r){return e.fold(t,n,r)},fm=function(e){return e.fold(k,k,k)},dm=sm.before,mm=sm.on,gm=sm.after,pm={before:dm,on:mm,after:gm,cata:lm,getStart:fm},hm=aa.generate([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),vm=function(e){return hm.exact(e.start,e.soffset,e.finish,e.foffset)},ym=function(e){return e.match({domRange:function(e){return tt.fromDom(e.startContainer)},relative:function(e,t){return pm.getStart(e)},exact:function(e,t,n,r){return e}})},bm=hm.domRange,wm=hm.relative,km=hm.exact,_m=function(e){var t=ym(e);return hn(t)},xm=um.create,Cm={domRange:bm,relative:wm,exact:km,exactFromRange:vm,getWin:_m,range:xm},zm=function(e,t){t.fold((function(t){e.setStartBefore(t.dom)}),(function(t,n){e.setStart(t.dom,n)}),(function(t){e.setStartAfter(t.dom)}))},Sm=function(e,t){t.fold((function(t){e.setEndBefore(t.dom)}),(function(t,n){e.setEnd(t.dom,n)}),(function(t){e.setEndAfter(t.dom)}))},Tm=function(e,t,n){var r=e.document.createRange();return zm(r,t),Sm(r,n),r},Om=function(e,t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},Em=function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}},Am=function(e){var t=e.getClientRects(),n=t.length>0?t[0]:e.getBoundingClientRect();return n.width>0||n.height>0?P.some(n).map(Em):P.none()},Dm=function(e){var t=e.getBoundingClientRect();return t.width>0||t.height>0?P.some(t).map(Em):P.none()},Mm=aa.generate([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Nm=function(e,t,n){return t(tt.fromDom(n.startContainer),n.startOffset,tt.fromDom(n.endContainer),n.endOffset)},Rm=function(e,t){return t.match({domRange:function(e){return{ltr:w(e),rtl:P.none}},relative:function(t,n){return{ltr:gt((function(){return Tm(e,t,n)})),rtl:gt((function(){return P.some(Tm(e,n,t))}))}},exact:function(t,n,r,o){return{ltr:gt((function(){return Om(e,t,n,r,o)})),rtl:gt((function(){return P.some(Om(e,r,o,t,n))}))}}})},Bm=function(e,t){var n=t.ltr();if(n.collapsed){var r=t.rtl().filter((function(e){return!1===e.collapsed}));return r.map((function(e){return Mm.rtl(tt.fromDom(e.endContainer),e.endOffset,tt.fromDom(e.startContainer),e.startOffset)})).getOrThunk((function(){return Nm(e,Mm.ltr,n)}))}return Nm(e,Mm.ltr,n)},Pm=function(e,t){var n=Rm(e,t);return Bm(e,n)},Lm=function(e,t){var n=Pm(e,t);return n.match({ltr:function(t,n,r,o){var i=e.document.createRange();return i.setStart(t.dom,n),i.setEnd(r.dom,o),i},rtl:function(t,n,r,o){var i=e.document.createRange();return i.setStart(r.dom,o),i.setEnd(t.dom,n),i}})};Mm.ltr,Mm.rtl;var Im,Hm=function(e,t){var n=function(n){if(!e(n))throw new Error("Can only get "+t+" value of a "+t+" node");return r(n).getOr("")},r=function(t){return e(t)?P.from(t.dom.nodeValue):P.none()},o=function(n,r){if(!e(n))throw new Error("Can only set raw "+t+" value of a "+t+" node");n.dom.nodeValue=r};return{get:n,getOption:r,set:o}},Fm=Hm(ft,"text"),jm=function(e){return Fm.get(e)},Vm=function(e){return Fm.getOption(e)},Um=function(e){return"img"===ct(e)?1:Vm(e).fold((function(){return kn(e).length}),(function(e){return e.length}))},qm=function(e){return Vm(e).filter((function(e){return 0!==e.trim().length||e.indexOf(am)>-1})).isSome()},Wm=["img","br"],$m=function(e){var t=qm(e);return t||V(Wm,ct(e))},Gm=function(e){return Km(e,$m)},Km=function(e,t){var n=function(e){for(var r=kn(e),o=r.length-1;o>=0;o--){var i=r[o];if(t(i))return P.some(i);var a=n(i);if(a.isSome())return a}return P.none()};return n(e)},Xm=function(e,t){return cn(t,e)},Ym=function(e,t,n,r){var o=mn(e),i=o.dom.createRange();return i.setStart(e.dom,t),i.setEnd(n.dom,r),i},Jm=function(e,t,n,r){var o=Ym(e,t,n,r),i=sn(e,n)&&t===r;return o.collapsed&&!i},Qm=function(e){return P.from(e.getSelection())},Zm=function(e){if(e.rangeCount>0){var t=e.getRangeAt(0),n=e.getRangeAt(e.rangeCount-1);return P.some(um.create(tt.fromDom(t.startContainer),t.startOffset,tt.fromDom(n.endContainer),n.endOffset))}return P.none()},eg=function(e){if(null===e.anchorNode||null===e.focusNode)return Zm(e);var t=tt.fromDom(e.anchorNode),n=tt.fromDom(e.focusNode);return Jm(t,e.anchorOffset,n,e.focusOffset)?P.some(um.create(t,e.anchorOffset,n,e.focusOffset)):Zm(e)},tg=function(e){return Qm(e).filter((function(e){return e.rangeCount>0})).bind(eg)},ng=function(e,t){var n=Lm(e,t);return Am(n)},rg=function(e,t){var n=Lm(e,t);return Dm(n)},og=function(e,t){return{element:e,offset:t}},ig=function(e,t){var n=kn(e);if(0===n.length)return og(e,t);if(t"})),ai()),_h=Ti("schema",(function(){return[Fi("preprocess")]})),xh=Ki("defaults",w({})),Ch=Ki("overrides",w({})),zh=ei([yh,bh,wh,kh,xh,Ch]),Sh=ei([yh,bh,wh,xh,Ch]),Th=ei([yh,bh,wh,kh,xh,Ch]),Oh=ei([yh,_h,wh,Ei("unit"),kh,xh,Ch]),Eh=function(e){return e.fold(P.some,P.none,P.some,P.some)},Ah=function(e){var t=function(e){return e.name};return e.fold(t,t,t,t)},Dh=function(e){return e.fold(k,k,k,k)},Mh=function(e,t){return function(n){var r=_i("Converting part type",t,n);return e(r)}},Nh=Mh(vh.required,zh),Rh=Mh(vh.external,Sh),Bh=Mh(vh.optional,Th),Ph=Mh(vh.group,Oh),Lh=w("entirety"),Ih=Object.freeze({__proto__:null,required:Nh,external:Rh,optional:Bh,group:Ph,asNamedPart:Eh,name:Ah,asCommon:Dh,original:Lh}),Hh=function(e,t,n,r){return _o(t.defaults(e,n,r),n,{uid:e.partUids[t.name]},t.overrides(e,n,r))},Fh=function(e,t,n){var r={},o={};return G(n,(function(e){e.fold((function(e){r[e.pname]=gh(!0,(function(t,n,r){return e.factory.sketch(Hh(t,e,n,r))}))}),(function(e){var n=t.parts[e.name];o[e.name]=w(e.factory.sketch(Hh(t,e,n[Lh()]),n))}),(function(e){r[e.pname]=gh(!1,(function(t,n,r){return e.factory.sketch(Hh(t,e,n,r))}))}),(function(e){r[e.pname]=ph(!0,(function(t,n,r){var o=t[e.name];return $(o,(function(n){return e.factory.sketch(_o(e.defaults(t,n,r),n,e.overrides(t,n)))}))}))}))})),{internals:w(r),externals:w(o)}},jh=function(e,t){var n={};return G(t,(function(t){Eh(t).each((function(t){var r=Vh(e,t.pname);n[t.name]=function(n){var o=_i("Part: "+t.name+" in "+e,ei(t.schema),n);return E(E({},r),{config:n,validated:o})}}))})),n},Vh=function(e,t){return{uiType:hh(),owner:e,name:t}},Uh=function(e,t,n){return{uiType:hh(),owner:e,name:t,config:n,validated:{}}},qh=function(e){return re(e,(function(e){return e.fold(P.none,P.some,P.none,P.none).map((function(e){return Li(e.name,e.schema.concat([dl(Lh())]))})).toArray()}))},Wh=function(e){return $(e,Ah)},$h=function(e,t,n){return Fh(e,t,n)},Gh=function(e,t,n){return mh(P.some(e),t,t.components,n)},Kh=function(e,t,n){var r=t.partUids[n];return e.getSystem().getByUid(r).toOptional()},Xh=function(e,t,n){return Kh(e,t,n).getOrDie("Could not find part: "+n)},Yh=function(e,t,n){var r={},o=t.partUids,i=e.getSystem();return G(n,(function(e){r[e]=w(i.getByUid(o[e]))})),r},Jh=function(e,t){var n=e.getSystem();return ye(t.partUids,(function(e,t){return w(n.getByUid(e))}))},Qh=function(e){return pe(e.partUids)},Zh=function(e,t,n){var r={},o=t.partUids,i=e.getSystem();return G(n,(function(e){r[e]=w(i.getByUid(o[e]).getOrDie())})),r},ev=function(e,t){var n=Wh(t);return ga($(n,(function(t){return{key:t,value:e+"-"+t}})))},tv=function(e){return Si("partUids","partUids",Oo((function(t){return ev(t.uid,e)})),ai())},nv=Object.freeze({__proto__:null,generate:jh,generateOne:Uh,schemas:qh,names:Wh,substitutes:$h,components:Gh,defaultUids:ev,defaultUidsSchema:tv,getAllParts:Jh,getAllPartNames:Qh,getPart:Kh,getPartOrDie:Xh,getParts:Yh,getPartsOrDie:Zh}),rv=function(e,t){var n=e.length>0?[Li("parts",e)]:[];return n.concat([Ei("uid"),Ki("dom",{}),Ki("components",[]),dl("originalSpec"),Ki("debug.sketcher",{})]).concat(t)},ov=function(e,t,n,r,o){var i=rv(r,o);return _i(e+" [SpecSchema]",Zo(i.concat(t)),n)},iv=function(e,t,n,r){var o=uv(r),i=ov(e,t,o,[],[]);return n(i,o)},av=function(e,t,n,r,o){var i=uv(o),a=qh(n),c=tv(n),u=ov(e,t,i,a,[c]),s=$h(e,u,n),l=Gh(e,u,s.internals());return r(u,l,i,s.externals())},cv=function(e){return Te(e,"uid")},uv=function(e){return cv(e)?e:E(E({},e),{uid:du("uid")})},sv=function(e){return void 0!==e.uid},lv=Zo([Ei("name"),Ei("factory"),Ei("configFields"),Ki("apis",{}),Ki("extraApis",{})]),fv=Zo([Ei("name"),Ei("factory"),Ei("configFields"),Ei("partFields"),Ki("apis",{}),Ki("extraApis",{})]),dv=function(e){var t=_i("Sketcher for "+e.name,lv,e),n=function(e){return iv(t.name,t.configFields,t.factory,e)},r=ye(t.apis,xu),o=ye(t.extraApis,(function(e,t){return yu(e,t)}));return E(E({name:t.name,configFields:t.configFields,sketch:n},r),o)},mv=function(e){var t=_i("Sketcher for "+e.name,fv,e),n=function(e){return av(t.name,t.configFields,t.partFields,t.factory,e)},r=jh(t.name,t.partFields),o=ye(t.apis,xu),i=ye(t.extraApis,(function(e,t){return yu(e,t)}));return E(E({name:t.name,partFields:t.partFields,configFields:t.configFields,sketch:n,parts:r},o),i)},gv=function(e){return"input"===ct(e)&&"radio"!==Vn(e,"type")||"textarea"===ct(e)},pv=function(e,t,n){return t.find(e)},hv=Object.freeze({__proto__:null,getCurrent:pv}),vv=[Ei("find")],yv=pf({fields:vv,name:"composing",apis:hv}),bv=["input","button","textarea","select"],wv=function(e,t,n){var r=t.disabled()?Ov:Ev;r(e,t)},kv=function(e,t){return!0===t.useNative&&V(bv,ct(e.element))},_v=function(e){return qn(e.element,"disabled")},xv=function(e){Fn(e.element,"disabled","disabled")},Cv=function(e){Wn(e.element,"disabled")},zv=function(e){return"true"===Vn(e.element,"aria-disabled")},Sv=function(e){Fn(e.element,"aria-disabled","true")},Tv=function(e){Fn(e.element,"aria-disabled","false")},Ov=function(e,t,n){t.disableClass.each((function(t){is(e.element,t)}));var r=kv(e,t)?xv:Sv;r(e),t.onDisabled(e)},Ev=function(e,t,n){t.disableClass.each((function(t){cs(e.element,t)}));var r=kv(e,t)?Cv:Tv;r(e),t.onEnabled(e)},Av=function(e,t){return kv(e,t)?_v(e):zv(e)},Dv=function(e,t,n,r){var o=r?Ov:Ev;o(e,t)},Mv=Object.freeze({__proto__:null,enable:Ev,disable:Ov,isDisabled:Av,onLoad:wv,set:Dv}),Nv=function(e,t){return Au({classes:t.disabled()?t.disableClass.toArray():[]})},Rv=function(e,t){return Oc([Ec(tc(),(function(t,n){return Av(t,e)})),cf(e,t,wv)])},Bv=Object.freeze({__proto__:null,exhibit:Nv,events:Rv}),Pv=[ea("disabled",S),Ki("useNative",!0),Fi("disableClass"),cl("onDisabled"),cl("onEnabled")],Lv=pf({fields:Pv,name:"disabling",active:Bv,apis:Mv}),Iv=function(e,t,n,r){var o=Xm(e.element,"."+t.highlightClass);G(o,(function(n){U(r,(function(e){return e.element===n}))||(cs(n,t.highlightClass),e.getSystem().getByDom(n).each((function(n){t.onDehighlight(e,n),_c(n,kc())})))}))},Hv=function(e,t,n){return Iv(e,t,n,[])},Fv=function(e,t,n,r){$v(e,t,n,r)&&(cs(r.element,t.highlightClass),t.onDehighlight(e,r),_c(r,kc()))},jv=function(e,t,n,r){Iv(e,t,n,[r]),$v(e,t,n,r)||(is(r.element,t.highlightClass),t.onHighlight(e,r),_c(r,wc()))},Vv=function(e,t,n){Xv(e,t).each((function(r){jv(e,t,n,r)}))},Uv=function(e,t,n){Yv(e,t).each((function(r){jv(e,t,n,r)}))},qv=function(e,t,n,r){Kv(e,t,n,r).fold((function(e){throw e}),(function(r){jv(e,t,n,r)}))},Wv=function(e,t,n,r){var o=ey(e,t),i=ee(o,r);i.each((function(r){jv(e,t,n,r)}))},$v=function(e,t,n,r){return us(r.element,t.highlightClass)},Gv=function(e,t,n){return Is(e.element,"."+t.highlightClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Kv=function(e,t,n,r){var o=Xm(e.element,"."+t.itemClass);return P.from(o[r]).fold((function(){return ro.error(new Error("No element found with index "+r))}),e.getSystem().getByDom)},Xv=function(e,t,n){return Is(e.element,"."+t.itemClass).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Yv=function(e,t,n){var r=Xm(e.element,"."+t.itemClass),o=r.length>0?P.some(r[r.length-1]):P.none();return o.bind((function(t){return e.getSystem().getByDom(t).toOptional()}))},Jv=function(e,t,n,r){var o=Xm(e.element,"."+t.itemClass),i=te(o,(function(e){return us(e,t.highlightClass)}));return i.bind((function(t){var n=Tl(t,r,0,o.length-1);return e.getSystem().getByDom(o[n]).toOptional()}))},Qv=function(e,t,n){return Jv(e,t,n,-1)},Zv=function(e,t,n){return Jv(e,t,n,1)},ey=function(e,t,n){var r=Xm(e.element,"."+t.itemClass);return De($(r,(function(t){return e.getSystem().getByDom(t).toOptional()})))},ty=Object.freeze({__proto__:null,dehighlightAll:Hv,dehighlight:Fv,highlight:jv,highlightFirst:Vv,highlightLast:Uv,highlightAt:qv,highlightBy:Wv,isHighlighted:$v,getHighlighted:Gv,getFirst:Xv,getLast:Yv,getPrevious:Qv,getNext:Zv,getCandidates:ey}),ny=[Ei("highlightClass"),Ei("itemClass"),cl("onHighlight"),cl("onDehighlight")],ry=pf({fields:ny,name:"highlighting",apis:ty}),oy=[8],iy=[9],ay=[13],cy=[27],uy=[32],sy=[37],ly=[38],fy=[39],dy=[40],my=function(e,t,n){var r=ie(e.slice(0,t)),o=ie(e.slice(t+1));return ee(r.concat(o),n)},gy=function(e,t,n){var r=ie(e.slice(0,t));return ee(r,n)},py=function(e,t,n){var r=e.slice(0,t),o=e.slice(t+1);return ee(o.concat(r),n)},hy=function(e,t,n){var r=e.slice(t+1);return ee(r,n)},vy=function(e){return function(t){var n=t.raw;return V(e,n.which)}},yy=function(e){return function(t){return oe(e,(function(e){return e(t)}))}},by=function(e){var t=e.raw;return!0===t.shiftKey},wy=function(e){var t=e.raw;return!0===t.ctrlKey},ky=C(by),_y=function(e,t){return{matches:e,classification:t}},xy=function(e,t){var n=ee(e,(function(e){return e.matches(t)}));return n.map((function(e){return e.classification}))},Cy=function(e,t,n){var r=t.exists((function(e){return n.exists((function(t){return sn(t,e)}))}));r||xc(e,hc(),{prevFocus:t,newFocus:n})},zy=function(){var e=function(e){return Tf(e.element)},t=function(t,n){var r=e(t);t.getSystem().triggerFocus(n,t.element);var o=e(t);Cy(t,r,o)};return{get:e,set:t}},Sy=function(){var e=function(e){return ry.getHighlighted(e).map((function(e){return e.element}))},t=function(t,n){var r=e(t);t.getSystem().getByDom(n).fold(h,(function(e){ry.highlight(t,e)}));var o=e(t);Cy(t,r,o)};return{get:e,set:t}};(function(e){e["OnFocusMode"]="onFocus",e["OnEnterOrSpaceMode"]="onEnterOrSpace",e["OnApiMode"]="onApi"})(Im||(Im={}));var Ty=function(e,t,n,r,o){var i=function(){return e.concat([Ki("focusManager",zy()),Xi("focusInside","onFocus",vi((function(e){return V(["onFocus","onEnterOrSpace","onApi"],e)?ro.value(e):ro.error("Invalid value for focusInside")}))),fl("handler",u),fl("state",t),fl("sendFocusIn",o)])},a=function(e,t,n,r,o){var i=n(e,t,r,o);return xy(i,t.event).bind((function(n){return n(e,t,r,o)}))},c=function(e,t){var i=e.focusInside!==Im.OnFocusMode?P.none():o(e).map((function(n){return Mc(Ja(),(function(r,o){n(r,e,t),o.stop()}))})),c=function(n,r){var i=vy(uy.concat(ay))(r.event);e.focusInside===Im.OnEnterOrSpaceMode&&i&&ka(n,r)&&o(e).each((function(o){o(n,e,t),r.stop()}))},u=[Mc(Fa(),(function(r,o){a(r,o,n,e,t).fold((function(){c(r,o)}),(function(e){o.stop()}))})),Mc(ja(),(function(n,o){a(n,o,r,e,t).each((function(e){o.stop()}))}))];return Oc(i.toArray().concat(u))},u={schema:i,processKey:a,toEvents:c};return u},Oy=function(e){var t=[Fi("onEscape"),Fi("onEnter"),Ki("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Ki("firstTabstop",0),Ki("useTabstopAt",T),Fi("visibilitySelector")].concat([e]),n=function(e,t){var n=e.visibilitySelector.bind((function(e){return Hs(t,e)})).getOr(t);return ar(n)>0},r=function(e,t){var r=Xm(e.element,t.selector),o=Y(r,(function(e){return n(t,e)}));return P.from(o[t.firstTabstop])},o=function(e,t){return t.focusManager.get(e).bind((function(e){return Hs(e,t.selector)}))},i=function(e,t){return n(e,t)&&e.useTabstopAt(t)},a=function(e,t,n){r(e,t).each((function(n){t.focusManager.set(e,n)}))},c=function(e,t,n,r,o){return o(t,n,(function(e){return i(r,e)})).fold((function(){return r.cyclic?P.some(!0):P.none()}),(function(t){return r.focusManager.set(e,t),P.some(!0)}))},u=function(e,t,n,r){var i=Xm(e.element,n.selector);return o(e,n).bind((function(t){var o=te(i,x(sn,t));return o.bind((function(t){return c(e,i,t,n,r)}))}))},s=function(e,t,n){var r=n.cyclic?my:gy;return u(e,t,n,r)},l=function(e,t,n){var r=n.cyclic?py:hy;return u(e,t,n,r)},f=function(e,t,n){return n.onEnter.bind((function(n){return n(e,t)}))},d=function(e,t,n){return n.onEscape.bind((function(n){return n(e,t)}))},m=w([_y(yy([by,vy(iy)]),s),_y(vy(iy),l),_y(vy(cy),d),_y(yy([ky,vy(ay)]),f)]),g=w([]);return Ty(t,Cu.init,m,g,(function(){return P.some(a)}))},Ey=Oy(Ti("cyclic",S)),Ay=Oy(Ti("cyclic",T)),Dy=function(e,t,n){return zc(e,n,tc()),P.some(!0)},My=function(e,t,n){var r=gv(n)&&vy(uy)(t.event);return r?P.none():Dy(e,t,n)},Ny=function(e,t){return P.some(!0)},Ry=[Ki("execute",My),Ki("useSpace",!1),Ki("useEnter",!0),Ki("useControlEnter",!1),Ki("useDown",!1)],By=function(e,t,n){return n.execute(e,t,e.element)},Py=function(e,t,n,r){var o=n.useSpace&&!gv(e.element)?uy:[],i=n.useEnter?ay:[],a=n.useDown?dy:[],c=o.concat(i).concat(a);return[_y(vy(c),By)].concat(n.useControlEnter?[_y(yy([wy,vy(ay)]),By)]:[])},Ly=function(e,t,n,r){return n.useSpace&&!gv(e.element)?[_y(vy(uy),Ny)]:[]},Iy=Ty(Ry,Cu.init,Py,Ly,(function(){return P.none()})),Hy=function(){var e=od(),t=function(t,n){e.set({numRows:t,numColumns:n})},n=function(){return e.get().map((function(e){return e.numRows}))},r=function(){return e.get().map((function(e){return e.numColumns}))};return zu({readState:function(){return e.get().map((function(e){return{numRows:String(e.numRows),numColumns:String(e.numColumns)}})).getOr({numRows:"?",numColumns:"?"})},setGridSize:t,getNumRows:n,getNumColumns:r})},Fy=function(e){return e.state(e)},jy=Object.freeze({__proto__:null,flatgrid:Hy,init:Fy}),Vy=function(e){return function(t,n,r,o){var i=e(t.element);return $y(i,t,n,r,o)}},Uy=function(e,t){var n=Bd(e,t);return Vy(n)},qy=function(e,t){var n=Bd(t,e);return Vy(n)},Wy=function(e){return function(t,n,r,o){return $y(e,t,n,r,o)}},$y=function(e,t,n,r,o){var i=r.focusManager.get(t).bind((function(n){return e(t.element,n,r,o)}));return i.map((function(e){return r.focusManager.set(t,e),!0}))},Gy=Wy,Ky=Wy,Xy=Wy,Yy=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0},Jy=function(e){return!Yy(e.dom)},Qy=function(e,t){return te(e,t).map((function(t){return{index:t,candidates:e}}))},Zy=function(e,t,n){var r=function(e){return sn(e,t)},o=Xm(e,n),i=Y(o,Jy);return Qy(i,r)},eb=function(e,t){return te(e,(function(e){return sn(t,e)}))},tb=function(e,t,n,r){var o=Math.floor(t/n),i=t%n;return r(o,i).bind((function(t){var r=t.row*n+t.column;return r>=0&&r1?P.some(e.slice(1)):P.none()}))},g=function(e){return Se(n.get(),e)},p=function(e){return h(e).bind(Wk)},h=function(e){return Se(t.get(),e)},v=function(t){return Se(e.get(),t)},y=function(e){var t=o.get();return ae(pe(t),e)},b=function(){return r.get().bind(p)},w=function(){return t.get()};return{setMenuBuilt:c,setContents:u,expand:d,refresh:g,collapse:m,lookupMenu:h,lookupItem:v,otherMenus:y,getPrimary:b,getMenus:w,clear:i,isClear:a,getTriggeringPath:f}},Wk=function(e){return"prepared"===e.type?P.some(e.menu):P.none()},$k={init:qk,extractPreparedMenu:Wk},Gk=function(e,t){var n,r=od(),o=function(t,n,r){return ye(r,(function(r,o){var i=function(){return Fk.sketch(E(E({},r),{value:o,markers:e.markers,fakeFocus:e.fakeFocus,onHighlight:e.onHighlight,focusManager:e.fakeFocus?Sy():zy()}))};return o===n?{type:"prepared",menu:t.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}}))},i=$k.init(),a=function(t){var n=o(t,e.data.primary,e.data.menus),r=s();return i.setContents(e.data.primary,n,e.data.expansions,r),i.getPrimary()},c=function(e){return eh.getValue(e).value},u=function(e,t,n){return ge(t,(function(e){if(!e.getSystem().isConnected())return P.none();var t=ry.getCandidates(e);return ee(t,(function(e){return c(e)===n}))}))},s=function(t){return ye(e.data.menus,(function(e,t){return re(e.items,(function(e){return"separator"===e.type?[]:[e.data.value]}))}))},l=function(e,t){ry.highlight(e,t),ry.getHighlighted(t).orThunk((function(){return ry.getFirst(t)})).each((function(t){zc(e,t.element,nc())}))},f=function(e,t){return De($(t,(function(t){return e.lookupMenu(t).bind((function(e){return"prepared"===e.type?P.some(e.menu):P.none()}))})))},d=function(t,n,r){var o=f(n,n.otherMenus(r));G(o,(function(n){ls(n.element,[e.markers.backgroundMenu]),e.stayInDom||Hw.remove(t,n)}))},m=function(t){return r.get().getOrThunk((function(){var n={},o=Xm(t.element,"."+e.markers.item),i=Y(o,(function(e){return"true"===Vn(e,"aria-haspopup")}));return G(i,(function(e){t.getSystem().getByDom(e).each((function(e){var t=c(e);n[t]=e}))})),r.set(n),n}))},g=function(e,t){var n=m(e);ve(n,(function(e,n){var r=V(t,n);Fn(e.element,"aria-expanded",r)}))},p=function(t,n,r){return P.from(r[0]).bind((function(o){return n.lookupMenu(o).bind((function(o){if("notbuilt"===o.type)return P.none();var i=o.menu,a=f(n,r.slice(1));return G(a,(function(t){is(t.element,e.markers.backgroundMenu)})),Pn(i.element)||Hw.append(t,Os(i)),ls(i.element,[e.markers.backgroundMenu]),l(t,i),d(t,n,r),P.some(i)}))}))};(function(e){e[e["HighlightSubmenu"]=0]="HighlightSubmenu",e[e["HighlightParent"]=1]="HighlightParent"})(n||(n={}));var v=function(e,t,n){if("notbuilt"===n.type){var r=e.getSystem().build(n.nbMenu());return i.setMenuBuilt(t,r),r}return n.menu},y=function(t,r,o){if(void 0===o&&(o=n.HighlightSubmenu),r.hasConfigured(Lv)&&Lv.isDisabled(r))return P.some(r);var a=c(r);return i.expand(a).bind((function(a){return g(t,a),P.from(a[0]).bind((function(c){return i.lookupMenu(c).bind((function(u){var s=v(t,c,u);return Pn(s.element)||Hw.append(t,Os(s)),e.onOpenSubmenu(t,r,s,ie(a)),o===n.HighlightSubmenu?(ry.highlightFirst(s),p(t,i,a)):(ry.dehighlightAll(s),P.some(r))}))}))}))},b=function(t,n){var r=c(n);return i.collapse(r).bind((function(r){return g(t,r),p(t,i,r).map((function(r){return e.onCollapseMenu(t,n,r),r}))}))},w=function(e,t){var n=c(t);return i.refresh(n).bind((function(t){return g(e,t),p(e,i,t)}))},k=function(e,t){return gv(t.element)?P.none():y(e,t,n.HighlightSubmenu)},_=function(e,t){return gv(t.element)?P.none():b(e,t)},x=function(t,n){return b(t,n).orThunk((function(){return e.onEscape(t,n).map((function(){return t}))}))},C=function(t){return function(n,r){return Hs(r.getSource(),"."+e.markers.item).bind((function(e){return n.getSystem().getByDom(e).toOptional().bind((function(e){return t(n,e).map(T)}))}))}},z=Oc([Mc(Ik(),(function(e,t){var n=t.event.item;i.lookupItem(c(n)).each((function(){var n=t.event.menu;ry.highlight(e,n);var r=c(t.event.item);i.refresh(r).each((function(t){return d(e,i,t)}))}))})),Wc((function(t,r){var o=r.event.target;t.getSystem().getByDom(o).each((function(r){var o=c(r);0===o.indexOf("collapse-item")&&b(t,r),y(t,r,n.HighlightSubmenu).fold((function(){e.onExecute(t,r)}),h)}))})),Vc((function(t,n){a(t).each((function(n){Hw.append(t,Os(n)),e.onOpenMenu(t,n),e.highlightImmediately&&l(t,n)}))}))].concat(e.navigateOnHover?[Mc(_k(),(function(t,r){var o=r.event.item;w(t,o),y(t,o,n.HighlightParent),e.onHover(t,o)}))]:[])),S=function(e){return ry.getHighlighted(e).bind(ry.getHighlighted)},O=function(e){S(e).each((function(t){b(e,t)}))},A=function(e){i.getPrimary().each((function(t){l(e,t)}))},D=function(e){return P.from(e.components()[0]).filter((function(e){return"menu"===Vn(e.element,"role")}))},M=function(t){var n=i.getPrimary().bind((function(e){return S(t).bind((function(e){var n=c(e),r=ze(i.getMenus()),o=De($(r,$k.extractPreparedMenu));return i.getTriggeringPath(n,(function(e){return u(t,o,e)}))})).map((function(t){return{primary:e,triggeringPath:t}}))}));n.fold((function(){D(t).each((function(n){e.onRepositionMenu(t,n,[])}))}),(function(n){var r=n.primary,o=n.triggeringPath;e.onRepositionMenu(t,r,o)}))},N={collapseMenu:O,highlightPrimary:A,repositionMenus:M};return{uid:e.uid,dom:e.dom,markers:e.markers,behaviours:rh(e.tmenuBehaviours,[Ew.config({mode:"special",onRight:C(k),onLeft:C(_),onEscape:C(x),focusIn:function(e,t){i.getPrimary().each((function(t){zc(e,t.element,nc())}))}}),ry.config({highlightClass:e.markers.selectedMenu,itemClass:e.markers.menu}),yv.config({find:function(e){return ry.getHighlighted(e)}}),Hw.config({})]),eventOrder:e.eventOrder,apis:N,events:z}},Kk=w("collapse-item"),Xk=function(e,t,n){return{primary:e,menus:t,expansions:n}},Yk=function(e,t){return{primary:e,menus:ma(e,t),expansions:{}}},Jk=function(e){return{value:ou(Kk()),meta:{text:e}}},Qk=dv({name:"TieredMenu",configFields:[ll("onExecute"),ll("onEscape"),sl("onOpenMenu"),sl("onOpenSubmenu"),cl("onRepositionMenu"),cl("onCollapseMenu"),Ki("highlightImmediately",!0),Li("data",[Ei("primary"),Ei("menus"),Ei("expansions")]),Ki("fakeFocus",!1),cl("onHighlight"),cl("onHover"),ol(),Ei("dom"),Ki("navigateOnHover",!0),Ki("stayInDom",!1),th("tmenuBehaviours",[Ew,ry,yv,Hw]),Ki("eventOrder",{})],apis:{collapseMenu:function(e,t){e.collapseMenu(t)},highlightPrimary:function(e,t){e.highlightPrimary(t)},repositionMenus:function(e,t){e.repositionMenus(t)}},factory:Gk,extraApis:{tieredData:Xk,singleData:Yk,collapseItem:Jk}}),Zk=function(e,t,n,r,o){var i=function(){return e.lazySink(t)},a="horizontal"===r.type?{layouts:{onLtr:function(){return Zl()},onRtl:function(){return ef()}}}:{},c=function(e){return 2===e.length},u=function(e){return c(e)?a:{}};return Qk.sketch({dom:{tag:"div"},data:r.data,markers:r.menu.markers,highlightImmediately:r.menu.highlightImmediately,onEscape:function(){return yp.close(t),e.onEscape.map((function(e){return e(t)})),P.some(!0)},onExecute:function(){return P.some(!0)},onOpenMenu:function(e,t){Ig.positionWithinBounds(i().getOrDie(),t,n,o())},onOpenSubmenu:function(e,t,n,r){var o=i().getOrDie();Ig.position(o,n,{anchor:E({type:"submenu",item:t},u(r))})},onRepositionMenu:function(e,t,r){var a=i().getOrDie();Ig.positionWithinBounds(a,t,n,o()),G(r,(function(e){var t=u(e.triggeringPath);Ig.position(a,e.triggeredMenu,{anchor:E({type:"submenu",item:e.triggeringItem},t)})}))}})},e_=function(e,t){var n=function(t,n){var r=e.getRelated(t);return r.exists((function(e){return Us(e,n)}))},r=function(e,t){yp.setContent(e,t)},o=function(e,t,n){i(e,t,n,P.none())},i=function(e,t,n,r){a(e,t,n,(function(){return r.map((function(e){return Jr(e)}))}))},a=function(t,n,r,o){var i=e.lazySink(t).getOrDie();yp.openWhileCloaked(t,n,(function(){return Ig.positionWithinBounds(i,t,r,o())})),eh.setValue(t,P.some({mode:"position",config:r,getBounds:o}))},c=function(e,t,n){u(e,t,n,P.none)},u=function(t,n,r,o){var i=Zk(e,t,n,r,o);yp.open(t,i),eh.setValue(t,P.some({mode:"menu",menu:i}))},s=function(e){yp.isOpen(e)&&(eh.setValue(e,P.none()),yp.close(e))},l=function(e){return yp.getState(e)},f=function(t){yp.isOpen(t)&&eh.getValue(t).each((function(n){switch(n.mode){case"menu":yp.getState(t).each(Qk.repositionMenus);break;case"position":var r=e.lazySink(t).getOrDie();Ig.positionWithinBounds(r,t,n.config,n.getBounds());break}}))},d={setContent:r,showAt:o,showWithin:i,showWithinBounds:a,showMenuAt:c,showMenuWithinBounds:u,hide:s,getContent:l,reposition:f,isOpen:yp.isOpen};return{uid:e.uid,dom:e.dom,behaviours:rh(e.inlineBehaviours,[yp.config({isPartOf:function(e,t,r){return Us(t,r)||n(e,r)},getAttachPoint:function(t){return e.lazySink(t).getOrDie()},onOpen:function(t){e.onShow(t)},onClose:function(t){e.onHide(t)}}),eh.config({store:{mode:"memory",initialValue:P.none()}}),bf.config({channels:E(E({},xp(E({isExtraPart:t.isExtraPart},e.fireDismissalEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})))),zp(E(E({},e.fireRepositionEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})),{doReposition:f})))})]),eventOrder:e.eventOrder,apis:d}},t_=dv({name:"InlineView",configFields:[Ei("lazySink"),cl("onShow"),cl("onHide"),qi("onEscape"),th("inlineBehaviours",[yp,eh,bf]),$i("fireDismissalEventInstead",[Ki("event",gc())]),$i("fireRepositionEventInstead",[Ki("event",pc())]),Ki("getRelated",P.none),Ki("isExtraPart",S),Ki("eventOrder",P.none)],factory:e_,apis:{showAt:function(e,t,n,r){e.showAt(t,n,r)},showWithin:function(e,t,n,r,o){e.showWithin(t,n,r,o)},showWithinBounds:function(e,t,n,r,o){e.showWithinBounds(t,n,r,o)},showMenuAt:function(e,t,n,r){e.showMenuAt(t,n,r)},showMenuWithinBounds:function(e,t,n,r,o){e.showMenuWithinBounds(t,n,r,o)},hide:function(e,t){e.hide(t)},isOpen:function(e,t){return e.isOpen(t)},getContent:function(e,t){return e.getContent(t)},setContent:function(e,t,n){e.setContent(t,n)},reposition:function(e,t){e.reposition(t)}}}),n_="layout-inset",r_=function(e){return e.x},o_=function(e,t){return e.x+e.width/2-t.width/2},i_=function(e,t){return e.x+e.width-t.width},a_=function(e){return e.y},c_=function(e,t){return e.y+e.height-t.height},u_=function(e,t){return e.y+e.height/2-t.height/2},s_=function(e,t,n){return gl(i_(e,t),c_(e,t),n.insetSouthwest(),_l(),"southwest",Al(e,{right:0,bottom:3}),n_)},l_=function(e,t,n){return gl(r_(e),c_(e,t),n.insetSoutheast(),kl(),"southeast",Al(e,{left:1,bottom:3}),n_)},f_=function(e,t,n){return gl(i_(e,t),a_(e),n.insetNorthwest(),wl(),"northwest",Al(e,{right:0,top:2}),n_)},d_=function(e,t,n){return gl(r_(e),a_(e),n.insetNortheast(),bl(),"northeast",Al(e,{left:1,top:2}),n_)},m_=function(e,t,n){return gl(o_(e,t),a_(e),n.insetNorth(),xl(),"north",Al(e,{top:2}),n_)},g_=function(e,t,n){return gl(o_(e,t),c_(e,t),n.insetSouth(),Cl(),"south",Al(e,{bottom:3}),n_)},p_=function(e,t,n){return gl(i_(e,t),u_(e,t),n.insetEast(),Sl(),"east",Al(e,{right:0}),n_)},h_=function(e,t,n){return gl(r_(e),u_(e,t),n.insetWest(),zl(),"west",Al(e,{left:1}),n_)},v_=function(e){switch(e){case"north":return m_;case"northeast":return d_;case"northwest":return f_;case"south":return g_;case"southeast":return l_;case"southwest":return s_;case"east":return p_;case"west":return h_}},y_=function(e,t,n,r,o){var i=$f(r).map(v_).getOr(m_);return i(e,t,n,r,o)},b_=function(e){switch(e){case"north":return g_;case"northeast":return l_;case"northwest":return s_;case"south":return m_;case"southeast":return d_;case"southwest":return f_;case"east":return h_;case"west":return p_}},w_=function(e,t,n,r,o){var i=$f(r).map(b_).getOr(m_);return i(e,t,n,r,o)},k_=tinymce.util.Tools.resolve("tinymce.util.Delay"),__=function(e){var t=vk(e.action),n=e.dom.tag,r=function(t){return Se(e.dom,"attributes").bind((function(e){return Se(e,t)}))},o=function(){if("button"===n){var e=r("type").getOr("button"),t=r("role").map((function(e){return{role:e}})).getOr({});return E({type:e},t)}var o=r("role").getOr("button");return{role:o}};return{uid:e.uid,dom:e.dom,components:e.components,events:t,behaviours:oh.augment(e.buttonBehaviours,[Yw.config({}),Ew.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:o()},eventOrder:e.eventOrder}},x_=dv({name:"Button",factory:__,configFields:[Ki("uid",void 0),Ei("dom"),Ki("components",[]),oh.field("buttonBehaviours",[Yw,Ew]),Fi("action"),Fi("role"),Ki("eventOrder",{})]}),C_=function(e){var t=sv(e)&&Oe(e,"uid")?e.uid:du("memento"),n=function(e){return e.getSystem().getByUid(t).getOrDie()},r=function(e){return e.getSystem().getByUid(t).toOptional()},o=function(){return E(E({},e),{uid:t})};return{get:n,getOpt:r,asSpec:o}},z_=tinymce.util.Tools.resolve("tinymce.util.I18n"),S_={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},T_="temporary-placeholder",O_=function(e){return function(){return Se(e,T_).getOr("!not found!")}},E_=function(e,t){var n=e.toLowerCase();if(z_.isRtl()){var r=je(n,"-rtl");return Te(t,r)?r:n}return n},A_=function(e,t){return Se(t,E_(e,t))},D_=function(e,t){var n=t();return A_(e,n).getOrThunk(O_(n))},M_=function(e,t,n){var r=t();return A_(e,r).or(n).getOrThunk(O_(r))},N_=function(e){return!!z_.isRtl()&&Te(S_,e)},R_=function(){return jw("add-focusable",[Vc((function(e){Ls(e.element,"svg").each((function(e){return Fn(e,"focusable","false")}))}))])},B_=function(e,t,n,r){var o,i,a=N_(t)?["tox-icon--flip"]:[],c=Se(n,E_(t,n)).or(r).getOrThunk(O_(n));return{dom:{tag:e.tag,attributes:null!==(o=e.attributes)&&void 0!==o?o:{},classes:e.classes.concat(a),innerHtml:c},behaviours:mf(D(D([],null!==(i=e.behaviours)&&void 0!==i?i:[],!0),[R_()],!1))}},P_=function(e,t,n,r){return void 0===r&&(r=P.none()),B_(t,e,n(),r)},L_=function(e,t,n){var r=n(),o=ee(e,(function(e){return Te(r,E_(e,r))}));return B_(t,o.getOr(T_),r,P.none())},I_={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},H_=function(e){var t=C_({dom:{tag:"p",innerHtml:e.translationProvider(e.text)},behaviours:mf([Hw.config({})])}),n=function(e){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+e+"%"}}}},r=function(e){return{dom:{tag:"div",classes:["tox-text"],innerHtml:e+"%"}}},o=C_({dom:{tag:"div",classes:e.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(0)]},r(0)],behaviours:mf([Hw.config({})])}),i=function(e,t){e.getSystem().isConnected()&&o.getOpt(e).each((function(e){Hw.set(e,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[n(t)]},r(t)])}))},a=function(e,n){if(e.getSystem().isConnected()){var r=t.get(e);Hw.set(r,[xs(n)])}},c={updateProgress:i,updateText:a},u=ne([e.icon.toArray(),e.level.toArray(),e.level.bind((function(e){return P.from(I_[e])})).toArray()]),s=C_(x_.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[P_("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":e.translationProvider("Close")}},e.iconProvider)],action:function(t){e.onAction(t)}})),l=L_(u,{tag:"div",classes:["tox-notification__icon"]},e.iconProvider),f={dom:{tag:"div",classes:["tox-notification__body"]},components:[t.asSpec()],behaviours:mf([Hw.config({})])},d=[l,f];return{uid:e.uid,dom:{tag:"div",attributes:{role:"alert"},classes:e.level.map((function(e){return["tox-notification","tox-notification--in","tox-notification--"+e]})).getOr(["tox-notification","tox-notification--in"])},behaviours:mf([Yw.config({}),jw("notification-events",[Mc(Ia(),(function(e){s.getOpt(e).each(Yw.focus)}))])]),components:d.concat(e.progress?[o.asSpec()]:[]).concat(e.closeButton?[s.asSpec()]:[]),apis:c}},F_=dv({name:"Notification",factory:H_,configFields:[Fi("level"),Ei("progress"),Ei("icon"),Ei("onAction"),Ei("text"),Ei("iconProvider"),Ei("translationProvider"),Zi("closeButton",!0)],apis:{updateProgress:function(e,t,n){e.updateProgress(t,n)},updateText:function(e,t,n){e.updateText(t,n)}}});function j_(e,t,n){var r=t.backstage.shared,o=function(e){switch(e){case"bc-bc":return g_;case"tc-tc":return m_;case"tc-bc":return Wl;case"bc-tc":default:return $l}},i=function(e){e.length>0&&G(e,(function(t,n){0===n?t.moveRel(null,"banner"):t.moveRel(e[n-1].getEl(),"bc-tc")}))},a=function(t,i){var a=!t.closeButton&&t.timeout&&(t.timeout>0||t.timeout<0),c=function(){i(),t_.hide(s)},u=Ts(F_.sketch({text:t.text,level:V(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:P.from(t.icon),closeButton:!a,onAction:c,iconProvider:r.providers.icons,translationProvider:r.providers.translate})),s=Ts(t_.sketch(E({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));n.add(s),t.timeout>0&&k_.setTimeout((function(){c()}),t.timeout);var l=function(){var t=Jr(tt.fromDom(e.getContentAreaContainer())),n=Zr(),r=Ol(n.x,t.x,t.right),o=Ol(n.y,t.y,t.bottom),i=Math.max(t.right,n.right),a=Math.max(t.bottom,n.bottom);return P.some(Yr(r,o,i-r,a-o))};return{close:c,moveTo:function(e,t){t_.showAt(s,Os(u),{anchor:{type:"makeshift",x:e,y:t}})},moveRel:function(e,t){var n=Os(u),i={maxHeightFunction:Td()};if("banner"!==t&&d(e)){var a=o(t),c={type:"node",root:Ln(),node:P.some(tt.fromDom(e)),overrides:i,layouts:{onRtl:function(){return[a]},onLtr:function(){return[a]}}};t_.showWithinBounds(s,n,{anchor:c},l)}else{var f=E(E({},r.anchors.banner()),{overrides:i});t_.showWithinBounds(s,n,{anchor:f},l)}},text:function(e){F_.updateText(u,e)},settings:t,getEl:function(){return u.element.dom},progressBar:{value:function(e){F_.updateProgress(u,e)}}}},c=function(e){e.close()},u=function(e){return e.settings};return{open:a,close:c,reposition:i,getArgs:u}}var V_,U_=function(e,t){var n=null,r=function(){u(n)||(clearTimeout(n),n=null)},o=function(){for(var r=[],o=0;o',e.getDoc());return Ar(n,tt.fromDom(t.extractContents())),t.insertNode(n.dom),vn(n).each((function(e){return e.dom.normalize()})),Gm(n).map((function(t){e.selection.setCursorLocation(t.dom,Um(t))})),n}))},Y_=function(e){return Hs(e,K_)},J_=function(e){return e.collapsed&&3===e.startContainer.nodeType},Q_=function(e){return e.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Z_=function(e){return""!==e&&-1!=="  \f\n\r\t\v".indexOf(e)},ex=function(e,t){return e.substring(t.length)},tx=function(e,t,n){var r;for(r=t-1;r>=0;r--){var o=e.charAt(r);if(Z_(o))return P.none();if(o===n)break}return P.some(r)},nx=function(e,t,n,r){if(void 0===r&&(r=0),!J_(t))return P.none();var o=function(e,t,r){return tx(r,t,n).getOr(t)},i=e.getParent(t.startContainer,e.isBlock)||e.getRoot();return G_(e,t.startContainer,t.startOffset,o,i).bind((function(e){var o=t.cloneRange();if(o.setStart(e.container,e.offset),o.setEnd(t.endContainer,t.endOffset),o.collapsed)return P.none();var i=Q_(o),a=i.lastIndexOf(n);return 0!==a||ex(i,n).length0?lx(t[t.length-1]):cx(e,t.length)},fx=function(e,t){var n=e.childNodes;return n.length>0&&t0&&sx(e)&&n.length===t?lx(n[n.length-1]):cx(e,t)},dx=function(e,t){return G_(e,t.container,t.offset,(function(e,t){return 0===t?-1:t}),e.getRoot()).filter((function(e){var t=e.container.data.charAt(e.offset-1);return!Z_(t)})).isSome()},mx=function(e){return function(t){var n=fx(t.startContainer,t.startOffset);return!dx(e,n)}},gx=function(e,t,n){return ge(n.triggerChars,(function(n){return rx(e,t,n)}))},px=function(e,t){var n=t(),r=e.selection.getRng();return gx(e.dom,r,n).bind((function(n){return hx(e,t,n)}))},hx=function(e,t,n,r){void 0===r&&(r={});var o=t(),i=e.selection.getRng(),a=i.startContainer.nodeValue,c=Y(o.lookupByChar(n.triggerChar),(function(t){return n.text.length>=t.minChars&&t.matches.getOrThunk((function(){return mx(e.dom)}))(n.range,a,n.text)}));if(0===c.length)return P.none();var u=ax.all($(c,(function(e){var t=e.fetch(n.text,e.maxResults,r);return t.then((function(t){return{matchText:n.text,items:t,columns:e.columns,onAction:e.onAction,highlightOn:e.highlightOn}}))})));return P.some({lookupData:u,context:n})},vx=ei([Mi("type"),Ui("text")]),yx=function(e){return wi("separatormenuitem",vx,e)},bx=ei([Ki("type","autocompleteitem"),Ki("active",!1),Ki("disabled",!1),Ki("meta",{}),Mi("value"),Ui("text"),Ui("icon")]),wx=ei([Mi("type"),Mi("ch"),Yi("minChars",1),Ki("columns",1),Yi("maxResults",10),qi("matches"),Bi("fetch"),Bi("onAction"),na("highlightOn",[],si)]),kx=function(e){return wi("Autocompleter.Separator",vx,e)},_x=function(e){return wi("Autocompleter.Item",bx,e)},xx=function(e){return wi("Autocompleter",wx,e)},Cx=[Zi("disabled",!1),Ui("tooltip"),Ui("icon"),Ui("text"),ea("onSetup",(function(){return h}))],zx=ei([Mi("type"),Bi("onAction")].concat(Cx)),Sx=function(e){return wi("toolbarbutton",zx,e)},Tx=[Zi("active",!1)].concat(Cx),Ox=ei(Tx.concat([Mi("type"),Bi("onAction")])),Ex=function(e){return wi("ToggleButton",Ox,e)},Ax=[ea("predicate",S),Qi("scope","node",["node","editor"]),Qi("position","selection",["node","selection","line"])],Dx=Cx.concat([Ki("type","contextformbutton"),Ki("primary",!1),Bi("onAction"),Ti("original",k)]),Mx=Tx.concat([Ki("type","contextformbutton"),Ki("primary",!1),Bi("onAction"),Ti("original",k)]),Nx=Cx.concat([Ki("type","contextformbutton")]),Rx=Tx.concat([Ki("type","contextformtogglebutton")]),Bx=Ci("type",{contextformbutton:Dx,contextformtogglebutton:Mx}),Px=ei([Ki("type","contextform"),ea("initValue",w("")),Ui("label"),Hi("commands",Bx),ji("launch",Ci("type",{contextformbutton:Nx,contextformtogglebutton:Rx}))].concat(Ax)),Lx=function(e){return wi("ContextForm",Px,e)},Ix=ei([Ki("type","contexttoolbar"),Mi("items")].concat(Ax)),Hx=function(e){return wi("ContextToolbar",Ix,e)},Fx=function(e){var t={};return G(e,(function(e){t[e]={}})),pe(t)},jx=function(e){var t=e.ui.registry.getAll().popups,n=ye(t,(function(e){return xx(e).fold((function(e){throw new Error(xi(e))}),k)})),r=Fx(xe(n,(function(e){return e.ch}))),o=ze(n),i=function(e){return Y(o,(function(t){return t.ch===e}))};return{dataset:n,triggerChars:r,lookupByChar:i}};(function(e){e[e["CLOSE_ON_EXECUTE"]=0]="CLOSE_ON_EXECUTE",e[e["BUBBLE_TO_SANDBOX"]=1]="BUBBLE_TO_SANDBOX"})(V_||(V_={}));var Vx,Ux=V_,qx="tox-menu-nav__js",Wx="tox-collection__item",$x="tox-swatch",Gx={normal:qx,color:$x},Kx="tox-collection__item--enabled",Xx="tox-collection__group-heading",Yx="tox-collection__item-icon",Jx="tox-collection__item-label",Qx="tox-collection__item-accessory",Zx="tox-collection__item-caret",eC="tox-collection__item-checkmark",tC="tox-collection__item--active",nC="tox-collection__item-container",rC="tox-collection__item-container--column",oC="tox-collection__item-container--row",iC="tox-collection__item-container--align-right",aC="tox-collection__item-container--align-left",cC="tox-collection__item-container--valign-top",uC="tox-collection__item-container--valign-middle",sC="tox-collection__item-container--valign-bottom",lC=function(e){return Se(Gx,e).getOr(qx)},fC=function(e){return"color"===e?"tox-swatches":"tox-menu"},dC=function(e){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:fC(e),tieredMenu:"tox-tiered-menu"}},mC=function(e){var t=dC(e);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:lC(e)}},gC=function(e,t,n){var r=dC(n);return{tag:"div",classes:ne([[r.menu,"tox-menu-"+t+"-column"],e?[r.hasIcons]:[]])}},pC=[Fk.parts.items({})],hC=function(e,t,n){var r=dC(n),o={tag:"div",classes:ne([[r.tieredMenu]])};return{dom:o,markers:mC(n)}},vC=function(e,t){return function(n){var r=W(n,t);return $(r,(function(t){return{dom:e,components:t}}))}},yC=function(e){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Fk.parts.items({preprocess:"auto"!==e?vC({tag:"div",classes:["tox-swatches__row"]},e):k})]}]}},bC=function(e){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Fk.parts.items({preprocess:vC({tag:"div",classes:["tox-collection__group"]},e)})]}},wC=function(e,t){var n=[],r=[];return G(e,(function(e,o){t(e,o)?(r.length>0&&n.push(r),r=[],Te(e.dom,"innerHtml")&&r.push(e)):r.push(e)})),r.length>0&&n.push(r),$(n,(function(e){return{dom:{tag:"div",classes:["tox-collection__group"]},components:e}}))},kC=function(e,t,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===e?["tox-collection--list"]:["tox-collection--grid"])},components:[Fk.parts.items({preprocess:function(n){return"auto"!==e&&e>1?vC({tag:"div",classes:["tox-collection__group"]},e)(n):wC(n,(function(e,n){return"separator"===t[n].type}))}})]}},_C=function(e,t){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Fk.parts.items({preprocess:function(t){return wC(t,(function(t,n){return"separator"===e[n].type}))}})]}},xC=function(e){return U(e,(function(e){return"icon"in e&&void 0!==e.icon}))},CC=function(e){return console.error(xi(e)),console.log(e),P.none()},zC=function(e,t,n,r,o){var i=_C(n);return{value:e,dom:i.dom,components:i.components,items:n}},SC=function(e,t,n,r,o){if("color"===o){var i=yC(r);return{value:e,dom:i.dom,components:i.components,items:n}}if("normal"===o&&"auto"===r){i=kC(r,n);return{value:e,dom:i.dom,components:i.components,items:n}}if("normal"===o&&1===r){i=kC(1,n);return{value:e,dom:i.dom,components:i.components,items:n}}if("normal"===o){i=kC(r,n);return{value:e,dom:i.dom,components:i.components,items:n}}if("listpreview"===o&&"auto"!==r){i=bC(r);return{value:e,dom:i.dom,components:i.components,items:n}}return{value:e,dom:gC(t,r,o),components:pC,items:n}},TC=[Mi("type"),Mi("src"),Ui("alt"),na("classes",[],si)],OC=ei(TC),EC=[Mi("type"),Mi("text"),Ui("name"),na("classes",["tox-collection__item-label"],si)],AC=ei(EC),DC=Jo((function(){return pi("type",{cardimage:OC,cardtext:AC,cardcontainer:MC})})),MC=ei([Mi("type"),Ji("direction","horizontal"),Ji("align","left"),Ji("valign","middle"),Hi("items",DC)]),NC=[Zi("disabled",!1),Ui("text"),Ui("shortcut"),Si("value","value",zo((function(){return ou("menuitem-value")})),ai()),Ki("meta",{})],RC=ei([Mi("type"),Ui("label"),Hi("items",DC),ea("onSetup",(function(){return h})),ea("onAction",h)].concat(NC)),BC=function(e){return wi("cardmenuitem",RC,e)},PC=ei([Mi("type"),Zi("active",!1),Ui("icon")].concat(NC)),LC=function(e){return wi("choicemenuitem",PC,e)},IC=[Mi("type"),Mi("fancytype"),ea("onAction",h)],HC=[Ki("initData",{})].concat(IC),FC=[ra("initData",{},[Zi("allowCustomColors",!0),Wi("colors",ai())])].concat(IC),jC=Ci("fancytype",{inserttable:HC,colorswatch:FC}),VC=function(e){return wi("fancymenuitem",jC,e)},UC=ei([Mi("type"),ea("onSetup",(function(){return h})),ea("onAction",h),Ui("icon")].concat(NC)),qC=function(e){return wi("menuitem",UC,e)},WC=ei([Mi("type"),Bi("getSubmenuItems"),ea("onSetup",(function(){return h})),Ui("icon")].concat(NC)),$C=function(e){return wi("nestedmenuitem",WC,e)},GC=ei([Mi("type"),Ui("icon"),Zi("active",!1),ea("onSetup",(function(){return h})),Bi("onAction")].concat(NC)),KC=function(e){return wi("togglemenuitem",GC,e)},XC=function(e,t,n){var r=Xm(e.element,"."+n);if(r.length>0){var o=te(r,(function(e){var n=e.dom.getBoundingClientRect().top,o=r[0].dom.getBoundingClientRect().top;return Math.abs(n-o)>t})).getOr(r.length);return P.some({numColumns:o,numRows:Math.ceil(r.length/o)})}return P.none()},YC=function(e,t){return mf([jw(e,t)])},JC=function(e){return YC(ou("unnamed-events"),e)},QC={namedEvents:YC,unnamedEvents:JC},ZC=ou("tooltip.exclusive"),ez=ou("tooltip.show"),tz=ou("tooltip.hide"),nz=function(e,t,n){e.getSystem().broadcastOn([ZC],{})},rz=function(e,t,n,r){n.getTooltip().each((function(e){e.getSystem().isConnected()&&Hw.set(e,r)}))},oz=Object.freeze({__proto__:null,hideAllExclusive:nz,setComponents:rz}),iz=function(e,t){var n=function(n){t.getTooltip().each((function(r){Gg(r),e.onHide(n,r),t.clearTooltip()})),t.clearTimer()},r=function(n){if(!t.isShowing()){nz(n);var r=e.lazySink(n).getOrDie(),o=n.getSystem().build({dom:e.tooltipDom,components:e.tooltipComponents,events:Oc("normal"===e.mode?[Mc(La(),(function(e){_c(n,ez)})),Mc(Ba(),(function(e){_c(n,tz)}))]:[]),behaviours:mf([Hw.config({})])});t.setTooltip(o),qg(r,o),e.onShow(n,o),Ig.position(r,o,{anchor:e.anchor(n)})}};return Oc(ne([[Mc(ez,(function(n){t.resetTimer((function(){r(n)}),e.delay)})),Mc(tz,(function(r){t.resetTimer((function(){n(r)}),e.delay)})),Mc(ec(),(function(e,t){var r=t;r.universal||V(r.channels,ZC)&&n(e)})),Uc((function(e){n(e)}))],"normal"===e.mode?[Mc(Ia(),(function(e){_c(e,ez)})),Mc(Qa(),(function(e){_c(e,tz)})),Mc(La(),(function(e){_c(e,ez)})),Mc(Ba(),(function(e){_c(e,tz)}))]:[Mc(wc(),(function(e,t){_c(e,ez)})),Mc(kc(),(function(e){_c(e,tz)}))]]))},az=Object.freeze({__proto__:null,events:iz}),cz=[Ei("lazySink"),Ei("tooltipDom"),Ki("exclusive",!0),Ki("tooltipComponents",[]),Ki("delay",300),Qi("mode","normal",["normal","follow-highlight"]),Ki("anchor",(function(e){return{type:"hotspot",hotspot:e,layouts:{onLtr:w([$l,Wl,jl,Ul,Vl,ql]),onRtl:w([$l,Wl,jl,Ul,Vl,ql])}}})),cl("onHide"),cl("onShow")],uz=function(){var e=od(),t=od(),n=function(){e.on(clearTimeout)},r=function(t,r){n(),e.set(setTimeout(t,r))},o=w("not-implemented");return zu({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:n,resetTimer:r,readState:o})},sz=Object.freeze({__proto__:null,init:uz}),lz=pf({fields:cz,name:"tooltipping",active:az,state:sz,apis:oz}),fz=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},dz=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),mz=tinymce.util.Tools.resolve("tinymce.EditorManager"),gz=function(e){var t=e.getParam("skin"),n=e.getParam("skin_url");if(!1!==t){var r=t||"oxide";n=n?e.documentBaseURI.toAbsolute(n):mz.baseURL+"/skins/ui/"+r}return n},pz=function(e){return e.getParam("readonly",!1,"boolean")},hz=function(e){return!1===e.getParam("skin")},vz=function(e){return e.getParam("height",Math.max(e.getElement().offsetHeight,200))},yz=function(e){return e.getParam("width",dz.DOM.getStyle(e.getElement(),"width"))},bz=function(e){return P.from(e.getParam("min_width")).filter(g)},wz=function(e){return P.from(e.getParam("min_height")).filter(g)},kz=function(e){return P.from(e.getParam("max_width")).filter(g)},_z=function(e){return P.from(e.getParam("max_height")).filter(g)},xz=function(e){return P.from(e.getParam("style_formats")).filter(c)},Cz=function(e){return e.getParam("style_formats_merge",!1,"boolean")},zz=function(e){return e.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},Sz=function(e){return e.getParam("content_langs",void 0,"array")},Tz=function(e){return e.getParam("removed_menuitems","")},Oz=function(e){return!1!==e.getParam("menubar",!0,"boolean")},Ez=function(e){var t=e.getParam("toolbar",!0),n=!0===t,r=i(t),o=c(t)&&t.length>0;return!Dz(e)&&(o||r||n)},Az=function(e){var t=q(9,(function(t){return e.getParam("toolbar"+(t+1),!1,"string")})),n=Y(t,(function(e){return"string"===typeof e}));return n.length>0?P.some(n):P.none()},Dz=function(e){return Az(e).fold((function(){var t=e.getParam("toolbar",[],"string[]");return t.length>0}),T)};(function(e){e["default"]="wrap",e["floating"]="floating",e["sliding"]="sliding",e["scrolling"]="scrolling"})(Vx||(Vx={}));var Mz,Nz=function(e){return e.getParam("toolbar_mode","","string")};(function(e){e["auto"]="auto",e["top"]="top",e["bottom"]="bottom"})(Mz||(Mz={}));var Rz,Bz=function(e){return e.getParam("toolbar_groups",{},"object")},Pz=function(e){return e.getParam("toolbar_location",Mz.auto,"string")},Lz=function(e){return Pz(e)===Mz.bottom},Iz=function(e){return e.getParam("fixed_toolbar_container","","string")},Hz=function(e){return e.getParam("fixed_toolbar_container_target")},Fz=function(e){return e.getParam("toolbar_persist",!1,"boolean")},jz=function(e){if(!e.inline)return P.none();var t=Iz(e);if(t.length>0)return Is(Ln(),t);var n=Hz(e);return d(n)?P.some(tt.fromDom(n)):P.none()},Vz=function(e){return e.inline&&jz(e).isSome()},Uz=function(e){var t=jz(e);return t.getOrThunk((function(){return An(En(tt.fromDom(e.getElement())))}))},qz=function(e){return e.inline&&!Oz(e)&&!Ez(e)&&!Dz(e)},Wz=function(e){var t=e.getParam("toolbar_sticky",!1,"boolean");return(t||e.inline)&&!Vz(e)&&!qz(e)},$z=function(e){return e.getParam("toolbar_sticky_offset",0,"number")},Gz=function(e){return e.getParam("draggable_modal",!1,"boolean")},Kz=function(e){var t=e.getParam("menu");return t?ye(t,(function(e){return E(E({},e),{items:e.items})})):{}},Xz=function(e){return e.getParam("menubar")},Yz=function(e){return e.getParam("toolbar",!0)},Jz=function(e){return e.getParam("file_picker_callback")},Qz=function(e){return e.getParam("file_picker_types")},Zz=function(e){return e.getParam("file_browser_callback_types")},eS=function(e){return!1===e.getParam("typeahead_urls")},tS=function(e){return e.getParam("anchor_top","#top")},nS=function(e){return e.getParam("anchor_bottom","#bottom")},rS=function(e){var t=e.getParam("file_picker_validator_handler",void 0,"function");return void 0===t?e.getParam("filepicker_validator_handler",void 0,"function"):t},oS="silver.readonly",iS=ei([Ri("readonly")]),aS=function(e,t){var n=e.outerContainer,r=n.element;t&&(e.mothership.broadcastOn([bp()],{target:r}),e.uiMothership.broadcastOn([bp()],{target:r})),e.mothership.broadcastOn([oS],{readonly:t}),e.uiMothership.broadcastOn([oS],{readonly:t})},cS=function(e,t){e.on("init",(function(){e.mode.isReadOnly()&&aS(t,!0)})),e.on("SwitchMode",(function(){return aS(t,e.mode.isReadOnly())})),pz(e)&&e.setMode("readonly")},uS=function(){var e;return bf.config({channels:(e={},e[oS]={schema:iS,onReceive:function(e,t){Lv.set(e,t.readonly)}},e)})},sS=function(e){return Lv.config({disabled:e,disableClass:"tox-collection__item--state-disabled"})},lS=function(e){return Lv.config({disabled:e})},fS=function(e){return Lv.config({disabled:e,disableClass:"tox-tbtn--disabled"})},dS=function(e){return Lv.config({disabled:e,disableClass:"tox-tbtn--disabled",useNative:!1})},mS={item:sS,button:lS,splitButton:fS,toolbarButton:dS},gS=function(e,t){var n=e.getApi(t);return function(e){e(n)}},pS=function(e,t){return Vc((function(n){var r=gS(e,n);r((function(n){var r=e.onSetup(n);m(r)&&t.set(r)}))}))},hS=function(e,t){return Uc((function(n){return gS(e,n)(t.get())}))},vS=function(e,t){return Wc((function(n,r){gS(e,n)(e.onAction),e.triggersSubmenu||t!==Ux.CLOSE_ON_EXECUTE||(_c(n,ic()),r.stop())}))},yS=(Rz={},Rz[tc()]=["disabling","alloy.base.behaviour","toggling","item-events"],Rz),bS=De,wS=function(e,t,n,r){var o=oa(h);return{type:"item",dom:t.dom,components:bS(t.optComponents),data:e.data,eventOrder:yS,hasSubmenu:e.triggersSubmenu,itemBehaviours:mf([jw("item-events",[vS(e,n),pS(e,o),hS(e,o)]),mS.item((function(){return e.disabled||r.isDisabled()})),uS(),Hw.config({})].concat(e.itemBehaviours))}},kS=function(e){return{value:e.value,meta:E({text:e.text.getOr("")},e.meta)}},_S=tinymce.util.Tools.resolve("tinymce.Env"),xS=function(e){var t={alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"},n={meta:"Ctrl",access:"Shift+Alt"},r=_S.mac?t:n,o=e.split("+"),i=$(o,(function(e){var t=e.toLowerCase().trim();return Te(r,t)?r[t]:e}));return _S.mac?i.join(""):i.join("+")},CS=function(e,t,n){return void 0===n&&(n=[Yx]),P_(e,{tag:"div",classes:n},t)},zS=function(e){return{dom:{tag:"div",classes:[Jx]},components:[xs(z_.translate(e))]}},SS=function(e,t){return{dom:{tag:"div",classes:t,innerHtml:e}}},TS=function(e,t){return{dom:{tag:"div",classes:[Jx]},components:[{dom:{tag:e.tag,styles:e.styles},components:[xs(z_.translate(t))]}]}},OS=function(e){return{dom:{tag:"div",classes:[Qx],innerHtml:xS(e)}}},ES=function(e){return CS("checkmark",e,[eC])},AS=function(e){return CS("chevron-right",e,[Zx])},DS=function(e){return CS("chevron-down",e,[Zx])},MS=function(e,t){var n="vertical"===e.direction?rC:oC,r="left"===e.align?aC:iC,o=function(){switch(e.valign){case"top":return cC;case"middle":return uC;case"bottom":return sC}};return{dom:{tag:"div",classes:[nC,n,r,o()]},components:t}},NS=function(e,t,n){return{dom:{tag:"img",classes:t,attributes:{src:e,alt:n.getOr("")}}}},RS=function(e,t,n){var r="custom",o="remove",i=e.ariaLabel,a=e.value,c=e.iconContent.map((function(e){return M_(e,t.icons,n)})),u=function(){var e=$x,n=c.getOr(""),u=i.map((function(e){return{title:t.translate(e)}})).getOr({}),s={tag:"div",attributes:u,classes:[e]};return E(E({},s),a===r?{tag:"button",classes:D(D([],s.classes,!0),["tox-swatches__picker-btn"],!1),innerHtml:n}:a===o?{classes:D(D([],s.classes,!0),["tox-swatch--remove"],!1),innerHtml:n}:{attributes:E(E({},s.attributes),{"data-mce-color":a}),styles:{"background-color":a}})};return{dom:u(),optComponents:[]}},BS=function(e){var t=e.map((function(e){return{attributes:{title:z_.translate(e)}}})).getOr({});return E({tag:"div",classes:[qx,Wx]},t)},PS=function(e,t,n,r){var o={tag:"div",classes:[Yx]},i=function(e){return P_(e,o,t.icons,r)},a=function(){return P.some({dom:o})},c=n?e.iconContent.map(i).orThunk(a):P.none(),u=e.checkMark,s=P.from(e.meta).fold((function(){return zS}),(function(e){return Te(e,"style")?x(TS,e.style):zS})),l=e.htmlContent.fold((function(){return e.textContent.map(s)}),(function(e){return P.some(SS(e,[Jx]))})),f={dom:BS(e.ariaLabel),optComponents:[c,l,e.shortcutContent.map(OS),u,e.caret]};return f},LS=function(e,t,n,r){return void 0===r&&(r=P.none()),"color"===e.presets?RS(e,t,r):PS(e,t,n,r)},IS=function(e,t){return Se(e,"tooltipWorker").map((function(e){return[lz.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(e){return{type:"submenu",item:e,overrides:{maxHeightFunction:Td}}},mode:"follow-highlight",onShow:function(t,n){e((function(e){lz.setComponents(t,[Cs({element:tt.fromDom(e)})])}))}})]})).getOr([])},HS=function(e){return dz.DOM.encode(e)},FS=function(e,t){var n=z_.translate(e),r=HS(n);if(t.length>0){var o=new RegExp(fz(t),"gi");return r.replace(o,(function(e){return''+e+""}))}return r},jS=function(e,t,n,r,o,i,a,c){void 0===c&&(c=!0);var u=LS({presets:r,textContent:P.none(),htmlContent:n?e.text.map((function(e){return FS(e,t)})):P.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:P.none(),checkMark:P.none(),caret:P.none(),value:e.value},a.providers,c,e.icon);return wS({data:kS(e),disabled:e.disabled,getApi:w({}),onAction:function(t){return o(e.value,e.meta)},onSetup:w(h),triggersSubmenu:!1,itemBehaviours:IS(e.meta,a)},u,i,a.providers)},VS=function(e,t){return $(e,(function(e){switch(e.type){case"cardcontainer":return MS(e,VS(e.items,t));case"cardimage":return NS(e.src,e.classes,e.alt);case"cardtext":var n=e.name.exists((function(e){return V(t.cardText.highlightOn,e)})),r=n?P.from(t.cardText.matchText).getOr(""):"";return SS(FS(e.text,r),e.classes)}}))},US=function(e,t,n,r){var o=function(e){return{isDisabled:function(){return Lv.isDisabled(e)},setDisabled:function(t){Lv.set(e,t),G(Xm(e.element,"*"),(function(n){e.getSystem().getByDom(n).each((function(e){e.hasConfigured(Lv)&&Lv.set(e,t)}))}))}}},i={dom:BS(e.label),optComponents:[P.some({dom:{tag:"div",classes:[nC,oC]},components:VS(e.items,r)})]};return wS({data:kS(E({text:P.none()},e)),disabled:e.disabled,getApi:o,onAction:e.onAction,onSetup:e.onSetup,triggersSubmenu:!1,itemBehaviours:P.from(r.itemBehaviours).getOr([])},i,t,n.providers)},qS=function(e,t,n,r,o,i,a,c){void 0===c&&(c=!0);var u=function(e){return{setActive:function(t){pk.set(e,t)},isActive:function(){return pk.isOn(e)},isDisabled:function(){return Lv.isDisabled(e)},setDisabled:function(t){return Lv.set(e,t)}}},s=LS({presets:n,textContent:t?e.text:P.none(),htmlContent:P.none(),ariaLabel:e.text,iconContent:e.icon,shortcutContent:t?e.shortcut:P.none(),checkMark:t?P.some(ES(a.icons)):P.none(),caret:P.none(),value:e.value},a,c);return _o(wS({data:kS(e),disabled:e.disabled,getApi:u,onAction:function(t){return r(e.value)},onSetup:function(e){return e.setActive(o),h},triggersSubmenu:!1,itemBehaviours:[]},s,i,a),{toggling:{toggleClass:Kx,toggleOnExecute:!1,selected:e.active}})},WS=jh(Ok(),Ek()),$S=function(e){return{value:e}},GS=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,KS=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,XS=function(e){return GS.test(e)||KS.test(e)},YS=function(e){return Fe(e,"#").toUpperCase()},JS=function(e){return XS(e)?P.some({value:YS(e)}):P.none()},QS=function(e){var t=e.value.replace(GS,(function(e,t,n,r){return t+t+n+n+r+r}));return{value:t}},ZS=function(e){var t=QS(e),n=KS.exec(t.value);return null===n?["FFFFFF","FF","FF","FF"]:n},eT=function(e){var t=e.toString(16);return(1===t.length?"0"+t:t).toUpperCase()},tT=function(e){var t=eT(e.red)+eT(e.green)+eT(e.blue);return $S(t)},nT=Math.min,rT=Math.max,oT=Math.round,iT=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,aT=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,cT=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},uT=function(e){var t=parseInt(e,10);return t.toString()===e&&t>=0&&t<=255},sT=function(e){var t,n,r,o=(e.hue||0)%360,i=e.saturation/100,a=e.value/100;if(i=rT(0,nT(i,1)),a=rT(0,nT(a,1)),0===i)return t=n=r=oT(255*a),cT(t,n,r,1);var c=o/60,u=a*i,s=u*(1-Math.abs(c%2-1)),l=a-u;switch(Math.floor(c)){case 0:t=u,n=s,r=0;break;case 1:t=s,n=u,r=0;break;case 2:t=0,n=u,r=s;break;case 3:t=0,n=s,r=u;break;case 4:t=s,n=0,r=u;break;case 5:t=u,n=0,r=s;break;default:t=n=r=0}return t=oT(255*(t+l)),n=oT(255*(n+l)),r=oT(255*(r+l)),cT(t,n,r,1)},lT=function(e){var t=ZS(e),n=parseInt(t[1],16),r=parseInt(t[2],16),o=parseInt(t[3],16);return cT(n,r,o,1)},fT=function(e,t,n,r){var o=parseInt(e,10),i=parseInt(t,10),a=parseInt(n,10),c=parseFloat(r);return cT(o,i,a,c)},dT=function(e){if("transparent"===e)return P.some(cT(0,0,0,0));var t=iT.exec(e);if(null!==t)return P.some(fT(t[1],t[2],t[3],"1"));var n=aT.exec(e);return null!==n?P.some(fT(n[1],n[2],n[3],n[4])):P.none()},mT=function(e){return"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")"},gT=cT(255,0,0,1),pT=function(e){return e.fire("SkinLoaded")},hT=function(e,t){return e.fire("SkinLoadError",t)},vT=function(e){return e.fire("ResizeEditor")},yT=function(e,t){return e.fire("ResizeContent",t)},bT=function(e,t){return e.fire("ScrollContent",t)},wT=function(e,t){return e.fire("TextColorChange",t)},kT=function(e,t,n){return{hue:e,saturation:t,value:n}},_T=function(e){var t=0,n=0,r=0,o=e.red/255,i=e.green/255,a=e.blue/255,c=Math.min(o,Math.min(i,a)),u=Math.max(o,Math.max(i,a));if(c===u)return r=c,kT(0,0,100*r);var s=o===c?i-a:a===c?o-i:a-o;return t=o===c?3:a===c?1:5,t=60*(t-s/(u-c)),n=(u-c)/u,r=u,kT(Math.round(t),Math.round(100*n),Math.round(100*r))},xT=function(e){return _T(lT(e))},CT=function(e){return tT(sT(e))},zT=function(e){return JS(e).orThunk((function(){return dT(e).map(tT)})).getOrThunk((function(){var t=document.createElement("canvas");t.height=1,t.width=1;var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=e,n.fillRect(0,0,1,1);var r=n.getImageData(0,0,1,1).data,o=r[0],i=r[1],a=r[2],c=r[3];return tT(cT(o,i,a,c))}))},ST=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),TT="tinymce-custom-colors";function OT(e){void 0===e&&(e=10);var t=ST.getItem(TT),n=i(t)?JSON.parse(t):[],r=function(t){var n=e-t.length;return n<0?t.slice(0,e):t},o=r(n),a=function(t){j(o,t).each(c),o.unshift(t),o.length>e&&o.pop(),ST.setItem(TT,JSON.stringify(o))},c=function(e){o.splice(e,1)},u=function(){return o.slice(0)};return{add:a,state:u}}var ET,AT="choiceitem",DT=[{type:AT,text:"Light Green",value:"#BFEDD2"},{type:AT,text:"Light Yellow",value:"#FBEEB8"},{type:AT,text:"Light Red",value:"#F8CAC6"},{type:AT,text:"Light Purple",value:"#ECCAFA"},{type:AT,text:"Light Blue",value:"#C2E0F4"},{type:AT,text:"Green",value:"#2DC26B"},{type:AT,text:"Yellow",value:"#F1C40F"},{type:AT,text:"Red",value:"#E03E2D"},{type:AT,text:"Purple",value:"#B96AD9"},{type:AT,text:"Blue",value:"#3598DB"},{type:AT,text:"Dark Turquoise",value:"#169179"},{type:AT,text:"Orange",value:"#E67E23"},{type:AT,text:"Dark Red",value:"#BA372A"},{type:AT,text:"Dark Purple",value:"#843FA1"},{type:AT,text:"Dark Blue",value:"#236FA1"},{type:AT,text:"Light Gray",value:"#ECF0F1"},{type:AT,text:"Medium Gray",value:"#CED4D9"},{type:AT,text:"Gray",value:"#95A5A6"},{type:AT,text:"Dark Gray",value:"#7E8C8D"},{type:AT,text:"Navy Blue",value:"#34495E"},{type:AT,text:"Black",value:"#000000"},{type:AT,text:"White",value:"#ffffff"}],MT=OT(10),NT=function(e){for(var t=[],n=0;n0?d(n,r,t,o):r.text.length-n.matchLength>=10?u():c()}}))}))}))},p=q_((function(e){27!==e.which&&g()}),50),h={onKeypress:p,cancelIfNecessary:u,isMenuOpen:i,isActive:a,isProcessingAction:r.get,getView:function(){return t_.getContent(o)}};!1===e.hasPlugin("rtc")&&ix.setup(h,e)},BO={register:RO},PO=function(e,t,n){return Hs(e,t,n).isSome()},LO=function(e,t){var n=null,r=function(){for(var r=[],o=0;oIO||r>IO},VO=function(e){var t=od(),n=oa(!1),r=LO((function(t){e.triggerEvent(oc(),t),n.set(!0)}),HO),o=function(e){return FO(e).each((function(o){r.cancel();var i={x:o.clientX,y:o.clientY,target:e.target};r.schedule(e),n.set(!1),t.set(i)})),P.none()},i=function(e){return r.cancel(),FO(e).each((function(e){t.on((function(n){jO(e,n)&&t.clear()}))})),P.none()},a=function(o){r.cancel();var i=function(e){return sn(e.target,o.target)};return t.get().filter(i).map((function(t){return n.get()?(o.prevent(),!1):e.triggerEvent(rc(),o)}))},c=ga([{key:Ea(),value:o},{key:Aa(),value:i},{key:Da(),value:a}]),u=function(e,t){return Se(c,t).bind((function(t){return t(e)}))};return{fireIfReady:u}},UO=function(e){var t=e.raw;return t.which===oy[0]&&!V(["input","textarea"],ct(e.target))&&!PO(e.target,'[contenteditable="true"]')},qO=function(){return tn().browser.isFirefox()},WO=function(e,t){return qO()?cd(e,"focus",t):ad(e,"focusin",t)},$O=function(e,t){return qO()?cd(e,"blur",t):ad(e,"focusout",t)},GO=function(e,t){var n=E({stopBackspace:!0},t),r=["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"],o=VO(n),i=$(r.concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),(function(t){return ad(e,t,(function(e){o.fireIfReady(e,t).each((function(t){t&&e.kill()}));var r=n.triggerEvent(t,e);r&&e.kill()}))})),a=od(),c=ad(e,"paste",(function(e){o.fireIfReady(e,"paste").each((function(t){t&&e.kill()}));var t=n.triggerEvent("paste",e);t&&e.kill(),a.set(setTimeout((function(){n.triggerEvent(Za(),e)}),0))})),u=ad(e,"keydown",(function(e){var t=n.triggerEvent("keydown",e);t?e.kill():n.stopBackspace&&UO(e)&&e.prevent()})),s=WO(e,(function(e){var t=n.triggerEvent("focusin",e);t&&e.kill()})),l=od(),f=$O(e,(function(e){var t=n.triggerEvent("focusout",e);t&&e.kill(),l.set(setTimeout((function(){n.triggerEvent(Qa(),e)}),0))})),d=function(){G(i,(function(e){e.unbind()})),u.unbind(),s.unbind(),f.unbind(),c.unbind(),a.on(clearTimeout),l.on(clearTimeout)};return{unbind:d}},KO=function(e,t){var n=Se(e,"target").getOr(t);return oa(n)},XO=function(e,t){var n=oa(!1),r=oa(!1),o=function(){n.set(!0)},i=function(){r.set(!0)};return{stop:o,cut:i,isStopped:n.get,isCut:r.get,event:e,setSource:t.set,getSource:t.get}},YO=function(e){var t=oa(!1),n=function(){t.set(!0)};return{stop:n,cut:h,isStopped:t.get,isCut:S,event:e,setSource:z("Cannot set source of a broadcasted event"),getSource:z("Cannot get source of a broadcasted event")}},JO=aa.generate([{stopped:[]},{resume:["element"]},{complete:[]}]),QO=function(e,t,n,r,o,i){var a=e(t,r),c=XO(n,o);return a.fold((function(){return i.logEventNoHandlers(t,r),JO.complete()}),(function(e){var n=e.descHandler,r=Lu(n);return r(c),c.isStopped()?(i.logEventStopped(t,e.element,n.purpose),JO.stopped()):c.isCut()?(i.logEventCut(t,e.element,n.purpose),JO.complete()):vn(e.element).fold((function(){return i.logNoParent(t,e.element,n.purpose),JO.complete()}),(function(r){return i.logEventResponse(t,e.element,n.purpose),JO.resume(r)}))}))},ZO=function(e,t,n,r,o,i){return QO(e,t,n,r,o,i).fold(T,(function(r){return ZO(e,t,n,r,o,i)}),S)},eE=function(e,t,n,r,o){var i=KO(n,r);return QO(e,t,n,r,i,o)},tE=function(e,t,n){var r=YO(t);return G(e,(function(e){var t=e.descHandler,n=Lu(t);n(r)})),r.isStopped()},nE=function(e,t,n,r){return rE(e,t,n,n.target,r)},rE=function(e,t,n,r,o){var i=KO(n,r);return ZO(e,t,n,r,i,o)},oE=function(e,t){return{element:e,descHandler:t}},iE=function(e,t){return{id:e,descHandler:t}},aE=function(){var e={},t=function(t,n,r){ve(r,(function(r,o){var i=void 0!==e[o]?e[o]:{};i[n]=Pu(r,t),e[o]=i}))},n=function(e,t){return fu(t).bind((function(t){return Se(e,t)})).map((function(e){return oE(t,e)}))},r=function(t){return Se(e,t).map((function(e){return xe(e,(function(e,t){return iE(t,e)}))})).getOr([])},o=function(t,r,o){return Se(e,r).bind((function(e){return wa(o,(function(t){return n(e,t)}),t)}))},i=function(t){ve(e,(function(e,n){Te(e,t)&&delete e[t]}))};return{registerId:t,unregisterId:i,filterByType:r,find:o}},cE=function(){var e=aE(),t={},n=function(e){var t=e.element;return fu(t).getOrThunk((function(){return su("uid-",e.element)}))},r=function(e,n){var r=t[n];if(r!==e)throw new Error('The tagId "'+n+'" is already used by: '+Zc(r.element)+"\nCannot use it for: "+Zc(e.element)+"\nThe conflicting element is"+(Pn(r.element)?" ":" not ")+"already in the DOM");i(e)},o=function(o){var i=n(o);Oe(t,i)&&r(o,i);var a=[o];e.registerId(a,i,o.events),t[i]=o},i=function(n){fu(n.element).each((function(n){delete t[n],e.unregisterId(n)}))},a=function(t){return e.filterByType(t)},c=function(t,n,r){return e.find(t,n,r)},u=function(e){return Se(t,e)};return{find:c,filter:a,register:o,unregister:i,getById:u}},uE=function(e){var t=e.dom,n=t.attributes,r=A(t,["attributes"]);return{uid:e.uid,dom:E({tag:"div",attributes:E({role:"presentation"},n)},r),components:e.components,behaviours:nh(e.containerBehaviours),events:e.events,domModification:e.domModification,eventOrder:e.eventOrder}},sE=dv({name:"Container",factory:uE,configFields:[Ki("components",[]),th("containerBehaviours",[]),Ki("events",{}),Ki("domModification",{}),Ki("eventOrder",{})]}),lE=function(e){var t=function(t){return vn(e.element).fold(T,(function(e){return sn(t,e)}))},n=cE(),r=function(e,r){return n.find(t,e,r)},o=GO(e.element,{triggerEvent:function(e,t){return Js(e,t.target,(function(n){return nE(r,e,t,n)}))}}),i={debugInfo:w("real"),triggerEvent:function(e,t,n){Js(e,t,(function(o){return rE(r,e,n,t,o)}))},triggerFocus:function(e,t){fu(e).fold((function(){xf(e)}),(function(n){Js(Ja(),e,(function(n){return eE(r,Ja(),{originator:t,kill:h,prevent:h,target:e},e,n),!1}))}))},triggerEscape:function(e,t){i.triggerEvent("keydown",e.element,t.event)},getByUid:function(e){return p(e)},getByDom:function(e){return v(e)},build:Ts,addToGui:function(e){u(e)},removeFromGui:function(e){s(e)},addToWorld:function(e){a(e)},removeFromWorld:function(e){c(e)},broadcast:function(e){d(e)},broadcastOn:function(e,t){m(e,t)},broadcastEvent:function(e,t){g(e,t)},isConnected:T},a=function(e){e.connect(i),ft(e.element)||(n.register(e),G(e.components(),a),i.triggerEvent(cc(),e.element,{target:e.element}))},c=function(e){ft(e.element)||(G(e.components(),c),n.unregister(e)),e.disconnect()},u=function(t){qg(e,t)},s=function(e){Gg(e)},l=function(){o.unbind(),Br(e.element)},f=function(e){var t=n.filter(ec());G(t,(function(t){var n=t.descHandler,r=Lu(n);r(e)}))},d=function(e){f({universal:!0,data:e})},m=function(e,t){f({universal:!1,channels:e,data:t})},g=function(e,t){var r=n.filter(e);return tE(r,t)},p=function(e){return n.getById(e).fold((function(){return ro.error(new Error('Could not find component with uid: "'+e+'" in system.'))}),ro.value)},v=function(e){var t=fu(e).getOr("not found");return p(t)};return a(e),{root:e,element:e.element,destroy:l,add:u,remove:s,getByUid:p,getByDom:v,addToWorld:a,removeFromWorld:c,broadcast:d,broadcastOn:m,broadcastEvent:g}},fE=function(e,t){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:$(e.items,t.interpreter)}},dE=w([Ki("prefix","form-field"),th("fieldBehaviours",[yv,eh])]),mE=w([Bh({schema:[Ei("dom")],name:"label"}),Bh({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[Ei("text")],name:"aria-descriptor"}),Nh({factory:{sketch:function(e){var t=da(e,["factory"]);return e.factory.sketch(t)}},schema:[Ei("factory")],name:"field"})]),gE=function(e,t,n,r){var o=rh(e.fieldBehaviours,[yv.config({find:function(t){return Kh(t,e,"field")}}),eh.config({store:{mode:"manual",getValue:function(e){return yv.getCurrent(e).bind(eh.getValue)},setValue:function(e,t){yv.getCurrent(e).each((function(e){eh.setValue(e,t)}))}}})]),i=Oc([Vc((function(t,n){var r=Yh(t,e,["label","field","aria-descriptor"]);r.field().each((function(t){var n=ou(e.prefix);r.label().each((function(e){Fn(e.element,"for",n),Fn(t.element,"id",n)})),r["aria-descriptor"]().each((function(n){var r=ou(e.prefix);Fn(n.element,"id",r),Fn(t.element,"aria-describedby",r)}))}))}))]),a={getField:function(t){return Kh(t,e,"field")},getLabel:function(t){return Kh(t,e,"label")}};return{uid:e.uid,dom:e.dom,components:t,behaviours:o,events:i,apis:a}},pE=mv({name:"FormField",configFields:dE(),partFields:mE(),factory:gE,apis:{getField:function(e,t){return e.getField(t)},getLabel:function(e,t){return e.getLabel(t)}}}),hE=function(e,t){return Au({attributes:ga([{key:t.tabAttr,value:"true"}])})},vE=Object.freeze({__proto__:null,exhibit:hE}),yE=[Ki("tabAttr","data-alloy-tabstop")],bE=pf({fields:yE,name:"tabstopping",active:vE}),wE=tinymce.util.Tools.resolve("tinymce.html.Entities"),kE=function(e,t,n,r){var o=xE(e,t,n,r);return pE.sketch(o)},_E=function(e,t){return kE(e,t,[],[])},xE=function(e,t,n,r){return{dom:zE(n),components:e.toArray().concat([t]),fieldBehaviours:mf(r)}},CE=function(){return zE([])},zE=function(e){return{tag:"div",classes:["tox-form__group"].concat(e)}},SE=function(e,t){return pE.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}})},TE=ou("form-component-change"),OE=ou("form-close"),EE=ou("form-cancel"),AE=ou("form-action"),DE=ou("form-submit"),ME=ou("form-block"),NE=ou("form-unblock"),RE=ou("form-tabchange"),BE=ou("form-resize"),PE=function(e,t){var n,r=e.label.map((function(e){return SE(e,t)})),o=function(e){return function(t,n){Hs(n.event.target,"[data-collection-item-value]").each((function(r){e(t,n,r,Vn(r,"data-collection-item-value"))}))}},i=function(n,r){var o=$(r,(function(n){var r=z_.translate(n.text),o=1===e.columns?'
'+r+"
":"",i='
'+n.icon+"
",a={_:" "," - ":" ","-":" "},c=r.replace(/\_| \- |\-/g,(function(e){return a[e]})),u=t.isDisabled()?" tox-collection__item--state-disabled":"";return'
'+i+o+"
"})),i="auto"!==e.columns&&e.columns>1?W(o,e.columns):[o],a=$(i,(function(e){return'
'+e.join("")+"
"}));Kc(n.element,a.join(""))},a=o((function(n,r,o,i){r.stop(),t.isDisabled()||xc(n,AE,{name:e.name,value:i})})),c=[Mc(La(),o((function(e,t,n){xf(n)}))),Mc(qa(),a),Mc(rc(),a),Mc(Ia(),o((function(e,t,n){Is(e.element,"."+tC).each((function(e){cs(e,tC)})),is(n,tC)}))),Mc(Ha(),o((function(e){Is(e.element,"."+tC).each((function(e){cs(e,tC)}))}))),Wc(o((function(t,n,r,o){xc(t,AE,{name:e.name,value:o})})))],u=function(e,t){return $(Xm(e.element,".tox-collection__item"),t)},s=pE.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==e.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:k},behaviours:mf([Lv.config({disabled:t.isDisabled,onDisabled:function(e){u(e,(function(e){is(e,"tox-collection__item--state-disabled"),Fn(e,"aria-disabled",!0)}))},onEnabled:function(e){u(e,(function(e){cs(e,"tox-collection__item--state-disabled"),Wn(e,"aria-disabled")}))}}),uS(),Hw.config({}),eh.config({store:{mode:"memory",initialValue:[]},onSetValue:function(t,n){i(t,n),"auto"===e.columns&&XC(t,5,"tox-collection__item").each((function(e){var n=e.numRows,r=e.numColumns;Ew.setGridSize(t,n,r)})),_c(t,BE)}}),bE.config({}),Ew.config(iO(e.columns,"normal")),jw("collection-events",c)]),eventOrder:(n={},n[tc()]=["disabling","alloy.base.behaviour","collection-events"],n)}),l=["tox-form__group--collection"];return kE(r,s,l,[])},LE=w([Fi("data"),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("tag","input"),Ki("inputClasses",[]),cl("onSetValue"),Ki("styles",{}),Ki("eventOrder",{}),th("inputBehaviours",[eh,Yw]),Ki("selectOnFocus",!0)]),IE=function(e){return mf([Yw.config({onFocus:e.selectOnFocus?function(e){var t=e.element,n=ds(t);t.dom.setSelectionRange(0,n.length)}:h})])},HE=function(e){return E(E({},IE(e)),rh(e.inputBehaviours,[eh.config({store:E(E({mode:"manual"},e.data.map((function(e){return{initialValue:e}})).getOr({})),{getValue:function(e){return ds(e.element)},setValue:function(e,t){var n=ds(e.element);n!==t&&ms(e.element,t)}}),onSetValue:e.onSetValue})]))},FE=function(e){return{tag:e.tag,attributes:E({type:"text"},e.inputAttributes),styles:e.inputStyles,classes:e.inputClasses}},jE=function(e,t){return{uid:e.uid,dom:FE(e),components:[],behaviours:HE(e),eventOrder:e.eventOrder}},VE=dv({name:"Input",configFields:LE(),factory:jE}),UE={},qE={exports:UE};(function(t,n,r,o){(function(e,o){"object"===typeof n&&"undefined"!==typeof r?r.exports=o():"function"===typeof t&&t.amd?t(o):(e="undefined"!==typeof globalThis?globalThis:e||self,e.EphoxContactWrapper=o())})(this,(function(){var t="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:"undefined"!==typeof self?self:{},n={exports:{}};(function(e){(function(t){var n=setTimeout;function r(){}function o(e,t){return function(){e.apply(t,arguments)}}function i(e){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function a(e,t){while(3===e._state)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(o){return void u(t.promise,o)}c(t.promise,r)}else(1===e._state?c:u)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===typeof t||"function"===typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void s(e);if("function"===typeof n)return void f(o(n,t),e)}e._state=1,e._value=t,s(e)}catch(r){u(e,r)}}function u(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn((function(){e._handled||i._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;tn?n:e===t?t-1:Math.max(t,e-r)},eM=function(e,t,n,r){return e>n?e:ed)return p;var h=rM(o,f,d),v=tM(h/m*r+t,g,p);return a&&v>=t&&v<=n?nM(v,t,n,i,c):u?Math.round(v):v},iM=function(e){var t=e.min,n=e.max,r=e.range,o=e.value,i=e.hasMinEdge,a=e.hasMaxEdge,c=e.maxBound,u=e.maxOffset,s=e.centerMinEdge,l=e.centerMaxEdge;return on?a?c:l:(o-t)/r*u},aM="top",cM="right",uM="bottom",sM="left",lM="width",fM="height",dM=function(e){return e.element.dom.getBoundingClientRect()},mM=function(e,t){return e[t]},gM=function(e){var t=dM(e);return mM(t,sM)},pM=function(e){var t=dM(e);return mM(t,cM)},hM=function(e){var t=dM(e);return mM(t,aM)},vM=function(e){var t=dM(e);return mM(t,uM)},yM=function(e){var t=dM(e);return mM(t,lM)},bM=function(e){var t=dM(e);return mM(t,fM)},wM=function(e,t,n){return(e+t)/2-n},kM=function(e,t){var n=dM(e),r=dM(t),o=mM(n,sM),i=mM(n,cM),a=mM(r,sM);return wM(o,i,a)},_M=function(e,t){var n=dM(e),r=dM(t),o=mM(n,aM),i=mM(n,uM),a=mM(r,aM);return wM(o,i,a)},xM=function(e,t){xc(e,cD(),{value:t})},CM=function(e){return{x:e}},zM=function(e,t,n){var r={min:gD(t),max:yD(t),range:xD(t),value:n,step:TD(t),snap:OD(t),snapStart:ED(t),rounded:AD(t),hasMinEdge:MD(t),hasMaxEdge:ND(t),minBound:gM(e),maxBound:pM(e),screenRange:yM(e)};return oM(r)},SM=function(e,t,n){var r=zM(e,t,n),o=CM(r);return xM(e,o),r},TM=function(e,t){var n=gD(t);xM(e,CM(n))},OM=function(e,t){var n=yD(t);xM(e,CM(n))},EM=function(e,t,n){var r=e>0?eM:ZD,o=r(PD(n).x,gD(n),yD(n),TD(n));return xM(t,CM(o)),P.some(o)},AM=function(e){return function(t,n){return EM(e,t,n).map(T)}},DM=function(e){var t=sD(e);return t.map((function(e){return e.left}))},MM=function(e,t,n,r,o){var i=0,a=yM(e),c=r.bind((function(t){return P.some(kM(t,e))})).getOr(i),u=o.bind((function(t){return P.some(kM(t,e))})).getOr(a),s={min:gD(t),max:yD(t),range:xD(t),value:n,hasMinEdge:MD(t),hasMaxEdge:ND(t),minBound:gM(e),minOffset:i,maxBound:pM(e),maxOffset:a,centerMinEdge:c,centerMaxEdge:u};return iM(s)},NM=function(e,t,n,r,o,i){var a=MM(t,i,n,r,o);return gM(t)-gM(e)+a},RM=function(e,t,n,r){var o=PD(n),i=NM(e,r.getSpectrum(e),o.x,r.getLeftEdge(e),r.getRightEdge(e),n),a=vr(t.element)/2;Kn(t.element,"left",i-a+"px")},BM=AM(-1),PM=AM(1),LM=P.none,IM=P.none,HM={"top-left":P.none(),top:P.none(),"top-right":P.none(),right:P.some(WD),"bottom-right":P.none(),bottom:P.none(),"bottom-left":P.none(),left:P.some(JD)},FM=Object.freeze({__proto__:null,setValueFrom:SM,setToMin:TM,setToMax:OM,findValueOfOffset:zM,getValueFromEvent:DM,findPositionOfValue:NM,setPositionFromValue:RM,onLeft:BM,onRight:PM,onUp:LM,onDown:IM,edgeActions:HM}),jM=function(e,t){xc(e,cD(),{value:t})},VM=function(e){return{y:e}},UM=function(e,t,n){var r={min:pD(t),max:bD(t),range:CD(t),value:n,step:TD(t),snap:OD(t),snapStart:ED(t),rounded:AD(t),hasMinEdge:RD(t),hasMaxEdge:BD(t),minBound:hM(e),maxBound:vM(e),screenRange:bM(e)};return oM(r)},qM=function(e,t,n){var r=UM(e,t,n),o=VM(r);return jM(e,o),r},WM=function(e,t){var n=pD(t);jM(e,VM(n))},$M=function(e,t){var n=bD(t);jM(e,VM(n))},GM=function(e,t,n){var r=e>0?eM:ZD,o=r(PD(n).y,pD(n),bD(n),TD(n));return jM(t,VM(o)),P.some(o)},KM=function(e){return function(t,n){return GM(e,t,n).map(T)}},XM=function(e){var t=sD(e);return t.map((function(e){return e.top}))},YM=function(e,t,n,r,o){var i=0,a=bM(e),c=r.bind((function(t){return P.some(_M(t,e))})).getOr(i),u=o.bind((function(t){return P.some(_M(t,e))})).getOr(a),s={min:pD(t),max:bD(t),range:CD(t),value:n,hasMinEdge:RD(t),hasMaxEdge:BD(t),minBound:hM(e),minOffset:i,maxBound:vM(e),maxOffset:a,centerMinEdge:c,centerMaxEdge:u};return iM(s)},JM=function(e,t,n,r,o,i){var a=YM(t,i,n,r,o);return hM(t)-hM(e)+a},QM=function(e,t,n,r){var o=PD(n),i=JM(e,r.getSpectrum(e),o.y,r.getTopEdge(e),r.getBottomEdge(e),n),a=ar(t.element)/2;Kn(t.element,"top",i-a+"px")},ZM=P.none,eN=P.none,tN=KM(-1),nN=KM(1),rN={"top-left":P.none(),top:P.some(VD),"top-right":P.none(),right:P.none(),"bottom-right":P.none(),bottom:P.some(KD),"bottom-left":P.none(),left:P.none()},oN=Object.freeze({__proto__:null,setValueFrom:qM,setToMin:WM,setToMax:$M,findValueOfOffset:UM,getValueFromEvent:XM,findPositionOfValue:JM,setPositionFromValue:QM,onLeft:ZM,onRight:eN,onUp:tN,onDown:nN,edgeActions:rN}),iN=function(e,t){xc(e,cD(),{value:t})},aN=function(e,t){return{x:e,y:t}},cN=function(e,t,n){var r=zM(e,t,n.left),o=UM(e,t,n.top),i=aN(r,o);return iN(e,i),i},uN=function(e,t,n,r){var o=e>0?eM:ZD,i=t?PD(r).x:o(PD(r).x,gD(r),yD(r),TD(r)),a=t?o(PD(r).y,pD(r),bD(r),TD(r)):PD(r).y;return iN(n,aN(i,a)),P.some(i)},sN=function(e,t){return function(n,r){return uN(e,t,n,r).map(T)}},lN=function(e,t){var n=gD(t),r=pD(t);iN(e,aN(n,r))},fN=function(e,t){var n=yD(t),r=bD(t);iN(e,aN(n,r))},dN=function(e){return sD(e)},mN=function(e,t,n,r){var o=PD(n),i=NM(e,r.getSpectrum(e),o.x,r.getLeftEdge(e),r.getRightEdge(e),n),a=JM(e,r.getSpectrum(e),o.y,r.getTopEdge(e),r.getBottomEdge(e),n),c=vr(t.element)/2,u=ar(t.element)/2;Kn(t.element,"left",i-c+"px"),Kn(t.element,"top",a-u+"px")},gN=sN(-1,!1),pN=sN(1,!1),hN=sN(-1,!0),vN=sN(1,!0),yN={"top-left":P.some(jD),top:P.some(UD),"top-right":P.some(qD),right:P.some($D),"bottom-right":P.some(GD),bottom:P.some(XD),"bottom-left":P.some(YD),left:P.some(QD)},bN=Object.freeze({__proto__:null,setValueFrom:cN,setToMin:lN,setToMax:fN,getValueFromEvent:dN,setPositionFromValue:mN,onLeft:gN,onRight:pN,onUp:hN,onDown:vN,edgeActions:yN}),wN=[Ki("stepSize",1),Ki("onChange",h),Ki("onChoose",h),Ki("onInit",h),Ki("onDragStart",h),Ki("onDragEnd",h),Ki("snapToGrid",!1),Ki("rounded",!0),Fi("snapStart"),Ai("model",Ci("mode",{x:[Ki("minX",0),Ki("maxX",100),Ti("value",(function(e){return oa(e.mode.minX)})),Ei("getInitialValue"),fl("manager",FM)],y:[Ki("minY",0),Ki("maxY",100),Ti("value",(function(e){return oa(e.mode.minY)})),Ei("getInitialValue"),fl("manager",oN)],xy:[Ki("minX",0),Ki("maxX",100),Ki("minY",0),Ki("maxY",100),Ti("value",(function(e){return oa({x:e.mode.minX,y:e.mode.minY})})),Ei("getInitialValue"),fl("manager",bN)]})),th("sliderBehaviours",[Ew,eh]),Ti("mouseIsDown",(function(){return oa(!1)}))],kN=function(e,t,n,r){var o,i=function(t){return Xh(t,e,"thumb")},a=function(t){return Xh(t,e,"spectrum")},c=function(t){return Kh(t,e,"left-edge")},u=function(t){return Kh(t,e,"right-edge")},s=function(t){return Kh(t,e,"top-edge")},l=function(t){return Kh(t,e,"bottom-edge")},f=e.model,d=f.manager,m=function(t,n){d.setPositionFromValue(t,n,e,{getLeftEdge:c,getRightEdge:u,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(e,t){f.value.set(t);var n=i(e);m(e,n)},p=function(t,n){g(t,n);var r=i(t);return e.onChange(t,r,n),P.some(!0)},h=function(t){d.setToMin(t,e)},v=function(t){d.setToMax(t,e)},y=function(t){var n=function(){Kh(t,e,"thumb").each((function(n){var r=f.value.get();e.onChoose(t,n,r)}))},r=e.mouseIsDown.get();e.mouseIsDown.set(!1),r&&n()},b=function(t,n){n.stop(),e.mouseIsDown.set(!0),e.onDragStart(t,i(t))},w=function(t,n){n.stop(),e.onDragEnd(t,i(t)),y(t)};return{uid:e.uid,dom:e.dom,components:t,behaviours:rh(e.sliderBehaviours,[Ew.config({mode:"special",focusIn:function(t){return Kh(t,e,"spectrum").map(Ew.focusIn).map(T)}}),eh.config({store:{mode:"manual",getValue:function(e){return f.value.get()}}}),bf.config({channels:(o={},o[kp()]={onReceive:y},o)})]),events:Oc([Mc(cD(),(function(e,t){p(e,t.event.value)})),Vc((function(t,n){var r=f.getInitialValue();f.value.set(r);var o=i(t);m(t,o);var c=a(t);e.onInit(t,o,c,f.value.get())})),Mc(Ea(),b),Mc(Da(),w),Mc(Na(),b),Mc(Pa(),w)]),apis:{resetToMin:h,resetToMax:v,setValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},_N=mv({name:"Slider",configFields:wN,partFields:iD,factory:kN,apis:{setValue:function(e,t,n){e.setValue(t,n)},resetToMin:function(e,t){e.resetToMin(t)},resetToMax:function(e,t){e.resetToMax(t)},refresh:function(e,t){e.refresh(t)}}}),xN=ou("rgb-hex-update"),CN=ou("slider-update"),zN=ou("palette-update"),SN=function(e,t){var n=_N.parts.spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),r=_N.parts.thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return _N.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:w({y:0})},components:[n,r],sliderBehaviours:mf([Yw.config({})]),onChange:function(e,t,n){xc(e,CN,{value:n})}})},TN="form",ON=[th("formBehaviours",[eh])],EN=function(e){return""},AN=function(e){var t=function(){var e=[],t=function(t,n){return e.push(t),Uh(TN,EN(t),n)};return{field:t,record:w(e)}}(),n=e(t),r=t.record(),o=$(r,(function(e){return Nh({name:e,pname:EN(e)})}));return av(TN,ON,o,MN,n)},DN=function(e,t){return e.fold((function(){return ro.error(t)}),ro.value)},MN=function(e,t){return{uid:e.uid,dom:e.dom,components:t,behaviours:rh(e.formBehaviours,[eh.config({store:{mode:"manual",getValue:function(t){var n=Jh(t,e);return ye(n,(function(e,t){return e().bind((function(e){var n=yv.getCurrent(e);return DN(n,new Error("Cannot find a current component to extract the value from for form part '"+t+"': "+Zc(e.element)))})).map(eh.getValue)}))},setValue:function(t,n){ve(n,(function(n,r){Kh(t,e,r).each((function(e){yv.getCurrent(e).each((function(e){eh.setValue(e,n)}))}))}))}}})]),apis:{getField:function(t,n){return Kh(t,e,n).bind(yv.getCurrent)}}}},NN={getField:xu((function(e,t,n){return e.getField(t,n)})),sketch:AN},RN=ou("valid-input"),BN=ou("invalid-input"),PN=ou("validating-input"),LN="colorcustom.rgb.",IN=function(e,t,n,r){var o=function(n,r){return dA.config({invalidClass:t("invalid"),notify:{onValidate:function(e){xc(e,PN,{type:n})},onValid:function(e){xc(e,RN,{type:n,value:eh.getValue(e)})},onInvalid:function(e){xc(e,BN,{type:n,value:eh.getValue(e)})}},validator:{validate:function(t){var n=eh.getValue(t),o=r(n)?ro.value(!0):ro.error(e("aria.input.invalid"));return eA.pure(o)},validateOnLoad:!1}})},i=function(n,r,i,a,c){var u=e(LN+"range"),s=pE.parts.label({dom:{tag:"label",innerHtml:i,attributes:{"aria-label":a}}}),l=pE.parts.field({data:c,factory:VE,inputAttributes:E({type:"text"},"hex"===r?{"aria-live":"polite"}:{}),inputClasses:[t("textfield")],inputBehaviours:mf([o(r,n),bE.config({})]),onSetValue:function(e){if(dA.isInvalid(e)){var t=dA.run(e);t.get(h)}}}),f=[s,l],d="hex"!==r?[pE.parts["aria-descriptor"]({text:u})]:[],m=f.concat(d);return{dom:{tag:"div",attributes:{role:"presentation"}},components:m}},a=function(e,t){var n=tT(t);return NN.getField(e,"hex").each((function(t){Yw.isFocused(t)||eh.setValue(e,{hex:n.value})})),n},c=function(e,t){var n=t.red,r=t.green,o=t.blue;eh.setValue(e,{red:n,green:r,blue:o})},u=C_({dom:{tag:"div",classes:[t("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),s=function(e,t){u.getOpt(e).each((function(e){Kn(e.element,"background-color","#"+t.value)}))},l=function(){var o={red:oa(P.some(255)),green:oa(P.some(255)),blue:oa(P.some(255)),hex:oa(P.some("ffffff"))},l=function(e,t){var n=lT(t);c(e,n),g(n)},f=function(e){return o[e].get()},d=function(e,t){o[e].set(t)},m=function(){return f("red").bind((function(e){return f("green").bind((function(t){return f("blue").map((function(n){return cT(e,t,n,1)}))}))}))},g=function(e){var t=e.red,n=e.green,r=e.blue;d("red",P.some(t)),d("green",P.some(n)),d("blue",P.some(r))},p=function(e,t){var n=t.event;"hex"!==n.type?d(n.type,P.none()):r(e)},h=function(e,t){n(e);var r=$S(t);d("hex",P.some(t));var o=lT(r);c(e,o),g(o),xc(e,xN,{hex:r}),s(e,r)},v=function(e,t,n){var r=parseInt(n,10);d(t,P.some(r)),m().each((function(t){var n=a(e,t);xc(e,xN,{hex:n}),s(e,n)}))},y=function(e){return"hex"===e.type},b=function(e,t){var n=t.event;y(n)?h(e,n.value):v(e,n.type,n.value)},w=function(t){return{label:e(LN+t+".label"),description:e(LN+t+".description")}},k=w("red"),_=w("green"),x=w("blue"),C=w("hex");return _o(NN.sketch((function(n){return{dom:{tag:"form",classes:[t("rgb-form")],attributes:{"aria-label":e("aria.color.picker")}},components:[n.field("red",pE.sketch(i(uT,"red",k.label,k.description,255))),n.field("green",pE.sketch(i(uT,"green",_.label,_.description,255))),n.field("blue",pE.sketch(i(uT,"blue",x.label,x.description,255))),n.field("hex",pE.sketch(i(XS,"hex",C.label,C.description,"ffffff"))),u.asSpec()],formBehaviours:mf([dA.config({invalidClass:t("form-invalid")}),jw("rgb-form-events",[Mc(RN,b),Mc(BN,p),Mc(PN,p)])])}})),{apis:{updateHex:function(e,t){eh.setValue(e,{hex:t.value}),l(e,t),s(e,t)}}})},f=dv({factory:l,name:"RgbForm",configFields:[],apis:{updateHex:function(e,t,n){e.updateHex(t,n)}},extraApis:{}});return f},HN=function(e,t){var n=_N.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[t("sv-palette-spectrum")]}}),r=_N.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette-thumb")],innerHtml:"'}}),o=function(e,t){var n=e.width,r=e.height,o=e.getContext("2d");if(null!==o){o.fillStyle=t,o.fillRect(0,0,n,r);var i=o.createLinearGradient(0,0,n,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),o.fillStyle=i,o.fillRect(0,0,n,r);var a=o.createLinearGradient(0,0,0,r);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),o.fillStyle=a,o.fillRect(0,0,n,r)}},i=function(e,t){var n=e.components()[0].element.dom,r=kT(t,100,100),i=sT(r);o(n,mT(i))},a=function(e,t){var n=_T(lT(t));_N.setValue(e,{x:n.saturation,y:100-n.value})},c=function(e){var i=w({x:0,y:0}),a=function(e,t,n){xc(e,zN,{value:n})},c=function(e,t,n,r){o(n.element.dom,mT(gT))},u=mf([yv.config({find:P.some}),Yw.config({})]);return _N.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[t("sv-palette")]},model:{mode:"xy",getInitialValue:i},rounded:!1,components:[n,r],onChange:a,onInit:c,sliderBehaviours:u})},u=dv({factory:c,name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(e,t,n){i(t,n)},setThumb:function(e,t,n){a(t,n)}},extraApis:{}});return u},FN=function(e,t){var n=function(n){var r=IN(e,t,n.onValidHex,n.onInvalidHex),o=HN(e,t),i=function(e){return(100-e)/100*360},a=function(e){return 100-e/360*100},c={paletteRgba:oa(gT),paletteHue:oa(0)},u=C_(SN(e,t)),s=C_(o.sketch({})),l=C_(r.sketch({})),f=function(e,t,n){s.getOpt(e).each((function(e){o.setHue(e,n)}))},d=function(e,t){l.getOpt(e).each((function(e){r.updateHex(e,t)}))},m=function(e,t,n){u.getOpt(e).each((function(e){_N.setValue(e,{y:a(n)})}))},g=function(e,t){s.getOpt(e).each((function(e){o.setThumb(e,t)}))},p=function(e,t){var n=lT(e);c.paletteRgba.set(n),c.paletteHue.set(t)},h=function(e,t,n,r){p(t,n),G(r,(function(r){r(e,t,n)}))},v=function(){var e=[d];return function(t,n){var r=n.event.value,o=c.paletteHue.get(),i=kT(o,r.x,100-r.y),a=CT(i);h(t,a,o,e)}},y=function(){var e=[f,d];return function(t,n){var r=i(n.event.value.y),o=c.paletteRgba.get(),a=_T(o),u=kT(r,a.saturation,a.value),s=CT(u);h(t,s,r,e)}},b=function(){var e=[f,m,g];return function(t,n){var r=n.event.hex,o=xT(r);h(t,r,o.hue,e)}};return{uid:n.uid,dom:n.dom,components:[s.asSpec(),u.asSpec(),l.asSpec()],behaviours:mf([jw("colour-picker-events",[Mc(xN,b()),Mc(zN,v()),Mc(CN,y())]),yv.config({find:function(e){return l.getOpt(e)}}),Ew.config({mode:"acyclic"})])}},r=dv({name:"ColourPicker",configFields:[Ei("dom"),Ki("onValidHex",h),Ki("onInvalidHex",h)],factory:n});return r},jN=function(){return yv.config({find:P.some})},VN=function(e){return yv.config({find:e.getOpt})},UN=function(e){return yv.config({find:function(t){return _n(t.element,e).bind((function(e){return t.getSystem().getByDom(e).toOptional()}))}})},qN={self:jN,memento:VN,childAt:UN},WN={"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"},$N=function(e){return WN[e]},GN=function(e){return $N(e)},KN=function(e){var t=function(e){return"tox-"+e},n=FN(GN,t),r=function(e){xc(e,AE,{name:"hex-valid",value:!0})},o=function(e){xc(e,AE,{name:"hex-valid",value:!1})},i=C_(n.sketch({dom:{tag:"div",classes:[t("color-picker-container")],attributes:{role:"presentation"}},onValidHex:r,onInvalidHex:o}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:mf([eh.config({store:{mode:"manual",getValue:function(e){var t=i.get(e),n=yv.getCurrent(t),r=n.bind((function(e){var t=eh.getValue(e);return t.hex}));return r.map((function(e){return"#"+e})).getOr("")},setValue:function(e,t){var n=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/,r=n.exec(t),o=i.get(e),a=yv.getCurrent(o);a.fold((function(){console.log("Can not find form")}),(function(e){eh.setValue(e,{hex:P.from(r[1]).getOr("")}),NN.getField(e,"hex").each((function(e){_c(e,Va())}))}))}}}),qN.self()])}},XN=tinymce.util.Tools.resolve("tinymce.Resource"),YN=function(e){return Te(e,"init")},JN=function(e){var t=od(),n=C_({dom:{tag:e.tag}}),r=od();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:mf([jw("custom-editor-events",[Vc((function(o){n.getOpt(o).each((function(n){(YN(e)?e.init(n.element.dom):XN.load(e.scriptId,e.scriptUrl).then((function(t){return t(n.element.dom,e.settings)}))).then((function(e){r.on((function(t){e.setValue(t)})),r.clear(),t.set(e)}))}))}))]),eh.config({store:{mode:"manual",getValue:function(){return t.get().fold((function(){return r.get().getOr("")}),(function(e){return e.getValue()}))},setValue:function(e,n){t.get().fold((function(){r.set(n)}),(function(e){return e.setValue(n)}))}}}),qN.self()]),components:[n.asSpec()]}},QN=tinymce.util.Tools.resolve("tinymce.util.Tools"),ZN=ei([Ki("preprocess",k),Ki("postprocess",k)]),eR=function(e,t){var n=_i("RepresentingConfigs.memento processors",ZN,t);return eh.config({store:{mode:"manual",getValue:function(t){var r=e.get(t),o=eh.getValue(r);return n.postprocess(o)},setValue:function(t,r){var o=n.preprocess(r),i=e.get(t);eh.setValue(i,o)}}})},tR=function(e,t,n){return eh.config(_o({store:{mode:"manual",getValue:t,setValue:n}},e.map((function(e){return{store:{initialValue:e}}})).getOr({})))},nR=function(e,t,n){return tR(e,(function(e){return t(e.element)}),(function(e,t){return n(e.element,t)}))},rR=function(e){return nR(e,ds,ms)},oR=function(e){return nR(e,Gc,Kc)},iR=function(e){return eh.config({store:{mode:"memory",initialValue:e}})},aR={memento:eR,withElement:nR,withComp:tR,domValue:rR,domHtml:oR,memory:iR},cR="jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp",uR=function(e,t){var n=QN.explode(t.getSetting("images_file_types",cR,"string")),r=function(e){return U(n,(function(t){return qe(e.name.toLowerCase(),"."+t.toLowerCase())}))};return Y(me(e),r)},sR=function(e,t){var n=function(e,t){t.stop()},r=function(e){return function(t,n){G(e,(function(e){e(t,n)}))}},o=function(e,t){if(!Lv.isDisabled(e)){var n=t.event.raw;a(e,n.dataTransfer.files)}},i=function(e,t){var n=t.event.raw.target;a(e,n.files)},a=function(n,r){eh.setValue(n,uR(r,t)),xc(n,TE,{name:e.name})},c=C_({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:mf([jw("input-file-events",[Hc(qa()),Hc(rc())])])}),u=function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:mf([aR.memory([]),qN.self(),Lv.config({}),pk.config({toggleClass:"dragenter",toggleOnExecute:!1}),jw("dropzone-events",[Mc("dragenter",r([n,pk.toggle])),Mc("dragleave",r([n,pk.toggle])),Mc("dragover",n),Mc("drop",r([n,o])),Mc(Ua(),i)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},x_.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(e){var t=c.get(e);t.element.dom.click()},buttonBehaviours:mf([bE.config({}),mS.button(t.isDisabled),uS()])})]}]}},s=e.label.map((function(e){return SE(e,t)})),l=pE.parts.field({factory:{sketch:u}});return kE(s,l,["tox-form__group--stretched"],[])},lR=function(e,t){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:$(e.items,t.interpreter)}},fR=ou("alloy-fake-before-tabstop"),dR=ou("alloy-fake-after-tabstop"),mR=function(e){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:e},behaviours:mf([Yw.config({ignore:!0}),bE.config({})])}},gR=function(e){return{dom:{tag:"div",classes:["tox-navobj"]},components:[mR([fR]),e,mR([dR])],behaviours:mf([qN.childAt(1)])}},pR=function(e,t){xc(e,Fa(),{raw:{which:9,shiftKey:t}})},hR=function(e,t){var n=t.element;us(n,fR)?pR(e,!0):us(n,dR)&&pR(e,!1)},vR=function(e){return PO(e,["."+fR,"."+dR].join(","),S)},yR=!(tn().browser.isIE()||tn().browser.isEdge()),bR=function(e){var t=oa("");return{getValue:function(e){return t.get()},setValue:function(n,r){if(e)Fn(n.element,"srcdoc",r);else{Fn(n.element,"src","javascript:''");var o=n.element.dom.contentWindow.document;o.open(),o.write(r),o.close()}t.set(r)}}},wR=function(e,t){var n=yR&&e.sandboxed,r=E(E({},e.label.map((function(e){return{title:e}})).getOr({})),n?{sandbox:"allow-scripts allow-same-origin"}:{}),o=bR(n),i=e.label.map((function(e){return SE(e,t)})),a=function(e){return gR({uid:e.uid,dom:{tag:"iframe",attributes:r},behaviours:mf([bE.config({}),Yw.config({}),aR.withComp(P.none(),o.getValue,o.setValue)])})},c=pE.parts.field({factory:{sketch:a}});return kE(i,c,["tox-form__group--stretched"],[])},kR=function(e,t){return CR(document.createElement("canvas"),e,t)},_R=function(e){var t=kR(e.width,e.height),n=xR(t);return n.drawImage(e,0,0),t},xR=function(e){return e.getContext("2d")},CR=function(e,t,n){return e.width=t,e.height=n,e},zR=function(e){return e.naturalWidth||e.width},SR=function(e){return e.naturalHeight||e.height},TR=function(e){return new $E((function(t,n){var r=URL.createObjectURL(e),o=new Image,i=function(){o.removeEventListener("load",a),o.removeEventListener("error",c)},a=function(){i(),t(o)},c=function(){i(),n("Unable to load data of type "+e.type+": "+r)};o.addEventListener("load",a),o.addEventListener("error",c),o.src=r,o.complete&&setTimeout(a,0)}))},OR=function(e){var t=e.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return P.none();for(var r=n[1],o=t[1],i=1024,a=atob(o),c=a.length,u=Math.ceil(c/i),s=new Array(u),l=0;ln?r=n:rn?e=n:e2)&&(i=i<.5?.5:2,c=!0),(a<.5||a>2)&&(a=a<.5?.5:2,c=!0);var u=cB(e,i,a);return c?u.then((function(e){return aB(e,t,n)})):u},cB=function(e,t,n){return new $E((function(r){var o=zR(e),i=SR(e),a=Math.floor(o*t),c=Math.floor(i*n),u=kR(a,c),s=xR(u);s.drawImage(e,0,0,o,i,0,0,a,c),r(u)}))},uB=function(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)},sB=function(e,t){return e.toCanvas().then((function(n){return lB(n,e.getType(),t)}))},lB=function(e,t,n){var r=n<0?360+n:n,o=r*Math.PI/180,i=e.width,a=e.height,c=Math.sin(o),u=Math.cos(o),s=uB(Math.abs(i*u)+Math.abs(a*c)),l=uB(Math.abs(i*c)+Math.abs(a*u)),f=kR(s,l),d=xR(f);return d.translate(s/2,l/2),d.rotate(o),d.drawImage(e,-i/2,-a/2),LR(f,t)},fB=function(e,t){return e.toCanvas().then((function(n){return dB(n,e.getType(),t)}))},dB=function(e,t,n){var r=kR(e.width,e.height),o=xR(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),LR(r,t)},mB=function(e,t,n,r,o){return e.toCanvas().then((function(i){return gB(i,e.getType(),t,n,r,o)}))},gB=function(e,t,n,r,o,i){var a=kR(o,i),c=xR(a);return c.drawImage(e,-n,-r),LR(a,t)},pB=function(e,t,n){return e.toCanvas().then((function(r){return aB(r,t,n).then((function(t){return LR(t,e.getType())}))}))},hB=function(e){return eB(e)},vB=function(e){return oB(e)},yB=function(e,t){return iB(e,t)},bB=function(e,t,n,r){return rB(e,t,n,r)},wB=function(e,t){return tB(e,t)},kB=function(e,t){return nB(e,t)},_B=function(e,t){return fB(e,t)},xB=function(e,t,n,r,o){return mB(e,t,n,r,o)},CB=function(e,t,n){return pB(e,t,n)},zB=function(e,t){return sB(e,t)},SB=function(e,t,n){return P_(e,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:n},t)},TB=function(e,t){return SB(e,t,[])},OB=function(e,t){return SB(e,t,[Hw.config({})])},EB=function(e,t,n){return{dom:{tag:"span",innerHtml:n.translate(e),classes:[t+"__select-label"]},behaviours:mf([Hw.config({})])}},AB=ou("toolbar.button.execute"),DB=function(e){return Wc((function(t,n){gS(e,t)((function(n){xc(t,AB,{buttonApi:n}),e.onAction(n)}))}))},MB=(kA={},kA[tc()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],kA),NB=ou("update-menu-text"),RB=ou("update-menu-icon"),BB=function(e,t,n){var r=oa(h),o=e.text.map((function(e){return C_(EB(e,t,n.providers))})),i=e.icon.map((function(e){return C_(OB(e,n.providers.icons))})),a=function(e,t){var n=eh.getValue(e);return Yw.focus(n),xc(n,"keydown",{raw:t.event.raw}),LA.close(n),P.some(!0)},c=e.role.fold((function(){return{}}),(function(e){return{role:e}})),u=e.tooltip.fold((function(){return{}}),(function(e){var t=n.providers.translate(e);return{title:t,"aria-label":t}})),s=P_("chevron-down",{tag:"div",classes:[t+"__select-chevron"]},n.providers.icons),l=C_(LA.sketch(E(E(E({},e.uid?{uid:e.uid}:{}),c),{dom:{tag:"button",classes:[t,t+"--select"].concat($(e.classes,(function(e){return t+"--"+e}))),attributes:E({},u)},components:bS([i.map((function(e){return e.asSpec()})),o.map((function(e){return e.asSpec()})),P.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:mf(D(D([],e.dropdownBehaviours,!0),[mS.button((function(){return e.disabled||n.providers.isDisabled()})),uS(),jA.config({}),Hw.config({}),jw("dropdown-events",[pS(e,r),hS(e,r)]),jw("menubutton-update-display-text",[Mc(NB,(function(e,t){o.bind((function(t){return t.getOpt(e)})).each((function(e){Hw.set(e,[xs(n.providers.translate(t.event.text))])}))})),Mc(RB,(function(e,t){i.bind((function(t){return t.getOpt(e)})).each((function(e){Hw.set(e,[OB(t.event.icon,n.providers.icons)])}))}))])],!1)),eventOrder:_o(MB,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:mf([Ew.config({mode:"special",onLeft:a,onRight:a})]),lazySink:n.getSink,toggleClass:t+"--active",parts:{menu:hC(!1,e.columns,e.presets)},fetch:function(t){return eA.nu(x(e.fetch,t))}})));return l.asSpec()},PB=function(e){return i(e)},LB=function(e){return"separator"===e.type},IB=function(e){return Te(e,"getSubmenuItems")},HB={type:"separator"},FB=function(e,t){var n=Q(e,(function(e,n){return PB(n)?""===n?e:"|"===n?e.length>0&&!LB(e[e.length-1])?e.concat([HB]):e:Te(t,n.toLowerCase())?e.concat([t[n.toLowerCase()]]):e:e.concat([n])}),[]);return n.length>0&&LB(n[n.length-1])&&n.pop(),n},jB=function(e,t){var n=e.getSubmenuItems(),r=qB(n,t),o=_o(r.menus,ma(e.value,r.items)),i=_o(r.expansions,ma(e.value,e.value));return{item:e,menus:o,expansions:i}},VB=function(e,t){return IB(e)?jB(e,t):{item:e,menus:{},expansions:{}}},UB=function(e){if(LB(e))return e;var t=Se(e,"value").getOrThunk((function(){return ou("generated-menu-item")}));return _o({value:t},e)},qB=function(e,t){var n=FB(i(e)?e.split(" "):e,t);return J(n,(function(e,n){var r=UB(n),o=VB(r,t);return{menus:_o(e.menus,o.menus),items:[o.item].concat(e.items),expansions:_o(e.expansions,o.expansions)}}),{menus:{},expansions:{},items:[]})},WB=function(e,t,n,r){var o=ou("primary-menu"),i=qB(e,n.shared.providers.menuItems());if(0===i.items.length)return P.none();var a=DO(o,i.items,t,n,r),c=ye(i.menus,(function(e,r){return DO(r,e,t,n,!1)})),u=_o(c,ma(o,a));return P.from(Qk.tieredData(o,u,i.expansions))},$B=function(e){return{isDisabled:function(){return Lv.isDisabled(e)},setDisabled:function(t){return Lv.set(e,t)},setActive:function(t){var n=e.element;t?(is(n,"tox-tbtn--enabled"),Fn(n,"aria-pressed",!0)):(cs(n,"tox-tbtn--enabled"),Wn(n,"aria-pressed"))},isActive:function(){return us(e.element,"tox-tbtn--enabled")}}},GB=function(e,t,n,r){return BB({text:e.text,icon:e.icon,tooltip:e.tooltip,role:r,fetch:function(t,r){e.fetch((function(e){r(WB(e,Ux.CLOSE_ON_EXECUTE,n,!1))}))},onSetup:e.onSetup,getApi:$B,columns:1,presets:"normal",classes:[],dropdownBehaviours:[bE.config({})]},t,n.shared)},KB=function(e,t,n){var r=function(e){return function(r){var o=!r.isActive();r.setActive(o),e.storage.set(o),n.shared.getSink().each((function(n){t().getOpt(n).each((function(t){xf(t.element),xc(t,AE,{name:e.name,value:e.storage.get()})}))}))}},o=function(e){return function(t){t.setActive(e.storage.get())}};return function(t){t($(e,(function(e){var t=e.text.fold((function(){return{}}),(function(e){return{text:e}}));return E(E({type:e.type,active:!1},t),{onAction:r(e),onSetup:o(e)})})))}},XB=function(e,t,n,r,o,i){void 0===n&&(n=[]);var a=t.fold((function(){return{}}),(function(e){return{action:e}})),c=E({buttonBehaviours:mf([mS.button((function(){return e.disabled||i.isDisabled()})),uS(),bE.config({}),jw("button press",[Dc("click"),Dc("mousedown")])].concat(n)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),u=_o(c,{dom:r});return _o(u,{components:o})},YB=function(e,t,n,r){void 0===r&&(r=[]);var o=e.tooltip.map((function(e){return{"aria-label":n.translate(e),title:n.translate(e)}})).getOr({}),i={tag:"button",classes:["tox-tbtn"],attributes:o},a=e.icon.map((function(e){return TB(e,n.icons)})),c=bS([a]);return XB(e,t,r,i,c,n)},JB=function(e,t,n,r){void 0===r&&(r=[]);var o=YB(e,P.some(t),n,r);return x_.sketch(o)},QB=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=n.translate(e.text),a=e.icon?e.icon.map((function(e){return TB(e,n.icons)})):P.none(),c=a.isSome()?bS([a]):[],u=a.isSome()?{}:{innerHtml:i},s=D(D(D(D([],e.primary||e.borderless?["tox-button"]:["tox-button","tox-button--secondary"],!0),a.isSome()?["tox-button--icon"]:[],!0),e.borderless?["tox-button--naked"]:[],!0),o,!0),l=E(E({tag:"button",classes:s},u),{attributes:{title:i}});return XB(e,t,r,l,c,n)},ZB=function(e,t,n,r,o){void 0===r&&(r=[]),void 0===o&&(o=[]);var i=QB(e,P.some(t),n,r,o);return x_.sketch(i)},eP=function(e,t){return function(n){"custom"===t?xc(n,AE,{name:e,value:{}}):"submit"===t?_c(n,DE):"cancel"===t?_c(n,EE):console.error("Unknown button type: ",t)}},tP=function(e,t){return"menu"===t},nP=function(e,t){return"custom"===t||"cancel"===t||"submit"===t},rP=function(e,t,n){if(tP(e,t)){var r=function(){return a},o=e,i=E(E({},e),{onSetup:function(t){return t.setDisabled(e.disabled),h},fetch:KB(o.items,r,n)}),a=C_(GB(i,"tox-tbtn",n,P.none()));return a.asSpec()}if(nP(e,t)){var c=eP(e.name,t),u=E(E({},e),{borderless:!1});return ZB(u,c,n.shared.providers,[])}console.error("Unknown footer button type: ",t)},oP=function(e,t){var n=eP(e.name,"custom");return _E(P.none(),pE.parts.field(E({factory:x_},QB(e,P.some(n),t,[aR.memory(""),qN.self()]))))},iP=w([Ki("field1Name","field1"),Ki("field2Name","field2"),sl("onLockedChange"),il(["lockClass"]),Ki("locked",!1),oh.field("coupledFieldBehaviours",[yv,eh])]),aP=function(e,t,n){return Kh(e,t,n).bind(yv.getCurrent)},cP=function(e,t){return Nh({factory:pE,name:e,overrides:function(e){return{fieldBehaviours:mf([jw("coupled-input-behaviour",[Mc(Va(),(function(n){aP(n,e,t).each((function(t){Kh(n,e,"lock").each((function(r){pk.isOn(r)&&e.onLockedChange(n,t,r)}))}))}))])])}}})},uP=w([cP("field1","field2"),cP("field2","field1"),Nh({factory:x_,schema:[Ei("dom")],name:"lock",overrides:function(e){return{buttonBehaviours:mf([pk.config({selected:e.locked,toggleClass:e.markers.lockClass,aria:{mode:"pressed"}})])}}})]),sP=function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:oh.augment(e.coupledFieldBehaviours,[yv.config({find:P.some}),eh.config({store:{mode:"manual",getValue:function(t){var n,r=Zh(t,e,["field1","field2"]);return n={},n[e.field1Name]=eh.getValue(r.field1()),n[e.field2Name]=eh.getValue(r.field2()),n},setValue:function(t,n){var r=Zh(t,e,["field1","field2"]);Oe(n,e.field1Name)&&eh.setValue(r.field1(),n[e.field1Name]),Oe(n,e.field2Name)&&eh.setValue(r.field2(),n[e.field2Name])}}})]),apis:{getField1:function(t){return Kh(t,e,"field1")},getField2:function(t){return Kh(t,e,"field2")},getLock:function(t){return Kh(t,e,"lock")}}}},lP=mv({name:"FormCoupledInputs",configFields:iP(),partFields:uP(),factory:sP,apis:{getField1:function(e,t){return e.getField1(t)},getField2:function(e,t){return e.getField2(t)},getLock:function(e,t){return e.getLock(t)}}}),fP=function(e){var t={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},n=function(e){return e in t?t[e]:1},r=e.value.toFixed(n(e.unit));return-1!==r.indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+e.unit},dP=function(e){var t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/,n=t.exec(e);if(null!==n){var r=parseFloat(n[1]),o=n[2];return ro.value({value:r,unit:o})}return ro.error(e)},mP=function(e,t){var n={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},r=function(e){return Te(n,e)};return e.unit===t?P.some(e.value):r(e.unit)&&r(t)?n[e.unit]===n[t]?P.some(e.value):P.some(e.value/n[e.unit]*n[t]):P.none()},gP=function(e){return P.none()},pP=function(e,t){return function(n){return mP(n,t).map((function(n){return{value:n*e,unit:t}}))}},hP=function(e,t){var n=dP(e).toOptional(),r=dP(t).toOptional();return Ne(n,r,(function(e,t){return mP(e,t.unit).map((function(e){return t.value/e})).map((function(e){return pP(e,t.unit)})).getOr(gP)})).getOr(gP)},vP=function(e,t){var n=gP,r=ou("ratio-event"),o=function(e){return P_(e,{tag:"span",classes:["tox-icon","tox-lock-icon__"+e]},t.icons)},i=lP.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(e.label.getOr("Constrain proportions"))}},components:[o("lock"),o("unlock")],buttonBehaviours:mf([Lv.config({disabled:function(){return e.disabled||t.isDisabled()}}),uS(),bE.config({})])}),a=function(e){return{dom:{tag:"div",classes:["tox-form__group"]},components:e}},c=function(n){return pE.parts.field({factory:VE,inputClasses:["tox-textfield"],inputBehaviours:mf([Lv.config({disabled:function(){return e.disabled||t.isDisabled()}}),uS(),bE.config({}),jw("size-input-events",[Mc(Ia(),(function(e,t){xc(e,r,{isField1:n})})),Mc(Ua(),(function(t,n){xc(t,TE,{name:e.name})}))])]),selectOnFocus:!1})},u=function(e){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}}},s=lP.parts.field1(a([pE.parts.label(u("Width")),c(!0)])),l=lP.parts.field2(a([pE.parts.label(u("Height")),c(!1)]));return lP.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[s,l,a([u(" "),i])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(e,t,r){dP(eh.getValue(e)).each((function(e){n(e).each((function(e){eh.setValue(t,fP(e))}))}))},coupledFieldBehaviours:mf([Lv.config({disabled:function(){return e.disabled||t.isDisabled()},onDisabled:function(e){lP.getField1(e).bind(pE.getField).each(Lv.disable),lP.getField2(e).bind(pE.getField).each(Lv.disable),lP.getLock(e).each(Lv.disable)},onEnabled:function(e){lP.getField1(e).bind(pE.getField).each(Lv.enable),lP.getField2(e).bind(pE.getField).each(Lv.enable),lP.getLock(e).each(Lv.enable)}}),uS(),jw("size-input-events2",[Mc(r,(function(e,t){var r=t.event.isField1,o=r?lP.getField1(e):lP.getField2(e),i=r?lP.getField2(e):lP.getField1(e),a=o.map(eh.getValue).getOr(""),c=i.map(eh.getValue).getOr("");n=hP(a,c)}))])])})},yP=w(ou("undo")),bP=w(ou("redo")),wP=w(ou("zoom")),kP=w(ou("back")),_P=w(ou("apply")),xP=w(ou("swap")),CP=w(ou("transform")),zP=w(ou("temp-transform")),SP=w(ou("transform-apply")),TP={undo:yP,redo:bP,zoom:wP,back:kP,apply:_P,swap:xP,transform:CP,tempTransform:zP,transformApply:SP},OP=w("save-state"),EP=w("disable"),AP=w("enable"),DP={formActionEvent:AE,saveState:OP,disable:EP,enable:AP},MP=function(e,t){var n=function(e,n,r,o){return C_(ZB({name:e,text:e,disabled:r,primary:o,icon:P.none(),borderless:!1},n,t))},r=function(e,n,r,o){return C_(JB({name:e,icon:P.some(e),tooltip:P.some(n),disabled:o,primary:!1,borderless:!1},r,t))},o=function(e,t){e.map((function(e){var n=e.get(t);n.hasConfigured(Lv)&&Lv.disable(n)}))},i=function(e,t){e.map((function(e){var n=e.get(t);n.hasConfigured(Lv)&&Lv.enable(n)}))},a={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},c=h,u=function(e,t,n){xc(e,t,n)},s=function(e){return _c(e,DP.disable())},l=function(e){return _c(e,DP.enable())},f=function(e,t){s(e),u(e,TP.transform(),{transform:t}),l(e)},d=function(e,t){s(e),u(e,TP.tempTransform(),{transform:t}),l(e)},m=function(e){return function(){ae.getOpt(e).each((function(e){Hw.set(e,[oe])}))}},g=function(e,t){s(e),u(e,TP.transformApply(),{transform:t,swap:m(e)}),l(e)},p=function(){return n("Back",(function(e){return u(e,TP.back(),{swap:m(e)})}),!1,!1)},v=function(){return C_({dom:{tag:"div",classes:["tox-spacer"]},behaviours:mf([Lv.config({})])})},y=function(){return n("Apply",(function(e){return u(e,TP.apply(),{swap:m(e)})}),!0,!0)},b=function(){return function(t){var n=e.getRect();return xB(t,n.x,n.y,n.w,n.h)}},k=[p(),v(),n("Apply",(function(t){var n=b();g(t,n),e.hideCrop()}),!1,!0)],_=sE.sketch({dom:a,components:k.map((function(e){return e.asSpec()})),containerBehaviours:mf([jw("image-tools-crop-buttons-events",[Mc(DP.disable(),(function(e,t){o(k,e)})),Mc(DP.enable(),(function(e,t){i(k,e)}))])])}),x=C_(vP({name:"size",label:P.none(),constrain:!0,disabled:!1},t)),C=function(e,t){return function(n){return CB(n,e,t)}},z=[p(),v(),x,v(),n("Apply",(function(e){x.getOpt(e).each((function(t){var n=eh.getValue(t),r=parseInt(n.width,10),o=parseInt(n.height,10),i=C(r,o);g(e,i)}))}),!1,!0)],S=sE.sketch({dom:a,components:z.map((function(e){return e.asSpec()})),containerBehaviours:mf([jw("image-tools-resize-buttons-events",[Mc(DP.disable(),(function(e,t){o(z,e)})),Mc(DP.enable(),(function(e,t){i(z,e)}))])])}),T=function(e,t){return function(n){return e(n,t)}},O=T(_B,"h"),E=T(_B,"v"),A=T(zB,-90),D=T(zB,90),M=function(e,t){d(e,t)},N=[p(),v(),r("flip-horizontally","Flip horizontally",(function(e){M(e,O)}),!1),r("flip-vertically","Flip vertically",(function(e){M(e,E)}),!1),r("rotate-left","Rotate counterclockwise",(function(e){M(e,A)}),!1),r("rotate-right","Rotate clockwise",(function(e){M(e,D)}),!1),v(),y()],R=sE.sketch({dom:a,components:N.map((function(e){return e.asSpec()})),containerBehaviours:mf([jw("image-tools-fliprotate-buttons-events",[Mc(DP.disable(),(function(e,t){o(N,e)})),Mc(DP.enable(),(function(e,t){i(N,e)}))])])}),B=function(e,n,r,o,i){var a=_N.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(e)}}),c=_N.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),u=_N.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return C_(_N.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:r,maxX:i,getInitialValue:w({x:o})},components:[a,c,u],sliderBehaviours:mf([Yw.config({})]),onChoose:n}))},L=function(e,t,n,r,o){var i=function(e,n,r){var o=T(t,r.x/100);f(e,o)};return B(e,i,n,r,o)},I=function(e,t,n,r,o){return[p(),L(e,t,n,r,o),y()]},H=function(e,t,n,r,c){var u=I(e,t,n,r,c);return sE.sketch({dom:a,components:u.map((function(e){return e.asSpec()})),containerBehaviours:mf([jw("image-tools-filter-panel-buttons-events",[Mc(DP.disable(),(function(e,t){o(u,e)})),Mc(DP.enable(),(function(e,t){i(u,e)}))])])})},F=[p(),v(),y()],j=sE.sketch({dom:a,components:F.map((function(e){return e.asSpec()}))}),V=H("Brightness",wB,-100,0,100),U=H("Contrast",kB,-100,0,100),q=H("Gamma",yB,-100,0,100),W=function(e,t,n){return function(r){return bB(r,e,t,n)}},$=function(e){var t=function(e,t,n){var r=G.getOpt(e),o=X.getOpt(e),i=K.getOpt(e);r.each((function(t){o.each((function(n){i.each((function(r){var o=eh.getValue(t).x/100,i=eh.getValue(r).x/100,a=eh.getValue(n).x/100,c=W(o,i,a);f(e,c)}))}))}))};return B(e,t,0,100,200)},G=$("R"),K=$("G"),X=$("B"),Y=[p(),G,K,X,y()],J=sE.sketch({dom:a,components:Y.map((function(e){return e.asSpec()}))}),Q=function(e,t,n){return function(r){var o=function(){ae.getOpt(r).each((function(t){Hw.set(t,[e]),n(t)}))};u(r,TP.swap(),{transform:t,swap:o})}},Z=function(t){e.showCrop()},ee=function(t){x.getOpt(t).each((function(t){var n=e.getMeasurements(),r=n.width,o=n.height;eh.setValue(t,{width:r,height:o})}))},te=P.some(vB),ne=P.some(hB),re=[r("crop","Crop",Q(_,P.none(),Z),!1),r("resize","Resize",Q(S,P.none(),ee),!1),r("orientation","Orientation",Q(R,P.none(),c),!1),r("brightness","Brightness",Q(V,P.none(),c),!1),r("sharpen","Sharpen",Q(j,te,c),!1),r("contrast","Contrast",Q(U,P.none(),c),!1),r("color-levels","Color levels",Q(J,P.none(),c),!1),r("gamma","Gamma",Q(q,P.none(),c),!1),r("invert","Invert",Q(j,ne,c),!1)],oe=sE.sketch({dom:a,components:re.map((function(e){return e.asSpec()}))}),ie=sE.sketch({dom:{tag:"div"},components:[oe],containerBehaviours:mf([Hw.config({})])}),ae=C_(ie),ce=function(e){return ae.getOpt(e).map((function(e){var t=e.components()[0];return t.components()[t.components().length-1]}))};return{memContainer:ae,getApplyButton:ce}},NP=tinymce.util.Tools.resolve("tinymce.geom.Rect"),RP=tinymce.util.Tools.resolve("tinymce.util.Observable"),BP=tinymce.util.Tools.resolve("tinymce.util.VK"),PP=function(e){var t=Math.max,n=e.documentElement,r=e.body,o=t(n.scrollWidth,r.scrollWidth),i=t(n.clientWidth,r.clientWidth),a=t(n.offsetWidth,r.offsetWidth),c=t(n.scrollHeight,r.scrollHeight),u=t(n.clientHeight,r.clientHeight),s=t(n.offsetHeight,r.offsetHeight);return{width:o=1?n.set(1):n.set(c)}))},u=function(e,t){var n=tt.fromTag("img");return Fn(n,"src",t),UP(n.dom).then((function(){e.getSystem().isConnected()&&g.getOpt(e).map((function(e){var t=Cs({element:n});Hw.replaceAt(e,1,P.some(t));var r=i.get(),u={x:0,y:0,w:n.dom.naturalWidth,h:n.dom.naturalHeight};i.set(u);var s=NP.inflate(u,-20,-20);o.set(s),r.w===u.w&&r.h===u.h||c(e,n),a(e,n)}))}))},s=function(e,t){var r=n.get(),o=t>0?Math.min(2,r+.1):Math.max(.1,r-.1);n.set(o),g.getOpt(e).each((function(e){var t=e.components()[1].element;a(e,t)}))},l=function(){r.run((function(e){e.toggleVisibility(!0)}))},f=function(){r.run((function(e){e.toggleVisibility(!1)}))},d=function(){return o.get()},m=sE.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[t.asSpec(),{dom:{tag:"img",attributes:{src:e}}},{dom:{tag:"div"},behaviours:mf([jw("image-panel-crop-events",[Vc((function(e){g.getOpt(e).each((function(e){var t=e.element.dom,i=VP.create({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,h);i.toggleVisibility(!1),i.on("updateRect",(function(e){var t=e.rect,r=n.get(),i={x:Math.round(t.x/r),y:Math.round(t.y/r),w:Math.round(t.w/r),h:Math.round(t.h/r)};o.set(i)})),r.set(i)}))})),Uc((function(){r.clear()}))])])}],containerBehaviours:mf([Hw.config({}),jw("image-panel-events",[Vc((function(t){u(t,e)}))])])}),g=C_(m),p=function(){var e=i.get();return{width:e.w,height:e.h}};return{memContainer:g,updateSrc:u,zoom:s,showCrop:l,hideCrop:f,getRect:d,getMeasurements:p}},WP=function(e,t,n,r,o){return JB({name:e,icon:P.some(t),disabled:n,tooltip:P.some(e),primary:!1,borderless:!1},r,o)},$P=function(e,t){t?Lv.enable(e):Lv.disable(e)},GP=function(e){var t=function(e,t,o){n.getOpt(e).each((function(e){$P(e,t)})),r.getOpt(e).each((function(e){$P(e,o)}))},n=C_(WP("Undo","undo",!0,(function(e){xc(e,TP.undo(),{direction:1})}),e)),r=C_(WP("Redo","redo",!0,(function(e){xc(e,TP.redo(),{direction:1})}),e)),o=sE.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[n.asSpec(),r.asSpec(),WP("Zoom in","zoom-in",!1,(function(e){xc(e,TP.zoom(),{direction:1})}),e),WP("Zoom out","zoom-out",!1,(function(e){xc(e,TP.zoom(),{direction:-1})}),e)]});return{container:o,updateButtonUndoStates:t}};function KP(){var e=[],t=-1,n=function(n){var r=e.splice(++t);return e.push(n),{state:n,removed:r}},r=function(){if(i())return e[--t]},o=function(){if(a())return e[++t]},i=function(){return t>0},a=function(){return-1!==t&&t1?P.none():P.some(P_("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},t.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:ne([[o],i.toArray()])};return pE.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ne([r.toArray(),[a]]),fieldBehaviours:mf([Lv.config({disabled:function(){return e.disabled||t.isDisabled()},onDisabled:function(e){pE.getField(e).each(Lv.disable)},onEnabled:function(e){pE.getField(e).each(Lv.enable)}}),uS()])})},uL=function(e,t){var n=function(e){return{dom:{tag:"th",innerHtml:t.translate(e)}}},r=function(e){return{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:$(e,n)}]}},o=function(e){return{dom:{tag:"td",innerHtml:t.translate(e)}}},i=function(e){return{dom:{tag:"tr"},components:$(e,o)}},a=function(e){return{dom:{tag:"tbody"},components:$(e,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[r(e.header),a(e.cells)],behaviours:mf([bE.config({}),Yw.config({})])}},sL=function(e,t){var n=e.label.map((function(e){return SE(e,t)})),r=[Lv.config({disabled:function(){return e.disabled||t.isDisabled()}}),uS(),Ew.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(e){return _c(e,DE),P.some(!0)}}),jw("textfield-change",[Mc(Va(),(function(t,n){xc(t,TE,{name:e.name})})),Mc(Za(),(function(t,n){xc(t,TE,{name:e.name})}))]),bE.config({})],o=e.validation.map((function(e){return dA.config({getRoot:function(e){return vn(e.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var n=eh.getValue(t),r=e.validator(n);return eA.pure(!0===r?ro.value(n):ro.error(r))},validateOnLoad:e.validateOnLoad}})})).toArray(),i=e.placeholder.fold(w({}),(function(e){return{placeholder:t.translate(e)}})),a=e.inputMode.fold(w({}),(function(e){return{inputmode:e}})),c=E(E({},i),a),u=pE.parts.field({tag:!0===e.multiline?"textarea":"input",inputAttributes:c,inputClasses:[e.classname],inputBehaviours:mf(ne([r,o])),selectOnFocus:!1,factory:VE}),s=e.flex?["tox-form__group--stretched"]:[],l=s.concat(e.maximized?["tox-form-group--maximize"]:[]),f=[Lv.config({disabled:function(){return e.disabled||t.isDisabled()},onDisabled:function(e){pE.getField(e).each(Lv.disable)},onEnabled:function(e){pE.getField(e).each(Lv.enable)}}),uS()];return kE(n,u,l,f)},lL=function(e,t){return sL({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:P.none(),maximized:e.maximized},t)},fL=function(e,t){return sL({name:e.name,multiline:!0,label:e.label,inputMode:P.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:P.none(),maximized:e.maximized},t)},dL=function(e,t){var n=e.stream.streams,r=n.setup(e,t);return Oc([Mc(e.event,r),Uc((function(){return t.cancel()}))].concat(e.cancelEvent.map((function(e){return[Mc(e,(function(){return t.cancel()}))]})).getOr([])))},mL=Object.freeze({__proto__:null,events:dL}),gL=function(e){var t=oa(null),n=function(){return{timer:null!==t.get()?"set":"unset"}},r=function(e){t.set(e)},o=function(){var e=t.get();null!==e&&e.cancel()};return zu({readState:n,setTimer:r,cancel:o})},pL=function(e){return e.stream.streams.state(e)},hL=Object.freeze({__proto__:null,throttle:gL,init:pL}),vL=function(e,t){var n=e.stream,r=q_(e.onStream,n.delay);return t.setTimer(r),function(e,t){r.throttle(e,t),n.stopEvent&&t.stop()}},yL=[Ai("stream",Ci("mode",{throttle:[Ei("delay"),Ki("stopEvent",!0),fl("streams",{setup:vL,state:gL})]})),Ki("event","input"),Fi("cancelEvent"),sl("onStream")],bL=pf({fields:yL,name:"streaming",active:mL,state:hL}),wL=function(e,t,n){var r=eh.getValue(n);eh.setValue(t,r),_L(t)},kL=function(e,t){var n=e.element,r=ds(n),o=n.dom;"number"!==Vn(n,"type")&&t(o,r)},_L=function(e){kL(e,(function(e,t){return e.setSelectionRange(t.length,t.length)}))},xL=function(e,t){kL(e,(function(e,n){return e.setSelectionRange(t,n.length)}))},CL=function(e,t,n){if(e.selectsOver){var r=eh.getValue(t),o=e.getDisplayText(r),i=eh.getValue(n),a=e.getDisplayText(i);return 0===a.indexOf(o)?P.some((function(){wL(e,t,n),xL(t,o.length)})):P.none()}return P.none()},zL=w("alloy.typeahead.itemexecute"),SL=function(e,t,n,r){var o=function(t,n,o){e.previewing.set(!1);var i=yA.getCoupled(t,"sandbox");if(yp.isOpen(i))yv.getCurrent(i).each((function(e){ry.getHighlighted(e).fold((function(){o(e)}),(function(){Tc(i,e.element,"keydown",n)}))}));else{var c=function(e){yv.getCurrent(e).each(o)};zA(e,a(t),t,i,r,c,WE.HighlightFirst).get(h)}},i=IE(e),a=function(e){return function(t){return t.map((function(t){var n=ze(t.menus),r=re(n,(function(e){return Y(e.items,(function(e){return"item"===e.type}))})),o=eh.getState(e);return o.update($(r,(function(e){return e.data}))),t}))}},c=[Yw.config({}),eh.config({onSetValue:e.onSetValue,store:E({mode:"dataset",getDataKey:function(e){return ds(e.element)},getFallbackEntry:function(e){return{value:e,meta:{}}},setValue:function(t,n){ms(t.element,e.model.getDisplayText(n))}},e.initialData.map((function(e){return ma("initialValue",e)})).getOr({}))}),bL.config({stream:{mode:"throttle",delay:e.responseTime,stopEvent:!1},onStream:function(t,n){var o=yA.getCoupled(t,"sandbox"),i=Yw.isFocused(t);if(i&&ds(t.element).length>=e.minChars){var c=yv.getCurrent(o).bind((function(e){return ry.getHighlighted(e).map(eh.getValue)}));e.previewing.set(!0);var u=function(t){yv.getCurrent(o).each((function(t){c.fold((function(){e.model.selectsOver&&ry.highlightFirst(t)}),(function(e){ry.highlightBy(t,(function(t){var n=eh.getValue(t);return n.value===e.value})),ry.getHighlighted(t).orThunk((function(){return ry.highlightFirst(t),P.none()}))}))}))};zA(e,a(t),t,o,r,u,WE.HighlightFirst).get(h)}},cancelEvent:ac()}),Ew.config({mode:"special",onDown:function(e,t){return o(e,t,ry.highlightFirst),P.some(!0)},onEscape:function(e){var t=yA.getCoupled(e,"sandbox");return yp.isOpen(t)?(yp.close(t),P.some(!0)):P.none()},onUp:function(e,t){return o(e,t,ry.highlightLast),P.some(!0)},onEnter:function(t){var n=yA.getCoupled(t,"sandbox"),r=yp.isOpen(n);if(r&&!e.previewing.get())return yv.getCurrent(n).bind((function(e){return ry.getHighlighted(e)})).map((function(e){return xc(t,zL(),{item:e}),!0}));var o=eh.getValue(t);return _c(t,ac()),e.onExecute(n,t,o),r&&yp.close(n),P.some(!0)}}),pk.config({toggleClass:e.markers.openClass,aria:{mode:"expanded"}}),yA.config({others:{sandbox:function(t){return DA(e,t,{onOpen:function(){return pk.on(t)},onClose:function(){return pk.off(t)}})}}}),jw("typeaheadevents",[Wc((function(t){var n=h;TA(e,a(t),t,r,n,WE.HighlightFirst).get(h)})),Mc(zL(),(function(t,n){var r=yA.getCoupled(t,"sandbox");wL(e.model,t,n.event.item),_c(t,ac()),e.onItemExecute(t,r,n.event.item,eh.getValue(t)),yp.close(r),_L(t)}))].concat(e.dismissOnBlur?[Mc(Qa(),(function(e){var t=yA.getCoupled(e,"sandbox");Tf(t.element).isNone()&&yp.close(t)}))]:[]))];return{uid:e.uid,dom:FE(_o(e,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:E(E({},i),rh(e.typeaheadBehaviours,c)),eventOrder:e.eventOrder}},TL=w([Fi("lazySink"),Ei("fetch"),Ki("minChars",5),Ki("responseTime",1e3),cl("onOpen"),Ki("getHotspot",P.some),Ki("getAnchorOverrides",w({})),Ki("layouts",P.none()),Ki("eventOrder",{}),ra("model",{},[Ki("getDisplayText",(function(e){return void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.value})),Ki("selectsOver",!0),Ki("populateFromBrowse",!0)]),cl("onSetValue"),ul("onExecute"),cl("onItemExecute"),Ki("inputClasses",[]),Ki("inputAttributes",{}),Ki("inputStyles",{}),Ki("matchWidth",!0),Ki("useMinWidth",!1),Ki("dismissOnBlur",!0),il(["openClass"]),Fi("initialData"),th("typeaheadBehaviours",[Yw,eh,bL,Ew,pk,yA]),Ti("previewing",(function(){return oa(!0)}))].concat(LE()).concat(NA())),OL=w([Rh({schema:[ol()],name:"menu",overrides:function(e){return{fakeFocus:!0,onHighlight:function(t,n){e.previewing.get()?t.getSystem().getByUid(e.uid).each((function(r){CL(e.model,r,n).fold((function(){return ry.dehighlight(t,n)}),(function(e){return e()}))})):t.getSystem().getByUid(e.uid).each((function(t){e.model.populateFromBrowse&&wL(e.model,t,n)})),e.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(e.uid).toOptional().map((function(e){return xc(e,zL(),{item:n}),!0}))},onHover:function(t,n){e.previewing.set(!1),t.getSystem().getByUid(e.uid).each((function(t){e.model.populateFromBrowse&&wL(e.model,t,n)}))}}}})]),EL=mv({name:"Typeahead",configFields:TL(),partFields:OL(),factory:SL}),AL=function(e){var t=function(){return AL(e.toCached())},n=function(t){return AL(e.bind((function(e){return e.fold((function(e){return eA.pure(ro.error(e))}),(function(e){return t(e)}))})))},r=function(t){return AL(e.map((function(e){return e.bind(t)})))},o=function(t){return AL(e.map((function(e){return e.map(t)})))},i=function(t){return AL(e.map((function(e){return e.mapError(t)})))},a=function(t,n){return e.map((function(e){return e.fold(t,n)}))},c=function(t,n){return AL(eA.nu((function(r){var o=!1,i=setTimeout((function(){o=!0,r(ro.error(n()))}),t);e.get((function(e){o||(clearTimeout(i),r(e))}))})))};return E(E({},e),{toCached:t,bindFuture:n,bindResult:r,mapResult:o,mapError:i,foldResult:a,withTimeout:c})},DL=function(e){return AL(eA.nu(e))},ML=function(e){return AL(eA.pure(ro.value(e)))},NL=function(e){return AL(eA.pure(ro.error(e)))},RL=function(e){return AL(eA.pure(e))},BL=function(e){return AL(e.map(ro.value))},PL=function(e){return DL((function(t){e.then((function(e){t(ro.value(e))}),(function(e){t(ro.error(e))}))}))},LL={nu:DL,wrap:AL,pure:ML,value:ML,error:NL,fromResult:RL,fromFuture:BL,fromPromise:PL},IL={type:"separator"},HL=function(e){return{type:"menuitem",value:e.url,text:e.title,meta:{attach:e.attach},onAction:h}},FL=function(e,t){return{type:"menuitem",value:t,text:e,meta:{attach:void 0},onAction:h}},jL=function(e){return $(e,HL)},VL=function(e,t){return Y(t,(function(t){return t.type===e}))},UL=function(e,t){return jL(VL(e,t))},qL=function(e){return UL("header",e.targets)},WL=function(e){return UL("anchor",e.targets)},$L=function(e){return P.from(e.anchorTop).map((function(e){return FL("",e)})).toArray()},GL=function(e){return P.from(e.anchorBottom).map((function(e){return FL("",e)})).toArray()},KL=function(e){return $(e,(function(e){return FL(e,e)}))},XL=function(e){return Q(e,(function(e,t){var n=0===e.length||0===t.length;return n?e.concat(t):e.concat(IL,t)}),[])},YL=function(e,t){var n=e.toLowerCase();return Y(t,(function(e){var t=void 0!==e.meta&&void 0!==e.meta.text?e.meta.text:e.text;return Ve(t.toLowerCase(),n)||Ve(e.value.toLowerCase(),n)}))},JL=function(e,t,n){var r=eh.getValue(t),o=void 0!==r.meta.text?r.meta.text:r.value,i=n.getLinkInformation();return i.fold((function(){return[]}),(function(t){var r=YL(o,KL(n.getHistory(e)));return"file"===e?XL([r,YL(o,qL(t)),YL(o,ne([$L(t),WL(t),GL(t)]))]):r}))},QL=ou("aria-invalid"),ZL=function(e,t,n){var r,o=t.shared.providers,i=function(t){var r=eh.getValue(t);n.addToHistory(r.value,e.filetype)},a=pE.parts.field({factory:EL,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":QL,type:"url"},minChars:0,responseTime:0,fetch:function(r){var o=JL(e.filetype,r,n),i=WB(o,Ux.BUBBLE_TO_SANDBOX,t,!1);return eA.pure(i)},getHotspot:function(e){return m.getOpt(e)},onSetValue:function(e,t){e.hasConfigured(dA)&&dA.run(e).get(h)},typeaheadBehaviours:mf(ne([n.getValidationHandler().map((function(t){return dA.config({getRoot:function(e){return vn(e.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(e,t){s.getOpt(e).each((function(e){Fn(e.element,"title",o.translate(t))}))}},validator:{validate:function(n){var r=eh.getValue(n);return LL.nu((function(n){t({type:e.filetype,url:r.value},(function(e){if("invalid"===e.status){var t=ro.error(e.message);n(t)}else{var r=ro.value(e.message);n(r)}}))}))},validateOnLoad:!1}})})).toArray(),[Lv.config({disabled:function(){return e.disabled||o.isDisabled()}}),bE.config({}),jw("urlinput-events",ne(["file"===e.filetype?[Mc(Va(),(function(t){xc(t,TE,{name:e.name})}))]:[],[Mc(Ua(),(function(t){xc(t,TE,{name:e.name}),i(t)})),Mc(Za(),(function(t){xc(t,TE,{name:e.name}),i(t)}))]]))]])),eventOrder:(r={},r[Va()]=["streaming","urlinput-events","invalidating"],r),model:{getDisplayText:function(e){return e.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:t.shared.getSink,parts:{menu:hC(!1,1,"normal")},onExecute:function(e,t,n){xc(t,DE,{})},onItemExecute:function(t,n,r,o){i(t),xc(t,TE,{name:e.name})}}),c=e.label.map((function(e){return SE(e,o)})),u=function(e,t,n,r){return void 0===n&&(n=e),void 0===r&&(r=e),P_(n,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+e],attributes:E({title:o.translate(r),"aria-live":"polite"},t.fold((function(){return{}}),(function(e){return{id:e}})))},o.icons)},s=C_(u("invalid",P.some(QL),"warning")),l=C_({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),f=n.getUrlPicker(e.filetype),d=ou("browser.url.event"),m=C_({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:mf([Lv.config({disabled:function(){return e.disabled||o.isDisabled()}})])}),g=C_(ZB({name:e.name,icon:P.some("browse"),text:e.label.getOr(""),disabled:e.disabled,primary:!1,borderless:!0},(function(e){return _c(e,d)}),o,[],["tox-browse-url"])),p=function(){return{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:ne([[m.asSpec()],f.map((function(){return g.asSpec()})).toArray()])}},v=function(t){yv.getCurrent(t).each((function(n){var r=eh.getValue(n),o=E({fieldname:e.name},r);f.each((function(r){r(o).get((function(r){eh.setValue(n,r),xc(t,TE,{name:e.name})}))}))}))};return pE.sketch({dom:CE(),components:c.toArray().concat([p()]),fieldBehaviours:mf([Lv.config({disabled:function(){return e.disabled||o.isDisabled()},onDisabled:function(e){pE.getField(e).each(Lv.disable),g.getOpt(e).each(Lv.disable)},onEnabled:function(e){pE.getField(e).each(Lv.enable),g.getOpt(e).each(Lv.enable)}}),uS(),jw("url-input-events",[Mc(d,v)])])})},eI=function(e,t){return sE.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:[x_.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:D_(e.icon,t.icons),attributes:{title:t.translate(e.iconTooltip)}},action:function(t){xc(t,AE,{name:"alert-banner",value:e.url})},buttonBehaviours:mf([R_()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:t.translate(e.text)}}]})},tI=function(e,t){var n=eh.config({store:{mode:"manual",getValue:function(e){var t=e.element.dom;return t.checked},setValue:function(e,t){var n=e.element.dom;n.checked=t}}}),r=function(e){return e.element.dom.click(),P.some(!0)},o=pE.parts.field({factory:{sketch:k},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:mf([qN.self(),Lv.config({disabled:function(){return e.disabled||t.isDisabled()}}),bE.config({}),Yw.config({}),n,Ew.config({mode:"special",onEnter:r,onSpace:r,stopSpaceKeyup:!0}),jw("checkbox-events",[Mc(Ua(),(function(t,n){xc(t,TE,{name:e.name})}))])])}),i=pE.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:t.translate(e.label)},behaviours:mf([jA.config({})])}),a=function(e){var n="checked"===e?"selected":"unselected";return P_(n,{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+e]},t.icons)},c=C_({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[a("checked"),a("unchecked")]});return pE.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[o,c.asSpec(),i],fieldBehaviours:mf([Lv.config({disabled:function(){return e.disabled||t.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(e){pE.getField(e).each(Lv.disable)},onEnabled:function(e){pE.getField(e).each(Lv.enable)}}),uS()])})},nI=function(e){return"presentation"===e.presets?sE.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html}}):sE.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:e.html,attributes:{role:"document"}},containerBehaviours:mf([bE.config({}),Yw.config({})])})},rI=function(e){return function(t,n,r){return Se(n,"name").fold((function(){return e(n,r)}),(function(o){return t.field(o,e(n,r))}))}},oI=function(e){return function(t,n,r){var o=_o(n,{source:"dynamic"});return rI(e)(t,o,r)}},iI={bar:rI((function(e,t){return fE(e,t.shared)})),collection:rI((function(e,t){return PE(e,t.shared.providers)})),alertbanner:rI((function(e,t){return eI(e,t.shared.providers)})),input:rI((function(e,t){return lL(e,t.shared.providers)})),textarea:rI((function(e,t){return fL(e,t.shared.providers)})),label:rI((function(e,t){return QP(e,t.shared)})),iframe:oI((function(e,t){return wR(e,t.shared.providers)})),button:rI((function(e,t){return oP(e,t.shared.providers)})),checkbox:rI((function(e,t){return tI(e,t.shared.providers)})),colorinput:rI((function(e,t){return $A(e,t.shared,t.colorinput)})),colorpicker:rI(KN),dropzone:rI((function(e,t){return sR(e,t.shared.providers)})),grid:rI((function(e,t){return lR(e,t.shared)})),listbox:rI((function(e,t){return rL(e,t)})),selectbox:rI((function(e,t){return cL(e,t.shared.providers)})),sizeinput:rI((function(e,t){return vP(e,t.shared.providers)})),urlinput:rI((function(e,t){return ZL(e,t,t.urlinput)})),customeditor:rI(JN),htmlpanel:rI(nI),imagetools:rI((function(e,t){return JP(e,t.shared.providers)})),table:rI((function(e,t){return uL(e,t.shared.providers)})),panel:rI((function(e,t){return oL(e,t)}))},aI={field:function(e,t){return t}},cI=function(e,t,n){var r=_o(n,{shared:{interpreter:function(t){return uI(e,t,r)}}});return uI(e,t,r)},uI=function(e,t,n){return Se(iI,t.type).fold((function(){return console.error('Unknown factory type "'+t.type+'", defaulting to container: ',t),t}),(function(r){return r(e,t,n)}))},sI=function(e,t){var n=aI;return uI(n,e,t)},lI={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},fI=function(e,t,n){var r=12,o={maxHeightFunction:Td()},i=function(){return{type:"node",root:An(e()),node:P.from(e()),bubble:Md(r,r,lI),layouts:{onRtl:function(){return[d_]},onLtr:function(){return[f_]}},overrides:o}},a=function(){return{type:"hotspot",hotspot:t(),bubble:Md(-r,r,lI),layouts:{onRtl:function(){return[jl]},onLtr:function(){return[Vl]}},overrides:o}};return function(){return n()?i():a()}},dI=function(e,t,n){var r=function(){return{type:"node",root:An(e()),node:P.from(e()),layouts:{onRtl:function(){return[m_]},onLtr:function(){return[m_]}}}},o=function(){return{type:"hotspot",hotspot:t(),layouts:{onRtl:function(){return[$l]},onLtr:function(){return[$l]}}}};return function(){return n()?r():o()}},mI=function(e,t){return function(){return{type:"selection",root:t(),getSelection:function(){var t=e.selection.getRng();return P.some(Cm.range(tt.fromDom(t.startContainer),t.startOffset,tt.fromDom(t.endContainer),t.endOffset))}}}},gI=function(e){return function(t){return{type:"node",root:e(),node:t}}},pI=function(e,t,n){var r=Vz(e),o=function(){return tt.fromDom(e.getBody())},i=function(){return tt.fromDom(e.getContentAreaContainer())},a=function(){return r||!n()};return{inlineDialog:fI(i,t,a),banner:dI(i,t,a),cursor:mI(e,o),node:gI(o)}},hI=function(e){return function(t,n){var r=eO(e);r(t,n)}},vI=function(e){return function(){return BT(e)}},yI=function(e){return function(){return LT(e)}},bI=function(e){return function(){return $T(e)}},wI=function(e){return{colorPicker:hI(e),hasCustomColors:vI(e),getColors:yI(e),getColorCols:bI(e)}},kI=function(e){return function(){return Gz(e)}},_I=function(e){return{isDraggableModal:kI(e)}},xI=function(e){var t=oa(Lz(e)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===t.get()},getDockingMode:t.get,setDockingMode:t.set}},CI=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],zI=function(e){return Te(e,"items")},SI=function(e){return Te(e,"block")},TI=function(e){return Te(e,"inline")},OI=function(e){return Te(e,"selector")},EI=function(e){return Q(e,(function(e,t){if(zI(t)){var n=EI(t.items);return{customFormats:e.customFormats.concat(n.customFormats),formats:e.formats.concat([{title:t.title,items:n.formats}])}}if(TI(t)||SI(t)||OI(t)){var r=i(t.name)?t.name:t.title.toLowerCase(),o="custom-"+r;return{customFormats:e.customFormats.concat([{name:o,format:t}]),formats:e.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return E(E({},e),{formats:e.formats.concat(t)})}),{customFormats:[],formats:[]})},AI=function(e,t){var n=EI(t),r=function(t){G(t,(function(t){e.formatter.has(t.name)||e.formatter.register(t.name,t.format)}))};return e.formatter?r(n.customFormats):e.on("init",(function(){r(n.customFormats)})),n.formats},DI=function(e){return xz(e).map((function(t){var n=AI(e,t);return Cz(e)?CI.concat(n):n})).getOr(CI)},MI=function(e,t,n){var r={type:"formatter",isSelected:t(e.format),getStylePreview:n(e.format)};return _o(e,r)},NI=function(e,t,n,r){var o=function(e){return MI(e,n,r)},a=function(e){var t={type:"submenu"};return _o(e,t)},c=function(t){var o=i(t.name)?t.name:ou(t.title),a="custom-"+o,c={type:"formatter",format:a,isSelected:n(a),getStylePreview:r(a)},u=_o(t,c);return e.formatter.register(o,u),u},u=function(e){return $(e,(function(e){var t=pe(e);if(Oe(e,"items")){var n=u(e.items);return _o(a(e),{getStyleItems:w(n)})}return Oe(e,"format")?o(e):1===t.length&&V(t,"title")?_o(e,{type:"separator"}):c(e)}))};return u(t)},RI=function(e){var t=function(t){return function(){return e.formatter.match(t)}},n=function(t){return function(){var n=e.formatter.get(t);return void 0!==n?P.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):P.none()}},r=function(e){var t=e.items;return void 0!==t&&t.length>0?re(t,r):[e.format]},o=oa([]),i=oa([]),a=oa([]),c=oa([]),u=oa(!1);e.on("PreInit",(function(a){var c=DI(e),u=NI(e,c,t,n);o.set(u),i.set(re(u,r))})),e.on("addStyleModifications",(function(o){var i=NI(e,o.items,t,n);a.set(i),u.set(o.replace),c.set(re(i,r))}));var s=function(){var e=u.get()?[]:o.get(),t=a.get();return e.concat(t)},l=function(){var e=u.get()?[]:i.get(),t=c.get();return e.concat(t)};return{getData:s,getFlattenedKeys:l}},BI=function(e){return d(e)&&1===e.nodeType},PI=QN.trim,LI=function(e){return function(t){if(BI(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},II=LI("true"),HI=LI("false"),FI=function(e,t,n,r,o){return{type:e,title:t,url:n,level:r,attach:o}},jI=function(e){while(e=e.parentNode){var t=e.contentEditable;if(t&&"inherit"!==t)return II(e)}return!1},VI=function(e,t){return $(Xm(tt.fromDom(t),e),(function(e){return e.dom}))},UI=function(e){return e.innerText||e.textContent},qI=function(e){return e.id?e.id:ou("h")},WI=function(e){return e&&"A"===e.nodeName&&void 0!==(e.id||e.name)},$I=function(e){return WI(e)&&KI(e)},GI=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},KI=function(e){return jI(e)&&!HI(e)},XI=function(e){return GI(e)&&KI(e)},YI=function(e){return GI(e)?parseInt(e.nodeName.substr(1),10):0},JI=function(e){var t=qI(e),n=function(){e.id=t};return FI("header",UI(e),"#"+t,YI(e),n)},QI=function(e){var t=e.id||e.name,n=UI(e);return FI("anchor",n||"#"+t,"#"+t,0,h)},ZI=function(e){return $(Y(e,XI),JI)},eH=function(e){return $(Y(e,$I),QI)},tH=function(e){var t=VI("h1,h2,h3,h4,h5,h6,a:not([href])",e);return t},nH=function(e){return PI(e.title).length>0},rH=function(e){var t=tH(e);return Y(ZI(t).concat(eH(t)),nH)},oH={find:rH},iH="tinymce-url-history",aH=5,cH=function(e){return i(e)&&/^https?/.test(e)},uH=function(e){return c(e)&&e.length<=aH&&oe(e,cH)},sH=function(e){return a(e)&&Ce(e,(function(e){return!uH(e)})).isNone()},lH=function(){var e,t=ST.getItem(iH);if(null===t)return{};try{e=JSON.parse(t)}catch(n){if(n instanceof SyntaxError)return console.log("Local storage "+iH+" was not valid JSON",n),{};throw n}return sH(e)?e:(console.log("Local storage "+iH+" was not valid format",e),{})},fH=function(e){if(!sH(e))throw new Error("Bad format for history:\n"+JSON.stringify(e));ST.setItem(iH,JSON.stringify(e))},dH=function(e){var t=lH();return Se(t,e).getOr([])},mH=function(e,t){if(cH(e)){var n=lH(),r=Se(n,t).getOr([]),o=Y(r,(function(t){return t!==e}));n[t]=[e].concat(o).slice(0,aH),fH(n)}},gH=function(e){return!!e},pH=function(e){return ye(QN.makeMap(e,/[, ]/),gH)},hH=function(e){return P.from(Jz(e)).filter(m)},vH=function(e){var t=P.some(Qz(e)).filter(gH),n=P.some(Zz(e)).filter(gH),r=t.or(n).map(pH);return hH(e).fold(S,(function(e){return r.fold(T,(function(e){return pe(e).length>0&&e}))}))},yH=function(e,t){var n=vH(e);return s(n)?n?hH(e):P.none():n[t]?hH(e):P.none()},bH=function(e,t){return yH(e,t).map((function(n){return function(r){return eA.nu((function(o){var c=function(e,t){if(!i(e))throw new Error("Expected value to be string");if(void 0!==t&&!a(t))throw new Error("Expected meta to be a object");var n={value:e,meta:t};o(n)},u=E({filetype:t,fieldname:r.fieldname},P.from(r.meta).getOr({}));n.call(e,c,r.value,u)}))}}))},wH=function(e){return P.from(e).filter(i).getOrUndefined()},kH=function(e){return eS(e)?P.none():P.some({targets:oH.find(e.getBody()),anchorTop:wH(tS(e)),anchorBottom:wH(nS(e))})},_H=function(e){return P.from(rS(e))},xH=function(e){return{getHistory:dH,addToHistory:mH,getLinkInformation:function(){return kH(e)},getValidationHandler:function(){return _H(e)},getUrlPicker:function(t){return bH(e,t)}}},CH=function(e,t,n){var r=oa(!1),o=xI(t),i={shared:{providers:{icons:function(){return t.ui.registry.getAll().icons},menuItems:function(){return t.ui.registry.getAll().menuItems},translate:z_.translate,isDisabled:function(){return t.mode.isReadOnly()||t.ui.isDisabled()},getSetting:t.getParam.bind(t)},interpreter:function(e){return sI(e,i)},anchors:pI(t,n,o.isPositionedAtTop),header:o,getSink:function(){return ro.value(e)}},urlinput:xH(t),styleselect:RI(t),colorinput:wI(t),dialog:_I(t),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(e){return r.set(e)}};return i},zH=function(e,t,n){var r=function(e,r){G([t,n],(function(t){t.broadcastEvent(e,r)}))},o=function(e,r){G([t,n],(function(t){t.broadcastOn([e],r)}))},i=function(e){return o(bp(),{target:e.target})},a=_f(),c=ad(a,"touchstart",i),u=ad(a,"touchmove",(function(e){return r(uc(),e)})),s=ad(a,"touchend",(function(e){return r(sc(),e)})),l=ad(a,"mousedown",i),f=ad(a,"mouseup",(function(e){0===e.raw.button&&o(kp(),{target:e.target})})),d=function(e){return o(bp(),{target:tt.fromDom(e.target)})},m=function(e){0===e.button&&o(kp(),{target:tt.fromDom(e.target)})},g=function(){G(e.editorManager.get(),(function(t){e!==t&&t.fire("DismissPopups",{relatedTarget:e})}))},p=function(e){return r(lc(),ud(e))},h=function(e){o(wp(),{}),r(fc(),ud(e))},v=function(){return o(wp(),{})},y=function(t){t.state&&o(bp(),{target:tt.fromDom(e.getContainer())})},b=function(e){o(bp(),{target:tt.fromDom(e.relatedTarget.getContainer())})};e.on("PostRender",(function(){e.on("click",d),e.on("tap",d),e.on("mouseup",m),e.on("mousedown",g),e.on("ScrollWindow",p),e.on("ResizeWindow",h),e.on("ResizeEditor",v),e.on("AfterProgressState",y),e.on("DismissPopups",b)})),e.on("remove",(function(){e.off("click",d),e.off("tap",d),e.off("mouseup",m),e.off("mousedown",g),e.off("ScrollWindow",p),e.off("ResizeWindow",h),e.off("ResizeEditor",v),e.off("AfterProgressState",y),e.off("DismissPopups",b),l.unbind(),c.unbind(),u.unbind(),s.unbind(),f.unbind()})),e.on("detach",(function(){Qg(t),Qg(n),t.destroy(),n.destroy()}))},SH=nv,TH=Ih,OH=w([Ki("shell",!1),Ei("makeItem"),Ki("setupItem",h),oh.field("listBehaviours",[Hw])]),EH=function(){return{behaviours:mf([Hw.config({})])}},AH=Bh({name:"items",overrides:EH}),DH=w([AH]),MH=w("CustomList"),NH=function(e,t,n,r){var o=function(t,n){a(t).fold((function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")}),(function(r){var o=Hw.contents(r),i=n.length,a=i-o.length,c=a>0?q(a,(function(){return e.makeItem()})):[],u=o.slice(i);G(u,(function(e){return Hw.remove(r,e)})),G(c,(function(e){return Hw.append(r,e)}));var s=Hw.contents(r);G(s,(function(r,o){e.setupItem(t,r,n[o],o)}))}))},i=e.shell?{behaviours:[Hw.config({})],components:[]}:{behaviours:[],components:t},a=function(t){return e.shell?P.some(t):Kh(t,e,"items")};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:rh(e.listBehaviours,i.behaviours),apis:{setItems:o}}},RH=mv({name:MH(),configFields:OH(),partFields:DH(),factory:NH,apis:{setItems:function(e,t,n){e.setItems(t,n)}}}),BH=w([Ei("dom"),Ki("shell",!0),th("toolbarBehaviours",[Hw])]),PH=function(){return{behaviours:mf([Hw.config({})])}},LH=w([Bh({name:"groups",overrides:PH})]),IH=function(e,t,n,r){var o=function(e,t){i(e).fold((function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")}),(function(e){Hw.set(e,t)}))},i=function(t){return e.shell?P.some(t):Kh(t,e,"groups")},a=e.shell?{behaviours:[Hw.config({})],components:[]}:{behaviours:[],components:t};return{uid:e.uid,dom:e.dom,components:a.components,behaviours:rh(e.toolbarBehaviours,a.behaviours),apis:{setGroups:o},domModification:{attributes:{role:"group"}}}},HH=mv({name:"Toolbar",configFields:BH(),partFields:LH(),factory:IH,apis:{setGroups:function(e,t,n){e.setGroups(t,n)}}}),FH=h,jH=S,VH=w([]),UH=Object.freeze({__proto__:null,setup:FH,isDocked:jH,getBehaviours:VH}),qH=function(e){var t=Ee(Zn(e,"position"),"fixed"),n=t?P.none():bn(e);return n.orThunk((function(){var t=tt.fromTag("span");return vn(e).bind((function(e){Ar(e,t);var n=bn(t);return Br(t),n}))}))},WH=function(e){return qH(e).map(mr).getOrThunk((function(){return lr(0,0)}))},$H=aa.generate([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),GH=function(e,t){var n=e.element;is(n,t.transitionClass),cs(n,t.fadeOutClass),is(n,t.fadeInClass),t.onShow(e)},KH=function(e,t){var n=e.element;is(n,t.transitionClass),cs(n,t.fadeInClass),is(n,t.fadeOutClass),t.onHide(e)},XH=function(e,t){return e.yt.y},YH=function(e,t){return e.y>=t.y},JH=function(e,t){return e.bottom<=t.bottom},QH=function(e,t,n){return oe(e,(function(e){switch(e){case"bottom":return JH(t,n);case"top":return YH(t,n)}}))},ZH=function(e,t){return t.getInitialPos().map((function(t){return Yr(t.bounds.x,t.bounds.y,vr(e),ar(e))}))},eF=function(e,t,n){n.setInitialPos({style:er(e),position:Jn(e,"position")||"static",bounds:t})},tF=function(e,t,n){return n.getInitialPos().bind((function(r){switch(n.clearInitialPos(),r.position){case"static":return P.some($H.static());case"absolute":var o=qH(e).map(Jr).getOrThunk((function(){return Jr(Ln())}));return P.some($H.absolute(Ef("absolute",Se(r.style,"left").map((function(e){return t.x-o.x})),Se(r.style,"top").map((function(e){return t.y-o.y})),Se(r.style,"right").map((function(e){return o.right-t.right})),Se(r.style,"bottom").map((function(e){return o.bottom-t.bottom})))));default:return P.none()}}))},nF=function(e,t,n){return ZH(e,n).filter((function(e){return QH(n.getModes(),e,t)})).bind((function(t){return tF(e,t,n)}))},rF=function(e,t,n){var r=Jr(e);if(QH(n.getModes(),r,t))return P.none();eF(e,r,n);var o=Zr(),i=r.x-o.x,a=t.y-o.y,c=o.bottom-t.bottom,u=r.y<=t.y;return P.some($H.fixed(Ef("fixed",P.some(i),u?P.some(a):P.none(),P.none(),u?P.none():P.some(c))))},oF=function(e,t,n){var r=e.element,o=Ee(Zn(r,"position"),"fixed");return o?nF(r,t,n):rF(r,t,n)},iF=function(e,t){var n=e.element;return ZH(n,t).bind((function(e){return tF(n,e,t)}))},aF=function(e,t,n){n.setDocked(!1),G(["left","right","top","bottom","position"],(function(t){return nr(e.element,t)})),t.onUndocked(e)},cF=function(e,t,n,r){var o="fixed"===r.position;n.setDocked(o),Df(e.element,r);var i=o?t.onDocked:t.onUndocked;i(e)},uF=function(e,t,n,r,o){void 0===o&&(o=!1),t.contextual.each((function(t){t.lazyContext(e).each((function(i){var a=XH(i,r);if(a!==n.isVisible())if(n.setVisible(a),o&&!a)ss(e.element,[t.fadeOutClass]),t.onHide(e);else{var c=a?GH:KH;c(e,t)}}))}))},sF=function(e,t,n){var r=t.lazyViewport(e),o=n.isDocked();o&&uF(e,t,n,r),oF(e,r,n).each((function(o){o.fold((function(){return aF(e,t,n)}),(function(r){return cF(e,t,n,r)}),(function(o){uF(e,t,n,r,!0),cF(e,t,n,o)}))}))},lF=function(e,t,n){var r=e.element;n.setDocked(!1),iF(e,n).each((function(r){r.fold((function(){return aF(e,t,n)}),(function(r){return cF(e,t,n,r)}),h)})),n.setVisible(!0),t.contextual.each((function(t){ls(r,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(e)})),fF(e,t,n)},fF=function(e,t,n){e.getSystem().isConnected()&&sF(e,t,n)},dF=function(e,t,n){n.isDocked()&&lF(e,t,n)},mF=function(e,t,n){return n.isDocked()},gF=function(e,t,n,r){return n.setModes(r)},pF=function(e,t,n){return n.getModes()},hF=Object.freeze({__proto__:null,refresh:fF,reset:dF,isDocked:mF,getModes:pF,setModes:gF}),vF=function(e,t){return Oc([jc($a(),(function(n,r){e.contextual.each((function(e){if(us(n.element,e.transitionClass)){ls(n.element,[e.transitionClass,e.fadeInClass]);var o=t.isVisible()?e.onShown:e.onHidden;o(n)}r.stop()}))})),Mc(lc(),(function(n,r){fF(n,e,t)})),Mc(fc(),(function(n,r){dF(n,e,t)}))])},yF=Object.freeze({__proto__:null,events:vF}),bF=[$i("contextual",[Mi("fadeInClass"),Mi("fadeOutClass"),Mi("transitionClass"),Bi("lazyContext"),cl("onShow"),cl("onShown"),cl("onHide"),cl("onHidden")]),ea("lazyViewport",Zr),na("modes",["top","bottom"],si),cl("onDocked"),cl("onUndocked")],wF=function(e){var t=oa(!1),n=oa(!0),r=od(),o=oa(e.modes),i=function(){return"docked: "+t.get()+", visible: "+n.get()+", modes: "+o.get().join(",")};return zu({isDocked:t.get,setDocked:t.set,getInitialPos:r.get,setInitialPos:r.set,clearInitialPos:r.clear,isVisible:n.get,setVisible:n.set,getModes:o.get,setModes:o.set,readState:i})},kF=Object.freeze({__proto__:null,init:wF}),_F=pf({fields:bF,name:"docking",active:yF,apis:hF,state:kF}),xF=w(ou("toolbar-height-change")),CF={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},zF="tox-tinymce--toolbar-sticky-on",SF="tox-tinymce--toolbar-sticky-off",TF=function(e,t){var n=mn(t),r=n.dom.defaultView.innerHeight,o=Lr(n),i=tt.fromDom(e.elm),a=Qr(i),c=ar(i),u=a.y,s=u+c,l=mr(t),f=ar(t),d=l.top,m=d+f,g=Math.abs(d-o.top)<2,p=Math.abs(m-(o.top+r))<2;if(g&&ud){var h=u-r+c+f;Ir(o.left,h,n)}},OF=function(e,t){return V(_F.getModes(e),t)},EF=function(e){var t=function(e){return cr(e)+(parseInt(Jn(e,"margin-top"),10)||0)+(parseInt(Jn(e,"margin-bottom"),10)||0)},n=e.element;vn(n).each((function(r){var o="padding-"+_F.getModes(e)[0];if(_F.isDocked(e)){var i=vr(r);Kn(n,"width",i+"px"),Kn(r,o,t(n)+"px")}else nr(n,"width"),nr(r,o)}))},AF=function(e,t){t?(cs(e,CF.fadeOutClass),ss(e,[CF.transitionClass,CF.fadeInClass])):(cs(e,CF.fadeInClass),ss(e,[CF.fadeOutClass,CF.transitionClass]))},DF=function(e,t){var n=tt.fromDom(e.getContainer());t?(is(n,zF),cs(n,SF)):(is(n,SF),cs(n,zF))},MF=function(e,t){var n=mn(t);Sf(n).filter((function(e){return!sn(t,e)})).filter((function(t){return sn(t,tt.fromDom(n.dom.body))||dn(e,t)})).each((function(){return xf(t)}))},NF=function(e,t){return Tf(e).orThunk((function(){return t().toOptional().bind((function(e){return Tf(e.element)}))}))},RF=function(e,t,n){e.inline||(t.header.isPositionedAtTop()||e.on("ResizeEditor",(function(){n().each(_F.reset)})),e.on("ResizeWindow ResizeEditor",(function(){n().each(EF)})),e.on("SkinLoaded",(function(){n().each((function(e){_F.isDocked(e)?_F.reset(e):_F.refresh(e)}))})),e.on("FullscreenStateChanged",(function(){n().each(_F.reset)}))),e.on("AfterScrollIntoView",(function(e){n().each((function(t){_F.refresh(t);var n=t.element;Jy(n)&&TF(e,n)}))})),e.on("PostRender",(function(){DF(e,!1)}))},BF=function(e){return e().map(_F.isDocked).getOr(!1)},PF=function(){var e;return[bf.config({channels:(e={},e[xF()]={onReceive:EF},e)})]},LF=function(e,t){var n=od(),r=t.getSink,o=function(e){r().each((function(t){return e(t.element)}))},i=function(t){e.inline||EF(t),DF(e,_F.isDocked(t)),t.getSystem().broadcastOn([wp()],{}),r().each((function(e){return e.getSystem().broadcastOn([wp()],{})}))},a=e.inline?[]:PF();return D([Yw.config({}),_F.config({contextual:E({lazyContext:function(t){var n=cr(t.element),r=e.inline?e.getContentAreaContainer():e.getContainer(),o=Jr(tt.fromDom(r)),i=o.height-n,a=o.y+(OF(t,"top")?0:n);return P.some(Yr(o.x,a,o.width,i))},onShow:function(){o((function(e){return AF(e,!0)}))},onShown:function(e){o((function(e){return ls(e,[CF.transitionClass,CF.fadeInClass])})),n.get().each((function(t){MF(e.element,t),n.clear()}))},onHide:function(e){NF(e.element,r).fold(n.clear,n.set),o((function(e){return AF(e,!1)}))},onHidden:function(){o((function(e){return ls(e,[CF.transitionClass])}))}},CF),lazyViewport:function(t){var n=Zr(),r=$z(e),o=n.y+(OF(t,"top")?r:0),i=n.height-(OF(t,"bottom")?r:0);return Yr(n.x,o,n.width,i)},modes:[t.header.getDockingMode()],onDocked:i,onUndocked:i})],a,!0)},IF=Object.freeze({__proto__:null,setup:RF,isDocked:BF,getBehaviours:LF}),HF=function(e){var t=e.editor,n=e.sticky?LF:VH;return{uid:e.uid,dom:e.dom,components:e.components,behaviours:mf(n(t,e.sharedBackstage))}},FF=ei([Mi("type"),Ai("items",ni([ii([Mi("name"),Hi("items",si)]),si]))].concat(Cx)),jF=function(e){return wi("GroupToolbarButton",FF,e)},VF=[Ui("text"),Ui("tooltip"),Ui("icon"),Bi("fetch"),ea("onSetup",(function(){return h}))],UF=ei(D([Mi("type")],VF,!0)),qF=function(e){return wi("menubutton",UF,e)},WF=ei([Mi("type"),Ui("tooltip"),Ui("icon"),Ui("text"),qi("select"),Bi("fetch"),ea("onSetup",(function(){return h})),Qi("presets","normal",["normal","color","listpreview"]),Ki("columns",1),Bi("onAction"),Bi("onItemAction")]),$F=function(e){return wi("SplitButton",WF,e)},GF=function(e,t){var n=function(e,n){var r=$(n,(function(e){var n={type:"menubutton",text:e.text,fetch:function(t){t(e.getItems())}},r=qF(n).mapError((function(e){return xi(e)})).getOrDie();return GB(r,"tox-mbtn",t.backstage,P.some("menuitem"))}));Hw.set(e,r)},r={focus:Ew.focusIn,setMenus:n};return{uid:e.uid,dom:e.dom,components:[],behaviours:mf([Hw.config({}),jw("menubar-events",[Vc((function(t){e.onSetup(t)})),Mc(La(),(function(e,t){Is(e.element,".tox-mbtn--active").each((function(n){Hs(t.event.target,".tox-mbtn").each((function(t){sn(n,t)||e.getSystem().getByDom(n).each((function(n){e.getSystem().getByDom(t).each((function(e){LA.expand(e),LA.close(n),Yw.focus(e)}))}))}))}))})),Mc(hc(),(function(e,t){t.event.prevFocus.bind((function(t){return e.getSystem().getByDom(t).toOptional()})).each((function(n){t.event.newFocus.bind((function(t){return e.getSystem().getByDom(t).toOptional()})).each((function(e){LA.isOpen(n)&&(LA.expand(e),LA.close(n))}))}))}))]),Ew.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return e.onEscape(t),P.some(!0)}}),bE.config({})]),apis:r,domModification:{attributes:{role:"menubar"}}}},KF=dv({factory:GF,name:"silver.Menubar",configFields:[Ei("dom"),Ei("uid"),Ei("onEscape"),Ei("backstage"),Ki("onSetup",h)],apis:{focus:function(e,t){e.focus(t)},setMenus:function(e,t,n){e.setMenus(t,n)}}}),XF=function(e,t){return t.getAnimationRoot.fold((function(){return e.element}),(function(t){return t(e)}))},YF=function(e){return e.dimension.property},JF=function(e,t){return e.dimension.getDimension(t)},QF=function(e,t){var n=XF(e,t);ls(n,[t.shrinkingClass,t.growingClass])},ZF=function(e,t){cs(e.element,t.openClass),is(e.element,t.closedClass),Kn(e.element,YF(t),"0px"),rr(e.element)},ej=function(e,t){cs(e.element,t.closedClass),is(e.element,t.openClass),nr(e.element,YF(t))},tj=function(e,t,n,r){n.setCollapsed(),Kn(e.element,YF(t),JF(t,e.element)),rr(e.element),QF(e,t),ZF(e,t),t.onStartShrink(e),t.onShrunk(e)},nj=function(e,t,n,r){var o=r.getOrThunk((function(){return JF(t,e.element)}));n.setCollapsed(),Kn(e.element,YF(t),o),rr(e.element);var i=XF(e,t);cs(i,t.growingClass),is(i,t.shrinkingClass),ZF(e,t),t.onStartShrink(e)},rj=function(e,t,n){var r=JF(t,e.element),o="0px"===r?tj:nj;o(e,t,n,P.some(r))},oj=function(e,t,n){var r=XF(e,t),o=us(r,t.shrinkingClass),i=JF(t,e.element);ej(e,t);var a=JF(t,e.element),c=function(){Kn(e.element,YF(t),i),rr(e.element)},u=function(){ZF(e,t)},s=o?c:u;s(),cs(r,t.shrinkingClass),is(r,t.growingClass),ej(e,t),Kn(e.element,YF(t),a),n.setExpanded(),t.onStartGrow(e)},ij=function(e,t,n){if(n.isExpanded()){nr(e.element,YF(t));var r=JF(t,e.element);Kn(e.element,YF(t),r)}},aj=function(e,t,n){n.isExpanded()||oj(e,t,n)},cj=function(e,t,n){n.isExpanded()&&rj(e,t,n)},uj=function(e,t,n){n.isExpanded()&&tj(e,t,n)},sj=function(e,t,n){return n.isExpanded()},lj=function(e,t,n){return n.isCollapsed()},fj=function(e,t,n){var r=XF(e,t);return!0===us(r,t.growingClass)},dj=function(e,t,n){var r=XF(e,t);return!0===us(r,t.shrinkingClass)},mj=function(e,t,n){return fj(e,t)||dj(e,t)},gj=function(e,t,n){var r=n.isExpanded()?rj:oj;r(e,t,n)},pj=Object.freeze({__proto__:null,refresh:ij,grow:aj,shrink:cj,immediateShrink:uj,hasGrown:sj,hasShrunk:lj,isGrowing:fj,isShrinking:dj,isTransitioning:mj,toggleGrow:gj,disableTransitions:QF}),hj=function(e,t,n){var r=t.expanded;return Au(r?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:ma(t.dimension.property,"0px")})},vj=function(e,t){return Oc([jc($a(),(function(n,r){var o=r.event.raw;if(o.propertyName===e.dimension.property){QF(n,e),t.isExpanded()&&nr(n.element,e.dimension.property);var i=t.isExpanded()?e.onGrown:e.onShrunk;i(n)}}))])},yj=Object.freeze({__proto__:null,exhibit:hj,events:vj}),bj=[Ei("closedClass"),Ei("openClass"),Ei("shrinkingClass"),Ei("growingClass"),Fi("getAnimationRoot"),cl("onShrunk"),cl("onStartShrink"),cl("onGrown"),cl("onStartGrow"),Ki("expanded",!1),Ai("dimension",Ci("property",{width:[fl("property","width"),fl("getDimension",(function(e){return vr(e)+"px"}))],height:[fl("property","height"),fl("getDimension",(function(e){return ar(e)+"px"}))]}))],wj=function(e){var t=oa(e.expanded),n=function(){return"expanded: "+t.get()};return zu({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:x(t.set,!1),setExpanded:x(t.set,!0),readState:n})},kj=Object.freeze({__proto__:null,init:wj}),_j=pf({fields:bj,name:"sliding",active:yj,apis:pj,state:kj}),xj="container",Cj=[th("slotBehaviours",[])],zj=function(e){return""},Sj=function(e){var t=function(){var e=[],t=function(t,n){return e.push(t),Uh(xj,zj(t),n)};return{slot:t,record:w(e)}}(),n=e(t),r=t.record(),o=$(r,(function(e){return Nh({name:e,pname:zj(e)})}));return av(xj,Cj,o,Tj,n)},Tj=function(e,t){var n=function(t){return Qh(e)},r=function(t,n){return Kh(t,e,n)},o=function(t,n){return function(r,o){return Kh(r,e,o).map((function(e){return t(e,o)})).getOr(n)}},i=function(e){return function(t,n){G(n,(function(n){return e(t,n)}))}},a=function(e,t){return"true"!==Vn(e.element,"aria-hidden")},c=function(e,t){if(!a(e)){var n=e.element;nr(n,"display"),Wn(n,"aria-hidden"),xc(e,vc(),{name:t,visible:!0})}},u=function(e,t){if(a(e)){var n=e.element;Kn(n,"display","none"),Fn(n,"aria-hidden","true"),xc(e,vc(),{name:t,visible:!1})}},s=o(a,!1),l=o(u),f=i(l),d=function(e){return f(e,n())},m=o(c),g={getSlotNames:n,getSlot:r,isShowing:s,hideSlot:l,hideAllSlots:d,showSlot:m};return{uid:e.uid,dom:e.dom,components:t,behaviours:nh(e.slotBehaviours),apis:g}},Oj=ye({getSlotNames:function(e,t){return e.getSlotNames(t)},getSlot:function(e,t,n){return e.getSlot(t,n)},isShowing:function(e,t,n){return e.isShowing(t,n)},hideSlot:function(e,t,n){return e.hideSlot(t,n)},hideAllSlots:function(e,t){return e.hideAllSlots(t)},showSlot:function(e,t,n){return e.showSlot(t,n)}},(function(e){return xu(e)})),Ej=E(E({},Oj),{sketch:Sj}),Aj=ei([Ui("icon"),Ui("tooltip"),ea("onShow",h),ea("onHide",h),ea("onSetup",(function(){return h}))]),Dj=function(e){return wi("sidebar",Aj,e)},Mj=function(e){var t=e.ui.registry.getAll().sidebars;G(pe(t),(function(n){var r=t[n],o=function(){return Ee(P.from(e.queryCommandValue("ToggleSidebar")),n)};e.ui.registry.addToggleButton(n,{icon:r.icon,tooltip:r.tooltip,onAction:function(t){e.execCommand("ToggleSidebar",!1,n),t.setActive(o())},onSetup:function(t){var n=function(){return t.setActive(o())};return e.on("ToggleSidebar",n),function(){e.off("ToggleSidebar",n)}}})}))},Nj=function(e){return{element:function(){return e.element.dom}}},Rj=function(e,t){var n=$(pe(t),(function(e){var n=t[e],r=ki(Dj(n));return{name:e,getApi:Nj,onSetup:r.onSetup,onShow:r.onShow,onHide:r.onHide}}));return $(n,(function(t){var r=oa(h);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:QC.unnamedEvents([pS(t,r),hS(t,r),Mc(vc(),(function(e,t){var r=t.event,o=ee(n,(function(e){return e.name===r.name}));o.each((function(t){var n=r.visible?t.onShow:t.onHide;n(t.getApi(e))}))}))])})}))},Bj=function(e){return Ej.sketch((function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:Rj(t,e),slotBehaviours:QC.unnamedEvents([Vc((function(e){return Ej.hideAllSlots(e)}))])}}))},Pj=function(e,t){var n=yv.getCurrent(e);n.each((function(e){return Hw.set(e,[Bj(t)])}))},Lj=function(e,t){var n=yv.getCurrent(e);n.each((function(e){var n=yv.getCurrent(e);n.each((function(n){_j.hasGrown(e)?Ej.isShowing(n,t)?_j.shrink(e):(Ej.hideAllSlots(n),Ej.showSlot(n,t)):(Ej.hideAllSlots(n),Ej.showSlot(n,t),_j.grow(e))}))}))},Ij=function(e){var t=yv.getCurrent(e);return t.bind((function(e){var t=_j.isGrowing(e)||_j.hasGrown(e);if(t){var n=yv.getCurrent(e);return n.bind((function(e){return ee(Ej.getSlotNames(e),(function(t){return Ej.isShowing(e,t)}))}))}return P.none()}))},Hj=ou("FixSizeEvent"),Fj=ou("AutoSizeEvent"),jj=function(e){return{uid:e.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:mf([bE.config({}),Yw.config({}),_j.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(e){var t=yv.getCurrent(e);t.each(Ej.hideAllSlots),_c(e,Fj)},onGrown:function(e){_c(e,Fj)},onStartGrow:function(e){xc(e,Hj,{width:Zn(e.element,"width").getOr("")})},onStartShrink:function(e){xc(e,Hj,{width:vr(e.element)+"px"})}}),Hw.config({}),yv.config({find:function(e){var t=Hw.contents(e);return fe(t)}})])}],behaviours:mf([qN.childAt(0),jw("sidebar-sliding-events",[Mc(Hj,(function(e,t){Kn(e.element,"width",t.event.width)})),Mc(Fj,(function(e,t){nr(e.element,"width")}))])])}},Vj=function(e,t,n,r){Fn(e.element,"aria-busy",!0);var o=t.getRoot(e).getOr(e),i=mf([Ew.config({mode:"special",onTab:function(){return P.some(!0)},onShiftTab:function(){return P.some(!0)}}),Yw.config({})]),a=r(o,i),c=o.getSystem().build(a);Hw.append(o,Os(c)),c.hasConfigured(Ew)&&t.focus&&Ew.focusIn(c),n.isBlocked()||t.onBlock(e),n.blockWith((function(){return Hw.remove(o,c)}))},Uj=function(e,t,n){Wn(e.element,"aria-busy"),n.isBlocked()&&t.onUnblock(e),n.clear()},qj=Object.freeze({__proto__:null,block:Vj,unblock:Uj}),Wj=[ea("getRoot",P.none),Zi("focus",!0),cl("onBlock"),cl("onUnblock")],$j=function(){var e=td(),t=function(t){e.set({destroy:t})};return zu({readState:e.isSet,blockWith:t,clear:e.clear,isBlocked:e.isSet})},Gj=Object.freeze({__proto__:null,init:$j}),Kj=pf({fields:Wj,name:"blocking",apis:qj,state:Gj}),Xj=function(e){var t=void 0!==e.dom.attributes?e.dom.attributes:[];return Q(t,(function(e,t){var n;return"class"===t.name?e:E(E({},e),(n={},n[t.name]=t.value,n))}),{})},Yj=function(e){return Array.prototype.slice.call(e.dom.classList,0)},Jj=function(e){var t=tt.fromHtml(e),n=kn(t),r=Xj(t),o=Yj(t),i=0===n.length?{}:{innerHtml:Gc(t)};return E({tag:ct(t),classes:o,attributes:r},i)},Qj=function(e){return function(t,n){return{dom:{tag:"div",attributes:{"aria-label":e.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Jj('
')}]}}},Zj=function(e){return yv.getCurrent(e).each((function(e){return xf(e.element)}))},eV=function(e,t){var n="tabindex",r="data-mce-"+n;P.from(e.iframeElement).map(tt.fromDom).each((function(e){t?(Un(e,n).each((function(t){return Fn(e,r,t)})),Fn(e,n,-1)):(Wn(e,n),Un(e,r).each((function(t){Fn(e,n,t),Wn(e,r)})))}))},tV=function(e,t,n,r){var o=t.element;if(eV(e,n),n)Kj.block(t,Qj(r)),nr(o,"display"),Wn(o,"aria-hidden"),e.hasFocus()&&Zj(t);else{var i=yv.getCurrent(t).exists((function(e){return zf(e.element)}));Kj.unblock(t),Kn(o,"display","none"),Fn(o,"aria-hidden","true"),i&&e.focus()}},nV=function(e){return{uid:e.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:mf([Hw.config({}),Kj.config({focus:!1}),yv.config({find:function(e){return fe(e.components())}})]),components:[]}},rV=function(e){return"focusin"===e.type},oV=function(e){if(rV(e)){var t=e.composed?fe(e.composedPath()):P.from(e.target);return t.map(tt.fromDom).filter(lt).exists((function(e){return us(e,"mce-pastebin")}))}return!1},iV=function(e,t,n){var r=oa(!1),o=od(),i=function(n){r.get()&&!oV(n)&&(n.preventDefault(),Zj(t()),e.editorManager.setActive(e))};e.inline||e.on("PreInit",(function(){e.dom.bind(e.getWin(),"focusin",i),e.on("BeforeExecCommand",(function(e){"mcefocus"===e.command.toLowerCase()&&!0!==e.value&&i(e)}))}));var a=function(o){o!==r.get()&&(r.set(o),tV(e,t(),o,n.providers),e.fire("AfterProgressState",{state:o}))};e.on("ProgressState",(function(t){if(o.on(k_.clearTimeout),g(t.time)){var n=k_.setEditorTimeout(e,(function(){return a(t.state)}),t.time);o.set(n)}else a(t.state),o.clear()}))},aV=function(e,t){var n={len:0,list:[]},r=Q(e,(function(e,n){var r=t(n,e.len);return r.fold(w(e),(function(t){return{len:t.finish,list:e.list.concat([t])}}))}),n);return r.list},cV=function(e,t,n){return{within:e,extra:t,withinWidth:n}},uV=function(e,t,n){var r=aV(e,(function(e,t){var r=n(e);return P.some({element:e,start:t,finish:t+r,width:r})})),o=Y(r,(function(e){return e.finish<=t})),i=J(o,(function(e,t){return e+t.width}),0),a=r.slice(o.length);return{within:o,extra:a,withinWidth:i}},sV=function(e){return $(e,(function(e){return e.element}))},lV=function(e,t,n){var r=sV(e.concat(t));return cV(r,[],n)},fV=function(e,t,n,r){var o=sV(e).concat([n]);return cV(o,sV(t),r)},dV=function(e,t,n){return cV(sV(e),[],n)},mV=function(e,t,n){var r=uV(t,e,n);return 0===r.extra.length?P.some(r):P.none()},gV=function(e,t,n,r){var o=mV(e,t,n).getOrThunk((function(){return uV(t,e-n(r),n)})),i=o.within,a=o.extra,c=o.withinWidth;return 1===a.length&&a[0].width<=n(r)?lV(i,a,c):a.length>=1?fV(i,a,r,c):dV(i,a,c)},pV=function(e,t){var n=$(t,(function(e){return Os(e)}));HH.setGroups(e,n)},hV=function(e){return ge(e,(function(e){return Tf(e.element).bind((function(t){return e.getSystem().getByDom(t).toOptional()}))}))},vV=function(e,t,n){var r=t.builtGroups.get();if(0!==r.length){var o=Xh(e,t,"primary"),i=yA.getCoupled(e,"overflowGroup");Kn(o.element,"visibility","hidden");var a=r.concat([i]),c=hV(a);n([]),pV(o,a);var u=vr(o.element),s=gV(u,t.builtGroups.get(),(function(e){return vr(e.element)}),i);0===s.extra.length?(Hw.remove(o,i),n([])):(pV(o,s.within),n(s.extra)),nr(o.element,"visibility"),rr(o.element),c.each(Yw.focus)}},yV=w([th("splitToolbarBehaviours",[yA]),Ti("builtGroups",(function(){return oa([])}))]),bV=w([il(["overflowToggledClass"]),qi("getOverflowBounds"),Ei("lazySink"),Ti("overflowGroups",(function(){return oa([])}))].concat(yV())),wV=w([Nh({factory:HH,schema:BH(),name:"primary"}),Rh({schema:BH(),name:"overflow"}),Rh({name:"overflow-button"}),Rh({name:"overflow-group"})]),kV=w((function(e,t){br(e,Math.floor(t))})),_V=w([il(["toggledClass"]),Ei("lazySink"),Bi("fetch"),qi("getBounds"),$i("fireDismissalEventInstead",[Ki("event",gc())]),Hd()]),xV=w([Rh({name:"button",overrides:function(e){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:mf([pk.config({toggleClass:e.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Rh({factory:HH,schema:BH(),name:"toolbar",overrides:function(e){return{toolbarBehaviours:mf([Ew.config({mode:"cyclic",onEscape:function(t){return Kh(t,e,"button").each(Yw.focus),P.none()}})])}}})]),CV=function(e,t){var n=yA.getCoupled(e,"toolbarSandbox");yp.isOpen(n)?yp.close(n):yp.open(n,t.toolbar())},zV=function(e,t,n,r){var o=n.getBounds.map((function(e){return e()})),i=n.lazySink(e).getOrDie();Ig.positionWithinBounds(i,t,{anchor:{type:"hotspot",hotspot:e,layouts:r,overrides:{maxWidthFunction:kV()}}},o)},SV=function(e,t,n,r,o){HH.setGroups(t,o),zV(e,t,n,r),pk.on(e)},TV=function(e,t,n){var r=js(),o=function(o,i){n.fetch().get((function(o){SV(e,i,n,t.layouts,o),r.link(e.element),Ew.focusIn(i)}))},i=function(){pk.off(e),Yw.focus(e),r.unlink(e.element)};return{dom:{tag:"div",attributes:{id:r.id}},behaviours:mf([Ew.config({mode:"special",onEscape:function(e){return yp.close(e),P.some(!0)}}),yp.config({onOpen:o,onClose:i,isPartOf:function(t,n,r){return Us(n,r)||Us(e,r)},getAttachPoint:function(){return n.lazySink(e).getOrDie()}}),bf.config({channels:E(E({},xp(E({isExtraPart:S},n.fireDismissalEventInstead.map((function(e){return{fireEventInstead:{event:e.event}}})).getOr({})))),zp({doReposition:function(){yp.getState(yA.getCoupled(e,"toolbarSandbox")).each((function(r){zV(e,r,n,t.layouts)}))}}))})])}},OV=function(e,t,n,r){return E(E({},x_.sketch(E(E({},r.button()),{action:function(e){CV(e,r)},buttonBehaviours:oh.augment({dump:r.button().buttonBehaviours},[yA.config({others:{toolbarSandbox:function(t){return TV(t,n,e)}}})])}))),{apis:{setGroups:function(t,r){yp.getState(yA.getCoupled(t,"toolbarSandbox")).each((function(o){SV(t,o,e,n.layouts,r)}))},reposition:function(t){yp.getState(yA.getCoupled(t,"toolbarSandbox")).each((function(r){zV(t,r,e,n.layouts)}))},toggle:function(e){CV(e,r)},getToolbar:function(e){return yp.getState(yA.getCoupled(e,"toolbarSandbox"))},isOpen:function(e){return yp.isOpen(yA.getCoupled(e,"toolbarSandbox"))}}})},EV=mv({name:"FloatingToolbarButton",factory:OV,configFields:_V(),partFields:xV(),apis:{setGroups:function(e,t,n){e.setGroups(t,n)},reposition:function(e,t){e.reposition(t)},toggle:function(e,t){e.toggle(t)},getToolbar:function(e,t){return e.getToolbar(t)},isOpen:function(e,t){return e.isOpen(t)}}}),AV=w([Ei("items"),il(["itemSelector"]),th("tgroupBehaviours",[Ew])]),DV=w([Ph({name:"items",unit:"item"})]),MV=function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,behaviours:rh(e.tgroupBehaviours,[Ew.config({mode:"flow",selector:e.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}},NV=mv({name:"ToolbarGroup",configFields:AV(),partFields:DV(),factory:MV}),RV=function(e){return $(e,(function(e){return Os(e)}))},BV=function(e,t,n){vV(e,n,(function(r){n.overflowGroups.set(r),t.getOpt(e).each((function(e){EV.setGroups(e,RV(r))}))}))},PV=function(e,t,n,r){var o=C_(EV.sketch({fetch:function(){return eA.nu((function(t){t(RV(e.overflowGroups.get()))}))},layouts:{onLtr:function(){return[Vl,jl]},onRtl:function(){return[jl,Vl]},onBottomLtr:function(){return[ql,Ul]},onBottomRtl:function(){return[Ul,ql]}},getBounds:n.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:r["overflow-button"](),toolbar:r.overflow()}}));return{uid:e.uid,dom:e.dom,components:t,behaviours:rh(e.splitToolbarBehaviours,[yA.config({others:{overflowGroup:function(){return NV.sketch(E(E({},r["overflow-group"]()),{items:[o.asSpec()]}))}}})]),apis:{setGroups:function(t,n){e.builtGroups.set($(n,t.getSystem().build)),BV(t,o,e)},refresh:function(t){return BV(t,o,e)},toggle:function(e){o.getOpt(e).each((function(e){EV.toggle(e)}))},isOpen:function(e){return o.getOpt(e).map(EV.isOpen).getOr(!1)},reposition:function(e){o.getOpt(e).each((function(e){EV.reposition(e)}))},getOverflow:function(e){return o.getOpt(e).bind(EV.getToolbar)}},domModification:{attributes:{role:"group"}}}},LV=mv({name:"SplitFloatingToolbar",configFields:bV(),partFields:wV(),factory:PV,apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)},reposition:function(e,t){e.reposition(t)},toggle:function(e,t){e.toggle(t)},isOpen:function(e,t){return e.isOpen(t)},getOverflow:function(e,t){return e.getOverflow(t)}}}),IV=w([il(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),cl("onOpened"),cl("onClosed")].concat(yV())),HV=w([Nh({factory:HH,schema:BH(),name:"primary"}),Nh({factory:HH,schema:BH(),name:"overflow",overrides:function(e){return{toolbarBehaviours:mf([_j.config({dimension:{property:"height"},closedClass:e.markers.closedClass,openClass:e.markers.openClass,shrinkingClass:e.markers.shrinkingClass,growingClass:e.markers.growingClass,onShrunk:function(t){Kh(t,e,"overflow-button").each((function(e){pk.off(e),Yw.focus(e)})),e.onClosed(t)},onGrown:function(t){Ew.focusIn(t),e.onOpened(t)},onStartGrow:function(t){Kh(t,e,"overflow-button").each(pk.on)}}),Ew.config({mode:"acyclic",onEscape:function(t){return Kh(t,e,"overflow-button").each(Yw.focus),P.some(!0)}})])}}}),Rh({name:"overflow-button",overrides:function(e){return{buttonBehaviours:mf([pk.config({toggleClass:e.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Rh({name:"overflow-group"})]),FV=function(e,t){return Kh(e,t,"overflow").map(_j.hasGrown).getOr(!1)},jV=function(e,t){Kh(e,t,"overflow-button").bind((function(){return Kh(e,t,"overflow")})).each((function(n){VV(e,t),_j.toggleGrow(n)}))},VV=function(e,t){Kh(e,t,"overflow").each((function(n){vV(e,t,(function(e){var t=$(e,(function(e){return Os(e)}));HH.setGroups(n,t)})),Kh(e,t,"overflow-button").each((function(e){_j.hasGrown(n)&&pk.on(e)})),_j.refresh(n)}))},UV=function(e,t,n,r){var o="alloy.toolbar.toggle",i=function(t,n){var r=$(n,t.getSystem().build);e.builtGroups.set(r)};return{uid:e.uid,dom:e.dom,components:t,behaviours:rh(e.splitToolbarBehaviours,[yA.config({others:{overflowGroup:function(e){return NV.sketch(E(E({},r["overflow-group"]()),{items:[x_.sketch(E(E({},r["overflow-button"]()),{action:function(t){_c(e,o)}}))]}))}}}),jw("toolbar-toggle-events",[Mc(o,(function(t){jV(t,e)}))])]),apis:{setGroups:function(t,n){i(t,n),VV(t,e)},refresh:function(t){return VV(t,e)},toggle:function(t){return jV(t,e)},isOpen:function(t){return FV(t,e)}},domModification:{attributes:{role:"group"}}}},qV=mv({name:"SplitSlidingToolbar",configFields:IV(),partFields:HV(),factory:UV,apis:{setGroups:function(e,t,n){e.setGroups(t,n)},refresh:function(e,t){e.refresh(t)},toggle:function(e,t){e.toggle(t)},isOpen:function(e,t){return e.isOpen(t)}}}),WV=function(e){var t=e.title.fold((function(){return{}}),(function(e){return{attributes:{title:e}}}));return{dom:E({tag:"div",classes:["tox-toolbar__group"]},t),components:[NV.parts.items({})],items:e.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:mf([bE.config({}),Yw.config({})])}},$V=function(e){return NV.sketch(WV(e))},GV=function(e,t){var n=Vc((function(t){var n=$(e.initGroups,$V);HH.setGroups(t,n)}));return mf([mS.toolbarButton(e.providers.isDisabled),uS(),Ew.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),jw("toolbar-events",[n])])},KV=function(e){var t=e.cyclicKeying?"cyclic":"acyclic";return{uid:e.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":WV({title:P.none(),items:[]}),"overflow-button":YB({name:"more",icon:P.some("more-drawer"),disabled:!1,tooltip:P.some("More..."),primary:!1,borderless:!1},P.none(),e.providers)},splitToolbarBehaviours:GV(e,t)}},XV=function(e){var t=KV(e),n=4,r=LV.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return LV.sketch(E(E({},t),{lazySink:e.getSink,getOverflowBounds:function(){var t=e.moreDrawerData.lazyHeader().element,r=Qr(t),o=pn(t),i=Qr(o),a=Math.max(o.dom.scrollHeight,i.height);return Yr(r.x+n,i.y,r.width-2*n,a)},parts:E(E({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:e.attributes}}}),components:[r],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},YV=function(e){var t=qV.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),n=qV.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),r=KV(e);return qV.sketch(E(E({},r),{components:[t,n],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(e){e.getSystem().broadcastOn([xF()],{type:"opened"})},onClosed:function(e){e.getSystem().broadcastOn([xF()],{type:"closed"})}}))},JV=function(e){var t=e.cyclicKeying?"cyclic":"acyclic";return HH.sketch({uid:e.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(e.type===Vx.scrolling?["tox-toolbar--scrolling"]:[])},components:[HH.parts.groups({})],toolbarBehaviours:GV(e,t)})},QV=function(e,t,n){var r={getSocket:function(t){return SH.getPart(t,e,"socket")},setSidebar:function(t,n){SH.getPart(t,e,"sidebar").each((function(e){return Pj(e,n)}))},toggleSidebar:function(t,n){SH.getPart(t,e,"sidebar").each((function(e){return Lj(e,n)}))},whichSidebar:function(t){return SH.getPart(t,e,"sidebar").bind(Ij).getOrNull()},getHeader:function(t){return SH.getPart(t,e,"header")},getToolbar:function(t){return SH.getPart(t,e,"toolbar")},setToolbar:function(t,n){SH.getPart(t,e,"toolbar").each((function(e){e.getApis().setGroups(e,n)}))},setToolbars:function(t,n){SH.getPart(t,e,"multiple-toolbar").each((function(e){RH.setItems(e,n)}))},refreshToolbar:function(t){var n=SH.getPart(t,e,"toolbar");n.each((function(e){return e.getApis().refresh(e)}))},toggleToolbarDrawer:function(t){SH.getPart(t,e,"toolbar").each((function(e){Be(e.getApis().toggle,(function(t){return t(e)}))}))},isToolbarDrawerToggled:function(t){return SH.getPart(t,e,"toolbar").bind((function(e){return P.from(e.getApis().isOpen).map((function(t){return t(e)}))})).getOr(!1)},getThrobber:function(t){return SH.getPart(t,e,"throbber")},focusToolbar:function(t){var n=SH.getPart(t,e,"toolbar").orThunk((function(){return SH.getPart(t,e,"multiple-toolbar")}));n.each((function(e){Ew.focusIn(e)}))},setMenubar:function(t,n){SH.getPart(t,e,"menubar").each((function(e){KF.setMenus(e,n)}))},focusMenubar:function(t){SH.getPart(t,e,"menubar").each((function(e){KF.focus(e)}))}};return{uid:e.uid,dom:e.dom,components:t,apis:r,behaviours:e.behaviours}},ZV=TH.optional({factory:KF,name:"menubar",schema:[Ei("backstage")]}),eU=function(e){return e.type===Vx.sliding?YV:e.type===Vx.floating?XV:JV},tU=TH.optional({factory:{sketch:function(e){return RH.sketch({uid:e.uid,dom:e.dom,listBehaviours:mf([Ew.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return JV({type:e.type,uid:ou("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:e.providers,onEscape:function(){return e.onEscape(),P.some(!0)}})},setupItem:function(e,t,n,r){HH.setGroups(t,n)},shell:!0})}},name:"multiple-toolbar",schema:[Ei("dom"),Ei("onEscape")]}),nU=TH.optional({factory:{sketch:function(e){var t=eU(e),n={type:e.type,uid:e.uid,onEscape:function(){return e.onEscape(),P.some(!0)},cyclicKeying:!1,initGroups:[],getSink:e.getSink,providers:e.providers,moreDrawerData:{lazyToolbar:e.lazyToolbar,lazyMoreButton:e.lazyMoreButton,lazyHeader:e.lazyHeader},attributes:e.attributes};return t(n)}},name:"toolbar",schema:[Ei("dom"),Ei("onEscape"),Ei("getSink")]}),rU=TH.optional({factory:{sketch:HF},name:"header",schema:[Ei("dom")]}),oU=TH.optional({name:"socket",schema:[Ei("dom")]}),iU=TH.optional({factory:{sketch:jj},name:"sidebar",schema:[Ei("dom")]}),aU=TH.optional({factory:{sketch:nV},name:"throbber",schema:[Ei("dom")]}),cU=mv({name:"OuterContainer",factory:QV,configFields:[Ei("dom"),Ei("behaviours")],partFields:[rU,ZV,nU,tU,oU,iU,aU],apis:{getSocket:function(e,t){return e.getSocket(t)},setSidebar:function(e,t,n){e.setSidebar(t,n)},toggleSidebar:function(e,t,n){e.toggleSidebar(t,n)},whichSidebar:function(e,t){return e.whichSidebar(t)},getHeader:function(e,t){return e.getHeader(t)},getToolbar:function(e,t){return e.getToolbar(t)},setToolbar:function(e,t,n){var r=$(n,(function(e){return $V(e)}));e.setToolbar(t,r)},setToolbars:function(e,t,n){var r=$(n,(function(e){return $(e,$V)}));e.setToolbars(t,r)},refreshToolbar:function(e,t){return e.refreshToolbar(t)},toggleToolbarDrawer:function(e,t){e.toggleToolbarDrawer(t)},isToolbarDrawerToggled:function(e,t){return e.isToolbarDrawerToggled(t)},getThrobber:function(e,t){return e.getThrobber(t)},setMenubar:function(e,t,n){e.setMenubar(t,n)},focusMenubar:function(e,t){e.focusMenubar(t)},focusToolbar:function(e,t){e.focusToolbar(t)}}}),uU="file edit view insert format tools table help",sU={file:{title:"File",items:"newdocument restoredraft | preview | export 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 lineheight | forecolor backcolor | language | 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"}},lU=function(e,t,n){var r=Tz(n).split(/[ ,]/);return{text:e.title,getItems:function(){return re(e.items,(function(e){var n=e.toLowerCase();return 0===n.trim().length||U(r,(function(e){return e===n}))?[]:"separator"===n||"|"===n?[{type:"separator"}]:t.menuItems[n]?[t.menuItems[n]]:[]}))}}},fU=function(e){return"string"===typeof e?e.split(" "):e},dU=function(e,t){var n=E(E({},sU),t.menus),r=pe(t.menus).length>0,o=void 0===t.menubar||!0===t.menubar?fU(uU):fU(!1===t.menubar?"":t.menubar),i=Y(o,(function(e){var n=Te(sU,e);return r?n||Se(t.menus,e).exists((function(e){return Te(e,"items")})):n})),a=$(i,(function(r){var o=n[r];return lU({title:o.title,items:fU(o.items)},t,e)}));return Y(a,(function(e){var t=function(e){return"separator"!==e.type};return e.getItems().length>0&&U(e.getItems(),t)}))},mU=function(e){var t=function(){e._skinLoaded=!0,pT(e)};return function(){e.initialized?t():e.on("init",t)}},gU=function(e,t){return function(){return hT(e,{message:t})}},pU=function(e,t,n){return new ax((function(r,o){n.load(t,r,o),e.on("remove",(function(){return n.unload(t)}))}))},hU=function(e,t){var n=t+"/skin.min.css";return pU(e,n,e.ui.styleSheetLoader)},vU=function(e,t){var n=Dn(tt.fromDom(e.getElement()));if(n){var r=t+"/skin.shadowdom.min.css";return pU(e,r,dz.DOM.styleSheetLoader)}return ax.resolve()},yU=function(e,t){var n=gz(t);n&&t.contentCSS.push(n+(e?"/content.inline":"/content")+".min.css"),!1===hz(t)&&i(n)?ax.all([hU(t,n),vU(t,n)]).then(mU(t),gU(t,"Skin could not be loaded")):mU(t)()},bU=x(yU,!1),wU=x(yU,!0),kU=function(e,t){return function(n){var r=nd(),o=function(){n.setActive(e.formatter.match(t));var o=e.formatter.formatChanged(t,n.setActive);r.set(o)};return e.initialized?o():e.once("init",o),function(){e.off("init",o),r.clear()}}},_U=function(e,t,n){return function(r){var o=function(){return n(r)},i=function(){n(r),e.on(t,o)};return e.initialized?i():e.once("init",i),function(){e.off("init",i),e.off(t,o)}}},xU=function(e){return function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("mceToggleFormat",!1,t.format)}))}}},CU=function(e,t){return function(){return e.execCommand(t)}},zU=function(e,t,n){var r=function(e,r,i,a){var c=t.shared.providers.translate(e.title);if("separator"===e.type)return P.some({type:"separator",text:c});if("submenu"===e.type){var u=re(e.getStyleItems(),(function(e){return o(e,r,a)}));return 0===r&&u.length<=0?P.none():P.some({type:"nestedmenuitem",text:c,disabled:u.length<=0,getSubmenuItems:function(){return re(e.getStyleItems(),(function(e){return o(e,r,a)}))}})}return P.some(E({type:"togglemenuitem",text:c,icon:e.icon,active:e.isSelected(a),disabled:i,onAction:n.onAction(e)},e.getStylePreview().fold((function(){return{}}),(function(e){return{meta:{style:e}}}))))},o=function(e,t,o){var i="formatter"===e.type&&n.isInvalid(e);return 0===t?i?[]:r(e,t,!1,o).toArray():r(e,t,i,o).toArray()},i=function(e){var t=n.getCurrentValue(),r=n.shouldHide?0:1;return re(e,(function(e){return o(e,r,t)}))},a=function(e,t){return function(n,r){var o=t(),a=i(o),c=WB(a,Ux.CLOSE_ON_EXECUTE,e,!1);r(c)}};return{validateItems:i,getFetch:a}},SU=function(e,t,n){var r=n.dataset,o="basic"===r.type?function(){return $(r.data,(function(e){return MI(e,n.isSelectedFor,n.getPreviewFor)}))}:r.getData;return{items:zU(e,t,n),getStyleItems:o}},TU=function(e,t,n){var r=SU(e,t,n),o=r.items,i=r.getStyleItems,a=function(e){return{getComponent:w(e)}},c=_U(e,"NodeChange",(function(e){var t=e.getComponent();n.updateText(t)}));return BB({text:n.icon.isSome()?P.none():n.text,icon:n.icon,tooltip:P.from(n.tooltip),role:P.none(),fetch:o.getFetch(t,i),onSetup:c,getApi:a,columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)},OU=function(e){return $(e,(function(e){var t=e,n=e,r=e.split("=");return r.length>1&&(t=r[0],n=r[1]),{title:t,format:n}}))},EU=function(e){return{type:"basic",data:e}};(function(e){e[e["SemiColon"]=0]="SemiColon",e[e["Space"]=1]="Space"})(XP||(XP={}));var AU,DU=function(e,t){return t===XP.SemiColon?e.replace(/;$/,"").split(";"):e.split(" ")},MU=function(e,t,n,r){var o=e.getParam(t,n,"string"),i=OU(DU(o,r));return{type:"basic",data:i}},NU=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],RU=function(e){var t=function(){return ee(NU,(function(t){return e.formatter.match(t.format)}))},n=function(t){return function(){return e.formatter.match(t)}},r=function(e){return P.none},o=function(e){var n=t(),r=n.fold(w("left"),(function(e){return e.title.toLowerCase()}));xc(e,RB,{icon:"align-"+r})},i=EU(NU),a=function(t){return function(){return ee(NU,(function(e){return e.format===t.format})).each((function(t){return e.execCommand(t.command)}))}};return{tooltip:"Align",text:P.none(),icon:P.some("align-left"),isSelectedFor:n,getCurrentValue:P.none,getPreviewFor:r,onAction:a,updateText:o,dataset:i,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},BU=function(e,t){return TU(e,t,RU(e))},PU=function(e,t){var n=SU(e,t,RU(e));e.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},LU="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",IU=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],HU=function(e){var t=e.split(/\s*,\s*/);return $(t,(function(e){return e.replace(/^['"]+|['"]+$/g,"")}))},FU=function(e){var t=function(){var t=HU(e.toLowerCase());return oe(IU,(function(e){return t.indexOf(e.toLowerCase())>-1}))};return 0===e.indexOf("-apple-system")&&t()},jU=function(e){var t="System Font",n=function(){var n=function(e){return e?HU(e)[0]:""},r=e.queryCommandValue("FontName"),o=u.data,i=r?r.toLowerCase():"",a=ee(o,(function(e){var t=e.format;return t.toLowerCase()===i||n(t).toLowerCase()===n(i).toLowerCase()})).orThunk((function(){return Pe(FU(i),{title:t,format:i})}));return{matchOpt:a,font:r}},r=function(e){return function(t){return t.exists((function(t){return t.format===e}))}},o=function(){var e=n().matchOpt;return e},i=function(e){return function(){return P.some({tag:"div",styles:-1===e.indexOf("dings")?{"font-family":e}:{}})}},a=function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("FontName",!1,t.format)}))}},c=function(e){var t=n(),r=t.matchOpt,o=t.font,i=r.fold(w(o),(function(e){return e.title}));xc(e,NB,{text:i})},u=MU(e,"font_formats",LU,XP.SemiColon);return{tooltip:"Fonts",text:P.some(t),icon:P.none(),isSelectedFor:r,getCurrentValue:o,getPreviewFor:i,onAction:a,updateText:c,dataset:u,shouldHide:!1,isInvalid:S}},VU=function(e,t){return TU(e,t,jU(e))},UU=function(e,t){var n=SU(e,t,jU(e));e.ui.registry.addNestedMenuItem("fontformats",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},qU="8pt 10pt 12pt 14pt 18pt 24pt 36pt",WU={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},$U={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},GU=function(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n},KU=function(e,t){return/[0-9.]+px$/.test(e)?GU(72*parseInt(e,10)/96,t||0)+"pt":Se($U,e).getOr(e)},XU=function(e){return Se(WU,e).getOr("")},YU=function(e){var t=function(){var t=P.none(),n=c.data,r=e.queryCommandValue("FontSize");if(r)for(var o=function(e){var o=KU(r,e),i=XU(o);t=ee(n,(function(e){return e.format===r||e.format===o||e.format===i}))},i=3;t.isNone()&&i>=0;i--)o(i);return{matchOpt:t,size:r}},n=function(e){return function(t){return t.exists((function(t){return t.format===e}))}},r=function(){var e=t().matchOpt;return e},o=w(P.none),i=function(t){return function(){e.undoManager.transact((function(){e.focus(),e.execCommand("FontSize",!1,t.format)}))}},a=function(e){var n=t(),r=n.matchOpt,o=n.size,i=r.fold(w(o),(function(e){return e.title}));xc(e,NB,{text:i})},c=MU(e,"fontsize_formats",qU,XP.Space);return{tooltip:"Font sizes",text:P.some("12pt"),icon:P.none(),isSelectedFor:n,getPreviewFor:o,getCurrentValue:r,onAction:i,updateText:a,dataset:c,shouldHide:!1,isInvalid:S}},JU=function(e,t){return TU(e,t,YU(e))},QU=function(e,t){var n=SU(e,t,YU(e));e.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},ZU=function(e,t){var n=t(),r=$(n,(function(e){return e.format}));return P.from(e.formatter.closest(r)).bind((function(e){return ee(n,(function(t){return t.format===e}))})).orThunk((function(){return Pe(e.formatter.match("p"),{title:"Paragraph",format:"p"})}))},eq="Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",tq=function(e){var t="Paragraph",n=function(t){return function(){return e.formatter.match(t)}},r=function(t){return function(){var n=e.formatter.get(t);return P.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))})}},o=function(n){var r=ZU(e,(function(){return i.data})),o=r.fold(w(t),(function(e){return e.title}));xc(n,NB,{text:o})},i=MU(e,"block_formats",eq,XP.SemiColon);return{tooltip:"Blocks",text:P.some(t),icon:P.none(),isSelectedFor:n,getCurrentValue:P.none,getPreviewFor:r,onAction:xU(e),updateText:o,dataset:i,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},nq=function(e,t){return TU(e,t,tq(e))},rq=function(e,t){var n=SU(e,t,tq(e));e.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return n.items.validateItems(n.getStyleItems())}})},oq=function(e,t){var n="Paragraph",r=function(t){return function(){return e.formatter.match(t)}},o=function(t){return function(){var n=e.formatter.get(t);return void 0!==n?P.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):P.none()}},i=function(t){var r=function(e){var t=e.items;return void 0!==t&&t.length>0?re(t,r):[{title:e.title,format:e.format}]},o=re(DI(e),r),i=ZU(e,w(o)),a=i.fold(w(n),(function(e){return e.title}));xc(t,NB,{text:a})};return{tooltip:"Formats",text:P.some(n),icon:P.none(),isSelectedFor:r,getCurrentValue:P.none,getPreviewFor:o,onAction:xU(e),updateText:i,shouldHide:e.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!e.formatter.canApply(t.format)},dataset:t}},iq=function(e,t){var n=E({type:"advanced"},t.styleselect);return TU(e,t,oq(e,n))},aq=function(e,t){var n=E({type:"advanced"},t.styleselect),r=SU(e,t,oq(e,n));e.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}})},cq=function(e,t){var n=function(n,r){e.updateState.each((function(e){var o=e(n,r);t.set(o)})),e.renderComponents.each((function(e){var o=e(r,t.get()),i=$(o,n.getSystem().build);Ug(n,i)}))};return Oc([Mc(ec(),(function(t,r){var o=r;if(!o.universal){var i=e.channel;V(o.channels,i)&&n(t,o.data)}})),Vc((function(t,r){e.initialData.each((function(e){n(t,e)}))}))])},uq=Object.freeze({__proto__:null,events:cq}),sq=function(e,t,n){return n},lq=Object.freeze({__proto__:null,getState:sq}),fq=[Ei("channel"),Fi("renderComponents"),Fi("updateState"),Fi("initialData")],dq=function(){var e=oa(P.none()),t=function(){return e.set(P.none())},n=function(){return e.get().getOr("none")};return{readState:n,get:e.get,set:e.set,clear:t}},mq=Object.freeze({__proto__:null,init:dq}),gq=pf({fields:fq,name:"reflecting",active:uq,apis:lq,state:mq}),pq=w([Ei("toggleClass"),Ei("fetch"),sl("onExecute"),Ki("getHotspot",P.some),Ki("getAnchorOverrides",w({})),Hd(),sl("onItemExecute"),Fi("lazySink"),Ei("dom"),cl("onOpen"),th("splitDropdownBehaviours",[yA,Ew,Yw]),Ki("matchWidth",!1),Ki("useMinWidth",!1),Ki("eventOrder",{}),Fi("role")].concat(NA())),hq=Nh({factory:x_,schema:[Ei("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:mf([Yw.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(Cc)},buttonBehaviours:mf([pk.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])}}}),vq=Nh({factory:x_,schema:[Ei("dom")],name:"button",defaults:function(){return{buttonBehaviours:mf([Yw.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each((function(n){e.onExecute(n,t)}))}}}}),yq=w([hq,vq,Bh({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[Ei("text")],name:"aria-descriptor"}),Rh({schema:[ol()],name:"menu",defaults:function(e){return{onExecute:function(t,n){t.getSystem().getByUid(e.uid).each((function(r){e.onItemExecute(r,t,n)}))}}}}),wA()]),bq=function(e,t,n,r){var o,i=function(e){yv.getCurrent(e).each((function(e){ry.highlightFirst(e),Ew.focusIn(e)}))},a=function(t){var n=i;TA(e,k,t,r,n,WE.HighlightFirst).get(h)},c=function(e){return a(e),P.some(!0)},u=function(t){var n=Xh(t,e,"button");return Cc(n),P.some(!0)},s=E(E({},Oc([Vc((function(t,n){var r=Kh(t,e,"aria-descriptor");r.each((function(e){var n=ou("aria");Fn(e.element,"id",n),Fn(t.element,"aria-describedby",n)}))}))])),vk(P.some(a))),l={repositionMenus:function(e){pk.isOn(e)&&MA(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:l,eventOrder:E(E({},e.eventOrder),(o={},o[tc()]=["disabling","toggling","alloy.base.behaviour"],o)),events:s,behaviours:rh(e.splitDropdownBehaviours,[yA.config({others:{sandbox:function(t){var n=Xh(t,e,"arrow"),r={onOpen:function(){pk.on(n),pk.on(t)},onClose:function(){pk.off(n),pk.off(t)}};return DA(e,t,r)}}}),Ew.config({mode:"special",onSpace:u,onEnter:u,onDown:c}),Yw.config({}),pk.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},wq=mv({name:"SplitDropdown",configFields:pq(),partFields:yq(),factory:bq,apis:{repositionMenus:function(e,t){return e.repositionMenus(t)}}}),kq=function(e){return{isDisabled:function(){return Lv.isDisabled(e)},setDisabled:function(t){return Lv.set(e,t)}}},_q=function(e){return{setActive:function(t){pk.set(e,t)},isActive:function(){return pk.isOn(e)},isDisabled:function(){return Lv.isDisabled(e)},setDisabled:function(t){return Lv.set(e,t)}}},xq=function(e,t){return e.map((function(e){return{"aria-label":t.translate(e),title:t.translate(e)}})).getOr({})},Cq=ou("focus-button"),zq=function(e,t,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:xq(n,i)},components:bS([e.map((function(e){return TB(e,i.icons)})),t.map((function(e){return EB(e,"tox-tbtn",i)}))]),eventOrder:(a={},a[Na()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:mf([mS.toolbarButton(i.isDisabled),uS(),jw("common-button-display-events",[Mc(Na(),(function(e,t){t.event.prevent(),_c(e,Cq)}))])].concat(r.map((function(n){return gq.config({channel:n,initialData:{icon:e,text:t},renderComponents:function(e,t){return bS([e.icon.map((function(e){return TB(e,i.icons)})),e.text.map((function(e){return EB(e,"tox-tbtn",i)}))])}})})).toArray()).concat(o.getOr([])))}},Sq=function(e,t,n,r){var o=t.shared;return EV.sketch({lazySink:o.getSink,fetch:function(){return eA.nu((function(t){t($(n(e.items),$V))}))},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:zq(e.icon,e.text,e.tooltip,P.none(),P.none(),o.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:r}}}})},Tq=function(e,t,n){var r=oa(h),o=zq(e.icon,e.text,e.tooltip,P.none(),P.none(),n);return x_.sketch({dom:o.dom,components:o.components,eventOrder:MB,buttonBehaviours:mf([jw("toolbar-button-events",[DB({onAction:e.onAction,getApi:t.getApi}),pS(t,r),hS(t,r)]),mS.toolbarButton((function(){return e.disabled||n.isDisabled()})),uS()].concat(t.toolbarButtonBehaviours))})},Oq=function(e,t){return Eq(e,t,[])},Eq=function(e,t,n){return Tq(e,{toolbarButtonBehaviours:[].concat(n.length>0?[jw("toolbarButtonWith",n)]:[]),getApi:kq,onSetup:e.onSetup},t)},Aq=function(e,t){return Dq(e,t,[])},Dq=function(e,t,n){return _o(Tq(e,{toolbarButtonBehaviours:[Hw.config({}),pk.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(n.length>0?[jw("toolbarToggleButtonWith",n)]:[]),getApi:_q,onSetup:e.onSetup},t))},Mq=function(e,t,n){return function(r){return eA.nu((function(e){return t.fetch(e)})).map((function(o){return P.from(MO(_o(nO(ou("menu-value"),o,(function(n){t.onItemAction(e(r),n)}),t.columns,t.presets,Ux.CLOSE_ON_EXECUTE,t.select.getOr(S),n),{movement:oO(t.columns,t.presets),menuBehaviours:QC.unnamedEvents("auto"!==t.columns?[]:[Vc((function(e,n){XC(e,4,lC(t.presets)).each((function(t){var n=t.numRows,r=t.numColumns;Ew.setGridSize(e,n,r)}))}))])})))}))}},Nq=function(e,t){var n,r=ou("channel-update-split-dropdown-display"),o=function(e){return{isDisabled:function(){return Lv.isDisabled(e)},setDisabled:function(t){return Lv.set(e,t)},setIconFill:function(t,n){Is(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each((function(e){Fn(e,"fill",n)}))},setIconStroke:function(t,n){Is(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each((function(e){Fn(e,"stroke",n)}))},setActive:function(t){Fn(e.element,"aria-pressed",t),Is(e.element,"span").each((function(n){e.getSystem().getByDom(n).each((function(e){return pk.set(e,t)}))}))},isActive:function(){return Is(e.element,"span").exists((function(t){return e.getSystem().getByDom(t).exists(pk.isOn)}))}}},i=oa(h),a={getApi:o,onSetup:e.onSetup};return wq.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:E({"aria-pressed":!1},xq(e.tooltip,t.providers))},onExecute:function(t){e.onAction(o(t))},onItemExecute:function(e,t,n){},splitDropdownBehaviours:mf([mS.splitButton(t.providers.isDisabled),uS(),jw("split-dropdown-events",[Mc(Cq,Yw.focus),pS(a,i),hS(a,i)]),jA.config({})]),eventOrder:(n={},n[dc()]=["alloy.base.behaviour","split-dropdown-events"],n),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:Mq(o,e,t.providers),parts:{menu:hC(!1,e.columns,e.presets)},components:[wq.parts.button(zq(e.icon,e.text,P.none(),P.some(r),P.some([pk.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),wq.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:D_("chevron-down",t.providers.icons)},buttonBehaviours:mf([mS.splitButton(t.providers.isDisabled),uS(),R_()])}),wq.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},Rq=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],Bq=function(e,t){return function(n,r,o){var i=e(n).mapError((function(e){return xi(e)})).getOrDie();return t(i,r,o)}},Pq={button:Bq(Sx,(function(e,t){return Oq(e,t.backstage.shared.providers)})),togglebutton:Bq(Ex,(function(e,t){return Aq(e,t.backstage.shared.providers)})),menubutton:Bq(qF,(function(e,t){return GB(e,"tox-tbtn",t.backstage,P.none())})),splitbutton:Bq($F,(function(e,t){return Nq(e,t.backstage.shared)})),grouptoolbarbutton:Bq(jF,(function(e,t,n){var r,o=n.ui.registry.getAll().buttons,i=function(e){return qq(n,{buttons:o,toolbar:e,allowToolbarGroups:!1},t,P.none())},a=(r={},r[Ld]=t.backstage.shared.header.isPositionedAtTop()?Hf.TopToBottom:Hf.BottomToTop,r);switch(Nz(n)){case Vx.floating:return Sq(e,t.backstage,i,a);default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}})),styleSelectButton:function(e,t){return iq(e,t.backstage)},fontsizeSelectButton:function(e,t){return JU(e,t.backstage)},fontSelectButton:function(e,t){return VU(e,t.backstage)},formatButton:function(e,t){return nq(e,t.backstage)},alignMenuButton:function(e,t){return BU(e,t.backstage)}},Lq=function(e,t,n){return Se(Pq,e.type).fold((function(){return console.error("skipping button defined by",e),P.none()}),(function(r){return P.some(r(e,t,n))}))},Iq={styleselect:Pq.styleSelectButton,fontsizeselect:Pq.fontsizeSelectButton,fontselect:Pq.fontSelectButton,formatselect:Pq.formatButton,align:Pq.alignMenuButton},Hq=function(e){var t=$(Rq,(function(t){var n=Y(t.items,(function(t){return Te(e,t)||Te(Iq,t)}));return{name:t.name,items:n}}));return Y(t,(function(e){return e.items.length>0}))},Fq=function(e){var t=e.split("|");return $(t,(function(e){return{items:e.trim().split(" ")}}))},jq=function(e){return p(e,(function(e){return Te(e,"name")&&Te(e,"items")}))},Vq=function(e){var t=e.toolbar,n=e.buttons;return!1===t?[]:void 0===t||!0===t?Hq(n):i(t)?Fq(t):jq(t)?t:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},Uq=function(e,t,n,r,o,i){return Se(t,n.toLowerCase()).orThunk((function(){return i.bind((function(e){return ge(e,(function(e){return Se(t,e+n.toLowerCase())}))}))})).fold((function(){return Se(Iq,n.toLowerCase()).map((function(t){return t(e,o)})).orThunk((function(){return P.none()}))}),(function(t){return"grouptoolbarbutton"!==t.type||r?Lq(t,o,e):(console.warn("Ignoring the '"+n+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),P.none())}))},qq=function(e,t,n,r){var o=Vq(t),i=$(o,(function(o){var i=re(o.items,(function(o){return 0===o.trim().length?[]:Uq(e,t.buttons,o,t.allowToolbarGroups,n,r).toArray()}));return{title:P.from(e.translate(o.name)),items:i}}));return Y(i,(function(e){return e.items.length>0}))},Wq=function(e,t,n,r){var o=t.outerContainer,a=n.toolbar,c=n.buttons;if(p(a,i)){var u=a.map((function(t){var o={toolbar:t,buttons:c,allowToolbarGroups:n.allowToolbarGroups};return qq(e,o,{backstage:r},P.none())}));cU.setToolbars(o,u)}else cU.setToolbar(o,qq(e,n,{backstage:r},P.none()))},$q=tn(),Gq=$q.os.isiOS()&&$q.os.version.major<=12,Kq=function(e,t){var n=e.dom,r=e.getWin(),o=e.getDoc().documentElement,i=oa(lr(r.innerWidth,r.innerHeight)),a=oa(lr(o.offsetWidth,o.offsetHeight)),c=function(){var t=i.get();t.left===r.innerWidth&&t.top===r.innerHeight||(i.set(lr(r.innerWidth,r.innerHeight)),yT(e))},u=function(){var t=e.getDoc().documentElement,n=a.get();n.left===t.offsetWidth&&n.top===t.offsetHeight||(a.set(lr(t.offsetWidth,t.offsetHeight)),yT(e))},s=function(t){return bT(e,t)};n.bind(r,"resize",c),n.bind(r,"scroll",s);var l=cd(tt.fromDom(e.getBody()),"load",u),f=t.uiMothership.element;e.on("hide",(function(){Kn(f,"display","none")})),e.on("show",(function(){nr(f,"display")})),e.on("NodeChange",u),e.on("remove",(function(){l.unbind(),n.unbind(r,"resize",c),n.unbind(r,"scroll",s),r=null}))},Xq=function(e,t,n,r,o){var i=oa(0),a=t.outerContainer;bU(e);var c=tt.fromDom(o.targetNode),u=An(En(c));Yg(c,t.mothership),Xg(u,t.uiMothership),e.on("PostRender",(function(){Wq(e,t,n,r),i.set(e.getWin().innerWidth),cU.setMenubar(a,dU(e,n)),cU.setSidebar(a,n.sidebar),Kq(e,t)}));var s=cU.getSocket(a).getOrDie("Could not find expected socket element");if(Gq){Xn(s.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var l=U_((function(){e.fire("ScrollContent")}),20),f=ad(s.element,"scroll",l.throttle);e.on("remove",f.unbind)}cS(e,t),e.addCommand("ToggleSidebar",(function(t,n){cU.toggleSidebar(a,n),e.fire("ToggleSidebar")})),e.addQueryValueHandler("ToggleSidebar",(function(){return cU.whichSidebar(a)}));var d=Nz(e),m=function(){cU.refreshToolbar(t.outerContainer)};d!==Vx.sliding&&d!==Vx.floating||e.on("ResizeWindow ResizeEditor ResizeContent",(function(){var t=e.getWin().innerWidth;t!==i.get()&&(m(),i.set(t))}));var g={enable:function(){aS(t,!1)},disable:function(){aS(t,!0)},isDisabled:function(){return Lv.isDisabled(a)}};return{iframeContainer:s.element.dom,editorContainer:a.element.dom,api:g}},Yq=Object.freeze({__proto__:null,render:Xq}),Jq=function(e){var t=/^[0-9\.]+(|px)$/i;return t.test(""+e)?P.some(parseInt(""+e,10)):P.none()},Qq=function(e){return g(e)?e+"px":e},Zq=function(e,t,n){var r=t.filter((function(t){return et}));return r.or(o).getOr(e)},eW=function(e){var t=vz(e),n=wz(e),r=_z(e);return Jq(t).map((function(e){return Zq(e,n,r)}))},tW=function(e){var t=eW(e);return t.getOr(vz(e))},nW=function(e){var t=yz(e),n=bz(e),r=kz(e);return Jq(t).map((function(e){return Zq(e,n,r)}))},rW=function(e){var t=nW(e);return t.getOr(yz(e))},oW=function(e,t,n,r,o){var i=n.uiMothership,a=n.outerContainer,c=dz.DOM,u=Vz(e),s=Wz(e),l=kz(e).or(nW(e)),f=r.shared.header,d=f.isPositionedAtTop,m=Nz(e),g=m===Vx.sliding||m===Vx.floating,p=oa(!1),h=function(){return p.get()&&!e.removed},v=function(e){return g?e.fold(w(0),(function(e){return e.components().length>1?ar(e.components()[1].element):0})):0},y=function(n){switch(Pz(e)){case Mz.auto:var r=cU.getToolbar(a),o=v(r),i=ar(n.element)-o,c=Jr(t),u=c.y>i;if(u)return"top";var s=pn(t),l=Math.max(s.dom.scrollHeight,ar(s)),f=c.bottom=n&&e.bottom-t.y>=n},kW=function(e){var t=e.getBoundingClientRect();if(t.height<=0&&t.width<=0){var n=zn(tt.fromDom(e.startContainer),e.startOffset).element,r=ft(n)?vn(n):P.some(n);return r.filter(lt).map((function(e){return e.dom.getBoundingClientRect()})).getOr(t)}return t},_W=function(e){var t=e.selection.getRng(),n=kW(t);if(e.inline){var r=Lr();return Yr(r.left+n.left,r.top+n.top,n.width,n.height)}var o=Qr(tt.fromDom(e.getBody()));return Yr(o.x+n.left,o.y+n.top,n.width,n.height)},xW=function(e,t){return t.filter(Pn).map(Qr).getOrThunk((function(){return _W(e)}))},CW=function(e,t,n){var r=Math.max(e.x+n,t.x),o=Math.min(e.right-n,t.right);return{x:r,width:o-r}},zW=function(e,t,n,r,o,i){var a=tt.fromDom(e.getContainer()),c=Is(a,".tox-editor-header").getOr(a),u=Jr(c),s=u.y>=t.bottom,l=r&&!s;if(e.inline&&l)return{y:Math.max(u.bottom+i,n.y),bottom:n.bottom};if(e.inline&&!l)return{y:n.y,bottom:Math.min(u.y-i,n.bottom)};var f="line"===o?Jr(a):t;return l?{y:Math.max(u.bottom+i,n.y),bottom:Math.min(f.bottom-i,n.bottom)}:{y:Math.max(f.y+i,n.y),bottom:Math.min(u.y-i,n.bottom)}},SW=function(e,t,n,r){void 0===r&&(r=0);var o=jr(window),i=Jr(tt.fromDom(e.getContentAreaContainer())),a=Oz(e)||Ez(e)||Dz(e),c=CW(i,o,r),u=c.x,s=c.width;if(e.inline&&!a)return Yr(u,o.y,s,o.height);var l=t.header.isPositionedAtTop(),f=zW(e,i,o,l,n,r),d=f.y,m=f.bottom;return Yr(u,d,s,m-d)},TW=12,OW={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"],inset:["tox-pop--inset"]},EW={maxHeightFunction:Td(),maxWidthFunction:kV()},AW=function(e,t){var n=e.selection.getRng(),r=zn(tt.fromDom(n.startContainer),n.startOffset);return n.startContainer===n.endContainer&&n.startOffset===n.endOffset-1&&sn(r.element,t)},DW=function(e,t,n){var r=Zn(e,"position");Kn(e,"position",t);var o=n(e);return r.each((function(t){return Kn(e,"position",t)})),o},MW=function(e){return"node"===e},NW=function(e,t,n,r,o){var i=_W(e),a=r.lastElement().exists((function(e){return sn(n,e)}));if(AW(e,n))return a?y_:m_;if(a)return DW(t,r.getMode(),(function(){var e=wW(i,Jr(t));return e&&!r.isReposition()?w_:y_}));var c="fixed"===r.getMode()?o.y+Lr().top:o.y,u=ar(t)+TW;return c+u<=i.y?m_:g_},RW=function(e,t,n,r){var o=function(t){return function(r,o,i,a,c){var u=NW(e,a,t,n,c),s=E(E({},r),{y:c.y,height:c.height});return E(E({},u(s,o,i,a,c)),{alwaysFit:!0})}},i=function(e){return MW(r)?[o(e)]:[]},a={onLtr:function(e){return[Wl,$l,Ul,jl,ql,Vl].concat(i(e))},onRtl:function(e){return[Wl,$l,ql,Vl,Ul,jl].concat(i(e))}},c={onLtr:function(e){return[$l,jl,Vl,Ul,ql,Wl].concat(i(e))},onRtl:function(e){return[$l,Vl,jl,ql,Ul,Wl].concat(i(e))}};return t?c:a},BW=function(e,t,n,r){return"line"===t?{bubble:Md(TW,0,OW),layouts:{onLtr:function(){return[Gl]},onRtl:function(){return[Kl]}},overrides:EW}:{bubble:Md(0,TW,OW,1/TW),layouts:RW(e,n,r,t),overrides:EW}},PW=function(e,t){var n=Y(t,(function(t){return t.predicate(e.dom)})),r=X(n,(function(e){return"contexttoolbar"===e.type})),o=r.pass,i=r.fail;return{contextToolbars:o,contextForms:i}},LW=function(e){if(e.length<=1)return e;var t=function(t){return U(e,(function(e){return e.position===t}))},n=function(t){return Y(e,(function(e){return e.position===t}))},r=t("selection"),o=t("node");if(r||o){if(o&&r){var i=n("node"),a=$(n("selection"),(function(e){return E(E({},e),{position:"node"})}));return i.concat(a)}return n(r?"selection":"node")}return n("line")},IW=function(e){if(e.length<=1)return e;var t=function(t){return ee(e,(function(e){return e.position===t}))},n=t("selection").orThunk((function(){return t("node")})).orThunk((function(){return t("line")})).map((function(e){return e.position}));return n.fold((function(){return[]}),(function(t){return Y(e,(function(e){return e.position===t}))}))},HW=function(e,t,n){var r=PW(e,t);if(r.contextForms.length>0)return P.some({elem:e,toolbars:[r.contextForms[0]]});var o=PW(e,n);if(o.contextForms.length>0)return P.some({elem:e,toolbars:[o.contextForms[0]]});if(r.contextToolbars.length>0||o.contextToolbars.length>0){var i=LW(r.contextToolbars.concat(o.contextToolbars));return P.some({elem:e,toolbars:i})}return P.none()},FW=function(e,t,n){return e(t)?P.none():ba(t,(function(e){if(lt(e)){var t=PW(e,n.inNodeScope),r=t.contextToolbars,o=t.contextForms,i=o.length>0?o:IW(r);return i.length>0?P.some({elem:e,toolbars:i}):P.none()}return P.none()}),e)},jW=function(e,t){var n=tt.fromDom(t.getBody()),r=function(e){return sn(e,n)},o=function(e){return!r(e)&&!dn(n,e)},i=tt.fromDom(t.selection.getNode());return o(i)?P.none():HW(i,e.inNodeScope,e.inEditorScope).orThunk((function(){return FW(r,i,e)}))},VW=function(e,t){var n={},r=[],o=[],i={},a={},c=function(e,c){var u=ki(Lx(c));n[e]=u,u.launch.map((function(n){i["form:"+e]=E(E({},c.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){t(u)}})})),"editor"===u.scope?o.push(u):r.push(u),a[e]=u},u=function(e,t){Hx(t).each((function(n){"editor"===t.scope?o.push(n):r.push(n),a[e]=n}))},s=pe(e);return G(s,(function(t){var n=e[t];"contextform"===n.type?c(t,n):"contexttoolbar"===n.type&&u(t,n)})),{forms:n,inNodeScope:r,inEditorScope:o,lookupTable:a,formNavigators:i}},UW=ou("forward-slide"),qW=ou("backward-slide"),WW=ou("change-slide-event"),$W="tox-pop--resizing",GW=function(e){var t=oa([]);return t_.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(e){t.set([]),t_.getContent(e).each((function(e){nr(e.element,"visibility")})),cs(e.element,$W),nr(e.element,"width")},inlineBehaviours:mf([jw("context-toolbar-events",[jc($a(),(function(e,t){"width"===t.event.raw.propertyName&&(cs(e.element,$W),nr(e.element,"width"))})),Mc(WW,(function(e,t){var n=e.element;nr(n,"width");var r=vr(n);t_.setContent(e,t.event.contents),is(n,$W);var o=vr(n);Kn(n,"width",r+"px"),t_.getContent(e).each((function(e){t.event.focus.bind((function(e){return xf(e),Tf(n)})).orThunk((function(){return Ew.focusIn(e),Sf(En(n))}))})),k_.setTimeout((function(){Kn(e.element,"width",o+"px")}),0)})),Mc(UW,(function(e,n){t_.getContent(e).each((function(n){t.set(t.get().concat([{bar:n,focus:Sf(En(e.element))}]))})),xc(e,WW,{contents:n.event.forwardContents,focus:P.none()})})),Mc(qW,(function(e,n){de(t.get()).each((function(n){t.set(t.get().slice(0,t.get().length-1)),xc(e,WW,{contents:Os(n.bar),focus:n.focus})}))}))]),Ew.config({mode:"special",onEscape:function(n){return de(t.get()).fold((function(){return e.onEscape()}),(function(e){return _c(n,qW),P.some(!0)}))}})]),lazySink:function(){return ro.value(e.sink)}})},KW="tox-pop--transition",XW=function(e,t,n,r){var o=r.backstage,i=o.shared,a=tn().deviceType.isTouch,c=od(),u=od(),s=od(),l=Ts(GW({sink:n,onEscape:function(){return e.focus(),P.some(!0)}})),f=function(){var t=s.get().getOr("node"),n=MW(t)?1:0;return SW(e,i,t,n)},d=function(){return!e.removed&&!(a()&&o.isContextMenuOpen())},m=function(e){return Ee(Ne(e,c.get(),sn),!0)},g=function(){if(d()){var t=f(),n=Ee(s.get(),"node")?xW(e,c.get()):_W(e);return t.height<=0||!wW(n,t)}return!0},p=function(){c.clear(),u.clear(),s.clear(),t_.hide(l)},v=function(){if(t_.isOpen(l)){var e=l.element;nr(e,"display"),g()?Kn(e,"display","none"):(u.set(0),t_.reposition(l))}},y=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:mf([Ew.config({mode:"acyclic"}),jw("pop-dialog-wrap-events",[Vc((function(t){e.shortcuts.add("ctrl+F9","focus statusbar",(function(){return Ew.focusIn(t)}))})),Uc((function(t){e.shortcuts.remove("ctrl+F9")}))])])}},b=gt((function(){return VW(t,(function(e){var t=_([e]);xc(l,UW,{forwardContents:y(t)})}))})),w=function(t,n){return qq(e,{buttons:t,toolbar:n.items,allowToolbarGroups:!1},r,P.some(["form:"]))},k=function(e,t){return bW.buildInitGroups(e,t)},_=function(t){var n=e.ui.registry.getAll().buttons,r=b(),o=E(E({},n),r.formNavigators),a=Nz(e)===Vx.scrolling?Vx.scrolling:Vx.default,c=ne($(t,(function(e){return"contexttoolbar"===e.type?w(o,e):k(e,i.providers)})));return JV({type:a,uid:ou("context-toolbar"),initGroups:c,onEscape:P.none,cyclicKeying:!0,providers:i.providers})},x=function(t,r){var o="node"===t?i.anchors.node(r):i.anchors.cursor(),s=BW(e,t,a(),{lastElement:c.get,isReposition:function(){return Ee(u.get(),0)},getMode:function(){return Ig.getMode(n)}});return _o(o,s)},C=function(e,t){if(z.cancel(),d()){var r=_(e),o=e[0].position,i=x(o,t);s.set(o),u.set(1);var a=l.element;nr(a,"display"),m(t)||(cs(a,KW),Ig.reset(n,l)),t_.showWithinBounds(l,y(r),{anchor:i,transition:{classes:[KW],mode:"placement"}},(function(){return P.some(f())})),t.fold(c.clear,c.set),g()&&Kn(a,"display","none")}},z=q_((function(){if(e.hasFocus()&&!e.removed)if(us(l.element,KW))z.throttle();else{var t=b();jW(t,e).fold(p,(function(e){C(e.toolbars,P.some(e.elem))}))}}),17);e.on("init",(function(){e.on("remove",p),e.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",v),e.on("click keyup focus SetContent",z.throttle),e.on(lW,p),e.on(sW,(function(t){var n=b();Se(n.lookupTable,t.toolbarKey).each((function(n){C([n],Pe(t.target!==e,t.target)),t_.getContent(l).each(Ew.focusIn)}))})),e.on("focusout",(function(t){k_.setEditorTimeout(e,(function(){Tf(n.element).isNone()&&Tf(l.element).isNone()&&p()}),0)})),e.on("SwitchMode",(function(){e.mode.isReadOnly()&&p()})),e.on("AfterProgressState",(function(t){t.state?p():e.hasFocus()&&z.throttle()})),e.on("NodeChange",(function(e){Tf(l.element).fold(z.throttle,h)}))}))},YW=function(e){var t=[{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}];G(t,(function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:CU(e,t.cmd),onSetup:kU(e,t.name)})})),e.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:CU(e,"JustifyNone")})},JW={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},QW=function(){var e="[0-9]+",t="[+-]?"+e,n="[eE]"+t,r="\\.",o=function(e){return"(?:"+e+")?"},i=["Infinity",e+r+o(e)+o(n),r+e+o(n),e+o(n)].join("|"),a="[+-]?(?:"+i+")";return new RegExp("^("+a+")(.*)$")}(),ZW=function(e,t){return U(t,(function(t){return U(JW[t],(function(t){return e===t}))}))},e$=function(e,t){var n=P.from(QW.exec(e));return n.bind((function(e){var n=Number(e[1]),r=e[2];return ZW(r,t)?P.some({value:n,unit:r}):P.none()}))},t$=function(e,t){return e$(e,t).map((function(e){var t=e.value,n=e.unit;return t+n}))},n$=function(e,t){var n=function(){var n=t.getOptions(e),r=t.getCurrent(e).map(t.hash),o=od();return $(n,(function(n){return{type:"togglemenuitem",text:t.display(n),onSetup:function(i){var a=function(e){e&&(o.on((function(e){return e.setActive(!1)})),o.set(i)),i.setActive(e)};a(Ee(r,t.hash(n)));var c=t.watcher(e,n,a);return function(){o.clear(),c()}},onAction:function(){return t.setCurrent(e,n)}}}))};e.ui.registry.addMenuButton(t.name,{tooltip:t.text,icon:t.icon,fetch:function(e){return e(n())},onSetup:t.onToolbarSetup}),e.ui.registry.addNestedMenuItem(t.name,{type:"nestedmenuitem",text:t.text,getSubmenuItems:n,onSetup:t.onMenuSetup})},r$={name:"lineheight",text:"Line height",icon:"line-height",getOptions:zz,hash:function(e){return t$(e,["fixed","relative","empty"]).getOr(e)},display:k,watcher:function(e,t,n){return e.formatter.formatChanged("lineheight",n,!1,{value:t}).unbind},getCurrent:function(e){return P.from(e.queryCommandValue("LineHeight"))},setCurrent:function(e,t){return e.execCommand("LineHeight",!1,t)}},o$=function(e){var t=P.from(Sz(e));return t.map((function(t){return{name:"language",text:"Language",icon:"language",getOptions:w(t),hash:function(e){return l(e.customCode)?e.code:e.code+"/"+e.customCode},display:function(e){return e.title},watcher:function(e,t,n){return e.formatter.formatChanged("lang",n,!1,{value:t.code,customValue:t.customCode}).unbind},getCurrent:function(e){var t=tt.fromDom(e.selection.getNode());return wa(t,(function(e){return P.some(e).filter(lt).bind((function(e){var t=Un(e,"lang");return t.map((function(t){var n=Un(e,"data-mce-lang").getOrUndefined();return{code:t,customCode:n,title:""}}))}))}))},setCurrent:function(e,t){return e.execCommand("Lang",!1,t)},onToolbarSetup:function(t){var n=nd();return t.setActive(e.formatter.match("lang",{},void 0,!0)),n.set(e.formatter.formatChanged("lang",t.setActive,!0)),n.clear}}}))},i$=function(e){n$(e,r$),o$(e).each((function(t){return n$(e,t)}))},a$=function(e,t){PU(e,t),UU(e,t),aq(e,t),rq(e,t),QU(e,t)},c$=function(e){return _U(e,"NodeChange",(function(t){t.setDisabled(!e.queryCommandState("outdent"))}))},u$=function(e){e.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:c$(e),onAction:CU(e,"outdent")}),e.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:CU(e,"indent")})},s$=function(e){u$(e)},l$=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},f$=function(e){QN.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],(function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:kU(e,t.name),onAction:l$(e,t.name)})}));for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:kU(e,n),onAction:l$(e,n)})}},d$=function(e){QN.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],(function(t){e.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:CU(e,t.action)})}))},m$=function(e){QN.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],(function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:CU(e,t.action),onSetup:kU(e,t.name)})}))},g$=function(e){f$(e),d$(e),m$(e)},p$=function(e){QN.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],(function(t){e.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:CU(e,t.action)})})),e.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:l$(e,"code")})},h$=function(e){g$(e),p$(e)},v$=function(e,t){return _U(e,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",(function(n){n.setDisabled(e.mode.isReadOnly()||!e.undoManager[t]())}))},y$=function(e){e.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:v$(e,"hasUndo"),onAction:CU(e,"undo")}),e.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:v$(e,"hasRedo"),onAction:CU(e,"redo")})},b$=function(e){e.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:v$(e,"hasUndo"),onAction:CU(e,"undo")}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:v$(e,"hasRedo"),onAction:CU(e,"redo")})},w$=function(e){y$(e),b$(e)},k$=function(e){return _U(e,"VisualAid",(function(t){t.setActive(e.hasVisual)}))},_$=function(e){e.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:k$(e),onAction:CU(e,"mceToggleVisualAid")})},x$=function(e){e.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:CU(e,"mceToggleVisualAid")})},C$=function(e){x$(e),_$(e)},z$=function(e,t){YW(e),h$(e),a$(e,t),w$(e),tO(e),C$(e),s$(e),i$(e)},S$=function(e,t){return{type:"makeshift",x:e,y:t}},T$=function(e,t,n){return S$(e.x+t,e.y+n)},O$=function(e){return"longpress"===e.type||0===e.type.indexOf("touch")},E$=function(e){if(O$(e)){var t=e.touches[0];return S$(t.pageX,t.pageY)}return S$(e.pageX,e.pageY)},A$=function(e){if(O$(e)){var t=e.touches[0];return S$(t.clientX,t.clientY)}return S$(e.clientX,e.clientY)},D$=function(e,t){var n=dz.DOM.getPos(e);return T$(t,n.x,n.y)},M$=function(e,t){return"contextmenu"===t.type||"longpress"===t.type?e.inline?E$(t):D$(e.getContentAreaContainer(),A$(t)):N$(e)},N$=function(e){return{type:"selection",root:tt.fromDom(e.selection.getNode())}},R$=function(e){return{type:"node",node:P.some(tt.fromDom(e.selection.getNode())),root:tt.fromDom(e.getBody())}},B$=function(e,t,n){switch(n){case"node":return R$(e);case"point":return M$(e,t);case"selection":return N$(e)}},P$=function(e,t,n,r,o,i){var a=n(),c=B$(e,t,i);WB(a,Ux.CLOSE_ON_EXECUTE,r,!1).map((function(e){t.preventDefault(),t_.showMenuAt(o,{anchor:c},{menu:{markers:mC("normal")},data:e})}))},L$={onLtr:function(){return[$l,jl,Vl,Ul,ql,Wl,m_,g_,d_,l_,f_,s_]},onRtl:function(){return[$l,Vl,jl,ql,Ul,Wl,m_,g_,f_,s_,d_,l_]}},I$=12,H$={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},F$=function(e,t){var n=e.selection;if(n.isCollapsed()||t.touches.length<1)return!1;var r=t.touches[0],o=n.getRng(),i=ng(e.getWin(),Cm.domRange(o));return i.exists((function(e){return e.left<=r.clientX&&e.right>=r.clientX&&e.top<=r.clientY&&e.bottom>=r.clientY}))},j$=function(e){var t=e.selection.getRng(),n=function(){k_.setEditorTimeout(e,(function(){e.selection.setRng(t)}),10),i()};e.once("touchend",n);var r=function(e){e.preventDefault(),e.stopImmediatePropagation()};e.on("mousedown",r,!0);var o=function(){return i()};e.once("longpresscancel",o);var i=function(){e.off("touchend",n),e.off("longpresscancel",o),e.off("mousedown",r)}},V$=function(e,t,n){var r=B$(e,t,n),o="point"===n?I$:0;return E({bubble:Md(0,o,H$),layouts:L$,overrides:{maxWidthFunction:kV(),maxHeightFunction:Td()}},r)},U$=function(e,t,n,r,o,i,a){var c=V$(e,t,i);WB(n,Ux.CLOSE_ON_EXECUTE,r,!0).map((function(n){t.preventDefault(),t_.showMenuWithinBounds(o,{anchor:c},{menu:{markers:mC("normal"),highlightImmediately:a},data:n,type:"horizontal"},(function(){return P.some(SW(e,r.shared,"node"===i?"node":"selection"))})),e.fire(lW)}))},q$=function(e,t,n,r,o,i){var a=tn(),c=a.os.isiOS(),u=a.os.isOSX(),s=a.os.isAndroid(),l=a.deviceType.isTouch(),f=function(){return!(s||c||u&&l)},d=function(){var a=n();U$(e,t,a,r,o,i,f())};if((u||c)&&"node"!==i){var m=function(){j$(e),d()};F$(e,t)?m():(e.once("selectionchange",m),e.once("touchend",(function(){return e.off("selectionchange",m)})))}else d()},W$=function(e){return"string"===typeof e?e.split(/[ ,]/):e},$$=function(e){return e.getParam("contextmenu_never_use_native",!1,"boolean")},G$=function(e,t,n){var r=e.ui.registry.getAll().contextMenus;return P.from(e.getParam(t)).map(W$).getOrThunk((function(){return Y(W$(n),(function(e){return Te(r,e)}))}))},K$=function(e){return!1===e.getParam("contextmenu")},X$=function(e){return G$(e,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},Y$=function(e){return e.getParam("contextmenu_avoid_overlap","","string")},J$=function(e){return i(e)?"|"===e:"separator"===e.type},Q$={type:"separator"},Z$=function(e){var t=function(e){return{text:e.text,icon:e.icon,disabled:e.disabled,shortcut:e.shortcut}};if(i(e))return e;switch(e.type){case"separator":return Q$;case"submenu":return E(E({type:"nestedmenuitem"},t(e)),{getSubmenuItems:function(){var t=e.getSubmenuItems();return i(t)?t:$(t,Z$)}});default:return E(E({type:"menuitem"},t(e)),{onAction:v(e.onAction)})}},eG=function(e,t){if(0===t.length)return e;var n=de(e).filter((function(e){return!J$(e)})),r=n.fold((function(){return[]}),(function(e){return[Q$]}));return e.concat(r).concat(t).concat([Q$])},tG=function(e,t,n){var r=Q(t,(function(t,r){return Se(e,r.toLowerCase()).map((function(e){var r=e.update(n);if(i(r))return eG(t,r.split(" "));if(r.length>0){var o=$(r,Z$);return eG(t,o)}return t})).getOrThunk((function(){return t.concat([r])}))}),[]);return r.length>0&&J$(r[r.length-1])&&r.pop(),r},nG=function(e,t){return t.ctrlKey&&!$$(e)},rG=function(e,t){return"longpress"!==t.type&&(2!==t.button||t.target===e.getBody()&&""===t.pointerType)},oG=function(e,t){return rG(e,t)?e.selection.getStart(!0):t.target},iG=function(e,t){var n=Y$(e),r=rG(e,t)?"selection":"point";if(Ge(n)){var o=oG(e,t),i=PO(tt.fromDom(o),n);return i?"node":r}return r},aG=function(e,t,n){var r=tn(),o=r.deviceType.isTouch,i=Ts(t_.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return e.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:mf([jw("dismissContextMenu",[Mc(gc(),(function(t,n){yp.close(t),e.focus()}))])])})),a=function(e){return t_.hide(i)},c=function(t){if($$(e)&&t.preventDefault(),!nG(e,t)&&!K$(e)){var r=iG(e,t),a=function(){var n=oG(e,t),r=e.ui.registry.getAll(),o=X$(e);return tG(r.contextMenus,o,n)},c=o()?q$:P$;c(e,t,a,n,i,r)}};e.on("init",(function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");e.on(t,a),e.on("longpress contextmenu",c)}))},cG=aa.generate([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),uG=function(e){return function(t){return t.translate(-e.left,-e.top)}},sG=function(e){return function(t){return t.translate(e.left,e.top)}},lG=function(e){return function(t,n){return Q(e,(function(e,t){return t(e)}),lr(t,n))}},fG=function(e,t,n){return e.fold(lG([sG(n),uG(t)]),lG([uG(t)]),lG([]))},dG=function(e,t,n){return e.fold(lG([sG(n)]),lG([]),lG([sG(t)]))},mG=function(e,t,n){return e.fold(lG([]),lG([uG(n)]),lG([sG(t),uG(n)]))},gG=function(e,t,n,r,o,i){var a=dG(e,o,i),c=dG(t,o,i);return Math.abs(a.left-c.left)<=n&&Math.abs(a.top-c.top)<=r},pG=function(e,t,n,r,o,i){var a=dG(e,o,i),c=dG(t,o,i),u=Math.abs(a.left-c.left),s=Math.abs(a.top-c.top);return lr(u,s)},hG=function(e,t,n){var r=e.fold((function(e,t){return{position:P.some("absolute"),left:P.some(e+"px"),top:P.some(t+"px")}}),(function(e,t){return{position:P.some("absolute"),left:P.some(e-n.left+"px"),top:P.some(t-n.top+"px")}}),(function(e,t){return{position:P.some("fixed"),left:P.some(e+"px"),top:P.some(t+"px")}}));return E({right:P.none(),bottom:P.none()},r)},vG=function(e,t,n){return e.fold((function(e,r){return bG(e+t,r+n)}),(function(e,r){return wG(e+t,r+n)}),(function(e,r){return kG(e+t,r+n)}))},yG=function(e,t,n,r){var o=function(e,o){return function(i,a){var c=e(t,n,r);return o(i.getOr(c.left),a.getOr(c.top))}};return e.fold(o(mG,bG),o(dG,wG),o(fG,kG))},bG=cG.offset,wG=cG.absolute,kG=cG.fixed,_G=function(e,t){var n=Vn(e,t);return l(n)?NaN:parseInt(n,10)},xG=function(e,t){var n=e.element,r=_G(n,t.leftAttr),o=_G(n,t.topAttr);return isNaN(r)||isNaN(o)?P.none():P.some(lr(r,o))},CG=function(e,t,n){var r=e.element;Fn(r,t.leftAttr,n.left+"px"),Fn(r,t.topAttr,n.top+"px")},zG=function(e,t){var n=e.element;Wn(n,t.leftAttr),Wn(n,t.topAttr)},SG=function(e,t,n,r){return xG(e,t).fold((function(){return n}),(function(e){return kG(e.left+r.left,e.top+r.top)}))},TG=function(e,t,n,r,o,i){var a=SG(e,t,n,r),c=t.mustSnap?AG(e,t,a,o,i):DG(e,t,a,o,i),u=fG(a,o,i);return CG(e,t,u),c.fold((function(){return{coord:kG(u.left,u.top),extra:P.none()}}),(function(e){return{coord:e.output,extra:e.extra}}))},OG=function(e,t){zG(e,t)},EG=function(e,t,n,r){return ge(e,(function(e){var o=e.sensor,i=gG(t,o,e.range.left,e.range.top,n,r);return i?P.some({output:yG(e.output,t,n,r),extra:e.extra}):P.none()}))},AG=function(e,t,n,r,o){var i=t.getSnapPoints(e),a=EG(i,n,r,o);return a.orThunk((function(){var e=Q(i,(function(e,t){var i=t.sensor,a=pG(n,i,t.range.left,t.range.top,r,o);return e.deltas.fold((function(){return{deltas:P.some(a),snap:P.some(t)}}),(function(n){var r=(a.left+a.top)/2,o=(n.left+n.top)/2;return r<=o?{deltas:P.some(a),snap:P.some(t)}:e}))}),{deltas:P.none(),snap:P.none()});return e.snap.map((function(e){return{output:yG(e.output,n,r,o),extra:e.extra}}))}))},DG=function(e,t,n,r,o){var i=t.getSnapPoints(e);return EG(i,n,r,o)},MG=function(e,t,n){return{coord:yG(e.output,e.output,t,n),extra:e.extra}},NG=function(e,t,n,r){var o=t.getTarget(e.element);if(t.repositionTarget){var i=mn(e.element),a=Lr(i),c=WH(o),u=MG(r,a,c),s=hG(u.coord,a,c);Yn(o,s)}},RG=Object.freeze({__proto__:null,snapTo:NG}),BG="data-initial-z-index",PG=function(e){vn(e.element).filter(lt).each((function(e){Un(e,BG).fold((function(){return nr(e,"z-index")}),(function(t){return Kn(e,"z-index",t)})),Wn(e,BG)}))},LG=function(e){vn(e.element).filter(lt).each((function(t){Zn(t,"z-index").each((function(e){Fn(t,BG,e)})),Kn(t,"z-index",Jn(e.element,"z-index"))}))},IG=function(e,t){e.getSystem().addToGui(t),LG(t)},HG=function(e){PG(e),e.getSystem().removeFromGui(e)},FG=function(e,t,n){return e.getSystem().build(sE.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:n}))},jG=$i("snaps",[Ei("getSnapPoints"),cl("onSensor"),Ei("leftAttr"),Ei("topAttr"),Ki("lazyViewport",Zr),Ki("mustSnap",!1)]),VG=[Ki("useFixed",S),Ei("blockerClass"),Ki("getTarget",k),Ki("onDrag",h),Ki("repositionTarget",!0),Ki("onDrop",h),ea("getBounds",Zr),jG],UG=function(e){return Re(Zn(e,"left"),Zn(e,"top"),Zn(e,"position"),(function(e,t,n){var r="fixed"===n?kG:bG;return r(parseInt(e,10),parseInt(t,10))})).getOrThunk((function(){var t=mr(e);return wG(t.left,t.top)}))},qG=function(e,t,n,r,o){var i=o.bounds,a=dG(t,n,r),c=Ol(a.left,i.x,i.x+i.width-o.width),u=Ol(a.top,i.y,i.y+i.height-o.height),s=wG(c,u);return t.fold((function(){var e=mG(s,n,r);return bG(e.left,e.top)}),w(s),(function(){var e=fG(s,n,r);return kG(e.left,e.top)}))},WG=function(e,t,n,r,o,i,a){var c=t.fold((function(){var e=vG(n,i.left,i.top),t=fG(e,r,o);return kG(t.left,t.top)}),(function(t){var a=TG(e,t,n,i,r,o);return a.extra.each((function(n){t.onSensor(e,n)})),a.coord}));return qG(e,c,r,o,a)},$G=function(e,t,n,r){var o=t.getTarget(e.element);if(t.repositionTarget){var i=mn(e.element),a=Lr(i),c=WH(o),u=UG(o),s=WG(e,t.snaps,u,a,c,r,n),l=hG(s,a,c);Yn(o,l)}t.onDrag(e,o,r)},GG=function(e,t){return{bounds:e.getBounds(),height:cr(t.element),width:yr(t.element)}},KG=function(e,t,n,r,o){var i=n.update(r,o),a=n.getStartData().getOrThunk((function(){return GG(t,e)}));i.each((function(n){$G(e,t,a,n)}))},XG=function(e,t,n,r){t.each(HG),n.snaps.each((function(t){OG(e,t)}));var o=n.getTarget(e.element);r.reset(),n.onDrop(e,o)},YG=function(e){return function(t,n){var r=function(e){n.setStartData(GG(t,e))};return Oc(D([Mc(lc(),(function(e){n.getStartData().each((function(){return r(e)}))}))],e(t,n,r),!0))}},JG=function(e){return Oc([Mc(Na(),e.forceDrop),Mc(Pa(),e.drop),Mc(Ra(),(function(t,n){e.move(n.event)})),Mc(Ba(),e.delayDrop)])},QG=function(e){return P.from(lr(e.x,e.y))},ZG=function(e,t){return lr(t.left-e.left,t.top-e.top)},eK=Object.freeze({__proto__:null,getData:QG,getDelta:ZG}),tK=function(e,t,n){return[Mc(Na(),(function(r,o){var i=o.event.raw;if(0===i.button){o.stop();var a=function(){return XG(r,P.some(s),e,t)},c=LO(a,200),u={drop:a,delayDrop:c.schedule,forceDrop:a,move:function(n){c.cancel(),KG(r,e,t,eK,n)}},s=FG(r,e.blockerClass,JG(u)),l=function(){n(r),IG(r,s)};l()}}))]},nK=D(D([],VG,!0),[fl("dragger",{handlers:YG(tK)})],!1),rK=function(e){return Oc([Mc(Ea(),e.forceDrop),Mc(Da(),e.drop),Mc(Ma(),e.drop),Mc(Aa(),(function(t,n){e.move(n.event)}))])},oK=function(e){var t=e[0];return P.some(lr(t.clientX,t.clientY))},iK=function(e){var t=e.raw,n=t.touches;return 1===n.length?oK(n):P.none()},aK=function(e,t){return lr(t.left-e.left,t.top-e.top)},cK=Object.freeze({__proto__:null,getData:iK,getDelta:aK}),uK=function(e,t,n){var r=od(),o=function(n){XG(n,r.get(),e,t),r.clear()};return[Mc(Ea(),(function(i,a){a.stop();var c=function(){return o(i)},u={drop:c,delayDrop:h,forceDrop:c,move:function(n){KG(i,e,t,cK,n)}},s=FG(i,e.blockerClass,rK(u));r.set(s);var l=function(){n(i),IG(i,s)};l()})),Mc(Aa(),(function(n,r){r.stop(),KG(n,e,t,cK,r.event)})),Mc(Da(),(function(e,t){t.stop(),o(e)})),Mc(Ma(),o)]},sK=D(D([],VG,!0),[fl("dragger",{handlers:YG(uK)})],!1),lK=function(e,t,n){return D(D([],tK(e,t,n),!0),uK(e,t,n),!0)},fK=D(D([],VG,!0),[fl("dragger",{handlers:YG(lK)})],!1),dK=nK,mK=sK,gK=fK,pK=Object.freeze({__proto__:null,mouse:dK,touch:mK,mouseOrTouch:gK}),hK=function(){var e=P.none(),t=P.none(),n=function(){e=P.none(),t=P.none()},r=function(t,n){var r=e.map((function(e){return t.getDelta(e,n)}));return e=P.some(n),r},o=function(e,t){return e.getData(t).bind((function(t){return r(e,t)}))},i=function(e){t=P.some(e)},a=function(){return t},c=w({});return zu({readState:c,reset:n,update:o,getStartData:a,setStartData:i})},vK=Object.freeze({__proto__:null,init:hK}),yK=vf({branchKey:"mode",branches:pK,name:"dragging",active:{events:function(e,t){var n=e.dragger;return n.handlers(e,t)}},extra:{snap:function(e){return{sensor:e.sensor,range:e.range,output:e.output,extra:P.from(e.extra)}}},state:vK,apis:RG}),bK=40,wK=bK/2,kK=function(e,t,n,r,o,i){return e.fold((function(){return yK.snap({sensor:wG(n-wK,r-wK),range:lr(o,i),output:wG(P.some(n),P.some(r)),extra:{td:t}})}),(function(e){var o=n-wK,i=r-wK,a=bK,c=bK,u=e.element.dom.getBoundingClientRect();return yK.snap({sensor:wG(o,i),range:lr(a,c),output:wG(P.some(n-u.width/2),P.some(r-u.height/2)),extra:{td:t}})}))},_K=function(e,t,n){var r=function(e,t){return e.exists((function(e){return sn(e,t)}))};return{getSnapPoints:e,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(e,o){var i=o.td;r(t.get(),i)||(t.set(i),n(i))},mustSnap:!0}},xK=function(e){return C_(x_.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:mf([yK.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:e}),jA.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},CK=function(e,t){var n=oa([]),r=oa([]),o=oa(!1),i=od(),a=od(),c=function(e){var n=Qr(e);return kK(m.getOpt(t),e,n.x,n.y,n.width,n.height)},u=function(){return $(n.get(),(function(e){return c(e)}))},s=function(e){var n=Qr(e);return kK(g.getOpt(t),e,n.right,n.bottom,n.width,n.height)},l=function(){return $(r.get(),(function(e){return s(e)}))},f=_K(u,i,(function(t){a.get().each((function(n){e.fire("TableSelectorChange",{start:t,finish:n})}))})),d=_K(l,a,(function(t){i.get().each((function(n){e.fire("TableSelectorChange",{start:n,finish:t})}))})),m=xK(f),g=xK(d),p=Ts(m.asSpec()),h=Ts(g.asSpec()),v=function(t,n,r,o){var i=n.dom.getBoundingClientRect();nr(t.element,"display");var a=hn(tt.fromDom(e.getBody())).dom.innerHeight,c=r(i),u=o(i,a);(c||u)&&Kn(t.element,"display","none")},y=function(e,t,n,r){var o=n(t);yK.snapTo(e,o);var i=function(e){return e[r]<0},a=function(e,t){return e[r]>t};v(e,t,i,a)},b=function(e){return y(p,e,c,"top")},w=function(){return i.get().each(b)},k=function(e){return y(h,e,s,"bottom")},_=function(){return a.get().each(k)};tn().deviceType.isTouch()&&(e.on("TableSelectionChange",(function(e){o.get()||(qg(t,p),qg(t,h),o.set(!0)),i.set(e.start),a.set(e.finish),e.otherCells.each((function(t){n.set(t.upOrLeftCells),r.set(t.downOrRightCells),b(e.start),k(e.finish)}))})),e.on("ResizeEditor ResizeWindow ScrollContent",(function(){w(),_()})),e.on("TableSelectionClear",(function(){o.get()&&(Gg(p),Gg(h),o.set(!1)),i.clear(),a.clear()})))},zK=function(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1},SK=function(e,t,n){t.delimiter||(t.delimiter="»");var r=function(r){var o=r||[],i=$(o,(function(t,r){return x_.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":r,"tab-index":-1,"aria-level":r+1},innerHtml:t.name},action:function(n){e.focus(),e.selection.select(t.element),e.nodeChanged()},buttonBehaviours:mf([mS.button(n.isDisabled),uS()])})})),a={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+t.delimiter+" "}};return Q(i.slice(1),(function(e,t){var n=e;return n.push(a),n.push(t),n}),[i[0]])},o=function(t){var n=[],r=t.length;while(r-- >0){var o=t[r];if(1===o.nodeType&&!zK(o)){var i=e.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(i.isDefaultPrevented()||n.push({name:i.name,element:o}),i.isPropagationStopped())break}}return n};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:mf([Ew.config({mode:"flow",selector:"div[role=button]"}),Lv.config({disabled:n.isDisabled}),uS(),bE.config({}),Hw.config({}),jw("elementPathEvents",[Vc((function(t,n){e.shortcuts.add("alt+F11","focus statusbar elementpath",(function(){return Ew.focusIn(t)})),e.on("NodeChange",(function(e){var n=o(e.parents);n.length>0?Hw.set(t,r(n)):Hw.set(t,[])}))}))])]),components:[]}};(function(e){e[e["None"]=0]="None",e[e["Both"]=1]="Both",e[e["Vertical"]=2]="Vertical"})(AU||(AU={}));var TK=function(e,t,n,r,o){var i={};return i.height=Zq(r+t.top,wz(e),_z(e)),n===AU.Both&&(i.width=Zq(o+t.left,bz(e),kz(e))),i},OK=function(e,t,n){var r=tt.fromDom(e.getContainer()),o=TK(e,t,n,ar(r),vr(r));ve(o,(function(e,t){return Kn(r,t,Qq(e))})),vT(e)},EK=function(e){var t=!e.hasPlugin("autoresize"),n=e.getParam("resize",t);return!1===n?AU.None:"both"===n?AU.Both:AU.Vertical},AK=function(e,t,n,r){var o=20,i=lr(n*o,r*o);return OK(e,i,t),P.some(!0)},DK=function(e,t){var n=EK(e);return n===AU.None?P.none():P.some(P_("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},behaviours:[yK.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,r,o){return OK(e,o,n)},blockerClass:"tox-blocker"}),Ew.config({mode:"special",onLeft:function(){return AK(e,n,-1,0)},onRight:function(){return AK(e,n,1,0)},onUp:function(){return AK(e,n,0,-1)},onDown:function(){return AK(e,n,0,1)}}),bE.config({}),Yw.config({})]},t.icons))},MK=function(e,t){var n,r=function(e,n,r){return Hw.set(e,[xs(t.translate(["{0} "+r,n[r]]))])};return x_.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:mf([mS.button(t.isDisabled),uS(),bE.config({}),Hw.config({}),eh.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),jw("wordcount-events",[Wc((function(e){var t=eh.getValue(e),n="words"===t.mode?"characters":"words";eh.setValue(e,{mode:n,count:t.count}),r(e,t.count,n)})),Vc((function(t){e.on("wordCountUpdate",(function(e){var n=eh.getValue(t).mode;eh.setValue(t,{mode:n,count:e.wordCount}),r(t,e.wordCount,n)}))}))])]),eventOrder:(n={},n[tc()]=["disabling","alloy.base.behaviour","wordcount-events"],n)})},NK=function(e,t){var n=function(){var e=z_.translate(["Powered by {0}","Tiny"]),t=''+e+"";return{dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:t}}},r=function(){var r=[];return e.getParam("elementpath",!0,"boolean")&&r.push(SK(e,{},t)),e.hasPlugin("wordcount")&&r.push(MK(e,t)),e.getParam("branding",!0,"boolean")&&r.push(n()),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:r}]:[]},o=function(){var n=r(),o=DK(e,t);return n.concat(o.toArray())};return{dom:{tag:"div",classes:["tox-statusbar"]},components:o()}},RK=function(e){var t,n=e.inline,r=n?uW:Yq,o=Wz(e)?IF:UH,i=P.none(),a=tn(),c=a.browser.isIE(),u=c?["tox-platform-ie"]:[],s=a.deviceType.isTouch(),l="tox-platform-touch",f=s?[l]:[],d=Lz(e),m=Uz(e),g=z_.isRtl()?{attributes:{dir:"rtl"}}:{},p={attributes:(t={},t[Ld]=d?Hf.BottomToTop:Hf.TopToBottom,t)},v=function(){return i.bind(cU.getHeader)},y=function(){return o.isDocked(v)},b=function(){Kn(Q.element,"width",document.body.clientWidth+"px")},w=function(){var e=sn(Ln(),m)&&"grid"===Jn(m,"display"),t={dom:E({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(u).concat(f)},g),behaviours:mf([Ig.config({useFixed:function(){return y()}})])},n={dom:{styles:{width:document.body.clientWidth+"px"}},events:Oc([Mc(fc(),b)])};return _o(t,e?n:{})},k=Ts(w()),_=function(){return ro.value(k)},x=C_({dom:{tag:"div",classes:["tox-anchorbar"]}}),C=function(){return i.bind((function(e){return x.getOpt(e)})).getOrDie("Could not find a anchor bar element")},z=function(){return i.bind((function(e){return cU.getToolbar(e)})).getOrDie("Could not find more toolbar element")},S=function(){return i.bind((function(e){return cU.getThrobber(e)})).getOrDie("Could not find throbber element")},T=CH(k,e,C),O=cU.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:T,onEscape:function(){e.focus()}}),A=Nz(e),D=cU.parts.toolbar(E({dom:{tag:"div",classes:["tox-toolbar"]},getSink:_,providers:T.shared.providers,onEscape:function(){e.focus()},type:A,lazyToolbar:z,lazyHeader:function(){return v().getOrDie("Could not find header element")}},p)),M=cU.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:T.shared.providers,onEscape:function(){e.focus()},type:A}),N=cU.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),R=cU.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),B=cU.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:T}),L=e.getParam("statusbar",!0,"boolean"),I=L&&!n?P.some(NK(e,T.shared.providers)):P.none(),H={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[N,R]},F=Dz(e),j=Ez(e),V=Oz(e),U=function(){return F?[M]:j?[D]:[]},q=cU.parts.header({dom:E({tag:"div",classes:["tox-editor-header"]},p),components:ne([V?[O]:[],U(),Vz(e)?[]:[x.asSpec()]]),sticky:Wz(e),editor:e,sharedBackstage:T.shared}),W=ne([d?[]:[q],n?[]:[H],d?[q]:[]]),$={dom:{tag:"div",classes:["tox-editor-container"]},components:W},G=ne([[$],n?[]:I.toArray(),[B]]),K=qz(e),X=E(E({role:"application"},z_.isRtl()?{dir:"rtl"}:{}),K?{"aria-hidden":"true"}:{}),Y=Ts(cU.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(n?["tox-tinymce-inline"]:[]).concat(d?["tox-tinymce--toolbar-bottom"]:[]).concat(f).concat(u),styles:E({visibility:"hidden"},K?{opacity:"0",border:"0"}:{}),attributes:X},components:G,behaviours:mf([uS(),Lv.config({disableClass:"tox-tinymce--disabled"}),Ew.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a, .tox-statusbar__resize-handle"})])}));i=P.some(Y),e.shortcuts.add("alt+F9","focus menubar",(function(){cU.focusMenubar(Y)})),e.shortcuts.add("alt+F10","focus toolbar",(function(){cU.focusToolbar(Y)})),e.addCommand("ToggleToolbarDrawer",(function(){cU.toggleToolbarDrawer(Y)})),e.addQueryStateHandler("ToggleToolbarDrawer",(function(){return cU.isToolbarDrawerToggled(Y)}));var J=lE(Y),Q=lE(k);zH(e,J,Q);var Z=function(){var e={broadcastAll:Q.broadcast,broadcastOn:Q.broadcastOn,register:h};return{channels:e}},ee=function(){var t=Qq(tW(e)),n=Qq(rW(e));return e.inline||(tr("div","width",n)&&Kn(Y.element,"width",n),tr("div","height",t)?Kn(Y.element,"height",t):Kn(Y.element,"height","200px")),t},te=function(){o.setup(e,T.shared,v),z$(e,T),aG(e,_,T),Mj(e),iV(e,S,T.shared),ye(Bz(e),(function(t,n){e.ui.registry.addGroupToolbarButton(n,t)}));var t=e.ui.registry.getAll(),n=t.buttons,i=t.menuItems,a=t.contextToolbars,c=t.sidebars,u=Az(e),s={menuItems:i,menus:Kz(e),menubar:Xz(e),toolbar:u.getOrThunk((function(){return Yz(e)})),allowToolbarGroups:A===Vx.floating,buttons:n,sidebar:c};XW(e,a,k,{backstage:T}),CK(e,k);var l=e.getElement(),f=ee(),d={mothership:J,uiMothership:Q,outerContainer:Y},m={targetNode:l,height:f};return r.render(e,d,s,T,m)};return{mothership:J,uiMothership:Q,backstage:T,renderUI:te,getUi:Z}},BK=function(e,t){var n=P.from(Vn(e,"id")).fold((function(){var e=ou("dialog-describe");return Fn(t,"id",e),e}),k);Fn(e,"aria-describedby",n)},PK=function(e,t){var n=Un(e,"id").fold((function(){var e=ou("dialog-label");return Fn(t,"id",e),e}),k);Fn(e,"aria-labelledby",n)},LK=w([Ei("lazySink"),Fi("dragBlockClass"),ea("getBounds",Zr),Ki("useTabstopAt",T),Ki("eventOrder",{}),th("modalBehaviours",[Ew]),ul("onExecute"),ll("onEscape")]),IK={sketch:k},HK=w([Bh({name:"draghandle",overrides:function(e,t){return{behaviours:mf([yK.config({mode:"mouse",getTarget:function(e){return Ps(e,'[role="dialog"]').getOr(e)},blockerClass:e.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:e.getDragBounds})])}}}),Nh({schema:[Ei("dom")],name:"title"}),Nh({factory:IK,schema:[Ei("dom")],name:"close"}),Nh({factory:IK,schema:[Ei("dom")],name:"body"}),Bh({factory:IK,schema:[Ei("dom")],name:"footer"}),Rh({factory:{sketch:function(e,t){return E(E({},e),{dom:t.dom,components:t.components})}},schema:[Ki("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Ki("components",[])],name:"blocker"})]),FK=function(e,t,n,r){var o,i=od(),a=function(t){i.set(t);var n=e.lazySink(t).getOrDie(),o=r.blocker(),a=n.getSystem().build(E(E({},o),{components:o.components.concat([Os(t)]),behaviours:mf([Yw.config({}),jw("dialog-blocker-events",[jc(Ia(),(function(){Ew.focusIn(t)}))])])}));qg(n,a),Ew.focusIn(t)},c=function(e){i.clear(),vn(e.element).each((function(t){e.getSystem().getByDom(t).each((function(e){Gg(e)}))}))},u=function(t){return Xh(t,e,"body")},s=function(t){return Xh(t,e,"footer")},l=function(e,t){Kj.block(e,t)},f=function(e){Kj.unblock(e)},d=ou("modal-events"),m=E(E({},e.eventOrder),(o={},o[dc()]=[d].concat(e.eventOrder["alloy.system.attached"]||[]),o));return{uid:e.uid,dom:e.dom,components:t,apis:{show:a,hide:c,getBody:u,getFooter:s,setIdle:f,setBusy:l},eventOrder:m,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:rh(e.modalBehaviours,[Hw.config({}),Ew.config({mode:"cyclic",onEnter:e.onExecute,onEscape:e.onEscape,useTabstopAt:e.useTabstopAt}),Kj.config({getRoot:i.get}),jw(d,[Vc((function(t){PK(t.element,Xh(t,e,"title").element),BK(t.element,Xh(t,e,"body").element)}))])])}},jK=mv({name:"ModalDialog",configFields:LK(),partFields:HK(),factory:FK,apis:{show:function(e,t){e.show(t)},hide:function(e,t){e.hide(t)},getBody:function(e,t){return e.getBody(t)},getFooter:function(e,t){return e.getFooter(t)},setBusy:function(e,t,n){e.setBusy(t,n)},setIdle:function(e,t){e.setIdle(t)}}}),VK=ei([Mi("type"),Mi("name")].concat(NC)),UK=li,qK=[Si("name","name",zo((function(){return ou("button-name")})),si),Ui("icon"),Qi("align","end",["start","end"]),Zi("primary",!1),Zi("disabled",!1)],WK=D(D([],qK,!0),[Mi("text")],!1),$K=D([Ni("type",["submit","cancel","custom"])],WK,!0),GK=D([Ni("type",["menu"]),Ui("text"),Ui("tooltip"),Ui("icon"),Hi("items",VK)],qK,!0),KK=Ci("type",{submit:$K,cancel:$K,custom:$K,menu:GK}),XK=[Mi("type"),Mi("text"),Ni("level",["info","warn","error","success"]),Mi("icon"),Ki("url","")],YK=ei(XK),JK=function(e){return[Mi("type"),e]},QK=[Mi("type"),Mi("text"),Zi("disabled",!1),Zi("primary",!1),Si("name","name",zo((function(){return ou("button-name")})),si),Ui("icon"),Zi("borderless",!1)],ZK=ei(QK),eX=[Mi("type"),Mi("name"),Mi("label"),Zi("disabled",!1)],tX=ei(eX),nX=li,rX=[Mi("type"),Mi("name")],oX=rX.concat([Ui("label")]),iX=oX.concat([Ki("columns","auto")]),aX=ei(iX),cX=ii([Mi("value"),Mi("text"),Mi("icon")]),uX=oX,sX=ei(uX),lX=si,fX=oX,dX=ei(fX),mX=si,gX=rX.concat([Ji("tag","textarea"),Mi("scriptId"),Mi("scriptUrl"),ta("settings",void 0)]),pX=rX.concat([Ji("tag","textarea"),Bi("init")]),hX=vi((function(e){return wi("customeditor.old",Zo(pX),e).orThunk((function(){return wi("customeditor.new",Zo(gX),e)}))})),vX=si,yX=oX,bX=ei(yX),wX=hi(),kX=function(e){return[Mi("type"),Di("columns"),e]},_X=[Mi("type"),Mi("html"),Qi("presets","presentation",["presentation","document"])],xX=ei(_X),CX=oX.concat([Zi("sandboxed",!0)]),zX=ei(CX),SX=si,TX=oX.concat([Ai("currentState",ei([Ei("blob"),Mi("url")]))]),OX=ei(TX),EX=oX.concat([Ui("inputMode"),Ui("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),AX=ei(EX),DX=si,MX=function(e){return[Mi("type"),Mi("label"),e]},NX=[Mi("text"),Mi("value")],RX=[Mi("text"),Hi("items",zi("items",(function(){return BX})))],BX=ni([ei(NX),ei(RX)]),PX=oX.concat([Hi("items",BX),Zi("disabled",!1)]),LX=ei(PX),IX=si,HX=oX.concat([Ii("items",[Mi("text"),Mi("value")]),Yi("size",1),Zi("disabled",!1)]),FX=ei(HX),jX=si,VX=oX.concat([Zi("constrain",!0),Zi("disabled",!1)]),UX=ei(VX),qX=ei([Mi("width"),Mi("height")]),WX=[Mi("type"),Hi("header",si),Hi("cells",ti(si))],$X=ei(WX),GX=oX.concat([Ui("placeholder"),Zi("maximized",!1),Zi("disabled",!1)]),KX=ei(GX),XX=si,YX=oX.concat([Qi("filetype","file",["image","media","file"]),Ki("disabled",!1)]),JX=ei(YX),QX=ei([Mi("value"),Ki("meta",{})]),ZX=function(e){return Si("items","items",Co(),ti(vi((function(t){return wi("Checking item of "+e,eY,t).fold((function(e){return ro.error(xi(e))}),(function(e){return ro.value(e)}))}))))},eY=Jo((function(){return pi("type",{alertbanner:YK,bar:ei(JK(ZX("bar"))),button:ZK,checkbox:tX,colorinput:sX,colorpicker:dX,dropzone:bX,grid:ei(kX(ZX("grid"))),iframe:zX,input:AX,listbox:LX,selectbox:FX,sizeinput:UX,textarea:KX,urlinput:JX,customeditor:hX,htmlpanel:xX,imagetools:OX,collection:aX,label:ei(MX(ZX("label"))),table:$X,panel:nY})})),tY=[Mi("type"),Ki("classes",[]),Hi("items",eY)],nY=ei(tY),rY=[Si("name","name",zo((function(){return ou("tab-name")})),si),Mi("title"),Hi("items",eY)],oY=[Mi("type"),Ii("tabs",rY)],iY=ei(oY),aY=WK,cY=KK,uY=ei([Mi("title"),Ai("body",pi("type",{panel:nY,tabpanel:iY})),Ji("size","normal"),Hi("buttons",cY),Ki("initialData",{}),ea("onAction",h),ea("onChange",h),ea("onSubmit",h),ea("onClose",h),ea("onCancel",h),Ki("onTabChange",h)]),sY=function(e){return wi("dialog",uY,e)},lY=ei(D([Ni("type",["cancel","custom"])],aY,!0)),fY=ei([Mi("title"),Mi("url"),Vi("height"),Vi("width"),Wi("buttons",lY),ea("onAction",h),ea("onCancel",h),ea("onClose",h),ea("onMessage",h)]),dY=function(e){return wi("dialog",fY,e)},mY=function(e){return a(e)?[e].concat(re(ze(e),mY)):c(e)?re(e,mY):[]},gY=function(e){return i(e.type)&&i(e.name)},pY={checkbox:nX,colorinput:lX,colorpicker:mX,dropzone:wX,input:DX,iframe:SX,sizeinput:qX,selectbox:jX,listbox:IX,size:qX,textarea:XX,urlinput:QX,customeditor:vX,collection:cX,togglemenuitem:UK},hY=function(e){return P.from(pY[e.type])},vY=function(e){return Y(mY(e),gY)},yY=function(e){var t=vY(e),n=re(t,(function(e){return hY(e).fold((function(){return[]}),(function(t){return[Ai(e.name,t)]}))}));return ei(n)},bY=function(e){var t=ki(sY(e)),n=yY(e),r=e.initialData;return{internalDialog:t,dataValidator:n,initialData:r}},wY={open:function(e,t){var n=bY(t);return e(n.internalDialog,n.initialData,n.dataValidator)},openUrl:function(e,t){var n=ki(dY(t));return e(n)},redial:function(e){return bY(e)}},kY=function(e){var t=[],n={};return ve(e,(function(e,r){e.fold((function(){t.push(r)}),(function(e){n[r]=e}))})),t.length>0?ro.error(t):ro.value(n)},_Y=function(e,t){var n=C_(NN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:$(e.items,(function(e){return cI(n,e,t)}))}})));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:mf([Ew.config({mode:"acyclic",useTabstopAt:C(vR)}),qN.memento(n),aR.memento(n,{postprocess:function(e){return kY(e).fold((function(e){return console.error(e),{}}),k)}})])}},xY=function(e,t){return{uid:e.uid,dom:e.dom,components:e.components,events:vk(e.action),behaviours:rh(e.tabButtonBehaviours,[Yw.config({}),Ew.config({mode:"execution",useSpace:!0,useEnter:!0}),eh.config({store:{mode:"memory",initialValue:e.value}})]),domModification:e.domModification}},CY=dv({name:"TabButton",configFields:[Ki("uid",void 0),Ei("value"),Si("dom","dom",Oo((function(){return{attributes:{role:"tab",id:ou("aria"),"aria-selected":"false"}}})),ai()),Fi("action"),Ki("domModification",{}),th("tabButtonBehaviours",[Yw,Ew,eh]),Ei("view")],factory:xY}),zY=w([Ei("tabs"),Ei("dom"),Ki("clickToDismiss",!1),th("tabbarBehaviours",[ry,Ew]),il(["tabClass","selectedClass"])]),SY=Ph({factory:CY,name:"tabs",unit:"tab",overrides:function(e){var t=function(e,t){ry.dehighlight(e,t),xc(e,bc(),{tabbar:e,button:t})},n=function(e,t){ry.highlight(e,t),xc(e,yc(),{tabbar:e,button:t})};return{action:function(r){var o=r.getSystem().getByUid(e.uid).getOrDie(),i=ry.isHighlighted(o,r),a=function(){return i&&e.clickToDismiss?t:i?h:n}();a(o,r)},domModification:{classes:[e.markers.tabClass]}}}}),TY=w([SY]),OY=function(e,t,n,r){return{uid:e.uid,dom:e.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:rh(e.tabbarBehaviours,[ry.config({highlightClass:e.markers.selectedClass,itemClass:e.markers.tabClass,onHighlight:function(e,t){Fn(t.element,"aria-selected","true")},onDehighlight:function(e,t){Fn(t.element,"aria-selected","false")}}),Ew.config({mode:"flow",getInitial:function(e){return ry.getHighlighted(e).map((function(e){return e.element}))},selector:"."+e.markers.tabClass,executeOnMove:!0})])}},EY=mv({name:"Tabbar",configFields:zY(),partFields:TY(),factory:OY}),AY=function(e,t){return{uid:e.uid,dom:e.dom,behaviours:rh(e.tabviewBehaviours,[Hw.config({})]),domModification:{attributes:{role:"tabpanel"}}}},DY=dv({name:"Tabview",configFields:[th("tabviewBehaviours",[Hw])],factory:AY}),MY=w([Ki("selectFirst",!0),cl("onChangeTab"),cl("onDismissTab"),Ki("tabs",[]),th("tabSectionBehaviours",[])]),NY=Nh({factory:EY,schema:[Ei("dom"),Li("markers",[Ei("tabClass"),Ei("selectedClass")])],name:"tabbar",defaults:function(e){return{tabs:e.tabs}}}),RY=Nh({factory:DY,name:"tabview"}),BY=w([NY,RY]),PY=function(e,t,n,r){var o=function(t){var n=eh.getValue(t);Kh(t,e,"tabview").each((function(r){var o=ee(e.tabs,(function(e){return e.value===n}));o.each((function(n){var o=n.view();Un(t.element,"id").each((function(e){Fn(r.element,"aria-labelledby",e)})),Hw.set(r,o),e.onChangeTab(r,t,o)}))}))},i=function(t,n){Kh(t,e,"tabbar").each((function(e){n(e).each(Cc)}))};return{uid:e.uid,dom:e.dom,components:t,behaviours:nh(e.tabSectionBehaviours),events:Oc(ne([e.selectFirst?[Vc((function(e,t){i(e,ry.getFirst)}))]:[],[Mc(yc(),(function(e,t){var n=t.event.button;o(n)})),Mc(bc(),(function(t,n){var r=n.event.button;e.onDismissTab(t,r)}))]])),apis:{getViewItems:function(t){return Kh(t,e,"tabview").map((function(e){return Hw.contents(e)})).getOr([])},showTab:function(e,t){var n=function(e){var n=ry.getCandidates(e),r=ee(n,(function(e){return eh.getValue(e)===t}));return r.filter((function(t){return!ry.isHighlighted(e,t)}))};i(e,n)}}}},LY=mv({name:"TabSection",configFields:MY(),partFields:BY(),factory:PY,apis:{getViewItems:function(e,t){return e.getViewItems(t)},showTab:function(e,t,n){e.showTab(t,n)}}}),IY=function(e,t,n){return $(e,(function(r,o){Hw.set(n,e[o].view());var i=t.dom.getBoundingClientRect();return Hw.set(n,[]),i.height}))},HY=function(e){return fe(se(e,(function(e,t){return e>t?-1:e=n.dom.offsetLeft+vr(n),s=u?Math.max(ar(n),c):c,l=parseInt(Jn(e,"margin-top"),10)||0,f=parseInt(Jn(e,"margin-bottom"),10)||0,d=ar(e)+l+f,m=d-s;return r-m},jY=function(e,t){fe(e).each((function(e){return LY.showTab(t,e.value)}))},VY=function(e,t){Kn(e,"height",t+"px"),tn().browser.isIE()?nr(e,"flex-basis"):Kn(e,"flex-basis",t+"px")},UY=function(e,t,n){Ps(e,'[role="dialog"]').each((function(e){Is(e,'[role="tablist"]').each((function(r){n.get().map((function(n){return Kn(t,"height","0"),Kn(t,"flex-basis","0"),Math.min(n,FY(e,t,r))})).each((function(e){VY(t,e)}))}))}))},qY=function(e){return Is(e,'[role="tabpanel"]')},WY=function(e){var t=function(){var t=od(),n=[Vc((function(n){var r=n.element;qY(r).each((function(o){Kn(o,"visibility","hidden"),n.getSystem().getByDom(o).toOptional().each((function(n){var r=IY(e,o,n),i=HY(r);i.fold(t.clear,t.set)})),UY(r,o,t),nr(o,"visibility"),jY(e,n),k_.requestAnimationFrame((function(){UY(r,o,t)}))}))})),Mc(fc(),(function(e){var n=e.element;qY(n).each((function(e){UY(n,e,t)}))})),Mc(BE,(function(e,n){var r=e.element;qY(r).each((function(e){var n=Sf(En(e));Kn(e,"visibility","hidden");var o=Zn(e,"height").map((function(e){return parseInt(e,10)}));nr(e,"height"),nr(e,"flex-basis");var i=e.dom.getBoundingClientRect().height,a=o.forall((function(e){return i>e}));a?(t.set(i),UY(r,e,t)):o.each((function(t){VY(e,t)})),nr(e,"visibility"),n.each(xf)}))}))],r=!1;return{extraEvents:n,selectFirst:r}}(),n=function(){var e=[],t=!0;return{extraEvents:e,selectFirst:t}}();return{smartTabHeight:t,naiveTabHeight:n}},$Y="send-data-to-section",GY="send-data-to-view",KY=function(e,t){var n=oa({}),r=function(e){var t=eh.getValue(e),r=kY(t).getOr({}),o=n.get(),i=_o(o,r);n.set(i)},o=function(e){var t=n.get();eh.setValue(e,t)},i=oa(null),a=$(e.tabs,(function(e){return{value:e.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:t.shared.providers.translate(e.title)},view:function(){return[NN.sketch((function(n){return{dom:{tag:"div",classes:["tox-form"]},components:$(e.items,(function(e){return cI(n,e,t)})),formBehaviours:mf([Ew.config({mode:"acyclic",useTabstopAt:C(vR)}),jw("TabView.form.events",[Vc(o),Uc(r)]),bf.config({channels:ga([{key:$Y,value:{onReceive:r}},{key:GY,value:{onReceive:o}}])})])}}))]}}})),c=WY(a).smartTabHeight;return LY.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(e,t,n){var r=eh.getValue(t);xc(e,RE,{name:r,oldName:i.get()}),i.set(r)},tabs:a,components:[LY.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[EY.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:mf([bE.config({})])}),LY.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:c.selectFirst,tabSectionBehaviours:mf([jw("tabpanel",c.extraEvents),Ew.config({mode:"acyclic"}),yv.config({find:function(e){return fe(LY.getViewItems(e))}}),eh.config({store:{mode:"manual",getValue:function(e){return e.getSystem().broadcastOn([$Y],{}),n.get()},setValue:function(e,t){n.set(t),e.getSystem().broadcastOn([GY],{})}}})])})},XY=ou("update-dialog"),YY=ou("update-title"),JY=ou("update-body"),QY=ou("update-footer"),ZY=ou("body-send-message"),eJ=function(e,t,n,r){var o=function(e){switch(e.body.type){case"tabpanel":return[KY(e.body,n)];default:return[_Y(e.body,n)]}},i=function(e,t){return P.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},a={"aria-live":"polite"};return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:E(E({},t.map((function(e){return{id:e}})).getOr({})),r?a:{})},components:[],behaviours:mf([qN.childAt(0),gq.config({channel:JY,updateState:i,renderComponents:o,initialData:e})])}},tJ=function(e,t,n,r){return eJ(e,P.some(t),n,r)},nJ=function(e,t){var n=eJ(e,P.none(),t,!1);return jK.parts.body(n)},rJ=function(e){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[gR({dom:{tag:"iframe",attributes:{src:e.url}},behaviours:mf([bE.config({}),Yw.config({})])})]}],behaviours:mf([Ew.config({mode:"acyclic",useTabstopAt:C(vR)})])};return jK.parts.body(t)},oJ=_S.deviceType.isTouch(),iJ=function(e,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[e,t]}},aJ=function(e,t){return jK.parts.close(x_.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:e,buttonBehaviours:mf([bE.config({})])}))},cJ=function(){return jK.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},uJ=function(e,t){return jK.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Jj("

"+t.translate(e)+"

")}]}]})},sJ=function(e){return jK.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:e})},lJ=function(e,t){return[sE.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:e}),sE.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]},fJ=function(e){var t,n="tox-dialog",r=n+"-wrap",o=r+"__backdrop",i=n+"__disable-scroll";return jK.sketch({lazySink:e.lazySink,onEscape:function(t){return e.onEscape(t),P.some(!0)},useTabstopAt:function(e){return!vR(e)},dom:{tag:"div",classes:[n].concat(e.extraClasses),styles:E({position:"relative"},e.extraStyles)},components:D([e.header,e.body],e.footer.toArray(),!0),parts:{blocker:{dom:Jj('
'),components:[{dom:{tag:"div",classes:oJ?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:r,modalBehaviours:mf(D([Yw.config({}),jw("dialog-events",e.dialogEvents.concat([jc(Ia(),(function(e,t){Ew.focusIn(e)}))])),jw("scroll-lock",[Vc((function(){is(Ln(),i)})),Uc((function(){cs(Ln(),i)}))])],e.extraBehaviours,!0)),eventOrder:E((t={},t[tc()]=["dialog-events"],t[dc()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[mc()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),e.eventOrder)})},dJ=function(e){return x_.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":e.translate("Close"),title:e.translate("Close")}},components:[P_("close",{tag:"div",classes:["tox-icon"]},e.icons)],action:function(e){_c(e,EE)}})},mJ=function(e,t,n){var r=function(e){return[xs(n.translate(e.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:E({},t.map((function(e){return{id:e}})).getOr({}))},components:r(e),behaviours:mf([gq.config({channel:YY,renderComponents:r})])}},gJ=function(){return{dom:Jj('
')}},pJ=function(e,t,n){return sE.sketch({dom:Jj('
'),components:[mJ(e,P.some(t),n),gJ(),dJ(n)],containerBehaviours:mf([yK.config({mode:"mouse",blockerClass:"blocker",getTarget:function(e){return Hs(e,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})},hJ=function(e,t){var n=jK.parts.title(mJ(e,P.none(),t)),r=jK.parts.draghandle(gJ()),o=jK.parts.close(dJ(t)),i=[n].concat(e.draggable?[r]:[]).concat([o]);return sE.sketch({dom:Jj('
'),components:i})},vJ=function(e,t){return hJ({title:t.shared.providers.translate(e),draggable:t.dialog.isDraggableModal()},t.shared.providers)},yJ=function(e,t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":n.translate(e)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:Jj('
')}]}},bJ=function(e,t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(n){jK.setBusy(e(),(function(e,r){return yJ(n.message,r,t)}))},onUnblock:function(){jK.setIdle(e())}}},wJ=function(e,t,n,r){var o,i=function(e,t){return P.some(t)};return Ts(fJ(E(E({},e),{lazySink:r.shared.getSink,extraBehaviours:D([gq.config({channel:XY,updateState:i,initialData:t}),aR.memory({})],e.extraBehaviours,!0),onEscape:function(e){_c(e,EE)},dialogEvents:n,eventOrder:(o={},o[ec()]=[gq.name(),bf.name()],o[dc()]=["scroll-lock",gq.name(),"messages","dialog-events","alloy.base.behaviour"],o[mc()]=["alloy.base.behaviour","dialog-events","messages",gq.name(),"scroll-lock"],o)})))},kJ=function(e){var t=function(e){var t=$(e.items,(function(e){var t=oa(!1);return E(E({},e),{storage:t})}));return E(E({},e),{items:t})};return $(e,(function(e){return"menu"===e.type?t(e):e}))},_J=function(e){return Q(e,(function(e,t){if("menu"===t.type){var n=t;return Q(n.items,(function(e,t){return e[t.name]=t.storage,e}),e)}return e}),{})},xJ=function(e,t){return[Ic(Ia(),hR),e(OE,(function(e,n){t.onClose(),n.onClose()})),e(EE,(function(e,t,n,r){t.onCancel(e),_c(r,OE)})),Mc(NE,(function(e,n){return t.onUnblock()})),Mc(ME,(function(e,n){return t.onBlock(n.event)}))]},CJ=function(e,t){var n=function(t,n){return Mc(t,(function(t,o){r(t,(function(r,i){n(e(),r,o.event,t)}))}))},r=function(e,t){gq.getState(e).get().each((function(n){t(n,e)}))};return D(D([],xJ(n,t),!0),[n(AE,(function(e,t,n){t.onAction(e,{name:n.name})}))],!1)},zJ=function(e,t,n){var r=function(t,n){return Mc(t,(function(t,r){o(t,(function(o,i){n(e(),o,r.event,t)}))}))},o=function(e,t){gq.getState(e).get().each((function(n){t(n.internalDialog,e)}))};return D(D([],xJ(r,t),!0),[r(DE,(function(e,t){return t.onSubmit(e)})),r(TE,(function(e,t,n){t.onChange(e,{name:n.name})})),r(AE,(function(e,t,r,o){var i=function(){return Ew.focusIn(o)},a=function(e){return qn(e,"disabled")||Un(e,"aria-disabled").exists((function(e){return"true"===e}))},c=En(o.element),u=Sf(c);t.onAction(e,{name:r.name,value:r.value}),Sf(c).fold(i,(function(e){a(e)||u.exists((function(t){return dn(e,t)&&a(t)}))?i():n().toOptional().filter((function(t){return!dn(t.element,e)})).each(i)}))})),r(RE,(function(e,t,n){t.onTabChange(e,{newTabName:n.name,oldTabName:n.oldName})})),Uc((function(t){var n=e();eh.setValue(t,n.getData())}))],!1)},SJ={initUrlDialog:CJ,initDialog:zJ},TJ=function(e,t){return rP(e,e.type,t)},OJ=function(e,t,n){return ee(t,(function(e){return e.name===n})).bind((function(t){return t.memento.getOpt(e)}))},EJ=function(e,t){var n=t.map((function(e){return e.footerButtons})).getOr([]),r=X(n,(function(e){return"start"===e.align})),o=function(e,t){return sE.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+e]},components:$(t,(function(e){return e.memento.asSpec()}))})},i=o("start",r.pass),a=o("end",r.fail);return[i,a]},AJ=function(e,t){var n=function(e,n){var r=$(n.buttons,(function(e){var n=C_(TJ(e,t));return{name:e.name,align:e.align,memento:n}})),o=function(e,t){return OJ(e,r,t)};return P.some({lookupByName:o,footerButtons:r})};return{dom:Jj(''),components:[],behaviours:mf([gq.config({channel:QY,initialData:e,updateState:n,renderComponents:EJ})])}},DJ=function(e,t){return AJ(e,t)},MJ=function(e,t){return jK.parts.footer(AJ(e,t))},NJ=function(e,t){var n=e.getRoot();if(n.getSystem().isConnected()){var r=yv.getCurrent(e.getFormWrapper()).getOr(e.getFormWrapper());return NN.getField(r,t).fold((function(){var n=e.getFooter(),o=gq.getState(n);return o.get().bind((function(e){return e.lookupByName(r,t)}))}),(function(e){return P.some(e)}))}return P.none()},RJ=function(e,t){var n=e.getRoot();return gq.getState(n).get().map((function(e){return ki(wi("data",e.dataValidator,t))})).getOr(t)},BJ=function(e,t,n){var r=function(t){var n=e.getRoot();n.getSystem().isConnected()&&t(n)},o=function(){var t=e.getRoot(),r=t.getSystem().isConnected()?e.getFormWrapper():t,o=eh.getValue(r),i=ye(n,(function(e){return e.get()}));return E(E({},o),i)},a=function(t){r((function(r){var o=p.getData(),i=E(E({},o),t),a=RJ(e,i),c=e.getFormWrapper();eh.setValue(c,a),ve(n,(function(e,t){Te(i,t)&&e.set(i[t])}))}))},c=function(t){NJ(e,t).each(Lv.disable)},u=function(t){NJ(e,t).each(Lv.enable)},s=function(t){NJ(e,t).each(Yw.focus)},l=function(e){if(!i(e))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");r((function(t){xc(t,ME,{message:e})}))},f=function(){r((function(e){_c(e,NE)}))},d=function(t){r((function(n){var r=e.getBody(),o=gq.getState(r);o.get().exists((function(e){return e.isTabPanel()}))&&yv.getCurrent(r).each((function(e){LY.showTab(e,t)}))}))},m=function(e){r((function(n){var r=t(e);n.getSystem().broadcastOn([XY],r),n.getSystem().broadcastOn([YY],r.internalDialog),n.getSystem().broadcastOn([JY],r.internalDialog),n.getSystem().broadcastOn([QY],r.internalDialog),p.setData(r.initialData)}))},g=function(){r((function(e){_c(e,OE)}))},p={getData:o,setData:a,disable:c,enable:u,focus:s,block:l,unblock:f,showTab:d,redial:m,close:g};return p},PJ=function(e){switch(e){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}},LJ=function(e,t,n){var r=vJ(e.internalDialog.title,n),o=nJ({body:e.internalDialog.body},n),i=kJ(e.internalDialog.buttons),a=_J(i),c=MJ({buttons:i},n),u=SJ.initDialog((function(){return m}),bJ((function(){return f}),n.shared.providers,t),n.shared.getSink),s=PJ(e.internalDialog.size),l={header:r,body:o,footer:P.some(c),extraClasses:s,extraBehaviours:[],extraStyles:{}},f=wJ(l,e,u,n),d=function(){var e=function(){var e=jK.getBody(f);return yv.getCurrent(e).getOr(e)};return{getRoot:w(f),getBody:function(){return jK.getBody(f)},getFooter:function(){return jK.getFooter(f)},getFormWrapper:e}}(),m=BJ(d,t.redial,a);return{dialog:f,instanceApi:m}},IJ=function(e,t,n,r){var o,i,a=ou("dialog-label"),c=ou("dialog-content"),u=function(e,t){return P.some(t)},s=C_(pJ({title:e.internalDialog.title,draggable:!0},a,n.shared.providers)),l=C_(tJ({body:e.internalDialog.body},c,n,r)),f=kJ(e.internalDialog.buttons),d=_J(f),m=C_(DJ({buttons:f},n)),g=SJ.initDialog((function(){return h}),{onBlock:function(e){Kj.block(p,(function(t,r){return yJ(e.message,r,n.shared.providers)}))},onUnblock:function(){Kj.unblock(p)},onClose:function(){return t.closeWindow()}},n.shared.getSink),p=Ts({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(o={role:"dialog"},o["aria-labelledby"]=a,o["aria-describedby"]=c,o)},eventOrder:(i={},i[ec()]=[gq.name(),bf.name()],i[tc()]=["execute-on-form"],i[dc()]=["reflecting","execute-on-form"],i),behaviours:mf([Ew.config({mode:"cyclic",onEscape:function(e){return _c(e,OE),P.some(!0)},useTabstopAt:function(e){return!vR(e)&&("button"!==ct(e)||"disabled"!==Vn(e,"disabled"))}}),gq.config({channel:XY,updateState:u,initialData:e}),Yw.config({}),jw("execute-on-form",g.concat([jc(Ia(),(function(e,t){Ew.focusIn(e)}))])),Kj.config({getRoot:function(){return P.some(p)}}),Hw.config({}),aR.memory({})]),components:[s.asSpec(),l.asSpec(),m.asSpec()]}),h=BJ({getRoot:w(p),getFooter:function(){return m.get(p)},getBody:function(){return l.get(p)},getFormWrapper:function(){var e=l.get(p);return yv.getCurrent(e).getOr(e)}},t.redial,d);return{dialog:p,instanceApi:h}},HJ=tinymce.util.Tools.resolve("tinymce.util.URI"),FJ=function(e){var t=function(t){e.getSystem().isConnected()&&t(e)},n=function(e){if(!i(e))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t((function(t){xc(t,ME,{message:e})}))},r=function(){t((function(e){_c(e,NE)}))},o=function(){t((function(e){_c(e,OE)}))},a=function(e){t((function(t){t.getSystem().broadcastOn([ZY],e)}))};return{block:n,unblock:r,close:o,sendMessage:a}},jJ=["insertContent","setContent","execCommand","close","block","unblock"],VJ=function(e){return a(e)&&-1!==jJ.indexOf(e.mceAction)},UJ=function(e){return!VJ(e)&&a(e)&&Te(e,"mceAction")},qJ=function(e,t,n){switch(n.mceAction){case"insertContent":e.insertContent(n.content);break;case"setContent":e.setContent(n.content);break;case"execCommand":var r=!!s(n.ui)&&n.ui;e.execCommand(n.cmd,r,n.value);break;case"close":t.close();break;case"block":t.block(n.message);break;case"unblock":t.unblock();break}},WJ=function(e,t,n,r){var o,i=vJ(e.title,r),a=rJ(e),c=e.buttons.bind((function(e){return 0===e.length?P.none():P.some(MJ({buttons:e},r))})),u=SJ.initUrlDialog((function(){return v}),bJ((function(){return h}),r.shared.providers,t)),s=E(E({},e.height.fold((function(){return{}}),(function(e){return{height:e+"px","max-height":e+"px"}}))),e.width.fold((function(){return{}}),(function(e){return{width:e+"px","max-width":e+"px"}}))),l=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],f=new HJ(e.url,{base_uri:new HJ(window.location.href)}),d=f.protocol+"://"+f.host+(f.port?":"+f.port:""),m=nd(),g=[jw("messages",[Vc((function(){var t=ad(tt.fromDom(window),"message",(function(t){if(f.isSameOrigin(new HJ(t.raw.origin))){var r=t.raw.data;VJ(r)?qJ(n,v,r):UJ(r)&&e.onMessage(v,r)}}));m.set(t)})),Uc(m.clear)]),bf.config({channels:(o={},o[ZY]={onReceive:function(e,t){Is(e.element,"iframe").each((function(e){var n=e.dom.contentWindow;n.postMessage(t,d)}))}},o)})],p={header:i,body:a,footer:c,extraClasses:l,extraBehaviours:g,extraStyles:s},h=wJ(p,e,u,r),v=FJ(h);return{dialog:h,instanceApi:v}},$J=function(e){var t=e.backstage.shared,n=function(n,r){var o=function(){jK.hide(u),r()},i=C_(rP({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:P.none()},"cancel",e.backstage)),a=cJ(),c=aJ(o,t.providers),u=Ts(fJ({lazySink:function(){return t.getSink()},header:iJ(a,c),body:uJ(n,t.providers),footer:P.some(sJ(lJ([],[i.asSpec()]))),onEscape:o,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Mc(EE,o)],eventOrder:{}}));jK.show(u);var s=i.get(u);Yw.focus(s)};return{open:n}},GJ=function(e){var t=e.backstage.shared,n=function(n,r){var o=function(e){jK.hide(s),r(e)},i=C_(rP({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:P.none()},"submit",e.backstage)),a=rP({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:P.none()},"cancel",e.backstage),c=cJ(),u=aJ((function(){return o(!1)}),t.providers),s=Ts(fJ({lazySink:function(){return t.getSink()},header:iJ(c,u),body:uJ(n,t.providers),footer:P.some(sJ(lJ([],[a,i.asSpec()]))),onEscape:function(){return o(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Mc(EE,(function(){return o(!1)})),Mc(DE,(function(){return o(!0)}))],eventOrder:{}}));jK.show(s);var l=i.get(s);Yw.focus(l)};return{open:n}},KJ=function(e,t){return ki(wi("data",t,e))},XJ=function(e){return PO(e,".tox-alert-dialog")||PO(e,".tox-confirm-dialog")},YJ=function(e,t,n){return t&&n?[]:[_F.config({contextual:{lazyContext:function(){return P.some(Jr(tt.fromDom(e.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]},JJ=function(e){var t=e.backstage,n=e.editor,r=Wz(n),o=$J(e),i=GJ(e),a=function(e,n,r){return void 0!==n&&"toolbar"===n.inline?l(e,t.shared.anchors.inlineDialog(),r,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?l(e,t.shared.anchors.cursor(),r,n.ariaAttrs):s(e,r)},c=function(e,t){return u(e,t)},u=function(e,r){var o=function(e){var o=WJ(e,{closeWindow:function(){jK.hide(o.dialog),r(o.instanceApi)}},n,t);return jK.show(o.dialog),o.instanceApi};return wY.openUrl(o,e)},s=function(e,n){var r=function(e,r,o){var i=r,a={dataValidator:o,initialData:i,internalDialog:e},c=LJ(a,{redial:wY.redial,closeWindow:function(){jK.hide(c.dialog),n(c.instanceApi)}},t);return jK.show(c.dialog),c.instanceApi.setData(i),c.instanceApi};return wY.open(r,e)},l=function(e,o,i,a){var c=function(e,c,u){var s=KJ(c,u),l=od(),f=t.shared.header.isPositionedAtTop(),d={dataValidator:u,initialData:s,internalDialog:e},m=function(){return l.on((function(e){t_.reposition(e),_F.refresh(e)}))},g=IJ(d,{redial:wY.redial,closeWindow:function(){l.on(t_.hide),n.off("ResizeEditor",m),l.clear(),i(g.instanceApi)}},t,a),p=Ts(t_.sketch(E(E({lazySink:t.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},f?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:mf(D([jw("window-manager-inline-events",[Mc(gc(),(function(e,t){_c(g.dialog,EE)}))])],YJ(n,r,f),!0)),isExtraPart:function(e,t){return XJ(t)}})));return l.set(p),t_.showWithin(p,Os(g.dialog),{anchor:o},P.some(Ln())),r&&f||(_F.refresh(p),n.on("ResizeEditor",m)),g.instanceApi.setData(s),Ew.focusIn(g.dialog),g.instanceApi};return wY.open(c,e)},f=function(e,t){i.open(e,(function(e){t(e)}))},d=function(e,t){o.open(e,(function(){t()}))},m=function(e){e.close()};return{open:a,openUrl:c,alert:d,close:m,confirm:f}};function QJ(){O.add("silver",(function(e){var t=RK(e),n=t.uiMothership,r=t.backstage,o=t.renderUI,i=t.getUi;BO.register(e,r.shared);var a=JJ({editor:e,backstage:r});return{renderUI:o,getWindowManagerImpl:w(a),getNotificationManagerImpl:function(){return j_(e,{backstage:r},n)},ui:i()}}))}QJ()})()}).call(this,n("c8ba"))},"0335":function(e,t,n){n("0f58")},"07d1":function(e,t,n){n("94ce")},"080b":function(e,t){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},r=function(e){return e.getParam("pagebreak_split_block",!1)},o="mce-pagebreak",i=function(e){var n='';return e?"

"+n+"

":n},a=function(e){var t=n(e),a=function(){return r(e)},c=new RegExp(t.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,(function(e){return"\\"+e})),"gi");e.on("BeforeSetContent",(function(e){e.content=e.content.replace(c,i(a()))})),e.on("PreInit",(function(){e.serializer.addNodeFilter("img",(function(n){var r,i,c=n.length;while(c--)if(r=n[c],i=r.attr("class"),i&&-1!==i.indexOf(o)){var u=r.parent;if(e.schema.getBlockElements()[u.name]&&a()){u.type=3,u.value=t,u.raw=!0,r.remove();continue}r.type=3,r.value=t,r.raw=!0}}))}))},c=function(e){e.addCommand("mcePageBreak",(function(){e.insertContent(i(r(e)))}))},u=function(e){e.on("ResolveName",(function(t){"IMG"===t.target.nodeName&&e.dom.hasClass(t.target,o)&&(t.name="pagebreak")}))},s=function(e){var t=function(){return e.execCommand("mcePageBreak")};e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:t}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:t})};function l(){e.add("pagebreak",(function(e){c(e),s(e),a(e),u(e)}))}l()})()},"0902":function(e,t,n){n("88b64")},"0a9d":function(e,t,n){n("69a4")},"0aa0c":function(e,t,n){n("3b47")},"0d68":function(e,t,n){n("030f")},"0efa":function(e,t,n){n("4bdc")},"0f58":function(e,t){(function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){var t=typeof e;return null===e?"null":"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},n=function(e){return function(n){return t(n)===e}},r=function(e){return function(t){return typeof t===e}},o=n("string"),i=r("function"),a=function(){},c=function(e){return function(){return e}},u=function(e){return e};function s(e){for(var t=[],n=1;n0&&(i=r.create("div",null),i.appendChild(a[0].cloneNode(!0))),d.each(r.select("*",i),(function(t){D(t,g(e).replace(/\s+/g,"|"))&&(t.innerHTML=T(e,_(e))),D(t,p(e).replace(/\s+/g,"|"))&&(t.innerHTML=T(e,x(e))),D(t,h(e).replace(/\s+/g,"|"))&&(t.innerHTML=o)})),A(e,i),e.execCommand("mceInsertContent",!1,i.innerHTML),e.addVisual()},N=function(){return R},R=function(){var e=function(e){return e()},t=u,n={fold:function(e,t){return e()},isSome:l,isNone:f,getOr:t,getOrThunk:e,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(void 0),or:t,orThunk:e,map:N,each:a,bind:N,exists:l,forall:f,filter:function(){return N()},toArray:function(){return[]},toString:c("none()")};return n}(),B=function(e){var t=c(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},isSome:f,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return B(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:R},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return o},P=function(e){return null===e||void 0===e?R:B(e)},L={some:B,none:N,from:P},I=function(e,t){for(var n=e.length,r=new Array(n),o=0;o":">","&":"&","'":"'"},G=function(e){return e.replace(/["'<>&]/g,(function(e){return q($,e).getOr(e)}))},K=function(e,t){if(-1===t.indexOf("")){var n="",r=y(e),o=b(e)?' crossorigin="anonymous"':"";d.each(e.contentCSS,(function(t){n+='"})),r&&(n+='");var i=z(e),a=e.dom.encode,c=j.mac?"e.metaKey":"e.ctrlKey && !e.altKey",u='