n e.formatter.match(t)}},getCurrentValue:R.none,getPreviewFor:function(t){return function(){var n=e.formatter.get(t);return R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))})}},onAction:ZO(e),updateText:function(r){var o=lB(e,(function(){return n.data})).fold(v(t),(function(e){return e.title}));wi(r,ak,{text:o})},dataset:n,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},fB=function(e,t){var n="Paragraph";return{tooltip:"Formats",text:R.some(n),icon:R.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:R.none,getPreviewFor:function(t){return function(){var n=e.formatter.get(t);return void 0!==n?R.some({tag:n.length>0&&(n[0].inline||n[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(t))}):R.none()}},onAction:ZO(e),updateText:function(t){var r=function(e){var t=e.items;return void 0!==t&&t.length>0?Q(t,r):[{title:e.title,format:e.format}]},o=Q(WS(e),r),i=lB(e,v(o)).fold(v(n),(function(e){return e.title}));wi(t,ak,{text:i})},shouldHide:e.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!e.formatter.canApply(t.format)},dataset:t}},hB=Object.freeze({__proto__:null,events: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=W(o,n.getSystem().build);ol(n,i)}))};return Si([Oi(Jo(),(function(t,r){var o=r;if(!o.universal){var i=e.channel;L(o.channels,i)&&n(t,o.data)}})),Ni((function(t,r){e.initialData.each((function(e){n(t,e)}))}))])}}),pB=Object.freeze({__proto__:null,getState:function(e,t,n){return n}}),gB=[Hr("channel"),Gr("renderComponents"),Gr("updateState"),Gr("initialData")],mB=Qs({fields:gB,name:"reflecting",active:hB,apis:pB,state:Object.freeze({__proto__:null,init:function(){var e=ho(R.none());return{readState:function(){return e.get().getOr("none")},get:e.get,set:e.set,clear:function(){return e.set(R.none())}}}})}),vB=v([Hr("toggleClass"),Hr("fetch"),ss("onExecute"),ro("getHotspot",R.some),ro("getAnchorOverrides",v({})),Gu(),ss("onItemExecute"),Gr("lazySink"),Hr("dom"),is("onOpen"),Ul("splitDropdownBehaviours",[Pw,pp,Sp]),ro("matchWidth",!1),ro("useMinWidth",!1),ro("eventOrder",{}),Gr("role")].concat(Zw())),bB=md({factory:Bg,schema:[Hr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Js([Sp.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(_i)},buttonBehaviours:Js([Dp.config({toggleOnExecute:!1,toggleClass:e.toggleClass})])}}}),yB=md({factory:Bg,schema:[Hr("dom")],name:"button",defaults:function(){return{buttonBehaviours:Js([Sp.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)}))}}}}),wB=v([bB,yB,bd({factory:{sketch:function(e){return{uid:e.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:e.text}}}},schema:[Hr("text")],name:"aria-descriptor"}),vd({schema:[ns()],name:"menu",defaults:function(e){return{onExecute:function(t,n){t.getSystem().getByUid(e.uid).each((function(r){e.onItemExecute(r,t,n)}))}}}}),Vw()]),_B=$d({name:"SplitDropdown",configFields:vB(),partFields:wB(),factory:function(e,t,n,r){var o,i=function(e){Yd.getCurrent(e).each((function(e){wf.highlightFirst(e),pp.focusIn(e)}))},a=function(t){Hw(e,b,t,r,i,fw.HighlightFirst).get(g)},s=function(t){var n=Ad(t,e,"button");return _i(n),R.some(!0)},u=T(T({},Si([Ni((function(t,n){Md(t,e,"aria-descriptor").each((function(e){var n=qi("aria");$t(e.element,"id",n),$t(t.element,"aria-describedby",n)}))}))])),Fp(R.some(a))),c={repositionMenus:function(e){Dp.isOn(e)&&$w(e)}};return{uid:e.uid,dom:e.dom,components:t,apis:c,eventOrder:T(T({},e.eventOrder),(o={},o[Ko()]=["disabling","toggling","alloy.base.behaviour"],o)),events:u,behaviours:$l(e.splitDropdownBehaviours,[Pw.config({others:{sandbox:function(t){var n=Ad(t,e,"arrow");return Ww(e,t,{onOpen:function(){Dp.on(n),Dp.on(t)},onClose:function(){Dp.off(n),Dp.off(t)}})}}}),pp.config({mode:"special",onSpace:s,onEnter:s,onDown:function(e){return a(e),R.some(!0)}}),Sp.config({}),Dp.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:e.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(e,t){return e.repositionMenus(t)}}}),xB=function(e){return{isDisabled:function(){return lf.isDisabled(e)},setDisabled:function(t){return lf.set(e,t)}}},CB=function(e){return{setActive:function(t){Dp.set(e,t)},isActive:function(){return Dp.isOn(e)},isDisabled:function(){return lf.isDisabled(e)},setDisabled:function(t){return lf.set(e,t)}}},kB=function(e,t){return e.map((function(e){return{"aria-label":t.translate(e),title:t.translate(e)}})).getOr({})},SB=qi("focus-button"),TB=function(e,t,n,r,o,i){var a;return{dom:{tag:"button",classes:["tox-tbtn"].concat(t.isSome()?["tox-tbtn--select"]:[]),attributes:kB(n,i)},components:ib([e.map((function(e){return tk(e,i.icons)})),t.map((function(e){return rk(e,"tox-tbtn",i)}))]),eventOrder:(a={},a[Mo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:Js([Qv(i.isDisabled),Gv(),wp("common-button-display-events",[Oi(Mo(),(function(e,t){t.event.prevent(),yi(e,SB)}))])].concat(r.map((function(n){return mB.config({channel:n,initialData:{icon:e,text:t},renderComponents:function(e,t){return ib([e.icon.map((function(e){return tk(e,i.icons)})),e.text.map((function