!function(p){"use strict";var I=function(){for(var n=[],e=0;e "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return kt.objOf(yn(a,function(n){return n.fold(function(n,e,t,r){return Ct.field(n,t,r)},function(n,e){return Ct.state(n)})}))}}},zt=function(t,i){var e=function(n,e){return(o=Vt(t),{extract:function(t,r,n){var e=yn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return dt(e)},toString:function(){return"array("+o.toString()+")"},toDsl:function(){return kt.arrOf(o)}}).extract(n,h,e);var o};return{extract:function(t,r,o){var n=N(o);return e(t,n).bind(function(n){var e=yn(n,function(n){return Mt.field(n,n,it(),i)});return Ht(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"},toDsl:function(){return kt.setOf(t,i)}}},jt=A(Vt(et.value)),Lt=Mt.state,Ut=Mt.field,Pt=function(t,e,r,o,i){return wt(o,i).fold(function(){return n=o,e=i,At(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+It(n)});var n,e},function(n){return Ht(n).extract(t.concat(["branch: "+i]),e,r)})},$t=function(o,i){return{extract:function(e,t,r){return wt(r,o).fold(function(){return n=o,At(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Pt(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+N(i)},toDsl:function(){return kt.choiceOf(o,i)}}},Wt=Vt(et.value),Gt=function(n,e,t,r){return e.extract([n],t,r).fold(function(n){return et.error({input:r,errors:n})},et.value)},_t=function(n,e,t){return Gt(n,e,A,t)},qt=function(n){return n.fold(function(n){throw new Error(Xt(n))},h)},Yt=function(n,e,t){return qt(Gt(n,e,h,t))},Kt=function(n,e,t){return qt(_t(n,e,t))},Xt=function(n){return"Errors: \n"+(e=n.errors,t=10 ")+")\n"+n.getErrorInfo()}))+"\n\nInput object: "+It(n.input);var e,t},Jt=function(n,e){return $t(n,e)},Qt=A(Wt),Zt=(i=x,u="function",Vt(function(n){var e=typeof n;return i(n)?et.value(n):et.error("Expected type: "+u+" but got: "+e)})),nr=function(n){return Ut(n,n,it(),jt())},er=function(n,e){return Ut(n,n,it(),e)},tr=function(n){return er(n,Zt)},rr=function(n,e){return Ut(n,n,it(),Ht(e))},or=function(n){return Ut(n,n,ut(),jt())},ir=function(n,e){return Ut(n,n,ut(),Ht(e))},ur=function(n,e){return Ut(n,n,ut(),Nt(e))},ar=function(n,e){return Ut(n,n,ot(e),jt())},cr=function(n,e,t){return Ut(n,n,ot(e),t)},sr=function(n,e){return Lt(n,e)},fr=function(n){if(!Ot(n,"can")&&!Ot(n,"abort")&&!Ot(n,"run"))throw new Error("EventHandler defined by: "+Dt(n,null,2)+" does not have can, abort, or run!");return Yt("Extracting event.handler",Nt([ar("can",A(!0)),ar("abort",A(!1)),ar("run",I)]),n)},lr=function(t){var e,r,o,i,n=(e=t,r=function(n){return n.can},function(){for(var t=[],n=0;n"),innerHtml:n.innerHtml().getOr(""),defChildren:n.defChildren().fold(function(){return""},function(n){return Dt(n,null,2)}),domChildren:n.domChildren().fold(function(){return""},function(n){return 0===n.length?"0 children, but still specified":String(n.length)})}},Er=Ee([],["classes","attributes","styles","value","innerHtml","defChildren","domChildren"]),Dr=function(e,n,t){return n.fold(function(){return t.fold(function(){return{}},function(n){return xt(e,n)})},function(n){return t.fold(function(){return xt(e,n)},function(n){return xt(e,n)})})},Ir=function(t,r,o){return xr(function(n,e){o(n,t,r)})},Ar=function(n,e,t,r,o,i){var u,a,c=n,s=ir(e,[(u="config",a=n,Ut(u,u,ut(),a))]);return Rr(c,s,e,t,r,o,i)},Mr=function(o,i,u){var n,e,t,r,a,c;return n=function(t){for(var n=[],e=1;e"}),Qt()),oc=ar("defaults",A({})),ic=ar("overrides",A({})),uc=Ht([nc,ec,tc,rc,oc,ic]),ac=Ht([nc,ec,tc,rc,oc,ic]),cc=Ht([nc,ec,tc,nr("unit"),rc,oc,ic]),sc=function(n){var e=function(n){return n.name()};return n.fold(e,e,e,e)},fc=function(t,r){return function(n){var e=Kt("Converting part type",r,n);return t(e)}},lc=fc(Za.required,uc),dc=fc(Za.optional,ac),mc=fc(Za.group,cc),gc=A("entirety"),vc=function(n,e,t,r){var o=t;return C(e.defaults()(n,t,r),t,{uid:n.partUids()[e.name()]},e.overrides()(n,t,r),{"debug.sketcher":xt("part-"+e.name(),o)})},pc=function(o,n){var i={};return wn(n,function(n){var e;(e=n,e.fold(V.some,V.none,V.some,V.some)).each(function(t){var r=hc(o,t.pname());i[t.name()]=function(n){var e=Yt("Part: "+t.name()+" in "+o,Ht(t.schema()),n);return C(r,{config:n,validated:e})}})}),i},hc=function(n,e){return{uiType:Xa(),owner:n,name:e}},bc=function(n,e,t){return r=e,i={},o={},wn(t,function(n){n.fold(function(r){i[r.pname()]=Ya(!0,function(n,e,t){return r.factory().sketch(vc(n,r,e,t))})},function(n){var e=r.parts()[n.name()]();o[n.name()]=A(vc(r,n,e[gc()]()))},function(r){i[r.pname()]=Ya(!1,function(n,e,t){return r.factory().sketch(vc(n,r,e,t))})},function(o){i[o.pname()]=Ka(!0,function(e,n,t){var r=e[o.name()]();return yn(r,function(n){return o.factory().sketch(C(o.defaults()(e,n),n,o.overrides()(e,n)))})})})}),{internals:A(i),externals:A(o)};var r,i,o},yc=function(n,e,t){return qa(V.some(n),e,e.components(),t)},wc=function(n,e,t){var r=e.partUids()[t];return n.getSystem().getByUid(r).toOption()},xc=function(n,e,t){return wc(n,e,t).getOrDie("Could not find part: "+t)},Sc=function(e,n){var t=yn(n,sc);return St(yn(t,function(n){return{key:n,value:e+"-"+n}}))},Tc=function(e){return Ut("partUids","partUids",ct(function(n){return Sc(n.uid,e)}),Qt())},Oc=Qa("alloy-premade"),kc=Qa("api"),Cc=function(n){return xt(Oc,n)},Ec=function(o){return n=function(n){for(var e=[],t=1;t'),action:e,buttonBehaviours:C(Ur([$c.config({})]),t)})},Kc={forToolbar:Yc,forToolbarCommand:function(n,e){return Yc(e,function(){n.execCommand(e)},{})},forToolbarStateAction:function(n,e,t,r){var o=qc(t);return Yc(e,r,o)},forToolbarStateCommand:function(n,e){var t=qc(e);return Yc(e,function(){n.execCommand(e)},t)}},Xc=function(t,r){return{left:A(t),top:A(r),translate:function(n,e){return Xc(t+n,r+e)}}},Jc=Xc,Qc=function(n,e,t){return Math.max(e,Math.min(t,n))},Zc=function(n,e,t,r,o,i,u){var a=t-e;if(rn.right)return t+1;var c,s,f,l,d=Math.min(n.right,Math.max(r,n.left))-n.left,m=Qc(d/n.width*a+e,e-1,t+1),g=Math.round(m);return i&&e<=m&&m<=t?(c=m,s=e,f=t,l=o,u.fold(function(){var n=c-s,e=Math.round(n/l)*l;return Qc(s+e,s-1,f+1)},function(n){var e=(c-n)%l,t=Math.round(e/l),r=Math.floor((c-n)/l),o=Math.floor((f-n)/l),i=n+Math.min(o,r+t)*l;return Math.max(n,i)})):g},ns="slider.change.value",es=Wn.detect().deviceType.isTouch(),ts=function(n){return function(n){var e=n.event().raw();if(es){var t=e;return t.touches!==undefined&&1===t.touches.length?V.some(t.touches[0]).map(function(n){return Jc(n.clientX,n.clientY)}):V.none()}var r=e;return r.clientX!==undefined?V.some(r).map(function(n){return Jc(n.clientX,n.clientY)}):V.none()}(n).map(function(n){return n.left()})},rs=function(n,e){ie(n,ns,{value:e})},os=function(i,u,a,n){return ts(n).map(function(n){var e,t,r,o;return e=i,r=n,o=Zc(a,(t=u).min(),t.max(),r,t.stepSize(),t.snapToGrid(),t.snapStart()),rs(e,o),n})},is=function(n,e){var t,r,o,i,u=(t=e.value().get(),r=e.min(),o=e.max(),i=e.stepSize(),tr.max()?wc(e,r,"right-edge").fold(function(){return t.width},function(n){return f(n)-t.left}):(r.value().get()-r.min())/s*t.width);return i.left-u.left+a},u=function(n){var e=i(n),t=o(n),r=Es(t.element())/2;Si(t.element(),"left",e-r+"px")},r=function(n,e){var t=c.value().get(),r=o(n);return t!==e||Ci(r.element(),"left").isNone()?(c.value().set(e),u(n),c.onChange()(n,r,e),V.some(!0)):V.none()},a=Ds?[gr(U(),function(n,e){c.onDragStart()(n,o(n))}),gr($(),function(n,e){c.onDragEnd()(n,o(n))})]:[gr(W(),function(n,e){e.stop(),c.onDragStart()(n,o(n)),c.mouseIsDown().set(!0)}),gr(_(),function(n,e){c.onDragEnd()(n,o(n)),c.mouseIsDown().set(!1)})];return{uid:c.uid(),dom:c.dom(),components:n,behaviours:C(Ur(Dn([Ds?[]:[La.config({mode:"special",focusIn:function(n){return wc(n,c,"spectrum").map(La.focusIn).map(A(!0))}})],[Ss.config({store:{mode:"manual",getValue:function(n){return c.value().get()}}})]])),Pa(c.sliderBehaviours())),events:dr([gr(ns,function(n,e){r(n,e.event().value())}),yr(function(n,e){c.value().set(c.getInitialValue()());var t=o(n);u(n),c.onInit()(n,t,c.value().get())})].concat(a)),apis:{resetToMin:function(n){r(n,c.min())},resetToMax:function(n){r(n,c.max())},refresh:u},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),As=function(e,t,r){return Kc.forToolbar(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{})},Ms=function(n){return[(o=n,i=function(n){return n<0?"black":360'),components:[Is.parts()["left-edge"](_c('
')),Is.parts().spectrum({dom:Gc('
'),components:[_c('
')],behaviours:Ur([si.config({toggleClass:gi.resolve("thumb-active")})])}),Is.parts()["right-edge"](_c('
')),Is.parts().thumb({dom:Gc('
'),behaviours:Ur([si.config({toggleClass:gi.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t);Si(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){si.on(e)},onDragEnd:function(n,e){si.off(e)},onInit:function(n,e,t){var r=i(t);Si(e.element(),"background-color",r)},stepSize:10,min:0,max:360,getInitialValue:o.getInitialValue,sliderBehaviours:Ur([li(Is.refresh)])}))];var o,i},Bs=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return As(n,"color",function(){return Ms(e)})},Rs=Nt([nr("getInitialValue"),nr("onChange"),nr("category"),nr("sizes")]),Fs=function(n){var o=Yt("SizeSlider",Rs,n);return Is.sketch({dom:{tag:"div",classes:[gi.resolve("slider-"+o.category+"-size-container"),gi.resolve("slider"),gi.resolve("slider-size-container")]},onChange:function(n,e,t){var r;0<=(r=t)&&r'),components:[_c('
')]}),Is.parts().thumb({dom:Gc('
'),behaviours:Ur([si.config({toggleClass:gi.resolve("thumb-active")})])})]})},Vs=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Ns=function(n){var e,t,r=n.selection.getStart(),o=fe.fromDom(r),i=fe.fromDom(n.getBody()),u=(e=function(n){return He(i,n)},(pe(t=o)?V.some(t):je(t)).map(function(n){return vo(n,function(n){return Ci(n,"font-size").isSome()},e).bind(function(n){return Ci(n,"font-size")}).getOrThunk(function(){return Oi(n,"font-size")})}).getOr(""));return On(Vs,function(n){return u===n}).getOr("medium")},Hs={candidates:A(Vs),get:function(n){var e,t=Ns(n);return(e=t,kn(Vs,function(n){return n===e})).getOr(2)},apply:function(r,n){var e;(e=n,V.from(Vs[e])).each(function(n){var e,t;t=n,Ns(e=r)!==t&&e.execCommand("fontSize",!1,t)})}},zs=Hs.candidates(),js=function(n){return[_c(''),(e=n,Fs({onChange:e.onChange,sizes:zs,category:"font",getInitialValue:e.getInitialValue})),_c('')];var e},Ls=function(n){var e=n.uid!==undefined&&Ot(n,"uid")?n.uid:Fc("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).fold(V.none,V.some)},asSpec:function(){return C(n,{uid:e})}}};function Us(n,e){return $s(p.document.createElement("canvas"),n,e)}function Ps(n){return n.getContext("2d")}function $s(n,e,t){return n.width=e,n.height=t,n}var Ws={create:Us,clone:function(n){var e;return Ps(e=Us(n.width,n.height)).drawImage(n,0,0),e},resize:$s,get2dContext:Ps,get3dContext:function(n){var e=null;try{e=n.getContext("webgl")||n.getContext("experimental-webgl")}catch(t){}return e||(e=null),e}},Gs={getWidth:function(n){return n.naturalWidth||n.width},getHeight:function(n){return n.naturalHeight||n.height}},_s=window.Promise?window.Promise:function(){var n=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],s(n,r(o,this),r(u,this))},e=n.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){p.setTimeout(n,1)};function r(n,e){return function(){n.apply(e,arguments)}}var t=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function i(r){var o=this;null!==this._state?e(function(){var n=o._state?r.onFulfilled:r.onRejected;if(null!==n){var e;try{e=n(o._value)}catch(t){return void r.reject(t)}r.resolve(e)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void s(r(e,n),r(o,this),r(u,this))}this._state=!0,this._value=n,a.call(this)}catch(t){u.call(this,t)}}function u(n){this._state=!1,this._value=n,a.call(this)}function a(){for(var n=0,e=this._deferreds.length;n'),components:[e.asSpec()],action:function(n){e.get(n).element().dom().click()}})},df=function(n){return n.dom().textContent},mf=function(n){return 0'),action:function(n){var e=t.get(n);Ss.setValue(e,"")}}));return{name:n,spec:kf.sketch({dom:Gc('
'),components:[t.asSpec(),r.asSpec()],containerBehaviours:Ur([si.config({toggleClass:gi.resolve("input-container-empty")}),Of.config({find:function(n){return V.some(t.get(n))}}),xf("input-clearing",[gr(K(),function(n){var e=t.get(n);(0"},Jf=function(o,n,e){return C({"debug.sketcher":{Form:e},uid:o.uid(),dom:o.dom(),components:n,behaviours:C(Ur([Ss.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),z(e.partUids(),function(n,e){return A(t.getByUid(n))}));return z(r,function(n,e){return n().bind(Of.getCurrent).map(Ss.getValue)})},setValue:function(t,n){H(n,function(e,n){wc(t,o,n).each(function(n){Of.getCurrent(n).each(function(n){Ss.setValue(n,e)})})})}}})]),Pa(o.formBehaviours())),apis:{getField:function(n,e){return wc(n,o,e).bind(Of.getCurrent)}}})},Qf=(Ec(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Xf(n),o=e,{uiType:Xa(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=yn(r,function(n){return lc({name:n,pname:Xf(n)})});return Nc("form",Kf,o,Jf,t)}),Zf=function(){var e=lo(V.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(V.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(V.some(n))},run:function(n){e.get().each(n)}}},nl=function(){var e=lo(V.none());return{clear:function(){e.set(V.none())},set:function(n){e.set(V.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},el=function(n){return{xValue:n,points:[]}},tl=function(n,e){if(e===n.xValue)return n;var t=0'),action:function(n){ie(n,r,{direction:e})},buttonBehaviours:Ur([Yf.config({disableClass:gi.resolve("toolbar-navigation-disabled"),disabled:!t})])})},i=function(n,o){var i=Ni(n.element(),"."+gi.resolve("serialised-dialog-screen"));ji(n.element(),"."+gi.resolve("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o'),components:[kf.sketch({dom:Gc('
'),components:yn(u.fields,function(n,e){return e<=u.maxFieldIndex?kf.sketch({dom:Gc('
'),components:Dn([[o(-1,"previous",0'),behaviours:Ur([cu.config({highlightClass:gi.resolve("dot-active"),itemClass:gi.resolve("dot-item")})]),components:In(u.fields,function(n,e){return e<=u.maxFieldIndex?[_c('
')]:[]})});return{dom:Gc('
'),components:[c.asSpec(),s.asSpec()],behaviours:Ur([La.config({mode:"special",focusIn:function(n){var e=c.get(n);La.focusIn(e)}}),xf("serializer-wrapper-events",[gr(U(),function(n,e){var t=e.event();u.state.dialogSwipeState.set(el(t.touches[0].clientX))}),gr(P(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(tl(n,t.raw().touches[0].clientX))})}),gr($(),function(r){u.state.dialogSwipeState.on(function(n){var e=c.get(r),t=-1*rl(n);i(e,t)})})])])}},il=nn(function(t,r){return[{label:"the link group",items:[ol({fields:[Vf("url","Type or paste URL"),Vf("text","Link text"),Vf("title","Link title"),Vf("target","Link target"),(n="link",{name:n,spec:Cf.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return V.none()}})})],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return V.some(hf.getInfo(r))},onExecute:function(n){var e=Ss.getValue(n);hf.applyInfo(r,e),t.restoreToolbar(),r.focus()}})]}];var n}),ul=[{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",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],al=dr([(nf=_n(),ef=function(n,e){var t,r,o=e.event().originator(),i=e.event().target();return r=i,!(He(t=o,n.element())&&!He(t,r)&&(p.console.warn(_n()+" did not get interpreted by the desired target. \nOriginator: "+Io(o)+"\nTarget: "+Io(i)+"\nCheck the "+_n()+" event handlers"),1))},{key:nf,value:fr({can:ef})})]),cl=Object.freeze({events:al}),sl=h,fl=zr(["debugInfo","triggerFocus","triggerEvent","triggerEscape","addToWorld","removeFromWorld","addToGui","removeFromGui","build","getByUid","getByDom","broadcast","broadcastOn","isConnected"]),ll=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Io(e().element())+" is not in context.")}};return fl({debugInfo:A("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),isConnected:A(!1)})},dl=function(n,o){var i={};return H(n,function(n,r){H(n,function(n,e){var t=yt(e,[])(i);i[e]=t.concat([o(r,n)])})}),i},ml=function(n,e){return 1 "):r[0].name();return xt(o,{handler:e,purpose:A(t)})})});return Tt(e,{})},Tl=function(n){return _t("custom.definition",Nt([Ut("dom","dom",it(),Nt([nr("tag"),ar("styles",{}),ar("classes",[]),ar("attributes",{}),or("value"),or("innerHtml")])),nr("components"),nr("uid"),ar("events",{}),ar("apis",A({})),Ut("eventOrder","eventOrder",(e={"alloy.execute":["disabling","alloy.base.behaviour","toggling"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing"]},rt.mergeWithThunk(A(e))),Qt()),or("domModification"),Ko("originalSpec"),ar("debug.sketcher","unknown")]),n);var e},Ol=function(n){var e,t={tag:n.dom().tag(),classes:n.dom().classes(),attributes:C((e=n,xt(Ac(),e.uid())),n.dom().attributes()),styles:n.dom().styles(),domChildren:yn(n.components(),function(n){return n.element()})};return kr(C(t,n.dom().innerHtml().map(function(n){return xt("innerHtml",n)}).getOr({}),n.dom().value().map(function(n){return xt("value",n)}).getOr({})))},kl=function(e,n){wn(n,function(n){ro(e,n)})},Cl=function(e,n){wn(n,function(n){oo(e,n)})},El=function(e){if(e.domChildren().isSome()&&e.defChildren().isSome())throw new Error("Cannot specify children and child specs! Must be one or the other.\nDef: "+(n=Cr(e),Dt(n,null,2)));return e.domChildren().fold(function(){var n=e.defChildren().getOr([]);return yn(n,Il)},function(n){return n});var n},Dl=function(n){var e=fe.fromTag(n.tag());Yr(e,n.attributes().getOr({})),kl(e,n.classes().getOr([])),Ti(e,n.styles().getOr({})),Co(e,n.innerHtml().getOr(""));var t=El(n);return We(e,t),n.value().each(function(n){Df(e,n)}),e},Il=function(n){var e=kr(n);return Dl(e)},Al=function(n,e){return t=n,o=yn(r=e,function(n){return ir(n.name(),[nr("config"),ar("state",jr)])}),i=_t("component.behaviours",Ht(o),t.behaviours).fold(function(n){throw new Error(Xt(n)+"\nComplete spec:\n"+Dt(t,null,2))},function(n){return n}),{list:r,data:z(i,function(n){var e=n().map(function(n){return{config:n.config(),state:n.state().init(n.config())}});return function(){return e}})};var t,r,o,i},Ml=function(n){var e,t,r=(e=wt(n,"behaviours").getOr({}),t=xn(N(e),function(n){return e[n]!==undefined}),yn(t,function(n){return e[n].me}));return Al(n,r)},Bl=zr(["getSystem","config","hasConfigured","spec","connect","disconnect","element","syncComponents","readState","components","events"]),Rl=function(n,e,t){var r,o,i,u,a=Ol(n),c=function(e,n,t,r){var o=C({},n);wn(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=dl(o,function(n,e){return{name:function(){return n},modification:e}}),u=z(i,function(n,e){return In(n,function(e){return e.modification().fold(function(){return[]},function(n){return[e]})})}),a=L(u,function(e,t){return wt(vl,t).fold(function(){return et.error("Unknown field type: "+t)},function(n){return n(e,t)})});return Tt(a,{}).map(Er)}(t,{"alloy.base.modification":(r=n,r.domModification().fold(function(){return Er({})},Er))},e,a).getOrDie();return i=c,u=C({tag:(o=a).tag(),classes:i.classes().getOr([]).concat(o.classes().getOr([])),attributes:E(o.attributes().getOr({}),i.attributes().getOr({})),styles:E(o.styles().getOr({}),i.styles().getOr({}))},i.innerHtml().or(o.innerHtml()).map(function(n){return xt("innerHtml",n)}).getOr({}),Dr("domChildren",i.domChildren(),o.domChildren()),Dr("defChildren",i.defChildren(),o.defChildren()),i.value().or(o.value()).map(function(n){return xt("value",n)}).getOr({})),kr(u)},Fl=function(n,e,t){var r,o,i,u,a,c,s={"alloy.base.behaviour":(r=n,r.events())};return(o=t,i=n.eventOrder(),u=e,a=s,c=yl(o,u,a),Sl(c,i)).getOrDie()},Vl=function(n){var e,t,r,o,i,u,a,c,s,f,l,d,m,g,v=sl(n),p=(e=v,t=yt("components",[])(e),yn(t,zl)),h=C(cl,v,xt("components",p));return et.value((r=h,i=lo(ll(o=function(){return g})),u=qt(Tl(C(r,{behaviours:undefined}))),a=Ml(r),c=a.list,s=a.data,f=Rl(u,c,s),l=Dl(f),d=Fl(u,c,s),m=lo(u.components()),g=Bl({getSystem:i.get,config:function(n){if(n===Dc())return u.apis();if(b(n))throw new Error("Invalid input: only API constant is allowed");var e=s;return(x(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+Dt(r,null,2))})()},hasConfigured:function(n){return x(s[n.name()])},spec:A(r),readState:function(n){return s[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},connect:function(n){i.set(n)},disconnect:function(){i.set(ll(o))},element:A(l),syncComponents:function(){var n=Le(l),e=In(n,function(n){return i.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});m.set(e)},components:m.get,events:A(d)})))},Nl=function(n){var e=fe.fromText(n);return Hl({element:e})},Hl=function(n){var t=Kt("external.component",Nt([nr("element"),or("uid")]),n),e=lo(ll());t.uid().each(function(n){var e;e=t.element(),qr(e,Bc,n)});var r=Bl({getSystem:e.get,config:V.none,hasConfigured:A(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(ll(function(){return r}))},element:A(t.element()),spec:A(n),readState:A("No state"),syncComponents:I,components:A([]),events:A({})});return Cc(r)},zl=function(e){return(n=e,wt(n,Oc)).fold(function(){var n=C({uid:Fc("")},e);return Vl(n).getOrDie()},function(n){return n});var n},jl=Cc,Ll="alloy.item-hover",Ul="alloy.item-focus",Pl=function(n){(wo(n.element()).isNone()||yi.isFocused(n))&&(yi.isFocused(n)||yi.focus(n),ie(n,Ll,{item:n}))},$l=function(n){ie(n,Ul,{item:n})},Wl=A(Ll),Gl=A(Ul),_l=[nr("data"),nr("components"),nr("dom"),or("toggling"),ar("itemBehaviours",{}),ar("ignoreFocus",!1),ar("domModification",{}),Yo("builder",function(n){return{dom:C(n.dom(),{attributes:{role:n.toggling().isSome()?"menuitemcheckbox":"menuitem"}}),behaviours:C(Ur([n.toggling().fold(si.revoke,function(n){return si.config(C({aria:{mode:"checked"}},n))}),yi.config({ignore:n.ignoreFocus(),onFocus:function(n){$l(n)}}),La.config({mode:"execution"}),Ss.config({store:{mode:"memory",initialValue:n.data()}})]),n.itemBehaviours()),events:dr([(e=Qn(),r=ue,gr(e,function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){r(e,n,t)})})),br(W()),gr(q(),Pl),gr(Xn(),yi.focus)]),components:n.components(),domModification:n.domModification(),eventOrder:n.eventOrder()};var e,r}),ar("eventOrder",{})],ql=[nr("dom"),nr("components"),Yo("builder",function(n){return{dom:n.dom(),components:n.components(),events:dr([(e=Xn(),gr(e,function(n,e){e.stop()}))])};var e})],Yl=A([lc({name:"widget",overrides:function(e){return{behaviours:Ur([Ss.config({store:{mode:"manual",getValue:function(n){return e.data()},setValue:function(){}}})])}}})]),Kl=[nr("uid"),nr("data"),nr("components"),nr("dom"),ar("autofocus",!1),ar("domModification",{}),Tc(Yl()),Yo("builder",function(t){var n=bc(0,t,Yl()),e=yc("item-widget",t,n.internals()),r=function(n){return wc(n,t,"widget").map(function(n){return La.focusIn(n),n})},o=function(n,e){return gu(e.event().target())||t.autofocus()&&e.setSource(n.element()),V.none()};return C({dom:t.dom(),components:e,domModification:t.domModification(),events:dr([Sr(function(n,e){r(n).each(function(n){e.stop()})}),gr(q(),Pl),gr(Xn(),function(n,e){t.autofocus()?r(n):yi.focus(n)})]),behaviours:Ur([Ss.config({store:{mode:"memory",initialValue:t.data()}}),yi.config({onFocus:function(n){$l(n)}}),La.config({mode:"special",focusIn:t.autofocus()?function(n){r(n)}:Gr(),onLeft:o,onRight:o,onEscape:function(n,e){return yi.isFocused(n)||t.autofocus()?(t.autofocus()&&e.setSource(n.element()),V.none()):(yi.focus(n),V.some(!0))}})])})})],Xl=Jt("type",{widget:Kl,item:_l,separator:ql}),Jl=A([mc({factory:{sketch:function(n){var e=Kt("menu.spec item",Xl,n);return e.builder()(e)}},name:"items",unit:"item",defaults:function(n,e){var t=Fc("");return C({uid:t},e)},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus(),domModification:{classes:[n.markers().item()]}}}})]),Ql=A([nr("value"),nr("items"),nr("dom"),nr("components"),ar("eventOrder",{}),Ua("menuBehaviours",[cu,Ss,Of,La]),cr("movement",{mode:"menu",moveOnTab:!0},Jt("mode",{grid:[Xo(),Yo("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers().item(),initSize:{numColumns:e.initSize().numColumns(),numRows:e.initSize().numRows()},focusManager:n.focusManager()}})],menu:[ar("moveOnTab",!0),Yo("config",function(n,e){return{mode:"menu",selector:"."+n.markers().item(),moveOnTab:e.moveOnTab(),focusManager:n.focusManager()}})]})),er("markers",Uo()),ar("fakeFocus",!1),ar("focusManager",su()),Wo("onHighlight")]),Zl=A("alloy.menu-focus"),nd=Uc({name:"Menu",configFields:Ql(),partFields:Jl(),factory:function(n,e,t,r){return C({dom:C(n.dom(),{attributes:{role:"menu"}}),uid:n.uid(),behaviours:C(Ur([cu.config({highlightClass:n.markers().selectedItem(),itemClass:n.markers().item(),onHighlight:n.onHighlight()}),Ss.config({store:{mode:"memory",initialValue:n.value()}}),Of.config({find:V.some}),La.config(n.movement().config()(n,n.movement()))]),Pa(n.menuBehaviours())),events:dr([gr(Gl(),function(e,t){var n=t.event();e.getSystem().getByDom(n.target()).each(function(n){cu.highlight(e,n),t.stop(),ie(e,Zl(),{menu:e,item:n})})}),gr(Wl(),function(n,e){var t=e.event().item();cu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder()})}}),ed=function(n,e,t,r){var o=n.getSystem().build(r);Xe(n,o,t)},td=function(n,e){return n.components()},rd=$r({fields:[],name:"replacing",apis:Object.freeze({append:function(n,e,t,r){ed(n,0,$e,r)},prepend:function(n,e,t,r){ed(n,0,Pe,r)},remove:function(n,e,t,r){var o=td(n,e);On(o,function(n){return He(r.element(),n.element())}).each(Qe)},set:function(e,n,t,r){var o,i,u,a,c,s;i=(o=e).components(),wn(i,Je),Ge(o.element()),o.syncComponents(),u=function(){var n=yn(r,e.getSystem().build);wn(n,function(n){Ke(e,n)})},a=e.element(),c=ze(a),s=yo(c).bind(function(e){var n=function(n){return He(e,n)};return n(a)?V.some(a):po(a,n)}),u(a),s.each(function(e){yo(c).filter(function(n){return He(n,e)}).fold(function(){ho(e)},I)})},contents:td})}),od=function(t,r,o,n){return wt(o,n).bind(function(n){return wt(t,n).bind(function(n){var e=od(t,r,o,n);return V.some([n].concat(e))})}).getOr([])},id=function(n,e){var t={};H(n,function(n,e){wn(n,function(n){t[n]=e})});var r=e,o=j(e,function(n,e){return{k:n,v:e}}),i=z(o,function(n,e){return[e].concat(od(t,r,o,e))});return z(t,function(n){return wt(i,n).getOr([n])})},ud=function(){var i=lo({}),u=lo({}),a=lo({}),c=lo(V.none()),s=lo({}),n=function(n){return wt(u.get(),n)};return{setContents:function(n,e,t,r){c.set(V.some(n)),i.set(t),u.set(e),s.set(r);var o=id(r,t);a.set(o)},expand:function(t){return wt(i.get(),t).map(function(n){var e=wt(a.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return wt(a.get(),n)},collapse:function(n){return wt(a.get(),n).bind(function(n){return 1");r[t[0]]=xt(t[1],n),r[t[1]]=xt(t[0],n)}),r},createBistate:function(n,e,t){return St([{key:n,value:xt(e,t)},{key:e,value:xt(n,t)}])},createTristate:function(n,e,t,r){return St([{key:n,value:St([{key:e,value:r},{key:t,value:r}])},{key:e,value:St([{key:n,value:r},{key:t,value:r}])},{key:t,value:St([{key:n,value:r},{key:e,value:r}])}])}}}),bd=gi.resolve("scrollable"),yd={register:function(n){ro(n,bd)},deregister:function(n){oo(n,bd)},scrollable:A(bd)},wd=function(n){return wt(n,"format").getOr(n.title)},xd=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[gi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:gi.resolve("format-matches"),selected:t},itemBehaviours:Ur(o?[]:[fi(n,function(n,e){(e?si.on:si.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},Sd=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Pc.sketch({dom:{tag:"div",classes:[gi.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[gi.resolve("styles-collapse-icon")]}},Nl(n)]:[Nl(n)],action:function(n){if(r){var e=t().get(n);cd.collapseMenu(e)}}}),{dom:{tag:"div",classes:[gi.resolve("styles-menu-items-container")]},components:[nd.parts().items({})],behaviours:Ur([xf("adhoc-scrollable-menu",[yr(function(n,e){Si(n.element(),"overflow-y","auto"),Si(n.element(),"-webkit-overflow-scrolling","touch"),yd.register(n.element())}),wr(function(n){Ei(n.element(),"overflow-y"),Ei(n.element(),"-webkit-overflow-scrolling"),yd.deregister(n.element())})])])}],items:e,menuBehaviours:Ur([hd.config({initialState:"after",routes:hd.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Td=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return a},n=Sd("Styles",[].concat(yn(o.items,function(n){return xd(wd(n),n.title,n.isSelected(),n.getPreview(),Ot(o.expansions,wd(n)))})),i,!1),e=z(o.menus,function(n,e){var t=yn(n,function(n){return xd(wd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Ot(o.expansions,wd(n)))});return Sd(e,t,i,!0)}),t=C(e,xt("styles",n)),{tmenu:cd.tieredData("styles",t,o.expansions)}),a=Ls(cd.sketch({dom:{tag:"div",classes:[gi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Ss.getValue(e);return r.handle(e,t.value),V.none()},onEscape:function(){return V.none()},onOpenMenu:function(n,e){var t=Es(n.element());Cs(e.element(),t),hd.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=Es(n.element()),o=zi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();Cs(t.element(),r),hd.progressTo(i,"before"),hd.jumpTo(t,"after"),hd.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=zi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();hd.progressTo(o,"after"),hd.progressTo(t,"current")},navigateOnHover:!1,openImmediately:!0,data:u.tmenu,markers:{backgroundMenu:gi.resolve("styles-background-menu"),menu:gi.resolve("styles-menu"),selectedMenu:gi.resolve("styles-selected-menu"),item:gi.resolve("styles-item"),selectedItem:gi.resolve("styles-selected-item")}}));return a.asSpec()},Od=function(n){return Ot(n,"items")?(t=C(ht(e=n,["items"]),{menu:!0}),r=kd(e.items),{item:t,menus:C(r.menus,xt(e.title,r.items)),expansions:C(r.expansions,xt(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},kd=function(n){return Sn(n,function(n,e){var t=Od(e);return{menus:C(n.menus,t.menus),items:[t.item].concat(n.items),expansions:C(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},Cd={expand:kd},Ed=function(u,n){var a=function(n){return function(){return u.formatter.match(n)}},c=function(n){return function(){return u.formatter.getCssText(n)}},e=wt(n,"style_formats").getOr(ul),s=function(n){return yn(n,function(n){if(Ot(n,"items")){var e=s(n.items);return C(C(n,{isSelected:A(!1),getPreview:A("")}),{items:e})}return Ot(n,"format")?C(i=n,{isSelected:a(i.format),getPreview:c(i.format)}):(r=Qa((t=n).title),o=C(t,{format:r,isSelected:a(r),getPreview:c(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return s(e)},Dd=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return In(n,function(n){return n.items!==undefined?0e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!==t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0===Yd?[]:[jd(fe.fromDom(r.win()),"blur",function(){t.getByDom(e).each(si.off)}),jd(i,"select",n),jd(r.doc(),"selectionchange",n)]);return{destroy:function(){wn(a,function(n){n.unbind()})}}},Xd=function(n,e){var t=parseInt(Kr(n,e),10);return isNaN(t)?0:t},Jd=(tf=he,rf="text",of=function(n){return tf(n)?V.from(n.dom().nodeValue):V.none()},uf=Wn.detect().browser,{get:function(n){if(!tf(n))throw new Error("Can only get "+rf+" value of a "+rf+" node");return af(n).getOr("")},getOption:af=uf.isIE()&&10===uf.version.major?function(n){try{return of(n)}catch(e){return V.none()}}:of,set:function(n,e){if(!tf(n))throw new Error("Can only set raw "+rf+" value of a "+rf+" node");n.dom().nodeValue=e}}),Qd=function(n){return Jd.getOption(n)},Zd=tt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),nm={before:Zd.before,on:Zd.on,after:Zd.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(h,h,h)}},em=tt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),tm=xe("start","soffset","finish","foffset"),rm=em.relative,om=em.exact,im=function(n,e,t,r){var o,i,u,a,c,s=(i=e,u=t,a=r,(c=ze(o=n).dom().createRange()).setStart(o.dom(),i),c.setEnd(u.dom(),a),c),f=He(n,t)&&e===r;return s.collapsed&&!f},um=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},am=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},cm=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},sm=tt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),fm=function(n,e,t){return e(fe.fromDom(t.startContainer),t.startOffset,fe.fromDom(t.endContainer),t.endOffset)},lm=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:A(n),rtl:V.none}},relative:function(n,e){return{ltr:nn(function(){return um(o,n,e)}),rtl:nn(function(){return V.some(um(o,e,n))})}},exact:function(n,e,t,r){return{ltr:nn(function(){return am(o,n,e,t,r)}),rtl:nn(function(){return V.some(am(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return sm.rtl(fe.fromDom(n.endContainer),n.endOffset,fe.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return fm(0,sm.ltr,r)}):fm(0,sm.ltr,r)},dm=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(n,e){var t=ge(n);return"input"===t?nm.after(n):bn(["br","img"],t)?0===e?nm.before(n):nm.after(n):nm.on(n,e)}),mm=function(n,e,t,r,o){var i,u,a=am(n,e,t,r,o);i=n,u=a,V.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},gm=function(n,e,t,r,o){var i,u,a,c,l,s=(i=r,u=o,a=dm(e,t),c=dm(i,u),rm(a,c));lm(l=n,s).match({ltr:function(n,e,t,r){mm(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,a,c,s=l.getSelection();if(s.setBaseAndExtent)s.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(s.extend)try{i=n,u=e,a=t,c=r,(o=s).collapse(i.dom(),u),o.extend(a.dom(),c)}catch(f){mm(l,t,r,n,e)}else mm(l,t,r,n,e)}})},vm=function(n){var e=fe.fromDom(n.anchorNode),t=fe.fromDom(n.focusNode);return im(e,n.anchorOffset,t,n.focusOffset)?V.some(tm(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),Om(e,n.innerHeight)});return Om(e,n.innerHeight),{toEditing:function(){Sm(u)},destroy:function(){t.unbind()}}},Dm=function(n){return V.some(fe.fromDom(n.dom().contentWindow.document.body))},Im=function(n){return V.some(fe.fromDom(n.dom().contentWindow.document))},Am=function(n){return V.from(n.dom().contentWindow)},Mm=function(n){return Am(n).bind(pm)},Bm=function(n){return n.getFrame()},Rm=function(n,t){return function(e){return e[n].getOrThunk(function(){var n=Bm(e);return function(){return t(n)}})()}},Fm=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return jd(e,r,n)}})},Vm=function(n){return{left:A(n.left),top:A(n.top),right:A(n.right),bottom:A(n.bottom),width:A(n.width),height:A(n.height)}},Nm={getBody:Rm("getBody",Dm),getDoc:Rm("getDoc",Im),getWin:Rm("getWin",Am),getSelection:Rm("getSelection",Mm),getFrame:Bm,getActiveApi:function(a){var c=Bm(a);return Dm(c).bind(function(u){return Im(c).bind(function(i){return Am(c).map(function(o){var n=fe.fromDom(i.dom().documentElement),e=a.getCursorBox.getOrThunk(function(){return function(){return(n=o,pm(n).map(function(n){return om(n.start(),n.soffset(),n.finish(),n.foffset())})).bind(function(n){return hm(o,n).orThunk(function(){return pm(o).filter(function(n){return He(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0