/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.10.4 (2022-04-27) */ !function(){"use strict";var y=function(){return(y=Object.assign||function(n){for(var e,t=1,o=arguments.length;t "+o.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"}}},mo=w(fo),go=(Qt=m,_t(function(n){var e=typeof n;return Qt(n)?no(n):eo("Expected type: function but got: "+e)})),po=function(n){return"Errors: \n"+Z(10<(e=n.errors).length?e.slice(0,10).concat([{path:[],getErrorInfo:w("... (only showing first ten failures)")}]):e,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}).join("\n")+"\n\nInput object: "+Dt(n.input);var e},ho=xt,vo=function(n,e){return{tag:"custom",newKey:n,instantiator:e}},bo=[Lt("alpha"),Lt("omega")];function yo(n,e){return(t={})[n]=e,t;var t}function xo(n){return e={},M(n,function(n){e[n.key]=n.value}),e;var e}function wo(n,e,t){return void 0===t&&(t=o),n.exists(function(n){return t(n,e)})}function So(n){for(var e=[],t=function(n){e.push(n)},o=0;o="/*".length&&"/*"===n.substr(e,e+"/*".length)?n.substring(0,n.length-"/*".length):n;var e})},nr=function(t,n,l,i,e,o,r){function u(n){return Re(n,l)?n[l]():mn.none()}var c=De(e,function(n,e){return r=l,t=function(t){for(var n=[],e=1;e"}),mo()),ta=vo("schema",function(){return[Ut("preprocess")]}),oa=Yt("defaults",w({})),ra=Yt("overrides",w({})),ia=lo([Qc,Zc,na,ea,oa,ra]),ua=lo([Qc,Zc,na,oa,ra]),ca=lo([Qc,Zc,na,ea,oa,ra]),aa=lo([Qc,ta,na,Lt("unit"),ea,oa,ra]),sa=Wu(Jc.required,ia);function fa(n,e,t,o){return co(e.defaults(n,t,o),t,{uid:n.partUids[e.name]},e.overrides(n,t,o))}function la(n,e,t){return o=e,r={},i={},M(t,function(n){n.fold(function(o){r[o.pname]=Xc(!0,function(n,e,t){return o.factory.sketch(fa(n,o,e,t))})},function(n){var e=o.parts[n.name];i[n.name]=w(n.factory.sketch(fa(o,n,e[zs()]),e))},function(o){r[o.pname]=Xc(!1,function(n,e,t){return o.factory.sketch(fa(n,o,e,t))})},function(o){r[o.pname]=qc(!0,function(e,n,t){return Z(e[o.name],function(n){return o.factory.sketch(co(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:w(r),externals:w(i)};var o,r,i}function da(n,e,t){return o=mn.some(n),i=(r=e).components,s=De(t,function(n,e){return o=n,r=!1,{name:w(t=e),required:function(){return o.fold(function(n,e){return n},function(n,e){return n})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+t);return r=!0,o}};var t,o,r}),u=o,c=r,a=s,f=B(i,function(n){return Wc(u,c,n,a)}),Ee(s,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+o.getOr("none")+"\nComponents: "+JSON.stringify(r.components,null,2))}),f;var o,r,i,u,c,a,s,f}function ma(n,e,t){var o=e.partUids[t];return n.getSystem().getByUid(o).toOptional()}function ga(n,e,t){return ma(n,e,t).getOrDie("Could not find part: "+t)}function pa(o){return ho("partUids","partUids",Et(function(n){return e=n.uid,t=Z(o,Uu),xo(Z(t,function(n){return{key:n,value:e+"-"+n}}));var e,t}),mo())}function ha(n){return yo(Ls,n)}function va(o){return n=function(n){for(var e=[],t=1;t')},function(n){return Oa(''+n+"")})}function Da(e){return Hs({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(o){return{events:qo([Do(Vn(),function(n,e,t){return o(n,t)},[n]),Do(Nn(),function(n,e,t){return o(n,t)},[n]),Do(Hn(),function(n,e,t){t.mouseIsDown.get()&&o(n,t)},[n])])}})}})}function Ma(n,e,t){e.store.manager.onLoad(n,e,t)}function _a(n,e,t){e.store.manager.onUnload(n,e,t)}function Ra(){var n=No(null);return tr({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function Fa(){var i=No({}),u=No({});return tr({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return _e(i.get(),n).orThunk(function(){return _e(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),o={},r={};M(n,function(e){_e(o[e.value]=e,"meta").each(function(n){_e(n,"text").each(function(n){r[n]=e})})}),i.set(y(y({},e),o)),u.set(y(y({},t),r))},clear:function(){i.set({}),u.set({})}})}function Ia(n,e,t,o){var r=e.store;t.update([o]),r.setValue(n,o),e.onSetValue(n,o)}function Va(n,e){return vf.set(n,e)}function Ba(n){return vf.get(n)}function Aa(n){var e=n.event.raw;return-1===e.type.indexOf("touch")?void 0!==e.clientX?mn.some(e).map(function(n){return yf(n.clientX,n.clientY)}):mn.none():void 0!==e.touches&&1===e.touches.length?mn.some(e.touches[0]).map(function(n){return yf(n.clientX,n.clientY)}):mn.none()}function Na(n){return n.model.minX}function Ha(n){return n.model.minY}function Pa(n){return n.model.minX-1}function za(n){return n.model.minY-1}function ja(n){return n.model.maxX}function La(n){return n.model.maxY}function $a(n){return n.model.maxX+1}function Ga(n){return n.model.maxY+1}function Ua(n,e,t){return e(n)-t(n)}function Wa(n){return Ua(n,ja,Na)}function Xa(n){return Ua(n,La,Ha)}function qa(n){return Wa(n)/2}function Ya(n){return Xa(n)/2}function Ka(n){return n.stepSize}function Ja(n){return n.snapToGrid}function Qa(n){return n.snapStart}function Za(n){return n.rounded}function ns(n,e){return void 0!==n[e+"-edge"]}function es(n){return ns(n,"left")}function ts(n){return ns(n,"right")}function os(n){return ns(n,"top")}function rs(n){return ns(n,"bottom")}function is(n){return n.model.value.get()}function us(n,e){return{x:n,y:e}}function cs(n,e){X(n,xf(),{value:e})}function as(n,e,t,o){return n'),components:[$f.parts["left-edge"](ka('
')),$f.parts.spectrum({dom:Oa('
'),components:[ka('
')],behaviours:or([ii.config({toggleClass:ci("thumb-active")})])}),$f.parts["right-edge"](ka('
')),$f.parts.thumb({dom:Oa('
'),behaviours:or([ii.config({toggleClass:ci("thumb-active")})])})],onChange:function(n,e,t){var o=i(t.x());$r(e.element,"background-color",o),r.onChange(n,e,o)},onDragStart:function(n,e){ii.on(e)},onDragEnd:function(n,e){ii.off(e)},onInit:function(n,e,t,o){var r=i(o.x());$r(e.element,"background-color",r)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:r.getInitialValue()}}},sliderBehaviours:or([Nr($f.refresh)])}))];function i(n){return n<0?"black":360'),(e={onChange:n.onChange,sizes:Xf,category:"font",getInitialValue:n.getInitialValue},r=zt("SizeSlider",Wf,e),$f.sketch({dom:{tag:"div",classes:[ci("slider-"+r.category+"-size-container"),ci("slider"),ci("slider-size-container")]},onChange:function(n,e,t){var o=t.x();0<=o&&o'),components:[ka('
')]}),$f.parts.thumb({dom:Oa('
'),behaviours:or([ii.config({toggleClass:ci("thumb-active")})])})]})),ka('')];var e,r}function Ns(n){var e=void 0!==n.uid&&Re(n,"uid")?n.uid:qs("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOptional()},asSpec:function(){return y(y({},n),{uid:e})}}}Wu(Jc.external,ua);var Hs=Wu(Jc.optional,ca),Ps=Wu(Jc.group,aa),zs=w("entirety"),js=function(n,e){return{uiType:Yc(),owner:n,name:e}},Ls=Gu("alloy-premade"),$s=w("alloy-id-"),Gs=w("data-alloy-id"),Us=$s(),Ws=Gs(),Xs=function(n,e){Object.defineProperty(n.dom,Ws,{value:e,writable:!0})},qs=Gu,Ys=function(n){return dt(n,"uid")?n:y(y({},n),{uid:qs("uid")})},Ks=It([Lt("name"),Lt("factory"),Lt("configFields"),Yt("apis",{}),Yt("extraApis",{})]),Js=It([Lt("name"),Lt("factory"),Lt("configFields"),Lt("partFields"),Yt("apis",{}),Yt("extraApis",{})]),Qs=wa({name:"Button",factory:function(n){function t(e){return _e(n.dom,"attributes").bind(function(n){return _e(n,e)})}var e,o=(e=n.action,qo(V([e.map(function(t){return Qo(function(n,e){t(n),e.stop()})}).toArray(),Pr()]))),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:o,behaviours:$c(n.buttonBehaviours,[fi.config({}),jc.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return y({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[Yt("uid",void 0),Lt("dom"),Yt("components",[]),Lc("buttonBehaviours",[fi,jc]),Ut("action"),Ut("role"),Yt("eventOrder",{})]}),Zs=Ao({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return qo([Co(Xn(),x)])},exhibit:function(){return Io({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),nf=function(n,e,t,o){return Qs.sketch({dom:Ea(n,o),action:e,buttonBehaviours:co(or([Zs.config({})]),t)})},ef=Hs({schema:[Lt("dom")],name:"label"}),tf=Da("top-left"),of=Da("top"),rf=Da("top-right"),uf=Da("right"),cf=Da("bottom-right"),af=Da("bottom"),sf=Da("bottom-left"),ff=[ef,Da("left"),uf,of,af,tf,rf,sf,cf,sa({name:"thumb",defaults:w({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:qo([_o(Vn(),n,"spectrum"),_o(Bn(),n,"spectrum"),_o(An(),n,"spectrum"),_o(Nn(),n,"spectrum"),_o(Hn(),n,"spectrum"),_o(Pn(),n,"spectrum")])}}}),sa({schema:[vo("mouseIsDown",function(){return No(!1)})],name:"spectrum",overrides:function(t){function o(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})}var r=t.model.manager;return{behaviours:or([jc.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),fi.config({})]),events:qo([Eo(Vn(),o),Eo(Bn(),o),Eo(Nn(),o),Eo(Hn(),function(n,e){t.mouseIsDown.get()&&o(n,e)})])}}})],lf=Object.freeze({__proto__:null,onLoad:Ma,onUnload:_a,setValue:function(n,e,t,o){e.store.manager.setValue(n,e,t,o)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),df=Object.freeze({__proto__:null,events:function(t,o){var n=t.resetOnDom?[Yo(function(n,e){Ma(n,t,o)}),Ko(function(n,e){_a(n,t,o)})]:[Vo(t,o,Ma)];return qo(n)}}),mf=Object.freeze({__proto__:null,memory:Ra,dataset:Fa,manual:function(){return tr({readState:Y})},init:function(n){return n.store.manager.state(n)}}),gf=[Ut("initialValue"),Lt("getFallbackEntry"),Lt("getDataKey"),Lt("setValue"),Dr("manager",{setValue:Ia,getValue:function(n,e,t){var o=e.store,r=o.getDataKey(n);return t.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(e,t,o){t.store.initialValue.each(function(n){Ia(e,t,o,n)})},onUnload:function(n,e,t){t.clear()},state:Fa})],pf=[Lt("getValue"),Yt("setValue",Y),Ut("initialValue"),Dr("manager",{setValue:function(n,e,t,o){e.store.setValue(n,o),e.onSetValue(n,o)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:Y,state:er.init})],hf=Ao({fields:[Kt("store",{mode:"memory"},jt("mode",{memory:[Ut("initialValue"),Dr("manager",{setValue:function(n,e,t,o){t.set(o),e.onSetValue(n,o)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:Ra})],manual:pf,dataset:gf})),kr("onSetValue"),Yt("resetOnDom",!1)],name:"representing",active:df,apis:lf,extra:{setValueFrom:function(n,e){var t=hf.getValue(e);hf.setValue(n,t)}},state:mf}),vf=Yr("width",function(n){return n.dom.offsetWidth}),bf=function(t,o){return{left:t,top:o,translate:function(n,e){return bf(t+n,o+e)}}},yf=bf,xf=w("slider.change.value"),wf="left",Sf=ks(-1),Of=ks(1),kf=mn.none,Tf=mn.none,Cf={"top-left":mn.none(),top:mn.none(),"top-right":mn.none(),right:mn.some(function(n,e){cs(n,{x:$a(e)})}),"bottom-right":mn.none(),bottom:mn.none(),"bottom-left":mn.none(),left:mn.some(function(n,e){cs(n,{x:Pa(e)})})},Ef=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Os(n,e,t);return Ss(n,{x:o}),o},setToMin:function(n,e){Ss(n,{x:Na(e)})},setToMax:function(n,e){Ss(n,{x:ja(e)})},findValueOfOffset:Os,getValueFromEvent:function(n){return Aa(n).map(function(n){return n.left})},findPositionOfValue:Ts,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ts(n,o.getSpectrum(n),r.x,o.getLeftEdge(n),o.getRightEdge(n),t),u=Ba(e.element)/2;$r(e.element,"left",i-u+"px")},onLeft:Sf,onRight:Of,onUp:kf,onDown:Tf,edgeActions:Cf}),Df=mn.none,Mf=mn.none,_f=Ds(-1),Rf=Ds(1),Ff={"top-left":mn.none(),top:mn.some(function(n,e){cs(n,{y:za(e)})}),"top-right":mn.none(),right:mn.none(),"bottom-right":mn.none(),bottom:mn.some(function(n,e){cs(n,{y:Ga(e)})}),"bottom-left":mn.none(),left:mn.none()},If=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Es(n,e,t);return Cs(n,{y:o}),o},setToMin:function(n,e){Cs(n,{y:Ha(e)})},setToMax:function(n,e){Cs(n,{y:La(e)})},findValueOfOffset:Es,getValueFromEvent:function(n){return Aa(n).map(function(n){return n.top})},findPositionOfValue:Ms,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ms(n,o.getSpectrum(n),r.y,o.getTopEdge(n),o.getBottomEdge(n),t),u=Kr(e.element)/2;$r(e.element,"top",i-u+"px")},onLeft:Df,onRight:Mf,onUp:_f,onDown:Rf,edgeActions:Ff}),Vf=Aa,Bf=Fs(-1,!1),Af=Fs(1,!1),Nf=Fs(-1,!0),Hf=Fs(1,!0),Pf={"top-left":mn.some(function(n,e){cs(n,us(Pa(e),za(e)))}),top:mn.some(function(n,e){cs(n,us(qa(e),za(e)))}),"top-right":mn.some(function(n,e){cs(n,us($a(e),za(e)))}),right:mn.some(function(n,e){cs(n,us($a(e),Ya(e)))}),"bottom-right":mn.some(function(n,e){cs(n,us($a(e),Ga(e)))}),bottom:mn.some(function(n,e){cs(n,us(qa(e),Ga(e)))}),"bottom-left":mn.some(function(n,e){cs(n,us(Pa(e),Ga(e)))}),left:mn.some(function(n,e){cs(n,us(Pa(e),Ya(e)))})},zf=Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var o=Rs(Os(n,e,t.left),Es(n,e,t.top));return _s(n,o),o},setToMin:function(n,e){_s(n,Rs(Na(e),Ha(e)))},setToMax:function(n,e){_s(n,Rs(ja(e),La(e)))},getValueFromEvent:Vf,setPositionFromValue:function(n,e,t,o){var r=is(t),i=Ts(n,o.getSpectrum(n),r.x,o.getLeftEdge(n),o.getRightEdge(n),t),u=Ms(n,o.getSpectrum(n),r.y,o.getTopEdge(n),o.getBottomEdge(n),t),c=Ba(e.element)/2,a=Kr(e.element)/2;$r(e.element,"left",i-c+"px"),$r(e.element,"top",u-a+"px")},onLeft:Bf,onRight:Af,onUp:Nf,onDown:Hf,edgeActions:Pf}),jf=[Yt("stepSize",1),Yt("onChange",Y),Yt("onChoose",Y),Yt("onInit",Y),Yt("onDragStart",Y),Yt("onDragEnd",Y),Yt("snapToGrid",!1),Yt("rounded",!0),Ut("snapStart"),$t("model",jt("mode",{x:[Yt("minX",0),Yt("maxX",100),vo("value",function(n){return No(n.mode.minX)}),Lt("getInitialValue"),Dr("manager",Ef)],y:[Yt("minY",0),Yt("maxY",100),vo("value",function(n){return No(n.mode.minY)}),Lt("getInitialValue"),Dr("manager",If)],xy:[Yt("minX",0),Yt("maxX",100),Yt("minY",0),Yt("maxY",100),vo("value",function(n){return No({x:n.mode.minX,y:n.mode.minY})}),Lt("getInitialValue"),Dr("manager",zf)]})),ju("sliderBehaviours",[jc,hf]),vo("mouseIsDown",function(){return No(!1)})],Lf=w("mouse.released"),$f=Sa({name:"Slider",configFields:jf,partFields:ff,factory:function(i,n,e,t){function u(n){return ga(n,i,"thumb")}function c(n){return ga(n,i,"spectrum")}function o(n){return ma(n,i,"left-edge")}function r(n){return ma(n,i,"right-edge")}function a(n){return ma(n,i,"top-edge")}function s(n){return ma(n,i,"bottom-edge")}function f(n,e){v.setPositionFromValue(n,e,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:a,getBottomEdge:s,getSpectrum:c})}function l(n,e){h.value.set(e),f(n,u(n))}function d(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&ma(t,i,"thumb").each(function(n){var e=h.value.get();i.onChoose(t,n,e)})}function m(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,e){e.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:Lu(i.sliderBehaviours,[jc.config({mode:"special",focusIn:function(n){return ma(n,i,"spectrum").map(jc.focusIn).map(x)}}),hf.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),ti.config({channels:((p={})[Lf()]={onReceive:d},p)})]),events:qo([Eo(xf(),function(n,e){!function(n,e){l(n,e);var t=u(n);i.onChange(n,t,e),mn.some(!0)}(n,e.event.value)}),Yo(function(n,e){var t=h.getInitialValue();h.value.set(t);var o=u(n);f(n,o);var r=c(n);i.onInit(n,o,r,h.value.get())}),Eo(Vn(),m),Eo(An(),g),Eo(Nn(),m),Eo(Pn(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},setValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(n,e,t){n.setValue(e,t)},resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),Gf=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Uf=w(Gf),Wf=It([Lt("getInitialValue"),Lt("onChange"),Lt("category"),Lt("sizes")]),Xf=Uf(),qf={},Yf={exports:qf};function Kf(u){var e=Ns({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:qo([Ro(Un()),Eo(Gn(),function(n,e){var t=e.event.raw,o=t.target.files||t.dataTransfer.files;mn.from(o[0]).each(function(n){var r,t,i=u;r=n,t=r,new Jl(function(n){var e=new FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)}).then(function(n){return n.split(",")[1]}).then(function(o){i.undoManager.transact(function(){var n=i.editorUpload.blobCache,e=n.create(Gu("mceu"),r,o);n.add(e);var t=i.dom.createHTML("img",{src:e.blobUri()});i.insertContent(t)})})})})])});return Qs.sketch({dom:Ea("image",u),components:[e.asSpec()],action:function(n){e.get(n).element.dom.click()}})}function Jf(n){return n.dom.textContent}function Qf(n){return 0'),action:function(n){var e=t.get(n);hf.setValue(e,"")}}));return{name:n,spec:td.sketch({dom:Oa('
'),components:[t.asSpec(),o.asSpec()],containerBehaviours:or([ii.config({toggleClass:ci("input-container-empty")}),ed.config({find:function(n){return mn.some(t.get(n))}}),el("input-clearing",[Eo($n(),function(n){var e=t.get(n);(0"}function sl(o,r){return Ca(r,"link","link",function(){var n,e,t=hd(o,r);o.setContextToolbar(t),n=r,e=function(){o.focusToolbar()},(Zl.os.isAndroid()?function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)}:p)(e,n),Ql(r).each(function(n){r.selection.select(n.dom)})})}function fl(e){function t(n){return"The component must be in a context to execute: "+n+(e?"\n"+$o(e().element)+" is not in context.":"")}function n(n){return function(){throw new Error(t(n))}}function o(n){return function(){console.warn(t(n))}}return{debugInfo:w("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),isConnected:S}}function ll(n,r){var i={};return Ee(n,function(n,o){Ee(n,function(n,e){var t=_e(i,e).getOr([]);i[e]=t.concat([r(o,n)])})}),i}function dl(n){return n.cHandler}function ml(n,e){return{name:n,handler:e}}function gl(n,e,t){var o=e[t];return o?function(u,c,n,a){try{var e=(t=function(n,e){var t=n[c],o=e[c],r=a.indexOf(t),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r'),components:[td.sketch({dom:Oa('
'),components:Z(s.fields,function(n,e){return e<=s.maxFieldIndex?td.sketch({dom:Oa('
'),components:[i(-1,"previous",0'),behaviours:or([Qi.config({highlightClass:ci("dot-active"),itemClass:ci("dot-item")})]),components:B(s.fields,function(n,e){return e<=s.maxFieldIndex?[ka('
')]:[]})}),{dom:Oa('
'),components:[f.asSpec(),l.asSpec()],behaviours:or([jc.config({mode:"special",focusIn:function(n){var e=f.get(n);jc.focusIn(e)}}),el("serializer-wrapper-events",[Eo(Vn(),function(n,e){var t=e.event;s.state.dialogSwipeState.set({xValue:t.raw.touches[0].clientX,points:[]})}),Eo(Bn(),function(n,e){var t=e.event;s.state.dialogSwipeState.on(function(n){e.event.prevent(),s.state.dialogSwipeState.set(function(n,e){if(e===n.xValue)return n;var t=0'),action:function(n){X(n,a,{direction:e})},buttonBehaviours:or([md.config({disableClass:ci("toolbar-navigation-disabled"),disabled:function(){return!t}})])})}function u(n,r){var i=Jr(n.element,"."+ci("serialised-dialog-screen"));hi(n.element,"."+ci("serialised-dialog-chain")).each(function(o){0<=s.state.currentScreen.get()+r&&s.state.currentScreen.get()+r "):r[0].name;return yo(u,{handler:t,purpose:o})})});return e={},t=[],o=[],M(a,function(n){n.fold(function(n){t.push(n)},function(n){o.push(n)})}),0<(u={errors:t,values:o}).errors.length?ht.error(V(u.errors)):(i=e,0===(r=u.values).length?ht.value(i):ht.value(co(i,ao.apply(void 0,r))))},Sd="alloy.base.behaviour",Od=lo([ho("dom","dom",Ot(),lo([Lt("tag"),Yt("styles",{}),Yt("classes",[]),Yt("attributes",{}),Ut("value"),Ut("innerHtml")])),Lt("components"),Lt("uid"),Yt("events",{}),Yt("apis",{}),ho("eventOrder","eventOrder",((Kl={})[Zn()]=["disabling",Sd,"toggling","typeaheadevents"],Kl[Yn()]=[Sd,"focusing","keying"],Kl[oe()]=[Sd,"disabling","toggling","representing"],Kl[$n()]=[Sd,"representing","streaming","invalidating"],Kl[ie()]=[Sd,"representing","item-events","tooltipping"],Kl[Nn()]=["focusing",Sd,"item-type-events"],Kl[Vn()]=["focusing",Sd,"item-type-events"],Kl[zn()]=["item-type-events","tooltipping"],Kl[Qn()]=["receiving","reflecting","tooltipping"],Et(w(Kl))),mo()),Ut("domModification")]),kd=qs,Td=function(u){return _e(u,Ls).getOrThunk(function(){var n,e,t,o,r,i=dt(u,"uid")?u:y({uid:kd("")},u);return n=yd(i),e=n.events,t=c(n,["events"]),o=Z(_e(t,"components").getOr([]),Td),r=y(y({},t),{events:y(y({},bd),e),components:o}),ht.value(xl(r)).getOrDie()})},Cd=ha,Ed="alloy.item-hover",Dd="alloy.item-focus",Md=w(Ed),_d=w(Dd),Rd=[Lt("data"),Lt("components"),Lt("dom"),Yt("hasSubmenu",!1),Ut("toggling"),Lc("itemBehaviours",[ii,fi,jc,hf]),Yt("ignoreFocus",!1),Yt("domModification",{}),Dr("builder",function(n){return{dom:n.dom,domModification:y(y({},n.domModification),{attributes:y(y(y({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:$c(n.itemBehaviours,[n.toggling.fold(ii.revoke,function(n){return ii.config(y({aria:{mode:"checked"}},n))}),fi.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Ol(n)}}),jc.config({mode:"execution"}),hf.config({store:{mode:"memory",initialValue:n.data}}),el("item-type-events",u(u([],Pr(),!0),[Eo(zn(),Sl),Eo(ne(),fi.focus)],!1))]),components:n.components,eventOrder:n.eventOrder}}),Yt("eventOrder",{})],Fd=[Lt("dom"),Lt("components"),Dr("builder",function(n){return{dom:n.dom,components:n.components,events:qo([Eo(ne(),function(n,e){e.stop()})])}})],Id=w("item-widget"),Vd=w([sa({name:"widget",overrides:function(e){return{behaviours:or([hf.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:Y}})])}}})]),Bd=jt("type",{widget:[Lt("uid"),Lt("data"),Lt("components"),Lt("dom"),Yt("autofocus",!1),Yt("ignoreFocus",!1),Lc("widgetBehaviours",[hf,fi,jc]),Yt("domModification",{}),pa(Vd()),Dr("builder",function(t){function o(n){return ma(n,t,"widget").map(function(n){return jc.focusIn(n),n})}function n(n,e){return eu(e.event.target)||t.autofocus&&e.setSource(n.element),mn.none()}var e=la(Id(),t,Vd()),r=da(Id(),t,e.internals());return{dom:t.dom,components:r,domModification:t.domModification,events:qo([Qo(function(n,e){o(n).each(function(n){e.stop()})}),Eo(zn(),Sl),Eo(ne(),function(n,e){t.autofocus?o(n):fi.focus(n)})]),behaviours:$c(t.widgetBehaviours,[hf.config({store:{mode:"memory",initialValue:t.data}}),fi.config({ignore:t.ignoreFocus,onFocus:function(n){Ol(n)}}),jc.config({mode:"special",focusIn:t.autofocus?function(n){o(n)}:ur(),onLeft:n,onRight:n,onEscape:function(n,e){return fi.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element),mn.none()):(fi.focus(n),mn.some(!0))}})])}})],item:Rd,separator:Fd}),Ad=w([Ps({factory:{sketch:function(n){var e=zt("menu.spec item",Bd,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return dt(e,"uid")?e:y(y({},e),{uid:qs("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Nd=w([Lt("value"),Lt("items"),Lt("dom"),Lt("components"),Yt("eventOrder",{}),ju("menuBehaviours",[Qi,hf,ed,jc]),Kt("movement",{mode:"menu",moveOnTab:!0},jt("mode",{grid:[ei(),Dr("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[Dr("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Lt("rowSelector")],menu:[Yt("moveOnTab",!0),Dr("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),$t("markers",ni()),Yt("fakeFocus",!1),Yt("focusManager",Ii()),kr("onHighlight")]),Hd=w("alloy.menu-focus"),Pd=Sa({name:"Menu",configFields:Nd(),partFields:Ad(),factory:function(n,e,t,o){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Lu(n.menuBehaviours,[Qi.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),hf.config({store:{mode:"memory",initialValue:n.value}}),ed.config({find:mn.some}),jc.config(n.movement.config(n,n.movement))]),events:qo([Eo(_d(),function(e,t){var n=t.event;e.getSystem().getByDom(n.target).each(function(n){Qi.highlight(e,n),t.stop(),X(e,Hd(),{menu:e,item:n})})}),Eo(Md(),function(n,e){var t=e.event.item;Qi.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),zd=function(n,e){return n.components()},jd=Ao({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(n,e,t,o){kl(n,0,Qe,o)},prepend:function(n,e,t,o){kl(n,0,ye,o)},remove:Tl,replaceAt:Cl,replaceBy:function(e,n,t,o,r){return I(zd(e),o).bind(function(n){return Cl(e,0,0,n,r)})},set:function(i,n,e,u){var t,o,r,c;t=function(){var e,n,t,o,r=Z(u,i.getSystem().build);n=r,o=(e=i).components(),M((t=e).components(),function(n){return Ze(n.element)}),we(t.element),t.syncComponents(),M(H(o,n),function(n){ut(n),e.getSystem().removeFromWorld(n)}),M(n,function(n){n.getSystem().isConnected()?Te(e,n):(e.getSystem().addToWorld(n),Te(e,n),rt(e.element)&&ct(n)),e.syncComponents()})},o=i.element,r=tt(o),c=zo(r).bind(function(e){function n(n){return un(e,n)}var r,i;return n(o)?mn.some(o):(r=n,(i=function(n){for(var e=0;e");o[t[0]]=yo(t[1],n),o[t[1]]=yo(t[0],n)}),o},createBistate:function(n,e,t){return xo([{key:n,value:yo(e,t)},{key:e,value:yo(n,t)}])},createTristate:function(n,e,t,o){return xo([{key:n,value:xo([{key:e,value:o},{key:t,value:o}])},{key:e,value:xo([{key:n,value:o},{key:t,value:o}])},{key:t,value:xo([{key:n,value:o},{key:e,value:o}])}])}}}),Qd=ci("scrollable"),Zd=Qd,nm=function(n,e,t,o,r){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:r?[ci("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:ci("format-matches"),selected:t},itemBehaviours:or(r?[]:[Ar(n,function(n,e){(e?ii.on:ii.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:o},innerHtml:e}}]}},em=function(n,e,t,o){return{value:n,dom:{tag:"div"},components:[Qs.sketch({dom:{tag:"div",classes:[ci("styles-collapser")]},components:o?[{dom:{tag:"span",classes:[ci("styles-collapse-icon")]}},wl(n)]:[wl(n)],action:function(n){var e;o&&(e=t().get(n),Wd.collapseMenu(e))}}),{dom:{tag:"div",classes:[ci("styles-menu-items-container")]},components:[Pd.parts.items({})],behaviours:or([el("adhoc-scrollable-menu",[Yo(function(n,e){$r(n.element,"overflow-y","auto"),$r(n.element,"-webkit-overflow-scrolling","touch"),_l(n.element)}),Ko(function(n){Xr(n.element,"overflow-y"),Xr(n.element,"-webkit-overflow-scrolling"),Rl(n.element)})])])}],items:e,menuBehaviours:or([Jd.config({initialState:"after",routes:Jd.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},tm=function(n){return _(n,function(n,e){var t=Il(e);return{menus:co(n.menus,t.menus),items:[t.item].concat(n.items),expansions:co(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},om=function(n){return B(n,function(n){return(D(n)?om:Bl)(n)})},rm=function(n,e,t,o){n.dom.removeEventListener(e,t,o)},im=x,um=tinymce.util.Tools.resolve("tinymce.util.Delay"),cm=Jt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function am(n,e){var t=le(n);return"input"===t?mg.after(n):T(["br","img"],t)?0===e?mg.before(n):mg.after(n):mg.on(n,e)}function sm(n){return mn.from(n.getSelection())}function fm(n,e,t,o,r){var i=Gl(n,e,t,o,r);sm(n).each(function(n){n.removeAllRanges(),n.addRange(i)})}function lm(n,e,t,o,r){var i,u,c,a,s,f=(i=o,u=r,c=am(e,t),a=am(i,u),pg.relative(c,a));Xl(s=n,f).match({ltr:function(n,e,t,o){fm(s,n,e,t,o)},rtl:function(r,i,u,c){sm(s).each(function(n){if(n.setBaseAndExtent)n.setBaseAndExtent(r.dom,i,u.dom,c);else if(n.extend)try{t=u,o=c,(e=n).collapse(r.dom,i),e.extend(t.dom,o)}catch(n){fm(s,u,c,r,i)}else fm(s,u,c,r,i);var e,t,o})}})}function dm(n){if(0r.innerHeight||n.bottom>r.innerHeight?Math.min(t,n.bottom-r.innerHeight+50):0;0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),Rm(i,o.innerHeight)});return Rm(i,o.innerHeight),{toEditing:function(){!function(n){n.focus();var e=fe.fromDom(n.document.body);(zo().exists(function(n){return T(["input","textarea"],le(n))})?function(n){um.setTimeout(function(){n()},0)}:p)(function(){zo().each(Po),Ho(e)})}(r)},destroy:function(){n.unbind()}}}function Vm(t,o){function r(){s(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:r,throttle:function(){for(var n=[],e=0;e